org.alfresco.web.bean.rules
Class CreateRuleWizard

java.lang.Object
  extended by org.alfresco.web.bean.dialog.BaseDialogBean
      extended by org.alfresco.web.bean.wizard.BaseWizardBean
          extended by org.alfresco.web.bean.actions.BaseActionWizard
              extended by org.alfresco.web.bean.rules.CreateRuleWizard
All Implemented Interfaces:
java.io.Serializable, IDialogBean, IWizardBean
Direct Known Subclasses:
CreateCompositeRuleWizard

public class CreateRuleWizard
extends BaseActionWizard

Bean implementation for the "Create Rule" wizard

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.alfresco.web.bean.actions.BaseActionWizard
BaseActionWizard.RecipientWrapper
 
Field Summary
protected  javax.faces.model.DataModel allConditionsDataModel
           
protected  java.util.List allConditionsPropertiesList
           
protected  boolean applyToSubSpaces
           
protected  java.util.Map conditionHandlers
           
protected  java.util.Map currentConditionProperties
           
protected  java.lang.String description
           
protected  boolean editingCondition
           
protected static java.lang.String PROP_CONDITION_NAME
           
protected static java.lang.String PROP_CONDITION_SUMMARY
           
protected  boolean ruleDisabled
           
protected  RulesDialog rulesDialog
           
protected  boolean runInBackground
           
protected  java.lang.String selectedCondition
           
protected  java.lang.String title
           
protected  java.lang.String type
           
 
Fields inherited from class org.alfresco.web.bean.actions.BaseActionWizard
action, actionHandlers, actions, addableAspects, allActionsDataModel, allActionsProperties, commonAspects, currentActionProperties, currentEmailRecipientsDataModel, editingAction, encodings, ERROR_ACTION_CANNOT_BE_EXECUTE_REPEATEDLY, imageTransformers, NO_PARAMS_MARKER, objectTypes, PROP_ACTION_EMAIL_RECIPIENTS, PROP_ACTION_NAME, PROP_ACTION_SUMMARY, removableAspects, returnViewId, testableAspects, transformers, users, usingTemplate
 
Fields inherited from class org.alfresco.web.bean.dialog.BaseDialogBean
browseBean, isFinished, navigator, parameters
 
Constructor Summary
CreateRuleWizard()
           
 
Method Summary
 void addCondition()
          Adds the condition just setup by the user to the list of conditions for the rule
 void cancelAddCondition()
          Cancels the addition of the condition
 void editCondition()
          Sets up the context for editing existing condition values
protected  void editCondition(java.util.Map conditionToEdit)
           
protected  java.lang.String finishImpl(javax.faces.context.FacesContext context, java.lang.String outcome)
          Performs the actual processing for the wizard.
 javax.faces.model.DataModel getAllConditionsDataModel()
          Returns the properties for all the conditions as a JSF DataModel
 boolean getApplyToSubSpaces()
           
protected  org.alfresco.service.cmr.action.CompositeAction getCompositeAction(org.alfresco.service.cmr.rule.Rule rule)
           
 java.lang.String getCondition()
           
 java.util.Map getConditionProperties()
           
 java.util.List getConditions()
           
 java.lang.String getDescription()
           
protected  java.lang.String getErrorMessageId()
          The default message id to use in error messages
 boolean getFinishButtonDisabled()
          Determines whether the finish button on the dialog should be disabled
 java.util.List getMimeTypes()
          Returns a list of mime types in the system
 java.util.List getModelTypes()
          Returns a list of the types available in the repository
 boolean getNextButtonDisabled()
          Determines whether the next button on the wizard should be disabled
 boolean getRuleDisabled()
           
protected  org.alfresco.service.cmr.rule.RuleService getRuleService()
          Get the rule service
 boolean getRuleTypeDisabled()
          Determines whether the rule type drop down list should be enabled.
 boolean getRunInBackground()
           
 java.lang.String getSummary()
           
 java.lang.String getTitle()
           
 java.lang.String getType()
           
 java.util.List getTypes()
           
 void init(java.util.Map parameters)
          Initialises the dialog bean
protected  void initialiseConditionHandlers()
          Initialises the condition handlers from the current configuration.
 void promptForConditionValues()
          Displays the settings page for the current condition being added (if required)
 void removeCondition()
          Removes the requested condition from the list
 void setApplyToSubSpaces(boolean applyToSubSpaces)
           
 void setCondition(java.lang.String condition)
           
 void setDescription(java.lang.String description)
           
 void setRuleDisabled(boolean ruleDisabled)
           
 void setRulesDialog(RulesDialog RulesDialog)
          Sets the rulesDialog instance to be used by the wizard in edit mode
 void setRuleService(org.alfresco.service.cmr.rule.RuleService ruleService)
           
 void setRunInBackground(boolean runInBackground)
           
 void setTitle(java.lang.String title)
           
 void setType(java.lang.String type)
           
protected  java.lang.String setupRule(javax.faces.context.FacesContext context, org.alfresco.service.cmr.rule.Rule rule, java.lang.String outcome)
          Sets up the given rule using the current state of the wizard
 
Methods inherited from class org.alfresco.web.bean.actions.BaseActionWizard
addAction, addRecipient, cancelAddAction, discardTemplate, displayLabelForAuthority, editAction, getAction, getActionProperties, getActions, getActionService, getAddableAspects, getAllActionsDataModel, getAuthorityService, getCommonAspects, getEmailRecipients, getEmailRecipientsDataModel, getImageTransformers, getMimetypeService, getObjectTypes, getPersonService, getRemovableAspects, getTestableAspects, getTransformers, getUsers, getUsingTemplate, goToPage, initialiseActionHandlers, insertTemplate, isActionPresent, isFinishButtonDisabled, promptForActionValues, readAspectsConfig, removeAction, removeRecipient, setAction, setActionService, setAuthorityService, setMimetypeService, setPersonService, setUsingTemplate
 
Methods inherited from class org.alfresco.web.bean.wizard.BaseWizardBean
back, buildSummary, getBackButtonLabel, getDefaultCancelOutcome, getDefaultFinishOutcome, getFinishButtonLabel, getNextButtonLabel, getStepDescription, getStepTitle, next
 
Methods inherited from class org.alfresco.web.bean.dialog.BaseDialogBean
cancel, doPostCommitProcessing, finish, formatErrorMessage, getActionsConfigId, getActionsContext, getAdditionalButtons, getCancelButtonLabel, getCheckOutCheckInService, getContainerDescription, getContainerSubTitle, getContainerTitle, getDictionaryService, getErrorOutcome, getFileFolderService, getMoreActionsConfigId, getNamespaceService, getNodeService, getSearchService, getTransactionService, isFinished, restored, setBrowseBean, setDictionaryService, setFileFolderService, setNamespaceService, setNavigator, setNodeService, setSearchService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.web.bean.dialog.IDialogBean
cancel, finish, getActionsConfigId, getActionsContext, getAdditionalButtons, getCancelButtonLabel, getContainerDescription, getContainerSubTitle, getContainerTitle, getMoreActionsConfigId, isFinished, restored
 

Field Detail

PROP_CONDITION_NAME

protected static final java.lang.String PROP_CONDITION_NAME
See Also:
Constant Field Values

PROP_CONDITION_SUMMARY

protected static final java.lang.String PROP_CONDITION_SUMMARY
See Also:
Constant Field Values

rulesDialog

protected RulesDialog rulesDialog

conditionHandlers

protected java.util.Map conditionHandlers

currentConditionProperties

protected java.util.Map currentConditionProperties

allConditionsDataModel

protected transient javax.faces.model.DataModel allConditionsDataModel

allConditionsPropertiesList

protected java.util.List allConditionsPropertiesList

title

protected java.lang.String title

description

protected java.lang.String description

type

protected java.lang.String type

selectedCondition

protected java.lang.String selectedCondition

runInBackground

protected boolean runInBackground

applyToSubSpaces

protected boolean applyToSubSpaces

editingCondition

protected boolean editingCondition

ruleDisabled

protected boolean ruleDisabled
Constructor Detail

CreateRuleWizard

public CreateRuleWizard()
Method Detail

init

public void init(java.util.Map parameters)
Description copied from interface: IDialogBean
Initialises the dialog bean

Specified by:
init in interface IDialogBean
Overrides:
init in class BaseActionWizard
Parameters:
parameters - Map of parameters for the dialog

finishImpl

protected java.lang.String finishImpl(javax.faces.context.FacesContext context,
                                      java.lang.String outcome)
                               throws java.lang.Exception
Description copied from class: BaseDialogBean
Performs the actual processing for the wizard. NOTE: This method is called within the context of a transaction so no transaction handling is required

Specified by:
finishImpl in class BaseDialogBean
Parameters:
context - FacesContext
outcome - The default outcome
Returns:
The outcome
Throws:
java.lang.Exception

getNextButtonDisabled

public boolean getNextButtonDisabled()
Description copied from interface: IWizardBean
Determines whether the next button on the wizard should be disabled

Specified by:
getNextButtonDisabled in interface IWizardBean
Overrides:
getNextButtonDisabled in class BaseWizardBean
Returns:
true if the button should be disabled

getFinishButtonDisabled

public boolean getFinishButtonDisabled()
Description copied from interface: IDialogBean
Determines whether the finish button on the dialog should be disabled

Specified by:
getFinishButtonDisabled in interface IDialogBean
Overrides:
getFinishButtonDisabled in class BaseDialogBean
Returns:
true if the button should be disabled

getSummary

public java.lang.String getSummary()
Returns:
Returns the summary data for the wizard.

getErrorMessageId

protected java.lang.String getErrorMessageId()
Description copied from class: BaseDialogBean
The default message id to use in error messages

Overrides:
getErrorMessageId in class BaseDialogBean
Returns:
The error message lookup id

getCompositeAction

protected org.alfresco.service.cmr.action.CompositeAction getCompositeAction(org.alfresco.service.cmr.rule.Rule rule)

getRuleTypeDisabled

public boolean getRuleTypeDisabled()
Determines whether the rule type drop down list should be enabled.

Returns:
false as the rule type drop down should be enabled

getAllConditionsDataModel

public javax.faces.model.DataModel getAllConditionsDataModel()
Returns the properties for all the conditions as a JSF DataModel

Returns:
JSF DataModel representing the condition properties

getModelTypes

public java.util.List getModelTypes()
Returns a list of the types available in the repository

Returns:
List of SelectItem objects

getMimeTypes

public java.util.List getMimeTypes()
Returns a list of mime types in the system

Returns:
List of mime types

getConditions

public java.util.List getConditions()
Returns:
Returns the list of selectable conditions

getTypes

public java.util.List getTypes()
Returns:
Returns the types of rules that can be defined

getConditionProperties

public java.util.Map getConditionProperties()
Returns:
Gets the condition settings

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.

getTitle

public java.lang.String getTitle()
Returns:
Returns the title.

setTitle

public void setTitle(java.lang.String title)
Parameters:
title - The title to set.

getRunInBackground

public boolean getRunInBackground()
Returns:
Returns whether the rule should run in the background

setRunInBackground

public void setRunInBackground(boolean runInBackground)
Parameters:
runInBackground - Sets whether the rule should run in the background

getApplyToSubSpaces

public boolean getApplyToSubSpaces()
Returns:
Returns whether the rule should be applied to sub spaces i.e. if it gets inherited

setApplyToSubSpaces

public void setApplyToSubSpaces(boolean applyToSubSpaces)
Parameters:
applyToSubSpaces - Sets whether the rule will get applied to sub spaces

getRuleDisabled

public boolean getRuleDisabled()
Returns:
Returns whether the rule is disabled or not.

setRuleDisabled

public void setRuleDisabled(boolean ruleDisabled)
Parameters:
ruleDisabled - Sets whether the rule is disabled or not

getType

public java.lang.String getType()
Returns:
Returns the type.

setType

public void setType(java.lang.String type)
Parameters:
type - The type to set

getCondition

public java.lang.String getCondition()
Returns:
Returns the selected condition

setCondition

public void setCondition(java.lang.String condition)
Parameters:
condition - Sets the selected condition

promptForConditionValues

public void promptForConditionValues()
Displays the settings page for the current condition being added (if required)


editCondition

public void editCondition()
Sets up the context for editing existing condition values


editCondition

protected void editCondition(java.util.Map conditionToEdit)

addCondition

public void addCondition()
Adds the condition just setup by the user to the list of conditions for the rule


removeCondition

public void removeCondition()
Removes the requested condition from the list


cancelAddCondition

public void cancelAddCondition()
Cancels the addition of the condition


setRuleService

public void setRuleService(org.alfresco.service.cmr.rule.RuleService ruleService)
Parameters:
ruleService - Sets the rule service to use

getRuleService

protected org.alfresco.service.cmr.rule.RuleService getRuleService()
Description copied from class: BaseDialogBean
Get the rule service

Overrides:
getRuleService in class BaseDialogBean
Returns:
RuleService rule service

setRulesDialog

public void setRulesDialog(RulesDialog RulesDialog)
Sets the rulesDialog instance to be used by the wizard in edit mode

Parameters:
rulesDialog - The rulesDialog

setupRule

protected java.lang.String setupRule(javax.faces.context.FacesContext context,
                                     org.alfresco.service.cmr.rule.Rule rule,
                                     java.lang.String outcome)
Sets up the given rule using the current state of the wizard

Parameters:
context - FacesContext
rule - The rule to setup
outcome - The default outcome
Returns:
The outcome

initialiseConditionHandlers

protected void initialiseConditionHandlers()
Initialises the condition handlers from the current configuration.



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.