Class AMImageEntryLocalServiceUtil

java.lang.Object
com.liferay.adaptive.media.image.service.AMImageEntryLocalServiceUtil

public class AMImageEntryLocalServiceUtil extends Object
Provides the local service utility for AMImageEntry. This utility wraps com.liferay.adaptive.media.image.service.impl.AMImageEntryLocalServiceImpl 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.
See Also:
Generated:
  • Constructor Details

    • AMImageEntryLocalServiceUtil

      public AMImageEntryLocalServiceUtil()
  • Method Details

    • addAMImageEntry

      public static AMImageEntry addAMImageEntry(AMImageConfigurationEntry amImageConfigurationEntry, com.liferay.portal.kernel.repository.model.FileVersion fileVersion, int height, int width, InputStream inputStream, long size) throws com.liferay.portal.kernel.exception.PortalException
      Adds an adaptive media image entry in the database and stores the image bytes in the file store.
      Parameters:
      amImageConfigurationEntry - the configuration used to create the adaptive media image
      fileVersion - the file version used to create the adaptive media image
      height - the adaptive media image's height
      width - the adaptive media image's width
      inputStream - the adaptive media image's input stream to store in the file store
      size - the adaptive media image's size
      Returns:
      the adaptive media image
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if an adaptive media image already exists for the file version and configuration
    • addAMImageEntry

      public static AMImageEntry addAMImageEntry(AMImageEntry amImageEntry)
      Adds the am image entry to the database. Also notifies the appropriate model listeners.

      Important: Inspect AMImageEntryLocalServiceImpl 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:
      amImageEntry - the am image entry
      Returns:
      the am image entry that was added
    • createAMImageEntry

      public static AMImageEntry createAMImageEntry(long amImageEntryId)
      Creates a new am image entry with the primary key. Does not add the am image entry to the database.
      Parameters:
      amImageEntryId - the primary key for the new am image entry
      Returns:
      the new am image entry
    • createPersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel createPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteAMImageEntries

      public static void deleteAMImageEntries(long companyId, AMImageConfigurationEntry amImageConfigurationEntry)
      Deletes all the adaptive media images generated for the configuration in the company. This method deletes both the adaptive media image entry from the database and the bytes from the file store.
      Parameters:
      companyId - the primary key of the company
      amImageConfigurationEntry - the configuration used to create the adaptive media image
    • deleteAMImageEntry

      public static AMImageEntry deleteAMImageEntry(AMImageEntry amImageEntry)
      Deletes the am image entry from the database. Also notifies the appropriate model listeners.

      Important: Inspect AMImageEntryLocalServiceImpl 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:
      amImageEntry - the am image entry
      Returns:
      the am image entry that was removed
    • deleteAMImageEntry

      public static AMImageEntry deleteAMImageEntry(long amImageEntryId) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the am image entry with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect AMImageEntryLocalServiceImpl 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:
      amImageEntryId - the primary key of the am image entry
      Returns:
      the am image entry that was removed
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a am image entry with the primary key could not be found
    • deleteAMImageEntryFileVersion

      public static void deleteAMImageEntryFileVersion(com.liferay.portal.kernel.repository.model.FileVersion fileVersion) throws com.liferay.portal.kernel.exception.PortalException
      Deletes all the adaptive media images generated for a file version. This method deletes both the adaptive media image entry from the database and the bytes from the file store.
      Parameters:
      fileVersion - the file version
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if the file version was not found
    • deleteAMImageEntryFileVersion

      public static void deleteAMImageEntryFileVersion(String configurationUuid, long fileVersionId) throws com.liferay.portal.kernel.exception.PortalException
      Deletes adaptive media images generated for a file version under a given configuration. This method deletes both the adaptive media image entry from the database and the bytes from the file store.
      Parameters:
      configurationUuid - the configuration UUID
      fileVersionId - the primary key of the file version
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if the file version was not found
    • deletePersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • 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 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery()
    • dynamicQuery

      public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.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(com.liferay.portal.kernel.dao.orm.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.adaptive.media.image.model.impl.AMImageEntryModelImpl.

      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(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.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.adaptive.media.image.model.impl.AMImageEntryModelImpl.

      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(com.liferay.portal.kernel.dao.orm.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(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.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
    • fetchAMImageEntry

      public static AMImageEntry fetchAMImageEntry(long amImageEntryId)
    • fetchAMImageEntry

      public static AMImageEntry fetchAMImageEntry(String configurationUuid, long fileVersionId)
      Returns the adaptive media image entry generated for the configuration and file version.
      Parameters:
      configurationUuid - the UUID of the configuration used to create the adaptive media image
      fileVersionId - the primary key of the file version
      Returns:
      the matching adaptive media image entry, or null if a matching adaptive media image entry could not be found
    • fetchAMImageEntryByUuidAndGroupId

      public static AMImageEntry fetchAMImageEntryByUuidAndGroupId(String uuid, long groupId)
      Returns the am image entry matching the UUID and group.
      Parameters:
      uuid - the am image entry's UUID
      groupId - the primary key of the group
      Returns:
      the matching am image entry, or null if a matching am image entry could not be found
    • getActionableDynamicQuery

      public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery()
    • getAMImageEntries

      public static List<AMImageEntry> getAMImageEntries(int start, int end)
      Returns a range of all the am image entries.

      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.adaptive.media.image.model.impl.AMImageEntryModelImpl.

      Parameters:
      start - the lower bound of the range of am image entries
      end - the upper bound of the range of am image entries (not inclusive)
      Returns:
      the range of am image entries
    • getAMImageEntries

      public static List<AMImageEntry> getAMImageEntries(long fileVersionId)
      Returns the list of adaptive media image entries generated for the file version.
      Parameters:
      fileVersionId - the primary key of the file version
      Returns:
      the list of adaptive media image entries in the file version
    • getAMImageEntriesByUuidAndCompanyId

      public static List<AMImageEntry> getAMImageEntriesByUuidAndCompanyId(String uuid, long companyId)
      Returns all the am image entries matching the UUID and company.
      Parameters:
      uuid - the UUID of the am image entries
      companyId - the primary key of the company
      Returns:
      the matching am image entries, or an empty list if no matches were found
    • getAMImageEntriesByUuidAndCompanyId

      public static List<AMImageEntry> getAMImageEntriesByUuidAndCompanyId(String uuid, long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AMImageEntry> orderByComparator)
      Returns a range of am image entries matching the UUID and company.
      Parameters:
      uuid - the UUID of the am image entries
      companyId - the primary key of the company
      start - the lower bound of the range of am image entries
      end - the upper bound of the range of am image entries (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the range of matching am image entries, or an empty list if no matches were found
    • getAMImageEntriesCount

      public static int getAMImageEntriesCount()
      Returns the number of am image entries.
      Returns:
      the number of am image entries
    • getAMImageEntriesCount

      public static int getAMImageEntriesCount(long companyId, String configurationUuid)
      Returns the number of adaptive media image entries generated for the configuration in the company.
      Parameters:
      companyId - the primary key of the company
      configurationUuid - the UUID of the configuration used to create the adaptive media image
      Returns:
      the number of adaptive media image entries in the company for the configuration
    • getAMImageEntry

      public static AMImageEntry getAMImageEntry(long amImageEntryId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the am image entry with the primary key.
      Parameters:
      amImageEntryId - the primary key of the am image entry
      Returns:
      the am image entry
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a am image entry with the primary key could not be found
    • getAMImageEntryByUuidAndGroupId

      public static AMImageEntry getAMImageEntryByUuidAndGroupId(String uuid, long groupId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the am image entry matching the UUID and group.
      Parameters:
      uuid - the am image entry's UUID
      groupId - the primary key of the group
      Returns:
      the matching am image entry
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a matching am image entry could not be found
    • getAMImageEntryContentStream

      public static InputStream getAMImageEntryContentStream(AMImageConfigurationEntry amImageConfigurationEntry, com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
      Returns the input stream of the adaptive media image generated for a file version and configuration.
      Parameters:
      amImageConfigurationEntry - the configuration used to create the adaptive media image
      fileVersion - the file version used to create the adaptive media image
      Returns:
      the input stream of the adaptive media image generated for a file version and configuration
    • getExpectedAMImageEntriesCount

      public static int getExpectedAMImageEntriesCount(long companyId)
      Returns the total number of adaptive media images that are expected to be in a company once they are generated. The number of adaptive media images could be less if there are images that haven't generated the adaptive media image yet.
      Parameters:
      companyId - the primary key of the company
      Returns:
      the number of expected adaptive media images for a company
    • getIndexableActionableDynamicQuery

      public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getOSGiServiceIdentifier

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

      public static int getPercentage(long companyId, String configurationUuid)
      Returns the percentage of images that have an adaptive media image generated based on the expected number of adaptive media images for a configuration in a company.
      Parameters:
      companyId - the primary key of the company
      configurationUuid - the UUID of the configuration used to create the adaptive media image
      Returns:
      the percentage of images that have an adaptive media image out of the expected adaptive media images
    • getPercentage

      public static int getPercentage(long companyId, String configurationUuid, int expectedAMImageEntriesCount)
    • getPersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • hasAMImageEntryContent

      public static boolean hasAMImageEntryContent(String configurationUuid, com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
    • updateAMImageEntry

      public static AMImageEntry updateAMImageEntry(AMImageEntry amImageEntry)
      Updates the am image entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect AMImageEntryLocalServiceImpl 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:
      amImageEntry - the am image entry
      Returns:
      the am image entry that was updated
    • getService

      public static AMImageEntryLocalService getService()