1 / 110

Introduction to Development on the Open Source VIVO Project

Introduction to Development on the Open Source VIVO Project. 2011 VIVO Conference. Welcome. Goals of this workshop. Connect you to the VIVO Application by building and deploying from the VIVO repositories Connect you to the VIVO Architecture by modifying VIVO

Download Presentation

Introduction to Development on the Open Source VIVO Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Development on the Open Source VIVO Project 2011 VIVO Conference

  2. Welcome

  3. Goals of this workshop • Connect you to the VIVO Application by building and deploying from the VIVO repositories • Connect you to the VIVO Architecture by modifying VIVO • Connect you to the VIVO community

  4. Schedule • Part 1 • Introduction • Deploying VIVO • break: 15 min • Part 2 • Application overview • Modifying VIVO • break: 15 min • Part 3 • Developer tools • Linked open data • The VIVO community

  5. Parts of an open source community • Open repositories • Open development • Open documentation • Open communication

  6. Open repositories • Project space is at sf.net/p/vivo • There are currently four repositories • VITRO – sf.net/p/vivo/vitro/code • VIVO – sf.net/p/vivo/code • Harvester – sf.net/p/vivo/harvester/code • Tools – sf.net/p/vivo/tools/code

  7. SourceForge repositories these buttons modify the checkout Text box For Read/Write Read Only HTTPS Checkout current revision A timeline of the commits to the project This table details the root folders files (standard SVN here) and the latest activity

  8. SourceForge repositories The commit history viewer is only available for projects under 2000 commits at this time. VIVO is at 3455! VITRO is at 8943! Commit history map in reverse order Selected revisions info Items modified

  9. Types of VIVO repositories SVN Git Projects using GIT: Harvester git-scm.com Why Git? Error in original SVN repo forced a distributed model • Project using SVN: VIVO, VITRO, Tools • subversion.apache.org • Standard versioning system used at • Cornell • Indiana • UF

  10. Regardless of repository • Development occurs in trunk • Branches are used for • Release Candidates • Final Releases • Maintenance • Large features • Events like • VIVO Hackathon • This Workshop! vivo-dev-workshops-08-2011

  11. What is not included in the repo • SVN – subversion.apache.org • Java – java.com • ANT – ant.apache.org • Mysql– www.mysql.com • Tomcat6 – tomcat.apache.org • Git– git-scm.com • Maven2 – maven.apache.org

  12. JAVA 6 JDK • Can I use the open-jdk? • Some parts of VIVO require classes that only exist in the sun/oracle implementation • What is Java? • “Write once, run anywhere” – popular quote about java • Many libraries for Java including • JENA http://jena.sourceforge.net/ • Freemarkerhttp://freemarker.sourceforge.net/ • Installation • Debian/Ubuntu – apt-get install sun-java6-jdk • Centos/Redhat – yum install java (need to configure alternatives) • Windows: download and install

  13. Tomcat 6 • Why not Tomcat 7 yet? • Issues with Windows support (seen as minor) • What is Tomcat? • “an open source software implementation of the Java Servlet and JavaServer Pages technologies” – tomcat.apache.org • A webserver for java applications • Installation • Debian/Ubuntu – apt-get install tomcat6 • Centos/Redhat – yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps • Windows: download and follow the instructions

  14. ANT • What is ANT • “a Java library and command-line tool whose mission is to drive processes described by build file” – ant site • Install ANT • Ubuntu/Debian – apt-get install ant • Centos/Redhat – yum install ant • Windows – download and install

  15. Maven 2 • Why Maven2? • Initially it was the ability to NOT commit the libraries needed for harvesting to the repository • What is Maven2? • “a software project management and comprehension tool” –maven.apache.org • Build, reporting, and documentation tool • Install Maven2 • Ubuntu/Debian – apt-get install maven2 • Centos/Redhat – yum install maven2 • Windows – download and install

  16. Deploying VIVO

  17. VIVO and Vitro • Vitro • a general-purpose web-based ontology and instance editor with customizable public browsing • VIVO • some overrides, mostly additions • ontology • theme • custom editing and display • visualization • Harvester interface VIVO Vitro

  18. VIVO and Vitro • Vivo Cornell • “inherits” from both Vitro and VIVO. • adds a theme • overrides some behavior Vivo Cornell VIVO Vitro

  19. Directories VIVO Installation Vitro Installation Tomcat /demo/install/vivo /demo/install/vitro /usr/local/tomcat VIVO Home MySQL /demo/vivohome

  20. Installation directories • Where the coding happens • Comes from Subversion • 2 directories • R/W by • the build script VIVO Installation Vitro Installation Tomcat /demo/install/vivo /demo/install/vitro /usr/local/tomcat VIVO Home MySQL /demo/vivohome

  21. Home Directory • Site-dependent data • Solr index • Uploaded images • Upgrade logs • R/W by • the build script • Tomcat VIVO Installation Vitro Installation Tomcat /demo/install/vivo /demo/install/vitro /usr/local/tomcat VIVO Home MySQL /demo/vivohome

  22. Directories • The running application webapps/vivo webapps/vivosolr • R/W by • Tomcat VIVO Installation Vitro Installation Tomcat /demo/install/vivo /demo/install/vitro /usr/local/tomcat VIVO Home MySQL /demo/vivohome

  23. Directories • The data model • Located somewhere • R/W by • MySQL VIVO Installation Vitro Installation Tomcat /demo/install/vivo /demo/install/vitro /usr/local/tomcat VIVO Home MySQL /demo/vivohome

  24. Create the database CREATE DATABASE vivo CHARACTER SET UTF8; GRANT ALL ON vivo.* TO 'vivoUser'@'localhost' IDENTIFIED BY 'vivoPass'; • Need the MySQL admin ID and password.

  25. Deploying • in the Vivo installation directory, create the deploy.properties file • start with a copy of example.deploy.properties • edit as needed • Run the build ant all

  26. Installation directories # # Where is the Vitro core directory? # In most deployments, this is set to ./vitro-core # (It is not uncommon for this setting to point # elsewhere in development environments). # Examples: # vitro.core.dir = ./vitro-core # vitro.core.dir = ../vitro # vitro.core.dir = /usr/local/vitro/trunk vitro.core.dir = ../vitro

  27. Home directory # # Tells the VIVO application where to store the data # that it creates. This includes uploaded files # (usually images) and the search index. # vitro.home.directory = /usr/local/vivo/data

  28. Tomcat # # The base install directory for your Tomcat server. # The VIVO application will be deployed in the /webapps # directory below this base. # tomcat.home = /usr/local/tomcat # # The name of the VIVO application. # This will appear in the URL for the application. # For example, http://my.vivo.server/vivo # webapp.name = vivo

  29. MySQL access # # Change the end of the URL to reflect your database name. # Change the username and password to match the authorized # database user you created. # VitroConnection.DataSource.url = jdbc:mysql://localhost/vivo VitroConnection.DataSource.username = vivoUser VitroConnection.DataSource.password = vivoPass

  30. Root user # # The email address of the root user for VIVO. # The password for this user is initially set to # "rootPassword", but you will be asked to # change the password the first time you log in. # rootUser.emailAddress = root@mydomain.edu

  31. Default namespace # # This namespace will be used when generating URIs # for objects created in the editor. # In order to serve linked data, the default # namespace must be composed as follows # (optional elements in parentheses): # # scheme + server_name (+ port) (+ servlet_context) + # "/individual/" # # For example, Cornell's default namespace is: # # http://vivo.cornell.edu/individual/ # Vitro.defaultNamespace = http://vivo.mydomain.edu/individual/

  32. Email (disabled) # # Email parameters which VIVO can use to send mail. # If these are left empty, the "Contact Us" form # will be disabled and users will not be notified of # changes to their accounts. # #email.smtpHost = smtp.mydomain.edu #email.replyTo = vivo_admin@mydomain.edu

  33. Solr # # URL of Solr context used in local VIVO search. # This will usually consist of: # scheme + server_name + port + vivo_webapp_name + "solr" # In the standard installation, the Solr context will be on # the same server as VIVO, and in the same Tomcat instance, # so the path will be: # webapp.name (specified above) + "solr" # Example: # vitro.local.solr.url = http://localhost:8080/vivosolr vitro.local.solr.url = http://localhost:8080/vivosolr

  34. More… • Database parameters: VitroConnection.DataSource.pool.maxActive VitroConnection.DataSource.pool.maxIdle VitroConnection.DataSource.dbtype VitroConnection.DataSource.driver VitroConnection.DataSource.validationQuery • Authentication and Profiles: selfEditing.idMatchingProperty externalAuth.buttonText externalAuth.netIdHeaderName

  35. More… • Visualization: visualization.temporal visualization.topLevelOrg • Harvester: harvester.location • Google reconcile: Vitro.reconcile.defaultTypeList • Solr: vitro.local.solr.ipaddress.mask

  36. Did it work? • Start tomcat • Browse these pages: http://localhost:8080/vivo http://localhost:8080/vivosolr • Look in the home directory: • see solr/data • see uploads

  37. Troubleshooting • Log files in the tomcat/logs directory • names will differ slightly depending on OS • catalina.out • vivo.all.log • solr.log • localhost.log

  38. Break 1 15 min break We will start again at X:XX AM

  39. Application Overview

  40. Application flow overview System startup Servlet context Context listeners Solr indexer policies Freemarker configuration file system Configuration properties HTTP Request Controllers Freemarker Templates Servlet filters HTTP Response models data filters DAOs Application bean Request Session Editing session status User Account

  41. View from the controller Session Login status and user information Editing: EditConfiguration EditSubmission Short-term display preferences ServletContext Configuration properties (from deploy.properties) FreemarkerConfiguration Loader VClassGroupCache Search: SolrServer IndexBuilder Policies Request DAO factories: Default (filtered) Unfiltered Full Dataset Models: Assertions model Inferences model Full model Application bean App name Theme directory etc.

  42. Theming Making it your own

  43. VIVO Theming

  44. VIVO Theming

  45. VIVO Theming

  46. Anatomy of a VIVO theme • Templates (.ftl) • Stylesheets (.css) • Scripts (.js) • Templates are written in FreeMarker • Stylesheets and scripts – nothing unusual

  47. Directory structure • Any VIVO theme must include “templates” directory • App knows to look here when loading templates

  48. Template types • Page request = multiple templates • Templates grouped by type • base template • body template

  49. page.ftl – the Base Template • first template called • complete control over HTML • called no matter what page is requested* • placed shared content/markup here • header • navigation • footer • every theme must contain page.ftl as a bare minimum

More Related