0

I'm really new to alfresco development. I have a java backed web-script which use to access global properties and get some values in json format. I need to access these values in share java-script web-script since I need to do few validations in share and do share customization. problem is I couldn't find a way to access java backed web-script output from java-script web-script.

I can use javasctipt and using alfresco ajax request, take java backed webscript response but how can I access javascript from javascript webscript in share?

Thank a lot !

MSU_Bulldog
  • 3,501
  • 5
  • 37
  • 73
paul
  • 37
  • 4
  • What not put the common logic into a Java class, inject that into your java backed webscript, and make it available to the javascript one? – Gagravarr Nov 20 '15 at 12:56

1 Answers1

1

You can use Alfresco.util.Ajax helper:

Alfresco.util.Ajax.request({
  url: Alfresco.constants.PROXY_URI + {
    YOUR_ALF_WEBSCRIPT_URL
  },
  method: Alfresco.util.Ajax.GET // OR Alfresco.util.Ajax.POST,
  dataObj: {

  },
  successCallback: {
    fn: this.success, // Success method call
    scope: this
  },
  failureCallback: {
    fn: this.failure, // Failure method call
    scope: this
  }
});