public Product safeGetProductById(String id) { if (!isConnected()) return Product.getDefaultFlatProduct("", ""); try { return fm.getProductById(id); } catch (Exception e) { LOG.log(Level.WARNING, "Unable to get product by id: [" + id + "]: Message: " + e.getMessage()); return null; } }
public Product safeGetProductById(String id) { if (!isConnected()) return Product.getDefaultFlatProduct("", ""); try { return fm.getProductById(id); } catch (Exception e) { LOG.log(Level.WARNING, "Unable to get product by id: [" + id + "]: Message: " + e.getMessage()); return null; } }
public Product safeGetProductByName(String prodName) { if (!isConnected()) return Product.getDefaultFlatProduct("", ""); Product p = null; try { p = this.fmgrClient.getProductByName(prodName); } catch (Exception e) { LOG.log(Level.WARNING, "Error obtaining product: [" + prodName + "]: Message: " + e.getMessage(), e); } return p; }
public Product safeGetProductByName(String prodName) { if (!isConnected()) return Product.getDefaultFlatProduct("", ""); Product p = null; try { p = this.fmgrClient.getProductByName(prodName); } catch (Exception e) { LOG.log(Level.WARNING, "Error obtaining product: [" + prodName + "]: Message: " + e.getMessage(), e); } return p; }
private List getProducts(List prodNames) { if (prodNames == null || (prodNames.size() == 0)) { return new Vector(); } List prods = new Vector(prodNames.size()); for (Object prodName1 : prodNames) { String prodName = (String) prodName1; List prodList = fm.queryAllTypes(new FilenameQuery(prodName, fm) .buildQuery(), this.prodTypeExcludeList); if (prodList != null && prodList.size() > 0) { prods.add((Product) prodList.get(0)); } else { if (this.listNotCataloged) { // create a new product and add it prods.add(Product.getDefaultFlatProduct(prodName, UNKNOWN)); } } } return prods; }
private List getProducts(List prodNames) { if (prodNames == null || (prodNames.size() == 0)) { return new Vector(); } List prods = new Vector(prodNames.size()); for (Object prodName1 : prodNames) { String prodName = (String) prodName1; List prodList = fm.queryAllTypes(new FilenameQuery(prodName, fm) .buildQuery(), this.prodTypeExcludeList); if (prodList != null && prodList.size() > 0) { prods.add((Product) prodList.get(0)); } else { if (this.listNotCataloged) { // create a new product and add it prods.add(Product.getDefaultFlatProduct(prodName, UNKNOWN)); } } } return prods; }
public Product getLatestProduct(Query query, ProductType type) { if (!isConnected()) return Product.getDefaultFlatProduct("", ""); List products; try { products = fmgrClient.query(query, type); if (products != null && products.size() > 0) { Product p = (Product) products.get(0); p.setProductReferences(safeGetProductReferences(p)); return p; } } catch (Exception e) { LOG.log(Level.SEVERE, "Unable to obtain products: query: [" + query + "]: Message: " + e.getMessage(), e); } return null; }
public Product getLatestProduct(Query query, ProductType type) { if (!isConnected()) return Product.getDefaultFlatProduct("", ""); List products; try { products = fmgrClient.query(query, type); if (products != null && products.size() > 0) { Product p = (Product) products.get(0); p.setProductReferences(safeGetProductReferences(p)); return p; } } catch (Exception e) { LOG.log(Level.SEVERE, "Unable to obtain products: query: [" + query + "]: Message: " + e.getMessage(), e); } return null; }