/** * Handle XHTML rendering for icon images. * * @version $Id: 2ffe56658a713e3cab85bbdb727367fcd3b1b399 $ * @since 5.4RC1 */ @Component @Named("icon") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class IconXHTMLImageTypeRenderer extends AttachmentXHTMLImageTypeRenderer { }
/** * @param componentClass the component class from which to extract the component instantiation strategy * @return the component instantiation strategy to use */ private ComponentInstantiationStrategy createComponentInstantiationStrategy(Class<?> componentClass) { ComponentInstantiationStrategy strategy; // Support both InstantiationStrategy and JSR 330's Singleton annotations. Singleton singleton = componentClass.getAnnotation(Singleton.class); if (singleton != null) { strategy = ComponentInstantiationStrategy.SINGLETON; } else { InstantiationStrategy instantiationStrategy = componentClass.getAnnotation(InstantiationStrategy.class); if (instantiationStrategy != null) { strategy = instantiationStrategy.value(); } else { // TODO: In order to be JSR330 compliant we need to change this behavior and consider components are // per lookup when no annotation is specified. Before we can do this we need to modify the full xwiki // code base and possibly introduce a configuration option. To be discussed. strategy = ComponentInstantiationStrategy.SINGLETON; } } return strategy; }
/** * Handle XHTML rendering for images for which we haven't found a specific * {@link org.xwiki.rendering.internal.renderer.xhtml.image.XHTMLImageTypeRenderer} implementation. * * @version $Id: 92c3f55fe5a718b7d443da85c4edcd68ea2c72c9 $ * @since 5.4RC1 */ @Component @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class DefaultXHTMLImageTypeRenderer extends AbstractXHTMLImageTypeRenderer { @Override protected String getImageSrcAttributeValue(ResourceReference reference, Map<String, String> parameters) { return reference.getReference(); } }
/** * Handle XHTML rendering for links for which we haven't found a specific * {@link org.xwiki.rendering.internal.renderer.xhtml.link.XHTMLLinkTypeRenderer} implementation. * * @version $Id: 760ff487bdc0f83d015431cdda881c75e3ecd0a0 $ * @since 2.5M2 */ @Component @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class DefaultXHTMLLinkTypeRenderer extends AbstractXHTMLLinkTypeRenderer { @Override protected void beginLinkExtraAttributes(ResourceReference reference, Map<String, String> spanAttributes, Map<String, String> anchorAttributes) { anchorAttributes.put(XHTMLLinkRenderer.HREF, reference.getReference()); } }
/** * Handle XHTML rendering for links to spaces. * * @version $Id: c369e980f739528d13b728cd38c374c274572a64 $ * @since 7.4.1 * @since 8.0M1 */ @Component @Named("space") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class SpaceXHTMLLinkTypeRenderer extends DocumentXHTMLLinkTypeRenderer { // Since we can`t currently have more than one @Named annotation on a component (until we get java 8), we need to // add this class instead which just extends DocumentXHTMLLinkTypeRenderer and uses a different @Named annotation. }
/** * @version $Id: ab8db0a375971ede7cc6635d6451b48027b14e85 $ */ @Component("theme") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class ThemeGestaltConfigurationSource implements GestaltConfigurationSource { @Inject private ThemeSettings themeSettings; @Override public Object get() { return themeSettings; } }
/** * Handle XHTML rendering for mailto links. * * @version $Id$ * @since 2.5RC1 */ @Component("mailto") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class MailtoXHTMLLinkTypeRenderer extends AbstractXHTMLLinkTypeRenderer { /** * {@inheritDoc} * * @see AbstractXHTMLLinkTypeRenderer#beginLinkExtraAttributes(ResourceReference, java.util.Map, java.util.Map) */ @Override protected void beginLinkExtraAttributes(ResourceReference reference, Map<String, String> spanAttributes, Map<String, String> anchorAttributes) { anchorAttributes.put(XHTMLLinkRenderer.HREF, reference.getType().getScheme() + ':' + reference.getReference()); } }
/** * Handle XHTML rendering for links towards a relative path. * * @version $Id: 03611245ac4622b88c110a736083c4d35b7573fc $ * @since 4.1M2 */ @Component @Named("path") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class PathXHTMLLinkTypeRenderer extends DefaultXHTMLLinkTypeRenderer { @Override protected boolean isExternalLink(ResourceReference reference) { return false; } }
/** * Handle XHTML rendering for mailto links. * * @version $Id: 1e85086d468a77e28c44888ed431c8e56995ea33 $ * @since 2.5RC1 */ @Component @Named("mailto") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class MailtoXHTMLLinkTypeRenderer extends AbstractXHTMLLinkTypeRenderer { @Override protected void beginLinkExtraAttributes(ResourceReference reference, Map<String, String> spanAttributes, Map<String, String> anchorAttributes) { anchorAttributes.put(XHTMLLinkRenderer.HREF, reference.getType().getScheme() + ':' + reference.getReference()); } }
/** * Handle XHTML rendering for images represented as a <a href="http://tools.ietf.org/html/rfc2397">Data URI</a>. * * @version $Id: 77b8ce1d2315e34fc23781b55c641c81065dff7f $ * @since 5.4RC1 */ @Component @Named("data") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class DataURIXHTMLImageTypeRenderer extends AbstractXHTMLImageTypeRenderer { @Override protected String getImageSrcAttributeValue(ResourceReference reference, Map<String, String> parameters) { return String.format("%s:%s", reference.getType().getScheme(), reference.getReference()); } }
/** * Handle XHTML rendering for links for which we haven't found a specific * {@link org.xwiki.rendering.internal.renderer.xhtml.link.XHTMLLinkTypeRenderer} implementation. * * @version $Id$ * @since 2.5M2 */ @Component @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class DefaultXHTMLLinkTypeRenderer extends AbstractXHTMLLinkTypeRenderer { /** * {@inheritDoc} * * @see AbstractXHTMLLinkTypeRenderer#beginLinkExtraAttributes(org.xwiki.rendering.listener.reference.ResourceReference * , java.util.Map, java.util.Map) */ @Override protected void beginLinkExtraAttributes(ResourceReference reference, Map<String, String> spanAttributes, Map<String, String> anchorAttributes) { anchorAttributes.put(XHTMLLinkRenderer.HREF, reference.getReference()); } }
/** * Handle XHTML rendering for UNC links (Universal Naming Convention). * * @version $Id$ * @since 2.7M1 */ @Component("unc") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class UNCXHTMLLinkTypeRenderer extends AbstractXHTMLLinkTypeRenderer { /** * {@inheritDoc} * * @see AbstractXHTMLLinkTypeRenderer#beginLinkExtraAttributes(ResourceReference, java.util.Map, java.util.Map) */ @Override protected void beginLinkExtraAttributes(ResourceReference reference, Map<String, String> spanAttributes, Map<String, String> anchorAttributes) { // Transform the UNC reference into a file URL of the format: file://///myserver/myshare/mydoc.txt // i.e. replace all "\" chars by "/" and prefix with "file:///". String fileURL = "file:///" + reference.getReference().replaceAll("\\\\", "/"); anchorAttributes.put(XHTMLLinkRenderer.HREF, fileURL); } }
/** * Print names of events. Useful for debugging and tracing in general. Note that this class is not located in the test * source tree since it's currently used at runtime by the WYSIWYG editor for its runtime debug mode. * * @version $Id$ * @since 2.0M3 */ @Component("event/1.0") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class EventRenderer extends AbstractChainingPrintRenderer implements Initializable { /** * {@inheritDoc} * @see Initializable#initialize() * @since 2.0M3 */ public void initialize() throws InitializationException { ListenerChain chain = new ListenerChain(); setListenerChain(chain); // Construct the listener chain in the right order. Listeners early in the chain are called before listeners // placed later in the chain. chain.addListener(this); chain.addListener(new EventsChainingRenderer(chain)); } }
/** * Handle XHTML rendering for UNC links (Universal Naming Convention). * * @version $Id: a5592fdd7fc1b11658ed8d36b46a2098a2f655d5 $ * @since 2.7M1 */ @Component @Named("unc") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class UNCXHTMLLinkTypeRenderer extends AbstractXHTMLLinkTypeRenderer { @Override protected void beginLinkExtraAttributes(ResourceReference reference, Map<String, String> spanAttributes, Map<String, String> anchorAttributes) { // Transform the UNC reference into a file URL of the format: file://///myserver/myshare/mydoc.txt // i.e. replace all "\" chars by "/" and prefix with "file:///". String fileURL = "file:///" + reference.getReference().replaceAll("\\\\", "/"); anchorAttributes.put(XHTMLLinkRenderer.HREF, fileURL); } }
/** * Print names of events. Useful for debugging and tracing in general. Note that this class is not located in the test * source tree since it's currently used at runtime by the WYSIWYG editor for its runtime debug mode. * * @version $Id: d27651949268a1caad8e0c097199e4c41939b3de $ * @since 2.0M3 */ @Component @Named("event/1.0") @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class EventRenderer extends AbstractChainingPrintRenderer implements Initializable { @Override public void initialize() throws InitializationException { ListenerChain chain = new ListenerChain(); setListenerChain(chain); // Construct the listener chain in the right order. Listeners early in the chain are called before listeners // placed later in the chain. chain.addListener(this); chain.addListener(new EventsChainingRenderer(chain)); } }
@InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class TexRenderer extends WrappingListener implements PrintRenderer
/** * Helper to execute Block based asynchronous renderer. * * @version $Id: 82352d90a47993aedc4365eabe76dbf198df3342 $ * @since 10.10RC1 */ @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public abstract class AbstractBlockAsyncRenderer implements BlockAsyncRenderer { @Inject protected TransformationManager transformationManager; @Inject @Named("macro") protected Transformation macroTransformation; @Inject protected RenderingContext renderingContext; protected void transform(Block block, TransformationContext transformationContext) throws TransformationException { if (isAsyncAllowed() || isCacheAllowed()) { this.transformationManager.performTransformations(block, transformationContext); } else { ((MutableRenderingContext) this.renderingContext).transformInContext(this.macroTransformation, transformationContext, block); } } }
@ComponentRole @InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public interface Task { enum Status { NONE, PAUSED, RUNNING, FINISHED } Status getStatus(); List<Exception> getExceptions(); Request getRequest(); void start(Request request); }
@InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class AttachmentXHTMLImageTypeRenderer extends AbstractXHTMLImageTypeRenderer implements Initializable
@InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) public class InterWikiXHTMLLinkTypeRenderer extends AbstractXHTMLLinkTypeRenderer