Author: hoang_to
Date: 2009-10-30 00:15:28 -0400 (Fri, 30 Oct 2009)
New Revision: 450
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/
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/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
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/tasks/
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/xml/AbstractTaskXMLBinding.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/xml/SkinConfigParser.java
Log:
GTNPORTAL-131: Javascript deployment
Added:
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
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/AbstractSkinTask.java 2009-10-30
04:15:28 UTC (rev 450)
@@ -0,0 +1,37 @@
+/**
+ * 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.skin.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);
+}
Added:
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
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/I18nTask.java 2009-10-30
04:15:28 UTC (rev 450)
@@ -0,0 +1,49 @@
+/**
+ * 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.skin.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
+
+ }
+
+}
Added:
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
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java 2009-10-30
04:15:28 UTC (rev 450)
@@ -0,0 +1,87 @@
+/**
+ * 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.skin.SkinService;
+
+import javax.servlet.ServletContext;
+
+/**
+ *
+ * Created by eXoPlatform SAS
+ *
+ * Author: Minh Hoang TO - hoang281283(a)gmail.com
+ *
+ * Sep 16, 2009
+ */
+public class PortalSkinTask extends AbstractSkinTask
+{
+
+ private static final String DEFAULT_MODULE_NAME = "CoreSkin";
+
+ private static final String DEFAULT_SKIN_NAME = "Default";
+
+ private String moduleName;
+
+ private String skinName;
+
+ private String cssPath;
+
+ private boolean overwrite;
+
+ public PortalSkinTask()
+ {
+ this.overwrite = true;
+ this.moduleName = DEFAULT_MODULE_NAME;
+ this.skinName = DEFAULT_SKIN_NAME;
+ }
+
+ public void setModuleName(String _moduleName)
+ {
+ this.moduleName = _moduleName;
+ }
+
+ public void setSkinName(String _skinName)
+ {
+ this.skinName = _skinName;
+ }
+
+ public void setCSSPath(String _cssPath)
+ {
+ this.cssPath = _cssPath;
+ }
+
+ public void setOverwrite(boolean _overwrite)
+ {
+ this.overwrite = _overwrite;
+ }
+
+ @Override
+ public void execute(SkinService skinService, ServletContext scontext)
+ {
+ if (moduleName == null || skinName == null || cssPath == null)
+ {
+ return;
+ }
+ String fullCSSPath = scontext.getContextPath() + cssPath;
+ skinService.addPortalSkin(moduleName, skinName, fullCSSPath, scontext, overwrite);
+ }
+
+}
Added:
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
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java 2009-10-30
04:15:28 UTC (rev 450)
@@ -0,0 +1,94 @@
+/**
+ * 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.skin.SkinService;
+
+import javax.servlet.ServletContext;
+
+/**
+ *
+ * Created by eXoPlatform SAS
+ *
+ * Author: Minh Hoang TO - hoang281283(a)gmail.com
+ *
+ * Sep 16, 2009
+ */
+public class PortletSkinTask extends AbstractSkinTask
+{
+
+ private String applicationName;
+
+ private String portletName;
+
+ private String skinName;
+
+ private String cssPath;
+
+ private boolean overwrite;
+
+ public PortletSkinTask()
+ {
+ this.skinName = "Default";
+ this.overwrite = true;
+ }
+
+ public void setApplicationName(String _applicationName)
+ {
+ this.applicationName = _applicationName;
+ }
+
+ public void setPortletName(String _portletName)
+ {
+ this.portletName = _portletName;
+ }
+
+ public void setSkinName(String _skinName)
+ {
+ this.skinName = _skinName;
+ }
+
+ public void setCSSPath(String _cssPath)
+ {
+ this.cssPath = _cssPath;
+ }
+
+ public void setOverwrite(boolean _overwrite)
+ {
+ this.overwrite = _overwrite;
+ }
+
+ @Override
+ public void execute(SkinService skinService, ServletContext scontext)
+ {
+ if (portletName == null || skinName == null || cssPath == null)
+ {
+ return;
+ }
+ if (applicationName == null)
+ {
+ applicationName = scontext.getContextPath();
+ }
+ String moduleName = applicationName + "/" + portletName;
+ String fullCSSPath = scontext.getContextPath() + cssPath;
+ skinService.addSkin(moduleName, skinName, fullCSSPath, scontext, overwrite);
+ }
+
+}
Added:
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
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/ThemeTask.java 2009-10-30
04:15:28 UTC (rev 450)
@@ -0,0 +1,70 @@
+/**
+ * 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.skin.SkinService;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+/**
+ *
+ * Created by eXoPlatform SAS
+ *
+ * Author: Minh Hoang TO - hoang281283(a)gmail.com
+ *
+ * Sep 16, 2009
+ */
+public class ThemeTask extends AbstractSkinTask
+{
+
+ private String styleName;
+
+ private List<String> themeNames;
+
+ public ThemeTask()
+ {
+ this.themeNames = new ArrayList<String>();
+ }
+
+ public void addThemeName(String _themeName)
+ {
+ //TODO: Check duplicated theme name
+ this.themeNames.add(_themeName);
+ }
+
+ public void setStyleName(String _styleName)
+ {
+ this.styleName = _styleName;
+ }
+
+ @Override
+ public void execute(SkinService skinService, ServletContext scontext)
+ {
+ if (styleName == null || themeNames.size() < 1)
+ {
+ return;
+ }
+ skinService.addTheme(styleName, themeNames);
+ }
+
+}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/xml/AbstractTaskXMLBinding.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/xml/AbstractTaskXMLBinding.java 2009-10-30
04:05:22 UTC (rev 449)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/xml/AbstractTaskXMLBinding.java 2009-10-30
04:15:28 UTC (rev 450)
@@ -19,10 +19,10 @@
package org.exoplatform.portal.skin.config.xml;
-import org.exoplatform.portal.skin.config.tasks.AbstractSkinTask;
-import org.exoplatform.portal.skin.config.tasks.PortalSkinTask;
-import org.exoplatform.portal.skin.config.tasks.PortletSkinTask;
-import org.exoplatform.portal.skin.config.tasks.ThemeTask;
+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.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/xml/SkinConfigParser.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/xml/SkinConfigParser.java 2009-10-30
04:05:22 UTC (rev 449)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/config/xml/SkinConfigParser.java 2009-10-30
04:15:28 UTC (rev 450)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.skin.config.xml;
+import org.exoplatform.portal.resource.config.tasks.AbstractSkinTask;
import org.exoplatform.portal.skin.SkinService;
-import org.exoplatform.portal.skin.config.tasks.AbstractSkinTask;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;