Example usage for com.liferay.portal.kernel.image GhostscriptUtil reset

List of usage examples for com.liferay.portal.kernel.image GhostscriptUtil reset

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.image GhostscriptUtil reset.

Prototype

public static void reset() 

Source Link

Usage

From source file:com.liferay.server.admin.web.internal.portlet.action.EditServerMVCActionCommand.java

License:Open Source License

protected void updateExternalServices(ActionRequest actionRequest, PortletPreferences portletPreferences)
        throws Exception {

    boolean imageMagickEnabled = ParamUtil.getBoolean(actionRequest, "imageMagickEnabled");
    String imageMagickPath = ParamUtil.getString(actionRequest, "imageMagickPath");
    boolean xugglerEnabled = ParamUtil.getBoolean(actionRequest, "xugglerEnabled");

    portletPreferences.setValue(PropsKeys.IMAGEMAGICK_ENABLED, String.valueOf(imageMagickEnabled));
    portletPreferences.setValue(PropsKeys.IMAGEMAGICK_GLOBAL_SEARCH_PATH, imageMagickPath);
    portletPreferences.setValue(PropsKeys.XUGGLER_ENABLED, String.valueOf(xugglerEnabled));

    Enumeration<String> enu = actionRequest.getParameterNames();

    while (enu.hasMoreElements()) {
        String name = enu.nextElement();

        if (name.startsWith("imageMagickLimit")) {
            String key = StringUtil.toLowerCase(name.substring(16));
            String value = ParamUtil.getString(actionRequest, name);

            portletPreferences.setValue(PropsKeys.IMAGEMAGICK_RESOURCE_LIMIT + key, value);
        }/*from  w w  w . j ava2  s  .c om*/
    }

    portletPreferences.store();

    GhostscriptUtil.reset();
    ImageMagickUtil.reset();
}