use of org.asqatasun.contentadapter.util.InlineRsrc in project Asqatasun by Asqatasun.
the class CSSJsoupPhlocContentAdapterImpl method adaptInlineCSS.
/**
* Retrieve css content and adapt it for each inline resource
*/
private void adaptInlineCSS() {
Set<Long> relatedCssIdSet = new HashSet<>();
for (Element el : inlineCssElements) {
String attributeValue = el.attr("style");
if (StringUtils.isNotBlank(attributeValue)) {
Resource cssResource = new CSSResourceImpl(el.nodeName() + "{" + attributeValue + "}", 0, new InlineRsrc());
StylesheetContent cssContent = getStylesheetFromInlineResource(cssResource.getResource());
adaptContent(cssContent, cssResource, getCurrentResourcePath(el.baseUri()), null);
relatedCssIdSet.add(getContentDataService().saveOrUpdate(cssContent).getId());
}
}
getContentDataService().saveContentRelationShip(getSSP(), relatedCssIdSet);
}
Aggregations