Example usage for com.liferay.portal.kernel.util PropsKeys IMAGEMAGICK_GLOBAL_SEARCH_PATH

List of usage examples for com.liferay.portal.kernel.util PropsKeys IMAGEMAGICK_GLOBAL_SEARCH_PATH

Introduction

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

Prototype

String IMAGEMAGICK_GLOBAL_SEARCH_PATH

To view the source code for com.liferay.portal.kernel.util PropsKeys IMAGEMAGICK_GLOBAL_SEARCH_PATH.

Click Source Link

Usage

From source file:com.liferay.portlet.admin.action.EditServerAction.java

License:Open Source License

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

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

    preferences.setValue(PropsKeys.IMAGEMAGICK_ENABLED, String.valueOf(imageMagickEnabled));
    preferences.setValue(PropsKeys.IMAGEMAGICK_GLOBAL_SEARCH_PATH, imageMagickPath);
    preferences.setValue(PropsKeys.OPENOFFICE_SERVER_ENABLED, String.valueOf(openOfficeEnabled));
    preferences.setValue(PropsKeys.OPENOFFICE_SERVER_PORT, String.valueOf(openOfficePort));
    preferences.setValue(PropsKeys.XUGGLER_ENABLED, String.valueOf(xugglerEnabled));

    preferences.store();/*from w  w  w. j  av  a2  s. c  o m*/

    PDFProcessorUtil.reset();
}

From source file:com.liferay.portlet.documentlibrary.util.PDFProcessorImpl.java

License:Open Source License

public String getGlobalSearchPath() throws Exception {
    PortletPreferences preferences = PrefsPropsUtil.getPreferences();

    String globalSearchPath = preferences.getValue(PropsKeys.IMAGEMAGICK_GLOBAL_SEARCH_PATH, null);

    if (Validator.isNotNull(globalSearchPath)) {
        return globalSearchPath;
    }//from www.jav a 2s. c  o m

    String filterName = null;

    if (OSDetector.isApple()) {
        filterName = "apple";
    } else if (OSDetector.isWindows()) {
        filterName = "windows";
    } else {
        filterName = "unix";
    }

    return PropsUtil.get(PropsKeys.IMAGEMAGICK_GLOBAL_SEARCH_PATH, new Filter(filterName));
}

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);
        }/*w w w.  j a va  2s.c o  m*/
    }

    portletPreferences.store();

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