View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.rice.kim.impl.jaxb;
20  
21  import javax.xml.bind.annotation.XmlAccessType;
22  import javax.xml.bind.annotation.XmlAccessorType;
23  import javax.xml.bind.annotation.XmlElement;
24  import javax.xml.bind.annotation.XmlType;
25  
26  /**
27   * This class represents the &lt;permissionData&gt; element.
28   * 
29   * <p>The expected XML structure is as follows:
30   * 
31   * <br>
32   * <br>&lt;permissionData&gt;
33   * <br>&nbsp;&nbsp;&lt;permissions&gt;
34   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;permission&gt;
35   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionName namespaceCode=""&gt;&lt;/permissionName&gt;
36   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;templateName namespaceCode=""&gt;&lt;/templateName&gt;
37   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;&lt;/description&gt;
38   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;active&gt;&lt;/active&gt;
39   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionDetails&gt;
40   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionDetail key=""&gt;&lt;/permissionDetail&gt;
41   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/permissionDetails&gt;
42   * <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/permission&gt;
43   * <br>&nbsp;&nbsp;&lt;/permissions&gt;
44   * <br>&lt;/permissionData&gt;
45   * 
46   * <p>Note the following:
47   * <ul>
48   *   <li>The &lt;permissions&gt; element is optional, and can contain zero or more &lt;permission&gt; elements.
49   *   <li>The &lt;permissionName&gt; element and its "namespaceCode" attribute are both required.
50   *   The namespace code must map to a valid namespace.
51   *   If the name and namespace combo matches an existing permission, then the permission in the XML
52   *   will overwrite the existing permission.
53   *   <li>The &lt;templateName&gt; element and its "namespaceCode" attribute are both required.
54   *   The name and namespace combo on this element must match a valid permission template.
55   *   <li>The &lt;description&gt; element is required, and must be non-blank.
56   *   <li>The &lt;active&gt; element is optional, and will be set to true if not specified.
57   *   <li>The &lt;permissionDetails&gt; element is optional, and can contain zero or more
58   *   &lt;permissionDetail&gt; elements.
59   *   <li>The &lt;permissionDetail&gt; element's "key" attribute is required, and must be non-blank.
60   *   Duplicate keys within a &lt;permissionDetails&gt; element are not permitted.
61   *   <li>The same permission can be ingested multiple times in the same file, where subsequent ones will
62   *   overwrite previous ones. (TODO: Is this acceptable?)
63   * </ul>
64   * 
65   * TODO: Verify that the above behavior is correct.
66   * 
67   * @author Kuali Rice Team (rice.collab@kuali.org)
68   */
69  @XmlAccessorType(XmlAccessType.FIELD)
70  @XmlType(name="PermissionDataType", propOrder={"permissions"})
71  public class PermissionDataXmlDTO {
72  
73      @XmlElement(name="permissions")
74      private PermissionsXmlDTO permissions;
75      
76      public PermissionDataXmlDTO() {}
77      
78      public PermissionDataXmlDTO(PermissionsXmlDTO permissions) {
79          this.permissions = permissions;
80      }
81  
82      /**
83       * @return the permissions
84       */
85      public PermissionsXmlDTO getPermissions() {
86          return this.permissions;
87      }
88  
89      /**
90       * @param permissions the permissions to set
91       */
92      public void setPermissions(PermissionsXmlDTO permissions) {
93          this.permissions = permissions;
94      }
95  }