|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.gadgets.render.RenderingGadgetRewriter
public class RenderingGadgetRewriter
Produces a valid HTML document for the gadget output, automatically inserting appropriate HTML document wrapper data as needed. Currently, this is only invoked directly since the rewriting infrastructure doesn't properly deal with uncacheable rewrite operations. TODO: Break this up into multiple rewriters. Should be: - UserPrefs injection - Javascript injection (including configuration) - html document normalization
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
RenderingGadgetRewriter(MessageBundleFactory messageBundleFactory,
ContainerConfig containerConfig,
FeatureRegistry featureRegistry,
JsUriManager jsUriManager,
Map<String,ConfigContributor> configContributors)
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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 Set<String> defaultExternLibs
protected Boolean externalizeFeatures
| Constructor Detail |
|---|
@Inject
public RenderingGadgetRewriter(MessageBundleFactory messageBundleFactory,
ContainerConfig containerConfig,
FeatureRegistry featureRegistry,
JsUriManager jsUriManager,
Map<String,ConfigContributor> configContributors)
messageBundleFactory - Used for injecting message bundles into gadget output.| Method Detail |
|---|
@Inject public void setDefaultForcedLibs(String forcedLibs)
@Inject(optional=true) public void setExternalizeFeatureLibs(Boolean externalizeFeatures)
public void rewrite(Gadget gadget,
MutableContent mutableContent)
throws RewritingException
GadgetRewriter
rewrite in interface GadgetRewritergadget - Gadget to rewrite.mutableContent - the content of the gadget to be manipulated.
RewritingException
protected void injectBaseTag(Gadget gadget,
Node headTag)
protected void injectOnLoadHandlers(Node bodyTag)
protected void injectGadgetBeacon(Gadget gadget,
Node headTag,
Node firstHeadChild)
throws GadgetException
GadgetException
protected void injectFeatureLibraries(Gadget gadget,
Node headTag,
Node firstHeadChild)
throws GadgetException
GadgetException
protected 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 token
protected 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)
protected void injectPreloads(Gadget gadget,
Node scriptTag)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||