Package org.purl.sword.base

Examples of org.purl.sword.base.ServiceDocument


        FlowResult result = new FlowResult();
        result.setContinue(false);

        // Get all our request parameters
        String location = request.getParameter("location");
        ServiceDocument serviceDoc = (ServiceDocument) request.getAttribute("serviceDoc");

        log.info("Collection selected is " + location);
        log.info("Service Doc reference is " + serviceDoc);

        // Set the target collection.
View Full Code Here


        Division main = body.addDivision("main");
        main.setHead(T_main_head.parameterize(handle));

        Request request = ObjectModelHelper.getRequest(objectModel);
        ServiceDocument serviceDoc = (ServiceDocument) request.getAttribute("serviceDoc");

        java.util.List<Collection> collections = ServiceDocumentHelper.getCollections(serviceDoc);
        for (Collection collection : collections)
        {
            Division collectionDiv = main.addInteractiveDivision("collection", contextPath + "/swordclient", Division.METHOD_POST, "");
View Full Code Here

        {
            try
            {
                DSClient.setRemoteServer(chosenUrl);
                DSClient.setCredentials(username, password, onBehalfOf);
                ServiceDocument serviceDoc = DSClient.getServiceDocument();
                result.setParameter("serviceDoc", serviceDoc);
                result.setContinue(true);
                result.setOutcome(true);
            }
            catch (MalformedURLException e)
View Full Code Here

           if (result.getErrors() == null)
           {
               try
               {
                   DSClient.setRemoteServer(url);
                   ServiceDocument serviceDoc = DSClient.getServiceDocument();
                   result.setParameter("serviceDoc", serviceDoc);
                   result.setOutcome(true);
               }
               catch (MalformedURLException e)
               {
View Full Code Here

    public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
        String handle = parameters.getParameter("handle", null);

        Request request = ObjectModelHelper.getRequest(objectModel);

        ServiceDocument serviceDoc = (ServiceDocument) request.getAttribute("serviceDoc");
        String location = (String) request.getAttribute("location");
        String[] fileTypes = (String[]) request.getAttribute("fileTypes");
        String[] packageFormats = (String[]) request.getAttribute("packageFormats");

        Collection collection = ServiceDocumentHelper.getCollection(serviceDoc, location);
View Full Code Here

      log.debug("Setting userAgent: " + userAgent);
      httpget.addHeader(HttpHeaders.USER_AGENT, userAgent);
            properties.put(HttpHeaders.USER_AGENT, userAgent);
    }

    ServiceDocument doc = null;

    try {
      HttpResponse response = client.execute(httpget);
            StatusLine statusLine = response.getStatusLine();
            int statusCode = statusLine.getStatusCode();
      // store the status code
      status = new Status(statusCode, statusLine.getReasonPhrase());

      if (status.getCode() == HttpStatus.SC_OK) {
        String message = readResponse(response.getEntity().getContent());
        log.debug("returned message is: " + message);
        doc = new ServiceDocument();
        lastUnmarshallInfo = doc.unmarshall(message, properties);
      } else {
        throw new SWORDClientException(
            "Received error from service document request: "
                + status);
      }
View Full Code Here

    if (useProxy) {
      client.setProxy(pHost, pPort);
    }

    try {
      ServiceDocument sd = client.getServiceDocument(theUrl,
      request.getParameter("obo"));

      // Set the status
      Status status = client.getStatus();
      request.setAttribute("status", status.toString());
      if (status.getCode() == 200) {
        // Set the debug response
        String xml = sd.marshall();

                String validateXml = xml;
                validateXml = validateXml.replaceAll("&", "&amp;");
                validateXml = validateXml.replaceAll("<", "&lt;");
                validateXml = validateXml.replaceAll(">", "&gt;");
View Full Code Here

TOP

Related Classes of org.purl.sword.base.ServiceDocument

Copyright © 2018 www.massapicom. 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.