1 /**
2 * Copyright 2005-2015 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.demo.uif.controller;
17
18 import org.kuali.rice.krad.inquiry.InquiryViewPresentationControllerBase;
19 import org.kuali.rice.krad.uif.container.Group;
20 import org.kuali.rice.krad.uif.field.Field;
21 import org.kuali.rice.krad.uif.view.View;
22 import org.kuali.rice.krad.uif.view.ViewModel;
23
24 /**
25 * Created with IntelliJ IDEA.
26 * User: jruch
27 * Date: 11/4/13
28 * Time: 2:24 PM
29 * To change this template use File | Settings | File Templates.
30 */
31 public class DemoInquiryViewPresentationController extends InquiryViewPresentationControllerBase {
32
33
34 @Override
35 public boolean canViewField(View view, ViewModel model, Field field, String propertyName) {
36
37 //hide travel authorization number
38 if(propertyName.equals("travelAuthorizationDocumentId")) {
39 return false;
40 }
41
42 return super.canViewField(view,model,field,propertyName);
43 }
44
45 @Override
46 public boolean canViewGroup(View view, ViewModel model, Group group, String groupId) {
47
48 //hide the estimates section
49 if(groupId.equals("TravelAccount-InquiryView-Costs")) {
50 return false;
51 }
52
53 return super.canViewGroup(view, model,group,groupId);
54 }
55
56 }