monitor.beginTask("Loading ArticleContainers", 1);
try {
if (!articleContainerIDs.isEmpty()) {
ArticleContainerID articleContainerID = articleContainerIDs.iterator().next();
if (articleContainerID instanceof DeliveryNoteID) {
StoreManagerRemote sm = JFireEjb3Factory.getRemoteBean(StoreManagerRemote.class, SecurityReflector.getInitialContextProperties());
Set<DeliveryNoteID> deliveryNoteIDs = CollectionUtil.castSet(articleContainerIDs);
return sm.getDeliveryNotes(deliveryNoteIDs, fetchGroups, maxFetchDepth);
}
if (articleContainerID instanceof InvoiceID) {
AccountingManagerRemote am = JFireEjb3Factory.getRemoteBean(AccountingManagerRemote.class, SecurityReflector.getInitialContextProperties());
Set<InvoiceID> invoiceIDs = CollectionUtil.castSet(articleContainerIDs);
return am.getInvoices(invoiceIDs, fetchGroups, maxFetchDepth);
}
if (articleContainerID instanceof OfferID) {
TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
Set<OfferID> offerIDs = CollectionUtil.castSet(articleContainerIDs);
return tm.getOffers(offerIDs, fetchGroups, maxFetchDepth);
}
if (articleContainerID instanceof OrderID) {
TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
Set<OrderID> orderIDs = CollectionUtil.castSet(articleContainerIDs);
return tm.getOrders(orderIDs, fetchGroups, maxFetchDepth);
}
if (articleContainerID instanceof ReceptionNoteID) {
StoreManagerRemote sm = JFireEjb3Factory.getRemoteBean(StoreManagerRemote.class, SecurityReflector.getInitialContextProperties());
Set<ReceptionNoteID> receptionNoteIDs = CollectionUtil.castSet(articleContainerIDs);
return sm.getReceptionNotes(receptionNoteIDs, fetchGroups, maxFetchDepth);
}
}
return null;
} catch (Exception e) {
monitor.setCanceled(true);