001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.sharepoint.dws;
016    
017    import com.liferay.portal.kernel.xml.Element;
018    import com.liferay.portal.model.Role;
019    
020    /**
021     * @author Bruno Farache
022     */
023    public class RoleResponseElement implements ResponseElement {
024    
025            public RoleResponseElement(Role role) {
026                    _name = role.getName();
027                    _description = role.getDescription();
028                    _type = role.getTypeLabel();
029            }
030    
031            public void addElement(Element rootEl) {
032                    Element el = rootEl.addElement("Role");
033    
034                    el.addAttribute("Name", _name);
035                    el.addAttribute("Description", _description);
036                    el.addAttribute("Type", _type);
037            }
038    
039            private String _name;
040            private String _description;
041            private String _type;
042    
043    }