/** * Create the role of internal user for blog * * @param createRoleParameter - an object that contains all the parameter that can or have to be * used for such a request * @param requestedMimeType - is the mime type that indicates which data exchange format to use * @param uriInfo - this object is created by the request and contains some request specific data * @param requestSessionId sessionId * @param request - javax request * @return an response object containing a http status code and a message * @throws BlogAccessException can not access blog * @throws BlogNotFoundException blog not found * @throws BlogAccessException can not access blog * @throws CommunoteEntityNotFoundException can not found entity (user/group) * @throws NoBlogManagerLeftException no active user with managment rights * @throws ResponseBuildException exception while building the response * @throws ExtensionNotSupportedException extension is not supported */ @Override public Response handleCreateInternally( CreateRoleParameter createRoleParameter, String requestedMimeType, UriInfo uriInfo, String requestSessionId, Request request) throws BlogNotFoundException, BlogAccessException, CommunoteEntityNotFoundException, NoBlogManagerLeftException, ResponseBuildException, ExtensionNotSupportedException { Long blogId = TopicResourceHelper.getTopicIdByIdentifier( (createRoleParameter.getTopicIdentifier() != null) ? createRoleParameter.getTopicIdentifier().name() : null, createRoleParameter.getTopicId(), getTopicManagement()); if (createRoleParameter.getEntityId() != null) { assignOrRemoveRoleForEntity( blogId, getBlogRole(createRoleParameter), createRoleParameter.getEntityId()); } else if (StringUtils.isNotBlank(createRoleParameter.getUserAlias())) { assignOrRemoveRoleForUser(createRoleParameter, blogId, getBlogRole(createRoleParameter)); } else if (StringUtils.isNotBlank(createRoleParameter.getGroupAlias())) { assignOrRemoveRoleForGroup(createRoleParameter, blogId, getBlogRole(createRoleParameter)); } return ResponseHelper.buildSuccessResponse(null, request); }
/** * Get blog role * * @param getRoleParameter - an object that contains all the parameter that can or have to be used * for such a request * @param requestedMimeType - is the mime type that indicates which data exchange format to use * @param uriInfo - this object is created by the request and contains some request specific data * @param requestSessionId sessionId * @param request - javax request * @return null because it is not implemented * @throws ResponseBuildException exception while building the response * @throws ExtensionNotSupportedException extension is not supported */ @Override public Response handleGetInternally( GetRoleParameter getRoleParameter, String requestedMimeType, UriInfo uriInfo, String requestSessionId, Request request) throws ResponseBuildException, ExtensionNotSupportedException { return ResponseHelper.buildSuccessResponse(null, request); }
/** * {@inheritDoc} * * @param request - javax request * @throws ResponseBuildException exception while building the response * @throws ExtensionNotSupportedException extension is not supported */ @Override public Response handleListInternally( GetCollectionTimelineUserParameter getCollectionTimelineUserParameter, String requestedMimeType, UriInfo uriInfo, String requestSessionId, Request request) throws ResponseBuildException, ExtensionNotSupportedException { Map<String, String> parameters = TimelineNoteHelper.toMap(uriInfo.getQueryParameters()); UserTaggingCoreQueryParameters queryParameters = configureQueryInstance(parameters, request); PageableList<TimelineUserResource> timelineUserList = ServiceLocator.findService(QueryManagement.class) .query( USER_QUERY, queryParameters, new UserDataToTimelineUserConverter<UserData, TimelineUserResource>()); Map<String, Object> metaData = ResourceHandlerHelper.generateMetaDataForPaging( getCollectionTimelineUserParameter.getOffset(), getCollectionTimelineUserParameter.getMaxCount(), timelineUserList.getMinNumberOfElements()); return ResponseHelper.buildSuccessResponse(timelineUserList, request, metaData); }