Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.Property


     * {@inheritDoc}
     * @see eu.planets_project.services.characterise.Characterise#listProperties(java.net.URI)
     */
    public List<Property> listProperties(URI format) {
        List<Property> props = new ArrayList<Property>();
        props.add( new Property( makePropertyURI(MIME_PROP_URI), MIME_PROP_URI, null) );
        return props;
    }
View Full Code Here


        // Set up property list:
        List<Property> measured = new ArrayList<Property>();
        ServiceReport sr = new ServiceReport(Type.INFO, Status.SUCCESS, "Nothing checked");
       
        // Attempt to measure size:
        measured.add( new Property( makePropertyURI(MIME_PROP_URI), MIME_PROP_URI, ""+DigitalObjectUtils.getContentSize( digitalObject ) ));

        return new CharacteriseResult(measured, sr);
    }
View Full Code Here

            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

     * @param candidate The service description to check access rights for
     * @return True, if access to the candidate is either unrestricted or the user is logged in via UI and authorized to
     *         see the description
     */
    static boolean authorized(final ServiceDescription candidate) {
        Property allowedRolesProperty = getProperty(ServiceDescription.AUTHORIZED_ROLES, candidate);
        if (allowedRolesProperty == null) {
            /* No access restriction in this service description: */
            return true;
        }
        /* Check the authorization for this description based on the UI authentication: */
        FacesContext context = FacesContext.getCurrentInstance();
        if (context != null && context.getExternalContext() != null) {
            String allowedRoles = allowedRolesProperty.getValue();
            String[] roles = allowedRoles.split(",");
            for (String role : roles) {
                role = role.trim();
                boolean userInRole = context.getExternalContext().isUserInRole(role);
                if (userInRole) {
View Full Code Here

       
        //add the extracted information
    for(String value : extractedInformation){
        MeasurementImpl m = new MeasurementImpl();
        String actionIdentifier = WorkflowResultItem.SERVICE_ACTION_IDENTIFICATION;
          Property p = new Property.Builder(helperCreatePropertyURI(actionIdentifier)).value(value).description("Planets "+actionIdentifier+" Service Operation Result").name(actionIdentifier).build();
        m.setProperty(p);
          //m.setMeasurementType( MeasurementType.DOB);
          m.setTarget(target);
          execStageRec.addMeasurement(m);
      }
View Full Code Here

        if(aboutObjects.size()>0)
          target.setDigitalObjects(aboutObjects);
       
        URI execStartURI = URI.create("planets://workflow/service/execution/start");
        URI execEndURI = URI.create("planets://workflow/service/execution/end");
        Property pStart = new Property.Builder(execStartURI).value(start+"").description("Planets Service Wrapper Execution start-time measured in milli-seconds").name("service execution start time").build();
        Property pEnd = new Property.Builder(execEndURI).value(end+"").description("Planets Service Wrapper Execution end-time measured in milli-seconds").name("service execution end time").build();
      
        MeasurementImpl mStart = new MeasurementImpl();
        //mStart.setMeasurementType( MeasurementType.SERVICE); 
        mStart.setProperty(pStart);
        mStart.setTarget(target);
View Full Code Here

     
      //add the extracted information
    for(String value : extractedInformation){
        MeasurementImpl m = new MeasurementImpl();
        String actionIdentifier = WorkflowResultItem.SERVICE_ACTION_COMPARE;
          Property p = new Property.Builder(helperCreatePropertyURI(actionIdentifier)).value(value).description("Planets "+actionIdentifier+" Service Operation Result").name(actionIdentifier).build();
        m.setProperty(p);
          //m.setMeasurementType( MeasurementType.DOB);
          m.setTarget(target);
          execStageRec.addMeasurement(m);
      }
View Full Code Here

        CompareResult ir = ids.compare( o1, o2, null);
       
        /* Check the result */
        Boolean foundIdentical = null;
        for( PropertyComparison pc : ir.getComparisons() ) {
            Property p = pc.getComparison();
//            System.out.println("Recieved property: " + p );
            if( p != null && JavaImageIOCompare.PSNR_URI.equals(p.getUri())) {
                System.out.println(p.getName()+" = "+p.getValue()+" ["+p.getUnit()+"]");
                double psnr = Double.parseDouble(p.getValue());
                if( Double.isInfinite(psnr) ) {
                    foundIdentical = true;
                } else {
                    foundIdentical = false;
                }
View Full Code Here

   * Create an identification event.
   * @return The created event
   */
  public Event buildEvent(URI format){
    List<Property> pList = new ArrayList<Property>();
    Property pIdentificationContent = new Property.Builder(URI.create(FORMAT_EVENT_TYPE))
          .name("content by reference")
          .value(format.toString())
          .description("This is a format for initial document identified by identification service")
          .unit("URI")
          .type("digital object format")
View Full Code Here

   * Create an event.
   * @return The created event
   */
  public Event buildEvent(URI ref, String eventType){
    List<Property> pList = new ArrayList<Property>();
    Property pIdentificationContent = new Property.Builder(URI.create(INITIAL_REF_EVENT_TYPE))
          .name("Reference to the initial document")
          .value(ref.toString())
          .description("This is a link to original document")
          .unit("URI")
          .type("digital object migration")
View Full Code Here

TOP

Related Classes of eu.planets_project.services.datatypes.Property

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.