"encoding" and "displayMimetype" getters added to templating Content API

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7264 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-10-31 15:10:11 +00:00
parent 05ff7ffa90
commit 3e65d317a7
3 changed files with 41 additions and 9 deletions

View File

@@ -418,6 +418,26 @@ public abstract class BaseContentNode implements TemplateContent
return (content != null ? content.getMimetype() : null);
}
/**
* @return The display label of the mimetype encoding for content attached to the node from the default
* content property (@see ContentModel.PROP_CONTENT)
*/
public String getDisplayMimetype()
{
TemplateContentData content = (TemplateContentData)this.getProperties().get(ContentModel.PROP_CONTENT);
return (content != null ? content.getDisplayMimetype() : null);
}
/**
* @return The character encoding for content attached to the node from the default content property
* (@see ContentModel.PROP_CONTENT)
*/
public String getEncoding()
{
TemplateContentData content = (TemplateContentData)this.getProperties().get(ContentModel.PROP_CONTENT);
return (content != null ? content.getEncoding() : null);
}
/**
* @return The size in bytes of the content attached to the node from the default content property
* (@see ContentModel.PROP_CONTENT)
@@ -562,6 +582,16 @@ public abstract class BaseContentNode implements TemplateContent
return contentData.getMimetype();
}
public String getDisplayMimetype()
{
return services.getMimetypeService().getDisplaysByMimetype().get(getMimetype());
}
public String getEncoding()
{
return contentData.getEncoding();
}
private ContentData contentData;
private QName property;
}