protected boolean navigationIsNotPermitted(WindowInfo windowInfo) { WindowInfo loginWindowInfo = windowConfig.getWindowInfo("loginWindow"); WindowInfo mainWindowInfo = windowConfig.getWindowInfo("mainWindow"); return loginWindowInfo.equals(windowInfo) || mainWindowInfo.equals(windowInfo); }
public WindowInfo getEditorScreen(Entity entity) { MetaClass metaClass = entity.getMetaClass(); MetaClass originalMetaClass = metadata.getExtendedEntities().getOriginalOrThisMetaClass(metaClass); WindowInfo windowInfo = primaryEditors.get(originalMetaClass.getJavaClass()); if (windowInfo != null) { return windowInfo; } String editorScreenId = getEditorScreenId(metaClass); return getWindowInfo(editorScreenId); }
protected Set<String> getAllWindowIds() { Collection<WindowInfo> windows = windowConfig.getWindows(); return windows.stream() .map(WindowInfo::getId) .collect(Collectors.toSet()); } }
public String getAvailableLookupScreenId(MetaClass metaClass) { String id = getLookupScreenId(metaClass); if (!hasWindow(id)) { id = getBrowseScreenId(metaClass); } return id; }
/** * Get available lookup screen by class of entity * * @param entityClass entity class * @return id of lookup screen * @throws NoSuchScreenException if the screen with specified ID is not registered */ public WindowInfo getLookupScreen(Class<? extends Entity> entityClass) { MetaClass metaClass = metadata.getSession().getClass(entityClass); MetaClass originalMetaClass = metadata.getExtendedEntities().getOriginalOrThisMetaClass(metaClass); WindowInfo windowInfo = primaryLookups.get(originalMetaClass.getJavaClass()); if (windowInfo != null) { return windowInfo; } String lookupScreenId = getAvailableLookupScreenId(metaClass); return getWindowInfo(lookupScreenId); }
@EventListener(AppContextInitializedEvent.class) @Order(Events.HIGHEST_PLATFORM_PRECEDENCE + 300) protected void init() { ClientConfig clientConfig = configuration.getConfig(ClientConfig.class); String property = clientConfig.getScreenIdsToSaveHistory(); if (StringUtils.isNotBlank(property)) { screenIds.addAll(Arrays.asList(StringUtils.split(property, ','))); } for (MetaClass metaClass : metadata.getTools().getAllPersistentMetaClasses()) { Map<String, Object> attributes = metadata.getTools().getMetaAnnotationAttributes(metaClass.getAnnotations(), TrackEditScreenHistory.class); if (Boolean.TRUE.equals(attributes.get("value"))) { screenIds.add(windowConfig.getEditorScreenId(metaClass)); } } }
protected void init() { widgetTypeInfos = new ArrayList<>(); try { for (WindowInfo windowInfo : windowConfig.getWindows()) { DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); if (StringUtils.isNoneEmpty(windowInfo.getTemplate())) { if (ann != null) { String editFrameId = ann.editFrameId(); if (StringUtils.isNotBlank(editFrameId) && !windowConfig.hasWindow(editFrameId)) { throw new IllegalArgumentException( String.format("Unable to find %s edit screen in screen config for widget %s",
editorScreenId = builder.getScreenId(); } else { editorScreenId = windowConfig.getEditorScreen(entity).getId(); WindowInfo windowInfo = windowConfig.getWindowInfo(editorScreenId); ScreenOptions options = builder.getOptions();
protected void initOutputTypeList() { ArrayList<ReportOutputType> outputTypes = new ArrayList<>(Arrays.asList(ReportOutputType.values())); if (!windowConfig.hasWindow(ShowChartController.JSON_CHART_SCREEN_ID)) { outputTypes.remove(ReportOutputType.CHART); } if (!windowConfig.hasWindow(ShowPivotTableController.PIVOT_TABLE_SCREEN_ID)) { outputTypes.remove(ReportOutputType.PIVOT_TABLE); } outputType.setOptionsList(outputTypes); }
throw new IllegalStateException("Please specify metaclass or property for PickerField"); currentWindowAlias = windowConfig.getLookupScreenId(metaClass); if (config.hasWindow(currentWindowAlias)) { ((LegacyFrame) lookupWindow).openLookup( currentWindowAlias,
/** * Open a lookup screen. * * @param entityClass required class of entity * @param handler is invoked when selection confirmed and the lookup screen closes * @param openType how to open the screen * @return created window * * @deprecated Use {@link ScreenBuilders} bean instead. */ @Deprecated default AbstractLookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler, WindowManager.OpenType openType) { WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME); WindowInfo lookupScreen = windowConfig.getLookupScreen(entityClass); return (AbstractLookup) getWindowManager().openLookup(lookupScreen, handler, openType); }
"for the PickerField", "action ID", getId()); windowAlias = windowConfig.getAvailableLookupScreenId(metaClass); windowConfig.getWindowInfo(windowAlias), this::handleLookupWindowSelection, openType,
/** * @return editor screen identifier */ public String getWindowId() { if (windowId != null) { return windowId; } else { MetaClass metaClass = target.getDatasource().getMetaClass(); WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME); return windowConfig.getEditorScreenId(metaClass); } }
protected Map<String, TemplateFileType> getAvailableTemplateFormats() { Messages messages = AppBeans.get(Messages.NAME); Map<String, TemplateFileType> result = new LinkedHashMap<>(4); result.put(messages.getMessage(TemplateFileType.XLSX), TemplateFileType.XLSX); result.put(messages.getMessage(TemplateFileType.DOCX), TemplateFileType.DOCX); result.put(messages.getMessage(TemplateFileType.HTML), TemplateFileType.HTML); result.put(messages.getMessage(TemplateFileType.CSV), TemplateFileType.CSV); WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME); if (windowConfig.hasWindow(ShowChartController.JSON_CHART_SCREEN_ID)) { result.put(messages.getMessage(TemplateFileType.CHART), TemplateFileType.CHART); } return result; }
/** * Open a lookup screen. * * @param entityClass required class of entity * @param handler is invoked when selection confirmed and the lookup screen closes * @param openType how to open the screen * @param params parameters to pass to {@code init()} method of the screen's controller * @return created window * * @deprecated Use {@link ScreenBuilders} bean instead. */ @Deprecated default AbstractLookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler, WindowManager.OpenType openType, Map<String, Object> params) { WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME); WindowInfo lookupScreen = windowConfig.getLookupScreen(entityClass); return (AbstractLookup) getWindowManager().openLookup(lookupScreen, handler, openType, params); }
protected WindowInfo getScreenInfo(Class<? extends Screen> screenClass) { UiController uiController = screenClass.getAnnotation(UiController.class); if (uiController == null) { throw new IllegalArgumentException("No @UiController annotation for class " + screenClass); } String screenId = UiDescriptorUtils.getInferredScreenId(uiController, screenClass); return windowConfig.getWindowInfo(screenId); }
windowAlias = windowConfig.getEditorScreenId(entity.getMetaClass()); windowConfig.getWindowInfo(windowAlias), entity, screenOpenType
protected List<String> getAllScreensIds() { return windowConfig.getWindows().stream() .map(WindowInfo::getId) .collect(Collectors.toList()); }
/** * @return editor screen identifier */ public String getWindowId() { if (windowId != null) { return windowId; } else { MetaClass metaClass = target.getDatasource().getMetaClass(); WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME); return windowConfig.getEditorScreenId(metaClass); } }
if (!windowConfig.hasWindow(defaultScreenId)) { log.info("Can't find default screen: {}", defaultScreenId); return;