Examples of MeasurementImpl


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

       
        // Record the endpoint of the service used for this stage.  FIXME Can this be done more automatically, from above?
        idStage.setEndpoint(serviceEndpoint);
       
        List<MeasurementImpl> recs = idStage.getMeasurements();
        recs.add(new MeasurementImpl(TecRegMockup.PROP_SERVICE_TIME, ""+((msAfter-msBefore)/1000.0) ));
       
        // Now record
        try {
            if( success && view.getViewURL() != null ) {
                recs.add( new MeasurementImpl( TecRegMockup.PROP_SERVICE_EXECUTION_SUCEEDED, "true"));
                collectCreateViewResults(recs, view, dob);
                wr.setMainEndpoint(serviceEndpoint);
                wr.setResult(view);
                wr.setResultType( WorkflowResult.RESULT_CREATEVIEW_RESULT );
                return wr;
            }
        } catch( Exception e ) {
            exceptionReport += "<p>Failed with exception: "+e+"</p>";
        }

        // Build in a 'service failed' property.
        recs.add( new MeasurementImpl( TecRegMockup.PROP_SERVICE_EXECUTION_SUCEEDED, "false"));

        // Create a ServiceReport from the exception.
        // TODO can we distinguish tool and install error here?
        ServiceReport sr = new ServiceReport(Type.ERROR, Status.TOOL_ERROR,
                "No info");
View Full Code Here

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

    }
   
    public static void collectCreateViewResults( List<MeasurementImpl> recs, CreateViewResult ident, DigitalObject dob ) {
        // Store the size:
        // FIXME: This method has now been added to the Digital Object.  Change it here to dob.getContentSize();
        recs.add( new MeasurementImpl(TecRegMockup.PROP_DO_SIZE, ""+IdentifyWorkflow.getContentSize(dob) ) );
        return;
    }
View Full Code Here

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

      //finally add the MeasurementInfo data (name, description, for the propertyID etc.
      if(manualProps){
        OntologyProperty ontop = OntologyHandlerImpl.getInstance().getProperty(propertyID);
        //create a MeasurementImpl from the OntologyProperty
        try {
          MeasurementImpl measurementinfo = OntoPropertyUtil.createMeasurementFromOntologyProperty(ontop);
          resBean.setMeasurementInfo(measurementinfo);
        } catch (Exception e) {
          log.debug("Could not retrieve Ontology Property information for propertyID: "+propertyID);
        }
      }
View Full Code Here

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

      //3.finally add the MeasurementInfo data (name, description, for the propertyID etc.
      if(manualProps){
        OntologyProperty ontop = OntologyHandlerImpl.getInstance().getProperty(propertyID);
        //create a MeasurementImpl from the OntologyProperty
        try {
          MeasurementImpl measurementinfo = OntoPropertyUtil.createMeasurementFromOntologyProperty(ontop);
          evalPropResBean.setMeasurementInfo(measurementinfo);
        } catch (Exception e) {
          log.debug("Could not retrieve Ontology Property information for propertyID: "+propertyID);
        }
      }
      else{
        //TODO: still need to request this information from the workflow authority
        MeasurementImpl measurementinfo = helperQueryAutoMeasurementAuthority(propertyID);
        evalPropResBean.setMeasurementInfo(measurementinfo);
      }
     
      //Finally: check requirements if to add this evalProp item
      //if(checkIfToAddEvaluationPropertyBean(evalPropResBean,comparedStageNames)){
View Full Code Here

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

          for(ExecutionRecordImpl execRec : batchr.getRuns()){
            for(ExecutionStageRecordImpl stage : execRec.getStages()){
              Vector<MeasurementImpl> propIDs = new Vector<MeasurementImpl>();
              for(MeasurementImpl measurement : stage.getMeasuredObservables()){
                //copy to avaid any cross refs and add copy for authority
                MeasurementImpl m = measurement.clone();
                propIDs.add(m);
              }
              ret.put(stage.getStage(), propIDs);
            }
          }
View Full Code Here

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

        for( int i = 0; i < nodes.getLength(); i++ ) {
            Node n = nodes.item(i);
            String name = (String) xpath.evaluate( "./name", n,  XPathConstants.STRING);
            String id = (String) xpath.evaluate( "./name/@id", n,  XPathConstants.STRING);
            // Loop through the property definitions and patch them into Property objects.
            MeasurementImpl m = new MeasurementImpl(
                    makePropertyUri(id, name),
                    (String) xpath.evaluate( "./valueSet/labValue/val", n,  XPathConstants.STRING)
                    );
            // FIXME Unify this construction: See also XCDLService.createPropertyFromFFProp
//            m.setType( "xcdl:" + (String) xpath.evaluate( "./valueSet/labValue/type", n,  XPathConstants.STRING) );
View Full Code Here

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

    /**
     * @param observable
     * @return
     */
    public static MeasurementImpl getObservable( URI observable ) {
        return new MeasurementImpl(null, observables.get(observable));
    }
View Full Code Here

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

     */
    private void fillComparisonEvent(MeasurementEventImpl me, Compare chr, CompareResult cr) {
        me.setAgent(new MeasurementAgent(chr.describe()));
        me.setDate(Calendar.getInstance());
        for( PropertyComparison pc : cr.getComparisons() ) {
            MeasurementImpl m = new MeasurementImpl( me, pc.getComparison());
            MeasurementTarget mt = new MeasurementTarget();
            mt.setType(TargetType.DIGITAL_OBJECT_PAIR);
            // Get data on the first object:
            mt.getDigitalObjects().add(0, this.getDobUri1() );
            mt.setDigitalObjectProperties(0, pc.getFirstProperties());
            log.info("Got PC1: "+pc.getFirstProperties());
            // Get data on the second object:
            mt.getDigitalObjects().add(1, this.getDobUri2() );
            mt.setDigitalObjectProperties(1, pc.getSecondProperties());
            log.info("Got PC2: "+pc.getSecondProperties());
            // Add to the measurement:
            m.setTarget( mt );
            // Equivalence Data:
            m.setEquivalence(pc.getEquivalence());
            me.addMeasurement(m);
        }
    }
View Full Code Here

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

        this.recordIdentifyMeasurement(me, ir2, dobUri2);
    }

    private void recordIdentifyMeasurement( MeasurementEventImpl me, IdentifyResult ir, String dob ) {
        for( URI fmt : ir.getTypes() ) {
            MeasurementImpl m = new MeasurementImpl(IdentifyWorkflow.MEASURE_IDENTIFY_FORMAT);
            m.setValue(fmt.toASCIIString());
            m.setTarget( new MeasurementTarget() );
            m.getTarget().setType(TargetType.DIGITAL_OBJECT);
            m.getTarget().getDigitalObjects().add( dob );
            me.addMeasurement(m);

        }
        // Also record the method:
        if( ir.getMethod() != null ) {
            MeasurementImpl m = new MeasurementImpl(IdentifyWorkflow.MEASURE_IDENTIFY_METHOD);
            m.setValue(ir.getMethod().name());
            m.setTarget( new MeasurementTarget() );
            m.getTarget().setType(TargetType.DIGITAL_OBJECT);
            m.getTarget().getDigitalObjects().add( dob );
            me.addMeasurement(m);
        }
    }
View Full Code Here

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

        this.recordPropertyMeasurements(me, properties2, dobUri2);
    }

    private void recordPropertyMeasurements( MeasurementEventImpl me, List<Property> props, String dob ) {
        for( Property p : props ) {
            MeasurementImpl m = new MeasurementImpl(me,p);
            m.setTarget( new MeasurementTarget() );
            m.getTarget().setType(TargetType.DIGITAL_OBJECT);
            m.getTarget().getDigitalObjects().add(dob);
            me.addMeasurement(m);
        }
    }
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.