2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   *
17   * $Id: BaseViewController.java 464373 2006-10-16 04:21:54Z rahul $
18   */
19  
20  package org.apache.shale.examples.mailreader;
21  
22  import org.apache.shale.view.AbstractViewController;
23  import org.apache.struts.apps.mailreader.dao.UserDatabase;;
24  
25  /***
26   * <p>Convenience abstract base <code>ViewController</code>
27   * for the Mail Reader example application.</p>
28   */
29  
30  public abstract class BaseViewController extends AbstractViewController {
31      
32      
33      // -------------------------------------------------------------- Properties
34  
35  
36      // ---------------------------------------------------------- Event Handlers
37  
38  
39      // -------------------------------------------------- ViewController Methods
40  
41  
42      // ------------------------------------------------------- Protected Methods
43  
44  
45      /***
46       * <p>Return the state saving bean for this user's transaction state.</p>
47       */
48      protected State getState() {
49          
50          // Look up the state saving bean,
51          // using the 'getBean' method inherited from AbstractFacesBean
52          return (State) getBean("state");
53  
54      }
55  
56  
57      /***
58       * <p>Return the DAO for our user database.</p>
59       */
60      protected UserDatabase getUserDatabase() {
61  
62          // Look up the DAO for the user database,
63          // using the 'getBean' method inherited from AbstractFacesBean
64          return (UserDatabase) getBean("database");
65  
66      }
67  
68  
69  }