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
  • Field Details

  • Method Details

    • 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
    • accept

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

      String getUrl(FileDocument doc, Member mbr, 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 String getUrl(FileDocument doc, Member mbr, String baseUrl, OpeningMode openingMode)
      Returns the URL to open the document.
      Parameters:
      doc - the document
      mbr - the member
      baseUrl - the base URL of the site
      openingMode - READ or WRITE (see OpeningMode)
      Returns:
      the URL to edit the document.
      Since:
      jcms-10.0.8
    • getName

      String getName(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

      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 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 String getMenuLabel(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
    • getMenuLabel

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

      default String getButtonLabel(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 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 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 String getLinkAttributes(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 String getKey()
    • setKey

      default void setKey(String key)