Search in sources :

Example 36 with Item

use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.

the class AffiliationsManagerImpl method createItem.

private Item createItem(OrgAffiliationRelationEntity orgAffiliationEntity) {
    Item item = new Item();
    item.setItemName(orgAffiliationEntity.getOrg().getName());
    item.setItemType(AffiliationType.EDUCATION.equals(orgAffiliationEntity.getAffiliationType()) ? ItemType.EDUCATION : ItemType.EMPLOYMENT);
    item.setPutCode(String.valueOf(orgAffiliationEntity.getId()));
    return item;
}
Also used : Item(org.orcid.jaxb.model.notification.permission_v2.Item)

Example 37 with Item

use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.

the class PeerReviewManagerImpl method createItemList.

private List<Item> createItemList(PeerReviewEntity peerReviewEntity) {
    Item item = new Item();
    item.setItemName(peerReviewEntity.getSubjectName());
    item.setItemType(ItemType.PEER_REVIEW);
    item.setPutCode(String.valueOf(peerReviewEntity.getId()));
    return Arrays.asList(item);
}
Also used : Item(org.orcid.jaxb.model.notification.permission_v2.Item)

Example 38 with Item

use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.

the class AffiliationsManagerImpl method createItemList.

private List<Item> createItemList(OrgAffiliationRelationEntity orgAffiliationEntity) {
    Item item = new Item();
    item.setItemName(orgAffiliationEntity.getOrg().getName());
    item.setItemType(AffiliationType.EDUCATION.value().equals(orgAffiliationEntity.getAffiliationType().value()) ? ItemType.EDUCATION : ItemType.EMPLOYMENT);
    item.setPutCode(String.valueOf(orgAffiliationEntity.getId()));
    return Arrays.asList(item);
}
Also used : Item(org.orcid.jaxb.model.notification.permission_v2.Item)

Example 39 with Item

use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.

the class ExternalIDValidatorTest method testEmptyRelationshipOnNotificationItemExternalIds_flagOn.

@Test(expected = ActivityIdentifierValidationException.class)
public void testEmptyRelationshipOnNotificationItemExternalIds_flagOn() {
    validator.setRequireRelationshipOnExternalIdentifier(true);
    Item i = new Item();
    Item i2 = new Item();
    Items items = new Items();
    ExternalID id1 = new ExternalID();
    id1.setRelationship(Relationship.SELF);
    id1.setType("doi");
    id1.setValue("value1");
    id1.setUrl(new Url("http://value1.com"));
    ExternalID id2 = new ExternalID();
    id2.setRelationship(null);
    id2.setType("source-work-id");
    id2.setValue("value2");
    id2.setUrl(new Url("http://value1.com"));
    i.setExternalIdentifier(id1);
    i2.setExternalIdentifier(id2);
    items.getItems().add(i);
    items.getItems().add(i2);
    // both valid
    validator.validateNotificationItems(items);
    fail("no exception thrown for invalid type");
}
Also used : Item(org.orcid.jaxb.model.notification.permission_v2.Item) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID) Items(org.orcid.jaxb.model.notification.permission_v2.Items) Url(org.orcid.jaxb.model.common_v2.Url) Test(org.junit.Test)

Example 40 with Item

use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.

the class ExternalIDValidatorTest method testEmptyRelationshipOnNotificationItemExternalIds_flagOff.

@Test
public void testEmptyRelationshipOnNotificationItemExternalIds_flagOff() {
    Item i = new Item();
    Item i2 = new Item();
    Items items = new Items();
    ExternalID id1 = new ExternalID();
    id1.setRelationship(Relationship.SELF);
    id1.setType("doi");
    id1.setValue("value1");
    id1.setUrl(new Url("http://value1.com"));
    ExternalID id2 = new ExternalID();
    id2.setRelationship(null);
    id2.setType("source-work-id");
    id2.setValue("value2");
    id2.setUrl(new Url("http://value1.com"));
    i.setExternalIdentifier(id1);
    i2.setExternalIdentifier(id2);
    items.getItems().add(i);
    items.getItems().add(i2);
    // both valid
    validator.validateNotificationItems(items);
}
Also used : Item(org.orcid.jaxb.model.notification.permission_v2.Item) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID) Items(org.orcid.jaxb.model.notification.permission_v2.Items) Url(org.orcid.jaxb.model.common_v2.Url) Test(org.junit.Test)

Aggregations

Item (org.orcid.jaxb.model.notification.permission_v2.Item)19 CraftItemStack (org.bukkit.craftbukkit.v1_16_R2.inventory.CraftItemStack)9 ItemStack (org.bukkit.inventory.ItemStack)9 Test (org.junit.Test)7 ExternalID (org.orcid.jaxb.model.record_v2.ExternalID)7 Field (java.lang.reflect.Field)6 Item (net.minecraft.server.v1_12_R1.Item)5 NBTTagCompound (net.minecraft.server.v1_16_R2.NBTTagCompound)5 Items (org.orcid.jaxb.model.notification.permission_v2.Items)5 CraftPlayer (org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer)4 ArrayList (java.util.ArrayList)3 Container (net.minecraft.server.v1_16_R2.Container)3 Font (java.awt.Font)2 Point (java.awt.Point)2 Nullable (javax.annotation.Nullable)2 Block (net.minecraft.server.v1_12_R1.Block)2 Item (net.minecraft.server.v1_13_R2.Item)2 Item (net.minecraft.server.v1_14_R1.Item)2 Item (net.minecraft.server.v1_15_R1.Item)2 ContainerAnvil (net.minecraft.server.v1_16_R2.ContainerAnvil)2