|
Qizx fe-4.4p2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LibraryMember
Common interface for objects belonging to a Library, namely Collections and Documents.
Field Summary | |
---|---|
static String |
COLLECTION
Value of the predefined property 'nature' for a Collection, equal to "collection". |
static String |
DOCUMENT
Value of the predefined property 'nature' for a Document, equal to "document". |
static String |
NATURE
Name of the predefined property 'nature', whose value is one of the strings "collection" or "document". |
static String |
NONXMLDOC
Value of the predefined property 'nature' for a non-XML Document, equal to "non-xml". |
static String |
PATH
Name of the predefined property 'path', whose value is also returned by the getPath() method. |
Method Summary | |
---|---|
boolean |
contains(LibraryMember other)
Returns true if that member (Document or Collection) is contained inside this member. |
void |
copyTo(String newPath)
Copies the Document or Collection to another location. |
void |
delete()
Deletes the Document or Collection. |
boolean |
exists()
Returns true if the member actually exists (not deleted). |
long |
getIntegerProperty(String propName)
Convenience method: returns the integer value of a property. |
Library |
getLibrary()
Returns the Library session owning this member. |
String |
getName()
Returns the name of the member inside its enclosing Collection. |
Collection |
getParent()
Returns the Collection that directly contains this member. |
String |
getParentPath()
Returns the path of the parent of the enclosing Collection. |
String |
getPath()
Returns the complete path of the member inside its Library. |
Object |
getProperty(String propName)
Gets the value of a property by its name. |
String[] |
getPropertyNames()
Returns a sorted list of current property names of the object. |
boolean |
hasProperty(String propName)
Tests if this member has a property of the specified name. |
boolean |
isCollection()
Returns true if the member is a Collection. |
boolean |
isDocument()
Returns true if the member is a Document (XML or non-XML). |
boolean |
lock(int timeoutMillis)
Starts an update transaction by locking this member (Document or Collection). |
Object |
removeProperty(String propName)
Deletes a property. |
void |
renameTo(String newPath)
Renames the Document or Collection. |
Object |
setIntegerProperty(String propName,
long propValue)
Convenience method: defines a long integer property. |
Object |
setProperty(String propName,
Object propValue)
Changes the value of a property. |
Field Detail |
---|
static final String PATH
static final String NATURE
static final String COLLECTION
static final String DOCUMENT
static final String NONXMLDOC
Method Detail |
---|
Library getLibrary()
boolean exists()
boolean isCollection()
boolean isDocument()
String getPath()
String getName()
String getParentPath()
Collection getParent() throws DataModelException
null
is returned for the root collection ("/").
DataModelException
- if the library is closed; if the member
is already deletedboolean contains(LibraryMember other)
other
- another library member to check for containment
boolean lock(int timeoutMillis) throws DataModelException
This method is almost equivalent to calling Library.lockCollection(java.lang.String, int)
or Library.lockDocument(java.lang.String, int)
on this Library
member.
The difference is that an exception is thrown if it is found that this object no longer exists in the refreshed state of the Library (due to a deletion by another transaction). In contrast, lockCollection and lockDocument simply return null.
Note: this method exists for historical reasons. It is recommended to use lockCollection and lockDocument instead.
timeoutMillis
- a maximum time in milliseconds to wait for when
the object is already locked. After that time the method returns false
and no lock is set.
DataModelException
- if the member has been deleted by another
transaction; if the library is closedvoid copyTo(String newPath) throws DataModelException
A Collection is recursively copied with all its contents.
As for other updating operations, should be followed by a commit to take effect permanently.
newPath
- path of the copy. It is an error (exception thrown) if
this path points to an existing Library member.
DataModelException
- if the library is closed; if the member
is already deleted; if the newPath points to an existing member or
points inside a non-existing collection,void renameTo(String newPath) throws DataModelException
Upon successful completion, the path of the library member is updated according the path specified.
As for other updating operations, should be followed by a commit to take effect permanently.
newPath
- new path of the member. It is an error (exception
thrown) if this path points to an existing Member.
DataModelException
- if the library is closed; if the member
is already deleted; if the newPath points to an existing document or
points inside a non-existing collection,void delete() throws DataModelException
When applied on a Collection, deletes recursively all enclosed documents and collections. Equivalent to Library.deleteMember(getPath()).
DataModelException
- if the library is closed; if the member
is already deletedString[] getPropertyNames() throws DataModelException
DataModelException
- if the library member is deleted; if the
Library is closed.boolean hasProperty(String propName) throws DataModelException
propName
- name of a property (simple XML name without colon).
DataModelException
- if the library member is deleted; if the
Library is closed.Object getProperty(String propName) throws DataModelException
propName
- name of a property (simple XML name without colon).
Caution: though a property can have any serializable value, some conversions are performed in setProperty.
DataModelException
- if the library member is deleted; if the
Library is closed.setProperty(java.lang.String, java.lang.Object)
Object setProperty(String propName, Object propValue) throws DataModelException
propName
- name of a property (simple XML name without colon).propValue
- the new value to set. The value can be of any
serializable Java type, but some types are treated specially:
Node
) is stored as such. Attention: DOM nodes, and
other kinds of XML representations, are not recognized and not
converted automatically. They have to be first converted using
ItemFactory.
Item
created using ItemFactory.createItem(java.lang.Object, com.qizx.api.ItemType)
. The
item can be cast to one of types supported by properties: boolean, long,
double, date, string.
null
otherwise.
DataModelException
- if the library member is deleted; if the
Library is closed.getProperty(java.lang.String)
Object removeProperty(String propName) throws DataModelException
propName
- name of a property (simple XML name without colon).
null
otherwise.
DataModelException
- if the library member is deleted; if the
Library is closed.long getIntegerProperty(String propName) throws DataModelException
propName
- name of a property (simple XML name without colon).
DataModelException
- if the library member is deleted; if the
Library is closed.Object setIntegerProperty(String propName, long propValue) throws DataModelException
propName
- name of a property (simple XML name without colon).propValue
- long integer new value
DataModelException
- if the library member is deleted; if the
Library is closed.
|
© 2010 Axyana Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |