Name : Akhil Anil Karun
Email : akhil.karun@gmail.com
Proposal Title : Enhance Tuscany Widget Support
Apache Project Name : Tuscany
Mentor Name : Luciano Resende (Pending Confirmation)
Link To Project Idea JIRA : Enhance Tuscany Widget Support
Proposal Content Details :
Current Intentions
Apache Tuscany is provides efficient solutins for SOA implementation and it works fundamentally based on SCA standards. It provides integration across a wide variety programming platforms available today such as C++, Java, BPEL and more. As a part of it’s multiple platform support, Apache Tuscany is also integrated with web 2.0 technologies. Pojo is the only javascript framework supported by Tuscany right now.
The objective of this proposal is to generically implement a configuration option from where the user can specify the javascript framework he like to use. And as a starting step, integrate today’s most popular javascript framework i.e. jQuery, with Apache Tuscany. Once the option is in place future contributors can include more js frameworks to Apache.
As of now Tuscany is configured to use Pojo as it's default framework. The previous contiributors have left out sufficient options to integrate a javascript framework in future. So currently those options are configured to use pojo in Java classes and other file inside the framework and is not exposed to the users to change that from outside.
class DojoJavaScriptComponentGeneratorImpl {
//This is used to identify different generators supporting different JavaScript frameworks
private static final QName NAME = new QName("http://tuscany.apache.org/xmlns/sca/1.1", "component.script.generator.dojo");
private ExtensionPointRegistry extensionPoints;
private JavascriptProxyFactoryExtensionPoint javascriptProxyFactories;
public void generateJavaScriptCode(RuntimeComponent component, PrintWriter pw) throws IOException {
...
}
}
|
As a next step, the values for these options should be supplied from files which are visible and editable by the user. So by the time this step is finished the user will have a place to configure the usage of any supported javascript. The dependency files will by included according to the configuration. Currently, the pojo.js is included as shown below.
class WidgetImplementationProvider implements ImplementationProvider {
private static final QName BINDING_HTTP = new QName(Base.SCA11_TUSCANY_NS, "binding.http");
...
public void start() {
String baseURI = getBaseURI();
// this uses removeServletMapping / addServletMapping as there is no getServletMapping facility
scriptURI = URI.create(baseURI + "/" + this.widgetName + ".js").toString();
Servlet servlet = servletHost.getServletMapping(scriptURI);
if (servlet == null /*|| servlet instanceof HTTPGetListenerServlet*/) {
WidgetComponentScriptServlet widgetScriptServlet;
widgetScriptServlet = new WidgetComponentScriptServlet(this.component, javaScriptGenerator);
servletHost.addServletMapping(scriptURI, widgetScriptServlet);
}
// If added to the class path, start dojo provider
if(javascriptProvider != null) {
javascriptProvider.start();
}
}
...
}
|
For every pojo framework supported application there is an automatic javascript file generated that acts as a bridge between the tuscany specific javascript syntax and its counterpart in pojo framework. This javascript is generated by the following file.
public class DojoJavaScriptComponentGeneratorImpl implements ComponentJavaScriptGenerator {
public void generateJavaScriptCode(RuntimeComponent component, PrintWriter pw) throws IOException {
...
generateJavaScriptHeader(component, javascriptProxyFactories,pw);
...
generateJavaScriptNamespace(pw);
...
generateJavaScriptPropertyFunction(component, pw);
...
generateJavaScriptReferenceFunction(component, javascriptProxyFactories,pw);
...
}
}
|
Similar to this file there would be a JQueryJavaScriptComponentGeneratorImpl.java and other related files that generate the javascript file for the applications configured to use javascript.
Javascript Generator is used to implement the GUI features of the Luke application as it is Apache Licensed and can be used in the Lucene trunk.
Configuration Control
Tabbed pane is already done using Pivot API for the Luke application. There is a pane for plugins that is empty in the sandboxed version.A Tab Pane is added as a BXML file as :
Week |
Dates |
Work to be done |
Week 0 |
July 20th to August 2nd |
Familiaring with overall Tuscany architecture and specifically with widget implementation. Discussing and prototyping implementation aspects. |
Week 1,2, |
August 5th to August 25th |
Implementation a of javascript code generator for jquery. |
Week 3,4 |
August 26th to September 13th |
Implement the the configuration option that the user can use to specify which js framework to use. |
Week 6 |
September 6th to September 13th |
Do the documentation for code till date |
Week 7,8 |
September 16th to September 30th |
Implement integration test. |
Week 9,10 |
September 30th to October 14th |
Open for comments for improvements from mentor and community. |
Week 11 |
October 14th to October 21st |
Extra Week for catching up in case of delays. Code review. |
Week 12 |
October 21st to October 28th |
Do documentation for code till date |