Package org.cristalise.restapi
Class ItemUtils
java.lang.Object
org.cristalise.restapi.RestHandler
org.cristalise.restapi.ItemUtils
- Direct Known Subclasses:
ItemCollection,ItemHistory,ItemOutcome,ItemOutcomeAttachment,ItemProperty,ItemRoot,ItemViewpoint,ItemWorkflow,ResourceAccess,ScriptUtils
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cristalise.restapi.RestHandler
RestHandler.AuthData -
Field Summary
FieldsFields inherited from class org.cristalise.restapi.RestHandler
COOKIENAME, PASSWORD, USERNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionenumerate(ItemProxy item, String dataPath, String uriPath, javax.ws.rs.core.UriInfo uri, javax.ws.rs.core.NewCookie cookie) enumerate(ItemProxy item, ClusterType cluster, String uriPath, javax.ws.rs.core.UriInfo uri, javax.ws.rs.core.NewCookie cookie) protected StringexecuteJob(ItemProxy item, String outcome, String outcomeType, InputStream attachment, String fileName, String actPath, String transition, AgentProxy agent) protected StringexecuteJob(ItemProxy item, String outcome, String outcomeType, String actPath, String transition, AgentProxy agent) protected StringexecutePredefinedStep(ItemProxy item, String postData, String contentType, String actPath, AgentProxy agent) protected AgentProxygetAgentProxy(String uuid, javax.ws.rs.core.NewCookie cookie) protected AgentProxygetAgentProxy(javax.ws.rs.core.NewCookie cookie) protected ArrayList<LinkedHashMap<String, Object>> getAllViewpoints(ItemProxy item, javax.ws.rs.core.UriInfo uri, javax.ws.rs.core.NewCookie cookie) protected StringgetItemName(ItemPath ip) getItemNames(Property... props) protected static URIgetItemURI(javax.ws.rs.core.UriInfo uri, Object... segments) protected static URIgetItemURI(javax.ws.rs.core.UriInfo uri, UUID item, Object... path) protected static URIgetItemURI(javax.ws.rs.core.UriInfo uri, ItemProxy item, Object... path) protected static URIgetItemURI(javax.ws.rs.core.UriInfo uri, ItemPath item, Object... path) protected LinkedHashMap<String, Object> getJobActivityData(Job job, String itemName, javax.ws.rs.core.UriInfo uri) protected LinkedHashMap<String, Object> getJobItemData(Job job, String itemName, javax.ws.rs.core.UriInfo uri) protected LinkedHashMap<String, Object> getJobOutcomeData(Job job, ItemProxy item, javax.ws.rs.core.UriInfo uri) protected LinkedHashMap<String, Object> getJobTransitionData(Job job, String itemName, javax.ws.rs.core.UriInfo uri) javax.ws.rs.core.Response.ResponseBuildergetOutcome(String uuid, String schema, int version, int eventId, boolean json, javax.ws.rs.core.NewCookie cookie) protected javax.ws.rs.core.Response.ResponseBuildergetOutcomeResponse(Outcome oc, boolean json, javax.ws.rs.core.NewCookie cookie) Creates Response with without any specific header.protected javax.ws.rs.core.Response.ResponseBuildergetOutcomeResponse(Outcome oc, Date eventDate, boolean json, javax.ws.rs.core.NewCookie cookie) Creates Response with header 'Last-Modified:' protected javax.ws.rs.core.Response.ResponseBuildergetOutcomeResponse(Outcome oc, Event ev, boolean json, javax.ws.rs.core.NewCookie cookie) protected static ArrayList<LinkedHashMap<String, String>> getPropertySummary(ItemProxy item) protected ItemProxyjavax.ws.rs.core.Response.ResponseBuildergetViewpointOutcome(String uuid, String schema, String viewName, boolean json, javax.ws.rs.core.NewCookie cookie) protected LinkedHashMap<String, Object> makeCollectionData(Collection<?> coll, javax.ws.rs.core.UriInfo uri) protected LinkedHashMap<String, Object> makeEventData(Event ev, javax.ws.rs.core.UriInfo uri) protected LinkedHashMap<String, Object> makeJobData(Job job, ItemProxy item, javax.ws.rs.core.UriInfo uri) static booleanproduceJSON(List<javax.ws.rs.core.MediaType> types) Check if the requested media type should be a JSON or XMLMethods inherited from class org.cristalise.restapi.RestHandler
checkAndCreateNewCookie, checkAndCreateNewCookie, checkAuthCookie, createNewCookie, createNewCookie, decryptAuthData, encryptAuthData, getAgent, getAgent, getAgentPath, getPagedResult, getPropertiesFromQParams, makeItemDomainPathsData, toJSON
-
Field Details
-
PREDEFINED_PATH
- See Also:
-
-
Constructor Details
-
ItemUtils
public ItemUtils()
-
-
Method Details
-
getItemURI
-
getItemURI
-
getItemURI
-
getItemURI
-
getPropertySummary
protected static ArrayList<LinkedHashMap<String,String>> getPropertySummary(ItemProxy item) throws ObjectNotFoundException - Throws:
ObjectNotFoundException
-
getProxy
-
getAgentProxy
-
getAgentProxy
-
getViewpointOutcome
-
getOutcome
-
enumerate
public ArrayList<LinkedHashMap<String,Object>> enumerate(ItemProxy item, ClusterType cluster, String uriPath, javax.ws.rs.core.UriInfo uri, javax.ws.rs.core.NewCookie cookie) -
enumerate
-
getAllViewpoints
protected ArrayList<LinkedHashMap<String,Object>> getAllViewpoints(ItemProxy item, javax.ws.rs.core.UriInfo uri, javax.ws.rs.core.NewCookie cookie) throws Exception - Throws:
Exception
-
getOutcomeResponse
protected javax.ws.rs.core.Response.ResponseBuilder getOutcomeResponse(Outcome oc, boolean json, javax.ws.rs.core.NewCookie cookie) Creates Response with without any specific header.- Parameters:
oc- the Outcome to convertjson- produce json or xml- Returns:
- the ws ResponseBuilder
-
getOutcomeResponse
protected javax.ws.rs.core.Response.ResponseBuilder getOutcomeResponse(Outcome oc, Date eventDate, boolean json, javax.ws.rs.core.NewCookie cookie) Creates Response with header 'Last-Modified:' - Parameters:
oc- the Outcome to convertjson- produce json or xml- Returns:
- the ws ResponseBuilder
-
getOutcomeResponse
-
makeEventData
-
makeJobData
protected LinkedHashMap<String,Object> makeJobData(Job job, ItemProxy item, javax.ws.rs.core.UriInfo uri) -
getJobItemData
protected LinkedHashMap<String,Object> getJobItemData(Job job, String itemName, javax.ws.rs.core.UriInfo uri) -
getJobActivityData
protected LinkedHashMap<String,Object> getJobActivityData(Job job, String itemName, javax.ws.rs.core.UriInfo uri) -
getJobTransitionData
protected LinkedHashMap<String,Object> getJobTransitionData(Job job, String itemName, javax.ws.rs.core.UriInfo uri) -
getJobOutcomeData
protected LinkedHashMap<String,Object> getJobOutcomeData(Job job, ItemProxy item, javax.ws.rs.core.UriInfo uri) -
getItemName
-
makeCollectionData
protected LinkedHashMap<String,Object> makeCollectionData(Collection<?> coll, javax.ws.rs.core.UriInfo uri) -
produceJSON
public static boolean produceJSON(List<javax.ws.rs.core.MediaType> types) throws UnsupportedOperationException Check if the requested media type should be a JSON or XML- Parameters:
types- the media types requested by the client- Returns:
- true if the type is JSON, false if it is XML
- Throws:
UnsupportedOperationException
-
getItemNames
- Parameters:
props-- Returns:
-
executePredefinedStep
protected String executePredefinedStep(ItemProxy item, String postData, String contentType, String actPath, AgentProxy agent) throws IOException, CriseVertxException, OutcomeBuilderException - Parameters:
item-postData-actPath-agent-types-- Returns:
- Throws:
ObjectNotFoundExceptionInvalidDataExceptionOutcomeBuilderExceptionAccessRightsExceptionInvalidTransitionExceptionPersistencyExceptionObjectAlreadyExistsExceptionInvalidCollectionModificationIOExceptionCriseVertxException
-
executeJob
protected String executeJob(ItemProxy item, String outcome, String outcomeType, String actPath, String transition, AgentProxy agent) throws IOException, CriseVertxException, OutcomeBuilderException -
executeJob
protected String executeJob(ItemProxy item, String outcome, String outcomeType, InputStream attachment, String fileName, String actPath, String transition, AgentProxy agent) throws IOException, CriseVertxException, OutcomeBuilderException
-