mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
59267: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (4.3/Cloud) 59266: Reverse Merge attempt at merging from V4.1-BUG-FIX (will do it again) AND record only merge the original commits 59231,59239 and reverse merge 59262 that took place on V4.1-BUG-FIX 59237: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 59231: MNT-10237: Merged V4.1.6 (4.1.6.4) to V4.1-BUG-FIX (4.1.8) 58895: MNT-10109: Merged DEV to PATCHES/V4.1.6 (4.1.6.4) 58855: MNT-10109: Permissions are not restored when a deleted site is recovered from the trashcan - Fix unit tests failure by purging archived sites. Forbid new site creation if site group already exists. 58871: MNT-10109: Permissions are not restored when a deleted site is recovered from the trashcan - Return beforePurgeNode callback binding to Site class. 58947: MNT-10109: PATCHES/V4.1.6 (4.1.6.4) 58946: MNT-10109: Permissions are not restored when a deleted site is recovered from the trashcan - Fix test failures by purging deleted sites from trashcan so that sitename can be reused. Change SiteServiceImplTest to avoid database deadlock. 58949: MNT-10109: PATCHES/V4.1.6 (4.1.6.4) 58948: MNT-10109: Permissions are not restored when a deleted site is recovered from the trashcan - Fix test failures by purging deleted sites from trashcan so that sitename can be reused. 59240: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 59239: MNT-10237: Permissions are not restored when a deleted site is recovered from the trashcan - The merge of the HF commit on 4.1.6 removed a variable that was not being used, but was being used in later versions. 59241: MNT-10237: Permissions are not restored when a deleted site is recovered from the trashcan - Correct error in merge from V4.1-BUG-FIX to V4.2-BUG-FIX git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62124 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,7 +21,6 @@ package org.alfresco.repo.web.scripts;
|
|||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
@@ -72,7 +71,6 @@ public class ReadOnlyTransactionInGetRestApiTest extends BaseWebScriptTest
|
|||||||
private SiteService siteService;
|
private SiteService siteService;
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
private TransactionService transactionService;
|
private TransactionService transactionService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
private NodeRef testSiteNodeRef;
|
private NodeRef testSiteNodeRef;
|
||||||
private String testSiteNodeRefString;
|
private String testSiteNodeRefString;
|
||||||
@@ -88,17 +86,14 @@ public class ReadOnlyTransactionInGetRestApiTest extends BaseWebScriptTest
|
|||||||
this.siteService = (SiteService)appContext.getBean("SiteService");
|
this.siteService = (SiteService)appContext.getBean("SiteService");
|
||||||
this.nodeService = (NodeService)appContext.getBean("NodeService");
|
this.nodeService = (NodeService)appContext.getBean("NodeService");
|
||||||
this.transactionService = (TransactionService)appContext.getBean("TransactionService");
|
this.transactionService = (TransactionService)appContext.getBean("TransactionService");
|
||||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
|
||||||
|
|
||||||
// set admin as current user
|
// set admin as current user
|
||||||
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
|
||||||
// delete the test site if it's still hanging around from previous runs
|
// delete the test site if it's still hanging around from previous runs
|
||||||
SiteInfo site = siteService.getSite(TEST_SITE_NAME);
|
if (siteService.getSite(TEST_SITE_NAME) != null)
|
||||||
if (site != null)
|
|
||||||
{
|
{
|
||||||
siteService.deleteSite(TEST_SITE_NAME);
|
siteService.deleteSite(TEST_SITE_NAME);
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(site.getNodeRef()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the test site, this should create a site but it won't have any containers created
|
// create the test site, this should create a site but it won't have any containers created
|
||||||
@@ -120,7 +115,6 @@ public class ReadOnlyTransactionInGetRestApiTest extends BaseWebScriptTest
|
|||||||
{
|
{
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
|
|
||||||
SiteInfo site = siteService.getSite(TEST_SITE_NAME);
|
|
||||||
// use retrying transaction to delete the site
|
// use retrying transaction to delete the site
|
||||||
this.transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
|
this.transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
|
||||||
{
|
{
|
||||||
@@ -133,7 +127,6 @@ public class ReadOnlyTransactionInGetRestApiTest extends BaseWebScriptTest
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(site.getNodeRef()));
|
|
||||||
|
|
||||||
AuthenticationUtil.clearCurrentSecurityContext();
|
AuthenticationUtil.clearCurrentSecurityContext();
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,6 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.site.SiteModel;
|
import org.alfresco.repo.site.SiteModel;
|
||||||
@@ -62,7 +61,6 @@ public class BlogServiceTest extends BaseWebScriptTest
|
|||||||
private AuthenticationComponent authenticationComponent;
|
private AuthenticationComponent authenticationComponent;
|
||||||
private PersonService personService;
|
private PersonService personService;
|
||||||
private SiteService siteService;
|
private SiteService siteService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
private static final String USER_ONE = "UserOneSecondToo";
|
private static final String USER_ONE = "UserOneSecondToo";
|
||||||
private static final String USER_TWO = "UserTwoSecondToo";
|
private static final String USER_TWO = "UserTwoSecondToo";
|
||||||
@@ -93,7 +91,6 @@ public class BlogServiceTest extends BaseWebScriptTest
|
|||||||
this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent");
|
this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent");
|
||||||
this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
|
this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
|
||||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
|
||||||
|
|
||||||
// Authenticate as user
|
// Authenticate as user
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
@@ -126,14 +123,8 @@ public class BlogServiceTest extends BaseWebScriptTest
|
|||||||
// admin user required to delete things
|
// admin user required to delete things
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
|
||||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_BLOG);
|
// delete invite site
|
||||||
if (siteInfo != null)
|
siteService.deleteSite(SITE_SHORT_NAME_BLOG);
|
||||||
{
|
|
||||||
// delete invite site
|
|
||||||
siteService.deleteSite(SITE_SHORT_NAME_BLOG);
|
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// delete the users
|
// delete the users
|
||||||
personService.deletePerson(USER_ONE);
|
personService.deletePerson(USER_ONE);
|
||||||
|
@@ -25,7 +25,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.calendar.CalendarServiceImpl;
|
import org.alfresco.repo.calendar.CalendarServiceImpl;
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.site.SiteModel;
|
import org.alfresco.repo.site.SiteModel;
|
||||||
@@ -68,7 +67,6 @@ public class CalendarRestApiTest extends BaseWebScriptTest
|
|||||||
private PersonService personService;
|
private PersonService personService;
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
private SiteService siteService;
|
private SiteService siteService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
private static final String USER_ONE = "UserOneSecondToo";
|
private static final String USER_ONE = "UserOneSecondToo";
|
||||||
private static final String USER_TWO = "UserTwoSecondToo";
|
private static final String USER_TWO = "UserTwoSecondToo";
|
||||||
@@ -102,7 +100,6 @@ public class CalendarRestApiTest extends BaseWebScriptTest
|
|||||||
this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
|
this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
|
||||||
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
||||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
|
||||||
|
|
||||||
// Authenticate as user
|
// Authenticate as user
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
@@ -139,13 +136,8 @@ public class CalendarRestApiTest extends BaseWebScriptTest
|
|||||||
// admin user required to delete user
|
// admin user required to delete user
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
|
||||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_CALENDAR);
|
// delete invite site
|
||||||
if (siteInfo != null)
|
siteService.deleteSite(SITE_SHORT_NAME_CALENDAR);
|
||||||
{
|
|
||||||
// delete invite site
|
|
||||||
siteService.deleteSite(SITE_SHORT_NAME_CALENDAR);
|
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete the users
|
// delete the users
|
||||||
deleteUser(USER_ONE);
|
deleteUser(USER_ONE);
|
||||||
|
@@ -29,7 +29,6 @@ import javax.transaction.UserTransaction;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.model.ForumModel;
|
import org.alfresco.model.ForumModel;
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.policy.BehaviourFilter;
|
import org.alfresco.repo.policy.BehaviourFilter;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
@@ -79,7 +78,6 @@ public class DiscussionRestApiTest extends BaseWebScriptTest
|
|||||||
private SiteService siteService;
|
private SiteService siteService;
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
private NodeService internalNodeService;
|
private NodeService internalNodeService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
private static final String USER_ONE = "UserOneThird";
|
private static final String USER_ONE = "UserOneThird";
|
||||||
private static final String USER_TWO = "UserTwoThird";
|
private static final String USER_TWO = "UserTwoThird";
|
||||||
@@ -111,7 +109,6 @@ public class DiscussionRestApiTest extends BaseWebScriptTest
|
|||||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||||
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
||||||
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
||||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
|
||||||
|
|
||||||
// Authenticate as user
|
// Authenticate as user
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
@@ -181,22 +178,17 @@ public class DiscussionRestApiTest extends BaseWebScriptTest
|
|||||||
this.authenticationService.deleteAuthentication(USER_TWO);
|
this.authenticationService.deleteAuthentication(USER_TWO);
|
||||||
}
|
}
|
||||||
|
|
||||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_DISCUSSION);
|
// delete discussions test site
|
||||||
if (siteInfo != null)
|
RetryingTransactionCallback<Void> deleteCallback = new RetryingTransactionCallback<Void>()
|
||||||
{
|
{
|
||||||
// delete discussions test site
|
@Override
|
||||||
RetryingTransactionCallback<Void> deleteCallback = new RetryingTransactionCallback<Void>()
|
public Void execute() throws Throwable
|
||||||
{
|
{
|
||||||
@Override
|
siteService.deleteSite(SITE_SHORT_NAME_DISCUSSION);
|
||||||
public Void execute() throws Throwable
|
return null;
|
||||||
{
|
}
|
||||||
siteService.deleteSite(SITE_SHORT_NAME_DISCUSSION);
|
};
|
||||||
return null;
|
transactionService.getRetryingTransactionHelper().doInTransaction(deleteCallback);
|
||||||
}
|
|
||||||
};
|
|
||||||
transactionService.getRetryingTransactionHelper().doInTransaction(deleteCallback);
|
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createUser(String userName, String role)
|
private void createUser(String userName, String role)
|
||||||
|
@@ -27,7 +27,6 @@ import org.alfresco.repo.action.executer.MailActionExecuter;
|
|||||||
import org.alfresco.repo.content.MimetypeMap;
|
import org.alfresco.repo.content.MimetypeMap;
|
||||||
import org.alfresco.repo.invitation.WorkflowModelNominatedInvitation;
|
import org.alfresco.repo.invitation.WorkflowModelNominatedInvitation;
|
||||||
import org.alfresco.repo.management.subsystems.ChildApplicationContextFactory;
|
import org.alfresco.repo.management.subsystems.ChildApplicationContextFactory;
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
@@ -82,7 +81,6 @@ public class InviteServiceTest extends BaseWebScriptTest
|
|||||||
private MutableAuthenticationDao mutableAuthenticationDao;
|
private MutableAuthenticationDao mutableAuthenticationDao;
|
||||||
private NamespaceService namespaceService;
|
private NamespaceService namespaceService;
|
||||||
private TransactionService transactionService;
|
private TransactionService transactionService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
// stores invitee email addresses, one entry for each "start invite" operation
|
// stores invitee email addresses, one entry for each "start invite" operation
|
||||||
// invoked, so that resources created for each invitee for each test
|
// invoked, so that resources created for each invitee for each test
|
||||||
@@ -136,7 +134,6 @@ public class InviteServiceTest extends BaseWebScriptTest
|
|||||||
this.namespaceService = (NamespaceService) getServer().getApplicationContext().getBean("NamespaceService");
|
this.namespaceService = (NamespaceService) getServer().getApplicationContext().getBean("NamespaceService");
|
||||||
this.transactionService = (TransactionService) getServer().getApplicationContext()
|
this.transactionService = (TransactionService) getServer().getApplicationContext()
|
||||||
.getBean("TransactionService");
|
.getBean("TransactionService");
|
||||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
|
||||||
|
|
||||||
configureMailExecutorForTestMode(this.getServer());
|
configureMailExecutorForTestMode(this.getServer());
|
||||||
|
|
||||||
@@ -282,19 +279,6 @@ public class InviteServiceTest extends BaseWebScriptTest
|
|||||||
{
|
{
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
|
|
||||||
|
|
||||||
RunAsWork<SiteInfo[]> runAsWork = new RunAsWork<SiteInfo[]>()
|
|
||||||
{
|
|
||||||
public SiteInfo[] doWork() throws Exception
|
|
||||||
{
|
|
||||||
SiteInfo[] siteInfos = { siteService.getSite(SITE_SHORT_NAME_INVITE_1),
|
|
||||||
siteService.getSite(SITE_SHORT_NAME_INVITE_2),
|
|
||||||
siteService.getSite(SITE_SHORT_NAME_INVITE_3) };
|
|
||||||
return siteInfos;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
final SiteInfo[] siteInfos = AuthenticationUtil.runAs(runAsWork, AuthenticationUtil.getSystemUserName());
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// run various teardown operations which need to be run as 'admin'
|
// run various teardown operations which need to be run as 'admin'
|
||||||
//
|
//
|
||||||
@@ -349,19 +333,6 @@ public class InviteServiceTest extends BaseWebScriptTest
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
|
||||||
{
|
|
||||||
public Object doWork() throws Exception
|
|
||||||
{
|
|
||||||
for (SiteInfo siteInfo : siteInfos)
|
|
||||||
{
|
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}, AuthenticationUtil.getSystemUserName());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String PERSON_FIRSTNAME = "FirstName123";
|
public static String PERSON_FIRSTNAME = "FirstName123";
|
||||||
|
@@ -25,7 +25,6 @@ import java.util.List;
|
|||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.policy.BehaviourFilter;
|
import org.alfresco.repo.policy.BehaviourFilter;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
@@ -71,7 +70,6 @@ public class LinksRestApiTest extends BaseWebScriptTest
|
|||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
private NodeService internalNodeService;
|
private NodeService internalNodeService;
|
||||||
private SiteService siteService;
|
private SiteService siteService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
private static final String USER_ONE = "UserOneSecondToo";
|
private static final String USER_ONE = "UserOneSecondToo";
|
||||||
private static final String USER_TWO = "UserTwoSecondToo";
|
private static final String USER_TWO = "UserTwoSecondToo";
|
||||||
@@ -109,7 +107,6 @@ public class LinksRestApiTest extends BaseWebScriptTest
|
|||||||
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
||||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||||
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
||||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
|
||||||
|
|
||||||
// Authenticate as user
|
// Authenticate as user
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
@@ -144,13 +141,8 @@ public class LinksRestApiTest extends BaseWebScriptTest
|
|||||||
// admin user required to delete user
|
// admin user required to delete user
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
|
||||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_LINKS);
|
// delete the site
|
||||||
if (siteInfo != null)
|
siteService.deleteSite(SITE_SHORT_NAME_LINKS);
|
||||||
{
|
|
||||||
// delete the site
|
|
||||||
siteService.deleteSite(SITE_SHORT_NAME_LINKS);
|
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete the users
|
// delete the users
|
||||||
personService.deletePerson(USER_ONE);
|
personService.deletePerson(USER_ONE);
|
||||||
|
@@ -6,7 +6,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.content.MimetypeMap;
|
import org.alfresco.repo.content.MimetypeMap;
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.site.SiteModel;
|
import org.alfresco.repo.site.SiteModel;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||||
@@ -47,7 +46,6 @@ public class NodeWebScripTest extends BaseWebScriptTest
|
|||||||
private PersonService personService;
|
private PersonService personService;
|
||||||
private SiteService siteService;
|
private SiteService siteService;
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
private static final String USER_ONE = "UserOneSecondToo";
|
private static final String USER_ONE = "UserOneSecondToo";
|
||||||
private static final String USER_TWO = "UserTwoSecondToo";
|
private static final String USER_TWO = "UserTwoSecondToo";
|
||||||
@@ -65,7 +63,6 @@ public class NodeWebScripTest extends BaseWebScriptTest
|
|||||||
this.personService = (PersonService)ctx.getBean("PersonService");
|
this.personService = (PersonService)ctx.getBean("PersonService");
|
||||||
this.siteService = (SiteService)ctx.getBean("SiteService");
|
this.siteService = (SiteService)ctx.getBean("SiteService");
|
||||||
this.nodeService = (NodeService)ctx.getBean("NodeService");
|
this.nodeService = (NodeService)ctx.getBean("NodeService");
|
||||||
this.nodeArchiveService = (NodeArchiveService)ctx.getBean("nodeArchiveService");
|
|
||||||
|
|
||||||
// Do the setup as admin
|
// Do the setup as admin
|
||||||
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
|
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
|
||||||
@@ -89,14 +86,8 @@ public class NodeWebScripTest extends BaseWebScriptTest
|
|||||||
// Admin user required to delete users and sites
|
// Admin user required to delete users and sites
|
||||||
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
|
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
|
||||||
|
|
||||||
SiteInfo siteInfo = siteService.getSite(TEST_SITE.getShortName());
|
// Zap the site, and their contents
|
||||||
if (siteInfo != null)
|
siteService.deleteSite(TEST_SITE.getShortName());
|
||||||
{
|
|
||||||
// Zap the site, and their contents
|
|
||||||
siteService.deleteSite(TEST_SITE.getShortName());
|
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Delete users
|
// Delete users
|
||||||
for (String user : new String[] {USER_ONE, USER_TWO, USER_THREE})
|
for (String user : new String[] {USER_ONE, USER_TWO, USER_THREE})
|
||||||
@@ -121,12 +112,10 @@ public class NodeWebScripTest extends BaseWebScriptTest
|
|||||||
@Override
|
@Override
|
||||||
public SiteInfo execute() throws Throwable
|
public SiteInfo execute() throws Throwable
|
||||||
{
|
{
|
||||||
SiteInfo siteInfo = siteService.getSite(shortName);
|
if (siteService.getSite(shortName) != null)
|
||||||
if (siteInfo != null)
|
|
||||||
{
|
{
|
||||||
// Tidy up after failed earlier run
|
// Tidy up after failed earlier run
|
||||||
siteService.deleteSite(shortName);
|
siteService.deleteSite(shortName);
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do the create
|
// Do the create
|
||||||
|
@@ -21,7 +21,6 @@ package org.alfresco.repo.web.scripts.nodelocator;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.model.Repository;
|
import org.alfresco.repo.model.Repository;
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.nodelocator.AncestorNodeLocator;
|
import org.alfresco.repo.nodelocator.AncestorNodeLocator;
|
||||||
import org.alfresco.repo.nodelocator.CompanyHomeNodeLocator;
|
import org.alfresco.repo.nodelocator.CompanyHomeNodeLocator;
|
||||||
import org.alfresco.repo.nodelocator.SitesHomeNodeLocator;
|
import org.alfresco.repo.nodelocator.SitesHomeNodeLocator;
|
||||||
@@ -62,7 +61,6 @@ public class NodeLocatorWebScriptTest extends BaseWebScriptTest
|
|||||||
private Repository repositoryHelper;
|
private Repository repositoryHelper;
|
||||||
private NodeRef companyHome;
|
private NodeRef companyHome;
|
||||||
private NamespaceService namespaceService;
|
private NamespaceService namespaceService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
public void testCompanyHomeNodeLocator() throws Exception
|
public void testCompanyHomeNodeLocator() throws Exception
|
||||||
{
|
{
|
||||||
@@ -115,7 +113,6 @@ public class NodeLocatorWebScriptTest extends BaseWebScriptTest
|
|||||||
if (site != null)
|
if (site != null)
|
||||||
{
|
{
|
||||||
siteService.deleteSite(site.getShortName());
|
siteService.deleteSite(site.getShortName());
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(site.getNodeRef()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,6 +279,5 @@ public class NodeLocatorWebScriptTest extends BaseWebScriptTest
|
|||||||
this.namespaceService= (NamespaceService) appContext.getBean("NamespaceService");
|
this.namespaceService= (NamespaceService) appContext.getBean("NamespaceService");
|
||||||
this.repositoryHelper = (Repository) appContext.getBean("repositoryHelper");
|
this.repositoryHelper = (Repository) appContext.getBean("repositoryHelper");
|
||||||
this.companyHome = repositoryHelper.getCompanyHome();
|
this.companyHome = repositoryHelper.getCompanyHome();
|
||||||
this.nodeArchiveService = (NodeArchiveService) appContext.getBean("nodeArchiveService");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -548,13 +548,6 @@ public class SiteServiceTest extends BaseWebScriptTest
|
|||||||
JSONObject grp = getResult.getJSONObject("authority");
|
JSONObject grp = getResult.getJSONObject("authority");
|
||||||
assertEquals("full name not correct", testGroupName, grp.getString("fullName"));
|
assertEquals("full name not correct", testGroupName, grp.getString("fullName"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup
|
|
||||||
if(authorityService.authorityExists(testGroupName))
|
|
||||||
{
|
|
||||||
this.authenticationComponent.setSystemUserAsCurrentUser();
|
|
||||||
authorityService.deleteAuthority(testGroupName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDeleteMembership() throws Exception
|
public void testDeleteMembership() throws Exception
|
||||||
@@ -1164,12 +1157,5 @@ public class SiteServiceTest extends BaseWebScriptTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup
|
|
||||||
if (authorityService.authorityExists(testGroupName))
|
|
||||||
{
|
|
||||||
this.authenticationComponent.setSystemUserAsCurrentUser();
|
|
||||||
this.authorityService.deleteAuthority(testGroupName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,6 @@ import java.util.Date;
|
|||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
|
||||||
import org.alfresco.repo.policy.BehaviourFilter;
|
import org.alfresco.repo.policy.BehaviourFilter;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
@@ -71,7 +70,6 @@ public class WikiRestApiTest extends BaseWebScriptTest
|
|||||||
private NodeService internalNodeService;
|
private NodeService internalNodeService;
|
||||||
private SiteService siteService;
|
private SiteService siteService;
|
||||||
private WikiService wikiService;
|
private WikiService wikiService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
|
||||||
|
|
||||||
private static final String USER_ONE = "UserOneSecondToo";
|
private static final String USER_ONE = "UserOneSecondToo";
|
||||||
private static final String USER_TWO = "UserTwoSecondToo";
|
private static final String USER_TWO = "UserTwoSecondToo";
|
||||||
@@ -112,7 +110,6 @@ public class WikiRestApiTest extends BaseWebScriptTest
|
|||||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||||
this.wikiService = (WikiService)getServer().getApplicationContext().getBean("WikiService");
|
this.wikiService = (WikiService)getServer().getApplicationContext().getBean("WikiService");
|
||||||
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
||||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
|
||||||
|
|
||||||
// Authenticate as user
|
// Authenticate as user
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
@@ -147,13 +144,8 @@ public class WikiRestApiTest extends BaseWebScriptTest
|
|||||||
// admin user required to delete user
|
// admin user required to delete user
|
||||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
|
||||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_WIKI);
|
// delete the site
|
||||||
if (siteInfo != null)
|
siteService.deleteSite(SITE_SHORT_NAME_WIKI);
|
||||||
{
|
|
||||||
// delete the site
|
|
||||||
siteService.deleteSite(SITE_SHORT_NAME_WIKI);
|
|
||||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete the users
|
// delete the users
|
||||||
if(personService.personExists(USER_ONE))
|
if(personService.personExists(USER_ONE))
|
||||||
|
Reference in New Issue
Block a user