blob: 8d68beaea20822fbf2e0143380a9882ad678c591 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" />
<title>SMILA/Documentation/HowTo/How to integrate the HelloWorld webservice as a Pipelet - Eclipsepedia</title>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="generator" content="MediaWiki 1.23.2" />
<link rel="shortcut icon" href="http://wiki.eclipse.org/eclipse.org-common/themes/solstice/public/images/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="http://wiki.eclipse.org/opensearch_desc.php" title="Eclipsepedia (en)" />
<link rel="EditURI" type="application/rsd+xml" href="http://wiki.eclipse.org/api.php?action=rsd" />
<link rel="alternate" type="application/atom+xml" title="Eclipsepedia Atom feed" href="http://wiki.eclipse.org/index.php?title=Special:RecentChanges&amp;feed=atom" />
<link rel="canonical" href="../Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html" />
<link rel="stylesheet" href="http://wiki.eclipse.org/load.php?debug=false&amp;lang=en&amp;modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.ui.button&amp;only=styles&amp;skin=solstice&amp;*" />
<link rel="stylesheet" href="http://wiki.eclipse.org/skins/solstice/public/stylesheets/styles.min.css?303" media="screen, print" /><meta name="ResourceLoaderDynamicStyles" content="" />
<style>a:lang(ar),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}
/* cache key: my_wiki:resourceloader:filter:minify-css:7:14ece53a42aa314864e5fd8c57f0d98f */</style>
<script src="http://wiki.eclipse.org/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=solstice&amp;*"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet","wgTitle":"SMILA/Documentation/HowTo/How to integrate the HelloWorld webservice as a Pipelet","wgCurRevisionId":374285,"wgRevisionId":374285,"wgArticleId":16093,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["SMILA"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet","wgIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgRedirectedFrom":"SMILA/Development_Guidelines/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet","wgWikiEditorEnabledModules":{"toolbar":false,"dialogs":false,"hidesig":true,"preview":false,"previewDialog":false,"publish":false},"wgCategoryTreePageCategoryOptions":"{\"mode\":0,\"hideprefix\":20,\"showcount\":true,\"namespaces\":false}"});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function($,jQuery){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"editfont":"default","editondblclick":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":1,"extendwatchlist":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nickname":"","norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"rcdays":7,"rclimit":50,"rows":25,"showhiddencats":0,"shownumberswatching":1,"showtoolbar":1,"skin":"solstice","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":1,"watchdefault":1,"watchdeletion":0,"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,
"useeditwarning":1,"prefershttps":1,"language":"en","variant-gan":"gan","variant-iu":"iu","variant-kk":"kk","variant-ku":"ku","variant-shi":"shi","variant-sr":"sr","variant-tg":"tg","variant-uz":"uz","variant-zh":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"variant":"en"});},{},{});mw.loader.implement("user.tokens",function($,jQuery){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});},{},{});
/* cache key: my_wiki:resourceloader:filter:minify-js:7:70d74423d3fc1e1c18fa9a1ff645a84a */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<style type="text/css">/*<![CDATA[*/
.source-text {line-height: normal;}
.source-text li, .source-text pre {
line-height: normal; border: 0px none white;
}
/**
* GeSHi Dynamically Generated Stylesheet
* --------------------------------------
* Dynamically generated stylesheet for text
* CSS class: source-text, CSS id:
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
* --------------------------------------
*/
.text.source-text .de1, .text.source-text .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.text.source-text {font-family:monospace;}
.text.source-text .imp {font-weight: bold; color: red;}
.text.source-text li, .text.source-text .li1 {font-weight: normal; vertical-align:top;}
.text.source-text .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.text.source-text .li2 {font-weight: bold; vertical-align:top;}
.text.source-text .ln-xtra, .text.source-text li.ln-xtra, .text.source-text div.ln-xtra {background-color: #ffc;}
.text.source-text span.xtra { display:block; }
/*]]>*/
</style><style type="text/css">/*<![CDATA[*/
.source-java {line-height: normal;}
.source-java li, .source-java pre {
line-height: normal; border: 0px none white;
}
/**
* GeSHi Dynamically Generated Stylesheet
* --------------------------------------
* Dynamically generated stylesheet for java
* CSS class: source-java, CSS id:
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
* --------------------------------------
*/
.java.source-java .de1, .java.source-java .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.java.source-java {font-family:monospace;}
.java.source-java .imp {font-weight: bold; color: red;}
.java.source-java li, .java.source-java .li1 {font-weight: normal; vertical-align:top;}
.java.source-java .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.java.source-java .li2 {font-weight: bold; vertical-align:top;}
.java.source-java .kw1 {color: #7F0055; font-weight: bold;}
.java.source-java .kw2 {color: #7F0055; font-weight: bold;}
.java.source-java .kw3 {color: #000000; font-weight: normal}
.java.source-java .kw4 {color: #7F0055; font-weight: bold;}
.java.source-java .co1 {color: #3F7F5F; font-style: italic;}
.java.source-java .co2 {color: #3F7F5F;}
.java.source-java .co3 {color: #3F7F5F; font-style: italic; font-weight: bold;}
.java.source-java .coMULTI {color: #3F5FBF; font-style: italic;}
.java.source-java .es0 {color: #000000;}
.java.source-java .br0 {color: #000000;}
.java.source-java .sy0 {color: #000000;}
.java.source-java .st0 {color: #2A00ff;}
.java.source-java .nu0 {color: #000000;}
.java.source-java .me1 {color: #000000;}
.java.source-java .me2 {color: #000000;}
.java.source-java .ln-xtra, .java.source-java li.ln-xtra, .java.source-java div.ln-xtra {background-color: #ffc;}
.java.source-java span.xtra { display:block; }
/*]]>*/
</style><style type="text/css">/*<![CDATA[*/
.source-xml {line-height: normal;}
.source-xml li, .source-xml pre {
line-height: normal; border: 0px none white;
}
/**
* GeSHi Dynamically Generated Stylesheet
* --------------------------------------
* Dynamically generated stylesheet for xml
* CSS class: source-xml, CSS id:
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
* --------------------------------------
*/
.xml.source-xml .de1, .xml.source-xml .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.xml.source-xml {font-family:monospace;}
.xml.source-xml .imp {font-weight: bold; color: red;}
.xml.source-xml li, .xml.source-xml .li1 {font-weight: normal; vertical-align:top;}
.xml.source-xml .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.xml.source-xml .li2 {font-weight: bold; vertical-align:top;}
.xml.source-xml .es0 {color: #000099; font-weight: bold;}
.xml.source-xml .br0 {color: #66cc66;}
.xml.source-xml .sy0 {color: #66cc66;}
.xml.source-xml .st0 {color: #ff0000;}
.xml.source-xml .nu0 {color: #cc66cc;}
.xml.source-xml .sc-1 {color: #808080; font-style: italic;}
.xml.source-xml .sc0 {color: #00bbdd;}
.xml.source-xml .sc1 {color: #ddbb00;}
.xml.source-xml .sc2 {color: #339933;}
.xml.source-xml .sc3 {color: #009900;}
.xml.source-xml .re0 {color: #000066;}
.xml.source-xml .re1 {color: #000000; font-weight: bold;}
.xml.source-xml .re2 {color: #000000; font-weight: bold;}
.xml.source-xml .ln-xtra, .xml.source-xml li.ln-xtra, .xml.source-xml div.ln-xtra {background-color: #ffc;}
.xml.source-xml span.xtra { display:block; }
/*]]>*/
</style><meta name="viewport" content="width=device-width, initial-scale=1.0"></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-SMILA_Documentation_HowTo_How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet skin-solstice action-view" id="solstice">
<a class="sr-only" href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#content">Skip to main content</a>
<div class="thin-header">
<header role="banner" class="hidden-print noprint">
<div class="container-fluid">
<div id="row-logo-search">
<div id="header-left">
<div class="row">
<div class="hidden-xs col-sm-6 logo-container">
<a href="https://www.eclipse.org/" ><img class="logo-eclipse-default" src="http://wiki.eclipse.org/skins/solstice/public/images/logo/eclipse-800x188.png" alt="Eclipsepedia"></a>
</div>
<div class="navbar col-sm-18 yamm" id="main-menu">
<div class="navbar-collapse collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a target="_self" href="https://eclipse.org/downloads/">Download</a></li>
<li><a target="_self" href="https://eclipse.org/users/">Getting Started </a></li>
<li><a target="_self" href="https://eclipse.org/membership/">Members</a></li>
<li><a target="_self" href="https://eclipse.org/projects/">Projects</a></li>
<li class="dropdown visible-xs"><a class="dropdown-toggle" data-toggle="dropdown" href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#">Community <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="http://marketplace.eclipse.org">Marketplace</a></li><li><a href="http://events.eclipse.org">Events</a></li><li><a href="http://www.planeteclipse.org/">Planet Eclipse</a></li><li><a href="https://eclipse.org/community/eclipse_newsletter/">Newsletter</a></li><li><a href="https://www.youtube.com/user/EclipseFdn">Videos</a></li></ul></li><li class="dropdown visible-xs"><a class="dropdown-toggle" data-toggle="dropdown" href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#">Participate <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="https://bugs.eclipse.org/bugs/">Report a Bug</a></li><li><a href="https://eclipse.org/forums/">Forums</a></li><li><a href="https://eclipse.org/mail/">Mailing Lists</a></li><li><a href="https://wiki.eclipse.org/">Wiki</a></li><li><a href="https://wiki.eclipse.org/IRC">IRC</a></li><li><a href="https://eclipse.org/contribute/">How to Contribute</a></li></ul></li><li class="dropdown visible-xs"><a class="dropdown-toggle" data-toggle="dropdown" href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#">Working Groups <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="http://wiki.eclipse.org/Auto_IWG">Automotive</a></li><li><a href="http://iot.eclipse.org">Internet of Things</a></li><li><a href="http://locationtech.org">LocationTech</a></li><li><a href="http://lts.eclipse.org">Long-Term Support</a></li><li><a href="http://polarsys.org">PolarSys</a></li><li><a href="http://science.eclipse.org">Science</a></li><li><a href="http://openmdm.org">OpenMDM</a></li></ul></li><!-- More -->
<li class="dropdown hidden-xs"><a class="dropdown-toggle" data-toggle="dropdown">More<b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<!-- Content container to add padding -->
<div class="yamm-content">
<div class="row">
<ul class="col-sm-8 list-unstyled"><li><p><strong>Community</strong></p></li><li><a href="http://marketplace.eclipse.org">Marketplace</a></li><li><a href="http://events.eclipse.org">Events</a></li><li><a href="http://www.planeteclipse.org/">Planet Eclipse</a></li><li><a href="https://eclipse.org/community/eclipse_newsletter/">Newsletter</a></li><li><a href="https://www.youtube.com/user/EclipseFdn">Videos</a></li></ul><ul class="col-sm-8 list-unstyled"><li><p><strong>Participate</strong></p></li><li><a href="https://bugs.eclipse.org/bugs/">Report a Bug</a></li><li><a href="https://eclipse.org/forums/">Forums</a></li><li><a href="https://eclipse.org/mail/">Mailing Lists</a></li><li><a href="https://wiki.eclipse.org/">Wiki</a></li><li><a href="https://wiki.eclipse.org/IRC">IRC</a></li><li><a href="https://eclipse.org/contribute/">How to Contribute</a></li></ul><ul class="col-sm-8 list-unstyled"><li><p><strong>Working Groups</strong></p></li><li><a href="http://wiki.eclipse.org/Auto_IWG">Automotive</a></li><li><a href="http://iot.eclipse.org">Internet of Things</a></li><li><a href="http://locationtech.org">LocationTech</a></li><li><a href="http://lts.eclipse.org">Long-Term Support</a></li><li><a href="http://polarsys.org">PolarSys</a></li><li><a href="http://science.eclipse.org">Science</a></li><li><a href="http://openmdm.org">OpenMDM</a></li></ul> </div>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="navbar-header">
<button data-target="#navbar-collapse-1" data-toggle="collapse" class="navbar-toggle" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="https://www.eclipse.org/" class="visible-xs navbar-brand"><img class="logo-eclipse-default" src="http://wiki.eclipse.org/skins/solstice/public/images/logo/eclipse-800x188.png" alt="Eclipsepedia" width="174"></a>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<section class="defaut-breadcrumbs hidden-print noprint hidden-print clearfix" id="breadcrumb">
<div>
<ol class="breadcrumb">
<li><a href="https://www.eclipse.org/">Home</a></li>
<li><a href="http://wiki.eclipse.org/Main_Page">Eclipse Wiki</a></li>
<li class="active">SMILA/Documentation/HowTo/How to integrate the HelloWorld webservice as a Pipelet</li></ol>
</div>
</section>
</div>
<div class="toolbar-menu breadcrumbs-offset noprint hidden-print margin-bottom-0 clearfix">
<div class="col-md-24">
<ol class="breadcrumb" role="navigation">
<li id="pt-login">
<a href="http://wiki.eclipse.org/index.php?title=Special:UserLogin&amp;returnto=SMILA%2FDocumentation%2FHowTo%2FHow+to+integrate+the+HelloWorld+webservice+as+a+Pipelet">
<i class="fa fa-sign-in fa-fw orange"></i> Log in </a>
</li>
</ul>
</div>
</div>
<main role="main" class="background-grey">
<div class="container-full padding-top-25">
<!-- content -->
<section id="content" class="mw-body container-full clearfix 0">
<div id="mw-js-message" style="display:none;"></div>
<!-- bodyContent -->
<div id="bodyContent">
<!-- jumpto -->
<div id="jump-to-nav" class="mw-jump">
Jump to: <a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#mw-head">navigation</a>,
<a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#p-search">search</a>
</div>
<!-- /jumpto -->
<!-- leftcol -->
<aside class="col-md-4 noprint hidden-print" id="leftcol">
<form class="input-group" role="form" id="form-eclipse-search" action="http://wiki.eclipse.org/index.php" id="searchform">
<input id="searchInput" class="search-query form-control" type="search" accesskey="f" title="Special:Search" placeholder="Search" name="search" value="">
<span class="input-group-btn">
<button value="search" id="mw-searchButton" type="submit" class="btn btn-default" title="Search the pages for this text" name="fulltext">
<i class="fa fa-search"></i>
</button>
</span>
</form>
<select class="form-control margin-top-10 margin-bottom-10 visible-xs visible-sm" onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);"><option class="fw-700 "><span class="fw-700">---Navigation---</span></option><option value="/Main_Page">Main Page</option><option value="/Eclipsepedia:Community_portal">Community portal</option><option value="/Eclipsepedia:Current_events">Current events</option><option value="/Special:RecentChanges">Recent changes</option><option value="/Special:Random">Random page</option><option value="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents">Help</option></select><ul class="ul-left-nav fa-ul hidden-print leftnav hidden-xs hidden-sm"><li class="separator"><span class="separator">Navigation</span></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Main_Page" id="n-mainpage" title="Visit the main page [z]" accesskey="z">Main Page</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Eclipsepedia:Community_portal" id="n-portal" title="About the project, what you can do, where to find things">Community portal</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Eclipsepedia:Current_events" id="n-currentevents" title="Find background information on current events">Current events</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:RecentChanges" id="n-recentchanges" title="A list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:Random" id="n-randompage" title="Load a random page [x]" accesskey="x">Random page</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents" id="n-help" title="The place to find out">Help</a></li></ul> <select class="form-control margin-top-10 margin-bottom-10 visible-xs visible-sm" onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);"><option class="fw-700 "><span class="fw-700">---Toolbox---</span></option><option value="/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;action=info">Page information</option><option value="/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;oldid=374285">Permanent link</option><option value="/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;printable=yes">Printable version</option><option value="/Special:SpecialPages">Special pages</option><option value="/Special:RecentChangesLinked/SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet">Related changes</option><option value="/Special:WhatLinksHere/SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet">What links here</option></select><ul class="ul-left-nav fa-ul hidden-print leftnav hidden-xs hidden-sm"><li class="separator"><span class="separator">Toolbox</span></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;action=info" id="t-info">Page information</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;oldid=374285" id="t-permalink" title="Permanent link to this revision of the page">Permanent link</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;printable=yes" id="t-print" rel="alternate" title="Printable version of this page [p]" accesskey="p">Printable version</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:SpecialPages" id="t-specialpages" title="A list of all special pages [q]" accesskey="q">Special pages</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:RecentChangesLinked/SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet" id="t-recentchangeslinked" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:WhatLinksHere/SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet" id="t-whatlinkshere" title="A list of all wiki pages that link here [j]" accesskey="j">What links here</a></li></ul> </aside>
<!-- /leftcol -->
<!-- mainContent -->
<div id="mainContent" class="col-md-20">
<ul class="nav nav-tabs noprint hidden-print" role="tablist">
<li id="ca-nstab-main" class="selected"><a href="../Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html" title="View the content page [c]" accesskey="c" tabindex="-1">Page</a></li>
<li id="ca-talk" class="new"><a href="http://wiki.eclipse.org/index.php?title=Talk:SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;action=edit&amp;redlink=1" title="Discussion about the content page [t]" accesskey="t" tabindex="-1">Discussion</a></li>
<li id="ca-viewsource"><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;action=edit" title="This page is protected.&#10;You can view its source [e]" accesskey="e" tabindex="-1">View source</a></li>
<li id="ca-history" class="collapsible"><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;action=history" title="Past revisions of this page [h]" accesskey="h" tabindex="-1">History</a></li>
</ul> <div class="tab-content background-white">
<div id="tab-pane-main-page-content" class="tab-pane active">
<h1 id="firstHeading" class="firstHeading page-header">
<span dir="auto">SMILA/Documentation/HowTo/How to integrate the HelloWorld webservice as a Pipelet</span>
</h1>
<div id="main-page-content">
<!-- subtitle -->
<div id="contentSub" class="alert alert-small alert-warning"><span class="subpages">&lt; <a href="../../SMILA.html" title="SMILA">SMILA</a>&lrm; | <a href="../Documentation.1.html" title="SMILA/Documentation">Documentation</a>&lrm; | <a href="../Documentation/HowTo.html" title="SMILA/Documentation/HowTo">HowTo</a></span>(Redirected from <a href="http://wiki.eclipse.org/index.php?title=SMILA/Development_Guidelines/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;redirect=no" title="SMILA/Development Guidelines/How to integrate the HelloWorld webservice as a Pipelet">SMILA/Development Guidelines/How to integrate the HelloWorld webservice as a Pipelet</a>)</div>
<!-- /subtitle -->
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><p>This page illustrates all steps that need to be performed in order to integrate the HelloWorld web service as a <a href="../Glossary.html#P" title="SMILA/Glossary">pipelet</a> in SMILA. For general information on how to integrate components and add functionality to SMILA refer to <a href="../Howto_integrate_a_component_in_SMILA.html" title="SMILA/Howto integrate a component in SMILA" class="mw-redirect"> How to integrate a component in SMILA</a>.
</p>
<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Preparations"><span class="tocnumber">1</span> <span class="toctext">Preparations</span></a>
<ul>
<li class="toclevel-2 tocsection-2"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Create_new_bundle"><span class="tocnumber">1.1</span> <span class="toctext">Create new bundle</span></a></li>
<li class="toclevel-2 tocsection-3"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Create_Java_classes_from_WSDL_using_Axis2"><span class="tocnumber">1.2</span> <span class="toctext">Create Java classes from WSDL using Axis2</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-4"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Implementation"><span class="tocnumber">2</span> <span class="toctext">Implementation</span></a>
<ul>
<li class="toclevel-2 tocsection-5"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Read_PipeletConfiguration"><span class="tocnumber">2.1</span> <span class="toctext">Read PipeletConfiguration</span></a></li>
<li class="toclevel-2 tocsection-6"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Process_IDs_and_implement_exception_handling"><span class="tocnumber">2.2</span> <span class="toctext">Process IDs and implement exception handling</span></a></li>
<li class="toclevel-2 tocsection-7"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#evaluate_configuration_parameters"><span class="tocnumber">2.3</span> <span class="toctext">evaluate configuration parameters</span></a></li>
<li class="toclevel-2 tocsection-8"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Read_input_data"><span class="tocnumber">2.4</span> <span class="toctext">Read input data</span></a></li>
<li class="toclevel-2 tocsection-9"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Process_input_data"><span class="tocnumber">2.5</span> <span class="toctext">Process input data</span></a></li>
<li class="toclevel-2 tocsection-10"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Write_output_data"><span class="tocnumber">2.6</span> <span class="toctext">Write output data</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-11"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Configuration_and_invocation_in_BPEL"><span class="tocnumber">3</span> <span class="toctext">Configuration and invocation in BPEL</span></a></li>
<li class="toclevel-1 tocsection-12"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Build_and_Test_your_pipelet"><span class="tocnumber">4</span> <span class="toctext">Build and Test your pipelet</span></a>
<ul>
<li class="toclevel-2 tocsection-13"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Source_Code_Distribution"><span class="tocnumber">4.1</span> <span class="toctext">Source Code Distribution</span></a></li>
<li class="toclevel-2 tocsection-14"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Binary_Distribution"><span class="tocnumber">4.2</span> <span class="toctext">Binary Distribution</span></a></li>
<li class="toclevel-2 tocsection-15"><a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#Troubleshooting"><span class="tocnumber">4.3</span> <span class="toctext">Troubleshooting</span></a></li>
</ul>
</li>
</ul>
</div>
<h2><span class="mw-headline" id="Preparations">Preparations</span></h2>
<p>It may be helpful to first take a look at the SMILA <a href="../Development_Guidelines.1.html" title="SMILA/Development Guidelines">Development guidelines</a> as many topics that are beyond the scope of this tutorial are illustrated there.
</p>
<h3><span class="mw-headline" id="Create_new_bundle">Create new bundle</span></h3>
<ul>
<li> Create a new bundle that should contain your pipelet. Follow the instructions on <a href="Create_a_bundle_(plug-in).html" title="SMILA/Development Guidelines/Create a bundle (plug-in)" class="mw-redirect">How to create a bundle</a> and use the following settings:
</li>
</ul>
<pre>
Project name: org.eclipse.smila.sample.pipelet
Plug-in ID: org.eclipse.smila.sample.pipelet
Plug-in Version: 1.0.0
Plug-in Name: Sample Pipelet Bundle
Plug-in Provider: your name or company
</pre>
<ul>
<li> Edit the file <tt>META-INF/MANIFEST.MF</tt> and add the following import-package dependencies as those are required to implement the basic functionalities of your pipelet:
</li>
</ul>
<pre>
Import-Package: org.apache.commons.logging;version=&quot;1.1.1&quot;,
org.eclipse.smila.blackboard;version=&quot;0.8.0&quot;,
org.eclipse.smila.datamodel;version=&quot;0.8.0&quot;,
org.eclipse.smila.processing;version=&quot;0.8.0&quot;
</pre>
<ul>
<li> To make sure that the <tt>PipeletTrackerService</tt> detects your new pipelet, create a folder <tt>SMILA-INF</tt> in the bundle and add a file <tt>HelloWorldPipelet.json</tt> to this folder:
</li>
</ul>
<pre>
{
&quot;class&quot;: &quot;org.eclipse.smila.sample.pipelet.HelloWorldPipelet&quot;,
&quot;parameters&quot;: [
{
&quot;name&quot;: &quot;IN_ATT_NAME&quot;,
&quot;type&quot;: &quot;string&quot;
},
{
&quot;name&quot;: &quot;OUT_ATT_NAME&quot;,
&quot;type&quot;: &quot;string&quot;
}
],
&quot;description&quot;: &quot;Hello World pipelet. Modifies the content of the attribut denoted by the parameter IN_ATT_NAME to the attribute denoted by the parameter OUT_ATT_NAME.&quot;
}
</pre>
<ul>
<li>Now add the folder <tt>SMILA-INF</tt> to the build.properties (or just check it in the <tt>Build</tt> view of the <tt>MANIFEST.MF</tt> file in your IDE.
</li>
</ul>
<h3><span class="mw-headline" id="Create_Java_classes_from_WSDL_using_Axis2">Create Java classes from WSDL using Axis2</span></h3>
<ul>
<li> Install Axis2 1.4.1: Download from <a rel="nofollow" class="external free" href="http://ws.apache.org/axis2/download/1_4_1/download.cgi">http://ws.apache.org/axis2/download/1_4_1/download.cgi</a> and unpack into any directory.
</li>
<li> Open a shell in the Axis2 directory and execute <tt>wsdl2java</tt> similar to this example - replace the WSDL-URL with that of the Webservice you want to use after <tt>-uri</tt>, change the package name after <tt>-p</tt> and the output directory after <tt>-o</tt>:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="text source-text"><pre class="de1">bin\wsdl2java -uri http://localhost:8081/axis2/services/HelloWorld.HelloWorldImplPort?wsdl
-d xmlbeans -p org.eclipse.smila.sample.helloworld -s -o helloworld-ws</pre></div></div>
<dl>
<dd> This creates two folders inside <tt>helloworld-ws</tt>: <tt>src</tt> and <tt>resources</tt>.
</dd>
<dd> If you do not want to run the generator inside the Axis2 installation you must set an environment variable <tt>AXIS2_HOME</tt> to the Axis2 installation directory.
</dd>
</dl>
<ul>
<li> Add Import-Package declarations with minimum versions as available in your target platform (they will be set automatically if you use the Manifest editor's Dependencies tab to add them). To run this example at least these are needed (with valid versions at the time of writing):
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="text source-text"><pre class="de1">javax.xml.stream;version=&quot;1.0.1&quot;,
org.apache.axiom.om;version=&quot;1.2.7&quot;,
org.apache.axiom.om.impl;version=&quot;1.2.7&quot;,
org.apache.axiom.om.impl.llom;version=&quot;1.2.7&quot;,
org.apache.axiom.soap;version=&quot;1.2.7&quot;,
org.apache.axis2;version=&quot;1.4.1&quot;,
org.apache.axis2.addressing;version=&quot;1.4.1&quot;,
org.apache.axis2.client;version=&quot;1.4.1&quot;,
org.apache.axis2.context;version=&quot;1.4.1&quot;,
org.apache.axis2.description;version=&quot;1.4.1&quot;,
org.apache.axis2.transport;version=&quot;1.4.1&quot;,
org.apache.axis2.transport.http;version=&quot;1.4.1&quot;,
org.apache.axis2.wsdl;version=&quot;1.4.1&quot;,
org.apache.xmlbeans;version=&quot;2.3.0&quot;,
org.apache.xmlbeans.impl.schema;version=&quot;2.3.0&quot;,
org.apache.xmlbeans.impl.values;version=&quot;2.3.0&quot;,
org.apache.xmlbeans.xml.stream;version=&quot;2.3.0&quot;</pre></div></div>
<dl>
<dd> You will not get compile errors if the import for <tt>org.apache.xmlbeans.impl.schema</tt> is missing, but it is needed during runtime.
</dd>
<dd> For more complex webservices, additional imports may be required. Check the imported generated client code for compile errors.
</dd>
</dl>
<ul>
<li> Create a source folder <tt>code/gen</tt> in your bundle and move the <b>content</b> of the generated <tt>src</tt> folder into it.
</li>
<li> Create a folder <tt>lib</tt> in your bundle, create a zip file from the <b>content</b> of the generated <tt>resources</tt> folder, change the suffix to <tt>jar</tt> and move it to <tt>lib</tt>. Refresh the bundle in your Eclipse workspace, and add this jar to the Bundle-Classpath of your bundle (Manifest editor, tab Runtime, Classpath setting).
</li>
</ul>
<p><br />
</p>
<h2><span class="mw-headline" id="Implementation">Implementation</span></h2>
<ul>
<li> Create the package <tt>org.eclipse.smila.sample.pipelet</tt> and the Java class <tt>HelloWorldPipelet</tt>.
</li>
<li> Use the following code as a template for your new class. It contains empty method bodies and a reference to the logger. In the following we are going to gradually replace the comments in this file by the corresponding code snippets. For your convenience you may also download the complete zipped source file from <a href="http://wiki.eclipse.org/images/7/75/HelloWorldPipelet_0.9.zip" class="internal" title="HelloWorldPipelet 0.9.zip">HelloWorldPipelet.zip</a>.
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="java source-java"><pre class="de1"><span class="kw1">package</span> <span class="co2">org.eclipse.smila.sample.pipelet</span>
&#160;
<span class="kw1">import</span> <span class="co2">org.apache.axis2.transport.http.HTTPConstants</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.apache.commons.logging.Log</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.apache.commons.logging.LogFactory</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.eclipse.smila.blackboard.Blackboard</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.eclipse.smila.datamodel.AnyMap</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.eclipse.smila.datamodel.Value</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.eclipse.smila.processing.Pipelet</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.eclipse.smila.processing.ProcessingException</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.eclipse.smila.processing.parameters.ParameterAccessor</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.eclipse.smila.processing.util.ProcessingConstants</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.eclipse.smila.processing.util.ResultCollector</span><span class="sy0">;</span>
&#160;
<span class="kw1">import</span> <span class="co2">com.empolis.smila.sample.helloworld.HelloWorldStub</span><span class="sy0">;</span>
&#160;
<span class="kw1">import</span> <span class="co2">demo.hw.server.SayHi</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">demo.hw.server.SayHiDocument</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">demo.hw.server.SayHiResponse</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">demo.hw.server.SayHiResponseDocument</span><span class="sy0">;</span>
&#160;
<span class="kw1">public</span> <span class="kw1">class</span> HelloWorldPipelet <span class="kw1">implements</span> Pipelet <span class="br0">&#123;</span>
&#160;
<span class="co1">// additional member variables or constants</span>
<span class="kw1">private</span> <span class="kw1">final</span> Log _log <span class="sy0">=</span> LogFactory.<span class="me1">getLog</span><span class="br0">&#40;</span>getClass<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&#160;
<span class="kw1">public</span> HelloWorldPipelet<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
<span class="br0">&#125;</span>
&#160;
<span class="kw1">public</span> <span class="kw4">void</span> configure<span class="br0">&#40;</span><span class="kw1">final</span> AnyMap configuration<span class="br0">&#41;</span> <span class="kw1">throws</span> ProcessingException <span class="br0">&#123;</span>
<span class="co1">// read the configuration properties</span>
<span class="br0">&#125;</span>
&#160;
<span class="kw1">public</span> <span class="kw3">String</span><span class="br0">&#91;</span><span class="br0">&#93;</span> process<span class="br0">&#40;</span><span class="kw1">final</span> Blackboard blackboard, <span class="kw1">final</span> <span class="kw3">String</span><span class="br0">&#91;</span><span class="br0">&#93;</span> recordIds<span class="br0">&#41;</span> <span class="kw1">throws</span> ProcessingException <span class="br0">&#123;</span>
<span class="co1">// process the recordIds and create a result</span>
<span class="kw1">return</span> <span class="kw2">null</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>
<h3><span class="mw-headline" id="Read_PipeletConfiguration">Read PipeletConfiguration</span></h3>
<ul>
<li> First let's create two constants for the property names used in the configuration (or the parameters section of the records to be processed) to retrieve the names of the source and target attribute. Replace the comment "<tt>// additional member variables or constants</tt>" with the following code snippet.
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="java source-java"><pre class="de1"> <span class="kw1">private</span> <span class="kw1">final</span> <span class="kw3">String</span> PROP_IN_ATT_NAME <span class="sy0">=</span> <span class="st0">&quot;IN_ATT_NAME&quot;</span><span class="sy0">;</span>
&#160;
<span class="kw1">private</span> <span class="kw1">final</span> <span class="kw3">String</span> PROP_OUT_ATT_NAME <span class="sy0">=</span> <span class="st0">&quot;OUT_ATT_NAME&quot;</span><span class="sy0">;</span>
&#160;
<span class="kw1">private</span> AnyMap _config<span class="sy0">;</span></pre></div></div>
<ul>
<li> Then we are going to store the the <tt>PipeletConfiguration</tt> in method <tt>configure(final AnyMap configuration)</tt> for later evalutaion in <tt>process(final Blackboard blackboard, final String[] recordIds)</tt>. So we will allow the user of this pipelet to either use the pipelet configuration to configure the attributes as well as the records themselves (e.g. the administrator could define the attributes in a job, these job properties can override default pipelet configuration properties when using the <tt>ParameterAccessor</tt> in the process method).
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="java source-java"><pre class="de1">@Override
<span class="kw1">public</span> <span class="kw4">void</span> configure<span class="br0">&#40;</span><span class="kw1">final</span> AnyMap configuration<span class="br0">&#41;</span> <span class="kw1">throws</span> ProcessingException <span class="br0">&#123;</span>
_config <span class="sy0">=</span> configuration<span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>
<p><b>Note</b>: It would also be possible to use and configure member variables directly in the configure method and not use the ParameterAccessor to retrieve configuration parameters in the process method. You can do so for properties that won't change during operation or will always stay the same for each record, no matter what the parameters of the record contain. Or for lengthy initialization like reading and parsing configuration from files and such. In these cases you should use member variables that are initialized in the configuration method using only the information from the PipeletConfiguration. but you should clearly document which parameters can only be defined with the PipeletConfiguration and which can be overridden in the records.
</p>
<h3><span class="mw-headline" id="Process_IDs_and_implement_exception_handling">Process IDs and implement exception handling</span></h3>
<p>The method <tt>process(Blackboard blackboard, String[] recordIds)</tt> has two parameters:
</p>
<ul>
<li> a reference to the <a href="../Glossary.html#B" title="SMILA/Glossary">blackboard service</a> that allows access on <a href="../Glossary.html#R" title="SMILA/Glossary">records</a> and
</li>
<li> a list of record IDs to process.
</li>
</ul>
<p>&lt;The HelloWorld pipelet should therefore iterate over the IDs in the parameter <tt>recordIds</tt>, get the required data from the record identified by the ID, process this data, and store the result in the record.
</p><p>It is suggested that you use the <tt>org.eclipse.smila.processing.util.ResultCollector</tt> utility class to cope with result id collection that also provides a configurable exception handling approach. When creating the ResultCollector, you have to decide whether records that cause an exception will be excepted from the result set or if they will stay in the result set. We will use the system wide default <tt>ProcessingConstants.DROP_ON_ERROR_DEFAULT</tt> which is set to <tt>false</tt>. The ResultCollector will also check the ParameterAccessor for the parameter <tt>_failOnError</tt> (default: <tt>false</tt>).
</p><p>Let's place a <tt>try ... catch()</tt> block in the <tt>for</tt> loop to ensure that errors do only interrupt the processing of the current ID. The comments in the code serve as placeholders for the functionality described in the following sections. At the end we ask the ResulotCollector for the set of <tt>recordIds</tt> as the result of the pipelet. Replace the comment "<tt>// process the recordIds and create a result</tt>" with the following code snippet.
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="java source-java"><pre class="de1"><span class="kw1">final</span> ParameterAccessor paramAccessor <span class="sy0">=</span> <span class="kw1">new</span> ParameterAccessor<span class="br0">&#40;</span>blackboard, _config<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">final</span> ResultCollector resultCollector <span class="sy0">=</span>
<span class="kw1">new</span> ResultCollector<span class="br0">&#40;</span>paramAccessor, _log, ProcessingConstants.<span class="me1">DROP_ON_ERROR_DEFAULT</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw3">String</span> id <span class="sy0">:</span> recordIds<span class="br0">&#41;</span> <span class="br0">&#123;</span>
<span class="kw1">try</span> <span class="br0">&#123;</span>
<span class="co1">// read your configuration using the parameteraccessor</span>
paramAccessor.<span class="me1">setCurrentRecord</span><span class="br0">&#40;</span>id<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="co1">// read configuration from the accessor</span>
&#160;
<span class="co1">// Read Input Data</span>
&#160;
<span class="co1">// Process Input Data</span>
&#160;
<span class="co1">// Write Output Data</span>
&#160;
<span class="co1">// add the id for a successful operation</span>
resultCollector.<span class="me1">addResult</span><span class="br0">&#40;</span>id<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><span class="kw1">final</span> <span class="kw3">Exception</span> ex<span class="br0">&#41;</span> <span class="br0">&#123;</span>
<span class="co1">// mark the id for a failed record and let the result collector handle the exception as configured</span>
resultCollector.<span class="me1">addFailedResult</span><span class="br0">&#40;</span>id, e<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span> <span class="co1">// for</span>
&#160;
<span class="co1">// let the ResultColletor decide which ids to return:</span>
<span class="kw1">return</span> resultCollector.<span class="me1">getResultIds</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p><b>Note</b>: Most of the time the return value of a pipelet is the same set of record ids as was processed (<tt>recordIds</tt>). However, in some cases a pipelet may filter record IDs or even create new records. Then the record IDs of the records to be filtered out should not be added to the ResultCollector and new record IDs have to be added to the ResultCollector in order to get the correct set of IDs as the result of the process method.
</p>
<h3><span class="mw-headline" id="evaluate_configuration_parameters">evaluate configuration parameters</span></h3>
<p>Now we have to determine the source an target attribute names that have to be provided with the configuration parameters <tt>PROP_IN_ATT_NAME</tt> and <tt>PROP_OUT_ATT_NAME</tt>. Therefore we first have to determine the attribute names using the parameter accessor (Note: if we didn't want to let job parameters change these attributes, we could have evaluated the piplet configuration in the configure method and stored the result in member variables, but we want to be flexible here in this example).
Replace the comment <tt>// read configuration from the accessor</tt> with the following snippet:
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="java source-java"><pre class="de1"><span class="kw1">final</span> <span class="kw3">String</span> inAttName <span class="sy0">=</span> paramAccessor.<span class="me1">getRequiredParameter</span><span class="br0">&#40;</span>PROP_IN_ATT_NAME<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span>inAttName.<span class="me1">trim</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">length</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
<span class="kw1">throw</span> <span class="kw1">new</span> ProcessingException<span class="br0">&#40;</span><span class="st0">&quot;Property &quot;</span> <span class="sy0">+</span> PROP_IN_ATT_NAME <span class="sy0">+</span> <span class="st0">&quot; must not be an empty String&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="kw1">final</span> <span class="kw3">String</span> outAttName <span class="sy0">=</span> paramAccessor.<span class="me1">getRequiredParameter</span><span class="br0">&#40;</span>PROP_OUT_ATT_NAME<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span>outAttName.<span class="me1">trim</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">length</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
<span class="kw1">throw</span> <span class="kw1">new</span> ProcessingException<span class="br0">&#40;</span><span class="st0">&quot;Property &quot;</span> <span class="sy0">+</span> PROP_OUT_ATT_NAME <span class="sy0">+</span> <span class="st0">&quot; must not be an empty String&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>
<h3><span class="mw-headline" id="Read_input_data">Read input data</span></h3>
<p>Now we want to read the data of the attribute we stored in <tt>inAttName</tt>.
Replace the comment "<tt>// Read Input Data</tt>" with the following code snippet.
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="java source-java"><pre class="de1"><span class="kw3">String</span> inputValue <span class="sy0">=</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span>blackboard.<span class="me1">getMetadata</span><span class="br0">&#40;</span>id<span class="br0">&#41;</span>.<span class="me1">containsKey</span><span class="br0">&#40;</span>inAttName<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
inputValue <span class="sy0">=</span> blackboard.<span class="me1">getMetadata</span><span class="br0">&#40;</span>id<span class="br0">&#41;</span>.<span class="me1">getStringValue</span><span class="br0">&#40;</span>inAttName<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>
<p><b>Note</b>: Accessing attribute values can be achieved more generically. Therefore you have to check what data type a certain attribute contains using the method <tt>getValueType()</tt> (or the checking methods <tt>isBoolean()</tt>... etc.). Then you can use the appropriate getter method to access the raw data.
</p>
<h3><span class="mw-headline" id="Process_input_data">Process input data</span></h3>
<p>Now we will call the HelloWorld web service with the parameter <tt>inputValue</tt> and store the result in variable <tt>outputValue</tt>. Therefore we use the classes generated from WSDL by Axis2. The HelloWorld web service will return a String message in the format <tt>"Hello "</tt> + the content of variable <tt>inputValue</tt>. Replace the comment "<tt>// Process Input Data</tt>" with the following code snippet.
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="java source-java"><pre class="de1">HelloWorldStub ws <span class="sy0">=</span> <span class="kw1">new</span> HelloWorldStub<span class="br0">&#40;</span><span class="st0">&quot;http://localhost:8081/axis2/services/HelloWorld.HelloWorldImplPort&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
ws._getServiceClient<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getOptions</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setProperty</span><span class="br0">&#40;</span>HTTPConstants.<span class="me1">CHUNKED</span>, <span class="kw3">Boolean</span>.<span class="kw2">FALSE</span><span class="br0">&#41;</span><span class="sy0">;</span>
SayHiDocument sayHiDoc <span class="sy0">=</span> SayHiDocument.<span class="me1">Factory</span>.<span class="me1">newInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
SayHi sayHi <span class="sy0">=</span> sayHiDoc.<span class="me1">addNewSayHi</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
sayHi.<span class="me1">setArg0</span><span class="br0">&#40;</span>inputValue<span class="br0">&#41;</span><span class="sy0">;</span>
SayHiResponseDocument respDoc <span class="sy0">=</span> ws.<span class="me1">sayHi</span><span class="br0">&#40;</span>sayHiDoc<span class="br0">&#41;</span><span class="sy0">;</span>
SayHiResponse response <span class="sy0">=</span> respDoc.<span class="me1">getSayHiResponse</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">String</span> outputValue <span class="sy0">=</span> response.<span class="me1">getReturn</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<h3><span class="mw-headline" id="Write_output_data">Write output data</span></h3>
<p>Finally, we want to store the content of the variable <tt>outputValue</tt> in the record attribute with the name contained in variable <tt>outAttName</tt>. Therefore we have to create a new <tt>Value</tt> object and set its value. Then we only need to set this <tt>Value</tt> for the current ID on the black board.
Replace the comment "<tt>// Write Output Data</tt>" with the following code snippet.
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="java source-java"><pre class="de1"><span class="kw1">final</span> Value outLiteral <span class="sy0">=</span> blackboard.<span class="me1">getDataFactory</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">createStringValue</span><span class="br0">&#40;</span>outputValue<span class="br0">&#41;</span><span class="sy0">;</span>
blackboard.<span class="me1">getMetadata</span><span class="br0">&#40;</span>id<span class="br0">&#41;</span>.<span class="me1">put</span><span class="br0">&#40;</span>outAttName, outLiteral<span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p><b>Note</b>: The method <tt>commit(Id)</tt> of the blackboard service does not need to be called in each pipelet as it is automatically called at the end of the <a href="http://wiki.eclipse.org/index.php?title=SMILA/Glossary/&amp;action=edit&amp;redlink=1" class="new" title="SMILA/Glossary/ (page does not exist)">pipeline</a>.
</p>
<h2><span class="mw-headline" id="Configuration_and_invocation_in_BPEL">Configuration and invocation in BPEL</span></h2>
<p>In this tutorial we will integrate the HelloWorld pipelet in the SMILA indexing process just before the record is stored in the Solr core. With this configuration the input for the HelloWorld pipelet will be read from attribute <i>Title</i> and the modified output will be stored in the same attribute, overwriting the previous value.
</p>
<ul>
<li> Edit the file <tt>configuration/org.eclipse.smila.processing.bpel/pipelines/addpipeline.bpel</tt> and add the following right between the <tt>&lt;extensionActivity name="convertDocument"&gt;</tt> and the <tt>&lt;extensionActivity name="SolrIndexPipelet"&gt;</tt> section.
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;extensionActivity<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;proc:invokePipelet</span> <span class="re0">name</span>=<span class="st0">&quot;invokeHelloWorldPipelet&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;proc:pipelet</span> <span class="re0">class</span>=<span class="st0">&quot;org.eclipse.smila.sample.pipelet.HelloWorldPipelet&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;proc:variables</span> <span class="re0">input</span>=<span class="st0">&quot;request&quot;</span> <span class="re0">output</span>=<span class="st0">&quot;request&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;proc:configuration<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Value</span> <span class="re0">name</span>=<span class="st0">&quot;IN_ATT_NAME&quot;</span><span class="re2">&gt;</span></span>Title<span class="sc3"><span class="re1">&lt;/rec:Value<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Value</span> <span class="re0">name</span>=<span class="st0">&quot;OUT_ATT_NAME&quot;</span><span class="re2">&gt;</span></span>Title<span class="sc3"><span class="re1">&lt;/rec:Value<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/proc:Property<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/proc:configuration<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/proc:invokePipelet<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/extensionActivity<span class="re2">&gt;</span></span></span></pre></div></div>
<h2><span class="mw-headline" id="Build_and_Test_your_pipelet">Build and Test your pipelet</span></h2>
<p>Depending on the SMILA distribution you are using you have different options how to build and test your pipelet:
</p>
<h3><span class="mw-headline" id="Source_Code_Distribution">Source Code Distribution</span></h3>
<p>You can simply integrate your pipelet in the SMILA build process. Refer to the instructions on <a href="How_to_integrate_new_bundle_into_build_process.html" title="SMILA/Development Guidelines/How to integrate new bundle into build process" class="mw-redirect">How to integrate a new bundle into build process</a> for details. You can build your SMILA application and run it as usual.
</p><p>In addition to building the SMILA application you can also directly run SMILA within your eclipse IDE. To test your pipelet, you have to include the bundle in the OSGi launch configuration:
</p>
<ul>
<li> Open <i>Run &gt; Open Run Dialog</i>.
</li>
<li> In the left window select <i>OSGi Framework &gt; SMILA</i>.
</li>
<li> In the right window expand <i>Workspace</i> and select <i>org.eclipse.smila.sample.pipelet</i>.
</li>
<li> Set the <i>Default Auto-Start</i> option to <i>true</i>.
</li>
<li> Click the <i>Apply</i> button.
</li>
<li> Launch SMILA by clicking the <i>Run</i> button.
</li>
</ul>
<h3><span class="mw-headline" id="Binary_Distribution">Binary Distribution</span></h3>
<p>To test your pipelet you have to add it as a plugin to your SMILA installation.
</p>
<ul>
<li> export your pipelet as a plugin using eclipse IDE wizards. Refer to the instructions on <a href="How_to_export_a_bundle.html" title="SMILA/Development Guidelines/How to export a bundle" class="mw-redirect">How to export a bundle</a> for a step by step description.
</li>
<li> Copy your plugin to the directory <tt>%SMILA_HOME%/plugins</tt>.
</li>
<li> Add the following XML snippet to the file <tt>%SMILA_HOME%/features/org.eclipse.smila.feature_1.0.0/feature.xml</tt>:
</li>
</ul>
<p><code lang="XML">
</p>
<pre> &lt;plugin
id="org.eclipse.smila.sample.pipelet"
download-size="0"
install-size="0"
version="1.0.0"
unpack="false"/&gt;
</pre>
<p></code>
</p>
<ul>
<li> Launch SMILA by starting <tt>SMILA.exe</tt>.
</li>
</ul>
<p>If SMILA is running, you can start a crawling job as described in <a href="../Development_Guidelines.1.html#Run_and_manage_the_connectivity_framework" title="SMILA/Development Guidelines">Run and manage the connectivity framework</a> beginning at step 5.
While crawling your data source you can already search for indexed documents. Open your browser, navigate to <a rel="nofollow" class="external free" href="http://localhost:8080/SMILA/search">http://localhost:8080/SMILA/search</a> and execute a query. In the result table take a look at the attribute <b>Title</b>. Every <b>Title</b> should now have the suffix <tt>"modified by HelloWorldPipelet"</tt>, as this was added by the pipelet.
</p>
<h3><span class="mw-headline" id="Troubleshooting">Troubleshooting</span></h3>
<p>If there are any problems please take a look at the log files <tt>SMILA.log</tt> and <tt>/workspace/.metadata/.log</tt> and feel free to ask for support at the <a rel="nofollow" class="external text" href="http://www.eclipse.org/smila/newsgroup.php">SMILA Newsgroup</a>.
</p>
<!--
NewPP limit report
CPU time usage: 0.540 seconds
Real time usage: 0.545 seconds
Preprocessor visited node count: 186/1000000
Preprocessor generated node count: 346/1000000
Post‐expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 2/40
Expensive parser function count: 0/100
-->
<!-- Saved in parser cache with key my_wiki:pcache:idhash:16093-0!*!0!!en!*!* and timestamp 20150414084530 and revision id 374285
-->
</div>
<!-- catlinks -->
<div id='catlinks' class='catlinks'><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="http://wiki.eclipse.org/Special:Categories" title="Special:Categories">Category</a>: <ul><li><a href="http://wiki.eclipse.org/Category:SMILA" title="Category:SMILA">SMILA</a></li></ul></div></div> <!-- /catlinks -->
</div>
</div>
</div>
</div>
<!-- /maincontent -->
<!-- printfooter -->
<div class="printfooter">
Retrieved from "<a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;oldid=374285">http://wiki.eclipse.org/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;oldid=374285</a>" </div>
<!-- /printfooter -->
<!-- debughtml -->
<!-- /debughtml -->
</div>
<!-- /bodyContent -->
</section>
<!-- /content -->
<!-- footer -->
</div> <section id="footer-contribution-info" style="border-top:1px solid #ccc;" class="footer-offset background-white margin-top-25"><div class="container text-center padding-top-10 padding-bottom-10"><p id="footercredit">This page was last modified 06:26, 27 November 2014 by <a href="http://wiki.eclipse.org/User:Andreas.weber.empolis.com" title="User:Andreas.weber.empolis.com">Andreas Weber</a>. Based on work by <a href="http://wiki.eclipse.org/index.php?title=User:Juergen.schumacher.attensity.com&amp;action=edit&amp;redlink=1" class="new" title="User:Juergen.schumacher.attensity.com (page does not exist)">Juergen Schumacher</a>, <a href="http://wiki.eclipse.org/index.php?title=User:Daniel.stucky.attensity.com&amp;action=edit&amp;redlink=1" class="new" title="User:Daniel.stucky.attensity.com (page does not exist)">Daniel Stucky</a> and <a href="http://wiki.eclipse.org/User:Andreas.schank.attensity.com" title="User:Andreas.schank.attensity.com">A. Schank</a> and <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/HowTo/How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet&amp;action=credits" title="SMILA/Documentation/HowTo/How to integrate the HelloWorld webservice as a Pipelet">others</a>.</p><p id="footerviews">This page has been accessed 9,156 times.</p></div></section> </main> <!-- /#main-content-container-row -->
<p id="back-to-top" class="noprint hidden-print">
<a class="visible-xs" href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#top">Back to the top</a>
</p>
<footer role="contentinfo" class="noprint hidden-print">
<div class="container">
<div class="row">
<section id="footer-eclipse-foundation" class="col-xs-offset-1 col-xs-11 col-sm-7 col-md-6 col-md-offset-0">
<h2 class="section-title">Eclipse Foundation</h2>
<ul class="nav">
<li><a href="https://eclipse.org/org/">About us</a></li>
<li><a href="https://eclipse.org/org/foundation/contact.php">Contact Us</a></li>
<li><a href="https://eclipse.org/donate">Donate</a></li>
<li><a href="https://eclipse.org/org/documents/">Governance</a></li>
<li><a href="https://eclipse.org/artwork/">Logo and Artwork</a></li>
<li><a href="https://eclipse.org/org/foundation/directors.php">Board of Directors</a></li>
</ul>
</section>
<section id="footer-legal" class="col-xs-offset-1 col-xs-11 col-sm-7 col-md-6 col-md-offset-0">
<h2 class="section-title">Legal</h2>
<ul class="nav">
<li><a href="https://eclipse.org/legal/privacy.php">Privacy Policy</a></li>
<li><a href="https://eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
<li><a href="https://eclipse.org/legal/copyright.php">Copyright Agent</a></li>
<li><a href="https://eclipse.org/org/documents/epl-v10.php">Eclipse Public License </a></li>
<li><a href="https://eclipse.org/legal/">Legal Resources </a></li>
</ul>
</section>
<section id="footer-useful-links" class="col-xs-offset-1 col-xs-11 col-sm-7 col-md-6 col-md-offset-0">
<h2 class="section-title">Useful Links</h2>
<ul class="nav">
<li><a href="https://bugs.eclipse.org/bugs/">Report a Bug</a></li>
<li><a href="http://help.eclipse.org/">Documentation</a></li>
<li><a href="https://eclipse.org/contribute/">How to Contribute</a></li>
<li><a href="https://eclipse.org/mail/">Mailing Lists</a></li>
<li><a href="https://eclipse.org/forums/">Forums</a></li>
<li><a href="http://marketplace.eclipse.org/">Marketplace</a></li>
</ul>
</section>
<section id="footer-other" class="col-xs-offset-1 col-xs-11 col-sm-7 col-md-6 col-md-offset-0">
<h2 class="section-title">Other</h2>
<ul class="nav">
<li><a href="https://eclipse.org/ide/">IDE and Tools</a></li>
<li><a href="https://eclipse.org/projects">Community of Projects</a></li>
<li><a href="https://eclipse.org/org/workinggroups/">Working Groups</a></li>
</ul>
<ul class="list-inline social-media">
<li><a href="https://twitter.com/EclipseFdn"><i class="fa fa-twitter-square"></i></a></li>
<li><a href="https://plus.google.com/+Eclipse"><i class="fa fa-google-plus-square"></i></a></li>
<li><a href="https://www.facebook.com/eclipse.org"><i class="fa fa-facebook-square"></i> </a></li>
<li><a href="https://www.youtube.com/user/EclipseFdn"><i class="fa fa-youtube-square"></i></a></li>
</ul>
</section>
<div id="copyright" class="col-xs-offset-1 col-sm-14 col-md-24 col-md-offset-0">
<div>
<span><img src="http://eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-logo-bw-800x188.png" alt="Eclipse.org black and white logo" width="166" height="39" id="logo-eclipse-white"/></span>
<p id="copyright-text">Copyright &copy; 2014 The Eclipse Foundation. All Rights Reserved.</p>
</div>
</div>
<a href="How_to_integrate_the_HelloWorld_webservice_as_a_Pipelet.html#" class="scrollup">Back to the top</a>
</div>
</div>
</footer>
<script src="http://wiki.eclipse.org/skins/solstice/public/javascript/main.min.js"></script>
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-910670-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script> <!-- /footer -->
<script>/*<![CDATA[*/window.jQuery && jQuery.ready();/*]]>*/</script><script>if(window.mw){
mw.loader.state({"skins.solstice":"loading","site":"ready","user":"ready","user.groups":"ready"});
}</script>
<script src="http://wiki.eclipse.org/load.php?debug=false&amp;lang=en&amp;modules=skins.solstice&amp;only=scripts&amp;skin=solstice&amp;*"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.searchSuggest"],null,true);
}</script>
<script>if(window.mw){
mw.config.set({"wgBackendResponseTime":388});
}</script> </body>
</html>