Changeset 8000


Ignore:
Timestamp:
Aug 10, 2021, 9:46:14 AM (9 months ago)
Author:
Nicklas Nordborg
Message:

Fixes #2262: Display version for extensions in the Plug-ins and extensions overview tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/admin/extensions/tree.jsp

    r7954 r8000  
    5050<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    5151<%!
    52 JSONObject newJoustExtensionPoint(DbControl dc, JSONObject jsonParent, ExtensionsControl ec, ExtensionPoint<?> ep, ExtensionsFile ef)
     52JSONObject newJoustExtensionPoint(DbControl dc, JSONObject jsonParent, ExtensionsControl ec, ExtensionPoint<?> ep, ExtensionsFile ef, boolean showFile)
    5353{
    5454  String id = ep.getId();
    55   String name = ep.getName();
     55  String name = HTML.encodeTags(ep.getName());
    5656  if (name == null) name = id;
     57  if (showFile && ef != null)
     58  {
     59    name += " <span class=\"itemref\">[" + HTML.encodeTags(ef.getName()) + "]</span>";
     60  }
    5761  String icon = ec.isEnabled(ep) ? "ExtensionPoint" : "ExtensionPointDisabled";
    5862  if ((ef != null && ef.hasError()) || ec.getLastExtensionPointError(id) != null)
     
    6064    icon = "ExtensionPointError";
    6165  }
    62   JSONObject json = newJoustEntry(dc, jsonParent, icon, HTML.encodeTags(name), id);
     66  JSONObject json = newJoustEntry(dc, jsonParent, icon, name, id);
    6367  json.put("type", "extension-point");
    6468  return json;
     
    96100JSONObject newJoustFile(DbControl dc, JSONObject jsonParent, ExtensionsFile ef, ExtensionsControl ec)
    97101{
    98   String efName = ef.getName();
     102  String id = ef.getName();
     103  About about = ef.getAbout();
     104  String name = HTML.encodeTags(ef.getName());
     105  if (about != null && about.getVersion() != null) name += " <span class=\"itemref\">[" + HTML.encodeTags(about.getVersion()) + "]</span>";
    99106  String icon = ef.isJar() ? "JarFile" : "XmlFile";
    100107  if (ef.hasError())
     
    108115  if (ef.checkModified()) icon += "Modified";
    109116 
    110   JSONObject json = newJoustEntry(dc, jsonParent, icon, HTML.encodeTags(efName), efName);
    111   json.put("id", efName);
     117  JSONObject json = newJoustEntry(dc, jsonParent, icon, name, id);
     118  json.put("id", id);
    112119  json.put("type", "file");
    113120  json.put("fileUri", ef.getURI().toString());
     
    210217    if (id.startsWith("net.sf.basedb.clients.web.listcolumn.")) jsonParent = jsonListColumns;
    211218   
    212     JSONObject jsonEp = newJoustExtensionPoint(dc, jsonParent, ec, ep, ec.getFileByObjectKey(new ExtensionPointKey(ep)));
     219    JSONObject jsonEp = newJoustExtensionPoint(dc, jsonParent, ec, ep, ec.getFileByObjectKey(new ExtensionPointKey(ep)), true);
    213220 
    214221    List<Extension<?>> extensions = ec.getExtensions(ep.getId());
     
    231238    for (ExtensionPoint<?> ep : eps)
    232239    {
    233       newJoustExtensionPoint(dc, jsonFile, ec, ep, ef);
     240      newJoustExtensionPoint(dc, jsonFile, ec, ep, ef, false);
    234241    }
    235242   
Note: See TracChangeset for help on using the changeset viewer.