public static ArticleContainerEditorInput createEditorInput() { TradeManagerRemote tm; try { try { Login.getLogin(); TradeConfigModule tradeConfigModule = ConfigUtil.getUserCfMod( TradeConfigModule.class, new String[] { FetchPlan.DEFAULT, TradeConfigModule.FETCH_GROUP_CURRENCY, }, NLJDOHelper.MAX_FETCH_DEPTH_NO_LIMIT, new NullProgressMonitor()); // TODO async! tm = JFireEjb3Factory.getRemoteBean( TradeManagerRemote.class, Login.getLogin().getInitialContextProperties()); // by default get the customerID of the anonymous customer AnchorID customerID = (AnchorID) JDOHelper.getObjectId( LegalEntityDAO.sharedInstance() .getAnonymousLegalEntity(new NullProgressMonitor())); // FIXME IDPREFIX (next line) should be asked from user if necessary! OrderID orderID = tm.createQuickSaleWorkOrder( customerID, null, tradeConfigModule.getCurrencyID(), new SegmentTypeID[] {null}); // null here is a shortcut for default segment type return new ArticleContainerEditorInput(orderID); } catch (LoginException le) { return null; } } catch (Throwable t) { throw new RuntimeException(t); } }