Author: thomas.heute(a)jboss.com
Date: 2007-05-14 09:56:59 -0400 (Mon, 14 May 2007)
New Revision: 7249
Modified:
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/project.html
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java
Log:
Fix JBPORTAL-1398: CMS content redirecting to index page after failure in streaming
content
Modified:
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/project.html
===================================================================
---
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/project.html 2007-05-12
22:10:34 UTC (rev 7248)
+++
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/project.html 2007-05-14
13:56:59 UTC (rev 7249)
@@ -1,9 +1,8 @@
<table width="100%" border="0" cellpadding="2">
<tr>
- <td valign="top" align="left"
class="portlet-section-body"><font class="portlet-font">JBoss
Inc. delivers the
+ <td valign="top" align="left"
class="portlet-section-body" colspan="2"><font
class="portlet-font">JBoss Inc. delivers the
Professional Support, Consulting, and Training that you need whether you are
testing a proof of concept,
deploying a mission-critical application, or rolling out JEMS across your
enterprise. </font></td>
- <td valign="top" align="right"><img
src="default/images/jboss_logo.gif"></td>
</tr>
<tr>
<td colspan="2">
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java 2007-05-12
22:10:34 UTC (rev 7248)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java 2007-05-14
13:56:59 UTC (rev 7249)
@@ -134,7 +134,7 @@
File file = getFile(requestPath, requestLocale);
// Redirect to default content if nothing found (and WTF the content is prefixed
by /default ???)
- if (file == null && "/default/index.html".equals(path) ==
false)
+ if (file == null && "/default/index.html".equals(path) ==
false && !isStreamable(path))
{
path = "/default/index.html";
file = getFile(path, requestLocale);
@@ -144,17 +144,10 @@
if (file != null)
{
Content content = file.getContent();
-
if (content != null)
{
- boolean isStreamable = false;
- if (!"text/html".equalsIgnoreCase(content.getMimeType())
&& !"text/plain".equalsIgnoreCase(content.getMimeType()))
+ if (isStreamable(content.getMimeType()))
{
- isStreamable = true;
- }
-
- if (isStreamable)
- {
return new StreamContentCommand(requestPath);
}
else
@@ -185,4 +178,9 @@
return null; // TODO: 404?
}
+
+ private boolean isStreamable(String mimeType)
+ {
+ return (!"text/html".equalsIgnoreCase(mimeType) &&
!"text/plain".equalsIgnoreCase(mimeType));
+ }
}
Show replies by date