Example usage for com.liferay.portal.kernel.dao.search ResultRow addText

List of usage examples for com.liferay.portal.kernel.dao.search ResultRow addText

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.search ResultRow addText.

Prototype

public void addText(String name);

Source Link

Usage

From source file:jorgediazest.indexchecker.output.IndexCheckerOutput.java

License:Open Source License

protected static ResultRow generateSearchContainerRow(ResourceBundle resourceBundle, Comparison comp,
        String groupIdOutput, String groupNameOutput, String type, Locale locale, int numberOfRows,
        String output, String outputSize) {

    if (Validator.isNull(output)) {
        return null;
    }//ww w. j  a va  2s . c  om

    ResultRow row = new com.liferay.taglib.search.ResultRow(comp, type, numberOfRows);
    Model model = comp.getModel();

    String modelOutput = model.getName();
    String modelDisplayNameOutput = model.getDisplayName(locale);

    if ((groupIdOutput != null) && (groupNameOutput != null)) {
        row.addText(groupIdOutput);
        row.addText(groupNameOutput);
    }

    row.addText(HtmlUtil.escape(modelOutput));
    row.addText(HtmlUtil.escape(modelDisplayNameOutput));
    row.addText(HtmlUtil.escape(LanguageUtil.get(resourceBundle, "output." + type)).replace(" ", " "));
    row.addText(HtmlUtil.escape(outputSize));
    row.addText(HtmlUtil.escape(output));
    return row;
}

From source file:jorgediazest.missingrefchecker.output.MissingRefCheckerOutput.java

License:Open Source License

protected static ResultRow generateSearchContainerRowCheckReferences(PortletConfig portletConfig,
        MissingRefInfo missingRefInfo, Locale locale, int numberOfRows) {

    ResultRow row = new com.liferay.taglib.search.ResultRow(missingRefInfo,
            missingRefInfo.getReference().getOrigin(), numberOfRows);

    List<String> line = generateReferenceCells(locale, missingRefInfo.getReference(), false);

    for (String cell : line) {
        row.addText(HtmlUtil.escape(cell.replace(",", ", ").replace("#", " #").replace("_", " _")));
    }// w w w . j  av a2s .c o m

    Throwable throwable = missingRefInfo.getThrowable();
    Collection<String> missingReferences = missingRefInfo.getMissingReferences();

    if ((throwable != null) || (missingReferences == null)) {
        row.addText(HtmlUtil.escape("Error checking references"));
    }

    if (throwable != null) {
        row.addText(HtmlUtil.escape("EXCEPTION: " + throwable.getClass() + " - " + throwable.getMessage()));
    } else if (missingReferences != null) {
        row.addText(HtmlUtil.escape(StringUtil.merge(missingReferences).replace(",", ", ")));
        row.addText(StringPool.BLANK);
    }

    return row;
}

From source file:jorgediazest.missingrefchecker.output.MissingRefCheckerOutput.java

License:Open Source License

protected static ResultRow generateSearchContainerRowMappingList(PortletConfig portletConfig,
        Reference reference, Locale locale, int numberOfRows) {

    if (Validator.isNull(reference.getType())) {
        return null;
    }/*ww w .  j a  v  a  2s. co  m*/

    ResultRow row = new com.liferay.taglib.search.ResultRow(reference, reference.getOrigin(), numberOfRows);

    List<String> line = generateReferenceCells(locale, reference, true);

    for (String cell : line) {
        row.addText(HtmlUtil.escape(cell.replace(",", ", ")));
    }

    return row;
}