Package org.apache.oodt.cas.metadata

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


    }

    private CompleteProduct toCompleteProduct(Document doc, boolean getRefs,
            boolean getMetadata) {
        Product product = new Product();
        Metadata metadata = new Metadata();
        CompleteProduct completeProduct = new CompleteProduct();

        product.setProductId(doc.get("product_id"));
        product.setProductName(doc.get("product_name"));
        product.setProductStructure(doc.get("product_structure"));
        product.setTransferStatus(doc.get("product_transfer_status"));

        ProductType type = new ProductType();
        type.setDescription(doc.get("product_type_desc"));
        type.setProductTypeId(doc.get("product_type_id"));
        type.setName(doc.get("product_type_name"));
        type.setProductRepositoryPath(doc.get("product_type_repoPath"));
        type.setVersioner(doc.get("product_type_versioner"));
        product.setProductType(type);

        if (getMetadata) {
            List<Element> elements = null;

            try {
                elements = valLayer.getElements(type);
            } catch (ValidationLayerException e) {
                LOG.log(Level.WARNING,
                        "Unable to obtain metadata for product: ["
                                + product.getProductName() + "]: Message: "
                                + e.getMessage());
            }

            if (elements != null) {
                for (Iterator<Element> i = elements.iterator(); i.hasNext();) {
                    Element element = (Element) i.next();

                    String[] elemValues = doc.getValues(element
                            .getElementName());

                    if (elemValues != null && elemValues.length > 0) {
                        for (int j = 0; j < elemValues.length; j++) {
                            metadata.addMetadata(element.getElementName(),
                                    elemValues[j]);
                        }
                    }
                }
            }
View Full Code Here


            throw new CatalogException(e.getMessage());
        } catch (IOException e) {
            throw new CatalogException(e.getMessage());
        }

        Metadata m = new Metadata();
        m.addMetadata(metadata);
        return m;

    }
View Full Code Here

            throw new CatalogException(e.getMessage());
        } catch (IOException e) {
            throw new CatalogException(e.getMessage());
        }

        Metadata m = new Metadata();
        m.addMetadata(metadata);
        return m;

    }
View Full Code Here

            throws XmlRpcException, IOException {
        Vector<Object> args = new Vector<Object>();
        args.add(metadata.getHashtable());
        args.add(XmlRpcStructFactory.getXmlRpcProductType(productType));

        Metadata m = new Metadata();
        m.addMetadata((Hashtable<String, Object>) this.client.execute(
                "filemgr.getCatalogValues", args));

        return m;
    }
View Full Code Here

            throws XmlRpcException, IOException {
        Vector<Object> args = new Vector<Object>();
        args.add(metadata.getHashtable());
        args.add(XmlRpcStructFactory.getXmlRpcProductType(productType));

        Metadata m = new Metadata();
        m.addMetadata((Hashtable<String, Object>) this.client.execute(
                "filemgr.getOrigValues", args));

        return m;
    }
View Full Code Here

            // add Product References from the URI list
            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));
View Full Code Here

    ProfileAttributes profAttr = profile.getProfileAttributes();
    resAttr.setResClass("system.profile");
    profAttr.setStatusID("active");
    profAttr.setType("profile");

    Metadata met = new Metadata();

    for (Iterator<String> i = map.getFieldNames().iterator(); i.hasNext();) {
      String fldName = i.next();
      MappingField fld = map.getFieldByName(fldName);
      ProfileElement elem = new EnumeratedProfileElement(profile);
      elem.setName(fld.getName());

      try {
        if (fld.getType().equals(FieldType.CONSTANT)) {
          elem.getValues().add(fld.getConstantValue());
        } else {
          String elemDbVal = rs.getString(fld.getDbName());
          for (Iterator<MappingFunc> j = fld.getFuncs().iterator(); j.hasNext();) {
            MappingFunc func = j.next();
            CDEValue origVal = new CDEValue(fld.getName(), elemDbVal);
            CDEValue newVal = func.inverseTranslate(origVal);
            elemDbVal = newVal.getVal();
          }

          elem.getValues().add(elemDbVal);
        }
      } catch (SQLException e) {
        e.printStackTrace();
        LOG.log(Level.WARNING, "Unable to obtain field: ["
            + map.getFieldLocalName(fld) + "] from result set: message: "
            + e.getMessage());
      }

      met.addMetadata(elem.getName(), (String) elem.getValues().get(0));

      profile.getProfileElements().put(fld.getName(), elem);
    }

    if (resLocationSpec != null) {
View Full Code Here

        return type;
    }

    private Metadata safeGetMetadata(Product p) {
        Metadata met = null;

        try {
            met = fmClient.getMetadata(p);
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

            if (products != null && products.size() > 0) {
                for (Iterator i = products.iterator(); i.hasNext();) {
                    Product p = (Product) i.next();
                    p.setProductReferences(safeGetProductReferences(p));
                    Metadata met = safeGetMetadata(p);
                    try {
                        profiles.add(ProfileUtils.buildProfile(p, met,
                                dataDelivBaseUrlStr));
                    } catch (Exception e) {
                        e.printStackTrace();
View Full Code Here

    when(configuration.getProperty("DayKey")).thenReturn("StartDay");
    when(configuration.getProperty("HourKey")).thenReturn("StartHour");
    when(configuration.getProperty("MinuteKey")).thenReturn("StartMinute");
    when(configuration.getProperty("SecondKey")).thenReturn("StartSecond");

    metadata = new Metadata();
    metadata.addMetadata("StartDateTime", "2013-05-23 03:02:01");

    extractor = new DateTimeExpandMetExtractor();
  }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.metadata.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.