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 PortletPreferencesaddPortletPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId, Portlet portlet, String defaultPreferences) static PortletPreferencesaddPortletPreferences(PortletPreferences portletPreferences) Adds the portlet preferences to the database.static PersistedModelcreatePersistedModel(Serializable primaryKeyObj) static PortletPreferencescreatePortletPreferences(long portletPreferencesId) Creates a new portlet preferences with the primary key.static PersistedModeldeletePersistedModel(PersistedModel persistedModel) static PortletPreferencesdeletePortletPreferences(long portletPreferencesId) Deletes the portlet preferences with the primary key from the database.static voiddeletePortletPreferences(long ownerId, int ownerType, long plid) static voiddeletePortletPreferences(long ownerId, int ownerType, long plid, String portletId) static PortletPreferencesdeletePortletPreferences(PortletPreferences portletPreferences) Deletes the portlet preferences from the database.static voiddeletePortletPreferencesByOwnerId(long ownerId) static voiddeletePortletPreferencesByPlid(long plid) static <T> TdslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static intdslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static DynamicQuerystatic <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 longdynamicQueryCount(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.static longdynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.static PortletPreferencesfetchPortletPreferences(long portletPreferencesId) static PortletPreferencesfetchPortletPreferences(long ownerId, int ownerType, long plid, String portletId) static PortletPreferencesfetchPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId) static PortletPreferencesfetchPreferences(PortletPreferencesIds portletPreferencesIds) static ActionableDynamicQuerystatic PortletPreferencesgetDefaultPreferences(long companyId, String portletId) static StringReturns the OSGi service identifier.static PersistedModelgetPersistedModel(Serializable primaryKeyObj) static SettingsgetPortletInstanceSettings(long companyId, long groupId, String portletId, PortletInstanceSettingsLocator portletInstanceSettingsLocator, Settings portalPreferencesSettings) static List<PortletPreferences>static List<PortletPreferences>getPortletPreferences(int ownerType, long plid, String portletId) static PortletPreferencesgetPortletPreferences(long portletPreferencesId) Returns the portlet preferences with the primary key.static List<PortletPreferences>getPortletPreferences(long ownerId, int ownerType, long plid) static PortletPreferencesgetPortletPreferences(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 longgetPortletPreferencesCount(int ownerType, long plid, String portletId) static longgetPortletPreferencesCount(int ownerType, String portletId) static longgetPortletPreferencesCount(long ownerId, int ownerType, long plid, Portlet portlet, boolean excludeDefaultPreferences) static longgetPortletPreferencesCount(long ownerId, int ownerType, String portletId, boolean excludeDefaultPreferences) static intgetPortletPreferencesCount(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 intReturns the number of portlet preferenceses.static PortletPreferencesgetPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId) static PortletPreferencesgetPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId, String defaultPreferences) static PortletPreferencesgetPreferences(PortletPreferencesIds portletPreferencesIds) static PortletPreferencesgetStrictPreferences(long companyId, long ownerId, int ownerType, long plid, String portletId) static Map<String,PortletPreferences> getStrictPreferences(Layout layout, List<Portlet> portlets) static PortletPreferencesgetStrictPreferences(PortletPreferencesIds portletPreferencesIds) static voidsetService(PortletPreferencesLocalService service) static PortletPreferencesupdatePortletPreferences(PortletPreferences portletPreferences) Updates the portlet preferences in the database or adds it if it does not yet exist.static PortletPreferencesupdatePreferences(long ownerId, int ownerType, long plid, String portletId, String xml) static PortletPreferencesupdatePreferences(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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris 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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris 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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris 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
-