JBoss Portal SVN: r11057 - in branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core: model/portal/command/render and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-06-16 09:20:15 -0400 (Mon, 16 Jun 2008)
New Revision: 11057
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
Log:
- Missing resources was stopping the call too early to be handled by the error management policy
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-06-16 09:12:23 UTC (rev 11056)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-06-16 13:20:15 UTC (rev 11057)
@@ -62,6 +62,7 @@
import org.w3c.dom.Element;
import javax.portlet.MimeResponse;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -173,11 +174,42 @@
}
}
+ // Get Window properties
+ Map<String, String> windowProps = new HashMap<String, String>(window.getProperties());
+
+ try
+ {
+ // Check that the associated portlet is deployed
+ getPortletInstance(rendererContext).getPortlet();
+ }
+ catch (PortletInvokerException e)
+ {
+ ControllerResponse cr;
+
+ //
+ if (e instanceof NoSuchPortletException)
+ {
+ cr = new UnavailableResourceResponse(((NoSuchPortletException)e).getPortletId(), false);
+ }
+ else
+ {
+ log.error("Portlet invoker exception during portlet window rendering", e);
+ cr = new org.jboss.portal.core.controller.command.response.ErrorResponse(e, false);
+ }
+
+ //
+ return new WindowRendition(windowProps, WindowState.NORMAL, Mode.VIEW, null, null, cr);
+ }
+
//
WindowNavigationalState windowNS = rendererContext.getNavigationalState();
+
+ if (windowNS == null)
+ {
+
+ }
//
- Map<String, String> windowProps = new HashMap<String, String>(window.getProperties());
Mode mode = windowNS.getMode();
WindowState windowState = windowNS.getWindowState();
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java 2008-06-16 09:12:23 UTC (rev 11056)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java 2008-06-16 13:20:15 UTC (rev 11057)
@@ -142,7 +142,7 @@
public void acquireResources() throws NoSuchResourceException
{
super.acquireResources();
-
+/*
// check that the portlet associated with the window is deployed by delegating to the navigational state which
// in turn delegates to ControllerPortletControllerContext which knows the windows which are available
String windowName = window.getName();
@@ -152,5 +152,7 @@
log.debug("Resource associated with window '" + windowName + "' could not be found!");
throw new NoSuchResourceException(windowName);
}
+ */
}
+
}
17 years, 10 months
JBoss Portal SVN: r11056 - branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-06-16 05:12:23 -0400 (Mon, 16 Jun 2008)
New Revision: 11056
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
Log:
JBPORTAL-2042: Error when trying to preview a binary file submitted for approval
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2008-06-16 09:12:16 UTC (rev 11055)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2008-06-16 09:12:23 UTC (rev 11056)
@@ -413,13 +413,31 @@
if (manageWorkflowAccessible.booleanValue())
{
%>
- <td>
+ <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="<%=sCurrPath%>"/>
<portlet:param name="contentPath" value="<%=cour.getPath()%>"/>
</portlet:renderURL>">${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() %>">${n:i18n("CMS_PREVIEW")}</a>
+ <%
+ }
+ %>
+
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%=CMSAdminConstants.OP_APPROVE%>"/>
17 years, 10 months
JBoss Portal SVN: r11055 - branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-06-16 05:12:16 -0400 (Mon, 16 Jun 2008)
New Revision: 11055
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
Log:
JBPORTAL-2042: Error when trying to preview a binary file submitted for approval
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2008-06-16 08:29:31 UTC (rev 11054)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2008-06-16 09:12:16 UTC (rev 11055)
@@ -413,13 +413,31 @@
if (manageWorkflowAccessible.booleanValue())
{
%>
- <td>
+ <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="<%=sCurrPath%>"/>
<portlet:param name="contentPath" value="<%=cour.getPath()%>"/>
</portlet:renderURL>">${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() %>">${n:i18n("CMS_PREVIEW")}</a>
+ <%
+ }
+ %>
+
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%=CMSAdminConstants.OP_APPROVE%>"/>
17 years, 10 months
JBoss Portal SVN: r11054 - branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin.
by portal-commits@lists.jboss.org
Author: mputz
Date: 2008-06-16 04:29:31 -0400 (Mon, 16 Jun 2008)
New Revision: 11054
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
Log:
JBPORTAL-1993: IE6 javascript error in preview action in the CMS publish/approval workflow
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-16 08:28:59 UTC (rev 11053)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-06-16 08:29:31 UTC (rev 11054)
@@ -150,16 +150,16 @@
<portlet:param name="path" value="<%= path %>"/>
</portlet:actionURL>"
>
- <table>
+ <table width="100%">
<tr>
<!--
<td style="border: 1px solid #000000;"><%=pendingPreviewContent%></td>
-->
- <form>
+ <td>
<textarea id="elm1" name="elm1" rows="20" cols="80" style="width: 100%" class="textarea">
<%=pendingPreviewContent%>
</textarea>
- </form>
+ </td>
</tr>
<tr>
<td> </td>
17 years, 10 months
JBoss Portal SVN: r11053 - branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin.
by portal-commits@lists.jboss.org
Author: mputz
Date: 2008-06-16 04:28:59 -0400 (Mon, 16 Jun 2008)
New Revision: 11053
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
Log:
JBPORTAL-1993: IE6 javascript error in preview action in the CMS publish/approval workflow
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 23:50:28 UTC (rev 11052)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-06-16 08:28:59 UTC (rev 11053)
@@ -150,16 +150,16 @@
<portlet:param name="path" value="<%= path %>"/>
</portlet:actionURL>"
>
- <table>
+ <table width="100%">
<tr>
<!--
<td style="border: 1px solid #000000;"><%=pendingPreviewContent%></td>
-->
- <form>
+ <td>
<textarea id="elm1" name="elm1" rows="20" cols="80" style="width: 100%" class="textarea">
<%=pendingPreviewContent%>
</textarea>
- </form>
+ </td>
</tr>
<tr>
<td> </td>
17 years, 10 months
JBoss Portal SVN: r11052 - in branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal: test/wsrp/v1/producer and 3 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-06-13 19:50:28 -0400 (Fri, 13 Jun 2008)
New Revision: 11052
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfiguration.java
Log:
- JBPORTAL-857: Setting strict mode relaxes language code validation. Should probably be implemented as
an interceptor to actually replace the in-out values before they make it to the Producer.
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2008-06-13 23:49:32 UTC (rev 11051)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2008-06-13 23:50:28 UTC (rev 11052)
@@ -280,4 +280,9 @@
{
throw new UnsupportedOperationException("setProducerConfiguration not implemented");
}
+
+ public void usingStrictModeChangedTo(boolean strictMode)
+ {
+ throw new UnsupportedOperationException("usingStrictModeChangedTo not implemented");
+ }
}
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2008-06-13 23:49:32 UTC (rev 11051)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2008-06-13 23:50:28 UTC (rev 11052)
@@ -335,13 +335,13 @@
}
}
- public void testGetMarkupWithNonStandardLocales() throws Exception
+ public void testGetMarkupWithNonStandardLocalesStrictMode() throws Exception
{
undeploy(DEFAULT_MARKUP_PORTLET_WAR);
String getLocalesPortletArchive = "test-getlocales-portlet.war";
deploy(getLocalesPortletArchive);
- GetMarkup getMarkup = createMarkupRequest(getPortletHandleFrom("Incorrect"));
+ GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
getMarkup.getMarkupParams().setLocales(new String[]{"en_US"});
try
@@ -361,6 +361,23 @@
}
}
+ public void testGetMarkupWithNonStandardLocalesLenientMode() throws Exception
+ {
+ undeploy(DEFAULT_MARKUP_PORTLET_WAR);
+ String getLocalesPortletArchive = "test-getlocales-portlet.war";
+ deploy(getLocalesPortletArchive);
+
+ GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+ getMarkup.getMarkupParams().setLocales(new String[]{"en_US"});
+
+ // Use the lenient mode
+ producer.usingStrictModeChangedTo(false);
+
+ // markup should be properly generated
+ checkMarkupResponse(markupService.getMarkup(getMarkup), "English (United States)");
+ undeploy(getLocalesPortletArchive);
+ }
+
public void testGetMarkupWithoutDeclaredLocale() throws Exception
{
undeploy(DEFAULT_MARKUP_PORTLET_WAR);
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2008-06-13 23:49:32 UTC (rev 11051)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2008-06-13 23:50:28 UTC (rev 11052)
@@ -168,6 +168,9 @@
super.setUp();
this.mostUsedPortletWARFileName = getMostUsedPortletWARFileName();
deploy(mostUsedPortletWARFileName);
+
+ // reset strict mode
+ producer.usingStrictModeChangedTo(true);
}
/**
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java 2008-06-13 23:49:32 UTC (rev 11051)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java 2008-06-13 23:50:28 UTC (rev 11052)
@@ -30,6 +30,7 @@
import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerConfigurationChangeListener;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
/**
@@ -39,7 +40,7 @@
*/
public interface WSRPProducer
extends WSRP_v1_ServiceDescription_PortType, WSRP_v1_Markup_PortType, WSRP_v1_Registration_PortType,
- WSRP_v1_PortletManagement_PortType
+ WSRP_v1_PortletManagement_PortType, ProducerConfigurationChangeListener
{
/** The default session expiration time in mili seconds. */
int DEFAULT_SESSION_EXPIRATION_TIME = 300000;
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2008-06-13 23:49:32 UTC (rev 11051)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2008-06-13 23:50:28 UTC (rev 11052)
@@ -23,6 +23,7 @@
package org.jboss.portal.wsrp;
+import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.i18n.LocaleFormat;
@@ -71,6 +72,15 @@
public static final Set<Mode> DEFAULT_JSR168_MODES;
public static final Set<WindowState> DEFAULT_JSR168_WINDOWSTATES;
+ private static boolean strict = true;
+ private static Logger log = Logger.getLogger(WSRPUtils.class);
+
+ public static void setStrict(boolean strict)
+ {
+ WSRPUtils.strict = strict;
+ log.debug("Using " + (strict ? "strict" : "lenient") + " language code validation mode.");
+ }
+
static
{
JSR168_WSRP_WINDOW_STATES.put(WindowState.MAXIMIZED.toString(), WSRPConstants.MAXIMIZED_WINDOW_STATE);
@@ -424,13 +434,20 @@
public static Locale getLocale(String lang) throws IllegalArgumentException
{
+ String possiblyRelaxed = lang;
+ if (!WSRPUtils.strict)
+ {
+ // treat en_US as valid by en_US => en-US
+ // todo: maybe this should be handled by an interceptor...
+ possiblyRelaxed = lang.replace('_', '-');
+ }
+
try
{
- return LocaleFormat.RFC3066_LANGUAGE_TAG.getLocale(lang);
+ return LocaleFormat.RFC3066_LANGUAGE_TAG.getLocale(possiblyRelaxed);
}
catch (ConversionException e)
{
- // Previous behavior on using ConversionException was like that
throw new IllegalArgumentException(e);
}
}
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-06-13 23:49:32 UTC (rev 11051)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-06-13 23:50:28 UTC (rev 11052)
@@ -39,6 +39,7 @@
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPProducer;
+import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
import org.jboss.portal.wsrp.core.ClonePortlet;
@@ -80,7 +81,6 @@
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
-import org.jboss.portal.wsrp.producer.config.ProducerConfigurationChangeListener;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationService;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -94,7 +94,7 @@
* @version $Revision$
* @since 2.4
*/
-public class WSRPProducerImpl extends AbstractJBossService implements WSRPProducer, ProducerConfigurationChangeListener
+public class WSRPProducerImpl extends AbstractJBossService implements WSRPProducer
{
/** logger used for logging ;) */
private static final Logger log = Logger.getLogger(WSRPProducerImpl.class);
@@ -534,5 +534,6 @@
public void usingStrictModeChangedTo(boolean strictMode)
{
RegistrationUtils.setStrict(strictMode);
+ WSRPUtils.setStrict(strictMode);
}
}
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfiguration.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfiguration.java 2008-06-13 23:49:32 UTC (rev 11051)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfiguration.java 2008-06-13 23:50:28 UTC (rev 11052)
@@ -32,6 +32,13 @@
{
ProducerRegistrationRequirements getRegistrationRequirements();
+ /**
+ * Is the associated producer using strict WSRP data validation? Strict validation means that even minor
+ * non-compliance will cause a failure. Lenient validation relaxes the checks that are performed to improve
+ * compatibility with some non-completely compliant consumers.
+ *
+ * @return <code>true</code> if strict validation is in effect, <code>false</code> otherwise.
+ */
boolean isUsingStrictMode();
void setUsingStrictMode(boolean strict);
17 years, 10 months
JBoss Portal SVN: r11051 - in branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal: test/wsrp/v1/producer and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-06-13 19:49:32 -0400 (Fri, 13 Jun 2008)
New Revision: 11051
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
Log:
- JBPORTAL-857: Setting strict mode relaxes language code validation. Should probably be implemented as
an interceptor to actually replace the in-out values before they make it to the Producer.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2008-06-13 21:58:52 UTC (rev 11050)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2008-06-13 23:49:32 UTC (rev 11051)
@@ -280,4 +280,9 @@
{
throw new UnsupportedOperationException("setProducerConfiguration not implemented");
}
+
+ public void setUseStrictMode(boolean strict)
+ {
+ throw new UnsupportedOperationException("setUseStrictMode not implemented");
+ }
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2008-06-13 21:58:52 UTC (rev 11050)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2008-06-13 23:49:32 UTC (rev 11051)
@@ -335,7 +335,7 @@
}
}
- public void testGetMarkupWithNonStandardLocales() throws Exception
+ public void testGetMarkupWithNonStandardLocalesStrictMode() throws Exception
{
undeploy(DEFAULT_MARKUP_PORTLET_WAR);
String getLocalesPortletArchive = "test-getlocales-portlet.war";
@@ -344,10 +344,9 @@
GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
getMarkup.getMarkupParams().setLocales(new String[]{"en_US"});
- MarkupResponse response = null;
try
{
- response = markupService.getMarkup(getMarkup);
+ markupService.getMarkup(getMarkup);
//fail("Should have trown an UnsupportetLocaleFault"); // ideally cf http://jira.jboss.com/jira/browse/JBPORTAL-857
ExtendedAssert.fail("Should have trown an exception"); // right now
}
@@ -361,6 +360,23 @@
}
}
+ public void testGetMarkupWithNonStandardLocalesLenientMode() throws Exception
+ {
+ undeploy(DEFAULT_MARKUP_PORTLET_WAR);
+ String getLocalesPortletArchive = "test-getlocales-portlet.war";
+ deploy(getLocalesPortletArchive);
+
+ GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+ getMarkup.getMarkupParams().setLocales(new String[]{"en_US"});
+
+ // Use the lenient mode
+ producer.setUseStrictMode(false);
+
+ // markup should be properly generated
+ checkMarkupResponse(markupService.getMarkup(getMarkup), "GetLocalesPortlet");
+ undeploy(getLocalesPortletArchive);
+ }
+
public void testGetMarkupWithEncodedURLs() throws Exception
{
undeploy(DEFAULT_MARKUP_PORTLET_WAR);
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2008-06-13 21:58:52 UTC (rev 11050)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2008-06-13 23:49:32 UTC (rev 11051)
@@ -162,6 +162,9 @@
super.setUp();
this.mostUsedPortletWARFileName = getMostUsedPortletWARFileName();
deploy(mostUsedPortletWARFileName);
+
+ // reset strict mode
+ producer.setUseStrictMode(true);
}
/**
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java 2008-06-13 21:58:52 UTC (rev 11050)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java 2008-06-13 23:49:32 UTC (rev 11051)
@@ -114,4 +114,14 @@
* @since 2.6
*/
void setProducerConfiguration(ProducerConfiguration producerConfiguration);
+
+ /**
+ * Specifies whether conformance to WSRP specification should be strict or lenient (this can help when working with
+ * non-complying consumers).
+ *
+ * @param strict <code>true</code> to be strict about WSRP conformance, <code>false</code> to allow for some
+ * flexibility in the validation of received WSRP data
+ * @since 2.6.6
+ */
+ void setUseStrictMode(boolean strict);
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2008-06-13 21:58:52 UTC (rev 11050)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2008-06-13 23:49:32 UTC (rev 11051)
@@ -23,6 +23,7 @@
package org.jboss.portal.wsrp;
+import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.i18n.LocaleFormat;
@@ -66,6 +67,15 @@
private static final String WSRP_WINDOW_STATE_NAME = "wsrp window state name";
private static final String WINDOW_STATE = "WindowState";
+ private static boolean strict = true;
+ private static Logger log = Logger.getLogger(WSRPUtils.class);
+
+ public static void setStrict(boolean strict)
+ {
+ WSRPUtils.strict = strict;
+ log.debug("Using " + (strict ? "strict" : "lenient") + " language code validation mode.");
+ }
+
static
{
JSR168_WSRP_WINDOW_STATES.put(WindowState.MAXIMIZED.toString(), WSRPConstants.MAXIMIZED_WINDOW_STATE);
@@ -299,7 +309,7 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(propertyDescription, "RegistrationPropertyDescription");
PropertyDescription propDesc = WSRPTypeFactory.createPropertyDescription(propertyDescription.getName().toString(),
- propertyDescription.getType());
+ propertyDescription.getType());
// todo: deal with languages properly!!
LocalizedString hint = propertyDescription.getHint();
@@ -324,7 +334,7 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(propertyDescription, "PropertyDescription");
RegistrationPropertyDescription desc = new RegistrationPropertyDescription(propertyDescription.getName(),
- propertyDescription.getType());
+ propertyDescription.getType());
desc.setLabel(getLocalizedStringOrNull(propertyDescription.getLabel()));
desc.setHint(getLocalizedStringOrNull(propertyDescription.getHint()));
@@ -376,7 +386,7 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(regLocalizedString, "LocalizedString");
return WSRPTypeFactory.createLocalizedString(toString(regLocalizedString.getLocale()),
- regLocalizedString.getResourceName(), regLocalizedString.getValue());
+ regLocalizedString.getResourceName(), regLocalizedString.getValue());
}
/**
@@ -416,13 +426,20 @@
public static Locale getLocale(String lang) throws IllegalArgumentException
{
+ String possiblyRelaxed = lang;
+ if (!WSRPUtils.strict)
+ {
+ // treat en_US as valid by en_US => en-US
+ // todo: maybe this should be handled by an interceptor...
+ possiblyRelaxed = lang.replace('_', '-');
+ }
+
try
{
- return LocaleFormat.RFC3066_LANGUAGE_TAG.getLocale(lang);
+ return LocaleFormat.RFC3066_LANGUAGE_TAG.getLocale(possiblyRelaxed);
}
catch (ConversionException e)
{
- // Previous behavior on using ConversionException was like that
throw new IllegalArgumentException(e);
}
}
@@ -435,7 +452,6 @@
}
catch (ConversionException e)
{
- // Previous behavior on using ConversionException was like that
throw new IllegalArgumentException(e);
}
}
@@ -457,7 +473,7 @@
sb.append("(secure)");
}
sb.append("[M=").append(params.getMode()).append("][WS=").append(params.getWindowState()).append("]")
- .append("[NS=").append(params.getNavigationalState()).append("]");
+ .append("[NS=").append(params.getNavigationalState()).append("]");
return sb.toString();
}
return null;
@@ -476,7 +492,7 @@
{
StringBuffer sb = new StringBuffer("InteractionParams");
sb.append("[IS=").append(interactionParams.getInteractionState()).append("]")
- .append("[StateChange=").append(interactionParams.getPortletStateChange().getValue()).append("]");
+ .append("[StateChange=").append(interactionParams.getPortletStateChange().getValue()).append("]");
NamedString[] formParams = interactionParams.getFormParameters();
if (formParams != null)
{
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-06-13 21:58:52 UTC (rev 11050)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-06-13 23:49:32 UTC (rev 11051)
@@ -38,6 +38,7 @@
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPProducer;
+import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
import org.jboss.portal.wsrp.core.ClonePortlet;
@@ -272,6 +273,7 @@
public void setUseStrictMode(boolean strict)
{
RegistrationUtils.setStrict(strict);
+ WSRPUtils.setStrict(strict);
}
protected void startService() throws Exception
17 years, 10 months
JBoss Portal SVN: r11050 - modules/presentation/trunk/build.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-13 17:58:52 -0400 (Fri, 13 Jun 2008)
New Revision: 11050
Modified:
modules/presentation/trunk/build/pom.xml
Log:
make PF to use portlet 2.0.0
Modified: modules/presentation/trunk/build/pom.xml
===================================================================
--- modules/presentation/trunk/build/pom.xml 2008-06-13 17:23:50 UTC (rev 11049)
+++ modules/presentation/trunk/build/pom.xml 2008-06-13 21:58:52 UTC (rev 11050)
@@ -32,9 +32,9 @@
<version.portlet-api>2.0</version.portlet-api>
- <version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
- <version.jboss.portal.portlet>2.0.0-SNAPSHOT</version.jboss.portal.portlet>
- <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.portlet>2.0.0</version.jboss.portal.portlet>
+ <version.jboss.portal.web>1.2.0</version.jboss.portal.web>
<version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
<version.jboss.microcontainer>2.0.0.Beta13</version.jboss.microcontainer>
17 years, 10 months
JBoss Portal SVN: r11048 - 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:42:20 -0400 (Fri, 13 Jun 2008)
New Revision: 11048
Modified:
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java
Log:
- Minor refactoring.
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 15:36:55 UTC (rev 11047)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/google/GoogleClippingPortlet.java 2008-06-13 15:42:20 UTC (rev 11048)
@@ -80,14 +80,14 @@
int begIndex = html.indexOf(beg);
if (begIndex != -1)
{
- html = process(renderResponse, html, beg, end, begIndex);
+ html = process(html, beg, end, begIndex);
}
else
{
begIndex = html.indexOf(alternateBeg);
if (begIndex != -1)
{
- html = process(renderResponse, html, alternateBeg, end, begIndex);
+ html = process(html, alternateBeg, end, begIndex);
}
else
{
@@ -100,8 +100,7 @@
printWriter.print(html);
}
- private String process(RenderResponse renderResponse, String html, String beg, String end, int begIndex)
- throws IOException
+ private String process(String html, String beg, String end, int begIndex) throws IOException
{
// extract table containing specific first result
int endIndex = html.indexOf(end, begIndex);
17 years, 10 months
JBoss Portal SVN: r11047 - in modules/portlet/tags/JBP_PORTLET_2_0_0: portal/src/main/resources/simple-portal-war/layouts/nav and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-13 11:36:55 -0400 (Fri, 13 Jun 2008)
New Revision: 11047
Modified:
modules/portlet/tags/JBP_PORTLET_2_0_0/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp
modules/portlet/tags/JBP_PORTLET_2_0_0/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp
modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller/RemoteControllerPortlet.java
Log:
applying trunk fixes + comment the 301 link
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp 2008-06-13 15:34:50 UTC (rev 11046)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp 2008-06-13 15:36:55 UTC (rev 11047)
@@ -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/tags/JBP_PORTLET_2_0_0/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp 2008-06-13 15:34:50 UTC (rev 11046)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp 2008-06-13 15:36:55 UTC (rev 11047)
@@ -32,9 +32,11 @@
<li>
<a href="${pageContext.request.contextPath}/demo/demo4.jsp" class="${fn:substringAfter(pageContext.request.servletPath, 'demo/') == 'demo4.jsp' ? 'selected' : ''}">Demo4</a>
</li>
+ <%--
<li>
<a href="${pageContext.request.contextPath}/demo/jsr-301.jsp" class="${fn:substringAfter(pageContext.request.servletPath, 'demo/') == 'jsr-301.jsp' ? 'selected' : ''}">JSR-301 Demo</a>
</li>
+ --%>
</ul>
<br class="clear"/>
</div>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller/RemoteControllerPortlet.java
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller/RemoteControllerPortlet.java 2008-06-13 15:34:50 UTC (rev 11046)
+++ modules/portlet/tags/JBP_PORTLET_2_0_0/samples/src/main/java/org/jboss/portal/portlet/samples/remotecontroller/RemoteControllerPortlet.java 2008-06-13 15:36:55 UTC (rev 11047)
@@ -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