Class CmsJsonDocumentFolder
java.lang.Object
org.opencms.xml.xml2json.document.A_CmsJsonDocument
org.opencms.xml.xml2json.document.CmsJsonDocumentFolder
- All Implemented Interfaces:
I_CmsJsonDocument
Class representing a JSON document for a folder.
-
Field Summary
Fields inherited from class org.opencms.xml.xml2json.document.A_CmsJsonDocument
FIELD_LINKED_CONTENTS, m_context, m_json, m_jsonRequest
-
Constructor Summary
ConstructorDescriptionCmsJsonDocumentFolder
(CmsJsonRequest jsonRequest) Creates a new JSON document. -
Method Summary
Modifier and TypeMethodDescriptionprotected JSONObject
folderListingJson
(CmsResource target, int levelsLeft) Formats folder listing as a JSON object, with the individual file names in the folder as keys.getJson()
Returns the JSON document.
-
Constructor Details
-
CmsJsonDocumentFolder
Creates a new JSON document.- Parameters:
jsonRequest
- the JSON request
-
-
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:
-
folderListingJson
Formats folder listing as a JSON object, with the individual file names in the folder as keys.- Parameters:
target
- the folderlevelsLeft
- the number of levels to format (if 1, only the direct children are listed)- Returns:
- the JSON representation of the folder listing
- Throws:
Exception
- if something goes wrong
-