@ -86,9 +86,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
@Override
public FolderModel getRootForTree ( ) throws Exception {
workspaceLogger . info ( "getRoot" ) ;
workspaceLogger . trace ( "getting workspace" ) ;
workspaceLogger . trace ( "getRoot" ) ;
try {
@ -243,7 +241,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
List < FileGridModel > listFileGridModels = new ArrayList < FileGridModel > ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "get children for Grid" ) ;
logger . trace ( "get children for Grid" ) ;
workspaceLogger . trace ( "get children for Grid" ) ;
@ -258,7 +256,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Long endTime = System . currentTimeMillis ( ) - startTime ;
String time = String . format ( "%d msc %d sec" , endTime , TimeUnit . MILLISECONDS . toSeconds ( endTime ) ) ;
logger . info ( "grid getChildren() returning " + listItems . size ( ) + " elements in " + time ) ;
logger . trace ( "grid getChildren() returning " + listItems . size ( ) + " elements in " + time ) ;
listFileGridModels = builder . buildGXTListFileGridModelItem ( listItems , folder ) ;
@ -276,14 +274,101 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
@Override
public Boolean moveItem ( String itemId , String destinationId ) throws Exception {
workspaceLogger . info ( "moveItem itemId: " + itemId + " destination: " + destinationId ) ;
workspaceLogger . trace ( "moveItem itemId: " + itemId + " destination: " + destinationId ) ;
try {
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "moveItem item: " + itemId + " destination: " + destinationId ) ;
logger . trace ( "moveItem item: " + itemId + " destination: " + destinationId ) ;
WorkspaceItem sourceItem = workspace . getItem ( itemId ) ; //GET SOURCE ITEM BEFORE OF MOVE
if ( sourceItem = = null )
return Boolean . FALSE ;
String sourceSharedId = null ;
boolean sourceItemIsShared = sourceItem . isShared ( ) ;
if ( sourceItemIsShared )
sourceSharedId = sourceItem . getIdSharedFolder ( ) ; //GET SHARED ID BEFORE OF MOVE
System . out . println ( "moveItem item: " + itemId + " sourceItem name " + sourceItem . getName ( ) + " shared: " + sourceItemIsShared + " destination: " + destinationId ) ;
workspace . moveItem ( itemId , destinationId ) ; //move item
WorkspaceItem folderDestinationItem = workspace . getItem ( destinationId ) ; //retrieve folder destination
System . out . println ( "sourceItem.isShared() " + sourceItemIsShared ) ;
System . out . println ( "folderDestinationItem item: " + destinationId + " folderDestinationItem name " + folderDestinationItem . getName ( ) + " folderDestinationItem shared: " + folderDestinationItem . isShared ( ) ) ;
workspace . moveItem ( itemId , destinationId ) ;
if ( folderDestinationItem ! = null ) {
// //if folder destination is shared folder
// if(folderDestinationItem.isShared()){ //Notify Added Item To Sharing?
//
// //share condition is true if source shared folder is null or not equal to destination shared folder
// shareChangeCondition = (sourceSharedId==null) || (sourceSharedId.compareTo(folderDestinationItem.getIdSharedFolder())!=0);
//
// System.out.println("shareChangeCondition add item: "+ shareChangeCondition);
//
//
// //if shareChangeCondition is true.. notifies added item to sharing
// if(shareChangeCondition){
//
// List<InfoContactModel> listContacts = getListUserSharedByFolderSharedId(folderDestinationItem.getIdSharedFolder());
//
// //DEBUG
// printContacts(listContacts);
//
// WorkspaceItem destinationSharedFolder = workspace.getItem(folderDestinationItem.getIdSharedFolder());
//
// np.notifyAddedItemToSharing(listContacts, sourceItem, (WorkspaceFolder) destinationSharedFolder);
//
//// np.notifyAddedItemToSharing(listContacts, (WorkspaceFolder) folderDestinationItem);
// }
// }
try {
checkNotifyAddItemToShare ( sourceItem , sourceSharedId , folderDestinationItem ) ;
checkNotifyRemoveItemToShare ( sourceItemIsShared , sourceItem , sourceSharedId , folderDestinationItem ) ;
} catch ( Exception e ) {
workspaceLogger . error ( "An error occurred in checkNotify " , e ) ;
}
// System.out.println("folderDestinationItem.isShared() "+ folderDestinationItem.getName() + ": "+ folderDestinationItem.isShared());
//
//
// String idSharedFolder = folderDestinationItem.getIdSharedFolder()!=null?folderDestinationItem.getIdSharedFolder():"";
//
// //share condition is true if source shared folder is not equal to destination shared folder
// shareChangeCondition = sourceSharedId==null?false:(sourceSharedId.compareTo(idSharedFolder)!=0);
//
// System.out.println("shareChangeCondition remove item: "+ shareChangeCondition);
//
// //Notify Removed Item To Sharing?
// //if source Item is shared and folder destination is not shared or shareChangeCondition is true.. notifies removed item to sharing
// if(sourceItemIsShared && (!folderDestinationItem.isShared() || shareChangeCondition)){
//
// //get contacts
// List<InfoContactModel> listContacts = getListUserSharedByFolderSharedId(sourceSharedId);
//
// //DEBUG
// printContacts(listContacts);
//
// WorkspaceItem sourceSharedFolder = workspace.getItem(sourceSharedId);
//
// System.out.println(" name sourceSharedFolder: "+ sourceSharedFolder.getName());
//
// np.notifyRemovedItemToSharing(listContacts, sourceItem, (WorkspaceFolder) sourceSharedFolder);
//
// }
}
return Boolean . TRUE ;
} catch ( InsufficientPrivilegesException e ) {
@ -298,15 +383,170 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
}
}
private void checkNotifyAddItemToShare ( WorkspaceItem sourceItem , String sourceSharedId , WorkspaceItem folderDestinationItem ) throws WorkspaceFolderNotFoundException , ItemNotFoundException , InternalErrorException , HomeNotFoundException , Exception {
if ( folderDestinationItem ! = null ) {
//if folder destination is shared folder
if ( folderDestinationItem . isShared ( ) ) { //Notify Added Item To Sharing?
//share condition is true if source shared folder is null or not equal to destination shared folder
boolean shareChangeCondition = ( sourceSharedId = = null ) | | ( sourceSharedId . compareTo ( folderDestinationItem . getIdSharedFolder ( ) ) ! = 0 ) ;
System . out . println ( "shareChangeCondition add item: " + shareChangeCondition ) ;
//if shareChangeCondition is true.. notifies added item to sharing
if ( shareChangeCondition ) {
List < InfoContactModel > listContacts = getListUserSharedByFolderSharedId ( folderDestinationItem . getIdSharedFolder ( ) ) ;
//DEBUG
printContacts ( listContacts ) ;
Workspace workspace = getWorkspace ( ) ;
WorkspaceItem destinationSharedFolder = workspace . getItem ( folderDestinationItem . getIdSharedFolder ( ) ) ;
NotificationsProducer np = getNotificationProducer ( ) ;
np . notifyAddedItemToSharing ( listContacts , sourceItem , ( WorkspaceFolder ) destinationSharedFolder ) ;
// np.notifyAddedItemToSharing(listContacts, (WorkspaceFolder) folderDestinationItem);
}
}
} else
workspaceLogger . error ( "verifyNotifyAddItemToShare folder destination item is null" ) ;
}
// private void checkNotifyAddItemToShare(final String itemId, final String destinationId) throws WorkspaceFolderNotFoundException, ItemNotFoundException, InternalErrorException, HomeNotFoundException, Exception{
//
// new Thread(){
// @Override
// public void run() {
//
// try{
//
// Workspace workspace = getWorkspace();
// GCUBEClientLog logger = new GCUBEClientLog(GWTWorkspaceServiceImpl.class);
// logger.trace("moveItem item: "+itemId+" destination: "+destinationId);
//
// WorkspaceItem sourceItem = workspace.getItem(itemId);
//
// if(sourceItem==null)
// return;
//
// String sourceSharedId = null;
// boolean sourceItemIsShared = sourceItem.isShared();
//
// if(sourceItemIsShared)
// sourceSharedId = sourceItem.getIdSharedFolder(); //GET SHARED ID BEFORE OF MOVE
//
//
// System.out.println("moveItem item: "+itemId+" sourceItem name "+sourceItem.getName() + " shared: "+sourceItemIsShared+ " destination: "+destinationId);
//
//
// WorkspaceItem folderDestinationItem = workspace.getItem(destinationId); //retrieve folder destination
//
// if(folderDestinationItem!=null){
//
// //if folder destination is shared folder
// if(folderDestinationItem.isShared()){ //Notify Added Item To Sharing?
//
// //share condition is true if source shared folder is null or not equal to destination shared folder
// boolean shareChangeCondition = (sourceSharedId==null) || (sourceSharedId.compareTo(folderDestinationItem.getIdSharedFolder())!=0);
//
// System.out.println("shareChangeCondition add item: "+ shareChangeCondition);
//
// //if shareChangeCondition is true.. notifies added item to sharing
// if(shareChangeCondition){
//
// List<InfoContactModel> listContacts = getListUserSharedByFolderSharedId(folderDestinationItem.getIdSharedFolder());
//
// //DEBUG
// printContacts(listContacts);
//
// WorkspaceItem destinationSharedFolder = workspace.getItem(folderDestinationItem.getIdSharedFolder());
//
// NotificationsProducer np = getNotificationProducer();
//
// np.notifyAddedItemToSharing(listContacts, sourceItem, (WorkspaceFolder) destinationSharedFolder);
//
//// np.notifyAddedItemToSharing(listContacts, (WorkspaceFolder) folderDestinationItem);
// }
// }
// }else
// workspaceLogger.error("verifyNotifyAddItemToShare folder destination item is null");
//
//
// }catch (Exception e) {
// // TODO: handle exception
// }
//
//
// }
// }.start();
//
// }
private void checkNotifyRemoveItemToShare ( boolean sourceItemIsShared , WorkspaceItem sourceItem , String sourceSharedId , WorkspaceItem folderDestinationItem ) throws WorkspaceFolderNotFoundException , ItemNotFoundException , InternalErrorException , HomeNotFoundException , Exception {
if ( folderDestinationItem ! = null ) {
String idSharedFolder = folderDestinationItem . getIdSharedFolder ( ) ! = null ? folderDestinationItem . getIdSharedFolder ( ) : "" ;
//share condition is true if source shared folder is not equal to destination shared folder
boolean shareChangeCondition = sourceSharedId = = null ? false : ( sourceSharedId . compareTo ( idSharedFolder ) ! = 0 ) ;
System . out . println ( "shareChangeCondition remove item: " + shareChangeCondition ) ;
//Notify Removed Item To Sharing?
//if source Item is shared and folder destination is not shared or shareChangeCondition is true.. notifies removed item to sharing
if ( sourceItemIsShared & & ( ! folderDestinationItem . isShared ( ) | | shareChangeCondition ) ) {
//get contacts
List < InfoContactModel > listContacts = getListUserSharedByFolderSharedId ( sourceSharedId ) ;
//DEBUG
printContacts ( listContacts ) ;
Workspace workspace = getWorkspace ( ) ;
WorkspaceItem sourceSharedFolder = workspace . getItem ( sourceSharedId ) ;
System . out . println ( " name sourceSharedFolder: " + sourceSharedFolder . getName ( ) ) ;
NotificationsProducer np = getNotificationProducer ( ) ;
np . notifyRemovedItemToSharing ( listContacts , sourceItem , ( WorkspaceFolder ) sourceSharedFolder ) ;
}
} else
workspaceLogger . error ( "verifyNotifyRemoveItemToShare folder destination item is null" ) ;
}
//DEBUG
private void printContacts ( List < InfoContactModel > listContacts ) {
System . out . println ( "PRINT CONTACTS: " ) ;
for ( InfoContactModel infoContactModel : listContacts ) {
System . out . println ( "User: " + infoContactModel ) ;
}
}
@Override
public Boolean removeItem ( String itemId ) throws Exception {
workspaceLogger . info ( "removeItem itemId: " + itemId ) ;
workspaceLogger . trace ( "removeItem itemId: " + itemId ) ;
try {
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "removeItem item: " + itemId ) ;
logger . trace ( "removeItem item: " + itemId ) ;
workspace . removeItem ( itemId ) ;
return Boolean . TRUE ;
@ -327,14 +567,14 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
@Override
public Boolean renameItem ( String itemId , String newName ) throws Exception {
workspaceLogger . info ( "renameItem itemId: " + itemId + " newName: " + newName ) ;
workspaceLogger . trace ( "renameItem itemId: " + itemId + " newName: " + newName ) ;
try {
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "renameItem itemId: " + itemId + " newName: " + newName ) ;
logger . trace ( "renameItem itemId: " + itemId + " newName: " + newName ) ;
workspace . renameItem ( itemId , newName ) ;
return true ;
@ -349,15 +589,20 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
@Override
public FolderModel createFolder ( String nameFolder , String description , FileModel parent ) throws Exception {
workspaceLogger . info ( "create folder" ) ;
workspaceLogger . trace ( "create folder" ) ;
try {
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "create folder: " + nameFolder ) ;
logger . trace ( "create folder: " + nameFolder ) ;
WorkspaceFolder wsFolder = workspace . createFolder ( nameFolder , description , parent . getIdentifier ( ) ) ;
WorkspaceItem folderDestinationItem = workspace . getItem ( parent . getIdentifier ( ) ) ;
checkNotifyAddItemToShare ( wsFolder , null , folderDestinationItem ) ;
GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder ( ) ;
@ -375,13 +620,13 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
@Override
public FileDetailsModel getDetailsFile ( FileModel folder ) throws Exception {
workspaceLogger . info ( "load file details" ) ;
workspaceLogger . trace ( "load file details" ) ;
try {
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "load file details: " + folder . getName ( ) ) ;
logger . trace ( "load file details: " + folder . getName ( ) ) ;
WorkspaceItem wsItem = workspace . getItem ( folder . getIdentifier ( ) ) ;
GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder ( ) ;
@ -407,7 +652,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "search itemId: " + itemIdentifier ) ;
logger . trace ( "search itemId: " + itemIdentifier ) ;
WorkspaceItem item = workspace . getItem ( itemIdentifier ) ; //get item from workspace
getListsChildrenByParents ( listSubTree , item ) ;
@ -431,7 +676,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "get smart folder by category: " + category ) ;
logger . trace ( "get smart folder by category: " + category ) ;
// listWorkspaceItems = workspace.getWorkspaceTree(workspace.getRoot()); //get item from workspace
@ -526,7 +771,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "create smart folder by name: " + name ) ;
logger . trace ( "create smart folder by name: " + name ) ;
workspaceLogger . trace ( "name " + name ) ;
workspaceLogger . trace ( "query " + query ) ;
@ -565,7 +810,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "remove smart folder by id: " + itemId ) ;
logger . trace ( "remove smart folder by id: " + itemId ) ;
workspace . removeItem ( itemId ) ; //remove Smart Folder from workspace
@ -587,7 +832,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "get all smart folder" ) ;
logger . trace ( "get all smart folder" ) ;
// workspaceLogger.trace("get all smart folder");
// List<WorkspaceFolder> listWorkspaceFolder = new ArrayList<WorkspaceFolder>();
@ -619,7 +864,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "get smart folder by id: " + folderId ) ;
logger . trace ( "get smart folder by id: " + folderId ) ;
// WorkspaceFolder wsFolder = workspace.getSmartFolder(folderId); //get Smart Folder from workspace
@ -649,7 +894,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "get image by id: " + identifier ) ;
logger . trace ( "get image by id: " + identifier ) ;
WorkspaceItem item = workspace . getItem ( identifier ) ; //get item from workspace
@ -678,7 +923,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "get timeseries by id: " + identifier ) ;
logger . trace ( "get timeseries by id: " + identifier ) ;
WorkspaceItem item = workspace . getItem ( identifier ) ; //get item from workspace
@ -702,7 +947,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "get url by id: " + identifier ) ;
logger . trace ( "get url by id: " + identifier ) ;
WorkspaceItem item = workspace . getItem ( identifier ) ; //get item from workspace
@ -729,7 +974,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
Workspace workspace = getWorkspace ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "create url in parent id: " + parentFileModel . getIdentifier ( ) ) ;
logger . trace ( "create url in parent id: " + parentFileModel . getIdentifier ( ) ) ;
//DEBUG
// workspaceLogger.trace("Name " + name);
@ -844,10 +1089,12 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
logger . warn ( "WORKSPACE PORTLET IS IN TEST MODE - RETURN TEST USERS" ) ;
List < InfoContactModel > listContactsModel = new ArrayList < InfoContactModel > ( ) ;
// //TEST USERS
listContactsModel . add ( new InfoContactModel ( "Federico.Test" , "Federico.Test" , "Federico de Faveri" ) ) ;
listContactsModel . add ( new InfoContactModel ( "Antonio.Test" , "Antonio.Test" , "Antonio Gioia" ) ) ;
listContactsModel . add ( new InfoContactModel ( "Fabio.Test" , "Fabio.Test" , "Fabio Sinibaldi" ) ) ;
listContactsModel . add ( new InfoContactModel ( "federico.defaveri" , "federico.defaveri" , "Federico de Faveri" ) ) ;
listContactsModel . add ( new InfoContactModel ( "antonio.gioia" , "antonio.gioia" , "Antonio Gioia" ) ) ;
listContactsModel . add ( new InfoContactModel ( "fabio.sinibaldi" , "fabio.sinibaldi" , "Fabio Sinibaldi" ) ) ;
listContactsModel . add ( new InfoContactModel ( "pasquale.pagano" , "pasquale.pagano" , "Pasquale Pagano" ) ) ;
listContactsModel . add ( new InfoContactModel ( Util . TEST_USER , Util . TEST_USER , Util . TEST_USER ) ) ;
listContactsModel . add ( new InfoContactModel ( "francesco.mangiacrapa" , "francesco.mangiacrapa" , "Francesco Mangiacrapa" ) ) ;
listContactsModel . add ( new InfoContactModel ( "massimiliano.assante" , "massimiliano.assante" , "Massimiliano Assante" ) ) ;
return listContactsModel ;
@ -1263,11 +1510,18 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
try {
Workspace workspace = getWorkspace ( ) ;
WorkspaceItem sourceItem = workspace . getItem ( itemId ) ; //GET SOURCE ITEM BEFORE COPY
String sourceSharedId = sourceItem . getIdSharedFolder ( ) ;
GCUBEClientLog logger = new GCUBEClientLog ( GWTWorkspaceServiceImpl . class ) ;
logger . info ( "copyItem by id: " + itemId ) ;
WorkspaceItem item = workspace . copy ( itemId , destinationFolderId ) ;
WorkspaceItem item = workspace . copy ( itemId , destinationFolderId ) ; //copy item
WorkspaceItem folderDestinationItem = workspace . getItem ( destinationFolderId ) ;
checkNotifyAddItemToShare ( sourceItem , sourceSharedId , folderDestinationItem ) ;
if ( item ! = null )
return true ;
@ -1355,6 +1609,14 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
WorkspaceSharedFolder sharedFolder = null ;
List < InfoContactModel > listSharedContact = null ;
boolean sourceFolderIsShared = folder . isShared ( ) ;
if ( sourceFolderIsShared ) { //if source folder is already share... retrieve old list of sharing to notify
listSharedContact = getListUserSharedByFolderSharedId ( folder . getIdentifier ( ) ) ;
}
if ( listLogin . size ( ) > 0 ) {
if ( ! isNewFolder )
@ -1368,7 +1630,10 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
if ( created ) {
NotificationsProducer np = getNotificationProducer ( ) ;
np . notifyFolderSharing ( listContacts , sharedFolder ) ;
if ( ! sourceFolderIsShared ) //if source folder is not already shared
np . notifyFolderSharing ( listContacts , sharedFolder ) ;
else
np . notifyAddedUserToSharing ( listSharedContact , listContacts , sharedFolder ) ;
}
return created ;
@ -1391,7 +1656,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
} catch ( Exception e ) {
workspaceLogger . error ( "Error in shareFolder " , e ) ;
e . printStackTrace ( ) ;
String error = ConstantsExplorer . SERVER_ERROR + " creating shared folder. "+ e . getMessage ( ) ;
String error = ConstantsExplorer . SERVER_ERROR + " creating shared folder. ";
throw new Exception ( error ) ;
}
}
@ -1420,6 +1685,8 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
}
else {
workspaceLogger . trace ( "the item with id: " + folderSharedId + " is not " + WorkspaceItemType . SHARED_FOLDER ) ;
//DEBUG
System . out . println ( "the item with id: " + folderSharedId + " is not " + WorkspaceItemType . SHARED_FOLDER ) ;
}
return new ArrayList < InfoContactModel > ( ) ;
@ -1454,14 +1721,15 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
if ( unShared ) {
NotificationsProducer np = getNotificationProducer ( ) ;
List < InfoContactModel > contacts = getListUserSharedByFolderSharedId ( folderSharedId ) ;
// if(isTestMode()){
// contacts = new ArrayList<InfoContactModel>();
// contacts.add(new InfoContactModel("francesco.mangiacrapa", "francesco.mangiacrapa", "Francesco Mangiacrapa"));
// }
printContacts ( contacts ) ;
if ( isTestMode ( ) ) {
contacts = new ArrayList < InfoContactModel > ( ) ;
contacts . add ( new InfoContactModel ( "francesco.mangiacrapa" , "francesco.mangiacrapa" , "Francesco Mangiacrapa" ) ) ;
}
np . notifyFolderUnSharing ( contacts , wsFolder ) ;
np . notifyFolderUnSharing ( contacts , unSharedFolder ) ;
}
}
@ -1475,7 +1743,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
} catch ( Exception e ) {
workspaceLogger . error ( "Error in unSharedFolderByFolderSharedId " , e ) ;
String error = ConstantsExplorer . SERVER_ERROR + " un share folder. "+ e . getMessage ( ) + ". " + ConstantsExplorer . TRY_AGAIN ;
String error = ConstantsExplorer . SERVER_ERROR + " un share folder. Refresh folder and " + ConstantsExplorer . TRY_AGAIN ;
e . printStackTrace ( ) ;
throw new Exception ( error ) ;
}