As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<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"; } }
<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!" }); } }); })();