public class ImageLocalServiceUtil
extends Object
com.liferay.portal.service.impl.ImageLocalServiceImpl
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.ImageLocalService
Constructor and Description |
---|
ImageLocalServiceUtil() |
Modifier and Type | Method and Description |
---|---|
static Image |
addImage(Image image)
Adds the image to the database.
|
static Image |
createImage(long imageId)
Creates a new image with the primary key.
|
static PersistedModel |
createPersistedModel(Serializable primaryKeyObj) |
static Image |
deleteImage(Image image)
Deletes the image from the database.
|
static Image |
deleteImage(long imageId)
Deletes the image with the primary key from the database.
|
static PersistedModel |
deletePersistedModel(PersistedModel persistedModel) |
static <T> T |
dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) |
static int |
dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) |
static DynamicQuery |
dynamicQuery() |
static <T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows.
|
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.
|
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.
|
static long |
dynamicQueryCount(DynamicQuery dynamicQuery)
Returns the number of rows matching the dynamic query.
|
static long |
dynamicQueryCount(DynamicQuery dynamicQuery,
Projection projection)
Returns the number of rows matching the dynamic query.
|
static Image |
fetchImage(long imageId) |
static ActionableDynamicQuery |
getActionableDynamicQuery() |
static Image |
getCompanyLogo(long imageId) |
static Image |
getImage(long imageId)
Returns the image with the primary key.
|
static InputStream |
getImageInputStream(long companyId,
long imageId,
String type) |
static Image |
getImageOrDefault(long imageId) |
static List<Image> |
getImages() |
static List<Image> |
getImages(int start,
int end)
Returns a range of all the images.
|
static List<Image> |
getImagesBySize(int size) |
static int |
getImagesCount()
Returns the number of images.
|
static IndexableActionableDynamicQuery |
getIndexableActionableDynamicQuery() |
static String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
static PersistedModel |
getPersistedModel(Serializable primaryKeyObj) |
static ImageLocalService |
getService() |
static Image |
moveImage(long imageId,
byte[] bytes) |
static void |
setService(ImageLocalService service) |
static Image |
updateImage(Image image)
Updates the image in the database or adds it if it does not yet exist.
|
static Image |
updateImage(long imageId,
byte[] bytes)
Deprecated.
As of Cavanaugh (7.4.x), replaced by
updateImage(long, long, byte[]) |
static Image |
updateImage(long imageId,
byte[] bytes,
String type,
int height,
int width,
int size)
Deprecated.
As of Cavanaugh (7.4.x), replaced by
updateImage(long, long, byte[], String, int, int, int) |
static Image |
updateImage(long imageId,
File file)
Deprecated.
As of Cavanaugh (7.4.x), replaced by
updateImage(long, long, File) |
static Image |
updateImage(long imageId,
InputStream inputStream)
Deprecated.
As of Cavanaugh (7.4.x), replaced by
updateImage(long, long, InputStream) |
static Image |
updateImage(long imageId,
InputStream inputStream,
boolean cleanUpStream)
Deprecated.
As of Cavanaugh (7.4.x), replaced by
updateImage(long, long, InputStream, boolean) |
static Image |
updateImage(long companyId,
long imageId,
byte[] bytes) |
static Image |
updateImage(long companyId,
long imageId,
byte[] bytes,
String type,
int height,
int width,
int size) |
static Image |
updateImage(long companyId,
long imageId,
File file) |
static Image |
updateImage(long companyId,
long imageId,
InputStream inputStream) |
static Image |
updateImage(long companyId,
long imageId,
InputStream inputStream,
boolean cleanUpStream) |
public static Image addImage(Image image)
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.
image
- the imagepublic static Image createImage(long imageId)
imageId
- the primary key for the new imagepublic static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
PortalException
public static Image deleteImage(Image image)
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.
image
- the imagepublic static Image deleteImage(long imageId) throws PortalException
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.
imageId
- the primary key of the imagePortalException
- if a image with the primary key could not be foundpublic static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
PortalException
public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
public static DynamicQuery dynamicQuery()
public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic querypublic static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
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.ImageModelImpl
.
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
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.ImageModelImpl
.
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 (optionally null
)public static long dynamicQueryCount(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic querypublic static long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the querypublic static Image fetchImage(long imageId)
public static ActionableDynamicQuery getActionableDynamicQuery()
public static Image getCompanyLogo(long imageId)
public static Image getImage(long imageId) throws PortalException
imageId
- the primary key of the imagePortalException
- if a image with the primary key could not be foundpublic static InputStream getImageInputStream(long companyId, long imageId, String type) throws PortalException
PortalException
public static Image getImageOrDefault(long imageId)
public static List<Image> getImages()
public static List<Image> getImages(int start, int end)
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.ImageModelImpl
.
start
- the lower bound of the range of imagesend
- the upper bound of the range of images (not inclusive)public static List<Image> getImagesBySize(int size)
public static int getImagesCount()
public static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
public static String getOSGiServiceIdentifier()
public static PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
PortalException
public static Image moveImage(long imageId, byte[] bytes) throws PortalException
PortalException
public static Image updateImage(Image image)
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.
image
- the image@Deprecated public static Image updateImage(long imageId, byte[] bytes) throws PortalException
updateImage(long, long, byte[])
PortalException
@Deprecated public static Image updateImage(long imageId, byte[] bytes, String type, int height, int width, int size) throws PortalException
updateImage(long, long, byte[], String, int, int, int)
PortalException
@Deprecated public static Image updateImage(long imageId, File file) throws PortalException
updateImage(long, long, File)
PortalException
@Deprecated public static Image updateImage(long imageId, InputStream inputStream) throws PortalException
updateImage(long, long, InputStream)
PortalException
@Deprecated public static Image updateImage(long imageId, InputStream inputStream, boolean cleanUpStream) throws PortalException
updateImage(long, long, InputStream, boolean)
PortalException
public static Image updateImage(long companyId, long imageId, byte[] bytes) throws PortalException
PortalException
public static Image updateImage(long companyId, long imageId, byte[] bytes, String type, int height, int width, int size) throws PortalException
PortalException
public static Image updateImage(long companyId, long imageId, File file) throws PortalException
PortalException
public static Image updateImage(long companyId, long imageId, InputStream inputStream) throws PortalException
PortalException
public static Image updateImage(long companyId, long imageId, InputStream inputStream, boolean cleanUpStream) throws PortalException
PortalException
public static ImageLocalService getService()
public static void setService(ImageLocalService service)