Skip to content

Commit

Permalink
start app for dumping data for GBIF
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosp420 committed May 21, 2015
1 parent 6ac8a19 commit ff93dd7
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 0 deletions.
Empty file added voseq/gbif/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions voseq/gbif/admin.py
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
Empty file.
3 changes: 3 additions & 0 deletions voseq/gbif/models.py
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
93 changes: 93 additions & 0 deletions voseq/gbif/templates/gbif/index.html
@@ -0,0 +1,93 @@
{% extends 'public_interface/base.html' %}



{% block content %}
<div class="explorer-container">
<div class="container">
<h3>Integration with GBIF:</h3>
<hr>


<div class="container">
<div class="row">

<div class="col-xs-12 col-sm-12 col-md-11 col-lg-11 ">
<p>
You can share your information hosted in VoSeq with GBIF.
</p>

<p>
<b>GBIF</b> prefers data owners to use their
<a href="http://www.gbif.org/ipt">Integrated Publishing Toolkit (IPT)</a>. This means that
you can install their IPT software to produce a resource in Darwin Core format that can be
harvested by GBIF. In addition to the actual data in your VoSeq installation, <b>IPT allows you
to include a rich variety of metadata</b> for GBIF.
</p>

<p>
VoSeq is able to produce a <b>dump file</b> containing all the data you own. Then you can import
this file into a IPT installation and choose which types of data you want to publish via
GBIF. Once you include all the metadata required by GBIF you have two choices in order to
expose your data taken from GBIF website:
</p>

<ul class="list-group">
<li class="list-group-item"><h4>By setting up a dynamic server software:</h4>
<ul class="list-group">
<li class="list-group-item">- Acquire hardware with a permanent Internet connection (a regular PC is sufficient).</li>
<li class="list-group-item">- Install data publishing software. GBIF recommends the Integrated Publishing Toolkit (IPT). You will need a web server such as Apache.</li>
<li class="list-group-item">- Configure the software for your local data structure; this is the "mapping" process. Please follow the documentation of your chosen publishing software for this process.</li>
<li class="list-group-item">- Register your service with GBIF and sign the GBIF Data Sharing Agreement.</li>
</ul>
</li>
<li class="list-group-item"><h4>Create an archive for your entire dataset:</h4>
<ul class="list-group">
<li class="list-group-item">- This scenario doesn't require a permanent Internet connection.</li>
<li class="list-group-item">- You simply need to create a Darwin Core Archive, upload it to a repository (for example an IPT repository installed by your GBIF Participant Node, an institutional FTP or web server, or a service like Dropbox or the Internet Archive).</li>
<li class="list-group-item">- You then just need to register the public URL for the storage location of your archive with GBIF.</li>
</ul>
</li>
</ul>


<button class="btn btn-primary" onClick="dump_data();">Dump data for GBIF</button>


</div><!-- col -->

</div><!-- row -->
</div><!-- container -->


</div>
</div>
{% endblock content %}


{% block additional_javascript_footer %}
<script type="text/javascript">

function dump_data() {
$.post('dump_data.php', { request: "count_data" },
function(data) {
var out = '';

out = "<br /><br /><p>A total of <b>" + data.count + "</b> records were processed for GBIF. ";
out += "<br />A MS EXCEL will be created with all data for GBIF. <a href='dump_data.php?request=make_file'>Click here to Download</a>. ";
out += "<p>Submit to GBIF by using an installation of their ";
out += "<a href='http://www.gbif.org/informatics/infrastructure/publishing/#c889'>Integrated Publishing Toolkit (IPT)</a>.</p>";
out += "<p>See <a href='http://carlosp420.github.io/VoSeq/#integration-with-gbif'>VoSeq documentation</a> on how to upload this dump file into IPT.</p>";

$('#output').empty().html('<img src="images/loading.gif" />').fadeIn('slow', function(){}).delay(1000).fadeOut('slow', function() {
$('#output').html(out).show();
});

}, "json");

// make and download MS EXCEL file
$.get('dump_data.php', { request: "make_file" });
}

</script>
{% endblock additional_javascript_footer %}
3 changes: 3 additions & 0 deletions voseq/gbif/tests.py
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
11 changes: 11 additions & 0 deletions voseq/gbif/urls.py
@@ -0,0 +1,11 @@
from django.conf.urls import patterns
from django.conf.urls import url

from . import views


urlpatterns = patterns(
'',
url(r'^/$', views.index, name='index'),
url(r'^/results/$', views.results, name='results'),
)
17 changes: 17 additions & 0 deletions voseq/gbif/views.py
@@ -0,0 +1,17 @@
from django.shortcuts import render

from core.utils import get_version_stats


def index(request):
version, stats = get_version_stats()
return render(request, 'gbif/index.html',
{
'version': version,
'stats': stats,
},
)


def results(request):
return ''
1 change: 1 addition & 0 deletions voseq/voseq/settings/base.py
Expand Up @@ -50,6 +50,7 @@
'genbank_fasta',
'gene_table',
'voucher_table',
'gbif',
)

MIDDLEWARE_CLASSES = (
Expand Down
1 change: 1 addition & 0 deletions voseq/voseq/urls.py
Expand Up @@ -12,6 +12,7 @@
url(r'^blast_ncbi', include('blast_ncbi.urls', namespace='blast_ncbi')),
url(r'^blast_new', include('blast_new.urls', namespace='blast_new')),
url(r'^genes', include('view_genes.urls', namespace='view_genes')),
url(r'^share_data_gbif', include('gbif.urls', namespace='gbif')),
url(r'^', include('public_interface.urls', namespace='public_interace')),

url(r'^admin/', include(admin.site.urls)),
Expand Down

0 comments on commit ff93dd7

Please sign in to comment.