### Eclipse Workspace Patch 1.0
#P Ametys - 05 Plugin Explorer
Index: main/plugin-explorer/src/org/ametys/plugins/explorer/resources/actions/AddOrUpdateResourceAction.java
===================================================================
--- main/plugin-explorer/src/org/ametys/plugins/explorer/resources/actions/AddOrUpdateResourceAction.java	(revision 31097)
+++ main/plugin-explorer/src/org/ametys/plugins/explorer/resources/actions/AddOrUpdateResourceAction.java	(working copy)
@@ -293,20 +293,23 @@
         try
         {
             zipFile = new ZipFile(uploadedFile, "cp437");
-            _unzip(request, collection, zipFile);
+            Map<String, String> resourcesNamesById = _unzip(request, collection, zipFile);
             
             result.put("need-reload", "true");
             result.put("parentID", collection.getId());
             result.put("success", "true");
             
             String author = _currentUserProvider.getUser();
+            String firstEntryName = zipFile.getEntries().nextElement().getName();
+            String archiveRootFolderName = firstEntryName.substring(0, firstEntryName.indexOf("/"));
             
             // Notify listeners
             Map<String, Object> eventParams = new HashMap<String, Object>();
             eventParams.put("parentID", collection.getId());
-            eventParams.put("name", collection.getName());
-            eventParams.put("path", collection.getPath());
-            _obsManager.notifyEvent(new ExplorerEvent(EventType.RESOURCE_CREATE, author, collection.getId(), eventParams));
+            eventParams.put("name", archiveRootFolderName); 
+            eventParams.put("path", collection.getPath() + "/" + archiveRootFolderName);
+            eventParams.put("resourcesIds", resourcesNamesById);
+            _obsManager.notifyEvent(new ExplorerEvent(EventType.RESOURCES_CREATE, author, collection.getId(), eventParams));
         }
         catch (IOException e) 
         {
@@ -337,8 +340,10 @@
         return collection.createChild(name, collection.getResourceType());
     }
     
-    private void _unzip (Request request, ModifiableResourceCollection collection, ZipFile zipFile) throws IOException
+    private Map<String, String> _unzip (Request request, ModifiableResourceCollection collection, ZipFile zipFile) throws IOException
     {
+        Map<String, String> pathByUnzippedResourceId = new HashMap<String, String> ();
+        
         Enumeration<ZipArchiveEntry> entries = zipFile.getEntries();
         while (entries.hasMoreElements())
         {
@@ -362,10 +367,11 @@
             }
             else
             {
-                _addZipEntry(request, parentCollection, zipFile, zipEntry, name);
+                pathByUnzippedResourceId.put(_addZipEntry(request, parentCollection, zipFile, zipEntry, name), name);
             }
-            
         }
+        
+        return pathByUnzippedResourceId;
     }
     
     private ModifiableResourceCollection _addCollection (ModifiableResourceCollection collection, String name)
@@ -382,7 +388,7 @@
         }
     }
     
-    private void _addZipEntry (Request request, ModifiableResourceCollection collection, ZipFile zipFile, ZipArchiveEntry zipEntry, String fileName) throws IOException
+    private String _addZipEntry (Request request, ModifiableResourceCollection collection, ZipFile zipFile, ZipArchiveEntry zipEntry, String fileName) throws IOException
     {
         String author = _currentUserProvider.getUser();
         InputStream is = zipFile.getInputStream(zipEntry);
@@ -409,5 +415,7 @@
         _checkpoint(resource);
         
         IOUtils.closeQuietly(is);
+        
+        return resource.getId();
     }
 }
Index: main/plugin-explorer/src/org/ametys/plugins/explorer/observation/ExplorerEvent.java
===================================================================
--- main/plugin-explorer/src/org/ametys/plugins/explorer/observation/ExplorerEvent.java	(revision 31097)
+++ main/plugin-explorer/src/org/ametys/plugins/explorer/observation/ExplorerEvent.java	(working copy)
@@ -25,6 +25,8 @@
     /** The event type */
     public enum EventType
     {
+        /** Event of creation of several resources */
+        RESOURCES_CREATE,
         /** Event of creation. */
         RESOURCE_CREATE,
         /** Event of edition. */
#P Ametys - 06 Explorer
Index: main/plugin-projects/i18n/messages_fr.xml
===================================================================
--- main/plugin-projects/i18n/messages_fr.xml	(revision 31097)
+++ main/plugin-projects/i18n/messages_fr.xml	(working copy)
@@ -57,6 +57,9 @@
 	<!-- +
 		 | MAIL NOTIFICATION
 		 + -->
+	<message key="PROJECT_MAIL_NOTIFICATION_SUBJECT_RESOURCES_CREATE">[Espace projet {0}] Ajout du répertoire {1}</message>
+    <message key="PROJECT_MAIL_NOTIFICATION_BODY_RESOURCES_CREATE">Ceci est un message automatique.&#13;&#13;Vous recevez cet email car un nouveau répertoire intitulé '{4}' a été ajouté dans l'espace projet {0} par l'utilisateur {2} ({3}).&#13;Le chemin du nouveau répertoire est le suivant : {6}.&#13;&#13;Pour télécharger les fichiers du répertoire, cliquez sur un des liens ci-après ou copiez/collez l'url dans votre navigateur : {5}.&#13;&#13;Pour vous rendre sur l'espace projet, cliquez sur le lien ci-après ou copiez/collez l'url dans votre navigateur : {1}.</message>
+		 
 	<message key="PROJECT_MAIL_NOTIFICATION_SUBJECT_RESOURCE_CREATE">[Espace projet {0}] Ajout du document {1}</message>
 	<message key="PROJECT_MAIL_NOTIFICATION_BODY_RESOURCE_CREATE">Ceci est un message automatique.&#13;&#13;Vous recevez cet email car un nouveau document intitulé '{4}' a été ajouté dans l'espace projet {0} par l'utilisateur {2} ({3}).&#13;Le chemin du nouveau document est le suivant : {6}.&#13;&#13;Pour télécharger le document, cliquez sur le lien ci-après ou copiez/collez l'url dans votre navigateur : {5}.&#13;&#13;Pour vous rendre sur l'espace projet, cliquez sur le lien ci-après ou copiez/collez l'url dans votre navigateur : {1}.</message>
 	
Index: main/plugin-projects/src/org/ametys/explorer/projects/AbstractMailNotifier.java
===================================================================
--- main/plugin-projects/src/org/ametys/explorer/projects/AbstractMailNotifier.java	(revision 31097)
+++ main/plugin-projects/src/org/ametys/explorer/projects/AbstractMailNotifier.java	(working copy)
@@ -186,6 +186,7 @@
     
     /**
      * Create the url to access a node directly
+     * @param projectName the name of the project
      * @param id the ID of the node
      * @return An URL representing the project's url, plus #ID
      */
Index: main/plugin-projects/src/org/ametys/explorer/projects/ResourcesMailNotifier.java
===================================================================
--- main/plugin-projects/src/org/ametys/explorer/projects/ResourcesMailNotifier.java	(revision 31097)
+++ main/plugin-projects/src/org/ametys/explorer/projects/ResourcesMailNotifier.java	(working copy)
@@ -18,9 +18,11 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.environment.Request;
+import org.apache.commons.lang.StringUtils;
 
 import org.ametys.explorer.projects.repository.Project;
 import org.ametys.plugins.explorer.observation.ExplorerEvent.EventType;
@@ -44,7 +46,7 @@
     @Override
     public void notifyEvent (EventType eventType, Project project, User issuer, Map<String, Object> eventParams)
     {
-        if (eventType.equals(EventType.RESOURCE_CREATE) || eventType.equals(EventType.RESOURCE_DELETE))
+        if (eventType.equals(EventType.RESOURCES_CREATE) || eventType.equals(EventType.RESOURCE_CREATE) || eventType.equals(EventType.RESOURCE_DELETE))
         {
             // Subject
             String mailSubjecti18nKey = "PROJECT_MAIL_NOTIFICATION_SUBJECT_" + eventType.toString();
@@ -60,8 +62,16 @@
             
             // {4} document name
             mailBodyParams.add((String) eventParams.get("name")); 
-            // {5} document url
-            mailBodyParams.add(eventParams.get("id") != null ? _getDownloadURL((String) eventParams.get("id")) : ""); 
+
+            // {5} document/documents url
+            if (eventParams.get("resourcesIds") != null)
+            {
+                mailBodyParams.add(_getDownloadURL((Map<String, String>) eventParams.get("resourcesIds")));
+            }
+            else
+            {
+                mailBodyParams.add(eventParams.get("id") != null ? _getDownloadURL((String) eventParams.get("id")) : "");
+            }
             // {6} document path
             String rootPath = project.getExplorerRootNode().getPath();
             mailBodyParams.add(eventParams.get("path") != null ? _getPath (rootPath, (String) eventParams.get("path")) : ""); 
@@ -77,12 +87,25 @@
         }
     }
     
+    private String _getDownloadURL(Map<String, String> resourcesNamesById)
+    {
+        List<String> downloadUrls = new ArrayList<String> ();
+        
+        Set<String> resourcesIds = resourcesNamesById.keySet();
+        for (String resourceId : resourcesIds)
+        {
+            downloadUrls.add(_getDownloadURL(resourceId) + " (" + resourcesNamesById.get(resourceId) + ")");
+        }
+    
+        return StringUtils.join(downloadUrls, ", ");
+    }
+
     /**
      * Create the url to download a resource
      * @param id the JCR ID of the resource
      * @return an URL representing the resource
      */
-    protected String _getDownloadURL (String id)
+    private String _getDownloadURL (String id)
     {
         Request request = ContextHelper.getRequest(_context);
         
Index: main/plugin-projects/i18n/messages_en.xml
===================================================================
--- main/plugin-projects/i18n/messages_en.xml	(revision 31097)
+++ main/plugin-projects/i18n/messages_en.xml	(working copy)
@@ -57,6 +57,9 @@
 	<!-- +
 		 | MAIL NOTIFICATION
 		 + -->
+    <message key="PROJECT_MAIL_NOTIFICATION_SUBJECT_RESOURCES_CREATE">[Project space {0}] Directory added {1}</message>
+    <message key="PROJECT_MAIL_NOTIFICATION_BODY_RESOURCES_CREATE">This is an automated email.&#13;&#13;You are receiving this email because a new directory '{4}'has been added in the project space {0} by user {2} ({3}).&#13;The path of the new directory is : {6}.&#13;&#13;To download the files of the directory, click on the following links or copy/paste an url in your browser : {5}.&#13;&#13;To go to the project space, click on the following link or copy/paste the following url to your browser: {1}.</message>
+		 
 	<message key="PROJECT_MAIL_NOTIFICATION_SUBJECT_RESOURCE_CREATE">[Project space {0}] Document added {1}</message>
 	<message key="PROJECT_MAIL_NOTIFICATION_BODY_RESOURCE_CREATE">This is an automated email.&#13;&#13;You are receiving this email because a new document '{4}' has been added in the project space {0} by user {2} ({3}).&#13;The path of the new document is: {6}.&#13;&#13;To download the document click on the following link or copy/paste the url in your browser : {5}.&#13;&#13;To go to the project space, click on the following link or copy/paste the following url to your browser: {1}.</message>
 	
