diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml
index 751c8d77ff..d8a582688a 100644
--- a/config/alfresco/web-client-config-dialogs.xml
+++ b/config/alfresco/web-client-config-dialogs.xml
@@ -319,7 +319,7 @@
-
diff --git a/config/alfresco/web-client-config-wcm-actions.xml b/config/alfresco/web-client-config-wcm-actions.xml
index 2d96198888..f4b29cc721 100644
--- a/config/alfresco/web-client-config-wcm-actions.xml
+++ b/config/alfresco/web-client-config-wcm-actions.xml
@@ -127,6 +127,7 @@
CreateChildren
+ org.alfresco.web.action.evaluator.WCMStagingReadonlyEvaluator
sandbox_create
/images/icons/new_content.gif
wizard:createWebContent
@@ -137,6 +138,7 @@
CreateChildren
+ org.alfresco.web.action.evaluator.WCMStagingReadonlyEvaluator
create_folder
/images/icons/create_space.gif
dialog:createAvmFolder
@@ -157,6 +159,7 @@
CreateChildren
+ org.alfresco.web.action.evaluator.WCMStagingReadonlyEvaluator
add_content
/images/icons/add.gif
addAvmContent
@@ -168,6 +171,7 @@
CreateChildren
+ org.alfresco.web.action.evaluator.WCMStagingReadonlyEvaluator
import_website_content
/images/icons/import_website.gif
dialog:importContent
@@ -304,22 +308,22 @@
-
+
false
-
+
diff --git a/config/alfresco/web-client-config-workflow-actions.xml b/config/alfresco/web-client-config-workflow-actions.xml
index af1a26b16c..6d20345075 100644
--- a/config/alfresco/web-client-config-workflow-actions.xml
+++ b/config/alfresco/web-client-config-workflow-actions.xml
@@ -246,15 +246,15 @@
-
+
-
+
@@ -293,19 +293,19 @@
-
+
-
+
diff --git a/config/alfresco/web-client-config.xml b/config/alfresco/web-client-config.xml
index a86cfe4606..afa7a48ffa 100644
--- a/config/alfresco/web-client-config.xml
+++ b/config/alfresco/web-client-config.xml
@@ -81,6 +81,10 @@
true
true
+
+
+ 2
+ 3
diff --git a/source/java/org/alfresco/web/action/evaluator/WCMStagingReadonlyEvaluator.java b/source/java/org/alfresco/web/action/evaluator/WCMStagingReadonlyEvaluator.java
new file mode 100644
index 0000000000..689f450147
--- /dev/null
+++ b/source/java/org/alfresco/web/action/evaluator/WCMStagingReadonlyEvaluator.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing
+ */
+package org.alfresco.web.action.evaluator;
+
+import org.alfresco.repo.avm.AVMNodeConverter;
+import org.alfresco.web.action.ActionEvaluator;
+import org.alfresco.web.bean.repository.Node;
+import org.alfresco.web.bean.wcm.AVMUtil;
+
+/**
+ * Evaluator to return if a item path is not within a staging area sandbox.
+ *
+ * @author Kevin Roast
+ */
+public class WCMStagingReadonlyEvaluator implements ActionEvaluator
+{
+ /**
+ * @return true if the item is not locked by another user
+ */
+ public boolean evaluate(final Node node)
+ {
+ String path = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef()).getSecond();
+ return !AVMUtil.isMainStore(AVMUtil.getStoreName(path));
+ }
+}
diff --git a/source/java/org/alfresco/web/action/evaluator/WCMWorkflowEvaluator.java b/source/java/org/alfresco/web/action/evaluator/WCMWorkflowEvaluator.java
index 68ba99d708..72ab39905f 100644
--- a/source/java/org/alfresco/web/action/evaluator/WCMWorkflowEvaluator.java
+++ b/source/java/org/alfresco/web/action/evaluator/WCMWorkflowEvaluator.java
@@ -46,15 +46,15 @@ public class WCMWorkflowEvaluator extends WCMLockEvaluator
*/
public boolean evaluate(final Node node)
{
- final Pair p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
- final String path = p.getSecond();
-
boolean proceed = false;
- if (AVMUtil.isWorkflowStore(AVMUtil.getStoreName(path)) || super.evaluate(node))
+ if (super.evaluate(node))
{
final FacesContext facesContext = FacesContext.getCurrentInstance();
final AVMService avmService = Repository.getServiceRegistry(facesContext).getAVMService();
+ final Pair p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
+ final String path = p.getSecond();
+
// evaluate to true if we are not deleted and within a workflow store (i.e. list of resources
// in the task dialog) or not part of an already in-progress workflow
proceed = ((AVMUtil.isWorkflowStore(AVMUtil.getStoreName(path)) ||
diff --git a/source/java/org/alfresco/web/bean/LoginBean.java b/source/java/org/alfresco/web/bean/LoginBean.java
index 03b2ceff1d..0c80131297 100644
--- a/source/java/org/alfresco/web/bean/LoginBean.java
+++ b/source/java/org/alfresco/web/bean/LoginBean.java
@@ -184,11 +184,13 @@ public class LoginBean
public void validatePassword(FacesContext context, UIComponent component, Object value)
throws ValidatorException
{
+ int minPasswordLength = Application.getClientConfig(context).getMinPasswordLength();
+
String pass = (String) value;
- if (pass.length() < 3 || pass.length() > 32)
+ if (pass.length() < minPasswordLength || pass.length() > 32)
{
String err = MessageFormat.format(Application.getMessage(context, MSG_PASSWORD_LENGTH),
- new Object[]{3, 32});
+ new Object[]{minPasswordLength, 32});
throw new ValidatorException(new FacesMessage(err));
}
}
@@ -199,13 +201,15 @@ public class LoginBean
public void validateUsername(FacesContext context, UIComponent component, Object value)
throws ValidatorException
{
+ int minUsernameLength = Application.getClientConfig(context).getMinUsernameLength();
+
String name = (String) value;
name = name.trim();
- if (name.length() < 2 || name.length() > 256)
+ if (name.length() < minUsernameLength || name.length() > 256)
{
String err = MessageFormat.format(Application.getMessage(context, MSG_USERNAME_LENGTH),
- new Object[]{2, 256});
+ new Object[]{minUsernameLength, 256});
throw new ValidatorException(new FacesMessage(err));
}
if (name.indexOf('\'') != -1 || name.indexOf('"') != -1 || name.indexOf('\\') != -1)
diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java
index 42e3091030..582883d5c5 100644
--- a/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java
+++ b/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java
@@ -52,6 +52,7 @@ import org.alfresco.repo.workflow.WorkflowModel;
import org.alfresco.service.cmr.avm.AVMExistsException;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
+import org.alfresco.service.cmr.avm.locking.AVMLockingService;
import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
@@ -105,6 +106,7 @@ public class CreateWebContentWizard extends BaseContentWizard
protected boolean formSelectDisabled = false;
protected boolean startWorkflow = false;
+ protected AVMLockingService avmLockingService;
protected AVMService avmService;
protected AVMSyncService avmSyncService;
protected AVMBrowseBean avmBrowseBean;
@@ -114,11 +116,19 @@ public class CreateWebContentWizard extends BaseContentWizard
/**
* @param avmService The AVMService to set.
*/
- public void setAvmService(AVMService avmService)
+ public void setAvmService(final AVMService avmService)
{
this.avmService = avmService;
}
+ /**
+ * @param avmLockingService The AVMLockingService to set.
+ */
+ public void setAvmLockingService(final AVMLockingService avmLockingService)
+ {
+ this.avmLockingService = avmLockingService;
+ }
+
/**
* @param avmSyncService The AVMSyncService to set.
*/
@@ -130,7 +140,7 @@ public class CreateWebContentWizard extends BaseContentWizard
/**
* @param avmBrowseBean The AVMBrowseBean to set.
*/
- public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
+ public void setAvmBrowseBean(final AVMBrowseBean avmBrowseBean)
{
this.avmBrowseBean = avmBrowseBean;
}
@@ -299,13 +309,30 @@ public class CreateWebContentWizard extends BaseContentWizard
if (LOGGER.isDebugEnabled())
{
- for (AVMDifference diff : diffList)
+ for (final AVMDifference diff : diffList)
{
LOGGER.debug("updating main store with " + diff.getSourcePath());
}
}
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
-
+ for (final AVMDifference diff : diffList)
+ {
+ final String path = diff.getDestinationPath();
+ if (LOGGER.isDebugEnabled())
+ {
+ LOGGER.debug("modifying lock on " + path +
+ ". chaging store from " +
+ this.avmLockingService.getLock(AVMUtil.getStoreId(path),
+ AVMUtil.getStoreRelativePath(path)).getStore() +
+ " to " + AVMUtil.getStoreName(path));
+ }
+ this.avmLockingService.modifyLock(AVMUtil.getStoreId(path),
+ AVMUtil.getStoreRelativePath(path),
+ null,
+ AVMUtil.getStoreName(path),
+ null,
+ null);
+ }
if (this.startWorkflow)
{
final List submitNodes =
diff --git a/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java b/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java
index 2d3a93ea9a..6749cf29dc 100644
--- a/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java
+++ b/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java
@@ -37,6 +37,7 @@ import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
+import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.cmr.model.FileExistsException;
import org.alfresco.service.cmr.repository.ContentData;
@@ -159,10 +160,15 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog
}
// Translate to what AVMService wants to take.
+ DictionaryService dd = Repository.getServiceRegistry(context).getDictionaryService();
Map avmProps = new HashMap();
for (Map.Entry entry : repoProps.entrySet())
{
- avmProps.put(entry.getKey(), new PropertyValue(entry.getKey(), entry.getValue()));
+ PropertyDefinition propDef = dd.getProperty(entry.getKey());
+ if (propDef != null)
+ {
+ avmProps.put(entry.getKey(), new PropertyValue(propDef.getDataType().getName(), entry.getValue()));
+ }
}
// send the properties back to the repository
this.avmService.setNodeProperties(AVMNodeConverter.ToAVMVersionPath(nodeRef).getSecond(), avmProps);
diff --git a/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java b/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java
index 3e10ae013d..2e3eab1907 100644
--- a/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java
+++ b/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java
@@ -41,10 +41,13 @@ import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
+import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
+import org.alfresco.service.cmr.dictionary.TypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.bean.repository.Node;
+import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.spaces.EditSpaceDialog;
import org.alfresco.web.ui.common.component.UIListItem;
@@ -145,10 +148,15 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog
}
// Translate to what AVMService wants to take.
+ DictionaryService dd = Repository.getServiceRegistry(context).getDictionaryService();
Map avmProps = new HashMap();
for (Map.Entry entry : repoProps.entrySet())
{
- avmProps.put(entry.getKey(), new PropertyValue(entry.getKey(), entry.getValue()));
+ PropertyDefinition propDef = dd.getProperty(entry.getKey());
+ if (propDef != null)
+ {
+ avmProps.put(entry.getKey(), new PropertyValue(propDef.getDataType().getName(), entry.getValue()));
+ }
}
// send the properties back to the repository
diff --git a/source/java/org/alfresco/web/bean/wcm/ManageChangeRequestTaskDialog.java b/source/java/org/alfresco/web/bean/wcm/ManageChangeRequestTaskDialog.java
index 281681948e..14145c937a 100644
--- a/source/java/org/alfresco/web/bean/wcm/ManageChangeRequestTaskDialog.java
+++ b/source/java/org/alfresco/web/bean/wcm/ManageChangeRequestTaskDialog.java
@@ -72,6 +72,10 @@ public class ManageChangeRequestTaskDialog extends ManageTaskDialog
{
super.init(parameters);
+ // reset any link validation state from other WCM task dialogs
+ this.avmBrowseBean.setLinkValidationState(null);
+ this.avmBrowseBean.setLinkValidationMonitor(null);
+
// reset the doResubmit flag
this.doResubmitNow = false;
}
@@ -124,7 +128,7 @@ public class ManageChangeRequestTaskDialog extends ManageTaskDialog
for (AVMDifference diff : diffs)
{
AVMNodeDescriptor node = this.avmService.lookup(diff.getDestinationVersion(),
- diff.getDestinationPath());
+ diff.getDestinationPath(), true);
if (node != null)
{
submitNodes.add(node);
diff --git a/source/java/org/alfresco/web/bean/wcm/RevertAllDialog.java b/source/java/org/alfresco/web/bean/wcm/RevertAllDialog.java
index cccaeaf3d0..294c172844 100644
--- a/source/java/org/alfresco/web/bean/wcm/RevertAllDialog.java
+++ b/source/java/org/alfresco/web/bean/wcm/RevertAllDialog.java
@@ -42,6 +42,7 @@ import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
+import org.alfresco.service.cmr.workflow.WorkflowTask;
import org.alfresco.util.NameMatcher;
import org.alfresco.util.Pair;
import org.alfresco.util.VirtServerUtils;
@@ -58,6 +59,7 @@ public class RevertAllDialog extends BaseDialogBean
private static final String MSG_REVERTALL_SUCCESS = "revertall_success";
protected AVMBrowseBean avmBrowseBean;
+ protected AVMService avmService;
protected AVMSyncService avmSyncService;
protected ActionService actionService;
protected NameMatcher nameMatcher;
@@ -69,6 +71,14 @@ public class RevertAllDialog extends BaseDialogBean
private String virtUpdatePath;
+ /**
+ * @param avmService the avmService to set
+ */
+ public void setAvmService(AVMService avmService)
+ {
+ this.avmService = avmService;
+ }
+
/**
* @param avmBrowseBean The AVM BrowseBean to set
*/
@@ -118,23 +128,31 @@ public class RevertAllDialog extends BaseDialogBean
List> versionPaths = new ArrayList>();
+ List tasks = null;
for (AVMDifference diff : diffs)
{
- String revertPath = diff.getSourcePath();
- versionPaths.add(new Pair(-1, revertPath) );
-
- if ( (this.virtUpdatePath == null) &&
- VirtServerUtils.requiresUpdateNotification(revertPath)
- )
+ AVMNodeDescriptor node = avmService.lookup(-1, diff.getSourcePath(), true);
+ if (tasks == null)
{
- this.virtUpdatePath = revertPath;
+ tasks = AVMWorkflowUtil.getAssociatedTasksForSandbox(AVMUtil.getStoreName(diff.getSourcePath()));
+ }
+ if (AVMWorkflowUtil.getAssociatedTasksForNode(node, tasks).size() == 0)
+ {
+ String revertPath = diff.getSourcePath();
+ versionPaths.add(new Pair(-1, revertPath) );
+
+ if ( (this.virtUpdatePath == null) &&
+ VirtServerUtils.requiresUpdateNotification(revertPath) )
+ {
+ this.virtUpdatePath = revertPath;
+ }
}
}
Map args = new HashMap(1, 1.0f);
args.put(AVMUndoSandboxListAction.PARAM_NODE_LIST, (Serializable)versionPaths);
Action action = this.actionService.createAction(AVMUndoSandboxListAction.NAME, args);
- this.actionService.executeAction(action, null); // dummy action ref
+ this.actionService.executeAction(action, null); // dummy action ref, list passed as action arg
String msg = MessageFormat.format(Application.getMessage(
context, MSG_REVERTALL_SUCCESS), this.avmBrowseBean.getUsername());
diff --git a/source/java/org/alfresco/web/bean/wcm/RevertSelectedDialog.java b/source/java/org/alfresco/web/bean/wcm/RevertSelectedDialog.java
index 3c73c568b5..a3f61e2854 100644
--- a/source/java/org/alfresco/web/bean/wcm/RevertSelectedDialog.java
+++ b/source/java/org/alfresco/web/bean/wcm/RevertSelectedDialog.java
@@ -40,6 +40,7 @@ import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ActionService;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
+import org.alfresco.service.cmr.workflow.WorkflowTask;
import org.alfresco.util.Pair;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
@@ -90,28 +91,31 @@ public class RevertSelectedDialog extends BaseDialogBean
{
List selected = this.avmBrowseBean.getSelectedSandboxItems();
List> versionPaths = new ArrayList>();
-
-
+
+ List tasks = null;
for (AVMNodeDescriptor node : selected)
{
- String revertPath = node.getPath();
- versionPaths.add(new Pair(-1, revertPath ));
-
- if ( (this.virtUpdatePath == null) &&
- VirtServerUtils.requiresUpdateNotification(revertPath)
- )
+ if (tasks == null)
{
- this.virtUpdatePath = revertPath;
+ tasks = AVMWorkflowUtil.getAssociatedTasksForSandbox(AVMUtil.getStoreName(node.getPath()));
+ }
+ if (AVMWorkflowUtil.getAssociatedTasksForNode(node, tasks).size() == 0)
+ {
+ String revertPath = node.getPath();
+ versionPaths.add(new Pair(-1, revertPath));
+
+ if ( (this.virtUpdatePath == null) &&
+ VirtServerUtils.requiresUpdateNotification(revertPath) )
+ {
+ this.virtUpdatePath = revertPath;
+ }
}
}
-
+
Map args = new HashMap(1, 1.0f);
args.put(AVMUndoSandboxListAction.PARAM_NODE_LIST, (Serializable)versionPaths);
- for (AVMNodeDescriptor node : selected)
- {
- Action action = this.actionService.createAction(AVMUndoSandboxListAction.NAME, args);
- this.actionService.executeAction(action, AVMNodeConverter.ToNodeRef(-1, node.getPath()));
- }
+ Action action = this.actionService.createAction(AVMUndoSandboxListAction.NAME, args);
+ this.actionService.executeAction(action, null); // dummy action ref, list passed as action arg
String msg = MessageFormat.format(Application.getMessage(
context, MSG_REVERTSELECTED_SUCCESS), this.avmBrowseBean.getUsername());
diff --git a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java
index 1fd9b547b0..b78d9d5c19 100644
--- a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java
+++ b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java
@@ -407,6 +407,7 @@ public class SubmitDialog extends BaseDialogBean
String stagingPath = AVMUtil.buildSandboxRootPath(this.avmBrowseBean.getStagingStore());
List diffs = new ArrayList(items.size());
+ String storeId = this.avmBrowseBean.getWebProject().getStoreId();
for (ItemWrapper wrapper : items)
{
String srcPath = sandboxPath + wrapper.getPath();
@@ -415,7 +416,7 @@ public class SubmitDialog extends BaseDialogBean
diffs.add(diff);
// recursively remove locks from this item
- recursivelyRemoveLocks(this.avmBrowseBean.getWebProject().getStoreId(), -1, srcPath);
+ recursivelyRemoveLocks(storeId, -1, srcPath);
// If nothing has required notifying the virtualization server
// so far, check to see if destPath forces a notification
@@ -481,11 +482,11 @@ public class SubmitDialog extends BaseDialogBean
// server that it exists because it's useful to
// defer this operation until everything is already
// in place; this allows pointlessly fine-grained
- // notifications to be suppressed (they're expensive).
+ // notifications to be suppressed (they're expensive).
//
// Therefore, just derive the name of the webapp
// in the workflow sandbox from the 1st item in
- // the submiot list (even if it's not in WEB-INF),
+ // the submit list (even if it's not in WEB-INF),
// and force the virt server notification after the
// transaction has completed via doPostCommitProcessing.
if (this.virtUpdatePath == null)
diff --git a/source/java/org/alfresco/web/config/ClientConfigElement.java b/source/java/org/alfresco/web/config/ClientConfigElement.java
index 809b493df4..9a1316500f 100644
--- a/source/java/org/alfresco/web/config/ClientConfigElement.java
+++ b/source/java/org/alfresco/web/config/ClientConfigElement.java
@@ -72,6 +72,8 @@ public class ClientConfigElement extends ConfigElementAdapter
private boolean pasteAllAndClear = true;
private boolean allowGuestConfig = false;
private List simpleSearchAdditionalAttributes = null;
+ private int minUsernameLength = 2;
+ private int minPasswordLength = 3;
/**
* Default Constructor
@@ -214,6 +216,16 @@ public class ClientConfigElement extends ConfigElementAdapter
combinedElement.setSimpleSearchAdditionalAttributes(newElement.getSimpleSearchAdditionalAttributes());
}
+ if (newElement.getMinUsernameLength() != combinedElement.getMinUsernameLength())
+ {
+ combinedElement.setMinUsernameLength(newElement.getMinUsernameLength());
+ }
+
+ if (newElement.getMinPasswordLength() != combinedElement.getMinPasswordLength())
+ {
+ combinedElement.setMinPasswordLength(newElement.getMinPasswordLength());
+ }
+
return combinedElement;
}
@@ -573,4 +585,36 @@ public class ClientConfigElement extends ConfigElementAdapter
{
this.simpleSearchAdditionalAttributes = simpleSearchAdditionalAttributes;
}
+
+ /**
+ * @return Returns the minimum length for a username.
+ */
+ public int getMinUsernameLength()
+ {
+ return this.minUsernameLength;
+ }
+
+ /**
+ * @param minUsernameLength The minimum length of a username
+ */
+ /*package*/ void setMinUsernameLength(int minUsernameLength)
+ {
+ this.minUsernameLength = minUsernameLength;
+ }
+
+ /**
+ * @return Returns the minimum length for a password.
+ */
+ public int getMinPasswordLength()
+ {
+ return this.minPasswordLength;
+ }
+
+ /**
+ * @param minPasswordLength The minimum length of a password
+ */
+ /*package*/ void setMinPasswordLength(int minPasswordLength)
+ {
+ this.minPasswordLength = minPasswordLength;
+ }
}
diff --git a/source/java/org/alfresco/web/config/ClientElementReader.java b/source/java/org/alfresco/web/config/ClientElementReader.java
index c1570c8fe3..7f7481671d 100644
--- a/source/java/org/alfresco/web/config/ClientElementReader.java
+++ b/source/java/org/alfresco/web/config/ClientElementReader.java
@@ -61,6 +61,8 @@ public class ClientElementReader implements ConfigElementReader
public static final String ELEMENT_GUESTCONFIG = "allow-guest-config";
public static final String ELEMENT_SIMPLESEARCHADDITIONALATTRS = "simple-search-additional-attributes";
public static final String ELEMENT_SIMPLESEARCHADDITIONALATTRSQNAME = "qname";
+ public static final String ELEMENT_MINUSERNAMELENGTH = "username-min-length";
+ public static final String ELEMENT_MINPASSWORDLENGTH = "password-min-length";
/**
* @see org.alfresco.config.xml.elementreader.ConfigElementReader#parse(org.dom4j.Element)
@@ -228,6 +230,20 @@ public class ClientElementReader implements ConfigElementReader
configElement.setSimpleSearchAdditionalAttributes(simpleSearchAddtlAttrb);
}
}
+
+ // get the minimum length of usernames
+ Element minUsername = element.element(ELEMENT_MINUSERNAMELENGTH);
+ if (minUsername != null)
+ {
+ configElement.setMinUsernameLength(Integer.parseInt(minUsername.getTextTrim()));
+ }
+
+ // get the minimum length of passwords
+ Element minPassword = element.element(ELEMENT_MINPASSWORDLENGTH);
+ if (minPassword != null)
+ {
+ configElement.setMinPasswordLength(Integer.parseInt(minPassword.getTextTrim()));
+ }
}
return configElement;
diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml
index 1f53906bab..05b588230f 100644
--- a/source/web/WEB-INF/faces-config-beans.xml
+++ b/source/web/WEB-INF/faces-config-beans.xml
@@ -2631,6 +2631,10 @@
avmService
#{AVMLockingAwareService}
+
+ avmLockingService
+ #{AVMLockingService}
+
avmSyncService
#{AVMSyncService}
@@ -2688,6 +2692,10 @@
avmService
#{AVMLockingAwareService}
+
+ avmLockingService
+ #{AVMLockingService}
+
avmSyncService
#{AVMSyncService}
@@ -3480,6 +3488,10 @@
RevertAllDialog
org.alfresco.web.bean.wcm.RevertAllDialog
session
+
+ avmService
+ #{AVMLockingAwareService}
+
avmBrowseBean
#{AVMBrowseBean}
diff --git a/source/web/jsp/wcm/file-details.jsp b/source/web/jsp/wcm/file-details.jsp
index 8d9fde2a5d..14c36d26cc 100644
--- a/source/web/jsp/wcm/file-details.jsp
+++ b/source/web/jsp/wcm/file-details.jsp
@@ -151,7 +151,7 @@
-
+