Author: hoang_to
Date: 2009-12-07 05:49:28 -0500 (Mon, 07 Dec 2009)
New Revision: 960
Added:
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/GateinResource.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/SkinConfigParser.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigParser.java
Log:
GTNPORTAL-360: Refactor Java code in Skin/Javascript service 's deployer
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java 2009-12-07
10:41:38 UTC (rev 959)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java 2009-12-07
10:49:28 UTC (rev 960)
@@ -23,6 +23,7 @@
import org.exoplatform.portal.resource.config.tasks.PortalSkinTask;
import org.exoplatform.portal.resource.config.tasks.PortletSkinTask;
import org.exoplatform.portal.resource.config.tasks.ThemeTask;
+import org.exoplatform.web.resource.config.xml.GateinResource;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Deleted:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/GateinResource.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/GateinResource.java 2009-12-07
10:41:38 UTC (rev 959)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/GateinResource.java 2009-12-07
10:49:28 UTC (rev 960)
@@ -1,64 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.portal.resource.config.xml;
-
-/**
- *
- * Created by eXoPlatform SAS
- *
- * Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 17, 2009
- */
-public interface GateinResource
-{
-
- final public static String SKIN_DEF_TAG = "skin-def";
-
- final public static String SKIN_NAME_TAG = "skin-name";
-
- final public static String SKIN_MODULE_TAG = "skin-module";
-
- final public static String PORTAl_SKIN_TAG = "portal-skin";
-
- final public static String PORTLET_SKIN_TAG = "portlet-skin";
-
- final public static String PORTLET_NAME_TAG = "portlet-name";
-
- final public static String APPLICATION_NAME_TAG = "application-name";
-
- final public static String CSS_PATH_TAG = "css-path";
-
- final public static String WINDOW_STYLE_TAG = "window-style";
-
- final public static String STYLE_NAME_TAG = "style-name";
-
- final public static String STYLE_THEME_TAG = "style-theme";
-
- final public static String THEME_NAME_TAG = "theme-name";
-
- final public static String JAVA_SCRIPT_TAG = "javascript";
-
- final public static String JAVA_SCRIPT_PARAM = "param";
-
- final public static String JAVA_SCRIPT_MODULE = "js-module";
-
- final public static String JAVA_SCRIPT_PATH = "js-path";
-}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/SkinConfigParser.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/SkinConfigParser.java 2009-12-07
10:41:38 UTC (rev 959)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/SkinConfigParser.java 2009-12-07
10:49:28 UTC (rev 960)
@@ -21,6 +21,7 @@
import org.exoplatform.portal.resource.SkinService;
import org.exoplatform.portal.resource.config.tasks.AbstractSkinTask;
+import org.exoplatform.web.resource.config.xml.GateinResource;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified:
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigParser.java
===================================================================
---
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigParser.java 2009-12-07
10:41:38 UTC (rev 959)
+++
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigParser.java 2009-12-07
10:49:28 UTC (rev 960)
@@ -26,6 +26,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.exoplatform.web.resource.config.xml.GateinResource;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -68,9 +69,7 @@
{
List<JavascriptTask> tasks = new ArrayList<JavascriptTask>();
Element element = document.getDocumentElement();
- // NodeList nodes =
- // element.getElementsByTagName(GateinResource.JAVA_SCRIPT_TAG);
- NodeList nodes = element.getElementsByTagName("javascript");
+ NodeList nodes = element.getElementsByTagName(GateinResource.JAVA_SCRIPT_TAG);
int length = nodes.getLength();
for (int i = 0; i < length; i++)
{
@@ -85,23 +84,22 @@
private static JavascriptTask xmlToTask(Element element)
{
- // if(!GateinResource.JAVA_SCRIPT_TAG.equals(element.getTagName())){
- if (!"javascript".equals(element.getTagName()))
+ if (!GateinResource.JAVA_SCRIPT_TAG.equals(element.getTagName()))
{
return null;
}
try
{
JavascriptTask task = new JavascriptTask();
- // NodeList nodes =
- // element.getElementsByTagName(GateinResource.JAVA_SCRIPT_PARAM);
- NodeList nodes = element.getElementsByTagName("param");
+ NodeList nodes =
element.getElementsByTagName(GateinResource.JAVA_SCRIPT_PARAM);
int length = nodes.getLength();
for (int i = 0; i < length; i++)
{
Element param_ele = (Element)nodes.item(i);
- String js_module =
param_ele.getElementsByTagName("js-module").item(0).getFirstChild().getNodeValue();
- String js_path =
param_ele.getElementsByTagName("js-path").item(0).getFirstChild().getNodeValue();
+ String js_module =
+
param_ele.getElementsByTagName(GateinResource.JAVA_SCRIPT_MODULE).item(0).getFirstChild().getNodeValue();
+ String js_path =
+
param_ele.getElementsByTagName(GateinResource.JAVA_SCRIPT_PATH).item(0).getFirstChild().getNodeValue();
task.addJSKey(js_module, js_path);
}
return task;
Added:
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java
===================================================================
---
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java
(rev 0)
+++
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java 2009-12-07
10:49:28 UTC (rev 960)
@@ -0,0 +1,64 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.web.resource.config.xml;
+
+/**
+ *
+ * Created by eXoPlatform SAS
+ *
+ * Author: Minh Hoang TO - hoang281283(a)gmail.com
+ *
+ * Sep 17, 2009
+ */
+public interface GateinResource
+{
+
+ final public static String SKIN_DEF_TAG = "skin-def";
+
+ final public static String SKIN_NAME_TAG = "skin-name";
+
+ final public static String SKIN_MODULE_TAG = "skin-module";
+
+ final public static String PORTAl_SKIN_TAG = "portal-skin";
+
+ final public static String PORTLET_SKIN_TAG = "portlet-skin";
+
+ final public static String PORTLET_NAME_TAG = "portlet-name";
+
+ final public static String APPLICATION_NAME_TAG = "application-name";
+
+ final public static String CSS_PATH_TAG = "css-path";
+
+ final public static String WINDOW_STYLE_TAG = "window-style";
+
+ final public static String STYLE_NAME_TAG = "style-name";
+
+ final public static String STYLE_THEME_TAG = "style-theme";
+
+ final public static String THEME_NAME_TAG = "theme-name";
+
+ final public static String JAVA_SCRIPT_TAG = "javascript";
+
+ final public static String JAVA_SCRIPT_PARAM = "param";
+
+ final public static String JAVA_SCRIPT_MODULE = "js-module";
+
+ final public static String JAVA_SCRIPT_PATH = "js-path";
+}