mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
No parameter conditions and actions can now be added with no client changes & made all summary strings use parameters in correct way
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2772 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -662,34 +662,32 @@ click_add_to_list=Click to add to list
|
|||||||
set_and_add_button=Set Values and Add
|
set_and_add_button=Set Values and Add
|
||||||
selected_conditions=Selected Rule Conditions
|
selected_conditions=Selected Rule Conditions
|
||||||
selected_actions=Selected Rule Actions
|
selected_actions=Selected Rule Actions
|
||||||
condition_no_condition=Match any item
|
condition_has_aspect=Item has aspect ''{0}''
|
||||||
condition_has_aspect=Item has aspect
|
condition_has_aspect_not=Item does not have aspect ''{0}''
|
||||||
condition_has_aspect_not=Item does not have aspect
|
condition_is_subtype=Item is a subtype of ''{0}''
|
||||||
condition_is_subtype=Item is a subtype of
|
condition_is_subtype_not=Item is not a subtype of ''{0}''
|
||||||
condition_is_subtype_not=Item is not a subtype of
|
condition_compare_mime_type=Item has a mimetype of ''{0}''
|
||||||
condition_compare_mime_type=Item has a mimetype of
|
condition_compare_mime_type_not=Item does not have a mimetype of ''{0}''
|
||||||
condition_compare_mime_type_not=Item does not have a mimetype of
|
condition_in_category=Item is in category ''{0}''
|
||||||
condition_in_category=Item is in category
|
condition_in_category_not=Item is not in category ''{0}''
|
||||||
condition_in_category_not=Item is not in category
|
condition_compare_property_value=Name property matches ''{0}''
|
||||||
condition_compare_property_value=Name property matches
|
condition_compare_property_value_not=Name property does not match ''{0}''
|
||||||
condition_compare_property_value_not=Name property does not match
|
action_add_features=Add aspect ''{0}''
|
||||||
action_add_features=Add aspect
|
action_remove_features=Remove aspect ''{0}''
|
||||||
action_remove_features=Remove aspect
|
action_specialise_type=Item is specialised to type ''{0}''
|
||||||
action_specialise_type=Item is specialised to type
|
|
||||||
action_simple_workflow={0} item to ''{1}'' if ''{2}'' action is taken.
|
action_simple_workflow={0} item to ''{1}'' if ''{2}'' action is taken.
|
||||||
action_link_category=Link to category
|
action_link_category=Link to category ''{0}''
|
||||||
action_transform=Copies content to ''{0}'' and transforms to ''{1}''
|
action_transform=Copies content to ''{0}'' and transforms to ''{1}''
|
||||||
action_transform_image=Copies image to ''{0}'' and transforms to ''{1}'' using option ''{2}''
|
action_transform_image=Copies image to ''{0}'' and transforms to ''{1}'' using option ''{2}''
|
||||||
action_copy=Copy to
|
action_copy=Copy to ''{0}''
|
||||||
action_extract_metadata=Extract metadata from content
|
action_move=Move to ''{0}''
|
||||||
action_move=Move to
|
action_mail=Send email to ''{0}''
|
||||||
action_mail=Send email to
|
|
||||||
action_mail_template=Use Template
|
action_mail_template=Use Template
|
||||||
action_check_in=Check in content as ''{0}'' with comment ''{1}''
|
action_check_in=Check in content as ''{0}'' with comment ''{1}''
|
||||||
action_check_out=Check out content to
|
action_check_out=Check out content to ''{0}''
|
||||||
action_set_property_value=Sets property
|
action_set_property_value=Sets property ''{0}''
|
||||||
action_import=Imports to
|
action_import=Imports to ''{0}''
|
||||||
action_script=Executes script
|
action_script=Executes script ''{0}''
|
||||||
action_script_select=Select a script to execute
|
action_script_select=Select a script to execute
|
||||||
not_condition_result=Check the item does not match the criteria above
|
not_condition_result=Check the item does not match the criteria above
|
||||||
space=Space
|
space=Space
|
||||||
|
@@ -22,7 +22,6 @@ import org.alfresco.model.ContentModel;
|
|||||||
import org.alfresco.repo.action.executer.AddFeaturesActionExecuter;
|
import org.alfresco.repo.action.executer.AddFeaturesActionExecuter;
|
||||||
import org.alfresco.repo.action.executer.CheckInActionExecuter;
|
import org.alfresco.repo.action.executer.CheckInActionExecuter;
|
||||||
import org.alfresco.repo.action.executer.CheckOutActionExecuter;
|
import org.alfresco.repo.action.executer.CheckOutActionExecuter;
|
||||||
import org.alfresco.repo.action.executer.ContentMetadataExtracter;
|
|
||||||
import org.alfresco.repo.action.executer.CopyActionExecuter;
|
import org.alfresco.repo.action.executer.CopyActionExecuter;
|
||||||
import org.alfresco.repo.action.executer.ImageTransformActionExecuter;
|
import org.alfresco.repo.action.executer.ImageTransformActionExecuter;
|
||||||
import org.alfresco.repo.action.executer.ImporterActionExecuter;
|
import org.alfresco.repo.action.executer.ImporterActionExecuter;
|
||||||
@@ -544,19 +543,30 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
actionProps.put(PROP_ACTION_NAME, this.action);
|
actionProps.put(PROP_ACTION_NAME, this.action);
|
||||||
this.currentActionProperties = actionProps;
|
this.currentActionProperties = actionProps;
|
||||||
|
|
||||||
// setup any defaults for the UI or handle actions with no parameters
|
// determine whether the action being added has any parameters
|
||||||
String overridenViewId = setupUIDefaultsForAction(actionProps);
|
ActionDefinition actionDef = this.actionService.getActionDefinition(this.action);
|
||||||
if (overridenViewId != null)
|
if (actionDef.hasParameterDefinitions())
|
||||||
{
|
{
|
||||||
viewId = overridenViewId;
|
// setup any defaults for the UI and override the viewId if necessary
|
||||||
|
String overridenViewId = setupUIDefaultsForAction(actionProps);
|
||||||
|
if (overridenViewId != null)
|
||||||
|
{
|
||||||
|
viewId = overridenViewId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// just add the action to the list and use the title as the summary
|
||||||
|
actionProps.put(PROP_ACTION_SUMMARY, actionDef.getTitle());
|
||||||
|
this.allActionsProperties.add(actionProps);
|
||||||
|
|
||||||
|
// come back to the same page we're on now as there are no params to collect
|
||||||
|
viewId = this.returnViewId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Added '" + this.action + "' action to list");
|
logger.debug("Added '" + this.action + "' action to list");
|
||||||
|
|
||||||
// reset the selected action drop down
|
|
||||||
this.action = null;
|
|
||||||
|
|
||||||
// go to the page to collect the settings
|
// go to the page to collect the settings
|
||||||
goToPage(context, viewId);
|
goToPage(context, viewId);
|
||||||
}
|
}
|
||||||
@@ -597,15 +607,14 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
this.currentActionProperties.put(PROP_ACTION_SUMMARY, summary);
|
this.currentActionProperties.put(PROP_ACTION_SUMMARY, summary);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.editingAction)
|
if (this.editingAction == false)
|
||||||
{
|
|
||||||
this.action = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this.allActionsProperties.add(this.currentActionProperties);
|
this.allActionsProperties.add(this.currentActionProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset the action drop down
|
||||||
|
this.action = null;
|
||||||
|
|
||||||
// refresh the wizard
|
// refresh the wizard
|
||||||
goToPage(context, this.returnViewId);
|
goToPage(context, this.returnViewId);
|
||||||
}
|
}
|
||||||
@@ -633,15 +642,14 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
*/
|
*/
|
||||||
public void cancelAddAction()
|
public void cancelAddAction()
|
||||||
{
|
{
|
||||||
if (this.editingAction)
|
if (this.editingAction == false)
|
||||||
{
|
|
||||||
this.action = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this.currentActionProperties.clear();
|
this.currentActionProperties.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset the action drop down
|
||||||
|
this.action = null;
|
||||||
|
|
||||||
// refresh the wizard
|
// refresh the wizard
|
||||||
goToPage(FacesContext.getCurrentInstance(), this.returnViewId);
|
goToPage(FacesContext.getCurrentInstance(), this.returnViewId);
|
||||||
}
|
}
|
||||||
@@ -823,15 +831,6 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
{
|
{
|
||||||
this.currentActionProperties.put(PROP_CHECKIN_MINOR, new Boolean(true));
|
this.currentActionProperties.put(PROP_CHECKIN_MINOR, new Boolean(true));
|
||||||
}
|
}
|
||||||
else if (ContentMetadataExtracter.NAME.equals(this.action))
|
|
||||||
{
|
|
||||||
// This one (currently) has no parameters, so just add it...
|
|
||||||
props.put(PROP_ACTION_SUMMARY, buildActionSummary());
|
|
||||||
this.allActionsProperties.add(props);
|
|
||||||
|
|
||||||
// come back to the same page we're on now
|
|
||||||
overridenViewId = this.returnViewId;
|
|
||||||
}
|
|
||||||
|
|
||||||
return overridenViewId;
|
return overridenViewId;
|
||||||
}
|
}
|
||||||
@@ -846,48 +845,48 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
protected Map<String, Serializable> buildActionParams()
|
protected Map<String, Serializable> buildActionParams()
|
||||||
{
|
{
|
||||||
// set up parameters maps for the action
|
// set up parameters maps for the action
|
||||||
Map<String, Serializable> actionParams = new HashMap<String, Serializable>();
|
Map<String, Serializable> repoParams = new HashMap<String, Serializable>();
|
||||||
|
|
||||||
if (AddFeaturesActionExecuter.NAME.equals(this.action))
|
if (AddFeaturesActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
QName aspect = Repository.resolveToQName((String)this.currentActionProperties.get(PROP_ASPECT));
|
QName aspect = Repository.resolveToQName((String)this.currentActionProperties.get(PROP_ASPECT));
|
||||||
actionParams.put(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, aspect);
|
repoParams.put(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, aspect);
|
||||||
}
|
}
|
||||||
else if (RemoveFeaturesActionExecuter.NAME.equals(this.action))
|
else if (RemoveFeaturesActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
QName aspect = Repository.resolveToQName((String)this.currentActionProperties.get(PROP_ASPECT));
|
QName aspect = Repository.resolveToQName((String)this.currentActionProperties.get(PROP_ASPECT));
|
||||||
actionParams.put(RemoveFeaturesActionExecuter.PARAM_ASPECT_NAME, aspect);
|
repoParams.put(RemoveFeaturesActionExecuter.PARAM_ASPECT_NAME, aspect);
|
||||||
}
|
}
|
||||||
else if (CopyActionExecuter.NAME.equals(this.action))
|
else if (CopyActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the destination space id to the action properties
|
// add the destination space id to the action properties
|
||||||
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
actionParams.put(CopyActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
repoParams.put(CopyActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
||||||
|
|
||||||
// add the type and name of the association to create when the copy
|
// add the type and name of the association to create when the copy
|
||||||
// is performed
|
// is performed
|
||||||
actionParams.put(CopyActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
repoParams.put(CopyActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
||||||
ContentModel.ASSOC_CONTAINS);
|
ContentModel.ASSOC_CONTAINS);
|
||||||
actionParams.put(CopyActionExecuter.PARAM_ASSOC_QNAME,
|
repoParams.put(CopyActionExecuter.PARAM_ASSOC_QNAME,
|
||||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "copy"));
|
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "copy"));
|
||||||
}
|
}
|
||||||
else if (MoveActionExecuter.NAME.equals(this.action))
|
else if (MoveActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the destination space id to the action properties
|
// add the destination space id to the action properties
|
||||||
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
actionParams.put(MoveActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
repoParams.put(MoveActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
||||||
|
|
||||||
// add the type and name of the association to create when the move
|
// add the type and name of the association to create when the move
|
||||||
// is performed
|
// is performed
|
||||||
actionParams.put(MoveActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
repoParams.put(MoveActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
||||||
ContentModel.ASSOC_CONTAINS);
|
ContentModel.ASSOC_CONTAINS);
|
||||||
actionParams.put(MoveActionExecuter.PARAM_ASSOC_QNAME,
|
repoParams.put(MoveActionExecuter.PARAM_ASSOC_QNAME,
|
||||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "move"));
|
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "move"));
|
||||||
}
|
}
|
||||||
else if (SimpleWorkflowActionExecuter.NAME.equals(this.action))
|
else if (SimpleWorkflowActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the approve step name
|
// add the approve step name
|
||||||
actionParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_STEP,
|
repoParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_STEP,
|
||||||
(String)this.currentActionProperties.get(PROP_APPROVE_STEP_NAME));
|
(String)this.currentActionProperties.get(PROP_APPROVE_STEP_NAME));
|
||||||
|
|
||||||
// add whether the approve step will copy or move the content
|
// add whether the approve step will copy or move the content
|
||||||
@@ -898,7 +897,7 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
approveMove = false;
|
approveMove = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
actionParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_MOVE, Boolean.valueOf(approveMove));
|
repoParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_MOVE, Boolean.valueOf(approveMove));
|
||||||
|
|
||||||
// add the destination folder of the content
|
// add the destination folder of the content
|
||||||
NodeRef approveDestNodeRef = null;
|
NodeRef approveDestNodeRef = null;
|
||||||
@@ -911,7 +910,7 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
{
|
{
|
||||||
approveDestNodeRef = new NodeRef((String)approveDestNode);
|
approveDestNodeRef = new NodeRef((String)approveDestNode);
|
||||||
}
|
}
|
||||||
actionParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_FOLDER, approveDestNodeRef);
|
repoParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_FOLDER, approveDestNodeRef);
|
||||||
|
|
||||||
// determine whether we have a reject step or not
|
// determine whether we have a reject step or not
|
||||||
boolean requireReject = true;
|
boolean requireReject = true;
|
||||||
@@ -924,7 +923,7 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
if (requireReject)
|
if (requireReject)
|
||||||
{
|
{
|
||||||
// add the reject step name
|
// add the reject step name
|
||||||
actionParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_STEP,
|
repoParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_STEP,
|
||||||
(String)this.currentActionProperties.get(PROP_REJECT_STEP_NAME));
|
(String)this.currentActionProperties.get(PROP_REJECT_STEP_NAME));
|
||||||
|
|
||||||
// add whether the reject step will copy or move the content
|
// add whether the reject step will copy or move the content
|
||||||
@@ -935,7 +934,7 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
rejectMove = false;
|
rejectMove = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
actionParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_MOVE, Boolean.valueOf(rejectMove));
|
repoParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_MOVE, Boolean.valueOf(rejectMove));
|
||||||
|
|
||||||
// add the destination folder of the content
|
// add the destination folder of the content
|
||||||
NodeRef rejectDestNodeRef = null;
|
NodeRef rejectDestNodeRef = null;
|
||||||
@@ -948,18 +947,18 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
{
|
{
|
||||||
rejectDestNodeRef = new NodeRef((String)rejectDestNode);
|
rejectDestNodeRef = new NodeRef((String)rejectDestNode);
|
||||||
}
|
}
|
||||||
actionParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_FOLDER, rejectDestNodeRef);
|
repoParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_FOLDER, rejectDestNodeRef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (LinkCategoryActionExecuter.NAME.equals(this.action))
|
else if (LinkCategoryActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the classifiable aspect
|
// add the classifiable aspect
|
||||||
actionParams.put(LinkCategoryActionExecuter.PARAM_CATEGORY_ASPECT,
|
repoParams.put(LinkCategoryActionExecuter.PARAM_CATEGORY_ASPECT,
|
||||||
ContentModel.ASPECT_GEN_CLASSIFIABLE);
|
ContentModel.ASPECT_GEN_CLASSIFIABLE);
|
||||||
|
|
||||||
// put the selected category in the action params
|
// put the selected category in the action params
|
||||||
NodeRef catNodeRef = (NodeRef)this.currentActionProperties.get(PROP_CATEGORY);
|
NodeRef catNodeRef = (NodeRef)this.currentActionProperties.get(PROP_CATEGORY);
|
||||||
actionParams.put(LinkCategoryActionExecuter.PARAM_CATEGORY_VALUE,
|
repoParams.put(LinkCategoryActionExecuter.PARAM_CATEGORY_VALUE,
|
||||||
catNodeRef);
|
catNodeRef);
|
||||||
}
|
}
|
||||||
else if (CheckOutActionExecuter.NAME.equals(this.action))
|
else if (CheckOutActionExecuter.NAME.equals(this.action))
|
||||||
@@ -967,61 +966,61 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
// specify the location the checked out working copy should go
|
// specify the location the checked out working copy should go
|
||||||
// add the destination space id to the action properties
|
// add the destination space id to the action properties
|
||||||
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
actionParams.put(CheckOutActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
repoParams.put(CheckOutActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
||||||
|
|
||||||
// add the type and name of the association to create when the
|
// add the type and name of the association to create when the
|
||||||
// check out is performed
|
// check out is performed
|
||||||
actionParams.put(CheckOutActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
repoParams.put(CheckOutActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
||||||
ContentModel.ASSOC_CONTAINS);
|
ContentModel.ASSOC_CONTAINS);
|
||||||
actionParams.put(CheckOutActionExecuter.PARAM_ASSOC_QNAME,
|
repoParams.put(CheckOutActionExecuter.PARAM_ASSOC_QNAME,
|
||||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "checkout"));
|
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "checkout"));
|
||||||
}
|
}
|
||||||
else if (CheckInActionExecuter.NAME.equals(this.action))
|
else if (CheckInActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the description for the checkin to the action params
|
// add the description for the checkin to the action params
|
||||||
actionParams.put(CheckInActionExecuter.PARAM_DESCRIPTION,
|
repoParams.put(CheckInActionExecuter.PARAM_DESCRIPTION,
|
||||||
this.currentActionProperties.get(PROP_CHECKIN_DESC));
|
this.currentActionProperties.get(PROP_CHECKIN_DESC));
|
||||||
|
|
||||||
// add the minor change flag
|
// add the minor change flag
|
||||||
actionParams.put(CheckInActionExecuter.PARAM_MINOR_CHANGE,
|
repoParams.put(CheckInActionExecuter.PARAM_MINOR_CHANGE,
|
||||||
this.currentActionProperties.get(PROP_CHECKIN_MINOR));
|
this.currentActionProperties.get(PROP_CHECKIN_MINOR));
|
||||||
}
|
}
|
||||||
else if (TransformActionExecuter.NAME.equals(this.action))
|
else if (TransformActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the transformer to use
|
// add the transformer to use
|
||||||
actionParams.put(TransformActionExecuter.PARAM_MIME_TYPE,
|
repoParams.put(TransformActionExecuter.PARAM_MIME_TYPE,
|
||||||
this.currentActionProperties.get(PROP_TRANSFORMER));
|
this.currentActionProperties.get(PROP_TRANSFORMER));
|
||||||
|
|
||||||
// add the destination space id to the action properties
|
// add the destination space id to the action properties
|
||||||
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
actionParams.put(TransformActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
repoParams.put(TransformActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
||||||
|
|
||||||
// add the type and name of the association to create when the copy
|
// add the type and name of the association to create when the copy
|
||||||
// is performed
|
// is performed
|
||||||
actionParams.put(TransformActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
repoParams.put(TransformActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
||||||
ContentModel.ASSOC_CONTAINS);
|
ContentModel.ASSOC_CONTAINS);
|
||||||
actionParams.put(TransformActionExecuter.PARAM_ASSOC_QNAME,
|
repoParams.put(TransformActionExecuter.PARAM_ASSOC_QNAME,
|
||||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "copy"));
|
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "copy"));
|
||||||
}
|
}
|
||||||
else if (ImageTransformActionExecuter.NAME.equals(this.action))
|
else if (ImageTransformActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the transformer to use
|
// add the transformer to use
|
||||||
actionParams.put(ImageTransformActionExecuter.PARAM_MIME_TYPE,
|
repoParams.put(ImageTransformActionExecuter.PARAM_MIME_TYPE,
|
||||||
this.currentActionProperties.get(PROP_IMAGE_TRANSFORMER));
|
this.currentActionProperties.get(PROP_IMAGE_TRANSFORMER));
|
||||||
|
|
||||||
// add the options
|
// add the options
|
||||||
actionParams.put(ImageTransformActionExecuter.PARAM_CONVERT_COMMAND,
|
repoParams.put(ImageTransformActionExecuter.PARAM_CONVERT_COMMAND,
|
||||||
this.currentActionProperties.get(PROP_TRANSFORM_OPTIONS));
|
this.currentActionProperties.get(PROP_TRANSFORM_OPTIONS));
|
||||||
|
|
||||||
// add the destination space id to the action properties
|
// add the destination space id to the action properties
|
||||||
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
actionParams.put(TransformActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
repoParams.put(TransformActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
||||||
|
|
||||||
// add the type and name of the association to create when the copy
|
// add the type and name of the association to create when the copy
|
||||||
// is performed
|
// is performed
|
||||||
actionParams.put(TransformActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
repoParams.put(TransformActionExecuter.PARAM_ASSOC_TYPE_QNAME,
|
||||||
ContentModel.ASSOC_CONTAINS);
|
ContentModel.ASSOC_CONTAINS);
|
||||||
actionParams.put(TransformActionExecuter.PARAM_ASSOC_QNAME,
|
repoParams.put(TransformActionExecuter.PARAM_ASSOC_QNAME,
|
||||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "copy"));
|
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "copy"));
|
||||||
}
|
}
|
||||||
else if (MailActionExecuter.NAME.equals(this.action))
|
else if (MailActionExecuter.NAME.equals(this.action))
|
||||||
@@ -1034,51 +1033,51 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
recipients.add(wrapper.authority);
|
recipients.add(wrapper.authority);
|
||||||
}
|
}
|
||||||
|
|
||||||
actionParams.put(MailActionExecuter.PARAM_TO_MANY, (Serializable)recipients);
|
repoParams.put(MailActionExecuter.PARAM_TO_MANY, (Serializable)recipients);
|
||||||
|
|
||||||
// add the actual email text to send
|
// add the actual email text to send
|
||||||
actionParams.put(MailActionExecuter.PARAM_TEXT,
|
repoParams.put(MailActionExecuter.PARAM_TEXT,
|
||||||
this.currentActionProperties.get(PROP_MESSAGE));
|
this.currentActionProperties.get(PROP_MESSAGE));
|
||||||
|
|
||||||
// add the subject for the email
|
// add the subject for the email
|
||||||
actionParams.put(MailActionExecuter.PARAM_SUBJECT,
|
repoParams.put(MailActionExecuter.PARAM_SUBJECT,
|
||||||
this.currentActionProperties.get(PROP_SUBJECT));
|
this.currentActionProperties.get(PROP_SUBJECT));
|
||||||
|
|
||||||
// add the from address
|
// add the from address
|
||||||
String from = Application.getClientConfig(FacesContext.getCurrentInstance()).getFromEmailAddress();
|
String from = Application.getClientConfig(FacesContext.getCurrentInstance()).getFromEmailAddress();
|
||||||
actionParams.put(MailActionExecuter.PARAM_FROM, from);
|
repoParams.put(MailActionExecuter.PARAM_FROM, from);
|
||||||
|
|
||||||
// add the template if one was selected by the user
|
// add the template if one was selected by the user
|
||||||
if (this.usingTemplate != null)
|
if (this.usingTemplate != null)
|
||||||
{
|
{
|
||||||
actionParams.put(MailActionExecuter.PARAM_TEMPLATE, new NodeRef(Repository.getStoreRef(), this.usingTemplate));
|
repoParams.put(MailActionExecuter.PARAM_TEMPLATE, new NodeRef(Repository.getStoreRef(), this.usingTemplate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ImporterActionExecuter.NAME.equals(this.action))
|
else if (ImporterActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the encoding
|
// add the encoding
|
||||||
actionParams.put(ImporterActionExecuter.PARAM_ENCODING, IMPORT_ENCODING);
|
repoParams.put(ImporterActionExecuter.PARAM_ENCODING, IMPORT_ENCODING);
|
||||||
|
|
||||||
// add the destination for the import
|
// add the destination for the import
|
||||||
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
NodeRef destNodeRef = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
actionParams.put(ImporterActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
repoParams.put(ImporterActionExecuter.PARAM_DESTINATION_FOLDER, destNodeRef);
|
||||||
}
|
}
|
||||||
else if (SpecialiseTypeActionExecuter.NAME.equals(this.action))
|
else if (SpecialiseTypeActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the specialisation type
|
// add the specialisation type
|
||||||
String objectType = (String)this.currentActionProperties.get(PROP_OBJECT_TYPE);
|
String objectType = (String)this.currentActionProperties.get(PROP_OBJECT_TYPE);
|
||||||
actionParams.put(SpecialiseTypeActionExecuter.PARAM_TYPE_NAME, QName.createQName(objectType));
|
repoParams.put(SpecialiseTypeActionExecuter.PARAM_TYPE_NAME, QName.createQName(objectType));
|
||||||
}
|
}
|
||||||
else if (ScriptActionExecutor.NAME.equals(this.action))
|
else if (ScriptActionExecutor.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
// add the selected script noderef to the action properties
|
// add the selected script noderef to the action properties
|
||||||
String id = (String)this.currentActionProperties.get(PROP_SCRIPT);
|
String id = (String)this.currentActionProperties.get(PROP_SCRIPT);
|
||||||
NodeRef scriptRef = new NodeRef(Repository.getStoreRef(), id);
|
NodeRef scriptRef = new NodeRef(Repository.getStoreRef(), id);
|
||||||
actionParams.put(ScriptActionExecutor.PARAM_SCRIPTREF, scriptRef);
|
repoParams.put(ScriptActionExecutor.PARAM_SCRIPTREF, scriptRef);
|
||||||
actionParams.put(ScriptActionExecutor.PARAM_SPACEREF, this.navigator.getCurrentNode().getNodeRef());
|
repoParams.put(ScriptActionExecutor.PARAM_SPACEREF, this.navigator.getCurrentNode().getNodeRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
return actionParams;
|
return repoParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1088,192 +1087,235 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
|||||||
*/
|
*/
|
||||||
protected String buildActionSummary()
|
protected String buildActionSummary()
|
||||||
{
|
{
|
||||||
String summaryResult = null;
|
String summary = null;
|
||||||
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
|
||||||
String actionName = (String)this.currentActionProperties.get(PROP_ACTION_NAME);
|
if (AddFeaturesActionExecuter.NAME.equals(this.action))
|
||||||
if (actionName != null)
|
|
||||||
{
|
{
|
||||||
StringBuilder summary = new StringBuilder();
|
String label = null;
|
||||||
summary.append(Application.getMessage(FacesContext.getCurrentInstance(),
|
String aspect = (String)this.currentActionProperties.get(PROP_ASPECT);
|
||||||
"action_" + actionName.replace('-', '_')));
|
|
||||||
summary.append(" ");
|
|
||||||
|
|
||||||
// define a summary to be added for each action
|
// find the label used by looking through the SelectItem list
|
||||||
if (AddFeaturesActionExecuter.NAME.equals(actionName) || RemoveFeaturesActionExecuter.NAME.equals(actionName))
|
for (SelectItem item : this.getAspects())
|
||||||
{
|
{
|
||||||
String aspect = (String)this.currentActionProperties.get(PROP_ASPECT);
|
if (item.getValue().equals(aspect))
|
||||||
|
|
||||||
// find the label used by looking through the SelectItem list
|
|
||||||
for (SelectItem item : this.getAspects())
|
|
||||||
{
|
{
|
||||||
if (item.getValue().equals(aspect))
|
label = item.getLabel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_add_features"),
|
||||||
|
new Object[] {label});
|
||||||
|
}
|
||||||
|
else if (RemoveFeaturesActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
String label = null;
|
||||||
|
String aspect = (String)this.currentActionProperties.get(PROP_ASPECT);
|
||||||
|
|
||||||
|
// find the label used by looking through the SelectItem list
|
||||||
|
for (SelectItem item : this.getAspects())
|
||||||
|
{
|
||||||
|
if (item.getValue().equals(aspect))
|
||||||
|
{
|
||||||
|
label = item.getLabel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_remove_features"),
|
||||||
|
new Object[] {label});
|
||||||
|
}
|
||||||
|
else if (CopyActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
|
String spaceName = Repository.getNameForNode(this.nodeService, space);
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_copy"),
|
||||||
|
new Object[] {spaceName});
|
||||||
|
}
|
||||||
|
else if (MoveActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
|
String spaceName = Repository.getNameForNode(this.nodeService, space);
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_move"),
|
||||||
|
new Object[] {spaceName});
|
||||||
|
}
|
||||||
|
else if (SimpleWorkflowActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
String approveStepName = (String)this.currentActionProperties.get(PROP_APPROVE_STEP_NAME);
|
||||||
|
String approveAction = (String)this.currentActionProperties.get(PROP_APPROVE_ACTION);
|
||||||
|
NodeRef approveFolder = (NodeRef)this.currentActionProperties.get(PROP_APPROVE_FOLDER);
|
||||||
|
String approveFolderName = Repository.getNameForNode(this.nodeService, approveFolder);
|
||||||
|
String approveMsg = MessageFormat.format(Application.getMessage(context, "action_simple_workflow"),
|
||||||
|
new Object[] {Application.getMessage(context, approveAction),
|
||||||
|
approveFolderName, approveStepName});
|
||||||
|
|
||||||
|
String rejectMsg = null;
|
||||||
|
String rejectStep = (String)this.currentActionProperties.get(PROP_REJECT_STEP_PRESENT);
|
||||||
|
if (rejectStep != null && "yes".equals(rejectStep))
|
||||||
|
{
|
||||||
|
String rejectStepName = (String)this.currentActionProperties.get(PROP_REJECT_STEP_NAME);
|
||||||
|
String rejectAction = (String)this.currentActionProperties.get(PROP_REJECT_ACTION);
|
||||||
|
NodeRef rejectFolder = (NodeRef)this.currentActionProperties.get(PROP_REJECT_FOLDER);
|
||||||
|
String rejectFolderName = Repository.getNameForNode(this.nodeService, rejectFolder);
|
||||||
|
rejectMsg = MessageFormat.format(Application.getMessage(context, "action_simple_workflow"),
|
||||||
|
new Object[] {Application.getMessage(context, rejectAction),
|
||||||
|
rejectFolderName, rejectStepName});
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder builder = new StringBuilder(approveMsg);
|
||||||
|
if (rejectMsg != null)
|
||||||
|
{
|
||||||
|
builder.append(" ");
|
||||||
|
builder.append(rejectMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = builder.toString();
|
||||||
|
}
|
||||||
|
else if (LinkCategoryActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
NodeRef cat = (NodeRef)this.currentActionProperties.get(PROP_CATEGORY);
|
||||||
|
String name = Repository.getNameForNode(this.nodeService, cat);
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_link_category"),
|
||||||
|
new Object[] {name});
|
||||||
|
}
|
||||||
|
else if (CheckOutActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
|
String spaceName = Repository.getNameForNode(this.nodeService, space);
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_check_out"),
|
||||||
|
new Object[] {spaceName});
|
||||||
|
}
|
||||||
|
else if (CheckInActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
String comment = (String)this.currentActionProperties.get(PROP_CHECKIN_DESC);
|
||||||
|
Boolean minorChange = (Boolean)this.currentActionProperties.get(PROP_CHECKIN_MINOR);
|
||||||
|
String change = null;
|
||||||
|
if (minorChange != null && minorChange.booleanValue())
|
||||||
|
{
|
||||||
|
change = Application.getMessage(context, "minor_change");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
change = Application.getMessage(context, "major_change");
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_check_in"),
|
||||||
|
new Object[] {change, comment});
|
||||||
|
}
|
||||||
|
else if (TransformActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
String label = null;
|
||||||
|
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
|
String name = Repository.getNameForNode(this.nodeService, space);
|
||||||
|
String transformer = (String)this.currentActionProperties.get(PROP_TRANSFORMER);
|
||||||
|
|
||||||
|
// find the label used by looking through the SelectItem list
|
||||||
|
for (SelectItem item : this.getTransformers())
|
||||||
|
{
|
||||||
|
if (item.getValue().equals(transformer))
|
||||||
|
{
|
||||||
|
label = item.getLabel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_transform"),
|
||||||
|
new Object[] {name, label});
|
||||||
|
}
|
||||||
|
else if (ImageTransformActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
String label = null;
|
||||||
|
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
|
String name = Repository.getNameForNode(this.nodeService, space);
|
||||||
|
String transformer = (String)this.currentActionProperties.get(PROP_IMAGE_TRANSFORMER);
|
||||||
|
String option = (String)this.currentActionProperties.get(PROP_TRANSFORM_OPTIONS);
|
||||||
|
|
||||||
|
// find the label used by looking through the SelectItem list
|
||||||
|
for (SelectItem item : this.getImageTransformers())
|
||||||
|
{
|
||||||
|
if (item.getValue().equals(transformer))
|
||||||
|
{
|
||||||
|
label = item.getLabel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_transform_image"),
|
||||||
|
new Object[] {name, label, option});
|
||||||
|
}
|
||||||
|
else if (MailActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
String addresses = (String)this.currentActionProperties.get(PROP_TO);
|
||||||
|
|
||||||
|
if (addresses == null || addresses.length() == 0)
|
||||||
|
{
|
||||||
|
if (this.emailRecipients.size() != 0)
|
||||||
|
{
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
|
for (int i=0; i<this.emailRecipients.size(); i++)
|
||||||
{
|
{
|
||||||
summary.append("'").append(item.getLabel()).append("'");
|
RecipientWrapper wrapper = this.emailRecipients.get(i);
|
||||||
break;
|
if (i != 0)
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (SimpleWorkflowActionExecuter.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
// just leave the summary as the title for now
|
|
||||||
String approveStepName = (String)this.currentActionProperties.get(PROP_APPROVE_STEP_NAME);
|
|
||||||
String approveAction = (String)this.currentActionProperties.get(PROP_APPROVE_ACTION);
|
|
||||||
NodeRef approveFolder = (NodeRef)this.currentActionProperties.get(PROP_APPROVE_FOLDER);
|
|
||||||
String approveFolderName = Repository.getNameForNode(this.nodeService, approveFolder);
|
|
||||||
String approveMsg = MessageFormat.format(summary.toString(),
|
|
||||||
new Object[] {Application.getMessage(FacesContext.getCurrentInstance(), approveAction),
|
|
||||||
approveFolderName, approveStepName});
|
|
||||||
|
|
||||||
String rejectStep = (String)this.currentActionProperties.get(PROP_REJECT_STEP_PRESENT);
|
|
||||||
|
|
||||||
String rejectMsg = null;
|
|
||||||
if (rejectStep != null && "yes".equals(rejectStep))
|
|
||||||
{
|
|
||||||
String rejectStepName = (String)this.currentActionProperties.get(PROP_REJECT_STEP_NAME);
|
|
||||||
String rejectAction = (String)this.currentActionProperties.get(PROP_REJECT_ACTION);
|
|
||||||
NodeRef rejectFolder = (NodeRef)this.currentActionProperties.get(PROP_REJECT_FOLDER);
|
|
||||||
String rejectFolderName = Repository.getNameForNode(this.nodeService, rejectFolder);
|
|
||||||
rejectMsg = MessageFormat.format(summary.toString(),
|
|
||||||
new Object[] {Application.getMessage(FacesContext.getCurrentInstance(), rejectAction),
|
|
||||||
rejectFolderName, rejectStepName});
|
|
||||||
}
|
|
||||||
|
|
||||||
summary = new StringBuilder(approveMsg);
|
|
||||||
if (rejectMsg != null)
|
|
||||||
{
|
|
||||||
summary.append(" ");
|
|
||||||
summary.append(rejectMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (LinkCategoryActionExecuter.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
NodeRef cat = (NodeRef)this.currentActionProperties.get(PROP_CATEGORY);
|
|
||||||
String name = Repository.getNameForNode(this.nodeService, cat);
|
|
||||||
summary.append("'").append(name).append("'");
|
|
||||||
}
|
|
||||||
else if (TransformActionExecuter.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
|
||||||
String name = Repository.getNameForNode(this.nodeService, space);
|
|
||||||
String transformer = (String)this.currentActionProperties.get(PROP_TRANSFORMER);
|
|
||||||
|
|
||||||
// find the label used by looking through the SelectItem list
|
|
||||||
for (SelectItem item : this.getTransformers())
|
|
||||||
{
|
|
||||||
if (item.getValue().equals(transformer))
|
|
||||||
{
|
|
||||||
transformer = item.getLabel();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// recreate the summary object as it contains parameters
|
|
||||||
String msg = MessageFormat.format(summary.toString(), new Object[] {name, transformer});
|
|
||||||
summary = new StringBuilder(msg);
|
|
||||||
}
|
|
||||||
else if (ImageTransformActionExecuter.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
|
||||||
String name = Repository.getNameForNode(this.nodeService, space);
|
|
||||||
String transformer = (String)this.currentActionProperties.get(PROP_IMAGE_TRANSFORMER);
|
|
||||||
String option = (String)this.currentActionProperties.get(PROP_TRANSFORM_OPTIONS);
|
|
||||||
|
|
||||||
// find the label used by looking through the SelectItem list
|
|
||||||
for (SelectItem item : this.getImageTransformers())
|
|
||||||
{
|
|
||||||
if (item.getValue().equals(transformer))
|
|
||||||
{
|
|
||||||
transformer = item.getLabel();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// recreate the summary object as it contains parameters
|
|
||||||
String msg = MessageFormat.format(summary.toString(), new Object[] {name, transformer, option});
|
|
||||||
summary = new StringBuilder(msg);
|
|
||||||
}
|
|
||||||
else if (CopyActionExecuter.NAME.equals(actionName) || "move".equals(actionName) || "check-out".equals(actionName))
|
|
||||||
{
|
|
||||||
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
|
||||||
String spaceName = Repository.getNameForNode(this.nodeService, space);
|
|
||||||
summary.append("'").append(spaceName).append("'");
|
|
||||||
}
|
|
||||||
else if (MailActionExecuter.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
String address = (String)this.currentActionProperties.get(PROP_TO);
|
|
||||||
if (address != null && address.length() != 0)
|
|
||||||
{
|
|
||||||
summary.append("'").append(address).append("'");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (this.emailRecipients.size() != 0)
|
|
||||||
{
|
|
||||||
summary.append("'");
|
|
||||||
for (int i=0; i<this.emailRecipients.size(); i++)
|
|
||||||
{
|
{
|
||||||
RecipientWrapper wrapper = this.emailRecipients.get(i);
|
builder.append(", ");
|
||||||
if (i != 0)
|
|
||||||
{
|
|
||||||
summary.append(", ");
|
|
||||||
}
|
|
||||||
summary.append(wrapper.getName());
|
|
||||||
}
|
}
|
||||||
summary.append("'");
|
builder.append(wrapper.getName());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (CheckInActionExecuter.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
String comment = (String)this.currentActionProperties.get(PROP_CHECKIN_DESC);
|
|
||||||
Boolean minorChange = (Boolean)this.currentActionProperties.get(PROP_CHECKIN_MINOR);
|
|
||||||
String change = null;
|
|
||||||
if (minorChange != null && minorChange.booleanValue())
|
|
||||||
{
|
|
||||||
change = Application.getMessage(FacesContext.getCurrentInstance(), "minor_change");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
change = Application.getMessage(FacesContext.getCurrentInstance(), "major_change");
|
|
||||||
}
|
|
||||||
|
|
||||||
// recreate the summary object as it contains parameters
|
addresses = builder.toString();
|
||||||
String msg = MessageFormat.format(summary.toString(), new Object[] {change, comment});
|
|
||||||
summary = new StringBuilder(msg);
|
|
||||||
}
|
|
||||||
else if (ImporterActionExecuter.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
|
||||||
String spaceName = Repository.getNameForNode(this.nodeService, space);
|
|
||||||
summary.append("'").append(spaceName).append("'");
|
|
||||||
}
|
|
||||||
else if (SpecialiseTypeActionExecuter.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
String label = null;
|
|
||||||
String objectType = (String)this.currentActionProperties.get(PROP_OBJECT_TYPE);
|
|
||||||
for (SelectItem item : getObjectTypes())
|
|
||||||
{
|
|
||||||
if (item.getValue().equals(objectType) == true)
|
|
||||||
{
|
|
||||||
label = item.getLabel();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
summary.append("'").append(label).append("'");
|
|
||||||
}
|
|
||||||
else if (ScriptActionExecutor.NAME.equals(actionName))
|
|
||||||
{
|
|
||||||
String id = (String)this.currentActionProperties.get(PROP_SCRIPT);
|
|
||||||
NodeRef scriptRef = new NodeRef(Repository.getStoreRef(), id);
|
|
||||||
String scriptName = Repository.getNameForNode(this.nodeService, scriptRef);
|
|
||||||
summary.append("'").append(scriptName).append("'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
summaryResult = summary.toString();
|
summary = MessageFormat.format(Application.getMessage(context, "action_mail"),
|
||||||
|
new Object[] {addresses});
|
||||||
|
}
|
||||||
|
else if (ImporterActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
|
||||||
|
String spaceName = Repository.getNameForNode(this.nodeService, space);
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_import"),
|
||||||
|
new Object[] {spaceName});
|
||||||
|
}
|
||||||
|
else if (SpecialiseTypeActionExecuter.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
String label = null;
|
||||||
|
String objectType = (String)this.currentActionProperties.get(PROP_OBJECT_TYPE);
|
||||||
|
for (SelectItem item : getObjectTypes())
|
||||||
|
{
|
||||||
|
if (item.getValue().equals(objectType) == true)
|
||||||
|
{
|
||||||
|
label = item.getLabel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_specialise_type"),
|
||||||
|
new Object[] {label});
|
||||||
|
}
|
||||||
|
else if (ScriptActionExecutor.NAME.equals(this.action))
|
||||||
|
{
|
||||||
|
String id = (String)this.currentActionProperties.get(PROP_SCRIPT);
|
||||||
|
NodeRef scriptRef = new NodeRef(Repository.getStoreRef(), id);
|
||||||
|
String scriptName = Repository.getNameForNode(this.nodeService, scriptRef);
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, "action_script"),
|
||||||
|
new Object[] {scriptName});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// as the default case (i.e. for actions with no parameters) use the title
|
||||||
|
ActionDefinition actionDef = this.actionService.getActionDefinition(this.action);
|
||||||
|
summary = actionDef.getTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
return summaryResult;
|
return summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package org.alfresco.web.bean.rules;
|
package org.alfresco.web.bean.rules;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -21,9 +22,6 @@ import org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator;
|
|||||||
import org.alfresco.repo.action.evaluator.HasAspectEvaluator;
|
import org.alfresco.repo.action.evaluator.HasAspectEvaluator;
|
||||||
import org.alfresco.repo.action.evaluator.InCategoryEvaluator;
|
import org.alfresco.repo.action.evaluator.InCategoryEvaluator;
|
||||||
import org.alfresco.repo.action.evaluator.IsSubTypeEvaluator;
|
import org.alfresco.repo.action.evaluator.IsSubTypeEvaluator;
|
||||||
import org.alfresco.repo.action.executer.CheckInActionExecuter;
|
|
||||||
import org.alfresco.repo.action.executer.ContentMetadataExtracter;
|
|
||||||
import org.alfresco.repo.action.executer.SimpleWorkflowActionExecuter;
|
|
||||||
import org.alfresco.service.cmr.action.Action;
|
import org.alfresco.service.cmr.action.Action;
|
||||||
import org.alfresco.service.cmr.action.ActionCondition;
|
import org.alfresco.service.cmr.action.ActionCondition;
|
||||||
import org.alfresco.service.cmr.action.ActionConditionDefinition;
|
import org.alfresco.service.cmr.action.ActionConditionDefinition;
|
||||||
@@ -231,11 +229,14 @@ public class CreateRuleWizard extends BaseActionWizard
|
|||||||
// add all the conditions to the rule
|
// add all the conditions to the rule
|
||||||
for (Map<String, Serializable> condParams : this.allConditionsProperties)
|
for (Map<String, Serializable> condParams : this.allConditionsProperties)
|
||||||
{
|
{
|
||||||
Map<String, Serializable> repoCondParams = buildConditionParams(condParams);
|
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
|
// add the condition to the rule
|
||||||
ActionCondition condition = this.actionService.createActionCondition(
|
ActionCondition condition = this.actionService.
|
||||||
(String)condParams.get(PROP_CONDITION_NAME));
|
createActionCondition(conditionName);
|
||||||
condition.setParameterValues(repoCondParams);
|
condition.setParameterValues(repoCondParams);
|
||||||
|
|
||||||
// specify whether the condition result should be inverted
|
// specify whether the condition result should be inverted
|
||||||
@@ -540,19 +541,32 @@ public class CreateRuleWizard extends BaseActionWizard
|
|||||||
condProps.put(PROP_CONDITION_NAME, this.condition);
|
condProps.put(PROP_CONDITION_NAME, this.condition);
|
||||||
this.currentConditionProperties = condProps;
|
this.currentConditionProperties = condProps;
|
||||||
|
|
||||||
// setup any defaults for the UI or handle actions with no parameters
|
// determine whether the condition being added has any parameters
|
||||||
String overridenViewId = setupUIDefaultsForCondition(condProps);
|
ActionConditionDefinition conditionDef = this.actionService.
|
||||||
if (overridenViewId != null)
|
getActionConditionDefinition(this.condition);
|
||||||
|
if (conditionDef.hasParameterDefinitions())
|
||||||
{
|
{
|
||||||
viewId = overridenViewId;
|
// setup any defaults for the UI and override the viewId if necessary
|
||||||
|
String overridenViewId = setupUIDefaultsForCondition(condProps);
|
||||||
|
if (overridenViewId != null)
|
||||||
|
{
|
||||||
|
viewId = overridenViewId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// just add the condition to the list and use the title as the summary
|
||||||
|
condProps.put(PROP_CONDITION_SUMMARY, conditionDef.getTitle());
|
||||||
|
condProps.put(PROP_CONDITION_NOT, Boolean.FALSE);
|
||||||
|
this.allConditionsProperties.add(condProps);
|
||||||
|
|
||||||
|
// come back to the same page we're on now as there are no params to collect
|
||||||
|
viewId = this.returnViewId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Added '" + this.condition + "' condition to list");
|
logger.debug("Added '" + this.condition + "' condition to list");
|
||||||
|
|
||||||
// reset the selected condition drop down
|
|
||||||
this.condition = null;
|
|
||||||
|
|
||||||
// go to the page to collect the settings
|
// go to the page to collect the settings
|
||||||
goToPage(context, viewId);
|
goToPage(context, viewId);
|
||||||
}
|
}
|
||||||
@@ -593,15 +607,14 @@ public class CreateRuleWizard extends BaseActionWizard
|
|||||||
this.currentConditionProperties.put(PROP_CONDITION_SUMMARY, summary);
|
this.currentConditionProperties.put(PROP_CONDITION_SUMMARY, summary);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.editingCondition)
|
if (this.editingCondition == false)
|
||||||
{
|
|
||||||
this.condition = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this.allConditionsProperties.add(this.currentConditionProperties);
|
this.allConditionsProperties.add(this.currentConditionProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset the action drop down
|
||||||
|
this.condition = null;
|
||||||
|
|
||||||
// refresh the wizard
|
// refresh the wizard
|
||||||
goToPage(context, this.returnViewId);
|
goToPage(context, this.returnViewId);
|
||||||
}
|
}
|
||||||
@@ -629,15 +642,14 @@ public class CreateRuleWizard extends BaseActionWizard
|
|||||||
*/
|
*/
|
||||||
public void cancelAddCondition()
|
public void cancelAddCondition()
|
||||||
{
|
{
|
||||||
if (this.editingCondition)
|
if (this.editingCondition == false)
|
||||||
{
|
|
||||||
this.condition = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this.currentConditionProperties.clear();
|
this.currentConditionProperties.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset the action drop down
|
||||||
|
this.condition = null;
|
||||||
|
|
||||||
// refresh the wizard
|
// refresh the wizard
|
||||||
goToPage(FacesContext.getCurrentInstance(), this.returnViewId);
|
goToPage(FacesContext.getCurrentInstance(), this.returnViewId);
|
||||||
}
|
}
|
||||||
@@ -678,59 +690,52 @@ public class CreateRuleWizard extends BaseActionWizard
|
|||||||
*/
|
*/
|
||||||
protected String setupUIDefaultsForCondition(HashMap<String, Serializable> props)
|
protected String setupUIDefaultsForCondition(HashMap<String, Serializable> props)
|
||||||
{
|
{
|
||||||
String overridenViewId = null;
|
// NOTE: none of the built in conditions have any defaults to setup
|
||||||
|
|
||||||
if ("no-condition".equals(this.condition))
|
return null;
|
||||||
{
|
|
||||||
// there are no parameters so just add it
|
|
||||||
props.put(PROP_CONDITION_SUMMARY, Application.getMessage(
|
|
||||||
FacesContext.getCurrentInstance(), "condition_no_condition"));
|
|
||||||
props.put(PROP_CONDITION_NOT, Boolean.FALSE);
|
|
||||||
this.allConditionsProperties.add(props);
|
|
||||||
|
|
||||||
// come back to the same page we're on now
|
|
||||||
overridenViewId = this.returnViewId;
|
|
||||||
}
|
|
||||||
|
|
||||||
return overridenViewId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the Map of properties for the given condition in the format the repo is expecting
|
* Builds the Map of properties for the given condition in the format the repo is expecting
|
||||||
*
|
*
|
||||||
* @param params The Map of properties built from the UI
|
|
||||||
* @return The Map the repo is expecting
|
* @return The Map the repo is expecting
|
||||||
*/
|
*/
|
||||||
protected Map<String, Serializable> buildConditionParams(Map<String, Serializable> params)
|
protected Map<String, Serializable> buildConditionParams()
|
||||||
{
|
{
|
||||||
Map<String, Serializable> repoParams = new HashMap<String, Serializable>(params.size());
|
Map<String, Serializable> repoParams = new HashMap<String, Serializable>();
|
||||||
|
|
||||||
String condName = (String)params.get(PROP_CONDITION_NAME);
|
if (ComparePropertyValueEvaluator.NAME.equals(this.condition))
|
||||||
if (ComparePropertyValueEvaluator.NAME.equals(condName))
|
|
||||||
{
|
{
|
||||||
repoParams.put(ComparePropertyValueEvaluator.PARAM_VALUE, params.get(PROP_CONTAINS_TEXT));
|
// add the text to compare
|
||||||
|
String text = (String)this.currentConditionProperties.get(PROP_CONTAINS_TEXT);
|
||||||
|
repoParams.put(ComparePropertyValueEvaluator.PARAM_VALUE, text);
|
||||||
}
|
}
|
||||||
else if (InCategoryEvaluator.NAME.equals(condName))
|
else if (InCategoryEvaluator.NAME.equals(this.condition))
|
||||||
{
|
{
|
||||||
// put the selected category in the condition params
|
// put the selected category in the condition params
|
||||||
repoParams.put(InCategoryEvaluator.PARAM_CATEGORY_VALUE, params.get(PROP_CATEGORY));
|
NodeRef nodeRef = (NodeRef)this.currentConditionProperties.get(PROP_CATEGORY);
|
||||||
|
repoParams.put(InCategoryEvaluator.PARAM_CATEGORY_VALUE, nodeRef);
|
||||||
|
|
||||||
// add the classifiable aspect
|
// add the classifiable aspect
|
||||||
repoParams.put(InCategoryEvaluator.PARAM_CATEGORY_ASPECT, ContentModel.ASPECT_GEN_CLASSIFIABLE);
|
repoParams.put(InCategoryEvaluator.PARAM_CATEGORY_ASPECT, ContentModel.ASPECT_GEN_CLASSIFIABLE);
|
||||||
}
|
}
|
||||||
else if (IsSubTypeEvaluator.NAME.equals(condName))
|
else if (IsSubTypeEvaluator.NAME.equals(this.condition))
|
||||||
{
|
{
|
||||||
// add the model type
|
// add the model type
|
||||||
repoParams.put(IsSubTypeEvaluator.PARAM_TYPE, QName.createQName((String)params.get(PROP_MODEL_TYPE)));
|
QName type = QName.createQName((String)this.currentConditionProperties.get(PROP_MODEL_TYPE));
|
||||||
|
repoParams.put(IsSubTypeEvaluator.PARAM_TYPE, type);
|
||||||
}
|
}
|
||||||
else if (HasAspectEvaluator.NAME.equals(condName))
|
else if (HasAspectEvaluator.NAME.equals(this.condition))
|
||||||
{
|
{
|
||||||
// add the aspect
|
// add the aspect
|
||||||
repoParams.put(HasAspectEvaluator.PARAM_ASPECT, QName.createQName((String)params.get(PROP_ASPECT)));
|
QName aspect = QName.createQName((String)this.currentConditionProperties.get(PROP_ASPECT));
|
||||||
|
repoParams.put(HasAspectEvaluator.PARAM_ASPECT, aspect);
|
||||||
}
|
}
|
||||||
else if (CompareMimeTypeEvaluator.NAME.equals(condName))
|
else if (CompareMimeTypeEvaluator.NAME.equals(this.condition))
|
||||||
{
|
{
|
||||||
repoParams.put(CompareMimeTypeEvaluator.PARAM_VALUE, params.get(PROP_MIMETYPE));
|
// add the mimetype
|
||||||
|
String mimeType = (String)this.currentConditionProperties.get(PROP_MIMETYPE);
|
||||||
|
repoParams.put(CompareMimeTypeEvaluator.PARAM_VALUE, mimeType);
|
||||||
}
|
}
|
||||||
|
|
||||||
return repoParams;
|
return repoParams;
|
||||||
@@ -743,85 +748,93 @@ public class CreateRuleWizard extends BaseActionWizard
|
|||||||
*/
|
*/
|
||||||
protected String buildConditionSummary()
|
protected String buildConditionSummary()
|
||||||
{
|
{
|
||||||
String summaryResult = null;
|
String summary = null;
|
||||||
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
Boolean not = (Boolean)this.currentConditionProperties.get(PROP_CONDITION_NOT);
|
||||||
|
|
||||||
String condName = (String)this.currentConditionProperties.get(PROP_CONDITION_NAME);
|
if (ComparePropertyValueEvaluator.NAME.equals(this.condition))
|
||||||
if (condName != null)
|
|
||||||
{
|
{
|
||||||
StringBuilder summary = new StringBuilder();
|
String msgId = not.booleanValue() ?
|
||||||
|
"condition_compare_property_value_not" : "condition_compare_property_value";
|
||||||
|
|
||||||
String msgId = "condition_" + condName.replace('-', '_');
|
String text = (String)this.currentConditionProperties.get(PROP_CONTAINS_TEXT);
|
||||||
|
|
||||||
// JSF is putting the boolean into the map as a Boolean object so we
|
summary = MessageFormat.format(Application.getMessage(context, msgId),
|
||||||
// need to handle that - adding a converter doesn't seem to help!
|
new Object[] {text});
|
||||||
Boolean not = (Boolean)this.currentConditionProperties.get(PROP_CONDITION_NOT);
|
}
|
||||||
if (not.booleanValue())
|
else if (InCategoryEvaluator.NAME.equals(this.condition))
|
||||||
|
{
|
||||||
|
String msgId = not.booleanValue() ? "condition_in_category_not" : "condition_in_category";
|
||||||
|
|
||||||
|
String name = Repository.getNameForNode(this.nodeService,
|
||||||
|
(NodeRef)this.currentConditionProperties.get(PROP_CATEGORY));
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, msgId),
|
||||||
|
new Object[] {name});
|
||||||
|
}
|
||||||
|
else if (IsSubTypeEvaluator.NAME.equals(this.condition))
|
||||||
|
{
|
||||||
|
String msgId = not.booleanValue() ? "condition_is_subtype_not" : "condition_is_subtype";
|
||||||
|
|
||||||
|
String label = null;
|
||||||
|
String typeName = (String)this.currentConditionProperties.get(PROP_MODEL_TYPE);
|
||||||
|
for (SelectItem item : this.getModelTypes())
|
||||||
{
|
{
|
||||||
msgId = msgId + "_not";
|
if (item.getValue().equals(typeName))
|
||||||
}
|
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
|
||||||
logger.debug("Looking up condition summary string: " + msgId);
|
|
||||||
|
|
||||||
summary.append(Application.getMessage(FacesContext.getCurrentInstance(), msgId));
|
|
||||||
summary.append(" ");
|
|
||||||
|
|
||||||
// define a summary to be added for each condition
|
|
||||||
if (InCategoryEvaluator.NAME.equals(condName))
|
|
||||||
{
|
|
||||||
String name = Repository.getNameForNode(this.nodeService,
|
|
||||||
(NodeRef)this.currentConditionProperties.get(PROP_CATEGORY));
|
|
||||||
summary.append("'").append(name).append("'");
|
|
||||||
}
|
|
||||||
else if (ComparePropertyValueEvaluator.NAME.equals(condName))
|
|
||||||
{
|
|
||||||
summary.append("'");
|
|
||||||
summary.append(this.currentConditionProperties.get(PROP_CONTAINS_TEXT));
|
|
||||||
summary.append("'");
|
|
||||||
}
|
|
||||||
else if (IsSubTypeEvaluator.NAME.equals(condName))
|
|
||||||
{
|
|
||||||
// find the label used by looking through the SelectItem list
|
|
||||||
String typeName = (String)this.currentConditionProperties.get(PROP_MODEL_TYPE);
|
|
||||||
for (SelectItem item : this.getModelTypes())
|
|
||||||
{
|
{
|
||||||
if (item.getValue().equals(typeName))
|
label = item.getLabel();
|
||||||
{
|
break;
|
||||||
summary.append("'").append(item.getLabel()).append("'");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (HasAspectEvaluator.NAME.equals(condName))
|
|
||||||
{
|
|
||||||
// find the label used by looking through the SelectItem list
|
|
||||||
String aspectName = (String)this.currentConditionProperties.get(PROP_ASPECT);
|
|
||||||
for (SelectItem item : this.getAspects())
|
|
||||||
{
|
|
||||||
if (item.getValue().equals(aspectName))
|
|
||||||
{
|
|
||||||
summary.append("'").append(item.getLabel()).append("'");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (CompareMimeTypeEvaluator.NAME.equals(condName))
|
|
||||||
{
|
|
||||||
String mimetype = (String)this.currentConditionProperties.get(PROP_MIMETYPE);
|
|
||||||
for (SelectItem item : this.getMimeTypes())
|
|
||||||
{
|
|
||||||
if (item.getValue().equals(mimetype))
|
|
||||||
{
|
|
||||||
summary.append("'").append(item.getLabel()).append("'");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
summaryResult = summary.toString();
|
summary = MessageFormat.format(Application.getMessage(context, msgId),
|
||||||
|
new Object[] {label});
|
||||||
|
}
|
||||||
|
else if (HasAspectEvaluator.NAME.equals(this.condition))
|
||||||
|
{
|
||||||
|
String msgId = not.booleanValue() ? "condition_has_aspect_not" : "condition_has_aspect";
|
||||||
|
|
||||||
|
String label = null;
|
||||||
|
String aspectName = (String)this.currentConditionProperties.get(PROP_ASPECT);
|
||||||
|
for (SelectItem item : this.getAspects())
|
||||||
|
{
|
||||||
|
if (item.getValue().equals(aspectName))
|
||||||
|
{
|
||||||
|
label = item.getLabel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, msgId),
|
||||||
|
new Object[] {label});
|
||||||
|
}
|
||||||
|
else if (CompareMimeTypeEvaluator.NAME.equals(this.condition))
|
||||||
|
{
|
||||||
|
String msgId = not.booleanValue() ? "condition_compare_mime_type_not" : "condition_compare_mime_type";
|
||||||
|
|
||||||
|
String label = null;
|
||||||
|
String mimetype = (String)this.currentConditionProperties.get(PROP_MIMETYPE);
|
||||||
|
for (SelectItem item : this.getMimeTypes())
|
||||||
|
{
|
||||||
|
if (item.getValue().equals(mimetype))
|
||||||
|
{
|
||||||
|
label = item.getLabel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
summary = MessageFormat.format(Application.getMessage(context, msgId),
|
||||||
|
new Object[] {label});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// as the default case (i.e. for conditions with no parameters) use the title
|
||||||
|
ActionConditionDefinition conditionDef = this.actionService.
|
||||||
|
getActionConditionDefinition(this.condition);
|
||||||
|
summary = conditionDef.getTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
return summaryResult;
|
return summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -175,27 +175,27 @@ public class EditRuleWizard extends CreateRuleWizard
|
|||||||
*/
|
*/
|
||||||
protected void populateAction(Map<String, Serializable> actionProps)
|
protected void populateAction(Map<String, Serializable> actionProps)
|
||||||
{
|
{
|
||||||
if (this.action.equals(AddFeaturesActionExecuter.NAME))
|
if (AddFeaturesActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
QName aspect = (QName)actionProps.get(AddFeaturesActionExecuter.PARAM_ASPECT_NAME);
|
QName aspect = (QName)actionProps.get(AddFeaturesActionExecuter.PARAM_ASPECT_NAME);
|
||||||
this.currentActionProperties.put(PROP_ASPECT, aspect.toString());
|
this.currentActionProperties.put(PROP_ASPECT, aspect.toString());
|
||||||
}
|
}
|
||||||
else if (this.action.equals(RemoveFeaturesActionExecuter.NAME))
|
else if (RemoveFeaturesActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
QName aspect = (QName)actionProps.get(RemoveFeaturesActionExecuter.PARAM_ASPECT_NAME);
|
QName aspect = (QName)actionProps.get(RemoveFeaturesActionExecuter.PARAM_ASPECT_NAME);
|
||||||
this.currentActionProperties.put(PROP_ASPECT, aspect.toString());
|
this.currentActionProperties.put(PROP_ASPECT, aspect.toString());
|
||||||
}
|
}
|
||||||
else if (this.action.equals(CopyActionExecuter.NAME))
|
else if (CopyActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
NodeRef destNodeRef = (NodeRef)actionProps.get(CopyActionExecuter.PARAM_DESTINATION_FOLDER);
|
NodeRef destNodeRef = (NodeRef)actionProps.get(CopyActionExecuter.PARAM_DESTINATION_FOLDER);
|
||||||
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
||||||
}
|
}
|
||||||
else if (this.action.equals(MoveActionExecuter.NAME))
|
else if (MoveActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
NodeRef destNodeRef = (NodeRef)actionProps.get(MoveActionExecuter.PARAM_DESTINATION_FOLDER);
|
NodeRef destNodeRef = (NodeRef)actionProps.get(MoveActionExecuter.PARAM_DESTINATION_FOLDER);
|
||||||
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
||||||
}
|
}
|
||||||
else if (this.action.equals(SimpleWorkflowActionExecuter.NAME))
|
else if (SimpleWorkflowActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
String approveStep = (String)actionProps.get(SimpleWorkflowActionExecuter.PARAM_APPROVE_STEP);
|
String approveStep = (String)actionProps.get(SimpleWorkflowActionExecuter.PARAM_APPROVE_STEP);
|
||||||
Boolean approveMove = (Boolean)actionProps.get(SimpleWorkflowActionExecuter.PARAM_APPROVE_MOVE);
|
Boolean approveMove = (Boolean)actionProps.get(SimpleWorkflowActionExecuter.PARAM_APPROVE_MOVE);
|
||||||
@@ -223,17 +223,17 @@ public class EditRuleWizard extends CreateRuleWizard
|
|||||||
this.currentActionProperties.put(PROP_REJECT_FOLDER, rejectFolderNode);
|
this.currentActionProperties.put(PROP_REJECT_FOLDER, rejectFolderNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.action.equals(LinkCategoryActionExecuter.NAME))
|
else if (LinkCategoryActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
NodeRef catNodeRef = (NodeRef)actionProps.get(LinkCategoryActionExecuter.PARAM_CATEGORY_VALUE);
|
NodeRef catNodeRef = (NodeRef)actionProps.get(LinkCategoryActionExecuter.PARAM_CATEGORY_VALUE);
|
||||||
this.currentActionProperties.put(PROP_CATEGORY, catNodeRef);
|
this.currentActionProperties.put(PROP_CATEGORY, catNodeRef);
|
||||||
}
|
}
|
||||||
else if (this.action.equals(CheckOutActionExecuter.NAME))
|
else if (CheckOutActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
NodeRef destNodeRef = (NodeRef)actionProps.get(CheckOutActionExecuter.PARAM_DESTINATION_FOLDER);
|
NodeRef destNodeRef = (NodeRef)actionProps.get(CheckOutActionExecuter.PARAM_DESTINATION_FOLDER);
|
||||||
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
||||||
}
|
}
|
||||||
else if (this.action.equals(CheckInActionExecuter.NAME))
|
else if (CheckInActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
String checkDesc = (String)actionProps.get(CheckInActionExecuter.PARAM_DESCRIPTION);
|
String checkDesc = (String)actionProps.get(CheckInActionExecuter.PARAM_DESCRIPTION);
|
||||||
this.currentActionProperties.put(PROP_CHECKIN_DESC, checkDesc);
|
this.currentActionProperties.put(PROP_CHECKIN_DESC, checkDesc);
|
||||||
@@ -241,7 +241,7 @@ public class EditRuleWizard extends CreateRuleWizard
|
|||||||
Boolean minorChange = (Boolean)actionProps.get(CheckInActionExecuter.PARAM_MINOR_CHANGE);
|
Boolean minorChange = (Boolean)actionProps.get(CheckInActionExecuter.PARAM_MINOR_CHANGE);
|
||||||
this.currentActionProperties.put(PROP_CHECKIN_MINOR, minorChange);
|
this.currentActionProperties.put(PROP_CHECKIN_MINOR, minorChange);
|
||||||
}
|
}
|
||||||
else if (this.action.equals(TransformActionExecuter.NAME))
|
else if (TransformActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
String transformer = (String)actionProps.get(TransformActionExecuter.PARAM_MIME_TYPE);
|
String transformer = (String)actionProps.get(TransformActionExecuter.PARAM_MIME_TYPE);
|
||||||
this.currentActionProperties.put(PROP_TRANSFORMER, transformer);
|
this.currentActionProperties.put(PROP_TRANSFORMER, transformer);
|
||||||
@@ -249,7 +249,7 @@ public class EditRuleWizard extends CreateRuleWizard
|
|||||||
NodeRef destNodeRef = (NodeRef)actionProps.get(CopyActionExecuter.PARAM_DESTINATION_FOLDER);
|
NodeRef destNodeRef = (NodeRef)actionProps.get(CopyActionExecuter.PARAM_DESTINATION_FOLDER);
|
||||||
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
||||||
}
|
}
|
||||||
else if (this.action.equals(ImageTransformActionExecuter.NAME))
|
else if (ImageTransformActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
String transformer = (String)actionProps.get(TransformActionExecuter.PARAM_MIME_TYPE);
|
String transformer = (String)actionProps.get(TransformActionExecuter.PARAM_MIME_TYPE);
|
||||||
this.currentActionProperties.put(PROP_IMAGE_TRANSFORMER, transformer);
|
this.currentActionProperties.put(PROP_IMAGE_TRANSFORMER, transformer);
|
||||||
@@ -260,7 +260,7 @@ public class EditRuleWizard extends CreateRuleWizard
|
|||||||
NodeRef destNodeRef = (NodeRef)actionProps.get(CopyActionExecuter.PARAM_DESTINATION_FOLDER);
|
NodeRef destNodeRef = (NodeRef)actionProps.get(CopyActionExecuter.PARAM_DESTINATION_FOLDER);
|
||||||
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
||||||
}
|
}
|
||||||
else if (this.action.equals(MailActionExecuter.NAME))
|
else if (MailActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
String subject = (String)actionProps.get(MailActionExecuter.PARAM_SUBJECT);
|
String subject = (String)actionProps.get(MailActionExecuter.PARAM_SUBJECT);
|
||||||
this.currentActionProperties.put(PROP_SUBJECT, subject);
|
this.currentActionProperties.put(PROP_SUBJECT, subject);
|
||||||
@@ -295,17 +295,17 @@ public class EditRuleWizard extends CreateRuleWizard
|
|||||||
this.usingTemplate = templateRef.getId();
|
this.usingTemplate = templateRef.getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.action.equals(ImporterActionExecuter.NAME))
|
else if (ImporterActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
NodeRef destNodeRef = (NodeRef)actionProps.get(ImporterActionExecuter.PARAM_DESTINATION_FOLDER);
|
NodeRef destNodeRef = (NodeRef)actionProps.get(ImporterActionExecuter.PARAM_DESTINATION_FOLDER);
|
||||||
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
this.currentActionProperties.put(PROP_DESTINATION, destNodeRef);
|
||||||
}
|
}
|
||||||
else if (this.action.equals(SpecialiseTypeActionExecuter.NAME) == true)
|
else if (SpecialiseTypeActionExecuter.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
QName specialiseType = (QName)actionProps.get(SpecialiseTypeActionExecuter.PARAM_TYPE_NAME);
|
QName specialiseType = (QName)actionProps.get(SpecialiseTypeActionExecuter.PARAM_TYPE_NAME);
|
||||||
this.currentActionProperties.put(PROP_OBJECT_TYPE, specialiseType.toString());
|
this.currentActionProperties.put(PROP_OBJECT_TYPE, specialiseType.toString());
|
||||||
}
|
}
|
||||||
else if (this.action.equals(ScriptActionExecutor.NAME))
|
else if (ScriptActionExecutor.NAME.equals(this.action))
|
||||||
{
|
{
|
||||||
NodeRef scriptRef = (NodeRef)actionProps.get(ScriptActionExecutor.PARAM_SCRIPTREF);
|
NodeRef scriptRef = (NodeRef)actionProps.get(ScriptActionExecutor.PARAM_SCRIPTREF);
|
||||||
this.currentActionProperties.put(PROP_SCRIPT, scriptRef.getId());
|
this.currentActionProperties.put(PROP_SCRIPT, scriptRef.getId());
|
||||||
|
Reference in New Issue
Block a user