- 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; Element filter;
String selected; String selected;
filter = new Element("compareFilter"); filter = new Element("filter");
filter.addAttribute("type", "compare");
if ((value == null) || value.isEmpty()) { if ((value == null) || value.isEmpty()) {
if (allOptionIsDefault) { if (allOptionIsDefault) {

View File

@ -276,11 +276,6 @@ public class CustomizableObjectList extends ComplexObjectList {
content.addAttribute(attribute.getKey(), attribute.getValue()); 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: //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 //- They have to be registered very early, so we can't add new parameters
@ -309,7 +304,14 @@ public class CustomizableObjectList extends ComplexObjectList {
sortBy = new ArrayList<String>(sortFields.values()).get(0); 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); sortFieldElems.addAttribute("sortBy", sortByKey);
for (Map.Entry<String, String> sortField : sortFields.entrySet()) { for (Map.Entry<String, String> sortField : sortFields.entrySet()) {
Element sortFieldElem = sortFieldElems.newChildElement("sortField"); Element sortFieldElem = sortFieldElems.newChildElement("sortField");

View File

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

View File

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

View File

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