Package eu.scape_project.planning.model

Examples of eu.scape_project.planning.model.SampleObject


        experiment.setDescription("Description");
        experiment.setSettings("Settings");
        experiment.setWorkflow(generateDigitalObject());

        Map<SampleObject, DetailedExperimentInfo> detailedInfo = experiment.getDetailedInfo();
        SampleObject sample1 = new SampleObject("Short name");
        DetailedExperimentInfo experimentInfo1 = new DetailedExperimentInfo();
        experimentInfo1.setSuccessful(true);
        experimentInfo1.setCpr("Cpr");
        experimentInfo1.setProgramOutput("Program output");
        experimentInfo1.getMeasurements().put("key", new Measurement("Measure id", "Value"));
View Full Code Here


    }

    private SampleObject parseSample(Element sample) {

        String uid = sample.attributeValue("uid");
        SampleObject sampleObject = new SampleObject(uid);
        sampleObject.setFullname(uid);
        List<Element> mimes = new ArrayList<Element>();
        List<Element> size = new ArrayList<Element>();
        List<Element> records = sample.elements("record");

        for (Element rec : records) {
            if (rec.attributeValue("name").equals("mimetype")) {
                mimes.add(rec);
            }

            if (rec.attributeValue("name").equals("size")) {
                size.add(rec);
            }
        }

        if (mimes.size() > 1) {
            sampleObject.setContentType("Conflict");
        } else if (mimes.size() == 1) {
            Element mimetype = (Element) mimes.get(0);
            sampleObject.setContentType(mimetype.attributeValue("value"));
        }

        if (size.size() == 1) {
            Element s = (Element) size.get(0);
            sampleObject.setSizeInBytes(Long.parseLong(s.attributeValue("value")));
        }

        FormatInfo info = this.getFormatInfo(sample, sampleObject.getContentType());
        sampleObject.setFormatInfo(info);

        return sampleObject;
    }
View Full Code Here

TOP

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

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.