Package com.nesstar.api.publishing

This package contains classes relevant to the publishing of data to Nesstar servers.

See: Description

Package com.nesstar.api.publishing Description

This package contains classes relevant to the publishing of data to Nesstar servers.

Code Example

        // The StudyPublishingBuilder acts as a container for all input to publishing
        StudyPublishingBuilder builder = new StudyPublishingBuilder();
        
        // A data source - in this case a CSV file
        CSVFileDataSource dataSource = new CSVFileDataSource(someCSVFile);
        
        // Adding data and metadata to the builder.
        // Notice how you can chain calls.
        builder.addDDI(norwegianDDIasInputStream)
            .addDDI(englishDDIasInputStream)
            .addData(dataSource, "some_ID");
        
        // Setting a default language is not necessary but if you don't,
        // the API will use the language from the first metadata file.
        builder.setDefaultLanguage(Locale.ENGLISH);
        
        // Finally send the data to the server 
        try {
           myServer.publishStudy(builder);
        } catch (PublishingException e) {
           logger.error("Publishing failed", e);
        }
    
Since:
0.6

Copyright © 2011, NSD All rights reserved