Interface DocumentEditor

  • All Known Implementing Classes:
    AbstractDocumentEditor, ImageDocumentEditor

    public interface DocumentEditor
    This interface must be implemented by component that what provides a service to edit a document. A DocumentEditor must be declared in properties with prefix file-document. and suffix .class.

    Example:

    file-document.editor.mySuperEditor.class: com.jalios.jcmsplugin.mySuperEditor.MySuperEditorDocumentEditor
    Since:
    jcms-10.0.3
    • Method Detail

      • accept

        boolean accept​(FileDocument doc,
                       Member mbr)
        Returns true if the editor accepts the member to edit the document.
        Parameters:
        doc - the document
        mbr - the member
        Returns:
        true if the editor accepts the member to edit the document.
        Since:
        jcms-10.0.3
      • getUrl

        java.lang.String getUrl​(FileDocument doc,
                                Member mbr,
                                java.lang.String baseUrl)
        Returns the URL to edit the document.
        Parameters:
        doc - the document
        mbr - the member
        baseUrl - the base URL of the site
        Returns:
        the URL to edit the document.
        Since:
        jcms-10.0.3
      • getName

        java.lang.String getName​(java.lang.String lang)
        Returns the localized name of the editor.
        Parameters:
        lang - the language
        Returns:
        the localized name of the editor.
        Since:
        jcms-10.0.3
      • getIcon

        java.lang.String getIcon​(FileDocument doc,
                                 Member mbr)
        Returns the icon of the editor.
        Parameters:
        doc - the document
        mbr - the document
        Returns:
        the icon of the editor.
        Since:
        jcms-10.0.3
      • getMenuLabel

        default java.lang.String getMenuLabel​(java.lang.String lang,
                                              FileDocument doc,
                                              Member mbr)
        Return the localized label used in the dropdown menu.
        Parameters:
        lang - the language
        doc - the document
        mbr - the document
        Returns:
        the localized label used in the dropdown menu.
        Since:
        jcms-10.0.3
      • getButtonLabel

        default java.lang.String getButtonLabel​(java.lang.String lang,
                                                FileDocument doc,
                                                Member mbr)
        Return the localized label used for the button (if only this editor is available).
        Parameters:
        lang - the language
        doc - the document
        mbr - the document
        Returns:
        the localized label used for the button (if only this editor is available).
        Since:
        jcms-10.0.3
      • getLinkCss

        default java.lang.String getLinkCss()
        Returns CSS classes to add to the link.
        Returns:
        CSS classes to add to the link.
        Since:
        jcms-10.0.3
      • getLinkAttributes

        default java.lang.String getLinkAttributes()
        Returns HTML attributes to add to the link.
        Returns:
        HTML attributes to add to the link.
        Since:
        jcms-10.0.3
      • getLinkAttributes

        default java.lang.String getLinkAttributes​(java.lang.String lang,
                                                   FileDocument doc,
                                                   Member mbr)
        Returns HTML attributes to add to the link.
        Parameters:
        lang - the language
        doc - the document
        mbr - the document
        Returns:
        HTML attributes to add to the link.
        Since:
        jcms-10.0.6
      • getKey

        default java.lang.String getKey()
      • setKey

        default void setKey​(java.lang.String key)