From 28a33522fd1705d24ff059cde02f81b4c7c77a7b Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 23 Sep 2011 16:41:09 +0000 Subject: [PATCH] ALF-9456 - Finish updating the Site Importer/Exporter now that Site Config is in the normal repo rather than in AVM (The sample team site export had already been tweaked by Kev in June to include the surf-config) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30745 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web-scripts-application-context.xml | 2 - .../repo/web/scripts/site/SiteExportGet.java | 51 ++----------------- 2 files changed, 5 insertions(+), 48 deletions(-) diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml index bc04726848..c23de12a7a 100644 --- a/config/alfresco/web-scripts-application-context.xml +++ b/config/alfresco/web-scripts-application-context.xml @@ -718,8 +718,6 @@ - - diff --git a/source/java/org/alfresco/repo/web/scripts/site/SiteExportGet.java b/source/java/org/alfresco/repo/web/scripts/site/SiteExportGet.java index 489b635fdc..63d589bad1 100644 --- a/source/java/org/alfresco/repo/web/scripts/site/SiteExportGet.java +++ b/source/java/org/alfresco/repo/web/scripts/site/SiteExportGet.java @@ -35,15 +35,12 @@ import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.exporter.ACPExportPackageHandler; import org.alfresco.repo.management.subsystems.ChildApplicationContextManager; import org.alfresco.repo.security.authentication.RepositoryAuthenticationDao; -import org.alfresco.service.cmr.avm.AVMNodeDescriptor; -import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.repository.MimetypeService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.security.AuthorityService; import org.alfresco.service.cmr.security.AuthorityType; import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteService; -import org.alfresco.service.cmr.view.AVMZipExporterService; import org.alfresco.service.cmr.view.ExporterCrawlerParameters; import org.alfresco.service.cmr.view.ExporterService; import org.alfresco.service.cmr.view.Location; @@ -58,19 +55,19 @@ import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptResponse; /** - * Exports a Site as a zip of ACPs and an AVM dump + * Exports a Site as a zip of ACPs. + * + * As of 4.0, the export no longer includes an AVM Dump, as + * the site config is now in the main site ACP. * * @author Nick Burch * @since 3.5 */ public class SiteExportGet extends AbstractWebScript { - private static final String SITE_AVM_ROOT = "sitestore:/alfresco/site-data/"; private static final List USERS_NOT_TO_EXPORT = Arrays.asList( new String[] { "admin", "guest" }); - private AVMZipExporterService avmZipExporterService; - private AVMService avmService; private SiteService siteService; private ExporterService exporterService; private MimetypeService mimetypeService; @@ -104,11 +101,8 @@ public class SiteExportGet extends AbstractWebScript CloseIgnoringOutputStream outputForNesting = new CloseIgnoringOutputStream(mainZip); - // Export the AVM details (dashboard etc) - mainZip.putNextEntry(new ZipEntry("AVM.zip")); - doAVMExport(site, outputForNesting); - // Export the Site's Contents + // This includes the site config such as dashboards mainZip.putNextEntry(new ZipEntry("Contents.acp")); doSiteACPExport(site, outputForNesting); @@ -150,31 +144,6 @@ public class SiteExportGet extends AbstractWebScript mainZip.close(); } - protected void doAVMExport(SiteInfo site, CloseIgnoringOutputStream writeTo) throws IOException - { - String pageRoot = SITE_AVM_ROOT + "pages/site/" + site.getShortName(); - String componentRoot = SITE_AVM_ROOT + "components"; - String componentMatch = "~" + site.getShortName() + "~"; - - // Nest the zip - ZipOutputStream zip = new ZipOutputStream(writeTo); - - // First up, do the page info - avmZipExporterService.export(zip, -1, pageRoot, true); - - // Now do the components - for (AVMNodeDescriptor node : avmService.getDirectoryListing(-1, componentRoot).values()) - { - if (node.getName().contains(componentMatch)) - { - avmZipExporterService.export(zip, node, false); - } - } - - // Finish the AVM zip - zip.close(); - } - protected void doSiteACPExport(SiteInfo site, CloseIgnoringOutputStream writeTo) throws IOException { // Build the parameters @@ -353,16 +322,6 @@ public class SiteExportGet extends AbstractWebScript } } - public void setAvmZipExporterService(AVMZipExporterService avmZipExporterService) - { - this.avmZipExporterService = avmZipExporterService; - } - - public void setAvmService(AVMService avmService) - { - this.avmService = avmService; - } - public void setSiteService(SiteService siteService) { this.siteService = siteService;