Merged from BRANCHES/DEV/KEVINR:

. NodeInfo panel and Ajax client library
 - Rewrite of Node Info panel
 - Alfresco common DOM methods refactored into namespaced object (YUI/Dojo style) Alfresco.Dom
 - Addition of useful DOM and 'smart' alignment method to common.js
 - OpenSearch now uses additional namespace for it's global method handlers: Alfresco.OpenSearchEngine
 - Temporary icons added for pop-up node info panel
. Additional FreeMarker model API method "cropContent(contentprop, length)" to return the first N bytes of a content stream - auto converted to plain/text from all supported transformation mimetypes
. DownloadContentServlet now handles ContentIOException more gracefully
. AbstractContentReader fixed to handle empty file data when requesting N characters from a content stream

. Yahoo scripts move to PageTag rendering as appropriate
. Refactoring of existing ajax components that output Yahoo scripts

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5253 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-03-01 17:24:08 +00:00
parent 2c1fe352a3
commit a4aa830af2
13 changed files with 509 additions and 413 deletions

View File

@@ -69,10 +69,9 @@ public class UINodeInfo extends SelfRenderingComponent
@Override
public Object saveState(FacesContext context)
{
Object values[] = new Object[8];
// standard component attributes are saved by the super class
values[0] = super.saveState(context);
values[1] = this.value;
Object values[] = new Object[] {
super.saveState(context),
this.value};
return values;
}
@@ -87,19 +86,15 @@ public class UINodeInfo extends SelfRenderingComponent
{
ResponseWriter out = context.getResponseWriter();
// output the scripts required by the component (checks are
// made to make sure the scripts are only written once)
Utils.writeDojoScripts(context, out);
// write out the JavaScript specific to the NodeInfo component,
// again, make sure it's only done once
// make sure it's only done once
Object present = context.getExternalContext().getRequestMap().
get(NODE_INFO_SCRIPTS_WRITTEN);
if (present == null)
{
out.write("<script type=\"text/javascript\" src=\"");
out.write(context.getExternalContext().getRequestContextPath());
out.write("/scripts/ajax/node-info.js\"> </script>\n");
out.write("/scripts/ajax/node-info.js\"></script>");
context.getExternalContext().getRequestMap().put(
NODE_INFO_SCRIPTS_WRITTEN, Boolean.TRUE);
@@ -107,12 +102,11 @@ public class UINodeInfo extends SelfRenderingComponent
// wrap the child components in a <span> that has the onmouseover
// event which kicks off the request for node information
String id = (String)this.getValue();
out.write("<span onmouseover=\"showNodeInfo('");
out.write(Repository.getStoreRef().toString());
out.write("/");
out.write(id);
out.write("', this)\" onmouseout=\"hideNodeInfo()\">");
// we key the node info panel by the noderef string of the current node
String noderef = Repository.getStoreRef().toString() + '/' + (String)this.getValue();
out.write("<span onclick=\"AlfNodeInfoMgr.toggle('");
out.write(noderef);
out.write("',this);\">");
}
}

View File

@@ -81,21 +81,17 @@ public class UIOpenSearch extends SelfRenderingComponent
String clientId = this.getId();
// output the scripts required by the component (checks are
// made to make sure the scripts are only written once)
Utils.writeYahooScripts(context, out, null);
// write out the JavaScript specific to the OpenSearch component,
// again, make sure it's only done once
// make sure it's only done once
Object present = context.getExternalContext().getRequestMap().get(SCRIPTS_WRITTEN);
if (present == null)
{
out.write("<link rel=\"stylesheet\" href=\"");
out.write(context.getExternalContext().getRequestContextPath());
out.write("/css/opensearch.css\" type=\"text/css\">\n");
out.write("/css/opensearch.css\" type=\"text/css\">");
out.write("<script type=\"text/javascript\" src=\"");
out.write(context.getExternalContext().getRequestContextPath());
out.write("/scripts/ajax/opensearch.js\"> </script>\n");
out.write("/scripts/ajax/opensearch.js\"></script>");
context.getExternalContext().getRequestMap().put(SCRIPTS_WRITTEN, Boolean.TRUE);
}