Ignore:
Timestamp:
Nov 27, 2019, 3:23:27 PM (3 years ago)
Author:
Nicklas Nordborg
Message:

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

Implemented in the any-to-any lists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/anytoany/list_anytoany.jsp

    r7604 r7761  
    5353  import="net.sf.basedb.clients.web.extensions.list.ListColumnAction"
    5454  import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil"
     55  import="net.sf.basedb.clients.web.extensions.fileviewer.FileViewerContext"
     56  import="net.sf.basedb.clients.web.extensions.fileviewer.FileViewerUtil"
    5557  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
    5658  import="java.util.List"
     
    8486  ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext);
    8587  ExtensionsInvoker<ListColumnAction<AnyToAny,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext);
     88  FileViewerContext fileContext = FileViewerContext.anyToAny(item);
     89  FileViewerUtil fileViewer = new FileViewerUtil(jspContext, fileContext);
    8690  %>
    8791  <base:page type="include">
    8892  <base:head scripts="/common/anytoany/list.js" />
    8993  <base:body>
     94    <ext:scripts context="<%=jspContext%>" />
    9095    <base:section
    9196      id="anytoany"
     
    179184             
    180185              String toLink = "";
    181               if (to instanceof File)
    182               {
    183                 File toFile = (File)to;
    184                 toLink = Base.getLinkedFile(ID, toFile, false, true, true, root);
    185               }
    186               else if (to instanceof Nameable)
     186              if (to instanceof Nameable)
    187187              {
    188188                Nameable nameable = (Nameable)to;
     
    204204              {
    205205                toLink = Base.getLink(ID, to.toString(), to.getType(), to.getId(), true);
     206              }
     207              if (to instanceof File)
     208              {
     209                File toFile = (File)to;
     210                fileContext.setCurrentAnyToAny(toFile, ata);
     211                toLink += " " + fileViewer.renderAsString();
    206212              }
    207213              if (to instanceof Subtypable)
Note: See TracChangeset for help on using the changeset viewer.