01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/portal/tags/sakai_2-4-1/portal-impl/impl/src/java/org/sakaiproject/portal/charon/handlers/ErrorDoneHandler.java $
03: * $Id: ErrorDoneHandler.java 29143 2007-04-19 01:10:38Z ajpoland@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006, 2007 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.portal.charon.handlers;
21:
22: import java.io.IOException;
23:
24: import javax.servlet.http.HttpServletRequest;
25: import javax.servlet.http.HttpServletResponse;
26:
27: import org.sakaiproject.portal.api.PortalHandlerException;
28: import org.sakaiproject.portal.util.ErrorReporter;
29: import org.sakaiproject.tool.api.Session;
30: import org.sakaiproject.tool.api.ToolException;
31:
32: /**
33: * Handler for final part of the Error Processing Flow
34: *
35: * @author ieb
36: * @since Sakai 2.4
37: * @version $Rev: 29143 $
38: *
39: */
40: public class ErrorDoneHandler extends BasePortalHandler {
41:
42: public ErrorDoneHandler() {
43: urlFragment = "error-reported";
44: }
45:
46: @Override
47: public int doPost(String[] parts, HttpServletRequest req,
48: HttpServletResponse res, Session session)
49: throws PortalHandlerException {
50: return doGet(parts, req, res, session);
51: }
52:
53: @Override
54: public int doGet(String[] parts, HttpServletRequest req,
55: HttpServletResponse res, Session session)
56: throws PortalHandlerException {
57: if ((parts.length >= 2) && (parts[1].equals("error-reported"))) {
58: try {
59: doErrorDone(req, res);
60: return END;
61: } catch (Exception ex) {
62: throw new PortalHandlerException(ex);
63: }
64: } else {
65: return NEXT;
66: }
67: }
68:
69: public void doErrorDone(HttpServletRequest req,
70: HttpServletResponse res) throws ToolException, IOException {
71: portal.setupForward(req, res, null, null);
72:
73: ErrorReporter err = new ErrorReporter();
74: err.thanksResponse(req, res);
75: }
76:
77: }
|