| java.lang.Object org.sakaiproject.archive.impl.BasicArchiveService
Method Summary | |
public String | archive(String siteId) Create an archive for the resources of a site.
Parameters: siteId - The id of the site to archive. | protected static String | archiveSite(Site site, Document doc, Stack stack) Archive the site definition. | protected static String | archiveUsers(Site site, Document doc, Stack stack) Archive the users defined in this site (internal users only). | public boolean | checkSakaiRole(String siteId, String userId) When Sakai is importing an item archived by Sakai, check the creator's role first. | protected boolean | checkSakaiService(String serviceName) | protected boolean | checkSystemRole(String system, String roleId) When Sakai is importing a role in site.xml, check if it is a qualified role. | public void | destroy() Final cleanup. | public void | init() Final initialization, once all dependencies are set. | public String | merge(String fileName, String siteId, String creatorId) 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) 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) | protected String | mergeUsers(Element element, HashMap useIdTrans) Merge the user list into the the system. | protected void | processMerge(String fileName, String siteId, StringBuffer results, Map attachmentNames, String creatorId) Read in an archive file and merge the entries into the specified site. | public void | setEntityManager(EntityManager service) Dependency: EntityManager. | public void | setServerConfigurationService(ServerConfigurationService service) Dependency: ServerConfigurationService. | public void | setStoragePath(String path) Configuration: Set the Storage Path. | 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. |
SakaiServicesToImport | public String[] SakaiServicesToImport(Code) | | |
m_storagePath | protected String m_storagePath(Code) | | A full path and file name to the storage file.
|
archive | public String archive(String siteId)(Code) | | Create an archive for the resources of a site.
Parameters: siteId - The id of the site to archive. A log of messages from the archive. |
archiveSite | protected static String archiveSite(Site site, Document doc, Stack stack)(Code) | | Archive the site definition.
Parameters: site - the site. Parameters: doc - The document to contain the xml. Parameters: stack - The stack of elements, the top of which will be the containingelement of the "site" element. |
archiveUsers | protected static String archiveUsers(Site site, Document doc, Stack stack)(Code) | | Archive the users defined in this site (internal users only).
Parameters: site - the site. Parameters: doc - The document to contain the xml. Parameters: stack - The stack of elements, the top of which will be the containingelement of the "site" element. |
checkSakaiRole | public boolean checkSakaiRole(String siteId, String userId)(Code) | | When Sakai is importing an item archived by Sakai, check the creator's role first.
The item is imported when the role is in the acceptance list,
Parameters: siteId - Parameters: userId - boolean value - true: the role is accepted for importing; otherwise, not; |
checkSakaiService | protected boolean checkSakaiService(String serviceName)(Code) | | |
checkSystemRole | protected boolean checkSystemRole(String system, String roleId)(Code) | | When Sakai is importing a role in site.xml, check if it is a qualified role.
Parameters: roleId - boolean value - true: the role is accepted for importing; otherwise, not; |
destroy | public void destroy()(Code) | | Final cleanup.
|
init | public void init()(Code) | | Final initialization, once all dependencies are set.
|
merge | public String merge(String fileName, String siteId, String creatorId)(Code) | | Process a merge for the file, or if it's a directory, for all contained files (one level deep).
Parameters: fileName - The site name (for the archive file) to read from. Parameters: mergeId - The id string to use to make ids in the merge consistent and unique. Parameters: creatorId - The creator idIf null or blank, the date/time string of the merge is used. |
mergeSite | protected void mergeSite(String siteId, String fromSiteId, Element element, HashMap useIdTrans, String creatorId)(Code) | | Merge the site definition from the site part of the archive file into the site service.
Translate the id to the siteId.
Parameters: siteId - The id of the site getting imported into. Parameters: fromSiteId - The id of the site the archive was made from. Parameters: element - The XML DOM tree of messages to merge. Parameters: creatorId - The creator id |
mergeSiteRoles | protected void mergeSiteRoles(Element el, String siteId, HashMap useIdTrans) throws PermissionException(Code) | | Merge the the permission-roles settings into the site
Parameters: element - The XML DOM tree of messages to merge. Parameters: siteId - The id of the site getting imported into. |
processMerge | protected void processMerge(String fileName, String siteId, StringBuffer results, Map attachmentNames, String creatorId)(Code) | | Read in an archive file and merge the entries into the specified site.
Parameters: fileName - The site name (for the archive file) to read from. Parameters: siteId - The id of the site to merge the content into. Parameters: results - A buffer to accumulate result messages. Parameters: attachmentNames - A map of old to new attachment names. Parameters: useIdTrans - A map of old WorkTools id to new Ctools id Parameters: creatorId - The creator id |
setEntityManager | public void setEntityManager(EntityManager service)(Code) | | Dependency: EntityManager.
Parameters: service - The EntityManager. |
setServerConfigurationService | public void setServerConfigurationService(ServerConfigurationService service)(Code) | | Dependency: ServerConfigurationService.
Parameters: service - The ServerConfigurationService. |
setStoragePath | public void setStoragePath(String path)(Code) | | Configuration: Set the Storage Path.
Parameters: path - The storage path. |
translateServiceName | protected String translateServiceName(String name)(Code) | | Old archives have the old CHEF 1.2 service names...
|
unlock | protected void unlock(String lock, String reference) throws PermissionException(Code) | | Check security permission.
Parameters: lock - The lock id string. Parameters: reference - The resource's reference string, or null if no resource is involved. exception: PermissionException - thrown if the user does not have access |
|
|