tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r453894 - in /incubator/tuscany/sandbox/ant/container.script/doc: ./ sca-java-container-script.xml
Date Sat, 07 Oct 2006 12:55:06 GMT
Author: antelder
Date: Sat Oct  7 05:55:06 2006
New Revision: 453894

URL: http://svn.apache.org/viewvc?view=rev&rev=453894
Log:
Start at scripting langauge website page

Added:
    incubator/tuscany/sandbox/ant/container.script/doc/
    incubator/tuscany/sandbox/ant/container.script/doc/sca-java-container-script.xml

Added: incubator/tuscany/sandbox/ant/container.script/doc/sca-java-container-script.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/container.script/doc/sca-java-container-script.xml?view=auto&rev=453894
==============================================================================
--- incubator/tuscany/sandbox/ant/container.script/doc/sca-java-container-script.xml (added)
+++ incubator/tuscany/sandbox/ant/container.script/doc/sca-java-container-script.xml Sat Oct
 7 05:55:06 2006
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document>
+
+    <properties>
+       <title>Tuscany</title>
+       <bannertitle>Tuscany SCA Java Scripting Language Implementation</bannertitle>
+    </properties>
+
+    <body>
+
+<section name="Scripting Language Implementation">
+
+<p>
+The Tuscany Java SCA runtime has a script container allowing SCA components to be implemented
with a variety of scripting languages.
+</p>
+<p>
+To use the script container you use the &lt;implementation.script&gt; element in
the component SCDL. The &lt;implementation.script&gt; element has two attributes,
'script' and 'class'. The 'script' attribute is required and defines the location of the script
program. The 'class' attribute is optional and enables specifying the class or prototype to
be used if the script language  supports such concepts.
+</p>
+<p>
+The language the script is implemented in is defined by the suffix of the script attribute
value. For example, the '.js' suffix indicates a JavaScript program, or '.py' indicates a
Python program. The script container uses the <a href='http://jakarta.apache.org/bsf/'
target='_blank'>Apache BSF script engine</a>, so any script language supported by
BSF can be used as an SCA component implementation.  
+</p>
+
+<p>
+</p>
+
+<p>
+</p>
+
+<p>
+</p>
+
+<p>
+</p>
+
+<p>
+The following example shows the files necessary to implement a simple HelloWorld style SCA
component using the script container and a JavaScript program.
+</p>
+
+<p>
+The composite SCDL:
+</p>
+<p>
+<table width="100%" class="ex" cellspacing="0" bgcolor="#f4f4f4">
+<tr><td>
+<pre>
+&lt;composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+    name="HelloWorldComposite"&gt;
+
+    &lt;component name="HelloWorldComponent"&gt;
+        &lt;implementation.script script="HelloWorld.js"/&gt;
+    &lt;/component&gt;
+
+&lt;/composite&gt;
+</pre>
+</td></tr>
+</table>
+</p>
+
+<p>
+and the associated JavaScript program, 'HelloWorld.js':
+</p>
+<p>
+<table width="100%" class="ex" cellspacing="0" bgcolor="#f4f4f4">
+<tr><td>
+<pre>
+function sayHello(s) {
+    return "Hello " + s;
+}
+</pre>
+</td></tr>
+</table>
+</p>
+
+<p>
+This next example shows a HelloWorld program using the Ruby language, and the use of the
&lt;implementation.script&gt; element 'class' attribute to specifying the class of
the component implementation:
+</p>
+<p>
+The composite SCDL:
+</p>
+<p>
+<table width="100%" class="ex" cellspacing="0" bgcolor="#f4f4f4">
+<tr><td>
+<pre>
+&lt;composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+    name="HelloWorldComposite"&gt;
+
+    &lt;component name="HelloWorldComponent"&gt;
+        &lt;implementation.script script="HelloWorld.rb" class="Helloworld"/&gt;
+    &lt;/component&gt;
+
+&lt;/composite&gt;
+</pre>
+</td></tr>
+</table>
+</p>
+
+<p>
+and the associated Ruby program, 'HelloWorld.rb':
+</p>
+<p>
+<table width="100%" class="ex" cellspacing="0" bgcolor="#f4f4f4">
+<tr><td>
+<pre>
+class Helloworld
+
+   def sayHello(s) 
+      return "Hello to " + s + " from the Ruby World!"
+   end
+
+end
+</pre>
+</td></tr>
+</table>
+</p>
+
+
+        </section>
+    </body>
+</document>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message