Changeset 7756


Ignore:
Timestamp:
Nov 27, 2019, 8:17:21 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #2199: Implement a "File viewer" extension point

Defined the 'net.sf.basedb.clients.web.file-viewer' extension point. It re-uses the ButtonAction interface to specify action. Information about the current item need more than just the file so the FileViewerContext class was created that can also hold more information about files that are attached or linked to a parent item.

Location:
trunk/src/clients/web
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/web-extensions.xml

    r7536 r7756  
    147147      CompactButtonRendererFactory, but this can be overridden by the extensions.
    148148      The JspContext.getItem() method return the current ServiceControllerAction.
     149    </description>
     150  </extension-point>
     151 
     152  <extension-point
     153    id="file-viewer"
     154    >
     155    <action-class>net.sf.basedb.clients.web.extensions.toolbar.ButtonAction</action-class>
     156    <renderer-factory override="true">
     157      <factory-class>net.sf.basedb.clients.web.extensions.toolbar.CompactButtonRendererFactory</factory-class>
     158    </renderer-factory>
     159    <name>File viewer</name>
     160    <description>
     161      Extension point for adding actions after the "View" and "Download" actions
     162      whenever a file item is displayed. Extensions should provide ActionButton
     163      instances. The default renderer factory is CompactButtonRendererFactory, but
     164      this can be overridden by the extensions. The JspContext.getCurrentItem() method
     165      return a FileViewerContext instance. This object can be used to retrieve information
     166      about the current file, but also about the surrounding context, for example,
     167      if the file is in a "Data files" list for another item.
    149168    </description>
    150169  </extension-point>
Note: See TracChangeset for help on using the changeset viewer.