Difference between revisions of "Copying Scoreboards"

From SDU
Jump to: navigation, search
(New page: ''''''Copying Scoreboards Between Access types'''''' First extract the scoreboard you want to copy on to a file using the following command To run the command you need to know the access...)
 
m (Step 1. Identify the Access Type's id)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''''''Copying Scoreboards Between Access types''''''
+
__NOTOC__
 +
[[Category:r6]]
 +
[[Category:r11]]
 +
[[Category:Scoreboard]]
 +
{{Global Header}}
 +
{{Global Announcement}}
  
First extract the scoreboard you want to copy on to a file using the following command
+
== Overview ==
 +
This article provides instructions for copying the Scoreboard of one Access Type and using it for another.
  
To run the command you need to know the accesstype code from Access_Type table
+
=== 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:
In this example 150926 is an accestype we wish to copy
+
<source lang="text">
 
+
pdm_extract -f "SELECT id,sym FROM Access_Type"
<source lang="html4strict"> pdm_extract -f "Select * from User_Query WHERE obj_persid like '%1540926%'" > store
+
 
</source>
 
</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>
  
The output is as follows
+
'''Example Output:'''
 
+
<source lang="text">
+
<source lang="html4strict">
+
 
TABLE User_Query
 
TABLE User_Query
 
expanded factory id label last_mod_by last_mod_dt obj_persid parent persid
 
expanded factory id label last_mod_by last_mod_dt obj_persid parent persid
Line 32: Line 38:
 
</source>
 
</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''.
  
Use the find and replace feature to replace Acctyp: 1540926 to the desired access type number .. in our case the number is 1540922
+
Also, rename the ''id'' header to ''idw'' and the ''persid'' header to ''persidw''.
 
+
After replacing, rename the ID and persid fields as follows
+
<source lang="html4strict">
+
  
 +
'''Example:'''
 +
<source lang="text">
 
TABLE User_Query
 
TABLE User_Query
expanded factory '''idw''' label last_mod_by last_mod_dt obj_persid parent '''persidw'''
+
expanded factory idw label last_mod_by last_mod_dt obj_persid parent persidw
 
query query_set query_type sequence  
 
query query_set query_type sequence  
 
</source>
 
</source>
Line 45: Line 52:
 
This will disable the ID fields in the file so we don’t replace the original data
 
This will disable the ID fields in the file so we don’t replace the original data
  
Use the following command to load it to the new scoreboard
+
=== Step 4. Load Extract ===
<source lang="html4strict">
+
Use the following command to load the new scoreboard:
 +
<source lang="text">pdm_load -i -f store.txt</source>
  
Z:\>pdm_load -i -f store
+
You will receive the following error because the idw and persidw fields are not recognized.
</source>
+
<source lang="text">
 
+
You will get the following error as the ID and persid fields are not recognizable
+
 
+
<source lang="html4strict">
+
 
+
Z:\>pdm_load -i -f store
+
command = C:\PROGRA~1/CA/UNICEN~1\bin\dbload -i  store
+
 
ERROR: Invalid field name (idw) for table (User_Query). Ignoring column.
 
ERROR: Invalid field name (idw) for table (User_Query). Ignoring column.
 
ERROR: Invalid field name (persidw) for table (User_Query). Ignoring column.
 
ERROR: Invalid field name (persidw) for table (User_Query). Ignoring column.
 
</source>
 
</source>
  
Now extract the data to define parent child relation ship
+
=== 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="html4strict">
+
<source lang="text">
 
+
pdm_extract -f "SELECT * FROM User_Query WHERE obj_persid like '%1540922%'" > store2.txt
Z:\>pdm_extract -f "Select * from User_Query WHERE obj_persid like '%1540922%'"
+
> store2
+
User_Query
+
        rows:55
+
 
</source>
 
</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.
  
<source lang="html4strict">
+
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
 
TABLE User_Query
 
expanded factory id label last_mod_by last_mod_dt obj_persid parent persid
 
expanded factory id label last_mod_by last_mod_dt obj_persid parent persid
 
query query_set query_type sequence  
 
query query_set query_type sequence  
{ "0" ,"" ,"'''''401337''''''',"My Queue" ,"" ,"" ,"acctyp:1540922" ,"0",
+
{ "0" ,"" ,"401337","My Queue" ,"" ,"" ,"acctyp:1540922" ,"0",
 
"usq:401337" ,"" ,"0" ,"" ,"100" }
 
"usq:401337" ,"" ,"0" ,"" ,"100" }
 
{ "0" ,"cr" ,"401338" ,"Today's Tickets",
 
{ "0" ,"cr" ,"401338" ,"Today's Tickets",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:28:32" ,"acctyp:1540922",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:28:32" ,"acctyp:1540922",
"'''400954'''" ,"usq:401338" ,"my Today" ,"0" ,"0" ,"150" }
+
"400954" ,"usq:401338" ,"my Today" ,"0" ,"0" ,"150" }
 
{ "0" ,"cr" ,"401339" ,"Today's Pending",
 
{ "0" ,"cr" ,"401339" ,"Today's Pending",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"05/12/2008 10:55:40" ,"acctyp:1540922",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"05/12/2008 10:55:40" ,"acctyp:1540922",
"'''400954'''" ,"usq:401339" ,"my todaypend" ,"0" ,"0" ,"175" }
+
"400954" ,"usq:401339" ,"my todaypend" ,"0" ,"0" ,"175" }
 
{ "0" ,"cr" ,"401340" ,"Today's Open" ,"E7F07AAB67A1DA469F51FB1BC30097CF",
 
{ "0" ,"cr" ,"401340" ,"Today's Open" ,"E7F07AAB67A1DA469F51FB1BC30097CF",
 
"04/18/2008 13:31:32" ,"acctyp:1540922" ,"400954" ,"usq:401340",
 
"04/18/2008 13:31:32" ,"acctyp:1540922" ,"400954" ,"usq:401340",
Line 89: Line 89:
 
{ "0" ,"cr" ,"401341" ,"Today's closed",
 
{ "0" ,"cr" ,"401341" ,"Today's closed",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:02" ,"acctyp:1540922",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:02" ,"acctyp:1540922",
"'''400954'''" ,"usq:401341" ,"my today clo" ,"0" ,"0" ,"193" }
+
"400954" ,"usq:401341" ,"my today clo" ,"0" ,"0" ,"193" }
 
{ "0" ,"cr" ,"401342" ,"Yesterday's pending",
 
{ "0" ,"cr" ,"401342" ,"Yesterday's pending",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:28" ,"acctyp:1540922",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:28" ,"acctyp:1540922",
"'''400954'''" ,"usq:401342" ,"My Yesterday" ,"0" ,"0" ,"196" }
+
"400954" ,"usq:401342" ,"My Yesterday" ,"0" ,"0" ,"196" }
 
{ "0" ,"cr" ,"401343" ,"My Incidents" ,"" ,"" ,"acctyp:1540922" ,"400954",
 
{ "0" ,"cr" ,"401343" ,"My Incidents" ,"" ,"" ,"acctyp:1540922" ,"400954",
 
"usq:401343" ,"LOGININ" ,"0" ,"" ,"200" }
 
"usq:401343" ,"LOGININ" ,"0" ,"" ,"200" }
\
+
</source>
\
+
All references to 400954 must be replaced with 401337 as shown in the example below.
\
+
<source lang="text">
</Source>
+
The Bold and italic item is the actual ID of the Parent folder. The bold are the old parent ID,, use the find and replace feature to replace each and every parent ID with the new parent  ID of the parent folder.
+
 
+
 
+
<source lang="html4strict">
+
 
TABLE User_Query
 
TABLE User_Query
 
expanded factory id label last_mod_by last_mod_dt obj_persid parent persid
 
expanded factory id label last_mod_by last_mod_dt obj_persid parent persid
Line 110: Line 105:
 
{ "0" ,"cr" ,"401338" ,"Today's Tickets",
 
{ "0" ,"cr" ,"401338" ,"Today's Tickets",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:28:32" ,"acctyp:1540922",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:28:32" ,"acctyp:1540922",
"''''''401337''''''" ,"usq:401338" ,"my Today" ,"0" ,"0" ,"150" }
+
"401337" ,"usq:401338" ,"my Today" ,"0" ,"0" ,"150" }
 
{ "0" ,"cr" ,"401339" ,"Today's Pending",
 
{ "0" ,"cr" ,"401339" ,"Today's Pending",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"05/12/2008 10:55:40" ,"acctyp:1540922",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"05/12/2008 10:55:40" ,"acctyp:1540922",
"''''''401337''''''" ,"usq:401339" ,"my todaypend" ,"0" ,"0" ,"175" }
+
"401337" ,"usq:401339" ,"my todaypend" ,"0" ,"0" ,"175" }
 
{ "0" ,"cr" ,"401340" ,"Today's Open" ,"E7F07AAB67A1DA469F51FB1BC30097CF",
 
{ "0" ,"cr" ,"401340" ,"Today's Open" ,"E7F07AAB67A1DA469F51FB1BC30097CF",
"04/18/2008 13:31:32" ,"acctyp:1540922" ,"'''401337'''" ,"usq:401340",
+
"04/18/2008 13:31:32" ,"acctyp:1540922" ,"401337" ,"usq:401340",
 
"MY TODAY OPE" ,"0" ,"0" ,"187" }
 
"MY TODAY OPE" ,"0" ,"0" ,"187" }
 
{ "0" ,"cr" ,"401341" ,"Today's closed",
 
{ "0" ,"cr" ,"401341" ,"Today's closed",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:02" ,"acctyp:1540922",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:02" ,"acctyp:1540922",
"''''''401337''''''" ,"usq:401341" ,"my today clo" ,"0" ,"0" ,"193" }
+
"401337" ,"usq:401341" ,"my today clo" ,"0" ,"0" ,"193" }
 
{ "0" ,"cr" ,"401342" ,"Yesterday's pending",
 
{ "0" ,"cr" ,"401342" ,"Yesterday's pending",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:28" ,"acctyp:1540922",
 
"E7F07AAB67A1DA469F51FB1BC30097CF" ,"04/18/2008 13:33:28" ,"acctyp:1540922",
"''''''401337''''''" ,"usq:401342" ,"My Yesterday" ,"0" ,"0" ,"196" }
+
"401337" ,"usq:401342" ,"My Yesterday" ,"0" ,"0" ,"196" }
{ "0" ,"cr" ,"401343" ,"My Incidents" ,"" ,"" ,"acctyp:1540922" ,"400954",
+
{ "0" ,"cr" ,"401343" ,"My Incidents" ,"" ,"" ,"acctyp:1540922" ,"401337",
 
"usq:401343" ,"LOGININ" ,"0" ,"" ,"200" }
 
"usq:401343" ,"LOGININ" ,"0" ,"" ,"200" }
 
\
 
\
 
</source>
 
</source>
  
Once the file is ready you can load it back
+
=== 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>
<source lang="html4strict">
+
pdm_load -f filename
+
 
+
</source>
+

Latest revision as of 13:56, 12 October 2008

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>