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:
Andrew Hind
2007-01-12 10:05:45 +00:00
parent 7e6ad08ad8
commit 0b0f1da94f
4 changed files with 59 additions and 3 deletions

View File

@@ -50,6 +50,10 @@
<!-- Limit search results within selectors, -1 for unlimited. --> <!-- Limit search results within selectors, -1 for unlimited. -->
<selectors-search-max-results>500</selectors-search-max-results> <selectors-search-max-results>500</selectors-search-max-results>
<!-- The path to starting point when creating/finding home folders for new users in the UI -->
<default-home-space-path>/app:company_home/app:user_homes</default-home-space-path>
<!-- The default permissions to apply to a new users Home Space when first created --> <!-- The default permissions to apply to a new users Home Space when first created -->
<!-- this permission is for other users attempting to access that Home Space --> <!-- this permission is for other users attempting to access that Home Space -->
<!-- generally set to "Consumer" or empty value to indicate a private hidden space. --> <!-- generally set to "Consumer" or empty value to indicate a private hidden space. -->

View File

@@ -103,6 +103,9 @@ public class NewUserWizard extends AbstractWizardBean
/** ref to the company home space folder */ /** ref to the company home space folder */
private NodeRef companyHomeSpaceRef = null; private NodeRef companyHomeSpaceRef = null;
/** ref to the default home location */
private NodeRef defaultHomeSpaceRef;
/** /**
* @param authenticationService The AuthenticationService to set. * @param authenticationService The AuthenticationService to set.
@@ -160,7 +163,7 @@ public class NewUserWizard extends AbstractWizardBean
this.email = ""; this.email = "";
this.companyId = ""; this.companyId = "";
this.homeSpaceName = ""; this.homeSpaceName = "";
this.homeSpaceLocation = getCompanyHomeSpace(); this.homeSpaceLocation = getDefaultHomeSpace();
} }
/** /**
@@ -394,7 +397,8 @@ public class NewUserWizard extends AbstractWizardBean
{ {
if (currentHomeSpaceLocation.equals(this.homeSpaceLocation) == false && if (currentHomeSpaceLocation.equals(this.homeSpaceLocation) == false &&
oldHomeFolderRef.equals(this.homeSpaceLocation) == false && oldHomeFolderRef.equals(this.homeSpaceLocation) == false &&
currentHomeSpaceLocation.equals(getCompanyHomeSpace()) == false) currentHomeSpaceLocation.equals(getCompanyHomeSpace()) == false &&
currentHomeSpaceLocation.equals(getDefaultHomeSpace()) == false)
{ {
moveHomeSpace = true; moveHomeSpace = true;
} }
@@ -845,6 +849,29 @@ public class NewUserWizard extends AbstractWizardBean
return this.companyHomeSpaceRef; 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 * Create the specified home space if it does not exist, and return the ID
* *

View File

@@ -58,6 +58,7 @@ public class ClientConfigElement extends ConfigElementAdapter
private String initialLocation = "myalfresco"; private String initialLocation = "myalfresco";
private ExpiringValueCache<String> wcmDomain = new ExpiringValueCache(1000*10L); private ExpiringValueCache<String> wcmDomain = new ExpiringValueCache(1000*10L);
private ExpiringValueCache<String> wcmPort = new ExpiringValueCache(1000*10L); private ExpiringValueCache<String> wcmPort = new ExpiringValueCache(1000*10L);
private String defaultHomeSpacePath = "/app:company_home";
/** /**
* Default Constructor * Default Constructor
@@ -387,6 +388,22 @@ public class ClientConfigElement extends ConfigElementAdapter
this.homeSpacePermission = homeSpacePermission; 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 * @return Returns whether AJAX support is enabled in the client
*/ */

View File

@@ -42,6 +42,7 @@ public class ClientElementReader implements ConfigElementReader
public static final String ELEMENT_SHELFVISIBLE = "shelf-visible"; public static final String ELEMENT_SHELFVISIBLE = "shelf-visible";
public static final String ELEMENT_AJAX_ENABLED = "ajax-enabled"; public static final String ELEMENT_AJAX_ENABLED = "ajax-enabled";
public static final String ELEMENT_INITIALLOCATION = "initial-location"; 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) * @see org.alfresco.config.xml.elementreader.ConfigElementReader#parse(org.dom4j.Element)
@@ -161,6 +162,13 @@ public class ClientElementReader implements ConfigElementReader
{ {
configElement.setInitialLocation(initialLocation.getTextTrim()); 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; return configElement;