mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- Rule and action tasks for 1.4
- Updated W/S include paths git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3526 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -68,6 +68,7 @@ public class CreateRuleWizard extends BaseActionWizard
|
||||
protected boolean runInBackground;
|
||||
protected boolean applyToSubSpaces;
|
||||
protected boolean editingCondition;
|
||||
protected boolean ruleDisabled;
|
||||
|
||||
private static final Log logger = LogFactory.getLog(CreateRuleWizard.class);
|
||||
|
||||
@@ -85,6 +86,7 @@ public class CreateRuleWizard extends BaseActionWizard
|
||||
this.condition = null;
|
||||
this.applyToSubSpaces = false;
|
||||
this.runInBackground = false;
|
||||
this.ruleDisabled = false;
|
||||
this.conditions = null;
|
||||
|
||||
this.allConditionsProperties = new ArrayList<Map<String, Serializable>>();
|
||||
@@ -192,12 +194,13 @@ public class CreateRuleWizard extends BaseActionWizard
|
||||
|
||||
String backgroundYesNo = this.runInBackground ? bundle.getString("yes") : bundle.getString("no");
|
||||
String subSpacesYesNo = this.applyToSubSpaces ? bundle.getString("yes") : bundle.getString("no");
|
||||
String ruleDisabledYesNo = this.ruleDisabled ? bundle.getString("yes") : bundle.getString("no");
|
||||
|
||||
return buildSummary(
|
||||
new String[] {bundle.getString("rule_type"), bundle.getString("name"), bundle.getString("description"),
|
||||
bundle.getString("apply_to_sub_spaces"), bundle.getString("run_in_background"),
|
||||
bundle.getString("apply_to_sub_spaces"), bundle.getString("run_in_background"), bundle.getString("rule_disabled"),
|
||||
bundle.getString("conditions"), bundle.getString("actions")},
|
||||
new String[] {this.type, this.title, this.description, subSpacesYesNo, backgroundYesNo,
|
||||
new String[] {this.type, this.title, this.description, subSpacesYesNo, backgroundYesNo, ruleDisabledYesNo,
|
||||
conditionsSummary.toString(), actionsSummary.toString()});
|
||||
}
|
||||
|
||||
@@ -455,6 +458,22 @@ public class CreateRuleWizard extends BaseActionWizard
|
||||
this.applyToSubSpaces = applyToSubSpaces;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns whether the rule is disabled or not.
|
||||
*/
|
||||
public boolean getRuleDisabled()
|
||||
{
|
||||
return this.ruleDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ruleDisabled Sets whether the rule is disabled or not
|
||||
*/
|
||||
public void setRuleDisabled(boolean ruleDisabled)
|
||||
{
|
||||
this.ruleDisabled = ruleDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the type.
|
||||
*/
|
||||
@@ -668,6 +687,7 @@ public class CreateRuleWizard extends BaseActionWizard
|
||||
rule.setDescription(this.description);
|
||||
rule.applyToChildren(this.applyToSubSpaces);
|
||||
rule.setExecuteAsynchronously(this.runInBackground);
|
||||
rule.setRuleDisabled(this.ruleDisabled);
|
||||
|
||||
CompositeAction compositeAction = this.actionService.createCompositeAction();
|
||||
rule.setAction(compositeAction);
|
||||
|
@@ -52,6 +52,7 @@ public class EditRuleWizard extends CreateRuleWizard
|
||||
this.description = rule.getDescription();
|
||||
this.applyToSubSpaces = rule.isAppliedToChildren();
|
||||
this.runInBackground = rule.getExecuteAsynchronously();
|
||||
this.ruleDisabled = rule.getRuleDisabled();
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
|
||||
|
@@ -29,6 +29,7 @@ import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.executer.ExecuteAllRulesActionExecuter;
|
||||
import org.alfresco.repo.rule.RuleModel;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -57,6 +58,8 @@ public class RulesBean implements IContextListener
|
||||
{
|
||||
private static final String MSG_ERROR_DELETE_RULE = "error_delete_rule";
|
||||
private static final String MSG_REAPPLY_RULES_SUCCESS = "reapply_rules_success";
|
||||
private static final String MSG_IGNORE_INHERTIED_RULES = "ignore_inherited_rules";
|
||||
private static final String MSG_INCLUDE_INHERITED_RULES = "include_inherited_rules";
|
||||
private static final String LOCAL = "local";
|
||||
private static final String INHERITED = "inherited";
|
||||
|
||||
@@ -200,6 +203,52 @@ public class RulesBean implements IContextListener
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the label id from the ignore inhertied action
|
||||
*
|
||||
* @return the message id
|
||||
*/
|
||||
public String getIgnoreInheritedRulesLabelId()
|
||||
{
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
String result = Application.getMessage(fc, MSG_IGNORE_INHERTIED_RULES);
|
||||
|
||||
if (this.nodeService.hasAspect(this.getSpace().getNodeRef(), RuleModel.ASPECT_IGNORE_INHERITED_RULES) == true)
|
||||
{
|
||||
result = Application.getMessage(fc, MSG_INCLUDE_INHERITED_RULES);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean getIgnoreInheritedRules()
|
||||
{
|
||||
return this.nodeService.hasAspect(this.getSpace().getNodeRef(), RuleModel.ASPECT_IGNORE_INHERITED_RULES);
|
||||
}
|
||||
|
||||
/**
|
||||
* Action listener to ignore (or include) inherited rules.
|
||||
*
|
||||
* @param event the action event object
|
||||
*/
|
||||
public void ignoreInheritedRules(ActionEvent event)
|
||||
{
|
||||
NodeRef nodeRef = this.getSpace().getNodeRef();
|
||||
if (this.nodeService.hasAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES) == true)
|
||||
{
|
||||
this.nodeService.removeAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.nodeService.addAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES, null);
|
||||
}
|
||||
|
||||
// force the list to be re-queried when the page is refreshed
|
||||
if (this.richList != null)
|
||||
{
|
||||
this.richList.setValue(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current rule
|
||||
*
|
||||
|
Reference in New Issue
Block a user