Skip to content

Commit

Permalink
bioCADDIE core UI v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RuilingLiu committed Jun 30, 2016
1 parent 10fee21 commit 3c575d0
Show file tree
Hide file tree
Showing 124 changed files with 1,866 additions and 3,318 deletions.
33 changes: 24 additions & 9 deletions about.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
// strcmp()
$errors .= "\n The captcha code does not match!";
}

if(empty($errors))
{
//send the email
sendEmails();
postToGitHub();

echo '<script type="text/javascript">';
echo 'alert("You request has been received and posted to <a class="hyperlink" href = "https://github.com/biocaddie/prototype_issues/issues">GitHub </a>. We will contact you soon.")';
echo 'alert("You request has been received and posted to GitHub We will contact you soon.")';
//echo 'alert("You request has been received and posted to <a class="hyperlink" href = "https://github.com/biocaddie/prototype_issues/issues">GitHub </a>. We will contact you soon.")';
echo '</script>';
}
}
Expand Down Expand Up @@ -85,10 +85,21 @@ function postToGitHub(){
<br>

<!-- <p style="text-align:center;font-size:20px"> About</p>-->
<p class="about_style"> We at the bioCADDIE (biomedical and healthcare Data Discovery Index Ecosystem) are developing a prototype of a data discovery index (DDI) to help you search and find datasets you’re interested in. Our prototype aims to provide:</p>

<p class="about_style"> 1. A free, user-friendly means for you to locate data sets of interest.</p>
<p class="about_style"> 2. Standardized, searchable information (metadata) about the contents of a data set.</p>
<p class="about_style">DataMed is a prototype biomedical data search engine. Its goal is to discover data sets across data repositories or data aggregators.
In the future it will allow searching outside these boundaries. DataMed supports the NIH-endorsed <a class="hyperlink" href="http://www.nature.com/articles/sdata201618">FAIR</a> principles of Findability, Accessibility, Interoperability
and Reusability of datasets with current functionality assisting in finding datasets and providing access information about them.</p>

<p class="about_style">The data repositories covered in this initial release have been selected by the bioCADDIE team and represent only a small sample of biomedical data. Many highly
relevant data sets have not yet been indexed. Please provide <a class='hyperlink' href="submit_repository.php">suggestions</a> on data repositories that DataMed should cover.</p>

<p class="about_style">The translation of user queries into structured data used in the search is being refined. Advanced search allows users to structure their queries.
Some DataMed search features are not yet available for all data. Please provide feedback about the quality of search results.</p>

<p class="about_style">DataMed indexes the core metadata available for most datasets, but it offers enhanced search functions when repositories provide additional metadata.
The Data Tag Suite <a class='hyperlink' href ="https://biocaddie.org/group/working-group/working-group-3-descriptive-metadata-datasets"> (DATS)</a> metadata specification
has evolved with input from the community and will include a schema.org annotated serialization.</p>


<p class="about_style"> You can use the web interface and provide us feedback <a class="hyperlink" href="./feedback.php">here </a> about your search experience. This is a prototype in development and your valuable suggestions and comments will help us to make the system better.</p>

Expand Down Expand Up @@ -128,12 +139,14 @@ function postToGitHub(){
</p>
<div class="row" >
<div class ="col-md-1">
<input type="submit" value="Submit" name='submit' class="btn btn-warning" onclick="process()" id="submitBtn" style="margin-bottom: 20px">
<!--<input type="submit" value="Submit" name='submit' class="btn btn-warning" onclick="process()" id="submitBtn" style="margin-bottom: 20px">-->
<input type="submit" value="Submit" name='submit' class="btn btn-warning" id="submitBtn" style="margin-bottom: 20px">
</div>
</div>
</div>
</form>
</div>

</div>


Expand All @@ -148,10 +161,12 @@ function refreshCaptcha()


/*show loading sign on button click*/
function process(){
/*function process(){
$('#submitBtn').prop("disabled",true);
alert("Your request has been received.");
}
//alert("Your request has been received.");

}*/

</script>
</body>
</html>
13 changes: 10 additions & 3 deletions ajax/deletecollectionitems.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@
$dbconn=$objDBController->getConn();

$collectionItems = new Collection();

$user_email =$_SESSION['email'];

if(!empty($_POST['query'])) {
foreach($_POST['query'] as $check) {
$collectionItems->setCollectionItemId($check);
if($collectionItems->deleteCollectionItem($dbconn)){
echo "ok";
if($collectionItems -> Is_valid_User($dbconn,$check,$user_email)){
if($collectionItems->deleteCollectionItem($dbconn)){
echo "ok";
}else{
echo "Error occurred during the deletion";
}
}else{
echo "No permission";
}

}
}
31 changes: 24 additions & 7 deletions ajax/deletecollections.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,33 @@
$collections = new UserCollection();
$collectionItems = new Collection();

$user_email = $_SESSION['email'];

if(!empty($_POST['query'])) {
foreach($_POST['query'] as $check) {
$collections->setCollectionId($check);
if($collections->deleteCollection($dbconn)){
echo "ok";
}
$collectionItems->setCollectionId($check);
if($collectionItems->deleteCollectionItem($dbconn)){
echo "ok";
$collectionID = $check;

// Valid user's identity
if($collections->Is_valid_User($dbconn,$collectionID, $user_email)){

// delete all collection items in the collection
$collectionItems->setCollectionId($check);
if($collectionItems->deleteAllCollectionItem($dbconn)){
echo "ok";
}else{
echo "Error occurred during the deletion of all collection items";
}

// delete collection
$collections->setCollectionId($check);
if($collections->deleteCollection($dbconn)){
echo "ok";
}else{
echo "Error occurred during the deletion of the collection";
}

}else{
echo "No Permission";
}
}
}
22 changes: 15 additions & 7 deletions ajax/deletesearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,25 @@
}

$objDBController = new DBController();
$dbconn=$objDBController->getConn();
$dbconn = $objDBController->getConn();
$search = new Search();

$user_email = $_SESSION['email'];

if(!empty($_POST['query'])) {
if (!empty($_POST['query'])) {
foreach ($_POST['query'] as $check) {

foreach($_POST['query'] as $check) {
$search->setSearchId($check);
if($search->deleteSearch($dbconn)){
echo "ok";
$searchID = $check;

if ($search->Is_valid_User($dbconn, $searchID, $user_email)) {
$search->setSearchId($check);
if ($search->deleteSearch($dbconn)) {
echo "ok";
}else{
echo "Error occurred during the deletion of the saved searches";
}
}else{
echo "No Permission";
}
//echo $check;
}
}
23 changes: 16 additions & 7 deletions ajax/savesearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,27 @@
$dbconn=$objDBController->getConn();
$search = new Search();

if(!empty($_POST['query'])) {
$user_email = "";
if(isset($_SESSION['email'])){
$user_email = $_SESSION['email'];
}


if(!empty($_POST['query'])) {
foreach($_POST['query'] as $check) {

$search->setDate(explode("|",$check)[2]);
$search->setSearchTerm(explode("|",$check)[0]);
$search->setSearchType(explode("|",$check)[1]);
$search->setUemail($_SESSION['email']);
if ($search->If_User_Exist($dbconn, $user_email)) {
$search->setDate(explode("|",$check)[2]);
$search->setSearchTerm(explode("|",$check)[0]);
$search->setSearchType(explode("|",$check)[1]);
$search->setUemail($_SESSION['email']);


if($search->saveSearch($dbconn)){
echo "ok";
if($search->saveSearch($dbconn)){
echo "ok";
}else{
echo "Error occurred during the saving of searches";
}
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions ajax/studyconsent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@
$dbconn=$objDBController->getConn();
$consent = new StudyConsent();

$user_email = $_SESSION['email'];

if(!empty($_POST['email'])) {
$consent->setEmail($_POST['email']);
$consent->setConsent(1);
$consent->setConsentTime(date("Y-m-d"));
$consent->setUsername($_SESSION['email']);

if($consent->saveConsent($dbconn)){
echo "ok";
if ($consent->If_User_Exist($dbconn, $user_email)) {
if($consent->saveConsent($dbconn)){
echo "ok";
}else{
echo "Error occurred during the saving of searches";
}
}else{
echo "No Permission";
}
}
8 changes: 8 additions & 0 deletions ajax/whatsthis.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

header('Content-type', 'application/json');

require_once dirname(__FILE__) . '/../config/config.php';
global $scigraph;
echo file_get_contents($scigraph.'/vocabulary/autocomplete/' . urlencode($_GET['q']));
?>
25 changes: 17 additions & 8 deletions change.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
$email = $_POST["email"];

}else{
include dirname(__FILE__) . '/views/header.php';
echo "email is not valid";
include dirname(__FILE__) . '/views/footer.php';
exit;
}

Expand All @@ -40,15 +42,15 @@
$password = hash('sha512', $salt.$userExists["email"]);

// Create a url which we will direct them to reset their password
$pwrurl = "http://datamed.biocaddie.org/dev/biocaddie-ui/reset_password.php?q=".$password;
$pwrurl = "https://datamed.org/dev/biocaddie-ui/reset_password.php?q=".$password;

$from = '[email protected]';
$to = $userExists["email"];
$subject = " Password Reset";
$body = 'Dear user,<br>
If this e-mail does not apply to you please ignore it. It appears that you have requested a password reset at our website www.yoursitehere.com<br>
To reset your password, please click the link below. If you cannot click it, please paste it into your web browser\'s address bar.<br>'
. $pwrurl . '<br>Thanks,<br>The Administration';
$body = 'Dear user,<br><br>
If this e-mail does not apply to you please ignore it. It appears that you have requested a password reset at our website https://datamed.org<br>
To reset your password, please click the link below. If you cannot click it, please paste it into your web browser\'s address bar.<br><br>'
. $pwrurl . '<br><br>Thanks,<br>The DataMed Team';


$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
Expand All @@ -65,14 +67,21 @@

$result = $mailer->send($message);

require_once './views/header.php';
include dirname(__FILE__) . '/views/header.php';

echo "<div class='container'>Your password recovery key has been sent to your e-mail address.</div>";
// header( "refresh:5;url=../index.php" );
include dirname(__FILE__) . '/views/footer.php';

}
else
echo "No user with that e-mail address exists.";
else{
include dirname(__FILE__) . '/views/header.php';
echo "<div class='container'>No user with that e-mail address exists.</div>";
include dirname(__FILE__) . '/views/footer.php';
}

}else{
header('Location: index.php');
exit;
}
?>
9 changes: 7 additions & 2 deletions collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
$create_time = date("Y-m-d H:i:s");
$collectionID = 0;

// Add to a new collection
if ($collectionType == "new") {
$collection_name = $_POST['collectionName'];

Expand All @@ -66,8 +67,10 @@
$usercollection->setCollectionName($collection_name);
$usercollection->setCreateTime($create_time);
$usercollection->setSettings($setting);

// Create a new collection

$collectionID = $usercollection->createCollection($dbconn);
$collectionID = $collectionID[0]['collection_id'];

$usercollection->setCollectionId($collectionID);

Expand Down Expand Up @@ -118,7 +121,9 @@
$error[] = "Please provide a unique collection name. A collection with the same name already exists.";
}
}
} elseif ($collectionType == "existing") {
}
// Add to an exisitng collection
elseif ($collectionType == "existing") {
// Get collection id using user email and collection name
$collection_name = $_POST['selectName'];
$usercollection->setCollectionName($collection_name);
Expand Down
32 changes: 32 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,36 @@
}
date_default_timezone_set('America/chicago');

//Es endpoint

$es_end_point = '129.106.31.121:9200';
//$es_end_point = '129.106.149.72:9200';

//terminology server
$scigraph_url = "http://localhost:9000/scigraph/graph/neighbors/";
$scigraph = "http://localhost:9000/scigraph/";

//similarity config
$similarity_url = "http://localhost:8085/dataset%23";


//Mysql database config
$user = "biocaddie";
//$password = "b10c6dd13";
$password = "biocaddie";
$database = "biocaddie";
$dbconf =array(
'ip' => "129.106.31.121", // "192.168.224.106",
'user'=>"biocaddie",
'password'=> 'biocaddie',
'database'=>'biocaddie',
);

//nlp server
$nlp_server = 'http://clamp.uth.edu/nlp-process-webapp/cdr';

//IseeDelve
$IseeDelve = 'http://datamed.biocaddie.org/iseedelve/pdb_v2/';
?>


Loading

0 comments on commit 3c575d0

Please sign in to comment.