Changeset 5983


Ignore:
Timestamp:
Feb 23, 2012, 3:45:07 PM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #1605: Inherit annotations from a child path

Added support for this in the core layer and web gui. It has been implemented for biomaterial and physical bioassay items so far. Need to add functionality to the 'Item overview' to follow the path when going up.

Location:
trunk
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/src/docbook/appendix/incompatible.xml

    r5969 r5983  
    7575    </para>
    7676
     77    <bridgehead>Annotations can be inherited/pushed from child to parent item</bridgehead>
     78    <para>
     79      A new feature has been implemented that allows an item to "push" annotations
     80      up to it's parent in addition to the normal "inherit to child" method.
     81      This has been implemented as a change in the <methodname>getAnnotatableParents()</methodname>
     82      method defined by the <interfacename docapi="net.sf.basedb.core">Annotatable</interfacename>
     83      interface. This may cause unexpected issues with code that is not prepared to handle
     84      this situation. Particulary, infinite loops must be avoided when traversing the "parent"
     85      tree of an item (but this should already be in place since it can already happen due to
     86      mistakes when creating items). See <ulink url="http://base.thep.lu.se/ticket/1605">ticket 1605</ulink>
     87      for more information.
     88    </para>
     89
    7790  </sect1>
    7891 
  • trunk/doc/test/roles/index.html

    r5964 r5983  
    573573    </tr>
    574574    <tr>
     575      <td>RIN [A]</td>
     576      <td>Float</td>
     577      <td>-</td>
     578      <td>text box</td>
     579      <td>-</td>
     580      <td>Extract</td>
     581    </tr>
     582    <tr>
    575583      <td>Dye swap [A]</td>
    576584      <td>Boolean</td>
     
    587595      <td>-</td>
    588596      <td>Derived bioassay</td>
     597    </tr>
     598    </table>
     599    <p>
     600  </li>
     601 
     602  <li>
     603    Create item subtypes:
     604    <table class="listing" cellspacing="0" cellpadding="2" border="0">
     605    <tr>
     606      <th>Name</th>
     607      <th>Item type</th>
     608      <th>Push annotations to parent</th>
     609    </tr>
     610    <tr>
     611      <td>Quality control</td>
     612      <td>Extract</td>
     613      <td>Yes</td>
    589614    </tr>
    590615    </table>
     
    15481573      </tr>
    15491574      </table>
    1550       The files listed for biosource, samples and derived bioassays also contain annotations
     1575      The files listed for biosource, samples, extracts, and derived bioassays also contain annotations
    15511576      for the items and these files should also be used with the annotation importer.
    15521577      The procedure is the same as for batch importers except that only <code>\Name\</code>
     
    16371662      <th>Name</th>
    16381663      <th>Protocol</th>
    1639       <th>Sample</th>
     1664      <th>Parent</th>
    16401665      <th>Bioplate [well]</th>
     1666      <th>Annotations</th>
    16411667    </tr>
    16421668    <tr>
     
    16451671      <td>Sample A.00h</td>
    16461672      <td>Bioplate A [B1]</td>
     1673      <td>-</td>
    16471674    </tr>
    16481675    <tr>
     
    16511678      <td>Sample A.24h</td>
    16521679      <td>Bioplate A [B2]</td>
     1680      <td>-</td>
    16531681    </tr>
    16541682    <tr>
     
    16571685      <td>Sample A.ref</td>
    16581686      <td>Bioplate A [B3]</td>
     1687      <td>-</td>
     1688    </tr>
     1689    <tr>
     1690      <td>Extract A.00h.qc</td>
     1691      <td>-</td>
     1692      <td>Extract A.00h</td>
     1693      <td>-</td>
     1694      <td>
     1695        <table border="0" cellspacing="0" cellpadding="2">
     1696        <tr>
     1697          <td><i>RIN:</i></td>
     1698          <td>8.1</td>
     1699        </tr>
     1700        </table>
     1701      </td>
     1702    </tr>
     1703    <tr>
     1704      <td>Extract A.24h.qc</td>
     1705      <td>-</td>
     1706      <td>Extract A.24h</td>
     1707      <td>-</td>
     1708      <td>
     1709        <table border="0" cellspacing="0" cellpadding="2">
     1710        <tr>
     1711          <td><i>RIN:</i></td>
     1712          <td>8.5</td>
     1713        </tr>
     1714        </table>
     1715      </td>
     1716    </tr>
     1717    <tr>
     1718      <td>Extract A.ref.qc</td>
     1719      <td>-</td>
     1720      <td>Extract A.ref</td>
     1721      <td>-</td>
     1722      <td>
     1723        <table border="0" cellspacing="0" cellpadding="2">
     1724        <tr>
     1725          <td><i>RIN:</i></td>
     1726          <td>9.2</td>
     1727        </tr>
     1728        </table>
     1729      </td>
    16591730    </tr>
    16601731    </table>
     
    20392110      <td>Raw bioassay A.00h,<br>Raw bioassay A.24h,<br>Raw bioassay A.00h (dye-swap),<br>
    20402111        Raw bioassay A.24h (dye-swap)</td>
    2041       <td>Drug resistance, Time, Dye swap, PMT gain</td>
     2112      <td>Drug resistance, Time, RIN, Dye swap, PMT gain</td>
    20422113    </tr>
    20432114    <tr>
     
    20452116      <td>Affymetrix</td>
    20462117      <td>Affymetrix raw A.1,<br>Affymetrix raw A.2,<br>Affymetrix raw A.3</td>
    2047       <td>Drug resistance, Time, PMT gain</td>
     2118      <td>Drug resistance, Time, RIN, PMT gain</td>
    20482119    </tr>
    20492120    <tr>
     
    20512122      <td>Cufflinks</td>
    20522123      <td>SeqRaw A.00h,<br>SeqRaw A.24h</td>
    2053       <td>Drug resistance, Time</td>
     2124      <td>Drug resistance, Time, RIN</td>
    20542125    </tr>
    20552126    </table>
     
    20582129 
    20592130  <li><a name="inheritannotations"></a>
    2060     Inherit the annotations from the scans, samples and biosource for each raw bioassay.
     2131    Inherit the annotations from the scans, extracts, samples and biosource for each raw bioassay.
    20612132    Use the <i>auto-inherit</i> function that exists on the experiment properties
    20622133    tab. Make sure that all experimental factors are selected by the check boxes,
  • trunk/src/core/net/sf/basedb/core/Annotatable.java

    r4889 r5983  
    7575    user has read permission to. If the item doesn't have any annotatable
    7676    parents, it may return null or an empty set. The method should only return
    77     the immediate parent(s), not parents to parents, etc.
     77    the immediate parent(s), not parents to parents, etc.
     78    As of BASE 3.1 this method may also return child items if
     79    the child item is a {@link Subtypable} item that has a subtype
     80    with the {@link ItemSubtype#getPushAnnotations()} flag set.
    7881
    7982    @return A set containing annotatable items, or null
  • trunk/src/core/net/sf/basedb/core/BioMaterial.java

    r5663 r5983  
    2424package net.sf.basedb.core;
    2525
     26import java.util.HashSet;
     27import java.util.Set;
     28
    2629import net.sf.basedb.core.Transactional.Action;
    2730import net.sf.basedb.core.data.BioMaterialData;
     31import net.sf.basedb.core.query.Expressions;
    2832import net.sf.basedb.core.query.Hql;
    2933import net.sf.basedb.core.query.Restrictions;
     
    97101      getData().setItemSubtype(null);
    98102    }
     103  }
     104  // -------------------------------------------
     105  /*
     106    From the Annotatable interface
     107    -------------------------------------------
     108  */
     109  /**
     110    Get all child biomaterial items with a subtype that
     111    has the {@link ItemSubtype#getPushAnnotations()} flag set.
     112    @since 3.1
     113  */
     114  public Set<Annotatable> getAnnotatableParents()
     115    throws BaseException
     116  {
     117    Set<Annotatable> annotatable = new HashSet<Annotatable>();
     118   
     119    SpecialQuery<BioMaterialEventSource> childQuery = getChildCreationEvents();
     120    childQuery.join(Hql.innerJoin(null, "event", "evt", true));
     121   
     122    // BioMaterial
     123    childQuery.join(Hql.leftJoin("evt", "bioMaterial", "bm", null, true));
     124    childQuery.join(Hql.leftJoin("bm", "itemSubtype", "sub1", null, false));
     125   
     126    // Physical bioassays
     127    childQuery.join(Hql.leftJoin("evt", "physicalBioAssay", "pba", null, true));
     128    childQuery.join(Hql.leftJoin("pba", "itemSubtype", "sub2", null, false));
     129   
     130    childQuery.restrict(Restrictions.or(
     131      Restrictions.eq(Hql.property("sub1", "pushAnnotations"), Expressions.bool(true)),
     132      Restrictions.eq(Hql.property("sub2", "pushAnnotations"), Expressions.bool(true))
     133    ));
     134   
     135    for (BioMaterialEventSource src : childQuery.list(getDbControl()))
     136    {
     137      BioMaterialEvent event = src.getEvent();
     138      BioMaterialEvent.Type eventType = event.getEventType();
     139      try
     140      {
     141        if (eventType == BioMaterialEvent.Type.CREATION)
     142        {
     143          BioMaterial bm = event.getBioMaterial();
     144          if (bm != null) annotatable.add(bm);
     145        }
     146        else if (eventType == BioMaterialEvent.Type.BIOASSAY)
     147        {
     148          PhysicalBioAssay pba = src.getEvent().getPhysicalBioAssay();
     149          if (pba != null) annotatable.add(pba);
     150        }
     151      }
     152      catch (PermissionDeniedException ex)
     153      {}
     154    }
     155   
     156    return annotatable;
    99157  }
    100158  // -------------------------------------------
  • trunk/src/core/net/sf/basedb/core/BioSource.java

    r5663 r5983  
    113113  {
    114114    return TYPE;
    115   }
    116   // -------------------------------------------
    117   /**
    118     Always null.
    119   */
    120   public Set<Annotatable> getAnnotatableParents()
    121     throws BaseException
    122   {
    123     return null;
    124115  }
    125116  // -------------------------------------------
  • trunk/src/core/net/sf/basedb/core/Extract.java

    r5695 r5983  
    149149  */
    150150  @Override
     151  @SupportsPushAnnotations
    151152  @SubtypableRelatedItems({Item.PROTOCOL, Item.HARDWARE, Item.TAG, Item.SAMPLE, Item.EXTRACT})
    152153  public ItemSubtype getItemSubtype()
  • trunk/src/core/net/sf/basedb/core/Install.java

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

    r5807 r5983  
    109109   
    110110    return related;
    111    
     111  }
     112 
     113  /**
     114    Check if the given item type has support for pushing annotations to
     115    the parent item or not.
     116    @since 3.1
     117  */
     118  public static boolean supportsPushAnnotations(Item mainItem)
     119  {
     120    if (!Subtypable.class.isAssignableFrom(mainItem.getItemClass())) return false;
     121
     122    Method getItemSubtype = ClassUtil.findMethod(mainItem.getItemClass(), "getItemSubtype");
     123    return getItemSubtype == null ? false : getItemSubtype.isAnnotationPresent(SupportsPushAnnotations.class);
    112124  }
    113125 
     
    486498
    487499  /**
     500    If this flag is set, the annotations on items of this subtype can be
     501    pushed to the parent item. Eg. the {@link Annotatable#getAnnotatableParents()}
     502    for an item may return items that are actually child items if they have a subtype with
     503    this flag set. For this feature to work it must also be supported by the
     504    actual parent item implementation of {@link Annotatable#getAnnotatableParents()}
     505    which is indicated by annotating the {@link Subtypable#getItemSubtype()} method
     506    with {@link SupportsPushAnnotations}.
     507   
     508    @return FALSE to use normal inheritance, TRUE to also inherit to parent items
     509    @since 3.1
     510  */
     511  public boolean getPushAnnotations()
     512  {
     513    return getData().getPushAnnotations();
     514  }
     515 
     516  /**
     517    @see #getPushAnnotations()
     518    @since 3.1
     519  */
     520  public void setPushAnnotations(boolean pushAnnotations)
     521  {
     522    checkPermission(Permission.WRITE);
     523    getData().setPushAnnotations(pushAnnotations);
     524  }
     525   
     526 
     527  /**
    488528    Get a related subtype of another item type. For a given main type of
    489529    items use {@link #getRelatedItems(Item)} to find out which other
  • trunk/src/core/net/sf/basedb/core/MeasuredBioMaterial.java

    r5663 r5983  
    2525
    2626import java.util.Date;
    27 import java.util.HashSet;
    2827import java.util.Set;
    2928
     
    174173    -------------------------------------------
    175174  */
    176   /**
     175  /** 
    177176    Get the biosource or pooled samples.
    178177  */
     
    180179    throws BaseException
    181180  {
    182     Set<Annotatable> annotatable = new HashSet<Annotatable>();
     181    Set<Annotatable> annotatable = super.getAnnotatableParents();
    183182    try
    184183    {
  • trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java

    r5749 r5983  
    183183  */
    184184  @Override
     185  @SupportsPushAnnotations
    185186  @SubtypableRelatedItems({Item.HARDWARE, Item.PROTOCOL, Item.EXTRACT})
    186187  public ItemSubtype getItemSubtype()
  • trunk/src/core/net/sf/basedb/core/Sample.java

    r5688 r5983  
    136136  */
    137137  @Override
     138  @SupportsPushAnnotations
    138139  @SubtypableRelatedItems({Item.PROTOCOL, Item.HARDWARE, Item.BIOSOURCE, Item.SAMPLE})
    139140  public ItemSubtype getItemSubtype()
  • trunk/src/core/net/sf/basedb/core/Update.java

    r5966 r5983  
    120120    </td>
    121121  </tr>
     122  <tr>
     123    <td>105</td>
     124    <td>
     125      Added {@link ItemSubtypeData#getPushAnnotations()}. All existing subtypes
     126      are set to 'false'.
     127    </td>
     128  </tr>
    122129
    123130  </table>
     
    197204      }
    198205     
    199       if (schemaVersion < 104)
    200       {
    201         if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 104...");
    202         schemaVersion = setSchemaVersionInTransaction(session, 104);
     206      if (schemaVersion < 105)
     207      {
     208        if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 105...");
     209        schemaVersion = setSchemaVersionInTransaction(session, 105);
    203210        progress_current += progress_step;
    204211      }
  • trunk/src/core/net/sf/basedb/core/data/ItemSubtypeData.java

    r5818 r5983  
    136136  }
    137137
     138  private boolean pushAnnotations;
     139  /**
     140    If this flag is set, the annotations on items of this subtype should be
     141    enabled for pushing to the parent item.
     142   
     143    NOTE! This property is mapped in hibernate-properties-ItemSubtypeData.xml since
     144    'default' is not supported by XDoclet
     145    //hibernate.property type="boolean"
     146    //hibernate.column name="`push_annotations`" not-null="true" default="false"
     147
     148    @since 3.1
     149  */
     150  public boolean getPushAnnotations()
     151  {
     152    return pushAnnotations;
     153  }
     154  public void setPushAnnotations(boolean pushAnnotations)
     155  {
     156    this.pushAnnotations = pushAnnotations;
     157  }
     158 
    138159  private Map<Integer, ItemSubtypeData> relatedSubtypes;
    139160  /**
  • trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java

    r5886 r5983  
    116116     
    117117      dc = TestUtil.getDbControl();
     118      // Item subtype
     119      ItemSubtype qualityControl = createItemSubtype(dc, "Quality control", Item.EXTRACT, true);
     120     
    118121      // Annotation types
    119122      AnnotationType drugResistance = createAnnotationType(dc, "Drug resistance",
     
    128131          Type.INT, hoursUnit, null,
    129132          new Item[] { Item.SAMPLE }
     133        );
     134     
     135      AnnotationType rin = createAnnotationType(dc, "RIN",
     136          Type.FLOAT, null, null,
     137          new Item[] { Item.EXTRACT }
    130138        );
    131139     
     
    328336
    329337  /**
     338    Create an item subtype.
     339  */
     340  public static ItemSubtype createItemSubtype(DbControl dc, String name, Item itemType,
     341      boolean pushAnnotations, ItemSubtype... related)
     342  {
     343    TestUtil.write("--Creating item subtype: " + name + "\n");
     344    ItemSubtype subtype = ItemSubtype.getNew(dc, itemType);
     345    subtype.setName(name);
     346    subtype.setPushAnnotations(pushAnnotations);
     347    if (related != null)
     348    {
     349      for (ItemSubtype r : related)
     350      {
     351        subtype.setRelatedSubtype(r);
     352      }
     353    }
     354    dc.saveItem(subtype);
     355    return subtype;
     356  }
     357 
     358  /**
    330359    Create a protocol.
    331360  */
  • trunk/src/test/net/sf/basedb/test/roles/UserTest.java

    r5937 r5983  
    174174      Sample sRef = null;
    175175     
     176      Extract e1Qc = null;
     177      Extract e2Qc = null;
     178      Extract eRefQc = null;
     179     
    176180      DerivedBioAssay sc1 = null;
    177181      DerivedBioAssay sc2 = null;
     
    207211        e1.setBioWell(bioPlate.getBioWell(1, 0));
    208212        Extract e2 = createExtract(dc, "Extract A.24h", s2);
    209         e2.setBioWell(bioPlate.getBioWell(1, 1));       
     213        e2.setBioWell(bioPlate.getBioWell(1, 1));
    210214        Extract eRef = createExtract(dc, "Extract A.ref", sRef);
    211215        eRef.setBioWell(bioPlate.getBioWell(1, 2));
     216       
     217        // Quality control
     218        ItemSubtype qualityControl = Util.findItemSubtype(dc, Item.EXTRACT, "Quality control");
     219        AnnotationType rin = Util.findAnnotationType(dc, "RIN", Item.EXTRACT);
     220        e1Qc = createAliquot(dc, "Extract A.00h.qc", e1, qualityControl, null);
     221        e2Qc = createAliquot(dc, "Extract A.24h.qc", e2, qualityControl, null);
     222        eRefQc = createAliquot(dc, "Extract A.ref.qc", eRef, qualityControl, null);
     223        Util.setAnnotation(e1Qc, rin, 8.1f, null);
     224        Util.setAnnotation(e2Qc, rin, 8.5f, null);
     225        Util.setAnnotation(eRefQc, rin, 9.2f, null);
    212226       
    213227        Tag cy3 = Util.findTag(dc, "cy3");     
     
    309323       
    310324        importExtracts(extractBatchImporter, batchImportFile_Extract);
     325        importAnnotations(annotationImporter, batchImportFile_Extract, Item.EXTRACT, getExtractColumnHeaders(), "\\t");
    311326       
    312327        // Hybridizations, etc.
     
    319334        s2 = Util.findSample(dc, "Sample A.24h");
    320335        sRef = Util.findSample(dc, "Sample A.ref");
     336       
     337        e1Qc = Util.findExtract(dc, "Extract A.00h.qc");
     338        e2Qc = Util.findExtract(dc, "Extract A.24h.qc");
     339        eRefQc = Util.findExtract(dc, "Extract A.qc");
    321340       
    322341        sc1 = Util.findScan(dc, "Scan A.00h");
     
    340359      seqRaw2 = Util.findRawBioAssay(dc, "SeqRaw A.24h");
    341360     
    342       inheritAnnotations(dc, rba1, s1, bioSource, sc1);
    343       inheritAnnotations(dc, rba2, s2, bioSource, sc2);
    344       inheritAnnotations(dc, rba1DyeSwap, s1, bioSource, sc1DyeSwap);
    345       inheritAnnotations(dc, rba2DyeSwap, s2, bioSource, sc2DyeSwap);
     361      inheritAnnotations(dc, rba1, s1, e1Qc, bioSource, sc1);
     362      inheritAnnotations(dc, rba2, s2, e2Qc, bioSource, sc2);
     363      inheritAnnotations(dc, rba1DyeSwap, s1, e1Qc, bioSource, sc1DyeSwap);
     364      inheritAnnotations(dc, rba2DyeSwap, s2, e2Qc, bioSource, sc2DyeSwap);
    346365     
    347366      // Affymetrix
    348       inheritAnnotations(dc, affyRaw1, s1, bioSource, affyScan1);
    349       inheritAnnotations(dc, affyRaw2, s2, bioSource, affyScan2);
    350       inheritAnnotations(dc, affyRaw3, sRef, affyScan3);
     367      inheritAnnotations(dc, affyRaw1, s1, e1Qc, bioSource, affyScan1);
     368      inheritAnnotations(dc, affyRaw2, s2, e2Qc, bioSource, affyScan2);
     369      inheritAnnotations(dc, affyRaw3, sRef, eRefQc, affyScan3);
    351370     
    352371      // Sequence
    353       inheritAnnotations(dc, seqRaw1, s1, bioSource);
    354       inheritAnnotations(dc, seqRaw2, s2, bioSource);
     372      inheritAnnotations(dc, seqRaw1, s1, e1Qc, bioSource);
     373      inheritAnnotations(dc, seqRaw2, s2, e2Qc, bioSource);
    355374     
    356375      PluginConfiguration rawDataImporter = Util.findPluginConfiguration(dc, "Raw data for project A");
     
    452471  }
    453472
     473  /**
     474    Create a child extract.
     475  */
     476  public static Extract createAliquot(DbControl dc, String name, Extract parent, ItemSubtype subtype, Protocol protocol)
     477  {
     478    TestUtil.write("--Creating aliquot: " + name + "\n");
     479    Extract extract = Extract.getNew(dc);
     480    extract.setName(name);
     481    extract.setItemSubtype(subtype);
     482    extract.setOriginalQuantity(2.0f);
     483    extract.getCreationEvent().setSource(parent).setUsedQuantity(2.0f);
     484    extract.getCreationEvent().setProtocol(protocol);
     485    dc.saveItem(extract);
     486    return extract;
     487  }
     488 
    454489  /**
    455490    Create a labeled extract.
     
    10001035  }
    10011036 
     1037  private static String[] getExtractColumnHeaders()
     1038  {
     1039    return new String[] {"Name", "Subtype", "Tag", "Original quantity", "Description", "External id", "Protocol", "Created", "Parent type", "Parent", "Parent used quantity", "Bioplate", "Row", "Column", "RIN"};
     1040  }
     1041
    10021042  private static String[] getDerivedBioAssayColumnHeaders()
    10031043  {
  • trunk/src/test/net/sf/basedb/test/roles/Util.java

    r5886 r5983  
    3737import net.sf.basedb.core.DerivedBioAssay;
    3838import net.sf.basedb.core.Experiment;
     39import net.sf.basedb.core.Extract;
    3940import net.sf.basedb.core.Formula;
    4041import net.sf.basedb.core.Group;
     
    4344import net.sf.basedb.core.Item;
    4445import net.sf.basedb.core.ItemQuery;
     46import net.sf.basedb.core.ItemSubtype;
    4547import net.sf.basedb.core.Plate;
    4648import net.sf.basedb.core.PlateGeometry;
     
    136138
    137139  /**
     140    Find the item subtype with a matching name.
     141  */
     142  public static ItemSubtype findItemSubtype(DbControl dc, Item itemType, String name)
     143  {
     144    ItemQuery<ItemSubtype> query = ItemSubtype.getQuery(itemType);
     145    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name)));
     146    return query.list(dc).get(0);
     147  }
     148 
     149  /**
    138150    Find the protocol with a matching name.
    139151  */
     
    333345 
    334346  /**
     347    Returns the first extract that was found with a certain name
     348   */
     349  public static Extract findExtract(DbControl dc, String name)
     350  {
     351    ItemQuery<Extract> query = Extract.getQuery();
     352    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name)));
     353    return query.list(dc).get(0);
     354  }
     355 
     356  /**
    335357    Returns the first biosource that was found with a certain name
    336358   */
  • trunk/www/admin/itemsubtypes/edit_subtype.jsp

    r5949 r5983  
    171171      info.related = '<%=tmp%>';
    172172      info.fileStoreEnabled = <%=FileStoreEnabled.class.isAssignableFrom(item.getItemClass()) ? "true" : "false"%>;
     173      info.supportsPushAnnotations = <%=ItemSubtype.supportsPushAnnotations(item) ? "true" : "false" %>;
    173174      itemInfo['<%=item.name()%>'] = info;
    174175      <%
     
    219220        document.getElementById('filetypes.disabled').innerHTML = '<div class="messagecontainer error">The selected main item type (' + mainType + ') has not support for attaching data files.</div>';
    220221      }
     222      Main.showHide('section.pushAnnotations', itemInfo[mainType].supportsPushAnnotations);
    221223    }
    222224   
     
    365367          %>
    366368        </td>
     369        <td></td>
     370      </tr>
     371      <tr id="section.pushAnnotations">
     372        <th></th>
     373        <td><input type="checkbox" name="pushAnnotations"
     374          id="pushAnnotations" value="1"
     375          <%=(subtype != null && subtype.getPushAnnotations()) ||
     376            (subtype == null && Values.getBoolean(cc.getPropertyValue("pushAnnotations"))) ? "checked" : ""%>
     377          ><label for="pushAnnotations">Push annotations to parent</label></td>
    367378        <td></td>
    368379      </tr>
  • trunk/www/admin/itemsubtypes/index.jsp

    r5713 r5983  
    157157      subtype.setName(Values.getStringOrNull(request.getParameter("name")));
    158158      subtype.setDescription(Values.getStringOrNull(request.getParameter("description")));
     159      subtype.setPushAnnotations(Values.getBoolean(request.getParameter("pushAnnotations")));
    159160     
    160161      for (Item related : ItemSubtype.getRelatedItems(subtype.getMainItemType()))
  • trunk/www/admin/itemsubtypes/list_subtypes.jsp

    r5954 r5983  
    259259        title="Main item type"
    260260        enumeration="<%=items%>"
     261        sortable="true"
     262        filterable="true"
     263        exportable="true"
     264      />
     265      <tbl:columndef
     266        id="pushAnnotations"
     267        property="pushAnnotations"
     268        datatype="boolean"
     269        title="Push annotations to parent"
    261270        sortable="true"
    262271        filterable="true"
     
    456465                <tbl:cell column="systemId"><%=Values.getString(item.getSystemId())%></tbl:cell>
    457466                <tbl:cell column="itemType"><%=item.getMainItemType()%></tbl:cell>
     467                <tbl:cell column="pushAnnotations"><%=item.getPushAnnotations() %></tbl:cell>
    458468                <tbl:cell column="relatedTypes">
    459469                  <%
  • trunk/www/admin/itemsubtypes/view_subtype.jsp

    r5946 r5983  
    218218      </tr>
    219219      <tr>
     220        <th>Push annotations to parent</th>
     221        <td><%=subtype.getPushAnnotations()%></td>
     222      </tr>
     223      <tr>
    220224        <th>Permissions</th>
    221225        <td><%=PermissionUtil.getFullPermissionNames(subtype)%></td>
Note: See TracChangeset for help on using the changeset viewer.