1 /** 2 * Copyright 2005-2013 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.datadictionary.uif; 17 18 import org.kuali.rice.krad.datadictionary.DictionaryBean; 19 20 import java.util.Map; 21 22 /** 23 * Marks any class that can be configured through the UIF dictionary 24 * 25 * <p> 26 * Indicates behavior that must be supported by an Class that can be configured through 27 * the UIF dictionary, such as property expressions. 28 * </p> 29 * 30 * @author Kuali Rice Team (rice.collab@kuali.org) 31 */ 32 public interface UifDictionaryBean extends DictionaryBean { 33 34 /** 35 * Map of expressions that were configured for the object's graph 36 * 37 * <p> 38 * During processing of the UIF configuration, expressions are pulled out and placed into this map for the 39 * component graph. A component graph contains the component and all one to one nested components (but not those 40 * that are contained in collections, each of these begins another graph). The expressions are placed at the root 41 * component level instead of the actual nested component for handling of nested property configuration and 42 * overridding 43 * </p> 44 * 45 * <p> 46 * The expression graph map key gives the property name (possibly nested) the expression was configured on, and the 47 * map value gives the expression. During the view lifecycle, 48 * see {@link org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl#performComponentApplyModel(org.kuali.rice.krad.uif.view.View, 49 * org.kuali.rice.krad.uif.component.Component, java.lang.Object)}, 50 * the expressions are moved to the {@link #getPropertyExpressions()} map for the configurable they should be 51 * evaluated on 52 * </p> 53 * 54 * @return Map<String, String> map of expressions contained on the configurable graph 55 */ 56 public Map<String, String> getExpressionGraph(); 57 58 /** 59 * Setter for the map of expressions contained on the configurable graph 60 * 61 * @param expressionGraph 62 */ 63 public void setExpressionGraph(Map<String, String> expressionGraph); 64 65 /** 66 * Map of expressions that should apply when the component is refresh 67 * 68 * <p> 69 * Expressions may exist on a parent component that impact the component state when it is being refreshed. These 70 * expressions are pulled out and placed into this map for evaluation during the refresh process 71 * </p> 72 * 73 * @return Map<String, String> key is property name to set and value is the expression to evaluate 74 */ 75 public Map<String, String> getRefreshExpressionGraph(); 76 77 /** 78 * Setter for the component's refresh expression graph 79 * 80 * @param refreshExpressionGraph 81 */ 82 public void setRefreshExpressionGraph(Map<String, String> refreshExpressionGraph); 83 84 /** 85 * Map of expressions that should be evaluated to conditionally set a property on the component 86 * 87 * <p> 88 * When configuring a component property through XML an expression can be given using the @{} placeholder. During 89 * the loading of the XML any such expressions are captured and placed into this Map, with the property they apply 90 * to set as the Map key. The expressions are then evaluated during the apply model phase and the result is set as 91 * the property value. 92 * </p> 93 * 94 * <p> 95 * Note after the expression is picked up, the property configuration is removed. Thus the property in the 96 * component will only have its default object value until the expression is evaluated 97 * </p> 98 * 99 * @return Map<String, String> map of expressions where key is property name and value is expression to evaluate 100 */ 101 public Map<String, String> getPropertyExpressions(); 102 103 /** 104 * Setter for the Map of property expressions 105 * 106 * @param propertyExpressions 107 */ 108 public void setPropertyExpressions(Map<String, String> propertyExpressions); 109 110 /** 111 * Returns the expression configured for the property with the given name 112 * 113 * @return String expression for property or null if expression is not configured 114 * @see org.kuali.rice.krad.uif.component.Component#getPropertyExpressions() 115 */ 116 public String getPropertyExpression(String propertyName); 117 }