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