Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.Parameter


        List<Parameter> links = new ArrayList<Parameter>();
        for (int i = 0; i < results.size(); i++) {
            URL url = results.get(i);
            String[] strings = url.getFile().split("/");
            //hack to change from file uri to relative path
            links.add(new Parameter("File " + (i + 1), String.format("<a href='%s'>%s</a>", /*url*/strings[strings.length - 1],
                    strings[strings.length - 1])));
        }
        Parameter[] array = links.toArray(new Parameter[] {});
        return new Message("Results", array);
    }
View Full Code Here


    /**
     * @param template The template
     * @return A overview message for the template
     */
    public static Message overview(WorkflowTemplate template) {
        return new Message("Overview", new Parameter("Description", template.describe()), new Parameter("Started",
                new Date(System.currentTimeMillis()).toString()));
    }
View Full Code Here

   * @see eu.planets_project.ifr.core.services.migration.jmagickconverter.impl.ImageMagickMigrationsLocalTest
   * @param sKey
   * @return
   */
  public Parameter getPropertyAsParameter(String sKey){
    return new Parameter(sKey,this.getProperty(sKey));
  }
View Full Code Here

                log.info("Processing file #" + (count + 1));
                try {
                 
                    // Identify
                    String[] types = runIdentification(dgo, wfResult);
                    log.info(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) {
                        log.warn("No metadata contained in DigitalObject!");
                    } else {
                        log.info("Extracted metadata: " + metadata);
                    }
                   
                    // Migrate
                    try {
                        FormatRegistry fr = FormatRegistryFactory.getFormatRegistry();
                        String ext = fr.getFirstExtension(new URI(types[0]));
                        log.info("Getting extension: " + ext);
                        if (ext != null) {
                            dgo = runMigrateService(dgo, fr.createExtensionUri(ext), wfResult);
                            dgo = new DigitalObject.Builder(dgo.getContent())
                                .title(tmpDo.getTitle().substring(0, tmpDo.getTitle().lastIndexOf(".")))
                                .build();
                            objects.add(dgo);
                            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

                metadata = null;
                log.info("Processing file #" + (count + 1));
                try {
                    // Identify
                    String[] types = runIdentification(dgo, wfResult);
                    log.info(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) {
                        log.warn("No metadata contained in DigitalObject!");
                    } else {
                        log.info("Extracted metadata: " + metadata);
                    }
                   
                    // Migrate
                    try {
                        FormatRegistry fr = FormatRegistryFactory.getFormatRegistry();
                        String ext = fr.getFirstExtension(new URI(types[0]));
                        log.info("Getting extension: " + ext);
                        if (ext != null) {
                            dgo = runMigrateService(dgo, fr.createExtensionUri(ext), wfResult);
                            objects.add(dgo);
                            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 migrateFromURI = new URI(migrateFrom);
      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);
      }
      wfResultItem.setServiceEndpoint(migrate.describe().getEndpoint());
View Full Code Here

    @Before
    public void logStuff() {

        /* A Message object will be in the report, but not in the log: */

        Parameter p1 = new Parameter("Input format", "PNG");
        Parameter p2 = new Parameter("Output format", "TIFF");
        Message message = new Message("A workflow message about migration", p1,
                p2);

        /* Such a message can be logged alone: */
        LOG.trace(message);
View Full Code Here

        inputFormatsPUID.add(formatRegistry.createPronomUri("fmt/100")); // HTML 4.01

        outputFormatsPUID.add(formatRegistry.createPronomUri("fmt/102")); // XHTML 1.0

        List<Parameter> parameterList = new ArrayList<Parameter>();
        Parameter configFile = new Parameter.Builder("configFile",
                "The content of a config file read into a String.").description(
                "Allows configurating JTidy by passing it a config file consisting of name=value pairs.\n"
                + "like 'show-warnings=yes'\n"
                + "\nFor further instructions on configurating JTidy please see the "
                + "JTidy (http://jtidy.sourceforge.net/)and "
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

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.