Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
popfilemodules:xmlrpc [2009/09/06 16:10] – update for current version amatubupopfilemodules:xmlrpc [2010/09/09 17:46] – get_buckets returns ARRAY amatubu
Line 148: Line 148:
 # #
        
-my $sk = $xml->call("POPFile/API.get_session_key",'admin',//);+my $sk = $xml->call("POPFile/API.get_session_key",'admin','');
 my $key = $sk->result; my $key = $sk->result;
 my $method = "POPFile/API.$ARGV[0]"; my $method = "POPFile/API.$ARGV[0]";
Line 169: Line 169:
     print join ("\n","TRANSPORT ERROR: ", $xml->transport->status);       print join ("\n","TRANSPORT ERROR: ", $xml->transport->status);  
 } else  { } else  {
-    print join ("\n",$res->paramsall);+    if ( ref $res->paramsall eq 'ARRAY' ) { 
 +        print join "\n", @{$res->paramsall}; 
 +    } else { 
 +        print $res->paramsall; 
 +    }
 } }
 +print "\n";
  
 # #
Line 243: Line 248:
  
 # say hello and get a session key # say hello and get a session key
-my $sk = $xmlrpc-> call('POPFile/API.get_session_key','admin',//)+my $sk = $xmlrpc-> call('POPFile/API.get_session_key','admin','')
  -> result;  -> result;
  
Line 278: Line 283:
 ||handle_message||<code>call('POPFile/API.handle_message', 'session_key', 'inputfilename', 'outputfilename')</code>  returns bucketname, the history slot-id, and a Boolean specifying whether a magnet was used for classification, similar to classify but adds message to POPFile history and writes message with POPFile headers to output file. **Note, there is a known issue with this call. It presently adds a . and 0x0d0a to the end of output file.**|| ||handle_message||<code>call('POPFile/API.handle_message', 'session_key', 'inputfilename', 'outputfilename')</code>  returns bucketname, the history slot-id, and a Boolean specifying whether a magnet was used for classification, similar to classify but adds message to POPFile history and writes message with POPFile headers to output file. **Note, there is a known issue with this call. It presently adds a . and 0x0d0a to the end of output file.**||
 ||get_buckets ||<code>call('POPFile/API.get_buckets','session_key')</code> returns an array of bucket names (exclude 'unclassified' bucket)|| ||get_buckets ||<code>call('POPFile/API.get_buckets','session_key')</code> returns an array of bucket names (exclude 'unclassified' bucket)||
 +||get_pseudo_buckets ||<code>call('POPFile/API.get_pseudo_buckets','session_key')</code> returns an array of pseudo-bucket names ('unclassified' bucket)||
 +||get_all_buckets ||<code>call('POPFile/API.get_all_buckets','session_key')</code> returns an array of bucket names (include 'unclassified' bucket)||
 +||is_bucket ||<code>call('POPFile/API.is_bucket','session_key', 'bucketname')</code> returns 1 if the bucketname exists, returns 0 if the bucketname does not exist, or the bucketname is a pseudo-bucket ('unclassified' bucket)||
 +||is_pseudo_bucket ||<code>call('POPFile/API.is_pseudo_bucket','session_key', 'bucketname')</code> returns 1 if the bucketname exists and it is a pseudo-bucket ('unclassified' bucket), returns 0 if the bucketname does not exist, or the bucketname is not a pseudo-bucket||
 ||get_bucket_word_count  ||<code>call('POPFile/API.get_bucket_word_count', 'session_key', 'bucketname')</code> returns word count of bucket|| ||get_bucket_word_count  ||<code>call('POPFile/API.get_bucket_word_count', 'session_key', 'bucketname')</code> returns word count of bucket||
 ||get_bucket_word_list||<code>call('POPFile/API.get_bucket_word_list', 'session_key', 'bucketname')</code> returns array of words found in bucket|| ||get_bucket_word_list||<code>call('POPFile/API.get_bucket_word_list', 'session_key', 'bucketname')</code> returns array of words found in bucket||
 +||get_bucket_word_prefixes||<code>call('POPFile/API.get_bucket_word_prefixes', 'session_key', 'bucketname')</code> returns array of initial letters for words found in bucket||
 +||get_count_for_word||<code>call('POPFile/API.get_cont_for_word', 'session_key', 'bucketname', 'someword')</code> returns word count for someword in bucket||
 ||get_word_count ||<code>call('POPFile/API.get_word_count','session_key')</code> returns word count of all buckets combined|| ||get_word_count ||<code>call('POPFile/API.get_word_count','session_key')</code> returns word count of all buckets combined||
 ||get_bucket_unique_count||<code>call('POPFile/API.get_bucket_unique_count', 'session_key', 'bucketname')</code> returns unique words in bucket|| ||get_bucket_unique_count||<code>call('POPFile/API.get_bucket_unique_count', 'session_key', 'bucketname')</code> returns unique words in bucket||
Line 290: Line 301:
 ||delete_bucket||<code>call('POPFile/API.delete_bucket', 'session_key', 'bucketname')</code> returns 1 if succeeded. Note that you cannot delete 'unclassified' bucket|| ||delete_bucket||<code>call('POPFile/API.delete_bucket', 'session_key', 'bucketname')</code> returns 1 if succeeded. Note that you cannot delete 'unclassified' bucket||
 ||rename_bucket||<code>call('POPFile/API.rename_bucket', 'session_key', 'bucketname', 'newname')</code> returns 0 on failure, 1 on success|| ||rename_bucket||<code>call('POPFile/API.rename_bucket', 'session_key', 'bucketname', 'newname')</code> returns 0 on failure, 1 on success||
-||add_message_to_bucket||<code>call('POPFile/API.add_message_to_bucket', 'session_key', 'bucketname', 'filename')</code> Train POPFile with mail files (reclassify the mail file to bucketname). Returns 0 on failure, 1 on success, note that filename must exist in the popfile directory or the full path must be specified||+||add_message_to_bucket||<code>call('POPFile/API.add_message_to_bucket', 'session_key', 'bucketname', 'filename')</code> Train POPFile with mail file (reclassify mail file to bucketname). Returns 0 on failure, 1 on success, note that filename must exist in the popfile directory or the full path must be specified|| 
 +||add_messages_to_bucket||<code>call('POPFile/API.add_messages_to_bucket', 'session_key', 'bucketname', 'filelist')</code> Train POPFile with mail files (reclassify mail files to bucketname). Returns 0 on failure, 1 on success, note that filenames must exist in the popfile directory or the full path must be specified||
 ||remove_message_from_bucket ||<code>call('POPFile/API.remove_message_from_bucket', 'session_key', 'bucketname', 'filename')</code> Undo training POPFile. Returns 0 on failure, 1 on success, note that filename must exist in the popfile directory or the full path must be specified|| ||remove_message_from_bucket ||<code>call('POPFile/API.remove_message_from_bucket', 'session_key', 'bucketname', 'filename')</code> Undo training POPFile. Returns 0 on failure, 1 on success, note that filename must exist in the popfile directory or the full path must be specified||
-||get_buckets_with_magnets ||<code>call('POPFile/API.get_buckets_with_magnets', 'session_key',)</code> returns array of bucket names specified by any magnets ||+||magnet_count ||<code>call('POPFile/API.magnet_count', 'session_key')</code> returns magnet count of all bucket combined || 
 +||get_buckets_with_magnets ||<code>call('POPFile/API.get_buckets_with_magnets', 'session_key')</code> returns array of bucket names specified by any magnets ||
 ||get_magnet_types_in_bucket ||<code>call('POPFile/API.get_magnet_types_in_bucket', 'session_key', 'bucketname')</code> returns array of magnet types for the bucket || ||get_magnet_types_in_bucket ||<code>call('POPFile/API.get_magnet_types_in_bucket', 'session_key', 'bucketname')</code> returns array of magnet types for the bucket ||
 ||clear_bucket||<code>call('POPFile/API.clear_bucket', 'session_key', 'bucketname')</code> empties the bucket. Returns 1 if succeeded|| ||clear_bucket||<code>call('POPFile/API.clear_bucket', 'session_key', 'bucketname')</code> empties the bucket. Returns 1 if succeeded||
 ||clear_magnets||<code>call('POPFile/API.clear_magnets','session_key')</code> removes all magnets. Returns 1 if succeeded|| ||clear_magnets||<code>call('POPFile/API.clear_magnets','session_key')</code> removes all magnets. Returns 1 if succeeded||
 ||get_magnets||<code>call('POPFile/API.get_magnets', 'session_key', 'bucketname', 'type')</code> returns array of magnets of the specified type for the bucket || ||get_magnets||<code>call('POPFile/API.get_magnets', 'session_key', 'bucketname', 'type')</code> returns array of magnets of the specified type for the bucket ||
-||create_magnet||<code>call('POPFile/API.create_magnet', 'session_key', 'bucketname', 'magnettype', 'magnetvalue')</code> Creates a new magnet. Returns 1 if succeeded||+||create_magnet||<code>call('POPFile/API.create_magnet', 'session_key', 'bucketname', 'magnettype', 'magnetvalue')</code> creates a new magnet. Returns 1 if succeeded||
 ||get_magnet_types||<code>call('POPFile/API.get_magnet_types','session_key')</code> returns a hash list of valid POPFile magnet types and mail headers|| ||get_magnet_types||<code>call('POPFile/API.get_magnet_types','session_key')</code> returns a hash list of valid POPFile magnet types and mail headers||
-||delete_magnet||<code>call('POPFile/API.delete_magnet', 'session_key', 'bucketname', 'magnettype','magnetvalue')</code> Deletes the magnet. Returns 1 if succeeded||+||delete_magnet||<code>call('POPFile/API.delete_magnet', 'session_key', 'bucketname', 'magnettype','magnetvalue')</code> deletes the magnet. Returns 1 if succeeded||
 ||get_stopword_list||<code>call('POPFile/API.get_stopword_list','session_key')</code> returns array of stop words || ||get_stopword_list||<code>call('POPFile/API.get_stopword_list','session_key')</code> returns array of stop words ||
 ||add_stopword||<code>call('POPFile/API.add_stopword', 'session_key', 'mystopword')</code> adds a word to stop words. Returns 0 if failed, 1 if succeeded|| ||add_stopword||<code>call('POPFile/API.add_stopword', 'session_key', 'mystopword')</code> adds a word to stop words. Returns 0 if failed, 1 if succeeded||
 
popfilemodules/xmlrpc.txt · Last modified: 2010/09/09 19:46 by 127.0.0.1
Old revisions

Should you find anything in the documentation that is incomplete, unclear, outdated or just plain wrong, please let us know and leave a note in the Documentation Forum.

Recent changes RSS feed Donate Driven by DokuWiki
The content of this wiki is protected by the GNU Fee Documentation License