public class SiteMerger extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.sakaiproject.authz.api.AuthzGroupService |
m_authzGroupService |
protected org.sakaiproject.entity.api.EntityManager |
m_entityManager |
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 and Description |
|---|
SiteMerger() |
| Modifier and Type | Method and Description |
|---|---|
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 |
setEntityManager(org.sakaiproject.entity.api.EntityManager m_entityManager) |
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.
|
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 org.sakaiproject.entity.api.EntityManager m_entityManager
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 void setEntityManager(org.sakaiproject.entity.api.EntityManager m_entityManager)
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 idprotected 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 idprotected 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.IdInvalidExceptionorg.sakaiproject.exception.IdUsedExceptionorg.sakaiproject.exception.PermissionExceptionorg.sakaiproject.exception.IdUnusedExceptionorg.sakaiproject.exception.InUseExceptionprotected 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 accessprotected boolean checkSystemRole(String system, String roleId, boolean filterSakaiRoles, String[] filteredSakaiRoles)
roleId - Copyright © 2006-2015 Sakai Project. All Rights Reserved.