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 Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean accept​(FileDocument doc, Member mbr)
      Returns true if the editor accepts the member to edit the document.
      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).
      java.lang.String getIcon​(FileDocument doc, Member mbr)
      Returns the 16x16-sized icon of the editor (icon property name without the icon.
      default java.lang.String getIcon48​(FileDocument doc, Member mbr)
      Returns the 48x48-sized icon of the editor (icon property name without the icon.
      default java.lang.String getKey()  
      default java.lang.String getLinkAttributes()
      Returns HTML attributes to add to the link.
      default java.lang.String getLinkAttributes​(java.lang.String lang, FileDocument doc, Member mbr)
      Returns HTML attributes to add to the link.
      default java.lang.String getLinkCss()
      Returns CSS classes to add to the link.
      default java.lang.String getMenuLabel​(java.lang.String lang, FileDocument doc, Member mbr)
      Return the localized label used in the dropdown menu.
      java.lang.String getName​(java.lang.String lang)
      Returns the localized name of the editor.
      java.lang.String getUrl​(FileDocument doc, Member mbr, java.lang.String baseUrl)
      Returns the URL to open the document.
      default java.lang.String getUrl​(FileDocument doc, Member mbr, java.lang.String baseUrl, OpeningMode mode)
      Returns the URL to open the document.
      default void setKey​(java.lang.String key)  
    • 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 open 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
      • getUrl

        default java.lang.String getUrl​(FileDocument doc,
                                        Member mbr,
                                        java.lang.String baseUrl,
                                        OpeningMode mode)
        Returns the URL to open the document.
        Parameters:
        doc - the document
        mbr - the member
        baseUrl - the base URL of the site
        mode - READ or WRITE (see OpeningMode)
        Returns:
        the URL to edit the document.
        Since:
        jcms-10.0.8
      • 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 16x16-sized icon of the editor (icon property name without the icon. prefix).
        Parameters:
        doc - the document
        mbr - the document
        Returns:
        the icon of the editor.
        Since:
        jcms-10.0.3
      • getIcon48

        default java.lang.String getIcon48​(FileDocument doc,
                                           Member mbr)
        Returns the 48x48-sized icon of the editor (icon property name without the icon. prefix)
        Parameters:
        doc - the document
        mbr - the document
        Returns:
        the icon of the editor.
        Since:
        jcms-10.0.8
      • 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)