diff --git a/pass-core-main/src/main/resources/db/changelog/changelog.yaml b/pass-core-main/src/main/resources/db/changelog/changelog.yaml index f10d4eb1..1cd2782a 100644 --- a/pass-core-main/src/main/resources/db/changelog/changelog.yaml +++ b/pass-core-main/src/main/resources/db/changelog/changelog.yaml @@ -73,3 +73,12 @@ databaseChangeLog: path: /db/changelog/schema/index-localkey.sql splitStatements: true stripComments: true + - changeSet: + id: 8 + author: mark-patton + changes: + - sqlFile: + encoding: utf-8 + path: /db/changelog/schema/remove-contrib-pub.sql + splitStatements: true + stripComments: true \ No newline at end of file diff --git a/pass-core-main/src/main/resources/db/changelog/schema/remove-contrib-pub.sql b/pass-core-main/src/main/resources/db/changelog/schema/remove-contrib-pub.sql new file mode 100644 index 00000000..9011e0ab --- /dev/null +++ b/pass-core-main/src/main/resources/db/changelog/schema/remove-contrib-pub.sql @@ -0,0 +1,8 @@ +-- Remove Contributor +DROP TABLE public.pass_contributor; + +-- Remove Journal.publication +ALTER TABLE public.pass_journal DROP COLUMN publisher_id; + +-- Remove Publisher +DROP TABLE public.pass_publisher; \ No newline at end of file diff --git a/pass-core-object-service/src/main/java/org/eclipse/pass/object/converter/ContributorRoleListToStringConverter.java b/pass-core-object-service/src/main/java/org/eclipse/pass/object/converter/ContributorRoleListToStringConverter.java deleted file mode 100644 index d24b7909..00000000 --- a/pass-core-object-service/src/main/java/org/eclipse/pass/object/converter/ContributorRoleListToStringConverter.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.object.converter; - -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import javax.persistence.AttributeConverter; - -import org.eclipse.pass.object.model.ContributorRole; - -/** - * String converter for ContributorRole - * - * @see ContributorRole - */ -public class ContributorRoleListToStringConverter implements AttributeConverter, String> { - @Override - public String convertToDatabaseColumn(List attribute) { - return attribute == null ? null - : String.join(",", attribute.stream().map(ContributorRole::getValue).collect(Collectors.toList())); - } - - @Override - public List convertToEntityAttribute(String dbData) { - return dbData == null ? Collections.emptyList() : - Stream.of(dbData.split(",")).map(ContributorRole::of).collect(Collectors.toList()); - } -} \ No newline at end of file diff --git a/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Contributor.java b/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Contributor.java deleted file mode 100644 index e47d9c73..00000000 --- a/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Contributor.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright 2018 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.object.model; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import javax.persistence.Convert; -import javax.persistence.Entity; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -import com.yahoo.elide.annotation.Include; -import org.eclipse.pass.object.converter.ContributorRoleListToStringConverter; -import org.eclipse.pass.object.converter.SetToStringConverter; - -/** - * A Contributor is a person who contributed to a Publication. The contributor - * model captures the person information as well as the roles they played in - * creating the publication (e.g. author). - * - * @author Karen Hanson - */ - -@Include -@Entity -@Table(name = "pass_contributor") -public class Contributor extends PassEntity { - /** - * First name(s) of person - */ - private String firstName; - - /** - * Middle name(s) of person - */ - private String middleName; - - /** - * Last name(s) of person - */ - private String lastName; - - /** - * Name for display. Separate names may not be available, but a person should - * always at least have a display name. - */ - private String displayName; - - /** - * Contact email for person - */ - private String email; - - /** - * ORCID ID for person - */ - private String orcidId; - - /** - * Affiliation string for person. Where Person is embedded in Submission or - * Grant, this is the affiliation relevant to that item - */ - @Convert(converter = SetToStringConverter.class) - private Set affiliation = new HashSet<>(); - - /** - * One or more roles that this Contributor performed for the associated - * Publication - */ - @Convert(converter = ContributorRoleListToStringConverter.class) - private List roles = new ArrayList(); - - /** - * The publication that this contributor is associated with - */ - @ManyToOne - private Publication publication; - - /** - * The user that represents the same person as this Contributor, where - * relevant - */ - @ManyToOne - private User user; - - /** - * Contributor constructor - */ - public Contributor() { - } - - /** - * Copy constructor, this will copy the values of the object provided into the new object - * - * @param contributor the contributor to copy - */ - public Contributor(Contributor contributor) { - super(contributor); - this.firstName = contributor.firstName; - this.middleName = contributor.middleName; - this.lastName = contributor.lastName; - this.displayName = contributor.displayName; - this.email = contributor.email; - this.orcidId = contributor.orcidId; - this.affiliation = contributor.affiliation; - this.roles = new ArrayList(contributor.roles); - this.publication = contributor.publication; - this.user = contributor.user; - } - - /** - * @return the firstName - */ - public String getFirstName() { - return firstName; - } - - /** - * @param firstName the firstName to set - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * @return the middleName - */ - public String getMiddleName() { - return middleName; - } - - /** - * @param middleName the middleName to set - */ - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - - /** - * @return the lastName - */ - public String getLastName() { - return lastName; - } - - /** - * @param lastName the lastName to set - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * @return the displayName - */ - public String getDisplayName() { - return displayName; - } - - /** - * @param displayName the displayName to set - */ - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - /** - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * @param email the email to set - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * @return the affiliation - */ - public Set getAffiliation() { - return affiliation; - } - - /** - * @param affiliation the affiliation to set - */ - public void setAffiliation(Set affiliation) { - this.affiliation = affiliation; - } - - /** - * @return the orcidId - */ - public String getOrcidId() { - return orcidId; - } - - /** - * @param orcidId the orcidId to set - */ - public void setOrcidId(String orcidId) { - this.orcidId = orcidId; - } - - /** - * @return the list of roles - */ - public List getRoles() { - return roles; - } - - /** - * @param roles the roles list to set - */ - public void setRoles(List roles) { - this.roles = roles; - } - - /** - * @return the publication - */ - public Publication getPublication() { - return publication; - } - - /** - * @param publication the publication to set - */ - public void setPublication(Publication publication) { - this.publication = publication; - } - - /** - * @return the user - */ - public User getUser() { - return user; - } - - /** - * @param user the user to set - */ - public void setUser(User user) { - this.user = user; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - Contributor other = (Contributor) obj; - return Objects.equals(affiliation, other.affiliation) && Objects.equals(displayName, other.displayName) - && Objects.equals(email, other.email) && Objects.equals(firstName, other.firstName) - && Objects.equals(lastName, other.lastName) && Objects.equals(middleName, other.middleName) - && Objects.equals(orcidId, other.orcidId) && Objects.equals(publication, other.publication) - && Objects.equals(roles, other.roles) && Objects.equals(user, other.user); - } - - @Override - public int hashCode() { - return Objects.hash(getId(), email); - } - - @Override - public String toString() { - return "Contributor [firstName=" + firstName + ", middleName=" + middleName + ", lastName=" + lastName - + ", displayName=" + displayName + ", email=" + email + ", orcidId=" + orcidId + ", affiliation=" - + affiliation + ", roles=" + roles + ", publication=" + publication + ", user=" + user + ", id=" - + getId() + "]"; - } -} diff --git a/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/ContributorRole.java b/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/ContributorRole.java deleted file mode 100644 index 17e94cfa..00000000 --- a/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/ContributorRole.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2018 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.object.model; - -import java.util.HashMap; -import java.util.Map; - -/** - * list of possible contributor Roles - */ -public enum ContributorRole { - - /** - * Author role - */ - AUTHOR("author"), - - /** - * First author role - */ - FIRST_AUTHOR("first-author"), - - /** - * Last author role - */ - LAST_AUTHOR("last-author"), - - /** - * Corresponding author role - */ - CORRESPONDING_AUTHOR("corresponding-author"); - - private static final Map map = new HashMap<>(values().length, 1); - - static { - for (ContributorRole r : values()) { - map.put(r.value, r); - } - } - - private final String value; - - ContributorRole(String value) { - this.value = value; - } - - /** - * Parse the role. - * - * @param role Serialized role string - * @return The parsed value. - */ - public static ContributorRole of(String role) { - ContributorRole result = map.get(role); - if (result == null) { - throw new IllegalArgumentException("Invalid Role: " + role); - } - return result; - } - - /** - * @return Contributor role value - */ - public String getValue() { - return value; - } -} \ No newline at end of file diff --git a/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Journal.java b/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Journal.java index 45396154..74b722f1 100644 --- a/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Journal.java +++ b/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Journal.java @@ -23,7 +23,6 @@ import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; -import javax.persistence.ManyToOne; import javax.persistence.Table; import com.yahoo.elide.annotation.Include; @@ -50,12 +49,6 @@ public class Journal extends PassEntity { @CollectionTable(name = "pass_journal_issns") private List issns = new ArrayList<>(); - /** - * The publisher - */ - @ManyToOne - private Publisher publisher; - /** * National Library of Medicine Title Abbreviation */ @@ -83,7 +76,6 @@ public Journal(Journal journal) { super(journal); this.journalName = journal.journalName; this.issns = new ArrayList(journal.issns); - this.publisher = journal.publisher; this.nlmta = journal.nlmta; this.pmcParticipation = journal.pmcParticipation; } @@ -116,20 +108,6 @@ public void setIssns(List issn) { this.issns = issn; } - /** - * @return the publisher ID - */ - public Publisher getPublisher() { - return publisher; - } - - /** - * @param publisher the publisher to set - */ - public void setPublisher(Publisher publisher) { - this.publisher = publisher; - } - /** * @return the nlmta */ @@ -171,8 +149,7 @@ public boolean equals(Object obj) { } Journal other = (Journal) obj; return listEquals(issns, other.issns) && Objects.equals(journalName, other.journalName) - && Objects.equals(nlmta, other.nlmta) && pmcParticipation == other.pmcParticipation - && Objects.equals(publisher, other.publisher); + && Objects.equals(nlmta, other.nlmta) && pmcParticipation == other.pmcParticipation; } @Override @@ -182,7 +159,7 @@ public int hashCode() { @Override public String toString() { - return "Journal [journalName=" + journalName + ", issns=" + issns + ", publisher=" + publisher + ", nlmta=" + return "Journal [journalName=" + journalName + ", issns=" + issns + ", nlmta=" + nlmta + ", pmcParticipation=" + pmcParticipation + ", id=" + getId() + "]"; } } diff --git a/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Publisher.java b/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Publisher.java deleted file mode 100644 index 3b7b35a4..00000000 --- a/pass-core-object-service/src/main/java/org/eclipse/pass/object/model/Publisher.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2018 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.eclipse.pass.object.model; - -import java.util.Objects; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.Table; - -import com.yahoo.elide.annotation.Include; - -/** - * Describes a Publisher and its related Journals, also the path of it's participation in PubMedCentral - * - * @author Karen Hanson - */ -@Include -@Entity -@Table(name = "pass_publisher") -public class Publisher extends PassEntity { - - /** - * Name of publisher - */ - private String name; - - /** - * This field indicates whether a journal participates in the NIH Public Access Program by sending final - * published article to PMC. If so, whether it requires additional processing fee. - */ - - @Enumerated(EnumType.STRING) - private PmcParticipation pmcParticipation; - - /** - * Publisher constructor - */ - public Publisher() { - } - - /** - * Copy constructor, this will copy the values of the object provided into the new object - * - * @param publisher the publisher to copy - */ - public Publisher(Publisher publisher) { - super(publisher); - this.name = publisher.name; - this.pmcParticipation = publisher.pmcParticipation; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the pmcParticipation - */ - public PmcParticipation getPmcParticipation() { - return pmcParticipation; - } - - /** - * @param pmcParticipation the pmcParticipation to set - */ - public void setPmcParticipation(PmcParticipation pmcParticipation) { - this.pmcParticipation = pmcParticipation; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - Publisher other = (Publisher) obj; - return Objects.equals(name, other.name) && pmcParticipation == other.pmcParticipation; - } - - @Override - public int hashCode() { - return Objects.hash(getId(), name); - } - - @Override - public String toString() { - return "Publisher [name=" + name + ", pmcParticipation=" + pmcParticipation + ", id=" + getId() + "]"; - } -} diff --git a/pass-core-object-service/src/main/java/org/eclipse/pass/object/serde/ContributorRoleSerde.java b/pass-core-object-service/src/main/java/org/eclipse/pass/object/serde/ContributorRoleSerde.java deleted file mode 100644 index 569eb06e..00000000 --- a/pass-core-object-service/src/main/java/org/eclipse/pass/object/serde/ContributorRoleSerde.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.object.serde; - -import com.yahoo.elide.core.utils.coerce.converters.ElideTypeConverter; -import com.yahoo.elide.core.utils.coerce.converters.Serde; -import org.eclipse.pass.object.model.ContributorRole; - -/** - * Serializer/Deserializer class for ContributorRole - * - * @see ContributorRole - */ -@ElideTypeConverter(type = ContributorRole.class, name = "ContributorRole") -public class ContributorRoleSerde implements Serde { - - @Override - public ContributorRole deserialize(String val) { - return ContributorRole.of(val); - } - - @Override - public String serialize(ContributorRole val) { - return val.getValue(); - } -} \ No newline at end of file diff --git a/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/ContributorModelTests.java b/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/ContributorModelTests.java deleted file mode 100644 index fa2083e9..00000000 --- a/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/ContributorModelTests.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2018 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.object.model; - -import static org.eclipse.pass.object.model.support.TestObjectCreator.createContributor; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; - -import org.eclipse.pass.object.model.support.TestValues; -import org.junit.jupiter.api.Test; - -/** - * These tests do a simple check to ensure the equals / hashcode functions work. - * - * @author Karen Hanson - * @author Jim Martino - */ -public class ContributorModelTests { - @Test - public void testContributorEqualsAndHashCode() { - Contributor contributor1 = createContributor(TestValues.CONTRIBUTOR_ID_1, TestValues.USER_ID_1); - Contributor contributor2 = createContributor(TestValues.CONTRIBUTOR_ID_1, TestValues.USER_ID_1); - - assertEquals(contributor1, contributor2); - assertEquals(contributor1.hashCode(), contributor2.hashCode()); - - contributor1.setFirstName("different"); - assertNotEquals(contributor1, contributor2); - } - - /** - * Test copy constructor creates a valid duplicate that is not the same object - */ - @Test - public void testContributorCopyConstructor() { - Contributor contributor = createContributor(TestValues.CONTRIBUTOR_ID_1, TestValues.USER_ID_1); - Contributor contributorCopy = new Contributor(contributor); - assertEquals(contributor, contributorCopy); - - String newEmail = "differentemail@differentemail.com"; - contributorCopy.setEmail(newEmail); - assertEquals(TestValues.USER_EMAIL, contributor.getEmail()); - assertEquals(newEmail, contributorCopy.getEmail()); - - contributorCopy.setUser(createUser()); - assertEquals(TestValues.USER_ID_1, contributor.getUser().getId()); - assertEquals(TestValues.USER_ID_2, contributorCopy.getUser().getId()); - } - - private User createUser() { - User user = new User(); - user.setId(TestValues.USER_ID_2); - user.setFirstName(TestValues.USER_FIRST_NAME); - user.setMiddleName(TestValues.USER_MIDDLE_NAME); - user.setLastName(TestValues.USER_LAST_NAME); - user.setDisplayName(TestValues.USER_DISPLAY_NAME); - user.setEmail(TestValues.USER_EMAIL); - user.setOrcidId(TestValues.USER_ORCID_ID); - user.setAffiliation(TestValues.USER_AFFILIATION); - - return user; - } -} diff --git a/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/PublisherModelTests.java b/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/PublisherModelTests.java deleted file mode 100644 index d5eac1c4..00000000 --- a/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/PublisherModelTests.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2018 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.object.model; - -import static org.eclipse.pass.object.model.support.TestObjectCreator.createPublisher; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; - -import org.eclipse.pass.object.model.support.TestValues; -import org.junit.jupiter.api.Test; - -/** - * These tests do a simple check to ensure the equals / hashcode functions work. - * - * @author Karen Hanson - * @author Jim Martino - */ -public class PublisherModelTests { - @Test - public void testPublisherEqualsAndHashCode() { - Publisher publisher1 = createPublisher(TestValues.PUBLISHER_ID_1); - Publisher publisher2 = createPublisher(TestValues.PUBLISHER_ID_1); - - assertEquals(publisher1, publisher2); - assertEquals(publisher1.hashCode(), publisher2.hashCode()); - - publisher1.setName("different"); - assertNotEquals(publisher1, publisher2); - } - - /** - * Test copy constructor creates a valid duplicate that is not the same object - */ - @Test - public void testPublisherCopyConstructor() { - Publisher publisher = createPublisher(TestValues.PUBLISHER_ID_1); - Publisher publisherCopy = new Publisher(publisher); - assertEquals(publisher, publisherCopy); - - publisherCopy.setPmcParticipation(PmcParticipation.A); - assertEquals(PmcParticipation.valueOf(TestValues.PUBLISHER_PMCPARTICIPATION), publisher.getPmcParticipation()); - assertEquals(PmcParticipation.A, publisherCopy.getPmcParticipation()); - } -} diff --git a/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/support/TestObjectCreator.java b/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/support/TestObjectCreator.java index 15f83a82..def1aec1 100644 --- a/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/support/TestObjectCreator.java +++ b/pass-core-object-service/src/test/java/org/eclipse/pass/object/model/support/TestObjectCreator.java @@ -23,7 +23,6 @@ import org.eclipse.pass.object.model.AggregatedDepositStatus; import org.eclipse.pass.object.model.AwardStatus; -import org.eclipse.pass.object.model.Contributor; import org.eclipse.pass.object.model.CopyStatus; import org.eclipse.pass.object.model.Deposit; import org.eclipse.pass.object.model.DepositStatus; @@ -34,7 +33,6 @@ import org.eclipse.pass.object.model.PmcParticipation; import org.eclipse.pass.object.model.Policy; import org.eclipse.pass.object.model.Publication; -import org.eclipse.pass.object.model.Publisher; import org.eclipse.pass.object.model.Repository; import org.eclipse.pass.object.model.RepositoryCopy; import org.eclipse.pass.object.model.Source; @@ -55,29 +53,6 @@ public class TestObjectCreator { private TestObjectCreator() { } - /** - * Creates an instance of a Contributor - * - * @param contributorId the id for the object to be created - * @param userId parameter for the user on this object - * @return the Contributor @ - */ - public static Contributor createContributor(Long contributorId, Long userId) { - Contributor contributor = new Contributor(); - contributor.setId(contributorId); - contributor.setFirstName(TestValues.USER_FIRST_NAME); - contributor.setMiddleName(TestValues.USER_MIDDLE_NAME); - contributor.setLastName(TestValues.USER_LAST_NAME); - contributor.setDisplayName(TestValues.USER_DISPLAY_NAME); - contributor.setEmail(TestValues.USER_EMAIL); - contributor.setOrcidId(TestValues.USER_ORCID_ID); - contributor.setAffiliation(TestValues.USER_AFFILIATION); - contributor.setUser(createUser(userId)); - contributor.setPublication(createPublication(TestValues.PUBLICATION_ID_1)); - - return contributor; - } - /** * Creates an instance of a Deposit * @@ -157,7 +132,6 @@ public static Journal createJournal(Long journalId) { issns.add(TestValues.JOURNAL_ISSN_1); issns.add(TestValues.JOURNAL_ISSN_2); journal.setIssns(issns); - journal.setPublisher(createPublisher(TestValues.PUBLISHER_ID_1)); journal.setNlmta(TestValues.JOURNAL_NLMTA); journal.setPmcParticipation(PmcParticipation.valueOf(TestValues.JOURNAL_PMCPARTICIPATION)); return journal; @@ -205,21 +179,6 @@ public static Publication createPublication(Long publicationId) { return publication; } - /** - * Creates an instance of a Publisher - * - * @param publisherId the id for the object to be created - * @return the Publisher @ - */ - public static Publisher createPublisher(Long publisherId) { - Publisher publisher = new Publisher(); - publisher.setId(publisherId); - publisher.setName(TestValues.PUBLISHER_NAME); - publisher.setPmcParticipation(PmcParticipation.valueOf(TestValues.PUBLISHER_PMCPARTICIPATION)); - - return publisher; - } - /** * Creates an instance of a Repository *