Class CMAUiExtension.Extension

  • Enclosing class:
    CMAUiExtension

    public static class CMAUiExtension.Extension
    extends java.lang.Object
    Model holding the actual information of the extension.
    • Constructor Detail

      • Extension

        public Extension()
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns:
        the name of this UI extension.
      • setName

        public CMAUiExtension.Extension setName​(java.lang.String name)
        Update the name of this UI extension.
        Parameters:
        name - the new name.
        Returns:
        this instance for chaining.
      • addFieldType

        public CMAUiExtension.Extension addFieldType​(Constants.CMAFieldType type)
        Add a new content type field type to this UI extension.
        Parameters:
        type - the new type to be added.
        Returns:
        this instance for chaining.
      • getSourceContent

        public java.lang.String getSourceContent()
        Returns:
        html source code representing the UI extension.
      • setSourceContent

        public CMAUiExtension.Extension setSourceContent​(java.lang.String sourceContent)
        Updates the html sourcode.

        Either this one or a link to an extension online needs to be present once sending to contentful.

        May not be larger then 200kB.

        Parameters:
        sourceContent - the actual html source code of this UI extension.
        Returns:
        this instance for chaining.
        Throws:
        java.lang.IllegalArgumentException - if source content is larger then 200kB.
        See Also:
        setSourceUrl(String)
      • getSourceUrl

        public java.lang.String getSourceUrl()
        Returns:
        a url to the source code.
      • setSourceUrl

        public CMAUiExtension.Extension setSourceUrl​(java.lang.String sourceUrl)
        Link to the source code to be executed with this UI extension.

        Either this one or the direct source code needs to be present once sending to contentful.

        Parameters:
        sourceUrl - a link to an html page containing the source of the UI extension.
        Returns:
        this instance for chaining.
        See Also:
        setSourceContent(String)
      • isOnSidebar

        public boolean isOnSidebar()
        Returns:
        is this element set to be appearing on the sidebar?
      • setIsOnSidebar

        public CMAUiExtension.Extension setIsOnSidebar​(boolean available)
        Update whether this element should be appearing on the sidebar.
        Parameters:
        available - on sidebar or not?
        Returns:
        this instance for chaining.
      • setParameters

        public CMAUiExtension.Extension setParameters​(CMAUiExtensionParameters parameters)
        Set the UI extension parameters. You can define up to 8 installation and instance parameters for each UI Extension.
        Parameters:
        parameters - the installation or instance parameters.
        Returns:
        this instance for chaining.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        a human readable string, representing the object.