001/* 002 * (C) Copyright 2010 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Anahide Tchertchian 016 */ 017package org.nuxeo.ecm.platform.forms.layout.demo.descriptors; 018 019import org.nuxeo.common.xmap.annotation.XNode; 020import org.nuxeo.common.xmap.annotation.XObject; 021import org.nuxeo.ecm.platform.forms.layout.demo.service.DemoLayout; 022import org.nuxeo.ecm.platform.forms.layout.demo.service.LayoutDemoManager; 023 024/** 025 * @author Anahide Tchertchian 026 */ 027@XObject("layout") 028public class DemoLayoutDescriptor implements DemoLayout { 029 030 private static final long serialVersionUID = 1L; 031 032 @XNode("@name") 033 protected String name; 034 035 @XNode("@src") 036 protected String sourcePath; 037 038 @XNode("@isListing") 039 protected boolean listing = false; 040 041 @XNode("@hideViewMode") 042 protected boolean hideViewMode = false; 043 044 /** 045 * @since 7.2 046 */ 047 @XNode("@hideEditMode") 048 protected boolean hideEditMode = false; 049 050 /** 051 * @since 7.2 052 */ 053 @XNode("@addForm") 054 protected boolean addForm = true; 055 056 /** 057 * @since 7.2 058 */ 059 @XNode("@useAjaxForm") 060 protected boolean useAjaxForm = true; 061 062 public String getName() { 063 return name; 064 } 065 066 public String getSourcePath() { 067 return LayoutDemoManager.APPLICATION_PATH + sourcePath; 068 } 069 070 public boolean isListing() { 071 return listing; 072 } 073 074 @Override 075 public boolean isHideViewMode() { 076 return hideViewMode; 077 } 078 079 @Override 080 public boolean isHideEditMode() { 081 return hideEditMode; 082 } 083 084 @Override 085 public boolean isAddForm() { 086 return addForm; 087 } 088 089 @Override 090 public boolean isUseAjaxForm() { 091 return useAjaxForm; 092 } 093 094}