Changeset 32075 for main/trunk
- Timestamp:
- 2017-11-16T15:11:39+13:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java
r32071 r32075 194 194 195 195 // work out doctype 196 // NOTE: this will be coming from collection database in index 197 // the archive file doesn't store this. So we have to assume 198 // that the doc type will not be changing with any 199 // modifications happening to archives. 200 201 // if doc type is null, then we need to work it out. 196 202 // create a basic doc list containing the current node 197 Element basic_doc_list = doc.createElement(GSXML.DOC_NODE_ELEM + GSXML.LIST_MODIFIER); 198 Element current_doc = doc.createElement(GSXML.DOC_NODE_ELEM); 199 basic_doc_list.appendChild(current_doc); 200 current_doc.setAttribute(GSXML.NODE_ID_ATT, document_id); 201 basic_doc_list.appendChild(current_doc); 203 202 204 if (document_type == null) { 203 document_type = getDocumentType(basic_doc_list, collection, userContext, page_response); 205 Element basic_doc_list = doc.createElement(GSXML.DOC_NODE_ELEM + GSXML.LIST_MODIFIER); 206 Element current_doc = doc.createElement(GSXML.DOC_NODE_ELEM); 207 basic_doc_list.appendChild(current_doc); 208 current_doc.setAttribute(GSXML.NODE_ID_ATT, document_id); 209 basic_doc_list.appendChild(current_doc); 210 document_type = getDocumentType(basic_doc_list, collection, userContext, page_response); 204 211 } 212 205 213 if (document_type == null) { 206 214 logger.debug("@@@ doctype is null, setting to simple"); 207 215 document_type = GSXML.DOC_TYPE_SIMPLE; 208 216 } 209 210 Element doc_elem = doc.createElement(GSXML.DOCUMENT_ELEM); 217 218 Element doc_elem = doc.createElement(GSXML.DOCUMENT_ELEM); 211 219 doc_elem.setAttribute(GSXML.DOC_TYPE_ATT, document_type); 212 220 page_response.appendChild(doc_elem); 213 section.setAttribute(GSXML.NODE_ID_ATT, document_id); 214 215 221 216 222 Element transformed_section = transformArchiveToDocument(section); 223 if (document_type == GSXML.DOC_TYPE_SIMPLE) { 224 // simple doc, only returning a single document node, which is the top level section. 225 doc_elem.setAttribute(GSXML.NODE_ID_ATT, document_id); 226 GSXML.mergeElements(doc_elem, transformed_section); 227 return result; 228 } 229 230 // multi sectioned document. 231 transformed_section.setAttribute(GSXML.NODE_ID_ATT, document_id); 217 232 // In docEdit mode, we obtain the text from archives, from doc.xml 218 233 // Now the transformation has replaced <Section> with <documentNode>
Note:
See TracChangeset
for help on using the changeset viewer.