View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.uif.view;
17  
18  import org.kuali.rice.kim.api.identity.Person;
19  import org.kuali.rice.krad.uif.container.CollectionGroup;
20  import org.kuali.rice.krad.uif.container.Group;
21  import org.kuali.rice.krad.uif.field.ActionField;
22  import org.kuali.rice.krad.uif.field.Field;
23  import org.kuali.rice.krad.uif.field.InputField;
24  import org.kuali.rice.krad.uif.widget.Widget;
25  import org.kuali.rice.krad.web.form.UifFormBase;
26  
27  import java.util.Set;
28  
29  /**
30   * Configured for a <code>View</code> instance to provide conditional logic
31   * based on any variable (view configuration, system parameters, ...) that does
32   * not depend on the current user
33   *
34   * @author Kuali Rice Team (rice.collab@kuali.org)
35   */
36  public interface ViewPresentationController {
37  
38      public Set<String> getActionFlags(View view, UifFormBase model);
39  
40      public Set<String> getEditModes(View view, UifFormBase model);
41  
42      /**
43       * Determines if the the given view and data is allowed to be edited
44       *
45       * @param view - view instance to check whether editing is allowed
46       * @param model - object containing the view data
47       * @return boolean true if editing on the view is allowed, false otherwise
48       */
49      public boolean canEditView(View view, ViewModel model);
50  
51      public boolean canEditField(View view, ViewModel model, Field field, String propertyName);
52  
53      public boolean canViewField(View view, ViewModel model, Field field, String propertyName);
54  
55      public boolean fieldIsRequired(View view, ViewModel model, Field field, String propertyName);
56  
57      public boolean canEditGroup(View view, ViewModel model, Group group, String groupId);
58  
59      public boolean canViewGroup(View view, ViewModel model, Group group, String groupId);
60  
61      public boolean canEditWidget(View view, ViewModel model, Widget widget, String widgetId);
62  
63      public boolean canViewWidget(View view, ViewModel model, Widget widget, String widgetId);
64  
65      public boolean canPerformAction(View view, ViewModel model, ActionField actionField, String actionEvent,
66              String actionId);
67  
68      public boolean canEditLine(View view, ViewModel model, CollectionGroup collectionGroup,
69              String collectionPropertyName, Object line);
70  
71      public boolean canViewLine(View view, ViewModel model, CollectionGroup collectionGroup,
72              String collectionPropertyName, Object line);
73  
74      public boolean canEditLineField(View view, ViewModel model, CollectionGroup collectionGroup,
75              String collectionPropertyName, Object line, Field field, String propertyName);
76  
77      public boolean canViewLineField(View view, ViewModel model, CollectionGroup collectionGroup,
78              String collectionPropertyName, Object line, Field field, String propertyName);
79  
80      public boolean canPerformLineAction(View view, ViewModel model, CollectionGroup collectionGroup,
81              String collectionPropertyName, Object line, ActionField actionField, String actionEvent, String actionId);
82  
83  }