use of org.asqatasun.contentadapter.js.JSResource in project Asqatasun by Asqatasun.
the class JSHandlerImpl method selectInlineJS.
@Override
public JSHandler selectInlineJS() {
Collection<JSResource> inlineJsList = new ArrayList<>();
for (JSResource jsResource : javaScriptSet) {
RsrcLocator location = jsResource.getRsrcLocator();
if (location.getRsrcLocatorType() == RsrcLocator.INLINE) {
inlineJsList.add(jsResource);
}
}
selectedJSList = inlineJsList;
return this;
}
use of org.asqatasun.contentadapter.js.JSResource 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.contentadapter.js.JSResource in project Asqatasun by Asqatasun.
the class JSHandlerImpl method selectExternalJS.
@Override
public JSHandler selectExternalJS() {
Collection<JSResource> externalJsList = new ArrayList<>();
for (JSResource jsResource : javaScriptSet) {
RsrcLocator location = jsResource.getRsrcLocator();
if (location.getRsrcLocatorType() == RsrcLocator.EXTERNAL) {
externalJsList.add(jsResource);
}
}
selectedJSList = externalJsList;
return this;
}
use of org.asqatasun.contentadapter.js.JSResource in project Asqatasun by Asqatasun.
the class JSHandlerImpl method selectLocalJS.
@Override
public JSHandler selectLocalJS() {
Collection<JSResource> localJsList = new ArrayList<>();
for (JSResource jsResource : javaScriptSet) {
RsrcLocator location = jsResource.getRsrcLocator();
if (location.getRsrcLocatorType() == RsrcLocator.LOCAL) {
localJsList.add(jsResource);
}
}
selectedJSList = localJsList;
return this;
}
Aggregations