<#if d.isDocument>
-

+

<#else>
-

+

#if>
@@ -46,4 +46,4 @@
#if>
#list>
<#-- hidden div with the count value for the page -->
-
${count}
+
${count}
\ No newline at end of file
diff --git a/source/java/org/alfresco/web/bean/ajax/FileUploadBean.java b/source/java/org/alfresco/web/bean/ajax/FileUploadBean.java
index 3bbab72b6a..bd224f866b 100644
--- a/source/java/org/alfresco/web/bean/ajax/FileUploadBean.java
+++ b/source/java/org/alfresco/web/bean/ajax/FileUploadBean.java
@@ -197,7 +197,6 @@ public class FileUploadBean
ResponseWriter out = fc.getResponseWriter();
XMLUtil.print(result, out);
- out.close();
}
static NodeRef pathToNodeRef(FacesContext fc, String path)
diff --git a/source/java/org/alfresco/web/bean/ajax/MySpacesBean.java b/source/java/org/alfresco/web/bean/ajax/MySpacesBean.java
index c869bfd951..e7b63618a3 100644
--- a/source/java/org/alfresco/web/bean/ajax/MySpacesBean.java
+++ b/source/java/org/alfresco/web/bean/ajax/MySpacesBean.java
@@ -105,6 +105,27 @@ public class MySpacesBean
{
out.write("ERROR: " + err.getMessage());
}
- out.close();
+ }
+
+ @InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_HTML)
+ public void deleteItem() throws Exception
+ {
+ FacesContext fc = FacesContext.getCurrentInstance();
+ ResponseWriter out = fc.getResponseWriter();
+
+ Map
requestMap = fc.getExternalContext().getRequestParameterMap();
+ String strNodeRef = (String)requestMap.get("noderef");
+ if (strNodeRef != null && strNodeRef.length() != 0)
+ {
+ try
+ {
+ Repository.getServiceRegistry(fc).getFileFolderService().delete(new NodeRef(strNodeRef));
+ out.write("OK: " + strNodeRef);
+ }
+ catch (Throwable err)
+ {
+ out.write("ERROR: " + err.getMessage());
+ }
+ }
}
}
diff --git a/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java b/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java
index 5fdc926fa7..3c466f3787 100644
--- a/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java
+++ b/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java
@@ -180,7 +180,6 @@ public class FilePickerBean
final ResponseWriter out = facesContext.getResponseWriter();
XMLUtil.print(result, out);
- out.close();
}
@InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_HTML)
@@ -272,7 +271,6 @@ public class FilePickerBean
final ResponseWriter out = facesContext.getResponseWriter();
XMLUtil.print(result, out);
- out.close();
}
private String getCurrentAVMPath()
diff --git a/source/web/scripts/ajax/myspaces.js b/source/web/scripts/ajax/myspaces.js
index 6dea590b49..d50743f6dc 100644
--- a/source/web/scripts/ajax/myspaces.js
+++ b/source/web/scripts/ajax/myspaces.js
@@ -227,7 +227,7 @@ var MySpaces = {
{
if (!resource.isLoaded)
{
- // fire off the ajax request to get the resources for this task
+ // fire off the ajax request to get the preview panel content and actions
YAHOO.util.Connect.asyncRequest(
"POST",
getContextPath() + '/ajax/invoke/NodeInfoBean.sendNodeInfo',
@@ -513,18 +513,6 @@ var MySpaces = {
}
},
- /**
- * Cancel button click handler for various pop-up panels
- */
- closePopupPanel: function()
- {
- if (this.popupPanel != null)
- {
- this.popupPanel.setStyle("display", "none");
- this.popupPanel = null;
- }
- },
-
/**
* Display the Upload File pop-up panel
*/
@@ -590,6 +578,51 @@ var MySpaces = {
}
},
+ /**
+ * Delete a space/document item
+ */
+ deleteItem: function(name, noderef)
+ {
+ if (confirm("Are you sure you want to delete: " + name))
+ {
+ // ajax call to create space
+ YAHOO.util.Connect.asyncRequest(
+ "POST",
+ getContextPath() + '/ajax/invoke/MySpacesBean.deleteItem',
+ {
+ success: function(response)
+ {
+ if (response.responseText.indexOf("OK:") == 0)
+ {
+ MySpaces.refreshList();
+ }
+ else
+ {
+ alert("Error during delete of item: " + response.responseText);
+ }
+ },
+ failure: function(response)
+ {
+ alert("Error during delete of item: " + response.responseText);
+ }
+ },
+ "noderef=" + noderef
+ );
+ }
+ },
+
+ /**
+ * Cancel button click handler for various pop-up panels
+ */
+ closePopupPanel: function()
+ {
+ if (this.popupPanel != null)
+ {
+ this.popupPanel.setStyle("display", "none");
+ this.popupPanel = null;
+ }
+ },
+
/**
* Refresh the main data list contents within the spacePanel container
*/