|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sakaiproject.util.storage.BaseDbFlatStorage
org.sakaiproject.component.legacy.site.DbSiteService.DbStorage
Storage implementation
Field Summary | |
protected BaseSiteService.Storage |
m_oldStorage
A prior version's storage model. |
protected BaseSiteService |
m_service
The service. |
Fields inherited from class org.sakaiproject.util.storage.BaseDbFlatStorage |
m_caseInsensitive, m_locking, m_locks, m_locksAreInTable, m_reader, m_resourcePropertyTableName, m_resourceTableDbidField, m_resourceTableIdField, m_resourceTableInsertFields, m_resourceTableInsertValues, m_resourceTableName, m_resourceTableReadFields, m_resourceTableSortField1, m_resourceTableSortField2, m_resourceTableUpdateFields, m_sql |
Constructor Summary | |
DbSiteService.DbStorage(BaseSiteService service)
Construct. |
Method Summary | |
boolean |
check(String id)
Does the site with this id exist? |
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. |
protected Object[] |
fields(String id,
Site edit,
boolean idAgain)
Get the fields for the database from the edit for this id, and the id again at the end if needed |
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. The page may be on any Site. |
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. |
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 group,
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. |
protected void |
readSiteGroupProperties(BaseSite site)
Read properties for all groups in the site |
void |
readSiteGroups(Site site,
Collection groups)
Read site pages from storage into the site's pages. |
protected void |
readSitePageProperties(BaseSite 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. |
protected void |
readSiteToolProperties(BaseSite site)
Read properties for all tools in the site |
void |
readSiteTools(Site site)
Read tools for all pages from storage into the site's page's tools. |
Object |
readSqlResultRecord(ResultSet result)
Read from the result one set of fields to create a Resource. |
void |
readToolProperties(ToolConfiguration tool,
Properties props)
Read tool properties from storage into the tool's properties. |
void |
remove(Site edit)
Remove this site. |
protected void |
save(Connection conn,
Site edit)
Commit with optional connection to use. |
void |
save(Site edit)
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. 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.sakaiproject.component.legacy.site.BaseSiteService.Storage |
close, open |
Field Detail |
protected BaseSiteService.Storage m_oldStorage
protected BaseSiteService m_service
Constructor Detail |
public DbSiteService.DbStorage(BaseSiteService service)
Method Detail |
public boolean check(String id)
BaseSiteService.Storage
check
in interface BaseSiteService.Storage
id
- The site id.
public Site get(String id)
BaseSiteService.Storage
get
in interface BaseSiteService.Storage
id
- The site id.
public List getAll()
BaseSiteService.Storage
getAll
in interface BaseSiteService.Storage
public Site put(String id)
BaseSiteService.Storage
put
in interface BaseSiteService.Storage
id
- The site id.
public void save(Site edit)
BaseSiteService.Storage
save
in interface BaseSiteService.Storage
edit
- The site to commit.protected void save(Connection conn, Site edit)
conn
- Optional connection to use.edit
- Edit to commit.public void saveInfo(String siteId, String description, String infoUrl)
BaseSiteService.Storage
saveInfo
in interface BaseSiteService.Storage
siteId
- The site to commit.description
- The new site description.infoUrl
- The new site infoUrl.public void saveToolConfig(Connection conn, ToolConfiguration tool)
BaseSiteService.Storage
saveToolConfig
in interface BaseSiteService.Storage
conn
- Optional connection to use.tool
- TooConfiguration to commit.public void remove(Site edit)
BaseSiteService.Storage
remove
in interface BaseSiteService.Storage
public int count()
BaseSiteService.Storage
count
in interface BaseSiteService.Storage
public List getSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria, SiteService.SortType sort, PagingPosition page)
getSites
in interface BaseSiteService.Storage
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.
public List getSiteTypes()
getSiteTypes
in interface BaseSiteService.Storage
public String getSiteSkin(String siteId)
getSiteSkin
in interface BaseSiteService.Storage
siteId
- The site id.
public int countSites(SiteService.SelectionType type, Object ofType, String criteria, Map propertyCriteria)
countSites
in interface BaseSiteService.Storage
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).
public ToolConfiguration findTool(String id)
findTool
in interface BaseSiteService.Storage
id
- The id of the tool.
public SitePage findPage(String id)
findPage
in interface BaseSiteService.Storage
id
- The id of the page.
public String findPageSiteId(String id)
findPageSiteId
in interface BaseSiteService.Storage
id
- The id of the page.
public String findGroupSiteId(String id)
findGroupSiteId
in interface BaseSiteService.Storage
id
- The id of the group.
public String findToolSiteId(String id)
findToolSiteId
in interface BaseSiteService.Storage
id
- The id of the tool.
public void setSiteSecurity(String siteId, Set updateUsers, Set visitUnpUsers, Set visitUsers)
setSiteSecurity
in interface BaseSiteService.Storage
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.public void setUserSecurity(String userId, Set updateSites, Set visitUnpSites, Set visitSites)
setUserSecurity
in interface BaseSiteService.Storage
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.public void readSiteProperties(Site site, ResourcePropertiesEdit props)
readSiteProperties
in interface BaseSiteService.Storage
site
- The site for which properties are desired.public void readAllSiteProperties(Site site)
readAllSiteProperties
in interface BaseSiteService.Storage
site
- The site for which properties are desired.protected void readSitePageProperties(BaseSite site)
site
- The site to read properties for.protected void readSiteToolProperties(BaseSite site)
site
- The site to read properties for.protected void readSiteGroupProperties(BaseSite site)
site
- The site to read group properties for.public void readPageProperties(SitePage page, ResourcePropertiesEdit props)
readPageProperties
in interface BaseSiteService.Storage
page
- The page for which properties are desired.public void readToolProperties(ToolConfiguration tool, Properties props)
readToolProperties
in interface BaseSiteService.Storage
tool
- The tool for which properties are desired.public void readGroupProperties(Group group, Properties props)
readGroupProperties
in interface BaseSiteService.Storage
group
- The group for which properties are desired.public void readSitePages(Site site, ResourceVector pages)
readSitePages
in interface BaseSiteService.Storage
site
- The site for which pages are desired.public void readPageTools(SitePage page, ResourceVector tools)
readPageTools
in interface BaseSiteService.Storage
page
- The page for which tools are desired.public void readSiteTools(Site site)
readSiteTools
in interface BaseSiteService.Storage
site
- The site for which tools are desired.public void readSiteGroups(Site site, Collection groups)
BaseSiteService.Storage
readSiteGroups
in interface BaseSiteService.Storage
site
- The site for which groups are desired.groups
- The Collection to fill in.protected Object[] fields(String id, Site edit, boolean idAgain)
id
- The resource idedit
- The edit (may be null in a new)idAgain
- If true, include the id field again at the end, else don't.
public Object readSqlResultRecord(ResultSet result)
readSqlResultRecord
in interface SqlReader
result
- The Sql query result.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |