Examples of ServiceDocument


Examples of org.apache.olingo.odata2.api.servicedocument.ServiceDocument

  }

  @Test
  public void testServiceDocument3() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/serviceDocExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);
    for (Workspace workspace : atomInfo.getWorkspaces()) {
      assertEquals("Data", workspace.getTitle().getText());
      assertEquals(9, workspace.getCollections().size());
      for (Collection collection : workspace.getCollections()) {
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument

      log.info(LogManager.getHeader(context, "sword_service_document_request", "username=" + request.getUsername() + ",on_behalf_of=" + request.getOnBehalfOf()));
     
      // prep the service request, then get the service document out of it
      SWORDService service = new SWORDService(sc);
      ServiceDocumentManager manager = new ServiceDocumentManager(service);
      ServiceDocument doc = manager.getServiceDocument(request.getLocation());
     
      return doc;
    }
    catch (DSpaceSWORDException e)
    {
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument

        service.addWorkspace(workspace);
      }
    }

    ServiceDocument sd = new ServiceDocument(service);
    return sd;
  }
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument

      // Throw the error exception
      throw new SWORDErrorException(ErrorCodes.MEDIATION_NOT_ALLOWED, "Mediated deposits not allowed");
    }
   
    // Create and return a dummy ServiceDocument
    ServiceDocument document = new ServiceDocument();
    Service service = new Service("1.3", true, true);
    document.setService(service);
        log.debug("sdr.getLocation() is: " + sdr.getLocation());
    String location = sdr.getLocation().substring(0, sdr.getLocation().length() - 16);
    log.debug("location is: " + location);
       
      if (sdr.getLocation().contains("?nested=")) {
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument

    // Set the deposit location
    sdr.setLocation(getUrl(request));

    // Get the ServiceDocument
    try {
      ServiceDocument sd = myRepository.doServiceDocument(sdr);
      if ((sd.getService().getMaxUploadSize() == -1) && (maxUploadSize != -1)) {
        sd.getService().setMaxUploadSize(maxUploadSize);
      }
   
      // Print out the Service Document
      response.setContentType("application/atomsvc+xml; charset=UTF-8");
      PrintWriter out = response.getWriter();
      out.write(sd.marshall());
      out.flush();
    } catch (SWORDAuthenticationException sae) {
      if (authN.equals("Basic")) {
        String s = "Basic realm=\"SWORD\"";
        response.setHeader("WWW-Authenticate", s);
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument


    public ServiceDocument getServiceDocument() throws HttpException, SWORDClientException
    {
        log.info("Getting Sword Service Document from " + serviceDocUrl);
        ServiceDocument sd = client.getServiceDocument(serviceDocUrl, onBehalfOf);

        Status status = client.getStatus();

        if (status.getCode() == 200)
        {
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument

        service.addWorkspace(workspace);
      }
    }

        return new ServiceDocument(service);
  }
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument

      // Throw the error exception
      throw new SWORDErrorException(ErrorCodes.MEDIATION_NOT_ALLOWED, "Mediated deposits not allowed");
    }
   
    // Create and return a dummy ServiceDocument
    ServiceDocument document = new ServiceDocument();
    Service service = new Service("1.3", true, true);
    document.setService(service);
        log.debug("sdr.getLocation() is: " + sdr.getLocation());
    String location = sdr.getLocation().substring(0, sdr.getLocation().length() - 16);
    log.debug("location is: " + location);
       
      if (sdr.getLocation().contains("?nested=")) {
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument

    // Set the deposit location
    sdr.setLocation(getUrl(request));

    // Get the ServiceDocument
    try {
      ServiceDocument sd = myRepository.doServiceDocument(sdr);
      if ((sd.getService().getMaxUploadSize() == -1) && (maxUploadSize != -1)) {
        sd.getService().setMaxUploadSize(maxUploadSize);
      }
   
      // Print out the Service Document
      response.setContentType("application/atomsvc+xml; charset=UTF-8");
      PrintWriter out = response.getWriter();
      out.write(sd.marshall());
      out.flush();
    } catch (SWORDAuthenticationException sae) {
      if (authN.equals("Basic")) {
        String s = "Basic realm=\"SWORD\"";
        response.setHeader("WWW-Authenticate", s);
View Full Code Here

Examples of org.purl.sword.base.ServiceDocument

      log.info(LogManager.getHeader(context, "sword_service_document_request", "username=" + request.getUsername() + ",on_behalf_of=" + request.getOnBehalfOf()));
     
      // prep the service request, then get the service document out of it
      SWORDService service = new SWORDService(sc);
      ServiceDocumentManager manager = new ServiceDocumentManager(service);
      ServiceDocument doc = manager.getServiceDocument(request.getLocation());
     
      return doc;
    }
    catch (DSpaceSWORDException e)
    {
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.