@Override public void register(Datasource datasource) { datasourceMap.put(datasource.getId(), datasource); }
@Override public void unregister(Datasource datasource) { datasourceMap.remove(datasource.getId()); }
protected String getDatasourceId(Element element) { String id = element.attributeValue("id"); for (Datasource datasource : context.getAll()) { if (Objects.equals(datasource.getId(), id)) throw new DevelopmentException("Duplicated datasource id: " + id); } return id; } }
protected void initRuntimePropertiesDatasources(View view) { rDS = new RuntimePropsDatasourceImpl(dsContext, dataSupplier, "rDS", datasource.getId(), null); MetaClass categoriesMeta = metadata.getSession().getClass(Category.class); categoriesDs = new CollectionDatasourceImpl(); ViewProperty categoryProperty = view.getProperty("category"); if (categoryProperty == null) { throw new IllegalArgumentException("Category property not found. Not a categorized entity?"); } categoriesDs.setup(dsContext, dataSupplier, "categoriesDs", categoriesMeta, categoryProperty.getView()); categoriesDs.setQuery(String.format("select c from sys$Category c where c.entityType='%s'", meta.getName())); categoriesDs.refresh(); dsContext.register(rDS); dsContext.register(categoriesDs); }
View masterView = masterDs.getView(); if (masterView == null) { throw new DevelopmentException("No view for datasource " + masterDs.getId(), ParamsMap.of("masterDs", masterDs.getId(), "propertyDs", getId())); String.format("Invalid view definition: %s. Property '%s' must have a view", masterView, property), ParamsMap.of("masterDs", masterDs.getId(), "propertyDs", getId(), "masterView", masterView,