Particls Action Extensions

How To Create an Action Extension: This article will explain what an Action Extension is and how to add one to Particls.

 

 

 

What:

An action extension is a way to send Touchstone items to internet sites. They are accessed by right clicking on either the ticker, the more info window, the popup window, a pinned alert or any other output adapter that implements the feature.

 

An example usage is when a user right clicks on an item in the ticker; a context menu is shown with several options including a few social networking actions. These social networking actions allow the user to add the item in question to various social networking sites, Digg, del.icio.us and et cetera. Existing action extensions are located in the "System.Windows.Forms.Application.StartupPath + "\ActionExtensions\" directory.

 

How:

As mentioned above, the action extensions are located in the "ActionExtensions" folder. Particls searches this directory for all XML files that contain the "SNContextMenuItem" root node. It then adds a new context strip item based on the sub nodes of "SNContextMenuItem". A skeleton is included next:

<?xml version="1.0"?>
<SNContextMenuItem>
<name>NAME OF ITEM</name>
<api>http://URL TO SEND ITEM TO/example.php?url=&lt;$PERMALINK$&gt;&amp;title=&lt;$TITLE$&gt;</api>
<icon>Particls.Core.Resources.ServiceLogos.NAME OF LOGO</icon>
</SNContextMenuItem>

As can be seen in the above XML example, "<$PERMALINK$>" is the url of the item being sent to the website. "<$TITLE$>" is the title of the item being sent. The icon node is used to add a icon for the action extension to the context strip item. At this stage the icon is hard coded into the Source code in both ScrollingText.cs and AlertContents.cs in a function called getSNImage(iconPath). getSNImage (get social networking image) returns an Image object based on a passed parameter, iconPath. getSNImage consists solely of several "if (iconPath.ToLower().IndexOf("SEARCH STRING") != -1)" statements for each action extension currently in the "ActionExtensions" directory.

 

 

 

Working examples of existing XML files:

 

Please note: As seen in the below examples, "&" must be used in the api url instead of "&" so as to be readable by the .Net XML reader.

 

Del.icio.us

<?xml version="1.0"?>
<SNContextMenuItem>
<name>Del.icio.us</name>
<api>http://del.icio.us/post?url=&lt;$PERMALINK$&gt;&amp;title=&lt;$TITLE$&gt;</api>
<icon>Particls.Core.Resources.ServiceLogos.del_icio_us</icon>
</SNContextMenuItem>

 

 

Digg

<?xml version="1.0"?>
<SNContextMenuItem>
<name>Digg</name>
<api>http://digg.com/submit?phase=2&amp;url=&lt;$PERMALINK$&gt;&amp;title=&lt;$TITLE$&gt;</api>
<icon>Particls.Core.Resources.ServiceLogos.digg</icon>
</SNContextMenuItem>


Page Information

  • 1 year ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information


Update to PBwiki 2.0

An entirely new PBwiki experience, including folders and easier editing.

Convert Now for Free | Learn more