diff --git a/config/alfresco/application-context-core.xml b/config/alfresco/application-context-core.xml
index ec272e3af7..fc0670ff70 100644
--- a/config/alfresco/application-context-core.xml
+++ b/config/alfresco/application-context-core.xml
@@ -49,4 +49,7 @@
+
+
+
diff --git a/config/alfresco/messages/system-messages.properties b/config/alfresco/messages/system-messages.properties
index a7bf645277..dd3ccedee9 100644
--- a/config/alfresco/messages/system-messages.properties
+++ b/config/alfresco/messages/system-messages.properties
@@ -84,6 +84,7 @@ system.usage.warn.limit_documents_approached=The allowable content limit of {0}
system.usage.warn.limit_documents_reached=The allowable content limit of {0} has been reached. There are {1} content objects in the system.
system.usage.err.limit_users_exceeded=The allowable user limit of {0} as per your license agreement has been exceeded. There are currently {1} users in the system. Please contact your Alfresco sales representative to purchase additional user licenses.
system.usage.err.limit_users_exceeded_verbose=The allowable user limit of {0} as per your license agreement has been exceeded. Users added: {1}. Please contact your Alfresco sales representative to purchase additional user licenses.
+system.usage.warn.limit_users_overage=The allowable user limit of {0} for your license agreement has been reached. There are {1} users in the system, {2} are allowed. Please contact your Alfresco sales representative to purchase additional user licenses.
system.usage.err.limit_documents_exceeded=The allowable content limit of {0} has been exceeded. There are currently {1} content objects in the system.
system.usage.err.limit_license_expiring=The Alfresco license will expire in {0} days.
diff --git a/config/alfresco/minimal-context.xml b/config/alfresco/minimal-context.xml
index 8c9e619da8..0736acd42c 100644
--- a/config/alfresco/minimal-context.xml
+++ b/config/alfresco/minimal-context.xml
@@ -26,7 +26,7 @@
Import all modules and related components.
-->
-
+
diff --git a/config/alfresco/model/systemModel.xml b/config/alfresco/model/systemModel.xml
index 2bceb3bbd1..569fb29665 100644
--- a/config/alfresco/model/systemModel.xml
+++ b/config/alfresco/model/systemModel.xml
@@ -77,6 +77,10 @@
d:content
false
+
+ d:content
+ false
+
diff --git a/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java b/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java
index 1e5901a487..f7e3517b96 100644
--- a/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java
+++ b/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java
@@ -372,6 +372,7 @@ public class AlfrescoRpcAuthenticator implements RpcAuthenticator, InitializingB
{
if ( logger.isErrorEnabled())
logger.error( "Error in RPC authenticator setting current user", ex);
+ throw ex;
}
}
diff --git a/source/java/org/alfresco/repo/jscript/People.java b/source/java/org/alfresco/repo/jscript/People.java
index 27c4eba40e..c1f667da9a 100644
--- a/source/java/org/alfresco/repo/jscript/People.java
+++ b/source/java/org/alfresco/repo/jscript/People.java
@@ -165,11 +165,11 @@ public class People extends BaseScopableProcessorExtension implements Initializi
/**
* Set the service registry
*
- * @param serviceRegistry the service registry
+ * @param serviceRegistry the service registry
*/
public void setServiceRegistry(ServiceRegistry serviceRegistry)
{
- this.services = serviceRegistry;
+ this.services = serviceRegistry;
}
/**
@@ -311,8 +311,8 @@ public class People extends BaseScopableProcessorExtension implements Initializi
public ScriptNode createPerson(String userName, String firstName, String lastName, String emailAddress,
String password, boolean setAccountEnabled, boolean notifyByEmail)
{
- ParameterCheck.mandatory("firstName", firstName);
- ParameterCheck.mandatory("emailAddress", emailAddress);
+ ParameterCheck.mandatory("firstName", firstName);
+ ParameterCheck.mandatory("emailAddress", emailAddress);
ScriptNode person = null;
@@ -321,13 +321,13 @@ public class People extends BaseScopableProcessorExtension implements Initializi
{
for (int i=0; i < numRetries; i++)
{
- userName = usernameGenerator.generateUserName(firstName, lastName, emailAddress, i);
-
- // create person if user name does not already exist
- if (!personService.personExists(userName))
- {
- break;
- }
+ userName = usernameGenerator.generateUserName(firstName, lastName, emailAddress, i);
+
+ // create person if user name does not already exist
+ if (!personService.personExists(userName))
+ {
+ break;
+ }
}
}
@@ -344,19 +344,19 @@ public class People extends BaseScopableProcessorExtension implements Initializi
person = createPerson(userName, firstName, lastName, emailAddress);
- if (person != null && password != null)
- {
- // create account for person with the userName and password
- authenticationService.createAuthentication(userName, password.toCharArray());
- authenticationService.setAuthenticationEnabled(userName, setAccountEnabled);
-
- person.save();
-
- if(notifyByEmail)
- {
- personService.notifyPerson(userName, password);
- }
- }
+ if (person != null && password != null)
+ {
+ // create account for person with the userName and password
+ authenticationService.createAuthentication(userName, password.toCharArray());
+ authenticationService.setAuthenticationEnabled(userName, setAccountEnabled);
+
+ person.save();
+
+ if(notifyByEmail)
+ {
+ personService.notifyPerson(userName, password);
+ }
+ }
}
return person;
@@ -914,8 +914,8 @@ public class People extends BaseScopableProcessorExtension implements Initializi
if ("fullName".equalsIgnoreCase(sortBy))
{
- String firstName = nodeService.getProperty(nodeRef, ContentModel.PROP_FIRSTNAME).toString();
- String lastName = nodeService.getProperty(nodeRef, ContentModel.PROP_LASTNAME).toString();
+ String firstName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_FIRSTNAME);
+ String lastName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_LASTNAME);
String fullName = firstName;
if (lastName != null && lastName.length() > 0)
{
diff --git a/source/java/org/alfresco/repo/security/person/PersonServiceImpl.java b/source/java/org/alfresco/repo/security/person/PersonServiceImpl.java
index 61fc43f30f..416d6e7f73 100644
--- a/source/java/org/alfresco/repo/security/person/PersonServiceImpl.java
+++ b/source/java/org/alfresco/repo/security/person/PersonServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2013 Alfresco Software Limited.
+ * Copyright (C) 2005-2015 Alfresco Software Limited.
*
* This file is part of Alfresco
*
diff --git a/source/test-java/org/alfresco/repo/site/SiteServiceImplTest.java b/source/test-java/org/alfresco/repo/site/SiteServiceImplTest.java
index e5c29e20eb..c1da2796b6 100644
--- a/source/test-java/org/alfresco/repo/site/SiteServiceImplTest.java
+++ b/source/test-java/org/alfresco/repo/site/SiteServiceImplTest.java
@@ -50,21 +50,26 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.security.authority.UnknownAuthorityException;
import org.alfresco.repo.security.person.UserNameMatcherImpl;
+import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
+import org.alfresco.service.cmr.action.ActionService;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.TypeDefinition;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileInfo;
+import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.CopyService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.ScriptLocation;
import org.alfresco.service.cmr.repository.ScriptService;
+import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.security.AccessPermission;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.AuthorityService;
import org.alfresco.service.cmr.security.AuthorityType;
+import org.alfresco.service.cmr.security.MutableAuthenticationService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.cmr.site.SiteInfo;
@@ -74,6 +79,7 @@ import org.alfresco.service.cmr.site.SiteVisibility;
import org.alfresco.service.cmr.tagging.TaggingService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
+import org.alfresco.service.transaction.TransactionService;
import org.alfresco.test_category.BaseSpringTestsCategory;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.BaseAlfrescoSpringTest;
@@ -93,6 +99,8 @@ import static org.mockito.Mockito.when;
@Category(BaseSpringTestsCategory.class)
public class SiteServiceImplTest extends BaseAlfrescoSpringTest
{
+ public static final StoreRef SITE_STORE = new StoreRef("workspace://SpacesStore");
+
private static final String TEST_SITE_PRESET = "testSitePreset";
private static final String TEST_SITE_PRESET_2 = "testSitePreset2";
private static final String TEST_TITLE = "TitleTest This is my title";
@@ -109,6 +117,8 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
private static final String GROUP_ONE_DISPLAY = "DisplayOfGrpOne-SiteServiceImplTest";
private static final String GROUP_TWO_DISPLAY = "DisplayOfGrpTwo-SiteServiceImplTest";
+ private static boolean IS_FIRST_SETUP = true;
+
private CopyService copyService;
private ScriptService scriptService;
private NodeService nodeService;
@@ -141,50 +151,90 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
@SuppressWarnings("deprecation")
protected void onSetUpInTransaction() throws Exception
{
- super.onSetUpInTransaction();
-
- // Get the required services
- this.copyService = (CopyService)this.applicationContext.getBean("CopyService");
- this.scriptService = (ScriptService)this.applicationContext.getBean("ScriptService");
- this.nodeService = (NodeService)this.applicationContext.getBean("NodeService");
- this.authenticationComponent = (AuthenticationComponent)this.applicationContext.getBean("authenticationComponent");
- this.taggingService = (TaggingService)this.applicationContext.getBean("TaggingService");
- this.personService = (PersonService)this.applicationContext.getBean("PersonService");
- this.authorityService = (AuthorityService)this.applicationContext.getBean("AuthorityService");
- this.fileFolderService = (FileFolderService)this.applicationContext.getBean("FileFolderService");
- this.nodeArchiveService = (NodeArchiveService)this.applicationContext.getBean("nodeArchiveService");
- this.permissionService = (PermissionService)this.applicationContext.getBean("PermissionService");
- this.dictionaryService = (DictionaryService)this.applicationContext.getBean("DictionaryService");
- this.namespaceService = (NamespaceService)this.applicationContext.getBean("namespaceService");
- this.siteService = (SiteService)this.applicationContext.getBean("SiteService"); // Big 'S'
- this.siteServiceImpl = (SiteServiceImpl) applicationContext.getBean("siteService"); // Small 's'
- this.sysAdminParams = (SysAdminParams)this.applicationContext.getBean("sysAdminParams");
- this.userNameMatcherImpl = (UserNameMatcherImpl)this.applicationContext.getBean("userNameMatcher");
+ RetryingTransactionCallback