View Javadoc

1   /**
2    * Copyright 2005-2012 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 org.apache.commons.lang.StringUtils;
19  import org.kuali.rice.krad.datadictionary.parse.BeanTag;
20  import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
21  
22  import java.io.Serializable;
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")
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       * @see org.kuali.rice.krad.datadictionary.DataDictionaryDefinition#completeValidation(java.lang.Class,
54       *      java.lang.Class)
55       */
56      public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) {
57          // No real validation to be done here other than perhaps checking to be
58          // sure that the security workgroup is a valid workgroup.
59      }
60  
61      /**
62       * @return
63       */
64      @BeanTagAttribute(name = "parameterName")
65      public String getParameterName() {
66          return parameterName;
67      }
68  
69      /**
70       * parameterName: name of the parameter that has the path to the help page
71       */
72      public void setParameterName(String parameterName) {
73          if (StringUtils.isBlank(parameterName)) {
74              throw new IllegalArgumentException("invalid (blank) parameterName");
75          }
76          this.parameterName = parameterName;
77      }
78  
79      /**
80       * @return
81       */
82      @BeanTagAttribute(name = "parameterNamespace")
83      public String getParameterNamespace() {
84          return parameterNamespace;
85      }
86  
87      /**
88       * parameterNamespace: namespace of the parameter that has the path to the help page
89       */
90      public void setParameterNamespace(String parameterNamespace) {
91          this.parameterNamespace = parameterNamespace;
92      }
93  
94      @BeanTagAttribute(name = "parameterDetailType")
95      public String getParameterDetailType() {
96          return this.parameterDetailType;
97      }
98  
99      /**
100      * parameterDetailType: detail type of the parameter that has the path to the help page
101      */
102     public void setParameterDetailType(String parameterDetailType) {
103         if (StringUtils.isBlank(parameterDetailType)) {
104             throw new IllegalArgumentException("invalid (blank) parameterDetailType");
105         }
106         this.parameterDetailType = parameterDetailType;
107     }
108 
109 }