cancel
Showing results for 
Search instead for 
Did you mean: 

Extending an existing .post.json.js javascript controller

akusei
Champ in-the-making
Champ in-the-making
I'm trying to extend an existing .post.json.js javascript controller. I've done this successfully with share-header.get.js by using a module extension and now I want to add some additional "post" processing to the creation of a site. I've added a create-site.post.json.js file and the following module definition:

<module>   <id>Create Site Extension</id>   <version>1.0</version>   <customizations>      <customization>         <targetPackageRoot>org.alfresco.modules</targetPackageRoot>         <sourcePackageRoot>create-site</sourcePackageRoot>      </customization>   </customizations></module>‍‍‍‍‍‍‍‍‍‍‍‍


I've added the create-site.post.json.js to the directory /config/alfresco/site-webscripts/create-site inside my module's JAR file. The javascript in my create-site.post.json.js file doesn't seem to be running at all and yes, I've added it to the deployed modules list inside Alfresco.

I'm using Alfresco 5.0d. Does anyone know what I'm doing wrong? Is it even possible to add functionality to a post controller like you can a get controller?
1 ACCEPTED ANSWER

ddraper
World-Class Innovator
World-Class Innovator

I got asked to look into this thread and have done some debugging into it and it would seem that there is a bug in the way in which extension controller paths are looked up. Essentially what is happening is that Surf is looking for extension scripts with the name create-site.post.js and not create-site.post.json.js (note the missing .json).

The workaround to this problem is just to create your extension as create-site.post.js and that should then get processed.

View answer in original post

10 REPLIES 10

Wow, thanks!

It was a mystery for me.

Hyland Developer Evangelist