1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
=begin
== BDB::XML::Container
The XML::Container class encapsulates a document container and its
related indices and statistics. XML::Container exposes methods for
managing (putting and deleting) XML::Document objects, managing indices,
and retrieving container statistics.
Module included : Enumerable
=== Methods
--- delete(doc_or_name, context = nil)
Remove the document from the container
: ((|doc_or_name|))
doc_or_name is an ((|BDB::XML::Document|)) previously stored,
or the name of an existent document
: ((|context|))
an optional Update context
--- index?
Returns true if the container is configured to create node indexes.
--- manager
return the current manager for the container, or ((|nil|))
--- pagesize
Returns true if the container is configured to create node indexes.
--- each {|doc| ... }
Iterate over all documents
--- self[id]
Fetch the document from the container
: ((|id|))
the id assigned to the document when it was first added to a container
: ((|flags|))
flags can has the value 0 or ((|BDB::DIRTY_READ|)), ((|BDB::RMW|))
--- get(id, flags = 0)
same than ((| self[id]|))
--- self[id] = document
Replace the document (see also #update)
--- index = index
set the indexing : ((|index|)) must be an ((|XML::Index|)) object
--- index
Retrieve the ((|BDB::XML::Index|))
Return ((|nil|)) if no indexing was specified
--- add_index(uri, name, index, context = nil)
--- add_index(uri, name, type, syntax, context = nil)
Add a new index : this is a convenient method. See ((|XML::Index#add|))
--- add_default_index(index, context = nil)
Add default index : this is a convenient method. See ((|XML::Index#add_default|))
--- delete_index(index, context = nil)
Delete an index : this is a convenient method. See ((|XML::Index#delete|))
--- delete_default_index(index, context = nil)
Delete default index : this is a convenient method. See ((|XML::Index#delete_default|))
--- replace_index(index, context = nil)
Replace an index : this is a convenient method. See ((|XML::Index#replace|))
--- replace_default_index(index, context = nil)
Replace default index : this is a convenient method. See ((|XML::Index#replace_default|))
--- name
return the name of the container
--- type
Return the type of the container
--- put(document, flags = 0)
Add a document to the container and return an ID
: ((|document|))
an object ((|BDB::XML::Document|))
: ((|flags|))
flags can be 0 or ((|BDB::XML::GEN_NAME|))
--- transaction
return the transaction associated with the container, or ((|nil|))
--- in_transaction?
return ((|true|)) if the container is associated with a transaction
--- transaction?
same than ((| in_transaction?|))
--- update(document, context = nil)
Update a document within the container
: ((|document|))
an XML::Document to be updated
: ((|context|))
an optional Update context
--- sync
Flush database pages for the container to disk
--- flags
Get the flags used to open the container.
--- node(handle, flags = 0)
Get the specified node.
: ((|handle|))
must be obtained using XML::Value.node_handle
: ((|flags|))
must be set to 0 or, ((|BDB::READ_UNCOMMITED|))
((|BDB::READ_UNCOMMITED|)), ((|BDB::RMW|))
((|BDB::XML::LAZY_DOCS|))
--- event_writer(document, update_context, flags = 0)
Begins insertion of an ((|XML::Document|)) into the container through use of an
((|XML::EventWriter|)) object.
Return the ((|XML::EventWriter|)) which must be closed at end.
=end
|