Search in sources :

Example 1 with ContactListEntryDto

use of de.symeda.sormas.api.contact.ContactListEntryDto in project SORMAS-Project by hzi-braunschweig.

the class ContactFacadeEjb method getEntriesList.

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

Example 2 with ContactListEntryDto

use of de.symeda.sormas.api.contact.ContactListEntryDto in project SORMAS-Project by hzi-braunschweig.

the class ContactList method drawDisplayedEntries.

@Override
protected void drawDisplayedEntries() {
    List<ContactListEntryDto> displayedEntries = getDisplayedEntries();
    UserProvider currentUser = UserProvider.getCurrent();
    for (int i = 0, displayedEntriesSize = displayedEntries.size(); i < displayedEntriesSize; i++) {
        final ContactListEntryDto contactListEntryDto = displayedEntries.get(i);
        final ContactListEntry listEntry = new ContactListEntry(contactListEntryDto);
        if (currentUser != null && currentUser.hasUserRight(UserRight.CONTACT_EDIT)) {
            listEntry.addEditButton("edit-contact-" + i, (Button.ClickListener) event -> ControllerProvider.getContactController().navigateToData(listEntry.getContactListEntryDto().getUuid()));
        }
        listLayout.addComponent(listEntry);
    }
}
Also used : PaginationList(de.symeda.sormas.ui.utils.PaginationList) ContactListEntryDto(de.symeda.sormas.api.contact.ContactListEntryDto) 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) ContactListEntryDto(de.symeda.sormas.api.contact.ContactListEntryDto) UserProvider(de.symeda.sormas.ui.UserProvider) Button(com.vaadin.ui.Button)

Aggregations

ContactListEntryDto (de.symeda.sormas.api.contact.ContactListEntryDto)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