This is a tool to generate date-delimited reports for individual scholars in a Vivo instance. The data is obtained through a web service (Vivo Widgets), rather than directly from a SPARQL endpoint.
This project uses Om, a Clojurescript wrapper for the Javascript framework React. It produces static html, css and javascript to do the reporting.
Install Leiningen. If you are using Homebrew on a Mac, you can run:
brew install leiningen
Compile the files:
git clone https://github.com/OIT-ADS-Web/vivo_widgets_reporter.git
cd vivo_widgets_reporter
lein cljsbuild auto development
This will continually compile the files each time you save one. If you just want to compile once, run:
lein cljsbuild once development
There is a bash script to handle deployment. You can run it like this:
./deploy development
You can also specify acceptance or production environments. Note that it is not git-aware. It will work with whatever files you have in your local working tree. It simply compiles the ClojureScript and syncs html, js, and css to the appropriate server. There currently is no rollback. You can handle that locally by checking out a previous git revision and re-running.
Open development.html in your browser (Chrome recommended, because it works better with source maps).
You can access the development version of the reporter by setting up a basic Web server:
python -m SimpleHTTPServer 8000
Then going to:
localhost:8000/development.html?uri=<some_uri>
Here are some helpful hacks for your vim setup. (If in Emacs, no worries, you're already in Lisp land. And in any case, I can't help you.)
Gabe Hollombe has a good blog post on vim and Clojure.
Personally, I like the combination of tmux and Vimux, with the ability to send chunks of code over to a repl running in a separate pane. I will probably write up a blog post on the process sometime.
The tests require Firefox, version 28. To run a newer Firefox, update the selenium-webdriver gem.
The tests also require Ruby (~ 2.1) and that you are compiling your ClojureScript.
bundle install
lein cljsbuild auto development
bundle exec rspec spec/
The tests currently hit live data, so it is possible that this will cause intermittent failures.
If you have nixpkgs install with flakes enabled, you can run the following command to start a shell with java 8 and lein in the path:
$ nix develop
If you have nixpkgs setup with direnv, you can run the following to create
a .envrc
file and if you allow it, it will load the environment.
$ echo 'use flake' > .envrc
...
$ direnv allow
To generate production files that get put in the "out" directorry in this project, run the following command:
$ docker-compose up generate-production
If you are using podman, it can use the same docker-compose.yml
file
with this command:
$ podman compose up generate-production