Author: trong.tran
Date: 2010-02-03 02:54:19 -0500 (Wed, 03 Feb 2010)
New Revision: 1509
Modified:
portal/branches/3.0.0-Beta05-CP/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java
portal/branches/3.0.0-Beta05-CP/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java
portal/branches/3.0.0-Beta05-CP/examples/extension/war/src/main/webapp/WEB-INF/gatein-resources.xml
portal/branches/3.0.0-Beta05-CP/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/branches/3.0.0-Beta05-CP/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java
===================================================================
---
portal/branches/3.0.0-Beta05-CP/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java 2010-02-03
07:46:46 UTC (rev 1508)
+++
portal/branches/3.0.0-Beta05-CP/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java 2010-02-03
07:54:19 UTC (rev 1509)
@@ -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/branches/3.0.0-Beta05-CP/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java
===================================================================
---
portal/branches/3.0.0-Beta05-CP/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java 2010-02-03
07:46:46 UTC (rev 1508)
+++
portal/branches/3.0.0-Beta05-CP/component/web/src/main/java/org/exoplatform/web/resource/config/xml/GateinResource.java 2010-02-03
07:54:19 UTC (rev 1509)
@@ -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/branches/3.0.0-Beta05-CP/examples/extension/war/src/main/webapp/WEB-INF/gatein-resources.xml
===================================================================
---
portal/branches/3.0.0-Beta05-CP/examples/extension/war/src/main/webapp/WEB-INF/gatein-resources.xml 2010-02-03
07:46:46 UTC (rev 1508)
+++
portal/branches/3.0.0-Beta05-CP/examples/extension/war/src/main/webapp/WEB-INF/gatein-resources.xml 2010-02-03
07:54:19 UTC (rev 1509)
@@ -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/branches/3.0.0-Beta05-CP/web/portal/src/main/webapp/WEB-INF/gatein_resources_1_0.xsd
===================================================================
---
portal/branches/3.0.0-Beta05-CP/web/portal/src/main/webapp/WEB-INF/gatein_resources_1_0.xsd 2010-02-03
07:46:46 UTC (rev 1508)
+++
portal/branches/3.0.0-Beta05-CP/web/portal/src/main/webapp/WEB-INF/gatein_resources_1_0.xsd 2010-02-03
07:54:19 UTC (rev 1509)
@@ -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>