01: /*
02: * $Id: AuthenticatedWebPage.java 460265 2006-04-16 13:36:52Z jdonnerstag $ $Revision:
03: * 4226 $ $Date: 2006-04-16 15:36:52 +0200 (Sun, 16 Apr 2006) $
04: *
05: * ==================================================================== Licensed
06: * under the Apache License, Version 2.0 (the "License"); you may not use this
07: * file except in compliance with the License. You may obtain a copy of the
08: * License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.examples.library;
19:
20: import wicket.examples.WicketExamplePage;
21: import wicket.markup.html.border.Border;
22:
23: /**
24: * Ensures that user is authenticated in session. If no user is signed in, a
25: * sign in is forced by redirecting the browser to the SignIn page.
26: * <p>
27: * This base class also creates a border for each page subclass, automatically
28: * adding children of the page to the border. This accomplishes two important
29: * things: (1) subclasses do not have to repeat the code to create the border
30: * navigation and (2) since subclasses do not repeat this code, they are not
31: * hardwired to page navigation structure details
32: *
33: * @author Jonathan Locke
34: */
35: public class AuthenticatedWebPage extends WicketExamplePage {
36: private Border border;
37:
38: /**
39: * Contruct
40: */
41: public AuthenticatedWebPage() {
42: // Create border and add it to the page
43: border = new LibraryApplicationBorder("border");
44: border.setTransparentResolver(true);
45: super .add(border);
46:
47: }
48:
49: /**
50: * Get downcast session object
51: *
52: * @return The session
53: */
54: public LibrarySession getLibrarySession() {
55: return (LibrarySession) getSession();
56: }
57: }
|