Skip to content

Commit

Permalink
Merge pull request #3431 from nickgros/PLFM-5064
Browse files Browse the repository at this point in the history
PLFM-5259 - remove old DOI code
  • Loading branch information
john-hill committed Nov 27, 2018
2 parents 7175266 + 611a5dd commit 9ab7260
Show file tree
Hide file tree
Showing 46 changed files with 31 additions and 3,753 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
import org.sagebionetworks.repo.model.discussion.UpdateThreadTitle;
import org.sagebionetworks.repo.model.docker.DockerCommit;
import org.sagebionetworks.repo.model.docker.DockerCommitSortBy;
import org.sagebionetworks.repo.model.doi.Doi;
import org.sagebionetworks.repo.model.doi.v2.Doi;
import org.sagebionetworks.repo.model.doi.v2.DoiAssociation;
import org.sagebionetworks.repo.model.doi.v2.DoiResponse;
import org.sagebionetworks.repo.model.entity.query.EntityQuery;
Expand Down Expand Up @@ -213,7 +213,6 @@
import org.sagebionetworks.repo.model.wiki.WikiPage;
import org.sagebionetworks.repo.web.NotFoundException;
import org.sagebionetworks.schema.adapter.JSONEntity;
import org.sagebionetworks.util.ValidateArgument;

/**
* Abstraction for Synapse.
Expand Down Expand Up @@ -1024,20 +1023,11 @@ public PaginatedResults<ProjectHeader> getProjectsFromUser(Long userId, ProjectL
public PaginatedResults<ProjectHeader> getProjectsForTeam(Long teamId, ProjectListSortColumn sortColumn, SortDirection sortDirection,
Integer limit, Integer offset) throws SynapseException;

public void createEntityDoi(String entityId) throws SynapseException;

public void createEntityDoi(String entityId, Long entityVersion)
throws SynapseException;

public Doi getEntityDoi(String entityId) throws SynapseException;

public Doi getEntityDoi(String s, Long entityVersion) throws SynapseException;

public DoiAssociation getDoiAssociation(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException;

public org.sagebionetworks.repo.model.doi.v2.Doi getDoi(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException;
public Doi getDoi(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException;

public String createOrUpdateDoiAsyncStart(org.sagebionetworks.repo.model.doi.v2.Doi doi) throws SynapseException;
public String createOrUpdateDoiAsyncStart(Doi doi) throws SynapseException;

public DoiResponse createOrUpdateDoiAsyncGet(String asyncJobToken) throws SynapseException, SynapseResultNotReadyException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
import org.sagebionetworks.repo.model.discussion.UpdateThreadTitle;
import org.sagebionetworks.repo.model.docker.DockerCommit;
import org.sagebionetworks.repo.model.docker.DockerCommitSortBy;
import org.sagebionetworks.repo.model.doi.Doi;
import org.sagebionetworks.repo.model.doi.v2.Doi;
import org.sagebionetworks.repo.model.doi.v2.DoiAssociation;
import org.sagebionetworks.repo.model.doi.v2.DoiRequest;
import org.sagebionetworks.repo.model.doi.v2.DoiResponse;
Expand Down Expand Up @@ -3427,62 +3427,6 @@ private PaginatedResults<ProjectHeader> getProjects(ProjectListType type, Long u
return getPaginatedResults(getRepoEndpoint(), url, ProjectHeader.class);
}

/**
* Creates a DOI for the specified entity. The DOI will always be associated
* with the current version of the entity.
*/
@Deprecated
@Override
public void createEntityDoi(String entityId) throws SynapseException {
createEntityDoi(entityId, null);
}

/**
* Creates a DOI for the specified entity version. If version is null, the
* DOI will always be associated with the current version of the entity.
*/
@Deprecated
@Override
public void createEntityDoi(String entityId, Long entityVersion)
throws SynapseException {

ValidateArgument.required(entityId, "entityId");
String url = ENTITY + "/" + entityId;
if (entityVersion != null) {
url = url + REPO_SUFFIX_VERSION + "/" + entityVersion;
}
url = url + DOI;
voidPut(getRepoEndpoint(), url, null);
}

/**
* Gets the DOI for the specified entity version. The DOI is for the current
* version of the entity.
*/
@Deprecated
@Override
public Doi getEntityDoi(String entityId) throws SynapseException {
return getEntityDoi(entityId, null);
}

/**
* Gets the DOI for the specified entity version. If version is null, the
* DOI is for the current version of the entity.
*/
@Deprecated
@Override
public Doi getEntityDoi(String entityId, Long entityVersion)
throws SynapseException {

ValidateArgument.required(entityId, "entityId");
String url = ENTITY + "/" + entityId;
if (entityVersion != null) {
url = url + REPO_SUFFIX_VERSION + "/" + entityVersion;
}
url = url + DOI;
return getJSONEntity(getRepoEndpoint(), url, Doi.class);
}

/**
* Gets the DOI Association for the specified object. If object version is null, the call will return the DOI
* for the current version of the object.
Expand All @@ -3503,21 +3447,22 @@ public DoiAssociation getDoiAssociation(String objectId, ObjectType objectType,
* for the current version of the object.
*/
@Override
public org.sagebionetworks.repo.model.doi.v2.Doi getDoi(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException {
public Doi getDoi(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException {
ValidateArgument.required(objectId, "objectId");
ValidateArgument.required(objectType, "objectType");
String url = DOI_ASSOCIATION + "?id=" + objectId + "&type=" + objectType;
if (objectVersion != null) {
url += "&version=" + objectVersion;
} return getJSONEntity(getRepoEndpoint(), url, org.sagebionetworks.repo.model.doi.v2.Doi.class);
}
return getJSONEntity(getRepoEndpoint(), url, Doi.class);
}


/**
* Creates a DOI for the specified object. Idempotent.
*/
@Override
public String createOrUpdateDoiAsyncStart(org.sagebionetworks.repo.model.doi.v2.Doi doi) throws SynapseException {
public String createOrUpdateDoiAsyncStart(Doi doi) throws SynapseException {
DoiRequest request = new DoiRequest();
request.setDoi(doi);
return startAsynchJob(AsynchJobType.Doi, request);
Expand Down

This file was deleted.

0 comments on commit 9ab7260

Please sign in to comment.