diff --git a/source/java/org/alfresco/web/config/ClientConfigElement.java b/source/java/org/alfresco/web/config/ClientConfigElement.java index 0b19d9661c..9bb101d7f7 100644 --- a/source/java/org/alfresco/web/config/ClientConfigElement.java +++ b/source/java/org/alfresco/web/config/ClientConfigElement.java @@ -387,17 +387,23 @@ public class ClientConfigElement extends ConfigElementAdapter } + /** + * Simple wrapper class for custom advanced search property + * @author Kevin Roast + */ public static class CustomProperty { - CustomProperty(String type, String aspect, String property) + CustomProperty(String type, String aspect, String property, String labelId) { Type = type; Aspect = aspect; Property = property; + LabelId = labelId; } public String Type; public String Aspect; public String Property; + public String LabelId; } } diff --git a/source/java/org/alfresco/web/config/ClientElementReader.java b/source/java/org/alfresco/web/config/ClientElementReader.java index 3d4a50494e..e557530375 100644 --- a/source/java/org/alfresco/web/config/ClientElementReader.java +++ b/source/java/org/alfresco/web/config/ClientElementReader.java @@ -58,6 +58,7 @@ public class ClientElementReader implements ConfigElementReader public static final String ATTRIBUTE_TYPE = "type"; public static final String ATTRIBUTE_PROPERTY = "property"; public static final String ATTRIBUTE_ASPECT = "aspect"; + public static final String ATTRIBUTE_DISPLAYLABEL = "displayLabelId"; private static Log logger = LogFactory.getLog(ClientElementReader.class); @@ -220,7 +221,8 @@ public class ClientElementReader implements ConfigElementReader String type = propElement.attributeValue(ATTRIBUTE_TYPE); String aspect = propElement.attributeValue(ATTRIBUTE_ASPECT); String prop = propElement.attributeValue(ATTRIBUTE_PROPERTY); - props.add(new ClientConfigElement.CustomProperty(type, aspect, prop)); + String labelId = propElement.attributeValue(ATTRIBUTE_DISPLAYLABEL); + props.add(new ClientConfigElement.CustomProperty(type, aspect, prop, labelId)); } configElement.setCustomProperties(props); } 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 5cb64a267f..047a0ce24d 100644 --- a/source/java/org/alfresco/web/ui/repo/component/UISearchCustomProperties.java +++ b/source/java/org/alfresco/web/ui/repo/component/UISearchCustomProperties.java @@ -168,8 +168,17 @@ public class UISearchCustomProperties extends SelfRenderingComponent implements // if we found a def, then we can build components to represent it if (propDef != null) { - // TODO: add display label I18N message support to configelement and here - String label = propDef.getTitle() != null ? propDef.getTitle() : propDef.getName().getLocalName(); + // resolve display label I18N message + String label; + if (property.LabelId != null && property.LabelId.length() != 0) + { + label = Application.getMessage(context, property.LabelId); + } + else + { + // or use dictionary label or QName as last resort + label = propDef.getTitle() != null ? propDef.getTitle() : propDef.getName().getLocalName(); + } // special handling for Date and DateTime DataTypeDefinition dataTypeDef = propDef.getDataType();