Re: [share-extras-devel] issue with share extension module development in alfresco 4.2 community

Skip to first unread message

Will Abson

Jun 27, 2013, 11:06:46 AM6/27/13
Hi Mittal,

Firstly, I should point that this is not a general support forum for Share development, it is more specific to the Share Extras add-ons, so you may find that you get more help by posting on the Alfresco forums or on stackoverflow.

That said, your issue is that you are mixing up your web script JS with client-side JavaScript. Alfresco.util.Node is a client-side helper class and is therefore available to client-side JS running in the web browser, but not to your web script code which runs on the server.

If you are look at the source of alfresco-util.js, which you are including, you will see that there is a helper class there called AlfrescoUtil. I would suggest that you want to use the function AlfrescoUtil.getNodeDetails() from that class, but check the source to see which parameters are required. It seems to me you can pass in a nodeRef, plus an optional site name, plus some options if you wish.


On 27 June 2013 13:06, mittal patoliya <> wrote:
I have developed share-extension module to hide the "favorites" and "share" links which is displayed on the document detail page.My condition is when certain aspect is applied I want to hide those links.

For that I am trying to override the node-header.get.js file as that is the webscript responsible for rendering node-header
Now, I am not able to find out how to check certain aspect is applied on node or not.

Here is my code

<import resource="classpath:/alfresco/templates/org/alfresco/import/alfresco-util.js">
for (var i=0; i<model.widgets.length; i++)
if (model.widgets[i].id == "NodeHeader")
var jsNode = new Alfresco.util.Node(model.widgets[i].options.nodeRef);
model.widgets[i].options.showFavourite = false;
model.widgets[i].options.showLikes = false;


But I am getting error as follow

Error Message: 05270002 Failed to execute script 'classpath*:webscripts/custom/nodeheader/hidelikesync/node-header.get.js': 05270001 ReferenceError: "Alfresco" is not defined. (jar:file:/C:/Alfresco/Alfresco42/tomcat/webapps/share/WEB-INF/lib/customshare.jar!/webscripts/custom/nodeheader/hidelikesync/node-header.get.js#1555)

You received this message because you are subscribed to the Google Groups "Share Extras Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

mittal patoliya

Jun 29, 2013, 1:29:41 PM6/29/13
Ohh Yes,
Will Apologies, Actually It was intended for the Alfresco Technical Discussion group.
Its just bit of urgent so I had posted it here along with forums and,stackoverflow 

To unsubscribe from this group and stop receiving emails from it, send an email to
Reply all
Reply to author
0 new messages