org.outerj.daisy.repository.commonimpl
Class DocumentImpl
java.lang.Object
org.outerj.daisy.repository.commonimpl.DocumentImpl
- All Implemented Interfaces:
- DocumentWrapper, org.outerj.daisy.repository.Document
public class DocumentImpl
- extends java.lang.Object
- implements org.outerj.daisy.repository.Document, DocumentWrapper
Implementation of the Document interface.
This document implementation depends on a DocumentStrategy
which allows
the persistence logic for the document to be pluggable.
Please note that all methods in this class that are not present in the Document interface,
including public methods, are considered to be *for internal use only* and hence should
never be called by "end users".
Method Summary |
void |
addLink(java.lang.String title,
java.lang.String target)
|
void |
addToCollection(org.outerj.daisy.repository.DocumentCollection collection)
|
boolean |
canReadLiveOnly()
|
void |
changeDocumentType(long documentTypeId)
|
void |
changeDocumentType(java.lang.String documentTypeName)
|
void |
clearCollections()
|
void |
clearCustomFields()
|
void |
clearLinks()
|
void |
clearLockInfo()
|
void |
deleteCustomField(java.lang.String name)
|
void |
deleteField(long fieldTypeId)
|
void |
deleteField(java.lang.String name)
|
void |
deleteLink(int index)
|
void |
deletePart(long partTypeId)
|
void |
deletePart(java.lang.String name)
|
org.outerj.daisy.repository.AvailableVariants |
getAvailableVariants()
|
long |
getBranchId()
|
org.outerj.daisy.repository.DocumentCollections |
getCollections()
|
java.util.Date |
getCreated()
|
java.lang.String |
getCustomField(java.lang.String name)
|
java.util.Map |
getCustomFields()
|
long |
getDocumentTypeId()
|
org.outerj.daisy.repository.Field |
getField(long fieldTypeId)
|
org.outerj.daisy.repository.Field |
getField(java.lang.String name)
|
org.outerj.daisy.repository.Fields |
getFields()
|
org.outerj.daisy.repository.Fields |
getFieldsInOrder()
|
long |
getId()
|
DocumentImpl.IntimateAccess |
getIntimateAccess(DocumentStrategy documentStrategy)
|
long |
getLanguageId()
|
java.util.Date |
getLastModified()
|
long |
getLastModifier()
|
org.outerj.daisy.repository.Version |
getLastVersion()
|
long |
getLastVersionId()
|
org.outerj.daisy.repository.Links |
getLinks()
|
org.outerj.daisy.repository.Version |
getLiveVersion()
|
long |
getLiveVersionId()
|
org.outerj.daisy.repository.LockInfo |
getLockInfo(boolean fresh)
|
java.lang.String |
getName()
|
org.outerj.daisy.repository.VersionState |
getNewVersionState()
|
long |
getOwner()
|
org.outerj.daisy.repository.Part |
getPart(long partTypeId)
|
org.outerj.daisy.repository.Part |
getPart(java.lang.String name)
|
org.outerj.daisy.repository.Parts |
getParts()
|
org.outerj.daisy.repository.Parts |
getPartsInOrder()
|
java.lang.String |
getSummary()
|
long |
getUpdateCount()
|
long |
getVariantCreatedFromBranchId()
|
long |
getVariantCreatedFromLanguageId()
|
long |
getVariantCreatedFromVersionId()
|
org.outerj.daisy.repository.VariantKey |
getVariantKey()
|
java.util.Date |
getVariantLastModified()
|
long |
getVariantLastModifier()
|
long |
getVariantUpdateCount()
|
org.outerj.daisy.repository.Version |
getVersion(long versionId)
|
org.outerj.daisy.repository.Versions |
getVersions()
|
DocumentImpl |
getWrappedDocument(DocumentStrategy strategy)
|
org.outerx.daisy.x10.DocumentDocument |
getXml()
|
org.outerx.daisy.x10.DocumentDocument |
getXml(long versionId)
|
org.outerx.daisy.x10.DocumentDocument |
getXmlWithoutVariant()
|
org.outerx.daisy.x10.DocumentDocument |
getXmlWithoutVersionedData()
|
boolean |
hasCustomField(java.lang.String name)
|
boolean |
hasField(long fieldTypeId)
|
boolean |
hasField(java.lang.String fieldTypeName)
|
boolean |
hasPart(long partTypeId)
|
boolean |
hasPart(java.lang.String name)
|
boolean |
inCollection(org.outerj.daisy.repository.DocumentCollection collection)
|
boolean |
inCollection(long collectionId)
|
boolean |
isNew()
|
boolean |
isPrivate()
|
boolean |
isReadOnly()
|
boolean |
isRetired()
|
boolean |
isVariantNew()
|
boolean |
lock(long duration,
org.outerj.daisy.repository.LockType lockType)
|
void |
makeReadOnly()
|
boolean |
needsSaving()
|
boolean |
releaseLock()
|
void |
removeFromCollection(org.outerj.daisy.repository.DocumentCollection collection)
|
void |
save()
|
void |
save(boolean validate)
|
void |
setCustomField(java.lang.String name,
java.lang.String value)
|
void |
setField(long fieldTypeId,
java.lang.Object value)
|
void |
setField(java.lang.String name,
java.lang.Object value)
|
void |
setName(java.lang.String name)
|
void |
setNewVersionState(org.outerj.daisy.repository.VersionState versionState)
|
void |
setOwner(long userId)
|
void |
setPart(long partTypeId,
java.lang.String mimeType,
byte[] data)
|
void |
setPart(long partTypeId,
java.lang.String mimeType,
org.outerj.daisy.repository.PartDataSource partDataSource)
|
void |
setPart(java.lang.String partTypeName,
java.lang.String mimeType,
byte[] data)
|
void |
setPart(java.lang.String partTypeName,
java.lang.String mimeType,
org.outerj.daisy.repository.PartDataSource partDataSource)
|
void |
setPartFileName(long partTypeId,
java.lang.String fileName)
|
void |
setPartFileName(java.lang.String partTypeName,
java.lang.String fileName)
|
void |
setPartMimeType(long partTypeId,
java.lang.String mimeType)
|
void |
setPartMimeType(java.lang.String partTypeName,
java.lang.String mimeType)
|
void |
setPrivate(boolean _private)
|
void |
setRetired(boolean retired)
|
java.lang.String |
toString()
|
void |
validate()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ERROR_ACCESSING_REPOSITORY_SCHEMA
public static final java.lang.String ERROR_ACCESSING_REPOSITORY_SCHEMA
- See Also:
- Constant Field Values
DocumentImpl
public DocumentImpl(DocumentStrategy documentStrategy,
CommonRepository repository,
AuthenticatedUser currentUser,
long documentTypeId,
long branchId,
long languageId)
getIntimateAccess
public DocumentImpl.IntimateAccess getIntimateAccess(DocumentStrategy documentStrategy)
getWrappedDocument
public DocumentImpl getWrappedDocument(DocumentStrategy strategy)
- Specified by:
getWrappedDocument
in interface DocumentWrapper
canReadLiveOnly
public boolean canReadLiveOnly()
- Specified by:
canReadLiveOnly
in interface org.outerj.daisy.repository.Document
getId
public long getId()
- Specified by:
getId
in interface org.outerj.daisy.repository.Document
isNew
public boolean isNew()
getBranchId
public long getBranchId()
- Specified by:
getBranchId
in interface org.outerj.daisy.repository.Document
getLanguageId
public long getLanguageId()
- Specified by:
getLanguageId
in interface org.outerj.daisy.repository.Document
getVariantKey
public org.outerj.daisy.repository.VariantKey getVariantKey()
- Specified by:
getVariantKey
in interface org.outerj.daisy.repository.Document
isVariantNew
public boolean isVariantNew()
- Specified by:
isVariantNew
in interface org.outerj.daisy.repository.Document
getAvailableVariants
public org.outerj.daisy.repository.AvailableVariants getAvailableVariants()
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getAvailableVariants
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getDocumentTypeId
public long getDocumentTypeId()
- Specified by:
getDocumentTypeId
in interface org.outerj.daisy.repository.Document
changeDocumentType
public void changeDocumentType(long documentTypeId)
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
changeDocumentType
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
changeDocumentType
public void changeDocumentType(java.lang.String documentTypeName)
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
changeDocumentType
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getOwner
public long getOwner()
- Specified by:
getOwner
in interface org.outerj.daisy.repository.Document
setOwner
public void setOwner(long userId)
- Specified by:
setOwner
in interface org.outerj.daisy.repository.Document
isPrivate
public boolean isPrivate()
- Specified by:
isPrivate
in interface org.outerj.daisy.repository.Document
setPrivate
public void setPrivate(boolean _private)
- Specified by:
setPrivate
in interface org.outerj.daisy.repository.Document
getField
public org.outerj.daisy.repository.Field getField(java.lang.String name)
throws org.outerj.daisy.repository.FieldNotFoundException
- Specified by:
getField
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.FieldNotFoundException
getField
public org.outerj.daisy.repository.Field getField(long fieldTypeId)
throws org.outerj.daisy.repository.FieldNotFoundException
- Specified by:
getField
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.FieldNotFoundException
hasField
public boolean hasField(long fieldTypeId)
- Specified by:
hasField
in interface org.outerj.daisy.repository.Document
hasField
public boolean hasField(java.lang.String fieldTypeName)
- Specified by:
hasField
in interface org.outerj.daisy.repository.Document
getFields
public org.outerj.daisy.repository.Fields getFields()
- Specified by:
getFields
in interface org.outerj.daisy.repository.Document
getFieldsInOrder
public org.outerj.daisy.repository.Fields getFieldsInOrder()
- Specified by:
getFieldsInOrder
in interface org.outerj.daisy.repository.Document
setField
public void setField(java.lang.String name,
java.lang.Object value)
throws org.outerj.daisy.repository.DocumentTypeInconsistencyException
- Specified by:
setField
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.DocumentTypeInconsistencyException
setField
public void setField(long fieldTypeId,
java.lang.Object value)
throws org.outerj.daisy.repository.DocumentTypeInconsistencyException
- Specified by:
setField
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.DocumentTypeInconsistencyException
deleteField
public void deleteField(java.lang.String name)
- Specified by:
deleteField
in interface org.outerj.daisy.repository.Document
deleteField
public void deleteField(long fieldTypeId)
- Specified by:
deleteField
in interface org.outerj.daisy.repository.Document
getLockInfo
public org.outerj.daisy.repository.LockInfo getLockInfo(boolean fresh)
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getLockInfo
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
clearLockInfo
public void clearLockInfo()
lock
public boolean lock(long duration,
org.outerj.daisy.repository.LockType lockType)
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
lock
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
releaseLock
public boolean releaseLock()
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
releaseLock
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getXml
public org.outerx.daisy.x10.DocumentDocument getXml()
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getXml
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getXml
public org.outerx.daisy.x10.DocumentDocument getXml(long versionId)
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getXml
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getXmlWithoutVersionedData
public org.outerx.daisy.x10.DocumentDocument getXmlWithoutVersionedData()
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getXmlWithoutVersionedData
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getXmlWithoutVariant
public org.outerx.daisy.x10.DocumentDocument getXmlWithoutVariant()
- Specified by:
getXmlWithoutVariant
in interface org.outerj.daisy.repository.Document
setName
public void setName(java.lang.String name)
- Specified by:
setName
in interface org.outerj.daisy.repository.Document
getName
public java.lang.String getName()
- Specified by:
getName
in interface org.outerj.daisy.repository.Document
setPart
public void setPart(java.lang.String partTypeName,
java.lang.String mimeType,
byte[] data)
throws org.outerj.daisy.repository.DocumentTypeInconsistencyException
- Specified by:
setPart
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.DocumentTypeInconsistencyException
setPart
public void setPart(long partTypeId,
java.lang.String mimeType,
byte[] data)
throws org.outerj.daisy.repository.DocumentTypeInconsistencyException
- Specified by:
setPart
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.DocumentTypeInconsistencyException
setPart
public void setPart(java.lang.String partTypeName,
java.lang.String mimeType,
org.outerj.daisy.repository.PartDataSource partDataSource)
throws org.outerj.daisy.repository.DocumentTypeInconsistencyException
- Specified by:
setPart
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.DocumentTypeInconsistencyException
setPart
public void setPart(long partTypeId,
java.lang.String mimeType,
org.outerj.daisy.repository.PartDataSource partDataSource)
throws org.outerj.daisy.repository.DocumentTypeInconsistencyException
- Specified by:
setPart
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.DocumentTypeInconsistencyException
setPartFileName
public void setPartFileName(java.lang.String partTypeName,
java.lang.String fileName)
- Specified by:
setPartFileName
in interface org.outerj.daisy.repository.Document
setPartFileName
public void setPartFileName(long partTypeId,
java.lang.String fileName)
- Specified by:
setPartFileName
in interface org.outerj.daisy.repository.Document
setPartMimeType
public void setPartMimeType(java.lang.String partTypeName,
java.lang.String mimeType)
- Specified by:
setPartMimeType
in interface org.outerj.daisy.repository.Document
setPartMimeType
public void setPartMimeType(long partTypeId,
java.lang.String mimeType)
- Specified by:
setPartMimeType
in interface org.outerj.daisy.repository.Document
getParts
public org.outerj.daisy.repository.Parts getParts()
- Specified by:
getParts
in interface org.outerj.daisy.repository.Document
getPartsInOrder
public org.outerj.daisy.repository.Parts getPartsInOrder()
- Specified by:
getPartsInOrder
in interface org.outerj.daisy.repository.Document
deletePart
public void deletePart(long partTypeId)
- Specified by:
deletePart
in interface org.outerj.daisy.repository.Document
deletePart
public void deletePart(java.lang.String name)
- Specified by:
deletePart
in interface org.outerj.daisy.repository.Document
getPart
public org.outerj.daisy.repository.Part getPart(long partTypeId)
throws org.outerj.daisy.repository.PartNotFoundException
- Specified by:
getPart
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.PartNotFoundException
getPart
public org.outerj.daisy.repository.Part getPart(java.lang.String name)
throws org.outerj.daisy.repository.PartNotFoundException
- Specified by:
getPart
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.PartNotFoundException
hasPart
public boolean hasPart(long partTypeId)
- Specified by:
hasPart
in interface org.outerj.daisy.repository.Document
hasPart
public boolean hasPart(java.lang.String name)
- Specified by:
hasPart
in interface org.outerj.daisy.repository.Document
setCustomField
public void setCustomField(java.lang.String name,
java.lang.String value)
- Specified by:
setCustomField
in interface org.outerj.daisy.repository.Document
deleteCustomField
public void deleteCustomField(java.lang.String name)
- Specified by:
deleteCustomField
in interface org.outerj.daisy.repository.Document
clearCustomFields
public void clearCustomFields()
- Specified by:
clearCustomFields
in interface org.outerj.daisy.repository.Document
clearCollections
public void clearCollections()
- Specified by:
clearCollections
in interface org.outerj.daisy.repository.Document
getCustomFields
public java.util.Map getCustomFields()
- Specified by:
getCustomFields
in interface org.outerj.daisy.repository.Document
getCustomField
public java.lang.String getCustomField(java.lang.String name)
- Specified by:
getCustomField
in interface org.outerj.daisy.repository.Document
hasCustomField
public boolean hasCustomField(java.lang.String name)
- Specified by:
hasCustomField
in interface org.outerj.daisy.repository.Document
getLinks
public org.outerj.daisy.repository.Links getLinks()
- Specified by:
getLinks
in interface org.outerj.daisy.repository.Document
addLink
public void addLink(java.lang.String title,
java.lang.String target)
- Specified by:
addLink
in interface org.outerj.daisy.repository.Document
deleteLink
public void deleteLink(int index)
- Specified by:
deleteLink
in interface org.outerj.daisy.repository.Document
clearLinks
public void clearLinks()
- Specified by:
clearLinks
in interface org.outerj.daisy.repository.Document
save
public void save()
throws org.outerj.daisy.repository.RepositoryException,
org.outerj.daisy.repository.DocumentTypeInconsistencyException
- Specified by:
save
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.DocumentTypeInconsistencyException
save
public void save(boolean validate)
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
save
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
validate
public void validate()
throws org.outerj.daisy.repository.DocumentTypeInconsistencyException
- Specified by:
validate
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.DocumentTypeInconsistencyException
setNewVersionState
public void setNewVersionState(org.outerj.daisy.repository.VersionState versionState)
- Specified by:
setNewVersionState
in interface org.outerj.daisy.repository.Document
getNewVersionState
public org.outerj.daisy.repository.VersionState getNewVersionState()
- Specified by:
getNewVersionState
in interface org.outerj.daisy.repository.Document
getVersion
public org.outerj.daisy.repository.Version getVersion(long versionId)
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getVersion
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getLastVersion
public org.outerj.daisy.repository.Version getLastVersion()
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getLastVersion
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getLiveVersion
public org.outerj.daisy.repository.Version getLiveVersion()
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getLiveVersion
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getLiveVersionId
public long getLiveVersionId()
- Specified by:
getLiveVersionId
in interface org.outerj.daisy.repository.Document
getVersions
public org.outerj.daisy.repository.Versions getVersions()
throws org.outerj.daisy.repository.RepositoryException
- Specified by:
getVersions
in interface org.outerj.daisy.repository.Document
- Throws:
org.outerj.daisy.repository.RepositoryException
getLastVersionId
public long getLastVersionId()
- Specified by:
getLastVersionId
in interface org.outerj.daisy.repository.Document
getLastModified
public java.util.Date getLastModified()
- Specified by:
getLastModified
in interface org.outerj.daisy.repository.Document
getLastModifier
public long getLastModifier()
- Specified by:
getLastModifier
in interface org.outerj.daisy.repository.Document
getVariantLastModified
public java.util.Date getVariantLastModified()
- Specified by:
getVariantLastModified
in interface org.outerj.daisy.repository.Document
getVariantLastModifier
public long getVariantLastModifier()
- Specified by:
getVariantLastModifier
in interface org.outerj.daisy.repository.Document
getCreated
public java.util.Date getCreated()
- Specified by:
getCreated
in interface org.outerj.daisy.repository.Document
isRetired
public boolean isRetired()
- Specified by:
isRetired
in interface org.outerj.daisy.repository.Document
setRetired
public void setRetired(boolean retired)
- Specified by:
setRetired
in interface org.outerj.daisy.repository.Document
getCollections
public org.outerj.daisy.repository.DocumentCollections getCollections()
- Specified by:
getCollections
in interface org.outerj.daisy.repository.Document
inCollection
public boolean inCollection(org.outerj.daisy.repository.DocumentCollection collection)
- Specified by:
inCollection
in interface org.outerj.daisy.repository.Document
inCollection
public boolean inCollection(long collectionId)
- Specified by:
inCollection
in interface org.outerj.daisy.repository.Document
addToCollection
public void addToCollection(org.outerj.daisy.repository.DocumentCollection collection)
- Specified by:
addToCollection
in interface org.outerj.daisy.repository.Document
removeFromCollection
public void removeFromCollection(org.outerj.daisy.repository.DocumentCollection collection)
- Specified by:
removeFromCollection
in interface org.outerj.daisy.repository.Document
getSummary
public java.lang.String getSummary()
- Specified by:
getSummary
in interface org.outerj.daisy.repository.Document
getVariantCreatedFromBranchId
public long getVariantCreatedFromBranchId()
- Specified by:
getVariantCreatedFromBranchId
in interface org.outerj.daisy.repository.Document
getVariantCreatedFromLanguageId
public long getVariantCreatedFromLanguageId()
- Specified by:
getVariantCreatedFromLanguageId
in interface org.outerj.daisy.repository.Document
getVariantCreatedFromVersionId
public long getVariantCreatedFromVersionId()
- Specified by:
getVariantCreatedFromVersionId
in interface org.outerj.daisy.repository.Document
getUpdateCount
public long getUpdateCount()
- Specified by:
getUpdateCount
in interface org.outerj.daisy.repository.Document
getVariantUpdateCount
public long getVariantUpdateCount()
- Specified by:
getVariantUpdateCount
in interface org.outerj.daisy.repository.Document
makeReadOnly
public void makeReadOnly()
isReadOnly
public boolean isReadOnly()
needsSaving
public boolean needsSaving()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © -2012 . All Rights Reserved.