Example usage for com.liferay.portal.kernel.deploy DeployManagerUtil undeploy

List of usage examples for com.liferay.portal.kernel.deploy DeployManagerUtil undeploy

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.deploy DeployManagerUtil undeploy.

Prototype

public static void undeploy(String context) throws Exception 

Source Link

Usage

From source file:com.liferay.marketplace.app.manager.web.internal.portlet.MarketplaceAppManagerPortlet.java

License:Open Source License

public void uninstallApp(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    long remoteAppId = ParamUtil.getLong(actionRequest, "remoteAppId");

    if (remoteAppId > 0) {
        _appService.uninstallApp(remoteAppId);
    } else {//from  w  ww  . j  av  a2s.c  o  m
        String[] contextNames = StringUtil.split(ParamUtil.getString(actionRequest, "contextNames"));

        for (String contextName : contextNames) {
            DeployManagerUtil.undeploy(contextName);
        }
    }

    SessionMessages.add(actionRequest, "triggeredPortletUndeploy");
}

From source file:com.liferay.marketplace.appmanager.portlet.AppManagerPortlet.java

License:Open Source License

public void uninstallApp(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    long remoteAppId = ParamUtil.getLong(actionRequest, "remoteAppId");

    if (remoteAppId > 0) {
        AppServiceUtil.uninstallApp(remoteAppId);
    } else {//  w  w w .ja  va  2  s .c o m
        String[] contextNames = StringUtil.split(ParamUtil.getString(actionRequest, "contextNames"));

        for (String contextName : contextNames) {
            DeployManagerUtil.undeploy(contextName);
        }
    }

    SessionMessages.add(actionRequest, "triggeredPortletUndeploy");
}

From source file:com.liferay.marketplace.service.impl.AppLocalServiceImpl.java

License:Open Source License

@Override
public void uninstallApp(long remoteAppId) throws PortalException {
    clearInstalledAppsCache();// w w w.ja  va2s .co m

    App app = appPersistence.findByRemoteAppId(remoteAppId);

    List<Module> modules = modulePersistence.findByAppId(app.getAppId());

    for (Module module : modules) {
        moduleLocalService.deleteModule(module.getModuleId());

        if (Validator.isNotNull(module.getBundleSymbolicName())
                && Validator.isNotNull(module.getBundleVersion())) {

            BundleUtil.uninstallBundle(module.getBundleSymbolicName(), module.getBundleVersion());

            continue;
        }

        if (hasDependentApp(module)) {
            continue;
        }

        try {
            DeployManagerUtil.undeploy(module.getContextName());
        } catch (Exception e) {
            _log.error(e, e);
        }
    }
}

From source file:com.liferay.server.manager.internal.executor.PluginExecutor.java

License:Open Source License

@Override
public void executeDelete(HttpServletRequest request, JSONObject responseJSONObject, Queue<String> arguments)
        throws Exception {

    String context = arguments.poll();

    DeployManagerUtil.undeploy(context);
}