CustomizableObjectList

FilterControls werden nicht mehr ausgegeben, wenn keine Filter definiert sind.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2324 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2013-09-25 07:37:46 +00:00
parent ded554211d
commit e209bd4b5e
1 changed files with 68 additions and 65 deletions

View File

@ -14,19 +14,20 @@ import org.apache.log4j.Logger;
/** /**
* <p> An object list variant which can be filtered and sorted by the visitor of * <p> An object list variant which can be filtered and sorted by the visitor of
* the website. The available filters and sort options are added in a JSP * the website. The available filters and sort options are added in a JSP
* template. There are three kinds of filters yet: </p> <dl> <dt><code>TextFilter</code></dt> * template. There are three kinds of filters yet: </p> <dl>
* <dd>This filter filters the object list using a user provided string, which * <dt><code>TextFilter</code></dt> <dd>This filter filters the object list
* is put into the * using a user provided string, which is put into the
* <code>WHERE</code> clause with * <code>WHERE</code> clause with
* <code>LIKE</code> operator. You might use this filter to allow the visitor to * <code>LIKE</code> operator. You might use this filter to allow the visitor to
* filter an object list for items with a specific name.</dd> <dt><code>SelectFilter</code></dt> * filter an object list for items with a specific name.</dd>
* <dd>This filter traverses through the objects displayed by the list and * <dt><code>SelectFilter</code></dt> <dd>This filter traverses through the
* determines all distinct values of a property. The visitor can choose one of * objects displayed by the list and determines all distinct values of a
* this values, and the displayed list will only contain items which where the * property. The visitor can choose one of this values, and the displayed list
* property has the selected value.</dd> <dt><code>CompareFilter</code></dt> * will only contain items which where the property has the selected value.</dd>
* <dd>This filter also provides selectable options. But these options can be * <dt><code>CompareFilter</code></dt> <dd>This filter also provides selectable
* configured by the developer in the template.</dd> </dl> <p> If there is more * options. But these options can be configured by the developer in the
* than one filter, the values of all filters are combined using * template.</dd> </dl> <p> If there is more than one filter, the values of all
* filters are combined using
* <code>AND</code>. </p> <p> This object list class was developed for * <code>AND</code>. </p> <p> This object list class was developed for
* displaying list of items from the Sci modules (SciPublications and * displaying list of items from the Sci modules (SciPublications and
* SciOrganization). For example, we use this list to provide lists of * SciOrganization). For example, we use this list to provide lists of
@ -90,7 +91,6 @@ public class CustomizableObjectList extends ComplexObjectList {
*/ */
private final Map<String, Filter> filters = private final Map<String, Filter> filters =
new LinkedHashMap<String, Filter>(); new LinkedHashMap<String, Filter>();
//private CategoryFilter categoryFilter; //private CategoryFilter categoryFilter;
/** /**
* The available sort fields. We use an {@link LinkedHashMap} here to * The available sort fields. We use an {@link LinkedHashMap} here to
@ -122,8 +122,10 @@ public class CustomizableObjectList extends ComplexObjectList {
* @param allOption Add an <em>all</em> option to the filter. * @param allOption Add an <em>all</em> option to the filter.
* @param allOptionIsDefault Is the all option the default? * @param allOptionIsDefault Is the all option the default?
* @param propertyIsNumeric Is the property to filter numeric? * @param propertyIsNumeric Is the property to filter numeric?
* @return The new filter. Options can be added to the filter by calling the {@link CompareFilter#addOption(java.lang.String, java.lang.String)} * @return The new filter. Options can be added to the filter by calling the
* or the {@link CompareFilter#addOption(java.lang.String, com.arsdigita.navigation.ui.object.CompareFilter.Operators, java.lang.String)} * {@link CompareFilter#addOption(java.lang.String, java.lang.String)} or
* the
* {@link CompareFilter#addOption(java.lang.String, com.arsdigita.navigation.ui.object.CompareFilter.Operators, java.lang.String)}
* method. * method.
* @see CompareFilter#CompareFilter(java.lang.String, java.lang.String, * @see CompareFilter#CompareFilter(java.lang.String, java.lang.String,
* boolean, boolean, boolean) * boolean, boolean, boolean)
@ -183,7 +185,6 @@ public class CustomizableObjectList extends ComplexObjectList {
// //
// return categoryFilter; // return categoryFilter;
// } // }
/** /**
* Add a sort field option. * Add a sort field option.
* *
@ -334,6 +335,8 @@ public class CustomizableObjectList extends ComplexObjectList {
// } // }
// } // }
if (!filters.isEmpty()) {
final Element controls = content.newChildElement("filterControls"); final Element controls = content.newChildElement("filterControls");
controls.addAttribute("customName", m_customName); controls.addAttribute("customName", m_customName);
@ -361,11 +364,11 @@ public class CustomizableObjectList extends ComplexObjectList {
sortFieldElem.addAttribute("label", sortField.getKey()); sortFieldElem.addAttribute("label", sortField.getKey());
} }
} }
}
//Add object list //Add object list
content.addContent(generateObjectListXML(request, response)); content.addContent(generateObjectListXML(request, response));
return content; return content;
} }
} }