Coverage Report - org.kuali.rice.kew.rule.bo.RuleBaseValuesInquirableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
RuleBaseValuesInquirableImpl
0%
0/15
0%
0/2
1.667
 
 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.kew.rule.bo;
 17  
 
 18  
 import java.util.List;
 19  
 import java.util.Map;
 20  
 
 21  
 import org.kuali.rice.core.config.ConfigContext;
 22  
 import org.kuali.rice.kew.rule.RuleBaseValues;
 23  
 import org.kuali.rice.kew.rule.web.WebRuleUtils;
 24  
 import org.kuali.rice.kew.util.KEWConstants;
 25  
 import org.kuali.rice.kew.util.KEWPropertyConstants;
 26  
 import org.kuali.rice.kns.bo.BusinessObject;
 27  
 import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
 28  
 import org.kuali.rice.kns.lookup.HtmlData;
 29  
 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
 30  
 import org.kuali.rice.kns.web.ui.Section;
 31  
 
 32  
 /**
 33  
  * This is a description of what this class does - ewestfal don't forget to fill this in. 
 34  
  * 
 35  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 36  
  *
 37  
  */
 38  0
 public class RuleBaseValuesInquirableImpl extends KualiInquirableImpl {
 39  
 
 40  
         public static final String ROUTE_HEADER_ID = "routeHeaderId";
 41  
 
 42  
 
 43  
         /**
 44  
          * This overridden method ...
 45  
          * 
 46  
          * @see org.kuali.rice.kns.inquiry.Inquirable#getBusinessObject(java.util.Map)
 47  
          */
 48  
         public BusinessObject getBusinessObject(Map fieldValues) {
 49  0
                 RuleBaseValues rule = (RuleBaseValues)super.getBusinessObject(fieldValues);
 50  0
                 WebRuleUtils.populateRuleMaintenanceFields(rule);
 51  0
                 return rule;
 52  
         }
 53  
 
 54  
         /**
 55  
          * This overridden method ...
 56  
          * 
 57  
          * @see org.kuali.rice.kns.inquiry.Inquirable#getSections(org.kuali.rice.kns.bo.BusinessObject)
 58  
          */
 59  
         public List getSections(BusinessObject bo) {
 60  0
                 List<Section> sections = super.getSections(bo);
 61  
 
 62  0
                 return WebRuleUtils.customizeSections((RuleBaseValues)bo, sections, false);
 63  
 
 64  
         }
 65  
         
 66  
            
 67  
         /**
 68  
      * @see org.kuali.kfs.sys.businessobject.inquiry.KfsInquirableImpl#getInquiryUrl(org.kuali.rice.kns.bo.BusinessObject,
 69  
      *      java.lang.String, boolean)
 70  
      */
 71  
     @Override
 72  
     public HtmlData getInquiryUrl(BusinessObject businessObject, String attributeName, boolean forceInquiry) {
 73  
             
 74  0
                 if(ROUTE_HEADER_ID.equals(attributeName)) {
 75  
 
 76  0
                         AnchorHtmlData link = new AnchorHtmlData();
 77  0
                         RuleBaseValues rule = (RuleBaseValues)businessObject;
 78  
 
 79  0
                         Long routeHeaderId = rule.getRouteHeaderId();
 80  0
                         link.setDisplayText(routeHeaderId+"");
 81  
 
 82  0
                         String href = ConfigContext.getCurrentContextConfig().getKEWBaseURL() + "/" +
 83  
                         KEWConstants.DOC_HANDLER_REDIRECT_PAGE + "?" + KEWConstants.COMMAND_PARAMETER + "=" +
 84  
                         KEWConstants.DOCSEARCH_COMMAND + "&" + KEWConstants.ROUTEHEADER_ID_PARAMETER + "=" + routeHeaderId;
 85  
 
 86  0
                         link.setHref(href);
 87  
 
 88  0
                         return link;
 89  
                 }                
 90  0
         return super.getInquiryUrl(businessObject, attributeName, forceInquiry);
 91  
     }
 92  
 
 93  
 }