Coverage Report - org.kuali.rice.kim.lookup.PersonLookupableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
PersonLookupableImpl
0%
0/12
0%
0/6
2.5
 
 1  
 /*
 2  
  * Copyright 2007-2008 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.kuali.rice.kew.util.KEWConstants;
 21  
 import org.kuali.rice.kim.service.KIMServiceLocator;
 22  
 import org.kuali.rice.kim.service.UiDocumentService;
 23  
 import org.kuali.rice.kim.util.KimCommonUtils;
 24  
 import org.kuali.rice.kim.util.KimConstants;
 25  
 import org.kuali.rice.kns.lookup.KualiLookupableImpl;
 26  
 import org.kuali.rice.kns.util.GlobalVariables;
 27  
 import org.kuali.rice.kns.util.KNSConstants;
 28  
 import org.kuali.rice.kns.util.UrlFactory;
 29  
 
 30  
 /**
 31  
  * This is a description of what this class does - shyu don't forget to fill this in. 
 32  
  * 
 33  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 34  
  *
 35  
  */
 36  0
 public class PersonLookupableImpl extends KualiLookupableImpl {
 37  
 
 38  
         private UiDocumentService uiDocumentService;
 39  
         private static final long serialVersionUID = 1707861010746829601L;
 40  
 
 41  
         @Override
 42  
         public String getCreateNewUrl() {
 43  0
                 String url = "";
 44  0
                 if((getLookupableHelperService()).allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_PERSON_DOCUMENT_TYPE_NAME)
 45  
                                 && getUiDocumentService().canModifyEntity(GlobalVariables.getUserSession().getPrincipalId(), null)){
 46  0
                 Properties parameters = new Properties();
 47  0
                 parameters.put(KNSConstants.DISPATCH_REQUEST_PARAMETER, KNSConstants.DOC_HANDLER_METHOD);
 48  0
                 parameters.put(KNSConstants.PARAMETER_COMMAND, KEWConstants.INITIATE_COMMAND);
 49  0
                 parameters.put(KNSConstants.DOCUMENT_TYPE_NAME, KimConstants.KimUIConstants.KIM_PERSON_DOCUMENT_TYPE_NAME);
 50  0
                 url = getCreateNewUrl(UrlFactory.parameterizeUrl(
 51  
                                 KimCommonUtils.getKimBasePath()+KimConstants.KimUIConstants.KIM_PERSON_DOCUMENT_ACTION, parameters));
 52  
                 //String url = "lookup.do?businessObjectClassName=org.kuali.rice.kim.bo.types.impl.KimTypeImpl&returnLocation=portal.do&docFormKey="+KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_SHORT_KEY;
 53  
                 //url = "../kim/identityManagementPersonDocument.do?methodToCall=docHandler&command=initiate&docTypeName=IdentityManagementPersonDocument";
 54  
                 //url = "<a href=\"" + url + "\"><img src=\"images/tinybutton-createnew.gif\" alt=\"create new\" width=\"70\" height=\"15\"/></a>";
 55  
                 }
 56  0
                 return url;
 57  
         }
 58  
 
 59  
         public UiDocumentService getUiDocumentService() {
 60  0
                 if ( uiDocumentService == null ) {
 61  0
                         uiDocumentService = KIMServiceLocator.getUiDocumentService();
 62  
                 }
 63  0
                 return uiDocumentService;
 64  
         }
 65  
 
 66  
 }