use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class ScheduledOrders method edit.
@FlashException("list")
public static void edit(String id) {
OrderDetails details = new OrderDetails(id);
details.catalogService = CatalogServiceUtils.getCatalogService(details.order.getCatalogService());
ScheduleEventForm scheduleEventForm = new ScheduleEventForm(details);
angularRenderArgs().put("scheduler", scheduleEventForm);
render(scheduleEventForm, details);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class SanSwitches method edit.
@FlashException("list")
public static void edit(String id) {
NetworkSystemRestRep networkSystem = NetworkSystemUtils.getNetworkSystem(id);
if (networkSystem == null) {
flash.error(MessagesUtils.get(UNKNOWN, id));
list();
}
edit(new SanSwitchForm(networkSystem));
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class SanSwitches method save.
@FlashException(keep = true, referrer = { "create", "edit" })
public static void save(SanSwitchForm sanSwitch) {
sanSwitch.validate("sanSwitch");
if (Validation.hasErrors()) {
Common.handleError();
}
Task<?> sanTask = sanSwitch.save();
flash.success(MessagesUtils.get(SAVED, sanSwitch.name));
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() == 4 && jobject.get(GUIDE_VISIBLE).getAsBoolean()) {
JsonObject dataObject = getCookieAsJson(GUIDE_DATA);
JsonArray fabrics = dataObject.getAsJsonArray(GUIDE_FABRICS);
if (fabrics == null) {
fabrics = new JsonArray();
}
boolean addToCookie = true;
for (Object fabricObject : fabrics) {
JsonObject sanswitch = (JsonObject) fabricObject;
if (sanswitch.get("id") != null) {
String fabricId = sanswitch.get("id").getAsString();
if (StringUtils.equals(fabricId, sanTask.getResourceId().toString())) {
// update case, don't add in cookie
addToCookie = false;
break;
}
}
}
if (addToCookie) {
JsonObject fabric = new JsonObject();
fabric.addProperty("id", sanTask.getResourceId().toString());
fabric.addProperty("name", sanSwitch.name);
fabrics.add(fabric);
dataObject.add("fabrics", fabrics);
saveJsonAsCookie("GUIDE_DATA", dataObject);
}
}
}
list();
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class LDAPsources method edit.
@FlashException("list")
public static void edit(String id) {
AuthnProviderRestRep authnProvider = AuthnProviderUtils.getAuthnProvider(id);
if (authnProvider == null) {
flash.error(MessagesUtils.get(UNKNOWN, id));
list();
}
authProviderAutoReg = authnProvider.getAutoRegCoprHDNImportOSProjects();
edit(new LDAPsourcesForm(authnProvider));
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VDCRoleAssignments method edit.
@FlashException("list")
public static void edit(@Required String id) {
String name = VDCRoleAssignmentForm.extractNameFromId(id);
RoleAssignmentType type = VDCRoleAssignmentForm.extractTypeFromId(id);
RoleAssignmentEntry roleAssignmentEntry = getVDCRoleAssignment(name, type);
if (roleAssignmentEntry != null) {
addRolesToRenderArgs();
Boolean isRootUser = RoleAssignmentUtils.isRootUser(roleAssignmentEntry);
VDCRoleAssignmentForm roleAssignment = new VDCRoleAssignmentForm();
roleAssignment.id = id;
roleAssignment.readFrom(roleAssignmentEntry);
render(roleAssignment, isRootUser);
} else {
flash.error(MessagesUtils.get("roleAssignments.unknown", name));
list();
}
}
Aggregations