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 a3d3014467
commit a6cd614afa
4 changed files with 137 additions and 4 deletions

View File

@@ -400,10 +400,9 @@ public abstract class AbstractContentReader extends AbstractContentAccessor impl
}
// read it all, if possible
int count = reader.read(buffer, 0, length);
// there may have been fewer characters - create a new string
String result = new String(buffer, 0, count);
// done
return result;
// there may have been fewer characters - create a new string as the result
return (count != -1 ? new String(buffer, 0, count) : "");
}
catch (IOException e)
{

View File

@@ -65,6 +65,7 @@ public class MimetypeMap implements MimetypeService
public static final String MIMETYPE_IMAGE_JPEG = "image/jpeg";
public static final String MIMETYPE_IMAGE_RGB = "image/x-rgb";
public static final String MIMETYPE_IMAGE_SVG = "image/svg";
public static final String MIMETYPE_IMAGE_PNG = "image/png";
public static final String MIMETYPE_JAVASCRIPT = "application/x-javascript";
public static final String MIMETYPE_ZIP = "application/zip";
public static final String MIMETYPE_OPENSEARCH_DESCRIPTION = "application/opensearchdescription+xml";