Package org.fao.geonet.services.metadata

Examples of org.fao.geonet.services.metadata.XslProcessingReport


        // Set parameter and process metadata to remove reference to the uploaded file
        request.getParameterMap().put("name", new String[]{filename});
        request.getParameterMap().put("protocol", new String[]{"WWW:DOWNLOAD-1.0-http--download"});

        String process = "onlinesrc-remove";
        XslProcessingReport report = new XslProcessingReport(process);

        Element processedMetadata;
        try {
            final String siteURL = context.getBean(SettingManager.class).getSiteURL(context);
            processedMetadata = XslProcessing.get().process(id, process,
                    true, context.getAppPath(), report, true, siteURL, request);
            if (processedMetadata == null) {
                throw new BadParameterEx("Processing failed", "Not found:"
                        + report.getNotFoundMetadataCount() + ", Not owner:" + report.getNotEditableMetadataCount()
                        + ", No process found:" + report.getNoProcessFoundCount() + ".");
            }
        } catch (Exception e) {
            throw e;
        }
View Full Code Here


        request.getParameterMap().put("name", new String[]{file.getName()});
        request.getParameterMap().put("desc", new String[]{description});
        request.getParameterMap().put("protocol", new String[]{"WWW:DOWNLOAD-1.0-http--download"});

        String process = "onlinesrc-add";
        XslProcessingReport report = new XslProcessingReport(process);
       
        Element processedMetadata;
        try {
            final String siteURL = context.getBean(SettingManager.class).getSiteURL(context);
            processedMetadata = XslProcessing.get().process(id, process,
                    true, context.getAppPath(), report, true, siteURL, request);
            if (processedMetadata == null) {
                throw new BadParameterEx("Processing failed", "Not found:"
                        + report.getNotFoundMetadataCount() + ", Not owner:" + report.getNotEditableMetadataCount()
                        + ", No process found:" + report.getNoProcessFoundCount() + ".");
            }
        } catch (Exception e) {
            throw e;
        }
        // -- return the processed metadata id
View Full Code Here

TOP

Related Classes of org.fao.geonet.services.metadata.XslProcessingReport

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.