Search in sources :

Example 1 with Series

use of uk.nhs.digital.ps.beans.Series in project hippo by NHS-digital-website.

the class RssModifier method getCategory.

private String getCategory(Publication publicationBean) {
    HippoBean parentDocument = publicationBean.getParentDocument();
    if (parentDocument instanceof Series) {
        Series series = (Series) parentDocument;
        StringBuilder category = new StringBuilder();
        try {
            if (series.getFullTaxonomyList() != null && series.getFullTaxonomyList().size() > 0) {
                category.append(Arrays.toString(series.getFullTaxonomyList().toArray()));
            }
        } catch (Exception ex) {
            LOGGER.warn(" Failed to get the Full Taxonomy.", ex.getMessage());
        }
        if (series.getInformationType() != null && series.getInformationType().length > 0) {
            category.append(Arrays.toString(series.getInformationType()));
        }
        if (series.getGranularity() != null && series.getGranularity().length > 0) {
            category.append(Arrays.toString(series.getGranularity()));
        }
        if (series.getGeographicCoverage() != null && series.getGeographicCoverage().length > 0) {
            category.append(Arrays.toString(Arrays.stream(series.getGeographicCoverage()).toArray()));
        }
        return category.toString();
    } else {
        return "";
    }
}
Also used : HippoBean(org.hippoecm.hst.content.beans.standard.HippoBean) Series(uk.nhs.digital.ps.beans.Series) FilterException(org.hippoecm.hst.content.beans.query.exceptions.FilterException) QueryException(org.hippoecm.hst.content.beans.query.exceptions.QueryException)

Aggregations

FilterException (org.hippoecm.hst.content.beans.query.exceptions.FilterException)1 QueryException (org.hippoecm.hst.content.beans.query.exceptions.QueryException)1 HippoBean (org.hippoecm.hst.content.beans.standard.HippoBean)1 Series (uk.nhs.digital.ps.beans.Series)1