01: /*
02: * This file is part of PFIXCORE.
03: *
04: * PFIXCORE is free software; you can redistribute it and/or modify
05: * it under the terms of the GNU Lesser General Public License as published by
06: * the Free Software Foundation; either version 2 of the License, or
07: * (at your option) any later version.
08: *
09: * PFIXCORE is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public License
15: * along with PFIXCORE; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: */
19:
20: package de.schlund.pfixcore.workflow.app;
21:
22: import org.apache.log4j.Logger;
23:
24: /**
25: * Default implementation of the ResdocFinalizer interface.
26: * <br/>
27: *
28: * Created: Fri Oct 12 22:00:21 2001
29: *
30: * @author <a href="mailto:jtl@schlund.de">Jens Lautenbacher</a>
31: *
32: *
33: */
34:
35: public class ResdocSimpleFinalizer implements ResdocFinalizer {
36: public static final String PROP_FINALIZER = "resdocfinalizer";
37: protected Logger LOG = Logger.getLogger(this .getClass());
38:
39: // These 3 methods are likely candidates to be overwritten...
40:
41: /**
42: * <code>OnWorkError</code> is called when an error happens while working with the data inside a
43: * handler's <code>handleSubmittedData()</code> routine.
44: * If you really know what you are doing you can add additional output to the ResultDocument here,
45: * but this is almost always a bad idea.
46: * The default implementation simply calls the {@link renderDefault(IWrapperContainer container)} method.
47: *
48: * @param container an <code>IWrapperContainer</code> value
49: * @see de.schlund.pfixcore.workflow.app.ResdocFinalizer#onWorkError(IWrapperContainer)
50: */
51: public void onWorkError(IWrapperContainer container)
52: throws Exception {
53: renderDefault(container);
54: }
55:
56: /**
57: * <code>onRetrieveStatus</code> is called after a call to
58: * IHandlerAction.inserCurrentStatus(container), that means whenever
59: * all (currently active) IHandlers are called to insert their current status
60: * Into the ResultDocument. Use this Routine to do additional stuff here.
61: * If you really know what you are doing you can add additional output to the ResultDocument here,
62: * but this is almost always a bad idea.
63: * The default implementation simply calls the {@link renderDefault(IWrapperContainer container)} method.
64: *
65: * @param container an <code>IWrapperContainer</code> value
66: * @see de.schlund.pfixcore.workflow.app.ResdocFinalizer#onRetrieveStatus(IWrapperContainer)
67: */
68: public void onRetrieveStatus(IWrapperContainer container)
69: throws Exception {
70: renderDefault(container);
71: }
72:
73: /**
74: * <code>onSuccess</code> is called when there has been no error handling a request that submitted data.
75: * If you really know what you are doing you can add additional output to the ResultDocument here,
76: * but this is almost always a bad idea.
77: * The default implementation simply calls the {@link renderDefault(IWrapperContainer container)} method.
78: *
79: * @param container an <code>IWrapperContainer</code> value
80: * @see de.schlund.pfixcore.workflow.app.ResdocFinalizer#onSuccess(IWrapperContainer)
81: */
82: public void onSuccess(IWrapperContainer container) throws Exception {
83: renderDefault(container);
84: }
85:
86: /**
87: * The default implementation does nothing. You normally want to overwrite this but only if you really know what you are doing.
88: * Adding output to the Resultdocument is almost always a bad idea. Doing additional other work may be useful, but keep in mind
89: * that this method will not always be called (see the {@link onSuccess(IWrapperContainer container)} method for an example).
90: *
91: * @param container an <code>IWrapperContainer</code> value
92: */
93: protected void renderDefault(IWrapperContainer container)
94: throws Exception {
95: //
96: }
97: }
98:
99: // ResdocSimpleFinalizer
|