public class SiteMerger extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AuthzGroupService |
m_authzGroupService |
protected EntityManager |
m_entityManager |
protected SecurityService |
m_securityService |
protected SiteService |
m_siteService |
protected 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(AuthzGroupService service) |
void |
setEntityManager(EntityManager m_entityManager) |
void |
setSecurityService(SecurityService service) |
void |
setSiteService(SiteService service) |
void |
setUserDirectoryService(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 AuthzGroupService m_authzGroupService
protected UserDirectoryService m_userDirectoryService
protected SiteService m_siteService
protected SecurityService m_securityService
protected EntityManager m_entityManager
public void setAuthzGroupService(AuthzGroupService service)
public void setUserDirectoryService(UserDirectoryService service)
public void setSiteService(SiteService service)
public void setSecurityService(SecurityService service)
public void setEntityManager(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 IdInvalidException, IdUsedException, PermissionException, IdUnusedException, InUseException
element - The XML DOM tree of messages to merge.siteId - The id of the site getting imported into.IdInvalidExceptionIdUsedExceptionPermissionExceptionIdUnusedExceptionInUseExceptionprotected void mergeSiteRoles(Element el, String siteId, HashMap useIdTrans, boolean filterSakaiRoles, String[] filteredSakaiRoles) throws PermissionException
element - The XML DOM tree of messages to merge.siteId - The id of the site getting imported into.PermissionExceptionprotected String translateServiceName(String name)
protected boolean checkSakaiService(boolean m_filterSakaiServices,
String[] m_filteredSakaiServices,
String serviceName)
protected void unlock(String lock, String reference) throws PermissionException
lock - The lock id string.reference - The resource's reference string, or null if no resource is involved.PermissionException - thrown if the user does not have accessprotected boolean checkSystemRole(String system, String roleId, boolean filterSakaiRoles, String[] filteredSakaiRoles)
roleId - Copyright © 2006–2016 Sakai Project. All rights reserved.