mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
. Added support for "displayLabelId" attribute in Advanced Search meta-data config (as requested on the forums)
. Handling of missing content (reader.exists()) in TemplateNode . JavaDoc improvements to Template changes code from yestarday git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2008 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
d051d1153c
commit
c337d0d87e
@ -387,17 +387,23 @@ public class ClientConfigElement extends ConfigElementAdapter
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple wrapper class for custom advanced search property
|
||||||
|
* @author Kevin Roast
|
||||||
|
*/
|
||||||
public static class CustomProperty
|
public static class CustomProperty
|
||||||
{
|
{
|
||||||
CustomProperty(String type, String aspect, String property)
|
CustomProperty(String type, String aspect, String property, String labelId)
|
||||||
{
|
{
|
||||||
Type = type;
|
Type = type;
|
||||||
Aspect = aspect;
|
Aspect = aspect;
|
||||||
Property = property;
|
Property = property;
|
||||||
|
LabelId = labelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String Type;
|
public String Type;
|
||||||
public String Aspect;
|
public String Aspect;
|
||||||
public String Property;
|
public String Property;
|
||||||
|
public String LabelId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@ public class ClientElementReader implements ConfigElementReader
|
|||||||
public static final String ATTRIBUTE_TYPE = "type";
|
public static final String ATTRIBUTE_TYPE = "type";
|
||||||
public static final String ATTRIBUTE_PROPERTY = "property";
|
public static final String ATTRIBUTE_PROPERTY = "property";
|
||||||
public static final String ATTRIBUTE_ASPECT = "aspect";
|
public static final String ATTRIBUTE_ASPECT = "aspect";
|
||||||
|
public static final String ATTRIBUTE_DISPLAYLABEL = "displayLabelId";
|
||||||
|
|
||||||
private static Log logger = LogFactory.getLog(ClientElementReader.class);
|
private static Log logger = LogFactory.getLog(ClientElementReader.class);
|
||||||
|
|
||||||
@ -220,7 +221,8 @@ public class ClientElementReader implements ConfigElementReader
|
|||||||
String type = propElement.attributeValue(ATTRIBUTE_TYPE);
|
String type = propElement.attributeValue(ATTRIBUTE_TYPE);
|
||||||
String aspect = propElement.attributeValue(ATTRIBUTE_ASPECT);
|
String aspect = propElement.attributeValue(ATTRIBUTE_ASPECT);
|
||||||
String prop = propElement.attributeValue(ATTRIBUTE_PROPERTY);
|
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);
|
configElement.setCustomProperties(props);
|
||||||
}
|
}
|
||||||
|
@ -168,8 +168,17 @@ public class UISearchCustomProperties extends SelfRenderingComponent implements
|
|||||||
// if we found a def, then we can build components to represent it
|
// if we found a def, then we can build components to represent it
|
||||||
if (propDef != null)
|
if (propDef != null)
|
||||||
{
|
{
|
||||||
// TODO: add display label I18N message support to configelement and here
|
// resolve display label I18N message
|
||||||
String label = propDef.getTitle() != null ? propDef.getTitle() : propDef.getName().getLocalName();
|
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
|
// special handling for Date and DateTime
|
||||||
DataTypeDefinition dataTypeDef = propDef.getDataType();
|
DataTypeDefinition dataTypeDef = propDef.getDataType();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user