0
votes

i have some questions about MobileFirst Adapters:

  1. We are implementing javascript adapters on a MobileFirst 8 server. Where is the best place to write javascript utils functions?

  2. I also have some utils on java classes (called from javascript adapters) and i need to use the ConfigurationAPI class to get properties. The problem is that the configurationAPI variable (instantiated with the @Context annotation) is always null. Why? How can i get properties values from Java code?

  3. I have a lot of properties (for example low-level backend endpoints) that should be shared between all the adapters. At the moment i used the <property name="" displayName="" defaultValue="" /> syntax, should i copy and paste them in all adapters?! Or where should i put them?

Thank you

1
The configurationAPI context works in pure Java adapters, not in "java in javascript".Nathan H

1 Answers

0
votes

We are implementing javascript adapters on a MobileFirst 8 server. Where is the best place to write javascript utils functions?

JavaScript adapters allow for a single .js file, so your best place for any adapters JavaScript code is the same .js file...

I have a lot of properties (for example low-level backend endpoints) that should be shared between all the adapters. At the moment i used the <property name="" displayName="" defaultValue="" /> syntax, should i copy and paste them in all adapters?! Or where should i put them?

See my answer to the following question. Once you add custom properties you should be able to handle them in the same way I mention handling other values from the adapter.xml file: Unable to build adapters using profiles and properties in Maven

I also have some utils on java classes (called from javascript adapters) and i need to use the ConfigurationAPI class to get properties. The problem is that the configurationAPI variable (instantiated with the @Context annotation) is always null. Why? How can i get properties values from Java code?

I've sent a question internally and will let you know once I get an answer.