2022

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Initialize the plugin by referencing the necessary files: 
    Code Block
    langjavascript
    <link rel="stylesheet" type="text/css" href="dbsyncwidget.min.css">
    
    <script src="$\{pageContext.request.contextPath\}/scripts/https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://av-web.s3.amazonaws.com/ecw/dbsyncwidget.min.js"></script>
    
  • Add div on the page: 
    Code Block
    langjavascript
    <div id="dbsyncwidget"></div>

  • Add javascript initialization in the script tag:
    appName - name of application to connect. 
    validationUrl - API Url to check if application is connected
    connectUrl - API Url to connector page 
    Code Block
    langjavascript
    
    <script>
    var dbsyncwidget = null;
    var dbsyncButton;
    
    var options = \{
    appName: 'Application Name',
    validationUrl: 'Validation API Urlhttps://<your-embedded-server/',
    connectUrl: 'Connection API Urlhttps://<your-embedded-server/'};
    
    $(document).ready(function () {
        dbsyncButton = $('#dbsyncwidget');
        dbsyncwidget = dbsyncButton.dbsyncwidget(options);
    }); 
    
    

4. (Optional: Customizing DBSync widget look & feel)

  •  
  •  

To change dbsyncwidget button we can override the next css classes:
dbsync-widget-logo - css class which describes styles of the button in case of validation is not successful
dbsync-widget-logo-connected - css class which describes styles of the button in case of validation is successful

...

<div id="dbsyncwidget"></div>

  1. Add script tag:
Code Block
langjavascript
<script>
var dbsyncwidget = null;
var dbsyncButton;


var paramsoptions = \{
	partner_key: '<%=System.getProperty("partnerKey")%>',
	partner_token: '<%=System.getProperty("partnerToken")%>',
	app_target: 'qbonline',
	username: 'TestComp001_User001',
	company: 'TestComp001',
	appId: 'qbonline',
	appName: 'QuickBooks<Display Online',
	context: '$\{pageContext.request.contextPath\}',
	validationUrl: 'verifyProfile'
};

var options = {
	appName: 'QuickBooks Desktop'Label of the Connecting App>',
	validationUrl: 'httphttps://localhost:8080/c2c/verifyProfile/TestComp001_User001<your_server>/ecw/verify/<appid>/<company>/<username>',
	connectUrl: 'httphttps://localhost:8080/c2c/qbdesktop/qbdesktop/TestComp001_User001/TestComp001<your_server>/ecw/connect/<appid>/<company>/<username>'
};

$(document).ready(function () {
	dbsyncButton = $('#dbsyncwidget');
	dbsyncwidget = dbsyncButton.dbsyncwidget(options);
});
</script> 

Configuring Look & Feel (Optional)

...