You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2012/03/31 00:25:01 UTC
svn commit: r1307642 [40/40] - in
/incubator/airavata/trunk/scratch/xbaya-web: ./ components/
components/calculator/ components/logic/ core/ css/ data/
dynamic_components/ js/ js/jquery/ js/jquery/css/
js/jquery/css/ui-lightness/ js/jquery/css/ui-light...
Added: incubator/airavata/trunk/scratch/xbaya-web/js/workspace.js
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/js/workspace.js?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/js/workspace.js (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/js/workspace.js Fri Mar 30 22:24:45 2012
@@ -0,0 +1,192 @@
+function initWorkspace(componentPanel, canvasObj){
+ workspace=new Object;
+ workspace.componentFactories={};
+ workspace.components={};
+ workspace.canvas=new Array();
+ workspace.canvas.push(canvasObj);
+ workspace.componentPanel=componentPanel;
+ workspace.addComponentFactory=function(factory){
+ return addComponentFactory(factory);
+ };
+ workspace.insertUIElementsToPage=function(parent, x, y,data){
+ return insertUIElementsToPage(parent, x, y,data);
+ };
+ workspace.addPorts=function (component,ports,orientation, isOutput){
+ return addPorts(component,ports,orientation, isOutput);
+ };
+ workspace.getNextComponentId=function(type){
+ return getNextComponentId(type);
+ };
+ workspace.addToComponentPannel=function (url, component_id, componentPanelSection){
+ return addToComponentPannel(url, component_id, componentPanelSection);
+ };
+ workspace.showDialog=function(title, content){
+ return showDialog(title, content);
+ };
+ workspace.removeComponent=function(componentInstance){
+ return removeComponent(componentInstance);
+ };
+ workspace.makeAccordian=function (divId){
+ return makeAccordian(divId);
+ };
+}
+function addComponentFactory(factory){
+ workspace.componentFactories[factory.type]=factory;
+}
+function insertUIElementsToPage(parent, x, y,data){
+ uiElement=null;
+ div = document.createElement('div');
+ div.innerHTML = data;
+ var elements = div.childNodes;
+ var arr = new Array();
+ while(elements.length>0){
+ ele=elements[0];
+ nodeName=ele.nodeName.toLowerCase();
+ if (nodeName=="style"){
+ document.getElementsByTagName("head")[0].appendChild(ele);
+ }else if (nodeName=="script"){
+ e=document.createElement("script");
+ e.innerHTML=ele.innerHTML;
+ arr.push(e);
+ div.removeChild(ele);
+ }else{
+ parent.appendChild(ele);
+ if (nodeName=="div"){
+ uiElement=ele;
+ }
+ }
+ }
+ for(i=0; i < arr.length;i++){
+ document.getElementsByTagName("head")[0].appendChild(arr[i]);
+ }
+ return uiElement;
+};
+function addPorts(component,ports,orientation, isOutput){
+ if (isOutput){
+ color="#66FF00";
+ }else{
+ color="#FFEF00";
+ }
+ step=1/(Object.keys(ports).length+1);
+ i=step;
+ jsPlumb.bind("ready", function() {
+ var r=5;
+ var label_x_value=(isOutput)? -r:r;
+ var x=(isOutput)? orientation+0.05:orientation-0.05;
+ for(var portId in ports){
+ endpointOption = {
+ isSource:isOutput,
+ isTarget:!isOutput,
+ endpoint:["Dot", {radius:r}],
+ paintStyle:{fillStyle:color},
+ setDragAllowedWhenFull:true,
+ /*overlays:[
+ [ "Label", {
+ location:[label_x_value, 0.5],
+ label:portId,
+ cssClass:"endpointLabel"
+ } ]
+ ]*/
+ };
+
+ endpointOption=(isOutput)? $.extend({anchor:[x,i,1,0],maxConnections:-1},endpointOption):$.extend({anchor:[x,i,0,1],maxConnections:1},endpointOption);
+ ep=jsPlumb.addEndpoint(component, endpointOption);
+ i=i+step;
+ }
+ jsPlumb.draggable(component);
+
+ });
+ }
+function getNextComponentId(type){
+ a=new Array();
+ for(id in workspace.components){
+ if (workspace.components[id].type==type){
+ a.push(id);
+ }
+ }
+ i=1;
+ name=type+i;
+ while(a.indexOf(name) != -1){
+ i=i+1;
+ name=type+i;
+ }
+ return name;
+ }
+
+function addToComponentPannel(url, component_id, componentPanelSection){
+ $.get(url, { id: component_id}, function(data) {
+ var div = document.createElement('div');
+ div.innerHTML = data;
+ var elements = div.childNodes;
+ //alert(elements.length);
+ var arr = new Array();
+ var leftPanel=componentPanelSection;
+ var divElement=document.createElement("div");
+ var divId=component_id+"_FactoryUI";
+ divElement.setAttribute("id", divId);
+ divElement.setAttribute("class", "componentFactoryIconStyle");
+ leftPanel.appendChild(divElement);
+ while(elements.length>0){
+
+ nodeName=elements[0].nodeName.toLowerCase();
+ if (nodeName=="style"){
+ document.getElementsByTagName("head")[0].appendChild(elements[0]);
+ }else if (nodeName=="script"){
+ e=document.createElement("script");
+ e.innerHTML=elements[0].innerHTML;
+ arr.push(e);
+ div.removeChild(elements[0]);
+ }else{
+ divElement.appendChild(elements[0]);
+ }
+ }
+ for(i=0; i < arr.length;i++){
+
+ document.getElementsByTagName("head")[0].appendChild(arr[i]);
+
+ }
+ var factoryObj=workspace.componentFactories[component_id];
+ if (factoryObj!=undefined){
+ factoryObj.draw(divElement,0,0);
+ resizeComponentPanel();
+ $("#"+divId).click(function(){
+ uniqueId=workspace.getNextComponentId(component_id);//+"_"+(new Date().getTime());
+ componentInstance=factoryObj.createComponent(uniqueId);
+ componentInstance.draw(workspace.canvas[0],0,0);
+ workspace.components[uniqueId]=componentInstance;
+ return false;
+ });
+ }
+ });
+ }
+
+function resizeComponentPanel(){
+ $( "#componentsPanel" ).accordion( "resize" );
+ $( ".selector" ).accordion({ autoHeight: false });
+}
+
+function makeAccordian(divId){
+ $( "#"+divId ).accordion();
+}
+
+function showDialog(dialogtitle, content){
+ var d=document.createElement('div');
+ d.innerHTML=content;
+ var $dialog = $(d)
+ .html('This dialog will show every time!')
+ .dialog({
+ autoOpen: false,
+ title: dialogtitle,
+ buttons: [{text: "Save",click: function() { $(this).dialog("close"); }},
+ {text: "Cancel",click: function() { $(this).dialog("close"); }}]
+ });
+ $dialog.dialog('open');
+}
+
+function removeComponent(componentInstanceId){
+ componentInstance=workspace.components[componentInstanceId];
+ var divId="#"+componentInstance.uicomponent.id;
+ jsPlumb.removeAllEndpoints(componentInstance.uicomponent);
+ $(divId).remove();
+ delete workspace.components[componentInstanceId];
+}
\ No newline at end of file
Propchange: incubator/airavata/trunk/scratch/xbaya-web/js/workspace.js
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/test/Calculator.wsdl
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/test/Calculator.wsdl?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/test/Calculator.wsdl (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/test/Calculator.wsdl Fri Mar 30 22:24:45 2012
@@ -0,0 +1,90 @@
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://c.b.a" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://c.b.a">
+ <wsdl:documentation>Calculator</wsdl:documentation>
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://c.b.a">
+ <xs:element name="add">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="n1" type="xs:int" />
+ <xs:element minOccurs="0" name="n2" type="xs:int" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="addResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:int" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="addRequest">
+ <wsdl:part name="parameters" element="ns:add" />
+ </wsdl:message>
+ <wsdl:message name="addResponse">
+ <wsdl:part name="parameters" element="ns:addResponse" />
+ </wsdl:message>
+ <wsdl:portType name="CalculatorPortType">
+ <wsdl:operation name="add">
+ <wsdl:input message="ns:addRequest" wsaw:Action="urn:add" />
+ <wsdl:output message="ns:addResponse" wsaw:Action="urn:addResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="CalculatorSoap11Binding" type="ns:CalculatorPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="add">
+ <soap:operation soapAction="urn:add" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="CalculatorSoap12Binding" type="ns:CalculatorPortType">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="add">
+ <soap12:operation soapAction="urn:add" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="CalculatorHttpBinding" type="ns:CalculatorPortType">
+ <http:binding verb="POST" />
+ <wsdl:operation name="add">
+ <http:operation location="add" />
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters" />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Calculator">
+ <wsdl:port name="CalculatorHttpsSoap11Endpoint" binding="ns:CalculatorSoap11Binding">
+ <soap:address location="https://156.56.179.164:9443/services/Calculator.CalculatorHttpsSoap11Endpoint/" />
+ </wsdl:port>
+ <wsdl:port name="CalculatorHttpSoap11Endpoint" binding="ns:CalculatorSoap11Binding">
+ <soap:address location="http://156.56.179.164:9763/services/Calculator.CalculatorHttpSoap11Endpoint/" />
+ </wsdl:port>
+ <wsdl:port name="CalculatorHttpSoap12Endpoint" binding="ns:CalculatorSoap12Binding">
+ <soap12:address location="http://156.56.179.164:9763/services/Calculator.CalculatorHttpSoap12Endpoint/" />
+ </wsdl:port>
+ <wsdl:port name="CalculatorHttpsSoap12Endpoint" binding="ns:CalculatorSoap12Binding">
+ <soap12:address location="https://156.56.179.164:9443/services/Calculator.CalculatorHttpsSoap12Endpoint/" />
+ </wsdl:port>
+ <wsdl:port name="CalculatorHttpsEndpoint" binding="ns:CalculatorHttpBinding">
+ <http:address location="https://156.56.179.164:9443/services/Calculator.CalculatorHttpsEndpoint/" />
+ </wsdl:port>
+ <wsdl:port name="CalculatorHttpEndpoint" binding="ns:CalculatorHttpBinding">
+ <http:address location="http://156.56.179.164:9763/services/Calculator.CalculatorHttpEndpoint/" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
Propchange: incubator/airavata/trunk/scratch/xbaya-web/test/Calculator.wsdl
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/test/jquery.js
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/test/jquery.js?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/test/jquery.js (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/test/jquery.js Fri Mar 30 22:24:45 2012
@@ -0,0 +1,13 @@
+document.write('<script type="text/javascript" src="../js/jquery/jquery-1.7.1.js"></script>');
+//document.write('<script type="text/javascript" src="jquery/development-bundle/ui/jquery.ui.core.js"></script>');
+//document.write('<script type="text/javascript" src="jquery/development-bundle/ui/jquery.ui.widget.js"></script>');
+//
+//document.write('<script type="text/javascript" src="jquery/development-bundle/ui/jquery.ui.mouse.js"></script>');
+//document.write('<script type="text/javascript" src="jquery/development-bundle/ui/jquery.ui.draggable.js"></script>');
+
+document.write('<script type="text/javascript" src="../js/jquery/js/jquery-ui-1.8.18.custom.min.js"></script>');
+
+document.write('<script type="text/javascript" src="../js/jquery/jquery.jsPlumb-1.3.6-all.js"></script>');
+//document.write('<script type="text/javascript" src="http://jsplumb.org/js/1.3.5/jquery.jsPlumb-1.3.5-all-min.js"></script>');
+document.write('<link rel="stylesheet" href="../js/jquery/development-bundle/themes/base/jquery.ui.all.css">');
+//document.write('<link rel="stylesheet" href="jquery/development-bundle/demos/demos.css">');
Propchange: incubator/airavata/trunk/scratch/xbaya-web/test/jquery.js
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/test/test2.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/test/test2.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/test/test2.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/test/test2.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,68 @@
+<html>
+
+<!-- <script type="text/javascript" src="jquery.js"></script> -->
+ <script type="text/javascript" src="jquery/jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
+ <script type="text/javascript" src="http://jsplumb.org/js/1.3.5/jquery.jsPlumb-1.3.5-all-min.js"></script>
+<link rel="stylesheet" href="../js/jquery/development-bundle/themes/base/jquery.ui.all.css">
+<link rel="stylesheet" href="../js/jquery/development-bundle/demos/demos.css">
+
+ <style>
+ #window1, #window2 { width: 150px; height: 150px;
+ border-style: solid;
+ }
+ </style>
+ <script>
+ $(function() {
+ //$( "#window1" ).draggable();
+ //$( "#window2" ).draggable();
+ });
+ </script>
+
+
+<body>
+
+
+
+
+
+ <div class="demo">
+
+ <div id="window1" class="ui-widget-content" style="position: relative;">
+ <p>Window1 content</p>
+ </div>
+ <div id="window2" class="ui-widget-content" style="position: absolute;">
+ <p>Window2 content</p>
+ </div>
+ </div>
+ <script type="text/javascript">
+ var targetOption = {
+ isSource:false,
+ isTarget:true,
+ endpoint:["Dot", {radius:5}]};
+
+ var sourceOption = {anchor:"BottomCenter",
+ isSource:true,
+ isTarget:false,
+ endpoint:["Dot", {radius:5}],
+ paintStyle:{fillStyle:"#FFEF00"},
+ setDragAllowedWhenFull:true};
+
+ jsPlumb.bind("ready", function() {
+
+ jsPlumb.addEndpoint('window1', $.extend({container:"window1"},targetOption));
+ jsPlumb.addEndpoint('window1', $.extend({container:"window1"},sourceOption));
+
+ jsPlumb.addEndpoint('window2', $.extend({container:"window2"},targetOption));
+ jsPlumb.addEndpoint('window2', $.extend({container:"window2"},sourceOption));
+
+ jsPlumb.draggable('window1');
+ jsPlumb.draggable('window2');
+ });
+
+
+ </script>
+
+ <button type="button" onclick="t()">Display Date</button>
+</body>
+</html>
Propchange: incubator/airavata/trunk/scratch/xbaya-web/test/test2.php
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/test/test3.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/test/test3.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/test/test3.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/test/test3.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,76 @@
+<html>
+<script type="text/javascript" src="jquery.js"></script>
+<script>
+ $(function() {
+ $( "#accordion" ).accordion();
+ });
+ </script>
+<body>
+
+
+
+
+<div class="demo">
+
+<div id="accordion">
+ <h3><a href="#">Section 1</a></h3>
+ <div>
+ <p>
+ Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
+ ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
+ amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
+ odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
+ </p>
+ </div>
+ <h3><a href="#">Section 2</a></h3>
+ <div>
+ <p>
+ Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
+ purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor
+ velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
+ suscipit faucibus urna.
+ </p>
+ </div>
+ <h3><a href="#">Section 3</a></h3>
+ <div>
+ <p>
+ Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
+ Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
+ ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
+ lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
+ </p>
+ <ul>
+ <li>List item one</li>
+ <li>List item two</li>
+ <li>List item three</li>
+ </ul>
+ </div>
+ <h3><a href="#">Section 4</a></h3>
+ <div>
+ <p>
+ Cras dictum. Pellentesque habitant morbi tristique senectus et netus
+ et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
+ faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia
+ mauris vel est.
+ </p>
+ <p>
+ Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
+ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
+ inceptos himenaeos.
+ </p>
+ </div>
+</div>
+
+</div><!-- End demo -->
+<div style="display: none;" class="demo-description">
+<p>
+Click headers to expand/collapse content that is broken into logical sections, much like tabs.
+Optionally, toggle sections open/closed on mouseover.
+</p>
+<p>
+The underlying HTML markup is a series of headers (H3 tags) and content divs so the content is
+usable without JavaScript.
+</p>
+</div><!-- End demo-description -->
+</body>
+</html>
Propchange: incubator/airavata/trunk/scratch/xbaya-web/test/test3.php
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/test/test4.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/test/test4.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/test/test4.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/test/test4.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,25 @@
+<html>
+<script type="text/javascript" src="jquery.js"></script>
+<!-- link href="http://jsplumb.org/css/jsPlumbDemo.css" rel="stylesheet"-->
+<!--link href="http://jsplumb.org/css/draggableConnectorsDemo.css" rel="stylesheet"-->
+
+<style>
+#window1,#window2 {
+ width: 150px;
+ height: 150px;
+ padding: 0.5em;
+}
+#container1{
+ width: 100%;
+ height: 100%;
+
+}
+</style>
+<body>
+ <div id="test"></div>
+ <script>
+ $("#test")[0].innerHTML="my name is";
+ </script>
+</body>
+
+</html>
\ No newline at end of file
Propchange: incubator/airavata/trunk/scratch/xbaya-web/test/test4.php
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/test/test5.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/test/test5.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/test/test5.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/test/test5.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,48 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Example</title>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
+ <script type="text/javascript" src="http://jsplumb.org/js/1.3.1/jquery.jsPlumb-1.3.1-all-min.js"></script>
+ </head>
+ <body >
+ <div id="block1" style="position: absolute;">Block1</div>
+ <div id="block2" style="position: absolute;">Block2</div>
+
+
+ <script type="text/javascript">
+
+ var targetOption = {anchor:"TopCenter",
+ maxConnections:-1,
+ isSource:false,
+ isTarget:true,
+ endpoint:["Dot", {radius:5}],
+ paintStyle:{fillStyle:"#66FF00"},
+ setDragAllowedWhenFull:true}
+
+ var sourceOption = {anchor:"BottomCenter",
+ maxConnections:-1,
+ isSource:true,
+ isTarget:false,
+ endpoint:["Dot", {radius:5}],
+ paintStyle:{fillStyle:"#FFEF00"},
+ setDragAllowedWhenFull:true}
+
+ jsPlumb.bind("ready", function() {
+
+ jsPlumb.addEndpoint('block1', targetOption);
+ jsPlumb.addEndpoint('block1', sourceOption);
+
+ jsPlumb.addEndpoint('block2', targetOption);
+ jsPlumb.addEndpoint('block2', sourceOption);
+
+ jsPlumb.draggable('block1');
+ jsPlumb.draggable('block2');
+ });
+
+ </script>
+
+ </body>
+</html>
Propchange: incubator/airavata/trunk/scratch/xbaya-web/test/test5.php
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/test/test6.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/test/test6.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/test/test6.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/test/test6.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,22 @@
+<?php
+ class Test{
+ function __construct($name, $age){
+ $this->name=$name;
+ $this->age=$age;
+ }
+ }
+ $test=array(5,6,7,8);
+ $str=serialize($test);
+ echo $str;
+ echo "<br />";
+ var_dump(unserialize($str));
+ echo "<br />";
+ $test=new Test("Saminda", array("age"=>18,"school"=>"iu"));
+ var_dump($test);
+ echo "<br />";
+ echo serialize($test);
+ echo "<br />";
+ var_dump(unserialize(serialize($test)));
+ echo "<br />";
+ echo serialize(array());
+?>
\ No newline at end of file
Added: incubator/airavata/trunk/scratch/xbaya-web/utils/fileutils.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/utils/fileutils.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/utils/fileutils.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/utils/fileutils.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,20 @@
+<?php
+function getSettings($filename){
+ $content = file_get_contents($filename, true);
+ $lines=explode("\n", $content);
+ $elements=array();
+ foreach ($lines as &$line) {
+ $s=trim($line);
+ if ($s!=""){
+ $data=explode(",",$s);
+ $data_elements=array();
+ foreach($data as $d){
+ $d2=explode(":",$d);
+ $data_elements[$d2[0]]=$d2[1];
+ }
+ array_push($elements,$data_elements);
+ }
+ }
+ return $elements;
+}
+?>
\ No newline at end of file
Propchange: incubator/airavata/trunk/scratch/xbaya-web/utils/fileutils.php
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/utils/persistanceutils.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/utils/persistanceutils.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/utils/persistanceutils.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/utils/persistanceutils.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,12 @@
+<?php
+
+function getProfiles(){
+ return unserialize(file_get_contents("profiles.db"));
+}
+
+function getComponents(){
+ return unserialize(file_get_contents("static_components.db"));
+}
+
+
+?>
\ No newline at end of file
Added: incubator/airavata/trunk/scratch/xbaya-web/utils/urlutils.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/utils/urlutils.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/utils/urlutils.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/utils/urlutils.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,32 @@
+<?php
+
+function startsWith($haystack, $needle)
+{
+ $length = strlen($needle);
+ return (substr($haystack, 0, $length) === $needle);
+}
+
+function endsWith($haystack, $needle)
+{
+ $length = strlen($needle);
+ $start = $length * -1; //negative
+ return (substr($haystack, $start) === $needle);
+}
+function removeFileName($url){
+ $filename = basename($url);
+ return substr($url,0,strlen($url)-strlen($filename));
+}
+
+function attachToURLInPath($url, $filename){
+ return (endsWith($url,"/"))? $url+$filename: removeFileName($url).$filename;
+}
+
+function attachToCurrentURLInPath($filename){
+ $url = getCurrentURL();
+ return (endsWith($url,"/"))? $url+$filename: removeFileName($url).$filename;
+}
+
+function getCurrentURL(){
+ return (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
+}
+?>
\ No newline at end of file
Propchange: incubator/airavata/trunk/scratch/xbaya-web/utils/urlutils.php
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/utils/wsdlparser.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/utils/wsdlparser.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/utils/wsdlparser.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/utils/wsdlparser.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,165 @@
+<?php
+// phpinfo();
+ class WSDLParser{
+ function __construct($wsdlurl){
+ $client=new SoapClient($wsdlurl);
+ $functions=$client->__getFunctions();
+ $typeStrings=$client->__getTypes();
+ $types=array();
+ foreach($typeStrings as $t){
+ $types=$types+$this->extractParameterInfo($t);
+ }
+ $this->types=$types;
+ $operations=array();
+ foreach($functions as $f){
+ $operation=$this->extractFunctionInfo($types,$f);
+ $key=$operation->toString();
+ if (!array_key_exists($key,$operations)){
+ $operations[$key]=$operation;
+ }
+ }
+ $this->operations=$operations;
+// var_dump($client->);
+// echo "<br />";
+ }
+
+ function extractParameterInfo($paramString){
+ $parts1=explode("{", $paramString);
+ $parts2=explode(" ",$parts1[0]);
+ $function_name=$parts2[1];
+ $parts3=explode("}",$parts1[1]);
+ $parts3=explode(";",$parts3[0]);
+ $parameters=array();
+ foreach($parts3 as $p){
+ $para=explode(" ",$p);
+ $para=remove_array_spaces($para);
+ if (count($para)>1){
+ $parameters[$para[1]]=$para[0];
+ }
+ }
+ return array($function_name=>$parameters);
+ }
+
+ function extractFunctionInfo($types,$functionString){
+ $parts1=explode("(", $functionString);
+ $parts2=explode(" ",$parts1[0]);
+ $function_name=$parts2[1];
+ $function_return_type=$parts2[0];
+ $parts3=explode(")",$parts1[1]);
+ $parts3=explode(";",$parts3[0]);
+ $parameters=array();
+ foreach($parts3 as $p){
+ $para=explode(" ",$p);
+ $para=remove_array_spaces($para);
+ if (count($para)>1){
+ $parameters[$para[1]]=$para[0];
+ }
+ }
+ return new WSOperation($function_name,$parameters, $function_return_type);
+ }
+
+ function getTypes(){
+ return $this->types;
+ }
+
+ function getOperations(){
+ return $this->operations;
+ }
+
+ function getServiceName(){
+ return "Calculator";
+ }
+
+ function getPrimitiveTypes($typeNames){
+ if (is_array($typeNames)){
+ $primitives=array();
+ foreach($typeNames as $key=>$value){
+ $baseTypes=$this->getPrimitiveTypesForType($value);
+ if ($baseTypes==null){
+ $primitives[$key]=$value;
+ }else{
+ foreach($baseTypes as $baseKey=>$baseValue){
+ $primitives[$key.".".$baseKey]=$baseValue;
+ }
+ }
+ }
+ return $primitives;
+ }else{
+ return $this->getPrimitiveTypesForType($typeNames);
+ }
+ }
+ private function getPrimitiveTypesForType($typeName){
+ $types=$this->getTypes();
+ if (array_key_exists($typeName, $types)){
+ $primitives=array();
+ $baseTypes=$types[$typeName];
+// var_dump($baseTypes);echo "<br />";
+ foreach($baseTypes as $basekey=>$baseType){
+ $rawPrimitives=$this->getPrimitiveTypes($baseType);
+ if ($rawPrimitives==null){
+ $primitives[$typeName.".".$basekey]=$baseType;
+ }else{
+ foreach($rawPrimitives as $key=>$value){
+ $primitives[$typeName.".".$key]=$value;
+ }
+ }
+ }
+ return $primitives;
+ }else{
+ return null;
+ }
+ }
+
+ }
+ class WSOperation{
+ function __construct($function_name,$parameters, $return_type){
+ $this->function_name=$function_name;
+ $this->parameters=$parameters;
+ $this->return_type=$return_type;
+ }
+
+ public function toString(){
+ $result=$this->function_name."$";
+ foreach($this->parameters as $p){
+ $result=$result.$p."_";
+ }
+ return $result;
+ }
+
+ function getFunctionName(){
+ return $this->function_name;
+ }
+
+ function getParameters(){
+ return $this->parameters;
+ }
+
+ function getReturnType(){
+ return $this->return_type;
+ }
+ }
+ function remove_array_spaces($arr){
+ $i=count($arr)-1;
+ while($i>-1){
+ if (trim($arr[$i])==""){
+ unset($arr[$i]);
+ }
+ $i-=1;
+ }
+ return array_values($arr);
+ }
+
+// $parser=new WSDLParser("http://localhost/poc/test/Calculator.wsdl");
+// // foreach($parser->getTypes() as $type){
+// // var_dump($type);
+// // echo "<br />";
+// // }
+// foreach($parser->getOperations() as $operation){
+// // var_dump($operation);
+// // echo "<br />";
+// foreach($operation->getParameters() as $key=>$value){
+// var_dump($parser->getPrimitiveTypes($value));
+// echo "<br />";
+// }
+// }
+?>
\ No newline at end of file
Propchange: incubator/airavata/trunk/scratch/xbaya-web/utils/wsdlparser.php
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/airavata/trunk/scratch/xbaya-web/workfloweditor.php
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/scratch/xbaya-web/workfloweditor.php?rev=1307642&view=auto
==============================================================================
--- incubator/airavata/trunk/scratch/xbaya-web/workfloweditor.php (added)
+++ incubator/airavata/trunk/scratch/xbaya-web/workfloweditor.php Fri Mar 30 22:24:45 2012
@@ -0,0 +1,45 @@
+<?php
+ include "utils/fileutils.php"
+?>
+<html>
+<head>
+<script type="text/javascript" src="js/jquery.js"></script>
+<script type="text/javascript" src="js/workspace.js"></script>
+<link rel="stylesheet" href="css/main.css">
+</head>
+<body>
+ <div id="componentsPanel" style="width: 20%; height: 100%; border: 2; border-color: black; border-style: solid;float: left;position:relative;">
+ <?php
+ $panels=getSettings("components/componentPanels.txt");
+ foreach($panels as &$panel){
+ echo "<h3><a href='#'>".$panel['label'].'<input type="submit" title="test" onclick="alert(234)" />'."</a></h3>";
+ echo "<div id='".$panel['id']."' style='padding:0.5em;'>";
+ echo "</div>";
+ }
+ ?>
+ </div>
+ <div id="canvas" style="position:relative; overflow:auto;width: 75%; height: 100%; border: 2; border-color: black; border-style: solid;float: right;"></div>
+ <script type="text/javascript">
+ initWorkspace(document.getElementById("componentsPanel"),document.getElementById("canvas"));
+ <?php
+ foreach($panels as &$panel){
+ $components=getSettings($panel['component_list']);
+// echo $panel['component_list'];
+ foreach ($components as &$component) {
+ $ui_id=$component['id']."_Factory_UIContainer";
+ echo "\t\tworkspace.addToComponentPannel('".$component['controller']."','".$component['id']."',$('#".$panel['id']."')[0]);\n";
+ }
+ }
+ ?>
+ url="http://localhost/poc/dynamic_components/WSDLComponent.php?wsdlurl="+encodeURIComponent("http://localhost/poc/test/Calculator.wsdl")+"&opid=Calculator_add";
+ workspace.addToComponentPannel(url,"Calculator_add",$('#<?php echo $panels[0]['id']?>')[0]);
+ $(function() {
+ workspace.makeAccordian("componentsPanel");
+ });
+ window.onresize = function(event) {
+ resizeComponentPanel();
+ };
+
+ </script>
+</body>
+</html>
Propchange: incubator/airavata/trunk/scratch/xbaya-web/workfloweditor.php
------------------------------------------------------------------------------
svn:executable = *