Changeset 5966


Ignore:
Timestamp:
Feb 16, 2012, 9:27:56 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1644: Make experiments annotable

Location:
trunk
Files:
11 edited

Legend:

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

    r5689 r5966  
    291291  }
    292292  /**
    293     Get the parent bioassay set (if any).
     293    Get the parent bioassay set (if any) and the experiment.
    294294    @since 2.2
    295295  */
     
    298298  {
    299299    Set<Annotatable> annotatable = new HashSet<Annotatable>();
     300    annotatable.add(getExperiment());
    300301    Transformation t = getTransformation();
    301302    if (t != null)
  • trunk/src/core/net/sf/basedb/core/Experiment.java

    r5878 r5966  
    5252*/
    5353public class Experiment
    54   extends CommonItem<ExperimentData>
     54  extends AnnotatedItem<ExperimentData>
    5555  implements DiskConsumable, Transactional, ToTransferable<ExperimentInfo>, Registered
    5656{
     
    238238  {
    239239    return DateUtil.copy(getData().getEntryDate());
     240  }
     241  // -------------------------------------------
     242  /*
     243    From the Annotatable interface
     244    --------------------------------
     245  */
     246  /**
     247    Always null.
     248  */
     249  public Set<Annotatable> getAnnotatableParents()
     250    throws BaseException
     251  {
     252    return null;
    240253  }
    241254  // -------------------------------------------
  • trunk/src/core/net/sf/basedb/core/Install.java

    r5877 r5966  
    118118    method.
    119119  */
    120   public static final int NEW_SCHEMA_VERSION = Integer.valueOf(103).intValue();
     120  public static final int NEW_SCHEMA_VERSION = Integer.valueOf(104).intValue();
    121121 
    122122  public static synchronized int createTables(SchemaGenerator.Mode mode, ProgressReporter progress,
  • trunk/src/core/net/sf/basedb/core/Update.java

    r5876 r5966  
    4242
    4343
     44import net.sf.basedb.core.data.AnnotatableData;
    4445import net.sf.basedb.core.data.AnnotationSetData;
    4546import net.sf.basedb.core.data.AnyToAnyData;
     
    4950import net.sf.basedb.core.data.DataFileTypeData;
    5051import net.sf.basedb.core.data.DerivedBioAssayData;
     52import net.sf.basedb.core.data.ExperimentData;
    5153import net.sf.basedb.core.data.FileData;
    5254import net.sf.basedb.core.data.FileSetData;
     
    111113    </td>
    112114  </tr>
     115  <tr>
     116    <td>104</td>
     117    <td>
     118      Make {@link ExperimentData}  {@link AnnotatableData}. No
     119      special update is required.
     120    </td>
     121  </tr>
    113122
    114123  </table>
     
    188197      }
    189198     
    190       if (schemaVersion < 103)
    191       {
    192         if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 103...");
    193         schemaVersion = setSchemaVersionInTransaction(session, 103);
     199      if (schemaVersion < 104)
     200      {
     201        if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 104...");
     202        schemaVersion = setSchemaVersionInTransaction(session, 104);
    194203        progress_current += progress_step;
    195204      }
  • trunk/src/core/net/sf/basedb/core/data/ExperimentData.java

    r5818 r5966  
    3939*/
    4040public class ExperimentData
    41   extends CommonData
     41  extends AnnotatedData
    4242  implements DiskConsumableData, RegisteredData, LoggableData
    4343{
  • trunk/src/core/net/sf/basedb/util/overview/loader/ExperimentLoader.java

    r5500 r5966  
    9292    <ul>
    9393    <li>Experimental factors: {@link ExperimentalFactorLoader#createPropertyNode(DbControl, OverviewContext, Node)}
     94    <li>Annotations: {@link AnnotationLoader#createPropertyNode(DbControl, OverviewContext, Node)}
    9495    </ul>
    9596  */
     
    9899  {
    99100    getNodeLoader(context, "EXPERIMENTAL.FACTOR").createPropertyNode(dc, context, experimentNode);
     101    getNodeLoader(context, Item.ANNOTATION).createPropertyNode(dc, context, experimentNode);
    100102    getNodeLoader(context, Item.ANYTOANY).createPropertyNode(dc, context, experimentNode);
    101103  }
  • trunk/www/views/experiments/bioassaysets/list_bioassaysets.jsp

    r5952 r5966  
    206206    function switchTab(tabControlId, tabId)
    207207    {
    208       if (tabId == 'properties' || tabId == 'overview' || tabId == 'history')
     208      if (tabId == 'properties' || tabId == 'overview' || tabId == 'history' || tabId == 'annotations')
    209209      {
    210210        location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=experimentId%>&tab='+tabId;
     
    237237      active="bioassaysets" switch="switchTab">
    238238    <t:tab id="properties" title="Properties" />
     239    <t:tab id="annotations" title="Annotations"
     240      tooltip="View annotation values" />
    239241   
    240242    <t:tab id="bioassaysets" title="Bioassay sets">
  • trunk/www/views/experiments/edit_experiment.jsp

    r5949 r5966  
    7171final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
    7272final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
     73final String tabId = Values.getString(request.getParameter("tab"), null);
    7374final int itemId = cc.getId();
    7475final String ID = sc.getId();
     
    150151  %>
    151152  <base:page type="popup" title="<%=title%>">
    152   <base:head scripts="tabcontrol.js,linkitems.js" styles="tabcontrol.css">
     153  <base:head scripts="tabcontrol.js,linkitems.js,annotations.js" styles="tabcontrol.css">
    153154    <ext:scripts context="<%=jspContext%>" />
    154155    <ext:stylesheets context="<%=jspContext%>" />
     
    188189      if (TabControl.validateActiveTab('settings'))
    189190      {
     191        if (annotationsLoaded)
     192        {
     193          Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
     194        }
     195
    190196        frm.addedRawBioAssays.value = Link.getActionIds(1, 'R').join(',');
    191197        frm.removedRawBioAssays.value = Link.getActionIds(-1, 'R').join(',');
     
    198204    }
    199205   
     206    var annotationsLoaded = false;
     207    function switchTab(tabControlId, tabId)
     208    {
     209      var frm = document.forms['experiment'];
     210      if (TabControl.setActiveTab(tabControlId, tabId))
     211      {
     212        if (tabId == 'annotations' && (!annotationsLoaded))
     213        {
     214          Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=experiment == null ? 0 : experiment.getId()%>);
     215          annotationsLoaded = true;
     216        }
     217      }
     218    }
     219
    200220    function addRawBioAssaysOnClick()
    201221    {
     
    339359    <t:tabcontrol id="settings"
    340360      subclass="content dialogtabcontrol"
    341       position="bottom" remember="<%=experiment != null%>"
     361      position="bottom" remember="<%=tabId == null && experiment != null%>"
     362      switch="switchTab"
    342363      extensions="<%=invoker%>">
    343364    <t:tab id="info" title="Experiment" validate="validateExperiment()" helpid="experiment.edit">
     
    630651      </table>
    631652      </t:tab>
     653     
     654      <t:tab id="annotations" title="Annotations" helpid="annotations.edit"><iframe
     655        name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
     656        style="width: 100%; height: 100%;"></iframe></t:tab>
    632657
    633658    </t:tabcontrol>
  • trunk/www/views/experiments/index.jsp

    r5897 r5966  
    220220      }
    221221     
     222      // Annotations tab
     223      Base.updateAnnotations(dc, experiment, experiment, request);
     224
    222225      // OnSave extensions
    223226      invoker.render(OnSaveRenderer.ON_SAVE);
  • trunk/www/views/experiments/reporters/list_reporters.jsp

    r5952 r5966  
    157157    function switchTab(tabControlId, tabId)
    158158    {
    159       if (tabId == 'properties' || tabId == 'overview' || tabId == 'history')
     159      if (tabId == 'properties' || tabId == 'overview' || tabId == 'history' || tabId == 'annotations')
    160160      {
    161161        location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=experimentId%>&tab='+tabId;
     
    202202      active="clonedreporters" switch="switchTab">
    203203    <t:tab id="properties" title="Properties" />
     204    <t:tab id="annotations" title="Annotations"
     205      tooltip="View annotation values" />
    204206    <t:tab id="bioassaysets" title="Bioassay sets" />
    205207
  • trunk/www/views/experiments/view_experiment.jsp

    r5958 r5966  
    807807    </script>
    808808      </t:tab>
     809      <t:tab id="annotations" title="Annotations"
     810        tooltip="View annotation values" clazz="white">
     811        <jsp:include page="../../common/annotations/list_annotations.jsp">
     812          <jsp:param name="item_type" value="<%=itemType.name()%>" />
     813          <jsp:param name="item_id" value="<%=itemId%>" />
     814          <jsp:param name="ID" value="<%=ID%>" />
     815        </jsp:include>
     816      </t:tab>
    809817     
    810818      <t:tab id="bioassaysets" title="Bioassay sets" />
Note: See TracChangeset for help on using the changeset viewer.