Changeset 4827
- Timestamp:
- 2003-06-27T17:31:46+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/DocumentAction.java
r4718 r4827 137 137 } 138 138 139 boolean dummy_node = false; 139 140 if (get_structure || get_structure_info) { 140 141 … … 172 173 the_document.appendChild(doc_.importNode(structs.item(i), true)); 173 174 } 175 } else { 176 // no structure nodes, so put in a dummy doc node 177 Element doc_node = doc_.createElement(GSXML.DOC_NODE_ELEM); 178 doc_node.setAttribute(GSXML.NODE_ID_ATT, document_name); 179 the_document.appendChild(doc_node); 180 dummy_node = true; 174 181 } 175 182 } else { … … 178 185 doc_node.setAttribute(GSXML.NODE_ID_ATT, document_name); 179 186 the_document.appendChild(doc_node); 187 dummy_node = true; 180 188 } 181 189 … … 299 307 String modified_doc_id = dc_response_doc.getAttribute(GSXML.NODE_ID_ATT); 300 308 the_document.setAttribute("selectedNode", modified_doc_id); 301 // Merge the document content with the metadata and structure information 302 for (int i = 0; i < doc_nodes.getLength(); i++) { 303 Node dn = doc_nodes.item(i); 304 String dn_id = ((Element)dn).getAttribute(GSXML.NODE_ID_ATT); 305 if (dn_id.equals(modified_doc_id)) { 306 dn.appendChild(doc_.importNode(dc_response_doc_content, true)); 307 break; 309 if (dummy_node) { 310 // change the id if necessary and add the content 311 ((Element)doc_nodes.item(0)).setAttribute(GSXML.NODE_ID_ATT, modified_doc_id); 312 doc_nodes.item(0).appendChild(doc_.importNode(dc_response_doc_content, true)); 313 } else { 314 // Merge the document content with the metadata and structure information 315 for (int i = 0; i < doc_nodes.getLength(); i++) { 316 Node dn = doc_nodes.item(i); 317 String dn_id = ((Element)dn).getAttribute(GSXML.NODE_ID_ATT); 318 if (dn_id.equals(modified_doc_id)) { 319 dn.appendChild(doc_.importNode(dc_response_doc_content, true)); 320 break; 321 } 308 322 } 309 323 }
Note:
See TracChangeset
for help on using the changeset viewer.