Examples of MigrationPath


Examples of eu.planets_project.pp.plato.services.crib_integration.remoteclient.MigrationPath

            // prepare the data of the sample record for migration
            FileObject sampleFile = new FileObject(sampleObject.getData().getData(), sampleObject.getFullname());
            RepresentationObject representationObject = new RepresentationObject(new FileObject[]{sampleFile});

            // the action parameters specify which migration service is called
            MigrationPath migrationPath = new MigrationPath();
            LinkedList<String> urls = new LinkedList<String>();
            for (Parameter param : action.getParams()) {
                urls.add(param.getValue());
            }
            String[] urlArr = urls.toArray(new String[]{});
            migrationPath.setAccessPoints(urlArr);
            /*
             * convert source object
             */
            eu.planets_project.pp.plato.services.crib_integration.remoteclient.MigrationResult migrationResult = metaconverterService.convert(representationObject, migrationPath);
            /*
 
View Full Code Here

Examples of eu.planets_project.pp.plato.services.crib_integration.remoteclient.MigrationPath

                 */
                PreservationActionDefinition action;
               
                MigrationPath[] paths = serviceRegistryService.getMigrationPaths(cribID, targetFormat);
                for (int j = 0; j < paths.length; j++) {
                    MigrationPath path = paths[j];
                    action = new PreservationActionDefinition();
                   
                    action.setShortname(getShortnameFromPath(path, shortnames));
                    String urls[] = path.getAccessPoints();
                    LinkedList<Parameter> params = new LinkedList<Parameter>();
                    for (int k = 0; k < urls.length; k++) {
                        Parameter param = new Parameter();
                        param.setName(""+k);
                        param.setValue(urls[k]);
View Full Code Here

Examples of eu.planets_project.pp.plato.services.crib_integration.tu_client.MigrationPath

                 */
                PreservationActionDefinition action;
               
                MigrationPath[] paths = serviceRegistryService.findall_migrationPaths(cribID, targetFormat);
                for (int j = 0; j < paths.length; j++) {
                    MigrationPath path = paths[j];
                    action = new PreservationActionDefinition();
                   
                    action.setShortname(getShortnameFromPath(path, shortnames));
                    String urls[] = path.getAccessPoints();
                    LinkedList<Parameter> params = new LinkedList<Parameter>();
                    for (int k = 0; k < urls.length; k++) {
                        Parameter param = new Parameter();
                        param.setName("crib::location"+k);
                        param.setValue(urls[k]);
View Full Code Here

Examples of eu.planets_project.services.datatypes.MigrationPath

                .register(/* new Droid().describe() */new ServiceDescription.Builder(
                        "Droid", Identify.class.getName()).endpoint(endpoint1)
                        .build());
        /* We can register supported migration paths with the service description: */
        FormatRegistry formatRegistry = FormatRegistryFactory.getFormatRegistry();
        MigrationPath path = new MigrationPath(formatRegistry.createExtensionUri("jpg"),
                formatRegistry.createExtensionUri("bmp"), null);
        registry
                .register(/* new SanselanMigrate().describe() */new ServiceDescription.Builder(
                        "Sanselan", Migrate.class.getName())
                        .endpoint(endpoint2).paths(path).build());
View Full Code Here

Examples of eu.planets_project.services.datatypes.MigrationPath

    public static MigrationPath[] createMigrationPathways(List<URI> inputFormats, List<URI> outputFormats) {
        List<MigrationPath> paths = new ArrayList<MigrationPath>();

        for (URI currentInputFormat : inputFormats) {
            for (URI currentOutputFormat : outputFormats) {
                MigrationPath path = new MigrationPath(currentInputFormat, currentOutputFormat, null);
                paths.add(path);
            }
        }

        return paths.toArray(new MigrationPath[] {});
View Full Code Here

Examples of eu.planets_project.services.datatypes.MigrationPath

            for (Iterator<URI> iterator2 = outputFormats.iterator(); iterator2
                    .hasNext();) {
                URI output = iterator2.next();

                MigrationPath path = new MigrationPath(input, output,
                        parameters);
                // Debug...
                // System.out.println(path.getInputFormat() + " --> " +
                // path.getOutputFormat());
                paths.add(path);
View Full Code Here

Examples of eu.planets_project.services.datatypes.MigrationPath

    +"         \n\nValid values : Description\n\n"
    + "US : Migrate to US legal paper format.\n"
    + "Normal : Migrate to the normal A4 paper format.");
  parameters.add(parameterBuilder.build());

  paths.add(new MigrationPath(inputFormat, outputFormat, parameters));

  inputFormat = new URI("info:pronom/x-fmt/406");
  paths.add(new MigrationPath(inputFormat, outputFormat, parameters));

  inputFormat = new URI("info:pronom/x-fmt/407");
  paths.add(new MigrationPath(inputFormat, outputFormat, parameters));

  inputFormat = new URI("info:pronom/x-fmt/408");
  paths.add(new MigrationPath(inputFormat, outputFormat, parameters));

  // Construct a path for migration from lowercase to uppercase.
  inputFormat = new URI("planets:fmt/ext/lowercase");
  outputFormat = new URI("planets:fmt/ext/uppercase");

  parameters = new ArrayList<Parameter>();

  parameterBuilder = new Parameter.Builder("param1", null);
  parameterBuilder.description("\n                        \n"
    + "                        \n"
    + "                        Parameters for 'cat'\n"
    + "                        \n"
    + "                            -A, --show-all\n"
    + "                                  equivalent to -vET\n"
    + "                                  \n"
    + "                            -b, --number-nonblank\n"
    + "                                  number nonempty output lines\n"
    + "                                  \n"
    + "                            -e    equivalent to -vE\n"
    + "                                  \n"
    + "                            -E, --show-ends\n"
    + "                                  display $ at end of each line\n"
    + "                                  \n"
    + "                            -n, --number\n"
    + "                                  number all output lines\n"
    + "                                  \n"
    + "                            -s, --squeeze-blank\n"
    + "                                  suppress repeated empty output lines\n"
    + "                                  \n"
    + "                            -t    equivalent to -vT\n"
    + "                                  \n"
    + "                            -T, --show-tabs\n"
    + "                                  display TAB characters as ^I\n"
    + "                                  \n"
    + "                            -v, --show-nonprinting\n"
    + "                                  use ^ and M- notation, except for"
    + " LFD and TAB\n                    ");
  parameters.add(parameterBuilder.build());

  parameterBuilder = new Parameter.Builder("param2", null);
  parameterBuilder
    .description("\n                        \n"+
      "                        \n"
      + "                        Command line parameters for the 'tr' command.\n"
      + "                        \n"
      + "                           -c, -C, --complement\n"
      + "                                 first complement SET1\n"
      + "                                 \n"
      + "                           -d, --delete\n"
      + "                                 delete characters in SET1, do not translate\n"
      + "                                 \n"
      + "                           -s, --squeeze-repeats\n"
      + "                                 replace each input sequence of  a  repeated  character  that  is\n"
      + "                                 listed in SET1 with a single occurrence of that character\n"
      + "                                 \n"
      + "                           -t, --truncate-set1\n"
      + "                                 first truncate SET1 to length of SET2\n"
      + "                                 \n"
      + "                           SETs  are  specified  as  strings  of characters.  Most represent them‐\n"
      + "                           selves.  Interpreted sequences are:\n"
      + "                           \n"
      + "                           \\NNN   character with octal value NNN (1 to 3 octal digits)\n"
      + "                           \n"
      + "                           \\\\     backslash\n"
      + "                           \n"
      + "                           \\a     audible BEL\n"
      + "                           \n"
      + "                           \\b     backspace\n"
      + "                           \n"
      + "                           \\f     form feed\n"
      + "                           \n"
      + "                           \\n     new line\n"
      + "                           \n"
      + "                           \\r     return\n"
      + "                           \n"
      + "                           \\t     horizontal tab\n"
      + "                           \n"
      + "                           \\v     vertical tab\n"
      + "                                  CHAR1-CHAR2\n"
      + "                                  all characters from CHAR1 to CHAR2 in ascending order\n"
      + "                                  \n"
      + "                           [CHAR*]\n"
      + "                                  in SET2, copies of CHAR until length of SET1\n"
      + "                                  \n"
      + "                           [CHAR*REPEAT]\n"
      + "                                  REPEAT copies of CHAR, REPEAT octal if starting with 0\n"
      + "                                  \n"
      + "                           [:alnum:]\n"
      + "                                  all letters and digits\n"
      + "                                  \n"
      + "                           [:alpha:]\n"
      + "                                  all letters\n"
      + "                                  \n"
      + "                           [:blank:]\n"
      + "                                  all horizontal whitespace\n"
      + "                                  \n"
      + "                           [:cntrl:]\n"
      + "                                  all control characters\n"
      + "                                  \n"
      + "                           [:digit:]\n"
      + "                                  all digits\n"
      + "                                  \n"
      + "                           [:graph:]\n"
      + "                                  all printable characters, not including space\n"
      + "                                  \n"
      + "                           [:lower:]\n"
      + "                                  all lower case letters\n"
      + "                                  \n"
      + "                           [:print:]\n"
      + "                                  all printable characters, including space\n"
      + "                                  \n"
      + "                           [:punct:]\n"
      + "                                  all punctuation characters\n"
      + "                                  \n"
      + "                           [:space:]\n"
      + "                                  all horizontal or vertical whitespace\n"
      + "                                  \n"
      + "                           [:upper:]\n"
      + "                                  all upper case letters\n"
      + "                                  \n"
      + "                           [:xdigit:]\n"
      + "                                  all hexadecimal digits\n"
      + "                                  \n"
      + "                           [=CHAR=]\n"
      + "                                  all characters which are equivalent to CHAR\n"
      + "                                  \n"
      + "                           Translation occurs if -d is not given and both SET1  and  SET2  appear.\n"
      + "                           -t  may  be  used only when translating.  SET2 is extended to length of\n"
      + "                           SET1 by repeating its last character as necessary.   Excess  characters\n"
      + "                           of  SET2  are  ignored.  Only [:lower:] and [:upper:] are guaranteed to\n"
      + "                           expand in ascending order; used in SET2  while  translating,  they  may\n"
      + "                           only  be used in pairs to specify case conversion.  -s uses SET1 if not\n"
      + "                           translating nor deleting; else squeezing uses  SET2  and  occurs  after\n"
      + "                           translation or deletion.\n"
      + "                    ");
  parameters.add(parameterBuilder.build());

  parameterBuilder = new Parameter.Builder("mode", "complete");
  parameterBuilder
    .description("\n                        \n                        \n"
      + "                        Valid options:\n"
      + "                        \n"
      + "                        'complete' : Converts from lowercase to uppercase.\n"
      + "                        'AC-DC'    : Converts As to Ds, thus, AC-DC becomes DC-AC.\n"
      + "                        'extra'    : Converts from lowercase to uppercase and adds\n"
      + "                                     a line number to each line.\n"
      + "                                     \n"
      + "                        Defaults to 'complete'.\n"
      + "                    \n\nValid values : Description\n\n"
      + "complete : Uppercase all text.\n"
      + "extra : Uppercase all text and add line numbers.\n"
      + "                        \n"
      + "AC-DC : Swaps As with Ds. Thus changing AC-DC to DC-AC\n"
      + "                        ");
  parameters.add(parameterBuilder.build());

  parameterBuilder = new Parameter.Builder("quality", null);
  parameterBuilder
    .description("\n                        \n                        \n"
      + "                        Quality presets for the test tool.\n"
      + "                        \n"
      + "                        Valid options:\n"
      + "                        \n"
      + "                        'good' : Converts from lowercase to uppercase.\n"
      + "                        'better' : Converts As to Ds, thus, AC-DC becomes DC-AC.\n"
      + "                        'best' : Converts from lowercase to uppercase and adds\n"
      + "                                 a line number to each line.\n"
      + "                                 \n"
      + "                        Defaults to 'good'.\n"
      + "                        \n" + "                    \n\n"
      + "Valid values : Description\n\n"
      + "better : AC-DC to DC-AC\n"
      + "best : Uppercase all and add line numbers.\n"
      + "good : Uppercase all.");

  parameters.add(parameterBuilder.build());

  paths.add(new MigrationPath(inputFormat, outputFormat, parameters));

  // Construct a path for migration from lowercase to uppercase.
  inputFormat = new URI("planets:fmt/ext/foo");
  outputFormat = new URI("planets:fmt/ext/bar");

  parameters = new ArrayList<Parameter>();

  parameterBuilder = new Parameter.Builder("param1", null);
  parameterBuilder.description("Command line parameters for the 'cat'\n"
    + "                        command.\n" + "                        See\n"
    + "                        'man\n" + "                        cat'.\n"
    + "                    ");
  parameters.add(parameterBuilder.build());

  parameterBuilder = new Parameter.Builder("param2", null);
  parameterBuilder.description("Command line parameters for the 'tr'\n"
    + "                        command.\n"
    + "                        See\n"
    + "                        'man\n"
    + "                        tr'.\n"
    + "                    ");
  parameters.add(parameterBuilder.build());

  paths.add(new MigrationPath(inputFormat, outputFormat, parameters));

  return paths;
    }
View Full Code Here

Examples of eu.planets_project.services.datatypes.MigrationPath

        List<MigrationPath> paths = new ArrayList<MigrationPath>();
        for ( String i : JavaImageIOIdentify.unique( ImageIO.getReaderFormatNames() ) ) {
                for (String j : JavaImageIOIdentify.unique( ImageIO.getWriterFormatNames() )) {
                    if (!i.equalsIgnoreCase(j) ) {
                   
                        MigrationPath p = new MigrationPath(
                                format.createExtensionUri(i),
                                format.createExtensionUri(j),
                                null );
                        paths.add(p);
                    }
View Full Code Here

Examples of eu.planets_project.services.datatypes.MigrationPath

                                    .build();
                            pars.add(compression);
                        }
                       
                        FormatRegistry format = FormatRegistryFactory.getFormatRegistry();
                        MigrationPath p = new MigrationPath(
                                format.createExtensionUri(i.extension),
                                format.createExtensionUri(j.extension),
                                pars);
                        paths.add(p);
                    }
View Full Code Here

Examples of eu.planets_project.services.datatypes.MigrationPath

 
  @Test
  public void testAllPossibleMigrationPathways() {
    System.out.println("Testing all possible pathways...START");
    for(int i=0;i<migrationPaths.length;i++) {
      MigrationPath path = migrationPaths[i];
      URI inputFormat = path.getInputFormat();
      URI outputFormat = path.getOutputFormat();
     
      System.out.println();
      System.out.println("Testing migrationPath: [" + inputFormat.toASCIIString() + " --> " + outputFormat.toASCIIString() + "]");
      System.out.println();
     
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.