Author: pwang
Date: 2011-07-11 16:38:17 -0700 (Mon, 11 Jul 2011)
New Revision: 26144

Modified:
   
core3/table-import-impl/trunk/src/main/java/org/cytoscape/tableimport/internal/ui/ImportAttributeTableTask.java
Log:
Fixed the duplicated primary key problem

Modified: 
core3/table-import-impl/trunk/src/main/java/org/cytoscape/tableimport/internal/ui/ImportAttributeTableTask.java
===================================================================
--- 
core3/table-import-impl/trunk/src/main/java/org/cytoscape/tableimport/internal/ui/ImportAttributeTableTask.java
     2011-07-11 23:30:54 UTC (rev 26143)
+++ 
core3/table-import-impl/trunk/src/main/java/org/cytoscape/tableimport/internal/ui/ImportAttributeTableTask.java
     2011-07-11 23:38:17 UTC (rev 26144)
@@ -72,20 +72,17 @@
        @Override
        public void run(TaskMonitor tm) throws IOException {
 
-               final CyTable table = 
CytoscapeServices.tableFactory.createTable("AttrTable "
-                               + Integer.toString(numImports++), "name", 
String.class, true,
-                               true);
-               cyTables = new CyTable[] { table };
-               
                final Class<? extends CyTableEntry> type = getMappingClass();
-               
-               
+                               
                String primaryKey = 
reader.getMappingParameter().getAttributeNames()[reader.getMappingParameter().getKeyIndex()];
                String mappingKey = 
reader.getMappingParameter().getMappingAttribute();
                
-               
//System.out.println("ImportAttributrTableTask.run()...primaryKey="+ 
primaryKey);
-               
//System.out.println("ImportAttributrTableTask.run()...mappingKey="+ 
mappingKey);
+               final CyTable table = 
CytoscapeServices.tableFactory.createTable("AttrTable "
+                               + Integer.toString(numImports++), primaryKey, 
String.class, true,
+                               true);
+               cyTables = new CyTable[] { table };
 
+               
                if (CytoscapeServices.netMgr.getNetworkSet().size() > 0 && type 
!= null) {
                        /*
                         * Case 1: use node ID as the key
@@ -99,19 +96,13 @@
                                /*
                                 *  Case 2: use an attribute as the key.
                                 */
-                               System.out.println("\tuse attribute as key");
                                final MapNetworkAttrTask task = new 
MapNetworkAttrTask(type, table, primaryKey, mappingKey,
                                                CytoscapeServices.netMgr, 
CytoscapeServices.appMgr);
                                insertTasksAfterCurrentTask(task);
-               
-                               
                        }
                }
-                               
-               
 
                this.reader.readTable(table);
-               // loadAttributesInternal(table);
        }
 
 

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to