Example usage for com.liferay.portal.kernel.xml Document addElement

List of usage examples for com.liferay.portal.kernel.xml Document addElement

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.xml Document addElement.

Prototype

public Element addElement(String qualifiedName, String namespaceURI);

Source Link

Usage

From source file:com.liferay.portlet.layoutsadmin.util.SitemapImpl.java

License:Open Source License

public String getSitemap(long groupId, boolean privateLayout, ThemeDisplay themeDisplay)
        throws PortalException, SystemException {

    Document document = SAXReaderUtil.createDocument();

    document.setXMLEncoding(StringPool.UTF8);

    Element rootElement = document.addElement("urlset", "http://www.google.com/schemas/sitemap/0.84");

    List<Layout> layouts = LayoutLocalServiceUtil.getLayouts(groupId, privateLayout,
            LayoutConstants.DEFAULT_PARENT_LAYOUT_ID);

    visitLayouts(rootElement, layouts, themeDisplay);

    return document.asXML();
}