/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.liferay.blogs.web.internal.exportimport.portlet.preferences.processor; import com.liferay.blogs.model.BlogsEntry; import com.liferay.portal.kernel.template.TemplateHandler; import com.liferay.portal.kernel.template.TemplateHandlerRegistryUtil; import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.Validator; import javax.portlet.PortletPreferences; /** * @author Mate Thurzo */ public class BlogsExportImportPortletPreferencesProcessorUtil { public static String getDisplayStyle( PortletPreferences portletPreferences) { try { TemplateHandler templateHandler = TemplateHandlerRegistryUtil.getTemplateHandler( BlogsEntry.class.getName()); if (Validator.isNotNull(templateHandler)) { return portletPreferences.getValue("displayStyle", null); } } catch (Exception e) { } return null; } public static long getDisplayStyleGroupId( PortletPreferences portletPreferences) { try { TemplateHandler templateHandler = TemplateHandlerRegistryUtil.getTemplateHandler( BlogsEntry.class.getName()); if (Validator.isNotNull(templateHandler)) { return GetterUtil.getLong( portletPreferences.getValue("displayStyleGroupId", null)); } } catch (Exception e) { } return 0; } }