use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class OperationGroupDetailsListeners method redirectToFilteredOperationGroupsList.
public void redirectToFilteredOperationGroupsList(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
FormComponent operationGroupForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity operationGroup = operationGroupForm.getEntity();
if (operationGroup.getId() == null) {
return;
}
String operationGroupNumber = operationGroup.getStringField(NUMBER);
Map<String, String> filters = Maps.newHashMap();
filters.put("operationGroupNumber", operationGroupNumber);
Map<String, Object> gridOptions = Maps.newHashMap();
gridOptions.put(L_FILTERS, filters);
Map<String, Object> parameters = Maps.newHashMap();
parameters.put(L_GRID_OPTIONS, gridOptions);
parameters.put(L_WINDOW_ACTIVE_MENU, "technology.operation");
String url = "../page/technologies/operationsList.html";
view.redirectTo(url, false, true, parameters);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class OperationProductInComponentsImportListeners method processImportFile.
public void processImportFile(final ViewDefinitionState view, final ComponentState state, final String[] args) throws IOException {
FormComponent technologyForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity technology = technologyForm.getEntity();
technology = technology.getDataDefinition().save(technology);
operationProductInComponentXlsxImportService.processImportFile(view, operationProductInComponentCellBinderRegistry.getCellBinderRegistry(), true, TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION_PRODUCT_IN_COMPONENT, technology, OperationProductInComponentFields.TECHNOLOGY, OperationProductInComponentsImportListeners::createRestrictionForOperationProductInComponent);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class ProductDetailsListenersT method addTechnologyGroup.
// TODO MAKU Fix passing values to another view
public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
FormComponent productForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity product = productForm.getEntity();
if (product.getId() == null) {
return;
}
Map<String, Object> parameters = Maps.newHashMap();
parameters.put(L_WINDOW_ACTIVE_MENU, "technology.technologyGroups");
String url = "../page/technologies/technologyGroupDetails.html";
view.redirectTo(url, false, true, parameters);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class ProductDetailsListenersT method showProductGroupTechnologies.
public final void showProductGroupTechnologies(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
FormComponent productForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity product = productForm.getEntity();
if (product.getId() == null) {
return;
}
Entity parent = product.getBelongsToField(ProductFields.PARENT);
if (parent == null) {
return;
}
String productNumber = parent.getStringField(NUMBER);
Map<String, String> filters = Maps.newHashMap();
filters.put("productNumber", applyInOperator(productNumber));
Map<String, Object> gridOptions = Maps.newHashMap();
gridOptions.put(L_FILTERS, filters);
Map<String, Object> parameters = Maps.newHashMap();
parameters.put(L_GRID_OPTIONS, gridOptions);
parameters.put(L_WINDOW_ACTIVE_MENU, "technology.technologies");
String url = "../page/technologies/technologiesList.html";
view.redirectTo(url, false, true, parameters);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class ProductDetailsListenersT method showTechnologiesWithFamilyProduct.
public final void showTechnologiesWithFamilyProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
FormComponent productForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity product = productForm.getEntity();
if (product.getId() == null) {
return;
}
Entity productDb = product.getDataDefinition().get(product.getId());
Entity parent = productDb.getBelongsToField(ProductFields.PARENT);
if (Objects.isNull(parent)) {
return;
}
String productNumber = parent.getStringField(NUMBER);
Map<String, String> filters = Maps.newHashMap();
filters.put("productNumber", applyInOperator(productNumber));
Map<String, Object> gridOptions = Maps.newHashMap();
gridOptions.put(L_FILTERS, filters);
Map<String, Object> parameters = Maps.newHashMap();
parameters.put(L_GRID_OPTIONS, gridOptions);
parameters.put(L_WINDOW_ACTIVE_MENU, "technology.technologies");
String url = "../page/technologies/technologiesList.html";
view.redirectTo(url, false, true, parameters);
}
Aggregations