Package mc.core.domain.base.rest
Class RESTContext
java.lang.Object
mc.core.domain.base.rest.RESTContext
REST context and utilities for all RI API classes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.commons.fileupload.FileItem>org.apache.commons.fileupload.FileItemgetParameter(String name) javax.ws.rs.core.Responseresponse()build a 200 responsejavax.ws.rs.core.Responsebuild a 200 response including entity data as messageBody.<T extends IBaseEntity>
javax.ws.rs.core.Response<T extends IBaseEntity>
javax.ws.rs.core.Response<T extends IBaseEntity>
javax.ws.rs.core.Response<T extends IBaseEntity>
javax.ws.rs.core.ResponseresponseSearch(IBaseDO<T> dobj, List<T> result, mc.core.system.search.SearchResult sr, boolean statelessSession, int start, int end) creates a Response that contains information to search result as well as the list (page) of found entities.
-
Constructor Details
-
RESTContext
public RESTContext()
-
-
Method Details
-
getDataMap
- Throws:
ApplicationException
-
toDataMap
- Throws:
ApplicationException
-
getDataMapList
- Throws:
ApplicationException
-
getParameter
-
getFileItems
-
getFirstFileItem
public org.apache.commons.fileupload.FileItem getFirstFileItem() -
response
public javax.ws.rs.core.Response response()build a 200 response -
response
build a 200 response including entity data as messageBody. JAX-RS will convert to json -
response
public <T extends IBaseEntity> javax.ws.rs.core.Response response(IBaseDO<T> dobj, T entity) throws ApplicationException, IOException - Throws:
ApplicationExceptionIOException
-
response
public <T extends IBaseEntity> javax.ws.rs.core.Response response(IBaseDO<T> dobj, List<T> entities) throws ApplicationException, IOException - Throws:
ApplicationExceptionIOException
-
response
public <T extends IBaseEntity> javax.ws.rs.core.Response response(IBaseDO<T> dobj, List<T> entities, DataMap resultMap) throws ApplicationException, IOException - Throws:
ApplicationExceptionIOException
-
responseSearch
public <T extends IBaseEntity> javax.ws.rs.core.Response responseSearch(IBaseDO<T> dobj, List<T> result, mc.core.system.search.SearchResult sr, boolean statelessSession, int start, int end) throws ApplicationException, IOException creates a Response that contains information to search result as well as the list (page) of found entities.- Parameters:
dobj- DO for result entitiesresult- list of result entitiessr- search resultstatelessSession- booleanstart- start index of result. default is 0 if not set. optionalend- end index of result. get first page if not set. optional- Returns:
- Response
- Throws:
ApplicationExceptionIOException
-