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".


To use the feature, a regular eSignature subscription is required.
  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';


The integration will be created in demo mode and has to be approved, before it can be moved to production.<br/>
The criteria for that is: the last 20 uploads have to be successful and performed within the last 30 days.<br/>
After that, an account with the proper access has to sign in and the integration will be transferred to their account.


== Setup in DocuSign ==
== Database transfer ==
Choose ONE of the options below that best suits your requirements.


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: Different MySQL server / Same schema name ===
Export data from LIVE server


Second: Add a "Secret Key", save it, it is needed for ''docuSignSecretKey''.
  mysqldump -uUSERNAME -pPASSWORD --databases tsbase tslive tstest > dump.sql


Third: Under "Redirect URIs" add one using the following formular:<br/>
Import data to TEST server
https://[TS-domain]/[TS-app-name]/[docuSignAuthCallbackUrl]<br/>
Sample: https://omega.tempusserva.dk/TempusServa/main?command=dk.tempusserva.signing.docusign.PageLoginCallback


== Setup in TS ==
  mysql -uUSERNAME -pPASSWORD --force < dump.sql


There are 11 parameters available, 7 of them have to be set for the integration to work.
=== Database transfer: Same MySQL server / Different schema name ===


* docuSignActive*
Export data from LIVE server
* docuSignLog
* docuSignApiHost*
* docuSignAuthHost*
* docuSignHost*
* docuSignAccountId*
* docuSignIntegrationKey*
* docuSignSecretKey*
* docuSignAuthCallbackUrl
* docuSignEventCallbackUrl
* docuSignBrandId


And the type of the field with documents where DocuSign upload should be available, has to be changed from "[[FieldFiles|Files: Documents]]" to "[[FieldFilesSigning|Files: Documents with signing]]".
  mysqldump -uUSERNAME -pPASSWORD tsbase > dumpBase.sql
  mysqldump -uUSERNAME -pPASSWORD tslive > dumpLive.sql
  mysqldump -uUSERNAME -pPASSWORD tstest > dumpTest.sql


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


To enable the DocuSign functionality, this has to be set to "true".
  mysql -uUSERNAME -pPASSWORD sandboxbase < dumpBase.sql
  mysql -uUSERNAME -pPASSWORD sandboxlive < dumpLive.sql
  mysql -uUSERNAME -pPASSWORD sandboxtest < dumpTest.sql


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


This is for debugging and should '''not''' be enabled in production.<br/>
Run the following commands '''before''' you start the server
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.


=== docuSignApiHost ===
  mysql -uUSERNAME -pPASSWORD


This parameter is account-dependant.<br/>
  USE tslive;
It can be found on the "Apps and Keys" page in DocuSign, labeled "Account Base URI".
  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';


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


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.
== Rebuild views ==
Ensure that views exist by rebuilding them


=== docuSignHost ===
  Designer > Modules > Admin services > RebuildViews


This parameter is account-dependant.<br/>
This parameter is used to redirect the user, after a successful upload.<br/>
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 ===
== Troubleshooting ==


This attribute is account-dependant.<br/>
=== Server not started ===
It can be found on the "Apps and Keys" page in DocuSign, labeled "API Account ID".<br/>
* Check application server log files for information
It's a GUID, formattet like this: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
* Tomcat
** Check xml descriptor is found in [TOMCAT]/conf/Catalina/localhost
** Check war file is unpacked correctly in [TOMCAT]/webapps


=== docuSignIntegrationKey ===
=== 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 on the "Apps and Keys" page in DocuSign, or when viewing the details about the integration.<br/>
  DROP VIEW IF EXISTS viewdatatypeselector;
It's a GUID, formattet like this: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  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;


=== docuSignSecretKey ===
# Repeat the "Rebuild views above"
 
This parameter is integration-dependant.<br/>
It can be found when viewing the details about the integration, in DocuSign.<br/>
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.<br/>
It's a GUID, formattet like this: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 
=== docuSignAuthCallbackUrl ===
 
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.<br/>
It's a GUID, formattet like this: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 
== 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 13: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"