Commit f39cc07729709e47896e1c43da92b13ac5c177f5

Authored by Megan Watson
1 parent f274b6db

KTC-752 Changed the Java to accept a filename as input instead of streaming the content.

"Guid Inserter seems to corrupt certain documents"
In progress.

Committed by: Megan Watson
bin/luceneserver/ktlucene.jar
No preview for this file type
search2/indexing/lib/XmlRpcLucene.inc.php
... ... @@ -337,55 +337,47 @@ class XmlRpcLucene
337 337 }
338 338  
339 339 /**
340   - * Write custom properties into the document content
  340 + * Writes a given set of custom properties to a document
341 341 *
342   - * @param stream $content
343   - * @param array $properties
344   - * @return boolean
  342 + * @param string $sourceFile The full path to the document
  343 + * @param string $targetFile The full path to the target / output file
  344 + * @param array $properties Associative array of the properties to be added
  345 + * @return boolean true on success | false on failure
345 346 */
346   - function writeProperties($content, $properties)
  347 + function writeProperties($sourceFile, $targetFile, $properties)
347 348 {
348   - $function = new xmlrpcmsg('metadata.writeCustomProperties',
  349 + $function = new xmlrpcmsg('metadata.writeProperty',
349 350 array(
350   - new xmlrpcval($content, 'base64'),
351   - new xmlrpcval("mimetype placeholder", "string"),
  351 + php_xmlrpc_encode((string) $sourceFile),
  352 + php_xmlrpc_encode((string) $targetFile),
352 353 php_xmlrpc_encode($properties)
353 354 ));
354 355  
355 356 $result =& $this->client->send($function);
356 357  
357   - unset($content);
358   -
359 358 if($result->faultCode()) {
360 359 $this->error($result, 'writeProperties');
361 360 return false;
362 361 }
363 362  
364   - $obj = php_xmlrpc_decode($result->value());
365   -
366   - if($obj['status'] != '0') {
367   - return false;
368   - }
369   - return $obj['data'];
  363 + return php_xmlrpc_decode($result->value()) == 0;
370 364 }
371 365  
372 366 /**
373   - * Read the document properties
  367 + * Read the custom document properties
374 368 *
375   - * @param stream $content
376   - * @return unknown
  369 + * @param string $sourceFile The full path to the document
  370 + * @return array The properties as an associative array | False on failure
377 371 */
378   - function readProperties($content)
  372 + function readProperties($sourceFile)
379 373 {
380   - $function = new xmlrpcmsg('metadata.readMetaData',
  374 + $function = new xmlrpcmsg('metadata.readMetadata',
381 375 array(
382   - new xmlrpcval($content, 'base64')
  376 + php_xmlrpc_encode((string) $sourceFile)
383 377 ));
384 378  
385 379 $result =& $this->client->send($function);
386 380  
387   - unset($buffer);
388   -
389 381 if($result->faultCode()) {
390 382 $this->error($result, 'readProperties');
391 383 return false;
... ...