Hi, Minnie.

If you're willing to try Python instead of PHP, you should be able to
accomplish what you're trying to do pretty easily with eulfedora (a Python
module we created at Emory University Libraries for interacting with
Fedora - https://github.com/emory-libraries/eulfedora ).

If you've already got Python installed, you can use pip or easy_install to
get the latest version (`easy_install eulfedora` or possibly `sudo
easy_install eulfedora`).  The current version has been tested with Fedora
3.4.x and 3.5; it looks like the REST APIs have changed much in 3.6, so it
should work there too.

We've actually got an example in our documentation that I think might be
fairly similar to what it sounds like you're trying to do:

http://eulfedora.readthedocs.org/en/latest/tutorials/examples.html#bulk-pur
ging-test-objects-via-console


Your find and purge script might look something roughly like this:

from eulfedora.server import Repository

repo = Repository('http://your.fedora.server:8080/fedora/',
username='fedora_user',
  password='fedora_password')

for obj in repo.find_objects(label__contains='test*'):
    repo.purge_object(obj.pid)

If you can't or don't want to use Python, you might want to consider using
Fedora's REST APIs instead of SOAP; the last time I worked with PHP + SOAP
there were non-obvious bugs in PHP that made things a lot more difficult
(e.g., incorrect encoding of null values).


Hope this helps,
Rebecca


________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fedora-commons-users mailing list
Fedora-commons-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users

Reply via email to