|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.site.script.Site
public class Site
Site JavaScript object
Nested Class Summary | |
---|---|
class |
Site.CustomProperty
Custom property helper class |
Method Summary | |
---|---|
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 serverPath,
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 serverPath,
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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)
instead
If 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 filter
public ScriptableHashMap listMembers(java.lang.String nameFilter, java.lang.String roleFilter, int size)
Site.listMembers(String, String, int, boolean)
instead
If 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 >0
public 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 otherwise
public java.lang.String getMembersRole(java.lang.String authorityName)
If the user is not a member of the site then null is returned.
authorityName
- authority name
public boolean isMember(java.lang.String authorityName)
authorityName
- user name
public 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 id
public ScriptNode createContainer(java.lang.String componentId, java.lang.String folderType)
componentId
- component idfolderType
- folder type to create
public ScriptNode createContainer(java.lang.String componentId, java.lang.String folderType, java.lang.Object permissions)
componentId
- component idfolderType
- folder type to create
public 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 property
public 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 serverPath, java.lang.String acceptUrl, java.lang.String rejectUrl)
public ScriptInvitation inviteNominated(java.lang.String inviteeUserName, java.lang.String inviteeRole, java.lang.String serverPath, 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
- inviteeUserName
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |