Class CCRI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidceDoStateTransition(String entityName, String key, String stateTransitionTypeKey, String localeKey, String message) POST: {entityName}/{key}/statetransition/{stateTransitionTypeKey}?localeKey=de_DE&message=[label key or plain message]voidceDoStateTransition(IStateManaged entity, StateTransitionType stateTransitionType, Locale locale, String message) Executes the transition and changes the state of the object.
Calls on StateTransitionHandler before and after transition, if a handler is configuredvoidceDoStateTransitionToState(String entityName, String key, String toStateTypeKey, String localeKey, String message) POST: {entityName}/{key}/statetransition/to/{toStateTypeKey}?localeKey=de_DE&message=[label key or plain message]ceGetAllowedRights(ComplexEntity entity) ceGetAllowedStateTransitionTypes(ComplexEntity entity, StateGroupType stateGroupType, Locale locale) returns all stateTransitionTypes for the current User, the specified stateGroup and the localejavax.ws.rs.core.ResponseceGetMemos(String entityName, String key, String filterAsJson, int start, int end, String resultId) GET: {entityName}/{key}/memosjavax.ws.rs.core.ResponseceGetPermissions(String entityName, String key) GET: {entityName}/{key}/permissionsdoubleceGetRating(ComplexEntity entity) get rating (voting average) for entity.javax.ws.rs.core.ResponseceGetStates(String entityName, String key) GET: {entityName}/{key}/statesjavax.ws.rs.core.ResponseceGetWatches(String entityName, String key) GET: {entityName}/{key}/watchesbooleanceHasPermission(ComplexEntity entity, Right right, Locale locale) Checks if session user has given right on this object.
If right is locale dependent also checks the locale.
Includes the user rights from user group membership.booleanceHasPermission(ComplexEntity entity, RightType rightType, Locale locale) Checks if given user has a permission with given right type or including rightType for given object.
If rightType is localeDependent compares locales in permissions.javax.ws.rs.core.ResponseceHasPermissionForRight(String entityName, String key, String rightKey, String localeKey) GET: {entityName}/{key}/permissions/right/{rightKey}javax.ws.rs.core.ResponseceHasPermissionForRightType(String entityName, String key, String rightTypeKey, String localeKey) GET: {entityName}/{key}/permissions/righttype/{rightTypeKey}voidceInsertDefaultState(String entityName, String key, String stateGroupTypeKey, String localeKey) POST: {entityName}/{key}/stategroup/{stateGroupTypeKey}?localeKey=de_DEvoidceInsertDefaultState(IStateManaged entity, StateGroupType stateGroupType, Locale locale) Sets the default state of given group (@see stateGroupType.getDefaultState()) on given entity recursive (if entity is hierarchical entity also sets this state for all children).
If stateGroup is language dependent and no locale is specified uses content locale.voidceInsertLocaleState(String entityName, String key, String localeKey) POST: {entityName}/{key}/insertstate?localeKey=de_DEvoidceInsertLocaleState(IStateManaged entity, Locale locale) Sets insert state for each configured stateGroupType in given locale.
Also inserts first version for given localejavax.ws.rs.core.ResponseceIsEditAllowed(String entityName, String key, String localeKey) GET: {entityName}/{key}/editallowed?localeKey=de_DEbooleanceIsEditAllowed(IStateManaged entity, Locale locale) Checks if object is in edit state for session user for all state groups that require an edit state.
If state group is language dependent, checks on given locale.ceMemoAdd(ComplexEntity entity, int vote) Add voting Memo to ComplexEntity and recount the average rating for entity.ceMemoAdd(ComplexEntity entity, String text, Memo parent) Adds Memo to ComplexEntity with giving text as child of parent memo.voidceSetPermissions(String entityName, String key, String principalKey, boolean recursive) POST: {entityName}/{key}/permissions/principal/{principalKey}?recursive=false&data=[permission map as json]voidceSetPermissions(ComplexEntity entity, Principal principal, Map<Right, List<Locale>> permissions) Sets permissions for given user or userGroup on object and all its children.voidceSetPermissions(ComplexEntity entity, Principal principal, Map<Right, List<Locale>> permissions, boolean recursive) Set permissions for given user or userGroup on object and optionally on all its children.voidceWatchAdd(ComplexEntity object, Principal principal, List<Watch.EventType> eventTypes, Locale locale) Adds a new watch for object and its children (by collections and hrc entities).voidmemoDelete(String memoKey) DELETE: /memo/{memoKey}voidmemoDelete(Memo memo) Removes given Memo from database.javax.ws.rs.core.ResponsePOST: memo/{memoKey}?data=[json]javax.ws.rs.core.ResponsePOST: memo?data=[json]Inserts or updates given Memo (comment or rating) by setting its fields from given dataMap.reportGetItems(Report report) Loads report items for the report transparently.voidrightDelete(String rightKey) DELETE: right/{rightKey}voidrightDelete(Right right) Removes given Right from database with usage check.javax.ws.rs.core.ResponsePOST: right/{rightKey}?data=[json]javax.ws.rs.core.ResponsePOST: right?data=[json]Inserts or updates given Right by setting its fields from paramMap.javax.ws.rs.core.ResponsestateGroupTypeCopy(String key) POST: stategrouptype/{key}/copystateGroupTypeCopy(StateGroupType source) Creates a copy of given StateGroupType.voidDELETE: stategrouptype/{key}voidstateGroupTypeDelete(StateGroupType stateGroupType, boolean force) Deletes this StateGroupType from database if not any references by ComplexTypeEntities (case force is false)
or case force is true - delete with state types, the usage in state transition and states by complex entities be deleted too
user role: only UserBaseRole.CONFIGADMIN
javax.ws.rs.core.ResponsestateGroupTypeEdit(String key) POST: stategrouptype/{key}?data=[jsonDataMap]javax.ws.rs.core.ResponsePOST: stategrouptype?data=[jsonDataMap]stateGroupTypeSave(StateGroupType stateGroupType, DataMap dataMap) inserts or updates given StateGroupType by setting its fields from given paramMap.voidDELETE: statetransitiontype/{key}voidstateTransitionTypeDelete(StateTransitionType stateTransitionType) Removes StateTransitionType given from database with validate not use check.voidstateTransitionTypeSetParameters(StateTransitionType stateTransitionType, DataMap paramMap) set additional parameter as json string
user role: only UserBaseRole.CONFIGADMIN
voidstateTypeDelete(String key) DELETE: statetype/{key}voidstateTypeDelete(StateType stateType) Deletes this StateType from database if not any references by AssetPipeline.javax.ws.rs.core.ResponsestateTypeEdit(String key) POST: statetype/{key}?data=[jsonDataMap]javax.ws.rs.core.ResponsePOST: statetype?data=[jsonDataMap]stateTypeSave(StateType stateType, DataMap dataMap) Inserts or updates given StateType by setting its fields from given paramMap.javax.ws.rs.core.ResponsestateTypeSetStateTransitionType(String fromStateTypeKey, String toStateTypeKey, String handlerClassName, String rightId) POST: statetype/from/{fromStateTypeKey}/to/{toStateTypeKey}?handler=[handlerClassName]&right=[rightId]}stateTypeSetStateTransitionType(StateType fromStateType, StateType toStateType, Class<? extends IStateTransitionHandler> handlerClass, long requiredRightId) Inserts or update StateTransitionType between given StateTypes (from/to couple is unique and must belong to the same StateGroupType).
user role: only UserBaseRole.CONFIGADMIN
voiduserDelete(String userKey) DELETE: user/{userKey}voiduserDelete(User user) Checks if User is used by another entity.javax.ws.rs.core.ResponsePOST: user/{userKey}?data=[json]javax.ws.rs.core.ResponseuserGetTerritories(String userKey) GET: user/{userKey}/territoriesuserGetTerritories(User user) Gets the list of territories, that are referenced by the UserGroups, to which belongs the user,
or all active territories of system.voiduserGroupAddUser(String userGroupKey, String userKey) POST: userGroup/{userGroupKey}/user/{userKey}voiduserGroupAddUser(UserGroup userGroup, User user) Adds user to this UserGroup if not already in this UserGroup.voiduserGroupDelete(String userGroupKey) DELETE: userGroup/{userGroupKey}voiduserGroupDelete(UserGroup userGroup) Checks if UserGroup is used by another entity.javax.ws.rs.core.ResponseuserGroupEdit(String userGroupKey) POST: userGroup/{userGroupKey}?data=[json]javax.ws.rs.core.ResponsePOST: userGroup?data=[json]voiduserGroupRemoveUser(String userGroupKey, String userKey) DELETE: userGroup/{userGroupKey}/user/{userKey}voiduserGroupRemoveUser(UserGroup userGroup, User user) Removes user from this UserGroup.userGroupSave(UserGroup userGroup, DataMap dataMap) Inserts or updates given UserGroup by setting its fields from given paramMap.javax.ws.rs.core.ResponsePOST: user?data=[json]voiduserPasswordChange(String uid, String newPw, String newPwRepeat) Changes password for user with uid (from userGenerateNewPassword generated link).
Performs various checks of password: Password not empty and not too short The new and new repeated password must be the samevoiduserPasswordChange(String userKey, String oldPw, String newPw, String newPwRepeat) POST: user/{userKey}/password?oldPw={oldPw}&newPw={newPw}&newPwRepeat={newPw}
QueryParam: oldPw is mandatory
QueryParam: newPw is mandatory
QueryParam: newPwRepeat is mandatoryvoiduserPasswordChange(User user, String oldPw, String newPw, String newPwRepeat) Changes password for user.
Performs various checks of password: Password not empty and not too short Checks old password against existing password of user Compares the new and new repeated password, must be the sameuserPasswordGenerateNew(String login, String userIP) Sends link to set new password to user per email if set in profile, else send email to admin, the password must be changed manually in GUI.booleanChecks if user must change password (expired or first login)
check value of key UserProfileKey.PASSWORD_MUST_CHANGE in user profile.Checks validity from in userGenerateNewPassword generated link.javax.ws.rs.core.ResponseuserProfileGetValue(String userKey, String profileKey) GET: user/{userKey}/profile/{profileKey}<T extends Serializable>
TuserProfileGetValue(User user, UserProfile.UserProfileKey key, Class<T> valueClass) Returns user profile value for given user with given key as object from type valueClass.booleanConvenience variant ofuserProfileGetValue(User, UserProfileKey, Class)for boolean flags.voiduserProfileSetValue(String userKey, String profileKey, String value) POST: user/{userKey}/profile/{profileKey}voiduserProfileSetValue(User user, UserProfile.UserProfileKey key, Object value) Inserts if not exists or updates user profile value for key and given user.Inserts or updates given User by setting its fields from given paramMap.voiduserUnlockAccount(String uid) Check validity of link and unlock the user accountvoidwatchDelete(Watch watch) Removes given Watch from database.Methods inherited from class mc.core.domain.base.AbstractAPI
getAll, getAll, getFromId, getFromInternalDescription, getReference, ref, ref
-
Constructor Details
-
CCRI
public CCRI()
-
-
Method Details
-
userInsert
@POST @Path("user") public javax.ws.rs.core.Response userInsert() throws ApplicationException, IOExceptionPOST: user?data=[json]Insert a new user.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI#userSave()
-
userEdit
@POST @Path("user/{userKey}") public javax.ws.rs.core.Response userEdit(@PathParam("userKey") String userKey) throws ApplicationException, IOException POST: user/{userKey}?data=[json]Save data to an existing user.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI#userSave(User user, DataMap dataMap)
-
userDelete
@DELETE @Path("user/{userKey}") public void userDelete(@PathParam("userKey") String userKey) throws ApplicationException DELETE: user/{userKey}Delete an existing user.
- Throws:
ApplicationException- See Also:
-
CCAPI.userDelete(User user)
-
userPasswordChange
@POST @Path("user/{userKey}/password") public void userPasswordChange(@PathParam("userKey") String userKey, @QueryParam("oldPw") String oldPw, @QueryParam("newPw") String newPw, @QueryParam("newPwRepeat") String newPwRepeat) throws ApplicationException POST: user/{userKey}/password?oldPw={oldPw}&newPw={newPw}&newPwRepeat={newPw}
QueryParam: oldPw is mandatory
QueryParam: newPw is mandatory
QueryParam: newPwRepeat is mandatoryChange user password.
- Throws:
ApplicationException- See Also:
-
CCAPI#userSave(User user, DataMap dataMap)
-
userGetTerritories
@GET @Path("user/{userKey}/territories") public javax.ws.rs.core.Response userGetTerritories(@PathParam("userKey") String userKey) throws ApplicationException, IOException GET: user/{userKey}/territoriesGet list of territories for a user.
- Throws:
IOExceptionApplicationException- See Also:
-
CCAPI.userGetTerritories(User user)
-
userProfileGetValue
@GET @Path("user/{userKey}/profile/{profileKey}") public javax.ws.rs.core.Response userProfileGetValue(@PathParam("userKey") String userKey, @PathParam("profileKey") String profileKey) throws ApplicationException GET: user/{userKey}/profile/{profileKey}Get a profile value for a given key.
- Throws:
ApplicationException- See Also:
-
CCAPI.userProfileGetValue(User, UserProfileKey, Class)
-
userProfileSetValue
@POST @Path("user/{userKey}/profile/{profileKey}/{value}") public void userProfileSetValue(@PathParam("userKey") String userKey, @PathParam("profileKey") String profileKey, @PathParam("value") String value) throws ApplicationException, UserException POST: user/{userKey}/profile/{profileKey}Set a profile value for a given key.
- Throws:
ApplicationExceptionUserException- See Also:
-
CCAPI.userProfileSetValue(User, UserProfileKey, Object)
-
userGroupInsert
@POST @Path("userGroup") public javax.ws.rs.core.Response userGroupInsert() throws ApplicationException, IOExceptionPOST: userGroup?data=[json]Create a new user group using json from dataMap.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI.userGroupSave(UserGroup, DataMap)
-
userGroupEdit
@POST @Path("userGroup/{userGroupKey}") public javax.ws.rs.core.Response userGroupEdit(@PathParam("userGroupKey") String userGroupKey) throws ApplicationException, IOException POST: userGroup/{userGroupKey}?data=[json]Save data in json data map to user group.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI.userGroupSave(UserGroup, DataMap)
-
userGroupDelete
@DELETE @Path("userGroup/{userGroupKey}") public void userGroupDelete(@PathParam("userGroupKey") String userGroupKey) throws ApplicationException DELETE: userGroup/{userGroupKey}Delete user group.
- Throws:
ApplicationException- See Also:
-
CCAPI#userGroupDelete(User user)
-
userGroupAddUser
@POST @Path("userGroup/{userGroupKey}/user/{userKey}") public void userGroupAddUser(@PathParam("userGroupKey") String userGroupKey, @PathParam("userKey") String userKey) throws ApplicationException POST: userGroup/{userGroupKey}/user/{userKey}Add user to group.
- Throws:
ApplicationException- See Also:
-
CCAPI.userGroupAddUser(UserGroup, User)
-
userGroupRemoveUser
@DELETE @Path("userGroup/{userGroupKey}/user/{userKey}") public void userGroupRemoveUser(@PathParam("userGroupKey") String userGroupKey, @PathParam("userKey") String userKey) throws ApplicationException DELETE: userGroup/{userGroupKey}/user/{userKey}Remove user from group.
- Throws:
ApplicationException- See Also:
-
CCAPI.userGroupRemoveUser(UserGroup, User)
-
rightInsert
@POST @Path("right") public javax.ws.rs.core.Response rightInsert() throws ApplicationException, IOExceptionPOST: right?data=[json]Insert a new right type from the JSON data map.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI.rightSave(Right right, DataMap dataMap)
-
rightEdit
@POST @Path("right/{rightKey}") public javax.ws.rs.core.Response rightEdit(@PathParam("rightKey") String rightKey) throws ApplicationException, IOException POST: right/{rightKey}?data=[json]Save data to a right from the data map.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI.rightSave(Right right, DataMap dataMap)
-
rightDelete
@DELETE @Path("right/{rightKey}") public void rightDelete(@PathParam("rightKey") String rightKey) throws ApplicationException DELETE: right/{rightKey}Delete a right with the given key.
- Throws:
ApplicationException- See Also:
-
CCAPI.rightDelete(Right)
-
ceGetPermissions
@GET @Path("{entityName}/{key}/permissions") public javax.ws.rs.core.Response ceGetPermissions(@PathParam("entityName") String entityName, @PathParam("key") String key) throws ApplicationException, IOException GET: {entityName}/{key}/permissionsGet all permissions for complex entity, not only for current user.
- Throws:
ApplicationExceptionIOException
-
ceSetPermissions
@POST @Path("{entityName}/{key}/permissions/principal/{principalKey}") public void ceSetPermissions(@PathParam("entityName") String entityName, @PathParam("key") String key, @PathParam("principalKey") String principalKey, @QueryParam("recursive") @DefaultValue("true") boolean recursive) throws ApplicationException, UserException POST: {entityName}/{key}/permissions/principal/{principalKey}?recursive=false&data=[permission map as json]set permissions for given user or userGroup on object and on all its children. set recursive=false if permission should be set only on object, not on children. deletes existing permissions for principal. The permissions map is passed as json String which should have the format below (remove comments to get valid json). For locale dependent rights list of locale keys should be provided. If list is empty permissions are created for all active locales.
[ { "right": "EDIT" //locale independent right }, { "right": "TRANSLATE", //locale dependent right "locales": [ "de_DE", "en_US", "fr_FR"] }, { "right": 1, //user defined right, locale dependent, set for all active locales "locales": [] } ]- Throws:
ApplicationExceptionUserException- See Also:
-
AspectPermission#setPermissions(ComplexEntity, mc.core.model.cc.Principal, java.util.List, boolean)
-
ceHasPermissionForRight
public javax.ws.rs.core.Response ceHasPermissionForRight(@PathParam("entityName") String entityName, @PathParam("key") String key, @PathParam("rightKey") String rightKey, @QueryParam("localeKey") String localeKey) throws ApplicationException GET: {entityName}/{key}/permissions/right/{rightKey}check if logged in user has given right on this object.
- Throws:
ApplicationException- See Also:
-
CCAPI.ceHasPermission(ComplexEntity, Right, Locale)
-
ceHasPermissionForRightType
public javax.ws.rs.core.Response ceHasPermissionForRightType(@PathParam("entityName") String entityName, @PathParam("key") String key, @PathParam("rightTypeKey") String rightTypeKey, @QueryParam("localeKey") String localeKey) throws ApplicationException GET: {entityName}/{key}/permissions/righttype/{rightTypeKey}check if logged in user has right of given right type on this object.
- Throws:
ApplicationException- See Also:
-
CCAPI.ceHasPermission(ComplexEntity, RightType, Locale)
-
ceGetStates
@GET @Path("{entityName}/{key}/states") public javax.ws.rs.core.Response ceGetStates(@PathParam("entityName") String entityName, @PathParam("key") String key) throws ApplicationException, IOException GET: {entityName}/{key}/statesGet all states for complex entity.
- Throws:
ApplicationExceptionIOException
-
ceIsEditAllowed
@GET @Path("{entityName}/{key}/editallowed") public javax.ws.rs.core.Response ceIsEditAllowed(@PathParam("entityName") String entityName, @PathParam("key") String key, @QueryParam("localeKey") String localeKey) throws ApplicationException GET: {entityName}/{key}/editallowed?localeKey=de_DEreturn true if edit allowed for complex entity, optionally for the locale, otherwise for content locale
- Throws:
ApplicationException- See Also:
-
CCAPI.ceIsEditAllowed(IStateManaged, Locale)
-
ceDoStateTransition
@POST @Path("{entityName}/{key}/statetransition/{stateTransitionTypeKey}") public void ceDoStateTransition(@PathParam("entityName") String entityName, @PathParam("key") String key, @PathParam("stateTransitionTypeKey") String stateTransitionTypeKey, @QueryParam("localeKey") String localeKey, @QueryParam("message") String message) throws UserException, ApplicationException POST: {entityName}/{key}/statetransition/{stateTransitionTypeKey}?localeKey=de_DE&message=[label key or plain message]execute the transition and change the state of the object, optionally for the locale, otherwise for content locale. Optional message is written in version report.
- Throws:
UserExceptionApplicationException- See Also:
-
CCAPI.ceDoStateTransition(IStateManaged, StateTransitionType, Locale, String)
-
ceDoStateTransitionToState
@POST @Path("{entityName}/{key}/statetransition/to/{toStateTypeKey}") public void ceDoStateTransitionToState(@PathParam("entityName") String entityName, @PathParam("key") String key, @PathParam("toStateTypeKey") String toStateTypeKey, @QueryParam("localeKey") String localeKey, @QueryParam("message") String message) throws UserException, ApplicationException POST: {entityName}/{key}/statetransition/to/{toStateTypeKey}?localeKey=de_DE&message=[label key or plain message]determine transition from current to given target state (if any), execute the transition and change the state of the object, optionally for the locale, otherwise for content locale. Optional message is written in version report.
- Throws:
UserExceptionApplicationException- See Also:
-
CCAPI.ceDoStateTransition(IStateManaged, StateTransitionType, Locale, String)
-
ceInsertDefaultState
@POST @Path("{entityName}/{key}/stategroup/{stateGroupTypeKey}") public void ceInsertDefaultState(@PathParam("entityName") String entityName, @PathParam("key") String key, @PathParam("stateGroupTypeKey") String stateGroupTypeKey, @QueryParam("localeKey") String localeKey) throws ApplicationException POST: {entityName}/{key}/stategroup/{stateGroupTypeKey}?localeKey=de_DEset the default state of given group on entity
- Throws:
ApplicationException- See Also:
-
CCAPI.ceInsertDefaultState(IStateManaged, StateGroupType, Locale)
-
ceInsertLocaleState
@POST @Path("{entityName}/{key}/insertstate") public void ceInsertLocaleState(@PathParam("entityName") String entityName, @PathParam("key") String key, @QueryParam("localeKey") String localeKey) throws ApplicationException POST: {entityName}/{key}/insertstate?localeKey=de_DEset the insert state for each configured state group on entity
- Throws:
ApplicationException- See Also:
-
CCAPI.ceInsertLocaleState(IStateManaged, Locale)
-
stateGroupTypeInsert
@POST @Path("stategrouptype") public javax.ws.rs.core.Response stateGroupTypeInsert() throws UserException, ApplicationException, IOExceptionPOST: stategrouptype?data=[jsonDataMap]Insert a new state group type with data provided in the json data map.
- Throws:
UserExceptionApplicationExceptionIOException- See Also:
-
CCAPI.stateGroupTypeSave(StateGroupType, DataMap)
-
stateGroupTypeEdit
@POST @Path("stategrouptype/{key}") public javax.ws.rs.core.Response stateGroupTypeEdit(@PathParam("key") String key) throws UserException, ApplicationException, IOException POST: stategrouptype/{key}?data=[jsonDataMap]Save changes to a state group type with data provided in the json data map.
- Throws:
UserExceptionApplicationExceptionIOException- See Also:
-
CCAPI.stateGroupTypeSave(StateGroupType, DataMap)
-
stateGroupTypeDelete
@DELETE @Path("stategrouptype/{key}") public void stateGroupTypeDelete(@PathParam("key") String key) throws ApplicationException DELETE: stategrouptype/{key}Delete the state group type if not in use.
- Throws:
ApplicationException- See Also:
-
CCAPI#stateGroupTypeDelete(StateGroupType)
-
stateGroupTypeCopy
@POST @Path("stategrouptype/{key}/copy") public javax.ws.rs.core.Response stateGroupTypeCopy(@PathParam("key") String key) throws ApplicationException, IOException POST: stategrouptype/{key}/copyCreate a copy of the state group type.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI.stateGroupTypeCopy(StateGroupType)
-
stateTypeInsert
@POST @Path("statetype") public javax.ws.rs.core.Response stateTypeInsert() throws UserException, ApplicationException, IOExceptionPOST: statetype?data=[jsonDataMap]Insert a new state type with data provided in the json data map.
- Throws:
UserExceptionApplicationExceptionIOException- See Also:
-
CCAPI.stateTypeSave(StateType, DataMap)
-
stateTypeEdit
@POST @Path("statetype/{key}") public javax.ws.rs.core.Response stateTypeEdit(@PathParam("key") String key) throws UserException, ApplicationException, IOException POST: statetype/{key}?data=[jsonDataMap]Save changes to a state type with data provided in the json data map.
- Throws:
UserExceptionApplicationExceptionIOException- See Also:
-
CCAPI.stateTypeSave(StateType, DataMap)
-
stateTypeDelete
@DELETE @Path("statetype/{key}") public void stateTypeDelete(@PathParam("key") String key) throws ApplicationException DELETE: statetype/{key}Delete the state type if not in use.
- Throws:
ApplicationException- See Also:
-
CCAPI.stateTypeDelete(StateType)
-
stateTypeSetStateTransitionType
@POST @Path("statetype/from/{fromStateTypeKey}/to/{toStateTypeKey}") public javax.ws.rs.core.Response stateTypeSetStateTransitionType(@PathParam("fromStateTypeKey") String fromStateTypeKey, @PathParam("toStateTypeKey") String toStateTypeKey, @QueryParam("handler") String handlerClassName, @QueryParam("right") String rightId) throws ApplicationException, ClassNotFoundException, IOException POST: statetype/from/{fromStateTypeKey}/to/{toStateTypeKey}?handler=[handlerClassName]&right=[rightId]}Save changes to a state type with data provided in the json data map.
- Throws:
ApplicationExceptionClassNotFoundExceptionIOException- See Also:
-
CCAPI.stateTypeSetStateTransitionType(StateType, StateType, Class, long)
-
stateTransitionTypeDelete
@DELETE @Path("statetransitiontype/{key}") public void stateTransitionTypeDelete(@PathParam("key") String key) throws ApplicationException DELETE: statetransitiontype/{key}Delete the state transition type.
- Throws:
ApplicationException- See Also:
-
CCAPI.stateTransitionTypeDelete(StateTransitionType)
-
ceGetWatches
@GET @Path("{entityName}/{key}/watches") public javax.ws.rs.core.Response ceGetWatches(@PathParam("entityName") String entityName, @PathParam("key") String key) throws ApplicationException, IOException GET: {entityName}/{key}/watchesGet all watches for complex entity.
- Throws:
ApplicationExceptionIOException
-
ceGetMemos
@GET @Path("{entityName}/{key}/memos") public javax.ws.rs.core.Response ceGetMemos(@PathParam("entityName") String entityName, @PathParam("key") String key, @QueryParam("filter") String filterAsJson, @QueryParam("start") int start, @QueryParam("end") @DefaultValue("-1") int end, @QueryParam("resultId") String resultId) throws ApplicationException, IOException GET: {entityName}/{key}/memosget all memos for complex entity, optionally filtered by search criteria and with paging.
- Parameters:
entityName- name of entity for which memos should be retrievedkey- key of entityfilterAsJson- search filter as jsonstart- start index of result. default is 0 if not set. optionalend- end index of result. get first page if not set. optionalresultId- resultId from previous search (only stateless session). must be valid if given. optionalExample: value (json definition) for query param
filterto search for all ratings, ordered by date created descending:
{ "criteria" : [{ "field":"vote", "param":0, "negative":true }], "orderBy" : [{"field":"dateCreated", "descending":true}]}- Throws:
ApplicationExceptionIOException- See Also:
-
memoInsert
@POST @Path("memo") public javax.ws.rs.core.Response memoInsert() throws ApplicationException, IOExceptionPOST: memo?data=[json]Insert a new memo (comment or rating) from the JSON data map.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI.memoSave(Memo, DataMap)
-
memoEdit
@POST @Path("memo/{memoKey}") public javax.ws.rs.core.Response memoEdit(@PathParam("memoKey") String memoKey) throws ApplicationException, IOException POST: memo/{memoKey}?data=[json]Save data to a memo (comment or rating) from the data map.
- Throws:
ApplicationExceptionIOException- See Also:
-
CCAPI.memoSave(Memo, DataMap)
-
memoDelete
@DELETE @Path("memo/{memoKey}") public void memoDelete(@PathParam("memoKey") String memoKey) throws ApplicationException DELETE: /memo/{memoKey}Delete a memo (comment or rating) with the given key.
- Throws:
ApplicationException- See Also:
-
CCAPI.memoDelete(Memo)
-
userSave
public User userSave(User user, String newPw, String newPwRepeat, DataMap dataMap) throws ApplicationException, UserException Inserts or updates given User by setting its fields from given paramMap. Required user roles:- for insert: UserBaseRole.POWERUSER
- for update of the data or another user: UserBaseRole.POWERUSER
- Parameters:
user- User mandatorynewPw- mandatory for insert
optional for edit
if not null it is checked against various rules, encoded and set as password for usernewPwRepeat- optional, if not null is compared with newPwdataMap- mandatory, contains values for the User's fields as key-value pairs- Returns:
- inserted or updated User. If User has been inserted if contains now the newly created id
- Throws:
UserException- if session user has not role UserBaseRole.POWERUSER
if one of the various password checks fails.UserExceptionApplicationException
-
userDelete
public void userDelete(User user) throws DeleteTiedElementException, UserException, ApplicationException Checks if User is used by another entity. If not removes this User from references in Permissions, Notifications, HotFolder, ImportProfiles and UserGroups, then removes User from database with usage check.
required user role: UserBaseRole.POWERUSER
- Parameters:
user- mandatory- Throws:
UserException- if session user has not role UserBaseRole.POWERUSERApplicationExceptionDeleteTiedElementException- if User is in use- See Also:
-
for usage of User
-
userPasswordChange
public void userPasswordChange(User user, String oldPw, String newPw, String newPwRepeat) throws ApplicationException, UserException Changes password for user.
Performs various checks of password:- Password not empty and not too short
- Checks old password against existing password of user
- Compares the new and new repeated password, must be the same
- Parameters:
user- mandatoryoldPw- mandatorynewPw- mandatorynewPwRepeat- mandatory- Throws:
UserException- with appropriate message key if any of password check failsUserExceptionApplicationException
-
userPasswordChange
public void userPasswordChange(String uid, String newPw, String newPwRepeat) throws ApplicationException, UserException Changes password for user with uid (from userGenerateNewPassword generated link).
Performs various checks of password:- Password not empty and not too short
- The new and new repeated password must be the same
- Parameters:
uid- mandatorynewPw- mandatorynewPwRepeat- mandatory- Throws:
UserException- with appropriate message key if any of password check failsUserExceptionApplicationException
-
userUnlockAccount
Check validity of link and unlock the user account- Parameters:
uid- mandatory- Throws:
UserException- the link be expiredUserExceptionApplicationException
-
userPasswordValidateLink
Checks validity from in userGenerateNewPassword generated link.- Parameters:
uid- mandatory, from userGenerateNewPassword generated link- Returns:
- user if valid or null if invalid
- Throws:
UserExceptionApplicationException
-
userPasswordGenerateNew
Sends link to set new password to user per email if set in profile, else send email to admin, the password must be changed manually in GUI. Set value for key UserProfileKey.PASSWORD_MUST_CHANGE in user profile to true.- Parameters:
login- mandatoryuserIP- request IP- Returns:
- message to user
- Throws:
ApplicationException
-
userPasswordMustBeChanged
Checks if user must change password (expired or first login)
check value of key UserProfileKey.PASSWORD_MUST_CHANGE in user profile.- Parameters:
user- mandatory- Returns:
- true if user must change password
-
userGetTerritories
Gets the list of territories, that are referenced by the UserGroups, to which belongs the user,
or all active territories of system.- Parameters:
user- mandatory- Returns:
- the list of territories
-
userProfileGetValue
public <T extends Serializable> T userProfileGetValue(User user, UserProfile.UserProfileKey key, Class<T> valueClass) Returns user profile value for given user with given key as object from type valueClass.- Parameters:
user- mandatorykey- mandatoryvalueClass- mandatory- Returns:
- instance of Class
-
userProfileGetValueBoolean
Convenience variant ofuserProfileGetValue(User, UserProfileKey, Class)for boolean flags. avoid NPE on autoboxing if Boolean value is not set- Parameters:
user- mandatorykey- UserProfileKey mandatory- Returns:
- true or false, always false if key is not set
-
userProfileSetValue
Inserts if not exists or updates user profile value for key and given user.- Parameters:
user- mandatorykey- UserProfileKey mandatoryvalue- optional, if null the value from key will be deleted
-
userGroupSave
public UserGroup userGroupSave(UserGroup userGroup, DataMap dataMap) throws UserException, ApplicationException Inserts or updates given UserGroup by setting its fields from given paramMap.
required user role: only UserBaseRole.POWERUSER
- Parameters:
userGroup- mandatorydataMap- mandatory, contains values for the UserGroup's fields as key-value pairs- Returns:
- inserted or updated UserGroup. If UserGroup has been inserted if contains now the newly created id
- Throws:
UserException- if user has not role UserBaseRole.POWERUSERApplicationException
-
userGroupDelete
public void userGroupDelete(UserGroup userGroup) throws DeleteTiedElementException, UserException, ApplicationException Checks if UserGroup is used by another entity. If not, removes this UserGroup from references in Permissions, Notifications, HotFolder, ImportProfiles and UserGroups, then removes User from database.
user role: UserBaseRole.POWERUSER
- Parameters:
userGroup- mandatory- Throws:
UserException- if session user has not role UserBaseRole.POWERUSERDeleteTiedElementException- if UserGroup is in useApplicationException- See Also:
-
for usage of UserGroup
-
userGroupAddUser
public void userGroupAddUser(UserGroup userGroup, User user) throws UserException, ApplicationException Adds user to this UserGroup if not already in this UserGroup.
user role: UserBaseRole.POWERUSER
- Parameters:
userGroup- mandatoryuser- mandatory- Throws:
UserException- if session user has not role UserBaseRole.POWERUSERApplicationException
-
userGroupRemoveUser
public void userGroupRemoveUser(UserGroup userGroup, User user) throws UserException, ApplicationException Removes user from this UserGroup.
user role: UserBaseRole.POWERUSER
- Parameters:
userGroup- mandatoryuser- mandatory- Throws:
UserException- if session user has not role UserBaseRole.POWERUSERApplicationException
-
ceSetPermissions
public void ceSetPermissions(ComplexEntity entity, Principal principal, Map<Right, List<Locale>> permissions) throws ApplicationException, UserExceptionSets permissions for given user or userGroup on object and all its children. deletes existing permissions for principal- Parameters:
entity- mandatory: object for which permissions should be setprincipal- User or UserGroup, mandatorypermissions- mandatory, map with rights and locales (for locale dependent rights)- Throws:
UserException- to signal start of workflowApplicationException
-
ceSetPermissions
public void ceSetPermissions(ComplexEntity entity, Principal principal, Map<Right, List<Locale>> permissions, boolean recursive) throws ApplicationException, UserExceptionSet permissions for given user or userGroup on object and optionally on all its children. deletes existing permissions for principal- Parameters:
entity- mandatory: object for which permissions should be setprincipal- User or UserGroup, mandatorypermissions- mandatory, map with rights and locales (for locale dependent rights)recursive- also set the permissions on all children- Throws:
UserException- to signal start of workflowApplicationException
-
ceHasPermission
Checks if session user has given right on this object.
If right is locale dependent also checks the locale.
Includes the user rights from user group membership.- Parameters:
entity- mandatory: object for which permissions will be checkedright- mandatorylocale- mandatory only by locale dependent rights- Returns:
- true if the user has the right
- Throws:
ApplicationException
-
ceHasPermission
Checks if given user has a permission with given right type or including rightType for given object.
If rightType is localeDependent compares locales in permissions.
WARNING: must only be used for RightTypes that are not user defined! For user defined Rights use#hasPermission(ComplexEntity, User, Right, Locale)- Parameters:
entity- mandatory, object, for which permissions will be checkedrightType- optional, must not be user defined, default is READlocale- optional, necessary for locale dependent RightType, default is content locale- Returns:
- true if permission or including permission exists
-
ceGetAllowedRights
- Parameters:
entity- mandatory- Returns:
- list of rights that are active and allowed for this entity type. If entity is a
Collectionreturns the combined allowed rights for Collection and it's item entity class. Returns empty list for not right managed entity types.
-
ceIsEditAllowed
Checks if object is in edit state for session user for all state groups that require an edit state.
If state group is language dependent, checks on given locale.- Parameters:
entity- mandatorylocale- optional, default is content locale- Returns:
- true if the object can be edited by session user
-
ceDoStateTransition
public void ceDoStateTransition(IStateManaged entity, StateTransitionType stateTransitionType, Locale locale, String message) throws UserException, ApplicationException Executes the transition and changes the state of the object.
Calls on StateTransitionHandler before and after transition, if a handler is configured- Parameters:
entity- mandatorystateTransitionType- mandatorylocale- optional, default is contentLocale or undefined locale for locale independent statesmessage- optional- Throws:
ApplicationExceptionUserException
-
ceGetAllowedStateTransitionTypes
public List<StateTransitionType> ceGetAllowedStateTransitionTypes(ComplexEntity entity, StateGroupType stateGroupType, Locale locale) throws ApplicationException returns all stateTransitionTypes for the current User, the specified stateGroup and the locale- Parameters:
entity- mandatorystateGroupType- mandatorylocale- optional, default is contentLocale or undefined locale for locale independent states- Returns:
- list of allowed stateTransitionTypes
- Throws:
ApplicationException
-
ceInsertDefaultState
public void ceInsertDefaultState(IStateManaged entity, StateGroupType stateGroupType, Locale locale) throws ApplicationException Sets the default state of given group (@see stateGroupType.getDefaultState()) on given entity recursive (if entity is hierarchical entity also sets this state for all children).
If stateGroup is language dependent and no locale is specified uses content locale.- Parameters:
entity- mandatorystateGroupType- mandatorylocale- optional, default is content locale, or undefinedLocale for locale independent states- Throws:
ApplicationException
-
ceInsertLocaleState
Sets insert state for each configured stateGroupType in given locale.
Also inserts first version for given locale- Parameters:
entity- mandatorylocale- optional, default is content locale- Throws:
ApplicationException
-
rightSave
Inserts or updates given Right by setting its fields from paramMap. Only user defined rights can be inserted.
Warning: Right.Field.rightType in paramMap must be set!
user role: only UserBaseRole.CONFIGADMIN
- Parameters:
right- mandatorydataMap- mandatory, contains values for the Right's fields as key-value pairs- Returns:
- inserted or updated Right.
- Throws:
UserException- if user has not role UserBaseRole.CONFIGADMINApplicationException
-
rightDelete
Removes given Right from database with usage check.- Parameters:
right- mandatory- Throws:
UserException- if user has not role UserBaseRole.CONFIGADMINApplicationException
-
stateGroupTypeSave
public StateGroupType stateGroupTypeSave(StateGroupType stateGroupType, DataMap dataMap) throws UserException, ApplicationException inserts or updates given StateGroupType by setting its fields from given paramMap.
user role: only UserBaseRole.CONFIGADMIN
- Parameters:
stateGroupType- mandatorydataMap- mandatory, contains values for the StateGroupType's fields as key-value pairs- Returns:
- inserted or updated StateGroupType. If StateGroupType has been inserted if contains now the newly created id
- Throws:
UserException- if user has not role UserBaseRole.CONFIGADMINApplicationException
-
stateGroupTypeCopy
public StateGroupType stateGroupTypeCopy(StateGroupType source) throws UserException, ApplicationException Creates a copy of given StateGroupType. Does not copy StateTypes that belong to this StateGroupType.
user role: only UserBaseRole.CONFIGADMIN
- Parameters:
source- mandatory- Returns:
- StateGroupType that is the copy
- Throws:
ApplicationExceptionUserException- if user has not role UserBaseRole.CONFIGADMIN
-
stateGroupTypeDelete
public void stateGroupTypeDelete(StateGroupType stateGroupType, boolean force) throws UserException, ApplicationException Deletes this StateGroupType from database if not any references by ComplexTypeEntities (case force is false)
or case force is true - delete with state types, the usage in state transition and states by complex entities be deleted too
user role: only UserBaseRole.CONFIGADMIN
- Parameters:
stateGroupType- mandatory- Throws:
ApplicationExceptionUserException- if user has not role UserBaseRole.CONFIGADMIN or StateGroupType is in use- See Also:
-
for usage of StateGroupType
-
stateTypeSave
public StateType stateTypeSave(StateType stateType, DataMap dataMap) throws UserException, ApplicationException Inserts or updates given StateType by setting its fields from given paramMap.
user role: only UserBaseRole.CONFIGADMIN
- Parameters:
stateType- mandatorydataMap- mandatory, contains values for the StateType's fields as key-value pairs- Returns:
- inserted or updated StateGroupType. If StateType has been inserted if contains now the newly created id
- Throws:
UserException- if user has not role UserBaseRole.CONFIGADMINApplicationException
-
stateTypeDelete
public void stateTypeDelete(StateType stateType) throws UserException, DeleteTiedElementException, ApplicationException Deletes this StateType from database if not any references by AssetPipeline.
required user role: only UserBaseRole.CONFIGADMIN
- Parameters:
stateType- mandatory- Throws:
UserException- if user has not role UserBaseRole.CONFIGADMINApplicationExceptionDeleteTiedElementException- if StateType is in use- See Also:
-
for usage of StateType
-
stateTypeSetStateTransitionType
public StateTransitionType stateTypeSetStateTransitionType(StateType fromStateType, StateType toStateType, Class<? extends IStateTransitionHandler> handlerClass, long requiredRightId) throws UserException, ApplicationException Inserts or update StateTransitionType between given StateTypes (from/to couple is unique and must belong to the same StateGroupType).
user role: only UserBaseRole.CONFIGADMIN
- Parameters:
fromStateType- mandatorytoStateType- mandatoryhandlerClass- optional, Class<? extends IStateTransitionHandler> called on state transitionrequiredRightId- optional, right to set for transition.
if requiredRightId is Right.USER_DEFINED_RIGHT, the transition right for this from-to-StateType combination is assigned if already exists or created on demand- Returns:
- StateTransitionType the inserted or updated StateTransitionType
- Throws:
UserException- if user has not role UserBaseRole.CONFIGADMINApplicationException
-
stateTransitionTypeDelete
public void stateTransitionTypeDelete(StateTransitionType stateTransitionType) throws ApplicationException Removes StateTransitionType given from database with validate not use check.
user role: only UserBaseRole.CONFIGADMIN
- Parameters:
stateTransitionType- mandatory- Throws:
UserException- if user has not role UserBaseRole.CONFIGADMINApplicationException
-
stateTransitionTypeSetParameters
public void stateTransitionTypeSetParameters(StateTransitionType stateTransitionType, DataMap paramMap) throws ApplicationException set additional parameter as json string
user role: only UserBaseRole.CONFIGADMIN
- Parameters:
stateTransitionType- mandatory- Throws:
UserException- if user has not role UserBaseRole.CONFIGADMINApplicationException
-
ceWatchAdd
public void ceWatchAdd(ComplexEntity object, Principal principal, List<Watch.EventType> eventTypes, Locale locale) throws ApplicationException Adds a new watch for object and its children (by collections and hrc entities).
checks if watch not already exists (same object, user, eventType and locale if any)- Parameters:
object- mandatoryprincipal- mandatory, id of user or userGroupeventTypes- must be not emptylocale- optional, set only if this watch is locale dependent- Throws:
ApplicationException
-
watchDelete
Removes given Watch from database.- Parameters:
watch- mandatory- Throws:
ApplicationException
-
ceMemoAdd
Adds Memo to ComplexEntity with giving text as child of parent memo.- Parameters:
entity- mandatorytext- mandatoryparent- optional, only if not first level memo- Returns:
- inserted Memo
- Throws:
ApplicationException
-
ceMemoAdd
Add voting Memo to ComplexEntity and recount the average rating for entity.- Parameters:
entity- mandatory, entity on which to set votevote- mandatory, must be greater than 0- Returns:
- inserted Memo
- Throws:
ApplicationException
-
ceGetRating
get rating (voting average) for entity.- Parameters:
entity- mandatory, entity for which to get rating- Returns:
- rating value or 0 if entity has no valid rating.
-
memoSave
Inserts or updates given Memo (comment or rating) by setting its fields from given dataMap.
A comment must have a text, a rating must have a vote != 0. If the comment is a reply or the rating is on a comment the id of the original comment must be given as parent in the map. For a rating checks if there is already a rating for the same entity and user, optionally with the same parent. In this case deletes the existing rating.- Parameters:
memo- mandatorydataMap- mandatory, contains values for the Memo's fields as key-value pairs- Returns:
- updated Memo
- Throws:
ApplicationException
-
memoDelete
Removes given Memo from database.- Parameters:
memo- mandatory- Throws:
ApplicationException
-
reportGetItems
Loads report items for the report transparently. Since mc7.4 report items are stored in lucene index, older report items are still stored in DB.- Parameters:
report- mandatory- Returns:
- List of ReportItem (not persistent if coming from index)
-