use of de.metas.process.IADProcessDAO in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewFactory method createProcessDescriptorForPickingSlotView.
private static RelatedProcessDescriptor createProcessDescriptorForPickingSlotView(@NonNull final Class<?> processClass) {
final IADProcessDAO adProcessDAO = Services.get(IADProcessDAO.class);
final int processId = adProcessDAO.retriveProcessIdByClassIfUnique(Env.getCtx(), processClass);
Preconditions.checkArgument(processId > 0, "No AD_Process_ID found for %s", processClass);
return RelatedProcessDescriptor.builder().processId(processId).webuiQuickAction(true).build();
}
use of de.metas.process.IADProcessDAO in project metasfresh-webui-api by metasfresh.
the class SalesOrder2PurchaseViewFactory method createProcessDescriptor.
private static RelatedProcessDescriptor createProcessDescriptor(@NonNull final Class<?> processClass) {
final IADProcessDAO adProcessDAO = Services.get(IADProcessDAO.class);
final int processId = adProcessDAO.retriveProcessIdByClassIfUnique(Env.getCtx(), processClass);
Preconditions.checkArgument(processId > 0, "No AD_Process_ID found for %s", processClass);
return RelatedProcessDescriptor.builder().processId(processId).webuiQuickAction(true).build();
}
use of de.metas.process.IADProcessDAO in project metasfresh-webui-api by metasfresh.
the class MaterialCockpitViewFactory method createProcessDescriptor.
private RelatedProcessDescriptor createProcessDescriptor() {
final IADProcessDAO adProcessDAO = Services.get(IADProcessDAO.class);
final int processId = adProcessDAO.retriveProcessIdByClassIfUnique(Env.getCtx(), MD_Cockpit_DocumentDetail_Display.class);
Preconditions.checkArgument(processId > 0, "No AD_Process_ID found for class %s", MD_Cockpit_DocumentDetail_Display.class);
final RelatedProcessDescriptor processDescriptor = RelatedProcessDescriptor.builder().processId(processId).webuiQuickAction(true).build();
return processDescriptor;
}
use of de.metas.process.IADProcessDAO in project metasfresh-webui-api by metasfresh.
the class WebuiHUTransformParametersFiller method getActions.
/**
* @return the actions that are available according to which row is currently selected and to also according to whether there are already existing TUs or LUs in the context.
*/
public final LookupValuesList getActions(final int processId) {
final Set<String> allowedActions = new HashSet<>();
final HUEditorRow huRow = getSelectedRow();
if (huRow.isCU()) {
allowedActions.addAll(getActionTypesForCUs());
} else if (huRow.isTU()) {
allowedActions.addAll(getActionTypesForTUs());
} else if (huRow.isLU()) {
allowedActions.add(ActionType.LU_Set_Ownership.toString());
}
final IADProcessDAO adProcessDAO = Services.get(IADProcessDAO.class);
final I_AD_Process_Para processParameter = adProcessDAO.retriveProcessParameter(Env.getCtx(), processId, WEBUI_M_HU_Transform.PARAM_Action);
final int actionsReferenceId = processParameter.getAD_Reference_Value_ID();
final Collection<ADRefListItem> allActiveActionItems = adReferenceDAO.retrieveListItems(actionsReferenceId);
final String adLanguage = Env.getAD_Language();
return allActiveActionItems.stream().filter(item -> allowedActions.contains(item.getValueName())).map(item -> StringLookupValue.of(item.getValueName(), item.getName())).sorted(Comparator.comparing(lookupValue -> lookupValue.getDisplayName(adLanguage))).collect(LookupValuesList.collect());
}
use of de.metas.process.IADProcessDAO in project metasfresh-webui-api by metasfresh.
the class PPOrderLinesViewFactory method createProcessDescriptorForIssueReceiptWindow.
private static RelatedProcessDescriptor createProcessDescriptorForIssueReceiptWindow(@NonNull final Class<?> processClass) {
final IADProcessDAO adProcessDAO = Services.get(IADProcessDAO.class);
final int processId = adProcessDAO.retriveProcessIdByClassIfUnique(Env.getCtx(), processClass);
Preconditions.checkArgument(processId > 0, "No AD_Process_ID found for %s", processClass);
return RelatedProcessDescriptor.builder().processId(processId).windowId(PPOrderConstants.AD_WINDOW_ID_IssueReceipt.toInt()).anyTable().webuiQuickAction(true).build();
}
Aggregations