Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.Parameter


                // Identify
              wfResultItem.addLogInfo("starting identify object: ");
                String[] types = runIdentification(dgo, wfResultItem);
              wfResultItem.addLogInfo("completed identify object format: " +
                  new Message("Identification", new Parameter("File", dgo.getTitle()), new Parameter(
                        "Result", Arrays.asList(types).toString())));

                // Extract metadata - will otherwise get lost between steps!
                List<Metadata> mList = dgo.getMetadata();

                if ((mList != null) && (mList.size() > 0)) {
                    metadata = mList.get(0).getContent();
                }

                if (metadata == null) {
                  wfResultItem.addLogInfo("No metadata contained in DigitalObject!");
                  wfResultItem.addLogInfo("Add title: " + dgo.getTitle());
                    title = dgo.getTitle();
          if(title.contains("."))
          {
            title = title.substring(0, title.lastIndexOf("."));
          }
              URI myMigrateToURI =
                    this.getServiceCallConfigs(this.migrate).getPropertyAsURI(SER_PARAM_MIGRATE_TO);
                    String newExtension =
                          FormatRegistryFactory.getFormatRegistry().getFirstExtension(myMigrateToURI);
                      title = title + "." + newExtension;
                } else {
                  wfResultItem.addLogInfo("Extracted metadata: " + metadata);
                }
               
                // Migrate
                try {
                    FormatRegistry fr = FormatRegistryFactory.getFormatRegistry();
                    String ext = fr.getFirstExtension(new URI(types[0]));
                    wfResultItem.addLogInfo("Getting extension: " + ext);
                    if (ext != null) {
                        URI uridgo = runMigration(migrate, dgo.getPermanentUri());
                        dgo = new DigitalObject.Builder(dgo.getContent())
                            .title(title)
                            .build();
                        objects.add(dgo);
                        wfResultItem.addLogInfo("Migration result uri: " + uridgo + ", result: " +
                            new Message("Migration", new Parameter("Input", ext), new Parameter("Result", dgo
                                .getTitle())));
                    }
                } catch (URISyntaxException e) {
                    throw new RuntimeException(e);
                }
View Full Code Here


                        log.info("Getting extension: " + ext);
                        if (ext != null) {
                            DigitalObject dgoOut = runMigrateService(dgo, fr.createExtensionUri(ext), wfResult);
                           
                            objects.add(dgoOut);
                            log.info(new Message("Migration", new Parameter("Input", ext), new Parameter("Result", dgo
                                    .getTitle())));
                        }
                    } catch (URISyntaxException e) {
                        throw new RuntimeException(e);
                    }
View Full Code Here

        URI migrateToURI = this.getServiceCallConfigs(this.migrate).getPropertyAsURI(SER_PARAM_MIGRATE_TO);
       
        // Create service parameter list
        List<Parameter> parameterList = new ArrayList<Parameter>();
        Parameter pCompressionType = this.getServiceCallConfigs(this.migrate).getPropertyAsParameter("compressionType");
        if (pCompressionType != null) {
            parameterList.add(pCompressionType);
        }

        Parameter pCompressionQuality = this.getServiceCallConfigs(this.migrate).getPropertyAsParameter(
                "compressionQuality");
        if (pCompressionQuality != null) {
            parameterList.add(pCompressionQuality);
        }
View Full Code Here

      //get default parameters for Service
      List<Parameter> pList = sdesc.getParameters();
      if (pList != null) {
        Iterator<Parameter> it = pList.iterator();
        while (it.hasNext()) {
          Parameter par = it.next();
          ServiceParameter spar = new ServiceParameter(par
              .getName(), par.getValue());
          //decide if the default params are added as standard params
          if(addDefaultParamsAsStandardParams){
            sb.addParameter(spar);
          }
          //add the default params to the bean
View Full Code Here

      List<Parameter> lParam = new ArrayList<Parameter>();
        String serID = sb.getServiceId();
       
        //3. iterate over all parameters that have been created/altered
        for(ServiceParameter param : sb.getServiceParameters()){
          Parameter parameter = new Parameter(param.getName(),param.getValue());
          lParam.add(parameter);
        }
        ret.put(serID, lParam);
      }
    return ret;
View Full Code Here

    Map<String,List<Parameter>> ret = new HashMap<String,List<Parameter>>();
   
    for(String serID: this.serviceParams.keySet()){
      List<Parameter> retParamList = new ArrayList<Parameter>();
      for(Param param : this.serviceParams.get(serID).getParam()){
        Parameter p = new Parameter.Builder(
              param.getName(), param.getValue()).build();
        retParamList.add(p);
      }
      ret.put(serID, retParamList);
    }
View Full Code Here

//    System.setProperty("pserv.test.port", "8080");
   
    File testFolder = new File("tests/test-files/documents/test_odt/odf_toolkit_test_files");
    testFiles = testFolder.listFiles();
   
    Parameter strictValidation = new Parameter.Builder("strict-validation", "true").build();
    params.add(strictValidation);
   
    Parameter v12_user_doc_schema = new Parameter.Builder("user-doc-schema", FileUtils.readFileToString(v12UserDocSchema)).build();
    Parameter v12_user_manifest_schema = new Parameter.Builder("user-manifest-schema", FileUtils.readFileToString(v12UserManifestSchema)).build();
    v12_params.add(v12_user_doc_schema);
    v12_params.add(v12_user_manifest_schema);
//   
    validator = ServiceCreator.createTestService(Validate.QNAME, OdfValidator.class, WSDL);
  }
View Full Code Here

            String mString = metrics.toString();
            if (mString.endsWith(",")) {
                mString = mString.substring(0, mString.length() - 1);
            }
            String propId = String.valueOf(objectProperty.getId());
            Parameter prop = new Parameter.Builder(propertyName, mString).type(propId).build();
            result.add(prop);
        }       
        return result;
    }   
View Full Code Here

        try {
            log.info("Characterising "+dob);
            //FIXME this is a hack for disabling norm data for XCDL characterisation services
            // as parameters are currently not definable for this expType
            List<Parameter> parameterList = new ArrayList<Parameter>();
            parameterList.add(new Parameter("disableNormDataInXCDL","-n"));
            result = dp.characterise(dob, parameterList);
            wr.logReport(result.getReport());
        } catch( Exception e ) {
            log.error("Characterisation failed with exception: "+e);
            e.printStackTrace();
View Full Code Here

      //get default parameters for Service
      List<Parameter> pList = serviceDescr.getParameters();
      if (pList != null) {
        Iterator<Parameter> it = pList.iterator();
        while (it.hasNext()) {
          Parameter par = it.next();
          ServiceParameter spar = reqParamInspector.new ServiceParameter(par
              .getName(), par.getValue(), par.getDescription());
         
          //add the default params to the bean
          this.addDefaultParameter(spar);
        }
      } else {
View Full Code Here

TOP

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

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.