Deploying the Mashup Script
When it is time to deploy the script:
- Start by copying the StockTicker.emml file to the %TOMCAT_HOME%/webapps/emml/WEB-INF/classes folder. To deploy a mashup, the emml file needs to be copied to the WEB-INF/classes folder of the emml web application and updated in the mashups.xml.
- Update the mashups.xml files in the %TOMCAT_HOME%/webapps/emml/WEB-INF/classes folder:
<!-- Mashups can be invoked using their logical name OR script name. e.g. http://xyz:8080/emml/name/operation?param1=value1¶m2=value2 http://xyz:8080/emml/script/operation?param1=value1¶m2=value2 --> <mashups> <mashup script="StockTicker.emml"/> </mashups>
- Restart the Tomcat server
- Go to the URL http://localhost:8080/emml/StockTicker. All mashups registered with the EMML engine can be accessed by their logical name or file name. The full syntax for a mashup service URL is http://host:port/emml/mashup-file-without-extension[/operation-name][?param-name=value¶m-name=value...]
- The following result is displayed in the browser:
<?xml version="1.0" encoding="UTF-8"?> <xml> <stock> <ticker>INFY</ticker> <company>Infosys Technologies Limited (ADR)</company> <price>56.41</price> <change/> <news> <rss> <channel> <item> <title>Infosys welcomes projected reduction in fiscal deficit (New Kerala)</title> <link>http://us.rd.yahoo.com/dailynews/rss/search/Infosys/SIG=11lda6h80/*http%3A//www.newkerala.com/news/fullnews-59951.html</link> <description>Bangalore, Feb 26 : Efforts to bring down the fiscal deficit to 5.5 per cent from 6.8 per cent was a positive development as the country strengthens its growth after recovery from the global recession, Infosys CEO and MD S Gopalakrishnan said today.</description> </item> <item> <title>India Stock Index Fluctuates; Infosys Rises, Mahindra Retreats (Bloomberg)</title> <link>http://us.rd.yahoo.com/dailynews/rss/search/Infosys/SIG=124h235gl/*http%3A//www.bloomberg.com/apps/news?pid=20601091&sid=a62MHSs.HJJ0</link> <description>Feb. 24 (Bloomberg) -- Indian stocks fluctuated. Infosys Technologies Ltd. gained after its rating was raised at Macquarie Group Ltd. Mahindra & Mahindra Ltd. fell for a fifth day amid concern the government may increase car taxes.</description> </item> <item> <title>Infosys Raised to Outperform at Macquarie on Earnings Growth (Bloomberg)</title> <link>http://us.rd.yahoo.com/dailynews/rss/search/Infosys/SIG=1242cqk17/*http%3A//www.bloomberg.com/apps/news?pid=20601091&sid=aLrwFpe_ExMs</link> <description>Feb. 24 (Bloomberg) -- Infosys Technologies Ltd. , Indias second-largest software-service provider, had its rating raised to outperform at Macquarie Group Ltd. on potential earnings growth.</description> </item> </channel> </rss> </news> </stock> … <info> <source>Google Finance and Yahoo Finance News</source> <datetime>Auto Generated on 26-February-2010 at 21:1</datetime> </info> </xml> - An error message such as this is displayed in the browser if there are any exceptions while processing the mashup. A detailed stack trace is also logged in the Tomcat log files. EMML also provides the <display> and <assert> commands for help in debugging the mashup script:
<error> <errorMessage>1002</errorMessage> <errorMessage><![CDATA[Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (socket creation error)]]> </errorMessage> </error>
Conclusion
This article presented an overview of OMA and its mashup specification. EMML supports an extensive set of operations and commands to handle simple to complex processing needs. EMML also supports the results of one mashup as input to another. All in all, this should give you a head start for developing more complicated mashups by referring to the detailed EMML documentation provided in the OMA portal.


