Class CmsJsonDocumentList
java.lang.Object
org.opencms.xml.xml2json.document.A_CmsJsonDocument
org.opencms.xml.xml2json.document.CmsJsonDocumentResource
org.opencms.xml.xml2json.document.CmsJsonDocumentXmlContent
org.opencms.xml.xml2json.document.CmsJsonDocumentList
- All Implemented Interfaces:
I_CmsJsonDocument
Class representing a JSON document for a CMS list.
-
Field Summary
Fields inherited from class org.opencms.xml.xml2json.document.CmsJsonDocumentXmlContent
m_embedLinkedModelgroup, m_throwException, m_xmlContent
Fields inherited from class org.opencms.xml.xml2json.document.CmsJsonDocumentResource
m_helper, m_resource
Fields inherited from class org.opencms.xml.xml2json.document.A_CmsJsonDocument
FIELD_LINKED_CONTENTS, m_context, m_json, m_jsonRequest
-
Constructor Summary
ConstructorDescriptionCmsJsonDocumentList
(CmsJsonRequest jsonRequest, CmsXmlContent xmlContent) Creates a new JSON document. -
Method Summary
Modifier and TypeMethodDescriptiongetJson()
Returns the JSON document.protected boolean
Whether all locales of this XML content are requested.protected boolean
Whether one locale of this XML content is requested.protected boolean
Whether a part of a locale of this XML content is requested.protected boolean
Whether the default locale content shall be shown in the case the requested locale is not available.protected boolean
Whether to show the wrapper with resource information.Methods inherited from class org.opencms.xml.xml2json.document.CmsJsonDocumentXmlContent
insertJsonLinkedContent, insertJsonLinkedContents, insertJsonWrapper, isShowLinkedContentsRequest
Methods inherited from class org.opencms.xml.xml2json.document.CmsJsonDocumentResource
insertJsonResource, insertJsonResourceAttributes, insertJsonResourceFile, insertJsonResourceParams, insertJsonResourcePathAndLink, insertJsonResourceProperties
-
Constructor Details
-
CmsJsonDocumentList
Creates a new JSON document.- Parameters:
jsonRequest
- the JSON requestxmlContent
- the listconfig XML content- Throws:
Exception
- if something goes wrong
-
-
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
- Overrides:
getJson
in classCmsJsonDocumentXmlContent
- 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:
-
isLocaleAllRequest
Description copied from class:CmsJsonDocumentXmlContent
Whether all locales of this XML content are requested.- Overrides:
isLocaleAllRequest
in classCmsJsonDocumentXmlContent
- Returns:
- whether all or not
- See Also:
-
isLocalePathRequest
Description copied from class:CmsJsonDocumentXmlContent
Whether one locale of this XML content is requested.- Overrides:
isLocalePathRequest
in classCmsJsonDocumentXmlContent
- Returns:
- whether one locale or not
- See Also:
-
isLocaleRequest
Description copied from class:CmsJsonDocumentXmlContent
Whether a part of a locale of this XML content is requested.- Overrides:
isLocaleRequest
in classCmsJsonDocumentXmlContent
- Returns:
- whether a part of a locale or not
- See Also:
-
isShowFallbackLocaleRequest
Description copied from class:CmsJsonDocumentXmlContent
Whether the default locale content shall be shown in the case the requested locale is not available.- Overrides:
isShowFallbackLocaleRequest
in classCmsJsonDocumentXmlContent
- Returns:
- whether to show the default locale or not
- See Also:
-
isShowWrapperRequest
Description copied from class:CmsJsonDocumentXmlContent
Whether to show the wrapper with resource information. For backward compatibility the wrapper is shown for the all locale request but not for the locale and locale path request as a default. This default behavior can be changed by means of the "wrapper" request parameter. For locale path requests, wrapper information is not available.- Overrides:
isShowWrapperRequest
in classCmsJsonDocumentXmlContent
- Returns:
- whether to show the wrapper or not
- See Also:
-