Class JcmsRestResource

    • Field Detail

      • channel

        protected Channel channel
      • j2eeRequest

        protected javax.servlet.http.HttpServletRequest j2eeRequest
      • xmlEncoding

        protected java.lang.String xmlEncoding
      • queryString

        protected java.lang.String queryString
      • formQueryString

        protected formQueryString
      • context

        protected org.restlet.Context context
      • checkCSRF

        protected boolean checkCSRF
        Should we check CSRF on POST request ?
    • Constructor Detail

      • JcmsRestResource

        public JcmsRestResource​(org.restlet.Context context,
    • Method Detail

      • getLoggedMember

        protected Member getLoggedMember()
      • forward

        protected void forward​(java.lang.String path)
      • getXmlProlog

        public java.lang.String getXmlProlog()
      • setXmlUTF8Encoding

        public void setXmlUTF8Encoding()
      • setCheckCSRF

        protected void setCheckCSRF​(boolean checkCSRF)
        Set wether CSRF control must be verified for POST request on this resource or not.

        Default behavior is configured with properties :

        • Globally for all resources rest.check-csrf: true|false
        • Per resources, using type hierarchy; rest.check-csrf.{class-fqn}: true|false
        Invoking this method override the default value.
        checkCSRF - true to require valid CSRF prevention measures on client POST request, false to skip CSRF control
        jcms-10.0.5 / JCMS-8546
      • getRepresentation

        public final org.restlet.resource.Representation getRepresentation​(org.restlet.resource.Variant variant)
        getRepresentation in class org.restlet.resource.Resource
      • getXmlRepresentation

        protected java.lang.String getXmlRepresentation()
      • getItemXmlRepresentation

        protected java.lang.String getItemXmlRepresentation​(java.lang.Object item)
      • insertBeforeXml

        protected java.lang.String insertBeforeXml()
      • insertAfterXml

        protected java.lang.String insertAfterXml()
      • getPlainTextRepresentation

        protected java.lang.String getPlainTextRepresentation()
      • getJSONRepresentation

        protected java.lang.String getJSONRepresentation()
      • getAtomRepresentation

        protected java.lang.String getAtomRepresentation()
      • generateErrorRepresentation

        protected void generateErrorRepresentation​(java.lang.String errorMessage,
                                                   java.lang.String applicationErrorCode,
        Prefer method with mediatype parameter
        Generate an XML representation of an error response. Prefer method RestUtil.sendDetailedError
        errorMessage - the error message.
        applicationErrorCode - the error code.
        httpStatus - the HTTP status
        response - the response
      • post

        public final void post​(org.restlet.resource.Representation entity)
        post in class org.restlet.resource.Resource
      • doPost

        protected void doPost​(org.restlet.resource.Representation entity)
      • doPost

        protected void doPost​(java.lang.String action,
      • put

        public final void put​(org.restlet.resource.Representation entity)
        put in class org.restlet.resource.Resource
      • doPut

        protected void doPut​(org.restlet.resource.Representation entity)
      • delete

        public final void delete()
        delete in class org.restlet.resource.Resource
      • doDelete

        protected void doDelete()
      • checkReadRight

        protected boolean checkReadRight​(Data theData)
        Check if the given Data may be read by the logged Member. For specific types (not Publication, Category, Workspace, Member), the data may be read only by their author or an admin member.
        theData - the data
        true is the Data can be read by the logged member
      • getPagerData

        public PagerData getPagerData()
        Retrieve the PagerData associated to this Resource, if any.

        The pager data instance returned may not contain any data if only one results was returned, in such case, see DataRestResource.getData().

        a PagerData instance or null if channel was not available.
      • getPreferredMediaType

        public getPreferredMediaType()