Package org.apache.oodt.cas.metadata

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


     *      AbstractFilemgrMetExtractor#doExtract(org.apache.oodt.cas.filemgr.structs.Product,
     *      org.apache.oodt.cas.metadata.Metadata)
     */
    public Metadata doExtract(Product product, Metadata met)
            throws MetExtractionException {
        Metadata extractMet = new Metadata();
        /* copy through original metadata */
        merge(met, extractMet);

        File prodFile = getProductFile(product);

        extractMet
                .addMetadata(isNsReplace(PRODUCT_ID) ? elementNs + nsSeparator
                        + PRODUCT_ID : PRODUCT_ID, product.getProductId());
        addMetadataIfUndefined(met, extractMet,
                isNsReplace(FILENAME) ? elementNs + nsSeparator + FILENAME
                        : FILENAME, prodFile.getName());
        addMetadataIfUndefined(met, extractMet,
                isNsReplace(FILE_LOCATION) ? elementNs + nsSeparator
                        + FILE_LOCATION : FILE_LOCATION, prodFile
                        .getParentFile().getAbsolutePath());
        addMetadataIfUndefined(met, extractMet,
                isNsReplace(PRODUCT_NAME) ? elementNs + nsSeparator
                        + PRODUCT_NAME : PRODUCT_NAME, product.getProductName());
        addMetadataIfUndefined(met, extractMet,
                isNsReplace(PRODUCT_STRUCTURE) ? elementNs + nsSeparator
                        + PRODUCT_STRUCTURE : PRODUCT_STRUCTURE, product
                        .getProductStructure());
        extractMet.addMetadata(isNsReplace(PRODUCT_RECEVIED_TIME) ? elementNs
                + nsSeparator + PRODUCT_RECEVIED_TIME : PRODUCT_RECEVIED_TIME,
                DateConvert.isoFormat(new Date()));
        addMetadataIfUndefined(met, extractMet,
                isNsReplace(PRODUCT_TYPE) ? elementNs + nsSeparator
                        + PRODUCT_TYPE : PRODUCT_TYPE, product.getProductType()
View Full Code Here


     * @see org.apache.oodt.cas.filemgr.metadata.extractors.AbstractFilemgrMetExtractor#doExtract(org.apache.oodt.cas.filemgr.structs.Product,
     *      org.apache.oodt.cas.metadata.Metadata)
     */
    public Metadata doExtract(Product product, Metadata met)
            throws MetExtractionException {
        Metadata extractMet = new Metadata();
        merge(met, extractMet);

        if (product.getProductStructure().equals(Product.STRUCTURE_FLAT)) {
            Reference prodRef = (Reference) product.getProductReferences().get(
                    0);
            /*Reference mimeRef = new Reference(prodRef.getOrigReference(),
                    prodRef.getDataStoreReference(), prodRef.getFileSize());*/

            extractMet.addMetadata(MIME_TYPE, prodRef.getMimeType().getName());
            extractMet.addMetadata(MIME_TYPE, prodRef.getMimeType()
                    .getPrimaryType());
            extractMet.addMetadata(MIME_TYPE, prodRef.getMimeType()
                    .getSubType());
        }

        return extractMet;
    }
View Full Code Here

                    XMLUtils.addNode(doc, item, "link", base
                            + "/viewTransfer?ref="
                            + status.getFileRef().getOrigReference() + "&size="
                            + status.getFileRef().getFileSize());

                    Metadata m = null;

                    try {
                        m = fClient.getMetadata(status.getParentProduct());

                        String productReceivedTime = m
                                .getMetadata("CAS.ProductReceivedTime");
                        Date receivedTime = null;

                        try {
                            receivedTime = DateConvert
View Full Code Here

    @Override
    public Metadata getMetadata(Product product) throws CatalogException {
        String origProductTypeName = product.getProductType().getName();
        product.getProductType().setName(
                getProductTypeTableName(origProductTypeName));
        Metadata met = super.getMetadata(product);
        product.getProductType().setName(origProductTypeName);
        return met;
    }
View Full Code Here

                            .setProductReferences(sourceClient
                                    .getProductReferences(p));
                } else
                    p.setProductReferences(srcCatalog.getProductReferences(p));

                Metadata met = null;

                if (sourceClient != null) {
                    met = sourceClient.getMetadata(p);
                } else {
                    met = srcCatalog.getMetadata(p);
                }

                LOG
                        .log(
                                Level.INFO,
                                "Source Product: ["
                                        + p.getProductName()
                                        + "]: Met Extraction and "
                                        + "Reference Extraction successful: writing to dest file manager");

                // remove the default CAS fields for metadata
                met.removeMetadata("CAS.ProductId");
                met.removeMetadata("CAS.ProductReceivedTime");
                met.removeMetadata("CAS.ProductName");

                Product destProduct = new Product();
                // copy through
                destProduct.setProductName(p.getProductName());
                destProduct.setProductStructure(p.getProductStructure());
View Full Code Here

    private List<ExtractorSpec> extractors = null;

    private List<TypeHandler> handlers = null;
   
    public ProductType() {
        typeMetadata = new Metadata();
        extractors = new Vector<ExtractorSpec>();
    }
View Full Code Here

        productTypeId = id;
        this.name = name;
        this.description = description;
        productRepositoryPath = repository;
        this.versioner = versioner;
        typeMetadata = new Metadata();
    }
View Full Code Here

    public Metadata getWorkflowInstanceMetadata(String wInstId)
            throws Exception {
        Vector argList = new Vector();
        argList.add(wInstId);

        Metadata met = null;

        try {
            Hashtable instMetHash = (Hashtable) client.execute(
                    "workflowmgr.getWorkflowInstanceMetadata", argList);
            met = new Metadata();
            met.addMetadata(instMetHash);
        } catch (XmlRpcException e) {
            e.printStackTrace();
            throw new Exception(e.getMessage());
        } catch (IOException e) {
            throw new Exception(e.getMessage());
View Full Code Here

        }

        if (operation.equals("--sendEvent")) {
            // get the event name, and the metadata
            String eventName = null;
            Metadata metadata = new Metadata();

            for (int i = 4; i < args.length; i++) {
                if (args[i].equals("--eventName")) {
                    eventName = args[++i];
                } else if (args[i].equals("--metaData")) {
                    for (int j = i + 1; j < args.length; j++) {

                        if (args[j].equals("--key")) {
                            String key = args[++j];
                            List values = new Vector();

                            boolean endOfList = true;
                            for (j++; j < args.length; j++) {
                                if (!args[j].equals("--key")) {
                                    values.add(args[j]);
                                } else {
                                    endOfList = false;
                                    break;
                                }
                            }

                            if (!endOfList) {
                                j--;
                            }

                            System.out.println("Picked up metadata: [key="
                                    + key + ", values=" + values + "]");
                            metadata.addMetadata(key, values);

                        }
                    }
                    break;
                }
View Full Code Here

        testInst = new WorkflowInstance();
        testInst.setCurrentTaskId("test.task");
        testInst.setStatus(STARTED);
        testInst.setWorkflow(testWkflw);

        Metadata sharedContext = new Metadata();
        sharedContext.addMetadata("TestKey1", "TestVal1");
        sharedContext.addMetadata("TestKey1", "TestVal2");
        sharedContext.addMetadata("TestKey2", "TestVal3");
        testInst.setSharedContext(sharedContext);
    }
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.