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.datadictionary;
017    
018    import org.apache.commons.lang.StringUtils;
019    
020    import java.io.Serializable;
021    
022    /**
023                The help element provides the keys to obtain a
024                help description from the database.
025    
026                On document JSP pages, a help icon may be rendered.  If this tag is specified, then
027                the filename of this page will be located in the value of the parameter specified by the namespace, detail type, and name.
028    
029                The value of the parameter is relative to the value of the "externalizable.help.url" property in ConfigurationService (see KualiHelpAction).
030                parameterNamespace: namespace of the parameter that has the path to the help page
031                parameterName: name of the parameter that has the path to the help page
032                parameterDetailType: detail type of the parameter that has the path to the help page
033     */
034    public class HelpDefinition extends DataDictionaryDefinitionBase implements Serializable {
035        private static final long serialVersionUID = -6869646654597012863L;
036        
037            protected String parameterNamespace;
038        protected String parameterDetailType;
039        protected String parameterName;
040    
041        /**
042         * Constructs a HelpDefinition.
043         */
044        public HelpDefinition() {}
045    
046        /**
047         * @see org.kuali.rice.krad.datadictionary.DataDictionaryDefinition#completeValidation(java.lang.Class, java.lang.Class)
048         */
049        public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) {
050            // No real validation to be done here other than perhaps checking to be
051            // sure that the security workgroup is a valid workgroup.
052        }
053    
054        /**
055         * @return
056         */
057        public String getParameterName() {
058            return parameterName;
059        }
060    
061        /**
062         * parameterName: name of the parameter that has the path to the help page
063         */
064        public void setParameterName(String parameterName) {
065            if (StringUtils.isBlank(parameterName)) {
066                throw new IllegalArgumentException("invalid (blank) parameterName");
067            }
068            this.parameterName = parameterName;
069        }
070    
071        /**
072         * @return
073         */
074        public String getParameterNamespace() {
075            return parameterNamespace;
076        }
077    
078        /**
079         * parameterNamespace: namespace of the parameter that has the path to the help page
080         */
081        public void setParameterNamespace(String parameterNamespace) {
082            if (StringUtils.isBlank(parameterNamespace)) {
083                throw new IllegalArgumentException("invalid (blank) parameterNamespace");
084            }
085            this.parameterNamespace = parameterNamespace;
086        }
087    
088            public String getParameterDetailType() {
089                    return this.parameterDetailType;
090            }
091    
092            /**
093             * parameterDetailType: detail type of the parameter that has the path to the help page
094             */
095            public void setParameterDetailType(String parameterDetailType) {
096            if (StringUtils.isBlank(parameterDetailType)) {
097                throw new IllegalArgumentException("invalid (blank) parameterDetailType");
098            }
099                    this.parameterDetailType = parameterDetailType;
100            }
101    
102    }