public class Site extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
class |
Site.CustomProperty
Custom property helper class
|
Modifier and Type | Method and Description |
---|---|
ScriptNode |
aquireContainer(String componentId)
Gets and if missing, creates a new site container.
|
ScriptNode |
aquireContainer(String componentId,
String folderType)
Gets and if missing, creates a new site container.
|
ScriptNode |
aquireContainer(String componentId,
String folderType,
Object properties)
Gets and if missing, creates a new site container.
|
ScriptNode |
createAndSaveContainer(String containerId,
String containerType,
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(String componentId)
Creates a new site container
|
ScriptNode |
createContainer(String componentId,
String folderType)
Creates a new site container
|
ScriptNode |
createContainer(String componentId,
String folderType,
Object permissions)
Creates a new site container
|
void |
deleteSite()
Deletes the site
|
ScriptNode |
getContainer(String componentId)
Gets (or creates) the "container" folder for the specified component id
|
Date |
getCreatedDate()
Get the site created date
|
ScriptableQNameMap<String,Site.CustomProperty> |
getCustomProperties()
Get a map of the sites custom properties
|
Site.CustomProperty |
getCustomProperty(String name)
Get the value of a custom property, null if the custom property has not been set or doesn't exist.
|
String |
getDescription()
Get the description
|
ScriptInvitation<?> |
getInvitation(String invitationId)
Get an invitation to this web site
|
boolean |
getIsPublic()
Deprecated.
since version 3.2, replaced by
getVisibility() |
Date |
getLastModifiedDate()
Get the site last modified date
|
String |
getMembersRole(String authorityName)
Gets a user's role in this site.
|
SiteMemberInfo |
getMembersRoleInfo(String authorityName)
Gets extended information on the user's role in this site.
|
ScriptNode |
getNode()
Get the site node, null if none
|
String |
getShortName()
Set the short name
|
String |
getSiteGroup()
Get the site group name
|
ScriptableHashMap<String,String> |
getSitePermissionGroups()
Gets a map of role name mapping to associated group name.
|
String |
getSitePreset()
Get the site preset
|
String |
getTitle()
Get the title
|
String |
getVisibility()
Get the site visibility
|
boolean |
hasContainer(String componentId)
Determine if the "container" folder for the specified component exists
|
ScriptInvitation<?> |
inviteModerated(String inviteeComments,
String inviteeUserName,
String inviteeRole)
Create new moderated invitation to this web site
|
ScriptInvitation<?> |
inviteNominated(String inviteeUserName,
String inviteeRole,
String acceptUrl,
String rejectUrl)
Create new nominated invitation to this web site
|
ScriptInvitation<?> |
inviteNominated(String inviteeFirstName,
String inviteeLastName,
String inviteeEmail,
String inviteeRole,
String acceptUrl,
String rejectUrl)
Create new nominated invitation to this web site
|
boolean |
isMember(String authorityName)
Indicates whether a user is a member of the site.
|
boolean |
isMemberOfGroup(String authorityName)
Indicates whether a user belongs to a group with access rights to the site or not
|
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<String,String> |
listMembers(String nameFilter,
String roleFilter)
Deprecated.
Use
listMembers(String, String, int, boolean) instead |
ScriptableHashMap<String,String> |
listMembers(String nameFilter,
String roleFilter,
int size)
Deprecated.
Use
listMembers(String, String, int, boolean) instead |
ScriptableHashMap<String,String> |
listMembers(String nameFilter,
String roleFilter,
int size,
boolean collapseGroups)
Gets a map of members of the site with their role within the site.
|
void |
removeMembership(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(String description)
Set the description
|
void |
setIsPublic(boolean isPublic)
Deprecated.
since version 3.2, replaced by
setVisibility(String) |
void |
setMembership(String authorityName,
String role)
Sets the membership details for a user.
|
void |
setPermissions(ScriptNode node,
Object permissions)
Apply a set of permissions to the node.
|
void |
setTitle(String title)
Set the title
|
void |
setVisibility(String visibility)
Set the site visibility
|
public String getSitePreset()
public String getShortName()
public String getTitle()
public void setTitle(String title)
title
- the titlepublic String getDescription()
public void setDescription(String description)
description
- the descriptionpublic boolean getIsPublic()
getVisibility()
public void setIsPublic(boolean isPublic)
setVisibility(String)
isPublic
- true the site is public false otherwisepublic String getVisibility()
public void setVisibility(String visibility)
visibility
- site visibility (public|moderated|private)public ScriptNode getNode()
public String getSiteGroup()
public ScriptableHashMap<String,String> getSitePermissionGroups()
public Date getCreatedDate()
Date
site created datepublic Date getLastModifiedDate()
Date
site last modified datepublic void save()
If properties of the site are changed and save is not called, those changes will be lost.
public void deleteSite()
public ScriptableHashMap<String,String> listMembers(String nameFilter, String roleFilter)
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<String,String> listMembers(String nameFilter, String roleFilter, int size)
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<String,String> listMembers(String nameFilter, 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 String getMembersRole(String authorityName)
If the user is not a member of the site then null is returned.
authorityName
- authority namepublic SiteMemberInfo getMembersRoleInfo(String authorityName)
If the user is not a member of the site then null is returned.
authorityName
- authority namepublic boolean isMemberOfGroup(String authorityName)
authorityName
- user namepublic boolean isMember(String authorityName)
authorityName
- user namepublic void setMembership(String authorityName, 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(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(String componentId)
componentId
- Stringpublic ScriptNode createContainer(String componentId)
componentId
- component idpublic ScriptNode createContainer(String componentId, String folderType)
componentId
- component idfolderType
- folder type to createpublic ScriptNode createContainer(String componentId, String folderType, Object permissions)
componentId
- component idfolderType
- folder type to createpublic ScriptNode aquireContainer(String componentId)
componentId
- component idpublic ScriptNode aquireContainer(String componentId, String folderType)
componentId
- component idfolderType
- folder type to createpublic ScriptNode aquireContainer(String componentId, String folderType, Object properties)
componentId
- component idfolderType
- folder type to createpublic ScriptNode createAndSaveContainer(String containerId, String containerType, 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(String componentId)
componentId
- Stringpublic void setPermissions(ScriptNode node, Object permissions)
node
- nodepermissions
- permissionspublic void resetAllPermissions(ScriptNode node)
All permissions will be deleted and the node set to inherit permissions.
node
- nodepublic Site.CustomProperty getCustomProperty(String name)
name
- qname of the propertypublic ScriptableQNameMap<String,Site.CustomProperty> getCustomProperties()
public ScriptInvitation<?> inviteModerated(String inviteeComments, String inviteeUserName, String inviteeRole)
public ScriptInvitation<?> inviteNominated(String inviteeFirstName, String inviteeLastName, String inviteeEmail, String inviteeRole, String acceptUrl, String rejectUrl)
public ScriptInvitation<?> inviteNominated(String inviteeUserName, String inviteeRole, String acceptUrl, String rejectUrl)
public ScriptInvitation<?> getInvitation(String invitationId)
public ScriptInvitation<?>[] listInvitations()
public ScriptInvitation<?>[] listInvitations(org.mozilla.javascript.Scriptable props)
props
- inviteeUserNameCopyright © 2005–2017 Alfresco Software. All rights reserved.