Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.Property


   * @return
   */
  public Event buildIngestEvent(boolean isIncludeContent){
    //create the ingest event
    List<Property> pList = new ArrayList<Property>();
    Property pIngestContent = new Property.Builder(URI.create("planets://data/repository/jcr/contentByReference"))
          .name("content by reference")
          .value(new Boolean(isIncludeContent).toString())
          .description("This flag is true if content should be stored in JCR and false if not")
          .unit("boolean")
          .type("repository characteristic")
View Full Code Here


   * Create an event.
   * @return The created event
   */
  public Event buildEvent(URI ref){
    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

  assertEquals(
    "Un-expected number of properties in service description.", 1,
    properties.size());

  final Property property = properties.get(0);
  final String expectedDescription = "This is an optional description of"
    + " an example property with a value\n                    and "
    + "a silly value unit specification.";
  assertEquals("Un-expected property description.", expectedDescription,
    property.getDescription());
  assertEquals("Un-expected property name.", "exampleName", property
    .getName());
  assertEquals("Un-expected property type.", "myOptionalExampleType",
    property.getType());
  assertEquals("Un-expected property ID.", new URI("info:exampleID"),
    property.getUri());
  assertEquals("Un-expected property value unit.", "cubic gram", property
    .getUnit());
  assertEquals("Un-expected ", "exampleValue with a ridiculous unit.",
    property.getValue());
    }
View Full Code Here

                  int index = 0;
                  while(iter.hasNext())
              {
                      TreeNode propertyNode = addNodeExt(propertiesNode,
                          ModelConfiguration.DigitalObjectModel.EventsList.Event.PropertiesList.PROPERTY.name(), index);
                Property propertyObj = iter.next();
                try
                {
                          if (propertyObj.getUri() != null) {
                            addNode(propertyNode,
                              ModelConfiguration.DigitalObjectModel.EventsList.Event.PropertiesList.Property.URI.name(), propertyObj.getUri().toString());
                          }
                          if (propertyObj.getName() != null) {
                            addNode(propertyNode,
                              ModelConfiguration.DigitalObjectModel.EventsList.Event.PropertiesList.Property.NAME.name(), propertyObj.getName());
                          }
                          if (propertyObj.getValue() != null) {
                            addNode(propertyNode,
                              ModelConfiguration.DigitalObjectModel.EventsList.Event.PropertiesList.Property.VALUE.name(), propertyObj.getValue());
                          }
                          if (propertyObj.getDescription() != null) {
                            addNode(propertyNode,
                              ModelConfiguration.DigitalObjectModel.EventsList.Event.PropertiesList.Property.DESCRIPTION.name(), propertyObj.getDescription());
                          }
                          if (propertyObj.getUnit() != null) {
                            addNode(propertyNode,
                              ModelConfiguration.DigitalObjectModel.EventsList.Event.PropertiesList.Property.UNIT.name(), propertyObj.getUnit());
                          }
                          if (propertyObj.getType() != null) {
                            addNode(propertyNode,
                              ModelConfiguration.DigitalObjectModel.EventsList.Event.PropertiesList.Property.TYPE.name(), propertyObj.getType());
                          }
                } catch (Exception e)
                {
                  log.log(Level.INFO, "propertyList error: " + e.getMessage(), e);
                }
View Full Code Here

                  TreeNode propertiesNode = addNode(eventNode,
                      ModelConfiguration.PremisModel.LinkingEventIdentifier.EventIdentifier.LINKING_OBJECT_IDENTIFIER.name());
                  int index = 0;
                  while(iter.hasNext())
              {
                Property propertyObj = iter.next();
                try
                {                         
                          if (propertyObj.getType() != null) {
                            addNode(propertiesNode,
                              ModelConfiguration.PremisModel.LinkingEventIdentifier.EventIdentifier.LinkingObjectIdentifier.TYPE.name(), "URI");
                          }
                          if (propertyObj.getValue() != null) {
                            addNode(propertiesNode,
                              ModelConfiguration.PremisModel.LinkingEventIdentifier.EventIdentifier.LinkingObjectIdentifier.VALUE.name(), propertyObj.getValue());
                          }
                } catch (Exception e)
                {
                  log.log(Level.INFO, "propertyList error: " + e.getMessage(), e);
                }
View Full Code Here

          wfResultItem.addLogInfo("type[" + i + "]: " + types[i]);
        }     

        if (types[0] != null) {
            List<Property> pList = new ArrayList<Property>();
            Property pIdentificationContent = new Property.Builder(URI.create("Identify"))
                  .name("content by reference")
                  .value(types[0].toString())
                  .description("This is a format for initial document identified by identification service")
                  .unit("URI")
                  .type("digital object format")
                  .build();
            pList.add(pIdentificationContent);
            Event eIdentifyFormat = new Event(
                IDENTIFICATION_EVENT, System.currentTimeMillis() + "", new Double(DURATION),
                new Agent("http://testbed-dev.planets-project.ait.ac.at:80/pserv-pc-droid/Droid?wsdl"
                    , identify.NAME, identify.QNAME.toString()),
                pList);
          dgoB = addEvent(dgoB, eIdentifyFormat, URI.create(types[0]));
         
          List<Property> pMigrationList = new ArrayList<Property>();
          Property pMigrationContent = new Property.Builder(URI.create("Migrate"))
                .name("content by reference")
                .value(types[0].toString())
                .description("This is a migration event")
                .unit("URI")
                .type("digital object format")
                .build();
          pMigrationList.add(pMigrationContent);
            Event eMigration = new Event(
                MIGRATION_EVENT, System.currentTimeMillis() + "", new Double(DURATION),
                new Agent(migrationEndpoint, migrate.NAME, migrate.QNAME.toString()),
                pMigrationList);
          dgoB = addEvent(dgoB, eMigration, null);
         
               // add create SIP event
          List<Property> pSipList = new ArrayList<Property>();
          Property pSipContent = new Property.Builder(URI.create("CreateSIP"))
                .name("SIP message")
                .value(types[0].toString())
                .description("This is a SIP message creation")
                .unit("file")
                .type("ZIP format")
View Full Code Here

            list = null;
        }
        List<Property> mprops = new Vector<Property>();
        if( list != null ) {
            for( MeasurementImpl m : list ) {
                Property p;
                try {
                    p = new Property( new URI( m.getIdentifier()), m.getIdentifier(), m.getValue() );
                    mprops.add(p);
                } catch (URISyntaxException e) {
                    e.printStackTrace();
                }
            }
View Full Code Here

          return ret;
        }
      for(Property p : in){
          if(p.getValue().length()>500){
            //add a truncated value String
            ret.add(new Property(p.getUri(),p.getName(),p.getValue().substring(0, 500)+"[..]"));
          }else{
            //add the original result
            ret.add(p);
          }
        }
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.dobUri1, this.newManVal1 );
        DigitalObjectCompare.createMeasurement(mev, p, this.dobUri2, this.newManVal2 );
        ExperimentInspector.persistExperiment();
    }
View Full Code Here

     * @param size
     */
    private void testSizing(DigitalObject object, int size) {
        /* Init the properties */
        List<Property> properties = new ArrayList<Property>();
        properties.add( new Property(
                SimpleCharacterisationService.makePropertyURI( SimpleCharacterisationService.MIME_PROP_URI),
                SimpleCharacterisationService.MIME_PROP_URI,
                null
                ) );
       
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.