| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ViewTypeService |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright 2005-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 | package org.kuali.rice.krad.uif.service; | |
| 17 | ||
| 18 | import org.kuali.rice.krad.uif.UifConstants; | |
| 19 | import org.kuali.rice.krad.uif.view.View; | |
| 20 | import org.kuali.rice.krad.uif.UifConstants.ViewType; | |
| 21 | import org.springframework.beans.PropertyValues; | |
| 22 | ||
| 23 | import java.util.Map; | |
| 24 | ||
| 25 | /** | |
| 26 | * Provides methods handing <code>View</code> instance of certain types | |
| 27 | * | |
| 28 | * <p> | |
| 29 | * The type service is invoked to handle type parameters that can be used for | |
| 30 | * additional indexing of views and retrieval. | |
| 31 | * </p> | |
| 32 | * | |
| 33 | * <p> | |
| 34 | * As the view dictionary entries are indexed the associated view type will be | |
| 35 | * retrieved and if there is an associated <code>ViewTypeService</code> it will | |
| 36 | * be invoked to provide parameter information for further indexing. This is | |
| 37 | * useful to index a view based on other properties, like a class name. | |
| 38 | * </p> | |
| 39 | * | |
| 40 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 41 | */ | |
| 42 | public interface ViewTypeService { | |
| 43 | ||
| 44 | /** | |
| 45 | * Gives the view type name that is supported by the type service | |
| 46 | * | |
| 47 | * <p> | |
| 48 | * The name is used to associated a type (and thus a view type service) with | |
| 49 | * a view instance through the view type name property. Thus must be unique | |
| 50 | * among all view types implemented | |
| 51 | * </p> | |
| 52 | * | |
| 53 | * @return ViewType view type name | |
| 54 | */ | |
| 55 | public ViewType getViewTypeName(); | |
| 56 | ||
| 57 | /** | |
| 58 | * Pulls values for the supported parameters from the views configured property values. These | |
| 59 | * name/value pairs are used to index the view for later retrieval | |
| 60 | * | |
| 61 | * @param propertyValues - property values configured on the view bean definition | |
| 62 | * @return Map<String, String> of parameters where map key is the parameter | |
| 63 | * name, and the map value is the parameter value | |
| 64 | */ | |
| 65 | public Map<String, String> getParametersFromViewConfiguration(PropertyValues propertyValues); | |
| 66 | ||
| 67 | /** | |
| 68 | * Pulls entries from the given map that are supported parameters for the view type. In addition, | |
| 69 | * defaults can be set or additional parameters set 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 | } |