Merge of all UI clustering changes originally applied to 2.2

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8292 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2008-02-15 14:59:11 +00:00
parent d20d8a7007
commit a450598ecb
281 changed files with 17771 additions and 15322 deletions

View File

@@ -39,6 +39,7 @@ import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -49,11 +50,13 @@ import org.apache.commons.logging.LogFactory;
*/
public class DeleteSandboxDialog extends BaseDialogBean
{
private static final long serialVersionUID = 6139801947722234685L;
private static final Log logger = LogFactory.getLog(DeleteSandboxDialog.class);
protected AVMService avmService;
transient private AVMService avmService;
protected AVMBrowseBean avmBrowseBean;
protected AVMLockingService avmLockingService;
transient private AVMLockingService avmLockingService;
// ------------------------------------------------------------------------------
@@ -75,6 +78,15 @@ public class DeleteSandboxDialog extends BaseDialogBean
this.avmService = avmService;
}
protected AVMService getAvmService()
{
if (avmService == null)
{
avmService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAVMService();
}
return avmService;
}
/**
* @param avmLockingService The AVMLockingService to set
*/
@@ -83,6 +95,15 @@ public class DeleteSandboxDialog extends BaseDialogBean
this.avmLockingService = avmLockingService;
}
protected AVMLockingService getAvmLockingService()
{
if (avmLockingService == null)
{
avmLockingService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAVMLockingService();
}
return avmLockingService;
}
// ------------------------------------------------------------------------------
// Dialog implementation
@@ -98,14 +119,14 @@ public class DeleteSandboxDialog extends BaseDialogBean
Node website = this.avmBrowseBean.getWebsite();
// remove the store reference from the website folder meta-data
List<ChildAssociationRef> userInfoRefs = this.nodeService.getChildAssocs(
List<ChildAssociationRef> userInfoRefs = this.getNodeService().getChildAssocs(
website.getNodeRef(),
WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef ref : userInfoRefs)
{
NodeRef userInfoRef = ref.getChildRef();
String user = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME);
String role = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE);
String user = (String)getNodeService().getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME);
String role = (String)getNodeService().getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE);
if (username.equals(user))
{
@@ -137,18 +158,18 @@ public class DeleteSandboxDialog extends BaseDialogBean
// layer attached.
// purge the user main sandbox store from the system
this.avmService.purgeStore(sandbox);
this.getAvmService().purgeStore(sandbox);
// remove any locks this user may have
this.avmLockingService.removeStoreLocks(sandbox);
this.getAvmLockingService().removeStoreLocks(sandbox);
// purge the user preview sandbox store from the system
sandbox = AVMUtil.buildUserPreviewStoreName(storeRoot, username);
this.avmService.purgeStore(sandbox);
this.getAvmService().purgeStore(sandbox);
// remove any locks this user may have
this.avmLockingService.removeStoreLocks(sandbox);
this.getAvmLockingService().removeStoreLocks(sandbox);
// remove the association to this web project user meta-data
this.nodeService.removeChild(website.getNodeRef(), ref.getChildRef());
this.getNodeService().removeChild(website.getNodeRef(), ref.getChildRef());
break;
}