use of org.collectiveone.modules.activity.Activity in project CollectiveOneWebapp by CollectiveOne.
the class ModelService method getActivityResultUnderCard.
@Transactional
public GetResult<Page<ActivityDto>> getActivityResultUnderCard(UUID cardWrapperId, PageRequest page, Boolean onlyMessages) {
Page<Activity> activities = getActivityUnderCard(cardWrapperId, page, onlyMessages);
List<ActivityDto> activityDtos = new ArrayList<ActivityDto>();
for (Activity activity : activities.getContent()) {
activityDtos.add(activity.toDto());
}
Page<ActivityDto> dtosPage = new PageImpl<ActivityDto>(activityDtos, page, activities.getNumberOfElements());
return new GetResult<Page<ActivityDto>>("succes", "actvity returned", dtosPage);
}
use of org.collectiveone.modules.activity.Activity in project CollectiveOneWebapp by CollectiveOne.
the class ModelService method getActivityResultUnderSection.
@Transactional
public GetResult<Page<ActivityDto>> getActivityResultUnderSection(UUID sectionId, PageRequest page, Boolean onlyMessages) {
Page<Activity> activities = getActivityUnderSection(sectionId, page, onlyMessages);
List<ActivityDto> activityDtos = new ArrayList<ActivityDto>();
for (Activity activity : activities.getContent()) {
activityDtos.add(activity.toDto());
}
Page<ActivityDto> dtosPage = new PageImpl<ActivityDto>(activityDtos, page, activities.getNumberOfElements());
return new GetResult<Page<ActivityDto>>("succes", "actvity returned", dtosPage);
}
use of org.collectiveone.modules.activity.Activity in project CollectiveOneWebapp by CollectiveOne.
the class InitiativeService method getActivityUnderInitiative.
@Transactional
public GetResult<Page<ActivityDto>> getActivityUnderInitiative(UUID initiativeId, PageRequest page, Boolean onlyMessages) {
List<InitiativeDto> subinitiativesTree = getSubinitiativesTree(initiativeId, null);
List<UUID> allInitiativesIds = new ArrayList<UUID>();
allInitiativesIds.add(initiativeId);
allInitiativesIds.addAll(extractAllIdsFromInitiativesTree(subinitiativesTree, new ArrayList<UUID>()));
Page<Activity> activities = null;
if (!onlyMessages) {
activities = activityRepository.findOfInitiatives(allInitiativesIds, page);
} else {
activities = activityRepository.findOfInitiativesAndType(allInitiativesIds, ActivityType.MESSAGE_POSTED, page);
}
List<ActivityDto> activityDtos = new ArrayList<ActivityDto>();
for (Activity activity : activities.getContent()) {
activityDtos.add(activity.toDto());
}
Page<ActivityDto> dtosPage = new PageImpl<ActivityDto>(activityDtos, page, activities.getNumberOfElements());
return new GetResult<Page<ActivityDto>>("succes", "actvity returned", dtosPage);
}
use of org.collectiveone.modules.activity.Activity in project CollectiveOneWebapp by CollectiveOne.
the class ModelService method getActivityResultUnderView.
@Transactional
public GetResult<Page<ActivityDto>> getActivityResultUnderView(UUID viewId, PageRequest page, Boolean onlyMessages) {
Page<Activity> activities = getActivityUnderView(viewId, page, onlyMessages);
List<ActivityDto> activityDtos = new ArrayList<ActivityDto>();
for (Activity activity : activities.getContent()) {
activityDtos.add(activity.toDto());
}
Page<ActivityDto> dtosPage = new PageImpl<ActivityDto>(activityDtos, page, activities.getNumberOfElements());
return new GetResult<Page<ActivityDto>>("succes", "actvity returned", dtosPage);
}
Aggregations