Changeset 2190


Ignore:
Timestamp:
Jan 13, 2014, 11:13:03 AM (8 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #557: Don't remove histology work lists after registration

Location:
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Histology.java

    r2134 r2190  
    2828
    2929  /**
    30     This prefix is used on Histology work lists for the external ID attribute.
     30    This ID is used on Histology work lists for the external ID attribute.
    3131  */
    32   public static final String WORK_LIST_ID_PREFIX = "net.sf.basedb.reggie.histology.work-list";
    33  
     32  public static final String WORK_LIST_ID = "net.sf.basedb.reggie.histology.work-list";
     33
     34  /**
     35    This ID is used on Histology work lists for which paraffin blocks have been registered.
     36    @since 2.14
     37  */
     38  public static final String WORK_LIST_COMPLETE_ID = "net.sf.basedb.reggie.histology.work-list-complete";
     39
     40
    3441  /**
    3542    The number of samples per paraffin block.
     
    6269      workQuery.join(Hql.innerJoin("bioMaterialLists", "lst"));
    6370      workQuery.restrict(Restrictions.and(
    64           Restrictions.like(Hql.property("lst", "externalId"), Expressions.string(WORK_LIST_ID_PREFIX + "%")),
     71          Restrictions.eq(Hql.property("lst", "externalId"), Expressions.string(WORK_LIST_ID)),
    6572          Restrictions.eq(Hql.property("lst", "removed"), Expressions.bool(false))
    6673        ));
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/HistologyServlet.java

    r2172 r2190  
    8888        ItemQuery<BioMaterialList> query = BioMaterialList.getQuery();
    8989        query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
    90         query.restrict(Restrictions.like(Hql.property("externalId"), Expressions.string(Histology.WORK_LIST_ID_PREFIX + "%")));
     90        query.restrict(Restrictions.eq(Hql.property("externalId"), Expressions.string(Histology.WORK_LIST_ID)));
    9191        long count = query.count(dc);
    9292        json.put("count", count);
     
    9999        ItemQuery<BioMaterialList> query = BioMaterialList.getQuery();
    100100        query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
    101         query.restrict(Restrictions.like(Hql.property("externalId"), Expressions.string(Histology.WORK_LIST_ID_PREFIX + "%")));
     101        query.restrict(Restrictions.eq(Hql.property("externalId"), Expressions.string(Histology.WORK_LIST_ID)));
    102102        query.order(Orders.desc(Hql.property("id")));
    103103       
     
    490490               
    491491        BioMaterialList workList = BioMaterialList.getNew(dc, Item.SAMPLE);
    492         workList.setExternalId(Histology.WORK_LIST_ID_PREFIX);
     492        workList.setExternalId(Histology.WORK_LIST_ID);
    493493        workList.setName((String)jsonReq.get("name"));
    494494        workList.setDescription((String)jsonReq.get("comments"));
     
    626626        }
    627627       
    628         // Mark the work list as removed
    629         workList.setRemoved(true);
     628        // Mark the work list as completed
     629        workList.setExternalId(Histology.WORK_LIST_COMPLETE_ID);
    630630        if (storageBox != null)
    631631        {
Note: See TracChangeset for help on using the changeset viewer.