Commit b25f8ef7 authored by Gwenael Cattez's avatar Gwenael Cattez

New functionalities for Web Explorer :

- Refresh component when clicked on the tree
- show more kind of binding (JMS,JNA,JGroups,UPnP)
- add,remove and set attribute of bindings
- method invocation
parent 605945b8
......@@ -33,4 +33,5 @@ a.footer-image {
#composite H2 {
color: #646464;
}
\ No newline at end of file
}
......@@ -73,4 +73,57 @@
#accordion .content p {
margin: 0.5em 0;
padding: 0 6px 8px 6px;
}
\ No newline at end of file
}
.fieldsetContainer {
margin : 10px;
border:1px solid #6B7B95;
border-radius: 10px;
background-color: white;
}
.fieldsetContainer .containerlegend {
padding: 5px 15px;
border:1px solid #6B7B95;
border-radius: 10px;
font-size:90%;
text-align:right;
background-color: #F4F5F5;
}
.fieldsetform {
margin : 10px;
border:1px solid #646464;
border-radius: 10px;
background-color: #F4F5F5;
}
.fieldsetform .formlegend {
padding: 5px 15px;
border:1px solid #646464;
border-radius: 10px;
font-size:90%;
text-align:right;
background-color: white;
}
.fieldsetform .desc {
float:left;
width:250px;
margin-right:0.5em;
text-align:right;
font-weight:bold;
}
.fieldsetform .value
{
}
.fieldsetform .button {
float:left;
width:150px;
margin-right:0.5em;
text-align:center;
}
\ No newline at end of file
......@@ -5,30 +5,30 @@
<link rel="stylesheet" type="text/css" href="css/dhtmlx.css">
<link rel="stylesheet" type="text/css" href="css/explorer.css">
<script src="js/mootools-core-1.4.2-full-compat.js"></script>
<script src="js/mootools-effect-1.4.0.1.js"></script>
<script src="js/dhtmlx.js"></script>
<script src="js/webexplorer.js"></script>
<script type="text/javascript" src="js/mootoolsCore.js"></script>
<script type="text/javascript" src="js/mootoolsMore.js"></script>
<script type="text/javascript" src="js/dhtmlx.js"></script>
<script type="text/javascript" src="js/webexplorer.js"></script>
<script type="text/javascript" src="js/treeParser.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
</head>
<body onload="doOnLoadExplorer();">
<div id="header" >
<font size="7" color="#646464">$title</font>
</div>
<div id="footer" >
<a href="http://adam.lille.inria.fr" class="footer-image">
<img src="http://adam.lille.inria.fr/uploads/Adam/ADAM_logo_web2011.png" title="ADAM" alt="ADAM"/>
</a>
<a href="http://www.inria.fr/en/" class="footer-image">
<img src="http://www.inria.fr/extension/site_inria/design/site_inria/images/logos/logo_INRIA.png" title="Inria" alt="Inria"/>
</a>
<a href="http://www.univ-lille1.fr/home/" class="footer-image">
<img src="http://www.univ-lille1.fr/digitalAssets/1/1742_Lille1.jpg" title="University of Lille 1" alt="University of Lille 1"/>
</a>
<font size="5" style="margin-left: 100px;" >2011 &copy;</font>
<!-- <a href="http://adam.lille.inria.fr" class="footer-image"> -->
<!-- <img src="http://adam.lille.inria.fr/uploads/Adam/ADAM_logo_web2011.png" title="ADAM" alt="ADAM"/> -->
<!-- </a> -->
<!-- <a href="http://www.inria.fr/en/" class="footer-image"> -->
<!-- <img src="http://www.inria.fr/extension/site_inria/design/site_inria/images/logos/logo_INRIA.png" title="Inria" alt="Inria"/> -->
<!-- </a> -->
<!-- <a href="http://www.univ-lille1.fr/home/" class="footer-image"> -->
<!-- <img src="http://www.univ-lille1.fr/digitalAssets/1/1742_Lille1.jpg" title="University of Lille 1" alt="University of Lille 1"/> -->
<!-- </a> -->
<!-- <font size="5" style="margin-left: 100px;" >2011 &copy;</font> -->
</div>
</body>
</html>
\ No newline at end of file
</html>
\ No newline at end of file
......@@ -8,6 +8,9 @@ web build:
packager build:
- packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff
...
*/
/*
---
......
/**
* OW2 FraSCAti Introspection
* Copyright (C) 2008-2012 INRIA, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Gwenael Cattez
*
* Contributor(s):
*
*/
var JSONTree;
function buildJSONTree()
{
var JSONObject;
JSONTree=new Object();
JSONTree.id=0;
JSONObject=new Object();
JSONObject.id="0_";
JSONObject.text="SCA Domain";
JSONObject.open=true;
JSONObject.im0="domain.png";
JSONObject.im1="domain.png";
JSONObject.im2="domain.png";
JSONObject.select=true;
XMLDocument=IntrospectionAjaxCall("GET","components","");
JSONObject.item=parse_composites(XMLDocument.childNodes);
JSONTree.item=new Array();
JSONTree.item[0]=JSONObject;
}
function parse_composites(composites)
{
var res,JSONObject,img;
var components;
res=new Array();
for(var i=0;i<composites.length;i++)
{
JSONObject=new JSONTreeNode("0_"+i,composites[i].getAttribute("name"),"composite",img,"","0_"+i,"component");
parse_composite(JSONObject,composites[i],"create");
res[i]=JSONObject;
}
return res;
}
function parse_composite(JSONObject,composite,mode)
{
var img;
JSONObject.status=composite.getAttribute("status");
if(JSONObject.status=="STARTED") img="scaCompositeStarted.png";
else img="scaCompositeStopped.png";
JSONObject.setImg(img);
components=composite.getElementsByTagName("component");
if(mode=="create") JSONObject.item=parse_components(JSONObject,components);
parse_component(JSONObject,composite);
}
function parse_components(JSONParentObject,components)
{
var res,JSONObject;
var subcomponents;
var componentPath,componentNode;
res=new Array();
for(var i=0;i<components.length;i++)
{
componentPath=JSONParentObject.path+"/"+components[i].getAttribute("name");
componentNode=IntrospectionAjaxCall("GET","component",componentPath);
JSONObject=new JSONTreeNode(JSONParentObject.id+"_"+i,componentNode.getAttribute("name"),"component","scaComponent.png",JSONParentObject.path,JSONParentObject.id+"_"+i,"component");
JSONObject.componentId=JSONObject.id;
JSONObject.position=i;
JSONParentObject.components.push(JSONObject);
subcomponents=componentNode.getElementsByTagName("component");
JSONObject.item=parse_components(JSONObject,subcomponents);
parse_component(JSONObject,componentNode);
res[i]=JSONObject;
}
return res;
}
function parse_component(JSONObject,component)
{
var services,references,properties;
var JSONItem,count;
count=JSONObject.item.length;
services=component.getElementsByTagName("service");
for(var i=0; i<services.length ; i++)
{
JSONItem=new JSONTreeNode(JSONObject.id+"_"+count,services[i].getAttribute("name"),"service","scaService.png",JSONObject.path,JSONObject.id,"port");
parse_service(JSONItem,services[i]);
JSONObject.item.push(JSONItem);
JSONItem.position=i;
JSONObject.services.push(JSONItem);
count++;
}
references=component.getElementsByTagName("reference");
for(var i=0; i<references.length ; i++)
{
JSONItem=new JSONTreeNode(JSONObject.id+"_"+count,references[i].getAttribute("name"),"reference","scaReference.png",JSONObject.path,JSONObject.id,"port");
parse_reference(JSONItem,references[i]);
JSONObject.item.push(JSONItem);
JSONItem.position=i;
JSONObject.references.push(JSONItem);
count++;
}
properties=component.getElementsByTagName("property");
for(var i=0; i<properties.length ; i++)
{
JSONItem=new JSONTreeNode(JSONObject.id+"_"+count,properties[i].getAttribute("name"),"property","scaProperty.png",JSONObject.path,JSONObject.id,"property");
parse_property(JSONItem,properties[i]);
JSONObject.item.push(JSONItem);
JSONItem.position=i;
JSONObject.properties.push(JSONItem);
count++;
}
}
function parse_service(JSONItem,service)
{
JSONItem.implementedInterface=service.getElementsByTagName("implementedInterface")[0].getAttribute("clazz");
JSONItem.methods=new Array();
var methods=service.getElementsByTagName("method");
for(var i=0;i<methods.length;i++) JSONItem.methods.push(parseMethod(methods[i]));
JSONItem.bindings=new Array();
var bindings=service.getElementsByTagName("bindings");
for(var i=0;i<bindings.length;i++) JSONItem.bindings.push(parseBinding(bindings[i]));
}
function parse_reference(JSONItem,reference)
{
JSONItem.implementedInterface=reference.getElementsByTagName("implementedInterface")[0].getAttribute("clazz");
JSONItem.methods=new Array();
var methods=reference.getElementsByTagName("method");
for(var i=0;i<methods.length;i++) JSONItem.methods.push(parseMethod(methods[i]));
JSONItem.bindings=new Array();
var bindings=reference.getElementsByTagName("bindings");
for(var i=0;i<bindings.length;i++) JSONItem.bindings.push(parseBinding(bindings[i]));
}
function parseMethod(method)
{
var JSONObject=new Object();
JSONObject.name=method.getAttribute("name");
JSONObject.parameters=new Array();
var parameters=method.getElementsByTagName("parameter");
var parameter;
for(var i=0;i<parameters.length;i++)
{
parameter=new Object();
parameter.type=parameters[i].getAttribute("type");
parameter.name=parameters[i].getAttribute("name");
JSONObject.parameters.push(parameter);
}
return JSONObject;
}
function parseBinding(binding)
{
var JSONObject=new Object();
JSONObject.attributesNames=new Array();
var attributes=binding.getElementsByTagName("attribute");
JSONObject.kind=binding.getAttribute("kind");
var attributeName;
for(var j=0;j<attributes.length;j++)
{
attributeName=attributes[j].getAttribute("name");
JSONObject.attributesNames.push(attributeName);
eval("JSONObject."+attributeName+"='"+attributes[j].getAttribute("value")+"';");
}
return JSONObject;
}
function parse_property(JSONItem,property)
{
JSONItem.value=property.getAttribute("value");
}
function JSONTreeNode(id,text,type,image,parentPath,componentId,introspectionMethod)
{
this.id=id;
this.text=text;
this.type=type;
this.im0=image;
this.im1=image;
this.im2=image;
if(parentPath=="") this.path=text;
else this.path=parentPath+"/"+text;
this.componentId=componentId;
this.introspectionMethod=introspectionMethod;
this.item=new Array();
this.components = new Array();
this.services = new Array();
this.references = new Array();
this.properties = new Array();
this.getCompositeId=function()
{
return this.id.substr(0,3);
}
this.setImg=function(image)
{
this.im0=image;
this.im1=image;
this.im2=image;
}
this.refresh=function()
{
var newItems=new Array();
for(var i=0;i<this.item.length;i++)
if(this.item[i].type=="component")
{
newItems.push(this.item[i]);
}
this.item=newItems;
this.services = new Array();
this.references = new Array();
this.properties = new Array();
var XMLObject=IntrospectionAjaxCall("GET",this.introspectionMethod,this.path);
eval("parse_"+this.type+"(this,XMLObject,'refresh');");
}
}
\ No newline at end of file
/**
* OW2 FraSCAti Introspection
* Copyright (C) 2008-2012 INRIA, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Gwenael Cattez
*
* Contributor(s):
*
*/
function IntrospectionAjaxCall(httpMethod,introspectionMethod,path,params)
{
var fullPath="/introspection";
if(introspectionMethod!=undefined && introspectionMethod!=null && introspectionMethod!="") fullPath+="/"+introspectionMethod;
if(path!=undefined && path!=null && path!="") fullPath+="/"+path;
var XMLresponse,Textresponse;
var myRequest=new Request({
url: fullPath,
method : httpMethod.toLowerCase(),
async : false,
emulation: false,
onSuccess : function(responseText,responseXML)
{
Textresponse=responseText;
XMLresponse=responseXML;
}
});
if(params==undefined || params==null) myRequest.send();
else
{
myRequest.setHeader("Content-Type","application/x-www-form-urlencoded");
myRequest.send(params);
}
if (XMLresponse!=null)
{
var XMLdocument=XMLresponse.documentElement;
return XMLdocument;
}
if (Textresponse!=null) return Textresponse;
}
\ No newline at end of file
......@@ -2,9 +2,13 @@
<head>
<title>Main Panel</title>
<link rel="stylesheet" type="text/css" href="css/mainPanel.css">
<script src="js/mootools-core-1.4.2-full-compat.js"></script>
<script src="js/mootools-effect-1.4.0.1.js"></script>
<script src="js/webexplorer.js"></script>
<script type="text/javascript" src="js/mootoolsCore.js"></script>
<script type="text/javascript" src="js/mootoolsMore.js"></script>
<script type="text/javascript" src="js/webexplorer.js"></script>
<script type="text/javascript" src="js/treeParser.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
</head>
<body onload="doOnLoadMainPanel();">
......
<html>
<head>
<title>Main Panel</title>
<link rel="stylesheet" type="text/css" href="css/mainPanel.css">
<script src="js/mootools-core-1.4.2-full-compat.js"></script>
<script src="js/mootools-effect-1.4.0.1.js"></script>
<script src="js/webexplorer.js"></script>
</head>
<body onload="doOnLoadMainPanel();">
<div id=header>
<b id="composite_name" style="float:left;">test</b>
<form name="composite_status_form" method="get" action="" onsubmit="return false;" style="float:left;">
<input type="radio" name="composite_status" value="start"> start
<input type="radio" name="composite_status" value="stop"> stop
</form>
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
<b id="component_name">test</b><br>
<ul id="nav">
<li><a id="components_menu" style="overflow:auto;" href="#" onClick="setPanelContent(id);">Components</a></li>
<li><a id="services_menu" href="#" onClick="setPanelContent(id);">Services</a></li>
<li><a id="references_menu" href="#" onClick="setPanelContent(id);">References</a></li>
<li><a id="properties_menu" href="#" onClick="setPanelContent(id);">Properties</a></li>
</ul>
</div>
<div id="panel">
<div id="panel_content">
</div>
</div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment