org.sakaiproject.component.legacy.content
Class BaseContentService.BaseCollectionEdit

java.lang.Object
  extended byorg.sakaiproject.component.legacy.content.BaseContentService.BaseCollectionEdit
All Implemented Interfaces:
ContentCollection, ContentCollectionEdit, Edit, Entity, EventListener, SessionBindingListener
Enclosing class:
BaseContentService

public class BaseContentService.BaseCollectionEdit
extends Object
implements ContentCollectionEdit, SessionBindingListener

ContentCollection implementation


Field Summary
protected  boolean m_active
          Active flag.
protected  String m_event
          The event code for this edit.
protected  String m_id
          Store the resource id
protected  boolean m_isRemoved
          When true, the collection has been removed.
protected  ResourcePropertiesEdit m_properties
          The properties.
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Constructor Summary
BaseContentService.BaseCollectionEdit(ContentCollection other)
          Construct as a copy of another.
BaseContentService.BaseCollectionEdit(Element el)
          Construct from info in XML in a DOM element.
BaseContentService.BaseCollectionEdit(String id)
          Construct with an id.
 
Method Summary
protected  void activate()
          Enable editing.
protected  void clear()
          Clear all the members of the collection, all the way down.
protected  void closeEdit()
          Close the edit object - it cannot be used after this.
protected  void finalize()
          Clean up.
 long getBodySizeK()
          Access the size of all the resource body bytes within this collection in Kbytes.
protected  String getEvent()
          Access the event code for this edit.
 String getId()
          Access the id of the resource.
 List getMemberResources()
          Access a List of the collections' internal members as full ContentResource or ContentCollection objects.
 List getMembers()
          Access a List of the collection's internal members, each a resource id string.
 ResourceProperties getProperties()
          Access the collection's properties.
 ResourcePropertiesEdit getPropertiesEdit()
          Access the resource's properties for modification
 String getReference()
          Access the internal reference which can be used to access the resource from within the system.
 String getReference(String rootProperty)
          Access the alternate internal reference which can be used to access the entity from within the system.
 String getUrl()
          Access the URL which can be used to access the resource.
 String getUrl(String rootProperty)
          Access the alternate URL which can be used to access the entity.
 boolean isActiveEdit()
          Check to see if the edit is still active, or has already been closed.
protected  void set(ContentCollection other)
          Take all values from this object.
protected  void setEvent(String event)
          Set the event code for this edit.
protected  void setRemoved()
          Set the collection as removed.
 Element toXml(Document doc, Stack stack)
          Serialize the resource into XML, adding an element to the doc under the top of the stack element.
 void valueBound(SessionBindingEvent event)
          SessionBindingListener implementation
 void valueUnbound(SessionBindingEvent event)
          Notifies the object that it is being unbound from a session.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_id

protected String m_id
Store the resource id


m_properties

protected ResourcePropertiesEdit m_properties
The properties.


m_event

protected String m_event
The event code for this edit.


m_active

protected boolean m_active
Active flag.


m_isRemoved

protected boolean m_isRemoved
When true, the collection has been removed.

Constructor Detail

BaseContentService.BaseCollectionEdit

public BaseContentService.BaseCollectionEdit(String id)
Construct with an id.

Parameters:
id - The unique channel id.

BaseContentService.BaseCollectionEdit

public BaseContentService.BaseCollectionEdit(ContentCollection other)
Construct as a copy of another.

Parameters:
other - The other to copy.

BaseContentService.BaseCollectionEdit

public BaseContentService.BaseCollectionEdit(Element el)
Construct from info in XML in a DOM element.

Parameters:
el - The XML DOM element.
Method Detail

set

protected void set(ContentCollection other)
Take all values from this object.


finalize

protected void finalize()
Clean up.


getUrl

public String getUrl()
Access the URL which can be used to access the resource.

Specified by:
getUrl in interface Entity
Returns:
The URL which can be used to access the resource.

getReference

public String getReference()
Access the internal reference which can be used to access the resource from within the system.

Specified by:
getReference in interface Entity
Returns:
The the internal reference which can be used to access the resource from within the system.

getReference

public String getReference(String rootProperty)
Description copied from interface: Entity
Access the alternate internal reference which can be used to access the entity from within the system.

Specified by:
getReference in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference is requested. If null, the native 'raw' reference is requested.
Returns:
The the alternate internal reference which can be used to access the entity from within the system.

getUrl

public String getUrl(String rootProperty)
Description copied from interface: Entity
Access the alternate URL which can be used to access the entity.

Specified by:
getUrl in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference URL is requested. If null, the native 'raw' URL is requested.
Returns:
The alternate URL which can be used to access the entity.

getId

public String getId()
Access the id of the resource.

Specified by:
getId in interface Entity
Returns:
The id.

getMembers

public List getMembers()
Access a List of the collection's internal members, each a resource id string.

Specified by:
getMembers in interface ContentCollection
Returns:
a List of the collection's internal members, each a resource id string (may be empty).

getBodySizeK

public long getBodySizeK()
Access the size of all the resource body bytes within this collection in Kbytes.

Specified by:
getBodySizeK in interface ContentCollection
Returns:
The size of all the resource body bytes within this collection in Kbytes.

getMemberResources

public List getMemberResources()
Access a List of the collections' internal members as full ContentResource or ContentCollection objects.

Specified by:
getMemberResources in interface ContentCollection
Returns:
a List of the full objects of the members of the collection.

getProperties

public ResourceProperties getProperties()
Access the collection's properties.

Specified by:
getProperties in interface Entity
Returns:
The collection's properties.

setRemoved

protected void setRemoved()
Set the collection as removed.


clear

protected void clear()
              throws IdUnusedException,
                     PermissionException,
                     InconsistentException,
                     TypeException,
                     InUseException,
                     ServerOverloadException
Clear all the members of the collection, all the way down. Security has already been checked!

Throws:
IdUnusedException
PermissionException
InconsistentException
TypeException
InUseException
ServerOverloadException

toXml

public Element toXml(Document doc,
                     Stack stack)
Serialize the resource into XML, adding an element to the doc under the top of the stack element.

Specified by:
toXml in interface Entity
Parameters:
doc - The DOM doc to contain the XML (or null for a string return).
stack - The DOM elements, the top of which is the containing element of the new "resource" element.
Returns:
The newly added element.

getEvent

protected String getEvent()
Access the event code for this edit.

Returns:
The event code for this edit.

setEvent

protected void setEvent(String event)
Set the event code for this edit.

Parameters:
event - The event code for this edit.

getPropertiesEdit

public ResourcePropertiesEdit getPropertiesEdit()
Access the resource's properties for modification

Specified by:
getPropertiesEdit in interface Edit
Returns:
The resource's properties.

activate

protected void activate()
Enable editing.


isActiveEdit

public boolean isActiveEdit()
Check to see if the edit is still active, or has already been closed.

Specified by:
isActiveEdit in interface Edit
Returns:
true if the edit is active, false if it's been closed.

closeEdit

protected void closeEdit()
Close the edit object - it cannot be used after this.


valueBound

public void valueBound(SessionBindingEvent event)
SessionBindingListener implementation

Specified by:
valueBound in interface SessionBindingListener
Parameters:
event - the event that identifies the session

valueUnbound

public void valueUnbound(SessionBindingEvent event)
Description copied from interface: SessionBindingListener
Notifies the object that it is being unbound from a session.

Specified by:
valueUnbound in interface SessionBindingListener
Parameters:
event - the event that identifies the session