View Javadoc
1   /**
2    * Copyright 2005-2014 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.kns.service;
17  
18  import org.kuali.rice.krad.bo.BusinessObject;
19  import org.kuali.rice.krad.bo.DataObjectRelationship;
20  import org.kuali.rice.krad.datadictionary.RelationshipDefinition;
21  import org.kuali.rice.krad.valuefinder.ValueFinder;
22  import org.kuali.rice.krad.service.DataObjectMetaDataService;
23  
24  import java.util.Collection;
25  import java.util.List;
26  import java.util.Map;
27  
28  /**
29   * Provides Metadata about a specific BusinessObject. Depending on the circumstance or type
30   * of BO it will retrieve the data it needs from either the DataDictionary or through the
31   * PersistenceStructureService
32   * 
33   * @author Kuali Rice Team (rice.collab@kuali.org)
34   *
35   * @deprecated use {@link org.kuali.rice.krad.data.metadata.MetadataRepository}
36   */
37  @Deprecated
38  public interface BusinessObjectMetaDataService extends DataObjectMetaDataService {
39  
40  	public DataObjectRelationship getBusinessObjectRelationship(RelationshipDefinition ddReference,
41              Object bo, Class boClass, String attributeName, String attributePrefix, boolean keysOnly);
42  
43  	public RelationshipDefinition getBusinessObjectRelationshipDefinition(Class c, String attributeName);
44  
45  	public RelationshipDefinition getBusinessObjectRelationshipDefinition(Object bo, String attributeName);
46  
47  	/**
48  	 * 
49  	 * This method returns a list of inquirable field names
50  	 * 
51  	 * @param bo
52  	 * @return a collection of inquirable field names
53  	 */
54  	public Collection<String> getInquirableFieldNames(Class boClass, String sectionTitle);
55  
56  	/**
57  	 * 
58  	 * This method returns a list of lookupable fields
59  	 * 
60  	 * @param bo
61  	 * @return a collection of lookupable fields
62  	 */
63  	public List<String> getLookupableFieldNames(Class boClass);
64  
65  	/**
66  	 * 
67  	 * This method looks up the default value for a given attribute and returns
68  	 * it
69  	 * 
70  	 * @param businessObjectClass
71  	 * @param attributeName
72  	 * @return default value for an attribute
73  	 */
74  	public String getLookupFieldDefaultValue(Class businessObjectClass, String attributeName);
75  
76  	/**
77  	 * 
78  	 * This method returns the value finder class for a given attribute
79  	 * 
80  	 * @param businessObjectClass
81  	 * @param attributeName
82  	 * @return value finder class
83  	 */
84  	public Class getLookupFieldDefaultValueFinderClass(Class businessObjectClass, String attributeName);
85  
86  	/**
87  	 * 
88  	 * This method looks up the quickfinder parameter string for a given
89  	 * attribute and returns it. See
90  	 * {@link org.kuali.rice.kns.datadictionary.FieldDefinition#getQuickfinderParameterString()}.
91  	 * 
92  	 * @param businessObjectClass
93  	 * @param attributeName
94  	 * @return default values for attributes
95  	 */
96  	public String getLookupFieldQuickfinderParameterString(Class businessObjectClass, String attributeName);
97  
98  	/**
99  	 * This method returns the quickfinder parameter string builder class for a
100 	 * given attribute. See
101 	 * {@link org.kuali.rice.kns.datadictionary.FieldDefinition#getQuickfinderParameterStringBuilderClass()}.
102 	 * 
103 	 * @param businessObjectClass
104 	 * @param attributeName
105 	 * @return value finder class
106 	 */
107 	public Class<? extends ValueFinder> getLookupFieldQuickfinderParameterStringBuilderClass(Class businessObjectClass,
108 			String attributeName);
109 
110 	/**
111 	 * 
112 	 * This method returns a list of collection names a business object contains
113 	 * 
114 	 * @param bo
115 	 * @return
116 	 */
117 	public Collection<String> getCollectionNames(Object bo);
118 
119 	/**
120 	 * 
121 	 * This method determines if a given field(attribute) is inquirable or not
122 	 * This handles both nested and non-nested attributes
123 	 * 
124 	 * @param bo
125 	 * @param attributeName
126 	 * @param sectionTitle
127 	 * @return true if field is inquirable
128 	 */
129 	public boolean isAttributeInquirable(Class boClass, String attributeName, String sectionTitle);
130 
131 	/**
132 	 * 
133 	 * This method determines if a given business object is inquirable
134 	 * 
135 	 * @param bo
136 	 * @return true if bo is inquirable
137 	 */
138 	public boolean isInquirable(Class boClass);
139 
140 	/**
141 	 * 
142 	 * This method determines if a given field(attribute) is lookupable or not
143 	 * This handles both nested and non-nested attributes
144 	 * 
145 	 * @param bo
146 	 * @param attributeName
147 	 * @return true if field is lookupable
148 	 */
149 	public boolean isAttributeLookupable(Class boClass, String attributeName);
150 
151 	/**
152 	 * 
153 	 * This method determines if a given business object is lookupable
154 	 * 
155 	 * @param bo
156 	 * @return true if bo is lookupable
157 	 */
158 	public boolean isLookupable(Class boClass);
159 
160 	/**
161 	 * 
162 	 * This method will return a class that is related to the parent BO (either
163 	 * through the DataDictionary or through the PersistenceStructureService)
164 	 * 
165 	 * @param bo
166 	 * @param attributes
167 	 * @return related class
168 	 */
169 	@Deprecated
170 	public DataObjectRelationship getBusinessObjectRelationship(Object bo, String attributeName);
171 
172 	@Deprecated
173 	public DataObjectRelationship getBusinessObjectRelationship(Object bo, Class boClass,
174 			String attributeName, String attributePrefix, boolean keysOnly);
175 
176 
177 
178 	/**
179 	 * Get all the business object relationships for the given business object.
180 	 * These relationships may be defined at the ORM-layer or within the data
181 	 * dictionary.
182 	 */
183 	@Deprecated
184 	public List<DataObjectRelationship> getBusinessObjectRelationships(Object bo);
185 
186 	/**
187 	 * Get all the business object relationships for the given class. These
188 	 * relationships may be defined at the ORM-layer or within the data
189 	 * dictionary.
190 	 */
191 	@Deprecated
192 	public List<DataObjectRelationship> getBusinessObjectRelationships(Class<? extends Object> boClass);
193 
194 	/**
195 	 * This method accepts a business object and one of its foreign key
196 	 * attribute names. It returns a map that has a foreign key attribute name
197 	 * as a key and its respective related class as value. If the passed in
198 	 * attributeName is not a foreign key, this method will return an empty map.
199 	 * 
200 	 * @param Object
201 	 *            businessObject
202 	 * @param String
203 	 *            attributeName
204 	 * @return Map<String, Class>
205 	 */
206 	@Deprecated
207 	public Map<String, Class> getReferencesForForeignKey(Object businessObject, String attributeName);
208 
209 	/**
210 	 * 
211 	 * This method ...
212 	 * 
213 	 * @param businessObjectClass
214 	 * @param attributeName
215 	 * @param targetName
216 	 * @return
217 	 */
218 	@Deprecated
219 	public String getForeignKeyFieldName(Class businessObjectClass, String attributeName, String targetName);
220 }