Changeset 26698
- Timestamp:
- 2013-01-11T18:35:45+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/GlamED/trunk/src/org/honours/greenstone/CollectionContentEditor.java
r26588 r26698 27 27 List<Item> items = _collectionItem.getFrame().getItems(); 28 28 boolean noChange = true; 29 ArchiveFileReader afr = new ArchiveFileReader(_collectionItem.getDocXML()); 29 30 30 31 for(Item item : items){ … … 33 34 if(item.isAnnotation()){ 34 35 //TODO: Deal with annotation items correctly. 36 35 37 }else{ 36 38 37 39 Text text = (Text)item; 38 39 ArchiveFileReader afe = new ArchiveFileReader(_collectionItem.getDocXML()); 40 40 41 41 if(text.getData() != null) 42 42 if(text.getData().size() > 0){ 43 String elemText = af e.obtainElementText(text.getData().get(0));43 String elemText = afr.obtainElementText(text.getData().get(0)); 44 44 45 45 if(!elemText.equals(null)){ … … 53 53 if(!noChange) 54 54 _archiveFileEditor.editArchiveDocFile(text); 55 55 56 } 56 57 }else if(item instanceof Picture){ … … 58 59 } 59 60 } 61 62 noChange = writeFrameID(afr,noChange); 60 63 61 64 //addNotes(); … … 65 68 } 66 69 70 /** 71 * Method for adding/editing the framID metadata value 72 * @param afr 73 * @param noChange 74 */ 75 private boolean writeFrameID(ArchiveFileReader afr, boolean noChange){ 76 77 //Write code to write frame number. 78 String frameID = afr.obtainElementText("frameID"); 79 String currentFrameID = Integer.toString(_collectionItem.getFrame().getNumber()); 80 Text frameIDtext = null; 81 82 if(frameID == null){ 83 //create a new frameID element 84 frameIDtext = new Text(currentFrameID); 85 frameIDtext.setData("frameID"); 86 87 }else{ 88 //check if frameID is the same as the current frame name/number. 89 if(!frameID.equals(currentFrameID)){ 90 91 frameIDtext = new Text(currentFrameID); 92 frameIDtext.setData("frameID"); 93 94 } 95 96 } 97 98 if(frameIDtext != null){ 99 _archiveFileEditor.editArchiveDocFile(frameIDtext); 100 noChange = false; 101 } 102 103 return noChange; 104 } 105 106 /** 107 * Method to output any notes associated with an item to the 108 * doc.xml file. 109 */ 67 110 private void addNotes() { 68 111 //Add notes to docXML file.
Note:
See TracChangeset
for help on using the changeset viewer.