Interface ImageLocalService
- All Superinterfaces:
BaseLocalService
,CTService<Image>
,PersistedModelLocalService
- All Known Implementing Classes:
ImageLocalServiceWrapper
- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Method Summary
Modifier and TypeMethodDescriptionAdds the image to the database.createImage
(long imageId) Creates a new image with the primary key.createPersistedModel
(Serializable primaryKeyObj) deleteImage
(long imageId) Deletes the image with the primary key from the database.deleteImage
(Image image) Deletes the image from the database.deletePersistedModel
(PersistedModel persistedModel) <T> T
dslQuery
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) int
dslQueryCount
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) <T> List<T>
dynamicQuery
(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.<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.<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.long
dynamicQueryCount
(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.long
dynamicQueryCount
(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.fetchImage
(long imageId) getCompanyLogo
(long imageId) getImage
(long imageId) Returns the image with the primary key.getImageInputStream
(long companyId, long imageId, String type) getImageOrDefault
(long imageId) getImages
(int start, int end) Returns a range of all the images.getImagesBySize
(int size) int
Returns the number of images.Returns the OSGi service identifier.getPersistedModel
(Serializable primaryKeyObj) moveImage
(long imageId, byte[] bytes) updateImage
(long imageId, byte[] bytes) Deprecated.updateImage
(long imageId, byte[] bytes, String type, int height, int width, int size) Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, byte[], String, int, int, int)
updateImage
(long companyId, long imageId, byte[] bytes) updateImage
(long companyId, long imageId, byte[] bytes, String type, int height, int width, int size) updateImage
(long companyId, long imageId, File file) updateImage
(long companyId, long imageId, InputStream inputStream) updateImage
(long companyId, long imageId, InputStream inputStream, boolean cleanUpStream) updateImage
(long imageId, File file) Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, File)
updateImage
(long imageId, InputStream inputStream) Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, InputStream)
updateImage
(long imageId, InputStream inputStream, boolean cleanUpStream) Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, InputStream, boolean)
updateImage
(Image image) Updates the image in the database or adds it if it does not yet exist.<R,
E extends Throwable>
RupdateWithUnsafeFunction
(com.liferay.petra.function.UnsafeFunction<CTPersistence<Image>, R, E> updateUnsafeFunction) Methods inherited from interface com.liferay.portal.kernel.service.PersistedModelLocalService
fetchPersistedModel, getBasePersistence
-
Method Details
-
addImage
Adds the image to the database. Also notifies the appropriate model listeners.Important: Inspect ImageLocalServiceImpl 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:
image
- the image- Returns:
- the image that was added
-
createImage
Creates a new image with the primary key. Does not add the image to the database.- Parameters:
imageId
- the primary key for the new image- Returns:
- the new image
-
createPersistedModel
- Specified by:
createPersistedModel
in interfacePersistedModelLocalService
- Throws:
PortalException
-
deleteImage
Deletes the image from the database. Also notifies the appropriate model listeners.Important: Inspect ImageLocalServiceImpl 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:
image
- the image- Returns:
- the image that was removed
-
deleteImage
Deletes the image with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect ImageLocalServiceImpl 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:
imageId
- the primary key of the image- Returns:
- the image that was removed
- Throws:
PortalException
- if a image with the primary key could not be found
-
deletePersistedModel
- Specified by:
deletePersistedModel
in interfacePersistedModelLocalService
- Throws:
PortalException
-
dslQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQuery
in interfacePersistedModelLocalService
-
dslQueryCount
@Transactional(propagation=SUPPORTS, readOnly=true) int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQueryCount
in interfacePersistedModelLocalService
-
dynamicQuery
-
dynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <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
@Transactional(propagation=SUPPORTS, readOnly=true) <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
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.ImageModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)- Returns:
- the range of matching rows
-
dynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <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
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.ImageModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
@Transactional(propagation=SUPPORTS, readOnly=true) 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
@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchImage
-
getActionableDynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) ActionableDynamicQuery getActionableDynamicQuery() -
getCompanyLogo
-
getImage
@Transactional(propagation=SUPPORTS, readOnly=true) Image getImage(long imageId) throws PortalException Returns the image with the primary key.- Parameters:
imageId
- the primary key of the image- Returns:
- the image
- Throws:
PortalException
- if a image with the primary key could not be found
-
getImageInputStream
@Transactional(propagation=SUPPORTS, readOnly=true) InputStream getImageInputStream(long companyId, long imageId, String type) throws PortalException - Throws:
PortalException
-
getImageOrDefault
-
getImages
-
getImages
Returns a range of all the images.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.ImageModelImpl
.- Parameters:
start
- the lower bound of the range of imagesend
- the upper bound of the range of images (not inclusive)- Returns:
- the range of images
-
getImagesBySize
-
getImagesCount
Returns the number of images.- Returns:
- the number of images
-
getIndexableActionableDynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() -
getOSGiServiceIdentifier
String getOSGiServiceIdentifier()Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
@Transactional(propagation=SUPPORTS, readOnly=true) PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException - Specified by:
getPersistedModel
in interfacePersistedModelLocalService
- Throws:
PortalException
-
moveImage
- Throws:
PortalException
-
updateImage
Updates the image in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect ImageLocalServiceImpl 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:
image
- the image- Returns:
- the image that was updated
-
updateImage
Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, byte[])
- Throws:
PortalException
-
updateImage
@Deprecated Image updateImage(long imageId, byte[] bytes, String type, int height, int width, int size) throws PortalException Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, byte[], String, int, int, int)
- Throws:
PortalException
-
updateImage
Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, File)
- Throws:
PortalException
-
updateImage
Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, InputStream)
- Throws:
PortalException
-
updateImage
@Deprecated Image updateImage(long imageId, InputStream inputStream, boolean cleanUpStream) throws PortalException Deprecated.As of Cavanaugh (7.4.x), replaced byupdateImage(long, long, InputStream, boolean)
- Throws:
PortalException
-
updateImage
- Throws:
PortalException
-
updateImage
Image updateImage(long companyId, long imageId, byte[] bytes, String type, int height, int width, int size) throws PortalException - Throws:
PortalException
-
updateImage
- Throws:
PortalException
-
updateImage
- Throws:
PortalException
-
updateImage
Image updateImage(long companyId, long imageId, InputStream inputStream, boolean cleanUpStream) throws PortalException - Throws:
PortalException
-
getCTPersistence
- Specified by:
getCTPersistence
in interfaceCTService<Image>
-
getModelClass
- Specified by:
getModelClass
in interfaceCTService<Image>
-
updateWithUnsafeFunction
@Transactional(rollbackFor=java.lang.Throwable.class) <R,E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<Image>, R, throws EE> updateUnsafeFunction) - Specified by:
updateWithUnsafeFunction
in interfaceCTService<Image>
- Throws:
E extends Throwable
-
updateImage(long, long, byte[])