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