diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index b358b04810..622919870f 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -755,6 +755,9 @@ home_space_name=Home Space Name title_admin_console=Administration Console admin_console=Administration Console admin_description=Use this view to perform system administration functions. +admin_limited_license=Licensed: {0} license issued on {1,date,short} limited to {2} days expiring {3,date,short} ({4} days remaining). +admin_unlimited_license=Licensed: {0} license issued on {1,date,short} (does not expire). +admin_invalid_license=Licensed: LICENSE INVALID - Alfresco Repository restricted to read-only capability. # UI Page Titles title_about=About Alfresco diff --git a/source/java/org/alfresco/web/bean/wizard/InviteUsersWizard.java b/source/java/org/alfresco/web/bean/wizard/InviteUsersWizard.java index fd1429a728..d997dbeb85 100644 --- a/source/java/org/alfresco/web/bean/wizard/InviteUsersWizard.java +++ b/source/java/org/alfresco/web/bean/wizard/InviteUsersWizard.java @@ -397,7 +397,7 @@ public abstract class InviteUsersWizard extends AbstractWizardBean int offset = PermissionService.GROUP_PREFIX.length(); for (String group : groups) { - if (group.toLowerCase().indexOf(containsLower) != -1) + if (group.toLowerCase().indexOf(containsLower, offset) != -1) { results.add(new SortableSelectItem(group, group.substring(offset), group)); } diff --git a/source/java/org/alfresco/web/bean/wizard/NewRuleWizard.java b/source/java/org/alfresco/web/bean/wizard/NewRuleWizard.java index cb621e3b72..762178a2f1 100644 --- a/source/java/org/alfresco/web/bean/wizard/NewRuleWizard.java +++ b/source/java/org/alfresco/web/bean/wizard/NewRuleWizard.java @@ -136,99 +136,108 @@ public class NewRuleWizard extends BaseActionWizard private DataModel allActionsDataModel; private DataModel allConditionsDataModel; + private boolean isFinished = false; + /** * Deals with the finish button being pressed * * @return outcome */ - public String finish() + public synchronized String finish() { String outcome = FINISH_OUTCOME; - UserTransaction tx = null; - - try + if (isFinished == false) { - tx = Repository.getUserTransaction(FacesContext.getCurrentInstance()); - tx.begin(); - - // get hold of the space the rule will apply to and make sure - // it is actionable - Node currentSpace = browseBean.getActionSpace(); - - Rule rule = null; - - if (this.editMode) - { - // update the existing rule in the repository - rule = this.rulesBean.getCurrentRule(); - - // remove all the conditions and actions from the current rule - rule.removeAllActionConditions(); - rule.removeAllActions(); - } - else - { - rule = this.ruleService.createRule(this.getType()); - } - - // setup the rule and add it to the space - rule.setTitle(this.title); - rule.setDescription(this.description); - rule.applyToChildren(this.applyToSubSpaces); - rule.setExecuteAsynchronously(this.runInBackground); - - // add all the conditions to the rule - for (Map condParams : this.allConditionsProperties) - { - Map repoCondParams = buildConditionParams(condParams); - - // add the condition to the rule - ActionCondition condition = this.actionService.createActionCondition( - (String)condParams.get(PROP_CONDITION_NAME)); - condition.setParameterValues(repoCondParams); - - // specify whether the condition result should be inverted - Boolean not = (Boolean)condParams.get(PROP_CONDITION_NOT); - condition.setInvertCondition(((Boolean)not).booleanValue()); - - rule.addActionCondition(condition); - } - - // add all the actions to the rule - for (Map actionParams : this.allActionsProperties) - { - // use the base class version of buildActionParams(), but for this we need - // to setup the currentActionProperties and action variables - String actionName = (String)actionParams.get(PROP_ACTION_NAME); - this.action = actionName; - this.currentActionProperties = actionParams; - Map repoActionParams = buildActionParams(); - - // add the action to the rule - Action action = this.actionService.createAction(actionName); - action.setParameterValues(repoActionParams); - rule.addAction(action); - } - - // Save the rule - this.ruleService.saveRule(currentSpace.getNodeRef(), rule); - - if (logger.isDebugEnabled()) - { - logger.debug(this.editMode ? "Updated" : "Added" + " rule '" + this.title + "'"); - } - - // commit the transaction - tx.commit(); - } - catch (Throwable e) - { - // rollback the transaction - try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} - Utils.addErrorMessage(MessageFormat.format(Application.getMessage( - FacesContext.getCurrentInstance(), ERROR), e.getMessage()), e); - outcome = null; + isFinished = true; + + UserTransaction tx = null; + + try + { + tx = Repository.getUserTransaction(FacesContext.getCurrentInstance()); + tx.begin(); + + // get hold of the space the rule will apply to and make sure + // it is actionable + Node currentSpace = browseBean.getActionSpace(); + + Rule rule = null; + + if (this.editMode) + { + // update the existing rule in the repository + rule = this.rulesBean.getCurrentRule(); + + // remove all the conditions and actions from the current rule + rule.removeAllActionConditions(); + rule.removeAllActions(); + } + else + { + rule = this.ruleService.createRule(this.getType()); + } + + // setup the rule and add it to the space + rule.setTitle(this.title); + rule.setDescription(this.description); + rule.applyToChildren(this.applyToSubSpaces); + rule.setExecuteAsynchronously(this.runInBackground); + + // add all the conditions to the rule + for (Map condParams : this.allConditionsProperties) + { + Map repoCondParams = buildConditionParams(condParams); + + // add the condition to the rule + ActionCondition condition = this.actionService.createActionCondition( + (String)condParams.get(PROP_CONDITION_NAME)); + condition.setParameterValues(repoCondParams); + + // specify whether the condition result should be inverted + Boolean not = (Boolean)condParams.get(PROP_CONDITION_NOT); + condition.setInvertCondition(((Boolean)not).booleanValue()); + + rule.addActionCondition(condition); + } + + // add all the actions to the rule + for (Map actionParams : this.allActionsProperties) + { + // use the base class version of buildActionParams(), but for this we need + // to setup the currentActionProperties and action variables + String actionName = (String)actionParams.get(PROP_ACTION_NAME); + this.action = actionName; + this.currentActionProperties = actionParams; + Map repoActionParams = buildActionParams(); + + // add the action to the rule + Action action = this.actionService.createAction(actionName); + action.setParameterValues(repoActionParams); + rule.addAction(action); + } + + // Save the rule + this.ruleService.saveRule(currentSpace.getNodeRef(), rule); + + if (logger.isDebugEnabled()) + { + logger.debug(this.editMode ? "Updated" : "Added" + " rule '" + this.title + "'"); + } + + // commit the transaction + tx.commit(); + } + catch (Throwable e) + { + // rollback the transaction + try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} + Utils.addErrorMessage(MessageFormat.format(Application.getMessage( + FacesContext.getCurrentInstance(), ERROR), e.getMessage()), e); + outcome = null; + + isFinished = false; + } } return outcome; @@ -678,6 +687,8 @@ public class NewRuleWizard extends BaseActionWizard this.allConditionsProperties = new ArrayList>(); this.allActionsProperties = new ArrayList>(); + + this.isFinished = false; } /**