[jboss-svn-commits] JBoss Portal SVN: r5610 - in branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme: . deployment/jboss metadata
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Nov 9 11:27:31 EST 2006
Author: roy.russo at jboss.com
Date: 2006-11-09 11:27:28 -0500 (Thu, 09 Nov 2006)
New Revision: 5610
Modified:
branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeInfo.java
branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeLink.java
branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeScript.java
branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalThemeMetaDataFactory.java
branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/metadata/ThemeScriptMetaData.java
Log:
JBPORTAL-1105 - fixed mangling of HTML resources of scripts/links
Modified: branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeInfo.java 2006-11-09 16:15:56 UTC (rev 5609)
+++ branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeInfo.java 2006-11-09 16:27:28 UTC (rev 5610)
@@ -67,7 +67,7 @@
for (int i = 0; i < scripts.size(); i++)
{
ThemeScriptMetaData scriptMD = (ThemeScriptMetaData)scripts.get(i);
- ThemeScript script = new ThemeScript(ctx.getContextPath(), scriptMD.getSrc(), scriptMD.getId(), scriptMD.getType(), scriptMD.getBodyContent());
+ ThemeScript script = new ThemeScript(ctx.getContextPath(), scriptMD.getSrc(), scriptMD.getId(), scriptMD.getType(), scriptMD.getBodyContent(), scriptMD.getCharset());
scripts.set(i, script);
}
for (int i = 0; i < links.size(); i++)
Modified: branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeLink.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeLink.java 2006-11-09 16:15:56 UTC (rev 5609)
+++ branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeLink.java 2006-11-09 16:27:28 UTC (rev 5610)
@@ -134,16 +134,16 @@
}
StringBuffer link = new StringBuffer();
- link.append("<link rel='").append(rel).append("'");
+ link.append("<link rel=\"").append(rel).append("\"");
if (type != null)
{
- link.append(" type='").append(type).append("'");
+ link.append(" type=\"").append(type).append("\"");
}
if (id != null && !"".equals(id))
{
- link.append(" id='").append(id).append("'");
+ link.append(" id=\"").append(id).append("\"");
}
if (href != null)
@@ -156,16 +156,16 @@
correctHREF.append(contextPath);
}
correctHREF.append(href);
- link.append(" href='").append(correctHREF).append("'");
+ link.append(" href=\"").append(correctHREF).append("\"");
}
if (title != null && !"".equals(title))
{
- link.append(" title='").append(title).append("'");
+ link.append(" title=\"").append(title).append("'");
}
if (media != null && !"".equals(media))
{
- link.append(" media='").append(media).append("'");
+ link.append(" media=\"").append(media).append("\"");
}
link.append(" />");
Modified: branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeScript.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeScript.java 2006-11-09 16:15:56 UTC (rev 5609)
+++ branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/ThemeScript.java 2006-11-09 16:27:28 UTC (rev 5610)
@@ -40,6 +40,7 @@
private final String src;
private final String type;
private final String id;
+ private final String charset;
private final String script;
/**
@@ -49,7 +50,7 @@
* @param src the value of the src attribute
* @param type the value of the type attribute
*/
- public ThemeScript(String contextPath, String src, String id, String type, String bodyContent)
+ public ThemeScript(String contextPath, String src, String id, String type, String bodyContent, String charset)
{
if (log.isDebugEnabled())
{
@@ -58,28 +59,37 @@
this.src = src;
this.id = id;
this.type = type;
- script = buildScriptMarkup(contextPath, src, id, type, bodyContent);
+ this.charset = charset;
+ script = buildScriptMarkup(contextPath, src, id, type, bodyContent, charset);
}
- /** @see org.jboss.portal.theme.ThemeScript#getScript */
+ /**
+ * @see org.jboss.portal.theme.ThemeScript#getScript
+ */
public String getScript()
{
return script;
}
- /** @see java.lang.Object#toString() */
+ /**
+ * @see java.lang.Object#toString()
+ */
public String toString()
{
return script;
}
- /** @see org.jboss.portal.theme.ThemeElement#getElement */
+ /**
+ * @see org.jboss.portal.theme.ThemeElement#getElement
+ */
public String getElement()
{
return getScript();
}
- /** @see org.jboss.portal.theme.ThemeElement at getAttributeValue */
+ /**
+ * @see org.jboss.portal.theme.ThemeElement at getAttributeValue
+ */
public String getAttributeValue(String attributeName)
{
if ("type".equals(attributeName))
@@ -97,10 +107,15 @@
return this.src;
}
+ if ("charset".equals(attributeName))
+ {
+ return this.charset;
+ }
+
return null;
}
- private static String buildScriptMarkup(String contextPath, String src, String id, String type, String bodyContent)
+ private static String buildScriptMarkup(String contextPath, String src, String id, String type, String bodyContent, String charset)
{
if (log.isDebugEnabled())
{
@@ -118,22 +133,28 @@
correctSRC.append(contextPath);
}
correctSRC.append(src);
- script.append(" src='").append(correctSRC).append("'");
+ script.append(" src=\"").append(correctSRC).append("\"");
}
if (id != null && !"".equals(id))
{
- script.append(" id='").append(id).append("'");
+ script.append(" id=\"").append(id).append("\"");
}
if (type != null && !"".equals(type))
{
- script.append(" type='").append(type).append("'");
+ script.append(" type=\"").append(type).append("\"");
}
+ if (charset != null && !"".equals(charset))
+ {
+ script.append(" charset=\"").append(charset).append("\"");
+ }
+
if (bodyContent == null || "".equals(bodyContent))
{
- script.append(" />");
+ //script.append(" />");
+ script.append("></script>");
}
else
{
Modified: branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalThemeMetaDataFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalThemeMetaDataFactory.java 2006-11-09 16:15:56 UTC (rev 5609)
+++ branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalThemeMetaDataFactory.java 2006-11-09 16:27:28 UTC (rev 5610)
@@ -82,6 +82,7 @@
script.setSrc(attrs.getValue("src"));
script.setId(attrs.getValue("id"));
script.setType(attrs.getValue("type"));
+ script.setCharset(attrs.getValue("charset"));
return script;
}
else if ("link".equals(localName))
Modified: branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/metadata/ThemeScriptMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/metadata/ThemeScriptMetaData.java 2006-11-09 16:15:56 UTC (rev 5609)
+++ branches/JBoss_Portal_Branch_2_4/theme/src/main/org/jboss/portal/theme/metadata/ThemeScriptMetaData.java 2006-11-09 16:27:28 UTC (rev 5610)
@@ -22,22 +22,34 @@
******************************************************************************/
package org.jboss.portal.theme.metadata;
-/** @author Martin Holzner */
+/**
+ * @author Martin Holzner
+ */
public final class ThemeScriptMetaData
{
- /** . */
+ /**
+ * .
+ */
private String src;
- /** . */
+ /**
+ * .
+ */
private String type;
- /** . */
+ /**
+ * .
+ */
private String id;
- /** . */
+ /**
+ * .
+ */
private String bodyContent;
+ private String charset;
+
public String getSrc()
{
return src;
@@ -77,4 +89,14 @@
{
this.bodyContent = bodyContent;
}
+
+ public String getCharset()
+ {
+ return charset;
+ }
+
+ public void setCharset(String charset)
+ {
+ this.charset = charset;
+ }
}
More information about the jboss-svn-commits
mailing list