mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Intial version of property sheet constraints support, no regex or list of values suppport yet though.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2664 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -484,51 +484,63 @@ public class CreateSpaceWizard extends BaseWizardBean
|
||||
QName idQName = Repository.resolveToQName(child.getAttribute("name"));
|
||||
TypeDefinition typeDef = this.dictionaryService.getType(idQName);
|
||||
|
||||
if (typeDef != null &&
|
||||
this.dictionaryService.isSubClass(typeDef.getName(), ContentModel.TYPE_FOLDER))
|
||||
if (typeDef != null)
|
||||
{
|
||||
// try and get the label from config
|
||||
String label = Utils.getDisplayLabel(context, child);
|
||||
|
||||
// if there wasn't a client based label try and get it from the dictionary
|
||||
if (label == null)
|
||||
if (this.dictionaryService.isSubClass(typeDef.getName(), ContentModel.TYPE_FOLDER))
|
||||
{
|
||||
label = typeDef.getTitle();
|
||||
// try and get the label from config
|
||||
String label = Utils.getDisplayLabel(context, child);
|
||||
|
||||
// if there wasn't a client based label try and get it from the dictionary
|
||||
if (label == null)
|
||||
{
|
||||
label = typeDef.getTitle();
|
||||
}
|
||||
|
||||
// finally use the localname if we still haven't found a label
|
||||
if (label == null)
|
||||
{
|
||||
label = idQName.getLocalName();
|
||||
}
|
||||
|
||||
// resolve a description string for the type
|
||||
String description = Utils.getDescription(context, child);
|
||||
|
||||
// if we don't have a local description just use the label
|
||||
if (description == null)
|
||||
{
|
||||
description = label;
|
||||
}
|
||||
|
||||
// extract the icon to use from the config
|
||||
String icon = child.getAttribute("icon");
|
||||
if (icon == null || icon.length() == 0)
|
||||
{
|
||||
icon = DEFAULT_SPACE_TYPE_ICON_PATH;
|
||||
}
|
||||
|
||||
UIListItem item = new UIListItem();
|
||||
item.getAttributes().put("value", idQName.toString());
|
||||
item.getAttributes().put("label", label);
|
||||
item.getAttributes().put("tooltip", label);
|
||||
item.getAttributes().put("image", icon);
|
||||
this.folderTypes.add(item);
|
||||
|
||||
UIDescription desc = new UIDescription();
|
||||
desc.setControlValue(idQName.toString());
|
||||
desc.setText(description);
|
||||
this.folderTypeDescriptions.add(desc);
|
||||
}
|
||||
|
||||
// finally use the localname if we still haven't found a label
|
||||
if (label == null)
|
||||
else
|
||||
{
|
||||
label = idQName.getLocalName();
|
||||
logger.warn("Failed to add '" + child.getAttribute("name") +
|
||||
"' to the list of folder types as the type is not a subtype of cm:folder");
|
||||
}
|
||||
|
||||
// resolve a description string for the type
|
||||
String description = Utils.getDescription(context, child);
|
||||
|
||||
// if we don't have a local description just use the label
|
||||
if (description == null)
|
||||
{
|
||||
description = label;
|
||||
}
|
||||
|
||||
// extract the icon to use from the config
|
||||
String icon = child.getAttribute("icon");
|
||||
if (icon == null || icon.length() == 0)
|
||||
{
|
||||
icon = DEFAULT_SPACE_TYPE_ICON_PATH;
|
||||
}
|
||||
|
||||
UIListItem item = new UIListItem();
|
||||
item.getAttributes().put("value", idQName.toString());
|
||||
item.getAttributes().put("label", label);
|
||||
item.getAttributes().put("tooltip", label);
|
||||
item.getAttributes().put("image", icon);
|
||||
this.folderTypes.add(item);
|
||||
|
||||
UIDescription desc = new UIDescription();
|
||||
desc.setControlValue(idQName.toString());
|
||||
desc.setText(description);
|
||||
this.folderTypeDescriptions.add(desc);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn("Failed to add '" + child.getAttribute("name") +
|
||||
"' to the list of folder types as the type is not recognised");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user