Class RegionLocalServiceUtil

Object
com.liferay.portal.kernel.service.RegionLocalServiceUtil

public class RegionLocalServiceUtil extends Object
Provides the local service utility for Region. This utility wraps com.liferay.portal.service.impl.RegionLocalServiceImpl and is an access point for service operations in application layer code running on the local server. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
Author:
Brian Wing Shun Chan
See Also:
{$generated.description}
  • Constructor Details

    • RegionLocalServiceUtil

      public RegionLocalServiceUtil()
  • Method Details

    • addRegion

      public static Region addRegion(long countryId, boolean active, String name, double position, String regionCode, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • addRegion

      public static Region addRegion(Region region)
      Adds the region to the database. Also notifies the appropriate model listeners.

      Important: Inspect RegionLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      region - the region
      Returns:
      the region that was added
    • createPersistedModel

      public static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
      Throws:
      PortalException
    • createRegion

      public static Region createRegion(long regionId)
      Creates a new region with the primary key. Does not add the region to the database.
      Parameters:
      regionId - the primary key for the new region
      Returns:
      the new region
    • deleteCountryRegions

      public static void deleteCountryRegions(long countryId)
    • deletePersistedModel

      public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
      Throws:
      PortalException
    • deleteRegion

      public static Region deleteRegion(long regionId) throws PortalException
      Deletes the region with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect RegionLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      regionId - the primary key of the region
      Returns:
      the region that was removed
      Throws:
      PortalException - if a region with the primary key could not be found
    • deleteRegion

      public static Region deleteRegion(Region region)
      Deletes the region from the database. Also notifies the appropriate model listeners.

      Important: Inspect RegionLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      region - the region
      Returns:
      the region that was removed
    • dslQuery

      public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
    • dslQueryCount

      public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
    • dynamicQuery

      public static DynamicQuery dynamicQuery()
    • dynamicQuery

      public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
      Performs a dynamic query on the database and returns a range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RegionModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      Returns:
      the range of matching rows
    • dynamicQuery

      public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
      Performs a dynamic query on the database and returns an ordered range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RegionModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      public static long dynamicQueryCount(DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      public static long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchRegion

      public static Region fetchRegion(long regionId)
    • fetchRegion

      public static Region fetchRegion(long countryId, String regionCode)
    • fetchRegionByUuidAndCompanyId

      public static Region fetchRegionByUuidAndCompanyId(String uuid, long companyId)
      Returns the region with the matching UUID and company.
      Parameters:
      uuid - the region's UUID
      companyId - the primary key of the company
      Returns:
      the matching region, or null if a matching region could not be found
    • fetchRegionLocalization

      public static RegionLocalization fetchRegionLocalization(long regionId, String languageId)
    • getActionableDynamicQuery

      public static ActionableDynamicQuery getActionableDynamicQuery()
    • getExportActionableDynamicQuery

      public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
    • getIndexableActionableDynamicQuery

      public static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getOSGiServiceIdentifier

      public static String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Returns:
      the OSGi service identifier
    • getPersistedModel

      public static PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      Throws:
      PortalException
    • getRegion

      public static Region getRegion(long regionId) throws PortalException
      Returns the region with the primary key.
      Parameters:
      regionId - the primary key of the region
      Returns:
      the region
      Throws:
      PortalException - if a region with the primary key could not be found
    • getRegion

      public static Region getRegion(long countryId, String regionCode) throws PortalException
      Throws:
      PortalException
    • getRegionByUuidAndCompanyId

      public static Region getRegionByUuidAndCompanyId(String uuid, long companyId) throws PortalException
      Returns the region with the matching UUID and company.
      Parameters:
      uuid - the region's UUID
      companyId - the primary key of the company
      Returns:
      the matching region
      Throws:
      PortalException - if a matching region could not be found
    • getRegionLocalization

      public static RegionLocalization getRegionLocalization(long regionId, String languageId) throws PortalException
      Throws:
      PortalException
    • getRegionLocalizations

      public static List<RegionLocalization> getRegionLocalizations(long regionId)
    • getRegions

      public static List<Region> getRegions(int start, int end)
      Returns a range of all the regions.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RegionModelImpl.

      Parameters:
      start - the lower bound of the range of regions
      end - the upper bound of the range of regions (not inclusive)
      Returns:
      the range of regions
    • getRegions

      public static List<Region> getRegions(long countryId, boolean active) throws PortalException
      Throws:
      PortalException
    • getRegions

      public static List<Region> getRegions(long countryId, boolean active, int start, int end, OrderByComparator<Region> orderByComparator)
    • getRegions

      public static List<Region> getRegions(long countryId, int start, int end, OrderByComparator<Region> orderByComparator)
    • getRegions

      public static List<Region> getRegions(long companyId, String a2, boolean active) throws PortalException
      Throws:
      PortalException
    • getRegionsCount

      public static int getRegionsCount()
      Returns the number of regions.
      Returns:
      the number of regions
    • getRegionsCount

      public static int getRegionsCount(long countryId)
    • getRegionsCount

      public static int getRegionsCount(long countryId, boolean active)
    • searchRegions

      public static BaseModelSearchResult<Region> searchRegions(long companyId, Boolean active, String keywords, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator<Region> orderByComparator) throws PortalException
      Throws:
      PortalException
    • updateActive

      public static Region updateActive(long regionId, boolean active) throws PortalException
      Throws:
      PortalException
    • updateRegion

      public static Region updateRegion(long regionId, boolean active, String name, double position, String regionCode) throws PortalException
      Throws:
      PortalException
    • updateRegion

      public static Region updateRegion(Region region)
      Updates the region in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect RegionLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      region - the region
      Returns:
      the region that was updated
    • updateRegionLocalization

      public static RegionLocalization updateRegionLocalization(Region region, String languageId, String title) throws PortalException
      Throws:
      PortalException
    • updateRegionLocalizations

      public static List<RegionLocalization> updateRegionLocalizations(Region region, Map<String,String> titleMap) throws PortalException
      Throws:
      PortalException
    • getService

      public static RegionLocalService getService()
    • setService

      public static void setService(RegionLocalService service)