Hi Eric,
Shelver & Hydrangea are works in progress and will be changing substantially over the next 3 months. If possible, it would be best to wait for the Beta release around Open Repositories, which will be accompanied by documentation.
I recommend going through the ActiveFedora console tour. It will show you how to use active fedora to define object models, load fedora objects based on those models, add relationships, and save those objects. I have not updated it in a while. Let the list know if anything does not work properly.
Since you're using gsearch, you should turn off activefedora's solr indexing. Right now you do that by setting UPDATE_SOLR_INDEX = false somewhere in your code.
The latest version of active fedora supports custom mapping of metadata fields to solr field names. You could use that to get activefedora to use the gsearch-populated solr info as-is. As with Shelver and Hydrangea, this feature will be better documented in July but it is there now. If you want to explore, try tinkering with the solr_mappings.yml file in the config directory (either within your rails app or within the activefedora gem itself)
In the meantime, as far as search stuff, activefedora is written with the assumption that you will probably prefer to use something like RSolr to get directly at the solr index. You can rely on ActiveFedora's minimal methods, but eventually you will want to use a more task-specific library.
as far as your first item -- getting the pids of the objects in a specific pid prefix,
Fedora::Repository.instance.find_objects("pid~druid*",:limit=>20, :select => [:pid, :title]).each {|fo| puts "#{fo.pid}, #{fo.label} "}
Originally, find_objects gave you an option of grabbing the raw fedora response, but that seems to have disappeared as everyone has drifted in the direction of using higher level libraries. Instead, it returns a wrapper for the Fedora objects in the result set. As a result, the :select limiter doesn't really do much for you. Here is how you would iterate through the result set outputting the pid and the label for each object:
result = Fedora::Repository.instance.find_objects("pid~druid*",:limit=>20])
result.each do |fo|
puts "PID: #{fo.pid}, Label: #{fo.label} "
end
Getting the title is another issue, since that's metadata in a datastream. In that case, you should define an activefedora model corresponding to your objects and then use it to access the metadata.
class MyEADModel < ActiveFedora::Base
# Of course, you could just use the QualifiedDublinCoreDatastream class here, but I'm just giving an example
# Caveat: doing stuff with the DC datastream might break stuff. I recommend putting your descriptive metadata elsewhere.
has_metadata :name => "DC", :type => ActiveFedora::MetadataDatastream do |m|
m.field "title"
end
end
result = Fedora::Repository.instance.find_objects("pid~druid*",:limit=>20])
result.each do |fo|
ead_object = MyEADModel.load_instance(fo.pid)
puts ead_object.datastreams["DC"].title_values
end
There are numerous other ways to load objects from fedora, but this one spells out many of the low-level methods you could use.