Class PortletPreferencesLocalServiceUtil
com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PortletPreferences
addPortletPreferences
(long companyId, long ownerId, int ownerType, long plid, String portletId, Portlet portlet, String defaultPreferences) static PortletPreferences
addPortletPreferences
(PortletPreferences portletPreferences) Adds the portlet preferences to the database.static PersistedModel
createPersistedModel
(Serializable primaryKeyObj) static PortletPreferences
createPortletPreferences
(long portletPreferencesId) Creates a new portlet preferences with the primary key.static PersistedModel
deletePersistedModel
(PersistedModel persistedModel) static PortletPreferences
deletePortletPreferences
(long portletPreferencesId) Deletes the portlet preferences with the primary key from the database.static void
deletePortletPreferences
(long ownerId, int ownerType, long plid) static void
deletePortletPreferences
(long ownerId, int ownerType, long plid, String portletId) static PortletPreferences
deletePortletPreferences
(PortletPreferences portletPreferences) Deletes the portlet preferences from the database.static void
deletePortletPreferencesByOwnerId
(long ownerId) static void
deletePortletPreferencesByPlid
(long plid) 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
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 PortletPreferences
fetchPortletPreferences
(long portletPreferencesId) static PortletPreferences
fetchPortletPreferences
(long ownerId, int ownerType, long plid, String portletId) static PortletPreferences
fetchPreferences
(long companyId, long ownerId, int ownerType, long plid, String portletId) static PortletPreferences
fetchPreferences
(PortletPreferencesIds portletPreferencesIds) static ActionableDynamicQuery
static PortletPreferences
getDefaultPreferences
(long companyId, String portletId) static String
Returns the OSGi service identifier.static PersistedModel
getPersistedModel
(Serializable primaryKeyObj) static Settings
getPortletInstanceSettings
(long companyId, long groupId, String portletId, PortletInstanceSettingsLocator portletInstanceSettingsLocator, Settings portalPreferencesSettings) static List<PortletPreferences>
static List<PortletPreferences>
getPortletPreferences
(int ownerType, long plid, String portletId) static PortletPreferences
getPortletPreferences
(long portletPreferencesId) Returns the portlet preferences with the primary key.static List<PortletPreferences>
getPortletPreferences
(long ownerId, int ownerType, long plid) static PortletPreferences
getPortletPreferences
(long ownerId, int ownerType, long plid, String portletId) static List<PortletPreferences>
getPortletPreferences
(long companyId, long ownerId, int ownerType, String portletId) static List<PortletPreferences>
getPortletPreferences
(long companyId, long groupId, long ownerId, int ownerType, String portletId, boolean privateLayout) static List<PortletPreferences>
getPortletPreferences
(long plid, String portletId) static List<PortletPreferences>
getPortletPreferencesByOwnerId
(long ownerId) static List<PortletPreferences>
getPortletPreferencesByPlid
(long plid) static List<PortletPreferences>
getPortletPreferencesByPortletId
(String portletId) static long
getPortletPreferencesCount
(int ownerType, long plid, String portletId) static long
getPortletPreferencesCount
(int ownerType, String portletId) static long
getPortletPreferencesCount
(long ownerId, int ownerType, long plid, Portlet portlet, boolean excludeDefaultPreferences) static long
getPortletPreferencesCount
(long ownerId, int ownerType, String portletId, boolean excludeDefaultPreferences) static int
getPortletPreferencesCount
(long companyId, long ownerId, int ownerType, String portletId) static List<PortletPreferences>
getPortletPreferenceses
(int start, int end) Returns a range of all the portlet preferenceses.static int
Returns the number of portlet preferenceses.static PortletPreferences
getPreferences
(long companyId, long ownerId, int ownerType, long plid, String portletId) static PortletPreferences
getPreferences
(long companyId, long ownerId, int ownerType, long plid, String portletId, String defaultPreferences) static PortletPreferences
getPreferences
(PortletPreferencesIds portletPreferencesIds) static PortletPreferences
getStrictPreferences
(long companyId, long ownerId, int ownerType, long plid, String portletId) static Map<String,
PortletPreferences> getStrictPreferences
(Layout layout, List<Portlet> portlets) static PortletPreferences
getStrictPreferences
(PortletPreferencesIds portletPreferencesIds) static void
setService
(PortletPreferencesLocalService service) static PortletPreferences
updatePortletPreferences
(PortletPreferences portletPreferences) Updates the portlet preferences in the database or adds it if it does not yet exist.static PortletPreferences
updatePreferences
(long ownerId, int ownerType, long plid, String portletId, String xml) static PortletPreferences
updatePreferences
(long ownerId, int ownerType, long plid, String portletId, PortletPreferences portletPreferences)
-
Constructor Details
-
PortletPreferencesLocalServiceUtil
public PortletPreferencesLocalServiceUtil()
-
-
Method Details
-
addPortletPreferences
public static PortletPreferences addPortletPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId, Portlet portlet, String defaultPreferences) -
addPortletPreferences
Adds the portlet preferences to the database. Also notifies the appropriate model listeners.Important: Inspect PortletPreferencesLocalServiceImpl 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:
portletPreferences
- the portlet preferences- Returns:
- the portlet preferences that was added
-
createPersistedModel
public static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException - Throws:
PortalException
-
createPortletPreferences
Creates a new portlet preferences with the primary key. Does not add the portlet preferences to the database.- Parameters:
portletPreferencesId
- the primary key for the new portlet preferences- Returns:
- the new portlet preferences
-
deletePersistedModel
public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException - Throws:
PortalException
-
deletePortletPreferences
public static PortletPreferences deletePortletPreferences(long portletPreferencesId) throws PortalException Deletes the portlet preferences with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect PortletPreferencesLocalServiceImpl 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:
portletPreferencesId
- the primary key of the portlet preferences- Returns:
- the portlet preferences that was removed
- Throws:
PortalException
- if a portlet preferences with the primary key could not be found
-
deletePortletPreferences
public static void deletePortletPreferences(long ownerId, int ownerType, long plid) -
deletePortletPreferences
public static void deletePortletPreferences(long ownerId, int ownerType, long plid, String portletId) throws PortalException - Throws:
PortalException
-
deletePortletPreferences
Deletes the portlet preferences from the database. Also notifies the appropriate model listeners.Important: Inspect PortletPreferencesLocalServiceImpl 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:
portletPreferences
- the portlet preferences- Returns:
- the portlet preferences that was removed
-
deletePortletPreferencesByOwnerId
public static void deletePortletPreferencesByOwnerId(long ownerId) -
deletePortletPreferencesByPlid
public static void deletePortletPreferencesByPlid(long plid) -
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
-
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
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.PortletPreferencesModelImpl
.- 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
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
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.PortletPreferencesModelImpl
.- 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
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
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
-
fetchPortletPreferences
-
fetchPortletPreferences
public static PortletPreferences fetchPortletPreferences(long ownerId, int ownerType, long plid, String portletId) -
fetchPreferences
public static PortletPreferences fetchPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId) -
fetchPreferences
-
getActionableDynamicQuery
-
getDefaultPreferences
-
getIndexableActionableDynamicQuery
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
- Throws:
PortalException
-
getPortletInstanceSettings
public static Settings getPortletInstanceSettings(long companyId, long groupId, String portletId, PortletInstanceSettingsLocator portletInstanceSettingsLocator, Settings portalPreferencesSettings) -
getPortletPreferences
-
getPortletPreferences
public static List<PortletPreferences> getPortletPreferences(int ownerType, long plid, String portletId) -
getPortletPreferences
public static PortletPreferences getPortletPreferences(long portletPreferencesId) throws PortalException Returns the portlet preferences with the primary key.- Parameters:
portletPreferencesId
- the primary key of the portlet preferences- Returns:
- the portlet preferences
- Throws:
PortalException
- if a portlet preferences with the primary key could not be found
-
getPortletPreferences
public static List<PortletPreferences> getPortletPreferences(long ownerId, int ownerType, long plid) -
getPortletPreferences
public static PortletPreferences getPortletPreferences(long ownerId, int ownerType, long plid, String portletId) throws PortalException - Throws:
PortalException
-
getPortletPreferences
public static List<PortletPreferences> getPortletPreferences(long companyId, long ownerId, int ownerType, String portletId) throws PortalException - Throws:
PortalException
-
getPortletPreferences
public static List<PortletPreferences> getPortletPreferences(long companyId, long groupId, long ownerId, int ownerType, String portletId, boolean privateLayout) -
getPortletPreferences
-
getPortletPreferencesByOwnerId
-
getPortletPreferencesByPlid
-
getPortletPreferencesByPortletId
-
getPortletPreferencesCount
-
getPortletPreferencesCount
-
getPortletPreferencesCount
public static long getPortletPreferencesCount(long ownerId, int ownerType, long plid, Portlet portlet, boolean excludeDefaultPreferences) -
getPortletPreferencesCount
public static long getPortletPreferencesCount(long ownerId, int ownerType, String portletId, boolean excludeDefaultPreferences) -
getPortletPreferencesCount
public static int getPortletPreferencesCount(long companyId, long ownerId, int ownerType, String portletId) -
getPortletPreferenceses
Returns a range of all the portlet preferenceses.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.PortletPreferencesModelImpl
.- Parameters:
start
- the lower bound of the range of portlet preferencesesend
- the upper bound of the range of portlet preferenceses (not inclusive)- Returns:
- the range of portlet preferenceses
-
getPortletPreferencesesCount
public static int getPortletPreferencesesCount()Returns the number of portlet preferenceses.- Returns:
- the number of portlet preferenceses
-
getPreferences
public static PortletPreferences getPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId) -
getPreferences
public static PortletPreferences getPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId, String defaultPreferences) -
getPreferences
-
getStrictPreferences
-
getStrictPreferences
public static PortletPreferences getStrictPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId) -
getStrictPreferences
-
updatePortletPreferences
Updates the portlet preferences in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect PortletPreferencesLocalServiceImpl 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:
portletPreferences
- the portlet preferences- Returns:
- the portlet preferences that was updated
-
updatePreferences
public static PortletPreferences updatePreferences(long ownerId, int ownerType, long plid, String portletId, PortletPreferences portletPreferences) -
updatePreferences
public static PortletPreferences updatePreferences(long ownerId, int ownerType, long plid, String portletId, String xml) -
getService
-
setService
-