Skip to content

Commit

Permalink
Merge branch 'develop' into 4261-sitemap #4261
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Sep 28, 2018
2 parents 63d7a4f + ec377d2 commit 6eecbf1
Show file tree
Hide file tree
Showing 69 changed files with 2,518 additions and 1,550 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ conf/docker-aio/dv/install/dvinstall.zip
# or copy of test data
conf/docker-aio/testdata/
scripts/installer/default.config
*.pem
191 changes: 191 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">

<module name="Checker">
<!--
If you set the basedir property below, then all reported file
names will be relative to the specified directory. See
http://checkstyle.sourceforge.net/5.x/config.html#Checker
<property name="basedir" value="${basedir}"/>
-->

<!-- <property name="fileExtensions" value="java, properties"/> -->
<property name="fileExtensions" value="java"/>

<!-- Checks that a package-info.java file exists for each package. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
<!-- <module name="JavadocPackage"/> -->

<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<!--<module name="NewlineAtEndOfFile"/>-->

<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<!--
<module name="Translation"/>
-->

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!-- <module name="FileLength"/> -->

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!-- Checks that there are no tab characters ('\t') in the source code. http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter-->
<module name="FileTabCharacter"/>

<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<!--
<module name="RegexpSingleline">
<property name="format" value="[^\s]\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>
-->

<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!--
<module name="RegexpHeader">
<property name="headerFile" value="${checkstyle.header.file}"/>
<property name="fileExtensions" value="java"/>
</module>
-->

<module name="TreeWalker">

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<!--
<module name="JavadocMethod">
<property name="severity" value="info"/>
<property name="allowMissingParamTags" value="true"/>
</module>
<module name="JavadocType"/>
<module name="JavadocVariable">
<property name="ignoreNamePattern" value="^[A-Z_\-]+$" />
</module>
<module name="JavadocStyle">
<property name="checkFirstSentence" value="false" />
</module>
-->

<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<!--
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
-->

<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<!--
<module name="AvoidStarImport">
<property name="excludes" value="lombok,java.util,org.springframework.web.bind.annotation"/>
</module>
-->
<!-- <module name="IllegalImport"/> --> <!-- defaults to sun.* packages -->
<!-- <module name="RedundantImport"/> -->
<!-- <module name="UnusedImports">
<property name="processJavadoc" value="false"/>
</module> -->
<!-- <module name="CustomImportOrder" /> -->

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!--
<module name="LineLength">
<property name="max" value="120"/>
<!- ignore lines with javadoc inside ->
<property name="ignorePattern" value="^ *\* *[^ ]+$"/>
</module>
<module name="MethodLength"/>
<module name="ParameterNumber"/>
-->

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!--
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
-->

<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<!--
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
-->

<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->

<!--<module name="AvoidNestedBlocks"/>-->
<!--<module name="EmptyBlock"/>-->
<!-- Put the left curly at the end of the line above, not on the next line. http://checkstyle.sourceforge.net/config_blocks.html#LeftCurly-->
<module name="LeftCurly"/>
<!--<module name="NeedBraces"/>-->
<!--<module name="RightCurly"/>-->


<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!--
<module name="AvoidInlineConditionals"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
<property name="ignoreSetter" value="true"/>
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber"/>
<module name="MissingSwitchDefault"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
-->

<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!-- <module name="DesignForExtension"/> -->
<!-- <module name="FinalClass"/> -->
<!-- <module name="HideUtilityClassConstructor"/> -->
<!-- <module name="InterfaceIsType"/> -->
<!-- <module name="VisibilityModifier"/> -->

<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<!-- <module name="ArrayTypeStyle"/> -->
<!-- <module name="FinalParameters"/> -->
<!--
<module name="TodoComment">
<property name="severity" value="info"/>
</module>
-->
<!-- <module name="UpperEll"/> -->

</module>

</module>
2 changes: 1 addition & 1 deletion conf/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fi
#
# Build init-container
#
cp ../../scripts/installer/postgres-setup dataverse-glassfish/init-container
cp ../../scripts/installer/install dataverse-glassfish/init-container
docker build -t $HUBORG/init-container:$TAG dataverse-glassfish/init-container
if [ "$1" == 'internal' ]; then
echo "Skipping docker push because we're using the internal Minishift registry."
Expand Down
5 changes: 2 additions & 3 deletions conf/docker/dataverse-glassfish/init-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ RUN yum install -y \
postgresql \
sha1sum

COPY postgres-setup /
COPY install /

ENTRYPOINT ["/postgres-setup"]
CMD ["dataverse"]
ENTRYPOINT ["/install", "--pg_only", "--yes"]
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ExecStart = /usr/bin/java -jar /usr/local/glassfish4/glassfish/lib/client/appser
ExecStop = /usr/bin/java -jar /usr/local/glassfish4/glassfish/lib/client/appserver-cli.jar stop-domain
ExecReload = /usr/bin/java -jar /usr/local/glassfish4/glassfish/lib/client/appserver-cli.jar restart-domain
LimitNOFILE=32768
DefaultTimeoutStartSec=120s # current default is 90s
Type = forking

[Install]
Expand Down
9 changes: 8 additions & 1 deletion doc/sphinx-guides/source/admin/dataverses-datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Moves a dataset whose id is passed to a dataverse whose alias is passed. If the
Link a Dataset
^^^^^^^^^^^^^^

Creates a link between a dataset and a dataverse (see the Linked Dataverses + Linked Datasets section of the :doc:`/user/dataverse-management` guide for more information). Only accessible to superusers. ::
Creates a link between a dataset and a dataverse (see the Linked Dataverses + Linked Datasets section of the :doc:`/user/dataverse-management` guide for more information). ::

curl -H "X-Dataverse-key: $API_TOKEN" -X PUT http://$SERVER/api/datasets/$linked-dataset-id/link/$linking-dataverse-alias

Expand All @@ -51,3 +51,10 @@ Unlink a Dataset
Removes a link between a dataset and a dataverse. Only accessible to superusers. ::

curl -H "X-Dataverse-key: $API_TOKEN" -X DELETE http://$SERVER/api/datasets/$linked-dataset-id/deleteLink/$linking-dataverse-alias

Mint new PID for a Dataset
^^^^^^^^^^^^^^^^^^^^^^^^^^

Mints a new identifier for a dataset previously registered with a handle. Only accessible to superusers. ::

curl -H "X-Dataverse-key: $API_TOKEN" -X POST http://$SERVER/api/admin/$dataset-id/reregisterHDLToPID
7 changes: 7 additions & 0 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,13 @@ In the example below, the curator has saved the JSON file as :download:`reason-f

The review process can sometimes resemble a tennis match, with the authors submitting and resubmitting the dataset over and over until the curators are satisfied. Each time the curators send a "reason for return" via API, that reason is persisted into the database, stored at the dataset version level.

Link a Dataset
~~~~~~~~~~~~~~

Creates a link between a dataset and a dataverse (see the Linked Dataverses + Linked Datasets section of the :doc:`/user/dataverse-management` guide for more information). ::

curl -H "X-Dataverse-key: $API_TOKEN" -X PUT http://$SERVER/api/datasets/$linked-dataset-id/link/$linking-dataverse-alias

Dataset Locks
~~~~~~~~~~~~~

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 @@ -64,9 +64,9 @@
# built documents.
#
# The short X.Y version.
version = '4.9.2'
version = '4.9.3'
# The full version, including alpha/beta/rc tags.
release = '4.9.2'
release = '4.9.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
34 changes: 29 additions & 5 deletions doc/sphinx-guides/source/developers/coding-style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Formatting Code
Tabs vs. Spaces
^^^^^^^^^^^^^^^

Don't use tabs. Use spaces.
Don't use tabs. Use 4 spaces.

Braces Placement
^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -59,10 +59,20 @@ Format Code You Changed with Netbeans

As you probably gathered from the :doc:`dev-environment` section, IQSS has standardized on Netbeans. It is much appreciated when you format your code (but only the code you touched!) using the out-of-the-box Netbeans configuration. If you have created an entirely new Java class, you can just click Source -> Format. If you are adjusting code in an existing class, highlight the code you changed and then click Source -> Format. Keeping the "diff" in your pull requests small makes them easier to code review.

The Netbeans formatting syntax appears not to be documented anywhere, however from an initial approximation `astyle --mode=java --style=attach --add-braces ${source_file}` is reasonably close.
If `astyle` is not installed on your system, it is available from `<http://astyle.sourceforge.net>`_.
Checking Your Formatting With Checkstyle
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We would like to someday automate the detection and possibly correction of code that hasn't been formatted using our house style (the default Netbeans style). We've heard that https://maven.apache.org/plugins/maven-checkstyle-plugin/ can do this but we would be happy to see a pull request in this area, especially if it also hooks up to our builds at https://travis-ci.org/IQSS/dataverse .
The easiest way to adopt Dataverse coding style is to use Netbeans as your IDE, avoid change the default Netbeans formatting settings, and only reformat code you've changed, as described above.

If you do not use Netbeans, you are encouraged to check the formatting of your code using Checkstyle.

To check the entire project:

``mvn checkstyle:checkstyle``

To check a single file:

``mvn checkstyle:checkstyle -Dcheckstyle.includes=**\/SystemConfig*.java``

Logging
~~~~~~~
Expand Down Expand Up @@ -93,6 +103,20 @@ If you just downloaded Netbeans and are using the out-of-the-box settings, you s

If you know of a way to easily share Netbeans configuration across a team, please get in touch.

Bash
----

Generally, Google's Shell Style Guide at https://google.github.io/styleguide/shell.xml seems to have good advice.

Formatting Code
~~~~~~~~~~~~~~~

Tabs vs. Spaces
^^^^^^^^^^^^^^^

Don't use tabs. Use 2 spaces.

shfmt from https://github.com/mvdan/sh seems like a decent way to enforce indentation of two spaces (i.e. ``shfmt -i 2 -w path/to/script.sh``) but be aware that it makes other changes.

Bike Shedding
-------------
Expand All @@ -103,4 +127,4 @@ Come debate with us about coding style in this Google doc that has public commen

----

Previous: :doc:`debugging` | Next: :doc:`containers`
Previous: :doc:`debugging` | Next: :doc:`deployment`
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/developers/containers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,4 @@ Again, Dataverse Docker images on Docker Hub are highly experimental at this poi

----

Previous: :doc:`coding-style` | Next: :doc:`making-releases`
Previous: :doc:`deployment` | Next: :doc:`making-releases`
Loading

0 comments on commit 6eecbf1

Please sign in to comment.