001/* 002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0 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 * 016 * Contributors: 017 * Nuxeo - initial API and implementation 018 * 019 * $Id$ 020 */ 021 022package org.nuxeo.ecm.platform.content.template.service; 023 024import java.io.Serializable; 025import java.util.ArrayList; 026import java.util.List; 027 028import org.nuxeo.common.xmap.annotation.XNode; 029import org.nuxeo.common.xmap.annotation.XNodeList; 030import org.nuxeo.common.xmap.annotation.XObject; 031 032/** 033 * Template item descriptor. Immutable. 034 */ 035@XObject(value = "templateItem") 036public class TemplateItemDescriptor implements Serializable { 037 038 private static final long serialVersionUID = 18765764747899L; 039 040 @XNode("@typeName") 041 private String typeName; 042 043 @XNode("@id") 044 private String id; 045 046 @XNode("@title") 047 private String title; 048 049 @XNode("@path") 050 private String path; 051 052 @XNode("@description") 053 private String description; 054 055 // Declared as ArrayList to be serializable. 056 @XNodeList(value = "acl/ace", type = ArrayList.class, componentType = ACEDescriptor.class) 057 public List<ACEDescriptor> acl; 058 059 @XNodeList(value = "properties/property", type = ArrayList.class, componentType = PropertyDescriptor.class) 060 public List<PropertyDescriptor> properties; 061 062 @XNodeList(value = "notifications/notification", type = ArrayList.class, componentType = NotificationDescriptor.class) 063 public List<NotificationDescriptor> notifications; 064 065 public String getPath() { 066 return path; 067 } 068 069 public String getDescription() { 070 return description; 071 } 072 073 public String getId() { 074 return id; 075 } 076 077 public String getTypeName() { 078 return typeName; 079 } 080 081 public String getTitle() { 082 return title; 083 } 084 085 public List<ACEDescriptor> getAcl() { 086 return acl; 087 } 088 089 public List<PropertyDescriptor> getProperties() { 090 return properties; 091 } 092 093 public List<NotificationDescriptor> getNotifications() { 094 return notifications; 095 } 096 097}