updated accountings

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@75353 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-05-24 16:18:02 +00:00
parent 70153d12a8
commit cd885a3fb3
2 changed files with 34 additions and 5 deletions

View File

@ -117,7 +117,8 @@ public class AppController implements SubscriberInterface {
EventsTypeEnum.REFRESH_FOLDER, EventsTypeEnum.REFRESH_FOLDER,
EventsTypeEnum.SELECTED_MESSAGE, EventsTypeEnum.SELECTED_MESSAGE,
EventsTypeEnum.CREATE_NEW_MESSAGE, EventsTypeEnum.CREATE_NEW_MESSAGE,
EventsTypeEnum.REPLY_FORWARD_MESSAGE EventsTypeEnum.REPLY_FORWARD_MESSAGE,
EventsTypeEnum.FILE_DOWNLAD_EVENT
}); });
bind(); bind();
} }
@ -164,7 +165,7 @@ public class AppController implements SubscriberInterface {
FileGridModel fileItem = getGridSelectedItem(); FileGridModel fileItem = getGridSelectedItem();
if(fileItem!=null){ if(fileItem!=null){
AppControllerExplorer.getEventBus().fireEvent(new AccountingHistoryEvent(fileItem.getIdentifier())); AppControllerExplorer.getEventBus().fireEvent(new AccountingHistoryEvent(fileItem));
} }
} }
}); });
@ -178,7 +179,7 @@ public class AppController implements SubscriberInterface {
FileGridModel fileItem = getGridSelectedItem(); FileGridModel fileItem = getGridSelectedItem();
if(fileItem!=null){ if(fileItem!=null){
AppControllerExplorer.getEventBus().fireEvent(new AccountingReadersEvent(fileItem.getIdentifier())); AppControllerExplorer.getEventBus().fireEvent(new AccountingReadersEvent(fileItem));
} }
} }
}); });
@ -235,7 +236,20 @@ public class AppController implements SubscriberInterface {
@Override @Override
public void onFileDownloadEvent(FileDownloadEvent fileDownloadEvent) { public void onFileDownloadEvent(FileDownloadEvent fileDownloadEvent) {
AppControllerExplorer.getEventBus().fireEvent(new FileDownloadEvent(fileDownloadEvent.getItemIdentifier(), fileDownloadEvent.getItemName(), fileDownloadEvent.getDownloadType()));
if(fileDownloadEvent!=null){
// FileGridModel fileItem = getGridSelectedItem();
//
// String id = fileDownloadEvent.getItemIdentifier()!=null? fileDownloadEvent.getItemIdentifier():"";
//
// if(fileItem!=null && id.compareTo(fileItem.getIdentifier())==0){
// fileItem.setMarkAsRead(true);
// accountingSetItemAsRead(true);
// }
AppControllerExplorer.getEventBus().fireEvent(new FileDownloadEvent(fileDownloadEvent.getItemIdentifier(), fileDownloadEvent.getItemName(), fileDownloadEvent.getDownloadType()));
}
} }
}); });
@ -957,4 +971,19 @@ public class AppController implements SubscriberInterface {
}); });
} }
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#fileDownloaded(java.lang.String)
*/
@Override
public void fileDownloaded(String itemIdentifier) {
FileGridModel fileItem = wsPortlet.getGridGroupContainer().getFileGridModelByIdentifier(itemIdentifier);
if(fileItem!=null && itemIdentifier!= null && fileItem.getIdentifier().compareTo(itemIdentifier)==0){
fileItem.setMarkAsRead(true);
accountingSetItemAsRead(true);
}
}
} }

View File

@ -250,7 +250,7 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
} }
public void setSearchActive(boolean isSearchActive) { public void setSearchActive(boolean isSearchActive) {
System.out.println("#################SET SEARCH ACTIVE in GRID " + isSearchActive); // System.out.println("#################SET SEARCH ACTIVE in GRID " + isSearchActive);
this.isSearchActive = isSearchActive; this.isSearchActive = isSearchActive;
} }