Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.Event


   * @return res
   *         The found event for particular summary
   */
  public static Event getEventBySummary(DigitalObject initObj, String summary)
  {
    Event res = null;
   
    if (summary != null && initObj != null)
    {   
      // search for the right event
      for(Event event : initObj.getEvents())
View Full Code Here


                  int index = 0;
              while(iter.hasNext())
              {
                      TreeNode eventNode = addNodeExt(
                          eventsNode, ModelConfiguration.DigitalObjectModel.EventsList.EVENT.name(), index);
                Event eventObj = iter.next();
                try
                {
                          if (eventObj.getDatetime() != null) {
                            addNode(eventNode, ModelConfiguration.DigitalObjectModel.EventsList.Event.DATETIME.name(), eventObj.getDatetime());
                          }
                          if (eventObj.getSummary() != null) {
                            addNode(eventNode, ModelConfiguration.DigitalObjectModel.EventsList.Event.SUMMARY.name(), eventObj.getSummary());
                          }
                          if (eventObj.getDuration() >= 0) {
                            addNode(eventNode, ModelConfiguration.DigitalObjectModel.EventsList.Event.DURATION.name(), String.valueOf(eventObj.getDuration()));
                          }
                          describeAgent(eventNode, eventObj);
                          describeProperties(eventNode, eventObj);
                } catch (Exception e)
                {
View Full Code Here

              while(iter.hasNext())
              {
                      TreeNode eventNode = addNodeExt(eventsNode,
                          ModelConfiguration.PremisModel.LinkingEventIdentifier.LINKING_EVENT_IDENTIFIER.name(),
                          index);
                Event eventObj = iter.next();
                try
                {
                          TreeNode eventIdNode = addNode(eventNode,
                              ModelConfiguration.PremisModel.LinkingEventIdentifier.EventIdentifier.EVENT_IDENTIFIER.name());
                        if (eventObj.getSummary() != null) {
                          addNode(eventIdNode,
                              ModelConfiguration.PremisModel.LinkingEventIdentifier.EventIdentifier.EvnetId.EVENT_IDENTIFIER_TYPE.name(), "String");
                          addNode(eventIdNode,
                              ModelConfiguration.PremisModel.LinkingEventIdentifier.EventIdentifier.EvnetId.EVENT_IDENTIFIER_VALUE.name(), eventObj.getSummary());
                        }
                          if (eventObj.getDatetime() != null) {
                            addNode(eventNode,
                                ModelConfiguration.PremisModel.LinkingEventIdentifier.EventIdentifier.EVENT_DATETIME.name(), eventObj.getDatetime());
                          }
                          if (eventObj.getDuration() >= 0) {
                            addNode(eventNode,
                                ModelConfiguration.PremisModel.LinkingEventIdentifier.EventIdentifier.EVENT_DETAIL.name(), String.valueOf(eventObj.getDuration()));
                          }
                          describeLinkingAgentId(eventNode, eventObj);
                          describeLinkingObjIdentifier(eventNode, eventObj);
                } catch (Exception e)
                {
View Full Code Here

        for (int i=0; i<types.length; i++) {
          wfResultItem.addLogInfo("type[" + i + "]: " + types[i]);
        }     

        if (types[0] != null) {
            Event eIdentifyFormat = buildEvent(URI.create(types[0].toString()));
          dgoB = addEvent(dgoB, eIdentifyFormat, URI.create(types[0]));
             }
           }

      // Update digital object in JCR repository
View Full Code Here

          .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(
        IDENTIFY_EVENT, System.currentTimeMillis() + "", new Double(100),
        new Agent("JCR Repository v1.0", "The Planets Jackrabbit Content Repository", "planets://data/repository"),
        pList);
    return eIdentifyFormat;
  }
View Full Code Here

   
        if ((eventsList != null) && (eventsList.size() > 0))
        {
      while(iter.hasNext())
      {
        Event eventsObj = iter.next();
        try
        {
           storeEvent(eventsObj, currentNode);
        } catch (Exception e)
        {
View Full Code Here

           NodeIterator entries = currentNode.getNodes(DOJCRConstants.DOJCR_EVENTS);
          
           while (entries.hasNext())
           {
               Node node = entries.nextNode();
               Event eventObj = retrieveEvent(node);
               _retVal.add(eventObj);
           }

    } catch (Exception e)
    {
View Full Code Here

        for (int i=0; i<types.length; i++) {
          wfResultItem.addLogInfo("type[" + i + "]: " + types[i]);
        }     

        if (types[0] != null) {
            Event eIdentifyFormat = buildEvent(URI.create(types[0].toString()), IDENTIFY_EVENT);
          dgoB = addEvent(dgoB, eIdentifyFormat, URI.create(types[0]), false);
             }
           }

      // Update digital object in JCR repository
            wfResultItem.addLogInfo("STEP 3: Update digital object in JCR repository. initial digital object: " +
                dgoB.toString());
           dgoB = dodm.updateDigitalObject(dgoB, false);
           wfResultItem.addLogInfo("Completed update in JCR repository. result digital object: " + dgoB.toString());


     
      // Migration service
      DigitalObject dgoC = null;
          wfResultItem.addLogInfo("STEP 4: Starting migration");
          wfResultItem.addLogInfo("processingDigo.getPermanentUri(): " + processingDigo.getPermanentUri() +
              ", dgoB.getPermanentUri(): " + dgoB.getPermanentUri());
         
        DataRegistry dataRegistry = DataRegistryFactory.getDataRegistry();
        URI baseUri = DataRegistryFactory.createDataRegistryIdFromName(DOJCRConstants.REGISTRY_NAME);
      wfResultItem.addLogInfo("base URI: " + baseUri);
      URI resUri = URI.create(baseUri.toString() + dgoB.getPermanentUri().toString());
      wfResultItem.addLogInfo("resUri: " + resUri);

      URI dgoCRef = runMigration(migrate, resUri, true);
      wfResultItem.addLogInfo("Completed migration. URI: " + dgoCRef);
     
      // Add migration resulting text to metadata
      if (dgoCRef != null) {
        try {
          baseUri = new PDURI(dgoCRef.normalize()).formDataRegistryRootURI();
          wfResultItem.addLogInfo("migration base URI: " + baseUri);
     
          dgoC = dataRegistry.getDigitalObjectManager(baseUri).retrieve(dgoCRef)
          wfResultItem.addLogInfo("dgoC: " + dgoC.toString());
          if (dgoC != null && dgoB.getPermanentUri() != null) {
              Event eMigration = buildEvent(dgoB.getPermanentUri(), MIGRATE_EVENT);
            dgoC = addEvent(dgoC, eMigration, null, true);
               }

        } catch (Exception e) {
          wfResultItem.addLogInfo("migration error: " + e.getMessage());
View Full Code Here

   * @throws URISyntaxException
   */
    public Event retrieveEvent(Node node)
          throws ItemNotFoundException, RepositoryException, URISyntaxException
    {
      Event res = null;
      try {
        Property _propSummary = node.getProperty(DOJCRConstants.DOJCR_EVENTS_SUMMARY);
        Property _propDatetime = node.getProperty(DOJCRConstants.DOJCR_EVENTS_DATETIME);
        Property _propDuration = node.getProperty(DOJCRConstants.DOJCR_EVENTS_DURATION);
        Agent agentObj = retrieveAgent(node);
          List<eu.planets_project.services.datatypes.Property> propertyResList =
            retrievePropertyList(node);
        res = new Event
              ( _propSummary.getString()
              , _propDatetime.getString()
              , _propDuration.getDouble()
              , agentObj
              , propertyResList
              );
        res.toString();
      } catch (Exception e)
      {
        _log.log(Level.INFO, "retrieveEvent error: " + e.getMessage(), e);
      }
     
View Full Code Here

          .description("This is a link to original document")
          .unit("URI")
          .type("digital object migration")
          .build();
    pList.add(pIdentificationContent);
    Event eIdentifyFormat = new Event(
        eventType, System.currentTimeMillis() + "", new Double(100),
        new Agent("JCR Repository v1.0", "The Planets Jackrabbit Content Repository", "planets://data/repository"),
        pList);
    return eIdentifyFormat;
  }
View Full Code Here

TOP

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

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.