Coverage Report - org.kuali.rice.kim.lookup.PermissionLookupableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
PermissionLookupableImpl
0%
0/11
0%
0/4
3
 
 1  
 /*
 2  
  * Copyright 2007-2009 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.kim.lookup;
 17  
 
 18  
 import java.util.Properties;
 19  
 
 20  
 import org.apache.commons.lang.StringUtils;
 21  
 import org.kuali.rice.kim.bo.impl.GenericPermission;
 22  
 import org.kuali.rice.kim.util.KimConstants;
 23  
 import org.kuali.rice.kns.lookup.KualiLookupableImpl;
 24  
 import org.kuali.rice.krad.util.KRADConstants;
 25  
 import org.kuali.rice.krad.util.UrlFactory;
 26  
 
 27  
 /**
 28  
  * This is a description of what this class does - kellerj don't forget to fill this in. 
 29  
  * 
 30  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 31  
  *
 32  
  */
 33  0
 public class PermissionLookupableImpl extends KualiLookupableImpl {
 34  
 
 35  
         
 36  
         /**
 37  
          * This overridden method ...
 38  
          * 
 39  
          * @see org.kuali.rice.krad.lookup.KualiLookupableImpl#getCreateNewUrl()
 40  
          */
 41  
         @Override
 42  
         public String getCreateNewUrl() {
 43  0
         String url = "";
 44  
 
 45  0
         if (getLookupableHelperService().allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_PERMISSION_DOCUMENT_TYPE_NAME)) {
 46  0
             Properties parameters = new Properties();
 47  0
             parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
 48  0
             parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, GenericPermission.class.getName());
 49  0
                 if (StringUtils.isNotBlank(getReturnLocation())) {
 50  0
                         parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
 51  
                         }
 52  0
             url = UrlFactory.parameterizeUrl(KRADConstants.MAINTENANCE_ACTION, parameters);
 53  0
             url = "<a href=\"" + url + "\"><img src=\"images/tinybutton-createnew.gif\" alt=\"create new\" width=\"70\" height=\"15\"/></a>";
 54  
         }
 55  
 
 56  0
         return url;
 57  
         }
 58  
 }