Search in sources :

Example 1 with LocalRsrc

use of org.asqatasun.contentadapter.util.LocalRsrc in project Asqatasun by Asqatasun.

the class CSSJsoupPhlocContentAdapterImpl method adaptLocaleCSS.

/**
     * Retrieve css content and adapt it for each locale resource 
     */
private void adaptLocaleCSS() {
    Set<Long> relatedCssIdSet = new HashSet<>();
    for (Element el : localeCssElements) {
        Resource cssResource;
        String rawCss = el.data();
        if (!StringUtils.isBlank(rawCss)) {
            cssResource = new CSSResourceImpl(rawCss, 0, new LocalRsrc());
            StylesheetContent cssContent = getStylesheetFromLocaleResource(cssResource.getResource());
            adaptContent(cssContent, cssResource, getCurrentResourcePath(el.baseUri()), getListOfMediaFromAttributeValue(el));
            relatedCssIdSet.add(getContentDataService().saveOrUpdate(cssContent).getId());
        }
    }
    getContentDataService().saveContentRelationShip(getSSP(), relatedCssIdSet);
}
Also used : StylesheetContent(org.asqatasun.entity.audit.StylesheetContent) LocalRsrc(org.asqatasun.contentadapter.util.LocalRsrc) Element(org.jsoup.nodes.Element) Resource(org.asqatasun.contentadapter.Resource)

Aggregations

Resource (org.asqatasun.contentadapter.Resource)1 LocalRsrc (org.asqatasun.contentadapter.util.LocalRsrc)1 StylesheetContent (org.asqatasun.entity.audit.StylesheetContent)1 Element (org.jsoup.nodes.Element)1