diff --git a/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java b/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java index d1f2b22ec176c51e5102589486666c19358658d3..d50e889b5e7a90e4cac0223e558ac4ebdbca22bc 100644 --- a/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java +++ b/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java @@ -1288,38 +1288,47 @@ public class AServProtocolManager implements Service { public Message renderHTMLNetwork( Properties params ){ // Retrieve the alignment String result = new String(); + String idON = new String(); + String pidON = new String(); String id = params.getProperty( "id" ); //String id = idON; BasicOntologyNetwork noo = null; try { logger.trace("Network sought for {}", id); noo = (BasicOntologyNetwork) alignmentCache.getOntologyNetwork(id); + idON = noo.getExtension( Namespace.ALIGNMENT.uri, Annotations.ID ); + pidON = noo.getExtension( Namespace.ALIGNMENT.uri, Annotations.PRETTY ); logger.trace("Network found"); } catch (Exception e) { return new UnknownOntologyNetwork( params, newId(), serverId,id ); } - result = "<h1>" + id + "</h1>"; + result = "<h1>" + id+ " ("+pidON+")" +"</h1>"; result += "<table border=\"0\">\n"; result += "<h2>Ontologies of the Network</h2>\n"; Collection<URI> networkOntology = networkOntologyUri(id); result += "<p><tr><th><b>Total ontologies: </b>" + networkOntology.size() + "</th></tr></p>"; result += "<table>\n"; + result += "<ul>"; for ( URI onto : networkOntology ) { - result += "<tr><td>" + "<a href=\"" + onto.toString() +"\">"+ onto.toString() + "</a>" + "</td></tr>\n"; + result += "<li><a href=\"" + onto.toString() +"\">"+ onto.toString() + "</a></li>"; } + result += "</ul>"; result += "</table>\n"; result += "<h2>Alignments of the Network</h2>\n"; Set<Alignment> networkAlignments = networkAlignmentUri(id); - result += "<table>\n"; result += "<p><tr><th><b>Total alignments: </b>" + networkAlignments.size() + "</th></tr></p>"; + result += "<table>\n"; + result += "<ul>"; for (Alignment al : networkAlignments) { String idAl = al.getExtension( Namespace.ALIGNMENT.uri, Annotations.ID ); String pidAl = al.getExtension( Namespace.ALIGNMENT.uri, Annotations.PRETTY ); if ( pidAl == null ) pidAl = idAl; else pidAl = idAl+" ("+pidAl+")"; - result += "<tr><td>" + "<a href=\""+idAl+"\">"+pidAl+"</a>" + "</td></tr>\n"; + result += "<li><a href=\""+idAl+"\">"+pidAl+" ("+ pidON +")"+"</a></li>"; } + result += "</ul>"; + result += "</table>\n"; return new RenderedAlignment( params, newId(), serverId, result ); } @@ -1458,7 +1467,6 @@ public List<Message> alignonet( Properties params ) { try { noo = alignmentCache.getOntologyNetwork( id ); - //nooClone = (OntologyNetwork) ((Hashtable<URI, OntologyNetwork>) noo)).clone(); } catch (AlignmentException e1) { return new UnknownOntologyNetwork( params, newId(), serverId,id ); } diff --git a/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java b/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java index ee2fdec4b3578ed12285b6f6aea9a1ae8566cae9..6435623bfafcdc23165767955610d45c65b0d01e 100644 --- a/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java +++ b/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java @@ -216,7 +216,7 @@ public class HTMLAServProfile implements AlignmentServiceProfile { } else if ( perf.equals("listNetOnto") ){ //TODO eliminate this //Message answer = manager.renderHTMLON( params ); - Message answer = manager.renderHTMLNetwork( params ); // "http://localhost:8089/onid/1400170347760/525" ); + Message answer = manager.renderHTMLNetwork( params ); if ( answer instanceof ErrorMsg ) { msg = testErrorMessages( answer, params, eSource ); } else { @@ -415,7 +415,7 @@ public class HTMLAServProfile implements AlignmentServiceProfile { } else if ( perf.equals("matchonet") ) { // DO MATCHING version 1 - +/* List<Message> answer = manager.alignonet( params ); msg = "<h1>Network Alignments results</h1>"; Iterator<Message> it = answer.iterator(); @@ -426,10 +426,10 @@ public class HTMLAServProfile implements AlignmentServiceProfile { } msg += "</ul>"; - +*/ // DO MATCHING -/* String idON = params.getProperty("id"); + String idON = params.getProperty("id"); logger.debug("Matching network {}", idON); Message answer = manager.alignonet2( params ); if ( answer instanceof ErrorMsg ) { @@ -437,8 +437,6 @@ public class HTMLAServProfile implements AlignmentServiceProfile { } else { //return answer.getContent(); msg = "<h1>Network alignments results</h1>"; - - //String idON = "http://localhost:8089/onid/1400144735513/788"; Set<Alignment> networkAlignments = manager.networkAlignmentUri(idON); msg += "<p> Network ID: <a href=\""+idON+"\">"+idON+"</a></p>"; msg += "<p><tr><th><b>Total alignments: </b>" + networkAlignments.size() + "</th></tr></p>"; @@ -450,8 +448,7 @@ public class HTMLAServProfile implements AlignmentServiceProfile { msg += "<li><a href=\""+id+"\">"+pid+"</a></li>"; } msg += "</ul>"; - } - */ + } } else if ( perf.equals("prmretreiveonet") ){ @@ -511,12 +508,12 @@ public class HTMLAServProfile implements AlignmentServiceProfile { msg += "<form action=\"../ontonet/listnetwork\"><button title=\"List networks stored in the server\" type=\"submit\">Available networks</button></form>"; // msg += "<form action=\"prmlistonet\"><button title=\"List networks stored in the server\" type=\"submit\">Available networks</button></form>"; msg += "<form action=\"prmloadonet\"><button title=\"Load a network from a valid source\" type=\"submit\">Load a network</button></form>"; - msg += "<form action=\"prmstoreonet\"><button title=\"Store a network in the server\" type=\"submit\">Store network</button></form>"; - msg += "<form action=\"prmtrimonet\"><button title=\"Trim a network\" type=\"submit\">Trim network</button></form>"; msg += "<form action=\"prmmatchonet\"><button title=\"Match an ontology network\" type=\"submit\">Match network </button></form>"; - msg += "<form action=\"prmretreiveonet\"><button title=\"Render an ontology network in a particular format\" type=\"submit\">Render network</button></form>"; + msg += "<form action=\"prmtrimonet\"><button title=\"Trim a network\" type=\"submit\">Trim network</button></form>"; + msg += "<form action=\"prmnormalizeonet\"><button title=\"Normalize an ontology network\" type=\"submit\">Normalize network</button></form>"; msg += "<form action=\"prmcloseonet\"><button title=\"Close an ontology network\" type=\"submit\">Close network</button></form>"; - msg += "<form action=\"prmnormalizeonet\"><button title=\"Normalize an ontology network\" type=\"submit\">Reset network</button></form>"; + msg += "<form action=\"prmretreiveonet\"><button title=\"Render an ontology network in a particular format\" type=\"submit\">Render network</button></form>"; + msg += "<form action=\"prmstoreonet\"><button title=\"Store a network in the server\" type=\"submit\">Store network</button></form>"; msg += "<form action=\"../html/\"><button style=\"background-color: lightpink;\" title=\"Back to user menu\" type=\"submit\">User interface</button></form>"; } else { msg = "Cannot understand: "+perf;