Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.ServiceReport


        wfResultItem.setInputDigitalObjectRef(digo.getPermanentUri());
        wfResultItem.setServiceParameters(parameterList);
        wfResultItem.setServiceEndpoint(identify.describe().getEndpoint());
       
        //have a look at the service's results
        ServiceReport report = results.getReport();
        List<URI> types = results.getTypes();

        //report service status and type
        wfResultItem.setServiceReport(report);

        if (report.getType() == Type.ERROR) {
            String s = "Service execution failed: " + report.getMessage();
            wfResultItem.addLogInfo(s);
            throw new Exception(s);
        }

        if (types.size() < 1) {
View Full Code Here


    //call the identification service
    IdentifyResult identifyResults = identifyService.identify(digo,parameterList);
   
    // document
    wfResultItem.setEndTime(System.currentTimeMillis());
    ServiceReport report = identifyResults.getReport();
    // report service status and type
    wfResultItem.setServiceReport(report);
    if (report.getType() == Type.ERROR) {
      String s = "Service execution failed: " + report.getMessage();
      wfResultItem.addLogInfo(s);
      throw new Exception(s);
    }
   
    //document the comparison's output
View Full Code Here

      CompareResult result = comparexcdl1.compare(digo1, digo2,
          configProperties);
       
      //document
      wfResultItem.setEndTime(System.currentTimeMillis());
      ServiceReport report = result.getReport();
      //report service status and type
      wfResultItem.setServiceReport(report);
      if (report.getType() == Type.ERROR) {
        String s = "Service execution failed: " + report.getMessage();
        wfResultItem.addLogInfo(s);
        throw new Exception(s);
      }
      //document: add report on outputDigitalObject
      wfResultItem.addExtractedInformation(result.getProperties().toString());
View Full Code Here

   
    ValidateResult vr = null;
   
    if(result.documentIsValid()) {
      vr = new ValidateResult.Builder(format,
                  new ServiceReport(Type.INFO, Status.SUCCESS, result.getValidationResultAsString()))
                  .ofThisFormat(result.isOdfFile())
                  .validInRegardToThisFormat(result.documentIsValid()).build();
    }
    else {
      vr = new ValidateResult.Builder(format, new ServiceReport(Type.INFO, Status.SUCCESS, result.getValidationResultAsString()))
      .ofThisFormat(result.isOdfFile())
      .validInRegardToThisFormat(result.documentIsValid()).build();
    }
    return vr;
  }
View Full Code Here

        wfResultItem.setInputDigitalObjectRef(digo.getPermanentUri());
        wfResultItem.setServiceParameters(parameterList);
        wfResultItem.setServiceEndpoint(identify.describe().getEndpoint());
       
        //have a look at the service's results
        ServiceReport report = results.getReport();
        List<URI> types = results.getTypes();

        //report service status and type
        wfResultItem.setServiceReport(report);

        if (report.getType() == Type.ERROR) {
            String s = "Service execution failed: " + report.getMessage();
            wfResultItem.addLogInfo(s);
            throw new Exception(s);
        }

        if (types.size() < 1) {
View Full Code Here

     */
    private String[] runIdentification(DigitalObject digo, WorkflowResultItem wfResultItem) throws Exception {
      wfResultItem.addLogInfo("STEP 1: Identification...");
        List<Parameter> parameterList = new ArrayList<Parameter>();
        IdentifyResult results = identify.identify(digo, parameterList);
        ServiceReport report = results.getReport();
        List<URI> types = results.getTypes();

        if (report.getType() == Type.ERROR) {
            String s = "Service execution failed: " + report.getMessage();
            wfResultItem.addLogInfo(s);
            throw new Exception(s);
        }

        if (types.size() < 1) {
View Full Code Here

          String title_ = digO.getTitle().substring(0,digO.getTitle().lastIndexOf('.'));
          if(migrateToURI.toString().toLowerCase().lastIndexOf("siard") > 0) title_ = title_ + ".siard";
          dgoOut = (new DigitalObject.Builder(dgoOut)).title(title_).build();
        }

        ServiceReport report = migrateResult.getReport();

        if (report.getType() == Type.ERROR) {
            String s = "Service execution failed: " + report.getMessage();
            log.debug(s);
            throw new Exception(s);
        }
        return dgoOut;
    }
View Full Code Here

            }
        }
       
        // FIXME Interface is a problem!  We really want to return simpler entities than full property descriptions.

        ServiceReport report = new ServiceReport(Type.INFO, Status.SUCCESS, "OK");
       
        return new CharacteriseResult(mprops, report);
    }
View Full Code Here

     *
     * @param message
     * @return
     */
    private IdentifyResult returnWithErrorMessage(String message) {
        ServiceReport rep = ServiceUtils.createErrorReport(message);
        List<URI> type = null;
        log.severe(message);
        return new IdentifyResult(type, null, rep);
    }
View Full Code Here

            FormatRegistry format = FormatRegistryFactory.getFormatRegistry();
            MigrateResult mr = dom.migrate(input, format.createExtensionUri("png"),
                    format.createExtensionUri("gif"), null);

            ServiceReport sr = mr.getReport();
            System.out.println("Got Report: " + sr);

            DigitalObject doOut = mr.getDigitalObject();

            assertTrue("Resulting digital object is null.", doOut != null);
View Full Code Here

TOP

Related Classes of eu.planets_project.services.datatypes.ServiceReport

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.