How much duplication do you reckon there is between the 2 classes?
Might be worth refactoring and have a common ancestor to share code?
-Vincent
On Apr 30, 2008, at 2:10 AM, sdumitriu (SVN) wrote:
Author: sdumitriu
Date: 2008-04-30 02:10:27 +0200 (Wed, 30 Apr 2008)
New Revision: 9589
Modified:
xwiki-platform/xwiki-plugins/trunk/skinx/src/main/java/com/xpn/
xwiki/plugin/skinx/CssSkinExtensionPlugin.java
xwiki-platform/xwiki-plugins/trunk/skinx/src/main/java/com/xpn/
xwiki/plugin/skinx/JsSkinExtensionPlugin.java
Log:
XSKINX-2: Author not set when auto-creating the extension xclasses
Fixed.
Modified: xwiki-platform/xwiki-plugins/trunk/skinx/src/main/java/com/
xpn/xwiki/plugin/skinx/CssSkinExtensionPlugin.java
===================================================================
--- xwiki-platform/xwiki-plugins/trunk/skinx/src/main/java/com/xpn/
xwiki/plugin/skinx/CssSkinExtensionPlugin.java 2008-04-29 17:20:37
UTC (rev 9588)
+++ xwiki-platform/xwiki-plugins/trunk/skinx/src/main/java/com/xpn/
xwiki/plugin/skinx/CssSkinExtensionPlugin.java 2008-04-30 00:10:27
UTC (rev 9589)
@@ -1,5 +1,6 @@
package com.xpn.xwiki.plugin.skinx;
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -98,9 +99,16 @@
needsUpdate |=
bclass.addStaticListField("cache", "Caching policy",
"long|short|default|forbid");
- String content = doc.getContent();
- if ((content == null) || (content.equals(""))) {
+ if (StringUtils.isBlank(doc.getAuthor())) {
needsUpdate = true;
+ doc.setAuthor("XWiki.Admin");
+ }
+ if (StringUtils.isBlank(doc.getCreator())) {
+ needsUpdate = true;
+ doc.setCreator("XWiki.Admin");
+ }
+ if (StringUtils.isBlank(doc.getContent())) {
+ needsUpdate = true;
doc.setContent("1 XWiki Stylesheet Extension Class");
}
Modified: xwiki-platform/xwiki-plugins/trunk/skinx/src/main/java/com/
xpn/xwiki/plugin/skinx/JsSkinExtensionPlugin.java
===================================================================
--- xwiki-platform/xwiki-plugins/trunk/skinx/src/main/java/com/xpn/
xwiki/plugin/skinx/JsSkinExtensionPlugin.java 2008-04-29 17:20:37
UTC (rev 9588)
+++ xwiki-platform/xwiki-plugins/trunk/skinx/src/main/java/com/xpn/
xwiki/plugin/skinx/JsSkinExtensionPlugin.java 2008-04-30 00:10:27
UTC (rev 9589)
@@ -1,5 +1,6 @@
package com.xpn.xwiki.plugin.skinx;
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -98,9 +99,16 @@
needsUpdate |=
bclass.addStaticListField("cache", "Caching policy",
"long|short|default|forbid");
- String content = doc.getContent();
- if ((content == null) || (content.equals(""))) {
+ if (StringUtils.isBlank(doc.getAuthor())) {
needsUpdate = true;
+ doc.setAuthor("XWiki.Admin");
+ }
+ if (StringUtils.isBlank(doc.getCreator())) {
+ needsUpdate = true;
+ doc.setCreator("XWiki.Admin");
+ }
+ if (StringUtils.isBlank(doc.getContent())) {
+ needsUpdate = true;
doc.setContent("1 XWiki Stylesheet Extension Class");
}
_______________________________________________
notifications mailing list
notifications(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/notifications