mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
. Added support for "displayLabelId" attribute in Advanced Search meta-data config (as requested on the forums)
. Handling of missing content (reader.exists()) in TemplateNode . JavaDoc improvements to Template changes code from yestarday git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2008 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -478,7 +478,7 @@ public final class TemplateNode implements Serializable
|
|||||||
{
|
{
|
||||||
ContentService contentService = this.services.getContentService();
|
ContentService contentService = this.services.getContentService();
|
||||||
ContentReader reader = contentService.getReader(this.nodeRef, ContentModel.PROP_CONTENT);
|
ContentReader reader = contentService.getReader(this.nodeRef, ContentModel.PROP_CONTENT);
|
||||||
return reader != null ? reader.getContentString() : "";
|
return (reader != null && reader.exists()) ? reader.getContentString() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -568,19 +568,32 @@ public final class TemplateNode implements Serializable
|
|||||||
*/
|
*/
|
||||||
public class TemplateContentData implements Serializable
|
public class TemplateContentData implements Serializable
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param contentData The ContentData object this object wraps
|
||||||
|
* @param property The property the ContentData is attached too
|
||||||
|
*/
|
||||||
public TemplateContentData(ContentData contentData, QName property)
|
public TemplateContentData(ContentData contentData, QName property)
|
||||||
{
|
{
|
||||||
this.contentData = contentData;
|
this.contentData = contentData;
|
||||||
this.property = property;
|
this.property = property;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the content stream
|
||||||
|
*/
|
||||||
public String getContent()
|
public String getContent()
|
||||||
{
|
{
|
||||||
ContentService contentService = services.getContentService();
|
ContentService contentService = services.getContentService();
|
||||||
ContentReader reader = contentService.getReader(nodeRef, property);
|
ContentReader reader = contentService.getReader(nodeRef, property);
|
||||||
return reader != null ? reader.getContentString() : "";
|
|
||||||
|
return (reader != null && reader.exists()) ? reader.getContentString() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String getUrl()
|
public String getUrl()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -611,4 +624,4 @@ public final class TemplateNode implements Serializable
|
|||||||
private ContentData contentData;
|
private ContentData contentData;
|
||||||
private QName property;
|
private QName property;
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user