mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
CMIS bag of stuff;:
- Add CMIS Allowable Actions to Abdera CMIS extension - Add testAllowableActions(), testQueryAllowableActions - Pass all AppClientTest (AtomPub server test suite) tests - Fix encoding issues while parsing Atom requests - Fix ignoring of Atom slug - Fix support of pure Atom entries (those without CMIS extensions) - Add test suite for custom sub-types / props (CMISCustomTypeTest) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13921 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,7 +24,10 @@
|
||||
*/
|
||||
package org.alfresco.repo.jscript;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -2704,18 +2707,43 @@ public class ScriptNode implements Serializable, Scopeable, NamespacePrefixResol
|
||||
{
|
||||
ContentService contentService = services.getContentService();
|
||||
ContentReader reader = contentService.getReader(nodeRef, property);
|
||||
|
||||
return (reader != null && reader.exists()) ? reader.getContentString() : "";
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.util.Content#getInputStream()
|
||||
*/
|
||||
public InputStream getInputStream()
|
||||
{
|
||||
ContentService contentService = services.getContentService();
|
||||
ContentReader reader = contentService.getReader(nodeRef, property);
|
||||
|
||||
return (reader != null && reader.exists()) ? reader.getContentInputStream() : null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.util.Content#getReader()
|
||||
*/
|
||||
public Reader getReader()
|
||||
{
|
||||
ContentService contentService = services.getContentService();
|
||||
ContentReader reader = contentService.getReader(nodeRef, property);
|
||||
|
||||
if (reader != null && reader.exists())
|
||||
{
|
||||
try
|
||||
{
|
||||
return (contentData.getEncoding() == null) ? new InputStreamReader(reader.getContentInputStream()) : new InputStreamReader(reader.getContentInputStream(), contentData.getEncoding());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// NOTE: fall-through
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the content stream
|
||||
*
|
||||
|
Reference in New Issue
Block a user