Servlets

VelocityPluginRessourceResolver

The ContentResolvers VelocityPluginRessourceResolver provides a ContentResolver capability, joining VelocityContentResolver and FileServerServlet.

In other terms, it gives the ability to serve from a Atlassian Plugin JAR a Velocity File as Resource

See below, its usage in Minyaa Core plugin...

  • Servlet definition in atlassian-plugin.xml
    <servlet name="Combined CSS Servlet for Plugin" key="AddOnCss" class="com.atlassian.cache.servlet.CombinedCachingServlet">
    	<description>New instance of CombinedCachingServlet to serve CSS Velocity Based from JAR Resource</description>
    	<url-pattern>/styles/combined.addon.css</url-pattern>
    
    	<init-param>
    		<param-name>content.type</param-name>
    		<param-value>text/css</param-value>
    	</init-param>
    	<init-param>
    		<param-name>content.resolver.divContainer</param-name>
    		<param-value>com.atlassian.jira.servlet.VelocityPluginRessourceResolver</param-value>
    	</init-param>
    	<init-param>
    		<param-name>divContainer</param-name>
    		<param-value>/download/resources/jira.plugin.minyaa.core:Actions/skins/aqua/theme.vm</param-value>
    	</init-param>
    </servlet>
  • Usage in HTM Page, here in WorklogDialogBox.vm, Velocity template for FastWorklog.
    <style type="text/css">
     @import url($req.contextPath/plugins/servlet/styles/combined.addon.css);
    </style>

DwrPluginContentResolver

The ContentResolvers DwrPluginContentResolver provides a ContentResolver capability, joining DwrContentResolver and FileServerServlet.

Initially developped to give the ability to serve from a Atlassian Plugin JAR a DWR Configuration, it has not been implemented, and the required service is no provided by DWRServlet Servlet (see below).

DWRServlet

The Servlet com.atlassian.jira.servlet.DWRServlet is extending uk.ltd.getahead.dwr.DWRServlet

It gives the ability to implement your own DWR configuration based on Plugin Resources.

See below, its usage in Minyaa Core Plugin :

.

  • Servlet definition in atlassian-plugin.xml
    	<servlet name="Overrided DWRServlet for Minyaa Core Plugin" key="minyaaCoreDWRServlet" class="com.atlassian.jira.servlet.DWRServlet">
    		<description key="servlet.descrition" />
    		<resource type="i18n" name="i18n" location="com.atlassian.jira.plugins.servlets.minyaaDWRSerlvet" />
    		<url-pattern>/minyaaDwr/*</url-pattern>
    		<init-param>
    			<param-name>customConfigurator</param-name>
    			<param-value>org.directwebremoting.jiraplugin.DwrXmlConfigurator</param-value>
    		</init-param>
    		<init-param>
    			<param-name>customConfig</param-name>
    			<param-value>/download/resources/jira.plugin.minyaa.core:Actions/dwr</param-value>
    		</init-param>
    		<init-param>
    			<param-name>urlPivot</param-name>
    			<param-value>/minyaaDwr/</param-value>
    		</init-param>
    	</servlet>
    
  • Usage in HTM Page, here in WorklogDialogBox.vm, Velocity template for FastWorklog.
    <script language="JavaScript" src="$req.contextPath/plugins/servlet/fastWorklogDwr/interface/FastLogWorkAjaxUtil.js"></script>