001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }