Author: thomas.heute(a)jboss.com
Date: 2011-01-06 09:07:21 -0500 (Thu, 06 Jan 2011)
New Revision: 13980
Modified:
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/model/portal/control/page/DefaultPageControlPolicy.java
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/model/portal/control/portal/DefaultPortalControlPolicy.java
branches/Enterprise_Portal_Platform_4_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBEPP-561: Hard coded Error-Page link- please make it configurable
Made more configurable by allowing to override just the context path
Modified:
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/model/portal/control/page/DefaultPageControlPolicy.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/model/portal/control/page/DefaultPageControlPolicy.java 2011-01-06
12:54:52 UTC (rev 13979)
+++
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/model/portal/control/page/DefaultPageControlPolicy.java 2011-01-06
14:07:21 UTC (rev 13980)
@@ -50,6 +50,9 @@
private static final Logger log = Logger.getLogger(DefaultPageControlPolicy.class);
/** . */
+ private String errorResourceContextPath = "/portal-core";
+
+ /** . */
private static final Map errorTypeMapping = new HashMap();
static
@@ -87,6 +90,16 @@
this.portalObjectContainer = portalObjectContainer;
}
+ public void setErrorResourceContextPath(String errorResourceContextPath)
+ {
+ this.errorResourceContextPath = errorResourceContextPath;
+ }
+
+ public String getErrorResourceContextPath()
+ {
+ return errorResourceContextPath;
+ }
+
public void doControl(PageControlContext controlContext)
{
WindowRendition rendition = controlContext.getRendition();
@@ -162,7 +175,7 @@
if (resourceURI != null)
{
ControllerContext controllerCtx =
controlContext.getControllerContext();
- ControllerRequestDispatcher rd =
controllerCtx.getRequestDispatcher("/portal-core", resourceURI);
+ ControllerRequestDispatcher rd =
controllerCtx.getRequestDispatcher(errorResourceContextPath, resourceURI);
if (rd != null)
{
String errorType = (String)errorTypeMapping.get(policyKey);
Modified:
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/model/portal/control/portal/DefaultPortalControlPolicy.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/model/portal/control/portal/DefaultPortalControlPolicy.java 2011-01-06
12:54:52 UTC (rev 13979)
+++
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/model/portal/control/portal/DefaultPortalControlPolicy.java 2011-01-06
14:07:21 UTC (rev 13980)
@@ -59,6 +59,9 @@
private static final Logger log = Logger.getLogger(DefaultPortalControlPolicy.class);
/** . */
+ private String errorResourceContextPath = "/portal-core";
+
+ /** . */
private static final Map errorTypeMapping = new HashMap();
static
@@ -83,6 +86,16 @@
this.portalObjectContainer = portalObjectContainer;
}
+ public void setErrorResourceContextPath(String errorResourceContextPath)
+ {
+ this.errorResourceContextPath = errorResourceContextPath;
+ }
+
+ public String getErrorResourceContextPath()
+ {
+ return errorResourceContextPath;
+ }
+
public void doControl(PortalControlContext controlContext)
{
@@ -154,7 +167,7 @@
if (resourceURI != null)
{
ControllerContext controllerCtx =
controlContext.getControllerContext();
- ControllerRequestDispatcher rd =
controllerCtx.getRequestDispatcher("/portal-core", resourceURI);
+ ControllerRequestDispatcher rd =
controllerCtx.getRequestDispatcher(errorResourceContextPath, resourceURI);
if (rd != null)
{
String errorType = (String)errorTypeMapping.get(policyKey);
Modified:
branches/Enterprise_Portal_Platform_4_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2011-01-06
12:54:52 UTC (rev 13979)
+++
branches/Enterprise_Portal_Platform_4_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2011-01-06
14:07:21 UTC (rev 13980)
@@ -1050,6 +1050,10 @@
name="portal:service=ControlPolicy,type=Page" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <!--
+ Change the context path if you require to have the error resource page outside
/portal-core
+ <attribute
name="ErrorResourceContextPath">/portal-core</attribute>
+ -->
<depends optional-attribute-name="PortalObjectContainer"
proxy-type="attribute">portal:container=PortalObject
</depends>
</mbean>
@@ -1057,6 +1061,10 @@
name="portal:service=ControlPolicy,type=Portal"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <!--
+ Change the context path if you require to have the error resource page outside
/portal-core
+ <attribute
name="ErrorResourceContextPath">/portal-core</attribute>
+ -->
<depends optional-attribute-name="PortalObjectContainer"
proxy-type="attribute">portal:container=PortalObject
</depends>
</mbean>
Show replies by date