com.jalios.rest.client
Class JcmsApp

java.lang.Object
  extended by com.jalios.rest.client.JcmsApp
All Implemented Interfaces:
JcmsRestConstants

public class JcmsApp
extends Object
implements JcmsRestConstants

Represents one remote JCMS site on wich an HTTP client session is connected through the REST Open API.

Since:
JCMS-6.0
Author:
dissert

Field Summary
 
Fields inherited from interface com.jalios.rest.client.JcmsRestConstants
HTTP_HEADERS, METHOD_OVERRIDE_HTTP_HEADER, UTS_ADMIN, UTS_CACHES, UTS_DATA_CHILDREN, UTS_DATA_PARAM, UTS_DATATYPE_ITEM, UTS_DATATYPE_LIST, UTS_JSYNC, UTS_JSYNC_REPLICA, UTS_LUCENE, UTS_LUCENE_CATEGORIES, UTS_LUCENE_PUBLICATIONS, UTS_MEMBER_ITEM, UTS_PRIVATE_RESOURCE, UTS_SEARCH, UTS_WORKFLOWS, UTS_WORKFLOWS_ITEM
 
Constructor Summary
JcmsApp(ClientSession session)
           
 
Method Summary
 JcmsResource createData(String dataTypeClassShortName, org.restlet.data.Form fields)
          Create a data of type given by the dataTypeClassShortName and the values set in the form fields.
 JcmsResource createData(String dataTypeClassShortName, org.restlet.data.Form fields, Authentication forcedAuthentication)
          Create a data of type given by the dataTypeClassShortName and the values set in the form fields.
 JcmsResource createFileDocument(String filename, File file, org.restlet.data.Form parameters)
          Create a FileDocument wrapping the file with the filename and the values set in the form fields.
 JcmsResource deleteData(org.restlet.data.Reference dataRef)
           
 JcmsResource deleteData(org.restlet.data.Reference dataRef, Authentication forcedAuthentication)
           
 JcmsResource deleteData(String dataId)
           
 JcmsResource deleteData(String dataId, Authentication forcedAuthentication)
           
 JcmsResource disableDataWrite(String msg)
           
 JcmsResource disableDataWrite(String msg, Authentication forcedAuthentication)
           
 JcmsResource disableMember(String login)
          Call to the member resource, given its login, with action disable.
 JcmsResource downloadFile(String fileLink)
           
 JcmsResource enableDataWrite(String msg)
           
 JcmsResource enableDataWrite(String msg, Authentication forcedAuthentication)
           
 JcmsResource enableMember(String login, String password)
          Call to the member resource, given its login, with action enable, and with the password given in parameter (in post).
 JcmsResource getAdminStatus()
           
 JcmsResource getAdminStatus(Authentication forcedAuthentication)
           
 String getAdminStatusPath()
           
 JcmsResource getAllDataType()
           
 JcmsResource getAllDataType(Authentication forcedAuthentication)
           
 String getAllDataTypePath()
           
 JcmsResource getAllWorkflows()
           
 JcmsResource getAllWorkflows(Authentication forcedAuthentication)
           
 String getAllWorkflowsPath()
           
 List<DataElement> getChildren(String dataId)
          Gives the list of children of a data, given its id, if its type supports it (TreeNode, Group).
 List<DataElement> getChildren(String dataId, Authentication forcedAuthentication, Relateds relateds)
          Gives the list of children of a data, given its id, if its type supports it (TreeNode, Group).
 JcmsResource getChildrenData(String dataId)
          Send a request to get the set of children of a data with a given JCMS id.
 JcmsResource getChildrenData(String dataId, Authentication forcedAuthentication)
          Send a request to get the set of children of a data with a given JCMS id.
 JcmsResource getChildrenData(String dataId, Authentication forcedAuthentication, Relateds relateds)
          Send a request to get the set of children of a data with a given JCMS id.
 JcmsResource getChildrenData(String dataId, Relateds relateds)
          Send a request to get the set of children of a data with a given JCMS id.
 String getChildrenDataPath(String dataId)
          Construct the URI to get the set of children of a data, given its JCMS id.
 String getCreateDataPath(String dataTypeClassShortName)
           
 String getCreateFileDocumentPath()
          Gives the URI of the creation of a FileDocument.
 JcmsResource getData(String dataId)
          Send a request to find a data with a given JCMS id.
 JcmsResource getData(String dataId, Authentication forcedAuthentication)
          Send a request to find a data with a given JCMS id.
 JcmsResource getData(String dataId, Authentication forcedAuthentication, Relateds relateds)
          Send a request to find a data with a given JCMS id.
 JcmsResource getData(String dataId, Relateds relateds)
          Send a request to find a data with a given JCMS id.
 JcmsResource getDataList(String[] dataId)
          Send a request to find a data with a given JCMS id.
 String getDataPath(String dataId)
          Construct the URI for a data, given its JCMS id.
 JcmsResource getDataType(String typeshortclassname)
           
 JcmsResource getDataType(String typeshortclassname, Authentication forcedAuthentication)
           
 String getDataTypePath(String typeshortclassname)
           
 DataElement getDefaultWorkspace()
          Gives the default Workspace of JCMS, if it is visible for the loggedMember.
 DataElement getDefaultWorkspace(Authentication forcedAuthentication, Relateds relateds)
          Gives the default Workspace of JCMS, if it is visible for the loggedMember.
 JcmsResource getDefaultWorkspaceData()
          Gives the default Workspace of JCMS, if it is visible for the loggedMember.
 JcmsResource getDefaultWorkspaceData(Authentication forcedAuthentication, Relateds relateds)
          Gives the default Workspace of JCMS, if it is visible for the loggedMember.
 String getIdFromLogin(String login)
          High level method.
 JcmsResource getMember(String login)
           
 JcmsResource getMember(String login, Authentication forcedAuthentication)
           
 JcmsResource getMember(String login, Authentication forcedAuthentication, Relateds relateds)
           
 JcmsResource getMember(String login, Relateds relateds)
           
 JcmsResource getMemberList()
           
 JcmsResource getMemberList(Authentication forcedAuthentication)
           
 JcmsResource getMemberList(Authentication forcedAuthentication, Relateds relateds)
           
 JcmsResource getMemberList(Relateds relateds)
           
 String getMemberListPath()
           
 String getMemberPath(String login)
           
 DataElement getRootCategory()
          Gives the root of JCMS categories, if it is visible for the loggedMember.
 DataElement getRootCategory(Authentication forcedAuthentication, Relateds relateds)
          Gives the root of JCMS categories, if it is visible for the loggedMember.
 JcmsResource getRootCategoryData()
          Gives the root of JCMS categories, if it is visible for the loggedMember.
 JcmsResource getRootCategoryData(Authentication forcedAuthentication, Relateds relateds)
          Gives the root of JCMS categories, if it is visible for the loggedMember.
 String getSearchPath()
           
 ClientSession getSession()
           
 String getUpdateFileDocumentPath(String id)
          Gives the URI of the update of a FileDocument.
 JcmsResource getWorkflow(String wfId)
           
 JcmsResource getWorkflow(String wfId, Authentication forcedAuthentication)
           
 String getWorkflowPath(String wfId)
           
 JcmsResource importDataFromSource(String importSourceId)
           
 JcmsResource importDataFromSource(String importSourceId, Authentication forcedAuthentication)
           
 JcmsResource lock(org.restlet.data.Reference fileDocRef)
          Call to the FileDocument resource, given the id of the FileDocument, with action lock.
 JcmsResource lock(String fileDocId)
          Call to the FileDocument resource, given the id of the FileDocument, with action lock.
 JcmsResource search(org.restlet.data.Form fields)
           
 JcmsResource search(org.restlet.data.Form fields, Authentication forcedAuthentication)
           
 JcmsResource search(org.restlet.data.Form fields, Authentication forcedAuthentication, Relateds relateds)
           
 JcmsResource search(org.restlet.data.Form fields, Relateds relateds)
           
 JcmsResource unlock(org.restlet.data.Reference fileDocRef)
          Call to the FileDocument resource, given the id of the FileDocument, with action unlock.
 JcmsResource unlock(String fileDocId)
          Call to the FileDocument resource, given the id of the FileDocument, with action unlock.
 JcmsResource updateData(org.restlet.data.Reference dataRef, org.restlet.data.Form fields)
           
 JcmsResource updateData(org.restlet.data.Reference dataRef, org.restlet.data.Form fields, Authentication forcedAuthentication)
           
 JcmsResource updateData(String dataId, org.restlet.data.Form fields)
           
 JcmsResource updateData(String dataId, org.restlet.data.Form fields, Authentication forcedAuthentication)
           
 JcmsResource updateFileDocument(org.restlet.data.Reference dataRef, String filename, File file, org.restlet.data.Form parameters)
          Update a FileDocument.
 JcmsResource updateFileDocument(String id, String filename, File file, org.restlet.data.Form parameters)
          Update a FileDocument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcmsApp

public JcmsApp(ClientSession session)
Method Detail

getSession

public ClientSession getSession()

getDataPath

public String getDataPath(String dataId)
Construct the URI for a data, given its JCMS id.

Parameters:
dataId - the JCMS id
Returns:
the path.

getData

public JcmsResource getData(String dataId)
                     throws RestException
Send a request to find a data with a given JCMS id.

Parameters:
dataId - the JCMS id
Returns:
the resource
Throws:
RestException

getData

public JcmsResource getData(String dataId,
                            Authentication forcedAuthentication)
                     throws RestException
Send a request to find a data with a given JCMS id.

Parameters:
dataId - the JCMS id
forcedAuthentication - possible specific authentication for this request
Returns:
the resource
Throws:
RestException

getData

public JcmsResource getData(String dataId,
                            Relateds relateds)
                     throws RestException
Send a request to find a data with a given JCMS id.

Parameters:
dataId - the JCMS id
relateds - possible relateds
Returns:
the resource
Throws:
RestException
Since:
JCMS-6.1

getData

public JcmsResource getData(String dataId,
                            Authentication forcedAuthentication,
                            Relateds relateds)
                     throws RestException
Send a request to find a data with a given JCMS id.

Parameters:
dataId - the JCMS id
forcedAuthentication - possible specific authentication for this request
relateds - possible relateds
Returns:
the resource
Throws:
RestException
Since:
JCMS-6.1

getDataList

public JcmsResource getDataList(String[] dataId)
                         throws RestException
Send a request to find a data with a given JCMS id.

Parameters:
dataId - the JCMS id
Returns:
the resource
Throws:
RestException

getChildrenDataPath

public String getChildrenDataPath(String dataId)
Construct the URI to get the set of children of a data, given its JCMS id.

Parameters:
dataId - the JCMS id
Returns:
the path.
Since:
JCMS-6.1

getChildrenData

public JcmsResource getChildrenData(String dataId)
                             throws RestException
Send a request to get the set of children of a data with a given JCMS id.

Parameters:
dataId - the JCMS id
Returns:
the resource
Throws:
RestException
Since:
JCMS-6.1

getChildren

public List<DataElement> getChildren(String dataId)
Gives the list of children of a data, given its id, if its type supports it (TreeNode, Group).

Parameters:
dataId -
Returns:
a list of DataElement
Since:
JCMS-6.1

getChildren

public List<DataElement> getChildren(String dataId,
                                     Authentication forcedAuthentication,
                                     Relateds relateds)
Gives the list of children of a data, given its id, if its type supports it (TreeNode, Group).

Parameters:
dataId -
forcedAuthentication - possible specific authentication for this request
relateds - possible relateds
Returns:
a list of DataElement
Since:
JCMS-6.1

getChildrenData

public JcmsResource getChildrenData(String dataId,
                                    Authentication forcedAuthentication)
                             throws RestException
Send a request to get the set of children of a data with a given JCMS id.

Parameters:
dataId - the JCMS id
forcedAuthentication - possible specific authentication for this request
Returns:
the resource
Throws:
RestException
Since:
JCMS-6.1

getChildrenData

public JcmsResource getChildrenData(String dataId,
                                    Relateds relateds)
                             throws RestException
Send a request to get the set of children of a data with a given JCMS id.

Parameters:
dataId - the JCMS id
relateds - possible relateds
Returns:
the resource
Throws:
RestException
Since:
JCMS-6.1

getChildrenData

public JcmsResource getChildrenData(String dataId,
                                    Authentication forcedAuthentication,
                                    Relateds relateds)
                             throws RestException
Send a request to get the set of children of a data with a given JCMS id.

Parameters:
dataId - the JCMS id
forcedAuthentication - possible specific authentication for this request
relateds - possible relateds
Returns:
the resource
Throws:
RestException
Since:
JCMS-6.1

getSearchPath

public String getSearchPath()

search

public JcmsResource search(org.restlet.data.Form fields)
                    throws RestException
Throws:
RestException

search

public JcmsResource search(org.restlet.data.Form fields,
                           Authentication forcedAuthentication)
                    throws RestException
Throws:
RestException

search

public JcmsResource search(org.restlet.data.Form fields,
                           Relateds relateds)
                    throws RestException
Throws:
RestException

search

public JcmsResource search(org.restlet.data.Form fields,
                           Authentication forcedAuthentication,
                           Relateds relateds)
                    throws RestException
Throws:
RestException

downloadFile

public JcmsResource downloadFile(String fileLink)
                          throws RestException
Throws:
RestException

getMemberListPath

public String getMemberListPath()

getMemberList

public JcmsResource getMemberList()
                           throws RestException
Throws:
RestException

getMemberList

public JcmsResource getMemberList(Authentication forcedAuthentication)
                           throws RestException
Throws:
RestException

getMemberList

public JcmsResource getMemberList(Relateds relateds)
                           throws RestException
Throws:
RestException

getMemberList

public JcmsResource getMemberList(Authentication forcedAuthentication,
                                  Relateds relateds)
                           throws RestException
Throws:
RestException

getMemberPath

public String getMemberPath(String login)

getMember

public JcmsResource getMember(String login)
                       throws RestException
Throws:
RestException

getMember

public JcmsResource getMember(String login,
                              Authentication forcedAuthentication)
                       throws RestException
Throws:
RestException

getMember

public JcmsResource getMember(String login,
                              Relateds relateds)
                       throws RestException
Throws:
RestException

getMember

public JcmsResource getMember(String login,
                              Authentication forcedAuthentication,
                              Relateds relateds)
                       throws RestException
Throws:
RestException

disableMember

public JcmsResource disableMember(String login)
Call to the member resource, given its login, with action disable.

Parameters:
login - the login of the member to disable
Returns:
the resource corresponding to request

enableMember

public JcmsResource enableMember(String login,
                                 String password)
Call to the member resource, given its login, with action enable, and with the password given in parameter (in post).

Parameters:
login - the login of the member to enable
password - the new password : mandatory to activate the member
Returns:
the resource corresponding to request

getIdFromLogin

public String getIdFromLogin(String login)
High level method. Return the id of a member, given its login. The member must not be desactivated.

Parameters:
login -
Returns:
the JCMS id bound to this login, null if it is not possible to get it.

getDataTypePath

public String getDataTypePath(String typeshortclassname)

getDataType

public JcmsResource getDataType(String typeshortclassname)
                         throws RestException
Throws:
RestException

getDataType

public JcmsResource getDataType(String typeshortclassname,
                                Authentication forcedAuthentication)
                         throws RestException
Throws:
RestException

getAllDataTypePath

public String getAllDataTypePath()

getAllDataType

public JcmsResource getAllDataType()
                            throws RestException
Throws:
RestException

getAllDataType

public JcmsResource getAllDataType(Authentication forcedAuthentication)
                            throws RestException
Throws:
RestException

getAllWorkflowsPath

public String getAllWorkflowsPath()

getAllWorkflows

public JcmsResource getAllWorkflows()
                             throws RestException
Throws:
RestException

getAllWorkflows

public JcmsResource getAllWorkflows(Authentication forcedAuthentication)
                             throws RestException
Throws:
RestException

getWorkflowPath

public String getWorkflowPath(String wfId)

getWorkflow

public JcmsResource getWorkflow(String wfId)
                         throws RestException
Throws:
RestException

getWorkflow

public JcmsResource getWorkflow(String wfId,
                                Authentication forcedAuthentication)
                         throws RestException
Throws:
RestException

getAdminStatusPath

public String getAdminStatusPath()

getAdminStatus

public JcmsResource getAdminStatus()
                            throws RestException
Throws:
RestException

getAdminStatus

public JcmsResource getAdminStatus(Authentication forcedAuthentication)
                            throws RestException
Throws:
RestException

getCreateDataPath

public String getCreateDataPath(String dataTypeClassShortName)

createData

public JcmsResource createData(String dataTypeClassShortName,
                               org.restlet.data.Form fields)
Create a data of type given by the dataTypeClassShortName and the values set in the form fields.

Parameters:
dataTypeClassShortName - type of the data to be created
fields - values to create the new data
Returns:
the JcmsResource corresponding to the creation. The resource of the data is in the "Location" Header field.

createData

public JcmsResource createData(String dataTypeClassShortName,
                               org.restlet.data.Form fields,
                               Authentication forcedAuthentication)
Create a data of type given by the dataTypeClassShortName and the values set in the form fields.

Parameters:
dataTypeClassShortName - type of the data to be created
fields - values to create the new data
forcedAuthentication - possible authenticatio nto use for this request
Returns:
the JcmsResource corresponding to the creation. The resource of the data is in the "Location" Header field.

updateData

public JcmsResource updateData(String dataId,
                               org.restlet.data.Form fields)

updateData

public JcmsResource updateData(org.restlet.data.Reference dataRef,
                               org.restlet.data.Form fields)

updateData

public JcmsResource updateData(String dataId,
                               org.restlet.data.Form fields,
                               Authentication forcedAuthentication)

updateData

public JcmsResource updateData(org.restlet.data.Reference dataRef,
                               org.restlet.data.Form fields,
                               Authentication forcedAuthentication)

deleteData

public JcmsResource deleteData(String dataId)

deleteData

public JcmsResource deleteData(org.restlet.data.Reference dataRef)

deleteData

public JcmsResource deleteData(String dataId,
                               Authentication forcedAuthentication)

deleteData

public JcmsResource deleteData(org.restlet.data.Reference dataRef,
                               Authentication forcedAuthentication)

getCreateFileDocumentPath

public String getCreateFileDocumentPath()
Gives the URI of the creation of a FileDocument.

Returns:
the URI
Since:
JCMS-6.1

createFileDocument

public JcmsResource createFileDocument(String filename,
                                       File file,
                                       org.restlet.data.Form parameters)
Create a FileDocument wrapping the file with the filename and the values set in the form fields.

Parameters:
filename - the filename
file - the file
parameters - others parameters as set in DocUploadHandler
Returns:
the JcmsResource wrapping the HTTP response.
Since:
JCMS-6.1

getUpdateFileDocumentPath

public String getUpdateFileDocumentPath(String id)
Gives the URI of the update of a FileDocument.

Parameters:
id - the id of the given FileDocument
Returns:
the URI
Since:
JCMS-6.1

updateFileDocument

public JcmsResource updateFileDocument(String id,
                                       String filename,
                                       File file,
                                       org.restlet.data.Form parameters)
Update a FileDocument.

Parameters:
id - the id of the FileDocument
filename - the filename
file - the file
parameters - others parameters as set in DocUploadHandler
Returns:
the JcmsResource wrapping the HTTP response.
Since:
JCMS-6.1

updateFileDocument

public JcmsResource updateFileDocument(org.restlet.data.Reference dataRef,
                                       String filename,
                                       File file,
                                       org.restlet.data.Form parameters)
Update a FileDocument.

Parameters:
dataRef - the reference of the FileDocument
filename - the filename
file - the file
parameters - others parameters as set in DocUploadHandler
Returns:
the JcmsResource wrapping the HTTP response.
Since:
JCMS-6.1

lock

public JcmsResource lock(String fileDocId)
Call to the FileDocument resource, given the id of the FileDocument, with action lock.

Parameters:
fileDocId - the id of the FileDocument
Returns:
the resource corresponding to request
Since:
jcms-6.1.0

lock

public JcmsResource lock(org.restlet.data.Reference fileDocRef)
Call to the FileDocument resource, given the id of the FileDocument, with action lock.

Parameters:
fileDocRef - the Reference of the FileDocument
Returns:
the resource corresponding to request
Since:
jcms-6.1.0

unlock

public JcmsResource unlock(String fileDocId)
Call to the FileDocument resource, given the id of the FileDocument, with action unlock.

Parameters:
fileDocId - the id of the FileDocument
Returns:
the resource corresponding to request
Since:
jcms-6.1.0

unlock

public JcmsResource unlock(org.restlet.data.Reference fileDocRef)
Call to the FileDocument resource, given the id of the FileDocument, with action unlock.

Parameters:
fileDocRef - the Reference of the FileDocument
Returns:
the resource corresponding to request
Since:
jcms-6.1.0

disableDataWrite

public JcmsResource disableDataWrite(String msg)

disableDataWrite

public JcmsResource disableDataWrite(String msg,
                                     Authentication forcedAuthentication)

enableDataWrite

public JcmsResource enableDataWrite(String msg)

enableDataWrite

public JcmsResource enableDataWrite(String msg,
                                    Authentication forcedAuthentication)

importDataFromSource

public JcmsResource importDataFromSource(String importSourceId)

importDataFromSource

public JcmsResource importDataFromSource(String importSourceId,
                                         Authentication forcedAuthentication)

getRootCategoryData

public JcmsResource getRootCategoryData()
                                 throws RestException
Gives the root of JCMS categories, if it is visible for the loggedMember.

Returns:
the JcmsResource wrapping the response
Throws:
RestException

getRootCategory

public DataElement getRootCategory()
Gives the root of JCMS categories, if it is visible for the loggedMember.

Returns:
root of JCMS categories as a DataElement

getRootCategoryData

public JcmsResource getRootCategoryData(Authentication forcedAuthentication,
                                        Relateds relateds)
                                 throws RestException
Gives the root of JCMS categories, if it is visible for the loggedMember.

Parameters:
forcedAuthentication -
relateds -
Returns:
the JcmsResource wrapping the response
Throws:
RestException

getRootCategory

public DataElement getRootCategory(Authentication forcedAuthentication,
                                   Relateds relateds)
Gives the root of JCMS categories, if it is visible for the loggedMember.

Parameters:
forcedAuthentication -
relateds -
Returns:
root of JCMS categories as a DataElement

getDefaultWorkspaceData

public JcmsResource getDefaultWorkspaceData()
                                     throws RestException
Gives the default Workspace of JCMS, if it is visible for the loggedMember.

Returns:
the JcmsResource wrapping the response
Throws:
RestException

getDefaultWorkspace

public DataElement getDefaultWorkspace()
Gives the default Workspace of JCMS, if it is visible for the loggedMember.

Returns:
the default workspace, as a DataElement

getDefaultWorkspaceData

public JcmsResource getDefaultWorkspaceData(Authentication forcedAuthentication,
                                            Relateds relateds)
                                     throws RestException
Gives the default Workspace of JCMS, if it is visible for the loggedMember.

Parameters:
forcedAuthentication -
relateds -
Returns:
the JcmsResource wrapping the response
Throws:
RestException

getDefaultWorkspace

public DataElement getDefaultWorkspace(Authentication forcedAuthentication,
                                       Relateds relateds)
Gives the default Workspace of JCMS, if it is visible for the loggedMember.

Parameters:
forcedAuthentication -
relateds -
Returns:
the default workspace, as a DataElement


Copyright © 2001-2007 Jalios SA. All Rights Reserved.