Skip to content

Commit

Permalink
Change version to 0.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
etorres committed Jan 10, 2016
1 parent b6997fe commit 28dc495
Show file tree
Hide file tree
Showing 17 changed files with 232 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Leishmaniasis-Virtual-Lab - [v0.3.0](http://lvl.i3m.upv.es/doc/#installation)
# Leishmaniasis-Virtual-Lab - [v0.9.8](http://lvl.i3m.upv.es/apidoc/)

[http://lvl.i3m.upv.es](http://lvl.i3m.upv.es) - The Leishmaniasis Virtual Laboratory: an open, collaborative environment for research in leishmaniasis.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="lvl-storage-0.9.3.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/lvl-storage/lvl-storage">
<dependent-module archiveName="lvl-storage-0.9.8.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/lvl-storage/lvl-storage">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="lvl-core-0.9.3.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/lvl-core/lvl-core">
<dependent-module archiveName="lvl-core-0.9.8.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/lvl-core/lvl-core">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/lvl-auth/target/classes"/>
Expand Down
2 changes: 1 addition & 1 deletion lvl-project/lvl-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ that you distribute must include a readable copy of the "NOTICE" text file.
<parent>
<groupId>eu.eubrazilcc.lvl</groupId>
<artifactId>lvl-project</artifactId>
<version>0.9.3</version>
<version>0.9.8</version>
<relativePath>..</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lvl-project/lvl-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ that you distribute must include a readable copy of the "NOTICE" text file.
<parent>
<groupId>eu.eubrazilcc.lvl</groupId>
<artifactId>lvl-project</artifactId>
<version>0.9.3</version>
<version>0.9.8</version>
<relativePath>..</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lvl-project/lvl-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ that you distribute must include a readable copy of the "NOTICE" text file.
<parent>
<groupId>eu.eubrazilcc.lvl</groupId>
<artifactId>lvl-project</artifactId>
<version>0.9.3</version>
<version>0.9.8</version>
<relativePath>..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* could be incomplete or inaccurate.
* @author Erik Torres <ertorser@upv.es>
*/
public class PendingReference implements Linkable<PendingReference> {
public class PendingReference extends SubmissionRequest implements Linkable<PendingReference> {

@InjectLinks({
@InjectLink(value="pending/citations/{urlSafeNamespace}/{urlSafeId}", rel=SELF, type=APPLICATION_JSON, bindings={
Expand Down Expand Up @@ -214,9 +214,11 @@ public static Builder builder() {
return new Builder();
}

public static class Builder {
public static class Builder extends SubmissionRequest.Builder<PendingReference> {

private final PendingReference instance = new PendingReference();
public Builder() {
super(PendingReference.class);
}

public Builder links(final List<Link> links) {
instance.setLinks(links);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* could be incomplete or inaccurate.
* @author Erik Torres <ertorser@upv.es>
*/
public class PendingSequence {
public class PendingSequence extends SubmissionRequest {

private String namespace; // Name space where the record is inscribed
private String id; // Resource identifier
Expand Down Expand Up @@ -121,16 +121,10 @@ public String toString() {

/* Fluent API */

public static class Builder<T extends PendingSequence> {

protected final T instance;
public static class Builder<T extends PendingSequence> extends SubmissionRequest.Builder<T> {

public Builder(final Class<T> clazz) {
T tmp = null;
try {
tmp = clazz.newInstance();
} catch (Exception ignore) { }
instance = tmp;
super(clazz);
}

public Builder<T> namespace(final String namespace) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
/*
* Copyright 2014-2015 EUBrazilCC (EU‐Brazil Cloud Connect)
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* This product combines work with different licenses. See the "NOTICE" text
* file for details on the various modules and licenses.
* The "NOTICE" text file is part of the distribution. Any derivative works
* that you distribute must include a readable copy of the "NOTICE" text file.
*/

package eu.eubrazilcc.lvl.core;

import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import static org.apache.commons.lang.StringUtils.isNotBlank;
import static org.apache.commons.lang3.StringUtils.trimToNull;

import java.util.Objects;

/**
* Any new data submitted to the system.
* @author Erik Torres <ertorser@upv.es>
*/
public class SubmissionRequest {

private String assignedTo;
private SubmissionResolution resolution;
private SubmissionStatus status;
private String allocatedCollection;
private String allocatedId;

public String getAssignedTo() {
return assignedTo;
}

public void setAssignedTo(final String assignedTo) {
this.assignedTo = assignedTo;
}

public SubmissionResolution getResolution() {
return resolution;
}

public void setResolution(final SubmissionResolution resolution) {
this.resolution = resolution;
}

public SubmissionStatus getStatus() {
return status;
}

public void setStatus(final SubmissionStatus status) {
this.status = status;
}

public String getAllocatedCollection() {
return allocatedCollection;
}

public void setAllocatedCollection(final String allocatedCollection) {
this.allocatedCollection = allocatedCollection;
}

public String getAllocatedId() {
return allocatedId;
}

public void setAllocatedId(final String allocatedId) {
this.allocatedId = allocatedId;
}

@Override
public boolean equals(final Object obj) {
if (obj == null || !(obj instanceof SubmissionRequest)) {
return false;
}
final SubmissionRequest other = SubmissionRequest.class.cast(obj);
return Objects.equals(assignedTo, other.assignedTo)
&& Objects.equals(resolution, other.resolution)
&& Objects.equals(status, other.status)
&& Objects.equals(allocatedCollection, other.allocatedCollection)
&& Objects.equals(allocatedId, other.allocatedId);
}

@Override
public int hashCode() {
return Objects.hash(assignedTo, resolution, status, allocatedCollection, allocatedId);
}

@Override
public String toString() {
return toStringHelper(this)
.add("assignedTo", assignedTo)
.add("resolution", resolution)
.add("status", status)
.add("allocatedCollection", allocatedCollection)
.add("allocatedId", allocatedId)
.toString();
}

/**
* Possible resolutions of a submission request.
* @author Erik Torres <ertorser@upv.es>
*/
public enum SubmissionResolution {
ACCEPTED,
INVALID,
DUPLICATE
}

/**
* Status of the submission request.
* @author Erik Torres <ertorser@upv.es>
*/
public enum SubmissionStatus {
NEW,
ASSIGNED,
ACCEPTED,
CLOSED,
REOPENED
}

/* Fluent API */

public static class Builder<T extends SubmissionRequest> {

protected final T instance;

public Builder(final Class<T> clazz) {
T tmp = null;
try {
tmp = clazz.newInstance();
} catch (Exception ignore) { }
instance = tmp;
}

public Builder<T> assignedTo(final String assignedTo) {
String assignedTo2 = null;
checkArgument(isNotBlank(assignedTo2 = trimToNull(assignedTo)), "Uninitialized or invalid owner");
instance.setAssignedTo(assignedTo2);
return this;
}

public Builder<T> resolution(final SubmissionResolution resolution) {
instance.setResolution(requireNonNull(resolution, "Uninitialized resolution"));
return this;
}

public Builder<T> status(final SubmissionStatus status) {
instance.setStatus(requireNonNull(status, "Uninitialized status"));
return this;
}

public Builder<T> allocatedCollection(final String allocatedCollection) {
String allocatedCollection2 = null;
checkArgument(isNotBlank(allocatedCollection2 = trimToNull(allocatedCollection)), "Uninitialized or invalid allocated collection");
instance.setAllocatedCollection(allocatedCollection2);
return this;
}

public Builder<T> allocatedId(final String allocatedId) {
String allocatedId2 = null;
checkArgument(isNotBlank(allocatedId2 = trimToNull(allocatedId)), "Uninitialized or invalid allocated Id");
instance.setAllocatedId(allocatedId2);
return this;
}

public T build() {
return instance;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@

import com.fasterxml.jackson.databind.ObjectMapper;

import eu.eubrazilcc.lvl.core.SubmissionRequest.SubmissionResolution;
import eu.eubrazilcc.lvl.core.SubmissionRequest.SubmissionStatus;
import eu.eubrazilcc.lvl.core.community.Post;
import eu.eubrazilcc.lvl.core.community.PostCategory;
import eu.eubrazilcc.lvl.core.community.PostLevel;
Expand Down Expand Up @@ -202,6 +204,11 @@ public void test() {
.preparationType("Mata")
.materialType("Parátipo")
.build())
.assignedTo("curator@lvl")
.resolution(SubmissionResolution.ACCEPTED)
.status(SubmissionStatus.CLOSED)
.allocatedCollection("sandfliesSamples")
.allocatedId("123")
.build();

final LeishmaniaPending cliocPending = LeishmaniaPending.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="lvl-storage-0.9.3.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/lvl-storage/lvl-storage">
<dependent-module archiveName="lvl-storage-0.9.8.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/lvl-storage/lvl-storage">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="lvl-core-0.9.3.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/lvl-core/lvl-core">
<dependent-module archiveName="lvl-core-0.9.8.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/lvl-core/lvl-core">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="context-root" value="lvl-service"/>
Expand Down
2 changes: 1 addition & 1 deletion lvl-project/lvl-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ that you distribute must include a readable copy of the "NOTICE" text file.
<parent>
<groupId>eu.eubrazilcc.lvl</groupId>
<artifactId>lvl-project</artifactId>
<version>0.9.3</version>
<version>0.9.8</version>
<relativePath>..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
import javax.ws.rs.core.Response;

import eu.eubrazilcc.lvl.core.SandflyPending;
import eu.eubrazilcc.lvl.core.SubmissionRequest.SubmissionResolution;
import eu.eubrazilcc.lvl.core.SubmissionRequest.SubmissionStatus;
import eu.eubrazilcc.lvl.core.xml.tdwg.dwc.SimpleDarwinRecord;
import eu.eubrazilcc.lvl.service.rest.SandflyPendingResource;
import eu.eubrazilcc.lvl.service.rest.SandflyPendingResource.SandflyPendings;
Expand All @@ -72,7 +74,7 @@
public class SandflyPendingResourceTest extends Testable {

public SandflyPendingResourceTest(final TestContext testCtxt) {
super(testCtxt, SandflyPendingResourceTest.class, true);
super(testCtxt, SandflyPendingResourceTest.class, false);
}

@Override
Expand Down Expand Up @@ -306,7 +308,7 @@ public void test() throws Exception {
.get(SandflyPendings.class);
assertThat("Search pending sequences result is not null", pendingSeqs, notNullValue());
assertThat("Search pending sequences list coincides with expected", pendingSeqs.getElements(), allOf(notNullValue(), not(empty()),
hasSize(pendingSeqs.getTotalCount()), hasSize(1))); // TODO
hasSize(pendingSeqs.getTotalCount()), hasSize(1)));
// uncomment for additional output
printMsg(" >> Search pending sequences result: " + toJson(pendingSeqs, JSON_PRETTY_PRINTER));

Expand Down Expand Up @@ -374,6 +376,11 @@ public void test() throws Exception {

// test update pending sequence
pendingSeq.getSample().setCollectionID("123");
pendingSeq.setAssignedTo("curator@lvl");
pendingSeq.setResolution(SubmissionResolution.ACCEPTED);
pendingSeq.setStatus(SubmissionStatus.CLOSED);
pendingSeq.setAllocatedCollection("sandfliesSamples");
pendingSeq.setAllocatedId("123");
response = testCtxt.target().path(path.value())
.path(urlEncodeUtf8(testCtxt.ownerid("user1")))
.path(pendingSeq.getId())
Expand Down
2 changes: 1 addition & 1 deletion lvl-project/lvl-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ that you distribute must include a readable copy of the "NOTICE" text file.
<parent>
<groupId>eu.eubrazilcc.lvl</groupId>
<artifactId>lvl-project</artifactId>
<version>0.9.3</version>
<version>0.9.8</version>
<relativePath>..</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 28dc495

Please sign in to comment.