- New edit properties dialog used when new content is added/created

- Minor fixes/enhancements

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2805 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-05-10 08:54:14 +00:00
parent 7f6fabb0b6
commit c953c45c3d
26 changed files with 711 additions and 171 deletions

View File

@@ -76,8 +76,7 @@ public class CreateRuleWizard extends BaseActionWizard
protected static final String CONDITION_PAGES_LOCATION = "/jsp/rules/";
private static final Log logger = LogFactory.getLog(CreateRuleWizard.class);
// ------------------------------------------------------------------------------
// Wizard implementation
@@ -209,63 +208,7 @@ public class CreateRuleWizard extends BaseActionWizard
{
return "error_rule";
}
/**
* Sets up the given rule using the current state of the wizard
*
* @param context FacesContext
* @param rule The rule to setup
* @param outcome The default outcome
* @return The outcome
*/
protected String setupRule(FacesContext context, Rule rule, String outcome)
{
// setup the rule and add it to the space
rule.setTitle(this.title);
rule.setDescription(this.description);
rule.applyToChildren(this.applyToSubSpaces);
rule.setExecuteAsynchronously(this.runInBackground);
// add all the conditions to the rule
for (Map<String, Serializable> condParams : this.allConditionsProperties)
{
String conditionName = (String)condParams.get(PROP_CONDITION_NAME);
this.condition = conditionName;
this.currentConditionProperties = condParams;
Map<String, Serializable> repoCondParams = buildConditionParams();
// add the condition to the rule
ActionCondition condition = this.actionService.
createActionCondition(conditionName);
condition.setParameterValues(repoCondParams);
// specify whether the condition result should be inverted
Boolean not = (Boolean)condParams.get(PROP_CONDITION_NOT);
condition.setInvertCondition(((Boolean)not).booleanValue());
rule.addActionCondition(condition);
}
// add all the actions to the rule
for (Map<String, Serializable> actionParams : this.allActionsProperties)
{
// use the base class version of buildActionParams(), but for this we need
// to setup the currentActionProperties and action variables
String actionName = (String)actionParams.get(PROP_ACTION_NAME);
this.action = actionName;
this.currentActionProperties = actionParams;
Map<String, Serializable> repoActionParams = buildActionParams();
// add the action to the rule
Action action = this.actionService.createAction(actionName);
action.setParameterValues(repoActionParams);
rule.addAction(action);
}
return outcome;
}
// ------------------------------------------------------------------------------
// Bean Getters and Setters
@@ -680,6 +623,61 @@ public class CreateRuleWizard extends BaseActionWizard
// ------------------------------------------------------------------------------
// Helper methods
/**
* Sets up the given rule using the current state of the wizard
*
* @param context FacesContext
* @param rule The rule to setup
* @param outcome The default outcome
* @return The outcome
*/
protected String setupRule(FacesContext context, Rule rule, String outcome)
{
// setup the rule and add it to the space
rule.setTitle(this.title);
rule.setDescription(this.description);
rule.applyToChildren(this.applyToSubSpaces);
rule.setExecuteAsynchronously(this.runInBackground);
// add all the conditions to the rule
for (Map<String, Serializable> condParams : this.allConditionsProperties)
{
String conditionName = (String)condParams.get(PROP_CONDITION_NAME);
this.condition = conditionName;
this.currentConditionProperties = condParams;
Map<String, Serializable> repoCondParams = buildConditionParams();
// add the condition to the rule
ActionCondition condition = this.actionService.
createActionCondition(conditionName);
condition.setParameterValues(repoCondParams);
// specify whether the condition result should be inverted
Boolean not = (Boolean)condParams.get(PROP_CONDITION_NOT);
condition.setInvertCondition(((Boolean)not).booleanValue());
rule.addActionCondition(condition);
}
// add all the actions to the rule
for (Map<String, Serializable> actionParams : this.allActionsProperties)
{
// use the base class version of buildActionParams(), but for this we need
// to setup the currentActionProperties and action variables
String actionName = (String)actionParams.get(PROP_ACTION_NAME);
this.action = actionName;
this.currentActionProperties = actionParams;
Map<String, Serializable> repoActionParams = buildActionParams();
// add the action to the rule
Action action = this.actionService.createAction(actionName);
action.setParameterValues(repoActionParams);
rule.addAction(action);
}
return outcome;
}
/**
* Sets up any default state required by the UI for collecting the
* condition settings. The view id to use for the condition UI can also