001    package org.apache.myfaces.tobago.model;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one or more
005     * contributor license agreements.  See the NOTICE file distributed with
006     * this work for additional information regarding copyright ownership.
007     * The ASF licenses this file to You under the Apache License, Version 2.0
008     * (the "License"); you may not use this file except in compliance with
009     * the License.  You may obtain a copy of the License at
010     *
011     *      http://www.apache.org/licenses/LICENSE-2.0
012     *
013     * Unless required by applicable law or agreed to in writing, software
014     * distributed under the License is distributed on an "AS IS" BASIS,
015     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016     * See the License for the specific language governing permissions and
017     * limitations under the License.
018     */
019    
020    public interface Crud {
021    
022      /**
023       * Indicates if the crud component should show the crud detail view
024         * otherwise the crud master view is shown
025       * 
026       * @return True if the detail view should be shown, false if the master view
027         *         should be shown
028       */
029      boolean getShowDetail();
030    
031      /**
032       * Managed bean (controller) method to delete an selected item.
033       * 
034       * @return The outcome after the method was executed
035       */
036      String deleteItem();
037    
038      /**
039       * Managed bean (controller) method to show an selected item on the CRUD
040         * detail view.
041       * 
042       * @return The outcome after the method was executed
043       */
044      String showItem();
045    
046      /**
047       * Managed bean (controller) method to show and edit an selected item on the
048         * CRUD detail view.
049       * 
050       * @return The outcome after the method was executed
051       */
052      String editItem();
053    
054      /**
055       * Managed bean (controller) method to create a new item on the CRUD detail
056         * view.
057       * 
058       * @return The outcome after the method was executed
059       */
060      String createItem();
061    
062      /**
063       * Managed bean (controller) method to save changes to a existing item or
064         * save a newly created item on the crud detail view.
065       * 
066       * @return The outcome after the method was executed
067       */
068      String saveItem();
069    
070      /**
071       * Managed bean (controller) method to exit the crud detail view without
072         * saving.
073       * 
074       * @return The outcome after the method was executed
075       */
076      String cancelItem();
077    
078      /**
079       * Indicates wether an item shown in the CRUD detail view is editable.
080       * 
081       * @return true if the shown item is editable, false if not
082       */
083      boolean isItemEditable();
084    
085    }