use of de.metas.ui.web.window.datatypes.DocumentId in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewFactory method extractCurrentShipmentScheduleId.
private static final int extractCurrentShipmentScheduleId(final CreateViewRequest request) {
final DocumentId pickingRowId = request.getParentRowId();
// TODO make it more obvious/explicit
final int shipmentScheduleId = pickingRowId.toInt();
return shipmentScheduleId;
}
use of de.metas.ui.web.window.datatypes.DocumentId in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewsIndexStorage method removeById.
@Override
public void removeById(@NonNull final ViewId pickingSlotViewId) {
final DocumentId rowId = extractRowId(pickingSlotViewId);
final PackageableView packageableView = getPackageableViewByPickingSlotViewId(pickingSlotViewId);
packageableView.removePickingSlotView(rowId, ViewCloseReason.USER_REQUEST);
}
use of de.metas.ui.web.window.datatypes.DocumentId in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewsIndexStorage method put.
@Override
public void put(final IView pickingSlotView) {
final ViewId pickingSlotViewId = pickingSlotView.getViewId();
final PackageableView packageableView = getPackageableViewByPickingSlotViewId(pickingSlotViewId);
final DocumentId rowId = extractRowId(pickingSlotViewId);
packageableView.setPickingSlotView(rowId, PickingSlotView.cast(pickingSlotView));
}
use of de.metas.ui.web.window.datatypes.DocumentId in project metasfresh-webui-api by metasfresh.
the class PurchaseRowsLoader method handleThrowableForAsyncAvailabilityCheck.
private void handleThrowableForAsyncAvailabilityCheck(@Nullable final Throwable throwable) {
if (throwable == null) {
return;
}
if (throwable instanceof AvailabilityException) {
final AvailabilityException availabilityException = (AvailabilityException) throwable;
final List<DocumentId> changedRowIds = new ArrayList<>();
final Set<Entry<PurchaseCandidate, Throwable>> entrySet = availabilityException.getPurchaseCandidate2Throwable().entrySet();
for (final Entry<PurchaseCandidate, Throwable> purchaseCandidate2throwable : entrySet) {
final PurchaseRow purchaseRowToAugment = purchaseCandidate2purchaseRow.get(purchaseCandidate2throwable.getKey());
final PurchaseRow availabilityResultRow = purchaseRowFactory.rowFromThrowableBuilder().parentRow(purchaseRowToAugment).throwable(purchaseCandidate2throwable.getValue()).build();
purchaseRowToAugment.setAvailabilityInfoRows(ImmutableList.of(availabilityResultRow));
changedRowIds.add(purchaseRowToAugment.getId());
}
notifyViewOfChanges(changedRowIds);
} else {
// TODO: display an error-message in the webui
}
}
use of de.metas.ui.web.window.datatypes.DocumentId in project metasfresh-webui-api by metasfresh.
the class PurchaseView method patchViewRow.
@Override
public void patchViewRow(@NonNull final RowEditingContext ctx, @NonNull final List<JSONDocumentChangedEvent> fieldChangeRequests) {
final PurchaseRowId rowId = PurchaseRowId.fromDocumentId(ctx.getRowId());
rows.patchRow(rowId, fieldChangeRequests);
// notify the frontend
final DocumentId groupRowDocumentId = PurchaseRowId.fromDocumentId(ctx.getRowId()).toGroupRowId().toDocumentId();
ViewChangesCollector.getCurrentOrAutoflush().collectRowChanged(this, groupRowDocumentId);
}
Aggregations