okapi.coreobjects
Class OkapiArc

java.lang.Object
  extended by okapi.coreobjects.OkapiObject
      extended by okapi.coreobjects.OkapiArc
All Implemented Interfaces:
java.io.Serializable

public class OkapiArc
extends OkapiObject

OkapiArc contains OkapiContent or other OkapiArcs

It provides the container for any content with "use metadata"

Arcs are associated with Nexuses and provide the static material. An Arc may have structure, containing other Arcs or multple Contents. The contained Arcs and Contents may in turn have structure. But an Arc may also be a single Content which has a single ContentAtom. Arcs and Contents are associated with paths or path segments. If the Arc or Content has more than a single ContentAtom, it should be associated with a path segment.

e.g.:
"index.html" : "index.html" -> Content -> ContentAtom
"lecture1/index.html" :
"lecture1" -> Content for lecture1
within that Content "index.html" -> ContentAtom
"lecture1/LN2.pdf" :
"lecture1" -> Content for lecture1
within that Content "LN2.pdf" -> ContentAtom
"lecture1/LN3/index.html" :
"lecture1" -> Content for lecture1
within that Content "LN3" -> Content for LN3
within that, "index.html" -> ContentAtom
"lecture1/LN4/index.html" :
"lecture1" -> Content for lecture1
within that Content "LN4/index.html" -> ContentAtom
(ln4 has only one html file. This construct is allowed technically but should probably be avoided to avoid confusion.)

Version:
$Revision: 31044 $, $Date: 2008-09-02 17:08:01 -0400 (Tue, 02 Sep 2008) $
Author:
MIT Stellar team
See Also:
Serialized Form

Field Summary
 
Fields inherited from class okapi.coreobjects.OkapiObject
createdBy, createdDate, description, lastModifiedBy, lastModifiedDate, longName, name, objectID, status
 
Constructor Summary
OkapiArc()
          Create new empty content container.
OkapiArc(int arcCode)
          Instantiate the Arc object for this arcCode
 
Method Summary
 void addArc(java.lang.String filePath, OkapiArc content)
          Add content of type Arc and add it to the end of the ordering.
 void addArcUnordered(java.lang.String filePath, OkapiArc content)
          Deprecated. not used
 void addContent(java.lang.String filePath, OkapiContent content)
          Add reusable content Contents to the Arc container and add it to the end of the ordering.
 void addContentUnordered(java.lang.String filePath, OkapiContent content)
          Deprecated. not used
 void arcOrderAdd(java.lang.String path)
          Put arcChild which is at path putPath at end of ordering in the arc child ordering.
 void arcOrderAddAfter(java.lang.String putPath, java.lang.String afterThisPath)
          Deprecated. not used
 void arcOrderAddBefore(java.lang.String putPath, java.lang.String beforeThisPath)
          Deprecated. not used
 void arcOrderAlphabetical()
          Deprecated. only used to repair ordering corrupted by bugs
 void arcOrderMakeUnique()
          Deprecated. only used to repair ordering corrupted by bugs
 int arcOrderMove(java.lang.String path, int n)
          Move arcChild by n positions up or down in the arc child ordering.
 void arcOrderRemove(java.lang.String path)
          Remove all occurances of path from order
 boolean checkAuthorization(OkapiUser user, OkapiOperation operation)
          Checks to see if the specified user is authorized to perform the specified operation on this object.
 void contentOrderAdd(java.lang.String path)
          Put contentChild which is at path putPath at end of ordering in the content child ordering.
 void contentOrderAddAfter(java.lang.String putPath, java.lang.String afterThisPath)
          Deprecated. not used
 void contentOrderAddBefore(java.lang.String putPath, java.lang.String beforeThisPath)
          Deprecated. not used
 void contentOrderAlphabetical()
          Deprecated. only used to repair ordering corrupted by bugs
 void contentOrderMakeUnique()
          Deprecated. only used to repair ordering corrupted by bugs
 int contentOrderMove(java.lang.String path, int n)
          Move contentChild by n positions up or down in the content child ordering.
 void contentOrderRemove(java.lang.String path)
          Remove all occurances of path from order
 boolean equals(java.lang.Object o)
          override Object equals method to compare two arcs
 java.util.List getAccessDates()
          Deprecated.  
 OkapiArc getArc(java.util.List filePathVector)
          Return a OkapiArc for the specified path, or null.
 OkapiArc getArc(java.util.List filePathVector, OkapiUser user)
          Return a OkapiArc for the specified path, or null.
 OkapiArc getArc(java.lang.String filePath)
          Method getArc
 OkapiArc getArc(java.lang.String filePath, OkapiUser user)
          Method getArc
 java.util.Map getArcChildren()
          Return vector of all children of type Arc.
 int getArcCode()
          Return arcCode of this Arc
 java.util.List getArcOrder()
          Return order of arc children
 java.lang.String getAsXml(java.util.Map options, java.lang.String tag, int indent)
          Overrides the method in OkapiObject to add Arc specific information.
 OkapiContent getContent(java.util.List filePathVector)
          Return a OkapiContent for the specified path which leads to an OkapiStore, or null.
 OkapiContent getContent(java.util.List filePathVector, OkapiUser user)
          Return a OkapiContent for the specified path which leads to an OkapiStore, or null.
 java.util.Map getContentChildren()
          Return vector of all children of type Content.
 java.util.List getContentOrder()
          Return order of content children
 java.util.Date getCreatedDate()
          Method getCreatedDate
 java.lang.String getDescription()
          Method getDescription
 java.lang.String getLastModifiedBy()
          Method getLastModifiedBy
 java.util.Date getLastModifiedDate()
          Method getLastModifiedDate
 java.lang.String getLongName()
          Method getLongName
 java.lang.String getName()
          Method getName
 OkapiObjectID getObjectID()
          Method getObjectID
 OkapiStore getStore(java.util.List filePathVector)
          Return a OkapiStore for the specified path, or null.
 OkapiStore getStore(java.util.List filePathVector, OkapiUser user)
          Return a OkapiStore for the specified path, or null, or throw a okapi.util.OkapiPermissionDenied exception.
 java.util.Map getUseMetadata()
          Get all use metadata.
 java.lang.Object getUseMetadata(java.lang.Object key)
          Get use metadata.
 int hashCode()
          override hashCode to use the database table sequence number
 boolean isEmpty()
          returns true if arc has no Arc or Content children.
 void makeAccessable(java.util.Date starting, java.util.Date ending)
          Deprecated.  
 void refreshFromDB()
          Refresh this object with the data currently stored in the DB.
 void removeArc(java.lang.String filePath)
          Remove an Arc.
 void removeContent(java.lang.String filePath)
          remove a content
 void removeUseMetadata(java.lang.Object key)
          Remove use metadata.
 void setAccessDates(java.util.List newAccessDates)
          Deprecated.  
 void setArcOrder(java.util.List newArcOrder)
          Set order of arc children, replacing old ordering
 void setAuthorization(OkapiUser user, OkapiOperation operation, boolean dateRestricted)
          Deprecated. not used
 void setContentOrder(java.util.List newContentOrder)
          Set order of content children, replacing old ordering
 void setDataSource(javax.sql.DataSource dataSource)
          Set the dataSource to be used for data access.
 void setDescription(java.lang.String newDescription)
          Method setDescription
protected  void setLastModifiedBy(OkapiUser newLastModifiedBy)
           
protected  void setLastModifiedBy(java.lang.String newLastModifiedBy)
           
protected  void setLastModifiedDate(java.util.Date newLastModifiedDate)
           
 void setLongName(java.lang.String newLongName)
          Method setLongName
 void setName(java.lang.String newName)
          Method setName
 void setUseMetadata(java.lang.String key, java.lang.Object value)
          Method setUseMetadata
 void setUseMetadata(java.lang.String key, java.lang.String value)
          Set use metadata.
 void updateDB()
          Update the database record for this object.
 
Methods inherited from class okapi.coreobjects.OkapiObject
currentDateTimeOracle, getAsXml, getAsXml, getAsXml, getCreatedBy, getStatus, isEncryptionRequired, setAuthorization, setCreatedBy, setCreatedDate, setStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OkapiArc

public OkapiArc()
Create new empty content container.


OkapiArc

public OkapiArc(int arcCode)
Instantiate the Arc object for this arcCode

Method Detail

getArcOrder

public java.util.List getArcOrder()
Return order of arc children


getContentOrder

public java.util.List getContentOrder()
Return order of content children


setArcOrder

public void setArcOrder(java.util.List newArcOrder)
Set order of arc children, replacing old ordering


setContentOrder

public void setContentOrder(java.util.List newContentOrder)
Set order of content children, replacing old ordering


arcOrderMove

public int arcOrderMove(java.lang.String path,
                        int n)
Move arcChild by n positions up or down in the arc child ordering.
Return the actual change in position.


arcOrderAddAfter

public void arcOrderAddAfter(java.lang.String putPath,
                             java.lang.String afterThisPath)
Deprecated. not used

Put arcChild which is at path putPath after afterThisPath in the arc child ordering.


arcOrderAddBefore

public void arcOrderAddBefore(java.lang.String putPath,
                              java.lang.String beforeThisPath)
Deprecated. not used

Put arcChild which is at path putPath before beforeThisPath in the arc child ordering.


arcOrderRemove

public void arcOrderRemove(java.lang.String path)
Remove all occurances of path from order


arcOrderAdd

public void arcOrderAdd(java.lang.String path)
Put arcChild which is at path putPath at end of ordering in the arc child ordering.


arcOrderAlphabetical

public void arcOrderAlphabetical()
Deprecated. only used to repair ordering corrupted by bugs

Order all arc children alphabetically by path


contentOrderAlphabetical

public void contentOrderAlphabetical()
Deprecated. only used to repair ordering corrupted by bugs

Order all content children alphabetically by path


arcOrderMakeUnique

public void arcOrderMakeUnique()
Deprecated. only used to repair ordering corrupted by bugs

Make all arc children unique: skip redundancies


contentOrderMakeUnique

public void contentOrderMakeUnique()
Deprecated. only used to repair ordering corrupted by bugs

Make all content children unique: skip redundancies


contentOrderMove

public int contentOrderMove(java.lang.String path,
                            int n)
Move contentChild by n positions up or down in the content child ordering.
Return the actual change in position.


contentOrderAddAfter

public void contentOrderAddAfter(java.lang.String putPath,
                                 java.lang.String afterThisPath)
Deprecated. not used

Put contentChild which is at path putPath after afterThisPath in the content child ordering.


contentOrderAddBefore

public void contentOrderAddBefore(java.lang.String putPath,
                                  java.lang.String beforeThisPath)
Deprecated. not used

Put contentChild which is at path putPath before beforeThisPath in the content child ordering.


contentOrderRemove

public void contentOrderRemove(java.lang.String path)
Remove all occurances of path from order


contentOrderAdd

public void contentOrderAdd(java.lang.String path)
Put contentChild which is at path putPath at end of ordering in the content child ordering.


setAuthorization

public void setAuthorization(OkapiUser user,
                             OkapiOperation operation,
                             boolean dateRestricted)
Deprecated. not used

Sets the authorization on this object for the specified user and operation, valid for particular dates.


setUseMetadata

public void setUseMetadata(java.lang.String key,
                           java.lang.String value)
Set use metadata.


setUseMetadata

public void setUseMetadata(java.lang.String key,
                           java.lang.Object value)
Method setUseMetadata

Parameters:
key -
value -

getUseMetadata

public java.util.Map getUseMetadata()
Get all use metadata.


getUseMetadata

public java.lang.Object getUseMetadata(java.lang.Object key)
Get use metadata.


removeUseMetadata

public void removeUseMetadata(java.lang.Object key)
Remove use metadata.


getArcCode

public int getArcCode()
Return arcCode of this Arc


equals

public boolean equals(java.lang.Object o)
override Object equals method to compare two arcs

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
override hashCode to use the database table sequence number

Overrides:
hashCode in class java.lang.Object

addArcUnordered

public void addArcUnordered(java.lang.String filePath,
                            OkapiArc content)
Deprecated. not used

Add content of type Arc without adding it to the ordering. File path should be a path segment.


addArc

public void addArc(java.lang.String filePath,
                   OkapiArc content)
Add content of type Arc and add it to the end of the ordering. File path should be a path segment.


removeArc

public void removeArc(java.lang.String filePath)
Remove an Arc.


addContentUnordered

public void addContentUnordered(java.lang.String filePath,
                                OkapiContent content)
Deprecated. not used

Add reusable content Contents to the Arc container without adding it to the ordering. File path should be a path segment if Content has more than one ContentAtom.


addContent

public void addContent(java.lang.String filePath,
                       OkapiContent content)
Add reusable content Contents to the Arc container and add it to the end of the ordering. File path should be a path segment if Content has more than one ContentAtom.


removeContent

public void removeContent(java.lang.String filePath)
remove a content


getArcChildren

public java.util.Map getArcChildren()
Return vector of all children of type Arc.


getContentChildren

public java.util.Map getContentChildren()
Return vector of all children of type Content.


getStore

public OkapiStore getStore(java.util.List filePathVector)
Return a OkapiStore for the specified path, or null. Does not check access rights of user, always returns a Store if it is found.


getStore

public OkapiStore getStore(java.util.List filePathVector,
                           OkapiUser user)
                    throws OkapiPermissionDeniedException
Return a OkapiStore for the specified path, or null, or throw a okapi.util.OkapiPermissionDenied exception.

Throws:
OkapiPermissionDeniedException

getContent

public OkapiContent getContent(java.util.List filePathVector)
Return a OkapiContent for the specified path which leads to an OkapiStore, or null. Does not check access rights of user, always returns a Store if it is found. This is useful in aquiring the OkapiContent to check its metatadata, before retrieving the OkapiStore from it.


getContent

public OkapiContent getContent(java.util.List filePathVector,
                               OkapiUser user)
                        throws OkapiPermissionDeniedException
Return a OkapiContent for the specified path which leads to an OkapiStore, or null. Does not check access rights of user, always returns a Store if it is found. This is useful in aquiring the OkapiContent to check its metatadata, before retrieving the OkapiStore from it.

Throws:
OkapiPermissionDeniedException

getArc

public OkapiArc getArc(java.util.List filePathVector)
Return a OkapiArc for the specified path, or null.


getArc

public OkapiArc getArc(java.util.List filePathVector,
                       OkapiUser user)
                throws OkapiPermissionDeniedException
Return a OkapiArc for the specified path, or null. Does not check access rights of user.

Throws:
OkapiPermissionDeniedException

getArc

public OkapiArc getArc(java.lang.String filePath)
Method getArc

Parameters:
filePath -
Returns:
OkapiArc

getArc

public OkapiArc getArc(java.lang.String filePath,
                       OkapiUser user)
                throws OkapiPermissionDeniedException
Method getArc

Parameters:
filePath -
user -
Returns:
OkapiArc
Throws:
OkapiPermissionDeniedException

makeAccessable

public void makeAccessable(java.util.Date starting,
                           java.util.Date ending)
Deprecated. 

Set access dates for content.


setAccessDates

public void setAccessDates(java.util.List newAccessDates)
Deprecated. 

Set access dates for content. Arguments likely to change.


getAccessDates

public java.util.List getAccessDates()
Deprecated. 

Method getAccessDates

Returns:
java.util.List

updateDB

public void updateDB()
Update the database record for this object.

Overrides:
updateDB in class OkapiObject

refreshFromDB

public void refreshFromDB()
Refresh this object with the data currently stored in the DB.

Overrides:
refreshFromDB in class OkapiObject

checkAuthorization

public boolean checkAuthorization(OkapiUser user,
                                  OkapiOperation operation)
Checks to see if the specified user is authorized to perform the specified operation on this object.

Overrides:
checkAuthorization in class OkapiObject

isEmpty

public boolean isEmpty()
returns true if arc has no Arc or Content children.


setName

public void setName(java.lang.String newName)
Method setName

Overrides:
setName in class OkapiObject
Parameters:
newName -

getName

public java.lang.String getName()
Method getName

Overrides:
getName in class OkapiObject
Returns:
String

setLongName

public void setLongName(java.lang.String newLongName)
Method setLongName

Overrides:
setLongName in class OkapiObject
Parameters:
newLongName -

getLongName

public java.lang.String getLongName()
Method getLongName

Overrides:
getLongName in class OkapiObject
Returns:
String

setDescription

public void setDescription(java.lang.String newDescription)
Method setDescription

Overrides:
setDescription in class OkapiObject
Parameters:
newDescription -

getDescription

public java.lang.String getDescription()
Method getDescription

Overrides:
getDescription in class OkapiObject
Returns:
String

getObjectID

public OkapiObjectID getObjectID()
Method getObjectID

Overrides:
getObjectID in class OkapiObject
Returns:
OkapiObjectID

setLastModifiedDate

protected void setLastModifiedDate(java.util.Date newLastModifiedDate)
Overrides:
setLastModifiedDate in class OkapiObject

getLastModifiedDate

public java.util.Date getLastModifiedDate()
Method getLastModifiedDate

Overrides:
getLastModifiedDate in class OkapiObject
Returns:
java.util.Date

setLastModifiedBy

protected void setLastModifiedBy(OkapiUser newLastModifiedBy)
Overrides:
setLastModifiedBy in class OkapiObject

setLastModifiedBy

protected void setLastModifiedBy(java.lang.String newLastModifiedBy)
Overrides:
setLastModifiedBy in class OkapiObject

getLastModifiedBy

public java.lang.String getLastModifiedBy()
Method getLastModifiedBy

Overrides:
getLastModifiedBy in class OkapiObject
Returns:
String

getCreatedDate

public java.util.Date getCreatedDate()
Method getCreatedDate

Overrides:
getCreatedDate in class OkapiObject
Returns:
java.util.Date

getAsXml

public java.lang.String getAsXml(java.util.Map options,
                                 java.lang.String tag,
                                 int indent)
Overrides the method in OkapiObject to add Arc specific information. See OkapiObject.getAsXml(String tag, int indent) for more information about using the getAsXml methods.

Overrides:
getAsXml in class OkapiObject

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)
Set the dataSource to be used for data access.

Parameters:
dataSource -


Copyright ? 2001-2009 MIT. All Rights Reserved.