Package org.apache.oodt.cas.metadata

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


        }
    }
   
    private Metadata getReducedMetadata(Product product, List<String> elements) throws CatalogException {
        try {
            Metadata m = null;
            if (elements != null && elements.size() > 0) {
                m = catalog.getReducedMetadata(product, elements);
            }else {
                m = this.getMetadata(product);
            }
View Full Code Here


        }
    }
   
    private Metadata getMetadata(Product product) throws CatalogException {
        try {
            Metadata m = catalog.getMetadata(product);
            return this.getOrigValues(m, product.getProductType());
        } catch (Exception e) {
            e.printStackTrace();
            LOG.log(Level.SEVERE,
                    "Exception obtaining metadata from catalog for product: ["
View Full Code Here

    private List<QueryResult> applyFilterToResults(
            List<QueryResult> queryResults, QueryFilter queryFilter)
            throws Exception {
        List<TimeEvent> events = new LinkedList<TimeEvent>();
        for (QueryResult queryResult : queryResults) {
            Metadata m = new Metadata();
            m.addMetadata(queryFilter.getPriorityMetKey(), queryResult
                .getMetadata().getMetadata(queryFilter.getPriorityMetKey()));
            events.add(new ObjectTimeEvent<QueryResult>(
                DateUtils.getTimeInMillis(DateUtils.toCalendar(queryResult
                    .getMetadata().getMetadata(queryFilter.getStartDateTimeMetKey()),
                    DateUtils.FormatType.UTC_FORMAT), DateUtils.julianEpoch),
View Full Code Here

                .get("workflow_inst_currenttask_enddatetime"));
        inst.setStartDateTimeIsoStr(doc.get("workflow_inst_startdatetime"));
        inst.setEndDateTimeIsoStr(doc.get("workflow_inst_enddatetime"));

        // read the workflow instance metadata
        Metadata sharedContext = new Metadata();
        String[] instMetFields = doc.getValues("workflow_inst_met_flds");
        if (instMetFields != null && instMetFields.length > 0) {
            for (int i = 0; i < instMetFields.length; i++) {
                String fldName = instMetFields[i];
                String[] vals = doc.getValues(fldName);
                if (vals != null && vals.length > 0) {
                    for (int j = 0; j < vals.length; j++) {
                        sharedContext.addMetadata(fldName, vals[j]);
                    }
                }
            }
        }
View Full Code Here

                                + "not tracking its execution and the id: ["
                                + workflowInstId + "] "
                                + "was never persisted to "
                                + "the instance repository");
                e.printStackTrace();
                return new Metadata();
        }

        return wInst.getSharedContext();
    }
View Full Code Here

            throws InstanceRepositoryException {
        Connection conn = null;
        Statement statement = null;
        ResultSet rs = null;

        Metadata met = new Metadata();

        try {
            conn = dataSource.getConnection();
            statement = conn.createStatement();

            String getWorkflowSql = "SELECT * from workflow_instance_metadata "
                    + "WHERE workflow_instance_id = " + workflowInstId;

            LOG.log(Level.FINE, "Executing: " + getWorkflowSql);
            rs = statement.executeQuery(getWorkflowSql);

            while (rs.next()) {
                met.addMetadata(rs.getString("workflow_met_key"), URLDecoder.decode(rs
                        .getString("workflow_met_val"), "UTF-8"));
            }

        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

                                + "not tracking its execution and the id: ["
                                + workflowInstId + "] "
                                + "was never persisted to "
                                + "the instance repository");
                e.printStackTrace();
                return new Metadata();
            }
        }

        return worker.getWorkflowInstance().getSharedContext();
    }
View Full Code Here

                            + product.getProductName()
                            + "] that isn't in the index or the local cache!");

        }

        Metadata currMet = p.getMetadata();
        List<Element> metadataTypes = null;

        try {
            metadataTypes = valLayer.getElements(product.getProductType());
        } catch (ValidationLayerException e) {
            e.printStackTrace();
            throw new CatalogException(
                    "ValidationLayerException when trying to obtain element list for product type: "
                            + product.getProductType().getName()
                            + ": Message: " + e.getMessage());
        }

        for (Iterator<Element> i = metadataTypes.iterator(); i.hasNext();) {
            Element element = i.next();
            currMet.removeMetadata(element.getElementName());
        }

        p.setMetadata(currMet);

        if (hasMetadataAndRefs(p)) {
View Full Code Here

                    .getProductId());
            cp.setProduct(product);
        } else {
            // need to grab the metadata for the existing product, and make sure
            // we don't lose it
            Metadata metadata = getMetadata(product);

            CompleteProduct completeProduct = new CompleteProduct();
            completeProduct.setMetadata(metadata);

            // now remove the product's document from the catalog
View Full Code Here

            }
        }
    }
   
    public Metadata getReducedMetadata(Product product, List<String> elements) throws CatalogException {
        Metadata fullMetadata = getMetadata(product);
        Metadata reducedMetadata = new Metadata();
        for (int i = 0; i < elements.size(); i++) {
            String element = elements.get(i);
            reducedMetadata.addMetadata(element, fullMetadata
                    .getMetadata(element));
        }
        return reducedMetadata;
    }
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.