- Fehlerkorrekturen für die CustomizableObjectList

- Fehlende Eigenschaften beim ProceedingsPropertyStep nachgetragen (als Basis wurde nicht der Sheet vom PublicationWithPublisherPropertiesStep sondern der vom 
  PublicationPropertiesStep verwendet).


git-svn-id: https://svn.libreccm.org/ccm/trunk@813 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-03-31 20:10:51 +00:00
parent bb1f289953
commit aa13c461ee
5 changed files with 20 additions and 19 deletions

View File

@ -118,7 +118,8 @@ public class CompareFilter implements Filter {
Element filter;
String selected;
filter = new Element("compareFilter");
filter = new Element("filter");
filter.addAttribute("type", "compare");
if ((value == null) || value.isEmpty()) {
if (allOptionIsDefault) {

View File

@ -276,12 +276,7 @@ public class CustomizableObjectList extends ComplexObjectList {
content.addAttribute(attribute.getKey(), attribute.getValue());
}
Element filterElems = content.newChildElement("filters");
for (Map.Entry<String, Filter> filterEntry : filters.entrySet()) {
filterElems.addContent(filterEntry.getValue().getXml());
}
//Look for values for the filters and the sort fields in the HTTP
//Look for values for the filters and the sort fields in the HTTP
//request. We are not using the Bebop parameters for two reasons:
//- They have to be registered very early, so we can't add new parameters
// from a JSP.
@ -309,7 +304,14 @@ public class CustomizableObjectList extends ComplexObjectList {
sortBy = new ArrayList<String>(sortFields.values()).get(0);
}
Element sortFieldElems = content.newChildElement("sortFields");
Element controls = content.newChildElement("controls");
Element filterElems = controls.newChildElement("filters");
for (Map.Entry<String, Filter> filterEntry : filters.entrySet()) {
filterElems.addContent(filterEntry.getValue().getXml());
}
Element sortFieldElems = controls.newChildElement("sortFields");
sortFieldElems.addAttribute("sortBy", sortByKey);
for (Map.Entry<String, String> sortField : sortFields.entrySet()) {
Element sortFieldElem = sortFieldElems.newChildElement("sortField");

View File

@ -85,7 +85,8 @@ public class SelectFilter implements Filter {
options = getOptions();
filter = new Element("selectFilter");
filter = new Element("filter");
filter.addAttribute("type", "select");
if ((value == null) || value.isEmpty()) {
if (allOptionIsDefault) {
@ -102,7 +103,7 @@ public class SelectFilter implements Filter {
if (allOption) {
optionElem = filter.newChildElement("option");
optionElem.addAttribute(label, ALL);
optionElem.addAttribute("label", ALL);
}
for (String optionStr : options) {

View File

@ -41,12 +41,8 @@ public class TextFilter implements Filter {
if ((value == null) || value.isEmpty()) {
return null;
} else {
/*return String.format("(lower(%s) LIKE lower('%%%s%%'))",
property, value);*/
return String.format("(lower(%s) LIKE lower('%%%s%%')) OR (lower(%s) LIKE lower('%%%s%%'))",
property, value,
property, firstToUpper(value));
return String.format("(lower(%s) LIKE lower('%%%s%%'))",
property, value);
}
}
@ -62,9 +58,10 @@ public class TextFilter implements Filter {
@Override
public Element getXml() {
Element textFilter ;
Element textFilter;
textFilter = new Element("textFilter");
textFilter = new Element("filter");
textFilter.addAttribute("type", "text");
textFilter.addAttribute("label", label);
if ((value != null) && !value.isEmpty()) {

View File

@ -44,7 +44,7 @@ public class ProceedingsPropertiesStep
public static Component getProceedingsPropertySheet(
ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) getPublicationPropertySheet(
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) getPublicationWithPublisherPropertySheet(
itemModel);
sheet.add(PublicationGlobalizationUtil.globalize(