Package eu.planets_project.pp.plato.model

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


                "Vienna University of Technology");

        q.getProjectBasis().setDocumentTypes(
                "textdateien MIT �������, die der kevin alle selbst geschrieben hat :(");

        SampleObject rec1 = new SampleObject();
        rec1.setFullname("sample 1");
        rec1.setShortName("eins");
        rec1.getData().setData(byteStream.getBytes());

        q.getSampleRecordsDefinition().setSamplesDescription(
                "some test samples");

        q.getSampleRecordsDefinition().addRecord(rec1);

        SampleObject rec2 = new SampleObject();
        rec2.setFullname("sample number two");
        rec2.setShortName("zwo");
        rec2.getData().setData(byteStream.getBytes());

        q.getSampleRecordsDefinition().addRecord(rec2);

        Alternative alt1 = Alternative.createAlternative();
        alt1.setName("PDF/A ToolA");
View Full Code Here


            }

            @Override
            protected void renderResponse() throws Exception {

                SampleObject toDelete = (SampleObject)Contexts.getSessionContext().get("record");

                int allowRemove = Integer.parseInt(Contexts.getSessionContext().get("allowRemove").toString());

                assert toDelete.getId() == allowRemove;
            }

        }.run();

        new FacesRequest("") {
View Full Code Here

    /**
     * Adds a new record to the list of sample records in the project. This is a sample record
     * without data.
     */
    public String newRecord() {
        SampleObject newRecord = new SampleObject();

        selectedPlan.getSampleRecordsDefinition().addRecord(newRecord);
        // this SampleRecordsDefinition has been changed
        selectedPlan.getSampleRecordsDefinition().touch();

View Full Code Here

            return null;
        }

        changed = "true";
        SampleObject record = new SampleObject();
        String fullName = new File(sampleRecordToUpload.getFullname()).getName();
        record.setFullname(fullName);
        record.setShortName(record.getFullname().substring(0,Math.min(20,record.getFullname().length())));
        record.setContentType(sampleRecordToUpload.getContentType());
        selectedPlan.getSampleRecordsDefinition().addRecord(record);
       
        writeTempFile(sampleRecordToUpload, record);

        // identify format of newly uploaded records
        if (shouldCharacterise(record)) {
            identifyFormat(record);
//              describeInXcdl(record);
              characteriseFits(record);
        }
       
        // need to initialize jhove tree by upload of a new sample record
        if (record.getJhoveXMLString() == null || "".equals(record.getJhoveXMLString())) {
           record.setJhoveXMLString(jHoveAdaptor.describe(tempDigitalObjects.get(record)));
        }
       
        log.debug("Content-Type: " + sampleRecordToUpload.getContentType());
        log.debug("Size of Records Array: "
                + selectedPlan.getSampleRecordsDefinition().getRecords()
                        .size());
        log.debug("FileName: " + sampleRecordToUpload.getFullname());
        log.debug("Length of File: " + sampleRecordToUpload.getData().getSize());
        log.debug("added SampleObject: " + record.getFullname());
        log.debug("JHove initialized: " + (record.getJhoveXMLString() != null));
       
        sampleRecordToUpload.setData(new ByteStream());
       
        System.gc();
       
View Full Code Here

       
        if (! (object instanceof SampleObject))
            return;
        try {
           
            SampleObject rec = (SampleObject)object;
            identifiedRecord = rec;           
            possibleFormats.clear();
            possibleFormatsString = null;
           
            /**
             * DROID is used for file identification.
             */
            FormatIdentification ident = null;
           
            String filename = tempDigitalObjects.get(rec);
           
            if (filename == null || "".equals(filename)) {
                SampleObject rec2 = em.merge(rec);
                ident = DROIDIntegration.getInstance().identifyFormat(rec2.getData().getData(), rec2.getFullname());   
            } else {
                ident = DROIDIntegration.getInstance().identify(filename);
            }
           
            if (ident.getResult() == FormatIdentificationResult.ERROR) {
View Full Code Here

     * all the characteristics extracted from JhoveXMLString present in the record
     *
     */
    public String characteriseJHoveTree(Object object) {
        if(object instanceof SampleObject){
            SampleObject tmpRec = (SampleObject)object;
            if (tmpRec != null) {
                jhoveTree=jHoveAdaptor.digestString(tmpRec.getFullname(), tmpRec.getJhoveXMLString());
            }
        }
      
        return null;
    }
View Full Code Here

        if (fits == null) {
            log.debug("FITS is not available and needs to be reconfigured.");
            return null;
        }
        if(object instanceof SampleObject){
            SampleObject sample = (SampleObject)object;
            if (sample != null && sample.isDataExistent()) {
                try {
                    String fitsXML = null;
                    String filepath =  tempDigitalObjects.get(sample);
                    if ((filepath != null) && (!"".equals(filepath))) {
                        fitsXML = fits.characterise(new File(filepath));
                    } else {
                        SampleObject mergedObj = em.merge(sample);
                        writeTempFile(mergedObj, sample);
                        filepath =  tempDigitalObjects.get(sample);
                        fitsXML = fits.characterise(new File(filepath));
                    }
                    sample.setFitsXMLString(fitsXML);
View Full Code Here

            }

            @Override
            protected void renderResponse() throws Exception {

                SampleObject toDelete = (SampleObject)Contexts.getSessionContext().get("record");

                int allowRemove = Integer.parseInt(Contexts.getSessionContext().get("allowRemove").toString());

                assert toDelete.getId() == allowRemove;
            }

        }.run();

        new FacesRequest("") {
View Full Code Here

        // remove old results
        eInfo.getMeasurements().clear();
       
       
        // why does this expect an instance of SampleObject ??!!
        SampleObject r = new SampleObject();
        r.getData().setData(data);
        r.setFullname(filename);
       
        Measurement success = new Measurement();
        success.setProperty(new MeasurableProperty(new BooleanScale(), MigrationResult.MIGRES_SUCCESS));
        success.setValue(success.getProperty().getScale().createValue());
       
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);
            }
        }
       
        /*
         * 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

TOP

Related Classes of eu.planets_project.pp.plato.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.