use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class StorageProviders method edit.
@FlashException("list")
public static void edit(String id) {
addReferenceData();
StorageProviderRestRep provider = StorageProviderUtils.getStorageProvider(uri(id));
if (provider != null) {
StorageProviderForm smisProvider = new StorageProviderForm(provider);
copyRenderArgsToAngular();
angularRenderArgs().put("smisProvider", smisProvider);
render(smisProvider);
} else {
flash.error(MessagesUtils.get(UNKNOWN, id));
list();
}
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class StorageProviders method save.
@FlashException(keep = true, referrer = { "create", "edit" })
public static void save(StorageProviderForm smisProvider) {
smisProvider.validate("smisProvider");
if (Validation.hasErrors()) {
Common.handleError();
}
URI providerUri = smisProvider.save();
flash.success(MessagesUtils.get(SAVED, smisProvider.name));
// check if checklist is running on this step
JsonObject jobject = getCookieAsJson(VIPR_START_GUIDE);
if (jobject != null && jobject.get(GUIDE_COMPLETED_STEP) != null && jobject.get(GUIDE_VISIBLE) != null) {
if (jobject.get(GUIDE_COMPLETED_STEP).getAsInt() == 3 && jobject.get(GUIDE_VISIBLE).getAsBoolean()) {
JsonObject dataObject = getCookieAsJson(GUIDE_DATA);
JsonArray storage_systems = dataObject.getAsJsonArray(STORAGE_SYSTEMS);
if (storage_systems == null) {
storage_systems = new JsonArray();
}
boolean addToCookie = true;
for (Object storageObject : storage_systems) {
JsonObject storagearray = (JsonObject) storageObject;
if (storagearray.get("id") != null) {
String arrayId = storagearray.get("id").getAsString();
if (StringUtils.equals(arrayId, providerUri.toString())) {
// update case, don't add in cookie
addToCookie = false;
break;
}
}
}
if (addToCookie) {
JsonObject storage = new JsonObject();
storage.addProperty("id", providerUri.toString());
storage.addProperty("name", smisProvider.name);
storage_systems.add(storage);
dataObject.add(STORAGE_SYSTEMS, storage_systems);
saveJsonAsCookie(GUIDE_DATA, dataObject);
}
list();
}
}
backToReferrer();
list();
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class StorageSystems method dissociateProject.
@FlashException(keep = true, referrer = { "virtualNasServers" })
public static void dissociateProject(@As(",") String[] projectIdsToDissociate, String nasIds, String storageId) {
if (projectIdsToDissociate != null && projectIdsToDissociate.length > 0) {
for (String projectId : projectIdsToDissociate) {
Set<String> vNASSet = new HashSet<String>();
vNASSet.add(nasIds);
VirtualNasParam vNasParam = new VirtualNasParam();
vNasParam.setVnasServers(vNASSet);
getViprClient().virtualNasServers().unassignVnasServers(uri(projectId), vNasParam);
}
}
virtualNasServers(storageId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class StorageSystems method savePool.
@FlashException(keep = true, referrer = { "editPool" })
public static void savePool(StorageArrayPoolForm storageArrayPool) {
storageArrayPool.validate("storageArrayPool");
if (Validation.hasErrors()) {
Common.handleError();
}
StoragePoolRestRep pool = storageArrayPool.save();
flash.success(MessagesUtils.get(SAVED_POOL, pool.getPoolName()));
pools(stringId(pool.getStorageSystem()));
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class Certificates method delete.
@FlashException(value = "list")
public static void delete(@As(",") List<String> ids) {
TrustedCertificateChanges changes = new TrustedCertificateChanges();
changes.setRemove(ids);
api().updateTrustedCertificate(changes);
flash.success(MessagesUtils.get("certificateChanges.submittedReconfigure"));
list();
}
Aggregations