Example usage for com.liferay.portal.kernel.xml Element attributeValue

List of usage examples for com.liferay.portal.kernel.xml Element attributeValue

Introduction

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

Prototype

public String attributeValue(String name, String defaultValue);

Source Link

Usage

From source file:org.xcolab.portlets.search.Indexer.java

License:Open Source License

private static void _getIndexableContent(StringBuilder sb, Element root) throws Exception {

    for (Element el : root.elements()) {
        String elType = el.attributeValue("type", StringPool.BLANK);

        if (elType.equals("text") || elType.equals("text_box") || elType.equals("text_area")) {

            for (Element dynamicContent : el.elements("dynamic-content")) {
                String text = dynamicContent.getText();

                sb.append(text);/*from   w  w  w .ja v  a2 s  . c om*/
                sb.append(StringPool.SPACE);
            }
        } else if (el.getName().equals("static-content")) {
            String text = el.getText();

            sb.append(text);
            sb.append(StringPool.SPACE);
        }

        _getIndexableContent(sb, el);
    }
}