mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Expose User Homes in the UI
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4802 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -102,6 +102,9 @@ public class NewUserWizard extends AbstractWizardBean
|
||||
|
||||
/** ref to the company home space folder */
|
||||
private NodeRef companyHomeSpaceRef = null;
|
||||
|
||||
/** ref to the default home location */
|
||||
private NodeRef defaultHomeSpaceRef;
|
||||
|
||||
|
||||
/**
|
||||
@@ -160,7 +163,7 @@ public class NewUserWizard extends AbstractWizardBean
|
||||
this.email = "";
|
||||
this.companyId = "";
|
||||
this.homeSpaceName = "";
|
||||
this.homeSpaceLocation = getCompanyHomeSpace();
|
||||
this.homeSpaceLocation = getDefaultHomeSpace();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -394,7 +397,8 @@ public class NewUserWizard extends AbstractWizardBean
|
||||
{
|
||||
if (currentHomeSpaceLocation.equals(this.homeSpaceLocation) == false &&
|
||||
oldHomeFolderRef.equals(this.homeSpaceLocation) == false &&
|
||||
currentHomeSpaceLocation.equals(getCompanyHomeSpace()) == false)
|
||||
currentHomeSpaceLocation.equals(getCompanyHomeSpace()) == false &&
|
||||
currentHomeSpaceLocation.equals(getDefaultHomeSpace()) == false)
|
||||
{
|
||||
moveHomeSpace = true;
|
||||
}
|
||||
@@ -845,6 +849,29 @@ public class NewUserWizard extends AbstractWizardBean
|
||||
return this.companyHomeSpaceRef;
|
||||
}
|
||||
|
||||
private NodeRef getDefaultHomeSpace()
|
||||
{
|
||||
if (this.defaultHomeSpaceRef == null)
|
||||
{
|
||||
String defaultHomeSpacePath = Application.getClientConfig(FacesContext.getCurrentInstance()).getDefaultHomeSpacePath();
|
||||
|
||||
NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
|
||||
List<NodeRef> nodes = this.searchService.selectNodes(rootNodeRef, defaultHomeSpacePath, null, this.namespaceService,
|
||||
false);
|
||||
|
||||
if (nodes.size() == 0)
|
||||
{
|
||||
throw new IllegalStateException("Unable to find company home space path: " + defaultHomeSpacePath);
|
||||
}
|
||||
|
||||
this.defaultHomeSpaceRef = nodes.get(0);
|
||||
}
|
||||
|
||||
return this.defaultHomeSpaceRef;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the specified home space if it does not exist, and return the ID
|
||||
*
|
||||
|
@@ -58,6 +58,7 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
private String initialLocation = "myalfresco";
|
||||
private ExpiringValueCache<String> wcmDomain = new ExpiringValueCache(1000*10L);
|
||||
private ExpiringValueCache<String> wcmPort = new ExpiringValueCache(1000*10L);
|
||||
private String defaultHomeSpacePath = "/app:company_home";
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
@@ -378,7 +379,7 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
{
|
||||
return this.homeSpacePermission;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param homeSpacePermission The default Home Space permission to set.
|
||||
*/
|
||||
@@ -386,6 +387,22 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
{
|
||||
this.homeSpacePermission = homeSpacePermission;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the default Home Space path.
|
||||
*/
|
||||
public String getDefaultHomeSpacePath()
|
||||
{
|
||||
return this.defaultHomeSpacePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultHomeSpacePath The default Home Space path to set.
|
||||
*/
|
||||
/*package*/ void setDefaultHomeSpacePath(String defaultHomeSpacePath)
|
||||
{
|
||||
this.defaultHomeSpacePath = defaultHomeSpacePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns whether AJAX support is enabled in the client
|
||||
|
@@ -42,6 +42,7 @@ public class ClientElementReader implements ConfigElementReader
|
||||
public static final String ELEMENT_SHELFVISIBLE = "shelf-visible";
|
||||
public static final String ELEMENT_AJAX_ENABLED = "ajax-enabled";
|
||||
public static final String ELEMENT_INITIALLOCATION = "initial-location";
|
||||
public static final String ELEMENT_DEFAULTHOMESPACEPATH = "default-home-space-path";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.config.xml.elementreader.ConfigElementReader#parse(org.dom4j.Element)
|
||||
@@ -161,6 +162,13 @@ public class ClientElementReader implements ConfigElementReader
|
||||
{
|
||||
configElement.setInitialLocation(initialLocation.getTextTrim());
|
||||
}
|
||||
|
||||
// get the default home space path
|
||||
Element defaultHomeSpacePath = element.element(ELEMENT_DEFAULTHOMESPACEPATH);
|
||||
if (defaultHomeSpacePath != null)
|
||||
{
|
||||
configElement.setDefaultHomeSpacePath(defaultHomeSpacePath.getTextTrim());
|
||||
}
|
||||
}
|
||||
|
||||
return configElement;
|
||||
|
Reference in New Issue
Block a user