mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
"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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user