Package org.silverpeas.core.webapi.pdc
Class PdcResource
- java.lang.Object
-
- org.silverpeas.core.web.rs.RESTWebService
-
- org.silverpeas.core.webapi.pdc.PdcResource
-
- All Implemented Interfaces:
ProtectedWebResource
,WebAuthenticationValidation
,WebAuthorizationValidation
,SilverpeasWebResource
@WebService @Path("pdc") @Authenticated public class PdcResource extends RESTWebService
A REST Web resource that represents the classification plan (named PdC). The PdC is defined by a set of semantic axis that vehicle the business concepts and the structures on which is based a given organization that uses the Silverpeas collaborative portal. The values of an axis is thus made either of single terms (of the inherent concept or structure) or of hierarchic semantic trees in which each branch carries an exactness about the value of a concept. It exists two kinds of PdC: the model (or the referent) in which all the axis to be used in the whole portal are defined, and the instances of the model that represent a PdC configured for a given Silverpeas component instance. The instances of the model can be just a clone of the model or a modified version by taking only some of the model's axis and by setting a different origin value (among the possible values of the axis) for each chosen axis. Such PdCs are identified by an unique URI in which the identifier of the Silverpeas component instance is referenced.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.silverpeas.core.web.rs.RESTWebService
RESTWebService.WebProcess<R>, RESTWebService.WebTreatment<R>
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.web.rs.RESTWebService
RESPONSE_HEADER_ARRAYSIZE
-
Fields inherited from interface org.silverpeas.core.web.SilverpeasWebResource
BASE_PATH
-
-
Constructor Summary
Constructors Constructor Description PdcResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getComponentId()
Gets the identifier of the component instance to which the requested resource belongs to.PdcEntity
getPdc()
Gets the PdC.PdcEntity
getPdcForClassification(String component, String content)
Gets the PdC configured for the Silverpeas component instance identified by the requested URI.protected String
getResourceBasePath()
Gets the base path of the web resource relative to the root path of all the web resources in Silverpeas as given bySilverpeasWebResource.getBasePath()
.-
Methods inherited from class org.silverpeas.core.web.rs.RESTWebService
createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, process
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.web.rs.ProtectedWebResource
validateUserAuthorization
-
Methods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation
validateUserAuthentication
-
-
-
-
Method Detail
-
getPdcForClassification
@GET @Path("{componentId:[a-zA-Z]+[0-9]+}") @Produces("application/json") public PdcEntity getPdcForClassification(@PathParam("componentId") String component, @QueryParam("contentId") String content)
Gets the PdC configured for the Silverpeas component instance identified by the requested URI. The PdC that is sent back is adapted for classifying or updating the classification of the resource content referred by the specified request query parameter. In that case, all the invariant axis of the PdC will have an invariant value set with the one coming from the classification of the resource. In effect, an invariant axis means that no other values are possible when one was already set in a position of the content on the axis. The PdC is sent back in JSON. If the user isn't authenticated, a 401 HTTP code is returned. If the user isn't authorized to access the requested component instance, a 403 is returned. If the resource content isn't indicated as query parameter, a 400 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.- Parameters:
component
- the unique identifier of the component instance for which the PdC is instanciated.content
- the unique identifier of the content to classify with the PdC.- Returns:
- a web entity representing the PdC ready to be used to classify a content. The entity is serialized in JSON.
-
getPdc
@GET @Produces("application/json") public PdcEntity getPdc()
Gets the PdC. The PdC is sent back in JSON. If the user isn't authenticated, a 401 HTTP code is returned. If the user isn't authorized to access the requested component instance, a 403 is returned. If the resource content isn't indicated as query parameter, a 400 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.- Returns:
- a web entity representing the PdC. The entity is serialized in JSON.
-
getResourceBasePath
protected String getResourceBasePath()
Description copied from class:RESTWebService
Gets the base path of the web resource relative to the root path of all the web resources in Silverpeas as given bySilverpeasWebResource.getBasePath()
.- Specified by:
getResourceBasePath
in classRESTWebService
- Returns:
- the relative path that identifies this REST web service among all other REST web services.
-
getComponentId
public String getComponentId()
Description copied from interface:SilverpeasWebResource
Gets the identifier of the component instance to which the requested resource belongs to.- Returns:
- the identifier of the Silverpeas component instance.
-
-