- Timestamp:
- 2013-01-11T18:39:34+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/GlamED/trunk/src/org/honours/agents/ImportCollections.java
r26601 r26701 1 1 package org.honours.agents; 2 2 3 import java.awt.Color; 4 import java.awt.Point; 3 import java.awt.*; 5 4 import java.io.*; 6 5 import java.util.ArrayList; … … 9 8 import org.expeditee.actions.Misc; 10 9 import org.expeditee.agents.DefaultAgent; 10 import org.expeditee.items.*; 11 import org.expeditee.gui.Frame; 11 12 import org.expeditee.gui.*; 12 import org.expeditee.items.Item;13 import org.expeditee.items.Text;14 13 15 14 import org.honours.Main; 16 15 import org.honours.collection.*; 16 import org.honours.greenstone.CollectionConfigReader; 17 17 import org.honours.gui.*; 18 18 … … 69 69 } 70 70 71 /** 72 * TODO: Change this method so we only display the full name of the collection and the collection's description (the first 10 words). 73 * @param children 74 * @throws Exception 75 */ 71 76 private static void importEachCollection(String[] children) throws Exception{ 72 77 … … 120 125 121 126 for(Collection t : tempCollections){ 122 123 124 127 Main._collections.add(t); 125 128 } … … 199 202 private static void displayRowsOfLinks(String collectionName,Frame getFreeFrame, Point getFreePoint, String link) { 200 203 201 getFreeFrame.addText(getFreePoint.x, getFreePoint.y, collectionName, null,link); 202 203 //TODO: will need to change it so it runs an action - if a collection space does NOT 204 //exist it will be generated, otherwise user will just simply navigate to it. 205 getFreeFrame.addText(getFreePoint.x+250,getFreePoint.y,"View Collection Space",null,"collection-space-"+collectionName+"1"); 206 207 getFreeFrame.addText(getFreePoint.x+500,getFreePoint.y,"Export to GSDL","CollectionToGreenstone",link); 208 209 getFreeFrame.addText(getFreePoint.x+750,getFreePoint.y,"Complete Reimport", "OverwriteUpdate " + collectionName + "1"); 210 211 getFreeFrame.addText(getFreePoint.x+1000,getFreePoint.y,"Incremental Reimport","AddDeleteItemsOnlyUpdate " + collectionName + "1"); 204 CollectionConfigReader ccr = new CollectionConfigReader(collectionName); 205 206 String description = ccr.retrieveDescription(); 207 String fullCollName = ccr.retrieveFullCollectionName(); 208 209 if(fullCollName != null){ 210 getFreeFrame.addText(getFreePoint.x, getFreePoint.y, fullCollName, null, link); 211 }else{ 212 getFreeFrame.addText(getFreePoint.x, getFreePoint.y, collectionName, null, link); 213 } 214 215 //Display collection description retrieved from collectionConfig.xml file - only first 25 words if it's a long description. 216 if(description != null){ 217 description = description.replaceAll("\\<[^>]*>",""); 218 219 String[] descriptionWords = description.split(" "); 220 String outputDescription = ""; 221 222 if(descriptionWords.length > 25){ 223 224 for(int i = 0; i < 25; i++){ 225 outputDescription += descriptionWords[i] + " "; 226 } 227 outputDescription += "..."; 228 229 }else{ 230 outputDescription = description; 231 } 232 233 getFreeFrame.addText(getFreePoint.x+250, getFreePoint.y, outputDescription, null); 234 } 212 235 } 213 236
Note:
See TracChangeset
for help on using the changeset viewer.