Package org.apache.oodt.cas.metadata

Examples of org.apache.oodt.cas.metadata.SerializableMetadata


  private FileManagerConn fm;

  public MetadataBrowser(String componentId, String fmUrlStr, String productId) {
    super(componentId);
    this.fm = new FileManagerConn(fmUrlStr);
    final SerializableMetadata met = new SerializableMetadata(this.fm
        .getMetadata(this.fm.safeGetProductById(productId)));
    setDefaultModel(new Model(met));

    if (met != null) {
      add(new Label("no_prod_met_display") {
        /*
         * (non-Javadoc)
         *
         * @see org.apache.wicket.Component#isVisible()
         */
        @Override
        public boolean isVisible() {
          return false;
        }
      });

      List<String> metKeys = met.getAllKeys();
      Collections.sort(metKeys);

      add(new ListView<String>("met_elem", new ListModel<String>(metKeys)) {
        /*
         * (non-Javadoc)
         *
         * @see
         * org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
         * .wicket.markup.html.list.ListItem)
         */
        @Override
        protected void populateItem(ListItem<String> item) {
          item.add(new Label("met_elem_name", item.getModelObject()));

          item
              .add(new ListView<String>("met_values_list",
                  new ListModel<String>(met.getAllMetadata(item
                      .getModelObject()))) {
                /*
                 * (non-Javadoc)
                 *
                 * @see
 
View Full Code Here


        if (metadataFilePath == null || configPropertiesPath == null) {
            System.err.println(usage);
            System.exit(1);
        }

        SerializableMetadata sm = new SerializableMetadata("UTF-8", false);
        sm.loadMetadataFromXmlStream(new File(metadataFilePath).toURL()
                .openStream());
        WorkflowTaskConfiguration config = new WorkflowTaskConfiguration();
        config.getProperties().load(
                new File(configPropertiesPath).toURL().openStream());
View Full Code Here

            VersioningUtils.addRefsFromUris(product, refs);

            try {
                Metadata metadata = null;
                URL metaUrl = new File(new URI(metadataFileName)).toURL();
                metadata = new SerializableMetadata(metaUrl.openStream());
                System.out.println("ingestProduct: Result: "
                        + client.ingestProduct(product, metadata,
                                clientTransfer));
            } catch (Exception e) {
                e.printStackTrace();
View Full Code Here

   }

   protected void dumpMetadataIfRequested() throws Exception {
      if (Boolean.parseBoolean(pgeMetadata
            .getMetadata(DUMP_METADATA))) {
         new SerializableMetadata(pgeMetadata.asMetadata())
               .writeMetadataToXmlStream(new FileOutputStream(
                     getDumpMetadataPath()));
      }
   }
View Full Code Here

      TransformerFactory transFact = TransformerFactory.newInstance();
      Transformer trans = transFact.newTransformer(xsltSource);
      boolean useCDATA = args.length > 1 ? parseBoolean((String) args[1])
            : false;
      Source xmlSource = new DOMSource((new SerializableMetadata(metadata,
            trans.getOutputProperty(OutputKeys.ENCODING), useCDATA)).toXML());

      trans.setOutputProperty(OutputKeys.INDENT, "yes");
      trans.transform(xmlSource, result);
View Full Code Here

  public void indexMetFile(File file, boolean delete)
      throws InstantiationException, FileNotFoundException, IOException,
      SolrServerException {
    LOG.info("Attempting to index product from metadata file.");
    try {
      SerializableMetadata metadata = new SerializableMetadata("UTF-8", false);
      metadata.loadMetadataFromXmlStream(new FileInputStream(file));
      metadata.addMetadata("id", metadata.getMetadata("CAS."
          + CoreMetKeys.PRODUCT_ID));
      metadata.addMetadata(config.getProperty(ACCESS_KEY), config
          .getProperty(ACCESS_URL)
          + metadata.getMetadata("CAS." + CoreMetKeys.PRODUCT_ID));
      if (delete) {
        server
            .deleteById(metadata.getMetadata("CAS." + CoreMetKeys.PRODUCT_ID));
      }
      server.add(this.getSolrDocument(metadata));
      LOG.info("Indexed product: "
          + metadata.getMetadata("CAS." + CoreMetKeys.PRODUCT_ID));
    } catch (InstantiationException e) {
      LOG.severe("Could not instantiate metadata object: " + e.getMessage());
    } catch (FileNotFoundException e) {
      LOG.severe("Could not find metadata file: " + e.getMessage());
    } catch (IOException e) {
View Full Code Here

    private void ingestTestFile() {
        Metadata prodMet = null;
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
View Full Code Here

    private void ingestTestFile() {
        Metadata prodMet = null;
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
View Full Code Here

    private void doIngest() {
        Metadata prodMet = null;

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
View Full Code Here

    public void testIngest() {
        Metadata prodMet = null;

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.metadata.SerializableMetadata

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.