Java Doc for Document.java in  » Content-Management-System » daisy » org » outerj » daisy » repository » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » daisy » org.outerj.daisy.repository 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.outerj.daisy.repository.Document

All known Subclasses:   org.outerj.daisy.repository.serverimpl.acl.DummyDocForAppliesToTest,  org.outerj.daisy.repository.commonimpl.DocumentImpl,  org.outerj.daisy.repository.commonimpl.DocumentAccessWrapper,
Document
public interface Document extends VersionedData(Code)
A document in the repository. This object actually always represents one particular variant (branch-language combination) of the document. There is no separate object representing a document itself as such, access to documents is always done through a certain variant of it (since access control is also determined based on the information that is part of the variant). Letting a document object represent both the document and document variant was also the most backwards-compatible way to introduce the variants feature.

Since one object is used to manipulate both the document and document variant, most methods include a mentioning of whether they apply to the document or the document variant. All methods inherited from VersionedData are variant-level methods.

A document can be created using Repository.createDocument(StringString) or retrieved using Repository.getDocument(Stringboolean) .





Method Summary
 voidaddLink(String title, String target)
     Adds an out-of-line link (at the end of the list).
 voidaddToCollection(DocumentCollection collection)
     Adds the document variant to a supplied Collection.
 booleancanReadLiveOnly()
     Returns true if the current user can only access live data of the document.
 voidchangeDocumentType(long documentTypeId)
     Changes the document type of this document.
 voidchangeDocumentType(String documentTypeName)
     See Document.changeDocumentType(long) .
 voidclearCollections()
     Removes the document variant from all the collections it belongs to.
 voidclearCustomFields()
     Removes all custom fields.
 voidclearLinks()
     Removes all out-of-line links.
 voiddeleteCustomField(String name)
     Removes the specified custom field.
 voiddeleteField(String name)
     Removes the specified field.
 voiddeleteField(long fieldTypeId)
     Removes the specified field.
 voiddeleteLink(int index)
     Removes an out-of-line link.
 voiddeletePart(long partTypeId)
     Removes a part, passes silently if there is no part in the document with the given id.
 voiddeletePart(String name)
     Removes a part, passes silently if there is no part in the document with the given name.
 AvailableVariantsgetAvailableVariants()
     Returns the available variants for this document.
 longgetBranchId()
    
 DocumentCollectionsgetCollections()
     Returns the collections the document variant belongs to, null if the document variant belongs to no Collections.
 DategetCreated()
     Gets the time this document was created.
 StringgetCustomField(String name)
     Gets the value of the specified custom field, or null if there is no custom field with that name.
 Map<String, String>getCustomFields()
     Returns a map containing the fields, with the field type name being the key.
 longgetDocumentTypeId()
     Returns the id of the document type to which this document adheres.
 StringgetId()
     Returns the id of this document.
 longgetLanguageId()
    
 longgetLastMajorChangeVersionId()
     Gets the last version for which the change type was major.

Returns -1 if there is no such version.

This is an automatically calculated field.

 DategetLastModified()
     The time this document was last saved.
 longgetLastModifier()
     Returns the user id of the last user who saved this document. Returns -1 for documents that have never been saved yet.

This is a document-level property.

 VersiongetLastVersion()
     Returns the Version object for the last stored version, or null for unsaved documents.
 longgetLastVersionId()
     Returns the id of the last stored version.
 longgetLiveMajorChangeVersionId()
     Gets the last version, up to the current live version, for which the change type was major.

Returns -1 if there is no such version.

This is an automatically calculated field.

 VersiongetLiveVersion()
     Returns the live version of this document, or null if there is none.
 longgetLiveVersionId()
     Returns the id of the live version, or -1 if there is none.
 LockInfogetLockInfo(boolean fresh)
     Returns information about the current lock on the document variant.

This is a variant-level method.
Parameters:
  fresh - if true, the lock information will be refetched.

 StringgetName()
     Gets the name of this document.
 StringgetNamespace()
     Returns the sequence ID part of the document ID.
 StringgetNewChangeComment()
    
 ChangeTypegetNewChangeType()
    
 VersionKeygetNewSyncedWith()
    
 VersionStategetNewVersionState()
     See Document.setNewVersionState(VersionState) .
 longgetOwner()
     Returns the user id of the owner of this document.
 longgetReferenceLanguageId()
     The current reference language for this document.
 StringgetRequestedId()
    
 longgetSeqId()
     Returns the sequence ID part of the document ID.
 StringgetSummary()
     Returns a summary text for the document variant.
 longgetUpdateCount()
    
 longgetVariantCreatedFromBranchId()
     If the variant currently loaded in this document object is created from an existing branch, this method will return the id of that branch, otherwise it will return -1.
 longgetVariantCreatedFromLanguageId()
     Similar to Document.getVariantCreatedFromBranchId() .
 longgetVariantCreatedFromVersionId()
     Similar to Document.getVariantCreatedFromBranchId() .
 VariantKeygetVariantKey()
    
 DategetVariantLastModified()
     The time the document variant was last saved.
 longgetVariantLastModifier()
     Returns the user id of the last user who saved this document variant. Returns -1 for document variants that have never been saved yet.

This is a variant-level property.

 longgetVariantUpdateCount()
    
 VersiongetVersion(long id)
     Returns the requested version.
 VersionsgetVersions()
     Returns all versions stored for this document.
 DocumentDocumentgetXml()
    
 DocumentDocumentgetXml(long versionId)
     Gets the XML of the document but include the data from the specified version, instead of the current data.
 DocumentDocumentgetXmlWithoutVariant()
    
 DocumentDocumentgetXmlWithoutVersionedData()
    
 booleanhasCustomField(String name)
     Returns true if there is a custom field with the specified name.
 booleaninCollection(DocumentCollection collection)
     Checks if the document variant belongs to the specified collection.
 booleaninCollection(long collectionId)
     Checks if the document variant belongs to the specified collection.
 booleanisNew()
     Returns true if this document has never been saved yet (thus does not exist in the repository yet).
 booleanisPrivate()
     Is this a private document or not.
 booleanisRetired()
     Is this document retired or not.
 booleanisVariantNew()
     Returns true if the variant represented by this document object has never been stored yet.
 booleanlock(long duration, LockType lockType)
     Takes a lock on the document variant.
 booleanreleaseLock()
     Releases the lock on the document variant.
 voidremoveFromCollection(DocumentCollection collection)
    
 voidsave()
     Saves a document.
 voidsave(boolean validate)
     Saves the document and document variant.

If only changes have been done to document-level properties, only the document will be saved.

 voidsetCustomField(String name, String value)
     Sets a custom field.
 voidsetDocumentTypeChecksEnabled(boolean documentTypeChecksEnabled)
     Allows to disable some document type related checks.
 voidsetField(String name, Object value)
     Sets the value of a field.
 voidsetField(long fieldTypeId, Object value)
     Same as Document.setField(String,Object) but using the id of the field type.
 voidsetName(String name)
     Sets the name of the document.
 voidsetNewChangeComment(String changeComment)
     Sets the change comment that should be used if a new version is created when saving the document.
 voidsetNewChangeType(ChangeType changeType)
     Sets the ChangeType that should be used if a new version is created when saving the document.
 voidsetNewSyncedWith(long languageId, long versionId)
     Sets the 'synced with' value that should be used if a new version is created as part of saving this document.
 voidsetNewSyncedWith(String languageName, long versionId)
     Alternative to Document.setNewSyncedWith(long,long) .
 voidsetNewSyncedWith(VersionKey syncedWith)
     Sets the 'synced with' pointer by specifying a VersionKey object. Only the language ID and version ID fields of the VersionKey object are significant.
 voidsetNewVersionState(VersionState versionState)
     Sets the VersionState that should be used if a new version is created when saving the document.
 voidsetOwner(long userId)
     Change the owner of this document.
 voidsetPart(String partTypeName, String mimeType, byte[] data)
     Sets a part.
 voidsetPart(long partTypeId, String mimeType, byte[] data)
     Sets a part.
 voidsetPart(String partTypeName, String mimeType, PartDataSource partDataSource)
     Sets a part.
 voidsetPart(long partTypeId, String mimeType, PartDataSource partDataSource)
     Sets a part.
 voidsetPartFileName(String partTypeName, String fileName)
     Update the file name of an already existing part.
 voidsetPartFileName(long partTypeId, String fileName)
     Update the file name of an already existing part.
 voidsetPartMimeType(String partTypeName, String mimeType)
     Update the mime-type of an already existing part.
 voidsetPartMimeType(long partTypeId, String mimeType)
     Update the mime-type of an already existing part.
 voidsetPrivate(boolean _private)
     Sets the private flag for this document, see also Document.isPrivate() .
 voidsetReferenceLanguage(String referenceLanguageName)
    
 voidsetReferenceLanguageId(long referenceLanguageId)
    
 voidsetRequestedId(String documentId)
     Requests that this new document will be saved with the given document ID.

This can only be done for document IDs in a namespace other than the namespace of the current repository.

 voidsetRetired(boolean retired)
     Sets the retired flag for this document, see also Document.isRetired() .
 voidvalidate()
     Validates that this document confirms to its document type.



Method Detail
addLink
void addLink(String title, String target)(Code)
Adds an out-of-line link (at the end of the list).

This is a variant-level method.




addToCollection
void addToCollection(DocumentCollection collection)(Code)
Adds the document variant to a supplied Collection.
Parameters:
  collection - the collection to add the current document to



canReadLiveOnly
boolean canReadLiveOnly()(Code)
Returns true if the current user can only access live data of the document.



changeDocumentType
void changeDocumentType(long documentTypeId) throws RepositoryException(Code)
Changes the document type of this document.

Will throw an exception if the document type does not exist.

Changing the documenttype does not influence the content of the document, you have to assure yourself that you update/add/remove parts and fields so that the document conforms to the document type.

The document type is a variant-level property.




changeDocumentType
void changeDocumentType(String documentTypeName) throws RepositoryException(Code)
See Document.changeDocumentType(long) .



clearCollections
void clearCollections()(Code)
Removes the document variant from all the collections it belongs to.



clearCustomFields
void clearCustomFields()(Code)
Removes all custom fields.

This is a variant-level method.




clearLinks
void clearLinks()(Code)
Removes all out-of-line links.

This is a variant-level method.




deleteCustomField
void deleteCustomField(String name)(Code)
Removes the specified custom field. Passes silently if there is no custom field with the given name.

This is a variant-level method.




deleteField
void deleteField(String name)(Code)
Removes the specified field. Silently ignored if the document doesn't have that field.

This is a variant-level method.
Parameters:
  name - name of the field type




deleteField
void deleteField(long fieldTypeId)(Code)
Removes the specified field. Silently ignored if the document doesn't have that field.

This is a variant-level method.




deleteLink
void deleteLink(int index)(Code)
Removes an out-of-line link.

This is a variant-level method.




deletePart
void deletePart(long partTypeId)(Code)
Removes a part, passes silently if there is no part in the document with the given id.

This is a variant-level method.




deletePart
void deletePart(String name)(Code)
Removes a part, passes silently if there is no part in the document with the given name.

This is a variant-level method.




getAvailableVariants
AvailableVariants getAvailableVariants() throws RepositoryException(Code)
Returns the available variants for this document. If the document is new and unsaved, this returns an empty list. If the document variant in this document is new and unsaved, the returned list will not yet contain this new variant. Thus only variants persisted in the repository are returned. This method does the same as Repository.getAvailableVariants(String) .



getBranchId
long getBranchId()(Code)



getCollections
DocumentCollections getCollections()(Code)
Returns the collections the document variant belongs to, null if the document variant belongs to no Collections.



getCreated
Date getCreated()(Code)
Gets the time this document was created.

This is a document-level property.




getCustomField
String getCustomField(String name)(Code)
Gets the value of the specified custom field, or null if there is no custom field with that name.

This is a variant-level method.




getCustomFields
Map<String, String> getCustomFields()(Code)
Returns a map containing the fields, with the field type name being the key. Making changes to this map will not be reflected in the document.

This is a variant-level method.




getDocumentTypeId
long getDocumentTypeId()(Code)
Returns the id of the document type to which this document adheres. Document types themselve are managed via the org.outerj.daisy.repository.schema.RepositorySchema .

The document type is a variant-level property.




getId
String getId()(Code)
Returns the id of this document. For newly created documents, this method returns null until Document.save() is called.



getLanguageId
long getLanguageId()(Code)



getLastMajorChangeVersionId
long getLastMajorChangeVersionId()(Code)
Gets the last version for which the change type was major.

Returns -1 if there is no such version.

This is an automatically calculated field. This information is fetched when this document object is retrieved and is not updated afterwards.

This is a variant level method.




getLastModified
Date getLastModified()(Code)
The time this document was last saved. Returns null for documents that have never been saved yet.

This is a document-level property. See also Document.getVariantLastModified() .




getLastModifier
long getLastModifier()(Code)
Returns the user id of the last user who saved this document. Returns -1 for documents that have never been saved yet.

This is a document-level property. See also Document.getVariantLastModifier() .




getLastVersion
Version getLastVersion() throws RepositoryException(Code)
Returns the Version object for the last stored version, or null for unsaved documents.

This is a variant-level method.




getLastVersionId
long getLastVersionId()(Code)
Returns the id of the last stored version. For new, unsaved documents this returns -1.

This is a variant-level property.




getLiveMajorChangeVersionId
long getLiveMajorChangeVersionId()(Code)
Gets the last version, up to the current live version, for which the change type was major.

Returns -1 if there is no such version.

This is an automatically calculated field. This information is fetched when this document object is retrieved and is not updated afterwards.

This is a variant level method.




getLiveVersion
Version getLiveVersion() throws RepositoryException(Code)
Returns the live version of this document, or null if there is none. The live version is the most recent version that has the state 'publish'.

This is a variant-level method.




getLiveVersionId
long getLiveVersionId()(Code)
Returns the id of the live version, or -1 if there is none.

This is a variant-level method.




getLockInfo
LockInfo getLockInfo(boolean fresh) throws RepositoryException(Code)
Returns information about the current lock on the document variant.

This is a variant-level method.
Parameters:
  fresh - if true, the lock information will be refetched. Otherwisethe existing information stored in this Document object willbe returned (which may be out of date).




getName
String getName()(Code)
Gets the name of this document.

The document name is a variant-level property.

This is exactly the same as calling VersionedData.getDocumentName .




getNamespace
String getNamespace()(Code)
Returns the sequence ID part of the document ID. This method returns -1 until Document.save() is called.
since:
   Daisy 2.0



getNewChangeComment
String getNewChangeComment()(Code)



getNewChangeType
ChangeType getNewChangeType()(Code)



getNewSyncedWith
VersionKey getNewSyncedWith()(Code)
: to indicate which variant/version the document was synced withor null if the document is not synced



getNewVersionState
VersionState getNewVersionState()(Code)
See Document.setNewVersionState(VersionState) .



getOwner
long getOwner()(Code)
Returns the user id of the owner of this document. The owner is the user that created the document, unless changed.

The owner is a document-level property.




getReferenceLanguageId
long getReferenceLanguageId()(Code)
The current reference language for this document. Returns -1 if the reference language is not set.

Setting the reference language is also used as an indication that the document should be considered to be under "translation management".

this is a document level method




getRequestedId
String getRequestedId()(Code)



getSeqId
long getSeqId()(Code)
Returns the sequence ID part of the document ID. This method returns -1 until Document.save() is called.
since:
   Daisy 2.0



getSummary
String getSummary()(Code)
Returns a summary text for the document variant. The summary is only created/updated when the document is saved. Returns an empty string if there's no summary. The summary always corresponds to the live version of the document.



getUpdateCount
long getUpdateCount()(Code)



getVariantCreatedFromBranchId
long getVariantCreatedFromBranchId()(Code)
If the variant currently loaded in this document object is created from an existing branch, this method will return the id of that branch, otherwise it will return -1. Note that the branch could possibly no longer exist.



getVariantCreatedFromLanguageId
long getVariantCreatedFromLanguageId()(Code)
Similar to Document.getVariantCreatedFromBranchId() .



getVariantCreatedFromVersionId
long getVariantCreatedFromVersionId()(Code)
Similar to Document.getVariantCreatedFromBranchId() .



getVariantKey
VariantKey getVariantKey()(Code)
null for documents which have not yet been saved.



getVariantLastModified
Date getVariantLastModified()(Code)
The time the document variant was last saved. Returns null for document variants that have never been saved yet.

This is a variant-level property. See also Document.getLastModified() .




getVariantLastModifier
long getVariantLastModifier()(Code)
Returns the user id of the last user who saved this document variant. Returns -1 for document variants that have never been saved yet.

This is a variant-level property. See also Document.getLastModifier() .




getVariantUpdateCount
long getVariantUpdateCount()(Code)



getVersion
Version getVersion(long id) throws RepositoryException(Code)
Returns the requested version.

Note that in contrast with the Document.getVersions() method, typical implementations will usually return a Version object containing all details about the version.

This is a variant-level method.




getVersions
Versions getVersions() throws RepositoryException(Code)
Returns all versions stored for this document.

In a typical implementation, the returned Version objects will only contain basic information about the version (like its id and creation time) which is needed to show a version list, but the actual version content (fields, parts, ...) will only be loaded when requested.

This is a variant-level method.




getXml
DocumentDocument getXml() throws RepositoryException(Code)



getXml
DocumentDocument getXml(long versionId) throws RepositoryException(Code)
Gets the XML of the document but include the data from the specified version, instead of the current data. This only applies to the data of the document that is actually versionable, of course. For the rest of the data, you'll get what's currently in the document object, whether that data has already been saved or not.



getXmlWithoutVariant
DocumentDocument getXmlWithoutVariant() throws RepositoryException(Code)



getXmlWithoutVersionedData
DocumentDocument getXmlWithoutVersionedData() throws RepositoryException(Code)



hasCustomField
boolean hasCustomField(String name)(Code)
Returns true if there is a custom field with the specified name.

This is a variant-level method.




inCollection
boolean inCollection(DocumentCollection collection)(Code)
Checks if the document variant belongs to the specified collection.



inCollection
boolean inCollection(long collectionId)(Code)
Checks if the document variant belongs to the specified collection.



isNew
boolean isNew()(Code)
Returns true if this document has never been saved yet (thus does not exist in the repository yet).



isPrivate
boolean isPrivate()(Code)
Is this a private document or not. A private document is a document that can only be accessed by its owner, or users having (and acting) in the role of Administrator.

This is a document-level property.




isRetired
boolean isRetired()(Code)
Is this document retired or not. A retired document behaves very much likes a deleted document. Retired documents don't show up in query results (unless specifically requested).

This is a variant-level property.




isVariantNew
boolean isVariantNew()(Code)
Returns true if the variant represented by this document object has never been stored yet.



lock
boolean lock(long duration, LockType lockType) throws RepositoryException(Code)
Takes a lock on the document variant. If the lock type is "pessimistic", this will prevent others from saving the document variant while you're working on it. If the lock is "warn", the lock only serves for informational purposes and will not enforce anything. So called "optimistic locking" (ie checking against concurrent modifications) happens always, and doesn't require to take a lock.

Changing a lock doesn't need a Document.save() call afterwards, calling this method has immediate effect.

The lock can be removed with Document.releaseLock() .

This is a variant-level method.
Parameters:
  duration - indication of how long the lock should remain (in ms).Use -1 for a never-expiring lock. false if someone else already has a lock on this document, inwhich case you can call Document.getLockInfo(boolean) with falseas parameter to know who is holding the lock.




releaseLock
boolean releaseLock() throws RepositoryException(Code)
Releases the lock on the document variant. This can only be done by the person holding this lock, or by an Administrator.

This is a variant-level method. true if the lock is removed (or if there was no lock). If a lockremains on the document, false will be returned, in which caseyou can call Document.getLockInfo(boolean) with falseas parameter to know who is holding the lock.




removeFromCollection
void removeFromCollection(DocumentCollection collection)(Code)
Removes the document variant from a collection
Parameters:
  collection - the collection from which the document needs to be removed



save
void save() throws RepositoryException(Code)
Saves a document.

This is the same as calling Document.save(boolean) with argument true.




save
void save(boolean validate) throws RepositoryException(Code)
Saves the document and document variant.

If only changes have been done to document-level properties, only the document will be saved. If only changes have been done to variant-level properties, only the variant will be saved.

If this is a new document, it will cause an id to be assigned to this document object.

Saving the document variant might or might not cause the creation of a new version, depending on whether any versioned data has changed. Versioned data includes the parts, fields, links and the document's name. So if for example only the retired flag changed, customfields were changed, or collection membership changed, no new version will be created. After saving, you can get the new version id from the method Document.getLastVersionId() . The state of the new version can be influenced by using Document.setNewVersionState(org.outerj.daisy.repository.VersionState) before calling save().

If someone else holds a pessimistic lock on the document variant, saving it will fail. Likewise, if another person saved the document since you retrieved this document object (ie a concurrent modification), saving will also fail. Note that locks apply only to document variants, so don't protect from concurrent changes to document-level properties.

Saving a document will cause the server to send out an assynchronous event, to which other processes can listen, for example the full text indexer. (There are separate events for updates to the document and the variant)

Using the argument validate you can specify whether the document variant should be validated against its document type. Usually you will always provide true here. As an example use case for not using validation, it might be that you just want to mark a document as retired without bothering that its content doesn't correspond to the schema anymore.
throws:
  DocumentTypeInconsistencyException - in case validation against the schema fails.




setCustomField
void setCustomField(String name, String value)(Code)
Sets a custom field. A custom field is an arbitrary name/value pair. Custom fields are not versioned.

This is a variant-level method.




setDocumentTypeChecksEnabled
void setDocumentTypeChecksEnabled(boolean documentTypeChecksEnabled)(Code)
Allows to disable some document type related checks. When disabled, it is possible to set fields and parts on this document that are not allowed by the document type. For parts, the mime-type checking won't be performed either.



setField
void setField(String name, Object value) throws DocumentTypeInconsistencyException(Code)
Sets the value of a field. The field must be part of the document type of this document.

This is a variant-level method.

See Document.setDocumentTypeChecksEnabled to disable checks against the document type.
Parameters:
  name - name of the field type of the field to set.
Parameters:
  value - the value of the field, the type of the object must be in correspondence with the ValueType of the field type.For multi-value fields, the value should be an array (i.e. Object[] or a more specifically typed array).For link field types, the value is a VariantKey object. The branch and language fields of the VariantKeyobject can be -1 to indicate they are the same as the containing document (recommended for most uses).For hierarchical fields, the value is a HierarchyPath containing values according to the field type.For multi-value hierarchical fields, the value is an array of HierarchyPath objects.




setField
void setField(long fieldTypeId, Object value) throws DocumentTypeInconsistencyException(Code)
Same as Document.setField(String,Object) but using the id of the field type.

This is a variant-level method.




setName
void setName(String name)(Code)
Sets the name of the document. The document name is not required to be unique, and is versioned, ie changing the document name and then saving the document will create a new version.

The document name is a variant-level property.




setNewChangeComment
void setNewChangeComment(String changeComment)(Code)
Sets the change comment that should be used if a new version is created when saving the document.

By default this is null




setNewChangeType
void setNewChangeType(ChangeType changeType)(Code)
Sets the ChangeType that should be used if a new version is created when saving the document.

By default this is ChangeType.MAJOR




setNewSyncedWith
void setNewSyncedWith(long languageId, long versionId) throws RepositoryException(Code)
Sets the 'synced with' value that should be used if a new version is created as part of saving this document.

The 'synced with' indicates the version is synced with another language:version.

Use setSyncedWithVersion(-1,-1) to clear any previous set value.




setNewSyncedWith
void setNewSyncedWith(String languageName, long versionId) throws RepositoryException(Code)
Alternative to Document.setNewSyncedWith(long,long) .

Use setSyncedWith(null, -1) to indicate the document is not synced anymore.




setNewSyncedWith
void setNewSyncedWith(VersionKey syncedWith) throws RepositoryException(Code)
Sets the 'synced with' pointer by specifying a VersionKey object. Only the language ID and version ID fields of the VersionKey object are significant. The syncedWith argument can be null.

See also Document.setNewSyncedWith(long,long) .




setNewVersionState
void setNewVersionState(VersionState versionState)(Code)
Sets the VersionState that should be used if a new version is created when saving the document.

By default this is VersionState.PUBLISH.




setOwner
void setOwner(long userId)(Code)
Change the owner of this document. Only users acting in the Administrator role, or the current owner, can change the owner.

The owner is a document-level property.




setPart
void setPart(String partTypeName, String mimeType, byte[] data) throws DocumentTypeInconsistencyException(Code)
Sets a part.

This is a variant-level method.




setPart
void setPart(long partTypeId, String mimeType, byte[] data) throws DocumentTypeInconsistencyException(Code)
Sets a part.

This is a variant-level method.




setPart
void setPart(String partTypeName, String mimeType, PartDataSource partDataSource) throws DocumentTypeInconsistencyException(Code)
Sets a part.

This is a variant-level method.




setPart
void setPart(long partTypeId, String mimeType, PartDataSource partDataSource) throws DocumentTypeInconsistencyException(Code)
Sets a part.

This is a variant-level method.




setPartFileName
void setPartFileName(String partTypeName, String fileName)(Code)
Update the file name of an already existing part. Throws an exception if the document doesn't have the indicated part.

This is a variant-level method.
Parameters:
  fileName - allowed to be null (to remove the filename information)




setPartFileName
void setPartFileName(long partTypeId, String fileName)(Code)
Update the file name of an already existing part. Throws an exception if the document doesn't have the indicated part.

This is a variant-level method.
Parameters:
  fileName - allowed to be null (to remove the filename information)




setPartMimeType
void setPartMimeType(String partTypeName, String mimeType)(Code)
Update the mime-type of an already existing part. Throws an exception if the document doesn't have the indicated part.

This is a variant-level method.




setPartMimeType
void setPartMimeType(long partTypeId, String mimeType)(Code)
Update the mime-type of an already existing part. Throws an exception if the document doesn't have the indicated part.

This is a variant-level method.




setPrivate
void setPrivate(boolean _private)(Code)
Sets the private flag for this document, see also Document.isPrivate() . New documents are not private by default.

This is a document-level property.




setReferenceLanguage
void setReferenceLanguage(String referenceLanguageName) throws RepositoryException(Code)



setReferenceLanguageId
void setReferenceLanguageId(long referenceLanguageId)(Code)



setRequestedId
void setRequestedId(String documentId)(Code)
Requests that this new document will be saved with the given document ID.

This can only be done for document IDs in a namespace other than the namespace of the current repository. This is simply because the current repository is responsible itself for the assigning numbers to its documents. For foreign namespaces, it is assumed that some external entity is responsible for the numbering (typically another Daisy repository, though it could be anything).

Setting the document ID is only possible for new, not-yet-saved documents.

If a document with the given ID would already exist in the repository, then this will give an exception when saving the document.
Parameters:
  documentId - allowed to be null, in which case a previous setting is reset
since:
   Daisy 2.0




setRetired
void setRetired(boolean retired)(Code)
Sets the retired flag for this document, see also Document.isRetired() .

This is a variant-level property.




validate
void validate() throws DocumentTypeInconsistencyException(Code)
Validates that this document confirms to its document type.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.