Package com.xpn.xwiki.plugin.skinx
Class JsResourceSkinExtensionPlugin
- java.lang.Object
-
- com.xpn.xwiki.plugin.XWikiDefaultPlugin
-
- com.xpn.xwiki.plugin.skinx.AbstractSkinExtensionPlugin
-
- com.xpn.xwiki.plugin.skinx.AbstractResourceSkinExtensionPlugin
-
- com.xpn.xwiki.plugin.skinx.JsResourceSkinExtensionPlugin
-
- All Implemented Interfaces:
com.xpn.xwiki.internal.cache.rendering.RenderingCacheAware,XWikiPluginInterface
public class JsResourceSkinExtensionPlugin extends AbstractResourceSkinExtensionPlugin
Skin Extension plugin that allows pulling javascript files from JAR resources.- Since:
- 1.3
- Version:
- $Id: 103a1bbe06f9ef2c286b3f1300c546f2bcbc341d $
-
-
Field Summary
-
Fields inherited from class com.xpn.xwiki.plugin.skinx.AbstractSkinExtensionPlugin
contextKey, DEFER_DEFAULT_PARAM, parametersContextKey, QUERY_PARAMETER_DELIMITER
-
-
Constructor Summary
Constructors Constructor Description JsResourceSkinExtensionPlugin(String name, String className, XWikiContext context)XWiki plugin constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringendParsing(String content, XWikiContext context)protected StringgenerateLink(String url, String resourceName, XWikiContext context)Takes a URL string and outputs a link which will cause the browser to load the url.protected StringgetAction()Get the action which the url should specify for calling this resource.StringgetName()-
Methods inherited from class com.xpn.xwiki.plugin.skinx.AbstractResourceSkinExtensionPlugin
getAlwaysUsedExtensions, getLink, hasPageExtensions
-
Methods inherited from class com.xpn.xwiki.plugin.skinx.AbstractSkinExtensionPlugin
getCacheResources, getCurrentDocumentReferenceResolver, getDefaultEntityReferenceSerializer, getImportString, getLink, getParameter, getParametersForResource, getParametersMap, getPluginApi, getPulledResources, getSkinExtensionAsync, initializeRequestListIfNeeded, parametersAsQueryString, restoreCacheResources, sanitize, use, use
-
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endRendering, endRenderingHandler, flushCache, flushCache, getClassName, getLocalization, init, insidePREHandler, localizePlainOrKey, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
-
-
-
-
Constructor Detail
-
JsResourceSkinExtensionPlugin
public JsResourceSkinExtensionPlugin(String name, String className, XWikiContext context)
XWiki plugin constructor.- Parameters:
name- The name of the plugin, which can be used for retrieving the plugin API from velocity. Unused.className- The canonical classname of the plugin. Unused.context- The current request context.- See Also:
XWikiDefaultPlugin(String, String, com.xpn.xwiki.XWikiContext)
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceXWikiPluginInterface- Overrides:
getNamein classXWikiDefaultPlugin
-
getAction
protected String getAction()
Description copied from class:AbstractResourceSkinExtensionPluginGet the action which the url should specify for calling this resource.- Specified by:
getActionin classAbstractResourceSkinExtensionPlugin- Returns:
- String Action name.
-
generateLink
protected String generateLink(String url, String resourceName, XWikiContext context)
Description copied from class:AbstractResourceSkinExtensionPluginTakes a URL string and outputs a link which will cause the browser to load the url.- Specified by:
generateLinkin classAbstractResourceSkinExtensionPlugin- Parameters:
url- String representation of the url to load (eg:/res/url.js)resourceName- name of the pulled resourcecontext- the current request context- Returns:
- HTML code linking to the pulled resource (eg:
<script src="/res/url.js"/>)
-
endParsing
public String endParsing(String content, XWikiContext context)
At the end of the request, insert the links to the pulled resources in the response, in the place marked by an XML comment of the format
<!-- canonical.plugin.classname -->.We must override this method since the plugin manager only calls it for classes that provide their own implementation, and not an inherited one.
- Specified by:
endParsingin interfaceXWikiPluginInterface- Overrides:
endParsingin classAbstractSkinExtensionPlugin- See Also:
AbstractSkinExtensionPlugin.endParsing(String, XWikiContext)
-
-