Package org.dspace.app.bulkedit

Examples of org.dspace.app.bulkedit.DSpaceCSV


            }
        }
        else if ("confirm".equals(request.getParameter("type")))
        {
            // Get the csv lines from the session
            DSpaceCSV csv = (DSpaceCSV)session.getAttribute("csv");

            // Make the changes
            try
            {
                MetadataImport mImport = new MetadataImport(context, csv.getCSVLines());
                ArrayList<BulkEditChange> changes = mImport.runImport(true, false, false, false);

                // Commit the changes
                context.commit();
                log.debug(LogManager.getHeader(context, "metadataimport", changes.size() + " items changed"));
View Full Code Here


        // Wrap multipart request to get the submission info
        FileUploadRequest wrapper = new FileUploadRequest(request);
        File f = wrapper.getFile("file");

        // Run the import
        DSpaceCSV csv = new DSpaceCSV(f);
        MetadataImport mImport = new MetadataImport(context, csv.getCSVLines());
        ArrayList<BulkEditChange> changes = mImport.runImport(false, false, false, false);

        // Store the csv lines in the session
        HttpSession session = request.getSession(true);
        session.setAttribute("csv", csv);
View Full Code Here

        {

            FlowResult result = new FlowResult();
            result.setContinue(false);

            DSpaceCSV csv = (DSpaceCSV)request.getSession().getAttribute("csv");

            if(csv != null)
            {
                try {

                    // Run the import
                    MetadataImport mImport = new MetadataImport(context, csv.getCSVLines());
                    ArrayList<BulkEditChange> changes = mImport.runImport(true, false, false, false);

                    // Commit the changes
                    context.commit();
                    request.setAttribute("changes",changes);
View Full Code Here

                        try {

                            log.info(LogManager.getHeader(context, "metadataimport", "loading file"));

                            // Process CSV without import
                            DSpaceCSV csv = new DSpaceCSV(file);
                            file.delete();

                            MetadataImport mImport = new MetadataImport(context, csv.getCSVLines());
                            ArrayList<BulkEditChange> changes = mImport.runImport(false, false, false, false);
                            log.debug(LogManager.getHeader(context, "metadataimport", changes.size() + " items with changes identifed"));

                            if(changes.size() > 0)
                            {
View Full Code Here

                {
                    exporter = new MetadataExport(context, (Community)thing, false);
                }

                // Perform the export
                DSpaceCSV csv = exporter.export();

                // Return the csv file
                response.setContentType("text/csv; charset=UTF-8");
                String filename = handle.replaceAll("/", "-") + ".csv";
                response.setHeader("Content-Disposition", "attachment; filename=" + filename);
                PrintWriter out = response.getWriter();
                out.write(csv.toString());
                out.flush();
                out.close();
                log.info(LogManager.getHeader(context, "metadataexport", "exported_file:" + filename));               
                return;
            }
View Full Code Here

            }
            ItemIterator ii = new ItemIterator(context, iids);
            MetadataExport exporter = new MetadataExport(context, ii, false);

            // Perform the export
            DSpaceCSV csv = exporter.export();

            // Return the csv file
            response.setContentType("text/csv; charset=UTF-8");
            response.setHeader("Content-Disposition", "attachment; filename=browse-result.csv");
            PrintWriter out = response.getWriter();
            out.write(csv.toString());
            out.flush();
            out.close();
            log.info(LogManager.getHeader(context, "metadataexport", "exported_file:browse-results.csv"));
            return;
        }
View Full Code Here

        }
        ItemIterator ii = new ItemIterator(context, iids);
        MetadataExport exporter = new MetadataExport(context, ii, false);

        // Perform the export
        DSpaceCSV csv = exporter.export();

        // Return the csv file
        response.setContentType("text/csv; charset=UTF-8");
        response.setHeader("Content-Disposition", "attachment; filename=search-results.csv");
        PrintWriter out = response.getWriter();
        out.write(csv.toString());
        out.flush();
        out.close();
        log.info(LogManager.getHeader(context, "metadataexport", "exported_file:search-results.csv"));
        return;
    }
View Full Code Here

            }
        }
        else if ("confirm".equals(request.getParameter("type")))
        {
            // Get the csv lines from the session
            DSpaceCSV csv = (DSpaceCSV)session.getAttribute("csv");

            // Make the changes
            try
            {
                MetadataImport mImport = new MetadataImport(context, csv);
View Full Code Here

        // Wrap multipart request to get the submission info
        FileUploadRequest wrapper = new FileUploadRequest(request);
        File f = wrapper.getFile("file");

        // Run the import
        DSpaceCSV csv = new DSpaceCSV(f, context);
        MetadataImport mImport = new MetadataImport(context, csv);
        List<BulkEditChange> changes = mImport.runImport(false, false, false, false);

        // Store the csv lines in the session
        HttpSession session = request.getSession(true);
View Full Code Here

        }
        ItemIterator ii = new ItemIterator(context, iids);
        MetadataExport exporter = new MetadataExport(context, ii, false);

        // Perform the export
        DSpaceCSV csv = exporter.export();

        // Return the csv file
        response.setContentType("text/csv; charset=UTF-8");
        response.setHeader("Content-Disposition", "attachment; filename=search-results.csv");
        PrintWriter out = response.getWriter();
        out.write(csv.toString());
        out.flush();
        out.close();
        log.info(LogManager.getHeader(context, "metadataexport", "exported_file:search-results.csv"));
        return;
    }
View Full Code Here

TOP

Related Classes of org.dspace.app.bulkedit.DSpaceCSV

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.