Changeset 25551 for main/trunk/greenstone3/src/java
- Timestamp:
- 2012-05-09T13:53:19+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSDocumentModel.java
r25542 r25551 130 130 return; 131 131 } 132 132 133 133 //If the collection is not specified then we cannot continue 134 134 if (oid == null || oid.equals("")) … … 153 153 if (!section) 154 154 { 155 File newDir = new File(_siteHome + File.separatorChar + "collect" + File.separatorChar + collection + File.separatorChar + "archives" + File.separatorChar + oid);156 157 if (!newDir.exists())158 {159 newDir.mkdir();160 }161 162 HashMap<String, ArrayList<String>> entries = new HashMap<String, ArrayList<String>>();163 ArrayList<String> values = new ArrayList<String>();164 values.add(oid + "/doc.xml");165 entries.put("doc-file", values);166 167 //Write the new entry to the archive database168 archiveWriteEntryToDatabase(oid, collection, entries, userContext);169 if (_errorStatus != NO_ERROR)170 {171 return;172 }173 174 155 //Create a basic doc.xml file to go in the new folder 175 156 documentXMLCreateDocXML(oid, collection, userContext); … … 398 379 return; 399 380 } 400 381 401 382 if (move) 402 383 { … … 676 657 { 677 658 String s = File.separator; 678 659 679 660 String docFolderPath = _siteHome + s + "collect" + s + collection + s + "import" + s + oid; 680 661 File docFolder = new File(docFolderPath); 681 662 682 663 if (!docFolder.exists()) 683 664 { 684 if (!docFolder.mkdirs())665 if (!docFolder.mkdirs()) 685 666 { 686 667 _errorStatus = ERROR_DOC_XML_COULD_NOT_BE_CREATED; … … 688 669 } 689 670 } 690 671 691 672 File docFile = new File(docFolderPath + s + "doc.xml"); 692 if (!docFile.exists() && !docFile.createNewFile())673 if (!docFile.exists() && !docFile.createNewFile()) 693 674 { 694 675 _errorStatus = ERROR_DOC_XML_COULD_NOT_BE_CREATED; … … 1262 1243 } 1263 1244 } 1264 1245 1265 1246 //Write the new change back into the file 1266 1247 if (!writeXMLFile(docXML, oid, collection, userContext)) … … 1623 1604 return; 1624 1605 } 1606 1625 1607 coll_db.setInfo(oid, info); 1626 1608 coll_db.closeDatabase(); … … 2079 2061 } 2080 2062 } 2081 2063 2082 2064 public int getErrorStatus() 2083 2065 {
Note:
See TracChangeset
for help on using the changeset viewer.