<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Velocity on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/velocity/</link>
    <description>Recent content in Velocity on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo -- 0.147.8</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #213243b1d6e8932079e09227d3f3ed0c806cd0c9</copyright>
    <lastBuildDate>Wed, 13 Feb 2013 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/velocity/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Using Apache Camel with Scala and the Camel Scala DSL</title>
      <link>https://www.hascode.com/using-apache-camel-with-scala-and-the-camel-scala-dsl/</link>
      <pubDate>Wed, 13 Feb 2013 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/using-apache-camel-with-scala-and-the-camel-scala-dsl/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Whenever I encounter a situation where I have to mix a blend of different services and endpoints and apply one or more of the traditional enterprise integration patterns then Apache Camel often is my weapon of choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;I simply love how easy it is to set up some datasources, add some routing magic, data transformers, load balancers, content enrichers and enjoy the result.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Another thing that I’m beginning to love is Scala and so this is the perfect time to write an article about using Scala and Apache Camel together.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>How to create a Template Bundle Plugin in Confluence</title>
      <link>https://www.hascode.com/how-to-create-a-template-bundle-plugin-in-confluence/</link>
      <pubDate>Mon, 12 Jul 2010 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/how-to-create-a-template-bundle-plugin-in-confluence/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Since Confluence 3.2. there is a new plugin module type that allows you to deploy templates in a bundle via the plugin API.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In addition it is possible to assign these templates to specific spaces and preview available templates in the Confluence administration area.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;So let’s build some sample templates..&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_creating_a_template_bundle_plugin&#34;&gt;Creating a Template Bundle Plugin&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Creating a template bundle is easy – just create a class implementing &lt;em&gt;TemplatePackage&lt;/em&gt; – there are two methods: one returns a list of bundled &lt;em&gt;PageTemplate&lt;/em&gt; Objects the other the name for the template bundle.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Snippets: Getting License Information from the Confluence API</title>
      <link>https://www.hascode.com/snippets-getting-license-information-from-the-confluence-api/</link>
      <pubDate>Thu, 06 May 2010 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/snippets-getting-license-information-from-the-confluence-api/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Sometimes one needs to look up license details of a running Confluence system .. perhaps for creating a commercial plugin or to display recommendations dependant from the license used. For this reason there are a few possibilities for receiving some license information from the Confluence API or the velocity context.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;quoteblock&#34;&gt;
&lt;blockquote&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;&lt;strong&gt;Note: This article is outdated since the Atlassian Marketplace was launched and a shiny new licensing API was added. Until this article is updated I strongly recommend to take a closer look at the detailed information that Atlassian is providing in the &lt;a href=&#34;https://developer.atlassian.com/display/UPM/How+to+Add+Licensing+Support+to+Your+Add-on&#34;&gt;Developer Documentation&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>How to build a Confluence Macro Plugin</title>
      <link>https://www.hascode.com/how-to-build-a-confluence-macro-plugin/</link>
      <pubDate>Tue, 13 Apr 2010 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/how-to-build-a-confluence-macro-plugin/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;The goal is to build a small macro plugin deployable via the Confluence plugin API rendering some spaces.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Please note that I am going to build the plugin using just Maven and not the Atlassian Maven Wrapper called the “&lt;em&gt;Atlassian Plugin SDK&lt;/em&gt;” – more information about that is available at the &lt;a href=&#34;http://confluence.atlassian.com/display/DEVNET/Developing+your+Plugin+using+the+Atlassian+Plugin+SDK&#34;&gt;Atlassian website&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;The macro output will be rendered using a Velocity template and all messages are stored for &lt;em&gt;i18n&lt;/em&gt; in properties files bundled with the plugin.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Atlassian Snippets</title>
      <link>https://www.hascode.com/atlassian-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/atlassian-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_disable_yui_compressor&#34;&gt;Disable YUI compressor&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-xml&#34; data-lang=&#34;xml&#34;&gt;&amp;lt;plugin&amp;gt;
    &amp;lt;groupId&amp;gt;com.atlassian.maven.plugins&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;maven-jira-plugin&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;${amps.version}&amp;lt;/version&amp;gt;
    &amp;lt;extensions&amp;gt;true&amp;lt;/extensions&amp;gt;
    &amp;lt;configuration&amp;gt;
        &amp;lt;compressResources&amp;gt;false&amp;lt;/compressResources&amp;gt;
        [..]
    &amp;lt;/configuration&amp;gt;
&amp;lt;/plugin&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_confluence_get_favourites_by_user&#34;&gt;Confluence – Get favourites by user&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Using the label manager.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;List getFavouriteSpaces(String username)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_confluence_determine_the_base_url&#34;&gt;Confluence – Determine the base URL&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Using the SettingsManager:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;String baseUrl = settingsManager.getGlobalSettings().getBaseUrl();&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_confluence_get_the_context_path&#34;&gt;Confluence – Get the context path&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Using the BootstrapManager:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;String contextPath = bootstrapManager.getWebAppContextPath();&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_confluence_using_velocity_template_for_a_macro&#34;&gt;Confluence – Using Velocity Template for a Macro&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;final VelocityContext contextMap = new VelocityContext(MacroUtils.defaultVelocityContext());

contextMap.put(&amp;#34;key&amp;#34;, obj); // references obj as variable named $key in the velocity template

VelocityUtils.getRenderedTemplate(&amp;#34;path/to/template.vm&amp;#34;, contextMap);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
