Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
importDocuments.php File Reference

Go to the source code of this file.

Namespaces

 FDL
 

Variables

global $appl
 
global $action
 
 $usage = new ApiUsage()
 
 $filename = $usage->addRequiredParameter("file", "the description file path")
 
 $analyze
 
 $archive
 
 $logfile = $usage->addOptionalParameter("log", "log file output")
 
 $policy
 
 $htmlmode
 
 $reinit
 
 $reset
 
 $to = $usage->addOptionalParameter("to", "email address to send report")
 
 $dirid = $usage->addOptionalParameter("dir", "folder where imported documents are put")
 
 $strict
 
 $csvSeparator
 
 $csvEnclosure
 
 $csvLinebreak = $usage->addOptionalParameter("csv-linebreak", "character sequence to be import like CRLF", null, '\n')
 
if($dirid) $oImport = new ImportDocument()
 
 $cr = $oImport->importDocuments($action, $filename, $analyze != "no", $archive == "yes")
 
 $filetmp = false
 
if((!$logfile)&&$to) if($logfile)
if($to) 
$err = $oImport->getErrorMessage()
 

Variable Documentation

global $action

Definition at line 17 of file importDocuments.php.

$analyze
Initial value:
= $usage->addOptionalParameter("analyze", "analyze only", array(
"yes",
"no"
) , "no")

Definition at line 25 of file importDocuments.php.

global $appl

Definition at line 17 of file importDocuments.php.

$archive
Initial value:
= $usage->addOptionalParameter("archive", "description file is an standard archive (not xml)", array(
"yes",
"no"
) , "no")

Definition at line 29 of file importDocuments.php.

$cr = $oImport->importDocuments($action, $filename, $analyze != "no", $archive == "yes")

Definition at line 152 of file importDocuments.php.

$csvEnclosure
Initial value:
= $usage->addOptionalParameter("csv-enclosure", "character to enclose fields - generaly double-quote", function ($values, $argName, ApiUsage $apiusage)
{
if ($values === ApiUsage::GET_USAGE) {
return sprintf(' use single character or "auto"');
}
if (!is_string($values)) {
return sprintf("must be a character [%s] ", print_r($values, true));
}
if ($values != "auto") {
if (mb_strlen($values) > 1) {
return sprintf("must be a only one character [%s] ", $values);
}
}
return '';
}
, "")
const GET_USAGE
Verify arguments for wsh programs.

Definition at line 90 of file importDocuments.php.

$csvLinebreak = $usage->addOptionalParameter("csv-linebreak", "character sequence to be import like CRLF", null, '\n')

Definition at line 107 of file importDocuments.php.

$csvSeparator
Initial value:
= $usage->addOptionalParameter("csv-separator", "character to delimiter fields - generaly a comma", function ($values, $argName, ApiUsage $apiusage)
{
if ($values === ApiUsage::GET_USAGE) {
return sprintf(' use single character or "auto"');
}
if (!is_string($values)) {
return sprintf("must be a character [%s] ", print_r($values, true));
}
if ($values != "auto") {
if (mb_strlen($values) > 1) {
return sprintf("must be a only one character [%s] ", $values);
}
}
return '';
}
, ";")
const GET_USAGE
Verify arguments for wsh programs.

Definition at line 73 of file importDocuments.php.

$dirid = $usage->addOptionalParameter("dir", "folder where imported documents are put")

Definition at line 66 of file importDocuments.php.

if ((!$logfile)&&$to) if ($logfile) if ($to) $err = $oImport->getErrorMessage()

Definition at line 183 of file importDocuments.php.

$filename = $usage->addRequiredParameter("file", "the description file path")

Definition at line 24 of file importDocuments.php.

$filetmp = false

Definition at line 154 of file importDocuments.php.

$htmlmode
Initial value:
= $usage->addOptionalParameter("htmlmode", "analyze report mode in html", array(
"yes",
"no"
) , "yes")

Definition at line 39 of file importDocuments.php.

$logfile = $usage->addOptionalParameter("log", "log file output")

Definition at line 33 of file importDocuments.php.

if ($dirid) $oImport = new ImportDocument()

Definition at line 145 of file importDocuments.php.

$policy
Initial value:
= $usage->addOptionalParameter("policy", "policy import - \n\t\t[update] to auto update same document (the default), \n\t\t[add] to always create new document, \n\t\t[keep] to do nothing if same document already present", array(
"update",
"add",
"keep"
))

Definition at line 34 of file importDocuments.php.

$reinit
Initial value:
= $usage->addOptionalParameter("reinitattr", "reset attribute before import family update (deprecated)", array(
"yes",
"no"
))

Definition at line 43 of file importDocuments.php.

$reset
Initial value:
= $usage->addOptionalParameter("reset", "reset options", function ($values, $argName, ApiUsage $apiusage)
{
$opt = array(
"default",
"parameters",
"attributes",
"structure",
"properties",
"enums"
);
if ($values === ApiUsage::GET_USAGE) return sprintf(" [%s] ", implode('|', $opt));
$error = $apiusage->matchValues($values, $opt);
if ($error) {
$apiusage->exitError(sprintf("Error: wrong value for argument 'reset' : %s", $error));
}
return '';
})
exitError($error= '')
const GET_USAGE
static matchValues($value, $restrictions)
Verify arguments for wsh programs.

Definition at line 47 of file importDocuments.php.

$strict
Initial value:
= $usage->addOptionalParameter("strict", "don't import if one error detected", array(
"yes",
"no"
) , "yes")

Definition at line 68 of file importDocuments.php.

$to = $usage->addOptionalParameter("to", "email address to send report")

Definition at line 65 of file importDocuments.php.

$usage = new ApiUsage()

Definition at line 22 of file importDocuments.php.

← centre documentaire © anakeen