From 042acf532175cebac67174ce2e3dc7b4e4ce8133 Mon Sep 17 00:00:00 2001 From: David Caruana Date: Thu, 30 Mar 2006 18:38:03 +0000 Subject: [PATCH] Full Repository Export / Import Support - first checkpoint git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2591 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/messages/webclient.properties | 2 +- .../org/alfresco/web/bean/ExportBean.java | 42 ++++++++++--------- source/web/jsp/dialog/export.jsp | 2 +- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 52d21fd8c3..3928b4f9f0 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -525,7 +525,7 @@ apply_dashboard_doc_info=Select a template to be applied to the Document as a Da export_info=Exports metadata and content from this or all Spaces. export_from=Export From package_name=Package Name -all_spaces_root=Repository Root +all_spaces_root=Complete Repository current_space=Current Space include_children=Include Children include_self=Include this Space diff --git a/source/java/org/alfresco/web/bean/ExportBean.java b/source/java/org/alfresco/web/bean/ExportBean.java index 37675bad1d..f719191f48 100644 --- a/source/java/org/alfresco/web/bean/ExportBean.java +++ b/source/java/org/alfresco/web/bean/ExportBean.java @@ -26,6 +26,7 @@ import javax.faces.context.FacesContext; import javax.transaction.UserTransaction; import org.alfresco.repo.action.executer.ExporterActionExecuter; +import org.alfresco.repo.action.executer.RepositoryExporterActionExecuter; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ActionService; import org.alfresco.service.cmr.repository.NodeRef; @@ -82,37 +83,38 @@ public class ExportBean { tx = Repository.getUserTransaction(FacesContext.getCurrentInstance()); tx.begin(); - - // build the action params map based on the bean's current state - Map params = new HashMap(5); - params.put(ExporterActionExecuter.PARAM_STORE, Repository.getStoreRef().toString()); - params.put(ExporterActionExecuter.PARAM_PACKAGE_NAME, this.packageName); - params.put(ExporterActionExecuter.PARAM_ENCODING, this.encoding); - params.put(ExporterActionExecuter.PARAM_DESTINATION_FOLDER, this.destination); - params.put(ExporterActionExecuter.PARAM_INCLUDE_CHILDREN, new Boolean(includeChildren)); - params.put(ExporterActionExecuter.PARAM_INCLUDE_SELF, new Boolean(includeSelf)); - - // build the action to execute - Action action = this.actionService.createAction(ExporterActionExecuter.NAME, params); - action.setExecuteAsynchronously(this.runInBackground); + + // construct appropriate action to execute + Action action = null; + NodeRef startNode = this.browseBean.getActionSpace().getNodeRef(); // get the appropriate node - NodeRef startNode = null; if (this.mode.equals(ALL_SPACES)) { - startNode = this.nodeService.getRootNode(Repository.getStoreRef()); + Map params = new HashMap(5); + params.put(ExporterActionExecuter.PARAM_PACKAGE_NAME, this.packageName); + params.put(ExporterActionExecuter.PARAM_DESTINATION_FOLDER, this.destination); + action = this.actionService.createAction(RepositoryExporterActionExecuter.NAME, params); } else { - startNode = this.browseBean.getActionSpace().getNodeRef(); + Map params = new HashMap(5); + params.put(ExporterActionExecuter.PARAM_STORE, Repository.getStoreRef().toString()); + params.put(ExporterActionExecuter.PARAM_PACKAGE_NAME, this.packageName); + params.put(ExporterActionExecuter.PARAM_ENCODING, this.encoding); + params.put(ExporterActionExecuter.PARAM_DESTINATION_FOLDER, this.destination); + params.put(ExporterActionExecuter.PARAM_INCLUDE_CHILDREN, new Boolean(includeChildren)); + params.put(ExporterActionExecuter.PARAM_INCLUDE_SELF, new Boolean(includeSelf)); + action = this.actionService.createAction(ExporterActionExecuter.NAME, params); } - - // execute the action on the relevant node + + // execute action + action.setExecuteAsynchronously(this.runInBackground); this.actionService.executeAction(action, startNode); - + if (logger.isDebugEnabled()) { - logger.debug("Executed export action with action params of " + params); + logger.debug("Executed space export action with action params of " + action.getParameterValues()); } // commit the transaction diff --git a/source/web/jsp/dialog/export.jsp b/source/web/jsp/dialog/export.jsp index c3f60c6308..c898df711e 100644 --- a/source/web/jsp/dialog/export.jsp +++ b/source/web/jsp/dialog/export.jsp @@ -139,7 +139,6 @@ - <%-- : @@ -149,6 +148,7 @@ + <%-- :