public class RenderingGadgetRewriter extends Object implements GadgetRewriter
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,ConfigContributor> |
configContributors |
protected ContainerConfig |
containerConfig |
protected static String |
DEFAULT_CSS |
protected Set<String> |
defaultExternLibs |
protected Boolean |
externalizeFeatures |
protected FeatureRegistry |
featureRegistry |
protected JsUriManager |
jsUriManager |
protected MessageBundleFactory |
messageBundleFactory |
| Constructor and Description |
|---|
RenderingGadgetRewriter(MessageBundleFactory messageBundleFactory,
ContainerConfig containerConfig,
FeatureRegistry featureRegistry,
JsUriManager jsUriManager,
Map<String,ConfigContributor> configContributors) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getLibraryConfig(Gadget gadget,
List<String> reqs)
Creates a set of all configuration needed to satisfy the requested feature set.
|
protected void |
injectBaseTag(Gadget gadget,
Node headTag) |
protected void |
injectDefaultPrefs(Gadget gadget,
Node scriptTag)
Injects default values for user prefs into the gadget output.
|
protected void |
injectFeatureLibraries(Gadget gadget,
Node headTag,
Node firstHeadChild)
Injects javascript libraries needed to satisfy feature dependencies.
|
protected void |
injectGadgetBeacon(Gadget gadget,
Node headTag,
Node firstHeadChild) |
protected void |
injectMessageBundles(MessageBundle bundle,
Node scriptTag)
Injects message bundles into the gadget output.
|
protected void |
injectOnLoadHandlers(Node bodyTag) |
protected void |
injectPreloads(Gadget gadget,
Node scriptTag)
Injects preloads into the gadget output.
|
void |
rewrite(Gadget gadget,
MutableContent mutableContent)
Rewrite the gadget.
|
void |
setDefaultForcedLibs(String forcedLibs) |
void |
setExternalizeFeatureLibs(Boolean externalizeFeatures) |
protected static final String DEFAULT_CSS
protected final MessageBundleFactory messageBundleFactory
protected final ContainerConfig containerConfig
protected final FeatureRegistry featureRegistry
protected final JsUriManager jsUriManager
protected final Map<String,ConfigContributor> configContributors
protected Boolean externalizeFeatures
@Inject public RenderingGadgetRewriter(MessageBundleFactory messageBundleFactory, ContainerConfig containerConfig, FeatureRegistry featureRegistry, JsUriManager jsUriManager, Map<String,ConfigContributor> configContributors)
messageBundleFactory - Used for injecting message bundles into gadget output.@Inject public void setDefaultForcedLibs(String forcedLibs)
@Inject(optional=true) public void setExternalizeFeatureLibs(Boolean externalizeFeatures)
public void rewrite(Gadget gadget, MutableContent mutableContent) throws RewritingException
GadgetRewriterrewrite in interface GadgetRewritergadget - Gadget to rewrite.mutableContent - the content of the gadget to be manipulated.RewritingExceptionprotected void injectOnLoadHandlers(Node bodyTag)
protected void injectGadgetBeacon(Gadget gadget, Node headTag, Node firstHeadChild) throws GadgetException
GadgetExceptionprotected void injectFeatureLibraries(Gadget gadget, Node headTag, Node firstHeadChild) throws GadgetException
GadgetExceptionprotected String getLibraryConfig(Gadget gadget, List<String> reqs) throws GadgetException
reqs - The features needed to satisfy the request.GadgetException - If there is a problem with the gadget auth tokenprotected void injectMessageBundles(MessageBundle bundle, Node scriptTag) throws GadgetException
GadgetException - If we are unable to retrieve the message bundle.protected void injectDefaultPrefs(Gadget gadget, Node scriptTag)
Copyright © 2007-2012. All Rights Reserved.