View Javadoc

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