Revision 6438 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/Project.java

View differences:

Project.java
531 531
		xml.putProperty("data-source-count", infos.length);
532 532

  
533 533
		for (int i = 0; i < infos.length; i++) {
534
			XMLEntity child = new XMLEntity();
535 534
			SourceInfo di = infos[i];
536

  
537
			if (di instanceof ObjectSourceInfo) {
538
				ObjectSourceInfo driver = (ObjectSourceInfo) di;
539
				child.putProperty("type", "sameDriverFile");
540
				child.putProperty("gdbmsname", driver.name);
541
			} else if (di instanceof FileSourceInfo) {
542
				FileSourceInfo vfdi = (FileSourceInfo) di;
543
				child.putProperty("type", "otherDriverFile");
544
				child.putProperty("gdbmsname", vfdi.name);
545
				child.putProperty("file", vfdi.file);
546
				child.putProperty("driverName", vfdi.driverName);
547
			} else if (di instanceof DBSourceInfo) {
548
				DBTableSourceInfo dbdi = (DBTableSourceInfo) di;
549
				child.putProperty("type", "db");
550
				child.putProperty("gdbmsname", dbdi.name);
551
				child.putProperty("dbms", dbdi.dbms);
552
				child.putProperty("host", dbdi.host);
553
				child.putProperty("port", dbdi.port);
554
				child.putProperty("user", dbdi.user);
555
				child.putProperty("password", dbdi.password);
556
				child.putProperty("dbName", dbdi.dbName);
557
				child.putProperty("tableName", dbdi.tableName);
558
				child.putProperty("driverInfo", dbdi.driverName);
559
			}
560

  
535
			XMLEntity child = this.getSourceInfoXMLEntity(di);
561 536
			xml.addChild(child);
562 537
		}
563 538

  
......
1208 1183
	public static ViewInfo getSeedProjectWindow() {
1209 1184
		return seedProjectWindow;
1210 1185
	}
1186
	
1187
	public XMLEntity getSourceInfoXMLEntity(SourceInfo di) {
1188
		XMLEntity child = new XMLEntity();
1189
		
1190

  
1191
		if (di instanceof ObjectSourceInfo) {
1192
			ObjectSourceInfo driver = (ObjectSourceInfo) di;
1193
			child.putProperty("type", "sameDriverFile");
1194
			child.putProperty("gdbmsname", driver.name);
1195
		} else if (di instanceof FileSourceInfo) {
1196
			FileSourceInfo vfdi = (FileSourceInfo) di;
1197
			child.putProperty("type", "otherDriverFile");
1198
			child.putProperty("gdbmsname", vfdi.name);
1199
			child.putProperty("file", vfdi.file);
1200
			child.putProperty("driverName", vfdi.driverName);
1201
		} else if (di instanceof DBSourceInfo) {
1202
			DBTableSourceInfo dbdi = (DBTableSourceInfo) di;
1203
			child.putProperty("type", "db");
1204
			child.putProperty("gdbmsname", dbdi.name);
1205
			child.putProperty("dbms", dbdi.dbms);
1206
			child.putProperty("host", dbdi.host);
1207
			child.putProperty("port", dbdi.port);
1208
			child.putProperty("user", dbdi.user);
1209
			child.putProperty("password", dbdi.password);
1210
			child.putProperty("dbName", dbdi.dbName);
1211
			child.putProperty("tableName", dbdi.tableName);
1212
			child.putProperty("driverInfo", dbdi.driverName);
1213
		}
1214
		
1215
		return child;
1216
	}
1211 1217
}

Also available in: Unified diff