Changeset 6966


Ignore:
Timestamp:
Oct 2, 2015, 10:41:56 AM (6 years ago)
Author:
Nicklas Nordborg
Message:

References #950: Add support for any-to-any link filters in table lists views

The changes made to filter definitions in [6934] broke some queries used in the Trashcan and Project class. We need the filters with generic names as well as the filters with item-specific names.

File:
1 edited

Legend:

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

    r6956 r6966  
    547547    if (filterSource == null) return;
    548548
    549     // Define the filter by cloning the template onto the
    550     // root element and set the name including the item type.
     549    // Define the filter by cloning the template onto the root element
     550    classTag.getDocument().getRootElement().addContent(filterSource.clone());
     551    // We also need the same filter with name+itemtype so we have control
     552    // for each type of item
    551553    Element filterDef = filterSource.clone();
    552554    filterDef.setAttribute("name", name + itemType.name());
    553555    classTag.getDocument().getRootElement().addContent(filterDef);
    554556
    555     // Second part of the filter definition goes inside the
    556     // class tag
    557     Element element = new Element("filter");
    558     element.setAttribute("name", name + itemType.name());
    559     element.setAttribute("condition", condition);
    560     classTag.addContent(element);
    561    
     557    // Second part of the filter definition goes inside the class tag
     558    Element filter = new Element("filter");
     559    filter.setAttribute("name", name);
     560    filter.setAttribute("condition", condition);
     561    classTag.addContent(filter);
     562   
     563    // And the name+itemtype variant
     564    filter = new Element("filter");
     565    filter.setAttribute("name", name + itemType.name());
     566    filter.setAttribute("condition", condition);
     567    classTag.addContent(filter);
    562568  }
    563569 
Note: See TracChangeset for help on using the changeset viewer.