How to check the API functions definition? | Community
Skip to main content
Level 3
February 10, 2022
Solved

How to check the API functions definition?

  • February 10, 2022
  • 3 replies
  • 3098 views

Hi there, 

 

We need to change some js script based on our business need. However, when I review the code, there are functions can be called directly and I can't find the definition of these functions, for example, setMaxProgress(). So I wonder where I can find the diefinition of thoes functions?

 

Thanks in advance!

XL

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ChristopheProtat

Hello, 

 

setMaxProgress() is a core method we expose to JS server engine and we use to manage progress bar (I.e. when your install a package for example)

 

It takes a integer as input and return nothing

It seems we use it in following OOTB campaign libs : 

  • /usr/local/neolane/nl6/datakit/xtk/eng/js/package.js:700: setMaxProgress(this.entities.length);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/messageCenter.js:1945: setMaxProgress(res.delivery.length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/messageCenter.js:1987: setMaxProgress(res.delivery.length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:6888: setMaxProgress(1)
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:7168: setMaxProgress(100);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:7609:setMaxProgress(objects[sSchemaName].length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:8355: setMaxProgress(100);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/wkfSurvey.js:250: setMaxProgress(10000)
  • /usr/local/neolane/nl6/datakit/nms/eng/js/wkfSurvey.js:343:setMaxProgress(surveyToProcess.webApp.length() * 2 + 1)
  • /usr/local/neolane/nl6/datakit/crm/eng/js/sfdcConnector.js:1290: setMaxProgress(nbEntity+1);
  • /usr/local/neolane/nl6/datakit/crm/eng/js/mscrmConnector.js:785:setMaxProgress(ndElement.remoteTable.length());
  • /usr/local/neolane/nl6/datakit/crm/eng/js/structureAndCleansing.js:1201: setMaxProgress(this.NB_WKF_ACTIVITIES)
  • /usr/local/neolane/nl6/datakit/crm/eng/js/common.js:633: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/datakit/crm/eng/js/common.js:706: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/deprecated/server/crm/oodConnector.js:1080: setMaxProgress(nbEntity);
  • /usr/local/neolane/nl6/deprecated/server/crm/oodConnector.js:1099: setMaxProgress(nbEntity + venumList.length);
  • /usr/local/neolane/nl6/deprecated/server/crm/sfdcConnector.js:1290: setMaxProgress(nbEntity+1);
  • /usr/local/neolane/nl6/deprecated/server/crm/mscrmConnector.js:1342: setMaxProgress(ndElement.remoteTable.length());
  • /usr/local/neolane/nl6/deprecated/server/crm/structureAndCleansing.js:1200: setMaxProgress(this.NB_WKF_ACTIVITIES)
  • /usr/local/neolane/nl6/deprecated/server/crm/common.js:634: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/deprecated/server/crm/common.js:707: setMaxProgress(xmlExtAccnt.enum.length())

CAUTION : Such methods are not publicly exposed and we can deprecate or remove them at any moment. This is the main reason why we do not document them. All publicly supported methods and function are documented in the public JS API here

 

Hope it will help

3 replies

DavidKangni
Community Advisor
Community Advisor
February 10, 2022

Hi XL,

 

You can find all ACC functions in the API documentation.

If not, it's probably a local function used in one of the OOTB JS libraries

David Kangni
xliuAuthor
Level 3
February 10, 2022

Thanks David,

 

Actually, I didn't find the definition of function

setMaxProgress()

from the document you sent. And from the url here, I can see the function. And I can't find it from our javascript libraries either.

 

Thanks again for your help

DavidKangni
Community Advisor
Community Advisor
February 11, 2022

it's a jssp function 

David Kangni
Krishnanunni
Level 4
February 11, 2022

Hi @xliu ,

The setMaxProgress() seems to be a custom function. Are you using any libraries in your code? If there are any loadLibrary() at the beginning of the code, you may check inside those js code whether there is a definition for the function you are looking for. 
If you are using this in an HTML, then check the scripts that are loaded in the HTML and see if you could find the definition.

xliuAuthor
Level 3
February 14, 2022

Hi Kris,

 

Thanks for your reply!

 

Actually there is no loadLibrary(), the function just can be called and works like this blog said. And I didn't find the defination of the function in ACC js and jssp libraries or files.

 

Thanks

ChristopheProtatAdobe EmployeeAccepted solution
Adobe Employee
February 25, 2022

Hello, 

 

setMaxProgress() is a core method we expose to JS server engine and we use to manage progress bar (I.e. when your install a package for example)

 

It takes a integer as input and return nothing

It seems we use it in following OOTB campaign libs : 

  • /usr/local/neolane/nl6/datakit/xtk/eng/js/package.js:700: setMaxProgress(this.entities.length);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/messageCenter.js:1945: setMaxProgress(res.delivery.length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/messageCenter.js:1987: setMaxProgress(res.delivery.length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:6888: setMaxProgress(1)
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:7168: setMaxProgress(100);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:7609:setMaxProgress(objects[sSchemaName].length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:8355: setMaxProgress(100);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/wkfSurvey.js:250: setMaxProgress(10000)
  • /usr/local/neolane/nl6/datakit/nms/eng/js/wkfSurvey.js:343:setMaxProgress(surveyToProcess.webApp.length() * 2 + 1)
  • /usr/local/neolane/nl6/datakit/crm/eng/js/sfdcConnector.js:1290: setMaxProgress(nbEntity+1);
  • /usr/local/neolane/nl6/datakit/crm/eng/js/mscrmConnector.js:785:setMaxProgress(ndElement.remoteTable.length());
  • /usr/local/neolane/nl6/datakit/crm/eng/js/structureAndCleansing.js:1201: setMaxProgress(this.NB_WKF_ACTIVITIES)
  • /usr/local/neolane/nl6/datakit/crm/eng/js/common.js:633: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/datakit/crm/eng/js/common.js:706: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/deprecated/server/crm/oodConnector.js:1080: setMaxProgress(nbEntity);
  • /usr/local/neolane/nl6/deprecated/server/crm/oodConnector.js:1099: setMaxProgress(nbEntity + venumList.length);
  • /usr/local/neolane/nl6/deprecated/server/crm/sfdcConnector.js:1290: setMaxProgress(nbEntity+1);
  • /usr/local/neolane/nl6/deprecated/server/crm/mscrmConnector.js:1342: setMaxProgress(ndElement.remoteTable.length());
  • /usr/local/neolane/nl6/deprecated/server/crm/structureAndCleansing.js:1200: setMaxProgress(this.NB_WKF_ACTIVITIES)
  • /usr/local/neolane/nl6/deprecated/server/crm/common.js:634: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/deprecated/server/crm/common.js:707: setMaxProgress(xmlExtAccnt.enum.length())

CAUTION : Such methods are not publicly exposed and we can deprecate or remove them at any moment. This is the main reason why we do not document them. All publicly supported methods and function are documented in the public JS API here

 

Hope it will help

xliuAuthor
Level 3
March 3, 2022

Hi Chris,

 

That makes sense now.

 

Thank you very much for your help! Very appreciated.

 

Xihao