Changeset 8388
- Timestamp:
- 2004-10-20T15:38:07+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/gems
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gems/GEMS.java
r8375 r8388 87 87 static final private String SET = "set"; 88 88 static final private String VALUES = "values"; 89 89 // static final public String MAX_LOADED_SETS = 64; 90 90 static public Configuration config = null; 91 static private MetadataSetManager msm = new MetadataSetManager();91 private MetadataSetManager msm = new MetadataSetManager(this); 92 92 93 93 public AddElementActionListener add_element_action_listener = null; … … 150 150 private String current_collection_file = null; 151 151 private String dialog_options[] = null; 152 152 153 153 154 154 static public void main(String[] args) … … 179 179 // Load configuration file 180 180 try { 181 181 182 config = new Configuration(go.gsdl_path, null, go.exec_path, go.perl_path, false, null); 182 183 } … … 184 185 DebugStream.printStackTrace(exception); 185 186 } 186 187 new GEMS();187 GEMS gems; 188 gems = new GEMS(); 188 189 } 189 190 … … 238 239 JPanel mds_tree_pane = new JPanel(); 239 240 mds_tree_pane.setOpaque(false); 240 mds_tree_pane.setPreferredSize(new Dimension(2 00,500));241 mds_tree_pane.setPreferredSize(new Dimension(250,500)); 241 242 mds_tree = new SmarterTree(model); 242 243 mds_tree.setCellRenderer(new MEMTreeCellRenderer()); … … 564 565 content_pane.add(button_pane, BorderLayout.SOUTH); 565 566 567 // initialise the selection 568 mds_tree.setSelectionRow(0); 566 569 // Display 567 570 setLocation((screen_size.width - SIZE.width) / 2, (screen_size.height - SIZE.height) / 2); … … 573 576 { 574 577 // Flush debug 575 System.out.println("Final exit func");578 //System.out.println("Final exit func"); 576 579 DebugStream.closeDebugStream(); 577 580 if(set_changed == true) { 581 582 int result = JOptionPane.showOptionDialog(self, Dictionary.get("Gems.Menu.Confirm_Exit_Save", Dictionary.get("MEM.Element")), Dictionary.get("Gems.Menu.Confirm_Exit_Save_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]); 583 584 // System.out.println("Exit: "+result); 585 if(result == 0) { 586 msm.save(); 587 } 588 589 } 590 578 591 System.exit(0); 579 592 } … … 636 649 // Layout (file menu) 637 650 file.add(file_new); 638 file.add(file_open);651 //file.add(file_open); 639 652 file.add(file_save); 640 653 file.add(file_delete); … … 708 721 MetadataSet metadata_set = msm.loadMetadataSet(metadata_set_file_chooser.getSelectedFile()); 709 722 // Update tree 710 model.add(null, metadata_set, GEMSNode.SET); 711 } 712 set_changed = true; 723 //only update tree if the metadata_set return is not null(it will be null if set is already 724 //opened-Attila - oct 19 0 4 725 if(metadata_set != null) { 726 model.add(null, metadata_set, GEMSNode.SET); 727 } 728 } 729 713 730 return; 714 731 } … … 723 740 // File -> Exit 724 741 if (event_source == file_exit) { 725 742 exit(); 743 /* 726 744 if(set_changed == true) { 727 745 int result = JOptionPane.showOptionDialog(self, Dictionary.get("Gems.Menu.Confirm_Exit_Save", Dictionary.get("MEM.Element")), Dictionary.get("Gems.Menu.Confirm_Exit_Save_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]); 728 746 729 System.out.println("Exit: "+result);747 // System.out.println("Exit: "+result); 730 748 if(result == 0) { 731 749 msm.save(); … … 740 758 741 759 exit(); 742 } 760 }*/ 743 761 } 744 762 … … 854 872 } 855 873 } 856 874 //callback method 875 protected void processWindowEvent(WindowEvent evt){ 876 877 if(evt.getID() == WindowEvent.WINDOW_CLOSING){ 878 879 exit(); 880 } 881 882 883 } 884 //called from MetadataSetManager...I don't think it should be here anymore, but for now it's ok 885 886 public void warn_cant_load_set(){ 887 JOptionPane.showMessageDialog(self, Dictionary.get("Gems.Already_Loaded_Set_Error"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 888 889 } 857 890 public void dispose() { 891 892 893 //if anything has changed, warn user that they should save 894 if(set_changed == true) { 895 896 int result = JOptionPane.showOptionDialog(self, Dictionary.get("Gems.Menu.Confirm_Exit_Save", Dictionary.get("MEM.Element")), Dictionary.get("Gems.Menu.Confirm_Exit_Save_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]); 897 // System.out.println("Exit: "+result); 898 if(result == 0) { 899 msm.save(); 900 901 } 902 } 903 set_changed = false; 858 904 // Destructor 859 905 card_layout = null; … … 896 942 } 897 943 remove_set_action_listener = null; 944 945 //close 898 946 super.dispose(); 899 947 } … … 961 1009 //LanguageManager languageManager = new LanguageManager(org.w3c.dom.Element()); 962 1010 963 System.out.println("f");1011 964 1012 // !!! language_box.setRenderer(new LanguageListCellRenderer()); 965 1013 Dictionary.setTooltip(language_box, "MEM.Attribute_Language_Tooltip"); … … 1076 1124 // Name combo box is enabled except when attributes are edited 1077 1125 //name.setEnabled((source != edit_attribute)); 1078 System.out.println("elsed");1126 //System.out.println("elsed"); 1079 1127 name_to_values.clear(); 1080 1128 name.clear(); … … 1167 1215 } 1168 1216 // Now pritty up the dialog depending on the action type 1169 if(source == add_attribute || source == popupListener.menuAddAttribute Element || source == popupListener.menuAddAttributeAttribute) {1217 if(source == add_attribute || source == popupListener.menuAddAttributeSet || source == popupListener.menuAddAttributeElement || source == popupListener.menuAddAttributeAttribute) { 1170 1218 add_type = true; 1171 1219 Dictionary.setText(this, "MEM.AddAttribute"); … … 1357 1405 center_pane.setOpaque(false); 1358 1406 1359 JPanel set_pane = new JPanel();1360 set_pane.setOpaque(false);1407 JPanel labels_pane = new JPanel(); 1408 labels_pane.setOpaque(false); 1361 1409 JLabel set_label = new JLabel(); 1362 1410 set_label.setOpaque(false); … … 1365 1413 set_field.setOpaque(false); 1366 1414 1367 JPanel name_pane = new JPanel();1368 name_pane.setOpaque(false);1415 JPanel values_pane = new JPanel(); 1416 values_pane.setOpaque(false); 1369 1417 JLabel name_label = new JLabel(); 1370 1418 name_label.setOpaque(false); … … 1395 1443 1396 1444 // Layout 1397 set_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));1398 set_pane.setLayout(new BorderLayout());1399 set_pane.add(set_label, BorderLayout.WEST);1400 set_pane.add(set_field, BorderLayout.CENTER);1401 1402 name_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));1403 name_pane.setLayout(new BorderLayout(5,0));1404 name_pane.add(name_label, BorderLayout.WEST);1405 name_pane.add(name_field, BorderLayout.CENTER);1406 1407 center_pane.setLayout(new GridLayout(2,1,0,0));1408 center_pane.add( set_pane);1409 center_pane.add( name_pane);1445 labels_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0)); 1446 labels_pane.setLayout(new GridLayout(2,1)); 1447 labels_pane.add(set_label); 1448 labels_pane.add(name_label); 1449 1450 values_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0)); 1451 values_pane.setLayout(new GridLayout(2,1)); 1452 values_pane.add(set_field); 1453 values_pane.add(name_field); 1454 1455 center_pane.setLayout(new BorderLayout(5,5)); 1456 center_pane.add(labels_pane, BorderLayout.WEST); 1457 center_pane.add(values_pane, BorderLayout.CENTER); 1410 1458 1411 1459 button_pane.setLayout(new GridLayout(1,2,0,5)); … … 1446 1494 // Otherwise show an error message and do not proceed. 1447 1495 else { 1448 JOptionPane.showMessageDialog(self, Dictionary.get(" MEM.Element_Already_Exists"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);1496 JOptionPane.showMessageDialog(self, Dictionary.get("Gems.Element_Already_Exists"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 1449 1497 } 1450 1498 name_str = null; … … 1465 1513 // Warn the user that they can't do that dave. 1466 1514 else { 1515 set_changed = false; 1467 1516 JOptionPane.showMessageDialog(self, Dictionary.get("MEM.Cannot_Add_Elements_To_Greenstone_MDS"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 1468 1517 } … … 1471 1520 source = null; 1472 1521 } 1473 1522 1474 1523 public void dispose() { 1475 1524 cancel_button = null; … … 1691 1740 if(msm.getSet(name_str) == null) { 1692 1741 MetadataSet set = msm.addSet(namespace_str, name_str); 1742 File mds_file = new File(Utility.METADATA_DIR, namespace_str + ".mds"); 1743 set.setFile(mds_file); 1693 1744 // Update tree. 1694 1745 model.add(null, set, GEMSNode.SET); … … 2088 2139 public void actionPerformed(ActionEvent event) { 2089 2140 if(current_set != null) { 2141 2142 //If the current_set_filename is dls or dc or ex and in the METADATA_DIR, then do 2143 //not let anyone remove them --Attila 2144 // System.out.println(current_set.getName()); 2145 // 2146 2147 File current_set_filename = current_set.getFile(); 2148 // System.out.println(current_set_filename.toString()); 2149 2150 if(current_set_filename.toString().compareTo(new String(Utility.METADATA_DIR+"dls.mds")) == 0 || 2151 current_set_filename.toString().compareTo(new String(Utility.METADATA_DIR+"dc.mds")) == 0 || 2152 current_set_filename.toString().compareTo(new String(Utility.METADATA_DIR+"ex.mds")) == 0){ 2153 2154 JOptionPane.showMessageDialog(self, Dictionary.get("Gems.Cannot_Delete_Core_Sets_Error"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 2155 return; 2156 } 2157 2158 2090 2159 int result = JOptionPane.showOptionDialog(self, Dictionary.get("MEM.Confirm_Removal", Dictionary.get("MEM.Set")), Dictionary.get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]); 2091 2160 // Remove the currently selected set … … 2348 2417 JMenuItem menuRenameSet; 2349 2418 JMenuItem menuAddElement; 2350 2419 JMenuItem menuAddAttributeSet; 2420 2351 2421 JMenuItem menuRenameSubfield; 2352 2422 JMenuItem menuDeleteSubfield; … … 2370 2440 static final public int SET = 4; 2371 2441 PopupListener() { 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2442 setPopup = new JPopupMenu(); 2443 subfieldPopup = new JPopupMenu(); 2444 elementPopup = new JPopupMenu(); 2445 attributePopup = new JPopupMenu(); 2446 2447 2448 //create the MenuItems 2449 2450 //set related popups 2451 menuAddSet = new JMenuItem(); 2382 2452 Dictionary.setText(menuAddSet,"Gems.Popup.menuAddSet"); 2383 2453 2384 menuRenameSet = new JMenuItem(); 2385 Dictionary.setText(menuRenameSet,"Gems.Popup.menuRenameSet"); 2386 2387 menuAddElement =new JMenuItem(); 2388 Dictionary.setText(menuAddElement,"Gems.Popup.menuAddElement"); 2389 2390 menuRemoveSet = new JMenuItem(); 2391 Dictionary.setText(menuRemoveSet,"Gems.Popup.menuRemoveSet"); 2392 //subfield related Gems.Popups 2454 menuRenameSet = new JMenuItem(); 2455 Dictionary.setText(menuRenameSet,"Gems.Popup.menuRenameSet"); 2456 2457 menuAddElement =new JMenuItem(); 2458 Dictionary.setText(menuAddElement,"Gems.Popup.menuAddElement"); 2459 2460 menuAddAttributeSet = new JMenuItem(); 2461 Dictionary.setText(menuAddAttributeSet, "Gems.Popup.menuAddAttribute"); 2462 menuRemoveSet = new JMenuItem(); 2463 Dictionary.setText(menuRemoveSet,"Gems.Popup.menuRemoveSet"); 2464 //subfield related Gems.Popups 2393 2465 menuRenameSubfield = new JMenuItem(); 2394 2466 Dictionary.setText(menuRenameSubfield,"Gems.Popup.menuRenameSubfield"); 2395 2467 2396 2468 menuDeleteSubfield=new JMenuItem(); 2397 Dictionary.setText(menuDeleteSubfield,"Gems.Popup.menu DeleteSubfield");2469 Dictionary.setText(menuDeleteSubfield,"Gems.Popup.menuRemoveSubfield"); 2398 2470 2399 2471 menuAddAttributeSubfield=new JMenuItem(); 2400 Dictionary.setText(menuAddAttributeSubfield,"Gems.Popup.menuAddAttribute Subfield");2472 Dictionary.setText(menuAddAttributeSubfield,"Gems.Popup.menuAddAttribute"); 2401 2473 2402 2474 //element related Gems.Popups … … 2405 2477 2406 2478 menuDeleteElement=new JMenuItem(); 2407 Dictionary.setText(menuDeleteElement,"Gems.Popup.menu DeleteElement");2479 Dictionary.setText(menuDeleteElement,"Gems.Popup.menuRemoveElement"); 2408 2480 2409 2481 menuAddAttributeElement=new JMenuItem(); 2410 Dictionary.setText(menuAddAttributeElement,"Gems.Popup.menuAddAttribute Element");2482 Dictionary.setText(menuAddAttributeElement,"Gems.Popup.menuAddAttribute"); 2411 2483 2412 2484 menuAddSubfield=new JMenuItem(); … … 2418 2490 2419 2491 menuDeleteAttribute=new JMenuItem(); 2420 Dictionary.setText(menuDeleteAttribute,"Gems.Popup.menu DeleteAttribute");2492 Dictionary.setText(menuDeleteAttribute,"Gems.Popup.menuRemoveAttribute"); 2421 2493 2422 2494 menuAddAttributeAttribute=new JMenuItem(); 2423 Dictionary.setText(menuAddAttributeAttribute,"Gems.Popup.menuAddAttribute Attribute");2495 Dictionary.setText(menuAddAttributeAttribute,"Gems.Popup.menuAddAttribute"); 2424 2496 2425 2497 //start Associate the menu items with the appropriate popups: 2426 2498 //setPopup.add(menuRenameSet); 2427 setPopup.add(menuAddSet); 2428 setPopup.add(menuAddElement); 2429 setPopup.add(menuRemoveSet); 2499 //setPopup.add(menuAddSet); 2500 setPopup.add(menuAddAttributeSet); 2501 setPopup.add(menuAddElement); 2502 setPopup.add(menuRemoveSet); 2430 2503 2431 2504 //subfieldPopup.add(menuRenameSubfield); … … 2436 2509 elementPopup.add(menuDeleteElement); 2437 2510 elementPopup.add(menuAddAttributeElement); 2438 elementPopup.add(menuAddSubfield);2511 //elementPopup.add(menuAddSubfield); 2439 2512 2440 2513 attributePopup.add(menuEditValue); … … 2447 2520 menuAddSet.addActionListener(new AddSetActionListener()); 2448 2521 menuAddElement.addActionListener(new AddElementActionListener()); 2449 2522 menuAddAttributeSet.addActionListener(new AddOrEditAttributeActionListener()); 2450 2523 menuRenameSubfield.addActionListener(this); 2451 2524 menuDeleteSubfield.addActionListener(this); -
trunk/gli/src/org/greenstone/gatherer/gems/MetadataSet.java
r8270 r8388 57 57 private Element root = null; 58 58 /** The <strong>File</strong> this metadata set was loaded from. */ 59 public String old_filename = null; 59 60 private File file = null; 60 61 /** A mapping from metadata elements to the root element of the value trees for that element. */ … … 62 63 /** The list of metadata elements which are, of course, children of the root node. */ 63 64 private NodeList elements = null; 64 65 66 //I realize I should be using getters and setters, but for a quick fix 67 public boolean set_changed = false; 65 68 private String current_language_code; 66 69 /** The description of this metadata set. Cached as it takes more computation time. */ … … 391 394 public String getName() { 392 395 if(current_language_code != null && !Configuration.getLanguage().equals(current_language_code)) { 393 name = null; 396 // name = null; 397 return null; 394 398 } 395 399 if(name == null) { 396 name = getAttribute(StaticStrings.NAME_ELEMENT, Dictionary.get("MSM.No_Name")); 397 } 400 401 //name = getAttribute(StaticStrings.NAME_ELEMENT, Dictionary.get("MSM.No_Name")); 402 return getAttribute(StaticStrings.NAME_ELEMENT, Dictionary.get("MSM.No_Name")); 403 404 } 405 398 406 return name; 399 407 } -
trunk/gli/src/org/greenstone/gatherer/gems/MetadataSetManager.java
r8375 r8388 39 39 import java.io.*; 40 40 import java.util.*; 41 import java.util.StringTokenizer; 41 42 import javax.swing.*; 42 43 import javax.swing.filechooser.*; … … 65 66 /** The name of the hidden, or system, metadata set. */ 66 67 static final public String HIDDEN = "hidden"; 68 static final public int MAX_LOADED_SETS = 64; 67 69 static public CollectionManager col_man = null; 68 70 /** A mapping from metadata namespace to metadata set. */ 69 71 static private Hashtable mds_hashtable = new Hashtable(); 70 72 public GEMS gemsptr; 73 71 74 /** The profiler is responsible for remembering what actions a user has requested when importing metadata, so as to prevent the user needlessly re-entering this information for each import. */ 72 75 // public MSMProfiler profiler = null; … … 74 77 75 78 /** Constructor. */ 76 public MetadataSetManager() { 79 public MetadataSetManager(GEMS gemscopy) { 80 gemsptr = gemscopy; 77 81 col_man = new CollectionManager(); 78 82 } … … 254 258 * @return The MetadataSet as named, or null if no such set. 255 259 */ 256 public MetadataSet getSet(String name ) {257 if(mds_hashtable.containsKey(name )) {258 return (MetadataSet) mds_hashtable.get(name );260 public MetadataSet getSet(String namespace) { 261 if(mds_hashtable.containsKey(namespace)) { 262 return (MetadataSet) mds_hashtable.get(namespace); 259 263 } 260 264 // else if(name.equals(HIDDEN)) { … … 304 308 public MetadataSet loadMetadataSet(File metadata_set_file) 305 309 { 306 System.err.println("Loading metadata set file " + metadata_set_file + "..."); 310 File[] all_sets = new File[MAX_LOADED_SETS]; 311 MetadataSet tempSet; 312 int i = 0; 313 System.err.println("Loading metadata set file " + metadata_set_file + "..."); 307 314 MetadataSet metadata_set = new MetadataSet(metadata_set_file); 315 316 //write out existing namespaces to all_sets[]...we use this to determine if a set is 317 //already loaded-Attila 318 for(Enumeration keys = mds_hashtable.keys(); keys.hasMoreElements(); ) { 319 tempSet = (MetadataSet)mds_hashtable.get(keys.nextElement()); 320 321 all_sets[i] = tempSet.getFile(); 322 i++; 323 } 324 325 //Now check our metadata.set's namespace to see if it is already loaded in all_sets 326 for(int p = 0 ; p < i; p++) { 327 328 if(metadata_set.getFile().compareTo(all_sets[p]) == 0) { 329 // System.err.println("Not loading set: "+ metadata_set.getNamespace() + " is already loaded.\n"); 330 // JOptionPane.showMessageDialog(self, Dictionary.get("MEM.Cannot_Add_Elements_To_Greenstone_MDS"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 331 gemsptr.warn_cant_load_set(); 332 333 return null; 334 } 335 336 } 337 338 //check if this metadata set belongs to a collection 339 //if so, then change the metadata set's name in the interface to (collection) dublic core... 340 // System.out.println(new String("asdfd" + metadata_set.getFile().separator)); 341 String sep = new String(metadata_set.getFile().separator); 342 StringTokenizer st = new StringTokenizer(metadata_set.getFile().toString(), sep); 343 String colName = new String(""); 344 345 while ( st.hasMoreTokens() ) 346 { 347 if(st.nextToken().compareTo("collect") == 0) { 348 colName = st.nextToken(); 349 // metadata_set.old_filename = metadata_set.getName(); 350 // metadata_set.setName(new String("(" + colName + ") " + metadata_set.getName()) ); 351 break; 352 } 353 } 354 355 //Actual set loading code(if it gets this far-Attila 308 356 mds_hashtable.put(metadata_set.getNamespace(), metadata_set); 309 357 return metadata_set; … … 360 408 } 361 409 public void save() { 362 // Create the correct file to save these sets to... 363 //File file = new File(Gatherer.self.getCollectionMetadata()); 364 File file = new File("/home/arosmain/gsdl/gli/metadata"); 365 366 System.out.println("saving..."); 410 // Create the correct file to save these sets to... 411 //File file = new File(Gatherer.self.getCollectionMetadata()); 412 //File file = new File(GEMS.config.gsdl_path + "/gli/metadata"); 413 File file = new File(Utility.METADATA_DIR); 414 415 367 416 if (!file.exists()) { 368 //DebugStream.println("trying to save a collection and the metadata directory does not exist - creating it!"); 369 System.out.println("trying to save a collection and the metadata directory does not exist - creating it!"); 370 371 file.mkdir(); 372 } 373 // And make back ups of all existing metadata set files. 374 File temp[] = file.listFiles(); 375 for(int i = temp.length - 1; i >= 0; i--) { 376 if(temp[i].getName().endsWith(".mds") ) { 377 File backup = new File(temp[i].getAbsolutePath() + "~attela"); 378 379 System.out.println(temp[i].getAbsolutePath()+ "asdf\n backupfile:"+ backup.toString()); 417 //DebugStream.println("trying to save a collection and the metadata directory does not exist - creating it!"); 418 System.out.println("trying to save a collection and the metadata directory does not exist - creating it!"); 419 420 file.mkdir(); 421 } 422 // And make back ups of all existing metadata set files. 423 File temp[] = file.listFiles(); 424 425 //Null ptr exception here? Didnt see it, -Attila 426 /*for(int i = temp.length - 1; i >= 0; i--) { 427 // System.out.println("Itter: " + i); 428 if(temp[i].getName().endsWith(".mds") ) { 429 File backup = new File(temp[i].getAbsolutePath() + "~bak"); 430 431 //System.out.println(temp[i].getAbsolutePath()+ "asdf\n backupfile:"+ backup.toString()); 380 432 381 433 382 434 //backup.deleteOnExit(); 435 383 436 if(!temp[i].renameTo(backup)) { 384 //DebugStream.println("Error in MetadataSetManager.save(): FileRenamedException");437 DebugStream.println("Error in MetadataSetManager.save(): FileRenamedException"); 385 438 System.out.println("Error in MetadataSetManager.save(): FileRenamedException"); 386 439 } 387 440 } 388 } 389 390 391 392 441 }*/ 442 // Now save the latest versions of the metadata sets. 443 for(Enumeration keys = mds_hashtable.keys(); keys.hasMoreElements(); ) { 444 String namespace = (String) keys.nextElement(); 445 MetadataSet set = (MetadataSet) mds_hashtable.get(namespace); 393 446 // 394 447 //col_man.loadCollection(GEMS.config.getString("general.open_collection",true)); 395 448 // 396 try { 397 File mds_file = new File(file, set.getNamespace() + ".mds"); 398 449 try { 450 // this won't work if we have collection metadata open 451 //File mds_file = new File(file, set.getNamespace() + ".mds"); 452 453 //set.setName(set.old_filename); 454 455 //set has not changed(or has been recently saved 456 457 //if(set.set_changed == false){ 458 // continue; 459 //} 460 461 // just use the existing file path 462 File mds_file = set.getFile(); 463 //System.out.println(mds_file.toString() + "a\n"); 399 464 //Saves the DOM obj that set.getDocument returns to mds_file name 400 Utility.export(set.getDocument(), mds_file); 401 //What does setfile do? 402 set.setFile(mds_file); 465 // set.getF 466 // System.out.println(keys.toString()); 467 468 469 // System.out.println("::: " + mds_file.toString()); 470 Utility.export(set.getDocument(), mds_file); 471 //What does setfile do? 472 //set.setFile(mds_file); 473 //} 403 474 // Now for each element attempt to save its value tree. 404 475 //NodeList elements = set.getElements();
Note:
See TracChangeset
for help on using the changeset viewer.