Example usage for com.liferay.portal.kernel.service.persistence OrganizationUtil fetchByUuid_C_First

List of usage examples for com.liferay.portal.kernel.service.persistence OrganizationUtil fetchByUuid_C_First

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service.persistence OrganizationUtil fetchByUuid_C_First.

Prototype

public static Organization fetchByUuid_C_First(String uuid, long companyId,
        OrderByComparator<Organization> orderByComparator) 

Source Link

Document

Returns the first organization in the ordered set where uuid = ? and companyId = ?.

Usage

From source file:com.liferay.blogs.recent.bloggers.web.internal.exportimport.portlet.preferences.processor.RecentBloggersExportImportPortletPreferencesProcessor.java

License:Open Source License

@Override
protected Long getImportPortletPreferencesNewValue(PortletDataContext portletDataContext, Class<?> clazz,
        long companyGroupId, Map<Long, Long> primaryKeys, String portletPreferencesOldValue) throws Exception {

    if (Validator.isNumber(portletPreferencesOldValue)) {
        long oldPrimaryKey = GetterUtil.getLong(portletPreferencesOldValue);

        return MapUtil.getLong(primaryKeys, oldPrimaryKey, oldPrimaryKey);
    }/*from w ww.ja va2 s .c o  m*/

    String className = clazz.getName();

    if (className.equals(Organization.class.getName())) {
        Organization organization = OrganizationUtil.fetchByUuid_C_First(portletPreferencesOldValue,
                portletDataContext.getCompanyId(), null);

        if (organization != null) {
            return organization.getOrganizationId();
        }
    }

    return null;
}