Channels ▼
RSS

Design

Mashups and the Enterprise Mashup Markup Language (EMML)


Deploying the Mashup Script

When it is time to deploy the script:

  1. 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.
  2. 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>
    
    

  3. Restart the Tomcat server

  4. 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...]

  5. 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>
    
    

  6. 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.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video