List of usage examples for com.liferay.portal.kernel.portlet PortalPreferences getValue
public String getValue(String namespace, String key);
From source file:com.liferay.user.notification.event.service.UserNotificationEventCustomServiceWrapper.java
License:Open Source License
protected void storeUserNotificationEventsCount(long userId, int deliveryType) { if (deliveryType != UserNotificationDeliveryConstants.TYPE_WEBSITE) { return;// ww w . java2 s. c om } PortalPreferences portalPreferences = PortletPreferencesFactoryUtil.getPortalPreferences(userId, true); long userNotificationEventsCount = GetterUtil.getLong( portalPreferences.getValue(UserNotificationEvent.class.getName(), "userNotificationEventsCount")); portalPreferences.setValue(UserNotificationEvent.class.getName(), "userNotificationEventsCount", String.valueOf(++userNotificationEventsCount)); PortalPreferencesLocalServiceUtil.updatePreferences(userId, PortletKeys.PREFS_OWNER_TYPE_USER, PortletPreferencesFactoryUtil.toXML(portalPreferences)); }