Package eu.planets_project.tb.impl.model.measure

Examples of eu.planets_project.tb.impl.model.measure.MeasurementEventImpl


    /**
     * @return
     */
    public MeasurementEventImpl getManualMeasurementEvent() {
        MeasurementEventImpl me = null;
        ExecutionRecordImpl res = this.getExecutionRecordForSessionId();
        if( res == null ) return null;
        Set<MeasurementEventImpl> measurementEvents = res.getMeasurementEvents();
        for( MeasurementEventImpl mee : measurementEvents ) {
            if( mee.getAgent() != null && mee.getAgent().getType() == AgentType.USER ) {
                me = mee;
            }
        }
        // If none, create one and pass it back.
        if( me == null ) {
            log.info("Creating Manual Measurement Event.");
            me = new MeasurementEventImpl(res);
            res.getMeasurementEvents().add(me);
            UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
            me.setAgent( new MeasurementAgent( user ));
            ExperimentPersistencyImpl.getInstance();
            ExperimentInspector.persistExperiment();
        }
        me.getMeasurements();
        return me;
    }
View Full Code Here


        if( mp == null ) {
            log.error("No property ["+mmbb.getNewManProp()+"] found!");
            return;
        }
        // Lookup the event:
        MeasurementEventImpl mev = this.getManualMeasurementEvent();
        // Make the property
        Property p = new Property.Builder( URI.create(mp.getURI()) ).description(mp.getDescription()).name(mp.getName()).build();
        DigitalObjectCompare.createMeasurement(mev, p, this.sessionId, this.newManVal );
        ExperimentInspector.persistExperiment();
    }
View Full Code Here

   
    /**
     * @return
     */
    public MeasuredComparisonEventBean getManualMeasurementEventBean() {
        MeasurementEventImpl me = this.getManualMeasurementEvent();
        MeasuredComparisonEventBean meb = new MeasuredComparisonEventBean( me, this.getDobUri1(), this.getDobUri2() );
        return meb;
    }
View Full Code Here

   
    /**
     * @return
     */
    private MeasurementEventImpl getManualMeasurementEvent() {
        MeasurementEventImpl me = null;
        ResultsForDigitalObjectBean res = new ResultsForDigitalObjectBean(this.getDobUri1());
        if( res == null || res.getExecutionRecord() == null ) return null;
        Set<MeasurementEventImpl> measurementEvents = res.getExecutionRecord().getMeasurementEvents();
        for( MeasurementEventImpl mee : measurementEvents ) {
            if( mee.getAgent() != null && mee.getAgent().getType() == AgentType.USER ) {
                me = mee;
            }
        }
        // If none, create one and pass it back.
        if( me == null ) {
            log.info("Creating Manual Measurement Event.");
            me = this.createMeasurementEvent();
            UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
            me.setAgent( new MeasurementAgent( user ));
            ExperimentInspector.persistExperiment();
        }
        return me;
    }
View Full Code Here

        if( mp == null ) {
            log.error("No property ["+mmbb.getNewManProp()+"] found!");
            return;
        }
        // Lookup the event:
        MeasurementEventImpl mev = this.getManualMeasurementEvent();
        // Make the property
        Property p = new Property.Builder( URI.create(mp.getURI()) ).description(mp.getDescription()).name(mp.getName()).build();
        DigitalObjectCompare.createMeasurement(mev, p, this.dobUri1, this.newManVal1 );
        DigitalObjectCompare.createMeasurement(mev, p, this.dobUri2, this.newManVal2 );
        ExperimentInspector.persistExperiment();
View Full Code Here

     * @return
     */
    private MeasurementEventImpl createMeasurementEvent() {
        ResultsForDigitalObjectBean res = new ResultsForDigitalObjectBean(this.getDobUri1());
        // If there is no experiment, return a non-DB event:
        if( res == null ) return new MeasurementEventImpl((ExecutionRecordImpl)null);
        if( res.getExecutionRecord() == null ) return new MeasurementEventImpl((ExecutionRecordImpl)null);
       
        // Otherwise, create an event that is attached to the experiment:
        MeasurementEventImpl me = new MeasurementEventImpl(res.getExecutionRecord());
        res.getExecutionRecord().getMeasurementEvents().add(me);
        return me;
    }   
View Full Code Here

TOP

Related Classes of eu.planets_project.tb.impl.model.measure.MeasurementEventImpl

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.