Examples of Migrate


Examples of eu.planets_project.services.migrate.Migrate

      try {
        url = new URL(URL_XCDLEXTRACTOR);
       
        Service service = Service.create(url, new QName(PlanetsServices.NS,
                Migrate.NAME));
          Migrate extractor = service.getPort(Migrate.class);
         
          //the service's input
          byte[] array = FileUtils.readFileToByteArray(f1);
         
          //the service call and it's result
            DigitalObject digitalObject = extractor.migrate(
                    new DigitalObject.Builder(Content.byValue(array))
                            .build(), null, null, null).getDigitalObject();
            byte[] results = IOUtils.toByteArray(digitalObject.getContent().getInputStream());
      String xcdl = new String(results,"UTF-8");
     
View Full Code Here

Examples of eu.planets_project.services.migrate.Migrate

            service = Service.create(wsdlLocation, Migrate.QNAME);
        } catch(WebServiceException e) {
            throw new PlatoServiceException("Error creating web service.", e);
        }
       
        Migrate m = (Migrate) service.getPort(Migrate.class);
       
        // create digital object that contains our sample object
        DigitalObject dob = new DigitalObject.Builder( Content.byValue(sampleObject.getData().getData()) ).title("data").build();

        FormatRegistry formatRegistry = FormatRegistryFactory.getFormatRegistry();

        // create Planets URI from extension
        URI sourceFormat = formatRegistry.createExtensionUri(sampleObject.getFormatInfo().getDefaultExtension());
       
        URI targetFormat;
        try {
            targetFormat = new URI(action.getTargetFormat());
        } catch (URISyntaxException e) {
            throw new PlatoServiceException("Error in target format.", e);
        }
       
        List<Parameter> serviceParams = getParameters(action.getParamByName("settings"));
       
        if (serviceParams.size() <= 0) {
            serviceParams = null;
        }
       
        // perform migration
        MigrateResult result = m.migrate(dob, sourceFormat, targetFormat, serviceParams);

        MigrationResult migrationResult = new MigrationResult();
        migrationResult.setSuccessful((result != null) && (result.getDigitalObject() != null));

        if (migrationResult.isSuccessful()) {
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.