Mashables and Mashups : Mashups in EMML : Mashup Samples
Mashup Samples
With theMashZone NextGeninstallation some additional samples are installed.
You can install the samples located in MashZoneNG-install/samples/emml using the MashZoneNG-install/prestocli/bin/publish-mashups scripts. These scripts will install any of the samples located in MashZoneNG-install/samples/emml and its subfolders.
After installation, the samples are shown in the Mashup Editor under My Mashups and can be opened directly from there.
Sample Mashup
Description
Annotate
annotate.emml
Examples of <annotate> to add nodes and data to existing nodes.
FeedAggregationSample
aggfeed.emml
Invokes RSS and Atom Services in parallel using <parallel/> statement. Normalizes all RSS feed types to Atom using feedtype='atom' attribute in directinvoke. After invocation of all feeds in parallel, it subsequently aggregates them using <merge/> and returns a single consolidated feed.
Assign to Expressions
assignments.emml
Examples of <assign>.
Format as CSV
csvmacro.emml
Example of outputing a mashable result in CSV format.
Example using FormatAsCSV macro.
Dynamic EMML
dynamicemml.emml
Example of how to create a mashup script dynamically and invoke it within another mashup.
Examples of <script> and executeDynamicEMML macro.
Dynamic Filter
dynamicfilter.emml
Example of invoking a web service and performing a filter based on dynamic filtering criteria.
Example of mashup expressions and <filter>.
Dynamic Invoke
dynamicinvoke.emml
Example of invoking a mashables that is specified dynamically. This sample invokes the Twitter search web service to find tweets for a term specified as input parameter. Outputs all tweets found.
Example of <foreach> and <appendresult>.
Encoding
encoding.emml
Examples of setting the character encoding for results.
Scripting POJOs
encrypt.emml
Example of handling encryption using <script> and Java classes.
Try/Catch
exception-java.emml
Examples of <try>/<catch> for SQL statements, XSLT or other common EMML statements.
Forceably return in loops
exception-java-return.emml
Examples of <return> to set the mashup result and forcibly return it based on exceptions.
Try/Catch for REST
exception-rest.emml
Examples of <try>/<catch> for invocation exceptions from <directinvoke> for REST web services or web feeds.
Try/Catch for SOAP
exception-soap.emml
Examples of <try>/<catch> for invocation exceptions from <directinvoke> when the response is a SOAP fault.
Throw Exception
exception-throw.emml
Examples using <throw> to throw exceptions from a mashup and a macro.
Fault Handling
faulthandling.emml
Example of using error variables from mashable invocations to control processing.
Example of <if>, <elseif> and <else>.
Finance News
googlefinancenews.emml
Uses web clipping from Google Finance News site to clip and output only specific content.
Examples of <template> to have dynamic XPath expressions, <assign>, <foreach> and <appendresult>.
Scripting with Groovy
groovy.emml
Example of scripting in a mashup using Groovy.
Data Aggregations using For Each
groupby2.emml
Example of grouping using <foreach> and <appendresult>.
Data Aggregation using Group By
groupby.emml
Example of single and nested grouping with <group>.
JsonPostPayloadSample
jsonPost.emml
Demonstrates doing a HTTP POST of JSON document to Mashup and further manipulation of the JSON document using JSON.parse() and JSON.stringify() methods in javascript.
Scripting using Javascript
javascript.emml
Example using inline JavaScript in a mashup.
Join
join.emml
Demonstrates how two information sources can be joined based on a simple criteria.
Join with Functions
joinfunctions.emml
Example of <join> using XPath functions in the join criteria. Also uses <select> to build the joined output.
Join with Select
joinselect.emml
Example of <join> using <select> to build the joined output.
Macros
macros.emml
Examples of simple macro definitions (custom EMML statements) and how to use them in a mashup.
Union
merge.emml
Example of <merge> and <parallel>.
Union of Nodesets
mergenodelists.emml
Examples of <merge> when the results are node sets rather than well-formed documents.
ModifyDocument
modifydoc.emml
In-place modification of XML DOM element values using <assign mode="replace" .. ./>
newMashup
xsDateTimeComparison.emml
Illustrates usage of ISO Date format function.
Invocation Error Handling
onerror.emml
Example of the onerror attribute to control mashup processing when invocation errors occur.
Example of <if> with <elseif> and <else> subclauses.
Outer Join
outerjoin.emml
Example of an outer join using XQuery.
Parallel
parallel.emml
Example of <parallel> invoking two mashables.
HttpMethodsSample
rest-methods.emml
Sample invocation of REST API using various HTTP methods - OPTIONS, HEAD, POST, PUT and DELETE
Filter
rssfilter.emml
Example of filtering results from a syndicated web feed.
Data Splitter with Select
select.emml
Example of <select> statement to filter selected nodes from each item in the result.
SelfJoin
selfjoin.emml
Technique for doing SQL-like self join using EMML join statement.
Sort using Functions
sort.emml
Examples of <sort>.
User-Defined Functions
soundex.emml
Example of using a custom XPath function.
SPARQLQuery
sparql.emml
Constructs a SPARL query using Groovy <script/> and invokes a semantic web service to execute it.
SqlResetService
sqlreset.emml
Utility Service
SQL
sql.emml
Examples of <sql> statement for database queries or stored procedures.
Example of <sqlUpdate> and SQL transaction statements.
tryLoadCatch
tryLoadCatch.emml
Uses EMML exception handling mechanism to initialize cache from a datasource on first-invocation and subsequently serves data from this cache.
Unique
unique.emml
Example of <filter> to ensure unique results.
Web Clipping
webclipping.emml
Example of web clipping from a web site.
While Loop
while.emml
Examples of <while>.
xml-names
xml-names.emml
XQuery
xquery.emml
Example using XQuery.
XSLT
xslt.emml
Example of using XSLT to transform results in a mashup.
Yahoo Finance Stock Quote
yahoofinancequote.emml
Example builds a dynamic URL with <template> to web clip information from Yahoo Financial. Uses <assign> and XPath to perform complex clipping and also dynamic mashup expressions within <constructor> to define the result.
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback