Provides a high-level object used to manage various aspects of Berkeley DB XML usage. You use XML::Manager to perform activities such as container management (including creation and open), preparing XML::Query queries, executing one-off queries, creating transaction objects, creating update and query context objects
A XML::Manager object can be created with BDB::Env#manager
BDB::Transaction respond to the same method than BDB::XML::Manager
new(flags = 0)create_container(name, flags = 0, type = XML::Container::NodeContainer, mode = 0)create_documentcreate_modifycreate_query_context(rt = XML::Context::LiveValues, et = XML::Context::Eager)create_resultsbegin(flags = 0)create_update_contextdump_container(name, path)dump_container(name, io, to_close = false)envhomeload_container(name, path, update = nil)load_container(name, io, to_close = false, update = nil)open_container(name, flags = 0)prepare(query, context = nil)Compile a Query expression and return a new XML::Query object.
You can then use XML::Query#execute
query(query, context = nil) [{res| ... }Execute a query. If a block is given it will call Xml::Results#each for the results, or it will return an Xml::Results object
This is equivalent to call XML::Manager#prepare and then XML::Query#execute
resolver = objectRegister a resolver
A resolver is an object which can respond to #resolve_collection, #resolve_document, #resolve_entity, #resolve_schema, #resolve_module or #resolve_module_location
These methods (if implemented) must return nil if they can't resolve
def resolve_collection(txn_or_manager, uri)
Xml::Results.new
end
def resolve_document(txn_or_manager, uri)
Xml::Value.new
end
def resolve_entity(txn_or_manager, system_id, public_id)
'an object which respond to #read'
end
def resolve_schema(txn_or_manager, schema_location, namespace)
'an object which respond to #read'
end
def resolve_module(txn_or_manager, module_location, namespace)
'an object which respond to #read'
end
def resolve_module_location(txn_or_manager, namespace)
Xml::Results.new
end
remove_container(name)rename_container(old_name, new_name)container_flagscontainer_flags = flagscontainer_typecontainer_type = typecontainer_version(file)create_index_lookup(container, uri, name, index, value = nil, op = XML::IndexLookup::EQ)pagesizepagesize = sizereindex_container(name, context = nil, flags = 0)Reindex an entire container. The container should be backed up prior to using this method, as it destroys existing indexes before reindexing. If the operation fails, and your container is not backed up, you may lose information.
Use this call to change the type of indexing used for a container between document-level indexes and node-level indexes. This method can take a very long time to execute, depending on the size of the container, and should not be used casually.
sequence_increment = incrementsequence_incrementupdate_container(name, context = nil)verify_container(name, flags = 0)verify_container(name, path, flags = BDB::SALVAGE)verify_container(name, io, to_close = false, flags = BDB::SALVAGE)flagsimplicit_timezoneimplicit_timezone=(tz)compact_container(name, context = Xml::Context.new)truncate_container(name, context = XML::Context.new)