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_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

View File

@@ -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<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));
// 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<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
{
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);
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

View File

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