Actually, here is the diff, nothing fancy, just wanted to make it
work :)
Nicolas,
Index: /Users/niko/Documents/workspace/Magnolia/src/main/info/
magnolia/cms/servlets/ImportExportServlet.java
===================================================================
--- /Users/niko/Documents/workspace/Magnolia/src/main/info/magnolia/
cms/servlets/ImportExportServlet.java (revision 1128)
+++ /Users/niko/Documents/workspace/Magnolia/src/main/info/magnolia/
cms/servlets/ImportExportServlet.java (working copy)
@@ -61,6 +61,8 @@
* request parameter: keep versions.
*/
private static final String PARAM_KEEPVERSIONS =
"mgnlKeepVersions"; //$NON-NLS-1$
+
+ private static final String PARAM_OVERRIDE = "mgnlOverride"; //
$NON-NLS-1$
/**
* request parameter: imported file.
@@ -244,6 +246,8 @@
}
boolean keepVersionHistory = BooleanUtils.toBoolean
(form.getParameter(PARAM_KEEPVERSIONS));
+
+ boolean override = BooleanUtils.toBoolean
(form.getParameter(PARAM_OVERRIDE));
String repository = form.getParameter(PARAM_REPOSITORY);
Document xmlFile = form.getDocument(PARAM_FILE);
@@ -251,7 +255,7 @@
throw new RuntimeException("Wrong parameters"); //
$NON-NLS-1$
}
- executeImport(basepath, repository, xmlFile,
keepVersionHistory);
+ executeImport(basepath, repository, xmlFile,
keepVersionHistory,override);
String redirectPage = form.getParameter(PARAM_REDIRECT);
if (StringUtils.isNotBlank(redirectPage)) {
@@ -346,8 +350,9 @@
* @param basepath base path in repository
* @param xmlFile uploaded file
* @param keepVersionHistory if <code>false</code> version info
will be stripped before importing the document
+ * @param override if <code>true</code> set import mode to
<code>ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW</code>
*/
- private void executeImport(String basepath, String repository,
Document xmlFile, boolean keepVersionHistory) {
+ private void executeImport(String basepath, String repository,
Document xmlFile, boolean keepVersionHistory,boolean override) {
HierarchyManager hr = ContentRepository.getHierarchyManager
(repository);
Workspace ws = hr.getWorkspace();
@@ -365,6 +370,9 @@
if ("website".equals(repository)) { //$NON-NLS-1$
importMode =
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING;
}
+
+ if(override)
+ importMode =
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING;
try {
if (keepVersionHistory) {
On Jul 14, 2005, at 5:10 PM, Nicolas wrote:
Hi there !
I have written two classes and an ant task to batch import
fragments of repositories at different places of the different
repositories.
This works using the import servlet written by Fabrizio ...
I've made some modifications to the servlet to allow the import to
select the import mode, ie:
int importMode = ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW;
is no more static but is actually a parameter in the post request.
It is possible to have the fix included in SVN ?
Also, at the same time, if the html in both the import and export
could be CSSized, that would be great.
I can send the diff if needed.
Cheers,
Nicolas,
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------