Portlet webscript updates:

MySpaces portlet changed to use ajax update to main list div.
Upload file now refreshes list after upload complete.
Manual refresh icon added to MySpaces and MyDocs portlets.
Removed video preview from pop-up panel in portlets (unstable in Firefox).
Manic scrollbar flicking fixed in MyDocs and MySpaces portlets.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5736 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-05-21 17:46:52 +00:00
parent 6419aef81e
commit ed5b547943
10 changed files with 186 additions and 96 deletions

View File

@@ -26,6 +26,7 @@ package org.alfresco.web.bean.ajax;
import java.io.IOException;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
@@ -60,7 +61,8 @@ public class NodeInfoBean
/**
* Returns information on the node identified by the 'noderef'
* parameter found in the ExternalContext.
* parameter found in the ExternalContext. If no noderef is supplied, then the template
* is executed without context.
* <p>
* The result is the formatted HTML to show on the client.
*/
@@ -69,28 +71,26 @@ public class NodeInfoBean
FacesContext context = FacesContext.getCurrentInstance();
ResponseWriter out = context.getResponseWriter();
String strNodeRef = (String)context.getExternalContext().getRequestParameterMap().get("noderef");
if (strNodeRef == null || strNodeRef.length() == 0)
{
throw new IllegalArgumentException("'noderef' parameter is missing");
}
String strTemplate = (String)context.getExternalContext().getRequestParameterMap().get("template");
Map<String, String> requestMap = context.getExternalContext().getRequestParameterMap();
String strNodeRef = (String)requestMap.get("noderef");
String strTemplate = (String)requestMap.get("template");
if (strTemplate == null || strTemplate.length() == 0)
{
strTemplate = "node_summary_panel.ftl";
}
NodeRef nodeRef = new NodeRef(strNodeRef);
if (this.nodeService.exists(nodeRef))
NodeRef nodeRef = null;
if (strNodeRef != null && strNodeRef.length() != 0)
{
Repository.getServiceRegistry(context).getTemplateService().processTemplate(
"/alfresco/templates/client/" + strTemplate, getModel(nodeRef), out);
}
else
{
out.write("<span class='errorMessage'>Node could not be found in the repository!</span>");
nodeRef = new NodeRef(strNodeRef);
if (this.nodeService.exists(nodeRef) == false)
{
out.write("<span class='errorMessage'>Node could not be found in the repository!</span>");
return;
}
}
Repository.getServiceRegistry(context).getTemplateService().processTemplate(
"/alfresco/templates/client/" + strTemplate, getModel(nodeRef, requestMap), out);
}
@@ -109,7 +109,7 @@ public class NodeInfoBean
// ------------------------------------------------------------------------------
// Helper methods
private Map<String, Object> getModel(NodeRef nodeRef)
private Map<String, Object> getModel(NodeRef nodeRef, Map<String, String> requestMap)
{
FacesContext context = FacesContext.getCurrentInstance();
Map<String, Object> model = new HashMap<String, Object>(8, 1.0f);
@@ -119,10 +119,21 @@ public class NodeInfoBean
model.put("cropContent", new CropContentMethod());
model.put("url", new BaseTemplateContentServlet.URLHelper(
context.getExternalContext().getRequestContextPath()));
model.put("node", new TemplateNode(
nodeRef,
Repository.getServiceRegistry(context),
this.imageResolver));
if (nodeRef != null)
{
model.put("node", new TemplateNode(
nodeRef,
Repository.getServiceRegistry(context),
this.imageResolver));
}
// add URL arguments as a map called 'args' to the root of the model
Map<String, String> args = new HashMap<String, String>(4, 1.0f);
for (String name : requestMap.keySet())
{
args.put(name, requestMap.get(name));
}
model.put("args", args);
return model;
}