public class DocumentClient extends AbstractClient
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PAGE_SIZE |
static String |
DEFAULT_TYPE |
static String |
ITEM_ERROR_CODE |
static String |
ITEM_ERROR_MESSAGE |
protected String |
items |
protected int |
pageIndex |
protected int |
pageSize |
protected String |
sortBy |
protected boolean |
sortReverse |
protected String |
type |
baseURI, requestFilterList| Constructor and Description |
|---|
DocumentClient(String base_uri)
Initialize the client by a BASE_URL.
|
| Modifier and Type | Method and Description |
|---|---|
long |
countDocuments(String query)
Counts a given lucene search result
The method returns the count of documents included in the result of a given
lucene query
|
org.imixs.workflow.ItemCollection |
createAdminPJob(org.imixs.workflow.ItemCollection document)
Creates a new AdminPJobInstance
|
void |
deleteDocument(String uniqueid)
Deletes a single workItem or document instance by UniqueID.
|
List<org.imixs.workflow.ItemCollection> |
getCustomResource(String uri)
Returns the custom data list by uri GET
|
org.imixs.workflow.xml.XMLDataCollection |
getCustomResourceXML(String uri)
Returns the custom data list by uri GET as a collection of XMLDocument
elements.
|
org.imixs.workflow.ItemCollection |
getDocument(String uniqueid)
Returns a single document instance by UniqueID.
|
String |
getItems() |
int |
getPageIndex() |
int |
getPageSize() |
String |
getSortBy() |
String |
getType()
retruns the document type.
|
javax.ws.rs.client.WebTarget |
getWebTarget(String uri) |
boolean |
isSortReverse() |
void |
postXMLDataCollection(String uri,
org.imixs.workflow.xml.XMLDataCollection xmlDataCollection)
Posts a XMLDocument collection to a custom resource.
|
org.imixs.workflow.xml.XMLDataCollection |
postXMLDocument(String uri,
org.imixs.workflow.xml.XMLDocument xmlWorkitem)
Posts a XMLDocument to a custom resource.
|
org.imixs.workflow.ItemCollection |
saveDocument(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.
|
void |
setItems(String items) |
void |
setPageIndex(int pageIndex) |
void |
setPageSize(int pageSize) |
void |
setSortBy(String sortBy) |
void |
setSortOrder(String sortBy,
boolean sortReverse) |
void |
setSortReverse(boolean sortReverse) |
void |
setType(String type) |
getBaseURI, newClient, registerClientRequestFilter, setBaseURIpublic static final String ITEM_ERROR_CODE
public static final String ITEM_ERROR_MESSAGE
public static final int DEFAULT_PAGE_SIZE
public static final String DEFAULT_TYPE
protected String sortBy
protected boolean sortReverse
protected String type
protected int pageSize
protected int pageIndex
protected String items
public DocumentClient(String base_uri)
base_uri - public int getPageSize()
public void setPageSize(int pageSize)
public int getPageIndex()
public void setPageIndex(int pageIndex)
public String getItems()
public void setItems(String items)
public String getType()
public void setType(String type)
public String getSortBy()
public void setSortBy(String sortBy)
public boolean isSortReverse()
public void setSortReverse(boolean sortReverse)
public void setSortOrder(String sortBy, boolean sortReverse)
public org.imixs.workflow.ItemCollection saveDocument(org.imixs.workflow.ItemCollection document)
throws RestAPIException
document - - a ItemCollection representing the document.RestAPIExceptionpublic org.imixs.workflow.ItemCollection createAdminPJob(org.imixs.workflow.ItemCollection document)
throws RestAPIException
document - - a ItemCollection representing the job.RestAPIExceptionpublic org.imixs.workflow.ItemCollection getDocument(String uniqueid) throws RestAPIException
uniqueid - RestAPIExceptionpublic void deleteDocument(String uniqueid) throws RestAPIException
userid - RestAPIExceptionpublic List<org.imixs.workflow.ItemCollection> searchDocuments(String query) throws RestAPIException, UnsupportedEncodingException
The method creates a search URL and requests a CustomResource by GET. The lucene query is encoded by this method. The method throws a UnsupportedEncodingException if the query string can not be encoded.
query - - lucene search queryRestAPIExceptionUnsupportedEncodingExceptionpublic long countDocuments(String query) throws RestAPIException, UnsupportedEncodingException
The method returns the count of documents included in the result of a given lucene query
query - - lucene search queryRestAPIExceptionUnsupportedEncodingExceptionpublic List<org.imixs.workflow.ItemCollection> getCustomResource(String uri) throws RestAPIException
userid - items - RestAPIExceptionpublic javax.ws.rs.client.WebTarget getWebTarget(String uri) throws RestAPIException
RestAPIExceptionpublic org.imixs.workflow.xml.XMLDataCollection getCustomResourceXML(String uri) throws RestAPIException
userid - items - RestAPIExceptionpublic org.imixs.workflow.xml.XMLDataCollection postXMLDocument(String uri, org.imixs.workflow.xml.XMLDocument xmlWorkitem) throws RestAPIException
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
document - - a ItemCollection representing the document.RestAPIExceptionpublic void postXMLDataCollection(String uri, org.imixs.workflow.xml.XMLDataCollection xmlDataCollection) throws RestAPIException
documents - - a collection of ItemCollection objectsRestAPIExceptionCopyright © 2018–2020 Imixs Software Solutions GmbH. All rights reserved.