Copying Scoreboards

From SDU
Jump to: navigation, search
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This article provides instructions for copying the Scoreboard of one Access Type and using it for another.

Step 1. Identify the Access Type's id

First we must obtain the id of the subject Access Types. Do this run the following command: <source lang="text"> pdm_extract -f "SELECT id,sym FROM Access_Type" </source>

Step 2. Extract the Scoreboard

The next step is to extract the Scoreboard of the source Access Type. To do that, run the following command: <source lang="text"> pdm_extract -f "SELECT * FROM User_Query WHERE obj_persid like '%1540926%'" > store.txt</source>

Example Output: <source lang="text"> TABLE User_Query expanded factory id label last_mod_by last_mod_dt obj_persid parent persid query query_set query_type sequence { "0" ,"" ,"400954" ,"My Queue" ,"" ,"" ,"acctyp:1540926" ,"0", "usq:400954" ,"" ,"0" ,"" ,"100" } { "0" ,"cr" ,"401012" ,"Today's Tickets", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:28:32" ,"acctyp:1540926", "400954" ,"usq:401012" ,"my Today" ,"0" ,"0" ,"150" } { "0" ,"cr" ,"401013" ,"Today's Pending", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"05/12/2008 10:55:40" ,"acctyp:1540926", "400954" ,"usq:401013" ,"my todaypend" ,"0" ,"0" ,"175" } { "0" ,"cr" ,"401014" ,"Today's Open" ,"E7F07AAB67A1DA469F51FB1BC30097CF", "04/18/2008 13:31:32" ,"acctyp:1540926" ,"400954" ,"usq:401014", "MY TODAY OPE" ,"0" ,"0" ,"187" } { "0" ,"cr" ,"401015" ,"Today's closed", </source>

Step 3. Edit Extract File

The next step is to replace the references to the source Access Type's id with the id of the destination Access Type. In the our case we will replace acctyp:1540926 with acctype:1540922.

Also, rename the id header to idw and the persid header to persidw.

Example: <source lang="text"> TABLE User_Query expanded factory idw label last_mod_by last_mod_dt obj_persid parent persidw query query_set query_type sequence </source>

This will disable the ID fields in the file so we don’t replace the original data

Step 4. Load Extract

Use the following command to load the new scoreboard: <source lang="text">pdm_load -i -f store.txt</source>

You will receive the following error because the idw and persidw fields are not recognized. <source lang="text"> ERROR: Invalid field name (idw) for table (User_Query). Ignoring column. ERROR: Invalid field name (persidw) for table (User_Query). Ignoring column. </source>

Step 5. Extract the New Scoreboard

The next step is to extract the new Scoreboard in order to properly build the folder structure. Run the following command: <source lang="text"> pdm_extract -f "SELECT * FROM User_Query WHERE obj_persid like '%1540922%'" > store2.txt </source>

Step 6. Edit Second Extract File

All the nodes need to reference the id of the folder that they reside in. The id of the folder, known as the parent, is identified in the parent column. The second extract will still be referencing the folder ids used by the source Access Type. We will be replacing these references with the ids of the folders used by the new Access Type's Scoreboard.

In the example below, My Queue is a folder and its id is 401337. The other items are nodes that are referencing id 400954 which is an id of a folder used by the source Access Type. <source lang="text"> TABLE User_Query expanded factory id label last_mod_by last_mod_dt obj_persid parent persid query query_set query_type sequence { "0" ,"" ,"401337","My Queue" ,"" ,"" ,"acctyp:1540922" ,"0", "usq:401337" ,"" ,"0" ,"" ,"100" } { "0" ,"cr" ,"401338" ,"Today's Tickets", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:28:32" ,"acctyp:1540922", "400954" ,"usq:401338" ,"my Today" ,"0" ,"0" ,"150" } { "0" ,"cr" ,"401339" ,"Today's Pending", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"05/12/2008 10:55:40" ,"acctyp:1540922", "400954" ,"usq:401339" ,"my todaypend" ,"0" ,"0" ,"175" } { "0" ,"cr" ,"401340" ,"Today's Open" ,"E7F07AAB67A1DA469F51FB1BC30097CF", "04/18/2008 13:31:32" ,"acctyp:1540922" ,"400954" ,"usq:401340", "MY TODAY OPE" ,"0" ,"0" ,"187" } { "0" ,"cr" ,"401341" ,"Today's closed", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:02" ,"acctyp:1540922", "400954" ,"usq:401341" ,"my today clo" ,"0" ,"0" ,"193" } { "0" ,"cr" ,"401342" ,"Yesterday's pending", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:28" ,"acctyp:1540922", "400954" ,"usq:401342" ,"My Yesterday" ,"0" ,"0" ,"196" } { "0" ,"cr" ,"401343" ,"My Incidents" ,"" ,"" ,"acctyp:1540922" ,"400954", "usq:401343" ,"LOGININ" ,"0" ,"" ,"200" } </source> All references to 400954 must be replaced with 401337 as shown in the example below. <source lang="text"> TABLE User_Query expanded factory id label last_mod_by last_mod_dt obj_persid parent persid query query_set query_type sequence { "0" ,"" ,"401337'',"My Queue" ,"" ,"" ,"acctyp:1540922" ,"0", "usq:401337" ,"" ,"0" ,"" ,"100" } { "0" ,"cr" ,"401338" ,"Today's Tickets", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:28:32" ,"acctyp:1540922", "401337" ,"usq:401338" ,"my Today" ,"0" ,"0" ,"150" } { "0" ,"cr" ,"401339" ,"Today's Pending", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"05/12/2008 10:55:40" ,"acctyp:1540922", "401337" ,"usq:401339" ,"my todaypend" ,"0" ,"0" ,"175" } { "0" ,"cr" ,"401340" ,"Today's Open" ,"E7F07AAB67A1DA469F51FB1BC30097CF", "04/18/2008 13:31:32" ,"acctyp:1540922" ,"401337" ,"usq:401340", "MY TODAY OPE" ,"0" ,"0" ,"187" } { "0" ,"cr" ,"401341" ,"Today's closed", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:02" ,"acctyp:1540922", "401337" ,"usq:401341" ,"my today clo" ,"0" ,"0" ,"193" } { "0" ,"cr" ,"401342" ,"Yesterday's pending", "E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:28" ,"acctyp:1540922", "401337" ,"usq:401342" ,"My Yesterday" ,"0" ,"0" ,"196" } { "0" ,"cr" ,"401343" ,"My Incidents" ,"" ,"" ,"acctyp:1540922" ,"401337", "usq:401343" ,"LOGININ" ,"0" ,"" ,"200" } \ </source>

Step 7. Load the Second Extract

Use the following command to finish configuring the scoreboard: <source lang="text">pdm_load -i -f store2.txt</source>