08-01-2013 11:08 AM
08-15-2013 05:16 AM
<!–
Custom Metadata Templates for the Document Library Browse View
Use view="simple" or view="detailed" to limit the display to one particular view.
–>
<metadata-templates>
<!– Default (fallback) –>
<template id="default">
<line index="10" id="date">{date}{size}</line>
<line index="20" id="description" view="detailed">{description}</line>
<line index="30" id="tags" view="detailed">{tags}</line>
<line index="40" id="categories" view="detailed" evaluator="evaluator.doclib.metadata.hasCategories">{categories}</line>
<line index="50" id="social" view="detailed">{social}</line>
</template>
this.registerRenderer("date", function(record, label)
{
var jsNode = record.jsNode,
properties = jsNode.properties,
html = "";
var dateI18N = "modified", dateProperty = properties.modified.iso8601;
if (record.workingCopy && record.workingCopy.isWorkingCopy)
{
dateI18N = "editing-started";
}
else if (dateProperty === properties.created.iso8601)
{
dateI18N = "created";
}
html = '<span class="item">' + label + this.msg("details." + dateI18N + "-by", $relTime(dateProperty), Alfresco.DocumentList.generateUserLink(this, properties.modifier)) + '</span>';
return html;
});
$relTime(dateProperty)
$date(dateProperty)
(function()
{
/**
* Alfresco Slingshot aliases
*/
var $html = Alfresco.util.encodeHTML,
$date = function $date(date, format) { return Alfresco.util.formatDate(Alfresco.util.fromISO8601(date), format); };
if (Alfresco.DocumentList)
{
YAHOO.Bubbling.fire("registerRenderer",
{
propertyName: "customdate",
renderer: function description_renderer(record, label)
{
var jsNode = record.jsNode,
properties = jsNode.properties,
html = "";
var dateI18N = "modified", dateProperty = properties.modified.iso8601;
if (record.workingCopy && record.workingCopy.isWorkingCopy)
{
dateI18N = "editing-started";
}
else if (dateProperty === properties.created.iso8601)
{
dateI18N = "created";
}
html = '<span class="item">' + label + this.msg("details." + dateI18N + "-by", $date(dateProperty), Alfresco.DocumentList.generateUserLink(this, properties.modifier)) + '</span>';
return html;
}
});
}
})();
<config evaluator="string-compare" condition="DocLibCustom">
<dependencies>
<js src="/extension/components/documentlibrary/date-renderer.js" />
</dependencies>
</config>
<config evaluator="string-compare" condition="DocumentLibrary">
<metadata-templates>
<template id="default">
<line index="10" id="date">{customdate}{size}</line>
</template>
</metadata-templates>
</config>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.