JBoss Portal SVN: r11046 - in modules/portlet/trunk: samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-06-13 11:34:50 -0400 (Fri, 13 Jun 2008)
New Revision: 11046
Modified:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller/RemoteControllerPortlet.java
Log:
- Hard-code path to simple-portal for now to access CSS and images.
- Use 2/3 width for Google map in wikipedia page.
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp 2008-06-13 15:14:20 UTC (rev 11045)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp 2008-06-13 15:34:50 UTC (rev 11046)
@@ -9,7 +9,7 @@
<portal:page>
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="32080"/>
<div class="wiki-content full-width">
- <div class="third-width float-right">
+ <div class="two-third-width float-right">
<xportal:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
</div>
<h2 class="title">St. Augustine, Florida</h2>
Modified: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller/RemoteControllerPortlet.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller/RemoteControllerPortlet.java 2008-06-13 15:14:20 UTC (rev 11045)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller/RemoteControllerPortlet.java 2008-06-13 15:34:50 UTC (rev 11046)
@@ -37,7 +37,7 @@
ResourceURL resource = renderResponse.createResourceURL();
printWriter.print(resource);
printWriter.print("')\">Open remote control!</a></p>");
-}
+ }
@Override
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws PortletException, IOException
@@ -46,17 +46,17 @@
PrintWriter writer = resourceResponse.getWriter();
String namespace = resourceResponse.getNamespace();
writer.print("<html><head><script type='text/javascript'>function openLinkInParent(url){window.open(url,'"
- + namespace + "_parent');}</script>\n<link rel=\"stylesheet\" href='" + resourceRequest.getContextPath() + "/css/master.css' type=\"text/css\"/></head><body>");
+ + namespace + "_parent');}</script>\n<link rel=\"stylesheet\" href='/simple-portal/css/master.css' type=\"text/css\"/></head><body>");
PortletURL url = resourceResponse.createRenderURL();
url.setWindowState(WindowState.MINIMIZED);
writer.print("<div class=\"remote-container\"><ul><li><a href='#' onclick=\"" + createParentURL(url) + "\"><img\n" +
- " src=\"" + resourceRequest.getContextPath() + "/images/icon-minimize.gif\" alt=\"\"/> minimize parent portlet</a></li>");
+ " src=\"/simple-portal/images/icon-minimize.gif\" alt=\"\"/> minimize parent portlet</a></li>");
url.setWindowState(WindowState.MAXIMIZED);
writer.print("<li><a href='#' onclick=\"" + createParentURL(url) + "\"><img\n" +
- " src=\"" + resourceRequest.getContextPath() + "/images/icon-maximize.gif\" alt=\"\"/> maximize parent portlet</a></li>");
+ " src=\"/simple-portal/images/icon-maximize.gif\" alt=\"\"/> maximize parent portlet</a></li>");
url.setWindowState(WindowState.NORMAL);
writer.print("<li><a href='#' onclick=\"" + createParentURL(url) + "\"><img\n" +
- " src=\"" + resourceRequest.getContextPath() + "/images/icon-normal.gif\" alt=\"\"/> make parent portlet normal</a></li></ul>");
+ " src=\"/simple-portal/images/icon-normal.gif\" alt=\"\"/> make parent portlet normal</a></li></ul>");
writer.print("<br/><ul><li><b>'zipcode'</b> public render parameter value: " + resourceRequest.getParameter(ZIPCODE) + "<br/>");
writer.print("Set value of <b>'zipcode'</b> public render parameter to:</li>");
url.setParameter(ZIPCODE, "80201");
17 years, 10 months
JBoss Portal SVN: r11045 - modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-13 11:14:20 -0400 (Fri, 13 Jun 2008)
New Revision: 11045
Modified:
modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java
modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleWeatherClippingPortlet.java
Log:
merging google fix to 2.0.0
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java 2008-06-13 15:05:43 UTC (rev 11044)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java 2008-06-13 15:14:20 UTC (rev 11045)
@@ -52,7 +52,11 @@
private static final String A_TARGET_BLANK = "<a target='_blank'";
private static final String ZIP = "zipcode";
private static final String SAN_FRAN = "94102";
- private static final String GOOGLE = "http://www.google.com/search?q=";
+ /**
+ * gl=US forces use of US google site, hl=en forces results to be in English so that regardless of location the query
+ * should result in the expected result.
+ */
+ private static final String GOOGLE = "http://www.google.com/search?gl=US&hl=en&q=";
@Override
protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException
@@ -71,22 +75,43 @@
in.close();
String beg = "<div id=\"res\"><div";
+ String alternateBeg = "<div id=res><div";
String end = "</table>";
int begIndex = html.indexOf(beg);
if (begIndex != -1)
{
- // extract table containing specific first result
- int endIndex = html.indexOf(end, begIndex);
- html = html.substring(begIndex + beg.length(), endIndex + end.length());
+ html = process(renderResponse, html, beg, end, begIndex);
+ }
+ else
+ {
+ begIndex = html.indexOf(alternateBeg);
+ if (begIndex != -1)
+ {
+ html = process(renderResponse, html, alternateBeg, end, begIndex);
+ }
+ else
+ {
+ html = "<font class='portlet-font'>Couldn't retrieve result from Google. Sorry! :(</font>";
+ }
+ }
- html = html.substring(html.indexOf(">") + 1);
+ renderResponse.setContentType("text/html");
+ PrintWriter printWriter = renderResponse.getWriter();
+ printWriter.print(html);
+ }
- html = postProcessHTML(html);
+ private String process(RenderResponse renderResponse, String html, String beg, String end, int begIndex)
+ throws IOException
+ {
+ // extract table containing specific first result
+ int endIndex = html.indexOf(end, begIndex);
+ html = html.substring(begIndex + beg.length(), endIndex + end.length());
- renderResponse.setContentType("text/html");
- PrintWriter printWriter = renderResponse.getWriter();
- printWriter.print(html);
- }
+ html = html.substring(html.indexOf(">") + 1);
+
+ html = postProcessHTML(html);
+
+ return html;
}
protected String getZipCode(RenderRequest renderRequest)
@@ -104,17 +129,17 @@
{
renderResponse.setContentType("text/html");
renderResponse.getWriter().print(
- "<div align='center'>\n" +
- " <br/>\n" +
- " <font class='portlet-font'>Change Location:</font>\n" +
- "\n" +
- " <form method='post' action='" + renderResponse.createActionURL() + "'\n" +
- " <font class='portlet-font'>Zip Code:</font><br/>\n" +
- " <input class='portlet-form-input-field' type='text' value='' size='12' name='" + ZIP + "'/>\n" +
- " <br/>\n" +
- " <input class='portlet-form-input-field' type='submit' name='submit' value='submit'>\n" +
- " </form>\n" +
- "</div>");
+ "<div align='center'>\n" +
+ " <br/>\n" +
+ " <font class='portlet-font'>Change Location:</font>\n" +
+ "\n" +
+ " <form method='post' action='" + renderResponse.createActionURL() + "'\n" +
+ " <font class='portlet-font'>Zip Code:</font><br/>\n" +
+ " <input class='portlet-form-input-field' type='text' value='' size='12' name='" + ZIP + "'/>\n" +
+ " <br/>\n" +
+ " <input class='portlet-form-input-field' type='submit' name='submit' value='submit'>\n" +
+ " </form>\n" +
+ "</div>");
}
@Override
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleWeatherClippingPortlet.java
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleWeatherClippingPortlet.java 2008-06-13 15:05:43 UTC (rev 11044)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleWeatherClippingPortlet.java 2008-06-13 15:14:20 UTC (rev 11045)
@@ -29,7 +29,7 @@
*/
public class GoogleWeatherClippingPortlet extends GoogleClippingPortlet
{
- private final static String WEATHER_URL = "http://www.google.com/search?q=weather+";
+ private final static String WEATHER_URL = "http://www.google.com/search?gl=US&hl=en&q=weather+";
private static final String A_END = "</a>";
protected String getQueryString(String zip)
17 years, 10 months
JBoss Portal SVN: r11043 - modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-06-13 11:05:14 -0400 (Fri, 13 Jun 2008)
New Revision: 11043
Modified:
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleWeatherClippingPortlet.java
Log:
- Now force US location and English language for query.
- More robust handling of Google markup. Should output a message if the query couldn't be parsed.
Modified: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java 2008-06-13 13:55:11 UTC (rev 11042)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java 2008-06-13 15:05:14 UTC (rev 11043)
@@ -52,7 +52,11 @@
private static final String A_TARGET_BLANK = "<a target='_blank'";
private static final String ZIP = "zipcode";
private static final String SAN_FRAN = "94102";
- private static final String GOOGLE = "http://www.google.com/search?q=";
+ /**
+ * gl=US forces use of US google site, hl=en forces results to be in English so that regardless of location the query
+ * should result in the expected result.
+ */
+ private static final String GOOGLE = "http://www.google.com/search?gl=US&hl=en&q=";
@Override
protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException
@@ -71,22 +75,43 @@
in.close();
String beg = "<div id=\"res\"><div";
+ String alternateBeg = "<div id=res><div";
String end = "</table>";
int begIndex = html.indexOf(beg);
if (begIndex != -1)
{
- // extract table containing specific first result
- int endIndex = html.indexOf(end, begIndex);
- html = html.substring(begIndex + beg.length(), endIndex + end.length());
+ html = process(renderResponse, html, beg, end, begIndex);
+ }
+ else
+ {
+ begIndex = html.indexOf(alternateBeg);
+ if (begIndex != -1)
+ {
+ html = process(renderResponse, html, alternateBeg, end, begIndex);
+ }
+ else
+ {
+ html = "<font class='portlet-font'>Couldn't retrieve result from Google. Sorry! :(</font>";
+ }
+ }
- html = html.substring(html.indexOf(">") + 1);
+ renderResponse.setContentType("text/html");
+ PrintWriter printWriter = renderResponse.getWriter();
+ printWriter.print(html);
+ }
- html = postProcessHTML(html);
+ private String process(RenderResponse renderResponse, String html, String beg, String end, int begIndex)
+ throws IOException
+ {
+ // extract table containing specific first result
+ int endIndex = html.indexOf(end, begIndex);
+ html = html.substring(begIndex + beg.length(), endIndex + end.length());
- renderResponse.setContentType("text/html");
- PrintWriter printWriter = renderResponse.getWriter();
- printWriter.print(html);
- }
+ html = html.substring(html.indexOf(">") + 1);
+
+ html = postProcessHTML(html);
+
+ return html;
}
protected String getZipCode(RenderRequest renderRequest)
@@ -104,17 +129,17 @@
{
renderResponse.setContentType("text/html");
renderResponse.getWriter().print(
- "<div align='center'>\n" +
- " <br/>\n" +
- " <font class='portlet-font'>Change Location:</font>\n" +
- "\n" +
- " <form method='post' action='" + renderResponse.createActionURL() + "'\n" +
- " <font class='portlet-font'>Zip Code:</font><br/>\n" +
- " <input class='portlet-form-input-field' type='text' value='' size='12' name='" + ZIP + "'/>\n" +
- " <br/>\n" +
- " <input class='portlet-form-input-field' type='submit' name='submit' value='submit'>\n" +
- " </form>\n" +
- "</div>");
+ "<div align='center'>\n" +
+ " <br/>\n" +
+ " <font class='portlet-font'>Change Location:</font>\n" +
+ "\n" +
+ " <form method='post' action='" + renderResponse.createActionURL() + "'\n" +
+ " <font class='portlet-font'>Zip Code:</font><br/>\n" +
+ " <input class='portlet-form-input-field' type='text' value='' size='12' name='" + ZIP + "'/>\n" +
+ " <br/>\n" +
+ " <input class='portlet-form-input-field' type='submit' name='submit' value='submit'>\n" +
+ " </form>\n" +
+ "</div>");
}
@Override
Modified: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleWeatherClippingPortlet.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleWeatherClippingPortlet.java 2008-06-13 13:55:11 UTC (rev 11042)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleWeatherClippingPortlet.java 2008-06-13 15:05:14 UTC (rev 11043)
@@ -29,7 +29,7 @@
*/
public class GoogleWeatherClippingPortlet extends GoogleClippingPortlet
{
- private final static String WEATHER_URL = "http://www.google.com/search?q=weather+";
+ private final static String WEATHER_URL = "http://www.google.com/search?gl=US&hl=en&q=weather+";
private static final String A_END = "</a>";
protected String getQueryString(String zip)
17 years, 10 months
JBoss Portal SVN: r11042 - modules/portlet/tags/JBP_PORTLET_2_0_0/docs.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-13 09:55:11 -0400 (Fri, 13 Jun 2008)
New Revision: 11042
Modified:
modules/portlet/tags/JBP_PORTLET_2_0_0/docs/pom.xml
Log:
update doc version
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/docs/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/docs/pom.xml 2008-06-13 13:40:01 UTC (rev 11041)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/docs/pom.xml 2008-06-13 13:55:11 UTC (rev 11042)
@@ -10,7 +10,7 @@
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Docs Aggregator</name>
- <version>2.0-Beta1</version>
+ <version>2.0.0</version>
<url>http://labs.jboss.com/jbossportal</url>
<modules>
17 years, 10 months
JBoss Portal SVN: r11041 - modules/portlet/tags/JBP_PORTLET_2_0_0/build/distrib.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-13 09:40:01 -0400 (Fri, 13 Jun 2008)
New Revision: 11041
Modified:
modules/portlet/tags/JBP_PORTLET_2_0_0/build/distrib/distrib.xml
Log:
update stuff to no snapshots
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/build/distrib/distrib.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/build/distrib/distrib.xml 2008-06-13 13:39:28 UTC (rev 11040)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/build/distrib/distrib.xml 2008-06-13 13:40:01 UTC (rev 11041)
@@ -2,9 +2,9 @@
<property name="source.dir" value="../.."/>
<property name="src.docs.dir" value="${source.dir}/docs"/>
- <property name="pc.release.version" value="2.0.0.CR3"/>
- <property name="demo.release.version" value="2.0.0.CR3"/>
- <property name="maven.version" value="2.0.0-SNAPSHOT"/>
+ <property name="pc.release.version" value="2.0.0"/>
+ <property name="demo.release.version" value="2.0.0"/>
+ <property name="maven.version" value="2.0.0"/>
<!-- -->
<property name="pc.release.name" value="jboss-portletcontainer-${pc.release.version}"/>
17 years, 10 months
JBoss Portal SVN: r11040 - in modules/web/tags/JBP_WEB_1_2_0: build and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-13 09:39:28 -0400 (Fri, 13 Jun 2008)
New Revision: 11040
Modified:
modules/web/tags/JBP_WEB_1_2_0/build/pom.xml
modules/web/tags/JBP_WEB_1_2_0/pom.xml
modules/web/tags/JBP_WEB_1_2_0/web/pom.xml
Log:
udpated web module to no snapshots
Modified: modules/web/tags/JBP_WEB_1_2_0/build/pom.xml
===================================================================
--- modules/web/tags/JBP_WEB_1_2_0/build/pom.xml 2008-06-13 13:38:57 UTC (rev 11039)
+++ modules/web/tags/JBP_WEB_1_2_0/build/pom.xml 2008-06-13 13:39:28 UTC (rev 11040)
@@ -13,12 +13,12 @@
<parent>
<groupId>org.jboss.portal</groupId>
<artifactId>jboss-portal-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.web</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.2.0</version>
<packaging>pom</packaging>
<name>JBoss Portal Test Module</name>
<url>http://www.jboss.com/products/jbossmc</url>
@@ -31,7 +31,7 @@
<version.apache.log4j>1.2.14</version.apache.log4j>
<version.jboss-logging>2.0.4.GA</version.jboss-logging>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
- <version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
+ <version.jboss.portal.common>1.2.0</version.jboss.portal.common>
<version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
Modified: modules/web/tags/JBP_WEB_1_2_0/pom.xml
===================================================================
--- modules/web/tags/JBP_WEB_1_2_0/pom.xml 2008-06-13 13:38:57 UTC (rev 11039)
+++ modules/web/tags/JBP_WEB_1_2_0/pom.xml 2008-06-13 13:39:28 UTC (rev 11040)
@@ -5,7 +5,7 @@
<artifactId>module-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Web Module</name>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.2.0</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
Modified: modules/web/tags/JBP_WEB_1_2_0/web/pom.xml
===================================================================
--- modules/web/tags/JBP_WEB_1_2_0/web/pom.xml 2008-06-13 13:38:57 UTC (rev 11039)
+++ modules/web/tags/JBP_WEB_1_2_0/web/pom.xml 2008-06-13 13:39:28 UTC (rev 11040)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.web</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.2.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
17 years, 10 months
JBoss Portal SVN: r11039 - in branches/JBoss_Portal_Branch_2_7/core-cms/src: main/org/jboss/portal/core/cms/ui/admin and 2 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-06-13 09:38:57 -0400 (Fri, 13 Jun 2008)
New Revision: 11039
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/servlet/CMSPreviewServlet.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
Log:
JBPORTAL-2042: Error when trying to preview a binary file submitted for approval
JBPORTAL-2043: During file upload a stack trace is shown when no file has been selected
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/servlet/CMSPreviewServlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/servlet/CMSPreviewServlet.java 2008-06-13 13:38:48 UTC (rev 11038)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/servlet/CMSPreviewServlet.java 2008-06-13 13:38:57 UTC (rev 11039)
@@ -32,6 +32,8 @@
import org.jboss.portal.cms.impl.jcr.JCRCMS;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.workflow.CMSWorkflowUtil;
+import org.jboss.portal.core.cms.ui.Util;
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.IdentityServiceController;
import org.jboss.portal.identity.User;
@@ -62,10 +64,16 @@
String path = request.getParameter("p");
String version = request.getParameter("v");
String language = request.getParameter("l");
+
+ String processId = request.getParameter("pid");
+
try
{
- MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+ Content content = null;
+ if (processId == null)
+ {
+ MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
CMS CMSService = (CMS)MBeanProxy.get(CMS.class, new ObjectName("portal:service=CMS"), mbeanServer);
IdentityServiceController identityService = (IdentityServiceController)MBeanProxy.get(
IdentityServiceController.class, new ObjectName("portal:service=Module,type=IdentityServiceController"), mbeanServer);
@@ -75,8 +83,14 @@
Command getCMD = CMSService.getCommandFactory().createFileGetCommand(path, version, new Locale(language));
File file = (File)CMSService.execute(getCMD);
- Content content = file.getContent();
-
+ content = file.getContent();
+ }
+ else
+ {
+ content = CMSWorkflowUtil.getPendingContent(Long.parseLong(processId), path);
+ }
+
+
response.setContentType(content.getMimeType());
ServletOutputStream sout = response.getOutputStream();
InputStream is = content.getStream();
@@ -91,6 +105,7 @@
}
catch (Exception e)
{
+ e.printStackTrace();
try
{
response.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage());
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-06-13 13:38:48 UTC (rev 11038)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-06-13 13:38:57 UTC (rev 11039)
@@ -774,54 +774,63 @@
if (!item.isFormField())
{
String sFilename = item.getName();
- int backslashIndex = sFilename.lastIndexOf("\\");
- if (backslashIndex > -1) // getWindows
+ if (!"".equals(sFilename))
{
- sFilename = sFilename.substring(backslashIndex + 1);
- }
- else // unix
- {
- backslashIndex = sFilename.lastIndexOf("/");
- sFilename = sFilename.substring(backslashIndex + 1);
- }
+ int backslashIndex = sFilename.lastIndexOf("\\");
+ if (backslashIndex > -1) // getWindows
+ {
+ sFilename = sFilename.substring(backslashIndex + 1);
+ }
+ else // unix
+ {
+ backslashIndex = sFilename.lastIndexOf("/");
+ sFilename = sFilename.substring(backslashIndex + 1);
+ }
- File file = new FileImpl();
- Content content = new ContentImpl();
+ File file = new FileImpl();
+ Content content = new ContentImpl();
- String fileExt = sFilename.substring(sFilename.lastIndexOf(".") + 1, sFilename.length());
- CMSMimeMappings mapper = new CMSMimeMappings();
- if (mapper.getMimeType(fileExt) != null)
- {
- content.setMimeType(mapper.getMimeType(fileExt));
- }
- else
- {
- content.setMimeType("application/octet-stream");
- }
+ String fileExt = sFilename.substring(sFilename.lastIndexOf(".") + 1, sFilename.length());
+ CMSMimeMappings mapper = new CMSMimeMappings();
+ if (mapper.getMimeType(fileExt) != null)
+ {
+ content.setMimeType(mapper.getMimeType(fileExt));
+ }
+ else
+ {
+ content.setMimeType("application/octet-stream");
+ }
- String sBasePath = FileUtil.cleanDoubleSlashes(sPath + "/" + sFilename);
- file.setBasePath(sBasePath);
+ String sBasePath = FileUtil.cleanDoubleSlashes(sPath + "/" + sFilename);
+ file.setBasePath(sBasePath);
- content.setTitle(sTitle);
- content.setDescription(sDescription);
- content.setBasePath(sBasePath + "/" + new Locale(sLanguage));
- content.setBytes(item.get());
- file.setContent(new Locale(sLanguage), content);
+ content.setTitle(sTitle);
+ content.setDescription(sDescription);
+ content.setBasePath(sBasePath + "/" + new Locale(sLanguage));
+ content.setBytes(item.get());
+ file.setContent(new Locale(sLanguage), content);
- Command existsCMD = CMSService.getCommandFactory().createItemExistsCommand(content.getBasePath());
- Boolean bExists = (Boolean)CMSService.execute(existsCMD);
- if (bExists.booleanValue()) // if file exists, update contentNode
- {
- // force "make live"
- Command cmdUpdate = CMSService.getCommandFactory().createUpdateFileCommand(file, content, true);
- CMSService.execute(cmdUpdate);
+ Command existsCMD = CMSService.getCommandFactory().createItemExistsCommand(content.getBasePath());
+ Boolean bExists = (Boolean)CMSService.execute(existsCMD);
+ if (bExists.booleanValue()) // if file exists, update contentNode
+ {
+ // force "make live"
+ Command cmdUpdate = CMSService.getCommandFactory().createUpdateFileCommand(file, content, true);
+ CMSService.execute(cmdUpdate);
+ }
+ else // if file doesnt exist, create the file and the contentNode.
+ {
+ Command newFileCMD = CMSService.getCommandFactory().createNewFileCommand(file, content);
+ CMSService.execute(newFileCMD);
+ }
+ aRes.setRenderParameter("path", sBasePath);
}
- else // if file doesnt exist, create the file and the contentNode.
+ else
{
- Command newFileCMD = CMSService.getCommandFactory().createNewFileCommand(file, content);
- CMSService.execute(newFileCMD);
+ aRes.setRenderParameter("op", CMSAdminConstants.OP_UPLOADCONFIRM);
+ aRes.setRenderParameter("path", sPath);
+ return;
}
- aRes.setRenderParameter("path", sBasePath);
}
else
{
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2008-06-13 13:38:48 UTC (rev 11038)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2008-06-13 13:38:57 UTC (rev 11039)
@@ -64,9 +64,7 @@
<depends optional-attribute-name="AuthorizationManager" proxy-type="attribute">portal:service=AuthorizationManager,type=cms</depends>
<!-- Add this to activate publish/approval workflow integration -->
- <!--
<depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends>
- -->
<depends optional-attribute-name="StackFactory" proxy-type="attribute">portal:service=InterceptorStackFactory,type=Cms</depends>
<attribute name="DoChecking">true</attribute>
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-06-13 13:38:48 UTC (rev 11038)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-06-13 13:38:57 UTC (rev 11039)
@@ -226,15 +226,36 @@
<!-- User who requested approval -->
<td><%= cour.getUserName() %>
</td>
- <td>
- <a href="<portlet:renderURL>
- <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWPENDINGPREVIEW %>"/>
- <portlet:param name="pid" value="<%=cour.getProcessId()%>"/>
- <portlet:param name="path" value="<%=linkPath%>"/>
- <portlet:param name="contentPath" value="<%=cour.getPath()%>"/>
- </portlet:renderURL>"
- <%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
- >${n:i18n("CMS_PREVIEW")}</a>
+ <td>
+ <%
+ if (cour.getMimeType().equals("text/html") || cour.getMimeType().equals("text/plain"))
+ {
+ %>
+ <a href="<portlet:renderURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWPENDINGPREVIEW %>"/>
+ <portlet:param name="pid" value="<%=cour.getProcessId()%>"/>
+ <portlet:param name="path" value="<%=linkPath%>"/>
+ <portlet:param name="contentPath" value="<%=cour.getPath()%>"/>
+ </portlet:renderURL>"
+ <%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
+ >${n:i18n("CMS_PREVIEW")}</a>
+
+ <% }
+ else
+ {
+ //save the principal for the preview servlet
+ String remoteUser = request.getRemoteUser();
+ request.getSession().setAttribute("remoteUser", remoteUser);
+ %>
+ <a target="_blank"
+ href="<%= request.getContextPath() %>/cmspreview?pid=<%= cour.getProcessId() %>&p=<%= cour.getPath() %>"<%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
+ >${n:i18n("CMS_PREVIEW")}</a>
+ <%
+ }
+ %>
+
+
+
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_APPROVE %>"/>
17 years, 10 months
JBoss Portal SVN: r11038 - in modules/portlet/tags/JBP_PORTLET_2_0_0: build and 10 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-13 09:38:48 -0400 (Fri, 13 Jun 2008)
New Revision: 11038
Modified:
modules/portlet/tags/JBP_PORTLET_2_0_0/bridge/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/build/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/controller/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/docs/user-guide/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/federation/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/jsr168api/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/management/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/mc/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/portal/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/portlet/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/samples/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_0/test/pom.xml
Log:
update stuff to no snapshots
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/bridge/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/bridge/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/bridge/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/build/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/build/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/build/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -13,12 +13,12 @@
<parent>
<groupId>org.jboss.portal</groupId>
<artifactId>jboss-portal-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module</name>
<description>JBoss Portal Portlet Module</description>
@@ -33,8 +33,8 @@
<version.jboss-logging>2.0.4.GA</version.jboss-logging>
<version.jbossxb>2.0.0.CR8</version.jbossxb>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
- <version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
- <version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
+ <version.jboss.portal.common>1.2.0</version.jboss.portal.common>
+ <version.jboss.portal.web>1.2.0</version.jboss.portal.web>
<version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/controller/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/controller/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/controller/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/docs/user-guide/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/docs/user-guide/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/docs/user-guide/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -11,7 +11,7 @@
</parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>user-guide-${translation}</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<packaging>jdocbook</packaging>
<name>User_Guide_(${translation})</name>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/federation/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/federation/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/federation/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/jsr168api/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/jsr168api/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/jsr168api/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/management/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/management/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/management/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/mc/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/mc/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/mc/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/portal/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/portal/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/portal/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/portlet/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/portlet/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/portlet/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/samples/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/samples/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/samples/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/test/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/test/pom.xml 2008-06-13 13:35:35 UTC (rev 11037)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/test/pom.xml 2008-06-13 13:38:48 UTC (rev 11038)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
17 years, 10 months
JBoss Portal SVN: r11037 - in branches/JBoss_Portal_Branch_2_6/core-cms/src: main/org/jboss/portal/core/cms/ui/admin and 2 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-06-13 09:35:35 -0400 (Fri, 13 Jun 2008)
New Revision: 11037
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/servlet/CMSPreviewServlet.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
Log:
JBPORTAL-2042: Error when trying to preview a binary file submitted for approval
JBPORTAL-2043: During file upload a stack trace is shown when no file has been selected
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/servlet/CMSPreviewServlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/servlet/CMSPreviewServlet.java 2008-06-13 12:21:52 UTC (rev 11036)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/servlet/CMSPreviewServlet.java 2008-06-13 13:35:35 UTC (rev 11037)
@@ -32,6 +32,8 @@
import org.jboss.portal.cms.impl.jcr.JCRCMS;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.workflow.CMSWorkflowUtil;
+import org.jboss.portal.core.cms.ui.Util;
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.IdentityServiceController;
import org.jboss.portal.identity.User;
@@ -62,10 +64,16 @@
String path = request.getParameter("p");
String version = request.getParameter("v");
String language = request.getParameter("l");
+
+ String processId = request.getParameter("pid");
+
try
{
- MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+ Content content = null;
+ if (processId == null)
+ {
+ MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
CMS CMSService = (CMS)MBeanProxy.get(CMS.class, new ObjectName("portal:service=CMS"), mbeanServer);
IdentityServiceController identityService = (IdentityServiceController)MBeanProxy.get(
IdentityServiceController.class, new ObjectName("portal:service=Module,type=IdentityServiceController"), mbeanServer);
@@ -75,8 +83,14 @@
Command getCMD = CMSService.getCommandFactory().createFileGetCommand(path, version, new Locale(language));
File file = (File)CMSService.execute(getCMD);
- Content content = file.getContent();
-
+ content = file.getContent();
+ }
+ else
+ {
+ content = CMSWorkflowUtil.getPendingContent(Long.parseLong(processId), path);
+ }
+
+
response.setContentType(content.getMimeType());
ServletOutputStream sout = response.getOutputStream();
InputStream is = content.getStream();
@@ -91,6 +105,7 @@
}
catch (Exception e)
{
+ e.printStackTrace();
try
{
response.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage());
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-06-13 12:21:52 UTC (rev 11036)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-06-13 13:35:35 UTC (rev 11037)
@@ -774,54 +774,63 @@
if (!item.isFormField())
{
String sFilename = item.getName();
- int backslashIndex = sFilename.lastIndexOf("\\");
- if (backslashIndex > -1) // getWindows
+ if (!"".equals(sFilename))
{
- sFilename = sFilename.substring(backslashIndex + 1);
- }
- else // unix
- {
- backslashIndex = sFilename.lastIndexOf("/");
- sFilename = sFilename.substring(backslashIndex + 1);
- }
+ int backslashIndex = sFilename.lastIndexOf("\\");
+ if (backslashIndex > -1) // getWindows
+ {
+ sFilename = sFilename.substring(backslashIndex + 1);
+ }
+ else // unix
+ {
+ backslashIndex = sFilename.lastIndexOf("/");
+ sFilename = sFilename.substring(backslashIndex + 1);
+ }
- File file = new FileImpl();
- Content content = new ContentImpl();
+ File file = new FileImpl();
+ Content content = new ContentImpl();
- String fileExt = sFilename.substring(sFilename.lastIndexOf(".") + 1, sFilename.length());
- CMSMimeMappings mapper = new CMSMimeMappings();
- if (mapper.getMimeType(fileExt) != null)
- {
- content.setMimeType(mapper.getMimeType(fileExt));
- }
- else
- {
- content.setMimeType("application/octet-stream");
- }
+ String fileExt = sFilename.substring(sFilename.lastIndexOf(".") + 1, sFilename.length());
+ CMSMimeMappings mapper = new CMSMimeMappings();
+ if (mapper.getMimeType(fileExt) != null)
+ {
+ content.setMimeType(mapper.getMimeType(fileExt));
+ }
+ else
+ {
+ content.setMimeType("application/octet-stream");
+ }
- String sBasePath = FileUtil.cleanDoubleSlashes(sPath + "/" + sFilename);
- file.setBasePath(sBasePath);
+ String sBasePath = FileUtil.cleanDoubleSlashes(sPath + "/" + sFilename);
+ file.setBasePath(sBasePath);
- content.setTitle(sTitle);
- content.setDescription(sDescription);
- content.setBasePath(sBasePath + "/" + new Locale(sLanguage));
- content.setBytes(item.get());
- file.setContent(new Locale(sLanguage), content);
+ content.setTitle(sTitle);
+ content.setDescription(sDescription);
+ content.setBasePath(sBasePath + "/" + new Locale(sLanguage));
+ content.setBytes(item.get());
+ file.setContent(new Locale(sLanguage), content);
- Command existsCMD = CMSService.getCommandFactory().createItemExistsCommand(content.getBasePath());
- Boolean bExists = (Boolean)CMSService.execute(existsCMD);
- if (bExists.booleanValue()) // if file exists, update contentNode
- {
- // force "make live"
- Command cmdUpdate = CMSService.getCommandFactory().createUpdateFileCommand(file, content, true);
- CMSService.execute(cmdUpdate);
+ Command existsCMD = CMSService.getCommandFactory().createItemExistsCommand(content.getBasePath());
+ Boolean bExists = (Boolean)CMSService.execute(existsCMD);
+ if (bExists.booleanValue()) // if file exists, update contentNode
+ {
+ // force "make live"
+ Command cmdUpdate = CMSService.getCommandFactory().createUpdateFileCommand(file, content, true);
+ CMSService.execute(cmdUpdate);
+ }
+ else // if file doesnt exist, create the file and the contentNode.
+ {
+ Command newFileCMD = CMSService.getCommandFactory().createNewFileCommand(file, content);
+ CMSService.execute(newFileCMD);
+ }
+ aRes.setRenderParameter("path", sBasePath);
}
- else // if file doesnt exist, create the file and the contentNode.
+ else
{
- Command newFileCMD = CMSService.getCommandFactory().createNewFileCommand(file, content);
- CMSService.execute(newFileCMD);
+ aRes.setRenderParameter("op", CMSAdminConstants.OP_UPLOADCONFIRM);
+ aRes.setRenderParameter("path", sPath);
+ return;
}
- aRes.setRenderParameter("path", sBasePath);
}
else
{
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2008-06-13 12:21:52 UTC (rev 11036)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2008-06-13 13:35:35 UTC (rev 11037)
@@ -64,9 +64,7 @@
<depends optional-attribute-name="AuthorizationManager" proxy-type="attribute">portal:service=AuthorizationManager,type=cms</depends>
<!-- Add this to activate publish/approval workflow integration -->
- <!--
<depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends>
- -->
<depends optional-attribute-name="StackFactory" proxy-type="attribute">portal:service=InterceptorStackFactory,type=Cms</depends>
<attribute name="DoChecking">true</attribute>
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-06-13 12:21:52 UTC (rev 11036)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-06-13 13:35:35 UTC (rev 11037)
@@ -226,15 +226,36 @@
<!-- User who requested approval -->
<td><%= cour.getUserName() %>
</td>
- <td>
- <a href="<portlet:renderURL>
- <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWPENDINGPREVIEW %>"/>
- <portlet:param name="pid" value="<%=cour.getProcessId()%>"/>
- <portlet:param name="path" value="<%=linkPath%>"/>
- <portlet:param name="contentPath" value="<%=cour.getPath()%>"/>
- </portlet:renderURL>"
- <%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
- >${n:i18n("CMS_PREVIEW")}</a>
+ <td>
+ <%
+ if (cour.getMimeType().equals("text/html") || cour.getMimeType().equals("text/plain"))
+ {
+ %>
+ <a href="<portlet:renderURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWPENDINGPREVIEW %>"/>
+ <portlet:param name="pid" value="<%=cour.getProcessId()%>"/>
+ <portlet:param name="path" value="<%=linkPath%>"/>
+ <portlet:param name="contentPath" value="<%=cour.getPath()%>"/>
+ </portlet:renderURL>"
+ <%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
+ >${n:i18n("CMS_PREVIEW")}</a>
+
+ <% }
+ else
+ {
+ //save the principal for the preview servlet
+ String remoteUser = request.getRemoteUser();
+ request.getSession().setAttribute("remoteUser", remoteUser);
+ %>
+ <a target="_blank"
+ href="<%= request.getContextPath() %>/cmspreview?pid=<%= cour.getProcessId() %>&p=<%= cour.getPath() %>"<%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
+ >${n:i18n("CMS_PREVIEW")}</a>
+ <%
+ }
+ %>
+
+
+
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_APPROVE %>"/>
17 years, 10 months
JBoss Portal SVN: r11036 - modules/web/tags.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-13 08:21:52 -0400 (Fri, 13 Jun 2008)
New Revision: 11036
Added:
modules/web/tags/JBP_WEB_1_2_0/
Log:
web module 1.2.0 tagging
Copied: modules/web/tags/JBP_WEB_1_2_0 (from rev 11035, modules/web/trunk)
17 years, 10 months