se.kmr.scam.server.impl
Class ManifestBean

java.lang.Object
  extended byse.kmr.scam.server.impl.BeanCommon
      extended byse.kmr.scam.server.impl.ManifestBean
All Implemented Interfaces:
EnterpriseBean, ManifestI, Serializable, SessionBean

public class ManifestBean
extends BeanCommon
implements ManifestI, SessionBean

EJB-implementation of ManifestI jboss.xml: java:/jaas/other

Author:
Stefan, jand
See Also:
Serialized Form
Created:
den 6 augusti 2002

Field Summary
 
Fields inherited from class se.kmr.scam.server.impl.BeanCommon
ADMIN_ROLE, GUEST_ROLE
 
Fields inherited from interface se.kmr.scam.ManifestI
DEFAULT_ID
 
Constructor Summary
ManifestBean()
           
 
Method Summary
 Model addItem(String identity, String uri)
          Add an IMSCP.Item to an IMSCP Folder-Item at next possible ordinal.
 String createURI(String identity)
          Construct a URI.
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 String getDefaultOrg(String identity)
          Get the default IMSCP organization URI (IMSCP.Item).
 String getManifest(String identity)
          Get the IMSCP.Manifest URI.
 Model getModel(String identity, Collection uris)
          Get the combined sub-model of a collection of Resources.
 Model getModel(String identity, Model model)
          Get the complete sub-models of those components included in model.
 Model getModel(String identity, String uri)
          Get the sub-model of a Resource.
 String getParent(String identity, String uri)
          Get the IMSCP-parent URI referencing uri by RDF.li, or get the "first" content-Item referencing it by IMSCP.content.
protected  SessionContext getSessionContext()
          Get the sessioncontext
 void insert(String identity, Model model)
          Insert a sub-model into a Manifest.
 Model listReferences(String identity, String uri)
          List all references (Resources) to uri by IMSCP.content
 void move(String identity, Collection uris, String toUri)
          Move a collection of components (Items).
 void move(String identity, String uri, String toUri)
          Move a component (Item).
 void remove(String identity, String uri)
          Remove a component.
 void rename(String identity, String uri, String toUri)
          Rename a Resource (change URI).
 void setSessionContext(SessionContext sessionContext)
           
 
Methods inherited from class se.kmr.scam.server.impl.BeanCommon
abort, assertPermission, assertPermission, begin, close, commit, contains, create, filter, filter, getCaller, hasPermission, hasPermission, isCaller, isCallerInRole, list, lookup, open, open, remove, rollback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManifestBean

public ManifestBean()
Method Detail

getSessionContext

protected SessionContext getSessionContext()
Description copied from class: BeanCommon
Get the sessioncontext

Specified by:
getSessionContext in class BeanCommon
Returns:
the context

ejbCreate

public void ejbCreate()
               throws CreateException
Throws:
CreateException

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface SessionBean

setSessionContext

public void setSessionContext(SessionContext sessionContext)
Specified by:
setSessionContext in interface SessionBean

createURI

public String createURI(String identity)
                 throws ArchiveException
Construct a URI. Format: "scam://<identity>/<uid>"

Specified by:
createURI in interface ManifestI
Parameters:
identity - Manifest
Returns:
the URI
Throws:
ArchiveException
To do:
to ManifestI?

getParent

public String getParent(String identity,
                        String uri)
                 throws ArchiveException
Get the IMSCP-parent URI referencing uri by RDF.li, or get the "first" content-Item referencing it by IMSCP.content.

Specified by:
getParent in interface ManifestI
Parameters:
identity - Manifest
uri - Child-resource
Returns:
Parent-URI or null if none
Throws:
ArchiveException

getDefaultOrg

public String getDefaultOrg(String identity)
                     throws ArchiveException
Get the default IMSCP organization URI (IMSCP.Item).

Specified by:
getDefaultOrg in interface ManifestI
Parameters:
identity - Manifest
Returns:
default organization URI or null if none
Throws:
ArchiveException

getManifest

public String getManifest(String identity)
                   throws ArchiveException
Get the IMSCP.Manifest URI.

Specified by:
getManifest in interface ManifestI
Parameters:
identity - Manifest
Returns:
manifest URI or null if none
Throws:
ArchiveException

listReferences

public Model listReferences(String identity,
                            String uri)
                     throws ArchiveException
List all references (Resources) to uri by IMSCP.content

Specified by:
listReferences in interface ManifestI
Parameters:
identity - Default Manifest (null means "ALL-model")
uri - Resource
Returns:
a model with references
Throws:
ArchiveException

rename

public void rename(String identity,
                   String uri,
                   String toUri)
            throws ArchiveException
Rename a Resource (change URI).

Specified by:
rename in interface ManifestI
Parameters:
identity - Manifest
uri - Original URI
toUri - New URI
Throws:
ArchiveException

remove

public void remove(String identity,
                   String uri)
            throws ArchiveException
Remove a component. All references to this component will be removed in case uri is an IMS Item. All "child-Items" of this component will be removed. All annotations bound to removed component/s will be removed. If a component has file-content, it will also be removed.

Specified by:
remove in interface ManifestI
Parameters:
identity - Manifest
uri - Resource
Throws:
ArchiveException

move

public void move(String identity,
                 Collection uris,
                 String toUri)
          throws ArchiveException
Move a collection of components (Items).

Specified by:
move in interface ManifestI
Parameters:
identity - Manifest
uris - Collection of components (URI:s)
toUri - Destination Component (IMS Folder)
Throws:
ArchiveException

move

public void move(String identity,
                 String uri,
                 String toUri)
          throws ArchiveException
Move a component (Item).

Specified by:
move in interface ManifestI
Parameters:
identity - Manifest
uri - Component
toUri - Destination Component (IMS Folder)
Throws:
ArchiveException

addItem

public Model addItem(String identity,
                     String uri)
              throws ArchiveException
Add an IMSCP.Item to an IMSCP Folder-Item at next possible ordinal.

Specified by:
addItem in interface ManifestI
Parameters:
identity - Manifest
uri - Parent IMSCP Item (Folder)
Returns:
the Model of created Item
Throws:
ArchiveException

insert

public void insert(String identity,
                   Model model)
            throws ArchiveException
Insert a sub-model into a Manifest. All existing components will be overwritten. The model may contain links to other Manifests (by SCAM.inModel), in that case the insertion will be made there. Some IMSCP validation is made.
Note: The model passed in may be altered by this method!!! Only notable if client/repository in same JVM.

Specified by:
insert in interface ManifestI
Parameters:
identity - Manifest
model - New model
Throws:
ArchiveException

getModel

public Model getModel(String identity,
                      Model model)
               throws ArchiveException
Get the complete sub-models of those components included in model. This model may contain links to other Manifests, which will be fetched. In case a component is an IMS Content-Item, its content will also be fetched either from current Manifest or by the SCAM.inModel Manifest (link). All existing components will have a SCAM.inModel-property attached.

Specified by:
getModel in interface ManifestI
Parameters:
identity - Default Manifest (null means "ALL-model")
model - Model
Returns:
The combined sub-model
Throws:
ArchiveException

getModel

public Model getModel(String identity,
                      Collection uris)
               throws ArchiveException
Get the combined sub-model of a collection of Resources.

Specified by:
getModel in interface ManifestI
Parameters:
identity - Manifest
uris - Collection of resources (URI:s)
Returns:
The combined sub-model
Throws:
ArchiveException
See Also:
getModel(String, Model)

getModel

public Model getModel(String identity,
                      String uri)
               throws ArchiveException
Get the sub-model of a Resource.

Specified by:
getModel in interface ManifestI
Parameters:
identity - Manifest
uri - Resource
Returns:
The sub-model of uri
Throws:
ArchiveException
See Also:
getModel(String, Model)


Copyright © 2003 SCAM. All Rights Reserved.