com.xpn.xwiki.plugin.skinx
Class SkinExtensionPluginApi

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.plugin.PluginApi<AbstractSkinExtensionPlugin>
          extended by com.xpn.xwiki.plugin.skinx.SkinExtensionPluginApi
Direct Known Subclasses:
SkinFileExtensionPluginApi

public class SkinExtensionPluginApi
extends com.xpn.xwiki.plugin.PluginApi<AbstractSkinExtensionPlugin>

API for the SkinExtension Plugin.

Version:
$Id: c589ccdf583f1f07bbdd9976ac40b820f3aabeb1 $
See Also:
PluginApi, AbstractSkinExtensionPlugin

Field Summary
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Constructor Summary
SkinExtensionPluginApi(AbstractSkinExtensionPlugin plugin, com.xpn.xwiki.XWikiContext context)
          XWiki Plugin API constructor.
 
Method Summary
 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, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkinExtensionPluginApi

public SkinExtensionPluginApi(AbstractSkinExtensionPlugin plugin,
                              com.xpn.xwiki.XWikiContext context)
XWiki Plugin API constructor.

Parameters:
plugin - The wrapped plugin.
context - The current request context.
See Also:
PluginApi.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.


Copyright © 2004-2012 XWiki. All Rights Reserved.