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
This commit is contained in:
David Caruana
2006-03-30 18:38:03 +00:00
parent a9e9e57b6d
commit 042acf5321
3 changed files with 24 additions and 22 deletions

View File

@@ -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_info=Exports metadata and content from this or all Spaces.
export_from=Export From export_from=Export From
package_name=Package Name package_name=Package Name
all_spaces_root=Repository Root all_spaces_root=Complete Repository
current_space=Current Space current_space=Current Space
include_children=Include Children include_children=Include Children
include_self=Include this Space include_self=Include this Space

View File

@@ -26,6 +26,7 @@ import javax.faces.context.FacesContext;
import javax.transaction.UserTransaction; import javax.transaction.UserTransaction;
import org.alfresco.repo.action.executer.ExporterActionExecuter; 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.Action;
import org.alfresco.service.cmr.action.ActionService; import org.alfresco.service.cmr.action.ActionService;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
@@ -83,36 +84,37 @@ public class ExportBean
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance()); tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
tx.begin(); tx.begin();
// build the action params map based on the bean's current state // construct appropriate action to execute
Map<String, Serializable> params = new HashMap<String, Serializable>(5); Action action = null;
params.put(ExporterActionExecuter.PARAM_STORE, Repository.getStoreRef().toString()); NodeRef startNode = this.browseBean.getActionSpace().getNodeRef();
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);
// get the appropriate node // get the appropriate node
NodeRef startNode = null;
if (this.mode.equals(ALL_SPACES)) if (this.mode.equals(ALL_SPACES))
{ {
startNode = this.nodeService.getRootNode(Repository.getStoreRef()); Map<String, Serializable> params = new HashMap<String, Serializable>(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 else
{ {
startNode = this.browseBean.getActionSpace().getNodeRef(); Map<String, Serializable> params = new HashMap<String, Serializable>(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); this.actionService.executeAction(action, startNode);
if (logger.isDebugEnabled()) 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 // commit the transaction

View File

@@ -139,7 +139,6 @@
</td> </td>
</tr> </tr>
<tr><td class="paddingRow"></td></tr> <tr><td class="paddingRow"></td></tr>
<%--
<tr> <tr>
<td><nobr><h:outputText value="#{msg.export_from}"/>:</nobr></td> <td><nobr><h:outputText value="#{msg.export_from}"/>:</nobr></td>
<td> <td>
@@ -149,6 +148,7 @@
</h:selectOneRadio> </h:selectOneRadio>
</td> </td>
</tr> </tr>
<%--
<tr> <tr>
<td><nobr><h:outputText value="#{msg.encoding}"/>:</nobr></td> <td><nobr><h:outputText value="#{msg.encoding}"/>:</nobr></td>
<td> <td>