updated get all contact. Now the method doesn't return user with empty name

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@77019 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-06-12 14:53:19 +00:00
parent 682558664a
commit 847c4ae1e8
2 changed files with 45 additions and 38 deletions

View File

@ -124,22 +124,22 @@ public class MultiDragContact extends Dialog {
storeTarget.sort(InfoContactModel.FULLNAME, SortDir.ASC);
StoreFilterField<InfoContactModel> filter = new StoreFilterField<InfoContactModel>() {
@Override
protected boolean doSelect(Store<InfoContactModel> store, InfoContactModel parent,
InfoContactModel record, String property, String filter) {
String name = record.getName();
name = name.toLowerCase();
if (name.contains(filter.toLowerCase())) {
return true;
}
return false;
}
};
StoreFilterField<InfoContactModel> filter = new StoreFilterField<InfoContactModel>() {
@Override
protected boolean doSelect(Store<InfoContactModel> store,
InfoContactModel parent, InfoContactModel record,
String property, String filter) {
String name = record.getName();
name = name.toLowerCase();
if (name.contains(filter.toLowerCase())) {
return true;
}
return false;
}
};
// filter.setFieldLabel("Filter Contacts");
filter.setWidth(247);
@ -169,22 +169,22 @@ public class MultiDragContact extends Dialog {
vp.add(new Label("Share with..."));
gridShareWith = new Grid<InfoContactModel>(storeTarget, createColumnModel());
StoreFilterField<InfoContactModel> filter2 = new StoreFilterField<InfoContactModel>() {
@Override
protected boolean doSelect(Store<InfoContactModel> store, InfoContactModel parent,
InfoContactModel record, String property, String filter) {
String name = record.getName();
name = name.toLowerCase();
if (name.contains(filter.toLowerCase())) {
return true;
}
return false;
}
};
StoreFilterField<InfoContactModel> filter2 = new StoreFilterField<InfoContactModel>() {
@Override
protected boolean doSelect(Store<InfoContactModel> store,
InfoContactModel parent, InfoContactModel record,
String property, String filter) {
String name = record.getName();
name = name.toLowerCase();
if (name.contains(filter.toLowerCase())) {
return true;
}
return false;
}
};
// filter.setFieldLabel("Filter Contacts");
filter2.setWidth(247);
@ -260,11 +260,13 @@ public class MultiDragContact extends Dialog {
gridAllContacts.mask("", ConstantsExplorer.LOADINGSTYLE);
if(listContact!=null && listContact.size()>0){
for (InfoContactModel infoContactModel : listContact) {
if(infoContactModel.getName()!=null && !infoContactModel.getName().isEmpty())
storeSource.add(infoContactModel);
}
// for (InfoContactModel infoContactModel : listContact) {
//
// if(infoContactModel.getName()!=null && !infoContactModel.getName().isEmpty())
// storeSource.add(infoContactModel);
// }
storeSource.add(listContact);
}
gridAllContacts.unmask();
}

View File

@ -1493,7 +1493,12 @@ public class GWTWorkspaceBuilder {
List<InfoContactModel> listContactsModel = new ArrayList<InfoContactModel>();
for(User user: listUsers){
listContactsModel.add(new InfoContactModel(user.getId(), user.getPortalLogin(), UserUtil.getUserFullName(user.getPortalLogin())));
String fullName = UserUtil.getUserFullName(user.getPortalLogin());
if(fullName!=null && !fullName.isEmpty())
listContactsModel.add(new InfoContactModel(user.getId(), user.getPortalLogin(), fullName));
else
logger.trace("buildGXTListContactsModel doesn't return user: "+user.getPortalLogin()+ "because name is null or empty");
}
return listContactsModel;