Difference between pages "DocuSign Integration" and "Moving database from live to test"

From TempusServa wiki
(Difference between pages)
Jump to navigation Jump to search
old>Tvi
 
old>Admin
 
Line 1: Line 1:
== Prereq ==
== Option: Database creation ==
I can there is no database allready please perform the following steps (assuming no db is sandbox)


To setup the integration an account with one of the following criteria is needed.<br/>
  mysql -uUSERNAME -pPASSWORD
Either it should be a DocuSign-partner or subscribed to the "Advanced developer plan".


The integration will be created in demo mode and has to be approved, before it can be moved to production.<br/>
  CREATE DATABASE IF NOT EXISTS sandboxbase;
The criteria for that is: the last 20 uploads have to be successful and performed within the last 30 days.<br/>
  CREATE DATABASE IF NOT EXISTS sandboxtest;
After that, an account with the proper access has to sign in and the integration will be transferred to their account.
  CREATE DATABASE IF NOT EXISTS sandboxlive;
  CREATE USER 'sandboxroot'@'localhost' IDENTIFIED BY 'TempusServaFTW!';
  GRANT ALL PRIVILEGES ON sandboxlive.* TO 'sandboxroot'@'localhost';
  GRANT ALL PRIVILEGES ON sandboxtest.* TO 'sandboxroot'@'localhost';
  GRANT ALL PRIVILEGES ON sandboxbase.* TO 'sandboxroot'@'localhost';


== Setup in DocuSign ==


First: Sign in with an admin account and create a new "Integration" under "Settings" -> "Integrations" -> "Apps and Keys". Give it a descriptive name, it will be shown to all who upload documents via the integration.
== Database transfer ==
Choose ONE of the options below that best suits your requirements.


Second: Add a "Secret Key", save it, it is needed for ''docuSignSecretKey''.
=== Database transfer: Different MySQL server / Same schema name ===
Export data from LIVE server


Third: Under "Redirect URIs" add one using the following formular:<br/>
  mysqldump -uUSERNAME -pPASSWORD --databases tsbase tslive tstest > dump.sql
https://[TS-domain]/[TS-app-name]/[docuSignAuthCallbackUrl]<br/>
Sample: https://omega.tempusserva.dk/TempusServa/main?command=dk.tempusserva.signing.docusign.PageLoginCallback


== Setup in TS ==
Import data to TEST server


There are 11 parameters available, 7 of them have to be set for the integration to work.
  mysql -uUSERNAME -pPASSWORD --force < dump.sql


* docuSignActive*
=== Database transfer: Same MySQL server / Different schema name ===
* docuSignLog
* docuSignApiHost*
* docuSignAuthHost*
* docuSignHost*
* docuSignAccountId*
* docuSignIntegrationKey*
* docuSignSecretKey*
* docuSignAuthCallbackUrl
* docuSignEventCallbackUrl
* docuSignBrandId


=== docuSignActive ===
Export data from LIVE server


To enable the DocuSign functionality, this has to be set to "true".
  mysqldump -uUSERNAME -pPASSWORD tsbase > dumpBase.sql
  mysqldump -uUSERNAME -pPASSWORD tslive > dumpLive.sql
  mysqldump -uUSERNAME -pPASSWORD tstest > dumpTest.sql


=== docuSignLog ===
Import data to TEST server (assuming name is 'sandbox')


This is for debugging and should '''not''' be enabled in production.<br/>
  mysql -uUSERNAME -pPASSWORD sandboxbase < dumpBase.sql
It enables debuggin-logs on all uploads, both in TS and in DocuSign, thus breaking confidentiality, because all parameters will be saved to a log somewhere.
  mysql -uUSERNAME -pPASSWORD sandboxlive < dumpLive.sql
  mysql -uUSERNAME -pPASSWORD sandboxtest < dumpTest.sql


=== docuSignApiHost ===
== Configuration changes ==
Important information:
The following script will updata the database '''tslive''', for the sandbox copy example please '''USE sandboxlive;'''.


This parameter is account-dependant.<br/>
Run the following commands '''before''' you start the server
It can be found on the "Apps and Keys" page in DocuSign, labeled "Account Base URI".


=== docuSignAuthHost ===
  mysql -uUSERNAME -pPASSWORD


This parameter should always be "https://account-d.docusign.com/oauth/" when testing the integration and "https://account.docusign.com/oauth/", when the integration is in production.
  USE tslive;
  UPDATE systempolicy SET PolicyValue = 'false' WHERE PolicyName='serviceAutostart';
  UPDATE systempolicy SET PolicyValue = 'true' WHERE PolicyName='smtpTestMode';
  UPDATE systempolicy SET PolicyValue = 'localhost' WHERE PolicyName='smtpServer';
  UPDATE systempolicy SET PolicyValue = 'localhost' WHERE PolicyName='applicationServer';
  UPDATE systempolicy SET PolicyValue = 'http://localhost' WHERE PolicyName='applicationURL';
  UPDATE systempolicy SET PolicyValue = '' WHERE PolicyName LIKE 'folder%';
  UPDATE systempolicy SET PolicyValue = 'C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps' WHERE PolicyName='applicationBasePath';


=== docuSignHost ===
Note:
The following changes can be replaced by setting the values in the application deployment descriptor, starting from version 2500


This parameter is account-dependant.<br/>
== Rebuild views ==
This parameter is used to redirect the user, after a successful upload.<br/>
Ensure that views exist by rebuilding them
It's value should be "https://appdemo.docusign.com" during testing.<br/>
The production value is found by signing in with an account, that will be using the integration, and then copying the url from the browser. Remember to only copy from beginning to end of ''docusign.com'', don't include the trailing /.


=== docuSignAccountId ===
  Designer > Modules > Admin services > RebuildViews


This attribute is account-dependant.<br/>
It can be found on the "Apps and Keys" page in DocuSign, labeled "API Account ID".


=== docuSignIntegrationKey ===
== Troubleshooting ==


This parameter is integration-dependant.<br/>
=== Server not started ===
It can be found on the "Apps and Keys" page in DocuSign, or when viewing the details about the integration.
* Check application server log files for information
* Tomcat
** Check xml descriptor is found in [TOMCAT]/conf/Catalina/localhost
** Check war file is unpacked correctly in [TOMCAT]/webapps


=== docuSignSecretKey ===
=== Cannot select fieldtype when adding or editing fields ===
# Run the following SQL command


This parameter is integration-dependant.<br/>
  USE tsbase;
It can be found when viewing the details about the integration, in DocuSign.<br/>
  DROP VIEW IF EXISTS viewdatatypeselector;
You will only have access to the entire key when creating it, but you can just add a new one if the key is lost. Remember to delete the old one.
  CREATE VIEW viewdatatypeselector AS
    SELECT
      systemdatatype.FeltTypeID AS `FeltTypeID`,
      concat(systemdatatypepackage.TypePrefix,': ',systemdatatype.FeltType) AS `FeltType`
    FROM systemdatatype
    JOIN systemdatatypepackage
      ON systemdatatype.PackageID = systemdatatypepackage.PackageID
    WHERE systemdatatype.IsSelectable = 1)
    ORDER BY systemdatatypepackage.SortOrder, systemdatatype.FeltType;


=== docuSignAuthCallbackUrl ===
# Repeat the "Rebuild views above"
 
Should always be "main?command=dk.tempusserva.signing.docusign.PageLoginCallback".
 
=== docuSignEventCallbackUrl ===
 
Should always be "docusign-event-callback".
 
=== docuSignBrandId ===
 
This parameter is optional.<br/>
In DocuSign it is possible to create "Brands" ("Settings" -> "Account" -> "Brands").<br/>
All brands have a unique ID, it doesn't have to be the owner of the integration that creates the brand.<br/>
To enable custom branding on email, the signing formula, etc., input the brandId here.<br/>
If this is empty, the default DocuSign branding will be used.
 
== Moving to production ==
 
When moving the integration to production, the following should be taken into account.
 
Make sure to successfully upload 20 documents in a row.<br/>
They don't have to be actual documents, empty ones will do, and they don't have to be different documents, you can upload the same one 20 times.
 
If the production account is different from the test account, the following parameters should be updated:
 
* docuSignAccountId
* docuSignApiHost
 
Make sure to change the following parameters:
 
* docuSignHost
* docuSignAuthHost
 
If there is a different TS-application for test and production (different base url), remember to add the "Redirect URIs" in DocuSign.
 
And make sure that docuSignLog is set to false.

Revision as of 12:23, 3 October 2013

Option: Database creation

I can there is no database allready please perform the following steps (assuming no db is sandbox)

 mysql -uUSERNAME -pPASSWORD
 CREATE DATABASE IF NOT EXISTS sandboxbase; 
 CREATE DATABASE IF NOT EXISTS sandboxtest;
 CREATE DATABASE IF NOT EXISTS sandboxlive;
 CREATE USER 'sandboxroot'@'localhost' IDENTIFIED BY 'TempusServaFTW!';
 GRANT ALL PRIVILEGES ON sandboxlive.* TO 'sandboxroot'@'localhost';
 GRANT ALL PRIVILEGES ON sandboxtest.* TO 'sandboxroot'@'localhost';
 GRANT ALL PRIVILEGES ON sandboxbase.* TO 'sandboxroot'@'localhost';


Database transfer

Choose ONE of the options below that best suits your requirements.

Database transfer: Different MySQL server / Same schema name

Export data from LIVE server

 mysqldump -uUSERNAME -pPASSWORD --databases tsbase tslive tstest > dump.sql

Import data to TEST server

 mysql -uUSERNAME -pPASSWORD --force < dump.sql

Database transfer: Same MySQL server / Different schema name

Export data from LIVE server

 mysqldump -uUSERNAME -pPASSWORD tsbase > dumpBase.sql
 mysqldump -uUSERNAME -pPASSWORD tslive > dumpLive.sql
 mysqldump -uUSERNAME -pPASSWORD tstest > dumpTest.sql

Import data to TEST server (assuming name is 'sandbox')

 mysql -uUSERNAME -pPASSWORD sandboxbase < dumpBase.sql
 mysql -uUSERNAME -pPASSWORD sandboxlive < dumpLive.sql
 mysql -uUSERNAME -pPASSWORD sandboxtest < dumpTest.sql

Configuration changes

Important information: The following script will updata the database tslive, for the sandbox copy example please USE sandboxlive;.

Run the following commands before you start the server

 mysql -uUSERNAME -pPASSWORD
 USE tslive;
 UPDATE systempolicy SET PolicyValue = 'false' WHERE PolicyName='serviceAutostart';
 UPDATE systempolicy SET PolicyValue = 'true' WHERE PolicyName='smtpTestMode';
 UPDATE systempolicy SET PolicyValue = 'localhost' WHERE PolicyName='smtpServer';
 UPDATE systempolicy SET PolicyValue = 'localhost' WHERE PolicyName='applicationServer';
 UPDATE systempolicy SET PolicyValue = 'http://localhost' WHERE PolicyName='applicationURL';
 UPDATE systempolicy SET PolicyValue =  WHERE PolicyName LIKE 'folder%';
 UPDATE systempolicy SET PolicyValue = 'C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps' WHERE PolicyName='applicationBasePath';

Note: The following changes can be replaced by setting the values in the application deployment descriptor, starting from version 2500

Rebuild views

Ensure that views exist by rebuilding them

 Designer > Modules > Admin services > RebuildViews


Troubleshooting

Server not started

  • Check application server log files for information
  • Tomcat
    • Check xml descriptor is found in [TOMCAT]/conf/Catalina/localhost
    • Check war file is unpacked correctly in [TOMCAT]/webapps

Cannot select fieldtype when adding or editing fields

  1. Run the following SQL command
 USE tsbase;
 DROP VIEW IF EXISTS viewdatatypeselector;
 CREATE VIEW viewdatatypeselector AS
   SELECT
     systemdatatype.FeltTypeID AS `FeltTypeID`,
     concat(systemdatatypepackage.TypePrefix,': ',systemdatatype.FeltType) AS `FeltType` 
   FROM systemdatatype 
   JOIN systemdatatypepackage 
     ON systemdatatype.PackageID = systemdatatypepackage.PackageID 
   WHERE systemdatatype.IsSelectable = 1)
   ORDER BY systemdatatypepackage.SortOrder, systemdatatype.FeltType;
  1. Repeat the "Rebuild views above"