Changeset 7271


Ignore:
Timestamp:
Jan 19, 2017, 9:54:41 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #2052: Add extension point for custom action in the Adminstrate->Services list

The extension point has now been defined: net.sf.basedb.clients.web.services.list.actions.

Location:
trunk
Files:
2 edited

Legend:

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

    r7111 r7271  
    132132      </parameters>
    133133    </error-handler-factory>
     134  </extension-point>
     135 
     136  <extension-point
     137    id="services.list.actions"
     138    >
     139    <action-class>net.sf.basedb.clients.web.extensions.toolbar.ButtonAction</action-class>
     140    <renderer-factory override="true">
     141      <factory-class>net.sf.basedb.clients.web.extensions.toolbar.CompactButtonRendererFactory</factory-class>
     142    </renderer-factory>
     143    <name>Services: Actions</name>
     144    <description>
     145      Extension point for the Actions column in the Adminstrate-&gt;services list.
     146      Extensions should provide ActionButton instances. The default renderer factory is
     147      CompactButtonRendererFactory, but this can be overridden by the extensions.
     148      The JspContext.getItem() method return the current ServiceControllerAction.
     149    </description>
    134150  </extension-point>
    135151
  • trunk/www/admin/services/services.jsp

    r7096 r7271  
    1919<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    2020<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
     21<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    2122<%
    2223final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
     
    3536int numServices = 0;
    3637
     38ExtensionsInvoker actionsInvoker = ExtensionsControl.useExtensions(jspContext,
     39   "net.sf.basedb.clients.web.services.list.actions");
    3740try
    3841{
    3942  %>
    4043  <base:page title="Manage Services">
    41   <base:head scripts="table.js,~services.js" styles="table.css" />
     44  <base:head scripts="table.js,~services.js" styles="table.css">
     45    <ext:scripts context="<%=jspContext %>" />
     46    <ext:stylesheets context="<%=jspContext%>" />
     47  </base:head>
    4248  <base:body>
    4349  <h1>Manage Services</h1>
     
    137143            <tbl:cell column="actions">
    138144              <%
    139               if (isNewExtension && writePermission)
    140               {
    141                 if (isRunning)
     145              if (writePermission)
     146              {
     147                if (isNewExtension)
    142148                {
    143                   %>
    144                   <base:icon
    145                     id="<%="stop."+ext.getId()%>"
    146                     subclass="auto-init"
    147                     data-auto-init="control-service"
    148                     data-cmd="Stop"
    149                     data-extension-id="<%=ext.getId()%>"
    150                     image="stop.png"
    151                     tooltip="Stop all services in this extension"
    152                   />
    153                   <%
     149                  if (isRunning)
     150                  {
     151                    %>
     152                    <base:icon
     153                      id="<%="stop."+ext.getId()%>"
     154                      subclass="auto-init"
     155                      data-auto-init="control-service"
     156                      data-cmd="Stop"
     157                      data-extension-id="<%=ext.getId()%>"
     158                      image="stop.png"
     159                      tooltip="Stop all services in this extension"
     160                    />
     161                    <%
     162                  }
     163                  else
     164                  {
     165                    %>
     166                    <base:icon
     167                      id="<%="start."+ext.getId()%>"
     168                      subclass="auto-init"
     169                      data-auto-init="control-service"
     170                      data-cmd="Start"
     171                      data-extension-id="<%=ext.getId()%>"
     172                      image="start.png"
     173                      tooltip="Start all services in this extension"
     174                    />
     175                    <%
     176                  }
    154177                }
    155                 else
    156                 {
    157                   %>
    158                   <base:icon
    159                     id="<%="start."+ext.getId()%>"
    160                     subclass="auto-init"
    161                     data-auto-init="control-service"
    162                     data-cmd="Start"
    163                     data-extension-id="<%=ext.getId()%>"
    164                     image="start.png"
    165                     tooltip="Start all services in this extension"
    166                   />
    167                   <%
    168                 }
     178                %>
     179                <ext:render extensions="<%=actionsInvoker%>" context="<%=jspContext%>" item="<%=action%>" />
     180                <%
    169181              }
    170182              %>
Note: See TracChangeset for help on using the changeset viewer.