Updated History with share and unshare.
Management of Session expired completed git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@80992 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
e617ba61ac
commit
d464d73eed
|
@ -28,6 +28,8 @@ import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingE
|
||||||
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryRead;
|
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryRead;
|
||||||
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryRemoval;
|
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryRemoval;
|
||||||
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryRenaming;
|
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryRenaming;
|
||||||
|
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryShare;
|
||||||
|
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryUnshare;
|
||||||
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryUpdate;
|
import org.gcube.portlets.user.homelibrary.home.workspace.accounting.AccountingEntryUpdate;
|
||||||
import org.gcube.portlets.user.homelibrary.home.workspace.folder.FolderBulkCreator;
|
import org.gcube.portlets.user.homelibrary.home.workspace.folder.FolderBulkCreator;
|
||||||
import org.gcube.portlets.user.homelibrary.home.workspace.folder.FolderItem;
|
import org.gcube.portlets.user.homelibrary.home.workspace.folder.FolderItem;
|
||||||
|
@ -1884,6 +1886,49 @@ public class GWTWorkspaceBuilder {
|
||||||
// af.setDescription(acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName());
|
// af.setDescription(acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SHARE:
|
||||||
|
|
||||||
|
if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.SHARE)){
|
||||||
|
|
||||||
|
af.setOperation(GxtAccountingEntryType.SHARE);
|
||||||
|
|
||||||
|
AccountingEntryShare acc = (AccountingEntryShare) accountingEntry;
|
||||||
|
|
||||||
|
String msg = "";
|
||||||
|
if(acc.getItemName()==null || acc.getItemName().isEmpty())
|
||||||
|
msg = GxtAccountingEntryType.SHARE.getName()+" by "+user.getName();
|
||||||
|
else
|
||||||
|
msg = acc.getItemName() +" "+GxtAccountingEntryType.SHARE.getName()+" by "+user.getName();
|
||||||
|
|
||||||
|
af.setDescription(msg);
|
||||||
|
|
||||||
|
// af.setDescription(GxtAccountingEntryType.UPDATE.getName()+ " "+acc.getItemName() +" by "+user.getName());
|
||||||
|
// af.setDescription(acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case UNSHARE:
|
||||||
|
|
||||||
|
if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.UNSHARE)){
|
||||||
|
|
||||||
|
af.setOperation(GxtAccountingEntryType.UNSHARE);
|
||||||
|
|
||||||
|
AccountingEntryUnshare acc = (AccountingEntryUnshare) accountingEntry;
|
||||||
|
|
||||||
|
String msg = "";
|
||||||
|
if(acc.getItemName()==null || acc.getItemName().isEmpty())
|
||||||
|
msg = GxtAccountingEntryType.UNSHARE.getName()+" by "+user.getName();
|
||||||
|
else
|
||||||
|
msg = acc.getItemName() +" "+GxtAccountingEntryType.UNSHARE.getName()+" by "+user.getName();
|
||||||
|
|
||||||
|
af.setDescription(msg);
|
||||||
|
|
||||||
|
// af.setDescription(GxtAccountingEntryType.UPDATE.getName()+ " "+acc.getItemName() +" by "+user.getName());
|
||||||
|
// af.setDescription(acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2295,14 +2295,17 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isSessionExpired() throws Exception {
|
public boolean isSessionExpired() throws Exception {
|
||||||
|
workspaceLogger.trace("workspace session validating...");
|
||||||
//READING USERNAME FROM ASL SESSION
|
//READING USERNAME FROM ASL SESSION
|
||||||
String userUsername = WsUtil.getAslSession(this.getThreadLocalRequest().getSession()).getUsername();
|
String userUsername = WsUtil.getAslSession(this.getThreadLocalRequest().getSession()).getUsername();
|
||||||
|
|
||||||
if(userUsername.compareTo(WsUtil.TEST_USER)==0){
|
if(userUsername.compareTo(WsUtil.TEST_USER)==0){
|
||||||
|
workspaceLogger.error("workspace session is expired! username is: "+WsUtil.TEST_USER);
|
||||||
return true; //is TEST_USER, session is expired
|
return true; //is TEST_USER, session is expired
|
||||||
}
|
}
|
||||||
|
|
||||||
|
workspaceLogger.trace("workspace session is valid! current username is: "+userUsername);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,10 @@ public enum GxtAccountingEntryType {
|
||||||
|
|
||||||
UPDATE("Updated", "updated"),
|
UPDATE("Updated", "updated"),
|
||||||
|
|
||||||
|
SHARE("Shared", "shared"),
|
||||||
|
|
||||||
|
UNSHARE("Unshared", "unshared"),
|
||||||
|
|
||||||
ALL("all", "all"),
|
ALL("all", "all"),
|
||||||
|
|
||||||
ALLWITHOUTREAD("allwithoutread", "allwithoutread");
|
ALLWITHOUTREAD("allwithoutread", "allwithoutread");
|
||||||
|
|
Loading…
Reference in New Issue