Example usage for com.liferay.portal.kernel.settings ArchivedSettings delete

List of usage examples for com.liferay.portal.kernel.settings ArchivedSettings delete

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.settings ArchivedSettings delete.

Prototype

public void delete() throws IOException;

Source Link

Usage

From source file:com.liferay.portlet.configuration.web.internal.portlet.PortletConfigurationPortlet.java

License:Open Source License

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

    Portlet portlet = ActionUtil.getPortlet(actionRequest);

    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

    String[] names = null;/*from  ww  w  .j  ava2  s . c  o m*/

    String name = ParamUtil.getString(actionRequest, "name");

    if (Validator.isNotNull(name)) {
        names = new String[] { name };
    } else {
        names = ParamUtil.getStringValues(actionRequest, "rowIds");
    }

    for (String curName : names) {
        ArchivedSettings archivedSettings = SettingsFactoryUtil.getPortletInstanceArchivedSettings(
                themeDisplay.getSiteGroupId(), portlet.getRootPortletId(), curName);

        archivedSettings.delete();
    }
}