Examples of SampleObject


Examples of eu.scape_project.planning.model.SampleObject

     * Determines if there is at least one sample with format info.
     *
     * @return true if a sample with format info is available
     */
    public boolean isMimetypeAvailable() {
        SampleObject sample = getSampleWithFormat();
        return isFormatInfoAvailable() && sample.getFormatInfo().getMimeType() != null
            && !"".equals(sample.getFormatInfo().getMimeType());
    }
View Full Code Here

Examples of eu.scape_project.planning.model.SampleObject

            setProgramOutputForAlternative(a, msg, false);
        }

        if (action instanceof IMigrationAction) {
            IMigrationAction migrationAction = (IMigrationAction) action;
            SampleObject record = experimentStatus.getNextSample();
            while (record != null) {
                if (record.isDataExistent()) {
                    MigrationResult migrationResult = null;

                    try {
                        DigitalObject workflow = a.getExperiment().getWorkflow();
                        if (workflow != null) {
View Full Code Here

Examples of eu.scape_project.planning.model.SampleObject

     * @param sampleObj
     *            Experiment sample object.
     */
    public void updateSelectedDetailedExperimentInfo(Object alt, Object sampleObj) {
        Alternative alternative = (Alternative) alt;
        SampleObject sampleObject = (SampleObject) sampleObj;

        selectedDetailedExperimentInfo = alternative.getExperiment().getDetailedInfo().get(sampleObject);
    }
View Full Code Here

Examples of eu.scape_project.planning.model.SampleObject

     * @param sampleObj
     *            SampleObject corresponding to the next file-upload.
     */
    public void updateDataForNextUpload(Object alt, Object sampleObj) {
        Alternative alternative = (Alternative) alt;
        SampleObject sampleObject = (SampleObject) sampleObj;

        alternativeForNextUpload = alternative;
        sampleObjectForNextUpload = sampleObject;
    }
View Full Code Here

Examples of eu.scape_project.planning.model.SampleObject

     * @param sampleObj
     *            SampleObject of the wanted result file.
     */
    public void downloadResultFile(Object alt, Object sampleObj) {
        Alternative alternative = (Alternative) alt;
        SampleObject sampleObject = (SampleObject) sampleObj;

        DigitalObject resultFile = null;

        try {
            resultFile = runExperiments.fetchResultFile(alternative, sampleObject);
        } catch (StorageException e) {
            log.error("Exception at trying to fetch result file for alternative " + alternative.getName()
                + "and sample " + sampleObject.getFullname(), e);
            facesMessages.addError("Unable to fetch result file. Please try again.");
        }

        if (resultFile != null) {
            downloader.download(resultFile);
        } else {
            log.debug("No result file exists for alternative " + alternative.getName() + " and sample "
                + sampleObject.getFullname() + ".");
        }
    }
View Full Code Here

Examples of eu.scape_project.planning.model.SampleObject

     * @param sampleObj
     *            Sample the file was uploaded for.
     */
    public void removeResultFile(Object alt, Object sampleObj) {
        Alternative alternative = (Alternative) alt;
        SampleObject sampleObject = (SampleObject) sampleObj;

        runExperiments.removeResultFile(alternative, sampleObject);
    }
View Full Code Here

Examples of eu.scape_project.planning.model.SampleObject

        samplesToRemove.clear();
    }

    public SampleObject addSample(String filename, String contentType, byte[] data) throws PlanningException {
        SampleObject sample = new SampleObject(filename);
        sample.setFullname(filename);
        sample.setContentType(contentType);

        ByteStream bsData = new ByteStream();
        bsData.setData(data);
        sample.setData(bsData);

        digitalObjectManager.moveDataToStorage(sample);
        addedBytestreams.add(sample.getPid());
        plan.getSampleRecordsDefinition().addRecord(sample);

        // identify format of newly uploaded samples
        if (shouldCharacterise(sample)) {
            characteriseFits(sample);
        }

        log.debug("Content-Type: " + sample.getContentType());
        log.debug("Size of samples Array: " + plan.getSampleRecordsDefinition().getRecords().size());
        log.debug("FileName: " + sample.getFullname());
        log.debug("Length of File: " + sample.getData().getSize());
        log.debug("added SampleObject: " + sample.getFullname());
        log.debug("JHove initialized: " + (sample.getJhoveXMLString() != null));

        return sample;
    }
View Full Code Here

Examples of eu.scape_project.planning.model.SampleObject

        /*
         * 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);
            }
        }

        /*
         * map sample records to detailedInfos
         */
        for (String key : tempDetailedInfos.keySet()) {
            SampleObject rec = records.get(key);
            if (rec != null) {
                getDetailedInfo().put(rec, tempDetailedInfos.get(key));
            }
        }

View Full Code Here

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

Examples of eu.scape_project.planning.model.SampleObject

    }

    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
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.