Skip to content

Commit

Permalink
minor change, using cache
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Jan 3, 2024
1 parent e08da74 commit 5bc267e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/java/org/spin/eca56/util/support/documents/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public DictionaryDocument withEntity(PO entity) {
documentDetail.put("window_type", window.getWindowType());
documentDetail.put("is_sales_transaction", window.isSOTrx());
// Tabs
documentDetail.put("tabs", convertTabs(Arrays.asList(window.getTabs(true, null))));
documentDetail.put("tabs", convertTabs(Arrays.asList(window.getTabs(false, null))));
putDocument(documentDetail);
return this;
}
Expand Down Expand Up @@ -130,7 +130,7 @@ private Map<String, Object> parseTab(MTab tab) {
referenceDetail.put("help", process.get_Translation(I_AD_Process.COLUMNNAME_Help, getLanguage()));
detail.put("process", referenceDetail);
}
List<MField> fields = getFieldsFromTab(tab);
List<MField> fields = Arrays.asList(tab.getFields(false, null));
detail.put("fields", convertFields(fields));
detail.put("row_fields", convertFields(fields.stream().filter(field -> field.isDisplayed()).collect(Collectors.toList())));
detail.put("grid_fields", convertFields(fields.stream().filter(field -> field.isDisplayedGrid()).collect(Collectors.toList())));
Expand All @@ -139,12 +139,6 @@ private Map<String, Object> parseTab(MTab tab) {
return detail;
}

private List<MField> getFieldsFromTab(MTab tab) {
return new Query(tab.getCtx(), I_AD_Field.Table_Name, I_AD_Field.COLUMNNAME_AD_Tab_ID + " = ?", null)
.setParameters(tab.getAD_Tab_ID())
.list();
}

private List<MProcess> getProcessFromTab(MTab tab) {
return new Query(tab.getCtx(), I_AD_Process.Table_Name, "EXISTS(SELECT 1 FROM AD_Table_Process tp WHERE tp.AD_Process_ID = AD_Process.AD_Process_ID AND tp.AD_Table_ID = ?)", null)
.setParameters(tab.getAD_Table_ID())
Expand Down

0 comments on commit 5bc267e

Please sign in to comment.