use of org.asqatasun.entity.audit.RelatedContent in project Asqatasun by Asqatasun.
the class JSHandlerImpl method initialize.
private void initialize() {
if (initialized) {
return;
}
XStream xStream = new XStream();
XStream.setupDefaultSecurity(xStream);
xStream.allowTypesByWildcard(new String[] { "org.asqatasun.**" });
for (RelatedContent relatedContent : ssp.getRelatedContentSet()) {
if (relatedContent instanceof JavascriptContent) {
if (javaScriptSet == null) {
javaScriptSet = new HashSet<>();
}
javaScriptSet.addAll((Set<JSResource>) xStream.fromXML(((JavascriptContent) relatedContent).getAdaptedContent()));
}
}
initialized = true;
}
use of org.asqatasun.entity.audit.RelatedContent in project Asqatasun by Asqatasun.
the class CrawlerServiceImpl method removeSummerRomance.
/**
* During the crawl, Webresources and Contents are created. Contents can be
* of 2 types : SSP or relatedContent. A SSP is linked to a webResource and
* a relatedContent is linked to a SSP. The relation between a ssp and a
* relatedContent is not known when fetching. So we need to link all the
* relatedContent to any SSP to be able to link them to the current audit.
* At the end of the crawl, after the creation of the relation between a
* content and an audit, we can "clean" this fake relation.
*
* This method were supposed to be called removedFakeRelation but thanks to
* the scottish guy, this method is now called removerSummerRomance.
*
* @param webResource
* @param audit
*/
private void removeSummerRomance(Audit audit) {
Set<RelatedContent> relatedContentSet = (Set<RelatedContent>) contentDataService.getRelatedContentFromAudit(audit);
for (RelatedContent relatedContent : relatedContentSet) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(" deleteContentRelationShip between of " + ((Content) relatedContent).getURI());
contentDataService.deleteContentRelationShip(((Content) relatedContent).getId());
}
}
}
Aggregations