diff --git a/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java b/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java index 8719e2b2cd2773c4b0f6ec763843bcf09f257691..697540068229b73269026466680dfd2b928f8434 100644 --- a/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java +++ b/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java @@ -108,18 +108,22 @@ public class HTMLAServProfile implements AlignmentServiceProfile { // API parts // ================================================== - protected static String about() { - String result = "<h1>Alignment server</h1><center><div>"+AlignmentService.class.getPackage().getImplementationTitle()+" "+AlignmentService.class.getPackage().getImplementationVersion()+"</div>" - //+ "<center><a href=\"html/\">Access</a></center>" - + "<div style=\"align: center;\"><br />" - + "<form style=\"height: 15px; width: 150px; position: relative;\" action=\"html/\"><button style=\"background-color: lightblue;\" title=\"Alignment menu\" type=\"submit\">Alignments</button></form>" + protected String about() { + String result = "<h1>Alignment server</h1><center><div style=\"align: center;\"><br />"; + if ( parameters != null && // guard against non init()-ed profile + parameters.getProperty( "banner" ) != null ) { + result += parameters.getProperty( "banner" ); + } + result += + "<form style=\"height: 15px; width: 150px; position: relative;\" action=\"html/\"><button style=\"background-color: lightblue;\" title=\"Alignment menu\" type=\"submit\">Alignments</button></form>" + "<form style=\"height: 15px; width: 150px; margin-left: 5px; position: relative;\" action=\"noo/\"><button style=\"background-color: lightgreen;\" title=\"Network of ontologies menu\" type=\"submit\">Ontology networks</button></form>" + "<form style=\"height: 15px; width: 150px; margin-left: 5px; position: relative;\" action=\"../admin/\"><button style=\"background-color: lightpink;\" title=\"Server management functions\" type=\"submit\">Server management</button></form>" + "</div>" - + "<div style=\"align: center;\"><br />(C) INRIA, 2006-2014<br />" + + "<div style=\"align: center;\"><br />" + + "<div>"+AlignmentService.class.getPackage().getImplementationTitle()+" "+AlignmentService.class.getPackage().getImplementationVersion()+"</div>" + + "(C) INRIA, 2006-2015<br />" + "<a href=\"http://alignapi.gforge.inria.fr\">http://alignapi.gforge.inria.fr</a><br />" + "</div></center>"; - // reading parameters here will raise static problem return result; } diff --git a/src/fr/inrialpes/exmo/align/service/HTTPTransport.java b/src/fr/inrialpes/exmo/align/service/HTTPTransport.java index 12784acf32b8743ca09a0f386ec3d0ae8446eeac..e37b53aa3add2b29e187ab325320e7fb8df9187a 100644 --- a/src/fr/inrialpes/exmo/align/service/HTTPTransport.java +++ b/src/fr/inrialpes/exmo/align/service/HTTPTransport.java @@ -310,7 +310,13 @@ public class HTTPTransport { } else if ( oper.equals( "" ) ) { // SHOULD BE ASSIGNED TO CONTENT NEGOCIATION AS WELL... (DEFAULT IN SERVERS) //return serveFile( uri, header, new File("."), true ); - return new HTTPResponse( HTTPResponse.HTTP_OK, HTTPResponse.MIME_HTML, "<html><head>"+HTMLAServProfile.HEADER+"</head><body>"+HTMLAServProfile.about()+"</body></html>" ); + HTMLAServProfile profile = null; + for ( AlignmentServiceProfile serv : services ) { + if ( serv instanceof HTMLAServProfile ) profile = (HTMLAServProfile)serv; + break; + } + if ( profile == null ) profile = new HTMLAServProfile(); + return new HTTPResponse( HTTPResponse.HTTP_OK, HTTPResponse.MIME_HTML, "<html><head>"+HTMLAServProfile.HEADER+"</head><body>"+profile.about()+"</body></html>" ); } else { // Selects the relevant service for the request for ( AlignmentServiceProfile serv : services ) {