Examples of DigitalObject


Examples of org.fcrepo.server.storage.types.DigitalObject

     * @throws ObjectNotFoundException
     *         if it's not in the "repository".
     */
    public synchronized DigitalObject getObject(String pid)
            throws ObjectNotFoundException {
        DigitalObject obj = _objects.get(pid);
        if (obj == null) {
            throw new ObjectNotFoundException("No such object: " + pid);
        } else {
            return obj;
        }
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

     * {@inheritDoc}
     */
    public synchronized DOReader getReader(boolean cachedObjectRequired,
                                           Context context,
                                           String pid) throws ServerException {
        DigitalObject obj = getObject(pid);
        return new SimpleDOReader(null, this, null, null, null, obj);
    }
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

     */
    public synchronized ServiceDeploymentReader getServiceDeploymentReader(boolean cachedObjectRequired,
                                                                           Context context,
                                                                           String pid)
            throws ServerException {
        DigitalObject obj = getObject(pid);
        //TODO hasModel
        if (!obj.hasContentModel(
                                 Models.SERVICE_DEPLOYMENT_3_0)) {
            throw new GeneralException("Not a service deployment: " + pid);
        } else {
            return new SimpleServiceDeploymentReader(null,
                                                     this,
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

     */
    public synchronized ServiceDefinitionReader getServiceDefinitionReader(boolean cachedObjectRequired,
                                                                           Context context,
                                                                           String pid)
            throws ServerException {
        DigitalObject obj = getObject(pid);
        //TODO hasModel
        if (!obj.hasContentModel(
                                 Models.SERVICE_DEFINITION_3_0)) {
            throw new GeneralException("Not a service definition object: "
                    + pid);
        } else {
            return new SimpleServiceDefinitionReader(null,
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

    }

    private static DOReader getDOReader(String[] dsData) {
        MockRepositoryReader repo = new MockRepositoryReader();
        try {
            DigitalObject obj = new BasicDigitalObject();
            obj.setPid(TEST_PID);
            for (int i = 0; i < dsData.length; i+=2) {
                ObjectBuilder.addXDatastream(obj, dsData[i], dsData[i+1]);
            }
            repo.putObject(obj);
            DOReader reader = repo.getReader(false, ReadOnlyContext.EMPTY, TEST_PID);
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

            HashMap<String, DODeserializer> desers = new HashMap<String, DODeserializer>();
            HashMap<String, DOSerializer> sers = new HashMap<String, DOSerializer>();
            desers.put(METS_EXT1_1.uri, deser);
            sers.put(METS_EXT1_1.uri, ser);
            DOTranslatorImpl trans = new DOTranslatorImpl(sers, desers);
            DigitalObject obj = new BasicDigitalObject();
            System.out.println("Deserializing...");
            trans.deserialize(in,
                              obj,
                              METS_EXT1_1.uri,
                              "UTF-8",
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

                    (DOTranslator) server
                            .getModule("org.fcrepo.server.storage.translation.DOTranslator");
            if (trans == null) {
                throw new IOException("DOTranslator module not found via getModule");
            }
            DigitalObject obj = new BasicDigitalObject();
            System.out.println("Deserializing...");
            trans.deserialize(in,
                              obj,
                              args[1],
                              args[2],
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

        InputStream in = new FileInputStream(source);
        File f = File.createTempFile("test", null);
        OutputStream out = new FileOutputStream(f);

        DODeserializer deser = new FOXML1_1DODeserializer();
        DigitalObject obj = new BasicDigitalObject();
        deser.deserialize(in, obj, "UTF-8", DESERIALIZE_INSTANCE);

        // some sanity checks
        setObjectDefaults(obj);
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

        serializer.serialize(obj, out, "UTF-8", SERIALIZE_EXPORT_ARCHIVE);
    }

    @Test
    public void testSerialize() throws Exception {
        DigitalObject obj = createTestObject(Models.FEDORA_OBJECT_3_0);
        obj.setLastModDate(new Date());
        DatastreamXMLMetadata ds1 = createXDatastream("DS1");
        ds1.DSCreateDT = new Date();
        obj.addDatastreamVersion(ds1, true);

        OutputStream out = new ByteArrayOutputStream();

        DOSerializer serializer = new AtomDOSerializer();
        serializer.serialize(obj, out, "UTF-8", SERIALIZE_EXPORT_ARCHIVE);
View Full Code Here

Examples of org.fcrepo.server.storage.types.DigitalObject

        //validateWithISOSchematron(out.toString());
    }

    @Test
    public void testAtomZip() throws Exception {
        DigitalObject obj = createTestObject(FEDORA_OBJECT_3_0);
        obj.setLastModDate(new Date());
        DatastreamXMLMetadata ds1 = createXDatastream("DS1");
        ds1.DSCreateDT = new Date();
        obj.addDatastreamVersion(ds1, true);

        File f = File.createTempFile("atom", ".zip");
        OutputStream out = new FileOutputStream(f);

        DOSerializer serializer = new AtomDOSerializer(Constants.ATOM_ZIP1_1);
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.