Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.ws
Class NuxeoRemotingBean

java.lang.Object
  extended by org.nuxeo.ecm.platform.ws.AbstractNuxeoWebService
      extended by org.nuxeo.ecm.platform.ws.NuxeoRemotingBean
All Implemented Interfaces:
Serializable, BaseNuxeoWebService, NuxeoRemoting

public class NuxeoRemotingBean
extends AbstractNuxeoWebService
implements NuxeoRemoting

Nuxeo remoting stateful session bean.

Author:
Julien Anguenot, Thierry Delprat
See Also:
Serialized Form

Constructor Summary
NuxeoRemotingBean()
           
 
Method Summary
 DocumentDescriptor[] getChildren(String sessionId, String uuid)
          Gets the children of the given document.
 DocumentDescriptor getCurrentVersion(String sid, String uuid)
          Gets the current version of the given document.
 DocumentDescriptor getDocument(String sessionId, String uuid)
          Gets the doc descriptor given the doc UUID.
 WsACE[] getDocumentACL(String sid, String uuid)
          Returns the merged ACL of the document (contains all ACEs defined on the document and its parents).
 DocumentBlob[] getDocumentBlobs(String sid, String uuid)
          Returns the document blobs only using byte[] format
 DocumentBlob[] getDocumentBlobsExt(String sid, String uuid, boolean useDownloadUrl)
          Returns the document blobs only.
 WsACE[] getDocumentLocalACL(String sid, String uuid)
          Returns the merged ACL of the document (contains all ACEs defined on the document, filtering the inherited ones).
 DocumentProperty[] getDocumentNoBlobProperties(String sid, String uuid)
          Same as NuxeoRemoting.getDocumentProperties(String, String) but skips blobs.
 DocumentProperty[] getDocumentProperties(String sid, String uuid)
          Returns the document properties.
 DocumentSnapshot getDocumentSnapshot(String sid, String uuid)
          Gets all properties and ACLs from a document uses byte[] format to export blob
 DocumentSnapshot getDocumentSnapshotExt(String sid, String uuid, boolean useDownloadUrl)
          Gets all properties and ACLs from a document
 String[] getGroups(String sid, String parentGroup)
          Gets all sub-groups inside the given group.
 String getRelativePathAsString(String sessionId, String uuid)
          Returns the relative path as a displayable path with parent titles.
 String getRepositoryName(String sid)
          Gets the current repository name.
 DocumentDescriptor getRootDocument(String sessionId)
          Gets the root document descriptor.
 DocumentDescriptor getSourceDocument(String sid, String uid)
          Gets the document that created the version specified by the given uid.
 String[] getUsers(String sid, String parentGroup)
          Get all users inside the given group.
 DocumentDescriptor[] getVersions(String sid, String uid)
          Gets the versions of the given document.
 boolean hasPermission(String sid, String uuid, String permission)
          Checks the given permission for the current user on the given document.
 String[] listGroups(String sid, int from, int to)
          Return the list of all groups.
 String[] listUsers(String sid, int from, int to)
          Returns the list of all users.
 String uploadDocument(String sid, String parentUUID, String type, String[] properties)
           
 
Methods inherited from class org.nuxeo.ecm.platform.ws.AbstractNuxeoWebService
connect, connectOnRepository, disconnect
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nuxeo.ecm.platform.api.ws.BaseNuxeoWebService
connect, disconnect
 

Constructor Detail

NuxeoRemotingBean

public NuxeoRemotingBean()
Method Detail

getRepositoryName

public String getRepositoryName(String sid)
                         throws ClientException
Description copied from interface: NuxeoRemoting
Gets the current repository name.

Specified by:
getRepositoryName in interface NuxeoRemoting
Parameters:
sid - the session id
Returns:
the repository name
Throws:
ClientException

getDocumentACL

public WsACE[] getDocumentACL(String sid,
                              String uuid)
                       throws ClientException
Description copied from interface: NuxeoRemoting
Returns the merged ACL of the document (contains all ACEs defined on the document and its parents).

It includes all ACLs for each ACP.

Specified by:
getDocumentACL in interface NuxeoRemoting
uuid - the uuid of the document
Returns:
the ordered list of ACLs
Throws:
ClientException

getDocumentSnapshot

public DocumentSnapshot getDocumentSnapshot(String sid,
                                            String uuid)
                                     throws ClientException
Description copied from interface: NuxeoRemoting
Gets all properties and ACLs from a document uses byte[] format to export blob

Specified by:
getDocumentSnapshot in interface NuxeoRemoting
Parameters:
sid - the session id
uuid - the doc uuid
Returns:
Throws:
ClientException

getDocumentSnapshotExt

public DocumentSnapshot getDocumentSnapshotExt(String sid,
                                               String uuid,
                                               boolean useDownloadUrl)
                                        throws ClientException
Description copied from interface: NuxeoRemoting
Gets all properties and ACLs from a document

Specified by:
getDocumentSnapshotExt in interface NuxeoRemoting
Parameters:
sid - the session id
uuid - the doc uuid
useDownloadUrl - define blob export format
Returns:
Throws:
ClientException

getDocumentLocalACL

public WsACE[] getDocumentLocalACL(String sid,
                                   String uuid)
                            throws ClientException
Description copied from interface: NuxeoRemoting
Returns the merged ACL of the document (contains all ACEs defined on the document, filtering the inherited ones).

It includes all ACLs for each ACP.

Specified by:
getDocumentLocalACL in interface NuxeoRemoting
uuid - the uuid of the document
Returns:
the ordered list of ACLs
Throws:
ClientException

hasPermission

public boolean hasPermission(String sid,
                             String uuid,
                             String permission)
                      throws ClientException
Description copied from interface: NuxeoRemoting
Checks the given permission for the current user on the given document.

Specified by:
hasPermission in interface NuxeoRemoting
Returns:
Throws:
ClientException

getDocumentBlobs

public DocumentBlob[] getDocumentBlobs(String sid,
                                       String uuid)
                                throws ClientException
Description copied from interface: NuxeoRemoting
Returns the document blobs only using byte[] format

Specified by:
getDocumentBlobs in interface NuxeoRemoting
uuid - the uuid of the document.
Returns:
an array of document blob instances.
Throws:
ClientException

getDocumentBlobsExt

public DocumentBlob[] getDocumentBlobsExt(String sid,
                                          String uuid,
                                          boolean useDownloadUrl)
                                   throws ClientException
Description copied from interface: NuxeoRemoting
Returns the document blobs only.

Specified by:
getDocumentBlobsExt in interface NuxeoRemoting
uuid - the uuid of the document.
useDownloadUrl - defines if blob are exported as download url or as byte|[]
Returns:
an array of document blob instances.
Throws:
ClientException

listUsers

public String[] listUsers(String sid,
                          int from,
                          int to)
                   throws ClientException
Description copied from interface: NuxeoRemoting
Returns the list of all users.

This method supports pagination in case of large user dbs.

Pagination is not yet working!

Specified by:
listUsers in interface NuxeoRemoting
from - pagination start
to - pagination stop
Returns:
an array of principal names
Throws:
ClientException

listGroups

public String[] listGroups(String sid,
                           int from,
                           int to)
                    throws ClientException
Description copied from interface: NuxeoRemoting
Return the list of all groups.

This method supports pagination in case of large user dbs

Pagination is not yet working!

Specified by:
listGroups in interface NuxeoRemoting
from - pagination start
to - pagination stop
Returns:
an array of group names
Throws:
ClientException

getDocumentProperties

public DocumentProperty[] getDocumentProperties(String sid,
                                                String uuid)
                                         throws ClientException
Description copied from interface: NuxeoRemoting
Returns the document properties.

All property are returned even blobs. All values are converted to strings.

It includes the perm link of the document.

No need to includes blobs here. See the dedicated API.

Specified by:
getDocumentProperties in interface NuxeoRemoting
uuid - uuid of the document.
Returns:
a map from name of the property to its value
Throws:
ClientException

getDocumentNoBlobProperties

public DocumentProperty[] getDocumentNoBlobProperties(String sid,
                                                      String uuid)
                                               throws ClientException
Description copied from interface: NuxeoRemoting
Same as NuxeoRemoting.getDocumentProperties(String, String) but skips blobs.

Specified by:
getDocumentNoBlobProperties in interface NuxeoRemoting
Returns:
Throws:
ClientException

getCurrentVersion

public DocumentDescriptor getCurrentVersion(String sid,
                                            String uuid)
                                     throws ClientException
Description copied from interface: NuxeoRemoting
Gets the current version of the given document.

Specified by:
getCurrentVersion in interface NuxeoRemoting
Returns:
Throws:
ClientException

getSourceDocument

public DocumentDescriptor getSourceDocument(String sid,
                                            String uid)
                                     throws ClientException
Description copied from interface: NuxeoRemoting
Gets the document that created the version specified by the given uid.

Specified by:
getSourceDocument in interface NuxeoRemoting
Returns:
Throws:
ClientException

getVersions

public DocumentDescriptor[] getVersions(String sid,
                                        String uid)
                                 throws ClientException
Description copied from interface: NuxeoRemoting
Gets the versions of the given document.

Specified by:
getVersions in interface NuxeoRemoting
Returns:
Throws:
ClientException

getRootDocument

public DocumentDescriptor getRootDocument(String sessionId)
                                   throws ClientException
Description copied from interface: NuxeoRemoting
Gets the root document descriptor.

Specified by:
getRootDocument in interface NuxeoRemoting
Returns:
the root document
Throws:
ClientException

getDocument

public DocumentDescriptor getDocument(String sessionId,
                                      String uuid)
                               throws ClientException
Description copied from interface: NuxeoRemoting
Gets the doc descriptor given the doc UUID.

Specified by:
getDocument in interface NuxeoRemoting
Parameters:
sessionId - the session id
uuid - the doc uuid
Returns:
the descriptor
Throws:
ClientException

getChildren

public DocumentDescriptor[] getChildren(String sessionId,
                                        String uuid)
                                 throws ClientException
Description copied from interface: NuxeoRemoting
Gets the children of the given document.

Specified by:
getChildren in interface NuxeoRemoting
Parameters:
sessionId - the session id
uuid - the doc uuid
Returns:
the children descriptors
Throws:
ClientException

getUsers

public String[] getUsers(String sid,
                         String parentGroup)
                  throws ClientException
Description copied from interface: NuxeoRemoting
Get all users inside the given group. If the group is null then return all users in the system.

Specified by:
getUsers in interface NuxeoRemoting
Parameters:
sid - the session id
parentGroup - the parent group
Throws:
ClientException - if any error occurs

getGroups

public String[] getGroups(String sid,
                          String parentGroup)
                   throws ClientException
Description copied from interface: NuxeoRemoting
Gets all sub-groups inside the given group. If the parent group is null returns all top level groups.

Specified by:
getGroups in interface NuxeoRemoting
Parameters:
sid - the session id
parentGroup - the parent group
Returns:
Throws:
ClientException

getRelativePathAsString

public String getRelativePathAsString(String sessionId,
                                      String uuid)
                               throws ClientException
Description copied from interface: NuxeoRemoting
Returns the relative path as a displayable path with parent titles.

Example: /Workspaces/My Workspaces/Nice Document

Specified by:
getRelativePathAsString in interface NuxeoRemoting
Parameters:
sessionId - : the session id
uuid - : the document uuid
Returns:
a relative path
Throws:
ClientException

uploadDocument

public String uploadDocument(String sid,
                             String parentUUID,
                             String type,
                             String[] properties)
                      throws ClientException
Specified by:
uploadDocument in interface NuxeoRemoting
Throws:
ClientException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.