Examples of SwordError


Examples of org.swordapp.server.SwordError

            // first thing is to figure out what we're being asked to work on
            SwordUrlManager urlManager = config.getUrlManager(context, config);
            Item item = urlManager.getItem(context, stateIRI);
            if (item == null)
            {
                throw new SwordError(404);
            }

            // find out if we are allowed to read the item's statement
            AuthorizeManager.authorizeAction(context, item, Constants.READ);
View Full Code Here

Examples of org.swordapp.server.SwordError

      // get the deposit target
      Collection collection = this.getDepositTarget(context, collectionUri, config);
            if (collection == null)
            {
                throw new SwordError(404);
            }

      // Ensure that this method is allowed
      WorkflowManager wfm = WorkflowManagerFactory.getInstance();
      wfm.createResource(context, collection);
View Full Code Here

Examples of org.swordapp.server.SwordError

    // get the target collection
    Collection collection = urlManager.getCollection(context, depositUrl);
        if (collection == null)
        {
            throw new SwordError(404);
        }

    this.verboseDescription.append("Performing deposit using deposit URL: " + depositUrl);

        this.verboseDescription.append("Location resolves to collection with handle: " + collection.getHandle() +
View Full Code Here

Examples of org.swordapp.server.SwordError

                }
            }

            if (disseminator == null)
            {
                throw new SwordError(UriRegistry.ERROR_CONTENT, 406, "No plugin can disseminate the requested formats");
            }

            disseminator.setPackaging(acceptPackaging);
            return disseminator;
        }
View Full Code Here

Examples of org.swordapp.server.SwordError

      }
    }

    if (disseminator == null)
    {
      throw new SwordError(UriRegistry.ERROR_CONTENT, 406, "No plugin can disseminate the requested formats");
    }

    return disseminator;
  }
View Full Code Here

Examples of org.swordapp.server.SwordError

            throws DSpaceSwordException, SwordError
    {
        SwordEntryDisseminator disseminator = (SwordEntryDisseminator) PluginManager.getSinglePlugin("swordv2-server", SwordEntryDisseminator.class);
        if (disseminator == null)
        {
            throw new SwordError(DSpaceUriRegistry.REPOSITORY_ERROR, "No disseminator configured for handling sword entry documents");
        }
        return disseminator;
  }
View Full Code Here

Examples of org.swordapp.server.SwordError

      SwordUrlManager urlManager = config.getUrlManager(context, config);

      Collection collection = urlManager.getCollection(context, colIRI.toString());
            if (collection == null)
            {
                throw new SwordError(404);
            }

      List<Item> items = this.listItems(sc, collection, swordConfig);
      Feed feed = this.itemListToFeed(sc, items, swordConfig);
      return feed;
View Full Code Here

Examples of org.swordapp.server.SwordError

    {
      // we are dealing with a partial or sub-service document
      DSpaceObject dso = urlManager.extractDSpaceObject(url);
            if (dso == null)
            {
                throw new SwordError(404);
            }

      if (dso instanceof Community)
      {
        Community community = (Community) dso;
View Full Code Here

Examples of org.swordapp.server.SwordError

      // ingest the item from the temp file
      DSpaceObject ingestedObject = pi.replace(context, item, depositFile, params);
      if (ingestedObject == null)
      {
        verboseDescription.append("Failed to ingest the package; throwing exception");
                throw new SwordError(DSpaceUriRegistry.UNPACKAGE_FAIL, "METS package ingester failed to unpack package");
      }

            // Verify we have an Item as a result
            if (!(ingestedObject instanceof Item))
      {
View Full Code Here

Examples of org.swordapp.server.SwordError

      // ingest the item from the temp file
      DSpaceObject ingestedObject = pi.replace(context, item, depositFile, params);
      if (ingestedObject == null)
      {
        verboseDescription.append("Failed to replace the package; throwing exception");
                throw new SwordError(DSpaceUriRegistry.UNPACKAGE_FAIL, "METS package ingester failed to unpack package");
      }

            // Verify we have an Item as a result
            if (!(ingestedObject instanceof Item))
      {
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.