Procedural File: import_functions.php
Source Location: /php/import/import_functions.php
Page Details:
import/import_functions.php
contains the import functions
PHP versions 4 and 5
LICENSE: ARK - The Archaeological Recording Kit. An open-source framework for displaying and working with archaeological data Copyright (C) 2008 L - P : Partnership Ltd. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Tags:
buildStecdLut
void buildStecdLut(
$uid, $table, $cmap_struc_info)
[line 2077]
Parameters
-
$uid
-
-
$table
-
-
$cmap_struc_info
-
[ Top ]
chkForField
void chkForField(
object $db, string $cmap, string $tbl, string $col)
[line 2051]
check the cmap for a field
Tags:
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
a valid db connection
-
string
$cmap
-
the cmap
-
string
$tbl
-
the table
-
string
$col
-
the colum
[ Top ]
chkLutId
void chkLutId(
string $lut, string $lang, string $and)
[line 1576]
checks for the id in an LUT based on real data
Tags:
Parameters
-
string
$lut
-
the name of the look up table
-
string
$lang
-
the desired lang
-
string
$and
-
NON optional "AND" clause
[ Top ]
edtCmapData
void edtCmapData(
$db, $cmap, $sourcedata, $sourcelocation, $mapto_tbl, $mapto_id, $cre_on, [ $qtype = FALSE])
[line 1728]
edits a row of the cmap_data the data mapping table
Tags:
- author - Guy Hunt
- since -
Parameters
-
$db
-
-
$cmap
-
-
$sourcedata
-
-
$sourcelocation
-
-
$mapto_tbl
-
-
$mapto_id
-
-
$cre_on
-
-
$qtype
-
[ Top ]
edtLut
void edtLut(
$db, $table, $new_lut_val, $ark_mod, $attrtype, $lang, $cre_by, $cre_on, [ $qtype = FALSE])
[line 1653]
edits look up tables (lut's)
Tags:
- author - Guy Hunt
- since -
Parameters
-
$db
-
-
$table
-
-
$new_lut_val
-
-
$ark_mod
-
-
$attrtype
-
-
$lang
-
-
$cre_by
-
-
$cre_on
-
-
$qtype
-
[ Top ]
extrActionXmi
string extrActionXmi(
object $db, integer $cmap, integer $uid, array $cmap_struc_info, array $cmap_info)
[line 1408]
extract information from a source db about actors
Tags:
Parameters
-
object
$db
-
a valid mysql connection
-
integer
$cmap
-
the id of the current concordance map
-
integer
$uid
-
the id of the column in the source table we are looking at
-
array
$cmap_struc_info
-
array containing all of the relevant values from the structure map
-
array
$cmap_info
-
array containing all of the relevant values from the concordance map table
[ Top ]
extrAttrA
string extrAttrA(
object $db, string $cmap, string $uid, array $cmap_struc_info, array $cmap_info)
[line 341]
extracts type A Atrributes (boolean like attributes)
Tags:
- return - the new id of the fragment
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
the source db
-
string
$cmap
-
the cmap
-
string
$uid
-
the unique id if this row
-
array
$cmap_struc_info
-
array of info about the structure
-
array
$cmap_info
-
array of info about the cmap
[ Top ]
extrAttrB
string extrAttrB(
object $db, string $cmap, string $uid, array $cmap_struc_info, array $cmap_info)
[line 491]
extracting type B Atrributes (attributes linking to lut data)
Tags:
- return - the new id of the fragment
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
the source db
-
string
$cmap
-
the cmap
-
string
$uid
-
the unique id if this row
-
array
$cmap_struc_info
-
array of info about the structure
-
array
$cmap_info
-
array of info about the cmap
[ Top ]
extrCxtKey
string extrCxtKey(
object $db, string $cmap, $itemkey, $table, $uid_col, string $uid, $expl, $frag_no, $source_col, $source_cxttype, $lang, $cre_by, $cre_on, $type, $log, array $cmap_struc_info, array $cmap_info)
[line 1179]
extracts information from a source db about a context key
Tags:
Parameters
-
object
$db
-
the source db
-
string
$cmap
-
the cmap
-
string
$uid
-
the unique id if this row
-
array
$cmap_struc_info
-
array of info about the structure
-
array
$cmap_info
-
array of info about the cmap
-
$itemkey
-
-
$table
-
-
$uid_col
-
-
$expl
-
-
$frag_no
-
-
$source_col
-
-
$source_cxttype
-
-
$lang
-
-
$cre_by
-
-
$cre_on
-
-
$type
-
-
$log
-
[ Top ]
extrDate
string extrDate(
object $db, string $cmap, string $uid, array $cmap_struc_info, array $cmap_info)
[line 782]
extracts information from a source db and sends this to the edtDate() function
Tags:
- return - the new id of the fragment
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
the source db
-
string
$cmap
-
the cmap
-
string
$uid
-
the unique id if this row
-
array
$cmap_struc_info
-
array of info about the structure
-
array
$cmap_info
-
array of info about the cmap
[ Top ]
extrFrAli
string extrFrAli(
object $db, string $cmap, string $uid, array $cmap_struc_info, array $cmap_info, [ $type = FALSE])
[line 630]
extracts Aliases of data fragments
Tags:
- return - the new id of the fragment
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
the source db
-
string
$cmap
-
the cmap
-
string
$uid
-
the unique id if this row
-
array
$cmap_struc_info
-
array of info about the structure
-
array
$cmap_info
-
array of info about the cmap
-
$type
-
[ Top ]
extrKey
string extrKey(
object $db, integer $cmap, integer $uid, array $cmap_struc_info, array $cmap_info)
[line 1297]
extracts information from a source (import) database about a standard key
Tags:
- return - the new itemvalue (or FALSE on error)
- author - Stuart Eve
- author - Guy Hunt
- since - 0.5
Parameters
-
object
$db
-
a valid mysql connection
-
integer
$cmap
-
the id of the current concordance map
-
integer
$uid
-
the id of the column in the source table we are looking at
-
array
$cmap_struc_info
-
array containing all of the relevant values from the structure map
-
array
$cmap_info
-
array containing all of the relevant values from the concordance map table
[ Top ]
extrNum
integer extrNum(
object $db, integer $cmap, integer $uid, array $cmap_struc_info, array $cmap_info)
[line 204]
extracts numbers and sends to addNum()
Tags:
- return - the new id of the text fragment (or FALSE on error)
- author - Stuart Eve
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
a valid mysql connection
-
integer
$cmap
-
the id of the current concordance map
-
integer
$uid
-
the id of the column in the source table we are looking at
-
array
$cmap_struc_info
-
array containing all of the relevant values from the structure map
-
array
$cmap_info
-
array containing all of the relevant values from the concordance map table
[ Top ]
extrSpan
string extrSpan(
object $db, string $cmap, string $uid, array $cmap_struc_info, array $cmap_info)
[line 923]
extracts information from a source db and sends this to addSpan()
Tags:
- return - the new id of the fragment
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
the source db
-
string
$cmap
-
the cmap
-
string
$uid
-
the unique id if this row
-
array
$cmap_struc_info
-
array of info about the structure
-
array
$cmap_info
-
array of info about the cmap
[ Top ]
extrTxt
integer extrTxt(
object $db, integer $cmap, integer $uid, array $cmap_struc_info, array $cmap_info)
[line 53]
extracts information from a source (import) database about a text fragment
Tags:
- return - the new id of the text fragment (or FALSE on error)
- author - Stuart Eve
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
a valid mysql connection
-
integer
$cmap
-
the id of the current concordance map
-
integer
$uid
-
the id of the column in the source table we are looking at
-
array
$cmap_struc_info
-
array containing all of the relevant values from the structure map
-
array
$cmap_info
-
array containing all of the relevant values from the concordance map table
[ Top ]
extrXmi
string extrXmi(
object $db, string $cmap, string $uid, array $cmap_struc_info, array $cmap_info)
[line 1044]
extracts information from a source db and to send this to the edtXmi()
Tags:
- return - the new id of the fragment
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
the source db
-
string
$cmap
-
the cmap
-
string
$uid
-
the unique id if this row
-
array
$cmap_struc_info
-
array of info about the structure
-
array
$cmap_info
-
array of info about the cmap
[ Top ]
getAttId
integer getAttId(
object $db, integer $cmap, $lut_tbl, $lut_idcol, $lut_id, $lut_valcol, $ark_lut, $ark_mod, $attrtype, $lang, $cre_by, $cre_on, [ $qtype = FALSE], integer $uid, array $cmap_struc_info, array $cmap_info)
[line 1768]
gets the correct LUT target id
Tags:
- return - the new id of the text fragment (or FALSE on error)
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
a valid mysql connection
-
integer
$cmap
-
the id of the current concordance map
-
integer
$uid
-
the id of the column in the source table we are looking at
-
array
$cmap_struc_info
-
array containing all of the relevant values from the structure map
-
array
$cmap_info
-
array containing all of the relevant values from the concordance map table
-
$lut_tbl
-
-
$lut_idcol
-
-
$lut_id
-
-
$lut_valcol
-
-
$ark_lut
-
-
$ark_mod
-
-
$attrtype
-
-
$lang
-
-
$cre_by
-
-
$cre_on
-
-
$qtype
-
[ Top ]
getCmapData
array getCmapData(
string $sourcelocation, string $sourcedata)
[line 1619]
gets datamapping vars from the cmap_data
Tags:
- return - the row in the cmap_data table that contains the requested source
- author - Guy Hunt
- since - 0.5
Parameters
-
string
$sourcelocation
-
the name of the table that holds the data
-
string
$sourcedata
-
the data to search for
[ Top ]
getCmapDB
void getCmapDB(
object $db, string $id)
[line 1861]
retrieves the name of the source db for a cmap using the id
Tags:
- author - Guy Hunt
- since - 0.4
Parameters
-
object
$db
-
the current db connection
-
string
$id
-
the cmap id
[ Top ]
getItemVal
string getItemVal(
$db, $imp_ste_cd, string $raw_itemval_col, string $tbl_itemval_join_col, string $raw_itemval_tbl, string $raw_itemval_join_col, $tbl, string $uid_col, string $uid, string $uid_tbl)
[line 1994]
gets an itemvalue from a source db
Tags:
- return - an ARK itemvalue
- author - Guy Hunt
- since - 0.5
Parameters
-
string
$raw_itemval_col
-
-
string
$raw_itemval_tbl
-
-
string
$raw_itemval_join_col
-
-
string
$tbl_itemval_join_col
-
-
string
$uid_tbl
-
-
string
$uid_col
-
-
string
$uid
-
-
$db
-
-
$imp_ste_cd
-
-
$tbl
-
[ Top ]
getSteCd
void getSteCd(
$db, $id, [ $stecd_lut = FALSE])
[line 1891]
Parameters
[ Top ]