001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.core.service;
017:
018: import java.util.Collection;
019: import java.util.List;
020:
021: import org.kuali.core.bo.BusinessObject;
022: import org.kuali.core.bo.BusinessObjectRelationship;
023: import org.kuali.core.datadictionary.RelationshipDefinition;
024:
025: /**
026: *
027: * This class provides Metadata about a specific BusinessObject. Depending on the circumstance or type
028: * of BO it will retrieve the data it needs from either the DataDictionary or through the
029: * PersistenceStructureService
030: */
031: public interface BusinessObjectMetaDataService {
032:
033: public BusinessObjectRelationship getBusinessObjectRelationship(
034: RelationshipDefinition ddReference, BusinessObject bo,
035: Class boClass, String attributeName,
036: String attributePrefix, boolean keysOnly);
037:
038: public RelationshipDefinition getBusinessObjectRelationshipDefinition(
039: Class c, String attributeName);
040:
041: public RelationshipDefinition getBusinessObjectRelationshipDefinition(
042: BusinessObject bo, String attributeName);
043:
044: /**
045: *
046: * This method returns a list of inquirable field names
047: * @param bo
048: * @return a collection of inquirable field names
049: */
050: public Collection<String> getInquirableFieldNames(Class boClass,
051: String sectionTitle);
052:
053: /**
054: *
055: * This method returns a list of lookupable fields
056: * @param bo
057: * @return a collection of lookupable fields
058: */
059: public List<String> getLookupableFieldNames(Class boClass);
060:
061: /**
062: *
063: * This method looks up the default value for a given attribute and
064: * returns it
065: * @param businessObjectClass
066: * @param attributeName
067: * @return default value for an attribute
068: */
069: public String getLookupFieldDefaultValue(Class businessObjectClass,
070: String attributeName);
071:
072: /**
073: *
074: * This method returns the value finder class for a given attribute
075: * @param businessObjectClass
076: * @param attributeName
077: * @return value finder class
078: */
079: public Class getLookupFieldDefaultValueFinderClass(
080: Class businessObjectClass, String attributeName);
081:
082: /**
083: *
084: * This method returns a list of collection names a business object contains
085: * @param bo
086: * @return
087: */
088: public Collection<String> getCollectionNames(BusinessObject bo);
089:
090: /**
091: *
092: * This method determines if a given field(attribute) is inquirable or not
093: * This handles both nested and non-nested attributes
094: * @param bo
095: * @param attributeName
096: * @param sectionTitle
097: * @return true if field is inquirable
098: */
099: public boolean isAttributeInquirable(Class boClass,
100: String attributeName, String sectionTitle);
101:
102: /**
103: *
104: * This method determines if a given business object is inquirable
105: * @param bo
106: * @return true if bo is inquirable
107: */
108: public boolean isInquirable(Class boClass);
109:
110: /**
111: *
112: * This method determines if a given field(attribute) is lookupable or not
113: * This handles both nested and non-nested attributes
114: * @param bo
115: * @param attributeName
116: * @return true if field is lookupable
117: */
118: public boolean isAttributeLookupable(Class boClass,
119: String attributeName);
120:
121: /**
122: *
123: * This method determines if a given business object is lookupable
124: * @param bo
125: * @return true if bo is lookupable
126: */
127: public boolean isLookupable(Class boClass);
128:
129: /**
130: *
131: * This method will return a class that is related to the parent BO (either through
132: * the DataDictionary or through the PersistenceStructureService)
133: * @param bo
134: * @param attributes
135: * @return related class
136: */
137: public BusinessObjectRelationship getBusinessObjectRelationship(
138: BusinessObject bo, String attributeName);
139:
140: public BusinessObjectRelationship getBusinessObjectRelationship(
141: BusinessObject bo, Class boClass, String attributeName,
142: String attributePrefix, boolean keysOnly);
143:
144: public List<BusinessObjectRelationship> getBusinessObjectRelationships(
145: BusinessObject bo);
146:
147: }
|