public class Site
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
class |
Site.CustomProperty
Custom property helper class
|
| Modifier and Type | Method and Description |
|---|---|
ScriptNode |
createAndSaveContainer(java.lang.String containerId,
java.lang.String containerType,
java.lang.String description)
This method creates a container of the specified id and type, sets the cm:description
on that container node to the specified value and saves the container node updates to the repository.
|
ScriptNode |
createContainer(java.lang.String componentId)
Creates a new site container
|
ScriptNode |
createContainer(java.lang.String componentId,
java.lang.String folderType)
Creates a new site container
|
ScriptNode |
createContainer(java.lang.String componentId,
java.lang.String folderType,
java.lang.Object permissions)
Creates a new site container
|
void |
deleteSite()
Deletes the site
|
ScriptNode |
getContainer(java.lang.String componentId)
Gets (or creates) the "container" folder for the specified component id
|
ScriptableQNameMap |
getCustomProperties()
Get a map of the sites custom properties
|
Site.CustomProperty |
getCustomProperty(java.lang.String name)
Get the value of a custom property, null if the custom property has not been set or doesn't exist.
|
java.lang.String |
getDescription()
Get the description
|
ScriptInvitation |
getInvitation(java.lang.String invitationId)
Get an invitation to this web site
|
boolean |
getIsPublic()
Deprecated.
since version 3.2, replaced by
Site.getVisibility() |
java.lang.String |
getMembersRole(java.lang.String authorityName)
Gets a user's role on this site.
|
ScriptNode |
getNode()
Get the site node, null if none
|
java.lang.String |
getShortName()
Set the short name
|
java.lang.String |
getSiteGroup()
Get the site group name
|
ScriptableHashMap |
getSitePermissionGroups()
Gets a map of role name mapping to associated group name.
|
java.lang.String |
getSitePreset()
Get the site preset
|
java.lang.String |
getTitle()
Get the title
|
java.lang.String |
getVisibility()
Get the site visibility
|
boolean |
hasContainer(java.lang.String componentId)
Determine if the "container" folder for the specified component exists
|
ScriptInvitation |
inviteModerated(java.lang.String inviteeComments,
java.lang.String inviteeUserName,
java.lang.String inviteeRole)
Create new moderated invitation to this web site
|
ScriptInvitation |
inviteNominated(java.lang.String inviteeUserName,
java.lang.String inviteeRole,
java.lang.String acceptUrl,
java.lang.String rejectUrl)
Create new nominated invitation to this web site
|
ScriptInvitation |
inviteNominated(java.lang.String inviteeFirstName,
java.lang.String inviteeLastName,
java.lang.String inviteeEmail,
java.lang.String inviteeRole,
java.lang.String acceptUrl,
java.lang.String rejectUrl)
Create new nominated invitation to this web site
|
boolean |
isMember(java.lang.String authorityName)
Indicates whether a user is a member of the site.
|
ScriptInvitation[] |
listInvitations()
list the outstanding invitations for this site
Map of name / invitation
|
ScriptInvitation[] |
listInvitations(org.mozilla.javascript.Scriptable props)
List the open invitations for this web site.
|
ScriptableHashMap |
listMembers(java.lang.String nameFilter,
java.lang.String roleFilter)
Deprecated.
Use
Site.listMembers(String, String, int, boolean) instead |
ScriptableHashMap |
listMembers(java.lang.String nameFilter,
java.lang.String roleFilter,
int size)
Deprecated.
Use
Site.listMembers(String, String, int, boolean) instead |
ScriptableHashMap |
listMembers(java.lang.String nameFilter,
java.lang.String roleFilter,
int size,
boolean collapseGroups)
Gets a map of members of the site with their role within the site.
|
void |
removeMembership(java.lang.String authorityName)
Removes a user or group membership from a site.
|
void |
resetAllPermissions(ScriptNode node)
Reset any permissions that have been set on the node.
|
void |
save()
Saves any outstanding updates to the site details.
|
void |
setDescription(java.lang.String description)
Set the description
|
void |
setIsPublic(boolean isPublic)
Deprecated.
since version 3.2, replaced by
Site.setVisibility(String) |
void |
setMembership(java.lang.String authorityName,
java.lang.String role)
Sets the membership details for a user.
|
void |
setPermissions(ScriptNode node,
java.lang.Object permissions)
Apply a set of permissions to the node.
|
void |
setTitle(java.lang.String title)
Set the title
|
void |
setVisibility(java.lang.String visibility)
Set the site visibility
|
public java.lang.String getSitePreset()
public java.lang.String getShortName()
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title - the titlepublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description - the descriptionpublic boolean getIsPublic()
Site.getVisibility()public void setIsPublic(boolean isPublic)
Site.setVisibility(String)isPublic - true the site is public false otherwisepublic java.lang.String getVisibility()
public void setVisibility(java.lang.String visibility)
visibility - site visibility (public|moderated|private)public ScriptNode getNode()
public java.lang.String getSiteGroup()
public ScriptableHashMap getSitePermissionGroups()
public void save()
If properties of the site are changed and save is not called, those changes will be lost.
public void deleteSite()
public ScriptableHashMap listMembers(java.lang.String nameFilter, java.lang.String roleFilter)
Site.listMembers(String, String, int, boolean) insteadIf no name or role filter is specified all members of the site are listed.
This list includes both users and groups.
nameFilter - user name filterroleFilter - user role filterpublic ScriptableHashMap listMembers(java.lang.String nameFilter, java.lang.String roleFilter, int size)
Site.listMembers(String, String, int, boolean) insteadIf no name or role filter is specified all members of the site are listed.
This list includes both users and groups.
nameFilter - user name filterroleFilter - user role filtersize - max results size crop if >0public ScriptableHashMap listMembers(java.lang.String nameFilter, java.lang.String roleFilter, int size, boolean collapseGroups)
If no name or role filter is specified all members of the site are listed.
This list includes both users and groups if collapseGroups is set to false, otherwise all groups that are members are collapsed into their component users and listed.
nameFilter - user name filterroleFilter - user role filtersize - max results size crop if >0collapseGroups - true if collapse member groups into user list, false otherwisepublic java.lang.String getMembersRole(java.lang.String authorityName)
If the user is not a member of the site then null is returned.
authorityName - authority namepublic boolean isMember(java.lang.String authorityName)
authorityName - user namepublic void setMembership(java.lang.String authorityName,
java.lang.String role)
If the user is not already a member of the site then they are added with the role given. If the user is already a member of the site then their role is updated to the new role.
Only a site manager can modify memberships and there must be at least one site manager at all times.
authorityName - authority namerole - site rolepublic void removeMembership(java.lang.String authorityName)
Only a site manager can remove a user's membership and the last site manager can not be removed.
authorityName - authority namepublic ScriptNode getContainer(java.lang.String componentId)
componentId - public ScriptNode createContainer(java.lang.String componentId)
componentId - component idpublic ScriptNode createContainer(java.lang.String componentId, java.lang.String folderType)
componentId - component idfolderType - folder type to createpublic ScriptNode createContainer(java.lang.String componentId, java.lang.String folderType, java.lang.Object permissions)
componentId - component idfolderType - folder type to createpublic ScriptNode createAndSaveContainer(java.lang.String containerId, java.lang.String containerType, java.lang.String description)
containerId - an id for the container node.containerType - the type for the container node.description - a value for the cm:description property on the container node.ScriptNode.public boolean hasContainer(java.lang.String componentId)
componentId - public void setPermissions(ScriptNode node, java.lang.Object permissions)
nodeRef - node referencepublic void resetAllPermissions(ScriptNode node)
All permissions will be deleted and the node set to inherit permissions.
nodeRef - node referencepublic Site.CustomProperty getCustomProperty(java.lang.String name)
name - qname of the propertypublic ScriptableQNameMap getCustomProperties()
public ScriptInvitation inviteModerated(java.lang.String inviteeComments, java.lang.String inviteeUserName, java.lang.String inviteeRole)
public ScriptInvitation inviteNominated(java.lang.String inviteeFirstName, java.lang.String inviteeLastName, java.lang.String inviteeEmail, java.lang.String inviteeRole, java.lang.String acceptUrl, java.lang.String rejectUrl)
public ScriptInvitation inviteNominated(java.lang.String inviteeUserName, java.lang.String inviteeRole, java.lang.String acceptUrl, java.lang.String rejectUrl)
public ScriptInvitation getInvitation(java.lang.String invitationId)
public ScriptInvitation[] listInvitations()
public ScriptInvitation[] listInvitations(org.mozilla.javascript.Scriptable props)
props - inviteeUserNameCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.