AttrDBRefreshTable of Contents

AttrDBRefreshGetAllKeysGetNewKeyCountsOpenPagePutValueWritePageAttrDBRefreshThis script performs useful function on the custom attributes database.

The currently-supported command-line options are as follows.

userName suffix to be used for log files. If omitted, the PID is used.

traceNumeric trace level. A higher trace level causes more messages to appear. Th default trace level is 3.

sqlIf specified, turns on tracing of SQL activity.

backgroundSave the standard and error output to files. The files will be create in the FIG temporary directory and will be named errUser.log an outUser.log, respectively, where User is the value of th user option above.

hDisplay this command's parameters and options.

phonePhone number to message when the script is complete.

appendLoadIf specified, existing keys will not be erased before loading the attribut data. This option only makes sense if load is specified.

loadIf specified, the name of a file containing attribute data to be loaded into th system. The file is presumed to be tab-delimited. The first column must be th object ID, the second the attribute key name, and the remaining columns th attribute values. All attribute keys mentioned in the file will be erased befor loading unless the appendLoad option is specified.

loadKeyIf specified, the name of a tab-delimited file containing attribute key data. For each key there is a pair of lines. The first line contains the ID, data type, and descriptio of the key. The second line contains the marker #GROUPS followed by zero or mor group names. The attribute will be connected to all the specified groups.

backupIf specified, the name of a file into which all the attribute data should b dumped. The file itself will receive the attribute data in the format expecte by load. A second file, consisting of the same file name with the suffix .key will contain the attribute key data in the format expected by loadKey.

summaryIf specified, the name of a file to contain a summary report. The summary repor contains a table of the attribute keys and the number of values of each. The repor is formatted as a web page.

trimSpacesIf specified, the name of an attribute value backup file. The file will be processed t remove excess spaces. The fixed file will have the same name as the incoming backu file with the extension <.fixed>. This new file can then be reloaded using th load option.

showKeyDefIf specified, the name of an attribute key. The key's descriptive data will be displayed.

clearIf specified, the attribute database will be cleared. If this is specified with the loadloadKey options, the clear will happen before the loads place.

resumeIf specified, attribute data already in the file will not be reloaded. This option onl makes sense if load is specified. If a number is used, then the specified number o lines will be skipped in the input file and after that the lines will be checked individually Once the first non-redundant line is found, all lines after that will be loaded. So, i a load failed somewhere after record 14000 in the input file, the option

would skip 14000 lines, then resume normal processing as soon as it finds a line after tha which has not already been loaded. If redundant and non-redundant lines are mixed in th input file, use

to check every single line before loading. There is a performance penalty for that.

archiveName to use for the archive file. The archive file contains a list of the records processed.

chunkSizeNumber of lines to load at one time if the attributes are being loaded. The default is 10000.

clearGroupsIf specified, all existing group information will be erased.

PutValuePutValue($hasValueFor, $ca, @values);

Put the values from an attribute value list into a HasValueFor load file.

hasValueForLoad object for the HasValueFor table.

caA CustomAttribute object. We get the splitter value from it.

valueA list of tuples, each consisting of an object ID, a key name, and one or more values.

GetAllKeysmy @keys = GetAllKeys($ca);

Return a sorted list of the attribute keys.

caCustomAttributes object used to access the database.

RETURNReturns a sorted list of all the attribute keys.

OpenPagemy $fh = OpenPage($fileName, $title);

Start writing an HTML page to a file and return the file handle.

fileNameName of the file to which the page will be written.

titleTitle for the page.

RETURNReturns the file handle for writing the rest of the page.

GetNewKeyCountsmy %counts = GetNewKeyCounts($ca);

Return a hash mapping attribute key names to counts.

caCustomAttributes object for accessing the attribute database.

RETURNReturns a reference to a hash mapping each key name to a count of the key's values.

WritePageWritePage($fileName, $title, \@lines);

Write the specified lines to the specified file as a web page. The lines are assumed to be ra HTML body text. They will be preceded by a standard HTML header and followed by a standar HTML footer.

fileNameName of the output file.

titleTitle for the web page.

linesReference to a list of lines of HTML.