Class Document

    • Field Detail

      • DEFAULT_FILE_CONTENT

        public static final java.lang.String DEFAULT_FILE_CONTENT
        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
    • 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 a Document in order to update it.
        Since:
        3.0
      • createWithName

        public static Document createWithName​(java.lang.String name,
                                              java.lang.String type)
        Regular way to instantiate a Document in 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()
      • 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]/bar as foos/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 given segments
        segments - the remaining segments to resolve on given value
        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, use streamBlob() instead
      • fetchBlob

        @Deprecated
        public FileBlob fetchBlob​(java.lang.String fieldPath)
        Deprecated.
        since 3.1, use streamBlob(String) instead
      • streamBlob

        public StreamBlob streamBlob​(java.lang.String fieldPath)
      • fetchBlob

        @Deprecated
        public void fetchBlob​(retrofit2.Callback<FileBlob> callback)
        Deprecated.
        since 3.1, use streamBlob(Callback) instead
      • fetchBlob

        @Deprecated
        public void fetchBlob​(java.lang.String fieldPath,
                              retrofit2.Callback<FileBlob> callback)
        Deprecated.
        since 3.1, use streamBlob(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()
      • startWorkflowInstance

        public Workflow startWorkflowInstance​(Workflow workflow)
      • 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, use fetchTasks() 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 an adapter object 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 an adapter object to build requests against Nuxeo Server Web Adapter.
        Parameters:
        creator - the function used to instantiate a specific adapter
        Since:
        3.2