Coverage Report - org.kuali.rice.kns.uif.service.ViewTypeService
 
Classes in this File Line Coverage Branch Coverage Complexity
ViewTypeService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.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/ecl1.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.kns.uif.service;
 17  
 
 18  
 import java.util.Map;
 19  
 
 20  
 import org.kuali.rice.kns.uif.container.View;
 21  
 
 22  
 /**
 23  
  * Provides methods handing <code>View</code> instance of certain types
 24  
  * 
 25  
  * <p>
 26  
  * The type service is invoked to handle type parameters that can be used for
 27  
  * additional indexing of views and retrieval.
 28  
  * </p>
 29  
  * 
 30  
  * <p>
 31  
  * As the view dictionary entries are indexed the associated view type will be
 32  
  * retrieved and if there is an associated <code>ViewTypeService</code> it will
 33  
  * be invoked to provide parameter information for further indexing. This is
 34  
  * useful to index a view based on other properties, like a class name.
 35  
  * </p>
 36  
  * 
 37  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 38  
  */
 39  
 public interface ViewTypeService {
 40  
 
 41  
         /**
 42  
          * Gives the view type name that is supported by the type service
 43  
          * 
 44  
          * <p>
 45  
          * The name is used to associated a type (and thus a view type service) with
 46  
          * a view instance through the view type name property. Thus must be unique
 47  
          * among all view types implemented
 48  
          * </p>
 49  
          * 
 50  
          * @return String view type name
 51  
          */
 52  
         public String getViewTypeName();
 53  
 
 54  
         /**
 55  
          * Pulls values for the supported parameters from the <code>View</code>
 56  
          * instance. These name/value pairs are used to index the view for later
 57  
          * retrieval
 58  
          * 
 59  
          * @param view
 60  
          *            - view instance to pull parameter values from
 61  
          * @return Map<String, String> of parameters where map key is the parameter
 62  
          *         name, and the map value is the parameter value
 63  
          */
 64  
         public Map<String, String> getParametersFromView(View view);
 65  
 
 66  
         /**
 67  
          * Pulls entries from the given map that are supported parameters for the
 68  
          * view type. In addition, defaults can be set or additional parameters set
 69  
          * as needed. Used by the <code>ViewService</code> to retrieve a
 70  
          * <code>View</code> instance based on the incoming request parameters
 71  
          * 
 72  
          * @param requestParameters
 73  
          *            - Map of request parameters to pull view type parameters from
 74  
          * @return Map<String, String> of parameters where map key is the parameter
 75  
          *         name, and the map value is the parameter value
 76  
          */
 77  
         public Map<String, String> getParametersFromRequest(Map<String, String> requestParameters);
 78  
 
 79  
 }