From cac4f143bd0e8595de6371bd8843b7188856a46a Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Wed, 29 Aug 2007 14:46:58 +0000 Subject: [PATCH] Merged V2.1 to HEAD 6590: AWC-1530 Saved search does not work for custom properties of type d:text with list constraint git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6629 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/web/bean/AdvancedSearchBean.java | 13 ++++++++++++- .../ui/repo/component/UISearchCustomProperties.java | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/source/java/org/alfresco/web/bean/AdvancedSearchBean.java b/source/java/org/alfresco/web/bean/AdvancedSearchBean.java index 181c06f19b..83f9dd9130 100644 --- a/source/java/org/alfresco/web/bean/AdvancedSearchBean.java +++ b/source/java/org/alfresco/web/bean/AdvancedSearchBean.java @@ -1340,7 +1340,18 @@ public class AdvancedSearchBean } else { - this.customProperties.put(qname, search.getAttributeQuery(QName.createQName(qname))); + // a default datatype may indicate either an attribute query, or if a Fixed Value + // is present then it's a LOV constraint with a value selected + Object value = search.getFixedValueQuery(QName.createQName(qname)); + if (value != null) + { + this.customProperties.put(UISearchCustomProperties.PREFIX_LOV_ITEM + qname, value); + this.customProperties.put(qname, Boolean.TRUE); + } + else + { + this.customProperties.put(qname, search.getAttributeQuery(QName.createQName(qname))); + } this.panels.put(PANEL_CUSTOM, true); } } diff --git a/source/java/org/alfresco/web/ui/repo/component/UISearchCustomProperties.java b/source/java/org/alfresco/web/ui/repo/component/UISearchCustomProperties.java index 7a75934330..657d764cb7 100644 --- a/source/java/org/alfresco/web/ui/repo/component/UISearchCustomProperties.java +++ b/source/java/org/alfresco/web/ui/repo/component/UISearchCustomProperties.java @@ -412,7 +412,7 @@ public class UISearchCustomProperties extends SelfRenderingComponent implements UISelectItems itemsComponent = (UISelectItems)facesApp. createComponent(ComponentConstants.JAVAX_FACES_SELECT_ITEMS); - List items = new ArrayList(3); + List items = new ArrayList(); List values = constraint.getAllowedValues(); for (String value : values) {