Author: hoang_to
Date: 2010-02-01 21:27:54 -0500 (Mon, 01 Feb 2010)
New Revision: 1484
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java
portal/trunk/examples/extension/war/src/main/webapp/WEB-INF/gatein-resources.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/gatein_resources_1_0.xsd
Log:
GTNPORTAL-520: Add overwrite option for skin in gatein-resources.xml
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 2010-02-01
10:11:30 UTC (rev 1483)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java 2010-02-02
02:27:54 UTC (rev 1484)
@@ -55,7 +55,7 @@
bindingCSSPath(pTask, element);
bindingSkinName(pTask, element);
bindingModuleName(pTask, element);
-
+ bindingOverwrite(pTask, element);
return pTask;
}
@@ -91,6 +91,17 @@
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));
+ }
}
@@ -150,6 +161,7 @@
bindingPortletName(pTask, element);
bindingCSSPath(pTask, element);
bindingSkinName(pTask, element);
+ bindingOverwrite(pTask, element);
return pTask;
}
@@ -196,6 +208,17 @@
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
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-02-01
10:11:30 UTC (rev 1483)
+++
portal/trunk/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java 2010-02-02
02:27:54 UTC (rev 1484)
@@ -29,7 +29,6 @@
*/
public interface GateinResource
{
-
final public static String SKIN_DEF_TAG = "skin-def";
final public static String SKIN_NAME_TAG = "skin-name";
@@ -62,5 +61,7 @@
final public static String JAVA_SCRIPT_PATH = "js-path";
+ final public static String OVERWRITE = "overwrite";
+
final public static String JAVA_SCRIPT_PRIORITY = "js-priority";
}
Modified:
portal/trunk/examples/extension/war/src/main/webapp/WEB-INF/gatein-resources.xml
===================================================================
---
portal/trunk/examples/extension/war/src/main/webapp/WEB-INF/gatein-resources.xml 2010-02-01
10:11:30 UTC (rev 1483)
+++
portal/trunk/examples/extension/war/src/main/webapp/WEB-INF/gatein-resources.xml 2010-02-02
02:27:54 UTC (rev 1484)
@@ -28,6 +28,7 @@
<application-name>web</application-name>
<portlet-name>HomePagePortlet</portlet-name>
<skin-name>Default</skin-name>
+ <overwrite>false</overwrite>
<css-path>/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css</css-path>
</portlet-skin>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/gatein_resources_1_0.xsd
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/gatein_resources_1_0.xsd 2010-02-01
10:11:30 UTC (rev 1483)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/gatein_resources_1_0.xsd 2010-02-02
02:27:54 UTC (rev 1484)
@@ -41,6 +41,7 @@
<xs:sequence>
<xs:element name="skin-name" type="xs:string" />
<xs:element name="css-path" type="xs:string" />
+ <xs:element name="overwrite" type="xs:string" />
</xs:sequence>
</xs:complexType>
@@ -50,6 +51,7 @@
<xs:element name="portlet-name" type="xs:string" />
<xs:element name="skin-name" type="xs:string" />
<xs:element name="css-path" type="xs:string" />
+ <xs:element name="overwrite" type="xs:string" />
</xs:sequence>
</xs:complexType>
Show replies by date