Skip to content

Commit

Permalink
Merge branch '4.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Nov 2, 2015
2 parents e4e454d + d083580 commit 3612859
Show file tree
Hide file tree
Showing 85 changed files with 3,666 additions and 1,159 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you for your interest in contributing to Dataverse! We welcome contributio

## Ideas/Feature Requests

The [Dataverse roadmap][] might already capture your idea or feature request but if not, the best way to bring it to the community's attention is by posting on the [dataverse-community Google Group][]. You're also welcome make some noise in the [#dataverse IRC channel][] or cram your idea into 140 characters and mention [@dataverseorg][] on Twitter.
Your idea or feature request might already be captured in the collection of [Dataverse issues] but if not, the best way to bring it to the community's attention is by posting on the [dataverse-community Google Group][]. You're also welcome make some noise in the [#dataverse IRC channel][] or cram your idea into 140 characters and mention [@dataverseorg][] on Twitter.

Once an idea/feature request has been received by the Dataverse Development Team the process outlined in the image below happens.

Expand All @@ -17,7 +17,7 @@ To review FRDs for Dataverse, you can access them in this [Functional Requiremen
See also our [Community and Support][] page.

[#dataverse IRC channel]: http://webchat.freenode.net/?channels=dataverse
[Dataverse roadmap]: http://roadmap.datascience.iq.harvard.edu
[Dataverse issues]: https://github.com/IQSS/dataverse/issues
[@dataverseorg]: http://twitter.com/dataverseorg
[Community and Support]: http://datascience.iq.harvard.edu/dataverse/support
[Functional Requirements Document (FRD for short)]: https://docs.google.com/document/d/1PRyAlP6zlUlUuHfgyUezzuaVQ4JnapvgtGWo0o7tLEs/edit?usp=sharing
Expand Down
99 changes: 99 additions & 0 deletions JAVADOC_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Javadoc Guidelines

Javadoc is the main tool for documenting code written in Java. It is not the only documentation method, though - there are also block comments (`/* ... */`) and line comments (`// ... `). And, of course, there is external documentation - presentations, readme files, etc. Each documentation method has its own target audience. External documentation works well for onboarding developers. Block and line comments work well for addressing maintenance programmers (hopefully, a future you). Javadoc was created mostly for addressing client code programmers - people that write code that uses the documented code.
A Javadoc comment (`/** ... */`) is always attached to an element of the code.

## Style guide
First and foremost, consider your audience. People mostly read the Javadocs when they are using the code as a black box, so describe what the documented artifact does from a client code's point of view. The description should be accurate, but short. The first sentence should be a summary - it's not just a good idea, it's the sentence copied by the Javadoc tool into summary tables at the top of the each Javadoc page. E.g., the table at the project overview page contains the first sentence from the Javadoc comment of each package. Note, however, that the end of the first sentence is detected by looking for the first period followed by a white space. Thus, abbreviations such as "e.g." would be considered as terminating a sentence. The standard workaround is to omit the last period, i.e. "e.g".

Subsequent paragraphs may include references to the implementation, if needed. Describe the current state of the code, not its history. While Javadoc allows embedding links to external resources, do not rely heavily on these, as they can change. When a diagram would do a better job than text, consider using ASCII drawings.

Javadoc supports links and formatting using HTML and specialized Javadoc tags, written `{@tagName tagParameter}`. The full list of Javadoc tags is maintained at the [Javadoc main page](http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html). Important tags include:

* `{@code javaCodeGoesHere}` for adding inline code - very important when referencing code that has generics, since Java's type parameter notation (`List<String>`) will confuse the HTML parser unless escaped.
* `{@see reference}` a link to another class, method, or field in the documentation, appears at the end of the Javadoc comment.
* `{@link className}` same as above, but inline.

As for the HTML tags, try to stick with the textual formatting ones (`<em>`,`<ol>`,`<table>`...), and avoid using structural ones (`<div>`, `<iframe>`). Using the header tags (`<h1>...<h6>`) is discouraged, as they interfere with the semantic structure of the generated document.

Writing good Javadocs is hard, as it requires the writer to phrase exactly what the code does. For this reason, it may be useful to write the Javadoc prior to writing the actual code it documents, as a way of arranging one's thoughts. This is a relaxed version of TDD, where test are written before code.

Lastly, don't overdo it - documentation has to be maintained and updated with the code. Outdated documentation may be even worse than not having one at all.


### Packages
To document a package, create a file called `package-info.java` in the package's directory, and add the comment above the package declaration in that file. This type of documentation is rarely seen in the wild, but is very useful to have when a package usage is not obvious, or when a package has multiple entry points.

/**
* This package contains all that's needed to do that complicated
* thingy. There are a few ways of getting it done, based on your
* need and starting point. If you're running in a JavaEE container,
* consider using the {@link ContainerGetThingDoneer} as your starting
* point. Otherwise, use {@link StandaloneGetThingDonner}.
*/
package edu.harvard.iq.non.intuitive.stuff;

### Classes

Explain what this class does and how it should be used. Consider using sample code. If the class has non-private static methods, make sure to distinguish them from their instance counterparts. Provide guidance regarding when to use which.

/**
* Orchestrates the doing of thing in a container environment
* (e.g Glassfish 4.1). Client code can obtain a configured instance
* using the static method {@link #create()}, or use one of the class'
* constructors and configure the instance manually.
*/
@AnAnnotation
public class ContainerGetThingDonner {
...

### Methods

Method documentation is structured, supporting special tags for the parameters (`@param <name> <description>`) and the return value (`@return <description>`). Together with the method's name, return type, and names and types of the method parameters, most methods can be sufficiently documented without adding free text to the comment. Note, however, that omitting this text would mean no description at the method's row in the summary table at the top of the class page. While documenting methods, use the `@throws` tag to document which exceptions may be thrown, and under which circumstances. This is especially important for runtime exceptions, which are not stated in the method's signature.

A full method javadoc is great, but it may read a bit verbose:

/**
* Creates a description of {@code this}, using at least {@code minimalWordCount} words.
* @param minimalWordCount Lower bound for the generated description word count. Must be a positive number.
* @return A description of {@code this} object, at least {@code minimalWordCount} words long.
* @throws IllegalArgumentException when {@code minimalWordCount} is equal to, or less than, 0.
* @see an.other.package.Description#createFor( java.lang.Class, int )
*/
public String createDescription( int minimalWordCount ) {
...

Since most developers read the Javadocs through their IDE's documentation pane, and not the generated HTML, this may suffice:

/**
* @param minimalWordCount
* @return A description of {@code this} object, at least {@code minimalWordCount} words long.
* @throws IllegalArgumentException when {@code minimalWordCount} is equal to, or less than, 0.
* @see an.other.package.Description#createFor( java.lang.Class, int )
*/
public String createDescription( int minimalWordCount ) {
...

Note that a `@param` tag for `minimalWordCount` exists, but has no description. This is the common way of saying "I did not forget to document this parameter - its name and type sufficiently describe its role".

### Fields

Java allows for multiple fields to be defined using a single statement. This, however, collides with Javadoc's "Javadoc comment precedes the element it documents" principle. When a Javadoc comment appears before a statement defining multiple fields, it is copied to both of them, which it probably not the desired behavior. In the following example of a backing bean for a page that allows moving a dataset between two dataverses, both the source and the target dataverse will have the same Javadoc comment:

/** Datasets on this page */
private Dataverse destinationDataverse, sourceDataverse; // bad idea

Here's a better approach:

/** The dataverse we move the dataset <em>from</em> */
private Dataverse sourceDataverse;

/** The dataverse we movet the dataset <em>to</em> */
private Dataverse destinationDataverse;


## Links

* [Javadoc](http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html)
* [PlantUML's ASCII diagrams](http://plantuml.com/ascii_art.html)
* [JavE - Free ASCII art tool](http://www.jave.de/)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Dataverse is an open source web application for sharing, citing, analyzing, and

Institutions and organizations can choose to install the Dataverse software for their own use.
In this case, the institution will be responsible for maintaining the application; installing upgrades,
setting up backups and data replication as needed. Dataverse 4.0 is now released and used by the Harvard Dataverse: [dataverse.harvard.edu] (http://dataverse.harvard.edu/). If you'd like to first test it, you can use our demo site: [dataverse-demo.iq.harvard.edu] (http://dataverse-demo.iq.harvard.edu/).
setting up backups and data replication as needed. Dataverse 4.0 is now released and used by the Harvard Dataverse: [dataverse.harvard.edu] (http://dataverse.harvard.edu/). If you'd like to first test it, you can use our demo site: [demo.dataverse.org](http://demo.dataverse.org).

For more general information about Dataverse please visit
[dataverse.org] (http://dataverse.org).
Expand Down
4 changes: 4 additions & 0 deletions conf/httpd/conf.d/dataverse.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ProxyPassMatch ^/rookzelig !
# don't pass paths used by Shibboleth to Glassfish
ProxyPassMatch ^/Shibboleth.sso !
ProxyPassMatch ^/shibboleth-ds !
ProxyPassMatch ^/error-documents !
# pass everything else to Glassfish
ProxyPass / ajp://localhost:8009/

Expand All @@ -14,6 +15,9 @@ ProxyPass / ajp://localhost:8009/
require valid-user
</Location>

ErrorDocument 503 /error-documents/503.html
Alias /error-documents /var/www/dataverse/error-documents

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

RewriteEngine On
Expand Down
46 changes: 46 additions & 0 deletions conf/solr/4.6.0/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,29 @@
<field name="gsdStudentProgram" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="gsdTags" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="gsdTypes" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="hbgdkiAnthropometry" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiBiosampleType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="hbgdkiBirthWeight" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiFeedingCare" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiGestationalAge" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiImmunizations" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiInfantChildhoodMorbidity" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiIntervention" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiLowerLimitAge" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiMaternalChar" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiNeurocognitiveDev" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiOther" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiPregnancyBirth" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiSocioeconomicChar" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiStudyName" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiStudyRegistry" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="hbgdkiStudyRegistryNumber" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="hbgdkiStudyRegistryType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="hbgdkiStudyType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="hbgdkiUnitsLowerLimitAge" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiUnitsUpperLimitAge" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiUpperLimitAge" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="hbgdkiWaterSanHygiene" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="journalArticleType" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="journalIssue" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="journalPubDate" type="text_en" multiValued="true" stored="true" indexed="true"/>
Expand Down Expand Up @@ -702,6 +725,29 @@
<copyField source="gsdStudentProgram" dest="text" maxChars="3000"/>
<copyField source="gsdTags" dest="text" maxChars="3000"/>
<copyField source="gsdTypes" dest="text" maxChars="3000"/>
<copyField source="hbgdkiAnthropometry" dest="text" maxChars="3000"/>
<copyField source="hbgdkiBiosampleType" dest="text" maxChars="3000"/>
<copyField source="hbgdkiBirthWeight" dest="text" maxChars="3000"/>
<copyField source="hbgdkiFeedingCare" dest="text" maxChars="3000"/>
<copyField source="hbgdkiGestationalAge" dest="text" maxChars="3000"/>
<copyField source="hbgdkiImmunizations" dest="text" maxChars="3000"/>
<copyField source="hbgdkiInfantChildhoodMorbidity" dest="text" maxChars="3000"/>
<copyField source="hbgdkiIntervention" dest="text" maxChars="3000"/>
<copyField source="hbgdkiLowerLimitAge" dest="text" maxChars="3000"/>
<copyField source="hbgdkiMaternalChar" dest="text" maxChars="3000"/>
<copyField source="hbgdkiNeurocognitiveDev" dest="text" maxChars="3000"/>
<copyField source="hbgdkiOther" dest="text" maxChars="3000"/>
<copyField source="hbgdkiPregnancyBirth" dest="text" maxChars="3000"/>
<copyField source="hbgdkiSocioeconomicChar" dest="text" maxChars="3000"/>
<copyField source="hbgdkiStudyName" dest="text" maxChars="3000"/>
<copyField source="hbgdkiStudyRegistry" dest="text" maxChars="3000"/>
<copyField source="hbgdkiStudyRegistryNumber" dest="text" maxChars="3000"/>
<copyField source="hbgdkiStudyRegistryType" dest="text" maxChars="3000"/>
<copyField source="hbgdkiStudyType" dest="text" maxChars="3000"/>
<copyField source="hbgdkiUnitsLowerLimitAge" dest="text" maxChars="3000"/>
<copyField source="hbgdkiUnitsUpperLimitAge" dest="text" maxChars="3000"/>
<copyField source="hbgdkiUpperLimitAge" dest="text" maxChars="3000"/>
<copyField source="hbgdkiWaterSanHygiene" dest="text" maxChars="3000"/>
<copyField source="journalArticleType" dest="text" maxChars="3000"/>
<copyField source="journalIssue" dest="text" maxChars="3000"/>
<copyField source="journalPubDate" dest="text" maxChars="3000"/>
Expand Down
1 change: 1 addition & 0 deletions conf/vagrant/var/www/dataverse/error-documents/503.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Custom "site is unavailable" 503 page.</p>
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ API Guide
We encourage anyone interested in building tools to
interoperate with the Dataverse to utilize our
APIs. In 4.0, we require to get a token, by simply registering for a Dataverse account, before using our APIs
(We are considering making some of the APIs completley public in the future - no token required - if you use it only a few times).
(We are considering making some of the APIs completely public in the future - no token required - if you use it only a few times).

Rather than using a production installation of Dataverse, API users should use http://apitest.dataverse.org for testing.

Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx-guides/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
# built documents.
#
# The short X.Y version.
version = '4.2'
version = '4.2.1'
# The full version, including alpha/beta/rc tags.
release = '4.2'
release = '4.2.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 3 additions & 3 deletions doc/sphinx-guides/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Dataverse 4.2 Guides
====================
Dataverse 4.2.1 Guides
======================

These guides are for the most recent version of Dataverse. For the guides for **version 4.1** please go `here <http://guides.dataverse.org/en/4.1/>`_.
These guides are for the most recent version of Dataverse. For the guides for **version 4.2** please go `here <http://guides.dataverse.org/en/4.2/>`_.

.. toctree::
:glob:
Expand Down
9 changes: 8 additions & 1 deletion doc/sphinx-guides/source/installation/installation-main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,17 @@ Settings
ApplicationPrivacyPolicyUrl
---------------------------

Specify a URL where users can read your Privacy Policy.
Specify a URL where users can read your Privacy Policy, linked from the bottom of the page.

``curl -X PUT -d http://best-practices.dataverse.org/harvard-policies/harvard-privacy-policy.html http://localhost:8080/api/admin/settings/:ApplicationPrivacyPolicyUrl``

ApplicationTermsOfUse
---------------------

Upload a text file containing the Terms of Use to be displayed at sign up.

``curl -X PUT -d@/tmp/apptou.html http://localhost:8080/api/admin/settings/:ApplicationTermsOfUse``

ApiTermsOfUse
-------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ to
c. Edit the following lines in dataexplore/rook/rookutils.R:
************************************************************

``url <- paste("https://dataverse-demo.iq.harvard.edu/custom/preprocess_dir/preprocessSubset_",sessionid,".txt",sep="")``
``url <- paste("https://demo.dataverse.org/custom/preprocess_dir/preprocessSubset_",sessionid,".txt",sep="")``

and

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WorldMap: Geospatial Data Exploration

WorldMap
===========
`WorldMap <http://worldmap.harvard.edu/>`_ is developed by the Center for Geographic Analysis (CGA) at Harvard and is an open source software that helps researchers visualize and explore their data in maps. The WorldMap and Dataverse collaboration allows researchers to be able to upload shapefiles to Dataverse for long term storage and receive a persistent identifer (through DOI) as well as be able to easily move into WorldMap to interact with the data and save to WorldMap as well. GeoConnect is the platform integrating Dataverse and WorldMap together and what you will use to visualize your data.
`WorldMap <http://worldmap.harvard.edu/>`_ is developed by the Center for Geographic Analysis (CGA) at Harvard and is an open source software that helps researchers visualize and explore their data in maps. The WorldMap and Dataverse collaboration allows researchers to be able to upload shapefiles to Dataverse for long term storage and receive a persistent identifier (through DOI) as well as be able to easily move into WorldMap to interact with the data and save to WorldMap as well. GeoConnect is the platform integrating Dataverse and WorldMap together and what you will use to visualize your data.

Uploading Shapefiles to Dataverse
=====================================
Expand Down
Loading

0 comments on commit 3612859

Please sign in to comment.