/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { displayFullPath = configuration.getBooleanProperty("fullPath", false); }
private boolean hasMultipleElementsOnRow(VLViewComponentXML rowConfig) { VLViewComponentXML rowsConfig = rowConfig.getComponentById("Rows").orElse(null); return rowsConfig != null && rowsConfig.hasSubComponent() && rowsConfig.getSubcomponents().size() > 1; }
/** * Buils all tabs */ protected void buildTabs() { VLViewComponentXML tabsConfiguration = rootConfiguration.getComponentById("ListViewTabs").orElse(null); if ((tabsConfiguration != null) && tabsConfiguration.hasSubComponent()) { for (VLViewComponentXML tabConfig : tabsConfiguration.getSubcomponents()) { String contentImpl = tabConfig.getPropertyValue("contentImpl"); if (StringUtils.isNotBlank(contentImpl)) { ListViewTab listViewTab = (ListViewTab) Services.getBean(contentImpl); listViewTab.setListviewPaneContent(this); listViewTab.buildFrom((IEmaginController) controller, tabConfig); tabs.add(listViewTab); } } } }
/** * Default Constructor */ public ColumnsDef(VLViewComponentXML columnConfig, TableColumnBase column) { this.columnConfig = columnConfig; responsiveOrder = columnConfig.getResponsiveOrder(); columnId = columnConfig.getId(); this.column = column; } }
public static boolean isAttributeMandatory(final VLViewComponentXML attrConfig) { final VLViewComponentXML displayConfig = attrConfig.getNullableComponentById(XMLConstants.VALIDATION_CONFIG); boolean mandatory = false; if (displayConfig != null) { mandatory = displayConfig.getBooleanProperty(XMLConstants.MANDATORY); } return mandatory; }
public VLViewComponentXML getEllipsisMenuConfiguration() { if ((configuration != null) && configuration.hasSubComponent()) { for (VLViewComponentXML subComp : configuration.getSubcomponents()) { if (subComp.getId().equalsIgnoreCase("EllipsisMenu")) { return subComp; } } } return null; }
protected static void copySourcesAttributes(VLViewComponentXML referenced, VLViewComponentXML resolved) { if(referenced.getVisibleIf() != null) resolved.setVisibleIf(referenced.getVisibleIf()); if(referenced.getCriteria() != null && resolved.getCriteria() == null) resolved.setCriteria(referenced.getCriteria()); if(referenced.getSeparatorAfter() != null) resolved.setSeparatorAfter(referenced.getSeparatorAfter()); if(referenced.getResponsiveOrder() != null) resolved.setResponsiveOrder(referenced.getResponsiveOrder()); if(referenced.getMasterColumn() != null) resolved.setMasterColumn(referenced.getMasterColumn()); if (StringUtils.isNotBlank(referenced.getDefaultButton())) { if(!resolved.getProperties().containsKey("default")) resolved.getProperties().put("default", referenced.getDefaultButton()); } if (referenced.getComponentById(VALIDATOR) != null) { if (resolved.getComponentById(VALIDATOR) != null) { final Optional<VLViewComponentXML> comp = resolved.getComponentById(VALIDATOR); comp.ifPresent(c -> resolved.getSubcomponents().remove(c)); } final Optional<VLViewComponentXML> d = referenced.getComponentById(VALIDATOR); d.ifPresent(f -> resolved.getSubcomponents().add(f)); } }
/** * Process tabs building */ protected void buildTabsArea() { if (tabComponents != null) { if (tabComponents != null && tabComponents.getSubcomponents() != null && tabComponents.hasSubComponent()) { for (final VLViewComponentXML tabDefinition : tabComponents.getSubcomponents()) { // Process tab and its title final String title = tabDefinition.getPropertyValue(XMLConstants.TITLE); final QuaternaryMenuTab styledTab = new QuaternaryMenuTab(tabDefinition, controller.getLocalised(title)); styledTab.setInternalId(tabDefinition.getId()); addTab(styledTab); } } if (!getTabs().isEmpty()) { selectTab(getTabs().get(0)); } } }
protected void buildDefaultActions() { if (defaultActionsConfiguration != null && defaultActionsConfiguration.hasSubComponent()) { defaultActions = ComponentUtils.resolveAndGenerate(controller, defaultActionsConfiguration.getSubcomponents()); } }
@Override public void initFromConfiguration(IEmaginController controller, VLViewComponentXML componentConfiguration) { linkClass = componentConfiguration.getPropertyValue("linkClass"); linkConstraintName = componentConfiguration.getPropertyValue("linkConstraintName"); linkType = componentConfiguration.getPropertyValue("linkType"); masterLink = componentConfiguration.getBooleanProperty("masterLink", false); if (StringUtils.isNotBlank(linkType)) { loadAttributesDefinition(); } final String countOperation = componentConfiguration.getPropertyValue("countOperation"); if (StringUtils.isNotBlank(countOperation)) { this.countOperation = (IOperation) Services.getBean(countOperation); } final String paginateOperation = componentConfiguration.getPropertyValue("paginateOperation"); if (StringUtils.isNotBlank(paginateOperation)) { this.paginateOperation = (IOperation) Services.getBean(paginateOperation); } }
if (blocConfig.propertyValueOf(XMLConstants.TITLE).isPresent()) { final Node titleBloc = buildBloctitle(blocConfig, controller); container.getChildren().add(titleBloc); container.getChildren().add(rowsWrapper); NodeHelper.setHVGrow(rowsWrapper); final String styleClass = blocConfig.getPropertyValue("contentStyleClass"); if (StringUtils.isNotBlank(styleClass)) { rowsWrapper.getStyleClass().addAll(styleClass.split(",")); Iterator<VLViewComponentXML> iterator = blocConfig.getSubcomponents().iterator(); while (iterator.hasNext()) { VLViewComponentXML rowConfig = iterator.next(); final String modeString = blocConfig.getPropertyValue(XMLConstants.MODE);
public void buildHeader() { headerConfiguration = rootConfiguration.getComponentById("Header").orElse(null); String headerImpl = "ListViewPaneHeader"; if (headerConfiguration != null) { headerImpl = headerConfiguration.getPropertyValue("headerImpl", "ListViewPaneHeader"); header = (IBuildable) Services.getBean(headerImpl); header.buildFrom(controller, headerConfiguration); } }
/** * Setter of configuration * * @param configuration the configuration to set */ @Override public void setConfiguration(VLViewComponentXML configuration) { this.configuration = configuration; if (configuration != null) { mainLabelStyles = configuration.getPropertyValue("mainLabelStyleClass"); descriptionLabelStyles = configuration.getPropertyValue("descriptionLabelStyleClass"); } }
for (VLViewComponentXML componentXML : rootData.getSubcomponents()) { OperationData data = new OperationData(); data.getAttributes().put("fullId", ((OperationData) res.rootData()).getAttributes().get("fullId")); data.getAttributes().put("name", NodeHelper.getTitle(componentXML, (AbstractViewController) controller)); for(String k: componentXML.getProperties().keySet()) { data.getAttributes().put(k, componentXML.getProperties().get(k)); if (componentXML.hasSubComponent()) { data.getMeta().put("subComponents", componentXML.getSubcomponents()); multipleResult.addMetaData("pageSize", rootData.getSubcomponents().size()); multipleResult.addMetaData("pageNumber", 0); multipleResult.addMetaData("totalPages", 1); multipleResult.addMetaData("hasNextPage", false); multipleResult.addMetaData("hasPreviousPage", false); multipleResult.addMetaData("pageElements", rootData.getSubcomponents().size()); multipleResult.addMetaData("totalElements", rootData.getSubcomponents().size()); consumer.accept(multipleResult);
public static StructureContentController forId(RootStructureContentController rootStructureContentController, RootStructureController rootStructure, PushStructureContentEvent fromPush, VLViewComponentXML config) { Assert.notNull(rootStructure); Assert.notNull(config); String structureContentImpl = config.getPropertyValue("viewLayout"); boolean isWizard = config.getBooleanProperty("isWizardView", false); StructureContentController controller = (StructureContentController) Services.getBean(structureContentImpl); if (fromPush != null) { controller.setSourceEvent(fromPush); controller.setFormModelData((OperationData) fromPush.getModel()); controller.setForModelId(fromPush.getModelFullId()); } controller.setRootStructureContent(rootStructureContentController); controller.setRootStructure(rootStructure); // controller.setWizardView(isWizard); // must build config manually because it does not exist final VLViewConfigXML configXML = new VLViewConfigXML(); configXML.addEmptyRootContent(); VLViewComponentXML rootComp = configXML.getComponents().get(0); rootComp.setProperties(config.getProperties()); controller.initViewContext(configXML, rootStructure.getRootContext()); controller.setInitialized(true); controller.build(); return controller; }
public void build(VLViewComponentXML configuration, AbstractViewController controller, CriteriaContext criteriaContext) { List<VLViewComponentXML> configurations = configuration.getSubcomponents(); build(configurations, controller, criteriaContext, null); String ellipsysStyleClass = configuration.getPropertyValue("ellipsysStyleClass"); if (StringUtils.isNotBlank(ellipsysStyleClass)) { ellipsisButton.getStyleClass().addAll(ellipsysStyleClass.split(",")); } }
/** * Read property mandatory from config of attribute * * @param attrConfig * @return */ public boolean isAttributeMandatory() { final VLViewComponentXML displayConfig = getComponentById("ValidationConfig").orElse(null); if (displayConfig != null) { return displayConfig.getBooleanProperty(XMLConstants.MANDATORY, false); } return false; }
VLViewComponentXML row = new VLViewComponentXML(); row.getProperties().put("defaultValue", defaultValue); row.getProperties().put("sourceValueListKeys", sourceValueListKeys); row.getProperties().put("enumeratedDataLoader", enumeratedDataLoader); row.getProperties().put("label", label); row.getProperties().put("prompt", prompt); row.getProperties().put("viewUtility", viewUtility); row.getProperties().put("editUtility", editUtility); row.getProperties().put("attributeName", attributeName); row.getProperties().put("attributePath", attributePath); row.getProperties().put("enumeratedDataLoader", enumeratedDataLoader); row.getProperties().put("enumeratedKey", enumeratedKey); row.getProperties().put("displayOrder", displayOrder); VLViewComponentXML validationConfig = new VLViewComponentXML(); validationConfig.setId("Validation"); validationConfig.getProperties().put("mandatory", mandatory); validationConfig.getProperties().put("minLength", minLength); validationConfig.getProperties().put("maxLength", maxLength); validationConfig.getProperties().put("minValue", minValue); validationConfig.getProperties().put("maxValue", maxValue); validationConfig.getProperties().put("blankAllowed", blankAllowed); row.addSubconfg(validationConfig); VLViewComponentXML formatConfig = new VLViewComponentXML(); formatConfig.setId("Format"); row.addSubconfg(formatConfig);
/** * */ public void addSubconfg(VLViewComponentXML config) { if (getSubcomponents() == null) { subcomponents = new ArrayList<>(); } subcomponents.add(config); }
/** * @{inheritedDoc} */ @Override public VLViewComponentXML getToolbarConfiguration() { return configuration.getComponentById("Actions").orElse(null); }