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.kim.impl.jaxb;
17  
18  import javax.xml.bind.annotation.XmlAccessType;
19  import javax.xml.bind.annotation.XmlAccessorType;
20  import javax.xml.bind.annotation.XmlElement;
21  import javax.xml.bind.annotation.XmlType;
22  
23  /**
24   * This class represents the <permissionData> element.
25   * 
26   * <p>The expected XML structure is as follows:
27   * 
28   * <br>
29   * <br>&lt;permissionData&gt;
30   * <br>&nbsp;&nbsp;&lt;permissions&gt;
31   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;permission&gt;
32   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionName namespaceCode=""&gt;&lt;/permissionName&gt;
33   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;templateName namespaceCode=""&gt;&lt;/templateName&gt;
34   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;&lt;/description&gt;
35   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;active&gt;&lt;/active&gt;
36   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionDetails&gt;
37   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionDetail key=""&gt;&lt;/permissionDetail&gt;
38   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/permissionDetails&gt;
39   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/permission&gt;
40   * <br>&nbsp;&nbsp;&lt;/permissions&gt;
41   * <br>&lt;/permissionData&gt;
42   * 
43   * <p>Note the following:
44   * <ul>
45   *   <li>The &lt;permissions&gt; element is optional, and can contain zero or more &lt;permission&gt; elements.
46   *   <li>The &lt;permissionName&gt; element and its "namespaceCode" attribute are both required.
47   *   The namespace code must map to a valid namespace.
48   *   If the name and namespace combo matches an existing permission, then the permission in the XML
49   *   will overwrite the existing permission.
50   *   <li>The &lt;templateName&gt; element and its "namespaceCode" attribute are both required.
51   *   The name and namespace combo on this element must match a valid permission template.
52   *   <li>The &lt;description&gt; element is required, and must be non-blank.
53   *   <li>The &lt;active&gt; element is optional, and will be set to true if not specified.
54   *   <li>The &lt;permissionDetails&gt; element is optional, and can contain zero or more
55   *   &lt;permissionDetail&gt; elements.
56   *   <li>The &lt;permissionDetail&gt; element's "key" attribute is required, and must be non-blank.
57   *   Duplicate keys within a &lt;permissionDetails&gt; element are not permitted.
58   *   <li>The same permission can be ingested multiple times in the same file, where subsequent ones will
59   *   overwrite previous ones. (TODO: Is this acceptable?)
60   * </ul>
61   * 
62   * TODO: Verify that the above behavior is correct.
63   * 
64   * @author Kuali Rice Team (rice.collab@kuali.org)
65   */
66  @XmlAccessorType(XmlAccessType.FIELD)
67  @XmlType(name="PermissionDataType", propOrder={"permissions"})
68  public class PermissionDataXmlDTO {
69  
70      @XmlElement(name="permissions")
71      private PermissionsXmlDTO permissions;
72      
73      public PermissionDataXmlDTO() {}
74      
75      public PermissionDataXmlDTO(PermissionsXmlDTO permissions) {
76          this.permissions = permissions;
77      }
78  
79      /**
80       * @return the permissions
81       */
82      public PermissionsXmlDTO getPermissions() {
83          return this.permissions;
84      }
85  
86      /**
87       * @param permissions the permissions to set
88       */
89      public void setPermissions(PermissionsXmlDTO permissions) {
90          this.permissions = permissions;
91      }
92  }