01-08-2014 01:10 PM
01-09-2014 02:58 AM
01-09-2014 04:33 AM
<extension>
<modules>
<module>
<id>Custom DocumentList Widget</id>
<description>Instantiate a custom DocumentList widget</description>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.components.documentlibrary
</targetPackageRoot>
<sourcePackageRoot>blog.demo.customization</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
// Declare namespace…
if (typeof Blog == undefined || !Blog) {
var Blog = {};
}
if (!Blog.custom) {
Blog.custom = {};
}
(function() {
// Define constructor…
Blog.custom.DocumentList = function CustomDocumentList_constructor(htmlId) {
Blog.custom.DocumentList.superclass.constructor.call(this, htmlId);
return this;
};
// Extend default DocumentList…
YAHOO.extend(Blog.custom.DocumentList, Alfresco.DocumentList, {
onFilterChanged : function CustomDL_onFilterChanged(layer, args) {
// Call super class method…
Blog.custom.DocumentList.superclass.onFilterChanged.call(this,
layer, args);
// Pop-up a message…
Alfresco.util.PopupManager.displayMessage({
text : "Filter Changed!"
});
}
});
})();
<@markup id="custom-documentlist-dependencies" target="js" action="after" scope="global">
<@script src="${url.context}/res/doclib/extension/custom-documentlist.js" group="documentlibrary"/>
</@markup>
// Find the default DocumentList widget and replace it with the custom widget
for (var i = 0; i < model.widgets.length; i++) {
if (model.widgets.id == "DocumentList") {
model.widgets.name = "Blog.custom.DocumentList";
}
}
01-09-2014 05:40 AM
01-09-2014 07:00 AM
<extension>
<modules>
<module>
<id>Custom DocumentList Widget</id>
<description>Instantiate a custom DocumentList widget</description>
<auto-deploy>true</auto-deploy>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.components.documentlibrary</targetPackageRoot>
<sourcePackageRoot>com.XXX.training.components.documentlibrary.customization</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
<@markup id="custom-documentlist-dependencies" target="js" action="after" scope="global">
<@script type="text/javascript" src="${url.context}/res/components/documentlibrary/extensions/custom-documentlist.js" group="documentlibrary"/>
</@markup>
// Find the default DocumentList widget and replace it with the custom widget
for (var i=0; i<model.widgets.length; i++) {
if (model.widgets.id == "DocumentList") {
model.widgets.name = "Training.custom.DocumentList";
}
}
// Declare Training namespace…
if (typeof Training == undefined || !Training) {
var Training = {};
}
if (!Training.custom) {
Training.custom = {};
}
(function() {
// Define constructor…
Training.custom.DocumentList = function CustomDocumentList_constructor(htmlId) {
Training.custom.DocumentList.superclass.constructor.call(this, htmlId);
return this;
};
// Extend default DocumentList…
YAHOO.extend(Training.custom.DocumentList, Alfresco.DocumentList,
{
onFilterChanged: function CustomDL_onFilterChanged(layer, args)
{
// Call super class method…
Training.custom.DocumentList.superclass.onFilterChanged.call(this, layer,args);
// Pop-up a message…
Alfresco.util.PopupManager.displayMessage({
text: "Filter Changed!"
});
}
});
})();
01-09-2014 07:53 AM
02-19-2016 12:56 AM
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.