Js code in APS doesn't work in alfresco development framework ADF

cancel
Showing results for 
Search instead for 
Did you mean: 
kmamine
Active Member

Js code in APS doesn't work in alfresco development framework ADF

I'm using Alfresco process services. In the form editor in the JavaScript section, I wrote a JS code that does an AJAX call on the form rendered event to retrieve some information and add them to the form, all this is working fine. However, when I developed a new interface using ADF these scripts doesn't work.
How can I fix this?

5 Replies
gdorsi4
Member II

Re: Js code in APS doesn't work in alfresco development framework ADF

Hello @kmamine ,

Have you wrapped your js (I suppose vanilla) code, into the Angular environment?

SWardle
Partner

Re: Js code in APS doesn't work in alfresco development framework ADF

I've wanted to the same thing a while ago with the ADW instead of an ADF app and as far as I am concerned there is no way to execute the APS JS code from the ADW/ADF app because of different major versions of angular. Since APS uses angular 1.x and ADW/ADF uses angular2+. At least that is what I've been told. 

What you can do is let your ADF app execute the JS code and access APS variables/elements to manipulate them. You could add custom stencils in APS and the corresponding code in the ADF app.

kmamine
Active Member

Re: Js code in APS doesn't work in alfresco development framework ADF

I could get the JS script, but the problem is that I have to convert it to typescripts before execute it in angular. I was looking for a cleaner way, but it seems there is none.

kmamine
Active Member

Re: Js code in APS doesn't work in alfresco development framework ADF

I could access the APS code, but to execute it, it has to be compatible with typescript. 

rockjonn
Member II

Re: Js code in APS doesn't work in alfresco development framework ADF


@kmamine wrote:

I could access the APS code, but to execute it, it has to be compatible with typescript. 


  1. Ensure the necessary setup: Make sure you have the ADF development environment properly set up and configured on your system.

  2. Locate the correct location: Identify the appropriate location within the ADF project structure where you want to add or modify the JS code.

  3. Use ADF conventions: Ensure that your JS code adheres to the conventions and standards of the ADF framework. This includes following best practices for file organization, naming conventions, and coding patterns.

  4. Incorporate code in components: Integrate your JS code within the relevant ADF components, such as custom widgets, services, or controllers, depending on the specific functionality you want to implement.

  5. Leverage ADF APIs: Utilize the available ADF APIs and libraries to access Alfresco's functionalities and services within your JS code. This ensures seamless integration with the Alfresco content management system.

  6. Test and debug: Thoroughly test and debug your code within the ADF environment to ensure its proper functioning and identify any potential issues or errors.