Commit 67d1b7c2 authored by Maxime Chaillet's avatar Maxime Chaillet

landingPage initiale version

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/oracle-java8-jdk-amd64">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="oracle.eclipse.tools.glassfish.lib.system">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>detailsFromDOI</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="WebContent"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="detailsFromDOI">
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<property name="context-root" value="detailsFromDOI"/>
<property name="java-output-path" value="/detailsFromDOI/build/classes"/>
</wb-module>
</project-modules>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="GlassFish 4"/>
<fixed facet="wst.jsdt.web"/>
<fixed facet="java"/>
<fixed facet="jst.web"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="3.1"/>
<installed facet="glassfish.web" version="4.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Window
\ No newline at end of file
Manifest-Version: 1.0
Class-Path:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<context-root>/detailsFromDOI</context-root>
</glassfish-web-app>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>details from DOI</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
var connection= {
json: "{\"plugin\":\"simple\",\"credentials\":[{\"username\":\"root\"}, {\"password\":\"root\"}]}"
}
var mySessionId="";
$(document).ready(function() {
console.log("Hello. The document is ready.");
$("#doiRequestDiv").hide();
$("#connectButton").click(function() {
console.log("You clicked on Connection button");
// From: http://learn.jquery.com/ajax/jquery-ajax-methods/
// Using the core $.ajax() method
$.ajax({
// The URL for the request
url: "https://linfalcon.esrf.fr:8181/icat/session",
// The data to send (will be converted to a query string)
data: connection,
// Whether this is a POST or GET request
type: "post",
// The type of data we expect back
//dataType : "text",
dataType : "json",
// Code to run if the request succeeds;
// the response is passed to the function
success: function( data ) {
console.log("You received some data!");
mySessionId = data.sessionId;
$("#connectionState").html("Your session ID is " + data.sessionId);
$("#doiRequestDiv").show();
},
// Code to run if the request fails
error: function() {
alert( "Sorry, there was a problem!" );
}
});
});
$("#getDoiButton").click(function() {
console.log("getDoiButton clicked");
var doiRequest = $("#doiId").val();
var myDoiQuery = "select distinct dcd from DataCollection dataCollection" +
" join DataCollectionDatafile dcd" +
" where dataCollection.doi='" + doiRequest + "'";
//" include dataCollection.parameters";
$.ajax({
// The URL for the request
url: "https://linfalcon.esrf.fr:8181/icat/entityManager",
// The data to send (will be converted to a query string)
data: {
sessionId: mySessionId,
server : "https://linfalcon.esrf.fr:8181",
query : myDoiQuery
},
type: "GET",
dataType : "json",
success: function( data ) {
console.log("The requested DOI was found !");
// data contains an array
receptionDOIInfo(data);
},
// Code to run if the request fails
error: function() {
alert( "Sorry, error while processing the DOI request !" );
}
});
});
});
function receptionDOIInfo(data){
if (data.length != 0)
{
var doiName = data[0].DataCollection.doi;
var doiId = data[0].DataCollection.id;
var title = data[0].DataCollection.parameters[0].stringValue;
var mintedDate = data[0].DataCollection.parameters[1].dateTimeValue;
var mintedBy = data[0].DataCollection.parameters[2].stringValue;
$("#doiResultDiv").html(
"Received Data : <BR/> " +
"doiName : " + doiName + " <BR/>" +
"doiID : " + doiId + " <BR/>" +
"title : " + title + " <BR/>" +
"mintedDate : " + mintedDate + " <BR/>" +
"mintedBy : " + mintedBy + " <BR/>"
);
} else {
$("#doiResultDiv").html("Sorry, the DOI was not found !" );
};
};
</script>
</head>
<body>
<h1>Salut</h1>
<p>Cliquer sur le bouton pour connexion sur ICAT server.</p>
<button id="connectButton">Connexion</button>
<div id="connectionState"></div>
<div id="doiRequestDiv"> Enter the requested DOI :
<input type="text" id="doiId">
<button id="getDoiButton"> Get it !</button>
</div>
<div id="doiResultDiv"> </div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>details from DOI</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
var connection= {
json: "{\"plugin\":\"simple\",\"credentials\":[{\"username\":\"root\"}, {\"password\":\"root\"}]}"
}
var mySessionId="";
$(document).ready(function() {
console.log("Hello. The document is ready.");
$("#doiRequestDiv").hide();
$("#connectButton").click(function() {
console.log("You clicked on Connection button");
// From: http://learn.jquery.com/ajax/jquery-ajax-methods/
// Using the core $.ajax() method
$.ajax({
// The URL for the request
url: "https://linfalcon.esrf.fr:8181/icat/session",
// The data to send (will be converted to a query string)
data: connection,
// Whether this is a POST or GET request
type: "post",
// The type of data we expect back
//dataType : "text",
dataType : "json",
// Code to run if the request succeeds;
// the response is passed to the function
success: function( data ) {
console.log("You received some data!");
mySessionId = data.sessionId;
$("#connectionState").html("Your session ID is " + data.sessionId);
$("#doiRequestDiv").show();
},
// Code to run if the request fails
error: function() {
alert( "Sorry, there was a problem!" );
}
});
});
$("#getDoiButton").click(function() {
console.log("getDoiButton clicked");
var doiRequest = $("#doiId").val();
var myDoiQuery = "select distinct dcd from DataCollection dataCollection" +
" join DataCollectionDatafile dcd" +
" where dataCollection.doi='" + doiRequest + "'";
//" include dataCollection.parameters";
$.ajax({
// The URL for the request
url: "https://linfalcon.esrf.fr:8181/icat/entityManager",
// The data to send (will be converted to a query string)
data: {
sessionId: mySessionId,
server : "https://linfalcon.esrf.fr:8181",
query : myDoiQuery
},
type: "GET",
dataType : "json",
success: function( data ) {
console.log("The requested DOI was found !");
// data contains an array
receptionDOIInfo(data);
},
// Code to run if the request fails
error: function() {
alert( "Sorry, error while processing the DOI request !" );
}
});
});
});
function receptionDOIInfo(data){
if (data.length != 0)
{
var doiName = data[0].DataCollection.doi;
var doiId = data[0].DataCollection.id;
var title = data[0].DataCollection.parameters[0].stringValue;
var mintedDate = data[0].DataCollection.parameters[1].dateTimeValue;
var mintedBy = data[0].DataCollection.parameters[2].stringValue;
$("#doiResultDiv").html(
"Received Data : <BR/> " +
"doiName : " + doiName + " <BR/>" +
"doiID : " + doiId + " <BR/>" +
"title : " + title + " <BR/>" +
"mintedDate : " + mintedDate + " <BR/>" +
"mintedBy : " + mintedBy + " <BR/>"
);
} else {
$("#doiResultDiv").html("Sorry, the DOI was not found !" );
};
};
</script>
</head>
<body>
<h1>Salut</h1>
<p>Cliquer sur le bouton pour connexion sur ICAT server.</p>
<button id="connectButton">Connexion</button>
<div id="connectionState"></div>
<div id="doiRequestDiv"> Enter the requested DOI :
<input type="text" id="doiId">
<button id="getDoiButton"> Get it !</button>
</div>
<div id="doiResultDiv"> </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