All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web.carbonapps.delete_artifact.jsp Maven / Gradle / Ivy


<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
<%@ page import="org.wso2.carbon.CarbonConstants" %>
<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
<%@ page import="java.util.ResourceBundle" %>
<%@ page import="org.wso2.carbon.application.mgt.ui.ApplicationAdminClient" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
<%@ page import="org.wso2.carbon.ui.util.CharacterEncoder" %>

<%
    String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
    ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
            .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);

    String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

    String BUNDLE = "org.wso2.carbon.application.mgt.ui.i18n.Resources";
    ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE, request.getLocale());

    String appName = CharacterEncoder.getSafeText(request.getParameter("appName"));

    try {
        ApplicationAdminClient client = new ApplicationAdminClient(cookie,
                backendServerURL, configContext, request.getLocale());
        String msg = "";
        if (appName != null) {
            client.deleteApp(appName);
            msg = bundle.getString("successfully.deleted.app") + " " + appName + ". " +
                    bundle.getString("refresh.capp.page");
        }
        CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.INFO, request);
    } catch (Exception e) {
        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request, e);
    }
%>






© 2015 - 2025 Weber Informatics LLC | Privacy Policy