*Deprecated* See https://wiki.duraspace.org/display/VIVODOC/All+Documentation for current documentation

Introduction

Digital Vita is a research networking application that allows users to manage CV and NIH biosketch information, and to create and edit an online profile. It automatically imports data from external sources and propagates publications to co-authors. Version 2.1 of Digital Vita now allows users to build networks of colleagues they collaborate with as well as share CVs and biosketches.

Go to the following website for more information.

http://digitalvita.pitt.edu/

Pre-requisites

Digital Vita web service needs the following jar files in order to compile properly.

cli-0.3-SNAPSHOT.jar

evaluator-0.3-SNAPSHOT.jar

rewriter-0.3-SNAPSHOT.jar

osgi-consumer-0.3-SNAPSHOT.jar

saxon-9.3.jar

The jar files can be downloaded from:

http://code.google.com/p/digital-vita/source/browse/trunk/VIVODocs/digital-vitaDOCS/lib/?r=3937

The jar files will be copied to /DVDocs/digital-vitaDOCS/lib once Digital Vita is downloaded (see instructions below).

<!--
Digital Vita web service needs the following jar files in order to compile properly.

cli-0.4-SNAPSHOT.jar

evaluator-0.4-SNAPSHOT.jar

rewriter-0.4-SNAPSHOT.jar

osgi-consumer-0.4-SNAPSHOT.jar

The jar files can be obtained by building xsparql.

1. 

Download the current svn version of xsparql:

svn co https://xsparql.svn.sourceforge.net/svnroot/xsparql xsparql

2. Depending on the version of the downloaded version, there may be a need to modify the pom.

E.g. if the version has been upgraded to 0.4, the pom files will need to be modified.

Go to trunk ...

backup the original copy of pom.xml

edit pom.xml

  <modules>
    <module>rewriter</module>
    <module>evaluator</module>
    <module>webapp</module>
    <module>cli</module>
    <module>osgi-consumer</module>
  </modules>


backup the original copy of /xsparql/trunk/osgi-consumer/pom.xml

edit pom.xml

  <parent>
    <artifactId>parent</artifactId>
    <groupId>org.deri.xsparql</groupId>
    <version>0.4-SNAPSHOT</version>
  </parent>

  <version>0.4-SNAPSHOT</version>

3.

mvn install

The following jar files will be copied to /DVDocs/digital-vitaDOCS/lib once DVDocs is downloaded (see instructions below).

cli/target/cli-0.4-SNAPSHOT.jar

evaluator/target/evaluator-0.4-SNAPSHOT.jar

rewriter/target/rewriter-0.4-SNAPSHOT.jar

osgi-consumer/target/osgi-consumer-0.4-SNAPSHOT.jar

-->

Building and Deploying the Digital Vita Web Service

1. Download DVDocs from

http://loafer.dbmi.pitt.edu/dvdownload/dvdocs/dvdocs-documentation.zip

http://loafer.dbmi.pitt.edu/dvdownload/dvdocs/dvdocs-extra-jars.zip

http://loafer.dbmi.pitt.edu/dvdownload/dvdocs/dvdocs-src.zip

http://loafer.dbmi.pitt.edu/dvdownload/dvdocs/dvdocs-binaries.zip

2. Unzip dvdocs-src and copy the previously downloaded jar files to /DVDocs/digital-vitaDOCS/lib

3. Check /DVDocs/build.xml and be sure the version numbers match with those of the jar files.

For instance: If the saxon file has been renamed as saxon9he.jar, this will need to be specified in the build file.

e.g. build.xml:

<property name="xsparql-cli.jar" value="${docs.dir}/lib/cli-0.3-SNAPSHOT.jar"/>
<property name="xsparql-evaluator.jar" value="${docs.dir}/lib/evaluator-0.3-SNAPSHOT.jar"/>
<property name="xsparql-osgi.jar" value="${docs.dir}/lib/osgi-consumer-0.3-SNAPSHOT.jar"/>
<property name="xsparql-rewriter.jar" value="${docs.dir}/lib/rewriter-0.3-SNAPSHOT.jar"/>
<property name="saxon.jar" value="${docs.dir}/lib/saxon9he.jar"/>

4. Run 'ant clean-deploy' in the web service project root

5. Make sure the file dv-docs.war has been deployed to Tomcat's webapps folder

If not, copy to the webapps folder manually.

Customizing VIVO to Display the Buttons

1. Create your images and copy to the images folder

2. Modify ftl

i)

/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl

Add this line:

<#include "individual-digitalvita.ftl">

ii)

Create /productMods/templates/freemarker/body/partials/individual/individual-digitalvita.ftl:

Copy and paste to create the new freemarker file. Replace vivo.mydomain.edu with your VIVO domain.

<#-- Digital Vita -->

<li role="listitem">
<a class="qrCode" href="/dv-docs/vivo-doc-gen/vivo.med.cornell.edu/${modifyUri(individual.uri)}?filetype=cv">
<img id="uriIcon" title="Curriculum Vitae (CV)" class="middle" src="${urls.base}/themes/wilma/images/icon_cv_small.jpg" alt="CV icon" height="30" width="26" />
</a>
</li>

<li role="listitem">
<a class="qrCode" href="/dv-docs/vivo-doc-gen/vivo.med.cornell.edu/${modifyUri(individual.uri)}?filetype=nih">
<img id="uriIcon" title="NIH Biosketch" class="right" src="${urls.base}/themes/wilma/images/icon_nih_small.jpg" alt="NIH Biosketch icon" height="30" width="26" />
</a>
</li>

<#function modifyUri uri>

	<#local modUri = uri>
    <#local test = "http://vivo.mydomain.edu/individual/">
    <#local replacement = "">

	<#if uri?contains(test)>
		<#local modUri = uri?replace(test, replacement)>
	</#if>
	
	<#return modUri>

</#function>

3. Go to the working directory (e.g. /vivo-rel-1.4.1) of VIVO, and run "ant all" to re-deploy the changes

Troubleshooting

1. During 'ant build-deploy-all' of DVDocs, Maven kept pulling a 301 Permanently Moved error related to jersey-project-1.6.pom.

Reason:

The file in Maven's repository .m2/repository/com/sun/jersey/jersey-project/1.6/jersey-project-1.6.pom is corrupt.

The content is similar to this:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/0.6.39</center>
</body>
</html>

Solution:

Google search for jersey-project-1.6.pom. You should get a link like this: http://download.java.net/maven/2/com/sun/jersey/jersey-project/1.6/jersey-project-1.6.pom

Copy and replace the content of jersey-project-1.6.pom.

2. When clicking on the NIH Biosketch icon, instead of showing the Biosketch format, it showed a CV. And when specifying RTF instead of PDF, it continued to load the PDF format.

Reason:

The edu.pitt.dbmi.digitalvita.docs.service.DocumentResource code has been hard-coded to load PDF in CV format.

Solution:

a) Edit the file DocumentResource and modify the generateDocument method.

The following is a suggested modified code:

	private static byte [] generateDocument(String inputFileName, DocumentTemplateType docType, OutputFileType fileformat) 
                        throws DocGenException, IOException
	{
			DVDocs docs = new DVDocs();
			File inFile = new File(inputFileName);
			FileReader in = new FileReader(inFile);
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			//default to generating a CV and use the Vancouver citation format
			///docs.generateDocument(in, DocumentTemplateType.CURRICULUM_VITAE, fileformat, CitationFormat.VANCOUVER, out); // original
			docs.generateDocument(in, docType, fileformat, CitationFormat.VANCOUVER, out);
			in.close();
			return(out.toByteArray());
	}	

b) Edit the file DocumentResource and modify the getDocument method.

The following is a suggested modified code:

		///OutputFileType ftype=null; // original
		// Modified begins
		OutputFileType fformat=null;
		type = "application/pdf";
		fformat = OutputFileType.PDF;
		if(fileformat.trim().equals("rtf"))
		{
			type = "application/rtf";
			fformat = OutputFileType.RTF;
		}
		DocumentTemplateType docType = DocumentTemplateType.CURRICULUM_VITAE;
		if(filetype.trim().equals("nih"))
		{
			docType = DocumentTemplateType.NIH_BIOSKETCH;
		}		
		// Modified ends
		/* original
		if(filetype.trim().equals("rtf"))
		{
			type = "application/rtf";
			ftype = OutputFileType.RTF;
		}
		*/

	        //generate a CV from the resulting xml
		///doc = generateDocument(tempXMLFile.getAbsolutePath(), ftype); // original
		doc = generateDocument(tempXMLFile.getAbsolutePath(), docType, fformat);

Thanks

Appreciation goes to Rene Ziede from University of Florida for making this possible.

Addendum

Tammy DiPrima of StonyBrook University attaches this file DocumentResource.java, saying

"This is what DocumentResource.java should look like. In addition to what is mentioned in this wiki, an extra parameter is required that allows filetype as well as fileformat."

 

  • No labels