<?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"
	>

<channel>
	<title>Marcus Povey</title>
	<atom:link href="http://www.marcus-povey.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcus-povey.co.uk</link>
	<description></description>
	<pubDate>Fri, 22 Aug 2008 16:56:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>The Open Web</title>
		<link>http://www.marcus-povey.co.uk/2008/08/22/the-open-web/</link>
		<comments>http://www.marcus-povey.co.uk/2008/08/22/the-open-web/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 16:56:32 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[open web]]></category>

		<category><![CDATA[oxford geek night]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=80</guid>
		<description><![CDATA[Just a quick note to say that I will be giving a lightning talk at Oxford Geek Night on the 27th, talking about the Open Web.
Those of you who are in the Oxford area (and are interested) are welcome to come along!
]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to say that I will be giving a lightning talk at <a href="http://oxford.geeknights.net/2008/aug-27th/">Oxford Geek Night</a> on the 27th, talking about the Open Web.</p>
<p>Those of you who are in the Oxford area (and are interested) are welcome to come along!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/08/22/the-open-web/feed/</wfw:commentRss>
		</item>
		<item>
		<title>APIs and data formats</title>
		<link>http://www.marcus-povey.co.uk/2008/08/19/apis-and-data-formats/</link>
		<comments>http://www.marcus-povey.co.uk/2008/08/19/apis-and-data-formats/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 18:42:02 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[elgg]]></category>

		<category><![CDATA[api]]></category>

		<category><![CDATA[data formats]]></category>

		<category><![CDATA[mashup]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=78</guid>
		<description><![CDATA[Now that Elgg 1.0 is finally out of the door, I think it is time to talk a little bit about about some of the more advanced features - namely APIs and data formats!
Elgg 1.0 provides a number of ways at getting at your data, including a number of natively supported data formats; including OpenDD [...]]]></description>
			<content:encoded><![CDATA[<p>Now that Elgg 1.0 is finally out of the door, I think it is time to talk a little bit about about some of the more advanced features - namely APIs and data formats!</p>
<p>Elgg 1.0 provides a number of ways at getting at your data, including a number of natively supported data formats; including OpenDD (of course), JSON, PHP, and of course RSS.</p>
<p>If you&#8217;re putting together a mashup, you can use these views very simply. You may have noticed when you&#8217;re looking at a page with a list of items on it, that there are buttons in the top left which link to either a RSS or an OpenDD view.</p>
<p>Now when you click on one of those you&#8217;ll see your data presented in an entirely different way. Now one of the fun things you can do is change that by altering the &#8220;view&#8221; parameter, for example &#8220;view=json&#8221; to get a JSON view.</p>
<p>You can export individual items of data (that you have access to) in different ways by visiting the &#8220;export&#8221; url. For example, to export GUID 1 (which will almost certainly be the first site you set up) visit:</p>
<p><code>http://mysite.com/export/opendd/1/</code></p>
<p>Of course, if you replace &#8220;opendd&#8221; with &#8220;json&#8221; or &#8220;php&#8221; you can see this data presented in an entirely different way. Additionally, you can also add support for other formats, <a href="http://www.marcus-povey.co.uk/page/5/">as I discussed in a previous article</a>.</p>
<p>On top of that, there is an API system where plugin writers can export a function as public. These functions can then be called via a rest-like api (<a href="http://docs.elgg.org/wiki/Engine/RestApi">discussed in more detail here</a>).</p>
<p>You can then select how you want to then see that data - whether its PHP, XML or JSON etc.</p>
<p>So, in a nutshell, Elgg has some quite powerful tools for quickly and easily creating some pretty funky mashups. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/08/19/apis-and-data-formats/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Elgg 1.0 Released</title>
		<link>http://www.marcus-povey.co.uk/2008/08/18/elgg-10-released/</link>
		<comments>http://www.marcus-povey.co.uk/2008/08/18/elgg-10-released/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 17:14:23 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[elgg]]></category>

		<category><![CDATA[2012]]></category>

		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=76</guid>
		<description><![CDATA[Well.. 
It&#8217;s been a lot of work and a long day, but I&#8217;m pleased to announce that Elgg 1.0 has officially been released!
Go download, while I crack open the beer!
]]></description>
			<content:encoded><![CDATA[<p>Well.. </p>
<p>It&#8217;s been a lot of work and a long day, but I&#8217;m pleased to announce that <a href="http://www.elgg.org/downloads.php">Elgg 1.0 has officially been released</a>!</p>
<p>Go download, while I crack open the beer!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/08/18/elgg-10-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Summary of Elgg 1</title>
		<link>http://www.marcus-povey.co.uk/2008/08/14/summary-of-elgg-1/</link>
		<comments>http://www.marcus-povey.co.uk/2008/08/14/summary-of-elgg-1/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 21:17:15 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[elgg]]></category>

		<category><![CDATA[august 18th]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=70</guid>
		<description><![CDATA[With the release of the long awaited Elgg 1 platform now imminent I just thought I&#8217;d take the opportunity to go over a few of the things that make this version so cool.
A lot of these things I and my colleagues have covered before in previous blog posts, but I thought I&#8217;d give a brief [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of the long awaited <a href="http://www.elgg.org/">Elgg 1 platform now imminent</a> I just thought I&#8217;d take the opportunity to go over a few of the things that make this version so cool.</p>
<p>A lot of these things I and my colleagues have covered before in previous blog posts, but I thought I&#8217;d give a brief summary of just a few of them.</p>
<p>First of all, this is possibly one of the best looking versions of Elgg ever. A lot of this is due to the efforts of our resident design guru Pete Harris, who has done a fantastic job in making the graphics and the user experience top notch.</p>
<p>There has also been a lot of work done under the hood&#8230;</p>
<p>There&#8217;s the <a href="http://docs.elgg.org/wiki/Views">views system</a> which easily lets you skin Elgg and completely change its look and feel. For example we have the default view, which is the one you see when you log into a site (and can be extended and changed by installed plugins). This could just as easily be a mobile view for display on mobile devices.</p>
<p>We have provided RSS and <a href="http://www.opendd.net">OpenDD</a> views which you&#8217;ll see links for if you look a list of objects.</p>
<p>There&#8217;s the <a href="http://docs.elgg.org/wiki/Engine/DataModel">database schema</a> which we have mentioned before. We have taken a very abstract view, so now everything is an entity with metadata and relationships between them&#8230; those of you familiar with the OpenDD schema will notice some familiarity. This is not an accident.</p>
<p>There is also the concept in Elgg 1 that pretty much everything is a plugin, and therefore we have made plugins stupidly easy to write. A lot of the stuff that every plugin has to do is taken care of by the framework. There are ways to list objects, a <a href="http://docs.elgg.org/wiki/Engine/Notifications">notification system</a>, <a href="http://docs.elgg.org/wiki/XML-RPC">XML-RPC</a>, <a href="http://www.marcus-povey.co.uk/2008/07/31/import-and-export-in-elgg-10-2/">import/export</a> out of the box, a robust <a href="http://docs.elgg.org/wiki/Engine/Internationalisation">internationalisation system</a>, <a href="http://docs.elgg.org/wiki/Engine/RestApi">API</a> and even views designed for data import (which have protection against various forms of attack).</p>
<p>In Elgg there are a whole bunch of things that all come together and mean that plugin writers only need to worry about the thing their plugin needs to do.</p>
<p>There is a comprehensive admin panel which plugins can extend. Plugins can be individually enabled and disabled, and can have <a href="http://docs.elgg.org/wiki/Pluginsettings">administrator and user configurable settings</a>. There&#8217;s a <a href="http://docs.elgg.org/wiki/Widgets">framework for displaying widgets</a> on pages which plugins can hook into.</p>
<p>As well as all the framework stuff that make development easier, the actual system is pretty fully featured. You have blogs, forums, messaging, bookmaking, a river of events (which again plugins can easily <a href="http://docs.elgg.org/wiki/River">hook into</a>), and an admin system log.</p>
<p>All this stuff and more come together to make a very easy to use and full featured social networking platform.</p>
<p><a href="http://www.elgg.org">Give it a try</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/08/14/summary-of-elgg-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vote for Elgg at SXSW!</title>
		<link>http://www.marcus-povey.co.uk/2008/08/14/elgg-at-sxsw/</link>
		<comments>http://www.marcus-povey.co.uk/2008/08/14/elgg-at-sxsw/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 14:05:21 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[elgg]]></category>

		<category><![CDATA[sxsw]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=66</guid>
		<description><![CDATA[Folks, the panel picker for South by Southwest is now open!
If you&#8217;ve got a moment please go vote for Elgg!
]]></description>
			<content:encoded><![CDATA[<p>Folks, the <a href="http://panelpicker.sxsw.com/">panel picker</a> for <a href="http://www.sxsw.com/">South by Southwest</a> is now open!</p>
<p>If you&#8217;ve got a moment please <a href="http://panelpicker.sxsw.com/ideas/view/1132?return=%2Fideas%2Findex%2F3%2Fq%3Aelgg">go vote for Elgg</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/08/14/elgg-at-sxsw/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Help us test Elgg!</title>
		<link>http://www.marcus-povey.co.uk/2008/08/08/help-us-test-elgg/</link>
		<comments>http://www.marcus-povey.co.uk/2008/08/08/help-us-test-elgg/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 21:04:49 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[elgg]]></category>

		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=64</guid>
		<description><![CDATA[Joining the others in my team to say that we have opened up the Elgg 1.0 svn and test community!
If you&#8217;re a less technical user, we&#8217;d like to invite you to come into our test community. This is now open for registration, so all you need to do is visit test.elgg.org and sign up for [...]]]></description>
			<content:encoded><![CDATA[<p>Joining the others in my team to say that<a href="http://news.elgg.org/pg/blog/bwerdmuller/read/44/help-us-test-elgg"> we have opened up the Elgg 1.0 svn and test community</a>!</p>
<blockquote><p>If you&#8217;re a less technical user, we&#8217;d like to invite you to come into our test community. This is now open for registration, so all you need to do is visit test.elgg.org and sign up for an account. We&#8217;d love to hear your feedback, and you&#8217;ll find an Elgg Feedback group there for the purpose. (Please note that we&#8217;ll be blanking the database from time to time.)</p>
<p>If you&#8217;re a developer, we&#8217;re pleased to announce that our source code repository is now public. Point your Subversion client at the following repositories:</p>
<p>* Core Elgg: https://code.elgg.org/elgg/<br />
* Elgg plugins: https://code.elgg.org/extensions/</p>
<p>Please note that this is not an end user release, and development is still ongoing. The intention is to bring developers in to help us test the platform.</p></blockquote>
<p>Come in and join the fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/08/08/help-us-test-elgg/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Import and Export in Elgg 1.0</title>
		<link>http://www.marcus-povey.co.uk/2008/07/31/import-and-export-in-elgg-10-2/</link>
		<comments>http://www.marcus-povey.co.uk/2008/07/31/import-and-export-in-elgg-10-2/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 17:13:44 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[elgg]]></category>

		<category><![CDATA[export]]></category>

		<category><![CDATA[import]]></category>

		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=56</guid>
		<description><![CDATA[Perhaps one of the most useful and unique features about Elgg 1.0 is its ability to import and export data. Initially this is accomplished via OpenDD, but we have added hooks which make it very easy to add other formats.
I&#8217;m going to talk a little bit about how this works. Firstly, Export.
Export works via the [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps one of the most useful and unique features about Elgg 1.0 is its ability to import and export data. Initially this is accomplished via OpenDD, but we have added hooks which make it very easy to add other formats.</p>
<p>I&#8217;m going to talk a little bit about how this works. Firstly, Export.</p>
<p>Export works via the <a href="http://docs.elgg.org/wiki/Views">views system</a>, and involves creating a brand new view hierarchy for your new format.</p>
<p>We first need to <a href="http://docs.elgg.org/wiki/Tutorials">create a plugin</a>, and in this plugin we create a &#8220;views&#8221; directory. We need to then create a new directory for your format, and then create a couple of views underneath.</p>
<p><img class="alignleft" style="float: left;"src="http://www.marcus-povey.co.uk/wp-content/viewsactions.png" alt="" width="216" height="330" />The image to the left shows the necessary file hierarchy that you need to create - in this instance to export &#8220;myformat&#8221;.</p>
<p>Create a directory called &#8220;export&#8221;. In this directory place the three php files - <code>entity.php</code>, <code>metadata.php</code> and <code>relationship.php</code> - which handle entities, metadata (and annotations) and relationships respectively.</p>
<p>Each of these files are passed objects via <code>$vars</code>. Depending on which file you are in, this might be <code>$vars['entity']</code>, <code>$vars['metadata']</code> or <code>$vars['relationship']</code>.</p>
<p>It is then up to you to encode and output the object according to your format.</p>
<p>All that remains is to provide the <code>pageshell</code> which handles how the overall page is displayed. This file may set the content-type header or provide wrapping tags (e.g. for XML output).</p>
<p><code>pageshell.php</code> is passed <code>$vars['body']</code> containing the output of your other files.</p>
<p>Providing a handler to deal with importing data is also fairly simple, and works through the <a href="http://docs.elgg.org/wiki/Actions">action interface</a>.</p>
<p>In your plugin&#8217;s init function register the action &#8220;import/YOURFORMAT&#8221;, and point it to your <code>actions/import/myformat.php</code>, e.g.</p>
<blockquote>
<pre>&lt;?php

	function myformatplugin_init()
	{
		global $CONFIG;

		// Register import action
		register_action('import/myformat', false,
		  $CONFIG-&gt;pluginspath . "myformatplugin_init/actions/import/myformat.php");
	}

	// Initialise
	register_elgg_event_handler('init','system','myformatplugin_init');
?&gt;</pre>
</blockquote>
<p>This will then register an import action which will be picked up by the administrator import export utility. Your action can access the information it needs to import with the call:</p>
<blockquote><p><code>$data = get_input('data');</code></p></blockquote>
<p>Elgg 1.0 will ship with native support for <a href="http://www.opendd.net">OpenDD</a> (both import and export) which will allow administrators to migrate between <a href="http://classic.elgg.org">Elgg classic</a> and the new codebase with a minimum amount of effort.</p>
<p>Elgg 1.0 also offers export views in JSON and PHP native, making it easier to reference the data directly and create mashups.</p>
<p>Over time we will be adding more import and export functionality, and I hope you will be too!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/07/31/import-and-export-in-elgg-10-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Push messaging with OpenDD</title>
		<link>http://www.marcus-povey.co.uk/2008/07/26/push-messaging-with-opendd/</link>
		<comments>http://www.marcus-povey.co.uk/2008/07/26/push-messaging-with-opendd/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 17:02:19 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[elgg]]></category>

		<category><![CDATA[events]]></category>

		<category><![CDATA[messaging]]></category>

		<category><![CDATA[opendd]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=51</guid>
		<description><![CDATA[Federated networks are the future for social networks. Realistically, nobody is going to come along any time soon to challenge the big players like Facebook. But what we can do is allow users to move themselves and their data seamlessly between niche networks, or better yet provide a way of linking up users and data [...]]]></description>
			<content:encoded><![CDATA[<p>Federated networks are the future for social networks. Realistically, nobody is going to come along any time soon to challenge the big players like Facebook. But what we can do is allow users to move themselves and their data seamlessly between niche networks, or better yet provide a way of linking up users and data between networks.</p>
<p>There are technologies around that are all working on bits of the puzzle; <a href="http://en.wikipedia.org/wiki/Openid">OpenID</a>, <a href="http://en.wikipedia.org/wiki/OAuth">OAuth</a> etc. I think <a href="http://www.opendd.net">OpenDD</a> solves a key part of the problem by providing a way to link between and move arbitrary data about in a generic and easily understandable way.</p>
<p><a href="http://www.marcus-povey.co.uk/2008/07/21/syndicating-friends-activity-using-opendd/">In my last post I illustrated the syndication usecase for OpenDD</a>; how you can subscribe to a feed for a user and get a list of their activity in the form of a river. One important thing that I forgot to mention of course is there is absolutely no reason why you couldn&#8217;t use the same technique to subscribe to and receive updates about any resource.</p>
<p>Another powerful use case for OpenDD is its use in a live push context, and that is what I&#8217;m going to write a bit about today. Now we have already touched on the fact that OpenDD components are all atomic; they do not require a great deal of context or state around them, so for example if you establish a relationship between two entities you do not need to include the complete description of the entities in question - just the relationship.</p>
<p>In the latest specifications I have introduced the concept of being able to unset and remove things, so as well as creating a relationship it is also possible to remove it. This turns OpenDD into quite a powerful tool in your arsenal.</p>
<p>If you take Elgg as an example, Elgg has an events system which we have touched on in <a href="http://www.marcus-povey.co.uk/2008/06/09/adding-to-the-river-in-an-elgg-1-plugin/">previous</a> <a href="http://news.elgg.org/pg/blog/bwerdmuller/read/38/events-and-auditing-in-elgg">articles</a> and as well as providing a syndication of an events log in the form of a river, we can also look at pushing those events <em>as they happen</em> out to interesting parties as a sequence of OpenDD components.</p>
<p>So, for example, you could request to be notified when a user joins a group or when something changes on a file (or indeed any other resource) and this can then be pushed out to you in a way that is simple to understand - and again, because we have the concept of an UUID, it isn&#8217;t necessary to have the complete context in order for the message to be useful. Everything else can be worked out.</p>
<p>So, using OpenDD, it is now possible to subscribe to users and resources on different networks and receive a feed of updates, but it is also now possible to push messages <em>between</em> networks in an open way that is understood by both platforms.</p>
<p>One of the cool things you can do with that is for example Sharing. In one network you could create a resource, for example a photo of you at a party or a URL you were interested in. Then you could select between the friends on the network you are in but also from <em>friends elsewhere</em> to share the resource with.</p>
<p>The user on the foreign network would then receive an OpenDD push update message saying that you have created a resource and have shared it with them (or rather the platform would receive and interpret it), and because users and the resource are all addressed by UUID the user would be able to see this seamlessly on their own network.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/07/26/push-messaging-with-opendd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Syndicating friends activity using OpenDD</title>
		<link>http://www.marcus-povey.co.uk/2008/07/21/syndicating-friends-activity-using-opendd/</link>
		<comments>http://www.marcus-povey.co.uk/2008/07/21/syndicating-friends-activity-using-opendd/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 14:14:14 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[ODD]]></category>

		<category><![CDATA[elgg]]></category>

		<category><![CDATA[opendd]]></category>

		<category><![CDATA[river]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=48</guid>
		<description><![CDATA[You are probably all aware of the concept of the River in terms of social networking platforms; being able to see what your friends have been up to as a list of events - what they have been doing, who they have made their friend etc.
This feature - made popular by the facebook &#8220;mini-feed&#8221; - [...]]]></description>
			<content:encoded><![CDATA[<p>You are probably all aware of the concept of the River in terms of social networking platforms; being able to see what your friends have been up to as a list of events - what they have been doing, who they have made their friend etc.</p>
<p>This feature - made popular by the <a href="http://news.cnet.com/8301-10784_3-6112450-7.html">facebook &#8220;mini-feed&#8221;</a> - has become one of the things that users expect from any platform they use and is rather compelling.</p>
<p>What if you want to see what they have been doing on other networks? Would it not be a pretty neat thing to be able to subscribe to their activity in order to receive updates about what they have been up to in a similar way as you would be able to subscribe to their blog via <a href="http://en.wikipedia.org/wiki/Rss">RSS</a>?</p>
<p>This turns out to be a simple yet powerful use case for <a href="http://www.opendd.net">OpenDD</a>, and this is how we&#8217;re doing it in the new version of <a href="http://www.elgg.org">Elgg</a>.</p>
<p>I talked a bit about how the river was implemented in Elgg 1.0 in <a href="http://www.marcus-povey.co.uk/2008/06/09/adding-to-the-river-in-an-elgg-1-plugin/">previous</a> <a href="http://www.marcus-povey.co.uk/2008/07/18/changes-to-the-river-code/">articles</a>. In a nutshell we have a system log which stores events as they happen in terms of a simple relationship, e.g. <em>&#8220;User X CREATED BlogPost&#8221;</em>, <em>&#8220;User X UPDATED profile&#8221;</em>, etc.</p>
<p>Once you have that information it becomes very easy to mine that for extra information and turn it into a River event. Essentially, a plugin would create a view on the specific event and entity and then be able to render it as a river item and provide new views on existing data.</p>
<p>If you remember, I also <a href="http://www.marcus-povey.co.uk/2008/07/18/changes-to-the-river-code/">talked about how I changed the river code</a> to use this thing called <code>ElggRiverStatement</code>, which lets you construct the river in a much more linguistic way and also provides all the information needed by the river views.</p>
<p>Creating a &#8220;Friends activity elsewhere&#8221; syndication view becomes quite easy. Essentially, all you need to do is export the system log for a user, which you can do very easily using OpenDD as a sequence of OpenDD Relationships. This is because <em>&#8220;User X CREATED BlogPost&#8221;</em> can be thought of in terms of a relationship.</p>
<p>Once this is done, an aggregation client can retrieve the feeds of all the friends that you&#8217;ve signed up to and then sort the relationships by published data, and then - because everything has a UUID - you can then drill down and pull the extra information required - details about the user who initiated the action, the object the event was performed on, metadata etc.</p>
<p>This essentially means you can construct a succession of <code>ElggRiverStatement</code> objects out of an OpenDD feed. This is quite cool, because it means you can take those objects and inject them into the already existing river views and get a river entry back. This means that for absolutely zero extra work, every plugin has the ability to render a &#8220;Friend elsewhere&#8221; event&#8230; and it becomes seamless!</p>
<p>Additionally, you can look to digging further and getting extra information about the entities involved and actually be able to <em>see</em> the entity in question - whether by linking to the entity elsewhere or using the information you have about it to render it locally.</p>
<p>This is quite a simple example, but it shows some of the power of OpenDD. Additionally, I should point out that since OpenDD is atomic, you don&#8217;t ever have to get all the information in one go!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/07/21/syndicating-friends-activity-using-opendd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Changes to the river code</title>
		<link>http://www.marcus-povey.co.uk/2008/07/18/changes-to-the-river-code/</link>
		<comments>http://www.marcus-povey.co.uk/2008/07/18/changes-to-the-river-code/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 12:28:19 +0000</pubDate>
		<dc:creator>Marcus Povey</dc:creator>
		
		<category><![CDATA[elgg]]></category>

		<category><![CDATA[river]]></category>

		<guid isPermaLink="false">http://www.marcus-povey.co.uk/?p=45</guid>
		<description><![CDATA[The latest Elgg 1.0 code changes how the river works slightly from that discussed in my previous article on the subject. These changes are entirely under the hood so they&#8217;ll only be noticeable to plugin writers, however it simplifies matters immeasurably and makes it possible to do some quite funky things.
In a nutshell, the river [...]]]></description>
			<content:encoded><![CDATA[<p>The latest Elgg 1.0 code changes how the river works slightly from that <a href="http://www.marcus-povey.co.uk/2008/06/09/adding-to-the-river-in-an-elgg-1-plugin/">discussed in my previous article on the subject</a>. These changes are entirely under the hood so they&#8217;ll only be noticeable to plugin writers, however it simplifies matters immeasurably and makes it possible to do some quite funky things.</p>
<p>In a nutshell, the river generation function now passes a variable called <code>"statement"</code> to your river views instead of passing the object, event etc as separate values. <code>"statement"</code> is a class called <code>ElggRiverStatement</code>.</p>
<p>Loosely speaking all river items are in the form of &#8220;X does something to Y&#8221;, where X is usually a user and Y is either an entity or another statement. I borrowed a bit from linguistics, and X is called the Subject and Y is the Object.</p>
<p>Subject, as I said, is the user, so this is easy. The ElggRiverStatement will provide you with a fully created user entity.</p>
<p>The statement &#8220;does something to&#8221; translates to the event in the system which you will be used to if you&#8217;ve implemented plugins for Elgg 1.0 already&#8230; so that&#8217;s &#8220;create&#8221;, &#8220;update&#8221;, etc.</p>
<p>Object will either by an ElggEntity in the case of simple statements like &#8220;User X updated their Profile&#8221;, or an array which represents compound statements.</p>
<p>What do I mean by compound statements? Well, take the following for example:</p>
<blockquote><p>&#8220;User X is now friends with User Y&#8221;</p></blockquote>
<p>As far as the system is concerned, what you are actually saying is:</p>
<blockquote><p>&#8220;User X created a new friend relationship between User X and User Y&#8221;</p></blockquote>
<p>In terms of language, User X is the Subject and &#8220;a new friend relationship between User X and User Y&#8221; (yes, the whole thing) is the Object (and yes, before someone jumps in I am aware this is highly simplified!).</p>
<p>I use the terms Subject and Object again in the array, so to take the above example our array would look something like this:</p>
<blockquote>
<pre>Array (
    "subject" =&gt; User X (ElggUser object),
    "relationship" =&gt; "friend",
    "object" =&gt; User Y (ElggUser object again)
)</pre>
</blockquote>
<p>If you take the example of adding some metadata (writing a note on a file for example), you&#8217;ve got another compound query. You are making the statement:</p>
<blockquote><p>&#8220;User X has created some metadata which relates to File Y&#8221;</p></blockquote>
<p>In this instance &#8220;some metadata which relates to File Y&#8221; is our Object, and the array returned would look something like this:</p>
<blockquote>
<pre>Array (
    "subject" =&gt; Metadata object,
    "object" =&gt; File Y
)</pre>
</blockquote>
<p>In summary then, the <code>ElggRiverStatement</code> provides a pretty flexible way of representing diverse river statements with a common interface. The entities referenced are provided in full to your view so that you do not have to load them yourself.</p>
<p>Although this is a small change under the hood it makes it possible to do some other cool stuff (which I will discuss a little bit later).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcus-povey.co.uk/2008/07/18/changes-to-the-river-code/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
