Forums overriden actions (checkin) and Discuss/Create Forum actions now externalised

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2556 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-03-20 14:10:44 +00:00
parent 5d3872279f
commit 65d874e9c9
10 changed files with 263 additions and 153 deletions

View File

@@ -107,30 +107,24 @@ public class ActionsElementReader implements ConfigElementReader
Element actionRefElement = actionRefItr.next();
// look for an action referred to be Id - this is the common use-case
ActionDefinition def = null;
String idRef = actionRefElement.attributeValue(ATTRIBUTE_IDREF);
if (idRef != null && idRef.length() != 0)
{
// try to find the referenced action by Id
def = configElement.getActionDefinition(idRef);
if (def == null)
{
throw new ConfigException("Action group '" + groupId +
"' cannot find action definition referenced by '" + idRef + "'");
}
}
else
if (idRef == null || idRef.length() == 0)
{
// look for an action defined directly rather than referenced by Id
String id = actionRefElement.attributeValue(ATTRIBUTE_ID);
if (id != null && id.length() != 0)
{
def = parseActionDefinition(actionRefElement);
ActionDefinition def = parseActionDefinition(actionRefElement);
// override action definition ID based on the group name to avoid conflicts
def.id = actionGroup.getId() + '_' + def.getId();
configElement.addActionDefinition(def);
actionGroup.addAction(def.getId());
}
}
if (def != null)
else
{
actionGroup.addAction(def);
// add the action definition ID to the group
actionGroup.addAction(idRef);
}
}