Changeset 6737


Ignore:
Timestamp:
Feb 13, 2015, 1:28:27 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1910: Disable annotation inheritance for annotation types

Do not include annotations for annotation types with inheritance disabled in the manual "Inherit annotations" dialog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/annotations/inherit.jsp

    r6692 r6737  
    5353  import="net.sf.basedb.core.query.Orders"
    5454  import="net.sf.basedb.core.query.Hql"
     55  import="net.sf.basedb.core.query.Expressions"
     56  import="net.sf.basedb.core.query.Restrictions"
    5557  import="net.sf.basedb.util.Tree"
    5658  import="net.sf.basedb.clients.web.Base"
     
    126128      HTML.encodeTags(((Nameable)item).getName()) + " <span class=\"itemsubtype\">(" + itemType + ")</span>";
    127129   
     130    ItemQuery<Annotation> query = as.getAnnotations();
     131    query.restrict(Restrictions.eq(Hql.property("annotationType.disableInheritance"), Expressions.bool(false)));
     132    List<Annotation> annotations = query.list(as.getDbControl());
     133    if (annotations.size() == 0 && !setInherited) continue; // With the next AnnotationSet/item
     134     
    128135    JSONObject jsonJoust = newJoustEntry(null, icon, input+name, joustId);
    129136    jsonJoust.put("isOpen", 1);
     
    133140    json.add(jsonJoust);
    134141
    135     List<Annotation> annotations = as.getAnnotations().list(as.getDbControl());
    136142    SessionControl sc = as.getSessionControl();
    137143    for (Annotation a : annotations)
Note: See TracChangeset for help on using the changeset viewer.