use of util.StringOption in project coprhd-controller by CoprHD.
the class StorageSystemTypes method getProvidersWithOnlyMDM.
public static List<StringOption> getProvidersWithOnlyMDM() {
String alltypes = "all";
List<StringOption> allproviders = new ArrayList<StringOption>();
StorageSystemTypeList storagetypelist = StorageSystemTypeUtils.getAllStorageSystemTypes(alltypes);
for (StorageSystemTypeRestRep storagetypeRest : storagetypelist.getStorageSystemTypes()) {
if (storagetypeRest.getIsOnlyMDM()) {
allproviders.add(new StringOption(storagetypeRest.getStorageTypeName(), storagetypeRest.getStorageTypeDispName()));
}
}
return allproviders;
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class StorageSystems method edit.
@FlashException("list")
public static void edit(String id) {
addReferenceData();
StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
if (storageSystem != null) {
StorageSystemForm storageArray = new StorageSystemForm(storageSystem);
if (storageArray.type.equals(SCALEIO)) {
renderArgs.put("storageArrayTypeList", StorageProviderTypes.getProviderOption());
}
if (storageArray.type.equals("xtremio")) {
renderArgs.put("storageArrayTypeList", StorageProviderTypes.getProviderOption());
}
if (storageArray.unregistered) {
flash.put("warning", MessagesUtils.get(NOT_REGISTERED, storageArray.name));
}
if (storageArray.type.equals(VMAX)) {
@SuppressWarnings("unchecked") List<StringOption> options = (List<StringOption>) renderArgs.get("storageArrayTypeList");
options.add(new StringOption(VMAX, MessagesUtils.get(SMIS_VMAX)));
@SuppressWarnings("unchecked") List<StringOption> smisOptions = (List<StringOption>) renderArgs.get("smisStorageSystemTypeList");
smisOptions.add(new StringOption(VMAX, MessagesUtils.get(SMIS_VMAX)));
}
render(storageArray);
} else {
flash.error(MessagesUtils.get(UNKNOWN, id));
list();
}
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class StorageSystems method getProjectsForNas.
public static void getProjectsForNas() {
List<URI> tenants = Lists.newArrayList();
List<StringOption> allTenants = TenantUtils.getUserSubTenantOptions();
Iterator<StringOption> tenantsIterator = allTenants.iterator();
while (tenantsIterator.hasNext()) {
StringOption tenant = tenantsIterator.next();
if (tenant == null) {
continue;
}
tenants.add(uri(tenant.id));
}
List<StringOption> projectTenantOptions = Lists.newArrayList();
for (URI tenantId : tenants) {
String tenantName = getViprClient().tenants().get(tenantId).getName();
List<String> projectOptions = Lists.newArrayList();
List<ProjectRestRep> projects = getViprClient().projects().getByTenant(tenantId);
for (ProjectRestRep project : projects) {
projectOptions.add(project.getId().toString() + "~~~" + project.getName());
}
projectTenantOptions.add(new StringOption(projectOptions.toString(), tenantName));
}
renderJSON(projectTenantOptions);
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class Orders method addMaxDaysRenderArgs.
private static void addMaxDaysRenderArgs() {
Integer maxDays = params.get("maxDays", Integer.class);
if (maxDays == null) {
if (StringUtils.isNotEmpty(params.get("startDate")) && StringUtils.isNotEmpty(params.get("endDate"))) {
renderArgs.put("startDate", params.get("startDate"));
renderArgs.put("endDate", params.get("endDate"));
maxDays = 0;
} else {
maxDays = 1;
}
}
int[] days = { 1, 7, 14, 30, 90, 0 };
List<StringOption> options = Lists.newArrayList();
options.add(new StringOption(String.valueOf(maxDays), MessagesUtils.get("orders.nDays", maxDays)));
for (int day : days) {
if (day == maxDays) {
options.remove(0);
}
options.add(new StringOption(String.valueOf(day), MessagesUtils.get("orders." + day + "days")));
}
renderArgs.put("offsetInMinutes", params.get("offsetInMinutes"));
renderArgs.put("maxDays", maxDays);
renderArgs.put("dateDaysAgo", OrderDataTable.getDateDaysAgo(maxDays));
renderArgs.put("maxDaysOptions", options);
}
Aggregations