Package org.nuxeo.client.objects
Class Document
- java.lang.Object
-
- org.nuxeo.client.objects.AbstractBase<B>
-
- org.nuxeo.client.objects.AbstractConnectable<A,B>
-
- org.nuxeo.client.objects.ConnectableEntity<A,B>
-
- org.nuxeo.client.objects.RepositoryEntity<RepositoryAPI,Document>
-
- org.nuxeo.client.objects.Document
-
- All Implemented Interfaces:
Connectable
public class Document extends RepositoryEntity<RepositoryAPI,Document>
- Since:
- 0.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDocument.AbstractAdapter<A extends Document.AbstractAdapter<A>>Adapter is basic class to handle requests against web adapters.static classDocument.AdapterAdapter is basic class to handle requests against web adapters.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringchangeTokenprotected java.util.Map<java.lang.String,java.lang.Object>contextParametersstatic java.lang.StringDEFAULT_FILE_CONTENTprotected static java.lang.StringDELETED_STATEprotected java.util.Map<java.lang.String,java.lang.Object>dirtyPropertiesprotected java.util.List<java.lang.String>facetsprotected booleanhasLegalHoldprotected java.lang.StringisCheckedOutprotected booleanisProxyprotected booleanisRecordprotected java.lang.BooleanisTrashedprotected booleanisUnderRetentionOrLegalHoldprotected booleanisVersionprotected java.lang.StringlastModifiedprotected java.lang.StringlockCreatedprotected java.lang.StringlockOwnerprotected java.lang.Stringnameprotected java.lang.StringparentRefprotected java.lang.Stringpathprotected java.util.Map<java.lang.String,java.lang.Object>propertiesprotected java.lang.StringretainUntilprotected java.lang.Stringstateprotected java.lang.Stringtitleprotected java.lang.Stringtypeprotected java.lang.Stringuidprotected java.lang.StringversionableIdprotected java.lang.StringversionLabel-
Fields inherited from class org.nuxeo.client.objects.RepositoryEntity
repositoryName
-
Fields inherited from class org.nuxeo.client.objects.ConnectableEntity
entityType
-
Fields inherited from class org.nuxeo.client.objects.AbstractConnectable
api, apiClass, nuxeoClient
-
Fields inherited from class org.nuxeo.client.objects.AbstractBase
headerInterceptors, headerValues, okhttpBuilder, retrofit, retrofitBuilder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDocument()For internal marshalling purpose.protectedDocument(java.lang.String uid, java.lang.String type)Protected constructor for adapters implementation.protectedDocument(Document document)This constructor is providing a way to create 'adapters' of a document.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Document.Adapteradapter(java.lang.String adapter)Gets anadapterobject to build requests against Nuxeo Server Web Adapter.<A extends Document.AbstractAdapter>
Aadapter(java.util.function.Function<Document,A> creator)Gets anadapterobject to build requests against Nuxeo Server Web Adapter.DocumentaddInvitation(ACE ace, java.lang.String email)Add permission on the current document by passing the related email.voidaddInvitation(ACE ace, java.lang.String email, retrofit2.Callback<Document> callback)Add permission on the current document by passing the related email.DocumentaddPermission(ACE ace)Add permission on the current document.voidaddPermission(ACE ace, retrofit2.Callback<Document> callback)Add permission on the current document.static DocumentcreateWithId(java.lang.String uid, java.lang.String type)Regular way to instantiate aDocumentin order to update it.static DocumentcreateWithName(java.lang.String name, java.lang.String type)Regular way to instantiate aDocumentin order to create it.AuditfetchAudit()voidfetchAudit(retrofit2.Callback<Audit> callback)FileBlobfetchBlob()Deprecated.since 3.1, usestreamBlob()insteadFileBlobfetchBlob(java.lang.String fieldPath)Deprecated.since 3.1, usestreamBlob(String)insteadvoidfetchBlob(java.lang.String fieldPath, retrofit2.Callback<FileBlob> callback)Deprecated.since 3.1, usestreamBlob(String, Callback)insteadvoidfetchBlob(retrofit2.Callback<FileBlob> callback)Deprecated.since 3.1, usestreamBlob(Callback)insteadDocumentsfetchChildren()voidfetchChildren(retrofit2.Callback<Documents> callback)ACPfetchPermissions()voidfetchPermissions(retrofit2.Callback<ACP> callback)TaskfetchTask()Deprecated.since 3.2, this method has never worked, usefetchTasks()insteadTasksfetchTasks()WorkflowsfetchWorkflowInstances()voidfetchWorkflowInstances(retrofit2.Callback<Workflows> callback)java.lang.StringgetChangeToken()<T> TgetContextParameter(java.lang.String key)java.util.Map<java.lang.String,java.lang.Object>getContextParameters()java.util.Map<java.lang.String,java.lang.Object>getDirtyProperties()Get the dirty properties.java.util.List<java.lang.String>getFacets()java.lang.StringgetId()java.lang.StringgetIsCheckedOut()java.lang.StringgetLastModified()java.lang.StringgetLock()java.lang.StringgetLockCreated()java.lang.StringgetLockOwner()java.lang.StringgetName()java.lang.StringgetParentRef()java.lang.StringgetPath()java.util.Map<java.lang.String,java.lang.Object>getProperties()protected java.lang.ObjectgetPropertyValue(java.lang.Object value, java.util.List<java.lang.String> segments)<T> TgetPropertyValue(java.lang.String xpath)Since 3.3, behavior of this method has been improved to handle xpath.java.lang.StringgetRetainUntil()java.lang.StringgetState()java.lang.StringgetTitle()java.lang.StringgetType()java.lang.StringgetUid()java.lang.StringgetVersionableId()java.lang.StringgetVersionLabel()booleanhasLegalHold()java.lang.BooleanisCheckedOut()booleanisLocked()booleanisProxy()CAUTION: Only available for Nuxeo Server greater than LTS 2016 - 8.10booleanisRecord()booleanisTrashed()booleanisUnderRetentionOrLegalHold()booleanisVersion()voidreconnectWith(NuxeoClient nuxeoClient)voidremovePermission(java.lang.String username)Remove all permissions for a given username on the current document.voidremovePermission(java.lang.String aceId, java.lang.String username, java.lang.String aclName)Remove all permissions for a given username, ace id, acl name on the current document.voidsetContextParameters(java.util.Map<java.lang.String,java.lang.Object> contextParameters)voidsetDirtyProperties(java.util.Map<java.lang.String,java.lang.Object> dirtyProperties)voidsetHasLegalHold(boolean hasLegalHold)voidsetProperties(java.util.Map<java.lang.String,java.lang.Object> properties)Sets several properties in one call, this method will also put input properties to dirty properties.voidsetPropertyValue(java.lang.String key, java.lang.Object value)Sets one property value, property's value will also be put to dirty properties.voidsetRecord(boolean record)voidsetRetainUntil(java.lang.String retainUntil)voidsetUnderRetentionOrLegalHold(boolean underRetentionOrLegalHold)voidsetVersion(boolean version)voidsetVersionableId(java.lang.String versionableId)WorkflowstartWorkflowInstance(Workflow workflow)voidstartWorkflowInstance(Workflow workflow, retrofit2.Callback<Workflow> callback)StreamBlobstreamBlob()StreamBlobstreamBlob(java.lang.String fieldPath)voidstreamBlob(java.lang.String fieldPath, retrofit2.Callback<StreamBlob> callback)voidstreamBlob(retrofit2.Callback<StreamBlob> callback)protected java.util.Map<java.lang.String,java.lang.Object>toAutomationParameters(ACE ace)Documenttrash()This API is available since Nuxeo Server 10.2.Documentuntrash()This API is available since Nuxeo Server 10.2.DocumentupdateDocument()-
Methods inherited from class org.nuxeo.client.objects.RepositoryEntity
getRepositoryName
-
Methods inherited from class org.nuxeo.client.objects.ConnectableEntity
getEntityType
-
Methods inherited from class org.nuxeo.client.objects.AbstractConnectable
buildRetrofit, fetchResponse, fetchResponse
-
Methods inherited from class org.nuxeo.client.objects.AbstractBase
connectTimeout, depth, enrichers, enrichers, enrichersForDocument, fetchProperties, fetchProperties, fetchPropertiesForDocument, fetchPropertiesForGroup, header, header, header, header, header, header, header, readTimeout, replaceWith, retryOnConnectionFailure, schemas, schemas, timeout, transactionTimeout, version, writeTimeout
-
-
-
-
Field Detail
-
DEFAULT_FILE_CONTENT
public static final java.lang.String DEFAULT_FILE_CONTENT
- See Also:
- Constant Field Values
-
DELETED_STATE
protected static final java.lang.String DELETED_STATE
- See Also:
- Constant Field Values
-
path
protected java.lang.String path
-
type
protected java.lang.String type
-
state
protected java.lang.String state
-
lockOwner
protected java.lang.String lockOwner
-
lockCreated
protected java.lang.String lockCreated
-
versionLabel
protected java.lang.String versionLabel
-
isCheckedOut
protected java.lang.String isCheckedOut
-
lastModified
protected java.lang.String lastModified
-
properties
protected java.util.Map<java.lang.String,java.lang.Object> properties
-
dirtyProperties
protected java.util.Map<java.lang.String,java.lang.Object> dirtyProperties
-
contextParameters
protected java.util.Map<java.lang.String,java.lang.Object> contextParameters
-
changeToken
protected java.lang.String changeToken
-
facets
protected java.util.List<java.lang.String> facets
-
parentRef
protected java.lang.String parentRef
-
uid
protected java.lang.String uid
-
title
protected java.lang.String title
-
name
protected java.lang.String name
-
isProxy
protected boolean isProxy
- Since:
- 2.3
-
isTrashed
protected java.lang.Boolean isTrashed
-
isRecord
protected boolean isRecord
- Since:
- 3.6
-
retainUntil
protected java.lang.String retainUntil
- Since:
- 3.6
-
hasLegalHold
protected boolean hasLegalHold
- Since:
- 3.6
-
isUnderRetentionOrLegalHold
protected boolean isUnderRetentionOrLegalHold
- Since:
- 3.6
-
isVersion
protected boolean isVersion
- Since:
- 3.6
-
versionableId
protected java.lang.String versionableId
- Since:
- 3.6
-
-
Constructor Detail
-
Document
protected Document()
For internal marshalling purpose.
-
Document
protected Document(java.lang.String uid, java.lang.String type)Protected constructor for adapters implementation.- Since:
- 3.0 this constructor has changed its meaning, it is used for adapters, see org.nuxeo.client.objects.DataSet.
-
Document
protected Document(Document document)
This constructor is providing a way to create 'adapters' of a document. See org.nuxeo.client.objects.DataSet in nuxeo-java-client-test.- Parameters:
document- the document to copy from the sub class.- Since:
- 1.0
-
-
Method Detail
-
createWithId
public static Document createWithId(java.lang.String uid, java.lang.String type)
Regular way to instantiate aDocumentin order to update it.- Since:
- 3.0
-
createWithName
public static Document createWithName(java.lang.String name, java.lang.String type)
Regular way to instantiate aDocumentin order to create it.- Since:
- 3.0
-
getId
public java.lang.String getId()
-
getPath
public java.lang.String getPath()
-
getType
public java.lang.String getType()
-
getLock
public java.lang.String getLock()
-
getLockOwner
public java.lang.String getLockOwner()
-
getLockCreated
public java.lang.String getLockCreated()
-
isLocked
public boolean isLocked()
-
getState
public java.lang.String getState()
-
getVersionLabel
public java.lang.String getVersionLabel()
-
isCheckedOut
public java.lang.Boolean isCheckedOut()
-
getTitle
public java.lang.String getTitle()
-
getChangeToken
public java.lang.String getChangeToken()
-
getFacets
public java.util.List<java.lang.String> getFacets()
-
getIsCheckedOut
public java.lang.String getIsCheckedOut()
-
getParentRef
public java.lang.String getParentRef()
-
getUid
public java.lang.String getUid()
-
getLastModified
public java.lang.String getLastModified()
-
getName
public java.lang.String getName()
-
isRecord
public boolean isRecord()
- Since:
- 3.6
-
setRecord
public void setRecord(boolean record)
- Since:
- 3.6
-
getRetainUntil
public java.lang.String getRetainUntil()
- Since:
- 3.6
-
setRetainUntil
public void setRetainUntil(java.lang.String retainUntil)
- Since:
- 3.6
-
hasLegalHold
public boolean hasLegalHold()
- Since:
- 3.6
-
setHasLegalHold
public void setHasLegalHold(boolean hasLegalHold)
- Since:
- 3.6
-
isUnderRetentionOrLegalHold
public boolean isUnderRetentionOrLegalHold()
- Since:
- 3.6
-
setUnderRetentionOrLegalHold
public void setUnderRetentionOrLegalHold(boolean underRetentionOrLegalHold)
- Since:
- 3.6
-
isVersion
public boolean isVersion()
- Since:
- 3.6
-
setVersion
public void setVersion(boolean version)
- Since:
- 3.6
-
getVersionableId
public java.lang.String getVersionableId()
- Since:
- 3.6
-
setVersionableId
public void setVersionableId(java.lang.String versionableId)
- Since:
- 3.6
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
-
getPropertyValue
public <T> T getPropertyValue(java.lang.String xpath)
Since 3.3, behavior of this method has been improved to handle xpath.Note that what's called xpath in this context is not an actual XPath as specified by the w3c. Main differences are that in our xpath:
- Indexes start at 0 instead of 1
- Predicates are not supported
- You must express
foos/foo[i]/barasfoos/i/bar
This API can't traverse fetched properties.
- Parameters:
xpath- the Nuxeo xpath to resolve- Returns:
- the property value referenced by the given Nuxeo xpath
-
getPropertyValue
protected java.lang.Object getPropertyValue(java.lang.Object value, java.util.List<java.lang.String> segments)- Parameters:
value- the object from which to resolve givensegmentssegments- the remaining segments to resolve on givenvalue- Returns:
- the resolved value of given
segments
-
setPropertyValue
public void setPropertyValue(java.lang.String key, java.lang.Object value)Sets one property value, property's value will also be put to dirty properties.
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Sets several properties in one call, this method will also put input properties to dirty properties.
-
getDirtyProperties
public java.util.Map<java.lang.String,java.lang.Object> getDirtyProperties()
Get the dirty properties.
-
setDirtyProperties
public void setDirtyProperties(java.util.Map<java.lang.String,java.lang.Object> dirtyProperties)
-
getContextParameter
public <T> T getContextParameter(java.lang.String key)
- Returns:
- The value associates to the input key from the context parameters.
- Since:
- 3.0
-
getContextParameters
public java.util.Map<java.lang.String,java.lang.Object> getContextParameters()
-
setContextParameters
public void setContextParameters(java.util.Map<java.lang.String,java.lang.Object> contextParameters)
-
updateDocument
public Document updateDocument()
-
fetchAudit
public Audit fetchAudit()
-
fetchAudit
public void fetchAudit(retrofit2.Callback<Audit> callback)
-
fetchPermissions
public ACP fetchPermissions()
-
addPermission
public Document addPermission(ACE ace)
Add permission on the current document.- Parameters:
ace- the permission.- Since:
- 1.0
-
toAutomationParameters
protected java.util.Map<java.lang.String,java.lang.Object> toAutomationParameters(ACE ace)
-
addInvitation
public Document addInvitation(ACE ace, java.lang.String email)
Add permission on the current document by passing the related email.- Parameters:
ace- the permission.email- the invited email.- Since:
- 1.0
-
removePermission
public void removePermission(java.lang.String username)
Remove all permissions for a given username on the current document.- Parameters:
username- User Name.- Since:
- 1.0
-
removePermission
public void removePermission(java.lang.String aceId, java.lang.String username, java.lang.String aclName)Remove all permissions for a given username, ace id, acl name on the current document.- Parameters:
aceId- ACE ID.username- User Name.aclName- Name of the ACL (local, inherited...).- Since:
- 1.0
-
fetchPermissions
public void fetchPermissions(retrofit2.Callback<ACP> callback)
-
addPermission
public void addPermission(ACE ace, retrofit2.Callback<Document> callback)
Add permission on the current document.- Parameters:
ace- the permission.- Since:
- 1.0
-
addInvitation
public void addInvitation(ACE ace, java.lang.String email, retrofit2.Callback<Document> callback)
Add permission on the current document by passing the related email.- Parameters:
ace- the permission.email- the invited email.- Since:
- 1.0
-
fetchChildren
public Documents fetchChildren()
-
fetchChildren
public void fetchChildren(retrofit2.Callback<Documents> callback)
-
fetchBlob
@Deprecated public FileBlob fetchBlob()
Deprecated.since 3.1, usestreamBlob()instead
-
fetchBlob
@Deprecated public FileBlob fetchBlob(java.lang.String fieldPath)
Deprecated.since 3.1, usestreamBlob(String)instead
-
streamBlob
public StreamBlob streamBlob()
-
streamBlob
public StreamBlob streamBlob(java.lang.String fieldPath)
-
fetchBlob
@Deprecated public void fetchBlob(retrofit2.Callback<FileBlob> callback)
Deprecated.since 3.1, usestreamBlob(Callback)instead
-
fetchBlob
@Deprecated public void fetchBlob(java.lang.String fieldPath, retrofit2.Callback<FileBlob> callback)Deprecated.since 3.1, usestreamBlob(String, Callback)instead
-
streamBlob
public void streamBlob(retrofit2.Callback<StreamBlob> callback)
-
streamBlob
public void streamBlob(java.lang.String fieldPath, retrofit2.Callback<StreamBlob> callback)
-
fetchWorkflowInstances
public Workflows fetchWorkflowInstances()
-
fetchWorkflowInstances
public void fetchWorkflowInstances(retrofit2.Callback<Workflows> callback)
-
startWorkflowInstance
public void startWorkflowInstance(Workflow workflow, retrofit2.Callback<Workflow> callback)
-
fetchTask
@Deprecated public Task fetchTask()
Deprecated.since 3.2, this method has never worked, usefetchTasks()instead
-
fetchTasks
public Tasks fetchTasks()
-
isProxy
public boolean isProxy()
CAUTION: Only available for Nuxeo Server greater than LTS 2016 - 8.10- Since:
- 2.3
-
isTrashed
public boolean isTrashed()
- Since:
- 3.1
-
trash
public Document trash()
This API is available since Nuxeo Server 10.2.- Since:
- 3.1
-
untrash
public Document untrash()
This API is available since Nuxeo Server 10.2.- Since:
- 3.1
-
adapter
public Document.Adapter adapter(java.lang.String adapter)
Gets anadapterobject to build requests against Nuxeo Server Web Adapter.- Parameters:
adapter- the adapter to hit- Since:
- 3.2
-
adapter
public <A extends Document.AbstractAdapter> A adapter(java.util.function.Function<Document,A> creator)
Gets anadapterobject to build requests against Nuxeo Server Web Adapter.- Parameters:
creator- the function used to instantiate a specificadapter- Since:
- 3.2
-
reconnectWith
public void reconnectWith(NuxeoClient nuxeoClient)
- Specified by:
reconnectWithin interfaceConnectable- Overrides:
reconnectWithin classAbstractConnectable<RepositoryAPI,Document>
-
-