1 /** 2 * Copyright 2005-2013 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><permissionData> 30 * <br> <permissions> 31 * <br> <permission> 32 * <br> <permissionName namespaceCode=""></permissionName> 33 * <br> <templateName namespaceCode=""></templateName> 34 * <br> <description></description> 35 * <br> <active></active> 36 * <br> <permissionDetails> 37 * <br> <permissionDetail key=""></permissionDetail> 38 * <br> </permissionDetails> 39 * <br> </permission> 40 * <br> </permissions> 41 * <br></permissionData> 42 * 43 * <p>Note the following: 44 * <ul> 45 * <li>The <permissions> element is optional, and can contain zero or more <permission> elements. 46 * <li>The <permissionName> 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 <templateName> 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 <description> element is required, and must be non-blank. 53 * <li>The <active> element is optional, and will be set to true if not specified. 54 * <li>The <permissionDetails> element is optional, and can contain zero or more 55 * <permissionDetail> elements. 56 * <li>The <permissionDetail> element's "key" attribute is required, and must be non-blank. 57 * Duplicate keys within a <permissionDetails> 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 }