public class BundleScriptResolver extends Object implements ScriptResolver, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
| Constructor and Description |
|---|
BundleScriptResolver() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBundleScript(org.osgi.framework.Bundle bundle,
String path)
Method for registering a new resource view for a bundle.
|
void |
addBundleScripts(org.osgi.framework.Bundle bundle,
List<URL> scripts)
Callback for registering new resource views for a bundle.
|
static void |
clearCaches()
Utility method to clear all view caches
|
ScriptBundleObserver |
getBundleObserver() |
static BundleScriptResolver |
getInstance() |
ExtensionObserverRegistry |
getObserverRegistry() |
SortedSet<View> |
getViewsSet(ExtendedNodeType nt,
JCRSiteNode site,
String templateType) |
boolean |
hasView(ExtendedNodeType nt,
String key,
JCRSiteNode site,
String templateType) |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
void |
register(ScriptEngineFactory scriptEngineFactory,
org.osgi.framework.Bundle bundle)
Registers the specified
ScriptEngineFactory defined in the context of the specified starting
Bundle. |
void |
registerObservers() |
void |
remove(ScriptEngineFactory factory,
org.osgi.framework.Bundle bundle)
Removes the specified
ScriptEngineFactory from the known ones, deactivating any associated views from
currently active bundles. |
void |
removeBundleScript(org.osgi.framework.Bundle bundle,
String path)
Method for unregistering a resource view for a bundle.
|
void |
removeBundleScripts(org.osgi.framework.Bundle bundle,
List<URL> scripts)
Callback for unregistering resource views for a bundle.
|
Script |
resolveScript(Resource resource,
RenderContext renderContext) |
void |
setBundleScriptFactory(BundleJSR223ScriptFactory bundleScriptFactory) |
void |
setExtensionObserverRegistry(ExtensionObserverRegistry extensionObserverRegistry) |
void |
setIgnoredBundlePrefixes(Set<String> ignoredBundlePrefixes) |
void |
setScriptFactoryMap(Map<String,ScriptFactory> scriptFactoryMap) |
void |
setTemplateManagerService(JahiaTemplateManagerService templateManagerService) |
public void setExtensionObserverRegistry(ExtensionObserverRegistry extensionObserverRegistry)
public ExtensionObserverRegistry getObserverRegistry()
public void registerObservers()
public ScriptBundleObserver getBundleObserver()
public static BundleScriptResolver getInstance()
public void setScriptFactoryMap(Map<String,ScriptFactory> scriptFactoryMap)
public void register(ScriptEngineFactory scriptEngineFactory, org.osgi.framework.Bundle bundle)
ScriptEngineFactory defined in the context of the specified starting
Bundle. This results in registering the associated view extensions along with activating any existing
views in active bundles. This registration operation also takes care of script extension re-ordering if
necessary since bundles defining ScriptEngineFactories can do so.
Additionally, ScriptBundleURLScanner are also activated to look for any files with the newly
registered extensions during future bundle deployments.
scriptEngineFactory - the ScriptEngineFactory instance we want to registerbundle - the starting bundle defining the given ScriptEngineFactorypublic void remove(ScriptEngineFactory factory, org.osgi.framework.Bundle bundle)
ScriptEngineFactory from the known ones, deactivating any associated views from
currently active bundles. This is called when a bundle declaring ScriptEngineFactories is stopping. Previously
registered extension observers associated with the ScriptEngineFactory's supported extensions are also removed.factory - the factory to be removedbundle - the bundle which declared the factory and which is being stoppedpublic void addBundleScripts(org.osgi.framework.Bundle bundle,
List<URL> scripts)
bundle - the bundle to register views forscripts - the URLs of the views to registerpublic void addBundleScript(org.osgi.framework.Bundle bundle,
String path)
bundle - the bundle to register views forpath - the path of the view to registerpublic void removeBundleScripts(org.osgi.framework.Bundle bundle,
List<URL> scripts)
bundle - the bundle to unregister views forscripts - the URLs of the views to unregisterpublic void removeBundleScript(org.osgi.framework.Bundle bundle,
String path)
bundle - the bundle to unregister views forpath - the path of the view to unregisterpublic Script resolveScript(Resource resource, RenderContext renderContext) throws TemplateNotFoundException
resolveScript in interface ScriptResolverTemplateNotFoundExceptionpublic boolean hasView(ExtendedNodeType nt, String key, JCRSiteNode site, String templateType)
hasView in interface ScriptResolverpublic SortedSet<View> getViewsSet(ExtendedNodeType nt, JCRSiteNode site, String templateType)
getViewsSet in interface ScriptResolverpublic void setTemplateManagerService(JahiaTemplateManagerService templateManagerService)
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>public static void clearCaches()
public void setBundleScriptFactory(BundleJSR223ScriptFactory bundleScriptFactory)
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.