Class DocumentClient
- Direct Known Subclasses:
WorkflowClient
- Author:
- Ralph Soika
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final Stringstatic final Stringstatic final Stringprotected Stringprotected intprotected intprotected Stringprotected booleanprotected StringFields inherited from class org.imixs.melman.AbstractClient
baseURI, requestFilterList, sslContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcountDocuments(String query) Counts a given lucene search resultorg.imixs.workflow.ItemCollectioncreateAdminPJob(org.imixs.workflow.ItemCollection document) Creates a new AdminPJobInstancevoiddeleteDocument(String uniqueid) Deletes a single workItem or document instance by UniqueID.org.imixs.workflow.ItemCollectiongetDocument(String uniqueid) Returns a single document instance by UniqueID.getItems()intintgetType()retruns the document type.booleanvoidpostXMLDataCollection(String uri, org.imixs.workflow.xml.XMLDataCollection xmlDataCollection) Posts a XMLDocument collection to a custom resource.org.imixs.workflow.xml.XMLDataCollectionpostXMLDocument(String uri, org.imixs.workflow.xml.XMLDocument xmlWorkitem) Posts a XMLDocument to a custom resource.List<org.imixs.workflow.ItemCollection>queryDocuments(String jpqlStatement) Returns the the search result of a JPQL statement.org.imixs.workflow.ItemCollectionsaveDocument(org.imixs.workflow.ItemCollection document) Creates or updates a single document instance.List<org.imixs.workflow.ItemCollection>searchDocuments(String query) Returns the the search result of a lucene search.voidSet a comma separated list of items to be returned.voidsetPageIndex(int pageIndex) voidsetPageSize(int pageSize) voidvoidsetSortOrder(String sortBy, boolean sortReverse) voidsetSortReverse(boolean sortReverse) voidMethods inherited from class org.imixs.melman.AbstractClient
getBaseURI, getCustomResource, getCustomResourceXML, getRequestFilterList, getSslContext, getWebTarget, logout, newClient, registerClientRequestFilter, setBaseURI, setSslContext
-
Field Details
-
ITEM_ERROR_CODE
- See Also:
-
ITEM_ERROR_MESSAGE
- See Also:
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE- See Also:
-
DEFAULT_TYPE
- See Also:
-
sortBy
-
sortReverse
protected boolean sortReverse -
type
-
pageSize
protected int pageSize -
pageIndex
protected int pageIndex -
items
-
-
Constructor Details
-
DocumentClient
Initialize the client by a BASE_URL.- Parameters:
base_uri-
-
-
Method Details
-
getPageSize
public int getPageSize() -
setPageSize
public void setPageSize(int pageSize) -
getPageIndex
public int getPageIndex() -
setPageIndex
public void setPageIndex(int pageIndex) -
getItems
-
setItems
Set a comma separated list of items to be returned.- Parameters:
items-
-
getType
retruns the document type. The default value is "workitem"- Returns:
-
setType
-
getSortBy
-
setSortBy
-
isSortReverse
public boolean isSortReverse() -
setSortReverse
public void setSortReverse(boolean sortReverse) -
setSortOrder
-
saveDocument
public org.imixs.workflow.ItemCollection saveDocument(org.imixs.workflow.ItemCollection document) throws RestAPIException Creates or updates a single document instance.- Parameters:
document- - a ItemCollection representing the document.- Returns:
- updated document instance
- Throws:
RestAPIException
-
createAdminPJob
public org.imixs.workflow.ItemCollection createAdminPJob(org.imixs.workflow.ItemCollection document) throws RestAPIException Creates a new AdminPJobInstance- Parameters:
document- - a ItemCollection representing the job.- Returns:
- updated job instance
- Throws:
RestAPIException
-
getDocument
Returns a single document instance by UniqueID.- Parameters:
uniqueid-- Returns:
- workitem
- Throws:
RestAPIException
-
deleteDocument
Deletes a single workItem or document instance by UniqueID.- Parameters:
userid-- Throws:
RestAPIException
-
searchDocuments
public List<org.imixs.workflow.ItemCollection> searchDocuments(String query) throws RestAPIException, UnsupportedEncodingException Returns the the search result of a lucene search.The method creates a search URL and requests a CustomResource by GET. The lucene search phrase is encoded by this method. The method throws a UnsupportedEncodingException if the query string can not be encoded.
- Parameters:
query- - lucene search query- Returns:
- result list
- Throws:
RestAPIExceptionUnsupportedEncodingException
-
queryDocuments
public List<org.imixs.workflow.ItemCollection> queryDocuments(String jpqlStatement) throws RestAPIException, UnsupportedEncodingException Returns the the search result of a JPQL statement.The method creates a search URL and requests a CustomResource by GET. The JPQL statement is encoded by this method. The method throws a UnsupportedEncodingException if the query string can not be encoded.
- Parameters:
jpqlStatement- - lucene search query / JQPL statement- Returns:
- result list
- Throws:
RestAPIExceptionUnsupportedEncodingException
-
countDocuments
Counts a given lucene search resultThe method returns the count of documents included in the result of a given lucene query
- Parameters:
query- - lucene search query- Returns:
- count of total hits
- Throws:
RestAPIExceptionUnsupportedEncodingException
-
postXMLDocument
public org.imixs.workflow.xml.XMLDataCollection postXMLDocument(String uri, org.imixs.workflow.xml.XMLDocument xmlWorkitem) throws RestAPIException Posts a XMLDocument to a custom resource.This method expects that the response is a XMLDataCollection containing the posted document. In case of an HTTP Result other than 200=OK the method throws an exception containing the the error_code and error_message stored in the returnded XMLDocument
- Parameters:
document- - a ItemCollection representing the document.- Returns:
- updated document instance or null if no document was returned by the API
- Throws:
RestAPIException
-
postXMLDataCollection
public void postXMLDataCollection(String uri, org.imixs.workflow.xml.XMLDataCollection xmlDataCollection) throws RestAPIException Posts a XMLDocument collection to a custom resource.- Parameters:
documents- - a collection of ItemCollection objects- Throws:
RestAPIException
-