|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sakaiproject.archive.impl.SiteMerger
public class SiteMerger
| Field Summary | |
|---|---|
protected org.sakaiproject.authz.api.AuthzGroupService |
m_authzGroupService
|
protected org.sakaiproject.authz.api.SecurityService |
m_securityService
|
protected org.sakaiproject.site.api.SiteService |
m_siteService
|
protected org.sakaiproject.user.api.UserDirectoryService |
m_userDirectoryService
|
protected static HashMap |
userIdTrans
|
protected HashSet<String> |
usersListAllowImport
|
| Constructor Summary | |
|---|---|
SiteMerger()
|
|
| Method Summary | |
|---|---|
protected boolean |
checkSakaiService(boolean m_filterSakaiServices,
String[] m_filteredSakaiServices,
String serviceName)
|
protected boolean |
checkSystemRole(String system,
String roleId,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
When Sakai is importing a role in site.xml, check if it is a qualified role. |
String |
merge(String fileName,
String siteId,
String creatorId,
String m_storagePath,
boolean filterSakaiServices,
String[] filteredSakaiServices,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
Process a merge for the file, or if it's a directory, for all contained files (one level deep). |
protected void |
mergeSite(String siteId,
String fromSiteId,
Element element,
HashMap useIdTrans,
String creatorId,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
Merge the site definition from the site part of the archive file into the site service. |
protected void |
mergeSiteInfo(Element el,
String siteId)
Merge the site info like description from the site part of the archive file into the site service. |
protected void |
mergeSiteRoles(Element el,
String siteId,
HashMap useIdTrans,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
Merge the the permission-roles settings into the site |
protected void |
processMerge(String fileName,
String siteId,
StringBuilder results,
Map attachmentNames,
String creatorId,
boolean filterSakaiService,
String[] filteredSakaiService,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
Read in an archive file and merge the entries into the specified site. |
void |
setAuthzGroupService(org.sakaiproject.authz.api.AuthzGroupService service)
|
void |
setSecurityService(org.sakaiproject.authz.api.SecurityService service)
|
void |
setSiteService(org.sakaiproject.site.api.SiteService service)
|
void |
setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService service)
|
protected String |
translateServiceName(String name)
Old archives have the old CHEF 1.2 service names... |
protected void |
unlock(String lock,
String reference)
Check security permission. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static HashMap userIdTrans
protected org.sakaiproject.authz.api.AuthzGroupService m_authzGroupService
protected org.sakaiproject.user.api.UserDirectoryService m_userDirectoryService
protected org.sakaiproject.site.api.SiteService m_siteService
protected org.sakaiproject.authz.api.SecurityService m_securityService
protected HashSet<String> usersListAllowImport
| Constructor Detail |
|---|
public SiteMerger()
| Method Detail |
|---|
public void setAuthzGroupService(org.sakaiproject.authz.api.AuthzGroupService service)
public void setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService service)
public void setSiteService(org.sakaiproject.site.api.SiteService service)
public void setSecurityService(org.sakaiproject.authz.api.SecurityService service)
public String merge(String fileName,
String siteId,
String creatorId,
String m_storagePath,
boolean filterSakaiServices,
String[] filteredSakaiServices,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
fileName - The site name (for the archive file) to read from.mergeId - The id string to use to make ids in the merge consistent and unique.creatorId - The creator id
If null or blank, the date/time string of the merge is used.
protected void processMerge(String fileName,
String siteId,
StringBuilder results,
Map attachmentNames,
String creatorId,
boolean filterSakaiService,
String[] filteredSakaiService,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
fileName - The site name (for the archive file) to read from.siteId - The id of the site to merge the content into.results - A buffer to accumulate result messages.attachmentNames - A map of old to new attachment names.useIdTrans - A map of old WorkTools id to new Ctools idcreatorId - The creator id
protected void mergeSite(String siteId,
String fromSiteId,
Element element,
HashMap useIdTrans,
String creatorId,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
siteId - The id of the site getting imported into.fromSiteId - The id of the site the archive was made from.element - The XML DOM tree of messages to merge.creatorId - The creator id
protected void mergeSiteInfo(Element el,
String siteId)
throws org.sakaiproject.exception.IdInvalidException,
org.sakaiproject.exception.IdUsedException,
org.sakaiproject.exception.PermissionException,
org.sakaiproject.exception.IdUnusedException,
org.sakaiproject.exception.InUseException
element - The XML DOM tree of messages to merge.siteId - The id of the site getting imported into.
org.sakaiproject.exception.IdInvalidException
org.sakaiproject.exception.IdUsedException
org.sakaiproject.exception.PermissionException
org.sakaiproject.exception.IdUnusedException
org.sakaiproject.exception.InUseException
protected void mergeSiteRoles(Element el,
String siteId,
HashMap useIdTrans,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
throws org.sakaiproject.exception.PermissionException
element - The XML DOM tree of messages to merge.siteId - The id of the site getting imported into.
org.sakaiproject.exception.PermissionExceptionprotected String translateServiceName(String name)
protected boolean checkSakaiService(boolean m_filterSakaiServices,
String[] m_filteredSakaiServices,
String serviceName)
protected void unlock(String lock,
String reference)
throws org.sakaiproject.exception.PermissionException
lock - The lock id string.reference - The resource's reference string, or null if no resource is involved.
org.sakaiproject.exception.PermissionException - thrown if the user does not have access
protected boolean checkSystemRole(String system,
String roleId,
boolean filterSakaiRoles,
String[] filteredSakaiRoles)
roleId -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||