com.centrasite.control.repository.items
Class RepositoryObjectItem

java.lang.Object
  extended by com.centrasite.control.AbstractItem
      extended by com.centrasite.control.repository.items.RepositoryObjectItem
All Implemented Interfaces:
Item
Direct Known Subclasses:
RepositoryFileItem, RepositoryFolderItem, RepositoryHistoryItem

public abstract class RepositoryObjectItem
extends AbstractItem

Abstract base class of all repository objects.


Field Summary
static javax.wvcm.PropertyNameList DEDICATED_PROPERTIES
           
 
Fields inherited from class com.centrasite.control.AbstractItem
rcs_id
 
Constructor Summary
RepositoryObjectItem(Connector connector, RepositoryObjectItem parent, javax.wvcm.Resource resource)
          Constructs a RepositoryObjectItem.
 
Method Summary
 int checkAndDeleteExternaLinkReferencies()
          Checks if the ExternalLinks for an URL resource have any linked RegistryObjects If there are none, then the URL resource is marked for deletion and all ExternalLinks that refer it get deleted
 void clearProperties()
           
static RepositoryObjectItem create(Connector connector, java.lang.String internalUrl)
          Create a RepositoryObjectItem.
static RepositoryObjectItem createItem(Connector connector, java.lang.String path)
          Create a RepositoryObjectItem for the given path
 boolean equals(java.lang.Object other)
           
 java.util.Collection<AbstractAce> getAccessControlElements()
          Get access control elements
 java.lang.String getAutoVersion()
          Get auto-version.
 java.util.Iterator getChildren()
           
 java.util.Iterator getChildren(boolean refresh)
           
 java.lang.String getComment()
          Get comment.
 java.lang.String getContentLength()
          Get content length.
 java.lang.String getContentType()
          Get content type.
 java.lang.String getCreationDate()
          Get creation date.
 InstanceLevelPermissionItem getCurrentUserPermissionItem()
          Get currently logged-in user privilege over this item, wrapped as a InstanceLevelPermissionItem.
 java.lang.String getDescription()
           
static java.lang.String getDocumentName(com.centrasite.util.RepositoryConnector connector, java.lang.String url)
          Retrieves the repository document name specified by the given URL.
 java.lang.String getImageURL()
           
 java.lang.String getKey()
          Obtain a unique key for class of icons
 java.lang.String getModificationDate()
          Get modification date.
 java.util.Date getModifiedDateObject()
           
 java.lang.String getName()
          Get display name.
 java.lang.String getNameEx()
          Get "extended/alternate name".
 java.lang.String getOwner()
          Get owner.
 RepositoryObjectItem getParent()
          Get parent node.
 java.lang.String getPath()
          Get path.
 java.util.ArrayList getProperties()
           
 javax.wvcm.Provider getProvider()
          Get WebDAV provider.
 com.centrasite.util.RepositoryConnector getRepositoryConnector()
          Get repository connector.
 javax.wvcm.Resource getResource()
          Get WebDAV resource.
 java.lang.String getTrimmedPath()
           
static java.lang.String getTrimmedPath(com.centrasite.util.RepositoryConnector connector, java.lang.String url)
           
abstract  boolean hasChildren()
          Indicates whether childs objects exist.
 int hashCode()
           
 boolean hasNoChildren()
           
 boolean isLocationChanged()
           
 boolean isModified()
          Check whether this Item is modified vs. its corresponding persistent version
 boolean isReferenced()
          Check if external references exist
 int isReferencedByMyCentraSite()
          Check if its reference by My Centra Site
 void rename(java.lang.String nodeName)
          Rename node.
 void save()
           
 void save(ActionContext context)
          Save node.
 void setAccessControlElements(java.util.Collection<? extends AbstractAce> accessControlElements)
          Set access control elements
 void setComment(java.lang.String value)
          Set comment.
 void setDisplayName(java.lang.String displayName)
          Set the display name.
 void setLocationChanged(boolean changed)
           
 void setNewLocation(RepositoryFolderItem folderItem)
           
 void setParent(RepositoryObjectItem parent)
           
 void setProperties(java.util.ArrayList properties)
           
 void setResource(javax.wvcm.Resource resource)
           
 java.lang.String toString()
           
 
Methods inherited from class com.centrasite.control.AbstractItem
addBulkCommand, addCommand, addDetailViewTab, cannotHaveChildren, clearCache, getBulkCommands, getCommand, getCommand, getCommands, getConnector, getDefaultCommand, getDetailsCommand, getDetailViewTabs, getItem, getLanguage, getLocale, getNonPermissionAccessControlElements, getPersistanceLocale, getPrivilegeDescriptor, getRelatedItems, getReport, getReportForDetailView, hasRequiredAttribute, isLocked, isReadOnly, isStandalone, isSubTabModified, removeCommand, replaceCommand, setCommandEnabled, setConnector, setDefaultCommand, setDetailsCommand, setLocked, setRelatedItems, setRequiredAttribute, setTabModified, showDetailView, showReport
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEDICATED_PROPERTIES

public static final javax.wvcm.PropertyNameList DEDICATED_PROPERTIES
Constructor Detail

RepositoryObjectItem

public RepositoryObjectItem(Connector connector,
                            RepositoryObjectItem parent,
                            javax.wvcm.Resource resource)
Constructs a RepositoryObjectItem.

Parameters:
connector - The connector.
parent - Parent node.
resource - WebDAV resource.
Method Detail

getAccessControlElements

public java.util.Collection<AbstractAce> getAccessControlElements()
                                                           throws java.lang.Exception
Description copied from class: AbstractItem
Get access control elements

Specified by:
getAccessControlElements in interface Item
Overrides:
getAccessControlElements in class AbstractItem
Returns:
List of Access Control elements
Throws:
java.lang.Exception

getCurrentUserPermissionItem

public InstanceLevelPermissionItem getCurrentUserPermissionItem()
                                                         throws java.lang.Exception
Description copied from class: AbstractItem
Get currently logged-in user privilege over this item, wrapped as a InstanceLevelPermissionItem.

Specified by:
getCurrentUserPermissionItem in interface Item
Overrides:
getCurrentUserPermissionItem in class AbstractItem
Returns:
InstanceLevelPermissionItem or null.
Throws:
java.lang.Exception

create

public static RepositoryObjectItem create(Connector connector,
                                          java.lang.String internalUrl)
Create a RepositoryObjectItem.

Parameters:
connector - The connector.
internalUrl - URL pointing to a location within CentraSite server.
Returns:
RepositoryObjectItem if operation succeeded, otherwise null.

getKey

public java.lang.String getKey()
                        throws java.lang.Exception
Obtain a unique key for class of icons

Specified by:
getKey in interface Item
Overrides:
getKey in class AbstractItem
Returns:
the key or null, if none available
Throws:
java.lang.Exception

getPath

public java.lang.String getPath()
Get path.

Specified by:
getPath in interface Item
Overrides:
getPath in class AbstractItem
Returns:
a path (if reasonable) or null

getResource

public javax.wvcm.Resource getResource()
Get WebDAV resource.

Returns:
WebDAV resource.

setResource

public void setResource(javax.wvcm.Resource resource)

getParent

public RepositoryObjectItem getParent()
Get parent node.

Returns:
Parent node.

setParent

public void setParent(RepositoryObjectItem parent)

getProvider

public javax.wvcm.Provider getProvider()
Get WebDAV provider.

Returns:
WebDAV provider.

getContentType

public java.lang.String getContentType()
                                throws java.lang.Exception
Get content type.

Returns:
Content type
Throws:
java.lang.Exception

getContentLength

public java.lang.String getContentLength()
                                  throws java.lang.Exception
Get content length.

Returns:
Content length
Throws:
java.lang.Exception

getModificationDate

public java.lang.String getModificationDate()
Get modification date.

Returns:
Modification date

getModifiedDateObject

public java.util.Date getModifiedDateObject()

getCreationDate

public java.lang.String getCreationDate()
                                 throws java.lang.Exception
Get creation date.

Returns:
Creation date.
Throws:
java.lang.Exception

getAutoVersion

public java.lang.String getAutoVersion()
Get auto-version.

Returns:
The auto-version.

getOwner

public java.lang.String getOwner()
Get owner.

Returns:
The owner.

getComment

public java.lang.String getComment()
Get comment.

Returns:
Comment of repository node.

setComment

public void setComment(java.lang.String value)
Set comment.

Parameters:
value - Comment to set

isLocationChanged

public boolean isLocationChanged()

setLocationChanged

public void setLocationChanged(boolean changed)

isReferenced

public boolean isReferenced()
                     throws java.lang.Exception
Check if external references exist

Returns:
True if referenced, otherwise false.
Throws:
java.lang.Exception

isReferencedByMyCentraSite

public int isReferencedByMyCentraSite()
                               throws java.lang.Exception
Check if its reference by My Centra Site

Returns:
int 0: empty links. it's not referenced by any object 1: there are links, but they are not referenced by My CentraSite 2: there are links referenced by My CentraSite
Throws:
java.lang.Exception

checkAndDeleteExternaLinkReferencies

public int checkAndDeleteExternaLinkReferencies()
                                         throws java.lang.Exception
Checks if the ExternalLinks for an URL resource have any linked RegistryObjects If there are none, then the URL resource is marked for deletion and all ExternalLinks that refer it get deleted

Returns:
int 0: empty links. it's not referenced by any object 1: there's links, but it's not referenced by My CentraSite 2: there's links referenced by My CentraSite
Throws:
java.lang.Exception

rename

public void rename(java.lang.String nodeName)
            throws java.lang.Exception
Rename node.

Throws:
java.lang.Exception

getProperties

public java.util.ArrayList getProperties()
                                  throws java.lang.Exception
Overrides:
getProperties in class AbstractItem
Throws:
java.lang.Exception

setProperties

public void setProperties(java.util.ArrayList properties)
                   throws java.lang.Exception
Overrides:
setProperties in class AbstractItem
Throws:
java.lang.Exception

clearProperties

public void clearProperties()
                     throws java.lang.Exception
Overrides:
clearProperties in class AbstractItem
Throws:
java.lang.Exception

setAccessControlElements

public void setAccessControlElements(java.util.Collection<? extends AbstractAce> accessControlElements)
                              throws java.lang.Exception
Set access control elements

Specified by:
setAccessControlElements in interface Item
Overrides:
setAccessControlElements in class AbstractItem
Parameters:
accessControlElements - List of Access Control elements
Throws:
java.lang.Exception

save

public void save(ActionContext context)
          throws java.lang.Exception
Save node.

Specified by:
save in interface Item
Overrides:
save in class AbstractItem
Throws:
java.lang.Exception

save

public void save()
          throws java.lang.Exception
Throws:
java.lang.Exception

isModified

public boolean isModified()
Description copied from interface: Item
Check whether this Item is modified vs. its corresponding persistent version

Specified by:
isModified in interface Item
Overrides:
isModified in class AbstractItem
Returns:
true if modified, false if not modified

getRepositoryConnector

public com.centrasite.util.RepositoryConnector getRepositoryConnector()
Get repository connector.

Returns:
Repository connector.

hasChildren

public abstract boolean hasChildren()
Indicates whether childs objects exist.

Returns:
false if childs exist.

hasNoChildren

public boolean hasNoChildren()
                      throws java.lang.Exception
Throws:
java.lang.Exception

getChildren

public java.util.Iterator getChildren()
                               throws java.lang.Exception
Throws:
java.lang.Exception

getChildren

public java.util.Iterator getChildren(boolean refresh)
                               throws java.lang.Exception
Throws:
java.lang.Exception

getDescription

public java.lang.String getDescription()
                                throws java.lang.Exception
Throws:
java.lang.Exception

getImageURL

public java.lang.String getImageURL()
                             throws java.lang.Exception
Throws:
java.lang.Exception

getName

public java.lang.String getName()
Get display name.

Returns:
Display name

setDisplayName

public void setDisplayName(java.lang.String displayName)
Set the display name. Item is marked as modified.

Parameters:
displayName - The display name to set.

getNameEx

public java.lang.String getNameEx()
Description copied from class: AbstractItem
Get "extended/alternate name". This method is only used in some rare locations e.g. currently when obtaining the label of an item in the tree. Its usage is discouraged in general. This default implementation returns same as getName().

Specified by:
getNameEx in interface Item
Overrides:
getNameEx in class AbstractItem

getTrimmedPath

public java.lang.String getTrimmedPath()

getTrimmedPath

public static java.lang.String getTrimmedPath(com.centrasite.util.RepositoryConnector connector,
                                              java.lang.String url)

getDocumentName

public static java.lang.String getDocumentName(com.centrasite.util.RepositoryConnector connector,
                                               java.lang.String url)
Retrieves the repository document name specified by the given URL. Returns null if the URL does not point to document in the repo.

Returns:
document name

createItem

public static RepositoryObjectItem createItem(Connector connector,
                                              java.lang.String path)
                                       throws javax.wvcm.WvcmException
Create a RepositoryObjectItem for the given path

Parameters:
connector - The connector
path - Path relative to base directory, e.g. /projects/CentraSite/icons/". If the path is to represent a folder/directory, it must be terminated with a slash
Returns:
the RepositoryObjectItem
Throws:
javax.wvcm.WvcmException

toString

public java.lang.String toString()
Overrides:
toString in class AbstractItem

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setNewLocation

public void setNewLocation(RepositoryFolderItem folderItem)