Most of the Share UI functionality can be traced back to a web script in one place or another. Sometimes it is useful to be able to override the controller or template of one of these out-of-the-box web scripts. Same things goes for other out-of-the-box code for things like pages and dashlets.
The preferred way of modifying out-of-the-box code is by usingSurf Extension Modules
Architecture Information:Share Architecture
The preferred way of modifying out-of-the-boxSurf Web Scripts is by using Surf Extension Modules to target the Web Script that should be replaced:
<extension> <modules> <module> <id>Customize a Web Script</id> <version>1.0</version> <auto-deploy>true</auto-deploy> <customizations> <customization> <targetPackageRoot>The path to the out-of-the-box Web Script you are overriding, such as org.alfresco.components.dashlets</targetPackageRoot> <sourcePackageRoot>The path to your Web Script customizations, such as org.alfresco.tutorials.customization.webscript.controller</sourcePackageRoot> </customization> </customizations> </module> </modules></extension>The Web Script files in your package should have the same names as the original ones that you are overriding. The Extension Modules section has all the details.
Out-of-the-box Surf Web Scriptsused to be overridden by putting the modified files underalfresco/web-extension/site-webscripts/org/alfresco/... directory using the exact same path. This approach is no longer needed.
Most of the pages in the Share web application are implemented with the Surf UI framework. In many cases it is necessary to modify these pages.
The preferred way of modifyingSurf pages is by using Surf Extension Modules to target the component that should be replaced or hidden. It is also possible to add components to a page this way. The Extension Modules section has all the details.
The Share web application has a special page called Dashboard, which contains windows of content called dashlets. Currently most of these dashlets areSurf dashlets, and it is possible to modify the contents on them.
The preferred way of modifying Surf dashlets is by using Surf Extension Modules to target the component that should be replaced or hidden. It is also possible to add components to a dashlet this way. The Extension Modules section has all the details.
The Share web application pages and dashlets are built up of widgets. Sometimes it is necessary to modify these.
The preferred way of modifyingSurf widgets is by using Surf Extension Modules to target the component that has the widget that should be replaced or hidden. It is also possible to add widgets to a page this way. The Extension Modules section has all the details.
The Share web application has a number of Aikau pages. These can be modified.
The preferred way of modifyingAikau pages is by using Surf Extension Modules to target the Aikau widget that should be replaced or hidden. It is also possible to add widgets to a page this way. The Extension Modules section has all the details. Now, if we want to modify an existing page we need to grab hold of it in the Web Script controller, this will look like this:
var widget = widgetUtils.findObject(model.jsonModel.widgets, "id", "FCTSRCH_SEARCH_RESULTS_LIST");if (widget && widget.config && widget.config.widgets) { widget.config.widgets.push( {...This is all that is required to extend an existing JSON model. We’re usingwidgetUtils to find theFCTSRCH_SEARCH_RESULTS_LIST widget. Once we have it, we simply push widgets into it.
The Share web application has a special page called Dashboard, which contains windows of content called dashlets. Currently most of these dashlets are Spring Surf dashlets, but they will eventually be converted toAikau dashlets.
The preferred way of modifying Aikau dashlets is by using Surf Extension Modules to target the Aikau widget that should be replaced or hidden. It is also possible to add widgets to a dashlet this way. The Extension Modules section has all the details.
Every Aikau menu, page, and dashlet is built up of one or more widgets. Sometimes it is necessary to modify out of the box widgets.
The preferred way of modifyingAikau widgets is by using Surf Extension Modules to target the widget that should be replaced or hidden. It is also possible to add widgets this way. The Extension Modules section has all the details.
aio/share-jar/src/main/resources/alfresco/web-extension/site-data/extensions - Store extension modules hereaio/share-jar/src/main/resources/alfresco/web-extension/site-webscripts - Your Web Script overrides are stored here under a custom package path