001    /**
002     * Copyright 2005-2011 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.workflow.attribute;
017    
018    import org.kuali.rice.kew.api.extension.ExtensionDefinition;
019    import org.kuali.rice.kew.rule.xmlrouting.StandardGenericXMLRuleAttribute;
020    import org.w3c.dom.Element;
021    
022    
023    /**
024     * This class extends the workflow xml rule attribute implementation to use the information in the data dictionary to generate labels.
025     * 
026     * @author Kuali Rice Team (rice.collab@kuali.org)
027     *
028     */
029    public class KualiXmlRuleAttributeImpl extends StandardGenericXMLRuleAttribute implements KualiXmlAttribute {
030            private static final long serialVersionUID = -3453451186396963835L;
031    
032        /**
033         * Constructs a KualiXmlRuleAttributeImpl.java.
034         */
035        public KualiXmlRuleAttributeImpl() {
036            super();
037        }
038    
039        /**
040         * This method overrides the super class and modifies the XML that it operates on to put the name and the title in the place
041         * where the super class expects to see them, even though they may no longer exist in the original XML.
042         * 
043         * @see org.kuali.rice.kew.rule.xmlrouting.StandardGenericXMLRuleAttribute#getConfigXML()
044         */
045        @Override
046        public Element getConfigXML() {
047            Element root = super.getConfigXML();
048            KualiXmlAttributeHelper attributeHelper = new KualiXmlAttributeHelper();
049            // this adds the name and title to the xml based on the data dictionary
050            return attributeHelper.processConfigXML(root);
051        }
052    
053        @Override
054        public Element getConfigXML(ExtensionDefinition extensionDefinition) {
055            return getConfigXML();
056        }
057    
058    }