use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class MeetupsPortlet method updateMeetupsRegistration.
public void updateMeetupsRegistration(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long meetupsEntryId = ParamUtil.getLong(actionRequest, "meetupsEntryId");
int status = ParamUtil.getInteger(actionRequest, "status");
String comments = ParamUtil.getString(actionRequest, "comments");
MeetupsRegistrationLocalServiceUtil.updateMeetupsRegistration(themeDisplay.getUserId(), meetupsEntryId, status, comments);
}
use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class MeetupsPortlet method deleteMeetupsEntry.
public void deleteMeetupsEntry(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();
if (!permissionChecker.isCompanyAdmin()) {
return;
}
long meetupsEntryId = ParamUtil.getLong(actionRequest, "meetupsEntryId");
MeetupsEntryLocalServiceUtil.deleteMeetupsEntry(meetupsEntryId);
}
use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class LiferayActivityService method getThemeDisplay.
protected ThemeDisplay getThemeDisplay(SecurityToken securityToken) throws Exception {
long userIdLong = GetterUtil.getLong(securityToken.getViewerId());
User user = UserLocalServiceUtil.getUserById(userIdLong);
Company company = CompanyLocalServiceUtil.getCompanyById(user.getCompanyId());
ThemeDisplay themeDisplay = new ThemeDisplay();
themeDisplay.setCompany(company);
themeDisplay.setLocale(user.getLocale());
themeDisplay.setUser(user);
return themeDisplay;
}
use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class LiferayActivityService method doGetActivities.
public RestfulCollection<Activity> doGetActivities(Set<UserId> userIds, GroupId groupId, String appId, Set<String> fields, CollectionOptions collectionOptions, SecurityToken securityToken) throws Exception {
ThemeDisplay themeDisplay = getThemeDisplay(securityToken);
List<Activity> activities = new ArrayList<Activity>();
for (UserId userId : userIds) {
long userIdLong = GetterUtil.getLong(userId.getUserId(securityToken));
List<Activity> personActivities = getActivities(themeDisplay, userIdLong);
activities.addAll(personActivities);
}
return new RestfulCollection<Activity>(activities, collectionOptions.getFirst(), activities.size(), collectionOptions.getMax());
}
use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class LiferayActivityService method doGetActivities.
public RestfulCollection<Activity> doGetActivities(UserId userId, GroupId groupId, String appId, Set<String> fields, CollectionOptions collectionOptions, Set<String> activityIds, SecurityToken securityToken) throws Exception {
ThemeDisplay themeDisplay = getThemeDisplay(securityToken);
long userIdLong = GetterUtil.getLong(userId.getUserId(securityToken));
List<Activity> activities = getActivities(themeDisplay, userIdLong);
return new RestfulCollection<Activity>(activities, collectionOptions.getFirst(), activities.size(), collectionOptions.getMax());
}
Aggregations