public class WGDocumentCoreWrapper extends java.lang.Object implements WGDocumentCore
| Constructor and Description |
|---|
WGDocumentCoreWrapper(WGDocumentCore core) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
attachFile(java.io.File file)
Attach a file from disk to the document
|
WGFileDerivateMetaData |
createFileDerivate(java.lang.String originalFileName,
java.lang.String creator,
java.lang.String derivateName,
java.io.InputStream in,
java.util.Map<java.lang.String,java.lang.Object> customMdFields)
Creates a derivate for the addressed file.
|
void |
dispose()
Called when this core is disposed "untimely", i.e. before the current session is closed
|
java.lang.Object |
evaluateExpression(java.lang.String expression)
Evaluates an expression in a database-native expression language on this document core.
|
java.util.Date |
getCreated()
Retrieves the creation date of this document.
|
java.lang.Object |
getExtensionData(java.lang.String strName)
Returns the value of an extension data field.
|
java.util.List |
getExtensionDataNames()
Returns the names of all extension data fields on this entity
|
java.lang.Object |
getFastAccessKey()
Can provide an fast access key, that the corresponding database core implementation can use to re-retrieve an instance of this core.
|
java.io.InputStream |
getFileData(java.lang.String strFile)
Retrieves an input stream to the data of an embedded file.
|
java.io.InputStream |
getFileDerivateData(java.lang.String id)
Returns the data of a file derivate.
|
WGFileDerivateMetaData |
getFileDerivateMetaData(java.lang.String id)
Returns the metadata of a file derivate.
|
java.util.List<WGFileDerivateMetaData> |
getFileDerivates(java.lang.String strFile)
Returns metadata about the created derivates for the given file.
|
WGFileMetaData |
getFileMetaData(java.lang.String strFile)
retrieves meta informations for the given file
May throw an exception if method is used on a document that does not serve file metadata.
|
java.util.List |
getFileNames()
Returns a list of the names of embedded files.
|
int |
getFileSize(java.lang.String strFile)
Returns the size of an embedded file in bytes.
|
java.util.List |
getItemNames()
Returns the names of all items in this document
|
java.lang.Object |
getItemValue(java.lang.String strName)
Returns the value of an content item.
|
java.util.Date |
getLastModified()
Returns the date of the last modification of this document.
|
java.util.Iterator<WGUpdateLog> |
getLastUpdates()
Returns update logs for the last updates done on this document, in descending chronological order
|
java.lang.Object |
getMetaData(java.lang.String type)
Retrieves various meta data for the document core.
|
java.lang.Object |
getNativeObject()
Returns the native backend object of this doc core if there is any
|
java.lang.String |
getOriginDatabase()
Returns the dbReference of the database that this document core was created from
|
WGDocumentCore |
getRelation(java.lang.String name)
Retrieves the target content document of the given content relation
|
WGRelationData |
getRelationData(java.lang.String name)
Retrieves data for the given content relation.
|
java.util.List<java.lang.String> |
getRelationNames()
Returns the names of all relations that this content document holds
|
java.util.List<java.lang.String> |
getRelationNamesOfGroup(java.lang.String group,
WGColumnSet order)
Returns the names of all relations on this content document that
belong to the given relation group.
|
int |
getType()
Returns the type of this document.
|
boolean |
hasFile(java.lang.String file)
Tests if a file of the given name is attached to the document
|
boolean |
hasFileMetadata()
Determines if this document serves metadata for file attachments
|
boolean |
hasItem(java.lang.String strName)
Tests, if the content contains an item of the given name.
|
boolean |
isDataCacheable()
Should return, if the data retrieved as items and metas of this document can be cached while the document doesn't change
|
boolean |
isDeleted()
Tests, if this document is marked as deleted.
|
boolean |
isSaved()
Should return if the document has been saved.
|
boolean |
isTemporary()
Should return true, if this document core cannot be re-retrieved by it's individual key.
|
void |
markFileMetaDataModified(WGFileMetaData md)
Marks a file metadata object as being modified, so the core knows that it must be saved
|
WGDatabaseRevision |
remove()
Removes this document from the database
|
void |
removeExtensionData(java.lang.String strName)
Removes an extension data field from this entity
|
boolean |
removeFile(java.lang.String name)
Removes a file attachment from this document
|
void |
removeFileDerivate(java.lang.String id)
Deletes an existing file derivate
|
boolean |
removeItem(java.lang.String Name)
Removes an item from the document
|
WGDocumentCore |
removeRelation(java.lang.String name)
Removes a content relation
|
void |
renameFile(java.lang.String oldFileName,
java.lang.String newFileName)
Renames an attached file
|
WGExtensionDataContainer |
retrieveFileExtensionDataHandler(java.lang.String strFile)
retrieves the extension data handler for the given file or null if extension data is not supported
|
WGDatabaseRevision |
save(java.util.Date lastModified)
Called to save modifications to this document core.
|
boolean |
setItemValue(java.lang.String strName,
java.lang.Object value)
Sets a new value for a content item.
|
boolean |
setMetaData(java.lang.String name,
java.lang.Object value)
Modifies various meta data for the document core.
|
WGDocumentCore |
setRelation(WGRelationData data)
Sets a content relation to the designated target
|
void |
setWGDocument(WGDocument doc)
Called by the WGAPI after instantiation of this document core to provide a reference to the wrapping WGDocument object.
|
void |
writeExtensionData(java.lang.String strName,
java.lang.Object value)
Sets the value of an extension data field.
|
void |
writeFileDerivateMetaData(WGFileDerivateMetaData md)
Writes the modified metadata of a file derivate to the database.
|
public WGDocumentCoreWrapper(WGDocumentCore core)
public boolean attachFile(java.io.File file)
throws WGAPIException
WGDocumentCoreattachFile in interface WGDocumentCoreWGAPIExceptionpublic void dispose()
throws WGAPIException
WGDocumentCoredispose in interface WGDocumentCoreWGAPIExceptionpublic java.lang.Object evaluateExpression(java.lang.String expression)
throws WGAPIException
WGDocumentCoreevaluateExpression in interface WGDocumentCoreexpression - The expression to be evaluatedWGExpressionExceptionWGBackendExceptionWGAPIExceptionpublic java.util.Date getCreated()
throws WGAPIException
WGDocumentCoregetCreated in interface WGDocumentCoreWGAPIExceptionpublic java.lang.Object getFastAccessKey()
throws WGBackendException
WGDocumentCoregetFastAccessKey in interface WGDocumentCoreWGBackendExceptionpublic java.io.InputStream getFileData(java.lang.String strFile)
throws WGAPIException
WGDocumentCoregetFileData in interface WGDocumentCorestrFile - The name of the fileWGAPIExceptionpublic java.util.List getFileNames()
throws WGAPIException
WGDocumentCoregetFileNames in interface WGDocumentCoreWGBackendExceptionWGAPIExceptionpublic int getFileSize(java.lang.String strFile)
throws WGAPIException
WGDocumentCoregetFileSize in interface WGDocumentCorestrFile - The name of the file, whose size is requested.WGAPIExceptionpublic java.util.List getItemNames()
throws WGAPIException
WGDocumentCoregetItemNames in interface WGDocumentCoreWGBackendExceptionWGAPIExceptionpublic java.lang.Object getItemValue(java.lang.String strName)
throws WGAPIException
WGDocumentCoregetItemValue in interface WGDocumentCorestrName - Name of the requested content item.WGAPIExceptionpublic java.util.Date getLastModified()
throws WGAPIException
WGDocumentCoregetLastModified in interface WGDocumentCoreWGAPIExceptionpublic java.lang.Object getMetaData(java.lang.String type)
throws WGAPIException
WGDocumentCoregetMetaData in interface WGDocumentCoretype - The type of the meta data. See constants META_ of the specific WGDocument subclass for this doc class.WGAPIExceptionpublic java.lang.Object getNativeObject()
throws WGAPIException
WGDocumentCoregetNativeObject in interface WGDocumentCoreWGBackendExceptionWGAPIExceptionpublic int getType()
WGDocumentCoregetType in interface WGDocumentCorepublic boolean hasItem(java.lang.String strName)
throws WGAPIException
WGDocumentCorehasItem in interface WGDocumentCoreWGBackendExceptionWGAPIExceptionpublic boolean isDataCacheable()
WGDocumentCoreisDataCacheable in interface WGDocumentCorepublic boolean isDeleted()
throws WGAPIException
WGDocumentCoreisDeleted in interface WGDocumentCoreWGAPIExceptionpublic boolean isSaved()
throws WGAPIException
WGDocumentCoreisSaved in interface WGDocumentCoreWGAPIExceptionpublic boolean isTemporary()
throws WGAPIException
WGDocumentCoreisTemporary in interface WGDocumentCoreWGAPIExceptionpublic WGDatabaseRevision remove() throws WGAPIException
WGDocumentCoreremove in interface WGDocumentCoreWGAPIExceptionpublic boolean removeFile(java.lang.String name)
throws WGAPIException
WGDocumentCoreremoveFile in interface WGDocumentCorename - Name of the file to removeWGAPIExceptionpublic boolean removeItem(java.lang.String Name)
throws WGAPIException
WGDocumentCoreremoveItem in interface WGDocumentCoreName - Name of the item to removeWGIllegalArgumentExceptionWGAPIExceptionpublic WGDatabaseRevision save(java.util.Date lastModified) throws WGAPIException
WGDocumentCoresave in interface WGDocumentCoreWGAPIExceptionpublic boolean setItemValue(java.lang.String strName,
java.lang.Object value)
throws WGAPIException
WGDocumentCoresetItemValue in interface WGDocumentCorestrName - Name of the item to be modified.value - New value of the itemWGAPIExceptionpublic boolean setMetaData(java.lang.String name,
java.lang.Object value)
throws WGAPIException
WGDocumentCoresetMetaData in interface WGDocumentCorename - The name of the meta data. See constants META_ of the specific WGDocument subclass for this doc class.WGAPIExceptionpublic void setWGDocument(WGDocument doc)
WGDocumentCoresetWGDocument in interface WGDocumentCoredoc - The WGDocument object, that wraps this document core.public java.lang.String getOriginDatabase()
WGDocumentCoregetOriginDatabase in interface WGDocumentCorepublic void renameFile(java.lang.String oldFileName,
java.lang.String newFileName)
throws WGAPIException
WGDocumentCorerenameFile in interface WGDocumentCoreoldFileName - - file to renamenewFileName - - new name for the fileWGAPIExceptionpublic WGFileMetaData getFileMetaData(java.lang.String strFile) throws WGAPIException
WGDocumentCoreWGDocumentCore.hasFileMetadata() to determine if metadata is present.getFileMetaData in interface WGDocumentCorestrFile - - the filenameWGAPIExceptionpublic WGDocumentCore getRelation(java.lang.String name) throws WGAPIException
WGDocumentCoregetRelation in interface WGDocumentCorename - Name of the relationWGAPIExceptionpublic java.util.List<java.lang.String> getRelationNames()
throws WGAPIException
WGDocumentCoregetRelationNames in interface WGDocumentCoreWGAPIExceptionpublic WGDocumentCore removeRelation(java.lang.String name) throws WGAPIException
WGDocumentCoreremoveRelation in interface WGDocumentCorename - Name of the relationWGAPIExceptionpublic boolean hasFileMetadata()
throws WGAPIException
WGDocumentCorehasFileMetadata in interface WGDocumentCoreWGAPIExceptionpublic boolean hasFile(java.lang.String file)
throws WGAPIException
WGDocumentCorehasFile in interface WGDocumentCoreWGBackendExceptionWGAPIExceptionpublic java.lang.Object getExtensionData(java.lang.String strName)
throws WGAPIException
WGExtensionDataContainergetExtensionData in interface WGExtensionDataContainerstrName - Name of the requested field.WGAPIExceptionpublic java.util.List getExtensionDataNames()
throws WGAPIException
WGExtensionDataContainergetExtensionDataNames in interface WGExtensionDataContainerWGBackendExceptionWGAPIExceptionpublic void removeExtensionData(java.lang.String strName)
throws WGAPIException
WGExtensionDataContainerremoveExtensionData in interface WGExtensionDataContainerstrName - Name of the field to remove.WGAPIExceptionpublic void writeExtensionData(java.lang.String strName,
java.lang.Object value)
throws WGAPIException
WGExtensionDataContainerwriteExtensionData in interface WGExtensionDataContainerstrName - Name of the requested field.value - The value of the fieldWGAPIExceptionpublic WGRelationData getRelationData(java.lang.String name) throws WGAPIException
WGDocumentCoregetRelationData in interface WGDocumentCorename - The name of the relationWGAPIExceptionpublic WGDocumentCore setRelation(WGRelationData data) throws WGAPIException
WGDocumentCoresetRelation in interface WGDocumentCoredata - All data of the relationWGAPIExceptionpublic java.util.List<java.lang.String> getRelationNamesOfGroup(java.lang.String group,
WGColumnSet order)
throws WGAPIException
WGDocumentCoregetRelationNamesOfGroup in interface WGDocumentCoregroup - The group nameorder - Optional order in which to return relations, evaluated against the relation targets, null for no orderWGBackendExceptionWGAPIExceptionpublic WGExtensionDataContainer retrieveFileExtensionDataHandler(java.lang.String strFile) throws WGAPIException
WGDocumentCoreretrieveFileExtensionDataHandler in interface WGDocumentCorestrFile - - the filenameWGAPIExceptionpublic java.util.List<WGFileDerivateMetaData> getFileDerivates(java.lang.String strFile) throws WGAPIException
WGDocumentCoregetFileDerivates in interface WGDocumentCorestrFile - The file nameWGAPIExceptionpublic void markFileMetaDataModified(WGFileMetaData md) throws WGAPIException
WGDocumentCoremarkFileMetaDataModified in interface WGDocumentCoreWGAPIExceptionpublic WGFileDerivateMetaData createFileDerivate(java.lang.String originalFileName, java.lang.String creator, java.lang.String derivateName, java.io.InputStream in, java.util.Map<java.lang.String,java.lang.Object> customMdFields) throws WGAPIException, WGNotSupportedException
WGDocumentCorecreateFileDerivate in interface WGDocumentCoreoriginalFileName - The name of the original filecreator - Identifier of the creator class of this derivatederivateName - Name of the derivatein - The data of the derivate filecustomMdFields - Additional custom file metadata fields to store for the derivateWGAPIExceptionWGNotSupportedException - if derivates are not supported on this databasepublic void removeFileDerivate(java.lang.String id)
throws WGAPIException
WGDocumentCoreremoveFileDerivate in interface WGDocumentCoreid - The ID of the derivateWGAPIExceptionpublic WGFileDerivateMetaData getFileDerivateMetaData(java.lang.String id) throws WGAPIException
WGDocumentCoregetFileDerivateMetaData in interface WGDocumentCoreid - The ID of the derivateWGAPIExceptionpublic void writeFileDerivateMetaData(WGFileDerivateMetaData md) throws WGAPIException, WGNotSupportedException
WGDocumentCorewriteFileDerivateMetaData in interface WGDocumentCoremd - The metadataWGAPIExceptionWGNotSupportedException - if derivates are not supported on this databasepublic java.io.InputStream getFileDerivateData(java.lang.String id)
throws WGAPIException
WGDocumentCoregetFileDerivateData in interface WGDocumentCoreid - The ID of the derivateWGAPIExceptionpublic java.util.Iterator<WGUpdateLog> getLastUpdates() throws WGAPIException
WGDocumentCoregetLastUpdates in interface WGDocumentCoreWGAPIException