An Introduction to Mashup Macros - How to Create a Custom Macro in Presto Wires

Posted 10/23/2008 - 13:49 by Americo Savinon

In this example I am going to show you how you can create a custom Wires action using EMML Macros.

You can think of a Macro as a normal function on any programming language, this function recieves some parameters, process them and then returns a result. Macros work in the same way as normal functions but they run on EMML. 

Wires has a good set of this actions out of the box, for instance: merge, join, etc. Now wouldn't it be great to add your own custom actions into Wires? So that other people besides you can use them to simplify things and the the job done? Well thanks to the EMML Macros you can do that.

This examples shows how to create a Macro from scratch that will add an attribute and value to a Mashup.

The attached zip file contains 2 files:

- addSingleAttributeValue.emml : Which is the Macro itself

- macrosTemplate.emml: Which is a template you can use to get started, code your macro inside a mashup and test your macro before including it into wires.

 

5
Your rating: None Average: 5 (2 votes)