Project

General

Profile

Revision f4935f27

IDf4935f27105805ddfaa47d766c1a39102f80414a
Parent d50317d6
Child 8db3ccd6

Added by Patrick Plitzner over 1 year ago

ref #8041 Use CdmUtils.quoteRegExWithWildcard(pattern) for search string

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GrantedAuthoritySelectionDialog.java
17 17
import org.springframework.security.core.GrantedAuthority;
18 18

  
19 19
import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;
20
import eu.etaxonomy.cdm.common.CdmUtils;
20 21
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
21 22
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
22 23
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
......
61 62
		model = new ArrayList<>();
62 63

  
63 64
		for(GrantedAuthorityImpl authority : authorities){
64
		    if ( pattern == null || authority.getAuthority().matches(pattern +".*")){
65
		    if ( pattern == null || authority.getAuthority().matches(CdmUtils.quoteRegExWithWildcard(pattern) +".*")){
65 66
		        model.add(new UuidAndTitleCache<>(GrantedAuthorityImpl.class, authority.getUuid(), authority.getId(), String.format("%s", GrantedAuthorityLabelTextProvider.getText(authority))));
66 67
		    }
67 68
		}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GroupSelectionDialog.java
16 16
import org.eclipse.swt.widgets.Shell;
17 17

  
18 18
import eu.etaxonomy.cdm.api.service.IGroupService;
19
import eu.etaxonomy.cdm.common.CdmUtils;
19 20
import eu.etaxonomy.cdm.model.common.Group;
20 21
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
21 22
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
......
62 63
		model = new ArrayList<UuidAndTitleCache<Group>>();
63 64

  
64 65
		for(Group group : groups){
65
		    if (pattern == null || group.getName().matches("(?i)"+pattern + ".*")){
66
		    if (pattern == null || group.getName().matches("(?i)"+CdmUtils.quoteRegExWithWildcard(pattern) + ".*")){
66 67
		        model.add(new UuidAndTitleCache<Group>(Group.class, group.getUuid(), group.getId(), String.format("%s", group.getName())));
67 68
		    }
68 69
		}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/UserSelectionDialog.java
16 16
import org.eclipse.swt.widgets.Shell;
17 17

  
18 18
import eu.etaxonomy.cdm.api.service.IUserService;
19
import eu.etaxonomy.cdm.common.CdmUtils;
19 20
import eu.etaxonomy.cdm.model.common.User;
20 21
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
21 22
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
......
68 69
		model = new ArrayList<UuidAndTitleCache<User>>();
69 70

  
70 71
		for(User user : users){
71
		    if (pattern == null || user.getUsername().matches(pattern + ".*")) {
72
		    if (pattern == null || user.getUsername().matches(CdmUtils.quoteRegExWithWildcard(pattern) + ".*")) {
72 73
                model.add(new UuidAndTitleCache<User>(User.class, user.getUuid(), user.getId(), String.format("%s, %s", user.getUsername(), user.getPerson())));
73 74
            }
74 75
		}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)