001: /**
002: * LibreSource
003: * Copyright (C) 2004-2008 Artenum SARL / INRIA
004: * http://www.libresource.org - contact@artenum.com
005: *
006: * This file is part of the LibreSource software,
007: * which can be used and distributed under license conditions.
008: * The license conditions are provided in the LICENSE.TXT file
009: * at the root path of the packaging that enclose this file.
010: * More information can be found at
011: * - http://dev.libresource.org/home/license
012: *
013: * Initial authors :
014: *
015: * Guillaume Bort / INRIA
016: * Francois Charoy / Universite Nancy 2
017: * Julien Forest / Artenum
018: * Claude Godart / Universite Henry Poincare
019: * Florent Jouille / INRIA
020: * Sebastien Jourdain / INRIA / Artenum
021: * Yves Lerumeur / Artenum
022: * Pascal Molli / Universite Henry Poincare
023: * Gerald Oster / INRIA
024: * Mariarosa Penzi / Artenum
025: * Gerard Sookahet / Artenum
026: * Raphael Tani / INRIA
027: *
028: * Contributors :
029: *
030: * Stephane Bagnier / Artenum
031: * Amadou Dia / Artenum-IUP Blois
032: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033: */package org.libresource;
034:
035: import org.libresource.search.LibresourceIndexableContent;
036:
037: import org.libresource.xml.LibresourceExportHandler;
038: import org.libresource.xml.LibresourceImportHandler;
039:
040: import java.net.URI;
041:
042: import java.rmi.RemoteException;
043:
044: import javax.ejb.EJBException;
045: import javax.ejb.SessionBean;
046: import javax.ejb.SessionContext;
047:
048: /**
049: * LibreSource
050: *
051: * @author <a href="mailto:bort@loria.fr">Guillaume Bort</a> - <a
052: * href="http://www.inria.fr">INRIA Lorraine</a>
053: */
054: public abstract class LibresourceServiceBase implements SessionBean {
055: protected transient SessionContext ctx;
056:
057: // standard call back methods
058: public void setSessionContext(SessionContext c) {
059: ctx = c;
060: }
061:
062: public void unsetEntityContext() {
063: ctx = null;
064: }
065:
066: public void ejbActivate() throws EJBException, RemoteException {
067: }
068:
069: public void ejbPassivate() throws EJBException, RemoteException {
070: }
071:
072: public void ejbRemove() throws EJBException, RemoteException {
073: }
074:
075: public void ejbCreate() throws EJBException, RemoteException {
076: }
077:
078: // business methods
079: public abstract String getLibresourceServiceName();
080:
081: public abstract String[] getLibresourceServiceDepends();
082:
083: public boolean canMapResourceForSecurity(URI fromResource,
084: URI toResource) throws LibresourceException {
085: return false;
086: }
087:
088: public LibresourceIndexableContent getIndexableContent(
089: LibresourceResourceIdentifier resourceIdentifier)
090: throws LibresourceException {
091: return null;
092: }
093:
094: public LibresourceExportHandler getXmlExportHandlerForResource(
095: URI uri) throws LibresourceException {
096: return new LibresourceExportHandler();
097: }
098:
099: public LibresourceImportHandler getXmlImportHandler(String type)
100: throws LibresourceException {
101: return new LibresourceImportHandler();
102: }
103:
104: public String getShortResourceName(
105: LibresourceResourceIdentifier resourceIdentifier)
106: throws LibresourceException {
107: return Libresource.findResource(resourceIdentifier)
108: .getShortResourceName();
109: }
110:
111: public String[] listAvailablesPermissions(
112: LibresourceResourceIdentifier resourceIdentifier)
113: throws LibresourceException {
114: return null;
115: }
116:
117: public String[] listAvailablesEvents(
118: LibresourceResourceIdentifier resourceIdentifier)
119: throws LibresourceException {
120: return null;
121: }
122: }
|