history of share, unshare is completed
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@81006 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d464d73eed
commit
d1f0dc7dbb
|
@ -93,6 +93,8 @@ import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
||||||
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
|
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
|
||||||
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
||||||
|
|
||||||
|
import com.liferay.portal.model.Contact;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
*
|
*
|
||||||
|
@ -1894,17 +1896,30 @@ public class GWTWorkspaceBuilder {
|
||||||
af.setOperation(GxtAccountingEntryType.SHARE);
|
af.setOperation(GxtAccountingEntryType.SHARE);
|
||||||
|
|
||||||
AccountingEntryShare acc = (AccountingEntryShare) accountingEntry;
|
AccountingEntryShare acc = (AccountingEntryShare) accountingEntry;
|
||||||
|
|
||||||
|
List<String> listContacts = new ArrayList<String>();
|
||||||
|
|
||||||
|
if(acc.getMembers()!=null && acc.getMembers().size()>0){
|
||||||
|
|
||||||
|
listContacts = acc.getMembers();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
String msg = "";
|
String msg = "";
|
||||||
if(acc.getItemName()==null || acc.getItemName().isEmpty())
|
if(acc.getItemName()==null || acc.getItemName().isEmpty())
|
||||||
msg = GxtAccountingEntryType.SHARE.getName()+" by "+user.getName();
|
msg = user.getName() + " "+GxtAccountingEntryType.SHARE.getName()+ " workspace folder";
|
||||||
|
// msg = GxtAccountingEntryType.SHARE.getName()+" by "+user.getName();
|
||||||
else
|
else
|
||||||
msg = acc.getItemName() +" "+GxtAccountingEntryType.SHARE.getName()+" by "+user.getName();
|
msg = user.getName() + " "+GxtAccountingEntryType.SHARE.getName()+ " workspace folder "+acc.getItemName();
|
||||||
|
// msg = acc.getItemName() +" "+GxtAccountingEntryType.SHARE.getName()+" by "+user.getName();
|
||||||
|
|
||||||
|
|
||||||
|
if(listContacts.size()>0){
|
||||||
|
|
||||||
|
msg+=" with "+UserUtil.separateFullNameToCommaForPortalLogin(acc.getMembers());
|
||||||
|
}
|
||||||
|
|
||||||
af.setDescription(msg);
|
af.setDescription(msg);
|
||||||
|
|
||||||
// af.setDescription(GxtAccountingEntryType.UPDATE.getName()+ " "+acc.getItemName() +" by "+user.getName());
|
|
||||||
// af.setDescription(acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1924,14 +1939,11 @@ public class GWTWorkspaceBuilder {
|
||||||
|
|
||||||
af.setDescription(msg);
|
af.setDescription(msg);
|
||||||
|
|
||||||
// af.setDescription(GxtAccountingEntryType.UPDATE.getName()+ " "+acc.getItemName() +" by "+user.getName());
|
|
||||||
// af.setDescription(acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
listAccFields.add(af);
|
listAccFields.add(af);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,4 +66,34 @@ public class UserUtil {
|
||||||
|
|
||||||
return listUsers;
|
return listUsers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String separateUsersNamesToComma(List<InfoContactModel> listContacts){
|
||||||
|
|
||||||
|
String users = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < listContacts.size()-1; i++) {
|
||||||
|
users+= listContacts.get(i).getName() + ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(listContacts.size()>1)
|
||||||
|
users += listContacts.get(listContacts.size()-1).getName();
|
||||||
|
|
||||||
|
return users;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String separateFullNameToCommaForPortalLogin(List<String> listLogin){
|
||||||
|
|
||||||
|
String users = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < listLogin.size()-1; i++) {
|
||||||
|
users+= getUserFullName(listLogin.get(i)) + ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(listLogin.size()>1)
|
||||||
|
users += getUserFullName(listLogin.get(listLogin.size()-1));
|
||||||
|
|
||||||
|
return users;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,8 @@ public class WsUtil {
|
||||||
|
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
|
|
||||||
user=TEST_USER;
|
// user=TEST_USER;
|
||||||
// user = "francesco.mangiacrapa";
|
user = "francesco.mangiacrapa";
|
||||||
|
|
||||||
defaultLogger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:");
|
defaultLogger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:");
|
||||||
defaultLogger.warn("session id: "+sessionID);
|
defaultLogger.warn("session id: "+sessionID);
|
||||||
|
|
Loading…
Reference in New Issue