01: /*
02: * Enhydra Java Application Server
03: * The Initial Developer of the Original Code is Lutris Technologies Inc.
04: * Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies
05: * Inc.
06: * All Rights Reserved.
07: *
08: * The contents of this file are subject to the Enhydra Public License Version
09: * 1.0 (the "License"); you may not use this file except in compliance with the
10: * License. You may obtain a copy of the License at
11: * http://www.enhydra.org/software/license/epl.html
12: *
13: * Software distributed under the License is distributed on an "AS IS" basis,
14: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
15: * License for the specific language governing rights and limitations under the
16: * License.
17: *
18: *
19: */
20:
21: package golfShop.presentation.xmlc.login;
22:
23: import org.enhydra.xml.xmlc.*;
24: import org.enhydra.xml.xmlc.html.*;
25: import com.lutris.appserver.server.httpPresentation.*;
26: import com.lutris.appserver.server.session.*;
27: import java.io.*;
28: import org.w3c.dom.*;
29: import org.w3c.dom.html.*;
30: import golfShop.GolfShop;
31: import golfShop.spec.user.*;
32: import golfShop.presentation.xmlc.utilities.*;
33:
34: /**
35: * This presentation object dynamically creates an HTML page showing
36: * that the user is logged out. A button allows the user to login again.
37: */
38: public class Logout implements HttpPresentation {
39: /**
40: * Entry.
41: */
42: public void run(HttpPresentationComms comms)
43: throws HttpPresentationException, IOException,
44: SessionException {
45:
46: GolfShop application = (GolfShop) comms.application;
47: GolfShopUserManager userManager = application.getUserManager();
48: try {
49: userManager.logout(comms.session);
50: /*
51: * We need to allow GolfShop_pres to be functional
52: */
53:
54: } catch (NullPointerException ex) {
55: }
56: LogoutHTML htmlObj = (LogoutHTML) comms.xmlcFactory
57: .create(LogoutHTML.class);
58: comms.response.writeDOM(htmlObj);
59: }
60: }
|