();
for(SandboxInfo s : si)
{
Sandbox b = new Sandbox(this, s);
result.put(b.getSandboxRef(), b);
}
return result;
}
/**
* Gets a user's role on this site.
*
* If the user is not a member of the site then null is returned.
*
* @param userName user name
* @return String user's role or null if not a member
*/
public String getMembersRole(String userName)
{
return getWebProjectService().getWebUserRole(webProjectRef, userName);
}
/**
* Sets the membership details for a user.
*
* If the user is not already a member of the web project then they are invited with the role
* given.
*
* Only a content manager can modify memberships and there must be at least one conttent manager at
* all times.
*
* @param userName user name
* @param role site role
*/
public void addMembership(String userName, String role)
{
getWebProjectService().inviteWebUser(webProjectRef, userName, role);
}
/**
* Removes a users membership of the web project.
*
* Note: this will cascade delete the user's sandboxes without warning (even if there are modified items)
*
*
* @param userName user name
*/
public void removeMembership(String userName)
{
getWebProjectService().uninviteWebUser(webProjectRef, userName);
}
/**
* Gets a map of members of the web project with their role within the web project.
*
* @return ScriptableHashMap list of members of site with their roles
*/
public ScriptableHashMap listMembers()
{
Map members = getWebProjectService().listWebUsers(webProjectRef);
ScriptableHashMap result = new ScriptableHashMap();
result.putAll(members);
return result;
}
/**
* List the role (name) for a WCM project
* @return a map of roles for a WCM project (value, name)
*/
public ScriptableHashMap getRoles()
{
//TODO Role names should be I811N from webclient.properties
//ContentManager=Content Manager
//ContentPublisher=Content Publisher
//ContentContributor=Content Contributor
//ContentReviewer=Content Reviewer
ScriptableHashMap result = new ScriptableHashMap();
result.put(ROLE_CONTENT_MANAGER, "Content Manager");
result.put(ROLE_CONTENT_PUBLISHER, "Content Publisher");
result.put(ROLE_CONTENT_REVIEWER, "Content Reviewer");
result.put(ROLE_CONTENT_CONTRIBUTOR, "Content Contributor");
return result;
}
public WebProjects getWebProjects()
{
return this.webprojects;
}
public SandboxService getSandboxService()
{
return getWebProjects().getSandboxService();
}
public WebProjectService getWebProjectService()
{
return getWebProjects().getWebProjectService();
}
}