001/**
002 * Copyright 2005-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.uif.view;
017
018import org.kuali.rice.krad.datadictionary.parse.BeanTag;
019import org.kuali.rice.krad.uif.container.CollectionGroup;
020import org.kuali.rice.krad.uif.container.Group;
021import org.kuali.rice.krad.uif.element.Action;
022import org.kuali.rice.krad.uif.field.Field;
023import org.kuali.rice.krad.uif.widget.Widget;
024import org.kuali.rice.krad.web.form.UifFormBase;
025
026import java.io.Serializable;
027import java.util.HashSet;
028import java.util.Set;
029
030/**
031 * Implementation of {@link ViewPresentationController} that implements no logic by default
032 *
033 * @author Kuali Rice Team (rice.collab@kuali.org)
034 */
035@BeanTag(name = "viewPresentationController")
036public class ViewPresentationControllerBase implements ViewPresentationController, Serializable {
037    private static final long serialVersionUID = -3199587372204398503L;
038
039    /**
040     * @see ViewPresentationController#getActionFlags(org.kuali.rice.krad.uif.view.View,
041     * org.kuali.rice.krad.web.form.UifFormBase)
042     */
043    public Set<String> getActionFlags(View view, UifFormBase model) {
044        return new HashSet<String>();
045    }
046
047    /**
048     * @see ViewPresentationController#getEditModes(org.kuali.rice.krad.uif.view.View,
049     * org.kuali.rice.krad.web.form.UifFormBase)
050     */
051    public Set<String> getEditModes(View view, UifFormBase model) {
052        return new HashSet<String>();
053    }
054
055    /**
056     * @see ViewPresentationController#canEditView(org.kuali.rice.krad.uif.view.View, org.kuali.rice.krad.uif.view.ViewModel)
057     */
058    public boolean canEditView(View view, ViewModel model) {
059        return true;
060    }
061
062    /**
063     * @see ViewPresentationController#canEditField(org.kuali.rice.krad.uif.view.View,
064     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.field.Field, java.lang.String)
065     */
066    public boolean canEditField(View view, ViewModel model, Field field, String propertyName) {
067        return true;
068    }
069
070    /**
071     * @see ViewPresentationController#canViewField(org.kuali.rice.krad.uif.view.View,
072     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.field.Field, java.lang.String)
073     */
074    public boolean canViewField(View view, ViewModel model, Field field, String propertyName) {
075        return true;
076    }
077
078    /**
079     * @see ViewPresentationController#fieldIsRequired(org.kuali.rice.krad.uif.view.View,
080     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.field.Field, java.lang.String)
081     */
082    public boolean fieldIsRequired(View view, ViewModel model, Field field, String propertyName) {
083        return false;
084    }
085
086    /**
087     * @see ViewPresentationController#canEditGroup(org.kuali.rice.krad.uif.view.View,
088     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.Group, java.lang.String)
089     */
090    public boolean canEditGroup(View view, ViewModel model, Group group, String groupId) {
091        return true;
092    }
093
094    /**
095     * @see ViewPresentationController#canViewGroup(org.kuali.rice.krad.uif.view.View,
096     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.Group, java.lang.String)
097     */
098    public boolean canViewGroup(View view, ViewModel model, Group group, String groupId) {
099        return true;
100    }
101
102    /**
103     * @see ViewPresentationController#canEditWidget(org.kuali.rice.krad.uif.view.View,
104     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.widget.Widget, java.lang.String)
105     */
106    public boolean canEditWidget(View view, ViewModel model, Widget widget, String widgetId) {
107        return true;
108    }
109
110    /**
111     * @see ViewPresentationController#canViewWidget(org.kuali.rice.krad.uif.view.View,
112     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.widget.Widget, java.lang.String)
113     */
114    public boolean canViewWidget(View view, ViewModel model, Widget widget, String widgetId) {
115        return true;
116    }
117
118    /**
119     * @see ViewPresentationController#canPerformAction(org.kuali.rice.krad.uif.view.View,
120     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.element.Action, java.lang.String,
121     * java.lang.String)
122     */
123    public boolean canPerformAction(View view, ViewModel model, Action action, String actionEvent,
124            String actionId) {
125        return true;
126    }
127
128    /**
129     * @see ViewPresentationController#canEditLine(org.kuali.rice.krad.uif.view.View,
130     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
131     * java.lang.String, java.lang.Object)
132     */
133    public boolean canEditLine(View view, ViewModel model, CollectionGroup collectionGroup,
134            String collectionPropertyName, Object line) {
135        return true;
136    }
137
138    /**
139     * @see ViewPresentationController#canViewLine(org.kuali.rice.krad.uif.view.View,
140     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
141     * java.lang.String, java.lang.Object)
142     */
143    public boolean canViewLine(View view, ViewModel model, CollectionGroup collectionGroup,
144            String collectionPropertyName, Object line) {
145        return true;
146    }
147
148    /**
149     * @see ViewPresentationController#canEditLineField(org.kuali.rice.krad.uif.view.View,
150     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
151     * java.lang.String, java.lang.Object, org.kuali.rice.krad.uif.field.Field, java.lang.String)
152     */
153    public boolean canEditLineField(View view, ViewModel model, CollectionGroup collectionGroup,
154            String collectionPropertyName, Object line, Field field, String propertyName) {
155        return true;
156    }
157
158    /**
159     * @see ViewPresentationController#canViewLineField(org.kuali.rice.krad.uif.view.View,
160     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
161     * java.lang.String, java.lang.Object, org.kuali.rice.krad.uif.field.Field, java.lang.String)
162     */
163    public boolean canViewLineField(View view, ViewModel model, CollectionGroup collectionGroup,
164            String collectionPropertyName, Object line, Field field, String propertyName) {
165        return true;
166    }
167
168    /**
169     * @see ViewPresentationController#canPerformLineAction(org.kuali.rice.krad.uif.view.View,
170     * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
171     * java.lang.String, java.lang.Object, org.kuali.rice.krad.uif.element.Action, java.lang.String,
172     * java.lang.String)
173     */
174    public boolean canPerformLineAction(View view, ViewModel model, CollectionGroup collectionGroup,
175            String collectionPropertyName, Object line, Action action, String actionEvent, String actionId) {
176        return true;
177    }
178
179}