001/* 002 * Copyright 2011 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl1.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kim.impl.jaxb; 017 018import javax.xml.bind.annotation.XmlAccessType; 019import javax.xml.bind.annotation.XmlAccessorType; 020import javax.xml.bind.annotation.XmlElement; 021import javax.xml.bind.annotation.XmlType; 022 023/** 024 * This class represents the <permissionData> element. 025 * 026 * <p>The expected XML structure is as follows: 027 * 028 * <br> 029 * <br><permissionData> 030 * <br> <permissions> 031 * <br> <permission> 032 * <br> <permissionName namespaceCode=""></permissionName> 033 * <br> <templateName namespaceCode=""></templateName> 034 * <br> <description></description> 035 * <br> <active></active> 036 * <br> <permissionDetails> 037 * <br> <permissionDetail key=""></permissionDetail> 038 * <br> </permissionDetails> 039 * <br> </permission> 040 * <br> </permissions> 041 * <br></permissionData> 042 * 043 * <p>Note the following: 044 * <ul> 045 * <li>The <permissions> element is optional, and can contain zero or more <permission> elements. 046 * <li>The <permissionName> element and its "namespaceCode" attribute are both required. 047 * The namespace code must map to a valid namespace. 048 * If the name and namespace combo matches an existing permission, then the permission in the XML 049 * will overwrite the existing permission. 050 * <li>The <templateName> element and its "namespaceCode" attribute are both required. 051 * The name and namespace combo on this element must match a valid permission template. 052 * <li>The <description> element is required, and must be non-blank. 053 * <li>The <active> element is optional, and will be set to true if not specified. 054 * <li>The <permissionDetails> element is optional, and can contain zero or more 055 * <permissionDetail> elements. 056 * <li>The <permissionDetail> element's "key" attribute is required, and must be non-blank. 057 * Duplicate keys within a <permissionDetails> element are not permitted. 058 * <li>The same permission can be ingested multiple times in the same file, where subsequent ones will 059 * overwrite previous ones. (TODO: Is this acceptable?) 060 * </ul> 061 * 062 * TODO: Verify that the above behavior is correct. 063 * 064 * @author Kuali Rice Team (rice.collab@kuali.org) 065 */ 066@XmlAccessorType(XmlAccessType.FIELD) 067@XmlType(name="PermissionDataType", propOrder={"permissions"}) 068public class PermissionDataXmlDTO { 069 070 @XmlElement(name="permissions") 071 private PermissionsXmlDTO permissions; 072 073 public PermissionDataXmlDTO() {} 074 075 public PermissionDataXmlDTO(PermissionsXmlDTO permissions) { 076 this.permissions = permissions; 077 } 078 079 /** 080 * @return the permissions 081 */ 082 public PermissionsXmlDTO getPermissions() { 083 return this.permissions; 084 } 085 086 /** 087 * @param permissions the permissions to set 088 */ 089 public void setPermissions(PermissionsXmlDTO permissions) { 090 this.permissions = permissions; 091 } 092}