org.sakaiproject.component.legacy.site
Interface BaseSiteService.Storage

All Known Implementing Classes:
DbSiteService.DbStorage
Enclosing interface:
BaseSiteService

protected static interface BaseSiteService.Storage

Storage


Method Summary
 boolean check(String id)
          Does the site with this id exist?
 void close()
          Close.
 int count()
          Count all the sites.
 int countSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria)
          Count the Site objets that meet specified criteria.
 String findGroupSiteId(String id)
          Access the Site id for the group with this id.
 SitePage findPage(String id)
          Access the Page that has this id, if one is defined, else return null.
 String findPageSiteId(String id)
          Access the Site id for the page with this id.
 ToolConfiguration findTool(String id)
          Access the ToolConfiguration that has this id, if one is defined, else return null.
 String findToolSiteId(String id)
          Access the Site id for the tool with this id.
 Site get(String id)
          Get the site with this id, or null if not found.
 List getAll()
          Get all sites.
 List getSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria, SiteService.SortType sort, PagingPosition page)
          Access a list of Site objets that meet specified criteria.
 String getSiteSkin(String siteId)
          Return the skin for this site
 List getSiteTypes()
          Access a unique list of String site types for any site type defined for any site, sorted by type.
 void open()
          Open and be ready to read / write.
 Site put(String id)
          Add a new site with this id.
 void readAllSiteProperties(Site site)
          Read site properties and all page and tool properties for the site from storage.
 void readGroupProperties(Group groupId, Properties props)
          Read group properties from storage into the group's properties.
 void readPageProperties(SitePage page, ResourcePropertiesEdit props)
          Read page properties from storage into the page's properties.
 void readPageTools(SitePage page, ResourceVector tools)
          Read site page tools from storage into the page's tools.
 void readSiteGroups(Site site, Collection groups)
          Read site pages from storage into the site's pages.
 void readSitePages(Site site, ResourceVector pages)
          Read site pages from storage into the site's pages.
 void readSiteProperties(Site site, ResourcePropertiesEdit props)
          Read site properties from storage into the site's properties.
 void readSiteTools(Site site)
          Read tools for all pages from storage into the site's page's tools.
 void readToolProperties(ToolConfiguration tool, Properties props)
          Read tool configuration from storage into the tool's configuration properties.
 void remove(Site site)
          Remove this site.
 void save(Site site)
          Save the changes.
 void saveInfo(String siteId, String description, String infoUrl)
          Save the changes to the two info fields (description and infoUrl) only.
 void saveToolConfig(Connection conn, ToolConfiguration tool)
          Write an updated tool configuration to the database.
 void setSiteSecurity(String siteId, Set updateUsers, Set visitUnpUsers, Set visitUsers)
          Establish the internal security for this site.
 void setUserSecurity(String userId, Set updateSites, Set visitUnpSites, Set visitSites)
          Establish the internal security for user for all sites.
 

Method Detail

open

public void open()
Open and be ready to read / write.


close

public void close()
Close.


check

public boolean check(String id)
Does the site with this id exist?

Parameters:
id - The site id.
Returns:
true if the site with this id exists, false if not.

get

public Site get(String id)
Get the site with this id, or null if not found.

Parameters:
id - The site id.
Returns:
The site with this id, or null if not found.

getAll

public List getAll()
Get all sites.

Returns:
The list of all sites.

put

public Site put(String id)
Add a new site with this id.

Parameters:
id - The site id.
Returns:
The site with this id, or null if in use.

save

public void save(Site site)
Save the changes.

Parameters:
site - The site to commit.

saveInfo

public void saveInfo(String siteId,
                     String description,
                     String infoUrl)
Save the changes to the two info fields (description and infoUrl) only.

Parameters:
siteId - The site to commit.
description - The new site description.
infoUrl - The new site infoUrl.

remove

public void remove(Site site)
Remove this site.


count

public int count()
Count all the sites.

Returns:
The count of all sites.

getSiteTypes

public List getSiteTypes()
Access a unique list of String site types for any site type defined for any site, sorted by type.

Returns:
A list (String) of all used site types.

getSites

public List getSites(SiteService.SelectionType type,
                     Object ofType,
                     String criteria,
                     Map propertyCriteria,
                     SiteService.SortType sort,
                     PagingPosition page)
Access a list of Site objets that meet specified criteria.

Parameters:
type - The SelectionType specifying what sort of selection is intended.
ofType - Site type criteria: null for any type; a String to match a single type; A String[], List or Set to match any type in the collection.
criteria - Additional selection criteria: sits returned will match this string somewhere in their id, title, description, or skin.
propertyCriteria - Additional selection criteria: sites returned will have a property named to match each key in the map, whose values match (somewhere in their value) the value in the map (may be null or empty).
sort - A SortType indicating the desired sort. For no sort, set to SortType.NONE.
page - The PagePosition subset of items to return.
Returns:
The List (Site) of Site objets that meet specified criteria.

countSites

public int countSites(SiteService.SelectionType type,
                      Object ofType,
                      String criteria,
                      Map propertyCriteria)
Count the Site objets that meet specified criteria.

Parameters:
type - The SelectionType specifying what sort of selection is intended.
ofType - Site type criteria: null for any type; a String to match a single type; A String[], List or Set to match any type in the collection.
criteria - Additional selection criteria: sits returned will match this string somewhere in their id, title, description, or skin.
propertyCriteria - Additional selection criteria: sites returned will have a property named to match each key in the map, whose values match (somewhere in their value) the value in the map (may be null or empty).
Returns:
The count of Site objets that meet specified criteria.

findTool

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

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

findToolSiteId

public String findToolSiteId(String id)
Access the Site id for the tool with this id.

Parameters:
id - The id of the tool.
Returns:
The Site id for the tool with this id, if the tool is found, else null.

findPage

public SitePage findPage(String id)
Access the Page that has this id, if one is defined, else return null. The page may be on any Site.

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

findPageSiteId

public String findPageSiteId(String id)
Access the Site id for the page with this id.

Parameters:
id - The id of the page.
Returns:
The Site id for the page with this id, if the page is found, else null.

readSiteProperties

public void readSiteProperties(Site site,
                               ResourcePropertiesEdit props)
Read site properties from storage into the site's properties.

Parameters:
site - The site for which properties are desired.

readAllSiteProperties

public void readAllSiteProperties(Site site)
Read site properties and all page and tool properties for the site from storage.

Parameters:
site - The site for which properties are desired.

readPageProperties

public void readPageProperties(SitePage page,
                               ResourcePropertiesEdit props)
Read page properties from storage into the page's properties.

Parameters:
page - The page for which properties are desired.

readToolProperties

public void readToolProperties(ToolConfiguration tool,
                               Properties props)
Read tool configuration from storage into the tool's configuration properties.

Parameters:
tool - The tool for which properties are desired.

readGroupProperties

public void readGroupProperties(Group groupId,
                                Properties props)
Read group properties from storage into the group's properties.

Parameters:
groupId - The groupId for which properties are desired.

readSitePages

public void readSitePages(Site site,
                          ResourceVector pages)
Read site pages from storage into the site's pages.

Parameters:
site - The site for which pages are desired.

readPageTools

public void readPageTools(SitePage page,
                          ResourceVector tools)
Read site page tools from storage into the page's tools.

Parameters:
page - The page for which tools are desired.

readSiteTools

public void readSiteTools(Site site)
Read tools for all pages from storage into the site's page's tools.

Parameters:
site - The site for which tools are desired.

getSiteSkin

public String getSiteSkin(String siteId)
Return the skin for this site

Parameters:
siteId - The site id.
Returns:
the skin for this site.

setSiteSecurity

public void setSiteSecurity(String siteId,
                            Set updateUsers,
                            Set visitUnpUsers,
                            Set visitUsers)
Establish the internal security for this site. Previous security settings are replaced for this site. Assigning a user with update implies the two reads; assigning a user with unp read implies the other read.

Parameters:
siteId - The id of the site.
updateUsers - The set of String User Ids who have update access.
visitUnpUsers - The set of String User Ids who have visit unpublished access.
visitUsers - The set of String User Ids who have visit access.

setUserSecurity

public void setUserSecurity(String userId,
                            Set updateSites,
                            Set visitUnpSites,
                            Set visitSites)
Establish the internal security for user for all sites. Previous security settings are replaced for this user. Assigning a user with update implies the two reads; assigning a user with unp read implies the other read.

Parameters:
userId - The id of the user.
updateSites - The set of String site ids where the user has update access.
visitUnpSites - The set of String site ids where the user has visit unpublished access.
visitSites - The set of String site ids where the user has visit access.

saveToolConfig

public void saveToolConfig(Connection conn,
                           ToolConfiguration tool)
Write an updated tool configuration to the database.

Parameters:
conn - Optional connection to use.
tool - TooConfiguration to commit.

findGroupSiteId

public String findGroupSiteId(String id)
Access the Site id for the group with this id.

Parameters:
id - The id of the group.
Returns:
The Site id for the group with this id, if the group is found, else null.

readSiteGroups

public void readSiteGroups(Site site,
                           Collection groups)
Read site pages from storage into the site's pages.

Parameters:
site - The site for which groups are desired.
groups - The Collection to fill in.