View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.model;
21  
22  public interface Crud {
23  
24    /**
25     * Indicates if the crud component should show the crud detail view
26       * otherwise the crud master view is shown
27     * 
28     * @return True if the detail view should be shown, false if the master view
29       *         should be shown
30     */
31    boolean getShowDetail();
32  
33    /**
34     * Managed bean (controller) method to delete an selected item.
35     * 
36     * @return The outcome after the method was executed
37     */
38    String deleteItem();
39  
40    /**
41     * Managed bean (controller) method to show an selected item on the CRUD
42       * detail view.
43     * 
44     * @return The outcome after the method was executed
45     */
46    String showItem();
47  
48    /**
49     * Managed bean (controller) method to show and edit an selected item on the
50       * CRUD detail view.
51     * 
52     * @return The outcome after the method was executed
53     */
54    String editItem();
55  
56    /**
57     * Managed bean (controller) method to create a new item on the CRUD detail
58       * view.
59     * 
60     * @return The outcome after the method was executed
61     */
62    String createItem();
63  
64    /**
65     * Managed bean (controller) method to save changes to a existing item or
66       * save a newly created item on the crud detail view.
67     * 
68     * @return The outcome after the method was executed
69     */
70    String saveItem();
71  
72    /**
73     * Managed bean (controller) method to exit the crud detail view without
74       * saving.
75     * 
76     * @return The outcome after the method was executed
77     */
78    String cancelItem();
79  
80    /**
81     * Indicates wether an item shown in the CRUD detail view is editable.
82     * 
83     * @return true if the shown item is editable, false if not
84     */
85    boolean isItemEditable();
86  
87  }