use of models.properties.Property in project coprhd-controller by CoprHD.
the class ConfigProperties method loadPropertyPages.
private static List<PropertyPage> loadPropertyPages() {
boolean isActiveSite = DisasterRecoveryUtils.isActiveSite();
Map<String, Property> properties = loadProperties();
Map<String, PropertyPage> pages = Maps.newLinkedHashMap();
Map<String, PropertyPage> excludePages = Maps.newLinkedHashMap();
if (isActiveSite) {
addPage(pages, new NetworkPropertyPage(properties));
if (PlatformUtils.isAppliance()) {
// This done to maintain the current tab order
addPage(pages, new SecurityPropertyPage(properties));
}
addPage(pages, new ControllerPropertyPage(properties));
addPage(pages, new DiscoveryPropertyPage(properties));
if (!SetupUtils.isOssBuild()) {
addPage(pages, new SupportPropertyPage(properties));
}
addPage(pages, new SmtpPropertyPage(properties));
addPage(pages, new UpgradePropertyPage(properties));
addPage(pages, new PasswordPropertyPage(properties));
addPage(pages, new SyslogPropertiesPage(properties));
addPage(pages, new BackupPropertyPage(properties));
} else {
if (PlatformUtils.isAppliance()) {
addPage(pages, new SecurityPropertyPage(properties));
}
addPage(excludePages, new NetworkPropertyPage(properties));
addPage(excludePages, new ControllerPropertyPage(properties));
addPage(excludePages, new DiscoveryPropertyPage(properties));
addPage(excludePages, new SupportPropertyPage(properties));
addPage(excludePages, new SmtpPropertyPage(properties));
addPage(excludePages, new UpgradePropertyPage(properties));
addPage(excludePages, new DefaultPropertyPage(OTHER));
addPage(excludePages, new PasswordPropertyPage(properties));
addPage(excludePages, new SyslogPropertiesPage(properties));
addPage(excludePages, new BackupPropertyPage(properties));
}
addDefaultPages(pages, properties.values(), excludePages, isActiveSite);
return Lists.newArrayList(pages.values());
}
use of models.properties.Property in project coprhd-controller by CoprHD.
the class ConfigProperties method loadProperties.
private static Map<String, Property> loadProperties() {
Map<String, String> values = ConfigPropertyUtils.getProperties();
Map<String, Property> properties = Maps.newLinkedHashMap();
for (Map.Entry<String, PropertyMetadata> entry : ConfigPropertyUtils.getPropertiesMetadata().getMetadata().entrySet()) {
/*
* image server configuration has been moved to Physical assets but, image server properties meta data
* needs to remain for migration
*/
if (entry.getKey().startsWith("image_server")) {
continue;
}
PropertyMetadata metadata = entry.getValue();
if ((metadata.getUserMutable() != null && metadata.getUserMutable()) && (metadata.getHidden() == null || !metadata.getHidden())) {
String name = entry.getKey();
String value = values.get(name);
PropertyMetadata meta = entry.getValue();
if (value != null) {
if (meta.getType().equals(TEXT) || meta.getType().equals(ENCRYPTEDTEXT)) {
value = value.replace("\\\\n", "\r\n");
}
}
Set<String> allSupportPageProperties = SupportPropertyPage.getAllProperties();
if (!(allSupportPageProperties.contains(name) && SetupUtils.isOssBuild())) {
Property property = new Property(name, value, meta);
properties.put(name, property);
}
}
}
return properties;
}
use of models.properties.Property in project coprhd-controller by CoprHD.
the class ConfigProperties method addDefaultPages.
private static void addDefaultPages(Map<String, PropertyPage> pages, Collection<Property> properties, Map<String, PropertyPage> excludePages, boolean isActiveSite) {
for (Property property : properties) {
String pageName = StringUtils.defaultIfBlank(property.getPageName(), DEFAULT_PAGE);
PropertyPage page = pages.get(pageName);
if (excludePages.get(pageName) == null) {
if (page == null) {
page = addPage(pages, new DefaultPropertyPage(pageName));
}
if (isActiveSite) {
page.getProperties().add(property);
} else {
String propertyName = StringUtils.defaultIfBlank(property.getName(), DEFAULT_PAGE);
if (StringUtils.equals(propertyName, PERMIT_ROOT_CONSOLE) || StringUtils.equals(propertyName, PERMIT_ROOT_SSH)) {
if (!StringUtils.equals(pageName, SECURITY_PAGE)) {
page.getProperties().add(property);
}
} else {
page.getProperties().add(property);
}
}
}
}
}
Aggregations