org.xmlecho.palomar.xfs
Interface RepositoryItem

All Superinterfaces:
PermissionSet

public interface RepositoryItem
extends PermissionSet

Provides those operations common to all objects in the repository


Field Summary
static int BINARY
          item is of type "BINARY"
static int FOLDER
          item is of type "FOLDER"
static int STATUS_CLOBS
           
static int STATUS_DOCNODES
           
static int STATUS_FS
           
static int STATUS_FS_AND_DOCNODES
           
static int STATUS_FTI_COMPLETE
           
static int STATUS_FTI_PENDING
           
static int STATUS_FTI_REMOVAL_PENDING
           
static int STATUS_GONER
           
static int STATUS_PURGE_PENDING
           
static int TEXT
          item is of type "TEXT"
static int XML
          item is of type "XML"
 
Method Summary
 void checkinCheckedoutVersion(Transaction xact, User user)
          checkin a checkedout version of the item with this name, as a part of a larger transaction
 RepositoryItem checkoutVersion(Transaction xact, User user)
          checkout a version of the item with this name, as a part of a larger transaction .
 RepositoryItem createChildBinaryItem(User user, java.lang.String name, java.lang.String mimeType)
          creates a new item as a child of this directory
 RepositoryItem createChildBinaryItem(User user, java.lang.String name, java.lang.String mimeType, java.io.InputStream is)
          creates a new item as a child of this directory
 RepositoryItem createChildDirItem(User user, java.lang.String name)
          creates a new FOLDER item as a child of this FOLDER
 RepositoryItem createChildTextItem(User user, java.lang.String name, java.lang.String mimeType)
          creates a new item as a child of this directory
 RepositoryItem createChildTextItem(User user, java.lang.String name, java.lang.String mimeType, java.io.InputStream is)
          creates a new item as a child of this directory
 RepositoryItem createChildXMLItem(User user, java.lang.String name, java.lang.String mimeType)
          creates a new XML item as a child of this FOLDER
 RepositoryItem createChildXMLItem(User user, java.lang.String name, java.lang.String mimeType, java.io.InputStream is)
          creates a new XML item as a child of this FOLDER
 int deleteSelf()
          Deprecated. As of FDX 3.5, use deleteSelf( Timestamp, boolean )
 int deleteSelf(java.sql.Timestamp deleteTime, boolean isSubItem)
          deletes row/s from the XStore Item table, if applicable.
 RepositoryItem[] getAllVersions()
           
 java.lang.Object getApplicationObject(java.lang.Object key)
          Return the application object identified by key for this item.
 java.lang.String getBaseURI()
          return the base URI for this item suitable for resolving relative references
 RepositoryItem getCheckedoutVersion(Transaction xact, User user)
          get version of an item with this name which has been already checked out, as a part of a larger transaction
 RepositoryItem[] getChildren()
           
 java.lang.String getCreateTime()
           
 java.lang.String getDAVProperty(java.lang.String propertyName)
          get the named webdav property associated with this item
 RepositoryItem[] getDeletedChildren()
           
 java.lang.String getDirNamePath()
          return a string representing the directory path in which this item lives i.e.
 java.lang.String getFullPath()
          return the normalized full path name for the item within the repository.
 java.io.InputStream getInputStream()
          gets a java byte InputStream for reading the binary data content from the repository
 java.lang.String getItemID()
           
 int getItemType()
           
 java.lang.String getMimeType()
          get the item's MimeType
 java.lang.String getName()
          get the item's name
 java.io.OutputStream getOutputStream()
          get an OutputStream for writing binary data to the repository item
 int getOwnerID()
           
 int getOwningGroupID()
          returns the string identifier associated with the item's owning group
 java.lang.String getParentID()
          get the ID of the item (folder) which contains this item
 PermBits getPermissions()
          a bitmask authorization scheme
 int getRevisionNumber()
          returns the revision number of this item
 java.lang.String getUpdateTime()
           
 boolean isCheckedoutVersion()
          true if item with this name represents the checked out version of the item with this name
 boolean isLatest()
          true if this item represents the latest (current) revision of the item with this name
 void list(User user, org.xml.sax.ContentHandler dest, int depth)
          emit the description of this item as XML.
 void listFolders(User user, org.xml.sax.ContentHandler dest, int depth)
          emit the description of this item, and its folder descendents as XML.
 void move(User user, java.lang.String fullpath)
          changes the name and/or moves the item to another folder
 java.io.Reader openCharReader()
          gets a java character stream Reader for reading the item's character content from the repository
 java.io.Writer openCharWriter()
          get a Writer for writing character (text) content to the repository item
 org.xml.sax.XMLReader openXMLReader()
          get a SAX XMLReader for reading (parsing) the repository XML content
 org.xml.sax.ContentHandler openXMLWriter()
          get a SAX ContententHandler for writing XML content to the repository
 void setApplicationObject(java.lang.Object key, java.lang.Object value)
          Associate an application object with a key for this item.
 void setCreateTime(java.util.Date when)
          set the time at which this was created
 void setDAVProperty(java.lang.String propertyName, java.lang.String propertyValue)
          set the named webdav property associated with this item
 void setItemType(int type)
          set the item type identifier
 void setName(java.lang.String name)
          sets the item's name
 void setOwnerID(int id)
          set the item's ownership
 void setOwningGroupID(int id)
          set the item's owning group
 void setParentID(java.lang.String id)
          get the ID of the item (folder) which contains this item
 void setPermissions(PermBits permissions)
          a bitmask authorization scheme
 void setUpdateTime(java.util.Date updated)
          sets the last modified time
 void uncheckoutCheckedoutVersion(Transaction xact, User user)
          uncheckout (cancel a checkout) by removing a checkedout version of item with this name, as a part of a larger transaction
 

Field Detail

FOLDER

public static final int FOLDER
item is of type "FOLDER"

See Also:
Constant Field Values

XML

public static final int XML
item is of type "XML"

See Also:
Constant Field Values

BINARY

public static final int BINARY
item is of type "BINARY"

See Also:
Constant Field Values

TEXT

public static final int TEXT
item is of type "TEXT"

See Also:
Constant Field Values

STATUS_GONER

public static final int STATUS_GONER
See Also:
Constant Field Values

STATUS_FS

public static final int STATUS_FS
See Also:
Constant Field Values

STATUS_DOCNODES

public static final int STATUS_DOCNODES
See Also:
Constant Field Values

STATUS_FS_AND_DOCNODES

public static final int STATUS_FS_AND_DOCNODES
See Also:
Constant Field Values

STATUS_CLOBS

public static final int STATUS_CLOBS
See Also:
Constant Field Values

STATUS_FTI_PENDING

public static final int STATUS_FTI_PENDING
See Also:
Constant Field Values

STATUS_FTI_COMPLETE

public static final int STATUS_FTI_COMPLETE
See Also:
Constant Field Values

STATUS_FTI_REMOVAL_PENDING

public static final int STATUS_FTI_REMOVAL_PENDING
See Also:
Constant Field Values

STATUS_PURGE_PENDING

public static final int STATUS_PURGE_PENDING
See Also:
Constant Field Values
Method Detail

getItemID

public java.lang.String getItemID()
Returns:
the item's unique identifier

getOwnerID

public int getOwnerID()
Specified by:
getOwnerID in interface PermissionSet
Returns:
the unique ID of the item's owner

setOwnerID

public void setOwnerID(int id)
                throws XfsException
set the item's ownership

Throws:
XfsException

getOwningGroupID

public int getOwningGroupID()
returns the string identifier associated with the item's owning group

Specified by:
getOwningGroupID in interface PermissionSet
Returns:
the ID of the owner group of the item with the above permission bits.

getPermissions

public PermBits getPermissions()
a bitmask authorization scheme

Specified by:
getPermissions in interface PermissionSet
Returns:
a PermBits object representing the permission

setPermissions

public void setPermissions(PermBits permissions)
                    throws XfsException
a bitmask authorization scheme

Throws:
XfsException

setOwningGroupID

public void setOwningGroupID(int id)
                      throws XfsException
set the item's owning group

Throws:
XfsException

getItemType

public int getItemType()
Returns:
TEXT, XML, FOLDER or BINARY

setItemType

public void setItemType(int type)
                 throws XfsException
set the item type identifier

Throws:
XfsException

getName

public java.lang.String getName()
get the item's name


getFullPath

public java.lang.String getFullPath()
return the normalized full path name for the item within the repository. e.g. "/testje/data/myDoc.xml"


getDirNamePath

public java.lang.String getDirNamePath()
                                throws XfsException
return a string representing the directory path in which this item lives i.e. "/testje/data"

Throws:
XfsException

setName

public void setName(java.lang.String name)
             throws XfsException
sets the item's name

Throws:
XfsException

move

public void move(User user,
                 java.lang.String fullpath)
          throws XfsException
changes the name and/or moves the item to another folder

Throws:
XfsException

getCreateTime

public java.lang.String getCreateTime()
Returns:
the time at which this was created

setCreateTime

public void setCreateTime(java.util.Date when)
                   throws XfsException
set the time at which this was created

Throws:
XfsException

getUpdateTime

public java.lang.String getUpdateTime()
Returns:
the time at which it was last modified

setUpdateTime

public void setUpdateTime(java.util.Date updated)
                   throws XfsException
sets the last modified time

Throws:
XfsException

getParentID

public java.lang.String getParentID()
get the ID of the item (folder) which contains this item


setParentID

public void setParentID(java.lang.String id)
                 throws XfsException
get the ID of the item (folder) which contains this item

Throws:
XfsException

getMimeType

public java.lang.String getMimeType()
get the item's MimeType


getChildren

public RepositoryItem[] getChildren()
                             throws XfsException
Returns:
all items that are children of this FOLDER item
Throws:
XfsException

getDeletedChildren

public RepositoryItem[] getDeletedChildren()
                                    throws XfsException
Returns:
all items that are children of this FOLDER item that have been marked inactive and for which there is no currently active version
Throws:
XfsException

getAllVersions

public RepositoryItem[] getAllVersions()
                                throws XfsException
Returns:
all revisions of this item that are still maintained in the system.
Throws:
XfsException

list

public void list(User user,
                 org.xml.sax.ContentHandler dest,
                 int depth)
          throws org.xml.sax.SAXException,
                 XfsException
emit the description of this item as XML.

Parameters:
dest - a SAX2 ContentHandler to write the xml
depth - in the case of folders, the depth to recursively list children
Throws:
org.xml.sax.SAXException
XfsException

setApplicationObject

public void setApplicationObject(java.lang.Object key,
                                 java.lang.Object value)
                          throws java.lang.UnsupportedOperationException
Associate an application object with a key for this item. allows application code to associate any arbitrary object with any given RepositoryItem. Implementations may refuse to support this functionality.

Throws:
java.lang.UnsupportedOperationException

getApplicationObject

public java.lang.Object getApplicationObject(java.lang.Object key)
                                      throws java.lang.UnsupportedOperationException
Return the application object identified by key for this item. allows application code to associate any arbitrary object with any given RepositoryItem. Implementations may refuse to support this functionality.

Throws:
java.lang.UnsupportedOperationException

listFolders

public void listFolders(User user,
                        org.xml.sax.ContentHandler dest,
                        int depth)
                 throws org.xml.sax.SAXException,
                        XfsException
emit the description of this item, and its folder descendents as XML.

Parameters:
dest - a SAX2 ContentHandler to write the xml
depth - in the case of folders, the depth to recursively list children
Throws:
org.xml.sax.SAXException
XfsException

createChildDirItem

public RepositoryItem createChildDirItem(User user,
                                         java.lang.String name)
                                  throws XfsException
creates a new FOLDER item as a child of this FOLDER

Throws:
XfsException

createChildXMLItem

public RepositoryItem createChildXMLItem(User user,
                                         java.lang.String name,
                                         java.lang.String mimeType)
                                  throws XfsException
creates a new XML item as a child of this FOLDER

Throws:
XfsException

createChildXMLItem

public RepositoryItem createChildXMLItem(User user,
                                         java.lang.String name,
                                         java.lang.String mimeType,
                                         java.io.InputStream is)
                                  throws XfsException
creates a new XML item as a child of this FOLDER

Throws:
XfsException

createChildTextItem

public RepositoryItem createChildTextItem(User user,
                                          java.lang.String name,
                                          java.lang.String mimeType)
                                   throws XfsException
creates a new item as a child of this directory

Throws:
XfsException

createChildTextItem

public RepositoryItem createChildTextItem(User user,
                                          java.lang.String name,
                                          java.lang.String mimeType,
                                          java.io.InputStream is)
                                   throws XfsException
creates a new item as a child of this directory

Throws:
XfsException

createChildBinaryItem

public RepositoryItem createChildBinaryItem(User user,
                                            java.lang.String name,
                                            java.lang.String mimeType)
                                     throws XfsException
creates a new item as a child of this directory

Throws:
XfsException

createChildBinaryItem

public RepositoryItem createChildBinaryItem(User user,
                                            java.lang.String name,
                                            java.lang.String mimeType,
                                            java.io.InputStream is)
                                     throws XfsException
creates a new item as a child of this directory

Throws:
XfsException

deleteSelf

public int deleteSelf()
               throws java.lang.Exception
Deprecated. As of FDX 3.5, use deleteSelf( Timestamp, boolean )

deletes the item from the repository

Throws:
java.lang.Exception

deleteSelf

public int deleteSelf(java.sql.Timestamp deleteTime,
                      boolean isSubItem)
               throws java.lang.Exception
deletes row/s from the XStore Item table, if applicable.

Throws:
java.lang.Exception

getBaseURI

public java.lang.String getBaseURI()
return the base URI for this item suitable for resolving relative references


openXMLWriter

public org.xml.sax.ContentHandler openXMLWriter()
                                         throws XfsException
get a SAX ContententHandler for writing XML content to the repository

Throws:
XfsException

openCharWriter

public java.io.Writer openCharWriter()
                              throws XfsException
get a Writer for writing character (text) content to the repository item

Throws:
XfsException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws XfsException
get an OutputStream for writing binary data to the repository item

Throws:
XfsException

openXMLReader

public org.xml.sax.XMLReader openXMLReader()
                                    throws XfsException
get a SAX XMLReader for reading (parsing) the repository XML content

Throws:
XfsException

openCharReader

public java.io.Reader openCharReader()
                              throws XfsException
gets a java character stream Reader for reading the item's character content from the repository

Throws:
XfsException

getInputStream

public java.io.InputStream getInputStream()
                                   throws XfsException
gets a java byte InputStream for reading the binary data content from the repository

Throws:
XfsException

getDAVProperty

public java.lang.String getDAVProperty(java.lang.String propertyName)
get the named webdav property associated with this item


setDAVProperty

public void setDAVProperty(java.lang.String propertyName,
                           java.lang.String propertyValue)
                    throws XfsException
set the named webdav property associated with this item

Throws:
XfsException

getRevisionNumber

public int getRevisionNumber()
returns the revision number of this item


isLatest

public boolean isLatest()
true if this item represents the latest (current) revision of the item with this name


isCheckedoutVersion

public boolean isCheckedoutVersion()
true if item with this name represents the checked out version of the item with this name


getCheckedoutVersion

public RepositoryItem getCheckedoutVersion(Transaction xact,
                                           User user)
                                    throws XfsException
get version of an item with this name which has been already checked out, as a part of a larger transaction

Throws:
XfsException

checkoutVersion

public RepositoryItem checkoutVersion(Transaction xact,
                                      User user)
                               throws XfsException
checkout a version of the item with this name, as a part of a larger transaction .

Parameters:
xact - transaction this operation participates in
user - the User on whose behalf we're checking out
Returns:
a checked out version which not accessible to other users
Throws:
XfsException

checkinCheckedoutVersion

public void checkinCheckedoutVersion(Transaction xact,
                                     User user)
                              throws XfsException
checkin a checkedout version of the item with this name, as a part of a larger transaction

Parameters:
xact - transaction this operation participates in
user - the User on whose behalf we're checking out
Throws:
XfsException

uncheckoutCheckedoutVersion

public void uncheckoutCheckedoutVersion(Transaction xact,
                                        User user)
                                 throws XfsException
uncheckout (cancel a checkout) by removing a checkedout version of item with this name, as a part of a larger transaction

Parameters:
xact - transaction this operation participates in
user - the User on whose behalf we're checking out
Throws:
XfsException