Changeset 5069


Ignore:
Timestamp:
Aug 20, 2009, 10:53:16 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #108: Logging the change history of an item

  • Enabled logging for experiments
  • Added "Change history" tab to experiments, plugin configuration and protocol
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/data/ExperimentData.java

    r4889 r5069  
    4040public class ExperimentData
    4141  extends CommonData
    42   implements DiskConsumableData, RegisteredData
     42  implements DiskConsumableData, RegisteredData, LoggableData
    4343{
    4444
  • trunk/www/admin/pluginconfigurations/view_configuration.jsp

    r5040 r5069  
    4949  import="net.sf.basedb.util.ToStringComparator"
    5050  import="net.sf.basedb.clients.web.Base"
     51  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
    5152  import="net.sf.basedb.clients.web.PermissionUtil"
    5253  import="net.sf.basedb.clients.web.util.HTML"
     
    8283final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
    8384final int itemId = cc.getId();
     85final String tab = Values.getString(request.getParameter("tab"), "properties");
    8486final float scale = Base.getScale(sc);
    8587final DbControl dc = sc.newDbControl();
     
    170172      Main.openPopup('../../common/plugin/index.jsp?ID=<%=ID%>&cmd=ConfigurePlugin&pluginconfiguration_id=<%=itemId%>', 'ConfigurePlugin', 800, 600);
    171173    }
     174    function switchTab(tabControlId, tabId)
     175    {
     176      if (TabControl.isActive(tabControlId, tabId)) return;
     177      if (tabId == 'history' && tabId != '<%=tab%>')
     178      {
     179        location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=itemId%>&tab='+tabId;
     180      }
     181      else
     182      {
     183        TabControl.setActiveTab(tabControlId, tabId);
     184      }
     185    }
    172186    </script>
    173187  </base:head>
     
    179193    </p:path>
    180194   
    181     <t:tabcontrol id="main" active="properties">
     195    <t:tabcontrol id="main" active="<%=tab%>" switch="switchTab" remember="false">
    182196    <t:tab id="properties" title="Properties">
    183197    <tbl:toolbar
     
    523537        </div>
    524538      </t:tab>
    525      
     539      <t:tab id="history" title="Change history"
     540        tooltip="Displays a log of all modifications made to this item"
     541        visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>">
     542        <%
     543        if ("history".equals(tab))
     544        {
     545          %>
     546          <jsp:include page="../../common/history/frameset.jsp">
     547            <jsp:param name="source_type" value="<%=itemType.name()%>" />
     548            <jsp:param name="source_id" value="<%=itemId%>" />
     549            <jsp:param name="ID" value="<%=ID%>" />
     550          </jsp:include>
     551          <%
     552        }
     553        %>
     554      </t:tab>
    526555      </t:tabcontrol>
    527556
  • trunk/www/admin/protocols/view_protocol.jsp

    r5042 r5069  
    4949  import="net.sf.basedb.core.query.Hql"
    5050  import="net.sf.basedb.clients.web.Base"
     51  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
    5152  import="net.sf.basedb.clients.web.PermissionUtil"
    5253  import="net.sf.basedb.clients.web.util.HTML"
     
    7879final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
    7980final int itemId = cc.getId();
     81final String tab = Values.getString(request.getParameter("tab"), "properties");
    8082final float scale = Base.getScale(sc);
    8183final DbControl dc = sc.newDbControl();
     
    140142      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
    141143    }
     144    function switchTab(tabControlId, tabId)
     145    {
     146      if (TabControl.isActive(tabControlId, tabId)) return;
     147      if (tabId == 'history' && tabId != '<%=tab%>')
     148      {
     149        location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=itemId%>&tab='+tabId;
     150      }
     151      else
     152      {
     153        TabControl.setActiveTab(tabControlId, tabId);
     154      }
     155    }
    142156    </script>
    143157  </base:head>
     
    149163    </p:path>
    150164   
    151     <t:tabcontrol id="main" active="properties">
     165    <t:tabcontrol id="main" active="<%=tab%>" switch="switchTab" remember="false">
    152166    <t:tab id="properties" title="Properties">
    153167   
     
    455469      </div>
    456470    </t:tab>
    457      
     471    <t:tab id="history" title="Change history"
     472      tooltip="Displays a log of all modifications made to this item"
     473      visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>">
     474      <%
     475      if ("history".equals(tab))
     476      {
     477        %>
     478        <jsp:include page="../../common/history/frameset.jsp">
     479          <jsp:param name="source_type" value="<%=itemType.name()%>" />
     480          <jsp:param name="source_id" value="<%=itemId%>" />
     481          <jsp:param name="ID" value="<%=ID%>" />
     482        </jsp:include>
     483        <%
     484      }
     485      %>
     486    </t:tab>
    458487    </t:tabcontrol>
    459488
  • trunk/www/views/experiments/bioassaysets/list_bioassaysets.jsp

    r4889 r5069  
    4949  import="net.sf.basedb.util.Tree"
    5050  import="net.sf.basedb.clients.web.Base"
     51  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
    5152  import="net.sf.basedb.clients.web.ModeInfo"
    5253  import="net.sf.basedb.clients.web.util.HTML"
     
    205206    function switchTab(tabControlId, tabId)
    206207    {
    207       if (tabId == 'properties' || tabId == 'overview')
     208      if (tabId == 'properties' || tabId == 'overview' || tabId == 'history')
    208209      {
    209210        location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=experimentId%>&tab='+tabId;
     
    242243    <t:tab id="overview" title="Overview"
    243244      tooltip="Display a tree overview of related items" />
     245    <t:tab id="history" title="Change history"
     246      tooltip="Displays a log of all modifications made to this item"
     247      visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>" />
    244248    </t:tabcontrol>
    245249
  • trunk/www/views/experiments/view_experiment.jsp

    r4889 r5069  
    5454  import="net.sf.basedb.clients.web.Base"
    5555  import="net.sf.basedb.clients.web.PermissionUtil"
     56  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
    5657  import="net.sf.basedb.clients.web.util.HTML"
    5758  import="net.sf.basedb.util.Values"
     
    166167    {
    167168      if (TabControl.isActive(tabControlId, tabId)) return;
    168       if (tabId == 'overview' && tabId != '<%=tab%>')
     169      if ((tabId == 'overview' || tabId == 'history') && tabId != '<%=tab%>')
    169170      {
    170171        location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=itemId%>&tab='+tabId;
     
    802803        %>
    803804      </t:tab>     
     805      <t:tab id="history" title="Change history"
     806        tooltip="Displays a log of all modifications made to this item"
     807        visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>">
     808        <%
     809        if ("history".equals(tab))
     810        {
     811          %>
     812          <jsp:include page="../../common/history/frameset.jsp">
     813            <jsp:param name="source_type" value="<%=itemType.name()%>" />
     814            <jsp:param name="source_id" value="<%=itemId%>" />
     815            <jsp:param name="ID" value="<%=ID%>" />
     816          </jsp:include>
     817          <%
     818        }
     819        %>
     820      </t:tab>
    804821      </t:tabcontrol>
    805822
Note: See TracChangeset for help on using the changeset viewer.