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_document
create_modify
create_query_context(rt = XML::Context::LiveValues, et = XML::Context::Eager)
create_results
begin(flags = 0)
create_update_context
dump_container(name, path)
dump_container(name, io, to_close = false)
env
home
load_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 = object
Register 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_flags
container_flags = flags
container_type
container_type = type
container_version(file)
create_index_lookup(container, uri, name, index, value = nil, op = XML::IndexLookup::EQ)
pagesize
pagesize = size
reindex_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 = increment
sequence_increment
update_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)
flags
implicit_timezone
implicit_timezone=(tz)
compact_container(name, context = Xml::Context.new)
truncate_container(name, context = XML::Context.new)