Class CmsJsonDocumentResource
java.lang.Object
org.opencms.xml.xml2json.document.A_CmsJsonDocument
org.opencms.xml.xml2json.document.CmsJsonDocumentResource
- All Implemented Interfaces:
I_CmsJsonDocument
- Direct Known Subclasses:
CmsJsonDocumentXmlContent
Class representing a JSON document for a CMS resource.
-
Field Summary
Modifier and TypeFieldDescriptionprotected CmsResourceDataJsonHelper
The resource data helper.protected CmsResource
The resource.Fields inherited from class org.opencms.xml.xml2json.document.A_CmsJsonDocument
FIELD_LINKED_CONTENTS, m_context, m_json, m_jsonRequest
-
Constructor Summary
ConstructorDescriptionCmsJsonDocumentResource
(CmsJsonRequest jsonRequest, CmsResource resource) Creates a new JSON document. -
Method Summary
Modifier and TypeMethodDescriptiongetJson()
Returns the JSON document.protected void
If the request parameter "wrapper" is set, inserts information about this resource into the JSON document.protected void
Inserts the resource attributes into this JSON document.protected void
Inserts file type information into this JSON document.protected void
Inserts information about the effective request parameters into this JSON document.protected void
Inserts path and link information about this resource into this JSON document.protected void
Inserts the properties of this resource into the JSON document.
-
Field Details
-
m_helper
The resource data helper. -
m_resource
The resource.
-
-
Constructor Details
-
CmsJsonDocumentResource
Creates a new JSON document.- Parameters:
jsonRequest
- the JSON requestresource
- the resource
-
-
Method Details
-
getJson
public Object getJson() throws JSONException, CmsException, CmsJsonHandlerException, CmsJsonHandlerXmlContent.PathNotFoundException, ExceptionDescription copied from interface:I_CmsJsonDocument
Returns the JSON document.- Specified by:
getJson
in interfaceI_CmsJsonDocument
- Returns:
- the JSON document
- Throws:
JSONException
- if rendering the JSON document failsCmsException
- if reading a resource or evaluating a SOLR search failsCmsJsonHandlerException
- if the request is not valid according to the specificationCmsJsonHandlerXmlContent.PathNotFoundException
- if the selected path does not existException
- if something else goes wrong- See Also:
-
insertJsonResource
If the request parameter "wrapper" is set, inserts information about this resource into the JSON document.- Throws:
JSONException
CmsException
-
insertJsonResourceAttributes
Inserts the resource attributes into this JSON document.- Throws:
JSONException
- if JSON rendering fails
-
insertJsonResourceFile
Inserts file type information into this JSON document.- Throws:
JSONException
- if JSON rendering fails
-
insertJsonResourceParams
Inserts information about the effective request parameters into this JSON document.- Throws:
JSONException
- if JSON rendering fails
-
insertJsonResourcePathAndLink
Inserts path and link information about this resource into this JSON document.- Throws:
JSONException
- if JSON rendering fails
-
insertJsonResourceProperties
Inserts the properties of this resource into the JSON document.- Throws:
JSONException
- if JSON rendering failsCmsException
- if reading the properties fails
-