Package org.dspace.content.packager

Examples of org.dspace.content.packager.PackageParameters


        String[] collections = null;
        boolean useWorkflow = true;
        String packageType = null;
        boolean submit = true;
        String itemHandle = null;
        PackageParameters pkgParams = new PackageParameters();

        if (line.hasOption('h'))
        {
            HelpFormatter myhelp = new HelpFormatter();
            myhelp.printHelp("Packager  [options]  package-file|-\n",
                    options);
            System.out.println("\nAvailable Submission Package (SIP) types:");
            String pn[] = PluginManager
                    .getAllPluginNames(PackageIngester.class);
            for (int i = 0; i < pn.length; ++i)
                System.out.println("  " + pn[i]);
            System.out
                    .println("\nAvailable Dissemination Package (DIP) types:");
            pn = PluginManager.getAllPluginNames(PackageDisseminator.class);
            for (int i = 0; i < pn.length; ++i)
                System.out.println("  " + pn[i]);
            System.exit(0);
        }
        if (line.hasOption('w'))
            useWorkflow = false;
        if (line.hasOption('e'))
            eperson = line.getOptionValue('e');
        if (line.hasOption('c'))
            collections = line.getOptionValues('c');
        if (line.hasOption('t'))
            packageType = line.getOptionValue('t');
        if (line.hasOption('i'))
            itemHandle = line.getOptionValue('i');
        String files[] = line.getArgs();
        if (files.length > 0)
            sourceFile = files[0];
        if (line.hasOption('d'))
            submit = false;
        if (line.hasOption('o'))
        {
            String popt[] = line.getOptionValues('o');
            for (int i = 0; i < popt.length; ++i)
            {
                String pair[] = popt[i].split("\\=", 2);
                if (pair.length == 2)
                    pkgParams.addProperty(pair[0].trim(), pair[1].trim());
                else if (pair.length == 1)
                    pkgParams.addProperty(pair[0].trim(), "");
                else
                    System.err
                            .println("Warning: Illegal package option format: \""
                                    + popt[i] + "\"");
            }
View Full Code Here


            throw new CrosswalkInternalException("Cannot find a disseminate plugin for package="+METS_PACKAGER_PLUGIN);

        try
        {
            // Set the manifestOnly=true param so we just get METS document
            PackageParameters pparams = new PackageParameters();
            pparams.put("manifestOnly", "true");

            // "pipe" the output into a parser to create JDOM document.
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            Context context = new Context();
            dip.disseminate(context, item, pparams, baos);
View Full Code Here

        }
        else
        {
            try
            {
                PackageParameters pparams = PackageParameters.create(this.request);
                this.response.setContentType(dip.getMIMEType(pparams));
                dip.disseminate(this.context, this.item, pparams, this.response
                        .getOutputStream());
            }
            catch (CrosswalkException pe)
View Full Code Here

      // the licence is either in the zip or the mets manifest.  Either way
      // it's none of our business here
      String licence = null;
     
      // We don't need to include any parameters
      PackageParameters params = new PackageParameters();
     
      // ingest the item
      WorkspaceItem wsi = pi.ingest(context, collection, is, params, licence);
      if (wsi == null)
      {
View Full Code Here

            Utils.copy(pis, fos);
            fos.close();
            pis.close();

            // Initialize parameters to packager
            PackageParameters params = PackageParameters.create(this.request);
            // Force package ingester to respect Collection workflows (i.e. start workflow automatically as needed)
            params.setWorkflowEnabled(true);

            //ingest from the temp file to create the new DSpaceObject
            DSpaceObject ingestedDso = sip.ingest(this.context, this.collection, tempFile,
                    params, null);
            Item item = (Item) ingestedDso;
View Full Code Here

    {
        // todo : Read all this stuff from config
        if (packageFormat.equals("http://purl.org/net/sword-types/METSDSpaceSIP"))
        {
            this.packageFormat = "METS";
            pkgParams = new PackageParameters();
            pkgParams.addProperty("dmd", "MODS");
            message.setFormatNamespace("http://purl.org/net/sword-types/METSDSpaceSIP");
        }
        else
        {
View Full Code Here

                    ? ConfigurationManager.getProperty("upload.temp.dir") : System.getProperty("java.io.tmpdir");
                File tempFile = File.createTempFile("DAVItemGet" + this.item.hashCode(), null, new File(tempDirectory));
                tempFile.deleteOnExit();

                // Disseminate item to temporary file
                PackageParameters pparams = PackageParameters.create(this.request);
                this.response.setContentType(dip.getMIMEType(pparams));
                dip.disseminate(this.context, this.item, pparams, tempFile);

                // Copy temporary file contents to response stream
                FileInputStream fileIn = null;
View Full Code Here

                ? ConfigurationManager.getProperty("upload.temp.dir") : System.getProperty("java.io.tmpdir");
            File tempFile = File.createTempFile("RoleCrosswalkDisseminate" + dso.hashCode(), null, new File(tempDirectory));
            tempFile.deleteOnExit();

            // Initialize our packaging parameters
            PackageParameters pparams;
            if(this.getPackagingParameters()!=null)
            {
                pparams = this.getPackagingParameters();
            }
            else
            {
                pparams = new PackageParameters();
            }

            //actually disseminate to our temp file.
            Context context = new Context();
            dip.disseminate(context, dso, pparams, tempFile);
View Full Code Here

        {
            throw new CrosswalkInternalException("Cannot find a PackageIngester plugin named " + ROLE_PACKAGER_PLUGIN);
        }

        // Initialize our packaging parameters
        PackageParameters pparams;
        if(this.getPackagingParameters()!=null)
        {
            pparams = this.getPackagingParameters();
        }
        else
        {
            pparams = new PackageParameters();
        }
       
        // Initialize our license info
        String license = null;
        if(this.getIngestionLicense()!=null)
View Full Code Here

        }

        try
        {
            // Set the manifestOnly=true param so we just get METS document (and not content files, etc)
            PackageParameters pparams = new PackageParameters();
            pparams.put("manifestOnly", "true");

            // Create a temporary file to disseminate into
            String tempDirectory = (ConfigurationManager.getProperty("upload.temp.dir") != null)
                ? ConfigurationManager.getProperty("upload.temp.dir") : System.getProperty("java.io.tmpdir");
View Full Code Here

TOP

Related Classes of org.dspace.content.packager.PackageParameters

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.