Search in sources :

Example 1 with FlashException

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);
}
Also used : OrderDetails(controllers.catalog.Orders.OrderDetails) FlashException(controllers.util.FlashException)

Example 2 with FlashException

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));
}
Also used : NetworkSystemRestRep(com.emc.storageos.model.network.NetworkSystemRestRep) FlashException(controllers.util.FlashException)

Example 3 with FlashException

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();
}
Also used : JsonArray(com.google.gson.JsonArray) JsonObject(com.google.gson.JsonObject) JsonObject(com.google.gson.JsonObject) FlashException(controllers.util.FlashException)

Example 4 with FlashException

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));
}
Also used : AuthnProviderRestRep(com.emc.storageos.model.auth.AuthnProviderRestRep) FlashException(controllers.util.FlashException)

Example 5 with FlashException

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();
    }
}
Also used : RoleAssignmentType(models.RoleAssignmentType) RoleAssignmentEntry(com.emc.storageos.model.auth.RoleAssignmentEntry) RoleAssignmentUtils.createRoleAssignmentEntry(util.RoleAssignmentUtils.createRoleAssignmentEntry) FlashException(controllers.util.FlashException)

Aggregations

FlashException (controllers.util.FlashException)122 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)45 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)9 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)9 URI (java.net.URI)9 ExportUpdateParam (com.emc.storageos.model.block.export.ExportUpdateParam)8 Restrictions (controllers.deadbolt.Restrictions)8 ArrayList (java.util.ArrayList)7 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)6 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)5 CopiesParam (com.emc.storageos.model.block.CopiesParam)4 SiteRestRep (com.emc.storageos.model.dr.SiteRestRep)4 ExportRule (com.emc.storageos.model.file.ExportRule)4 ExportRules (com.emc.storageos.model.file.ExportRules)4 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)4 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)4 ServiceErrorException (com.emc.vipr.client.exceptions.ServiceErrorException)4 JsonArray (com.google.gson.JsonArray)3 JsonObject (com.google.gson.JsonObject)3 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)2