Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
updateAttribute.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Update attribute values for a document set
8  *
9  * @author Anakeen
10  * @package FDL
11  */
12 /*
13  * @var Action $action
14  */
15 global $action;
16 
17 include_once ("FDL/Lib.Attr.php");
18 include_once ("FDL/Class.DocFam.php");
19 
20 $usage = new ApiUsage();
21 $usage->setDefinitionText("Update attribute value for a document set");
22 $sObject = $usage->addRequiredParameter("objectFile", "serialized object");
23 $sArg = $usage->addRequiredParameter("argsFile", "serialized args");
24 $method = $usage->addRequiredParameter("method", "method to apply");
25 $statusFile = $usage->addRequiredParameter("statusFile", "status file output");
26 $usage->verify();
27 /*
28  * @var UpdateAttribute $ua
29  */
30 $ua = unserialize(file_get_contents($sObject));
31 $args = unserialize(file_get_contents($sArg));
32 
33 $ua->setStatusFile($statusFile);
34 switch ($method) {
35  case "addValue":
36  case "removeValue":
37  case "replaceValue":
38  case "setValue":
39  $s = $ua->dl->getSearchDocument();
40  $s->reset();
41  try {
42  call_user_func_array(array(
43  $ua,
44  $method
45  ) , $args);
46  }
47  catch(Exception $e) {
48  $ua->logStatus("ERROR:" . $e->getMessage());
49  $ua->logStatus("END");
50  }
51  break;
52 
53  default:
54  $ua->logStatus("ERROR:" . sprintf("method %s not available", $method));
55  $ua->logStatus("END");
56  $action->exitError(sprintf("method %s not available", $method));
57 }
58 ?>
global $action
if($famId) $s
$statusFile
$sObject
Verify arguments for wsh programs.
← centre documentaire © anakeen