refactor to class Difference
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@120327 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
80db6955aa
commit
ef8bccf3ef
|
@ -60,7 +60,7 @@ import org.gcube.portlets.user.workspace.server.notifications.NotificationsUtil;
|
||||||
import org.gcube.portlets.user.workspace.server.resolver.UriResolverReaderParameter;
|
import org.gcube.portlets.user.workspace.server.resolver.UriResolverReaderParameter;
|
||||||
import org.gcube.portlets.user.workspace.server.shortener.UrlShortener;
|
import org.gcube.portlets.user.workspace.server.shortener.UrlShortener;
|
||||||
import org.gcube.portlets.user.workspace.server.util.AclTypeComparator;
|
import org.gcube.portlets.user.workspace.server.util.AclTypeComparator;
|
||||||
import org.gcube.portlets.user.workspace.server.util.DiffereceBetweenInfoContactModel;
|
import org.gcube.portlets.user.workspace.server.util.DifferenceBetweenInfoContactModel;
|
||||||
import org.gcube.portlets.user.workspace.server.util.HttpRequestUtil;
|
import org.gcube.portlets.user.workspace.server.util.HttpRequestUtil;
|
||||||
import org.gcube.portlets.user.workspace.server.util.StringUtil;
|
import org.gcube.portlets.user.workspace.server.util.StringUtil;
|
||||||
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
||||||
|
@ -1715,7 +1715,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
sharedFolder.setDescription(folder.getDescription()); //SET NEW DESCRIPTION
|
sharedFolder.setDescription(folder.getDescription()); //SET NEW DESCRIPTION
|
||||||
|
|
||||||
//USER REMOVED FROM SHARE
|
//USER REMOVED FROM SHARE
|
||||||
DiffereceBetweenInfoContactModel diff2 = new DiffereceBetweenInfoContactModel(listSharedContact, listContacts);
|
DifferenceBetweenInfoContactModel diff2 = new DifferenceBetweenInfoContactModel(listSharedContact, listContacts);
|
||||||
List<InfoContactModel> listRemovedUsersFromShare = diff2.getDifferentsContacts();
|
List<InfoContactModel> listRemovedUsersFromShare = diff2.getDifferentsContacts();
|
||||||
workspaceLogger.info("List removed user from share has size: "+listRemovedUsersFromShare.size());
|
workspaceLogger.info("List removed user from share has size: "+listRemovedUsersFromShare.size());
|
||||||
for (InfoContactModel userRemoved : listRemovedUsersFromShare) {
|
for (InfoContactModel userRemoved : listRemovedUsersFromShare) {
|
||||||
|
@ -3062,14 +3062,14 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
NotificationsProducer np = getNotificationProducer();
|
NotificationsProducer np = getNotificationProducer();
|
||||||
|
|
||||||
workspaceLogger.info("Sending notifications downgrade/upgrade administator/s..");
|
workspaceLogger.info("Sending notifications downgrade/upgrade administator/s..");
|
||||||
DiffereceBetweenInfoContactModel diff1 = new DiffereceBetweenInfoContactModel(oldAdmins, newAdmins);
|
DifferenceBetweenInfoContactModel diff1 = new DifferenceBetweenInfoContactModel(oldAdmins, newAdmins);
|
||||||
List<InfoContactModel> contactsDowngrade = diff1.getDifferentsContacts();
|
List<InfoContactModel> contactsDowngrade = diff1.getDifferentsContacts();
|
||||||
|
|
||||||
for (InfoContactModel infoContactModel : contactsDowngrade) {
|
for (InfoContactModel infoContactModel : contactsDowngrade) {
|
||||||
np.notifyAdministratorDowngrade(infoContactModel, sharedFolder);
|
np.notifyAdministratorDowngrade(infoContactModel, sharedFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
DiffereceBetweenInfoContactModel diff2 = new DiffereceBetweenInfoContactModel(newAdmins, oldAdmins);
|
DifferenceBetweenInfoContactModel diff2 = new DifferenceBetweenInfoContactModel(newAdmins, oldAdmins);
|
||||||
List<InfoContactModel> contactsUpgrade = diff2.getDifferentsContacts();
|
List<InfoContactModel> contactsUpgrade = diff2.getDifferentsContacts();
|
||||||
|
|
||||||
for (InfoContactModel infoContactModel : contactsUpgrade) {
|
for (InfoContactModel infoContactModel : contactsUpgrade) {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
||||||
import org.gcube.portlets.user.workspace.server.util.DiffereceBetweenInfoContactModel;
|
import org.gcube.portlets.user.workspace.server.util.DifferenceBetweenInfoContactModel;
|
||||||
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
||||||
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ public class NotificationsProducer {
|
||||||
try{
|
try{
|
||||||
|
|
||||||
//NEW USER SHARED
|
//NEW USER SHARED
|
||||||
DiffereceBetweenInfoContactModel diff = new DiffereceBetweenInfoContactModel(listSharingContact, listSharedContact);
|
DifferenceBetweenInfoContactModel diff = new DifferenceBetweenInfoContactModel(listSharingContact, listSharedContact);
|
||||||
|
|
||||||
List<InfoContactModel> listNewContactsShared = diff.getDifferentsContacts();
|
List<InfoContactModel> listNewContactsShared = diff.getDifferentsContacts();
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ public class NotificationsProducer {
|
||||||
}
|
}
|
||||||
|
|
||||||
//USER REMOVED FROM SHARE
|
//USER REMOVED FROM SHARE
|
||||||
DiffereceBetweenInfoContactModel diff2 = new DiffereceBetweenInfoContactModel(listSharedContact, listSharingContact);
|
DifferenceBetweenInfoContactModel diff2 = new DifferenceBetweenInfoContactModel(listSharedContact, listSharingContact);
|
||||||
|
|
||||||
List<InfoContactModel> listRemovedUsersFromShare = diff2.getDifferentsContacts();
|
List<InfoContactModel> listRemovedUsersFromShare = diff2.getDifferentsContacts();
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,14 @@ import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class DiffereceBetweenInfoContactModel.
|
* The Class DifferenceBetweenInfoContactModel.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
* Nov 19, 2015
|
* Nov 19, 2015
|
||||||
*/
|
*/
|
||||||
public class DiffereceBetweenInfoContactModel {
|
public class DifferenceBetweenInfoContactModel {
|
||||||
|
|
||||||
|
|
||||||
private List<InfoContactModel> listOne;
|
private List<InfoContactModel> listOne;
|
||||||
|
@ -25,7 +26,7 @@ public class DiffereceBetweenInfoContactModel {
|
||||||
* @param listA the list a
|
* @param listA the list a
|
||||||
* @param listB the list b
|
* @param listB the list b
|
||||||
*/
|
*/
|
||||||
public DiffereceBetweenInfoContactModel(List<InfoContactModel> listA, List<InfoContactModel> listB){
|
public DifferenceBetweenInfoContactModel(List<InfoContactModel> listA, List<InfoContactModel> listB){
|
||||||
this.listOne = listA;
|
this.listOne = listA;
|
||||||
this.listTwo = listB;
|
this.listTwo = listB;
|
||||||
}
|
}
|
Loading…
Reference in New Issue