blob: 67a4e504bcf79bd22262a51b329c9c8db33fe945 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" />
<title>SMILA/Documentation/Scripting - 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="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/Scripting","wgTitle":"SMILA/Documentation/Scripting","wgCurRevisionId":381589,"wgRevisionId":381589,"wgArticleId":45918,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"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/Scripting","wgIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"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>
<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_Scripting skin-solstice action-view" id="solstice">
<a class="sr-only" href="Scripting.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="Scripting.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="Scripting.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="Scripting.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/Scripting</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%2FScripting">
<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="Scripting.html#mw-head">navigation</a>,
<a href="Scripting.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/Scripting&amp;action=info">Page information</option><option value="/index.php?title=SMILA/Documentation/Scripting&amp;oldid=381589">Permanent link</option><option value="/index.php?title=SMILA/Documentation/Scripting&amp;printable=yes">Printable version</option><option value="/Special:SpecialPages">Special pages</option><option value="/Special:RecentChangesLinked/SMILA/Documentation/Scripting">Related changes</option><option value="/Special:WhatLinksHere/SMILA/Documentation/Scripting">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/Scripting&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/Scripting&amp;oldid=381589" 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/Scripting&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/Scripting" 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/Scripting" 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="active"><a href="Scripting.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/Scripting&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/Scripting&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/Scripting&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/Scripting</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></span></div>
<!-- /subtitle -->
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="Scripting.html#Scripting_SMILA_using_JavaScript"><span class="tocnumber">1</span> <span class="toctext">Scripting SMILA using JavaScript</span></a>
<ul>
<li class="toclevel-2 tocsection-2"><a href="Scripting.html#Service_Description"><span class="tocnumber">1.1</span> <span class="toctext">Service Description</span></a>
<ul>
<li class="toclevel-3 tocsection-3"><a href="Scripting.html#Script_Basics"><span class="tocnumber">1.1.1</span> <span class="toctext">Script Basics</span></a></li>
<li class="toclevel-3 tocsection-4"><a href="Scripting.html#Exposing_Script_Functions"><span class="tocnumber">1.1.2</span> <span class="toctext">Exposing Script Functions</span></a></li>
<li class="toclevel-3 tocsection-5"><a href="Scripting.html#Configuration"><span class="tocnumber">1.1.3</span> <span class="toctext">Configuration</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-6"><a href="Scripting.html#Scripting_Features_.28.22SDK.22.29"><span class="tocnumber">1.2</span> <span class="toctext">Scripting Features ("SDK")</span></a>
<ul>
<li class="toclevel-3 tocsection-7"><a href="Scripting.html#Working_with_Java_Classes"><span class="tocnumber">1.2.1</span> <span class="toctext">Working with Java Classes</span></a></li>
<li class="toclevel-3 tocsection-8"><a href="Scripting.html#Working_with_Records"><span class="tocnumber">1.2.2</span> <span class="toctext">Working with Records</span></a></li>
<li class="toclevel-3 tocsection-9"><a href="Scripting.html#Accessing_OSGi_Services"><span class="tocnumber">1.2.3</span> <span class="toctext">Accessing OSGi Services</span></a></li>
<li class="toclevel-3 tocsection-10"><a href="Scripting.html#Using_Pipelets"><span class="tocnumber">1.2.4</span> <span class="toctext">Using Pipelets</span></a></li>
<li class="toclevel-3 tocsection-11"><a href="Scripting.html#Using_other_Scripts:_require"><span class="tocnumber">1.2.5</span> <span class="toctext">Using other Scripts: require</span></a></li>
<li class="toclevel-3 tocsection-12"><a href="Scripting.html#Logging"><span class="tocnumber">1.2.6</span> <span class="toctext">Logging</span></a></li>
<li class="toclevel-3 tocsection-13"><a href="Scripting.html#Debugging"><span class="tocnumber">1.2.7</span> <span class="toctext">Debugging</span></a></li>
<li class="toclevel-3 tocsection-14"><a href="Scripting.html#ScriptProcessorWorker"><span class="tocnumber">1.2.8</span> <span class="toctext">ScriptProcessorWorker</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-15"><a href="Scripting.html#HTTP_REST_API"><span class="tocnumber">1.3</span> <span class="toctext">HTTP REST API</span></a>
<ul>
<li class="toclevel-3 tocsection-16"><a href="Scripting.html#Managing_Scripts"><span class="tocnumber">1.3.1</span> <span class="toctext">Managing Scripts</span></a></li>
<li class="toclevel-3 tocsection-17"><a href="Scripting.html#Executing_Scripts"><span class="tocnumber">1.3.2</span> <span class="toctext">Executing Scripts</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-18"><a href="Scripting.html#Examples"><span class="tocnumber">1.4</span> <span class="toctext">Examples</span></a></li>
</ul>
</li>
</ul>
</div>
<h2><span class="mw-headline" id="Scripting_SMILA_using_JavaScript">Scripting SMILA using JavaScript</span></h2>
<div class="messagebox" style="background-color: #def3fe; border: 1px solid #c5d7e0; color: black; padding: 5px; margin: 1ex 0; min-height: 35px; padding-left: 45px;">
<div style="float: left; margin-left: -40px;"><a href="http://wiki.eclipse.org/File:Note.png" class="image"><img alt="Note.png" src="http://wiki.eclipse.org/images/c/cc/Note.png" width="35" height="35" /></a></div>
<div><b> Available since SMILA 1.3!</b><br /></div>
</div>
<p><br />
</p>
<h3><span class="mw-headline" id="Service_Description">Service Description</span></h3>
<ul>
<li> Bundles: <tt>org.eclipse.smila.scripting(.test)</tt>
</li>
<li> OSGi service interface: <tt>org.eclipse.smila.scripting.ScriptingEngine</tt>
</li>
<li> Service implementation: <tt>org.eclipse.smila.scripting.internal.JavascriptEngine</tt>
</li>
</ul>
<p>The ScriptingEngine provides an alternative for describing "synchronous workflows" by using JavaScript functions instead of BPEL processes. This approach is easier, more flexible, and more maintainable (e.g. debugable), so one day the BPEL approach might be removed completely.
</p>
<h4><span class="mw-headline" id="Script_Basics">Script Basics</span></h4>
<p>A JavaScript function for SMILA scripting takes one record (including attachments) as an argument, and can return one record (other return types are supported, too and wrapped in a record automatically). For example, a file <tt>helloWorld.js</tt> (the suffix must be ".js") could look like this:
</p>
<pre>
function greetings(record) {
record.greetings = &quot;Hello &quot; + record.name + &quot;!&quot;;
return record;
}
</pre>
<p>Script files to execute are added by default to <tt>SMILA/configuration/org.eclipse.smila.scripting/js</tt>. They are currently loaded "on-demand" and not stored in the service for reuse, so changes in the files will be effective for the next execution.
</p><p>A script is invoked using the <tt>ScriptingEngine.callScript()</tt> methods. The first argument of both methods is a <tt>scriptName</tt> string in format <tt>&lt;file&gt;.&lt;function&gt;</tt> where the <tt>&lt;file&gt;</tt> part is the name of the script file (without path and ".js" suffix) and the <tt>&lt;function&gt;</tt> part is the name of a function defined in this file.
</p>
<h4><span class="mw-headline" id="Exposing_Script_Functions">Exposing Script Functions</span></h4>
<p>The script directory can contain "script catalog" files. They can be used to expose and describe available scripts in the ReST API so that a client can detect available scripts. Such a file must be named <tt>&lt;prefix&gt;ScriptCatalog.js</tt>, e.g. <tt>smilaScriptCatalog.js</tt>, and must have this format:
</p>
<pre>
[
{
name: &quot;helloWorld.greetings&quot;,
description: &quot;Get a Hello from SMILA!&quot;
},
// ... more function descriptions
]
</pre>
<p>A catalog file does not define functions, it just produces an array of script function descriptions. A description object must contain a <tt>name</tt> property, we also recommend including a <tt>description</tt> property. Other properties can be added as you like (e.g. a structured description of expected parameters in the passed record).
</p><p>The <tt>ScriptingEngine.listScripts()</tt> method merges the arrays produced by all catalog scripts into one array (elements that are not objects or do not have a <tt>name</tt> property are ignored) and sorts them by name.
</p><p>The <tt>name</tt> property must be in format <tt>&lt;file&gt;.&lt;function&gt;</tt>, as described above for the <tt>scriptName</tt> parameter of the <tt>callScripts()</tt> functions.
</p>
<h4><span class="mw-headline" id="Configuration">Configuration</span></h4>
<p>The script directory can be changed on startup using a system property: <tt>SMILA -Dsmila.scripting.dir=/home/smila/js ...</tt>. The system property can also be added to <tt>SMILA.ini</tt>, of course.
</p>
<h3><span class="mw-headline" id="Scripting_Features_.28.22SDK.22.29">Scripting Features ("SDK")</span></h3>
<p>See the <a rel="nofollow" class="external text" href="https://developer.mozilla.org/en-US/docs/Rhino_documentation">Rhino Documentation</a> for special JavaScript features available in Rhino. They should work in SMILA, too. Especially the predefined functions available in <a rel="nofollow" class="external text" href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Shell#Predefined_Properties">Rhino Shell</a> should work in SMILA, too (if they are useful). For example, you can use <tt>print(...)</tt> to write something to the console:
</p>
<pre>
print(&quot;Hello World!&quot;);
</pre>
<p>(However, the <tt>quit()</tt> function will do nothing&#160;;-)
</p>
<h4><span class="mw-headline" id="Working_with_Java_Classes">Working with Java Classes</span></h4>
<p>You can use any Java class exported by any bundle in the SMILA-VM in your JavaScripts. This includes of course the standard Java SDK classes, too (i.e. java.lang, java.io, java.util, ...), for example:
</p>
<pre>
record.currentDate = new java.util.Date();
</pre>
<p>See <a rel="nofollow" class="external text" href="http://archive.eclipse.org/rt/smila/javadoc/current/">SMILA JavaDoc</a> for description of classes provided by SMILA.
</p><p>See <a rel="nofollow" class="external text" href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scripting_Java">Scripting Java with Rhino</a> for details.
</p>
<h4><span class="mw-headline" id="Working_with_Records">Working with Records</span></h4>
<p>The record passed to the script can be accessed just like a native JavaScript object. The record attributes are just treated as object properties:
</p>
<pre>
record.string = &quot;a string&quot;;
record[&quot;integer&quot;] = 42;
record.double = 3.14;
record.boolean = true;
record.map = {
key&#160;: &quot;value&quot;
};
record.sequence = [ &quot;Hello&quot;, record.string, record.integer, record.double ];
delete record.name;
</pre>
<p>Iterating over maps and sequences is possible, too:
</p>
<pre>
for ( var key in record.map) {
print(&quot;map &quot; + key + &quot; to &quot; + record.map.key);
}
for ( var index in record.sequence) {
print(&quot;element &quot; + index + &quot;: &quot; + record.sequence[index]);
}
</pre>
<p>To add elements to sequences, set the value of index <tt>sequence.length</tt>:
</p>
<pre>
record.sequence[record.sequence.length] = &quot;added element&quot;;
</pre>
<p>The methods of the Javascript Array objects (e.g. push(), concat(), ...) are currently not supported by SMILA sequence objects.
</p><p>The record object has the following three special properties whose names start with a dollar sign ($):
</p>
<ul>
<li> <tt>$id</tt>: The string value of the attribute <tt>_recordid</tt>. This is just a convenience property. It can be used to read and write the record ID:
</li>
</ul>
<pre>
var recordId = record.$id;
record.$id = &quot;changed-id&quot;;
</pre>
<ul>
<li> <tt>$metadata</tt>: In some cases it is necessary to use the actual <tt>AnyMap</tt> object containing the record metadata, for example if you want to call a Java method that defines a parameter of type <tt>Any</tt> or <tt>AnyMap</tt>:
</li>
</ul>
<pre>
var writer = new org.eclipse.smila.datamodel.ipc.IpcAnyWriter(true);
var recordAsJson = writer.writeJsonObject(record.$metadata);
</pre>
<ul>
<li> <tt>$attachments</tt>: Contains an object that provides access to the record's attachments. Its properties correspond to attachment names and can be used to get and set attachment contents of the record.<br /> When reading an attachment, an actual <tt>org.eclipse.smila.datamodel.Attachment</tt> object is returned that can be access by using the Java methods and passed to other Java objects:
</li>
</ul>
<pre>
var attachment = record.$attachments.Content;
var contentLength = attachment.size();
var contentAsByteArray = attachment.getAsBytes();
var contentAsStream = attachment.getAsStream();
var contentAsString = new java.lang.String(contentAsByteArray, &quot;utf-8&quot;);
</pre>
<p>To set an attachment, several types of objects are supported to provide the content:
</p>
<ul>
<li> Java byte Arrays, of course:
</li>
</ul>
<pre>
record.$attachment.fromBytes = contentAsByteArray;
</pre>
<ul>
<li> String (more exactly, <tt>java.lang.CharSequence</tt>) objects are converted to byte arrays using UTF-8 encoding:
</li>
</ul>
<pre>
record.$attachments.fromString = &quot;string attached&quot;;
</pre>
<ul>
<li> <tt>java.io.InputStream</tt> objects are read into an byte array and set as an attachment. The stream will be closed after the operation:
</li>
</ul>
<pre>
var stream = new FileInputStream(filename);
record.$attachments.fromStream = stream
</pre>
<ul>
<li> An <tt>org.eclipse.smila.datamodel.Attachment</tt> can be used, too. If the names match, the actual Attachment object will just be attached to the record. Else the implementation will fetch the content from the source attachment and create a new <tt>Attachment</tt> object from it (with the current implementation of attachments in SMILA this will NOT result in copying the actual <tt>byte[]</tt>). If getting the content does not work, an error will be thrown (however, this cannot happen currently).
</li>
</ul>
<pre>
record.$attachments.copyAttachment = record.$attachments.originalAttachment
</pre>
<p>To delete an attachment, use the <tt>delete</tt> operator:
</p>
<pre>
delete record.$attachments.Content;
</pre>
<p><tt>record.$attachments</tt> and <tt>record.$metadata</tt> cannot be used for write access themselves. The <tt>delete</tt> operator will not work on any of the special properties.
</p>
<h4><span class="mw-headline" id="Accessing_OSGi_Services">Accessing OSGi Services</span></h4>
<p>Any active OSGi services in the SMILA VM can be easily accessed from within a script. Just use the globally registered <tt>services</tt> object. For example:
</p>
<ul>
<li> Use LanguageIdentifier service:
</li>
</ul>
<pre>
var languageId = services.find(&quot;org.eclipse.smila.common.language.LanguageIdentifyService&quot;);
record.language = languageId.identify(record.Content).getIsoLanguage();
</pre>
<ul>
<li> Write record to ObjectStore:
</li>
</ul>
<pre>
var objectstore = services.find(&quot;org.eclipse.smila.objectstore.ObjectStoreService&quot;);
objectstore.ensureStore(&quot;store-created-by-script&quot;);
var bonWriter = new org.eclipse.smila.datamodel.ipc.IpcAnyWriter(true);
var bonObject = bonWriter.writeBinaryObject(record.$metadata);
objectstore.putObject(&quot;store-created-by-script&quot;, &quot;bon-object&quot;, bonObject);
</pre>
<p>See the service documentations for details on how to use them.
</p>
<h4><span class="mw-headline" id="Using_Pipelets">Using Pipelets</span></h4>
<p>It is also possible to use pipelets. You must create a pipelet instance first using the global <tt>pipelets.create</tt> function and a configuration object, then you can invoke the created pipelet instance using the <tt>process</tt> function of the instance:
</p>
<pre>
function processTika(record)
var tikaConfig = {
&quot;inputType&quot;&#160;: &quot;ATTRIBUTE&quot;,
&quot;outputType&quot;&#160;: &quot;ATTRIBUTE&quot;,
&quot;inputName&quot;&#160;: &quot;Content&quot;,
&quot;outputName&quot;&#160;: &quot;PlainContent&quot;,
&quot;contentTypeAttribute&quot;&#160;: &quot;MimeType&quot;,
&quot;exportAsHtml&quot;&#160;: false,
&quot;maxLength&quot;&#160;: &quot;-1&quot;,
&quot;extractProperties&quot;&#160;: [ {
&quot;metadataName&quot;&#160;: &quot;title&quot;,
&quot;targetAttribute&quot;&#160;: &quot;Title&quot;,
&quot;singleResult&quot;&#160;: true
} ]
};
var tika = pipelets.create(&quot;org.eclipse.smila.tika.TikaPipelet&quot;, tikaConfig);
tika.process(record);
return record;
</pre>
<p>The <tt>process()</tt> function accepts single records and arrays of records as well as single or arrays of <tt>JavaScript</tt> objects that can be converted to <tt>AnyMap</tt> objects. Arrays of records or objects will be processed in a single pipelet invocation.
</p><p>The <tt>process</tt> function always returns an array of records, even if only one record was given as input. That's due to the fact that some pipelets create new records resp. split the input record into multiple output records.
</p><p>So the signature of the <tt>process</tt> function looks like this:
</p>
<pre>
Record[] process(Record)
Record[] process(Record[])
Record[] process(AnyMap)
Record[] process(AnyMap[])
Record[] process(&lt;Javascript-Map&gt;)
Record[] process(&lt;Javascript-Map&gt;[])
</pre>
<p>The result of a pipelet invocation can be given to another pipelet for further processing or returned as the final function result.
</p><p><b>Using Pipelets - best practice: </b>
</p><p>In normal case, pipelets will just work on (resp. modify) given input records, but not create new records.
In this case, don't use the result of a pipelet for further script processing but just work with the input record. So you don't have to care about the <tt>process</tt> function always returning an array as result.
</p><p>Example-1: Best practice
</p>
<pre>
function processTika(record)
...
my1stPipelet.process(record);
record.greetings = &quot;Hello world&quot;;
my2ndPipelet.process(record);
...
return record;
</pre>
<p>Example-2: When working with the pipelet result, you'll have to deal with arrays:
</p>
<pre>
function processTika(record)
...
var result1 = my1stPipelet.process(record);
result1[0].greetings = &quot;Hello world&quot;;
var result2 = my2ndPipelet.process(result1);
...
return result2[0];
</pre>
<h4><span class="mw-headline" id="Using_other_Scripts:_require">Using other Scripts: <tt>require</tt></span></h4>
<p>This is basically an implementation of the <a rel="nofollow" class="external text" href="http://wiki.commonjs.org/wiki/Modules/1.1">CommonJS Module Specification</a>, so you may want to refer to details there.
</p><p>Scripts can use functions resp. objects from other scripts (aka "modules") using the global <tt>require</tt> function. The argument to <tt>require</tt> is the path to the imported script without the ".js" suffix, relative to the SMILA script directory.
</p><p>The prerequisite for using an object from another script is that it has been made available via registration in the "exports" object. The result of <tt>require</tt> is this "exports" object, so the exported functions can be accessed in the importing script via this object.
</p><p>Within one script execution, multiple <tt>require</tt> calls for one module (even from different scripts) cause the module to be loaded only once and return the same "exports" object. So the scope to which the module was loaded is shared by each importer, local variables in this context are the same regardless from where the module is called.
</p><p><b>Example:</b>
We call a function in script <tt>helloWorld.js</tt> which uses a function from script <tt>utils/myUtils.js</tt>:
</p><p>helloWorld.js
</p>
<pre>
// required scripts
var myUtils = require(&quot;utils/myUtils&quot;);
function greetings(record) {
var normalizedName = myUtils.normalize(record.name)
record.greetings = &quot;Hello &quot; + normalizedName + &quot;!&quot;;
return record;
}
</pre>
<p>utils/myUtils.js
</p>
<pre>
// objects used in other scripts
exports.normalize = normalize
function normalize(str) {
return str.toUpperCase()
}
</pre>
<p><b>Conventions</b>:
</p>
<ul>
<li> Exported functions should be exported under their original function name.
</li>
<li> The object created with require() should be named like the required script.
</li>
<li> If a script contains requires and/or exports, they should be listed at the beginning of the script, starting with the requires.
</li>
</ul>
<pre>
// required scripts
var myUtils = require(&quot;utils/myUtils&quot;);
var myCommons = require(&quot;commons/myCommons&quot;);
...
// objects used in other scripts
exports.myFunction1 = myFunction1;
exports.myFunction2 = myFunction2;
...
function myFunction1() {
...
}
function myFunction2() {
...
}
...
</pre>
<h4><span class="mw-headline" id="Logging">Logging</span></h4>
<p>To output log messages from within your scripting environment, SMILA provides two ways to do this. One way is to use the built in default logger which is accessible via the <b>log</b> object. This object is already provided within your scope.
</p>
<pre>
function logDemo() {
log.info(&quot;This msg will be logged on level &gt;&gt;info&lt;&lt;&quot;);
log.error(&quot;This msg will be logged on level &gt;&gt;error&lt;&lt;&quot;);
log.warn(&quot;This msg will be logged on level &gt;&gt;warn&lt;&lt;&quot;);
}
</pre>
<p>This log is an instance of 'org.apache.commons.logging.Log', therefore functions with an additional "Throwable" parameter for logging exceptions are available, too. See the hint below on how to use this.
</p><p>The messages can then be found in the smila.log file. Levels available are <i>trace</i>, <i>debug</i>, <i>info</i>, <i>warn</i>, <i>error</i> and <i>fatal</i>. Depending on the levels set in SMILA log4.properties, your log message may be discarded.
</p><p>If a certain level is enabled can be checked with:
</p>
<pre>
boolean log.isTraceEnabled();
boolean log.isDebugEnabled();
boolean log.isInfoEnabled();
boolean log.isWarnEnabled();
boolean log.isErrorEnabled();
boolean log.isFatalEnabled();
</pre>
<p>The other way is to create a custom logger. To do so the environment exposes a vanila <i>org.apache.commons.logging.LogFactory</i> to the script contexts.
</p>
<pre>
function logFactoryDemo() {
var myLogger = LogFactory.getLog(&quot;myLogger&quot;);
myLogger.info(&quot;This is a log message&quot;);
}
</pre>
<p><i>Hint</i>: To log exceptions thrown by Java classes (pipelets, services, ...), catch the JavaScript Error and use it's property "javaException" when calling the log method:
</p>
<pre>
try {
// call pipelets or services
} catch (e) {
log.error(&quot;Error processing record &quot; + record.$id, e.javaException);
}
</pre>
<h4><span class="mw-headline" id="Debugging">Debugging</span></h4>
<p>Yes, it is possible. See <a href="Scripting/Debugging.html" title="SMILA/Documentation/Scripting/Debugging">SMILA/Documentation/Scripting/Debugging</a>.
</p>
<h4><span class="mw-headline" id="ScriptProcessorWorker">ScriptProcessorWorker</span></h4>
<p>The <a href="Worker/ScriptProcessorWorker.html" title="SMILA/Documentation/Worker/ScriptProcessorWorker"> ScriptProcessorWorker</a> is a <a href="../Glossary.html#W" title="SMILA/Glossary">worker</a> designed to process (synchronous) script calls inside an <a href="../Glossary.html#W" title="SMILA/Glossary">asynchronous workflow</a>.
</p>
<h3><span class="mw-headline" id="HTTP_REST_API">HTTP REST API</span></h3>
<p>Scripts handled via ReST API must be located on top level of the configured script folder, i.e. scripts in subfolders can currently not be called via ReST API.
</p>
<h4><span class="mw-headline" id="Managing_Scripts">Managing Scripts</span></h4>
<p><b>URL</b>
</p><p><tt>http://&lt;hostname&gt;:8080/smila/script</tt>
</p><p><b>Methods</b>
</p><p>GET: list exposed scripts - show the result of <tt>ScriptingEngine.listScripts()</tt>.
</p><p><b>Request</b>
</p><p>No parameters, no request body.
</p><p><b>Response</b>
</p><p>Result of <tt>ScriptingEngine.listScripts()</tt>, wrapped as a JSON object with property "scripts" containing the array of script descriptions:
</p>
<pre>
{
&quot;scripts&quot;: [
{
&quot;name&quot;: &quot;helloWorld.greetings&quot;,
&quot;description&quot;: &quot;Get a Hello from SMILA!&quot;,
&quot;url&quot;: &quot;http://localhost:8080/smila/script/helloWorld.greetings/&quot;
}
]
}
</pre>
<p><b>URL</b>
</p><p><tt>http://&lt;hostname&gt;:8080/smila/script/&lt;scriptfile&gt;.&lt;function&gt;</tt>
</p><p><b>Methods</b>
</p><p>GET: show script description.
</p><p><b>Request</b>
</p><p>No parameters, no request body.
</p><p><b>Response</b>
</p><p>Description object from the above list with the matching name.
</p><p><b>Response Codes</b>
</p>
<ul>
<li> 200 OK: Success
</li>
<li> 404 Not Found: Function is not exposed in any ScriptCatalog file.
</li>
</ul>
<p><b>Example Request</b>
</p>
<pre>
GET /smila/script/helloWorld.greetings/
</pre>
<p><b>Example Response</b>
</p>
<pre>
{
&quot;name&quot;: &quot;helloWorld.greetings&quot;,
&quot;description&quot;: &quot;Get a Hello from SMILA!&quot;,
&quot;url&quot;: &quot;http://localhost:8080/smila/script/helloWorld.greetings/&quot;
}
</pre>
<h4><span class="mw-headline" id="Executing_Scripts">Executing Scripts</span></h4>
<p><b>URL</b>
</p><p><tt>http://&lt;hostname&gt;:8080/smila/script/&lt;script-file&gt;.&lt;function&gt;</tt>
</p><p><b>Methods</b>
</p><p>POST: execute script with record in request body. Attachments are supported, too.
</p><p><b>Response</b>
</p><p>Metadata part of result of ScriptingEngine.callScript("&lt;script-file&gt;.&lt;function&gt;", requestRecord). If the result contains attachments they are not returned via the ReST API.
</p><p><b>Response-Codes</b>
</p>
<ul>
<li> 200 OK: Script executed successfully.
</li>
<li> 400 Bad Request: Last URL part does not have &lt;script-file&gt;.&lt;function&gt; format, or error in Script execution
</li>
<li> 404 Not Found: Script file does not exist or does not contain the function
</li>
</ul>
<p><b>Example Request</b>
</p>
<pre>
POST http://localhost:8080/smila/script/helloWorld.greetings
{
&quot;name&quot;: &quot;Juergen&quot;
}
</pre>
<p><b>Example Response</b>
</p>
<pre>
{
&quot;name&quot;: &quot;Juergen&quot;,
&quot;greetings&quot;: &quot;Hello Juergen!&quot;
}
</pre>
<h3><span class="mw-headline" id="Examples">Examples</span></h3>
<p>Simple example using SMILA's default scripts for indexing and search.
</p><p>Add a record to the solr index:
</p>
<pre>
POST http://localhost:8080/smila/script/add.process
{
&quot;_recordid&quot;: &quot;id1&quot;,
&quot;Title&quot;: &quot;Scripting rules!&quot;,
&quot;Content&quot;: &quot;yet another SMILA document&quot;,
&quot;MimeType&quot;: &quot;text/plain&quot;
}
</pre>
<p>Search index:
</p>
<pre>
POST http://localhost:8080/smila/script/search.process
{
&quot;query&quot;: &quot;SMILA&quot;,
&quot;resultAttributes&quot;: [&quot;Title&quot;, &quot;Content&quot;]
}
</pre>
<p>Delete record from solr index:
</p>
<pre>
POST http://localhost:8080/smila/script/delete.process
{
&quot;_recordid&quot;: &quot;id1&quot;
}
</pre>
<!--
NewPP limit report
CPU time usage: 0.168 seconds
Real time usage: 0.200 seconds
Preprocessor visited node count: 440/1000000
Preprocessor generated node count: 1066/1000000
Post‐expand include size: 645/2097152 bytes
Template argument size: 113/2097152 bytes
Highest expansion depth: 5/40
Expensive parser function count: 0/100
-->
<!-- Saved in parser cache with key my_wiki:pcache:idhash:45918-0!*!0!!en!2!* and timestamp 20150414071810 and revision id 381589
-->
</div>
<!-- catlinks -->
<div id='catlinks' class='catlinks catlinks-allhidden'></div> <!-- /catlinks -->
</div>
</div>
</div>
</div>
<!-- /maincontent -->
<!-- printfooter -->
<div class="printfooter">
Retrieved from "<a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Scripting&amp;oldid=381589">http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Scripting&amp;oldid=381589</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 03:57, 9 April 2015 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/User:Juergen.schumacher.empolis.com" title="User:Juergen.schumacher.empolis.com">Juergen Schumacher</a>, <a href="http://wiki.eclipse.org/index.php?title=User:Nadine.auslaender.empolis.com&amp;action=edit&amp;redlink=1" class="new" title="User:Nadine.auslaender.empolis.com (page does not exist)">Nadine Ausländer</a> and <a href="http://wiki.eclipse.org/index.php?title=User:Marco.strack.empolis.com&amp;action=edit&amp;redlink=1" class="new" title="User:Marco.strack.empolis.com (page does not exist)">Marco Strack</a>.</p><p id="footerviews">This page has been accessed 2,439 times.</p></div></section> </main> <!-- /#main-content-container-row -->
<p id="back-to-top" class="noprint hidden-print">
<a class="visible-xs" href="Scripting.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="Scripting.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":404});
}</script> </body>
</html>