Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.Metadata


    
        // Extract relevant XML code and fill metadata
    try {
      String metadata = extractPageImageSection(xml);
      if (metadata != null)
        dob.metadata(new Metadata(new URI("application/xml"), metadata));
    } catch (URISyntaxException e) {
      throw new RuntimeException(e); // Should never happen
    } catch (IOException e) {
      throw new DigitalObjectNotFoundException(e);
    }
View Full Code Here


                    //So, format URI is null
                }
            } catch (FedoraConnectionException e) {
                throw new DigitalObjectNotFoundException(e);
            }
            metadata.add(new Metadata(formatURI,ds.getPlanetsName(),contents));
        }


        ContentdatastreamType filedatastream = planetsDatastreamObject.getContentdatastream();
        URL contenturl = null;
View Full Code Here

                  int index = 0;
              while(iterMeta.hasNext())
              {
                      TreeNode metadataNode = addNodeExt(metadatasNode,
                        ModelConfiguration.DigitalObjectModel.MetadataList.METADATA.name(), index);
                Metadata metadataObj = iterMeta.next();
                try
                {
                          if (metadataObj.getType() != null) {
                            addNode(metadataNode,
                              ModelConfiguration.DigitalObjectModel.MetadataList.Metadata.TYPE.name(), metadataObj.getType().toString());
                          }
                          if (metadataObj.getContent() != null) {
                            addNode(metadataNode,
                              ModelConfiguration.DigitalObjectModel.MetadataList.Metadata.CONTENT.name(), metadataObj.getContent());
                          }
                          if (metadataObj.getName() != null) {
                            addNode(metadataNode,
                              ModelConfiguration.DigitalObjectModel.MetadataList.Metadata.NAME.name(), metadataObj.getName());
                          }
                } catch (Exception e)
                {
                  log.log(Level.INFO, "metadataList error: " + e.getMessage(), e);
                }
View Full Code Here

              }
   
              br.close();
              String migrationResult = sb.toString();
                wfResultItem.addLogInfo("Migrated file contents: " + migrationResult);
            Metadata migrationMetadata = new Metadata(dgoA.getPermanentUri(), MIGRATION_METADATA, migrationResult);
            dgoA = addMetadata(dgoA, migrationMetadata);
        } catch (Exception e) {
          wfResultItem.addLogInfo("migration error: " + e.getMessage());
        }
      }
     
      // Insert in JCR repository
            wfResultItem.addLogInfo("STEP 3: Insert in JCR repository. initial digital object: " + dgoA.toString());
            // Manage the Digital Object Data Registry:
            wfResultItem.addLogInfo("Initialize JCR repository instance.");
            JcrDigitalObjectManagerImpl dodm =
               (JcrDigitalObjectManagerImpl) JcrDigitalObjectManagerImpl.getInstance();
            DigitalObject dgoB = dodm.store(PERMANENT_URI_PATH, dgoA, true);
           wfResultItem.addLogInfo("Completed storing in JCR repository: " + dgoB.toString());
          
           // Enrich digital object with metadata from characterization service
      Metadata characterisationMetadata = new Metadata(dgoB.getPermanentUri(), CHARACTERISATION_METADATA, "testdata");
      dgoB = addMetadata(dgoB, characterisationMetadata);

      // Update digital object in JCR repository
            wfResultItem.addLogInfo("STEP 4: Update digital object in JCR repository. initial digital object: " +
                dgoB.toString());
View Full Code Here

   
        if ((metadataList != null) && (metadataList.size() > 0))
        {
      while(iter.hasNext())
      {
        Metadata metadataObj = iter.next();
        try
        {
           storeMetadata(metadataObj, currentNode);
        } catch (Exception e)
        {
View Full Code Here

               }
               else
               {
                _log.log(Level.INFO, "retrieveMetadataList node is null");
               }
               Metadata metadataObj = retrieveMetadata(node);
               _retVal.add(metadataObj);
           }

    } catch (Exception e)
    {
View Full Code Here

     * @throws  RepositoryException
     * @throws  URISyntaxException
     */
    public Metadata retrieveMetadata(Node node) throws ItemNotFoundException,
      RepositoryException, URISyntaxException {
    Metadata _retVal = null;
    try {
      Property _propType = node
          .getProperty(DOJCRConstants.DOJCR_METADATA_TYPE);
      Property _propContent = node
          .getProperty(DOJCRConstants.DOJCR_METADATA_CONTENT);
      if (!node.hasProperty(DOJCRConstants.DOJCR_METADATA_NAME)) {
        _retVal = new Metadata(new URI(_propType.getString()),
            _propContent.getString());
      } else {
        Property _propName = node
            .getProperty(DOJCRConstants.DOJCR_METADATA_NAME);
        _retVal = new Metadata(new URI(_propType.getString()),
            _propName.getString(), _propContent.getString());
      }
      _retVal.toString();
    } catch (Exception e) {
      _log
          .log(Level.INFO, "retrieveMetadata error: "
              + e.getMessage(), e);
    }
View Full Code Here

                  int index = 0;
              while(iterMeta.hasNext())
              {
                      TreeNode metadataNode = addNodeExt(metadatasNode,
                        ModelConfiguration.PremisModel.DescriptiveMetadataList.DESCRIPTIVE_METADATA.name(), index);
                Metadata metadataObj = iterMeta.next();
                try
                {
                          if (metadataObj.getType() != null) {
                            addNode(metadataNode,
                              ModelConfiguration.PremisModel.DescriptiveMetadataList.DescriptiveMetadata.TYPE.name(), metadataObj.getType().toString());
                          }
                          if (metadataObj.getContent() != null) {
                            addNode(metadataNode,
                              ModelConfiguration.PremisModel.DescriptiveMetadataList.DescriptiveMetadata.VALUE.name(), metadataObj.getContent());
                          }
                          if (metadataObj.getName() != null) {
                            addNode(metadataNode,
                              ModelConfiguration.PremisModel.DescriptiveMetadataList.DescriptiveMetadata.EXTENSION.name(), metadataObj.getName());
                          }
                } catch (Exception e)
                {
                  log.log(Level.INFO, "metadataList error: " + e.getMessage(), e);
                }
View Full Code Here

              wfResultItem.addLogInfo("Create JCR for digital object.");
                JcrDigitalObjectManagerImpl dodm =
                  (JcrDigitalObjectManagerImpl) JcrDigitalObjectManagerImpl.getInstance();
               
          // Prepare data for digital object - to remove later
            Metadata META1 = new Metadata(URI.create("http://planets-project.eu"), "meta1", "meta1");
            Metadata META2 = new Metadata(URI.create("http://planets-project.eu"), "meta2", "meta2");
            Metadata[] metaList = new Metadata[2];
            metaList[0] = META1;
            metaList[1] = META2;
            Event[] eventList = new Event[2];
            Agent agent = new Agent("id", "name", "type");
View Full Code Here

            File xcdlf = new File(xcdlPath);
            _log.debug("Looking for "+xcdlf.getCanonicalPath());
            /* Attach XCDL as metadata, with a identifying URI */
            if( xcdlf.exists() && xcdlf.canRead() && xcdlf.isFile() ) {
                    String xcdls = FileUtils.readFileToString(xcdlf);
                    dob.metadata( new Metadata( XCDL_MD_URI, xcdls ) );
            }
           
            // Then look for 'source' and patch it in?

            // And return:
View Full Code Here

TOP

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

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.