Package eu.scape_project.planning.model

Examples of eu.scape_project.planning.model.CollectionProfile


            sample.setFullname(sample.getFullname().replace("http://localhost:8080", repositoryURL));
        }
        String name = id + "_" + key + ".xml";

        log.info("Storing profile");
        CollectionProfile collectionProfile = plan.getSampleRecordsDefinition().getCollectionProfile();

        this.storeProfile(name, bsData);

        log.info("processing sample objects information");
        RepositoryConnectorApi repo;
        if (Helper.isRODAidentifier(repositoryURL)) {
            RODAConnector roda = new RODAConnector();
            Map<String,String> config = new HashMap<String,String>() {{
                put(RODAConnector.ENDPOINT_KEY , repositoryURL);
                put(RODAConnector.USER_KEY , repositoryUser);
                put(RODAConnector.PASS_KEY , repositoryPassword);
            }};       
            roda.updateConfig(config);
            repo = roda;
        } else {
            repo = new SCAPEDataConnectorClient(repositoryURL, repositoryUser, repositoryPassword);
        }
        this.plan.getSampleRecordsDefinition().setSamplesDescription(description);
        this.processSamples(repo, samples);
       
        log.info("processing sample objects finished");
        try {
            CollectionProfile profile = this.plan.getSampleRecordsDefinition().getCollectionProfile();
            profile.setCollectionID(id + "?" + key);
            profile.setNumberOfObjects(count);
            profile.setTypeOfObjects(typeOfObjects);
            // TODO: confirm: why setting it when it was retrieved 4 lines above?
            // this.plan.getSampleRecordsDefinition().setCollectionProfile(profile);
            this.plan.getSampleRecordsDefinition().touch();
            this.plan.touch();
        } catch (Exception e) {
View Full Code Here


        object.setContentType("application/xml");
        object.setFullname(name);
        object.setData(profile);

        try {
            CollectionProfile collectionProfile = plan.getSampleRecordsDefinition().getCollectionProfile();
           
            // remove the old collection profile file if existent
            if (collectionProfile.getProfile() != null) {
                bytestreamsToRemove.add(collectionProfile.getProfile().getPid());
            }
            digitalObjectManager.moveDataToStorage(object);
            collectionProfile.setProfile(object);
            addedBytestreams.add(object.getPid());
        } catch (StorageException e) {
            log.error("An error occurred while storing the profile: {}", e);
            throw new PlanningException("An error occurred while storing the profile");
        }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.CollectionProfile

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.