mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
IMAP refactoring
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14288 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -40,8 +40,6 @@ import javax.faces.validator.ValidatorException;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.imap.AlfrescoImapConst;
|
||||
import org.alfresco.repo.imap.ImapHelper;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -118,8 +116,6 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
/** OwnableService bean reference */
|
||||
transient private OwnableService ownableService;
|
||||
|
||||
transient private ImapHelper imapHelper;
|
||||
|
||||
/** ContentUsageService bean reference */
|
||||
transient private ContentUsageService contentUsageService;
|
||||
|
||||
@@ -170,21 +166,6 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
return personService;
|
||||
}
|
||||
|
||||
public ImapHelper getImapHelper()
|
||||
{
|
||||
if (imapHelper == null)
|
||||
{
|
||||
imapHelper = (ImapHelper) ApplicationContextHelper.getApplicationContext().getBean("imapHelper");
|
||||
}
|
||||
|
||||
return imapHelper;
|
||||
}
|
||||
|
||||
public void setImapHelper(ImapHelper imapHelper)
|
||||
{
|
||||
this.imapHelper = imapHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tenantService The tenantService to set.
|
||||
*/
|
||||
@@ -792,29 +773,6 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
getPermissionService().setInheritParentPermissions(homeSpaceRef, false);
|
||||
}
|
||||
|
||||
private void createImapHome()
|
||||
{
|
||||
NodeRef imapRoot = imapHelper.getImapRootNodeRef();
|
||||
NodeRef imapUserHome = null;
|
||||
|
||||
// search IMAP user home
|
||||
imapUserHome = this.getFileFolderService().searchSimple(imapRoot, userName);
|
||||
if (imapUserHome == null)
|
||||
{
|
||||
// create IMAP user home
|
||||
imapUserHome = this.getFileFolderService().create(imapRoot, userName, ContentModel.TYPE_FOLDER).getNodeRef();
|
||||
}
|
||||
|
||||
// search INBOX
|
||||
NodeRef inbox = this.getFileFolderService().searchSimple(imapUserHome, AlfrescoImapConst.INBOX_NAME);
|
||||
if (inbox == null)
|
||||
{
|
||||
// create IMAP user home
|
||||
inbox = this.getFileFolderService().create(imapUserHome, AlfrescoImapConst.INBOX_NAME, ContentModel.TYPE_FOLDER).getNodeRef();
|
||||
}
|
||||
setupHomeSpacePermissions(imapUserHome);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return default permission string to set for other users for a new Home Space
|
||||
*/
|
||||
@@ -874,11 +832,6 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
// default to Company Home
|
||||
homeSpaceNodeRef = getCompanyHomeSpace();
|
||||
}
|
||||
// Create IMAP user Home
|
||||
if (imapHelper.isPatchApplied())
|
||||
{
|
||||
createImapHome();
|
||||
}
|
||||
|
||||
props.put(ContentModel.PROP_HOMEFOLDER, homeSpaceNodeRef);
|
||||
props.put(ContentModel.PROP_EMAIL, this.email);
|
||||
|
@@ -43,8 +43,6 @@ import javax.transaction.UserTransaction;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.imap.AlfrescoImapConst;
|
||||
import org.alfresco.repo.imap.ImapHelper;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -123,9 +121,6 @@ public class NewUserWizard extends AbstractWizardBean
|
||||
/** action context */
|
||||
private Node person = null;
|
||||
|
||||
/** ImapHelper bean reference */
|
||||
transient private ImapHelper imapHelper;
|
||||
|
||||
/** ref to the default home location */
|
||||
private NodeRef defaultHomeSpaceRef;
|
||||
|
||||
@@ -314,21 +309,6 @@ public class NewUserWizard extends AbstractWizardBean
|
||||
}
|
||||
}
|
||||
|
||||
public ImapHelper getImapHelper()
|
||||
{
|
||||
if (imapHelper == null)
|
||||
{
|
||||
imapHelper = (ImapHelper) ApplicationContextHelper.getApplicationContext().getBean("imapHelper");
|
||||
}
|
||||
|
||||
return imapHelper;
|
||||
}
|
||||
|
||||
public void setImapHelper(ImapHelper imapHelper)
|
||||
{
|
||||
this.imapHelper = imapHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepTitle()
|
||||
*/
|
||||
@@ -624,11 +604,6 @@ public class NewUserWizard extends AbstractWizardBean
|
||||
|
||||
// create the ACEGI Authentication instance for the new user
|
||||
this.getAuthenticationService().createAuthentication(this.userName, this.password.toCharArray());
|
||||
// create IMAP home for this user
|
||||
if (imapHelper.isPatchApplied())
|
||||
{
|
||||
createImapHome();
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled()) logger.debug("Created User Authentication instance for username: " + this.userName);
|
||||
}
|
||||
@@ -1112,32 +1087,6 @@ public class NewUserWizard extends AbstractWizardBean
|
||||
return config.getHomeSpacePermission();
|
||||
}
|
||||
|
||||
private void createImapHome()
|
||||
{
|
||||
NodeRef imapRoot = imapHelper.getImapRootNodeRef();
|
||||
NodeRef imapUserHome = null;
|
||||
NodeRef inbox = null;
|
||||
|
||||
// search IMAP user home
|
||||
imapUserHome = this.getFileFolderService().searchSimple(imapRoot, userName);
|
||||
if (imapUserHome == null)
|
||||
{
|
||||
// create IMAP user home
|
||||
imapUserHome = this.getFileFolderService().create(imapRoot, userName, ContentModel.TYPE_FOLDER).getNodeRef();
|
||||
}
|
||||
|
||||
// search INBOX
|
||||
inbox = this.getFileFolderService().searchSimple(imapUserHome, AlfrescoImapConst.INBOX_NAME);
|
||||
if (inbox == null)
|
||||
{
|
||||
// create IMAP user home
|
||||
inbox = this.getFileFolderService().create(imapUserHome, AlfrescoImapConst.INBOX_NAME, ContentModel.TYPE_FOLDER).getNodeRef();
|
||||
}
|
||||
setupHomeSpacePermissions(imapUserHome);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void invalidateUserList()
|
||||
{
|
||||
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
|
||||
|
@@ -1193,10 +1193,6 @@
|
||||
<property-name>tenantService</property-name>
|
||||
<value>#{tenantService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>imapHelper</property-name>
|
||||
<value>#{imapHelper}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
@@ -4964,10 +4960,6 @@
|
||||
<property-name>contentUsageService</property-name>
|
||||
<value>#{ContentUsageService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>imapHelper</property-name>
|
||||
<value>#{imapHelper}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
|
Reference in New Issue
Block a user