private TablePropertyDefinition getPropByName(String name) { return TablePropertyDefinitionUtils.getPropertyByName(name); }
public SimplePriorityRuleWrapper(String priorityRule, String operationName, String propertyName) { super(priorityRule); this.operationName = operationName; this.propertyName = propertyName; propertyType = TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(propertyName); }
public String getTableName (IOpenLTable table) { String[] dimensionProps = TablePropertyDefinitionUtils.getDimensionalTablePropertiesNames(); ITableProperties tableProps = table.getProperties(); StringBuilder dimensionBuilder = new StringBuilder(); String tableName = table.getDisplayName(); if (tableProps != null) { for (String dimensionProp : dimensionProps) { String propValue = tableProps.getPropertyValueAsString(dimensionProp); if (propValue != null && !propValue.isEmpty()) { dimensionBuilder.append(dimensionBuilder.length() == 0 ? "" : ", ").append(dimensionProp).append(" = ").append(propValue); } } } if (dimensionBuilder.length() > 0) { return tableName +" ["+ dimensionBuilder.toString() +"]"; } else { return tableName; } }
propertyName = propertyName.substring(0, t); if (!TablePropertyDefinitionUtils.isPropertyExist(propertyName)) { throw new InvalidFileNamePatternException( "Wrong file name pattern! Unknown property: " + propertyName); Class<?> returnType = TablePropertyDefinitionUtils.getTypeByPropertyName(propertyName);
private void checkVersionPropertyExistance(){ TableProperty versionProperty = super.getVersion(); if(versionProperty == null){ //property "version" is absent in base table versionProperty = new TablePropertyBuilder(VERSION_PROP_NAME, TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(VERSION_PROP_NAME)) .displayName(TablePropertyDefinitionUtils.getPropertyDisplayName(VERSION_PROP_NAME)) .value(INIT_VERSION).build(); getPropertiesManager().addProperty(versionProperty); } }
private SystemValuesManager() { for (TablePropertyDefinition propDef :TablePropertyDefinitionUtils.getSystemProperties()) { if (CURRENT_USER_DESCRIPTOR.equals(propDef.getSystemValueDescriptor())) { if (!systemValues.containsKey(CURRENT_USER_DESCRIPTOR)) { systemValues.put(CURRENT_USER_DESCRIPTOR, new CurrentUserValue()); } } else if (CURRENT_DATE_DESCRIPTOR.equals(propDef.getSystemValueDescriptor())) { if (!systemValues.containsKey(CURRENT_DATE_DESCRIPTOR)) { systemValues.put(CURRENT_DATE_DESCRIPTOR, new CurrentDateValue()); } } } }
public List<SelectItem> getPropertyList() { List<SelectItem> propertyNames = new ArrayList<SelectItem>(); TablePropertyDefinition[] propDefinitions = TablePropertyDefinitionUtils .getDefaultDefinitionsForTable(TABLE_TYPE, InheritanceLevel.TABLE, true); SelectItem selectItem = new SelectItem(""); selectItem.setLabel(""); propertyNames.add(selectItem); Map<String, List<TablePropertyDefinition>> propGroups = TablePropertyDefinitionUtils .groupProperties(propDefinitions); for (Map.Entry<String, List<TablePropertyDefinition>> entry : propGroups.entrySet()) { List<SelectItem> items = new ArrayList<SelectItem>(); for (TablePropertyDefinition propDefinition : entry.getValue()) { String propName = propDefinition.getName(); if (propDefinition.getDeprecation() == null) { items.add(new SelectItem(propName, propDefinition.getDisplayName())); } } if (!items.isEmpty()) { SelectItemGroup itemGroup = new SelectItemGroup(entry.getKey()); itemGroup.setSelectItems(items.toArray(new SelectItem[items.size()])); propertyNames.add(itemGroup); } } return propertyNames; }
/** * Gets the array of properties names that are dimensional. * * @return names of properties that are dimensional. */ public static String[] getDimensionalTablePropertiesNames() { if (dimensionalTablePropertiesNames == null) { List<String> names = new ArrayList<String>(); List<TablePropertyDefinition> dimensionalProperties = getDimensionalTableProperties(); for (TablePropertyDefinition definition : dimensionalProperties) { names.add(definition.getName()); } dimensionalTablePropertiesNames = names.toArray(new String[names.size()]); } return dimensionalTablePropertiesNames; }
private Map<String, Object> initPropListForUI(TableSyntaxNode tableSearch) { Map<String, Object> prop = new HashMap<String, Object>(); for(TableProperty propForSearch : propsForSearch) { String propName = propForSearch.getName(); String propDisplName = TablePropertyDefinitionUtils.getPropertyDisplayName(propName); Object propValue = tableSearch.getTableProperties().getPropertyValue(propName); if(propValue==null) { propValue = new String(EMPTY_VALUE); } prop.put(propDisplName, propValue); } return prop; }
public List<String> getPropertyNamesList() { List<String> propertyNames = new ArrayList<String>(); TablePropertyDefinition[] propDefinitions = TablePropertyDefinitionUtils .getDefaultDefinitionsByInheritanceLevel(InheritanceLevel.valueOf(scopeType.toUpperCase())); for (TablePropertyDefinition propDefinition : propDefinitions) { String propName = propDefinition.getName(); List<String> exceptProperties = getExceptProperties(); if (!exceptProperties.contains(propName)) { propertyNames.add(propName); } } return propertyNames; }
public static TablePropertyDefinition[] getDefaultDefinitionsForTable(String tableType) { return getDefaultDefinitionsForTable(tableType, null, false); }
private void initSearchQuery() { String query = FacesUtils.getRequestParameter(SEARCH_PARAMS[0]); String tableTypes = FacesUtils.getRequestParameter(SEARCH_PARAMS[1]); String tableHeader = FacesUtils.getRequestParameter(SEARCH_PARAMS[2]); if (StringUtils.isNotBlank(query)) { // Replace all non-breaking spaces by breaking spaces String spaceToRemove = Character.toString((char) 160); query = query.replaceAll(spaceToRemove, " "); this.query = query; } if (StringUtils.isNotBlank(tableTypes)) { this.tableTypes = tableTypes.split("-"); } this.tableHeader = tableHeader; // Init properties query Map<String, String> requestParams = FacesUtils.getRequestParameterMap(); for (Map.Entry<String, String> entry: requestParams.entrySet()) { String paramName = entry.getKey(); if (!ArrayUtils.contains(SEARCH_PARAMS, paramName) && TablePropertyDefinitionUtils.isPropertyExist(paramName)) { TableProperty property = getPropertyByName(paramName); String propertyValue = entry.getValue(); property.setStringValue(propertyValue); } } }
private void checkPropertiesExistance() { TableProperty versionProperty = super.getVersion(); if (versionProperty == null) { // Property "version" is absent in base table versionProperty = new TablePropertyBuilder(VERSION_PROP_NAME, TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(VERSION_PROP_NAME)) .displayName(TablePropertyDefinitionUtils.getPropertyDisplayName(VERSION_PROP_NAME)) .value(getOriginalVersion().toString()).build(); getPropertiesManager().addProperty(versionProperty); } }
private SystemValuesManager() { for (TablePropertyDefinition propDef :TablePropertyDefinitionUtils.getSystemProperties()) { if (CURRENT_USER_DESCRIPTOR.equals(propDef.getSystemValueDescriptor())) { if (!systemValues.containsKey(CURRENT_USER_DESCRIPTOR)) { systemValues.put(CURRENT_USER_DESCRIPTOR, new CurrentUserValue()); } } else if (CURRENT_DATE_DESCRIPTOR.equals(propDef.getSystemValueDescriptor())) { if (!systemValues.containsKey(CURRENT_DATE_DESCRIPTOR)) { systemValues.put(CURRENT_DATE_DESCRIPTOR, new CurrentDateValue()); } } } }
public List<SelectItem> getPropertyList() { List<SelectItem> propertyNames = new ArrayList<SelectItem>(); TablePropertyDefinition[] propDefinitions = TablePropertyDefinitionUtils .getDefaultDefinitionsForTable(TABLE_TYPE, InheritanceLevel.TABLE, true); SelectItem selectItem = new SelectItem(""); selectItem.setLabel(""); propertyNames.add(selectItem); Map<String, List<TablePropertyDefinition>> propGroups = TablePropertyDefinitionUtils .groupProperties(propDefinitions); for (Map.Entry<String, List<TablePropertyDefinition>> entry : propGroups.entrySet()) { List<SelectItem> items = new ArrayList<SelectItem>(); for (TablePropertyDefinition propDefinition : entry.getValue()) { String propName = propDefinition.getName(); if (propDefinition.getDeprecation() == null) { items.add(new SelectItem(propName, propDefinition.getDisplayName())); } } if (!items.isEmpty()) { SelectItemGroup itemGroup = new SelectItemGroup(entry.getKey()); itemGroup.setSelectItems(items.toArray(new SelectItem[items.size()])); propertyNames.add(itemGroup); } } return propertyNames; }
/** * Initialize domain collectors for each dimension property. */ private void initDomainCollectors() { for (TablePropertyDefinition property : TablePropertyDefinitionUtils.getDimensionalTableProperties()) { IDomainCollector domainCollector = getDomainCollector(property); if (domainCollector != null) { domainCollectors.put(property.getName(), domainCollector); } } }
@Override public ValidationResult validateTables(OpenL openl, TableSyntaxNode[] tableSyntaxNodes, IOpenClass openClass) { Collection<OpenLMessage> messages = new LinkedHashSet<>(); for (TableSyntaxNode tsn : tableSyntaxNodes) { if (PropertiesChecker.isPropertySuitableForTableType(propertyName, tsn.getType()) && (tsn.getTableProperties() != null && tsn.getTableProperties() .getPropertyLevelDefinedOn(propertyName) == InheritanceLevel.TABLE)) { String propertyValue = (String) tsn.getTableProperties().getPropertyValue(propertyName); if (propertyValue == null || !propertyValue.matches(constraintsStr)) { SyntaxNodeException exception = SyntaxNodeExceptionUtils .createError(String.format("Incorrect value \"%s\" for property \"%s\"", propertyValue, TablePropertyDefinitionUtils.getPropertyDisplayName(propertyName)), tsn); tsn.addError(exception); messages.add(new OpenLErrorMessage(exception)); } } } return ValidationUtils.withMessages(messages); }
propertyName = propertyName.substring(0, t); if (!TablePropertyDefinitionUtils.isPropertyExist(propertyName)) { throw new InvalidFileNamePatternException( "Wrong file name pattern! Unknown property: " + propertyName); Class<?> returnType = TablePropertyDefinitionUtils.getTypeByPropertyName(propertyName);
public List<String> getPropertyNamesList() { List<String> propertyNames = new ArrayList<String>(); TablePropertyDefinition[] propDefinitions = TablePropertyDefinitionUtils .getDefaultDefinitionsByInheritanceLevel(InheritanceLevel.valueOf(scopeType.toUpperCase())); for (TablePropertyDefinition propDefinition : propDefinitions) { String propName = propDefinition.getName(); List<String> exceptProperties = getExceptProperties(); if (!exceptProperties.contains(propName)) { propertyNames.add(propName); } } return propertyNames; }
public void initPropertyGroups(IOpenLTable table, ITableProperties props) { groups = new LinkedHashMap<String, List<TableProperty>>(); TablePropertyDefinition[] propDefinitions = TablePropertyDefinitionUtils .getDefaultDefinitionsForTable(table.getType()); for (TablePropertyDefinition propDefinition : propDefinitions) { Object value = props.getPropertyValue(propDefinition.getName()); if (value != null) { InheritanceLevel inheritanceLevel = props.getPropertyLevelDefinedOn(propDefinition.getName()); TableProperty prop = new TableProperty(propDefinition); prop.setValue(value); prop.setInheritanceLevel(inheritanceLevel); if (InheritanceLevel.MODULE.equals(inheritanceLevel) || InheritanceLevel.CATEGORY.equals(inheritanceLevel)) { prop.setInheritedTableId(getProprtiesTableId(inheritanceLevel, props)); } storeProperty(prop); } } }