|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.store.PersistentObject
com.dec.gi.sql.SQLObject
com.groiss.dms.DocumentVersion
public class DocumentVersion
This is the class representing a version of a DMSForm in @enterprise.
| Field Summary | |
|---|---|
byte[] |
content
holds the version of the content of a DocForm, else it is empty. |
java.util.Date |
createdAt
Holds the date when this version was made. |
com.dec.avw.core.User |
createdBy
Holds the user who has made this version. |
java.lang.String |
description
Holds some description for this version. |
com.dec.avw.core.Form |
doc
Holds a reference to the document of which this is a version |
java.lang.String |
extension
Holds the extension of the versioned document, but only if it is a DocForm |
java.lang.String |
formContent
Holds the version of the forms html-page |
java.lang.String |
id
Holds the id of this version |
static int |
MAX_DESC_LENGTH
Holds the maximum length for the description field of a version |
byte[] |
messageDigest
Holds the message digest for the content of this version. |
static java.lang.String |
TMP_ID
|
| Fields inherited from class com.dec.gi.sql.SQLObject |
|---|
DO_BLIND |
| Fields inherited from class com.groiss.store.PersistentObject |
|---|
filled, oid, store |
| Fields inherited from interface com.groiss.store.Exportable |
|---|
emptyKeys |
| Constructor Summary | |
|---|---|
DocumentVersion()
|
|
DocumentVersion(com.dec.avw.core.Form doc,
com.dec.avw.core.User user,
java.lang.String description)
Creates a new version of a document. |
|
| Method Summary | |
|---|---|
protected void |
checkDescription()
Checks if the description is not longer as allowed. |
void |
delete()
This method deletes a document version from the database. |
void |
finalizeVersion()
This methods sets the id and creation date correctly and will update the version object but only if this version is a temporary version |
byte[] |
getContent()
Returns the content of this version |
java.util.Date |
getCreatedAt()
Returns the creation date of this version. |
com.dec.avw.core.User |
getCreatedBy()
Returns the user who has made this version. |
java.lang.String |
getDescription()
Returns the description of this version. |
com.dec.avw.core.Form |
getDocument()
Returns the document which is the origin of this version. |
java.lang.String |
getExtension()
Returns the extension of the document at the time of the version |
com.dec.gi.sql.FieldDescriptor |
getFieldDescriptor(java.lang.String field)
Returns the field descriptor for the passed field or null if there is none. |
java.lang.String |
getFormContent()
Returns the content of the metadata form of this version |
byte[] |
getMessageDigest()
Returns the message digest of the content of this document. |
java.lang.String |
getTableName()
This method must return the table name of the database table in which this persistent object is stored. |
void |
insert()
This method inserts a document version into the database. |
boolean |
isContentEqual(byte[] data)
This method checks if the passed array is equal to the content of this version. |
boolean |
isFormEqual(byte[] data)
This method checks if the passed array is equal to the htmlpage of this version. |
boolean |
isMessageDigestEqual(byte[] md)
Checks if the message digest of this version is equal to the passed one |
void |
saveToLocal(java.io.OutputStream os)
Write this document to the file system. |
void |
setContent()
Fills the content of this object. |
void |
update()
|
| Methods inherited from class com.dec.gi.sql.SQLObject |
|---|
addRequiredObjects, beforeImport, clone, count, count, dbAttrs, dbFieldString, delete, delete, delete, executeStatement, executeStatement, exportAsElements, get, get, get, get, get2, getCache, getFieldName, getHTMLClass, getKey, getKeys, getLocalClassName, getLocalObjectName, getLoggingContext, getNoCache, getStore, getTableDefinition, getValue, getValueText, hasRows, hasRows, ignoreFields, inDatabase, insertBlind, isValid, list, list, list, list, list2, list2, onInsert, onUpdate, retrieveLoggingContextByOid, setEmpty, setFromDB, setNewOid, setOid, setValues, setValues, table, table, toListString, updateBlind |
| Methods inherited from class com.groiss.store.PersistentObject |
|---|
dbFields, equals, getOid, hashCode, isFilled, onDelete, onRead, setFilled, setOid, setStore |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TMP_ID
public static final int MAX_DESC_LENGTH
public com.dec.avw.core.Form doc
public com.dec.avw.core.User createdBy
public java.util.Date createdAt
public java.lang.String description
public java.lang.String id
public byte[] messageDigest
public java.lang.String extension
public java.lang.String formContent
public volatile byte[] content
| Constructor Detail |
|---|
public DocumentVersion()
public DocumentVersion(com.dec.avw.core.Form doc,
com.dec.avw.core.User user,
java.lang.String description)
throws java.lang.Exception
doc - the document which should be versioneduser - the user who makes the versiondescription - the description for this version
java.lang.Exception| Method Detail |
|---|
public com.dec.avw.core.User getCreatedBy()
public java.util.Date getCreatedAt()
public java.lang.String getDescription()
public java.lang.String getExtension()
public com.dec.avw.core.Form getDocument()
public byte[] getContent()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getFormContent()
public void setContent()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getTableName()
Persistent
public void insert()
throws java.lang.Exception
insert in class com.dec.gi.sql.SQLObjectjava.lang.Exception
public void delete()
throws java.lang.Exception
delete in class com.dec.gi.sql.SQLObjectjava.lang.Exception
public void update()
throws java.lang.Exception
update in class com.dec.gi.sql.SQLObjectjava.lang.Exception
public void saveToLocal(java.io.OutputStream os)
throws java.lang.Exception
os - the output stream to write on
java.lang.Exception
public boolean isFormEqual(byte[] data)
throws java.lang.Exception
data - the byte array which should be compared with the htmlpage of this version
java.lang.Exception
public boolean isContentEqual(byte[] data)
throws java.lang.Exception
data - the byte array which should be compared with the content of this version
java.lang.Exception
public boolean isMessageDigestEqual(byte[] md)
throws java.lang.Exception
md - the message digest which should be compared
java.lang.Exceptionpublic byte[] getMessageDigest()
protected void checkDescription()
public com.dec.gi.sql.FieldDescriptor getFieldDescriptor(java.lang.String field)
getFieldDescriptor in class com.dec.gi.sql.SQLObjectfield - the field for which the descriptor is wanted
public void finalizeVersion()
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||