View Javadoc

1   /*
2    * Copyright 2007-2008 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;
17  
18  import java.util.ArrayList;
19  import java.util.HashMap;
20  import java.util.List;
21  import java.util.Map;
22  
23  
24  /**
25   * A container that holds all of the {@link WorkflowAttributeDefinition} for a document for both document searches
26   * and routing that depends on the values that exist on the document.
27   * 
28   * @author Kuali Rice Team (rice.collab@kuali.org)
29   *
30   */
31  public class WorkflowAttributes extends DataDictionaryDefinitionBase {
32      private static final long serialVersionUID = 6435015497886060280L;
33      
34  	private List<SearchingTypeDefinition> searchingTypeDefinitions;
35      private Map<String, RoutingTypeDefinition> routingTypeDefinitions;
36      
37      public WorkflowAttributes() {
38      	searchingTypeDefinitions = new ArrayList<SearchingTypeDefinition>();;
39      	routingTypeDefinitions = new HashMap<String, RoutingTypeDefinition>();
40      }
41      
42  	/**
43  	 * @return the searchingTypeDefinitions
44  	 */
45  	public List<SearchingTypeDefinition> getSearchingTypeDefinitions() {
46  		return this.searchingTypeDefinitions;
47  	}
48  
49  	/**
50  	 * @param searchingTypeDefinitions the searchingTypeDefinitions to set
51  	 */
52  	public void setSearchingTypeDefinitions(
53  			List<SearchingTypeDefinition> searchingTypeDefinitions) {
54  		this.searchingTypeDefinitions = searchingTypeDefinitions;
55  	}
56  
57  	public Map<String, RoutingTypeDefinition> getRoutingTypeDefinitions() {
58  		return this.routingTypeDefinitions;
59  	}
60  
61  	public void setRoutingTypeDefinitions(
62  			Map<String, RoutingTypeDefinition> routingTypeDefinitions) {
63  		this.routingTypeDefinitions = routingTypeDefinitions;
64  	}
65  
66  	/**
67  	 * This overridden method ...
68  	 * 
69  	 * @see org.kuali.rice.krad.datadictionary.DataDictionaryDefinition#completeValidation(java.lang.Class, java.lang.Class)
70  	 */
71  	public void completeValidation(Class rootBusinessObjectClass,
72  			Class otherBusinessObjectClass) {
73  		for (SearchingTypeDefinition definition : searchingTypeDefinitions) { 
74  			definition.completeValidation(rootBusinessObjectClass, otherBusinessObjectClass);
75  		}
76  		for (RoutingTypeDefinition definitions : routingTypeDefinitions.values()) {
77  			definitions.completeValidation(rootBusinessObjectClass, otherBusinessObjectClass);
78  		}
79  	}
80  
81  }