Layer7 API Management

 View Only
  • 1.  LAC 5.4 Salesforce JS Code

    Posted Sep 22, 2020 06:46 AM
    Hi All,

    I am looking for sample Javascript to connect to Salesforce (as Managed Data Source Provider) as cdata driver is not supported with LAC 5.4
    Please advise.

    Thanks,
    Ankush


  • 2.  RE: LAC 5.4 Salesforce JS Code
    Best Answer

    Broadcom Employee
    Posted Sep 23, 2020 09:53 AM
    Ankush;
    While LAC 5.4 no longer supports CData drivers directly, there is a framework named Data Source Provider (DSP).  You can make a copy of the CDataCSV DSP found here.
    Copy this folder (and rename it to CDataSalesforce) to your %REPOSITORY_ROOT%/system/data_source_providers.  You will need to bring your own CData Salesforce JDBC driver (https://www.cdata.com/drivers/salesforce/jdbc/) and copy it to the appropriate class path. The DSP is a collection of JavaScript functions used to connect and perform CRUD operations. You will need to modify each for the specific operation (e.g. test_connection.js or open_code.js).  The key is to change the config_info_code.js which contains driver specific settings for the CData CSV driver.   Most of the JavaScript should work with little or no change.  Once you have modified the DSP code, start the server then create an empty API project and go to Data Sources and add this new DSP and connect. For more information - see the doc page here.


    ------------------------------
    Principal Engineer
    Broadcom
    ------------------------------



  • 3.  RE: LAC 5.4 Salesforce JS Code

    Broadcom Employee
    Posted Sep 24, 2020 10:59 AM
    I have pushed a new DSP (Data Source Provider) framework for CData Salesforce driver - You will still need to test and debug the code and install the CData Salesforce JDBC Jar - but this should get you started. https://github.com/EspressoLogicCafe/Examples/tree/master/DatasourceProvider/CDataSalesforce



    ------------------------------
    Principal Engineer
    Broadcom
    ------------------------------