org.sakaiproject.service.legacy.site
Interface Site

All Superinterfaces:
AuthzGroup, Comparable, Edit, Entity, Serializable
All Known Implementing Classes:
BaseSite

public interface Site
extends Edit, Comparable, Serializable, AuthzGroup

Site is the object that knows the information, tools and layouts for a Sakai Site.

Author:
Sakai Software Development Team

Field Summary
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Method Summary
 Group addGroup()
          Add a new group.
 SitePage addPage()
          Create a new site page and add it to this site.
 User getCreatedBy()
           
 Time getCreatedTime()
           
 String getDescription()
           
 Group getGroup(String id)
          Get a site group
 Collection getGroups()
          Get a collection of the groups in a Site.
 Collection getGroupsWithMember(String userId)
          Get a collection of the groups in a Site that have this user as a member.
 Collection getGroupsWithMemberHasRole(String userId, String role)
          Get a collection of the groups in a Site that have this user as a member with this role.
 String getIconUrl()
           
 String getIconUrlFull()
           
 String getInfoUrl()
           
 String getInfoUrlFull()
           
 String getJoinerRole()
           
 User getModifiedBy()
           
 Time getModifiedTime()
           
 List getOrderedPages()
           
 SitePage getPage(String id)
          Access the SitePage that has this id, if one is defined, else return null.
 List getPages()
           
 String getShortDescription()
           
 String getSkin()
           
 String getTitle()
           
 ToolConfiguration getTool(String id)
          Access the ToolConfiguration that has this id, if one is defined, else return null.
 ToolConfiguration getToolForCommonId(String commonToolId)
          Get the first tool placed on the site on any page with the specified common Tool id (such as sakai.chat)
 Collection getTools(String commonToolId)
          Get all the tools placed in the site on any page for a particular common Tool Id.
 Collection getTools(String[] toolIds)
          Get all the tools placed in the site on any page that are of any of these tool ids.
 String getType()
          Access the site type.
 boolean hasGroups()
          Does the site have any groups defined?
 boolean isJoinable()
           
 boolean isPublished()
           
 boolean isPubView()
          Check if the site is marked for viewing.
 boolean isType(Object type)
          Test if the site is of this type.
 void loadAll()
          Make sure pages and tools, groups and properties are loaded, not lazy
 void regenerateIds()
          Generate a new set of pages and tools that have new, unique ids.
 void removeGroup(Group group)
          Remove this group from the groups for this site.
 void removePage(SitePage page)
          Remove a site page from this site.
 void setDescription(String description)
          Set the Description of the site.
 void setIconUrl(String url)
          Set the url of an icon for the site.
 void setInfoUrl(String url)
          Set the url for information about the site.
 void setJoinable(boolean joinable)
          Set the joinable status of the site.
 void setJoinerRole(String role)
          Set the joiner role for a site.
 void setPublished(boolean published)
          Set the published state of this site.
 void setPubView(boolean pubView)
          Set the site view.
 void setShortDescription(String description)
          Set the short Description of the site.
 void setSkin(String skin)
          Set the skin to use for this site.
 void setTitle(String title)
          Set the human readable Title of the site.
 void setType(String type)
          Set the site type.
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.Edit
getPropertiesEdit, isActiveEdit
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.Entity
getId, getProperties, getReference, getReference, getUrl, getUrl, toXml
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.sakaiproject.service.legacy.authzGroup.AuthzGroup
addMember, addRole, addRole, getMaintainRole, getMember, getMembers, getProviderGroupId, getRole, getRoles, getRolesIsAllowed, getUserRole, getUsers, getUsersHasRole, getUsersIsAllowed, hasRole, isAllowed, isEmpty, keepIntersection, removeMember, removeMembers, removeRole, removeRoles, setMaintainRole, setProviderGroupId
 

Method Detail

getCreatedBy

public User getCreatedBy()
Specified by:
getCreatedBy in interface AuthzGroup
Returns:
the user who created this.

getModifiedBy

public User getModifiedBy()
Specified by:
getModifiedBy in interface AuthzGroup
Returns:
the user who last modified this.

getCreatedTime

public Time getCreatedTime()
Specified by:
getCreatedTime in interface AuthzGroup
Returns:
the time created.

getModifiedTime

public Time getModifiedTime()
Specified by:
getModifiedTime in interface AuthzGroup
Returns:
the time last modified.

getTitle

public String getTitle()
Returns:
The human readable Title of the site.

getShortDescription

public String getShortDescription()
Returns:
A short text Description of the site.

getDescription

public String getDescription()
Specified by:
getDescription in interface AuthzGroup
Returns:
A longer text Description of the site.

getIconUrl

public String getIconUrl()
Returns:
The Site's icon URL.

getIconUrlFull

public String getIconUrlFull()
Returns:
The Site's icon URL as a full URL.

getInfoUrl

public String getInfoUrl()
Returns:
The Site's info display URL.

getInfoUrlFull

public String getInfoUrlFull()
Returns:
The Site's info display URL as a full URL.

isJoinable

public boolean isJoinable()
Returns:
true if this Site can be joined by anyone, false if not.

getJoinerRole

public String getJoinerRole()
Returns:
the role name given to users who join a joinable site.

getSkin

public String getSkin()
Returns:
the skin to use for this site.

getPages

public List getPages()
Returns:
the List (SitePage) of Site Pages.

loadAll

public void loadAll()
Make sure pages and tools, groups and properties are loaded, not lazy


getOrderedPages

public List getOrderedPages()
Returns:
The pages ordered by the tool order constraint for this site's type (as tool category).

isPublished

public boolean isPublished()
Returns:
true if the site is published, false if not.

getPage

public SitePage getPage(String id)
Access the SitePage that has this id, if one is defined, else return null.

Parameters:
id - The id of the SitePage.
Returns:
The SitePage that has this id, if one is defined, else return null.

getTool

public ToolConfiguration getTool(String id)
Access the ToolConfiguration that has this id, if one is defined, else return null. The tool may be on any SitePage in the site.

Parameters:
id - The id of the tool.
Returns:
The ToolConfiguration that has this id, if one is defined, else return null.

getTools

public Collection getTools(String[] toolIds)
Get all the tools placed in the site on any page that are of any of these tool ids.

Parameters:
toolIds - The tool id array (String, such as sakai.chat, not a tool configuration / placement uuid) to search for.
Returns:
A Collection (ToolConfiguration) of all the tools placed in the site on any page that are of this tool id (may be empty).

getTools

public Collection getTools(String commonToolId)
Get all the tools placed in the site on any page for a particular common Tool Id.

Parameters:
commonToolId - The tool id (String, such as sakai.chat, not a tool configuration / placement uuid) to search for.
Returns:
A Collection (ToolConfiguration) of all the tools placed in the site on any page that are of this tool id (may be empty).

getToolForCommonId

public ToolConfiguration getToolForCommonId(String commonToolId)
Get the first tool placed on the site on any page with the specified common Tool id (such as sakai.chat)

Parameters:
commonToolId - The common ToolID to search for (i.e. sakai.chat)
Returns:
ToolConfiguration for the tool which has the ID (if any) or null if no tools match.

getType

public String getType()
Access the site type.

Returns:
The site type.

isType

public boolean isType(Object type)
Test if the site is of this type. It is if the param is null.

Parameters:
type - A String type to match, or a String[], List or Set of Strings, any of which can match.
Returns:
true if the site is of the type(s) specified, false if not.

isPubView

public boolean isPubView()
Check if the site is marked for viewing.

Returns:
True if the site is marked for viewing, false if not

getGroup

public Group getGroup(String id)
Get a site group

Parameters:
id - The group id (or reference).
Returns:
The Group object if found, or null if not found.

getGroups

public Collection getGroups()
Get a collection of the groups in a Site.

Returns:
A collection (Group) of groups defined in the site, empty if there are none.

getGroupsWithMember

public Collection getGroupsWithMember(String userId)
Get a collection of the groups in a Site that have this user as a member.

Parameters:
userId - The user id.
Returns:
A collection (Group) of groups defined in the site that have this user as a member, empty if there are none.

getGroupsWithMemberHasRole

public Collection getGroupsWithMemberHasRole(String userId,
                                             String role)
Get a collection of the groups in a Site that have this user as a member with this role.

Parameters:
userId - The user id.
role - The role.
Returns:
A collection (Group) of groups defined in the site that have this user as a member with this role, empty if there are none.

hasGroups

public boolean hasGroups()
Does the site have any groups defined?

Returns:
true if the site and has any groups, false if not.

setTitle

public void setTitle(String title)
Set the human readable Title of the site.

Parameters:
title - the new title.

setIconUrl

public void setIconUrl(String url)
Set the url of an icon for the site.

Parameters:
url - The new icon's url.

setInfoUrl

public void setInfoUrl(String url)
Set the url for information about the site.

Parameters:
url - The new information url.

setJoinable

public void setJoinable(boolean joinable)
Set the joinable status of the site.

Parameters:
joinable - represents whether the site is joinable (true) or not (false).

setJoinerRole

public void setJoinerRole(String role)
Set the joiner role for a site.

Parameters:
role - the joiner role for a site.

setShortDescription

public void setShortDescription(String description)
Set the short Description of the site. Used to give a short text description of the site.

Parameters:
description - The new short description.

setDescription

public void setDescription(String description)
Set the Description of the site. Used to give a longer text description of the site.

Parameters:
description - The new description.

setPublished

public void setPublished(boolean published)
Set the published state of this site.


setSkin

public void setSkin(String skin)
Set the skin to use for this site.

Parameters:
skin - The skin to use for this site.

addPage

public SitePage addPage()
Create a new site page and add it to this site.

Returns:
The SitePage object for the new site page.

removePage

public void removePage(SitePage page)
Remove a site page from this site.

Parameters:
page - The SitePage to remove.

regenerateIds

public void regenerateIds()
Generate a new set of pages and tools that have new, unique ids. Good if the site had non-unique-system-wide ids for pages and tools. The Site Id does not change.


setType

public void setType(String type)
Set the site type.

Parameters:
type - The site type.

setPubView

public void setPubView(boolean pubView)
Set the site view.

Parameters:
pubView - The site view setting.

addGroup

public Group addGroup()
Add a new group. The Id is generated, the rest of the fields can be set using calls to the Group object returned.


removeGroup

public void removeGroup(Group group)
Remove this group from the groups for this site.

Parameters:
group - The group to remove.