What is the right way to edit an existing file in Aikau?

cancel
Showing results for 
Search instead for 
Did you mean: 
hackerkok
Active Member

What is the right way to edit an existing file in Aikau?

I want to edit the SearchBox.js file in Aikau (add a part of code in it), located in alfresco/header folder of the Aikau jar. I have created a share amp with the below:

  • src\main\amp\config\alfresco\web-extension\site-data\extensions\aikau-searchbox-extension.xml

<extension>
<modules>
<module>
<id>History search extension</id>
<version>1.0</version>
<auto-deploy>true</auto-deploy>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.share.header</targetPackageRoot>
<sourcePackageRoot>customSearchBox</sourcePackageRoot>
</customization>
</customizations>
<configurations>
<config evaluator="string-compare" condition="WebFramework" replace="false">
<web-framework>
<dojo-pages>
<packages>
<package name="customSearchBox" location="js/customSearchBox"/>
</packages>
</dojo-pages>
</web-framework>
</config>
</configurations>
</module>
</modules>
</extension>

  • src\main\amp\config\alfresco\web-extension\site-webscripts\customSearchBox\share-header.get.js

var searchbox = widgetUtils.findObject(model.jsonModel.widgets, "id", "HEADER_SEARCH");
if (searchbox != null) {
    // Change the widget to our custom menu...
    searchbox.name = "customSearchBox/SearchBox";


  • src\main\amp\web\js\customSearchBox

This folder contains all the files of the folder js\aikau\1.0.8.1\alfresco\header of the aikau.jar with the SearchBox.js having the required changes.

This solution works fine as it does what I want, but I don't think it is the correct one as I have to accompany the rest of the header files in my amp. Is there another way to do this aikau edit, so I don't have to copy and include the rest of the header files in my amp?

Thanks in advance!

1 Reply
douglascrp
Advanced II

Re: What is the right way to edit an existing file in Aikau?

Read the official Aikau tutorial here Aikau/About.md at master · Alfresco/Aikau · GitHub 

Also, I believe this discussion can help you Customizing the aikau search placeholder