protected static interface BaseSiteService.Storage
Modifier and Type | Method and Description |
---|---|
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<String> |
getSiteIds(SiteService.SelectionType type,
Object ofType,
String criteria,
Map<String,String> propertyCriteria,
Map<String,String> propertyRestrictions,
List<String> excludedSites,
SiteService.SortType sort,
PagingPosition page,
String userId)
Get the Site IDs for all sites matching criteria.
|
List<String> |
getSiteIds(SiteService.SelectionType type,
Object ofType,
String criteria,
Map<String,String> propertyCriteria,
SiteService.SortType sort,
PagingPosition page)
Get the Site IDs for all sites matching criteria.
|
List<Site> |
getSites(SiteService.SelectionType type,
Object ofType,
String criteria,
Map propertyCriteria,
List excludedSites,
SiteService.SortType sort,
PagingPosition page,
boolean requireDescription)
Access a list of Site objects that meet specified criteria, with control over description retrieval.
|
List<Site> |
getSites(SiteService.SelectionType type,
Object ofType,
String criteria,
Map propertyCriteria,
List excludedSites,
SiteService.SortType sort,
PagingPosition page,
boolean requireDescription,
String userId)
Access a list of Site objects that meet specified criteria, with control over description retrieval.
|
List |
getSites(SiteService.SelectionType type,
Object ofType,
String criteria,
Map propertyCriteria,
SiteService.SortType sort,
PagingPosition page)
Access a list of Site objects that meet specified criteria.
|
List<Site> |
getSites(SiteService.SelectionType type,
Object ofType,
String criteria,
Map propertyCriteria,
SiteService.SortType sort,
PagingPosition page,
boolean requireDescription)
Access a list of Site objects that meet specified criteria, with control over description retrieval.
|
List<Site> |
getSites(SiteService.SelectionType type,
Object ofType,
String criteria,
Map propertyCriteria,
SiteService.SortType sort,
PagingPosition page,
boolean requireDescription,
String userId)
Access a list of Site objects that meet specified criteria, with control over description retrieval.
|
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.
|
List<Site> |
getSoftlyDeletedSites()
Get all sites that have been softly deleted
|
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 groups from storage into the site's groups.
|
void |
readSitePageProperties(Site site)
Read properties for all pages in the site
|
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(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.
|
void |
unpublish(List<String> siteIds,
String modifiedBy,
Time modifiedOn)
Unpublish the sites by simply unsetting the PUBLISHED flag
|
void |
writeProperties(Entity r,
ResourceProperties props)
Writes site properties
|
void |
writeProperty(String propertyName,
String propertyValue,
String... siteId)
Saves a site property for the sites with the specified IDs using the specified name-value pair in a single transaction.
|
void open()
void close()
boolean check(String id)
id
- The site id.Site get(String id)
id
- The site id.List getAll()
Site put(String id)
id
- The site id.void save(Site site)
site
- The site to commit.void saveInfo(String siteId, String description, String infoUrl)
siteId
- The site to commit.description
- The new site description.infoUrl
- The new site infoUrl.void unpublish(List<String> siteIds, String modifiedBy, Time modifiedOn)
siteIds
- The site to unpublishmodifedBy
- User who is unpublishing the site (as a userID)modifiedOn
- Time that the site is unpublishedvoid writeProperties(Entity r, ResourceProperties props)
void writeProperty(String propertyName, String propertyValue, String... siteId)
void remove(Site site)
user
- The site to remove.int count()
List getSiteTypes()
List getSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria, SiteService.SortType sort, PagingPosition page)
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.List<Site> getSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria, SiteService.SortType sort, PagingPosition page, boolean requireDescription)
getSite
or Site.loadAll()
. Either method will load and cache
whatever additional data is not yet cached.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.requireDescription
- When true, force a full retrieval of each description; when false, return any uncached descriptions as the empty stringList<Site> getSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria, List excludedSites, SiteService.SortType sort, PagingPosition page, boolean requireDescription)
getSite
or Site.loadAll()
. Either method will load and cache
whatever additional data is not yet cached.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).excludedSites
- List with siteIDs to be excluded from being loaded. If no exclusions are required, set to NULL or empty list.sort
- A SortType indicating the desired sort. For no sort, set to SortType.NONE.page
- The PagePosition subset of items to return.requireDescription
- When true, force a full retrieval of each description; when false, return any uncached descriptions as the empty stringList<Site> getSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria, SiteService.SortType sort, PagingPosition page, boolean requireDescription, String userId)
getSite
or Site.loadAll()
. Either method will load and cache
whatever additional data is not yet cached.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.requireDescription
- When true, force a full retrieval of each description; when false, return any uncached descriptions as the empty stringuserId
- The returned sites will be those which can be accessed by the user with this internal IDList<Site> getSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria, List excludedSites, SiteService.SortType sort, PagingPosition page, boolean requireDescription, String userId)
getSite
or Site.loadAll()
. Either method will load and cache
whatever additional data is not yet cached.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).excludedSites
- List with siteIDs to be excluded from being loaded. If no exclusions are required, set to NULL or empty list.sort
- A SortType indicating the desired sort. For no sort, set to SortType.NONE.page
- The PagePosition subset of items to return.requireDescription
- When true, force a full retrieval of each description; when false, return any uncached descriptions as the empty stringuserId
- The returned sites will be those which can be accessed by the user with this internal IDList<String> getSiteIds(SiteService.SelectionType type, Object ofType, String criteria, Map<String,String> propertyCriteria, SiteService.SortType sort, PagingPosition page)
getSites(org.sakaiproject.site.api.SiteService.SelectionType, Object, String, Map, org.sakaiproject.site.api.SiteService.SortType, PagingPosition)
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: sites 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.List<String> getSiteIds(SiteService.SelectionType type, Object ofType, String criteria, Map<String,String> propertyCriteria, Map<String,String> propertyRestrictions, List<String> excludedSites, SiteService.SortType sort, PagingPosition page, String userId)
getSites(org.sakaiproject.site.api.SiteService.SelectionType, Object, String, Map, org.sakaiproject.site.api.SiteService.SortType, PagingPosition)
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: sites 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).propertyRestrictions
- Similar to propertyCriteria, except matches will be excludedexcludedSites
- siteIds to be excluded from the resultssort
- A SortType indicating the desired sort. For no sort, set to SortType.NONE.page
- The PagePosition subset of items to return.userId
- The returned sites will be those which can be accessed by the user with this internal IDint countSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria)
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).ToolConfiguration findTool(String id)
id
- The id of the tool.String findToolSiteId(String id)
id
- The id of the tool.SitePage findPage(String id)
id
- The id of the page.String findPageSiteId(String id)
id
- The id of the page.void readSiteProperties(Site site, ResourcePropertiesEdit props)
site
- The site for which properties are desired.void readSitePageProperties(Site site)
site
- The site to read properties for.void readAllSiteProperties(Site site)
site
- The site for which properties are desired.void readPageProperties(SitePage page, ResourcePropertiesEdit props)
page
- The page for which properties are desired.void readToolProperties(ToolConfiguration tool, Properties props)
tool
- The tool for which properties are desired.void readGroupProperties(Group groupId, Properties props)
groupId
- The groupId for which properties are desired.void readSitePages(Site site, ResourceVector pages)
site
- The site for which pages are desired.void readPageTools(SitePage page, ResourceVector tools)
page
- The page for which tools are desired.void readSiteTools(Site site)
site
- The site for which tools are desired.String getSiteSkin(String siteId)
siteId
- The site id.void setSiteSecurity(String siteId, Set updateUsers, Set visitUnpUsers, Set visitUsers)
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.void setUserSecurity(String userId, Set updateSites, Set visitUnpSites, Set visitSites)
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.void saveToolConfig(ToolConfiguration tool)
tool
- TooConfiguration to commit.String findGroupSiteId(String id)
id
- The id of the group.void readSiteGroups(Site site, Collection groups)
site
- The site for which groups are desired.groups
- The Collection to fill in.Copyright © 2003–2019 The Sakai Foundation. All rights reserved.