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
public class CmsJsonDocumentList extends CmsJsonDocumentXmlContent
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
Constructors Constructor Description CmsJsonDocumentList(CmsJsonRequest jsonRequest, CmsXmlContent xmlContent)
Creates a new JSON document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getJson()
Returns the JSON document.protected boolean
isLocaleAllRequest()
Whether all locales of this XML content are requested.protected boolean
isLocalePathRequest()
Whether one locale of this XML content is requested.protected boolean
isLocaleRequest()
Whether a part of a locale of this XML content is requested.protected boolean
isShowFallbackLocaleRequest()
Whether the default locale content shall be shown in the case the requested locale is not available.protected boolean
isShowWrapperRequest()
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 Detail
-
CmsJsonDocumentList
public CmsJsonDocumentList(CmsJsonRequest jsonRequest, CmsXmlContent xmlContent) throws java.lang.Exception
Creates a new JSON document.- Parameters:
jsonRequest
- the JSON requestxmlContent
- the listconfig XML content- Throws:
java.lang.Exception
- if something goes wrong
-
-
Method Detail
-
getJson
public java.lang.Object getJson() throws JSONException, CmsException, CmsJsonHandlerException, CmsJsonHandlerXmlContent.PathNotFoundException, java.lang.Exception
Description 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 existjava.lang.Exception
- if something else goes wrong- See Also:
I_CmsJsonDocument.getJson()
-
isLocaleAllRequest
protected boolean 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:
CmsJsonDocumentXmlContent.isLocaleAllRequest()
-
isLocalePathRequest
protected boolean 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:
CmsJsonDocumentXmlContent.isLocalePathRequest()
-
isLocaleRequest
protected boolean 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:
CmsJsonDocumentXmlContent.isLocaleRequest()
-
isShowFallbackLocaleRequest
protected boolean 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:
CmsJsonDocumentXmlContent.isShowFallbackLocaleRequest()
-
isShowWrapperRequest
protected boolean 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:
CmsJsonDocumentXmlContent.isShowWrapperRequest()
-
-