Coverage Report - org.kuali.rice.kew.rule.bo.RuleBaseValuesInquirableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
RuleBaseValuesInquirableImpl
0%
0/18
0%
0/2
1.5
 
 1  
 /*
 2  
  * Copyright 2006-2011 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  
 
 17  
 package org.kuali.rice.kew.rule.bo;
 18  
 
 19  
 import org.kuali.rice.core.api.config.property.ConfigContext;
 20  
 import org.kuali.rice.kew.rule.RuleBaseValues;
 21  
 import org.kuali.rice.kew.rule.web.WebRuleUtils;
 22  
 import org.kuali.rice.kew.util.KEWConstants;
 23  
 import org.kuali.rice.kns.bo.BusinessObject;
 24  
 import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
 25  
 import org.kuali.rice.kns.lookup.HtmlData;
 26  
 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
 27  
 import org.kuali.rice.kns.web.ui.Section;
 28  
 
 29  
 import java.util.List;
 30  
 import java.util.Map;
 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 DOCUMENT_ID = "documentId";
 41  
 
 42  
         @Override
 43  
         public Object getDataObject(Map fieldValues){
 44  0
                 RuleBaseValues rule = (RuleBaseValues)super.getDataObject(fieldValues);
 45  0
                 WebRuleUtils.populateRuleMaintenanceFields(rule);
 46  0
                 return rule;
 47  
     }
 48  
         
 49  
         /**
 50  
          * This overridden method ...
 51  
          * 
 52  
          * @see org.kuali.rice.kns.inquiry.Inquirable#getBusinessObject(java.util.Map)
 53  
          */
 54  
         public BusinessObject getBusinessObject(Map fieldValues) {
 55  0
                 RuleBaseValues rule = (RuleBaseValues)super.getBusinessObject(fieldValues);
 56  0
                 WebRuleUtils.populateRuleMaintenanceFields(rule);
 57  0
                 return rule;
 58  
         }
 59  
 
 60  
         /**
 61  
          * This overridden method ...
 62  
          * 
 63  
          * @see org.kuali.rice.kns.inquiry.Inquirable#getSections(org.kuali.rice.kns.bo.BusinessObject)
 64  
          */
 65  
         public List getSections(BusinessObject bo) {
 66  0
                 List<Section> sections = super.getSections(bo);
 67  
 
 68  0
                 return WebRuleUtils.customizeSections((RuleBaseValues)bo, sections, false);
 69  
 
 70  
         }
 71  
         
 72  
            
 73  
         /**
 74  
      * @see org.kuali.kfs.sys.businessobject.inquiry.KfsInquirableImpl#getInquiryUrl(org.kuali.rice.kns.bo.BusinessObject,
 75  
      *      java.lang.String, boolean)
 76  
      */
 77  
     @Override
 78  
     public HtmlData getInquiryUrl(BusinessObject businessObject, String attributeName, boolean forceInquiry) {
 79  
             
 80  0
                 if(DOCUMENT_ID.equals(attributeName)) {
 81  
 
 82  0
                         AnchorHtmlData link = new AnchorHtmlData();
 83  0
                         RuleBaseValues rule = (RuleBaseValues)businessObject;
 84  
 
 85  0
                         String documentId = rule.getDocumentId();
 86  0
                         link.setDisplayText(documentId+"");
 87  
 
 88  0
                         String href = ConfigContext.getCurrentContextConfig().getKEWBaseURL() + "/" +
 89  
                         KEWConstants.DOC_HANDLER_REDIRECT_PAGE + "?" + KEWConstants.COMMAND_PARAMETER + "=" +
 90  
                         KEWConstants.DOCSEARCH_COMMAND + "&" + KEWConstants.DOCUMENT_ID_PARAMETER + "=" + documentId;
 91  
 
 92  0
                         link.setHref(href);
 93  
 
 94  0
                         return link;
 95  
                 }                
 96  0
         return super.getInquiryUrl(businessObject, attributeName, forceInquiry);
 97  
     }
 98  
 
 99  
 }