Examples of DOIIdentifierException


Examples of org.dspace.identifier.doi.DOIIdentifierException

        if (matcher.find())
        {
            return SCHEME + matcher.group(1);
        }

        throw new DOIIdentifierException("Cannot recognize DOI!",
                DOIIdentifierException.UNRECOGNIZED);
    }
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

            return DOI.SCHEME + identifier;
        }
        if (identifier.startsWith(RESOLVER + "/10.")) {
            return DOI.SCHEME + identifier.substring(18);
        }
        throw new DOIIdentifierException(identifier + "does not seem to be a DOI.",
                DOIIdentifierException.UNRECOGNIZED);
    }
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

        }

        if (DELETED == doiRow.getIntColumn("status") ||
                TO_BE_DELETED == doiRow.getIntColumn("status"))
        {
            throw new DOIIdentifierException("You tried to register a DOI that "
                    + "is marked as DELETED.", DOIIdentifierException.DOI_IS_DELETED);
        }

        // Check status of DOI
        if (IS_REGISTERED == doiRow.getIntColumn("status"))
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

        TableRow doiRow = loadOrCreateDOI(context, dso, doi);
       
        if (DELETED == doiRow.getIntColumn("status") ||
                TO_BE_DELETED == doiRow.getIntColumn("status"))
        {
            throw new DOIIdentifierException("You tried to reserve a DOI that "
                    + "is marked as DELETED.", DOIIdentifierException.DOI_IS_DELETED);
        }
       
        connector.reserveDOI(context, dso, doi);
       
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

        TableRow doiRow = loadOrCreateDOI(context, dso, doi);
       
        if (DELETED == doiRow.getIntColumn("status") ||
                TO_BE_DELETED == doiRow.getIntColumn("status"))
        {
            throw new DOIIdentifierException("You tried to register a DOI that "
                    + "is marked as DELETED.", DOIIdentifierException.DOI_IS_DELETED);
        }
       
        // register DOI Online
        try {
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

        doiRow = loadOrCreateDOI(context, dso, doi);

        if (DELETED == doiRow.getIntColumn("status") ||
                TO_BE_DELETED == doiRow.getIntColumn("status"))
        {
            throw new DOIIdentifierException("You tried to register a DOI that "
                    + "is marked as DELETED.", DOIIdentifierException.DOI_IS_DELETED);
        }

        if (IS_REGISTERED == doiRow.getIntColumn("status"))
        {
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

        }
        if (null == doiRow)
        {
            log.error("Cannot update metadata for DOI {}: unable to find it in "
                    + "our db.", doi);
            throw new DOIIdentifierException("Unable to find DOI.",
                    DOIIdentifierException.DOI_DOES_NOT_EXIST);
        }
        if (doiRow.getIntColumn("resource_id") != dso.getID() ||
                doiRow.getIntColumn("resource_type_id") != dso.getType())
        {
            log.error("Refuse to update metadata of DOI {} with the metadata of "
                    + " an object ({}/{}) the DOI is not dedicated to.",
                    new String[] {doi, dso.getTypeText(), Integer.toString(dso.getID())});
            throw new DOIIdentifierException("Cannot update DOI metadata: "
                    + "DOI and DSpaceObject does not match!",
                    DOIIdentifierException.MISMATCH);
        }

        if (DELETED == doiRow.getIntColumn("status") ||
                TO_BE_DELETED == doiRow.getIntColumn("status"))
        {
            throw new DOIIdentifierException("You tried to update the metadata"
                    + "of a DOI that is marked as DELETED.",
                    DOIIdentifierException.DOI_IS_DELETED);
        }
       
        connector.updateMetadata(context, dso, doi);
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

        if (null != doiRow)
        {
            if (doiRow.getIntColumn("resource_id") != dso.getID() ||
                    doiRow.getIntColumn("resource_type_id") != dso.getType())
            {
                throw new DOIIdentifierException("Trying to delete a DOI out of "
                        + "an object that is not addressed by the DOI.",
                        DOIIdentifierException.MISMATCH);
            }
        }
       
        // remove DOI from metadata
        try
        {
            removeDOIFromObject(context, dso, doi);
        }
        catch (AuthorizeException ex)
        {
            log.error("Not authorized to delete a DOI out of an Item.", ex);
            throw new DOIIdentifierException("Not authorized to delete DOI.",
                    ex, DOIIdentifierException.UNAUTHORIZED_METADATA_MANIPULATION);
        }
        catch (SQLException ex)
        {
            log.error("SQLException occured while deleting a DOI out of an item: "
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

        {
            throw new RuntimeException(sqle);
        }
        if(null == doiRow)
        {
            throw new DOIIdentifierException("This identifier: " + identifier
                    + " isn't in our database",
                    DOIIdentifierException.DOI_DOES_NOT_EXIST);
        }
        if (TO_BE_DELETED != doiRow.getIntColumn("status"))
        {
View Full Code Here

Examples of org.dspace.identifier.doi.DOIIdentifierException

                {
                    return doiRow;
                }
                else
                {
                    throw new DOIIdentifierException("Trying to create a DOI " +
                            "that is already reserved for another object.",
                            DOIIdentifierException.DOI_ALREADY_EXISTS);
                }
            }

            // check prefix
            if (!doi.startsWith(this.getPrefix() + "/"))
            {
                throw new DOIIdentifierException("Trying to create a DOI " +
                        "that's not part of our Namespace!",
                        DOIIdentifierException.FOREIGN_DOI);
            }
            // prepare new doiRow
            doiRow = DatabaseManager.create(context, "Doi");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.