cancel
Showing results for 
Search instead for 
Did you mean: 

Web script to get the value from client side js to server side js

srik
Champ in-the-making
Champ in-the-making
Hi Team,

I have a client side java script which returns value count so how do I send the count to server side java script so that I can update my custom aspect value based on some business logic .Should I use a web script to achieve that .Please provide me with the example as I am new to alfresco .

I am using 4.1 enterprise edition

Thanks&Regards
Srikanth S
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
you can certainly use webscript.
your webscript will be having javascript file as controller in which you can use your logic to generate that number and also assign that aspect to noderef by using services and root node apis provided by alfresco.

srik
Champ in-the-making
Champ in-the-making
Thanks for the quick reply .can you please provide me any working example.

Regards
Srikanth S

kaynezhang
World-Class Innovator
World-Class Innovator

If your  client application is share ,you can use the remote.call() function in the client's javaScript controller to make the call.
alfrescoServerWebscriptUrl is existing webscript url or your custom webscript url
   

         json = remote.call(alfrescoServerWebscriptUrl);
         if (json.status == 200)
         {
           
         }
   

If your  client application is not share you can just use ajax to sumit webscript url to alfresco server