org.sakaiproject.metaobj.shared.mgt.impl
Class ContentResourceHome

java.lang.Object
  extended byorg.sakaiproject.metaobj.shared.mgt.impl.ContentResourceHome
All Implemented Interfaces:
PresentableObjectHome, ReadableObjectHome

public class ContentResourceHome
extends Object
implements ReadableObjectHome, PresentableObjectHome

Created by IntelliJ IDEA. User: John Ellis Date: Sep 14, 2005 Time: 10:08:18 AM To change this template use File | Settings | File Templates.


Constructor Summary
ContentResourceHome()
           
 
Method Summary
protected  org.jdom.Element addAnnotations(SchemaNode schema)
           
protected  void addFileContent(ContentResourceArtifact artifact, org.jdom.Element root)
           
protected  void addStructuredObjectContent(String type, ContentResourceArtifact artifact, org.jdom.Element root)
           
 Artifact createInstance()
          Creates an empty instance of this home's object
protected  org.jdom.Element createInstructions(StructuredArtifactHomeInterface home)
           
protected  org.jdom.Element createNode(String name, String value)
           
 Artifact createSample()
          Creates a sample instance of the object with each field filled in with some representative data.
 Collection findByOwner(Agent owner)
          Find all the instances of this home's objects that are owned by the supplied owner.
 org.jdom.Element getArtifactAsXml(Artifact art)
           
protected  Date getDate(ContentResource resource, String propName)
           
 String getExternalType()
          Used to get an externally unique type to identify this home across running osp instances
 String getExternalUri(Id artifactId, String name)
           
 HomeFactory getHomeFactory()
           
 IdManager getIdManager()
           
 Class getInterface()
           
protected  org.jdom.Element getMetadata(ContentResourceArtifact art)
           
 InputStream getStream(Id artifactId)
           
 Type getType()
           
 boolean isInstance(Artifact testObject)
          Determines if the supplied object is handled by this home.
 boolean isSystemOnly()
           
 Artifact load(Id id)
          Load the object from the backing store.
 void prepareInstance(Artifact object)
           
 void refresh()
          re-initialize any configuration
 void setHomeFactory(HomeFactory homeFactory)
           
 void setIdManager(IdManager idManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentResourceHome

public ContentResourceHome()
Method Detail

getType

public Type getType()
Specified by:
getType in interface ReadableObjectHome

getExternalType

public String getExternalType()
Description copied from interface: ReadableObjectHome
Used to get an externally unique type to identify this home across running osp instances

Specified by:
getExternalType in interface ReadableObjectHome
Returns:
an externally unique type suitable for storage and later import

load

public Artifact load(Id id)
              throws PersistenceException
Description copied from interface: ReadableObjectHome
Load the object from the backing store.

Specified by:
load in interface ReadableObjectHome
Parameters:
id - Uniquely identifies the object.
Returns:
The loaded object
Throws:
PersistenceException

createInstance

public Artifact createInstance()
Description copied from interface: ReadableObjectHome
Creates an empty instance of this home's object

Specified by:
createInstance in interface ReadableObjectHome
Returns:
An empty object instance

prepareInstance

public void prepareInstance(Artifact object)
Specified by:
prepareInstance in interface ReadableObjectHome

createSample

public Artifact createSample()
Description copied from interface: ReadableObjectHome
Creates a sample instance of the object with each field filled in with some representative data.

Specified by:
createSample in interface ReadableObjectHome
Returns:
An object instance with sample data filled in.

findByOwner

public Collection findByOwner(Agent owner)
                       throws FinderException
Description copied from interface: ReadableObjectHome
Find all the instances of this home's objects that are owned by the supplied owner. How do we handle permissions here?

Specified by:
findByOwner in interface ReadableObjectHome
Parameters:
owner - The owner in question.
Returns:
A list of objects.
Throws:
FinderException

isInstance

public boolean isInstance(Artifact testObject)
Description copied from interface: ReadableObjectHome
Determines if the supplied object is handled by this home.

Specified by:
isInstance in interface ReadableObjectHome
Parameters:
testObject - the object to be tested.
Returns:
true if the supplied object is handled by this home

refresh

public void refresh()
Description copied from interface: ReadableObjectHome
re-initialize any configuration

Specified by:
refresh in interface ReadableObjectHome

getExternalUri

public String getExternalUri(Id artifactId,
                             String name)
Specified by:
getExternalUri in interface ReadableObjectHome

getStream

public InputStream getStream(Id artifactId)
Specified by:
getStream in interface ReadableObjectHome

isSystemOnly

public boolean isSystemOnly()
Specified by:
isSystemOnly in interface ReadableObjectHome

getInterface

public Class getInterface()
Specified by:
getInterface in interface ReadableObjectHome

getArtifactAsXml

public org.jdom.Element getArtifactAsXml(Artifact art)
Specified by:
getArtifactAsXml in interface PresentableObjectHome

addStructuredObjectContent

protected void addStructuredObjectContent(String type,
                                          ContentResourceArtifact artifact,
                                          org.jdom.Element root)

createInstructions

protected org.jdom.Element createInstructions(StructuredArtifactHomeInterface home)

addAnnotations

protected org.jdom.Element addAnnotations(SchemaNode schema)

addFileContent

protected void addFileContent(ContentResourceArtifact artifact,
                              org.jdom.Element root)

getMetadata

protected org.jdom.Element getMetadata(ContentResourceArtifact art)

createNode

protected org.jdom.Element createNode(String name,
                                      String value)

getDate

protected Date getDate(ContentResource resource,
                       String propName)

getHomeFactory

public HomeFactory getHomeFactory()

setHomeFactory

public void setHomeFactory(HomeFactory homeFactory)

getIdManager

public IdManager getIdManager()

setIdManager

public void setIdManager(IdManager idManager)