public Order updateOrder(WebPageRequest inReq) throws Exception { Order order = loadOrder(inReq); String[] fields = inReq.getRequestParameters("field"); String catalogid = inReq.findValue("catalogid"); Searcher searcher = getSearcherManager().getSearcher(catalogid, "order"); searcher.updateData(inReq, fields, order); searcher.saveData(order, inReq.getUser()); return order; }
public void createConversionAndPublishRequest(WebPageRequest inReq) { // Order and item should be created from previous step. // now we get the items and update the destination information Order order = loadOrder(inReq); OrderManager manager = getOrderManager(); String catalogid = inReq.findValue("catalogid"); Searcher searcher = getSearcherManager().getSearcher(catalogid, "order"); if (order == null) { order = (Order) searcher.createNewData(); } String[] fields = inReq.getRequestParameters("field"); searcher.updateData(inReq, fields, order); MediaArchive archive = getMediaArchive(inReq); Map params = inReq.getParameterMap(); if (order.get("publishdestination") == null) { // String publishdestination = inReq.findValue("publishdestination.value"); // do something? default it to browser? order.setProperty( "publishdestination", "0"); // assume 0 for most orders, 0 can be told to use Aspera } List assetids = manager.addConversionAndPublishRequest(inReq, order, archive, params, inReq.getUser()); // OrderHistory history = // getOrderManager().createNewHistory(archive.getCatalogId(), order, // inReq.getUser(), "pending"); // history.setAssetIds(assetids); // manager.saveOrderWithHistory(archive.getCatalogId(), inReq.getUser(), // order, history); // if (assetids.size() > 0) // { // order.setProperty("orderstatus", "ordered"); //what is pendig // } // manager.saveOrder(archive.getCatalogId(), inReq.getUser(), order); log.info("Added conversion and publish requests for order id:" + order.getId()); }