Skip to content

Commit

Permalink
Merge pull request #12 from IQSS/master
Browse files Browse the repository at this point in the history
Beta build, 6/5, version diffs
  • Loading branch information
kcondon committed Jun 5, 2014
2 parents 5a3ddad + c52d4c1 commit 0947592
Show file tree
Hide file tree
Showing 94 changed files with 4,690 additions and 1,849 deletions.
8 changes: 6 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.provision "shell", path: "scripts/setup/asadmin-setup.sh"
config.vm.provision "shell", path: "scripts/vagrant/deploy.sh"
config.vm.provision "shell", path: "scripts/vagrant/test.sh"

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# accessing "localhost:8888" will access port 8080 on the guest machine.
config.vm.network "forwarded_port", guest: 8080, host: 8888

# Create a private network, which allows host-only access to the machine
Expand All @@ -41,10 +42,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# FIXME: use /dataverse/downloads instead
config.vm.synced_folder "downloads", "/downloads"
config.vm.synced_folder "target", "/builds"
# FIXME: use /dataverse/conf instead
config.vm.synced_folder "conf", "/conf"
# FIXME: use /dataverse/scripts instead
config.vm.synced_folder "scripts", "/scripts"
config.vm.synced_folder ".", "/dataverse"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
Expand Down
19 changes: 19 additions & 0 deletions conf/httpd/conf.d/dataverse.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ProxyPass / ajp://localhost:8009/

# From https://wiki.apache.org/httpd/RewriteHTTPToHTTPS

RewriteEngine On
# This will enable the Rewrite capabilities

RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS

#RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteRule ^/dvn/api/data-deposit/?(.*) https://%{SERVER_NAME}/dvn/api/data-deposit/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context

# [#GLASSFISH-20694] Glassfish 4.0 and jk Unable to populate SSL attributes - Java.net JIRA - https://java.net/jira/browse/GLASSFISH-20694
#SSLOptions +StdEnvVars +ExportCertData
11 changes: 11 additions & 0 deletions doc/Sphinx/source/Developers/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,14 @@ created. You can edit this file to configure PageKite to serve up port 8080
(the default GlassFish HTTP port) or the port of your choosing.

According to https://pagekite.net/support/free-for-foss/ PageKite (very generously!) offers free accounts to developers writing software the meets http://opensource.org/docs/definition.php such as Dataverse.

Vagrant
+++++++

Vagrant allows you to spin up a virtual machine running Dataverse on
your development workstation.

From the root of the git repo, run ``vagrant up`` and eventually you
should be able to reach an installation of Dataverse at
http://localhost:8888 (or whatever forwarded_port indicates in the
Vagrantfile)
2 changes: 1 addition & 1 deletion doc/Sphinx/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Other Resources
Additional information about the Dataverse Project itself
including presentations, information about upcoming releases, data
management and citation, and announcements can be found at
`http://thedata.org <http://thedata.org/>`__
`http://datascience.iq.harvard.edu/ <http://datascience.iq.harvard.edu/>`__

**User Group**

Expand Down
2 changes: 1 addition & 1 deletion scripts/api/data-deposit/create-dataset
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
DATAVERSE_ALIAS=peteTop
curl --insecure --data-binary "@scripts/api/data-deposit/data/atom-entry-study.xml" -H "Content-Type: application/atom+xml" https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/collection/dataverse/$DATAVERSE_ALIAS \
curl -s --insecure --data-binary "@scripts/api/data-deposit/data/atom-entry-study.xml" -H "Content-Type: application/atom+xml" https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/collection/dataverse/$DATAVERSE_ALIAS \
| xmllint -format -
9 changes: 7 additions & 2 deletions scripts/api/data-deposit/delete-dataset
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
#GLOBAL_ID=hdl:TEST/12345
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12`
if [ -z "$1" ]; then
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12,13`
else
GLOBAL_ID=$1
# https://redmine.hmdc.harvard.edu/issues/3993
#GLOBAL_ID=doi:10.5072/FK2/5555
fi
#curl --insecure -X DELETE https://$DVN_SERVER/api/datasets/$DATABASE_ID?key=$USERNAME
curl --insecure -i -X DELETE https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit/study/$GLOBAL_ID
#| xmllint -format -
14 changes: 14 additions & 0 deletions scripts/api/data-deposit/delete-file
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -x
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
if [ -z "$1" ]; then
FILE_ID=`scripts/api/data-deposit/show-files | cut -d'/' -f1`
#echo $FILE_ID
#exit
else
FILE_ID=$1
fi
#curl --insecure -X DELETE https://$DVN_SERVER/api/datasets/$DATABASE_ID?key=$USERNAME
curl --insecure -i -X DELETE https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit-media/file/$FILE_ID
#| xmllint -format -
9 changes: 7 additions & 2 deletions scripts/api/data-deposit/list-datasets
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
DATAVERSE_ALIAS=peteTop
curl --insecure https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/collection/dataverse/$DATAVERSE_ALIAS \
if [ -z "$1" ]; then
DATAVERSE_ALIAS=peteTop
#DATAVERSE_ALIAS=root
else
DATAVERSE_ALIAS=$1
fi
curl --insecure -s https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/collection/dataverse/$DATAVERSE_ALIAS \
| xmllint -format -
11 changes: 11 additions & 0 deletions scripts/api/data-deposit/pipeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
require "rexml/document"
include REXML
service_document = Document.new `scripts/api/data-deposit/service-document`
collection = XPath.first(service_document, "//collection/@href")
puts collection

puts "Getting first title from #{collection}"
feed_of_studies = Document.new `scripts/api/data-deposit/show-collection #{collection}`
title = XPath.first(feed_of_studies, "//title")
puts title
14 changes: 14 additions & 0 deletions scripts/api/data-deposit/publish-dataset
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
if [ -z "$1" ]; then
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12,13`
else
GLOBAL_ID=$1
#GLOBAL_ID=doi:10.5072/FK2/5555
fi
# We cat /dev/null so that contentLength is zero. This makes headersOnly true:: https://github.com/swordapp/JavaServer2.0/blob/sword2-server-1.0/src/main/java/org/swordapp/server/ContainerAPI.java#L338
# 'to tell curl to read the format from stdin you write "@-"' -- http://curl.haxx.se/docs/manpage.html
cat /dev/null | curl -s --insecure -X POST -H "In-Progress: false" --data-binary @- https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit/study/$GLOBAL_ID \
| xmllint --format -
13 changes: 13 additions & 0 deletions scripts/api/data-deposit/publish-dataverse
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
if [ -z "$1" ]; then
echo "Please supply a dataverse alias"
exit 1
else
DATAVERSE_ALIAS=$1
#DATAVERSE_ALIAS=peteTop
fi
cat /dev/null | curl -s --insecure -X POST -H "In-Progress: false" --data-binary @- https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit/dataverse/$DATAVERSE_ALIAS \
| xmllint --format -
12 changes: 11 additions & 1 deletion scripts/api/data-deposit/service-document
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
#!/bin/bash
curl --insecure https://pete:pete@localhost:8181/dvn/api/data-deposit/v1/swordv2/service-document | xmllint -format -
USERNAME=pete
PASSWORD=$USERNAME
if [ -z "$1" ]; then
HOSTNAME=localhost:8181
else
HOSTNAME=$1
fi
URL=https://$HOSTNAME/dvn/api/data-deposit/v1/swordv2/service-document
echo Retrieving service document from $URL >&2
curl --insecure -u $USERNAME:$PASSWORD $URL \
| xmllint -format -
8 changes: 6 additions & 2 deletions scripts/api/data-deposit/show-atom-entry
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
#GLOBAL_ID=hdl:TEST/12345
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12`
if [ -z "$1" ]; then
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12,13`
else
GLOBAL_ID=$1
#GLOBAL_ID=doi:10.5072/FK2/5555
fi
curl --insecure -s https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit/study/$GLOBAL_ID \
| xmllint -format -
10 changes: 10 additions & 0 deletions scripts/api/data-deposit/show-collection
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
USERNAME=pete
PASSWORD=pete
if [ -z "$1" ]; then
echo "Please provide a URL"
else
URL=$1
fi
curl --insecure -s -u $USERNAME:$PASSWORD $URL
#| xmllint -format -
2 changes: 1 addition & 1 deletion scripts/api/data-deposit/show-files
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
#scripts/api/data-deposit/show-statement | xpath "//entry/content/@*[name()='type' or name()='src']"
scripts/api/data-deposit/show-statement | xpath '//entry/id/text()' | cut -d'/' -f11,12
scripts/api/data-deposit/show-statement | xpath '//entry/id/text()' | cut -d'/' -f11,12,13
7 changes: 6 additions & 1 deletion scripts/api/data-deposit/show-statement
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12`
if [ -z "$1" ]; then
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12,13`
else
GLOBAL_ID=$1
#GLOBAL_ID=doi:10.5072/FK2/5555
fi
curl --insecure -s https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/statement/study/$GLOBAL_ID \
| xmllint -format - \
#| xpath '//entry/title'
12 changes: 12 additions & 0 deletions scripts/api/data-deposit/unsupported-download-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
if [ -z "$1" ]; then
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12,13`
else
GLOBAL_ID=$1
#GLOBAL_ID=doi:10.5072/FK2/5555
fi
curl -s --insecure https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit-media/study/$GLOBAL_ID \
| xmllint -format -
9 changes: 8 additions & 1 deletion scripts/api/data-deposit/upload-file
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12`
if [ -z "$1" ]; then
GLOBAL_ID=`scripts/api/data-deposit/list-datasets | xpath '//id/text()' | cut -d'/' -f11,12,13`
else
GLOBAL_ID=$1
#GLOBAL_ID=doi:10.5072/FK2/5555
fi
curl -s --insecure --data-binary @scripts/api/data-deposit/data/example.zip -H "Content-Disposition: filename=example.zip" -H "Content-Type: application/zip" -H "Packaging: http://purl.org/net/sword/package/SimpleZip" https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit-media/study/$GLOBAL_ID \
| xmllint -format -
#curl -s --insecure --data-binary @scripts/search/data/binary/trees.zip -H "Content-Disposition: filename=trees.zip" -H "Content-Type: application/zip" -H "Packaging: http://purl.org/net/sword/package/SimpleZip" https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit-media/study/$GLOBAL_ID \
#| xmllint -format -
7 changes: 4 additions & 3 deletions scripts/api/data/dataset-bad-missingInitialVersion.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"authority":"anAuthority",
"identifier":"dataset-one",
"protocol":"chadham-house-rule"
"authority": "anAuthority",
"identifier": "dataset-one",
"persistentUrl": "http://dx.doi.org/10.5072/FK2/9",
"protocol": "chadham-house-rule"
}
Loading

0 comments on commit 0947592

Please sign in to comment.