Search in sources :

Example 31 with Item

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

the class WorkEntityFactory method create.

@Override
public NotificationWorkEntity create(Object source, MappingContext mappingContext) {
    mappingContext.getSourceObjects();
    NotificationWorkEntity nwe = new NotificationWorkEntity();
    String putCode = ((Item) source).getPutCode();
    if (putCode != null) {
        WorkEntity work = workDao.find(Long.valueOf(putCode));
        nwe.setWork(work);
    }
    return nwe;
}
Also used : NotificationWorkEntity(org.orcid.persistence.jpa.entities.NotificationWorkEntity) Item(org.orcid.jaxb.model.notification.permission_v2.Item) WorkEntity(org.orcid.persistence.jpa.entities.WorkEntity) NotificationWorkEntity(org.orcid.persistence.jpa.entities.NotificationWorkEntity)

Example 32 with Item

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

the class WorkManagerImpl method createItem.

private Item createItem(WorkEntity workEntity) {
    Item item = new Item();
    item.setItemName(workEntity.getTitle());
    item.setItemType(ItemType.WORK);
    item.setPutCode(String.valueOf(workEntity.getId()));
    return item;
}
Also used : Item(org.orcid.jaxb.model.notification.permission_v2.Item)

Example 33 with Item

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

the class NotificationManagerImpl method sendAmendEmail.

@Override
public void sendAmendEmail(String orcid, AmendedSection amendedSection, Item item) {
    OrcidProfile amendedProfile = orcidProfileManager.retrieveOrcidProfile(orcid, LoadOptions.BIO_AND_INTERNAL_ONLY);
    Collection<Item> items = new ArrayList<Item>(1);
    if (item != null) {
        items.add(item);
    }
    sendAmendEmail(amendedProfile, amendedSection, items);
}
Also used : OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) Item(org.orcid.jaxb.model.notification.permission_v2.Item) ArrayList(java.util.ArrayList)

Example 34 with Item

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

the class ExternalIDValidator method validateNotificationItems.

public void validateNotificationItems(Items items) {
    if (items == null)
        return;
    List<String> errors = Lists.newArrayList();
    for (Item i : items.getItems()) {
        if (i.getExternalIdentifier() != null && i.getExternalIdentifier().getType() != null) {
            ExternalID extId = i.getExternalIdentifier();
            if (extId.getType() == null || !identifierTypeManager.fetchIdentifierTypesByAPITypeName(null).containsKey(extId.getType())) {
                errors.add(i.getExternalIdentifier().getType());
            }
            if (PojoUtil.isEmpty(extId.getValue())) {
                errors.add("value");
            }
            if (requireRelationshipOnExternalIdentifier) {
                if (extId.getRelationship() == null) {
                    errors.add("relationship");
                }
            }
        }
    }
    checkAndThrow(errors);
}
Also used : Item(org.orcid.jaxb.model.notification.permission_v2.Item) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID)

Example 35 with Item

use of net.minecraft.server.v1_13_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)

Aggregations

Item (org.orcid.jaxb.model.notification.permission_v2.Item)19 CraftItemStack (org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack)11 ItemStack (org.bukkit.inventory.ItemStack)10 Field (java.lang.reflect.Field)7 ExternalID (org.orcid.jaxb.model.record_v2.ExternalID)7 NBTTagCompound (net.minecraft.server.v1_13_R2.NBTTagCompound)5 Test (org.junit.Test)5 Items (org.orcid.jaxb.model.notification.permission_v2.Items)5 CraftPlayer (org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer)4 ArrayList (java.util.ArrayList)3 Container (net.minecraft.server.v1_13_R2.Container)3 Entity (Entity)2 Item (Item)2 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)2 ChannelOutboundHandlerAdapter (io.netty.channel.ChannelOutboundHandlerAdapter)2 ChannelPromise (io.netty.channel.ChannelPromise)2 Font (java.awt.Font)2 Point (java.awt.Point)2 Nullable (javax.annotation.Nullable)2 ContainerAnvil (net.minecraft.server.v1_13_R2.ContainerAnvil)2