Examples of DigitalObject


Examples of eu.planets_project.pp.plato.model.DigitalObject

        if (pp== null) {
            return null;
        }
       
        // must be merged back into session because of lazy loading of data byte stream
        DigitalObject o = (DigitalObject)em.merge(pp.getReportUpload());
       
        byte[] data = o.getData().getData();

        return o;
    }
View Full Code Here

Examples of eu.planets_project.services.datatypes.DigitalObject

        }
      File zip = getZipAsFile(digOb);
     
      File target = ZipUtils.getFileFrom(zip, fragment, digObTmp);     
   
    DigitalObject resultDigOb = createDigitalObject(target, createByReference);
   
    return resultDigOb;
    }
View Full Code Here

Examples of eu.scape_project.planning.model.DigitalObject

     *            the result object
     * @param sampleObject
     *            the sample object
     */
    private void setResultName(MigrationResult result, DigitalObject sampleObject) {
        DigitalObject resultObject = result.getMigratedObject();
        if (resultObject != null) {
            String resultName = "result.";
            if (sampleObject.getFullname() != null) {
                resultName = sampleObject.getFullname() + ".";
            }
            if (result.getTargetFormat() != null) {
                resultName = resultName + result.getTargetFormat().getDefaultExtension();
                resultObject.getFormatInfo().assignValues(result.getTargetFormat());
            }
            resultObject.setFullname(resultName);
        }
    }
View Full Code Here

Examples of org.fcrepo.client.batch.types.DigitalObject

                             Attributes attrs) throws SAXException {

        if (namespaceURI.equalsIgnoreCase(BATCH_MODIFY.uri)
                && localName.equalsIgnoreCase("addObject")) {
            addObject = false;
            m_obj = new DigitalObject();

            // Get required attributes
            m_obj.pid = attrs.getValue("pid");
            m_obj.label = attrs.getValue("label");
            m_obj.logMessage = attrs.getValue("logMessage");

            try {
                if (m_obj.label.equals("")) {
                    failedCount++;
                    logFailedDirective(m_obj.pid,
                                       localName,
                                       null,
                                       "Object Label must be non-empty.");
                    return;
                }
                if (!m_obj.pid.equals("")) {
                    if (m_obj.pid.indexOf(":") < 1) {
                        failedCount++;
                        logFailedDirective(m_obj.pid,
                                           localName,
                                           null,
                                           "Custom PID should be of the form \"namespace:1234\"");
                        return;
                    }
                }
                addObject = true;

            } catch (Exception e) {
                failedCount++;
                logFailedDirective(m_obj.pid, localName, e, "");
            }
        } else if (namespaceURI.equalsIgnoreCase(BATCH_MODIFY.uri)
                && localName.equalsIgnoreCase("modifyObject")) {
            modifyObject = false;
            m_obj = new DigitalObject();

            // Get required attributes
            m_obj.pid = attrs.getValue("pid");
            m_obj.logMessage = attrs.getValue("logMessage");

            try {
                if (!m_obj.pid.equals("")) {
                    if (m_obj.pid.indexOf(":") < 1) {
                        failedCount++;
                        logFailedDirective(m_obj.pid,
                                           localName,
                                           null,
                                           "Custom PID should be of the form \"namespace:1234\"");
                        return;
                    }
                }

                // Get optional attributes
                if (attrs.getValue("label") != null) {
                    m_obj.label = attrs.getValue("label");
                } else {
                    m_obj.label = null;
                }
                if (attrs.getValue("state") != null) {
                    m_obj.state = attrs.getValue("state");
                } else {
                    m_obj.state = null;
                }
                if (attrs.getValue("ownerId") != null) {
                    m_obj.ownerId = attrs.getValue("ownerId");
                } else {
                    m_obj.ownerId = null;
                }
                modifyObject = true;

            } catch (Exception e) {
                failedCount++;
                logFailedDirective(m_obj.pid, localName, e, "");
            }
        } else if (namespaceURI.equalsIgnoreCase(BATCH_MODIFY.uri)
                && localName.equalsIgnoreCase("purgeObject")) {
            purgeObject = false;
            m_obj = new DigitalObject();

            // Get required attributes
            m_obj.pid = attrs.getValue("pid");
            m_obj.logMessage = attrs.getValue("logMessage");
View Full Code Here

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

    private boolean addObject(Rebuilder rebuilder, ILowlevelStorage llstore,
            DODeserializer deser, String pid) {
        InputStream in = null;
        try {
            in = llstore.retrieveObject(pid);
            DigitalObject obj = new BasicDigitalObject();
            deser.deserialize(in, obj, "UTF-8",
                    DOTranslationUtility.SERIALIZE_STORAGE_INTERNAL);
            rebuilder.addObject(obj);
            return true;
        } catch (Exception e) {
View Full Code Here

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

        m_inExt = inExt;
        m_outExt = outExt;
    }

    private boolean convert(InputStream source, OutputStream destination) {
        DigitalObject obj = new BasicDigitalObject();
        try {
            m_deserializer.deserialize(source,
                                       obj,
                                       ENCODING,
                                       DOTranslationUtility.AS_IS);
View Full Code Here

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

    // Tests
    //---

    @Test
    public void testOBJIDAttribute() throws TransformerException, XpathException {
        DigitalObject obj = createTestObject(FEDORA_OBJECT_3_0);
        Document xml = doSerializeOrFail(obj);
        assertXpathExists(ROOT_PATH + "[@OBJID='" + TEST_PID + "']", xml);
    }
View Full Code Here

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

    //    assertXpathExists(ROOT_PATH + "[@TYPE='"
    //            + MODEL.SERVICE_DEFINITION_OBJECT.localName + "']", xml);
    //}
    @Test
    public void testNoDatastreams() throws TransformerException, XpathException {
        DigitalObject obj = createTestObject(FEDORA_OBJECT_3_0);
        Document xml = doSerializeOrFail(obj);

        /* rels-ext */
        assertXpathEvaluatesTo("1", "count(" + AMDSEC_PATH + ")", xml);
    }
View Full Code Here

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

        assertXpathEvaluatesTo("1", "count(" + AMDSEC_PATH + ")", xml);
    }

    @Test
    public void testTwoInlineDatastreams() throws TransformerException, XpathException, XPathExpressionException {
        DigitalObject obj = createTestObject(FEDORA_OBJECT_3_0);

        final String dsID1 = "DS1";
        DatastreamXMLMetadata ds1 = createXDatastream(dsID1);

        final String dsID2 = "DS2";
        DatastreamXMLMetadata ds2 = createXDatastream(dsID2);

        obj.addDatastreamVersion(ds1, true);
        obj.addDatastreamVersion(ds2, true);
        Document xml = doSerializeOrFail(obj);
       
        assertXpathEvaluatesTo("3", "count(" + AMDSEC_PATH + ")", xml);
    }
View Full Code Here

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

       
        assertXpathEvaluatesTo("3", "count(" + AMDSEC_PATH + ")", xml);
    }
    @Test
    public void testTwoDataStreamsVersion() throws TransformerException, XpathException, XPathExpressionException {
        DigitalObject obj = createTestObject(FEDORA_OBJECT_3_0);

        final String dsID1 = "DS1";
        final String dsID2 = "DS2";
        // hugely randomly generated test data
        DatastreamManagedContent ds1 = createMDatastream(dsID1, "aölksdiudshfljdsfnalj mdscmjlfjaö nsaölkjfsölkjfsöldkjfaöslfjasödflaöl".getBytes());
        DatastreamManagedContent ds2 = createMDatastream(dsID2, "älkfddöslfjsölkfjäaoiam,yjöoicncäaskcäaäöl kf,jvdhfkjh".getBytes());


        obj.addDatastreamVersion(ds1, true);
        obj.addDatastreamVersion(ds2, true);
        Document xml = doSerializeOrFail(obj);

        // was unable to do this with assertXpathsNotEqual() method
        // therefore do the assertions by xpath manually
        XPath xp = XPathFactory.newInstance().newXPath();
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.