Search in sources :

Example 1 with CaseListEntryDto

use of de.symeda.sormas.api.caze.CaseListEntryDto in project SORMAS-Project by hzi-braunschweig.

the class CaseFacadeEjb method getEntriesList.

@Override
public List<CaseListEntryDto> getEntriesList(String personUuid, Integer first, Integer max) {
    Long personId = personFacade.getPersonIdByUuid(personUuid);
    List<CaseListEntryDto> entries = service.getEntriesList(personId, first, max);
    Pseudonymizer pseudonymizer = Pseudonymizer.getDefault(userService::hasRight, I18nProperties.getCaption(Captions.inaccessibleValue));
    pseudonymizer.pseudonymizeDtoCollection(CaseListEntryDto.class, entries, CaseListEntryDto::isInJurisdiction, null);
    return entries;
}
Also used : Pseudonymizer(de.symeda.sormas.backend.util.Pseudonymizer) CaseListEntryDto(de.symeda.sormas.api.caze.CaseListEntryDto) AtomicLong(java.util.concurrent.atomic.AtomicLong)

Example 2 with CaseListEntryDto

use of de.symeda.sormas.api.caze.CaseListEntryDto in project SORMAS-Project by hzi-braunschweig.

the class CaseList method drawDisplayedEntries.

@Override
protected void drawDisplayedEntries() {
    UserProvider currentUser = UserProvider.getCurrent();
    List<CaseListEntryDto> displayedEntries = getDisplayedEntries();
    for (int i = 0, displayedEntriesSize = displayedEntries.size(); i < displayedEntriesSize; i++) {
        final CaseListEntryDto caze = displayedEntries.get(i);
        final CaseListEntry listEntry = new CaseListEntry(caze);
        if (currentUser != null && currentUser.hasUserRight(UserRight.CASE_EDIT)) {
            listEntry.addEditButton("edit-case-" + i, (Button.ClickListener) event -> ControllerProvider.getCaseController().navigateToCase(listEntry.getCaseListEntryDto().getUuid()));
        }
        listLayout.addComponent(listEntry);
    }
}
Also used : PaginationList(de.symeda.sormas.ui.utils.PaginationList) CaseListEntryDto(de.symeda.sormas.api.caze.CaseListEntryDto) UserRight(de.symeda.sormas.api.user.UserRight) List(java.util.List) Button(com.vaadin.ui.Button) FacadeProvider(de.symeda.sormas.api.FacadeProvider) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) Label(com.vaadin.ui.Label) PersonReferenceDto(de.symeda.sormas.api.person.PersonReferenceDto) Captions(de.symeda.sormas.api.i18n.Captions) ControllerProvider(de.symeda.sormas.ui.ControllerProvider) UserProvider(de.symeda.sormas.ui.UserProvider) UserProvider(de.symeda.sormas.ui.UserProvider) Button(com.vaadin.ui.Button) CaseListEntryDto(de.symeda.sormas.api.caze.CaseListEntryDto)

Aggregations

CaseListEntryDto (de.symeda.sormas.api.caze.CaseListEntryDto)2 Button (com.vaadin.ui.Button)1 Label (com.vaadin.ui.Label)1 FacadeProvider (de.symeda.sormas.api.FacadeProvider)1 Captions (de.symeda.sormas.api.i18n.Captions)1 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)1 PersonReferenceDto (de.symeda.sormas.api.person.PersonReferenceDto)1 UserRight (de.symeda.sormas.api.user.UserRight)1 Pseudonymizer (de.symeda.sormas.backend.util.Pseudonymizer)1 ControllerProvider (de.symeda.sormas.ui.ControllerProvider)1 UserProvider (de.symeda.sormas.ui.UserProvider)1 PaginationList (de.symeda.sormas.ui.utils.PaginationList)1 List (java.util.List)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1