protected File getProductFile(Product product) throws MetExtractionException { File prodFile; if (product.getProductStructure() .equals(Product.STRUCTURE_HIERARCHICAL)) { try { prodFile = new File(getRootRefPath(product .getProductReferences(), product.getProductType() .getProductRepositoryPath())); } catch (Exception e) { LOG.log(Level.SEVERE, e.getMessage()); throw new MetExtractionException("URI exception parsing: [" + product.getRootRef().getOrigReference() + "]"); } } else { try { prodFile = new File(new URI(((Reference) product .getProductReferences().get(0)).getOrigReference())); } catch (Exception e) { throw new MetExtractionException("URI exception parsing: [" + ((Reference) product.getProductReferences().get(0)) .getOrigReference() + "]"); } } return prodFile; }
protected File getProductFile(Product product) throws MetExtractionException { File prodFile; if (product.getProductStructure() .equals(Product.STRUCTURE_HIERARCHICAL)) { try { prodFile = new File(getRootRefPath(product .getProductReferences(), product.getProductType() .getProductRepositoryPath())); } catch (Exception e) { LOG.log(Level.SEVERE, e.getMessage()); throw new MetExtractionException("URI exception parsing: [" + product.getRootRef().getOrigReference() + "]"); } } else { try { prodFile = new File(new URI(((Reference) product .getProductReferences().get(0)).getOrigReference())); } catch (Exception e) { throw new MetExtractionException("URI exception parsing: [" + ((Reference) product.getProductReferences().get(0)) .getOrigReference() + "]"); } } return prodFile; }
public static Map<String, Object> getXmlRpcProduct(Product product) { Map<String, Object> productHash = new Hashtable<String, Object>(); if (product.getProductId() != null) { productHash.put("id", product.getProductId()); } if (product.getProductName() != null) { productHash.put("name", product.getProductName()); } if (product.getProductType() != null) { productHash.put("type", getXmlRpcProductType(product.getProductType())); } if (product.getProductStructure() != null) { productHash.put("structure", product.getProductStructure()); } if (product.getTransferStatus() != null) { productHash.put("transferStatus", product.getTransferStatus()); } if (product.getProductReferences() != null) { productHash.put("references", getXmlRpcReferences(product .getProductReferences())); } if (product.getRootRef() != null) { productHash.put("rootReference", getXmlRpcReference(product .getRootRef())); } return productHash; }
@Override public void addProductReferences(Product product) throws CatalogException { // generate update documents (with replace=true) List<String> docs = productSerializer.serialize(product.getProductId(), product.getRootRef(), product.getProductReferences(), true); // send documents to Solr server solrClient.index(docs, true, productSerializer.getMimeType()); }
public static Map<String, Object> getXmlRpcProduct(Product product) { Map<String, Object> productHash = new Hashtable<String, Object>(); if (product.getProductId() != null) { productHash.put("id", product.getProductId()); } if (product.getProductName() != null) { productHash.put("name", product.getProductName()); } if (product.getProductType() != null) { productHash.put("type", getXmlRpcProductType(product.getProductType())); } if (product.getProductStructure() != null) { productHash.put("structure", product.getProductStructure()); } if (product.getTransferStatus() != null) { productHash.put("transferStatus", product.getTransferStatus()); } if (product.getProductReferences() != null) { productHash.put("references", getXmlRpcReferences(product .getProductReferences())); } if (product.getRootRef() != null) { productHash.put("rootReference", getXmlRpcReference(product .getRootRef())); } return productHash; }
Metadata metadata = cp.getMetadata(); List<Reference> references = product.getProductReferences(); Reference rootReference = product.getRootRef();
@Override public void addProductReferences(Product product) throws CatalogException { // generate update documents (with replace=true) List<String> docs = productSerializer.serialize(product.getProductId(), product.getRootRef(), product.getProductReferences(), true); // send documents to Solr server solrClient.index(docs, true, productSerializer.getMimeType()); }
Metadata metadata = cp.getMetadata(); List<Reference> references = product.getProductReferences(); Reference rootReference = product.getRootRef();
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Product p = getProduct(); printer.println("Product:"); printer.println(" - ID: " + p.getProductId()); printer.println(" - Name: " + p.getProductName()); printer.println(" - ProductType: " + p.getProductType().getName()); printer.println(" - Structure: " + p.getProductStructure()); printer.println(" - Status: " + p.getTransferStatus()); if (p.getRootRef() != null) { printer.println(" - RootRef: " + p.getRootRef().getDataStoreReference()); } if (!p.getProductReferences().isEmpty()) { printer.println(" - References: "); for (Reference ref : p.getProductReferences()) { printer.println(" - " + ref.getDataStoreReference() + " (" + ref.getFileSize() + ")"); } } } catch (Exception e) { throw new CmdLineActionException("Failed to get product info : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Product p = getProduct(); printer.println("Product:"); printer.println(" - ID: " + p.getProductId()); printer.println(" - Name: " + p.getProductName()); printer.println(" - ProductType: " + p.getProductType().getName()); printer.println(" - Structure: " + p.getProductStructure()); printer.println(" - Status: " + p.getTransferStatus()); if (p.getRootRef() != null) { printer.println(" - RootRef: " + p.getRootRef().getDataStoreReference()); } if (!p.getProductReferences().isEmpty()) { printer.println(" - References: "); for (Reference ref : p.getProductReferences()) { printer.println(" - " + ref.getDataStoreReference() + " (" + ref.getFileSize() + ")"); } } } catch (Exception e) { throw new CmdLineActionException("Failed to get product info : " + e.getMessage(), e); } }
@Override protected Product createSerializableVersionOf(Product product) { SerializableProduct sp = new SerializableProduct(); sp.setProductId(product.getProductId()); sp.setProductName(product.getProductName()); sp.setProductReferences(product.getProductReferences()); sp.setProductStructure(product.getProductStructure()); sp.setProductType(product.getProductType()); sp.setRootRef(product.getRootRef()); sp.setTransferStatus(product.getTransferStatus()); return sp; }
@Override protected Product createSerializableVersionOf(Product product) { SerializableProduct sp = new SerializableProduct(); sp.setProductId(product.getProductId()); sp.setProductName(product.getProductName()); sp.setProductReferences(product.getProductReferences()); sp.setProductStructure(product.getProductStructure()); sp.setProductType(product.getProductType()); sp.setRootRef(product.getRootRef()); sp.setTransferStatus(product.getTransferStatus()); return sp; }
public static AvroProduct getAvroProduct(Product product){ AvroProduct avroProduct = new AvroProduct(); if (product.getProductId() != null) avroProduct.setProductId(product.getProductId()); if (product.getProductName() != null) avroProduct.setProductName(product.getProductName()); if (product.getProductType() != null) avroProduct.setProductType(getAvroProductType(product.getProductType())); if (product.getProductType() != null) avroProduct.setProductStructure(product.getProductStructure()); //referince List<Reference> references = product.getProductReferences(); if (references != null){ List<AvroReference> avroReferences = AvroTypeFactory.getAvroReferences(product.getProductReferences()); avroProduct.setReferences(avroReferences); } if (product.getTransferStatus() != null) avroProduct.setTransferStatus(product.getTransferStatus()); if (product.getRootRef() != null) avroProduct.setRootRef(getAvroReference(product.getRootRef())); return avroProduct; }
.getTransferStatus() != null ? product .getTransferStatus() : "unknown"); pMet.replaceMetadata(ProductMetKeys.PRODUCT_ROOT_REFERENCE, product.getRootRef() != null ? VersioningUtils .getAbsolutePathFromUri( product.getRootRef().getDataStoreReference()) : "unknown");
pMet.replaceMetadata(ProductMetKeys.PRODUCT_TRANSFER_STATUS, product .getTransferStatus() != null ? product.getTransferStatus():"unknown"); pMet.replaceMetadata(ProductMetKeys.PRODUCT_ROOT_REFERENCE, product.getRootRef() != null ? VersioningUtils .getAbsolutePathFromUri(product.getRootRef().getDataStoreReference()):"unknown");
.getTransferStatus() != null ? product .getTransferStatus() : "unknown"); pMet.replaceMetadata(ProductMetKeys.PRODUCT_ROOT_REFERENCE, product.getRootRef() != null ? VersioningUtils .getAbsolutePathFromUri( product.getRootRef().getDataStoreReference()) : "unknown");