Package eu.scape_project.planning.model

Examples of eu.scape_project.planning.model.DigitalObject


     * Generates a digital object.
     *
     * @return the digital object
     */
    private DigitalObject generateDigitalObject() {
        DigitalObject d = new DigitalObject();
        d.setContentType("application/vnd.taverna.t2flow+xml");
        d.setFullname("workflow.t2flow");
        d.setPid("pid-experiment-workflow");

        ByteStream bs = new ByteStream();
        bs.setData("workflowdata".getBytes());
        d.setData(bs);

        return d;
    }
View Full Code Here


            if (counter > LOADED_DATA_SIZE_BOUNDARY) { // Call GC if unused data
                                                       // exceeds boundary
                System.gc();
                counter = 0;
            }
            DigitalObject object = em.find(DigitalObject.class, id);
            if (object.isDataExistent()) {
                counter += object.getData().getSize();
                File f = new File(tempDir + object.getId() + ".xml");
                DigitalObject dataFilledObject = digitalObjectManager.getCopyOfDataFilledDigitalObject(object);
                FileOutputStream out = new FileOutputStream(f);
                try {
                    out.write(dataFilledObject.getData().getData());
                } finally {
                    out.close();
                }
                dataFilledObject = null;
            } else {
View Full Code Here

            if (counter > LOADED_DATA_SIZE_BOUNDARY) { // Call GC if unused data
                                                       // exceeds boundary
                System.gc();
                counter = 0;
            }
            DigitalObject object = em.find(DigitalObject.class, id);
            if (object.isDataExistent()) {
                counter += object.getData().getSize();
                File f = new File(aTempDir + object.getId() + ".xml");
                DigitalObject dataFilledObject = null;
                dataFilledObject = digitalObjectManager.getCopyOfDataFilledDigitalObject(object);
                writeBinaryData(id, new ByteArrayInputStream(dataFilledObject.getData().getData()), f);
                dataFilledObject = null;
            } else {
                skip++;
            }
            object = null;
View Full Code Here

         * map sample records to uploads and their xcdlDescriptions, if present
         */
        for (String key : tempUploads.keySet()) {
            SampleObject rec = records.get(key);
            if (rec != null) {
                DigitalObject result = tempUploads.get(key);
                getResults().put(rec, result);
            }
        }

        /*
 
View Full Code Here

            // p.getSampleRecordsDefinition().getCollectionProfile().getCollectionID());

            // Objects
            Element objects = parent.addElement("objects");

            DigitalObject profileObject = collectionProfile.getProfile();
            try {
                if (profileObject != null && profileObject.isDataExistent()) {

                    if (!addDigitalObjectData) {
                        objects.setText(String.valueOf(profileObject.getId()));
                    } else {

                        if (profileObject.getData().getData() == null || profileObject.getData().getData().length == 0) {
                            profileObject = digitalObjectManager.getCopyOfDataFilledDigitalObject(profileObject);
                        }

                        C3POProfileParser parser = new C3POProfileParser();
                        parser.read(new ByteArrayInputStream(profileObject.getData().getData()), false);

                        List<String> objectIdentifiers = parser.getObjectIdentifiers();

                        for (String objectIdentifier : objectIdentifiers) {
                            objects.addElement("object").addAttribute("uid", objectIdentifier);
View Full Code Here

            if (!addDigitalObjectData) {
                // Add only DigitalObject ID, it can be replaced later
                executablePlan.setText(String.valueOf(t2flow.getId()));
            } else {
                DigitalObject t2flowObject = t2flow;
                try {
                    if (t2flowObject.getData().getData() == null || t2flowObject.getData().getData().length == 0) {
                        t2flowObject = digitalObjectManager.getCopyOfDataFilledDigitalObject(t2flowObject);
                    }
                    T2FlowParser parser = T2FlowParser.createParser(new ByteArrayInputStream(t2flowObject.getData()
                        .getData()));
                    Document doc = parser.getDoc();
                    executablePlan.add(doc.getRootElement());
                } finally {
                    t2flowObject = null;
View Full Code Here

            facesMessages.addError("The uploaded file is not a Freemind file.");
            return;
        }

        // Put file-data into a digital object
        DigitalObject importFile = new DigitalObject();
        importFile.setFullname(filename);
        importFile.getData().setData(file.getData());
        importFile.setContentType(file.getContentType());

        boolean importSuccessful = manageCriteriaSets.importCriteriaHierarchyFromFreemind(importFile);

        if (importSuccessful) {
            facesMessages.addInfo("Criteria set imported successfully");
View Full Code Here

        // retrieved bytestream would be put into the current object tree
        // (originating from plan)
        // which would fill up the memory. Because we do not want this - we
        // create a standalone DigitalObject which is cleaned up by garbage
        // collector after its usage.
        DigitalObject copyObject = object.clone();
        copyObject.setData(digitalObjectByteStream);
        return copyObject;
    }
View Full Code Here

        log.debug("Persisting plan " + entity.getClass().getName());
       
        plan.getPlanProperties().setState(currentState);

        if (plan.getPlanProperties().getReportUpload().isDataExistent()) {
            plan.getPlanProperties().setReportUpload(new DigitalObject());

            String msg = "Please consider that because data underlying the preservation plan has been changed, the uploaded report was automatically removed. ";
            msg += "If you would like to make the updated report available, please generate it again and upload it in 'Plan Settings'.";
            facesMessages.addInfo(msg);
        }
View Full Code Here

TOP

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

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.