Changeset 6214


Ignore:
Timestamp:
Dec 13, 2012, 11:23:32 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

Merged patch release 3.2.1 to the trunk.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/credits.txt

    r6124 r6214  
    11$Id$
    22
    3 The current BASE team is (at BASE 3.2 release)
     3The current BASE team is (at BASE 3.2.1 release)
    44{{{
    55Jari Häkkinen
     6Olle Månsson
    67Nicklas Nordborg
    78Johan Vallon-Christersson
  • trunk/src/core/common-queries.xml

    r6124 r6214  
    34233423    </description>
    34243424  </query>
     3425 
     3426  <query id="GET_ITEMSUBTYPE_WITH_NAME_AND_ITEMTYPE" type="HQL">
     3427    <sql>
     3428      SELECT st FROM ItemSubtypeData st
     3429      WHERE st.name = :name AND st.itemType = :itemType
     3430    </sql>
     3431    <description>
     3432      A Hibernate query that load an item subtype given the name
     3433      and main item type.
     3434    </description>
     3435  </query>
    34253436
    34263437 
  • trunk/src/core/net/sf/basedb/core/Install.java

    r6124 r6214  
    16721672        subtype = HibernateUtil.loadData(session, ItemSubtypeData.class, id);
    16731673      }
    1674       if (subtype == null && systemId == null)
    1675       {
    1676         org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, "GET_ITEMSUBTYPE_WITH_NAME");
     1674      if (subtype == null)
     1675      {
     1676        org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, "GET_ITEMSUBTYPE_WITH_NAME_AND_ITEMTYPE");
    16771677        query.setString("name", name);
     1678        query.setInteger("itemType", itemType.getValue());
    16781679        subtype = HibernateUtil.loadData(ItemSubtypeData.class, query);
     1680       
     1681        if (subtype != null && subtype.getSystemId() == null)
     1682        {
     1683          subtype.setSystemId(systemId);
     1684          SystemItems.add(subtype);
     1685        }
    16791686      }
    16801687     
     
    16881695        subtype = new ItemSubtypeData();
    16891696        subtype.setEntryDate(new Date());
    1690         if (systemId != null) subtype.setSystemId(systemId);
     1697        subtype.setSystemId(systemId);
    16911698        subtype.setItemType(itemType.getValue());
    16921699        subtype.setName(name);
     
    17041711        HibernateUtil.saveData(session, subtype);
    17051712        HibernateUtil.commit(tx);
    1706         if (systemId != null) SystemItems.add(subtype);
    1707         log.info("createHardwareType: OK [SYSTEM ID="+systemId+"; name="+name+"]");
     1713        SystemItems.add(subtype);
     1714        log.info("createItemSubtype: OK [SYSTEM ID="+systemId+"; name="+name+"]");
    17081715      }
    17091716    }
  • trunk/src/core/net/sf/basedb/core/PropertyFilter.java

    r6127 r6214  
    682682            WHERE cp.filter-property ........
    683683          )
     684         
     685          - or -
     686         
     687          root-entity <> ALL(
     688            SELECT root-entity FROM root-entity
     689            LEFT JOIN collection-path cp
     690            WHERE cp.filter-property ........
     691          )
     692         
    684693        */
    685694        Query subquery = new AbstractEntityQuery(query.getItemType(), null, false, null)
     
    704713        collectionFilter = cPath[cPath.length - 1];
    705714       
     715        // The following operators should result in "not contains" logic
     716        Operator subfilterOperator = operator;
     717        if (operator == Operator.NEQ)
     718        {
     719          subfilterOperator = Operator.EQ;
     720        }
     721        else if (operator == Operator.NOTIN)
     722        {
     723          subfilterOperator = Operator.IN;
     724        }
     725        else if (operator == Operator.NOTLIKE)
     726        {
     727          subfilterOperator = Operator.LIKE;
     728        }
     729        else if (operator == Operator.NOTLIKE_IN)
     730        {
     731          subfilterOperator = Operator.LIKE_IN;
     732        }
     733       
    706734        // Restrict the subquery
    707735        PropertyFilter pp = new PropertyFilter("$" + thisAlias + "." + collectionFilter,
    708             operator, getValue(), getValueType());
     736            subfilterOperator, getValue(), getValueType());
    709737        subquery.restrict(pp.getRestriction(dc, query));
    710738       
    711739        // Create the main restriction
    712         restriction = Restrictions.eq(Hql.alias(query.getRootAlias()),
    713             Expressions.any(subquery));
     740        if (subfilterOperator != operator)
     741        {
     742          // "not contains": root-entity <> ALL(subquery)
     743          restriction = Restrictions.neq(Hql.alias(query.getRootAlias()), Expressions.all(subquery));
     744        }
     745        else
     746        {
     747          // "contains": root-entity = ANY(subquery)
     748          restriction = Restrictions.eq(Hql.alias(query.getRootAlias()), Expressions.any(subquery));
     749        }
    714750      }
    715751      else if (property != null && property.startsWith("!sharedTo."))
  • trunk/src/core/net/sf/basedb/core/data/ItemSubtypeData.java

    r6127 r6214  
    117117  */
    118118  private String systemId;
     119  /**
     120    Override the property definition since we may have to update the system id
     121    during installation.
     122    @hibernate.property column="`system_id`" type="string" length="255" not-null="false" update="true"
     123  */
    119124  @Override
    120125  public String getSystemId()
  • trunk/src/core/net/sf/basedb/util/overview/loader/BioPlateLoader.java

    r6210 r6214  
    115115  {
    116116    getNodeLoader(context, Item.BIOPLATEEVENT).createForwardNode(dc, context, plateNode);
     117    getNodeLoader(context, Item.ANNOTATION).createPropertyNode(dc, context, plateNode);
    117118    getNodeLoader(context, Item.HARDWARE).createPropertyNode(dc, context, plateNode);
     119    getNodeLoader(context, Item.ANYTOANY).createPropertyNode(dc, context, plateNode);
    118120  }
    119121  // ---------------------------------------
  • trunk/src/core/net/sf/basedb/util/overview/loader/BioWellLoader.java

    r6044 r6214  
    7878    if (parentType == Item.BIOPLATE)
    7979    {
    80       createForwardNode((BioPlate)parentNode.getItem(dc), dc, context, parentNode);
     80      returnNode = createForwardNode((BioPlate)parentNode.getItem(dc), dc, context, parentNode);
    8181    }
    8282    return returnNode;
     
    9898  */
    9999  @SuppressWarnings("unchecked")
    100   private void createForwardNode(BioPlate plate, DbControl dc, OverviewContext context, Node plateNode)
     100  private Node createForwardNode(BioPlate plate, DbControl dc, OverviewContext context, Node plateNode)
    101101  {
    102102    // Name generate that prefixes each name with the well coordinate
    103103    BioWellNameGenerator nameGenerator = new BioWellNameGenerator();
     104    Node folderNode = null;
    104105   
    105106    // Validator and node factory for wells with samples
     
    130131      }
    131132     
     133      if (folderNode == null)
     134      {
     135        folderNode = new Node("biomaterial", "Biomaterial", plateNode, ChildNodeDirection.FORWARD);
     136      }
    132137      if (well.getBioMaterialType() == Item.SAMPLE)
    133138      {
    134139        // Create sample node
    135140        Sample sample = (Sample)bioMaterial;
    136         createItemNode(sampleNodeFactory, sample, well, denied, plateNode, ChildNodeDirection.ALL);
     141        createItemNode(sampleNodeFactory, sample, well, denied, folderNode, ChildNodeDirection.ALL);
    137142      }
    138143      else
     
    140145        // Create extract node
    141146        Extract extract = (Extract)bioMaterial;
    142         createItemNode(extractNodeFactory, extract, well, denied, plateNode, ChildNodeDirection.ALL);
     147        createItemNode(extractNodeFactory, extract, well, denied, folderNode, ChildNodeDirection.ALL);
    143148      }
    144149    }
     150    return folderNode;
    145151  }
    146152
  • trunk/www/common/overview/ajax.jsp

    r6124 r6214  
    2828  import="net.sf.basedb.core.ItemSubtype"
    2929  import="net.sf.basedb.core.Subtypable"
     30  import="net.sf.basedb.core.BioPlate"
     31  import="net.sf.basedb.core.BioPlateType"
    3032  import="net.sf.basedb.core.Item"
    3133  import="net.sf.basedb.util.overview.GenericOverview"
     
    107109          {}
    108110        }
     111        else if (n.getItem() instanceof BioPlate)
     112        {
     113          try
     114          {
     115            BioPlateType plateType = ((BioPlate)n.getItem(dc)).getBioPlateType();
     116            if (plateType != null) subtitle = plateType.getName();
     117          }
     118          catch (Throwable t)
     119          {}
     120        }
    109121       
    110122        int numChildren = n.numChildren();
  • trunk/www/filemanager/files/list_files.jsp

    r6201 r6214  
    10791079                  %>
    10801080                </tbl:cell>
     1081                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
    10811082                <tbl:cell column="url"><%=HTML.niceFormat(item.getUrl(), HTML.LINK_URL)%></tbl:cell>
    10821083                <tbl:cell column="fileServer"><base:propertyvalue
Note: See TracChangeset for help on using the changeset viewer.