Author: trong.tran
Date: 2010-04-21 09:28:51 -0400 (Wed, 21 Apr 2010)
New Revision: 2728
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinModule.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/SkinConfigTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/SkinConfigParser.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/resource/
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/resource/TestGateInResourceParser.java
portal/trunk/component/portal/src/test/resources/WEB-INF/
portal/trunk/component/portal/src/test/resources/WEB-INF/gatein-resources.xml
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/I18nTask.java
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
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SimpleSkin.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/ThemeTask.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java
Log:
Improve the gatein skin config resources resolver
Add tests for resources xml parser
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SimpleSkin.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SimpleSkin.java 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SimpleSkin.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -69,6 +69,11 @@
return name_;
}
+ public String toString()
+ {
+ return "SimpleSkin[id=" + id_ + ",module=" + module_ +
",name=" + name_ + ",cssPath=" + cssPath_ + "]";
+ }
+
public SkinURL createURL()
{
return new SkinURL()
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -183,6 +183,11 @@
{
skinConfig = new SimpleSkin(this, module, skinName, cssPath);
portalSkins_.put(key, skinConfig);
+
+ if (log.isDebugEnabled())
+ {
+ log.debug("Adding Portal skin : Bind " + key + " to " +
skinConfig);
+ }
}
}
@@ -193,6 +198,11 @@
if (skinConfig == null)
{
portalSkins_.put(key, new SimpleSkin(this, module, skinName, cssPath));
+
+ if (log.isDebugEnabled())
+ {
+ log.debug("Adding Portal skin : Bind " + key + " to " +
skinConfig);
+ }
}
ltCache.put(cssPath, new CachedStylesheet(cssData));
rtCache.put(cssPath, new CachedStylesheet(cssData));
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinModule.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinModule.java
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinModule.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -0,0 +1,87 @@
+/**
+ * Copyright (C) 2010 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.tasks;
+
+import org.exoplatform.web.resource.config.xml.GateinResource;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author <a href="trong.tran(a)exoplatform.com">Trong Tran</a>
+ * @version $Revision$
+ */
+
+public abstract class AbstractSkinModule implements GateinResource
+{
+ protected String skinName;
+ protected String cssPath;
+ protected boolean overwrite;
+
+ public AbstractSkinModule(String name)
+ {
+ skinName = name;
+ }
+
+ protected void bindingSkinName(Element element)
+ {
+ NodeList nodes = element.getElementsByTagName(GateinResource.SKIN_NAME_TAG);
+ if (nodes == null || nodes.getLength() < 1)
+ {
+ return;
+ }
+ this.skinName = nodes.item(0).getFirstChild().getNodeValue();
+ }
+
+ protected void bindingCSSPath(Element element)
+ {
+ NodeList nodes = element.getElementsByTagName(GateinResource.CSS_PATH_TAG);
+ if (nodes == null || nodes.getLength() < 1)
+ {
+ return;
+ }
+ this.cssPath = nodes.item(0).getFirstChild().getNodeValue();
+ }
+
+ protected void bindingOverwrite(Element element)
+ {
+ NodeList nodes = element.getElementsByTagName(GateinResource.OVERWRITE);
+ if (nodes == null || nodes.getLength() < 1)
+ {
+ return;
+ }
+ String overwrite = nodes.item(0).getFirstChild().getNodeValue();
+ setOverwrite("true".equals(overwrite));
+ }
+
+ public void setSkinName(String name)
+ {
+ this.skinName = name;
+ }
+
+
+ public void setCSSPath(String _cssPath)
+ {
+ this.cssPath = _cssPath;
+ }
+
+ public void setOverwrite(boolean _overwrite)
+ {
+ this.overwrite = _overwrite;
+ }
+}
Deleted:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinTask.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinTask.java 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinTask.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -1,37 +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.tasks;
-
-import org.exoplatform.portal.resource.SkinService;
-
-import javax.servlet.ServletContext;
-
-/**
- *
- * Created by eXoPlatform SAS
- *
- * Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 16, 2009
- */
-abstract public class AbstractSkinTask
-{
- abstract public void execute(SkinService skinService, ServletContext scontext);
-}
Deleted:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/I18nTask.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/I18nTask.java 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/I18nTask.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -1,49 +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.tasks;
-
-import org.exoplatform.portal.resource.SkinService;
-
-import javax.servlet.ServletContext;
-
-/**
- *
- * Created by eXoPlatform SAS
- *
- * Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 16, 2009
- */
-public class I18nTask extends AbstractSkinTask
-{
-
- public I18nTask()
- {
-
- }
-
- @Override
- public void execute(SkinService skinService, ServletContext scontext)
- {
- // TODO Auto-generated method stub
-
- }
-
-}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -21,6 +21,9 @@
import org.exoplatform.portal.resource.SkinDependentManager;
import org.exoplatform.portal.resource.SkinService;
+import org.exoplatform.web.resource.config.xml.GateinResource;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
import javax.servlet.ServletContext;
@@ -32,7 +35,7 @@
*
* Sep 16, 2009
*/
-public class PortalSkinTask extends AbstractSkinTask
+public class PortalSkinTask extends AbstractSkinModule implements SkinConfigTask
{
private static final String DEFAULT_MODULE_NAME = "CoreSkin";
@@ -41,39 +44,32 @@
private String moduleName;
- private String skinName;
-
- private String cssPath;
-
- private boolean overwrite;
-
public PortalSkinTask()
{
+ super(DEFAULT_SKIN_NAME);
this.overwrite = true;
this.moduleName = DEFAULT_MODULE_NAME;
- this.skinName = DEFAULT_SKIN_NAME;
}
- public void setModuleName(String _moduleName)
+ private void bindingModuleName(Element element)
{
- this.moduleName = _moduleName;
+ NodeList nodes = element.getElementsByTagName(GateinResource.SKIN_MODULE_TAG);
+ if (nodes == null || nodes.getLength() < 1)
+ {
+ return;
+ }
+ moduleName = nodes.item(0).getFirstChild().getNodeValue();
}
-
- public void setSkinName(String _skinName)
+
+ @Override
+ public void binding(Element elemt)
{
- this.skinName = _skinName;
+ bindingCSSPath(elemt);
+ bindingSkinName(elemt);
+ bindingModuleName(elemt);
+ bindingOverwrite(elemt);
}
- public void setCSSPath(String _cssPath)
- {
- this.cssPath = _cssPath;
- }
-
- public void setOverwrite(boolean _overwrite)
- {
- this.overwrite = _overwrite;
- }
-
@Override
public void execute(SkinService skinService, ServletContext scontext)
{
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -21,6 +21,9 @@
import org.exoplatform.portal.resource.SkinDependentManager;
import org.exoplatform.portal.resource.SkinService;
+import org.exoplatform.web.resource.config.xml.GateinResource;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
import javax.servlet.ServletContext;
@@ -32,50 +35,51 @@
*
* Sep 16, 2009
*/
-public class PortletSkinTask extends AbstractSkinTask
+public class PortletSkinTask extends AbstractSkinModule implements SkinConfigTask
{
private String applicationName;
private String portletName;
- private String skinName;
-
- private String cssPath;
-
- private boolean overwrite;
-
public PortletSkinTask()
{
- this.skinName = "Default";
+ super("Default");
this.overwrite = true;
}
- public void setApplicationName(String _applicationName)
+ private void bindingApplicationName(Element element)
{
- this.applicationName = _applicationName;
+ NodeList nodes =
element.getElementsByTagName(GateinResource.APPLICATION_NAME_TAG);
+ if (nodes == null || nodes.getLength() < 1)
+ {
+ return;
+ }
+ String applicationName = nodes.item(0).getFirstChild().getNodeValue();
+ setApplicationName(applicationName);
}
- public void setPortletName(String _portletName)
+ private void bindingPortletName(Element element)
{
- this.portletName = _portletName;
+ NodeList nodes = element.getElementsByTagName(GateinResource.PORTLET_NAME_TAG);
+ if (nodes == null || nodes.getLength() < 1)
+ {
+ return;
+ }
+ String portletName = nodes.item(0).getFirstChild().getNodeValue();
+ setPortletName(portletName);
}
- public void setSkinName(String _skinName)
+ public void setApplicationName(String _applicationName)
{
- this.skinName = _skinName;
+ this.applicationName = _applicationName;
}
- public void setCSSPath(String _cssPath)
+ public void setPortletName(String _portletName)
{
- this.cssPath = _cssPath;
+ this.portletName = _portletName;
}
- public void setOverwrite(boolean _overwrite)
- {
- this.overwrite = _overwrite;
- }
-
@Override
public void execute(SkinService skinService, ServletContext scontext)
{
@@ -100,4 +104,14 @@
SkinDependentManager.addSkinDeployedInApp(webApp, skinName);
}
+ @Override
+ public void binding(Element elemt)
+ {
+ bindingApplicationName(elemt);
+ bindingPortletName(elemt);
+ bindingCSSPath(elemt);
+ bindingSkinName(elemt);
+ bindingOverwrite(elemt);
+ }
+
}
Copied:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/SkinConfigTask.java
(from rev 2683,
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinTask.java)
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/SkinConfigTask.java
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/SkinConfigTask.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -0,0 +1,34 @@
+/**
+ * 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.tasks;
+
+import org.exoplatform.portal.resource.SkinService;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author <a href="trong.tran(a)exoplatform.com">Trong Tran</a>
+ * @version $Revision$
+ */
+
+public interface SkinConfigTask
+{
+ public void execute(SkinService skinService, ServletContext scontext);
+}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/ThemeTask.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/ThemeTask.java 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/ThemeTask.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -20,6 +20,9 @@
package org.exoplatform.portal.resource.config.tasks;
import org.exoplatform.portal.resource.SkinService;
+import org.exoplatform.web.resource.config.xml.GateinResource;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
import java.util.ArrayList;
import java.util.List;
@@ -34,7 +37,7 @@
*
* Sep 16, 2009
*/
-public class ThemeTask extends AbstractSkinTask
+public class ThemeTask implements GateinResource, SkinConfigTask
{
private String styleName;
@@ -46,6 +49,30 @@
this.themeNames = new ArrayList<String>();
}
+ private void bindingStyleName(Element element)
+ {
+ NodeList nodes = element.getElementsByTagName(GateinResource.STYLE_NAME_TAG);
+ if (nodes == null || nodes.getLength() < 1)
+ {
+ return;
+ }
+ String styleName = nodes.item(0).getFirstChild().getNodeValue();
+ setStyleName(styleName);
+ }
+
+ private void bindingThemeNames(Element element)
+ {
+ NodeList nodes = element.getElementsByTagName(GateinResource.THEME_NAME_TAG);
+ if (nodes == null)
+ {
+ return;
+ }
+ for (int i = nodes.getLength() - 1; i >= 0; i--)
+ {
+ addThemeName(nodes.item(i).getFirstChild().getNodeValue());
+ }
+ }
+
public void addThemeName(String _themeName)
{
//TODO: Check duplicated theme name
@@ -56,6 +83,13 @@
{
this.styleName = _styleName;
}
+
+ @Override
+ public void binding(Element elemt)
+ {
+ bindingStyleName(elemt);
+ bindingThemeNames(elemt);
+ }
@Override
public void execute(SkinService skinService, ServletContext scontext)
@@ -66,5 +100,4 @@
}
skinService.addTheme(styleName, themeNames);
}
-
}
Deleted:
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 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -1,233 +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;
-
-import org.exoplatform.portal.resource.config.tasks.AbstractSkinTask;
-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;
-
-/**
- *
- * Created by eXoPlatform SAS
- *
- * Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 17, 2009
- */
-public abstract class AbstractTaskXMLBinding
-{
-
- /** Bind an XML element to a skin task */
- abstract public AbstractSkinTask xmlToTask(Element element);
-
- public static class PortalSkinTaskXMLBinding extends AbstractTaskXMLBinding
- {
-
- @Override
- public AbstractSkinTask xmlToTask(Element element)
- {
- if (!element.getTagName().equals(GateinResource.PORTAl_SKIN_TAG))
- {
- return null;
- }
- PortalSkinTask pTask = new PortalSkinTask();
- bindingCSSPath(pTask, element);
- bindingSkinName(pTask, element);
- bindingModuleName(pTask, element);
- bindingOverwrite(pTask, element);
- return pTask;
- }
-
- private void bindingCSSPath(PortalSkinTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.CSS_PATH_TAG);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String cssPath = nodes.item(0).getFirstChild().getNodeValue();
- task.setCSSPath(cssPath);
- }
-
- private void bindingSkinName(PortalSkinTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.SKIN_NAME_TAG);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String skinName = nodes.item(0).getFirstChild().getNodeValue();
- task.setSkinName(skinName);
- }
-
- private void bindingModuleName(PortalSkinTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.SKIN_MODULE_TAG);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String skinModule = nodes.item(0).getFirstChild().getNodeValue();
- task.setModuleName(skinModule);
- }
-
- private void bindingOverwrite(PortalSkinTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.OVERWRITE);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String overwrite = nodes.item(0).getFirstChild().getNodeValue();
- task.setOverwrite("true".equals(overwrite));
- }
-
- }
-
- public static class ThemeTaskXMLBinding extends AbstractTaskXMLBinding
- {
- @Override
- public AbstractSkinTask xmlToTask(Element element)
- {
- if (!element.getTagName().equals(GateinResource.WINDOW_STYLE_TAG))
- {
- return null;
- }
- ThemeTask tTask = new ThemeTask();
-
- bindingStyleName(tTask, element);
- bindingThemeNames(tTask, element);
-
- return tTask;
- }
-
- private void bindingStyleName(ThemeTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.STYLE_NAME_TAG);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String styleName = nodes.item(0).getFirstChild().getNodeValue();
- task.setStyleName(styleName);
- }
-
- private void bindingThemeNames(ThemeTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.THEME_NAME_TAG);
- if (nodes == null)
- {
- return;
- }
- for (int i = nodes.getLength() - 1; i >= 0; i--)
- {
- task.addThemeName(nodes.item(i).getFirstChild().getNodeValue());
- }
- }
- }
-
- public static class PortletSkinTaskXMLBinding extends AbstractTaskXMLBinding
- {
- @Override
- public AbstractSkinTask xmlToTask(Element element)
- {
- if (!element.getTagName().equals(GateinResource.PORTLET_SKIN_TAG))
- {
- return null;
- }
- PortletSkinTask pTask = new PortletSkinTask();
- bindingApplicationName(pTask, element);
- bindingPortletName(pTask, element);
- bindingCSSPath(pTask, element);
- bindingSkinName(pTask, element);
- bindingOverwrite(pTask, element);
- return pTask;
- }
-
- private void bindingApplicationName(PortletSkinTask task, Element element)
- {
- NodeList nodes =
element.getElementsByTagName(GateinResource.APPLICATION_NAME_TAG);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String applicationName = nodes.item(0).getFirstChild().getNodeValue();
- task.setApplicationName(applicationName);
- }
-
- private void bindingPortletName(PortletSkinTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.PORTLET_NAME_TAG);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String portletName = nodes.item(0).getFirstChild().getNodeValue();
- task.setPortletName(portletName);
- }
-
- private void bindingCSSPath(PortletSkinTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.CSS_PATH_TAG);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String cssPath = nodes.item(0).getFirstChild().getNodeValue();
- task.setCSSPath(cssPath);
- }
-
- private void bindingSkinName(PortletSkinTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.SKIN_NAME_TAG);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String skinName = nodes.item(0).getFirstChild().getNodeValue();
- task.setSkinName(skinName);
- }
-
- private void bindingOverwrite(PortletSkinTask task, Element element)
- {
- NodeList nodes = element.getElementsByTagName(GateinResource.OVERWRITE);
- if (nodes == null || nodes.getLength() < 1)
- {
- return;
- }
- String overwrite = nodes.item(0).getFirstChild().getNodeValue();
- task.setOverwrite("true".equals(overwrite));
- }
- }
-
- public static class I18nTaskXMLBinding extends AbstractTaskXMLBinding
- {
- @Override
- public AbstractSkinTask xmlToTask(Element element)
- {
- return null;
- }
- }
-
-}
Deleted:
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 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/SkinConfigParser.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -1,128 +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;
-
-import org.exoplatform.commons.xml.DocumentSource;
-import org.exoplatform.commons.xml.XMLValidator;
-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;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-
-/**
- *
- * Created by eXoPlatform SAS
- *
- * Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 16, 2009
- */
-public class SkinConfigParser
-{
-
- /** . */
- public static final String GATEIN_RESOURCES_1_0_SYSTEM_ID =
"http://www.gatein.org/xml/ns/gatein_resources_1_0";
-
- /** . */
- private static final String GATEIN_RESOURCE_1_0_XSD_PATH =
"gatein_resources_1_0.xsd";
-
- /** . */
- private static final XMLValidator VALIDATOR = new XMLValidator(
- SkinConfigParser.class,
- GATEIN_RESOURCES_1_0_SYSTEM_ID,
- GATEIN_RESOURCE_1_0_XSD_PATH);
-
- private final static Map<String, AbstractTaskXMLBinding> allBindings = new
HashMap<String, AbstractTaskXMLBinding>();
-
- static
- {
- allBindings.put(GateinResource.PORTAl_SKIN_TAG, new
AbstractTaskXMLBinding.PortalSkinTaskXMLBinding());
- allBindings.put(GateinResource.PORTLET_SKIN_TAG, new
AbstractTaskXMLBinding.PortletSkinTaskXMLBinding());
- allBindings.put(GateinResource.WINDOW_STYLE_TAG, new
AbstractTaskXMLBinding.ThemeTaskXMLBinding());
- }
-
- public static void processConfigResource(DocumentSource source, SkinService
skinService, ServletContext scontext)
- {
- List<AbstractSkinTask> allTasks = fetchTasks(source);
- if (allTasks != null)
- {
- for (AbstractSkinTask task : allTasks)
- {
- task.execute(skinService, scontext);
- }
- }
- }
-
- private static List<AbstractSkinTask> fetchTasks(DocumentSource source)
- {
- try
- {
- Document document = VALIDATOR.validate(source);
- return fetchTasksFromXMLConfig(document);
- }
- catch (Exception ex)
- {
- return null;
- }
- }
-
- private static List<AbstractSkinTask> fetchTasksFromXMLConfig(Document
document)
- {
- List<AbstractSkinTask> tasks = new ArrayList<AbstractSkinTask>();
- Element docElement = document.getDocumentElement();
-
- fetchTasksByTagName(GateinResource.PORTAl_SKIN_TAG, docElement, tasks);
- fetchTasksByTagName(GateinResource.PORTLET_SKIN_TAG, docElement, tasks);
- fetchTasksByTagName(GateinResource.WINDOW_STYLE_TAG, docElement, tasks);
-
- return tasks;
- }
-
- private static void fetchTasksByTagName(String tagName, Element rootElement,
List<AbstractSkinTask> tasks)
- {
- AbstractTaskXMLBinding binding = allBindings.get(tagName);
- //If there is no binding for current tagName, then return
- if (binding == null)
- {
- return;
- }
-
- NodeList nodes = rootElement.getElementsByTagName(tagName);
- AbstractSkinTask task;
-
- for (int i = nodes.getLength() - 1; i >= 0; i--)
- {
- task = binding.xmlToTask((Element)nodes.item(i));
- if (task != null)
- {
- tasks.add(task);
- }
- }
- }
-}
Added:
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
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/SkinConfigParser.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -0,0 +1,128 @@
+/**
+ * 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;
+
+import org.exoplatform.commons.xml.DocumentSource;
+import org.exoplatform.commons.xml.XMLValidator;
+import org.exoplatform.portal.resource.SkinService;
+import org.exoplatform.portal.resource.config.tasks.SkinConfigTask;
+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.application.javascript.JavascriptTask;
+import org.exoplatform.web.resource.config.xml.GateinResource;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author <a href="trong.tran(a)exoplatform.com">Trong Tran</a>
+ * @version $Revision$
+ */
+
+public class SkinConfigParser
+{
+
+ /** . */
+ public static final String GATEIN_RESOURCES_1_0_SYSTEM_ID =
"http://www.gatein.org/xml/ns/gatein_resources_1_0";
+
+ /** . */
+ private static final String GATEIN_RESOURCE_1_0_XSD_PATH =
"gatein_resources_1_0.xsd";
+
+ /** . */
+ private static final XMLValidator VALIDATOR = new XMLValidator(
+ SkinConfigParser.class,
+ GATEIN_RESOURCES_1_0_SYSTEM_ID,
+ GATEIN_RESOURCE_1_0_XSD_PATH);
+
+ public static void processConfigResource(DocumentSource source, SkinService
skinService, ServletContext scontext)
+ {
+ List<SkinConfigTask> allTasks = fetchTasks(source);
+ if (allTasks != null)
+ {
+ for (SkinConfigTask task : allTasks)
+ {
+ task.execute(skinService, scontext);
+ }
+ }
+ }
+
+ public static List<SkinConfigTask> fetchTasks(DocumentSource source)
+ {
+ try
+ {
+ Document document = VALIDATOR.validate(source);
+
+ List<SkinConfigTask> tasks = new ArrayList<SkinConfigTask>();
+ Element docElement = document.getDocumentElement();
+
+ fetchTasksByTagName(GateinResource.PORTAl_SKIN_TAG, docElement, tasks);
+ fetchTasksByTagName(GateinResource.PORTLET_SKIN_TAG, docElement, tasks);
+ fetchTasksByTagName(GateinResource.WINDOW_STYLE_TAG, docElement, tasks);
+
+ return tasks;
+ }
+ catch (Exception ex)
+ {
+ return null;
+ }
+ }
+
+ private static void fetchTasksByTagName(String tagName, Element rootElement,
List<SkinConfigTask> tasks)
+ {
+ NodeList nodes = rootElement.getElementsByTagName(tagName);
+ GateinResource task;
+
+ for (int i = nodes.getLength() - 1; i >= 0; i--)
+ {
+ task = elemtToTask(tagName);
+ if (task != null)
+ {
+ task.binding((Element)nodes.item(i));
+ tasks.add((SkinConfigTask)task);
+ }
+ }
+ }
+
+ /**
+ * Return a skin task associated to the <code>tagName</code> of an XML
element
+ */
+ private static GateinResource elemtToTask(String tagName)
+ {
+ if (tagName.equals(GateinResource.PORTAl_SKIN_TAG))
+ {
+ return new PortalSkinTask();
+ }
+ else if (tagName.equals(GateinResource.WINDOW_STYLE_TAG))
+ {
+ return new ThemeTask();
+ }
+ else if (tagName.equals(GateinResource.PORTLET_SKIN_TAG))
+ {
+ return new PortletSkinTask();
+ }
+ return null;
+ }
+}
Added:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/resource/TestGateInResourceParser.java
===================================================================
---
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/resource/TestGateInResourceParser.java
(rev 0)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/resource/TestGateInResourceParser.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -0,0 +1,23 @@
+package org.exoplatform.portal.resource;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.commons.xml.DocumentSource;
+import org.exoplatform.portal.resource.config.tasks.SkinConfigTask;
+import org.exoplatform.portal.resource.config.xml.SkinConfigParser;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+public class TestGateInResourceParser extends TestCase
+{
+ public void testBinding() throws MalformedURLException {
+ URL url = this.getClass().getResource("/WEB-INF/gatein-resources.xml");
+ assertNotNull("the gatein-resources.xml can not be found", url);
+ DocumentSource source = DocumentSource.create(url);
+ List<SkinConfigTask> tasks = SkinConfigParser.fetchTasks(source);
+ assertNotNull("There are no tasks", tasks);
+ assertEquals(8, tasks.size());
+ }
+}
Added: portal/trunk/component/portal/src/test/resources/WEB-INF/gatein-resources.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/WEB-INF/gatein-resources.xml
(rev 0)
+++
portal/trunk/component/portal/src/test/resources/WEB-INF/gatein-resources.xml 2010-04-21
13:28:51 UTC (rev 2728)
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<gatein-resources
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_0
http://www.gatein.org/xml/ns/gatein_resources_1_0"
+
xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_0">
+
+ <!-- Portal skins -->
+ <portal-skin>
+ <skin-name>Default</skin-name>
+ <css-path>/skin/Stylesheet.css</css-path>
+ </portal-skin>
+
+ <!-- BannerPortlet skins -->
+
+ <portlet-skin>
+ <application-name>web</application-name>
+ <portlet-name>BannerPortlet</portlet-name>
+ <skin-name>Default</skin-name>
+ <css-path>/skin/portal/webui/component/UIBannerPortlet/DefaultStylesheet.css</css-path>
+ </portlet-skin>
+
+ <!-- FooterPortlet skins -->
+
+ <portlet-skin>
+ <application-name>web</application-name>
+ <portlet-name>FooterPortlet</portlet-name>
+ <skin-name>Default</skin-name>
+ <css-path>/skin/portal/webui/component/UIFooterPortlet/DefaultStylesheet.css</css-path>
+ </portlet-skin>
+
+ <!-- Simple window style -->
+ <window-style>
+ <style-name>Simple</style-name>
+ <style-theme>
+ <theme-name>SimpleBlue</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>SimpleViolet</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>SimpleOrange</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>SimplePink</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>SimpleGreen</theme-name>
+ </style-theme>
+ </window-style>
+
+ <!-- RoundConer window style -->
+ <window-style>
+ <style-name>RoundConer</style-name>
+ <style-theme>
+ <theme-name>RoundConerBlue</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>RoundConerViolet</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>RoundConerOrange</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>RoundConerPink</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>RoundConerGreen</theme-name>
+ </style-theme>
+ </window-style>
+
+ <!-- Shadow window style -->
+ <window-style>
+ <style-name>Shadow</style-name>
+ <style-theme>
+ <theme-name>ShadowBlue</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>ShadowViolet</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>ShadowOrange</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>ShadowPink</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>ShadowGreen</theme-name>
+ </style-theme>
+ </window-style>
+
+ <!-- MacStyle window style -->
+ <window-style>
+ <style-name>MacStyle</style-name>
+ <style-theme>
+ <theme-name>MacTheme</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>MacGray</theme-name>
+ </style-theme>
+ <style-theme>
+ <theme-name>MacGreenSteel</theme-name>
+ </style-theme>
+ </window-style>
+
+ <!-- VistaStyle window style -->
+ <window-style>
+ <style-name>VistaStyle</style-name>
+ <style-theme>
+ <theme-name>VistaTheme</theme-name>
+ </style-theme>
+ </window-style>
+
+ <javascript>
+ <param>
+ <js-module>eXo</js-module>
+ <js-path>/javascript/eXo.js</js-path>
+ <js-priority>0</js-priority>
+ </param>
+ </javascript>
+
+ <!-- CORE Javascripts -->
+ <javascript>
+ <param>
+ <js-module>eXo.core.Utils</js-module>
+ <js-path>/javascript/eXo/core/Util.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.DOMUtil</js-module>
+ <js-path>/javascript/eXo/core/DOMUtil.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.Browser</js-module>
+ <js-path>/javascript/eXo/core/Browser.js</js-path>
+ <js-priority>2</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.MouseEventManager</js-module>
+ <js-path>/javascript/eXo/core/MouseEventManager.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.UIMaskLayer</js-module>
+ <js-path>/javascript/eXo/core/UIMaskLayer.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.Skin</js-module>
+ <js-path>/javascript/eXo/core/Skin.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.DragDrop</js-module>
+ <js-path>/javascript/eXo/core/DragDrop.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.DragDrop2</js-module>
+ <js-path>/javascript/eXo/core/DragDrop2.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.Topic</js-module>
+ <js-path>/javascript/eXo/core/Topic.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.JSON</js-module>
+ <js-path>/javascript/eXo/core/JSON.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.Cometd</js-module>
+ <js-path>/javascript/eXo/core/Cometd.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.Spliter</js-module>
+ <js-path>/javascript/eXo/core/Spliter.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.Notification</js-module>
+ <js-path>/javascript/eXo/core/Notification.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.Loader</js-module>
+ <js-path>/javascript/eXo/core/Loader.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.core.I18n</js-module>
+ <js-path>/javascript/eXo/core/I18n.js</js-path>
+ </param>
+ </javascript>
+
+ <!-- Gadget Javascripts -->
+ <javascript>
+ <param>
+ <js-module>eXo.gadget.UIGadget</js-module>
+ <js-path>/javascript/eXo/gadget/UIGadget.js</js-path>
+ </param>
+ </javascript>
+
+ <!-- WebUI Javascripts -->
+ <javascript>
+ <param>
+ <js-module>eXo.webui.UIItemSelector</js-module>
+ <js-path>/javascript/eXo/webui/UIItemSelector.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIForm</js-module>
+ <js-path>/javascript/eXo/webui/UIForm.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPopup</js-module>
+ <js-path>/javascript/eXo/webui/UIPopup.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPopupSelectCategory</js-module>
+ <js-path>/javascript/eXo/webui/UIPopupSelectCategory.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPopupWindow</js-module>
+ <js-path>/javascript/eXo/webui/UIPopupWindow.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIHorizontalTabs</js-module>
+ <js-path>/javascript/eXo/webui/UIHorizontalTabs.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPopupMenu</js-module>
+ <js-path>/javascript/eXo/webui/UIPopupMenu.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIDropDownControl</js-module>
+ <js-path>/javascript/eXo/webui/UIDropDownControl.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIRightClickPopupMenu</js-module>
+ <js-path>/javascript/eXo/webui/UIRightClickPopupMenu.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIVerticalSlideTabs</js-module>
+ <js-path>/javascript/eXo/webui/UIVerticalSlideTabs.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPermissionSelectorTab</js-module>
+ <js-path>/javascript/eXo/webui/UIPermissionSelectorTab.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIDashboard</js-module>
+ <js-path>/javascript/eXo/webui/UIDashboard.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIDashboardUtil</js-module>
+ <js-path>/javascript/eXo/webui/UIDashboardUtil.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UINotification</js-module>
+ <js-path>/javascript/eXo/webui/UINotification.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIUserSelector</js-module>
+ <js-path>/javascript/eXo/webui/UIUserSelector.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UICombobox</js-module>
+ <js-path>/javascript/eXo/webui/UICombobox.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UICombobox</js-module>
+ <js-path>/javascript/eXo/webui/UIVirtualList.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIColorPicker</js-module>
+ <js-path>/javascript/eXo/webui/UIColorPicker.js</js-path>
+ </param>
+ </javascript>
+
+ <!-- Portal Javascripts -->
+ <javascript>
+ <param>
+ <js-module>eXo.portal.PortalHttpRequest</js-module>
+ <js-path>/javascript/eXo/portal/PortalHttpRequest.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIPortal</js-module>
+ <js-path>/javascript/eXo/portal/UIPortal.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIWorkspace</js-module>
+ <js-path>/javascript/eXo/portal/UIWorkspace.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIPortalControl</js-module>
+ <js-path>/javascript/eXo/portal/UIPortalControl.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.portal.PortalDragDrop</js-module>
+ <js-path>/javascript/eXo/portal/PortalDragDrop.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIPortalNavigation</js-module>
+ <js-path>/javascript/eXo/portal/UIPortalNavigation.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIMaskWorkspace</js-module>
+ <js-path>/javascript/eXo/portal/UIMaskWorkspace.js</js-path>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIBrowseContent</js-module>
+ <js-path>/javascript/eXo/portal/UIBrowseContent.js</js-path>
+ </param>
+ </javascript>
+
+ <javascript>
+ <param>
+ <js-module>eXo.webui.UIPortlet</js-module>
+ <js-path>/javascript/eXo/webui/UIPortlet.js</js-path>
+ </param>
+ </javascript>
+</gatein-resources>
Modified:
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 2010-04-21
13:19:57 UTC (rev 2727)
+++
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java 2010-04-21
13:28:51 UTC (rev 2728)
@@ -19,6 +19,8 @@
package org.exoplatform.web.resource.config.xml;
+import org.w3c.dom.Element;
+
/**
*
* Created by eXoPlatform SAS
@@ -29,8 +31,6 @@
*/
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";
@@ -64,4 +64,6 @@
final public static String OVERWRITE = "overwrite";
final public static String JAVA_SCRIPT_PRIORITY = "js-priority";
+
+ public void binding(Element elemt);
}