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.demo.uif.controller;
017
018import org.kuali.rice.krad.inquiry.InquiryViewPresentationControllerBase;
019import org.kuali.rice.krad.uif.container.Group;
020import org.kuali.rice.krad.uif.field.Field;
021import org.kuali.rice.krad.uif.view.View;
022import org.kuali.rice.krad.uif.view.ViewModel;
023
024/**
025 * Created with IntelliJ IDEA.
026 * User: jruch
027 * Date: 11/4/13
028 * Time: 2:24 PM
029 * To change this template use File | Settings | File Templates.
030 */
031public class DemoInquiryViewPresentationController extends InquiryViewPresentationControllerBase {
032
033
034    @Override
035    public boolean canViewField(View view, ViewModel model, Field field, String propertyName) {
036
037        //hide travel authorization number
038        if(propertyName.equals("travelAuthorizationDocumentId"))   {
039            return false;
040        }
041
042        return super.canViewField(view,model,field,propertyName);
043    }
044
045    @Override
046    public boolean canViewGroup(View view, ViewModel model, Group group, String groupId) {
047
048        //hide the estimates section
049        if(groupId.equals("TravelAccount-InquiryView-Costs"))  {
050            return false;
051        }
052
053        return super.canViewGroup(view, model,group,groupId);
054    }
055
056}