cancel
Showing results for 
Search instead for 
Did you mean: 

How To Override Share Client Side JS in SDK3.0

pedwards99
Star Contributor
Star Contributor

Hi there,

I'm trying to figure out how to override/replace client-side Javascript using SDK 3.

For example on the document-details.ftl page it uses:

<@script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/>

If I wanted to replace doclib-actions.js with my own script, where do I place it in the SDK 3.0 project and what would I replace  

src="${url.context}/res/modules/documentlibrary/doclib-actions.js"

with?

Thanks

Paul

1 ACCEPTED ANSWER

pedwards99
Star Contributor
Star Contributor

Ok, found the solution...

Place your custom client-side JS in the SDK project in the folder:

META-INF/resources/<your_module_name>/<whatever path you like>

(there is already an example in META-INF/resources/<module_name>/js/tutorials)

Then, in the FTL that you need to include your script the path will be something like:

<@script type="text/javascript" src="${url.context}/res/<your_module_name>/<whatever path you like>/my-doclib-actions.js" group="document-details"/>

View answer in original post

2 REPLIES 2

pedwards99
Star Contributor
Star Contributor

Ok, found the solution...

Place your custom client-side JS in the SDK project in the folder:

META-INF/resources/<your_module_name>/<whatever path you like>

(there is already an example in META-INF/resources/<module_name>/js/tutorials)

Then, in the FTL that you need to include your script the path will be something like:

<@script type="text/javascript" src="${url.context}/res/<your_module_name>/<whatever path you like>/my-doclib-actions.js" group="document-details"/>

have you found out how to actually override existing JS files? your solution is to make custom files and use them, but how can I override existing alfresco files (e.g. in {share.war}/components/...)?