mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
@@ -54,6 +54,11 @@
|
|||||||
<transformer name="strip-namespaces" src="org.apache.cocoon.transformation.StripNameSpacesTransformer"/>
|
<transformer name="strip-namespaces" src="org.apache.cocoon.transformation.StripNameSpacesTransformer"/>
|
||||||
</map:transformers>
|
</map:transformers>
|
||||||
|
|
||||||
|
<map:actions>
|
||||||
|
<map:action name="ContextAbortAction" src="org.dspace.app.xmlui.cocoon.ContextAbortAction" />
|
||||||
|
</map:actions>
|
||||||
|
|
||||||
|
|
||||||
<map:serializers>
|
<map:serializers>
|
||||||
<map:serializer name="html-no-doctype" logger="sitemap.serializer.xhtml"
|
<map:serializer name="html-no-doctype" logger="sitemap.serializer.xhtml"
|
||||||
src="org.apache.cocoon.serialization.HTMLSerializer"
|
src="org.apache.cocoon.serialization.HTMLSerializer"
|
||||||
@@ -215,6 +220,7 @@
|
|||||||
</map:when>
|
</map:when>
|
||||||
<!-- All other errors (HTTP 500 Internal Server Error) -->
|
<!-- All other errors (HTTP 500 Internal Server Error) -->
|
||||||
<map:otherwise>
|
<map:otherwise>
|
||||||
|
<map:act type="ContextAbortAction"/>
|
||||||
<map:serialize type="html-no-doctype" status-code="500"/>
|
<map:serialize type="html-no-doctype" status-code="500"/>
|
||||||
</map:otherwise>
|
</map:otherwise>
|
||||||
</map:select>
|
</map:select>
|
||||||
|
@@ -0,0 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* The contents of this file are subject to the license and copyright
|
||||||
|
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||||
|
* tree and available online at
|
||||||
|
*
|
||||||
|
* http://www.dspace.org/license/
|
||||||
|
*/
|
||||||
|
package org.dspace.app.xmlui.cocoon;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import org.apache.avalon.framework.parameters.*;
|
||||||
|
import org.apache.cocoon.acting.*;
|
||||||
|
import org.apache.cocoon.environment.*;
|
||||||
|
import org.dspace.app.xmlui.utils.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This action is used to abort the context when an exception occurs.
|
||||||
|
* The action is called by the handle-errors section in either the theme's sitemap or the
|
||||||
|
* main webapp/sitemap if the theme does not have a handle-errors section.
|
||||||
|
*
|
||||||
|
* @author philip at atmire.com
|
||||||
|
*/
|
||||||
|
public class ContextAbortAction extends ServiceableAction {
|
||||||
|
@Override
|
||||||
|
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception {
|
||||||
|
ContextUtil.abortContext(ObjectModelHelper.getRequest(objectModel));
|
||||||
|
return EMPTY_MAP;
|
||||||
|
}
|
||||||
|
}
|
@@ -208,6 +208,7 @@
|
|||||||
<map:action name="StartAuthentication" src="org.dspace.app.xmlui.aspect.eperson.StartAuthenticationAction"/>
|
<map:action name="StartAuthentication" src="org.dspace.app.xmlui.aspect.eperson.StartAuthenticationAction"/>
|
||||||
<map:action name="DSpacePropertyFileReader" src="org.dspace.app.xmlui.cocoon.DSpacePropertyFileReader" />
|
<map:action name="DSpacePropertyFileReader" src="org.dspace.app.xmlui.cocoon.DSpacePropertyFileReader" />
|
||||||
<map:action name="PropertyFileReader" src="org.dspace.app.xmlui.cocoon.PropertyFileReader" />
|
<map:action name="PropertyFileReader" src="org.dspace.app.xmlui.cocoon.PropertyFileReader" />
|
||||||
|
<map:action name="ContextAbortAction" src="org.dspace.app.xmlui.cocoon.ContextAbortAction" />
|
||||||
</map:actions>
|
</map:actions>
|
||||||
<map:pipes default="caching">
|
<map:pipes default="caching">
|
||||||
<map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
|
<map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
|
||||||
@@ -747,6 +748,8 @@
|
|||||||
</map:when>
|
</map:when>
|
||||||
|
|
||||||
<map:otherwise>
|
<map:otherwise>
|
||||||
|
<map:act type="ContextAbortAction"/>
|
||||||
|
|
||||||
<map:generate type="exception"/>
|
<map:generate type="exception"/>
|
||||||
<map:transform src="exception2html.xslt">
|
<map:transform src="exception2html.xslt">
|
||||||
<map:parameter name="contextPath" value="{request:contextPath}"/>
|
<map:parameter name="contextPath" value="{request:contextPath}"/>
|
||||||
|
@@ -49,6 +49,10 @@
|
|||||||
<map:readers>
|
<map:readers>
|
||||||
<map:reader name="ConcatenationReader" src="org.dspace.app.xmlui.cocoon.ConcatenationReader"/>
|
<map:reader name="ConcatenationReader" src="org.dspace.app.xmlui.cocoon.ConcatenationReader"/>
|
||||||
</map:readers>
|
</map:readers>
|
||||||
|
<map:actions>
|
||||||
|
<map:action name="ContextAbortAction" src="org.dspace.app.xmlui.cocoon.ContextAbortAction" />
|
||||||
|
</map:actions>
|
||||||
|
|
||||||
</map:components>
|
</map:components>
|
||||||
|
|
||||||
<!-- Define global resources that are used in multiple areas of the pipeline. -->
|
<!-- Define global resources that are used in multiple areas of the pipeline. -->
|
||||||
@@ -210,6 +214,7 @@
|
|||||||
</map:when>
|
</map:when>
|
||||||
<!-- All other errors (HTTP 500 Internal Server Error) -->
|
<!-- All other errors (HTTP 500 Internal Server Error) -->
|
||||||
<map:otherwise>
|
<map:otherwise>
|
||||||
|
<map:act type="ContextAbortAction"/>
|
||||||
<map:serialize type="xhtml" status-code="500"/>
|
<map:serialize type="xhtml" status-code="500"/>
|
||||||
</map:otherwise>
|
</map:otherwise>
|
||||||
</map:select>
|
</map:select>
|
||||||
|
Reference in New Issue
Block a user