001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (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 *     Nuxeo - initial API and implementation
016 *
017 * $Id: DirectoryEntryOutputTag.java 26053 2007-10-16 01:45:43Z atchertchian $
018 */
019
020package org.nuxeo.ecm.platform.ui.web.directory;
021
022import javax.faces.application.Application;
023import javax.faces.component.UIComponent;
024import javax.faces.context.FacesContext;
025import javax.faces.el.ValueBinding;
026import javax.faces.webapp.UIComponentTag;
027
028/**
029 * Tag for directory entry component.
030 *
031 * @author <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a>
032 * @deprecated facelets do not use the tag class
033 */
034@Deprecated
035public class DirectoryEntryOutputTag extends UIComponentTag {
036
037    /**
038     * @deprecated standard value attribute should be used instead
039     */
040    @Deprecated
041    protected String entryId;
042
043    protected String directoryName;
044
045    protected Boolean displayIdAndLabel;
046
047    protected Boolean translate;
048
049    /**
050     * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
051     */
052    @Override
053    protected void setProperties(UIComponent component) {
054        super.setProperties(component);
055        component.getAttributes().put("displayIdAndLabel", displayIdAndLabel);
056        component.getAttributes().put("translate", translate);
057        FacesContext context = FacesContext.getCurrentInstance();
058        Application application = context.getApplication();
059        ValueBinding binding = application.createValueBinding(entryId);
060        component.setValueBinding("entryId", binding);
061        binding = application.createValueBinding(directoryName);
062        component.setValueBinding("directoryName", binding);
063    }
064
065    /**
066     * @see javax.faces.webapp.UIComponentTag#getComponentType()
067     */
068    @Override
069    public String getComponentType() {
070        return "nxdirectory.DirectoryEntryOutput";
071    }
072
073    /**
074     * @see javax.faces.webapp.UIComponentTag#getRendererType()
075     */
076    @Override
077    public String getRendererType() {
078        return null;
079    }
080
081    public String getDirectoryName() {
082        return directoryName;
083    }
084
085    public void setDirectoryName(String directoryName) {
086        this.directoryName = directoryName;
087    }
088
089    public Boolean getDisplayIdAndLabel() {
090        return displayIdAndLabel;
091    }
092
093    public void setDisplayIdAndLabel(Boolean displayIdAndLabel) {
094        this.displayIdAndLabel = displayIdAndLabel;
095    }
096
097    public Boolean getTranslate() {
098        return translate;
099    }
100
101    public void setTranslate(Boolean translate) {
102        this.translate = translate;
103    }
104
105}