01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: Install.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package tutorial.friends;
09:
10: import com.uwyn.rife.engine.Element;
11: import com.uwyn.rife.template.Template;
12: import tutorial.friends.backend.FriendManager;
13:
14: /**
15: * Installs the database structure and populates it with example data.
16: *
17: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
18: * @version $Revision: 3634 $
19: */
20: public class Install extends Element {
21: private Template template;
22:
23: /**
24: * The element's initialization method.
25: */
26: public void initialize() {
27: template = getHtmlTemplate("install");
28: }
29:
30: /**
31: * The element's entry point.
32: */
33: public void processElement() {
34: print(template);
35: }
36:
37: /**
38: * The element's confirmation submission.
39: */
40: public void doConfirmation() {
41: FriendManager manager = new FriendManager();
42: manager.install();
43: template.setBlock("content", "content_installed");
44:
45: print(template);
46: }
47: }
|