Example usage for com.liferay.portal.kernel.util ArrayUtil replace

List of usage examples for com.liferay.portal.kernel.util ArrayUtil replace

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util ArrayUtil replace.

Prototype

public static void replace(String[] values, String oldValue, String newValue) 

Source Link

Usage

From source file:com.liferay.calendar.hook.upgrade.v1_0_0.UpgradePortletPreferences.java

License:Open Source License

private void replaceClassNameId(PortletPreferences portletPreferences, String name) throws Exception {

    String[] values = GetterUtil.getStringValues(portletPreferences.getValues(name, null));

    ArrayUtil.replace(values, String.valueOf(PortalUtil.getClassNameId(CalEvent.class)),
            String.valueOf(PortalUtil.getClassNameId(CalendarBooking.class)));

    portletPreferences.setValues(name, values);
}

From source file:com.liferay.calendar.web.internal.upgrade.v1_0_1.UpgradePortletPreferences.java

License:Open Source License

private void _replaceClassNameId(PortletPreferences portletPreferences, String name) throws Exception {

    String[] values = GetterUtil.getStringValues(portletPreferences.getValues(name, null));

    ArrayUtil.replace(values, String.valueOf("com.liferay.portlet.calendar.model.CalEvent"),
            String.valueOf(PortalUtil.getClassNameId(CalendarBooking.class)));

    portletPreferences.setValues(name, values);
}

From source file:com.liferay.wiki.web.internal.portlet.action.EditNodeMVCActionCommand.java

License:Open Source License

protected void updateSettings(
        WikiPortletInstanceOverriddenConfiguration wikiPortletInstanceOverriddenConfiguration, String oldName,
        String newName) throws Exception {

    String[] hiddenNodes = wikiPortletInstanceOverriddenConfiguration.hiddenNodes();

    ArrayUtil.replace(hiddenNodes, oldName, newName);

    wikiPortletInstanceOverriddenConfiguration.setHiddenNodes(hiddenNodes);

    String[] visibleNodes = wikiPortletInstanceOverriddenConfiguration.visibleNodes();

    ArrayUtil.replace(visibleNodes, oldName, newName);

    wikiPortletInstanceOverriddenConfiguration.setVisibleNodes(visibleNodes);

    wikiPortletInstanceOverriddenConfiguration.store();
}