001/* 002 * The Kuali Financial System, a comprehensive financial management system for higher education. 003 * 004 * Copyright 2005-2014 The Kuali Foundation 005 * 006 * This program is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU Affero General Public License as 008 * published by the Free Software Foundation, either version 3 of the 009 * License, or (at your option) any later version. 010 * 011 * This program is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU Affero General Public License for more details. 015 * 016 * You should have received a copy of the GNU Affero General Public License 017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package org.kuali.rice.kim.impl.jaxb; 020 021import javax.xml.bind.annotation.XmlAccessType; 022import javax.xml.bind.annotation.XmlAccessorType; 023import javax.xml.bind.annotation.XmlElement; 024import javax.xml.bind.annotation.XmlType; 025 026/** 027 * This class represents the <permissionData> element. 028 * 029 * <p>The expected XML structure is as follows: 030 * 031 * <br> 032 * <br><permissionData> 033 * <br> <permissions> 034 * <br> <permission> 035 * <br> <permissionName namespaceCode=""></permissionName> 036 * <br> <templateName namespaceCode=""></templateName> 037 * <br> <description></description> 038 * <br> <active></active> 039 * <br> <permissionDetails> 040 * <br> <permissionDetail key=""></permissionDetail> 041 * <br> </permissionDetails> 042 * <br> </permission> 043 * <br> </permissions> 044 * <br></permissionData> 045 * 046 * <p>Note the following: 047 * <ul> 048 * <li>The <permissions> element is optional, and can contain zero or more <permission> elements. 049 * <li>The <permissionName> element and its "namespaceCode" attribute are both required. 050 * The namespace code must map to a valid namespace. 051 * If the name and namespace combo matches an existing permission, then the permission in the XML 052 * will overwrite the existing permission. 053 * <li>The <templateName> element and its "namespaceCode" attribute are both required. 054 * The name and namespace combo on this element must match a valid permission template. 055 * <li>The <description> element is required, and must be non-blank. 056 * <li>The <active> element is optional, and will be set to true if not specified. 057 * <li>The <permissionDetails> element is optional, and can contain zero or more 058 * <permissionDetail> elements. 059 * <li>The <permissionDetail> element's "key" attribute is required, and must be non-blank. 060 * Duplicate keys within a <permissionDetails> element are not permitted. 061 * <li>The same permission can be ingested multiple times in the same file, where subsequent ones will 062 * overwrite previous ones. (TODO: Is this acceptable?) 063 * </ul> 064 * 065 * TODO: Verify that the above behavior is correct. 066 * 067 * @author Kuali Rice Team (rice.collab@kuali.org) 068 */ 069@XmlAccessorType(XmlAccessType.FIELD) 070@XmlType(name="PermissionDataType", propOrder={"permissions"}) 071public class PermissionDataXmlDTO { 072 073 @XmlElement(name="permissions") 074 private PermissionsXmlDTO permissions; 075 076 public PermissionDataXmlDTO() {} 077 078 public PermissionDataXmlDTO(PermissionsXmlDTO permissions) { 079 this.permissions = permissions; 080 } 081 082 /** 083 * @return the permissions 084 */ 085 public PermissionsXmlDTO getPermissions() { 086 return this.permissions; 087 } 088 089 /** 090 * @param permissions the permissions to set 091 */ 092 public void setPermissions(PermissionsXmlDTO permissions) { 093 this.permissions = permissions; 094 } 095}