001    /**
002     * Copyright 2005-2013 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.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/ecl2.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.rice.krad.datadictionary;
017    
018    import org.kuali.rice.krad.datadictionary.parse.BeanTag;
019    import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
020    import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase;
021    
022    import java.util.ArrayList;
023    import java.util.HashMap;
024    import java.util.List;
025    import java.util.Map;
026    
027    /**
028     * A container that holds all of the {@link WorkflowAttributeDefinition} for a document for both document searches
029     * and routing that depends on the values that exist on the document.
030     *
031     * @author Kuali Rice Team (rice.collab@kuali.org)
032     */
033    @BeanTag(name = "workflowAttributes-bean")
034    public class WorkflowAttributes extends UifDictionaryBeanBase {
035        private static final long serialVersionUID = 6435015497886060280L;
036    
037        private List<SearchingTypeDefinition> searchingTypeDefinitions;
038        private Map<String, RoutingTypeDefinition> routingTypeDefinitions;
039    
040        public WorkflowAttributes() {
041            searchingTypeDefinitions = new ArrayList<SearchingTypeDefinition>();
042            ;
043            routingTypeDefinitions = new HashMap<String, RoutingTypeDefinition>();
044        }
045    
046        /**
047         * @return the searchingTypeDefinitions
048         */
049        @BeanTagAttribute(name = "searchingTypeDefinitions", type = BeanTagAttribute.AttributeType.LISTBEAN)
050        public List<SearchingTypeDefinition> getSearchingTypeDefinitions() {
051            return this.searchingTypeDefinitions;
052        }
053    
054        /**
055         * @param searchingTypeDefinitions the searchingTypeDefinitions to set
056         */
057        public void setSearchingTypeDefinitions(List<SearchingTypeDefinition> searchingTypeDefinitions) {
058            this.searchingTypeDefinitions = searchingTypeDefinitions;
059        }
060    
061        @BeanTagAttribute(name = "routingTypeDefinitions", type = BeanTagAttribute.AttributeType.MAPBEAN)
062        public Map<String, RoutingTypeDefinition> getRoutingTypeDefinitions() {
063            return this.routingTypeDefinitions;
064        }
065    
066        public void setRoutingTypeDefinitions(Map<String, RoutingTypeDefinition> routingTypeDefinitions) {
067            this.routingTypeDefinitions = routingTypeDefinitions;
068        }
069    
070        /**
071         * This overridden method ...
072         *
073         * @see org.kuali.rice.krad.datadictionary.DataDictionaryDefinition#completeValidation(java.lang.Class,
074         *      java.lang.Class)
075         */
076        public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) {
077            for (SearchingTypeDefinition definition : searchingTypeDefinitions) {
078                definition.completeValidation(rootBusinessObjectClass, otherBusinessObjectClass);
079            }
080            for (RoutingTypeDefinition definitions : routingTypeDefinitions.values()) {
081                definitions.completeValidation(rootBusinessObjectClass, otherBusinessObjectClass);
082            }
083        }
084    
085    }