|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xpn.xwiki.plugin.XWikiDefaultPlugin
com.xpn.xwiki.plugin.skinx.AbstractSkinExtensionPlugin
com.xpn.xwiki.plugin.skinx.AbstractDocumentSkinExtensionPlugin
public abstract class AbstractDocumentSkinExtensionPlugin
Abstract SX plugin for wiki-document-based extensions (Extensions written as object of a XWiki Extension class). Provides a generic method to initialize the XWiki class upon plugin initialization if needed. Provide a notification mechanism for extensions marked as "use-always".
JsSkinExtensionPlugin,
CssSkinExtensionPlugin| Field Summary |
|---|
| Fields inherited from class com.xpn.xwiki.plugin.skinx.AbstractSkinExtensionPlugin |
|---|
contextKey, parametersContextKey |
| Constructor Summary | |
|---|---|
AbstractDocumentSkinExtensionPlugin(String name,
String className,
com.xpn.xwiki.XWikiContext context)
XWiki plugin constructor. |
|
| Method Summary | |
|---|---|
String |
endParsing(String content,
com.xpn.xwiki.XWikiContext context)
|
Set<String> |
getAlwaysUsedExtensions(com.xpn.xwiki.XWikiContext context)
Returns the list of always used extensions of this type. |
List<org.xwiki.observation.event.Event> |
getEvents()
|
com.xpn.xwiki.objects.classes.BaseClass |
getExtensionClass(com.xpn.xwiki.XWikiContext context)
Creates or updates the XClass used for this type of extension. |
protected abstract String |
getExtensionClassName()
The name of the XClass which holds extensions of this type. |
protected abstract String |
getExtensionName()
A user-friendly name for this type of resource, used in the auto-generated class document. |
boolean |
hasPageExtensions(com.xpn.xwiki.XWikiContext context)
Determines if the requested document contains on page skin extension objects of this type. |
void |
init(com.xpn.xwiki.XWikiContext context)
|
void |
onEvent(org.xwiki.observation.event.Event event,
Object source,
Object data)
|
void |
virtualInit(com.xpn.xwiki.XWikiContext context)
|
| Methods inherited from class com.xpn.xwiki.plugin.skinx.AbstractSkinExtensionPlugin |
|---|
getImportString, getLink, getParameter, getParametersForResource, getParametersMap, getPluginApi, getPulledResources, initializeRequestListIfNeeded, parametersAsQueryString, sanitize, use, use |
| Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin |
|---|
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endRendering, endRenderingHandler, flushCache, flushCache, getClassName, getName, insidePREHandler, outsidePREHandler, setClassName, setName, startRenderingHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xwiki.observation.EventListener |
|---|
getName |
| Constructor Detail |
|---|
public AbstractDocumentSkinExtensionPlugin(String name,
String className,
com.xpn.xwiki.XWikiContext context)
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.XWikiDefaultPlugin.XWikiDefaultPlugin(String,String,com.xpn.xwiki.XWikiContext)| Method Detail |
|---|
public List<org.xwiki.observation.event.Event> getEvents()
getEvents in interface org.xwiki.observation.EventListenerprotected abstract String getExtensionClassName()
String representation of the XClass name, in the Space.Document format.protected abstract String getExtensionName()
public void init(com.xpn.xwiki.XWikiContext context)
Create/update the XClass corresponding to this kind of extension, and register the listeners that update the list of always used extensions.
init in interface com.xpn.xwiki.plugin.XWikiPluginInterfaceinit in class com.xpn.xwiki.plugin.XWikiDefaultPluginXWikiDefaultPlugin.init(com.xpn.xwiki.XWikiContext)public void virtualInit(com.xpn.xwiki.XWikiContext context)
Create/update the XClass corresponding to this kind of extension in this virtual wiki.
virtualInit in interface com.xpn.xwiki.plugin.XWikiPluginInterfacevirtualInit in class com.xpn.xwiki.plugin.XWikiDefaultPluginXWikiDefaultPlugin.virtualInit(com.xpn.xwiki.XWikiContext)public Set<String> getAlwaysUsedExtensions(com.xpn.xwiki.XWikiContext context)
For this kind of resources, an XObject property (use) with the value always indicates always used extensions. The list of extensions for each wiki is lazily placed in a cache: if the extension set for the context wiki is null, then they will be looked up in the database and added to it. The cache is invalidated using the notification mechanism.
getAlwaysUsedExtensions in class AbstractSkinExtensionPlugincontext - The current request context.
AbstractSkinExtensionPlugin.getAlwaysUsedExtensions(XWikiContext)public boolean hasPageExtensions(com.xpn.xwiki.XWikiContext context)
AbstractSkinExtensionPlugin
hasPageExtensions in class AbstractSkinExtensionPlugincontext - the current request context
public String endParsing(String content,
com.xpn.xwiki.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.
endParsing in interface com.xpn.xwiki.plugin.XWikiPluginInterfaceendParsing in class AbstractSkinExtensionPluginAbstractSkinExtensionPlugin.endParsing(String, XWikiContext)public com.xpn.xwiki.objects.classes.BaseClass getExtensionClass(com.xpn.xwiki.XWikiContext context)
init(XWikiContext) and
virtualInit(XWikiContext).
context - The current request context, which gives access to the wiki.
public void onEvent(org.xwiki.observation.event.Event event,
Object source,
Object data)
Make sure to keep the alwaysUsedExtensions map consistent when the database changes.
onEvent in interface org.xwiki.observation.EventListenerEventListener.onEvent(org.xwiki.observation.event.Event, java.lang.Object,
java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||