Examples of PlanetsDatastreamType


Examples of eu.planets_project.ifr.core.storage.impl.fedora.connector.planets.PlanetsDatastreamType

        } catch (DigitalObjectNotFoundException e) {
            //we have just checked that it exists...
            throw new StoreException("Object was there, but then it was gone",e);
        }

        PlanetsDatastreamType planetsDatastreamObject;
        try {
            planetsDatastreamObject = readPlanetsDatastream(planetsModel);
        } catch (ParseException e) {
            throw new StoreException(e);
        } catch (DigitalObjectNotFoundException e) {
            throw new StoreException("Object '"+pid+"' was a planets object but cannot read the content model",e);
        }
        //If so far, we have now read the datastream in as a java class



        //decode the streams for the planets object

        MetadatastreamsType metadatastreams = planetsDatastreamObject.getMetadatastreams();
        Map<String, MetadatastreamType> metamap = new HashMap<String, MetadatastreamType>();
        for (MetadatastreamType datastream: metadatastreams.getMetadatastream()){
            metamap.put(datastream.getPlanetsName(),datastream);
        }



        for (Metadata metadata : digitalObject.getMetadata()) {
            MetadatastreamType ds = metamap.get(metadata.getName());
            URI formatURI = metadata.getType();
            if (ds!=null){

                try {
                    fedora.modifyDatastream(pid,ds.getName(),metadata.getContent(),formatURI);
                } catch (ParseException e) {
                    throw new StoreException(e);
                }
            }
        }

        try {
            fedora.setObjectLabel(pid,digitalObject.getTitle());
        } catch (DigitalObjectNotFoundException e) {
            //we have just checked that it exists...
            throw new StoreException("Object was there, but then it was gone",e);
        }

        ContentdatastreamType filedatastream = planetsDatastreamObject.getContentdatastream();
        URI formatURI = digitalObject.getFormat();

        try {
            fedora.modifyDatastream(pid,filedatastream.getName(),digitalObject.getContent().getInputStream(),formatURI);
            return  fedora.pid2Uri(pid);
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.fedora.connector.planets.PlanetsDatastreamType

        } catch (FedoraConnectionException e) {
            throw new DigitalObjectNotFoundException(e);
        }

        PlanetsDatastreamType planetsDatastreamObject;
        try {
            planetsDatastreamObject = readPlanetsDatastream(planetsmodel);
        } catch (ParseException e) {
            throw new DigitalObjectNotFoundException("Object "+pdURI+" is not planets compatible",e);
        } catch (FedoraConnectionException e) {
            throw new DigitalObjectNotFoundException("Object "+pdURI+" is not planets compatible",e);
        }
        //If so far, we have now read the datastream in as a java class



        //decode the streams for the planets object

        MetadatastreamsType metadatastreams = planetsDatastreamObject.getMetadatastreams();
        Map<String, MetadatastreamType> metamap = new HashMap<String, MetadatastreamType>();
        for (MetadatastreamType datastream: metadatastreams.getMetadatastream()){
            metamap.put(datastream.getPlanetsName(),datastream);
        }

        List<Metadata> metadata = new ArrayList<Metadata>();
        for (MetadatastreamType ds: metadatastreams.getMetadatastream()){
            String contents = null;
            URI formatURI = null;
            try {
                contents = fedora.getDatastreamString(pid,ds.getName());
                try {
                    formatURI = fedora.getDatastreamFormat(pid,ds.getName());
                } catch (ParseException e) {
                    //So, format URI is null
                }
            } catch (FedoraConnectionException e) {
                throw new DigitalObjectNotFoundException(e);
            }
            metadata.add(new Metadata(formatURI,ds.getPlanetsName(),contents));
        }


        ContentdatastreamType filedatastream = planetsDatastreamObject.getContentdatastream();
        URL contenturl = null;
        URI objectformat = null;
        try {
            contenturl = fedora.getDatastreamURL(pid,filedatastream.getName());
            try {
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.fedora.connector.planets.PlanetsDatastreamType

            //JAXBContext jaxb = JAXBContext.newInstance("eu.planets_project.fedora.connector.planets");
            JAXBContext jaxb = JAXBContext.newInstance("eu.planets_project.ifr.core.storage.impl.fedora.connector.planets");           
            Unmarshaller unmarshaller = jaxb.createUnmarshaller();
            //Read the planets content stream
            JAXBElement unmarshalled = (JAXBElement) unmarshaller.unmarshal(planetsstream);
            PlanetsDatastreamType planetsDatastreamObject = (PlanetsDatastreamType) unmarshalled.getValue();
            return planetsDatastreamObject;

        } catch (JAXBException e) {
            throw new ParseException(e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.