|
From: <fg...@us...> - 2013-10-20 10:56:55
|
Revision: 4396
http://openutils.svn.sourceforge.net/openutils/?rev=4396&view=rev
Author: fgiust
Date: 2013-10-20 10:56:50 +0000 (Sun, 20 Oct 2013)
Log Message:
-----------
remove old configuration
Modified Paths:
--------------
magnoliamodules/trunk/openutils-mgnlmedia/pom.xml
magnoliamodules/trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/MediaModuleVersionHandler.java
magnoliamodules/trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/DeleteNodeTask.java
Modified: magnoliamodules/trunk/openutils-mgnlmedia/pom.xml
===================================================================
--- magnoliamodules/trunk/openutils-mgnlmedia/pom.xml 2013-10-20 10:38:28 UTC (rev 4395)
+++ magnoliamodules/trunk/openutils-mgnlmedia/pom.xml 2013-10-20 10:56:50 UTC (rev 4396)
@@ -117,7 +117,7 @@
<dependency>
<groupId>net.sourceforge.openutils</groupId>
<artifactId>openutils-mgnltasks</artifactId>
- <version>5.0.0</version>
+ <version>5.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.sourceforge.openutils</groupId>
Modified: magnoliamodules/trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/MediaModuleVersionHandler.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/MediaModuleVersionHandler.java 2013-10-20 10:38:28 UTC (rev 4395)
+++ magnoliamodules/trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/MediaModuleVersionHandler.java 2013-10-20 10:56:50 UTC (rev 4396)
@@ -243,12 +243,7 @@
"wildcards",
Boolean.TRUE));
- tasks.add(new ChangeExistingPropertyTask(
- RepositoryConstants.CONFIG,
- "/modules/media/mediausedin/website",
- "nodeType",
- "mgnl:content",
- "mgnl:page"));
+
// empty placeholder
tasks.add(new CreateMissingPropertyTask(RepositoryConstants.CONFIG, "/modules/media/config", "baseurl", ""));
@@ -269,9 +264,24 @@
"class",
DefaultMediaUsedInManager.class.getName()));
- // config moved to /modules/media/mediausedin/entries/website
- tasks.add(new DeleteNodeTask(RepositoryConstants.CONFIG, "/modules/media/mediausedin/website"));
+ tasks
+ .add(new DeleteNodeTask(
+ RepositoryConstants.CONFIG,
+ "/modules/media/mediausedin/website",
+ "Configuration from /modules/media/mediausedin has now been changed and moved to the subnode \"entries\". The configuration has been reverted to the default"));
+ tasks
+ .add(new DeleteNodeTask(
+ RepositoryConstants.CONFIG,
+ "/modules/media/processors/image-post",
+ "Configuration node image-post into /modules/media/processors has been renamed to \"postprocessors\". The configuration has been reverted to the default"));
+
+ tasks
+ .add(new DeleteNodeTask(
+ RepositoryConstants.CONFIG,
+ "/modules/media/processors/image-resolution",
+ "Configuration node image-resolution into /modules/media/processors has been renamed to \"resolutionprocessors\". The configuration has been reverted to the default"));
+
return tasks;
}
Modified: magnoliamodules/trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/DeleteNodeTask.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/DeleteNodeTask.java 2013-10-20 10:38:28 UTC (rev 4395)
+++ magnoliamodules/trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/DeleteNodeTask.java 2013-10-20 10:56:50 UTC (rev 4396)
@@ -27,7 +27,10 @@
import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Deletes a node (if existing).
* @author fgiust
@@ -36,31 +39,50 @@
public class DeleteNodeTask extends AbstractRepositoryTask
{
- private final String workspaceName;
+ private String workspaceName;
- private final String nodePath;
+ private String nodePath;
+ private String warning;
+
+ private Logger log = LoggerFactory.getLogger(DeleteNodeTask.class);
+
/**
* @param workspaceName workspace (for example "config")
* @param nodePath node path
+ * @param warning optional warning message which will be shown if the node to delete actually exists
*/
- public DeleteNodeTask(String workspaceName, String nodePath)
+ public DeleteNodeTask(String workspaceName, String nodePath, String warning)
{
super("Deleting the node " + nodePath, "Deleting the node " + nodePath);
this.workspaceName = workspaceName;
this.nodePath = nodePath;
+ this.warning = warning;
}
/**
- * {@inheritDoc}
+ * @param workspaceName workspace (for example "config")
+ * @param nodePath node path
*/
+ public DeleteNodeTask(String workspaceName, String nodePath)
+ {
+ this(workspaceName, nodePath, null);
+ }
+
@Override
protected void doExecute(InstallContext installContext) throws RepositoryException, TaskExecutionException
{
- Session hm = installContext.getJCRSession(workspaceName);
+ Session session = installContext.getJCRSession(workspaceName);
- NodeUtilsExt.deleteIfExisting(hm, nodePath);
+ if (NodeUtilsExt.exists(session, nodePath))
+ {
+ if (warning != null)
+ {
+ installContext.warn(warning);
+ }
+ NodeUtilsExt.deleteIfExisting(session, nodePath);
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|