<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marcus Povey &#187; trac</title>
	<atom:link href="http://www.marcus-povey.co.uk/tag/trac/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcus-povey.co.uk</link>
	<description>Making the world a better place, one byte at a time...</description>
	<lastBuildDate>Fri, 16 Jul 2010 09:00:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<atom:link rel='hub' href='http://www.marcus-povey.co.uk/?pushpress=hub'/>
		<item>
		<title>Post processing Elgg views &#8211; Trac tags example</title>
		<link>http://www.marcus-povey.co.uk/2009/07/06/post-processing-elgg-views-trac-tags-example/</link>
		<comments>http://www.marcus-povey.co.uk/2009/07/06/post-processing-elgg-views-trac-tags-example/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 09:43:29 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
				<category><![CDATA[elgg]]></category>
		<category><![CDATA[#ue]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugin hook]]></category>
		<category><![CDATA[post processing]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[views]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=232</guid>
		<description><![CDATA[There are a number of ways that an Elgg plugin developer can manipulate views via the powerful Elgg views system. Most Elgg programmers are by now familiar with extending or replacing existing views, or providing new views for new objects etc. But what if you just wanted to make a simple tweak to an existing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://trac.edgewall.org"><img title="Trac_Logo_512x512" src="http://www.marcus-povey.co.uk/wp-content/Trac_Logo_512x512-150x150.png" alt="Trac_Logo_512x512" width="150" height="150" align="right" /></a>There are a number of ways that an Elgg plugin developer can manipulate views via the powerful <a href="http://docs.elgg.org/wiki/Views">Elgg views system</a>.</p>
<p>Most Elgg programmers are by now familiar with <a href="http://docs.elgg.org/wiki/Views#Extending_views">extending</a> or replacing existing views, or providing new views for new objects etc.</p>
<p>But what if you just wanted to make a simple tweak to an existing view &#8211; for example to replace all instances of rude words in a feed article, or to turn passive links into active ones?</p>
<p>Well, fortunately Elgg provides a post processing hook for views which can do just that.</p>
<p>After every view has been generated, the framework will trigger a <a href="http://docs.elgg.org/wiki/PluginHooks">plugin hook</a> called &#8220;&#8216;display&#8217;, &#8216;view&#8217;&#8221;. This hook is passed a parameter &#8216;view&#8217; which contains the name of the view being processed (eg. object/blog).</p>
<p>The contents of the view are passed in the <code>$returnvalue</code> variable which you can perform any processing on before returning it from the hook.</p>
<p>I have just uploaded a <a href="http://community.elgg.org/pg/plugins/marcus/read/168854/trac-tags">Trac tags plugin</a> to the <a href="http://community.elgg.org">Elgg community</a> site which provides a good example of this.</p>
<p>The Trac tags plugin is a tiny plugin which uses the views post processing hook to turn <a href="http://trac.edgewall.org">Trac</a> links (e.g. #xxxxx for tickets and [xxxxx] for changesets) into active links into your repository, and here&#8217;s how &#8211; first we register the hook:</p>
<blockquote><p><code>function tractags_init()<br />
{<br />
....<br />
// Register our post processing hook<br />
register_plugin_hook('display', 'view', 'tractags_rewrite');</code></p>
<p><code><br />
// define views we want to rewrite codes on (means we don't have to process *everything*)<br />
$CONFIG-&gt;tractags_views = array(<br />
'object/thewire',<br />
'object/blog'<br />
);</code></p>
<p><code> ....<br />
}</code></p></blockquote>
<p>Then in our handler looks something like this:</p>
<blockquote><p><code>function tractags_rewrite($hook, $entity_type, $returnvalue, $params)<br />
{<br />
global $CONFIG;</code></p>
<p><code>$view = $params['view'];</code></p>
<p><code>if (($view) &amp;&amp; (in_array($view, $CONFIG-&gt;tractags_views)))<br />
{<br />
// Search and replace ticket numbers<br />
$returnvalue =  preg_replace_callback('/(#)([0-9]+)/i',<br />
create_function(<br />
'$matches',<br />
'<br />
global $CONFIG;</code></p>
<p><code>return "&lt;a href=\"{$CONFIG-&gt;trac_baseurl}ticket/{$matches[2]}\"&gt;{$matches[0]}&lt;/a&gt;";<br />
'<br />
), $returnvalue);</code></p>
<p><code>// Search and replace changesets<br />
$returnvalue =  preg_replace_callback('/(\[)([0-9]+)(\])/i',<br />
create_function(<br />
'$matches',<br />
'<br />
global $CONFIG;</code></p>
<p><code>return "&lt;a href=\"{$CONFIG-&gt;trac_baseurl}changeset/{$matches[2]}\"&gt;{$matches[0]}&lt;/a&gt;";<br />
'<br />
), $returnvalue);</code></p>
<p><code>return $returnvalue;<br />
}<br />
}</code></p></blockquote>
<p>I&#8217;m sure you will be able to come up with some much more interesting uses!</p>
<p><small>Image from the <a href="http://trac.edgewall.org">Trac project</a>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2009/07/06/post-processing-elgg-views-trac-tags-example/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bug tracking</title>
		<link>http://www.marcus-povey.co.uk/2009/03/10/bug-tracking/</link>
		<comments>http://www.marcus-povey.co.uk/2009/03/10/bug-tracking/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 16:46:48 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bugtrackers]]></category>
		<category><![CDATA[bugzilla]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[mylyn]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[tag clustering]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=136</guid>
		<description><![CDATA[Over on his blog, my good friend and colleague Ben has written a good post about bugtrackers. He is essentially complaining that there are currently none available that are good for both developers and end users. Broadly speaking I agree with him. The two main players &#8211; Bugzilla and Trac &#8211; are both lacking. Bugzilla&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Over on his blog, my good friend and colleague Ben has written a <a href="http://benwerd.com/2009/03/bug-tracking/">good post about bugtrackers</a>. He is essentially complaining that there are currently none available that are good for both developers and end users.</p>
<p>Broadly speaking I agree with him. The two main players &#8211; <a href="http://www.bugzilla.org">Bugzilla</a> and <a href="http://trac.edgewall.org/">Trac</a> &#8211; are both lacking. Bugzilla&#8217;s interface has notable usability issues, and trac too is somewhat lacking.</p>
<p>In both cases however, the core functionality of what a bugtracker actually <em>does</em> &#8211; a prioritised and editable todo list &#8211; works perfectly.</p>
<p>The problem is interface.</p>
<p>How do we create one that is useful to both developers (who need quite detailed settings) and end users (who need a simple interface and in many cases need a certain amount of hand holding in order to fill in a report which is useful to the developer)?</p>
<p>Thinking back to my usage of both Bugzilla and Trac &#8211; the answer is that we don&#8217;t.</p>
<p>Let me explain: I have used both Bugzilla and Trac in anguish on large projects for many many years, but I have hardly ever used the default interface &#8211; currently I use the excellent <a href="http://www.eclipse.org/mylyn/">Mylyn</a> (nee Mylar) for <a href="http://www.eclipse.org/">Eclipse</a>. For me a bugtracker is a central todo list accessible from anywhere &#8211; combined with a central svn repo it becomes possible for me to continue to do work anywhere there is a computer and internet connection&#8230; invaluable if you spend any amount of time travelling.</p>
<p>It seems to me that a good approach would be to have the bug tracker entirely API driven (more so than it is now &#8211; which in many cases is a later bolt on), that way it would be possible to provide a variety of expert interfaces for developers and a simplified interface for end users &#8211; rather than having one interface try and do it all.</p>
<p>This interface should hold peoples hand and ask specific targeted questions to encourage non-programmers to provide reports which will be useful to developers.</p>
<p>Tagging (and tag clustering) could be a useful technique to then group issues together &#8211; making it easy to find related issues and to spot duplicates.</p>
<p>Building on some social technology to establish relationships between issues, comment around them and attach files and other media could also be useful.</p>
<p>If the underlining engine is the same this shouldn&#8217;t involve too much in the way of work duplication, but will allow for tighter integration with the tools and workflow people actually use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2009/03/10/bug-tracking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
