Class CmsJsonDocumentXmlContent

    • Constructor Detail

      • CmsJsonDocumentXmlContent

        public CmsJsonDocumentXmlContent​(CmsJsonRequest jsonRequest,
                                         CmsXmlContent xmlContent)
                                  throws java.lang.Exception
        Creates a new JSON document.

        Parameters:
        jsonRequest - the JSON request
        xmlContent - the XML content
        Throws:
        java.lang.Exception - if something goes wrong
      • CmsJsonDocumentXmlContent

        public CmsJsonDocumentXmlContent​(CmsJsonRequest jsonRequest,
                                         CmsXmlContent xmlContent,
                                         boolean embedLinkedModelgroup)
                                  throws java.lang.Exception
        Creates a new JSON document.

        Parameters:
        jsonRequest - the JSON request
        xmlContent - the XML content
        embedLinkedModelgroup - whether to embed linked model groups
        Throws:
        java.lang.Exception - if something goes wrong
    • Method Detail

      • insertJsonLinkedContent

        protected void insertJsonLinkedContent​(CmsResource resource)
                                        throws java.lang.Exception
        Inserts a JSON representation of a linked content into this JSON document.

        Parameters:
        resource - the resource
        Throws:
        java.lang.Exception - if something goes wrong
      • insertJsonLinkedContents

        protected void insertJsonLinkedContents()
                                         throws java.lang.Exception
        For each linked content, inserts a JSON representation of the linked content into this JSON document.

        Throws:
        java.lang.Exception - if something goes wrong
      • isLocaleAllRequest

        protected boolean isLocaleAllRequest()
        Whether all locales of this XML content are requested.

        Returns:
        whether all or not
      • isLocalePathRequest

        protected boolean isLocalePathRequest()
        Whether one locale of this XML content is requested.

        Returns:
        whether one locale or not
      • isLocaleRequest

        protected boolean isLocaleRequest()
        Whether a part of a locale of this XML content is requested.

        Returns:
        whether a part of a locale or not
      • isShowFallbackLocaleRequest

        protected boolean isShowFallbackLocaleRequest()
        Whether the default locale content shall be shown in the case the requested locale is not available.

        Returns:
        whether to show the default locale or not
      • isShowLinkedContentsRequest

        protected boolean isShowLinkedContentsRequest()
        Whether all linked contents shall be embedded into this document.
        Returns:
        whether to embed the linked contents or not
      • isShowWrapperRequest

        protected boolean isShowWrapperRequest()
        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.
        Returns:
        whether to show the wrapper or not