====================
EPIC Transform Files
====================

Copyright xMatters, inc. 2011

Revision Date: April 19, 2011

Target Audience
================
xMatters on demand Consultants


Version of Pentaho Data Integration
===================================
4.1.0 RC1


Executed Files
==============
All files with the extension .ktr found in the xMatters on demand server's 
shared directory for the targeted company will be executed. Note that the order
in which the files are executed is not guaranteed. 

The shared directory root is configured in the xMod Global Configuration - USER
UPLOAD FILE STORAGE LOCATION. Each company to be supported will need a
sub-directory named {org_id}.

The following examples are based on a USER UPLOAD FILE STORAGE LOCATION of 
 "/opt/share"

For a Company with an ID of 200000, the .ktr files should be placed as follows:

|-- /opt/share/200000
|   |-- 2010-Nov-24__20.50.23-export_enc
|   |-- DS_ATTRIBUTES.ktr
|   |-- DS_ATTRIBUTE_CATEGORIES.ktr
|   |-- DS_CUSTOM_FIELDS.ktr
|   |-- DS_CUSTOM_FIELD_JOIN_VALUES.ktr
|   |-- DS_DEVICE_TIMEFRAMES.ktr
|   |-- DS_EMAIL_DEVICES.ktr
|   |-- DS_GROUPS.ktr
|   |-- DS_HOLIDAY_COVERAGES.ktr
|   |-- DS_PERSON_SUPERVISORS.ktr
|   |-- DS_RECURRENT_COVERAGES.ktr
|   |-- DS_TEAMS.ktr
|   |-- DS_TEAM_MEMBERSHIPS.ktr
|   |-- DS_TEMP_REPLACEMENTS.ktr
|   |-- DS_TEXT_PAGER_DEVICES.ktr
|   |-- DS_TEXT_PHONE_DEVICES.ktr
|   |-- DS_USERS.ktr
|   |-- DS_USER_CUSTOM_VALUES.ktr
|   |-- DS_USER_JOIN_ATTRIBUTES.ktr
|   |-- DS_VOICE_DEVICES.ktr
|   `-- ds.common.properties

Available Variables
===================
The following variables are available to the transforms:
${ORIGINATING_JVM_TIMEZONE} - The time zone of the JVM where the data originated
${HOST}                     - Host to the database hosting the staging data
${SID}                      - SID to the database hosting the staging data
${TABLESPACE}               - The schema's name hosting the staging data
${USER}                     - Database User hosting the staging data
${PASSWORD}                 - Database User's password

Sample Transforms
=================
All sample transform moves data from the DS_% tables to the DS_%_T table. The
idea is to preserve the data from the EPIC Client process.

DS_DEVICE_TIMEFRAMES.ktr
 i Time Zone is converted as there are existing bug in how coverage data are
    stored.

DS_EMAIL_DEVICES.ktr
 i Service provider was transformed to xMod's settings.

DS_GROUPS.ktr
 i Time Zone is renamed from 
   America/Argentina/Buenos_Aires to America/Buenos_Aires
   America/Argentina/Catamarca to America/Catamarca
   America/Argentina/Cordoba to America/Cordoba
   America/Argentina/Jujuy to America/Jujuy
   America/Argentina/Mendoza to America/Mendoza
   Antarctica/DumontDUrville to Antarctica/Dumont d'Urville
ii Time zone is mapped to those supported by EPIC, for example America/Nipigon
   is mapped to US/Michigan.

DS_HOLIDAY_COVERAGES.ktr
 i Time Zone is converted as there are existing bug in how coverage data are
    stored.

DS_RECURRENT_COVERAGES.ktr
 i Time Zone is converted as there are existing bug in how coverage data are
    stored.

DS_TEXT_PAGER_DEVICES.ktr
 i Service provider was transformed to xMod's settings.

DS_TEXT_PHONE_DEVICES.ktr
  i Service provider was transformed to xMod's settings.
 ii Phone number was converted, refer to below link for more details.
     http://vic-confluence/download/attachments/26805602/
     SMSDatabaseMigrationTool.txt?version=1&modificationDate=1271285490000
iii If the device belongs to a Site that has an unrecognized Country and the
    country code cannot be determined from the Phone Number then a country code
	of ZZ will be assigned. The idea is to have Data Synchronizer throw an error
	that would be visible in the WebUI, as customers of xMod will not be able
	to see the transform logs.

DS_USERS.ktr
 i Roles are transformed.
ii Empty phone passwords are removed.
iii Language is set to English
iv mobile access is set to false
 v Time Zone is renamed from 
   America/Argentina/Buenos_Aires to America/Buenos_Aires
   America/Argentina/Catamarca to America/Catamarca
   America/Argentina/Cordoba to America/Cordoba
   America/Argentina/Jujuy to America/Jujuy
   America/Argentina/Mendoza to America/Mendoza
   Antarctica/DumontDUrville to Antarctica/Dumont d'Urville
vi Time zone is mapped to those supported by EPIC, for example America/Nipigon
   is mapped to US/Michigan.

DS_USER_CUSTOM_VALUES.ktr
 i Orphaned List Custom Values are filtered.

DS_VOICE_DEVICES.ktr
 i Service provider was transformed to xMod's settings.
 
DS_TEMP_REPLACEMENTS.ktr
 i Start and End date/time is converted to Vacationer's preferred time zone
   while accounting for the difference in time zone between Premises and xMod.
