Package com.xpn.xwiki.plugin.skinx
Class SkinExtensionPluginApi
- java.lang.Object
-
- com.xpn.xwiki.api.Api
-
- com.xpn.xwiki.plugin.PluginApi<AbstractSkinExtensionPlugin>
-
- com.xpn.xwiki.plugin.skinx.SkinExtensionPluginApi
-
- Direct Known Subclasses:
SkinFileExtensionPluginApi
public class SkinExtensionPluginApi extends PluginApi<AbstractSkinExtensionPlugin>
API for the SkinExtension Plugin.- Version:
- $Id: c589ccdf583f1f07bbdd9976ac40b820f3aabeb1 $
- See Also:
PluginApi
,AbstractSkinExtensionPlugin
-
-
Constructor Summary
Constructors Constructor Description SkinExtensionPluginApi(AbstractSkinExtensionPlugin plugin, XWikiContext context)
XWiki Plugin API constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getImportString()
Composes and returns the links to the resources pulled in the current request.void
use(String resource)
Mark a resource as used in the current result.void
use(String resource, Map<String,Object> parameters)
Mark a skin extension document as used in the current result, together with some parameters.-
Methods inherited from class com.xpn.xwiki.plugin.PluginApi
getInternalPlugin, getProtectedPlugin, setPlugin
-
Methods inherited from class com.xpn.xwiki.api.Api
convert, convert, convert, convertAttachments, getAuthorizationManager, getContextualAuthorizationManager, getXWikiContext, hasAccess, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
-
-
-
-
Constructor Detail
-
SkinExtensionPluginApi
public SkinExtensionPluginApi(AbstractSkinExtensionPlugin plugin, XWikiContext context)
XWiki Plugin API constructor.- Parameters:
plugin
- The wrapped plugin.context
- The current request context.- See Also:
PluginApi(com.xpn.xwiki.plugin.XWikiPluginInterface, XWikiContext)
-
-
Method Detail
-
use
public void use(String resource)
Mark a resource as used in the current result. A resource is registered only once per request, further calls will not result in additional links, even if it is pulled with different parameters.- Parameters:
resource
- The name of the resource to pull.- See Also:
AbstractSkinExtensionPlugin.use(String, XWikiContext)
-
use
public void use(String resource, Map<String,Object> parameters)
Mark a skin extension document as used in the current result, together with some parameters. How the parameters are used, depends on the type of resource being pulled. For example, JS and CSS extensions use the parameters in the resulting URL, while Link extensions use the parameters as attributes of the link tag. A resource is registered only once per request, further calls will not result in additional links, even if it is pulled with different parameters. If more than one calls per request are made, the parameters used are the ones from the last call (or none, if the last call did not specify any parameters).- Parameters:
resource
- The name of the resource to pull.parameters
- The parameters for this resource.- See Also:
AbstractSkinExtensionPlugin.use(String, Map, XWikiContext)
-
getImportString
public String getImportString()
Composes and returns the links to the resources pulled in the current request. This method is called at the end of each request, once for each type of resource (subclass), and the result is placed in the generated XHTML.- Returns:
- a XHMTL fragment with all extensions imports statements for this request. This includes both extensions that are defined as being "used always" and "on demand" extensions explicitly requested for this page. Always used extensions are always, before on demand extensions, so that on demand extensions can override more general elements in the always used ones.
-
-