001/*
002 * (C) Copyright 2010 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 *     Anahide Tchertchian
018 */
019package org.nuxeo.ecm.platform.forms.layout.demo.descriptors;
020
021import org.nuxeo.common.xmap.annotation.XNode;
022import org.nuxeo.common.xmap.annotation.XObject;
023import org.nuxeo.ecm.platform.forms.layout.demo.service.DemoLayout;
024import org.nuxeo.ecm.platform.forms.layout.demo.service.LayoutDemoManager;
025
026/**
027 * @author Anahide Tchertchian
028 */
029@XObject("layout")
030public class DemoLayoutDescriptor implements DemoLayout {
031
032    private static final long serialVersionUID = 1L;
033
034    @XNode("@name")
035    protected String name;
036
037    @XNode("@src")
038    protected String sourcePath;
039
040    @XNode("@isListing")
041    protected boolean listing = false;
042
043    @XNode("@hideViewMode")
044    protected boolean hideViewMode = false;
045
046    /**
047     * @since 7.2
048     */
049    @XNode("@hideEditMode")
050    protected boolean hideEditMode = false;
051
052    /**
053     * @since 7.2
054     */
055    @XNode("@addForm")
056    protected boolean addForm = true;
057
058    /**
059     * @since 7.2
060     */
061    @XNode("@useAjaxForm")
062    protected boolean useAjaxForm = true;
063
064    public String getName() {
065        return name;
066    }
067
068    public String getSourcePath() {
069        return LayoutDemoManager.APPLICATION_PATH + sourcePath;
070    }
071
072    public boolean isListing() {
073        return listing;
074    }
075
076    @Override
077    public boolean isHideViewMode() {
078        return hideViewMode;
079    }
080
081    @Override
082    public boolean isHideEditMode() {
083        return hideEditMode;
084    }
085
086    @Override
087    public boolean isAddForm() {
088        return addForm;
089    }
090
091    @Override
092    public boolean isUseAjaxForm() {
093        return useAjaxForm;
094    }
095
096}