View Javadoc
1   /**
2    * Copyright 2005-2014 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 java.io.Serializable;
19  
20  import org.apache.commons.lang.StringUtils;
21  import org.kuali.rice.krad.datadictionary.parse.BeanTag;
22  import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
23  
24  /**
25   * The help element provides the keys to obtain a
26   * help description from the database.
27   *
28   * On document JSP pages, a help icon may be rendered.  If this tag is specified, then
29   * the filename of this page will be located in the value of the parameter specified by the namespace, detail type, and
30   * name.
31   *
32   * The value of the parameter is relative to the value of the "externalizable.help.url" property in
33   * ConfigurationService
34   * (see KualiHelpAction).
35   * parameterNamespace: namespace of the parameter that has the path to the help page
36   * parameterName: name of the parameter that has the path to the help page
37   * parameterDetailType: detail type of the parameter that has the path to the help page
38   */
39  @BeanTag(name = "helpDefinition-bean")
40  public class HelpDefinition extends DataDictionaryDefinitionBase implements Serializable {
41      private static final long serialVersionUID = -6869646654597012863L;
42  
43      protected String parameterNamespace;
44      protected String parameterDetailType;
45      protected String parameterName;
46  
47      /**
48       * Constructs a HelpDefinition.
49       */
50      public HelpDefinition() {}
51  
52      /**
53       * @return parameter name
54       */
55      @BeanTagAttribute(name = "parameterName")
56      public String getParameterName() {
57          return parameterName;
58      }
59  
60      /**
61       * @param parameterName name of the parameter that has the path to the help page
62       */
63      public void setParameterName(String parameterName) {
64          if (StringUtils.isBlank(parameterName)) {
65              throw new IllegalArgumentException("invalid (blank) parameterName");
66          }
67          this.parameterName = parameterName;
68      }
69  
70      /**
71       * @return parameter namespace
72       */
73      @BeanTagAttribute(name = "parameterNamespace")
74      public String getParameterNamespace() {
75          return parameterNamespace;
76      }
77  
78      /**
79       * parameterNamespace: namespace of the parameter that has the path to the help page
80       */
81      public void setParameterNamespace(String parameterNamespace) {
82          this.parameterNamespace = parameterNamespace;
83      }
84  
85      @BeanTagAttribute(name = "parameterDetailType")
86      public String getParameterDetailType() {
87          return this.parameterDetailType;
88      }
89  
90      /**
91       * parameterDetailType: detail type of the parameter that has the path to the help page
92       */
93      public void setParameterDetailType(String parameterDetailType) {
94          if (StringUtils.isBlank(parameterDetailType)) {
95              throw new IllegalArgumentException("invalid (blank) parameterDetailType");
96          }
97          this.parameterDetailType = parameterDetailType;
98      }
99  
100 }