Skip to content

Commit

Permalink
AIS interview bulk import (#28)
Browse files Browse the repository at this point in the history
* chore(package): update build tools and expect Java 8

* feat: bulk import of AIS interviews
  • Loading branch information
CarstenWickner authored Mar 7, 2020
1 parent 7bd160a commit 1863658
Show file tree
Hide file tree
Showing 23 changed files with 788 additions and 242 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
language: java
jdk:
- openjdk7

- openjdk9
22 changes: 5 additions & 17 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
<property name="fileExtensions" value="java"/>
<property name="severity" value="warning" />
</module>
<module name="LineLength">
<property name="max" value="150" />
<property name="ignorePattern"
value="^package.*|^import.*|a href|href|http://|https://|ftp://" />
</module>
<module name="TreeWalker">
<module name="OuterTypeFilename" />
<module name="IllegalTokenText">
Expand All @@ -22,11 +27,6 @@
<property name="message"
value="Avoid using corresponding octal or Unicode escape." />
</module>
<module name="LineLength">
<property name="max" value="150" />
<property name="ignorePattern"
value="^package.*|^import.*|a href|href|http://|https://|ftp://" />
</module>
<module name="AvoidStarImport" />
<module name="OneTopLevelClass" />
<module name="NoLineWrap" />
Expand All @@ -36,15 +36,6 @@
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH" />
</module>
<module name="NeedBraces" />
<module name="LeftCurly">
<property name="maxLineLength" value="150" />
</module>
<module name="RightCurly" />
<module name="RightCurly">
<property name="option" value="alone" />
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT" />
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true" />
<property name="allowEmptyMethods" value="true" />
Expand Down Expand Up @@ -177,11 +168,8 @@
<module name="JavadocMethod">
<property name="scope" value="private" />
<property name="allowMissingParamTags" value="false" />
<property name="allowMissingThrowsTags" value="false" />
<property name="allowMissingReturnTag" value="false" />
<property name="minLineCount" value="1" />
<property name="allowedAnnotations" value="Override, Test" />
<property name="allowThrowsTagsForSubclasses" value="true" />
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$" />
Expand Down
15 changes: 8 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,20 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.8.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.15</version>
<version>3.1.1</version>
<executions>
<execution>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<logViolationsToConsole>true</logViolationsToConsole>
Expand All @@ -65,15 +66,15 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<version>2.6</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<version>3.2.0</version>
<inherited>true</inherited>
<configuration>
<archive>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2016 HermeneutiX.org
Copyright (C) 2016-2020 HermeneutiX.org
This file is part of SciToS.
Expand All @@ -19,10 +19,10 @@

package org.hmx.scitos.ais.core;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;

import org.hmx.scitos.ais.domain.IDetailCategoryProvider;
import org.hmx.scitos.ais.domain.model.AisProject;
import org.hmx.scitos.ais.domain.model.DetailCategory;
Expand All @@ -45,6 +45,15 @@ public interface AisModelHandler extends IModelHandler<AisProject> {
*/
Interview createInterview(String participantId);

/**
* Create an interview for the participant with the given id and initial text. Ensure the interview index stays unique for the participant id.
*
* @param interviews
* interviews to create
* @return created interview instance
*/
List<Interview> createInterviews(Collection<? extends InterviewToCreate> interviews);

/**
* Replace the current text tokens in the specified interview object with the tokens extracted from the given text.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
Copyright (C) 2020 HermeneutiX.org
This file is part of SciToS.
SciToS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SciToS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SciToS. If not, see <http://www.gnu.org/licenses/>.
*/

package org.hmx.scitos.ais.core;

/** Representation of an interview to be created. */
public interface InterviewToCreate {

/**
* Getter for the participant id to associate the new interview with.
*
* @return associated participant id
*/
String getParticipantId();

/**
* Getter for the interview text.
*
* @return interview text
*/
String getInterviewText();
}
Loading

0 comments on commit 1863658

Please sign in to comment.