Revision 33718
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src-test/org/gvsig/fmap/mapcontext/persistence/DummyDBFeatureStore.java | ||
---|---|---|
539 | 539 |
// TODO Auto-generated method stub |
540 | 540 |
return null; |
541 | 541 |
} |
542 |
|
|
543 |
public String getFullName() { |
|
544 |
// TODO Auto-generated method stub |
|
545 |
return null; |
|
546 |
} |
|
542 | 547 |
} |
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src-test/org/gvsig/fmap/mapcontext/persistence/DummyFileFeatureStore.java | ||
---|---|---|
1224 | 1224 |
// TODO Auto-generated method stub |
1225 | 1225 |
return null; |
1226 | 1226 |
} |
1227 |
|
|
1228 |
public String getFullName() { |
|
1229 |
// TODO Auto-generated method stub |
|
1230 |
return null; |
|
1231 |
} |
|
1227 | 1232 |
} |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/shp/SHPStoreProvider.java | ||
---|---|---|
298 | 298 |
return (SHPStoreParameters) getParameters(); |
299 | 299 |
} |
300 | 300 |
|
301 |
public String getName() { |
|
301 |
public String getProviderName() {
|
|
302 | 302 |
return NAME; |
303 | 303 |
} |
304 | 304 |
|
... | ... | |
366 | 366 |
featureProvider.setDefaultGeometry(this.shpFile.getGeometry(index)); |
367 | 367 |
hasGeometry = true; |
368 | 368 |
} catch (CreateGeometryException e) { |
369 |
throw new ReadException(getName(), e); |
|
369 |
throw new ReadException(getProviderName(), e);
|
|
370 | 370 |
} |
371 | 371 |
} |
372 | 372 |
if (hasDBFAttributes(featureType, hasGeometry)) { |
... | ... | |
448 | 448 |
try { |
449 | 449 |
fType = this.getStoreServices().getDefaultFeatureType(); |
450 | 450 |
} catch (DataException e) { |
451 |
throw new PerformEditingException(this.getName(), e); |
|
451 |
throw new PerformEditingException(this.getProviderName(), e);
|
|
452 | 452 |
} |
453 | 453 |
// TODO Comprobar el campo de geometria |
454 | 454 |
|
... | ... | |
470 | 470 |
DisposableIterator iter = null; |
471 | 471 |
try { |
472 | 472 |
set = getFeatureStore().getFeatureSet(); |
473 |
writer = new SHPFeatureWriter(getName()); |
|
473 |
writer = new SHPFeatureWriter(getProviderName());
|
|
474 | 474 |
|
475 | 475 |
SHPStoreParameters shpParams = getShpParameters(); |
476 | 476 |
SHPStoreParameters tmpParams = |
... | ... | |
496 | 496 |
resourceCloseRequest(); |
497 | 497 |
|
498 | 498 |
if (!shpParams.getDBFFile().delete()) { |
499 |
throw new PerformEditingException(getName(), |
|
499 |
throw new PerformEditingException(getProviderName(),
|
|
500 | 500 |
new IOException(shpParams.getDBFFileName())); |
501 | 501 |
} |
502 | 502 |
if (!shpParams.getSHPFile().delete()) { |
503 |
throw new PerformEditingException(getName(), |
|
503 |
throw new PerformEditingException(getProviderName(),
|
|
504 | 504 |
new IOException(shpParams.getSHPFileName())); |
505 | 505 |
} |
506 | 506 |
if (!shpParams.getSHXFile().delete()) { |
507 |
throw new PerformEditingException(getName(), |
|
507 |
throw new PerformEditingException(getProviderName(),
|
|
508 | 508 |
new IOException(shpParams.getSHXFileName())); |
509 | 509 |
} |
510 | 510 |
if (!tmpParams.getDBFFile().renameTo( |
511 | 511 |
shpParams.getDBFFile())) { |
512 |
throw new PerformEditingException(getName(), |
|
512 |
throw new PerformEditingException(getProviderName(),
|
|
513 | 513 |
new IOException(shpParams.getSHPFileName())); |
514 | 514 |
} |
515 | 515 |
if (!tmpParams.getSHPFile().renameTo( |
516 | 516 |
shpParams.getSHPFile())) { |
517 |
throw new PerformEditingException(getName(), |
|
517 |
throw new PerformEditingException(getProviderName(),
|
|
518 | 518 |
new IOException(shpParams.getSHPFileName())); |
519 | 519 |
} |
520 | 520 |
if (!tmpParams.getSHXFile().renameTo( |
521 | 521 |
shpParams.getSHXFile())) { |
522 |
throw new PerformEditingException(getName(), |
|
522 |
throw new PerformEditingException(getProviderName(),
|
|
523 | 523 |
new IOException(shpParams.getSHXFileName())); |
524 | 524 |
} |
525 | 525 |
|
... | ... | |
534 | 534 |
}); |
535 | 535 |
|
536 | 536 |
} catch (Exception e) { |
537 |
throw new PerformEditingException(this.getName(), e); |
|
537 |
throw new PerformEditingException(this.getProviderName(), e);
|
|
538 | 538 |
// } finally { |
539 | 539 |
// this.resourcesEnd(); |
540 | 540 |
} |
... | ... | |
586 | 586 |
removeGeometryColumn(dbfFtype); |
587 | 587 |
FeatureSet set = store.getFeatureSet(); |
588 | 588 |
|
589 |
writer = new SHPFeatureWriter(getName()); |
|
589 |
writer = new SHPFeatureWriter(getProviderName());
|
|
590 | 590 |
|
591 | 591 |
writer.begin(getShpParameters(), fType, dbfFtype, set.getSize()); |
592 | 592 |
return null; |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dbf/DBFStoreProvider.java | ||
---|---|---|
66 | 66 |
public class DBFStoreProvider extends AbstractFeatureStoreProvider implements |
67 | 67 |
ResourceConsumer { |
68 | 68 |
|
69 |
private static final Logger LOG = LoggerFactory.getLogger(DBFStoreProvider.class); |
|
69 |
// private static final Logger LOG = LoggerFactory.getLogger(DBFStoreProvider.class);
|
|
70 | 70 |
|
71 | 71 |
public static String NAME = "DBF"; |
72 | 72 |
public static String DESCRIPTION = "DBF file"; |
73 |
// private DBFResource dbf = null; |
|
74 | 73 |
private static final Locale ukLocale = new Locale("en", "UK"); |
75 | 74 |
|
76 | 75 |
public static final String METADATA_DEFINITION_NAME = NAME; |
77 | 76 |
private static final String METADATA_ENCODING = "Encoding"; |
78 | 77 |
private static final String METADATA_CODEPAGE = "CodePage"; |
79 | 78 |
|
80 |
// public static final String DYNFIELD_CURRENT_ENCODING = "CurrentEncoding"; |
|
81 |
// public static final String DYNFIELD_ORIGINAL_ENCODING = "OriginalEncoding"; |
|
82 |
|
|
83 | 79 |
private DbaseFile dbfFile = null; |
84 | 80 |
private ResourceProvider dbfResource; |
85 | 81 |
private long counterNewsOIDs = -1; |
... | ... | |
129 | 125 |
Charset charset = params.getEncoding(); |
130 | 126 |
this.dbfFile = new DbaseFile(theFile, charset); |
131 | 127 |
|
132 |
writer = new DBFFeatureWriter(this.getName()); |
|
128 |
writer = new DBFFeatureWriter(this.getProviderName());
|
|
133 | 129 |
|
134 | 130 |
this.initFeatureType(); |
135 | 131 |
|
... | ... | |
159 | 155 |
dbfResource.addConsumer(this); |
160 | 156 |
} |
161 | 157 |
|
162 |
public String getName() { |
|
158 |
public String getProviderName() {
|
|
163 | 159 |
return NAME; |
164 | 160 |
} |
165 | 161 |
|
... | ... | |
177 | 173 |
params.setRoot(this.getDBFParameters().getDBFFile().getParent()); |
178 | 174 |
return manager.openServerExplorer(FilesystemServerExplorer.NAME,params); |
179 | 175 |
} catch (DataException e) { |
180 |
throw new ReadException(this.getName(), e); |
|
176 |
throw new ReadException(this.getProviderName(), e);
|
|
181 | 177 |
} catch (ValidateDataParametersException e) { |
182 | 178 |
// TODO Auto-generated catch block |
183 |
throw new ReadException(this.getName(), e); |
|
179 |
throw new ReadException(this.getProviderName(), e);
|
|
184 | 180 |
} |
185 | 181 |
} |
186 | 182 |
|
... | ... | |
225 | 221 |
try { |
226 | 222 |
close(); |
227 | 223 |
} catch (CloseException e1) { |
228 |
throw new PerformEditingException(getName(), e1); |
|
224 |
throw new PerformEditingException(getProviderName(), e1);
|
|
229 | 225 |
} |
230 | 226 |
getDBFParameters().getDBFFile().delete(); |
231 | 227 |
tmpParams.getDBFFile().renameTo( |
... | ... | |
245 | 241 |
} |
246 | 242 |
}); |
247 | 243 |
} catch (ResourceExecuteException e) { |
248 |
throw new PerformEditingException(this.getName(), e); |
|
244 |
throw new PerformEditingException(this.getProviderName(), e);
|
|
249 | 245 |
} |
250 | 246 |
|
251 | 247 |
this.counterNewsOIDs = -1; |
... | ... | |
283 | 279 |
try { |
284 | 280 |
this.open(); |
285 | 281 |
} catch (DataException e) { |
286 |
throw new InitializeException(this.getName(), e); |
|
282 |
throw new InitializeException(this.getProviderName(), e);
|
|
287 | 283 |
} |
288 | 284 |
return (EditableFeatureType) getResource().execute( |
289 | 285 |
new ResourceAction() { |
... | ... | |
342 | 338 |
attr.setDefaultValue(null); |
343 | 339 |
attr.setAllowNull(true); |
344 | 340 |
} else { |
345 |
throw new InitializeException(getName(), |
|
341 |
throw new InitializeException(getProviderName(),
|
|
346 | 342 |
new UnknownDataTypeException( |
347 | 343 |
dbfFile.getFieldName(i), "" |
348 |
+ fieldType, getName())); |
|
344 |
+ fieldType, getProviderName()));
|
|
349 | 345 |
} |
350 | 346 |
} |
351 | 347 |
return fType; |
... | ... | |
367 | 363 |
try { |
368 | 364 |
value = this.dbfFile.getStringFieldValue(rowIndex, dbfIndex); |
369 | 365 |
} catch (DataException e) { |
370 |
throw new ReadException(this.getName(), e); |
|
366 |
throw new ReadException(this.getProviderName(), e);
|
|
371 | 367 |
} |
372 | 368 |
value = value.trim(); |
373 | 369 |
int fieldType = descriptor.getType(); |
... | ... | |
445 | 441 |
try { |
446 | 442 |
dat = df.parse(strAux); |
447 | 443 |
} catch (ParseException e) { |
448 |
throw new ReadException(this.getName(), e); |
|
444 |
throw new ReadException(this.getProviderName(), e);
|
|
449 | 445 |
} |
450 | 446 |
featureProvider.set(descriptor.getIndex(), dat); |
451 | 447 |
break; |
... | ... | |
509 | 505 |
}); |
510 | 506 |
|
511 | 507 |
} catch (ResourceExecuteException e) { |
512 |
throw new OpenException(this.getName(), e); |
|
508 |
throw new OpenException(this.getProviderName(), e);
|
|
513 | 509 |
} |
514 | 510 |
} |
515 | 511 |
|
... | ... | |
533 | 529 |
} |
534 | 530 |
}); |
535 | 531 |
} catch (ResourceExecuteException e) { |
536 |
throw new CloseException(this.getName(), e); |
|
532 |
throw new CloseException(this.getProviderName(), e);
|
|
537 | 533 |
} |
538 | 534 |
} |
539 | 535 |
|
... | ... | |
577 | 573 |
try { |
578 | 574 |
this.close(); |
579 | 575 |
} catch (CloseException e) { |
580 |
throw new OpenException(this.getName(), e); |
|
576 |
throw new OpenException(this.getProviderName(), e);
|
|
581 | 577 |
} |
582 | 578 |
this.open(); |
583 | 579 |
try { |
584 | 580 |
this.initFeatureType(); |
585 | 581 |
} catch (InitializeException e) { |
586 |
throw new OpenException(this.getName(), e); |
|
582 |
throw new OpenException(this.getProviderName(), e);
|
|
587 | 583 |
} |
588 | 584 |
} |
589 | 585 |
|
... | ... | |
722 | 718 |
public Object getSourceId() { |
723 | 719 |
return this.getDBFParameters().getFile(); |
724 | 720 |
} |
721 |
|
|
722 |
public String getName() { |
|
723 |
String name = this.getDBFParameters().getFile().getName(); |
|
724 |
int n = name.lastIndexOf("."); |
|
725 |
if( n<1 ) { |
|
726 |
return name; |
|
727 |
} |
|
728 |
return name.substring(0, n); |
|
729 |
} |
|
730 |
|
|
731 |
public String getFullName() { |
|
732 |
return this.getDBFParameters().getFile().getAbsolutePath(); |
|
733 |
} |
|
725 | 734 |
|
726 | 735 |
protected void resourceCloseRequest() throws ResourceException { |
727 | 736 |
this.dbfResource.closeRequest(); |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dbf/DBFSetProvider.java | ||
---|---|---|
91 | 91 |
index++; |
92 | 92 |
return ret; |
93 | 93 |
} catch (DataException e) { |
94 |
throw new ReadRuntimeException(getDBFStoreProvider().getName(), |
|
94 |
throw new ReadRuntimeException(getDBFStoreProvider().getProviderName(),
|
|
95 | 95 |
e); |
96 | 96 |
} |
97 | 97 |
} |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dxf/DXFStoreProvider.java | ||
---|---|---|
164 | 164 |
return (DXFStoreParameters) this.getParameters(); |
165 | 165 |
} |
166 | 166 |
|
167 |
public String getName() { |
|
167 |
public String getProviderName() {
|
|
168 | 168 |
return NAME; |
169 | 169 |
} |
170 | 170 |
|
... | ... | |
287 | 287 |
try { |
288 | 288 |
throw new OpenException(resource.getName(), e); |
289 | 289 |
} catch (AccessResourceException e1) { |
290 |
throw new OpenException(getName(), e); |
|
290 |
throw new OpenException(getProviderName(), e);
|
|
291 | 291 |
} |
292 | 292 |
} |
293 | 293 |
} |
... | ... | |
302 | 302 |
params.setRoot(this.getDXFParameters().getFile().getParent()); |
303 | 303 |
return manager.openServerExplorer(FilesystemServerExplorer.NAME,params); |
304 | 304 |
} catch (DataException e) { |
305 |
throw new ReadException(this.getName(), e); |
|
305 |
throw new ReadException(this.getProviderName(), e);
|
|
306 | 306 |
} catch (ValidateDataParametersException e) { |
307 |
throw new ReadException(this.getName(), e); |
|
307 |
throw new ReadException(this.getProviderName(), e);
|
|
308 | 308 |
} |
309 | 309 |
|
310 | 310 |
} |
... | ... | |
1497 | 1497 |
try { |
1498 | 1498 |
this.open(); |
1499 | 1499 |
} catch (OpenException e) { |
1500 |
throw new InitializeException(this.getName(), e); |
|
1500 |
throw new InitializeException(this.getProviderName(), e);
|
|
1501 | 1501 |
} |
1502 | 1502 |
} |
1503 | 1503 |
|
... | ... | |
1536 | 1536 |
return this.getDXFParameters().getFile(); |
1537 | 1537 |
} |
1538 | 1538 |
|
1539 |
public String getName() { |
|
1540 |
String name = this.getDXFParameters().getFile().getName(); |
|
1541 |
int n = name.lastIndexOf("."); |
|
1542 |
if( n<1 ) { |
|
1543 |
return name; |
|
1544 |
} |
|
1545 |
return name.substring(0, n); |
|
1546 |
} |
|
1547 |
|
|
1548 |
public String getFullName() { |
|
1549 |
return this.getDXFParameters().getFile().getAbsolutePath(); |
|
1550 |
} |
|
1551 |
|
|
1539 | 1552 |
public ResourceProvider getResource() { |
1540 | 1553 |
return resource; |
1541 | 1554 |
} |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dgn/DGNStoreProvider.java | ||
---|---|---|
135 | 135 |
} |
136 | 136 |
|
137 | 137 |
|
138 |
public String getName() { |
|
138 |
public String getProviderName() {
|
|
139 | 139 |
return NAME; |
140 | 140 |
} |
141 | 141 |
|
... | ... | |
258 | 258 |
try { |
259 | 259 |
throw new OpenException(resource.getName(), e); |
260 | 260 |
} catch (AccessResourceException e1) { |
261 |
throw new OpenException(getName(), e); |
|
261 |
throw new OpenException(getProviderName(), e);
|
|
262 | 262 |
} |
263 | 263 |
} |
264 | 264 |
} |
... | ... | |
273 | 273 |
params.setRoot(this.getDGNParameters().getFile().getParent()); |
274 | 274 |
return manager.openServerExplorer(FilesystemServerExplorer.NAME, params); |
275 | 275 |
} catch (DataException e) { |
276 |
throw new ReadException(this.getName(), e); |
|
276 |
throw new ReadException(this.getProviderName(), e);
|
|
277 | 277 |
} catch (ValidateDataParametersException e) { |
278 |
throw new ReadException(this.getName(), e); |
|
278 |
throw new ReadException(this.getProviderName(), e);
|
|
279 | 279 |
} |
280 | 280 |
|
281 | 281 |
} |
... | ... | |
947 | 947 |
try { |
948 | 948 |
this.open(); |
949 | 949 |
} catch (OpenException e) { |
950 |
throw new InitializeException(this.getName(), e); |
|
950 |
throw new InitializeException(this.getProviderName(), e);
|
|
951 | 951 |
} |
952 | 952 |
} |
953 | 953 |
|
... | ... | |
973 | 973 |
public Object getSourceId() { |
974 | 974 |
return this.getDGNParameters().getFile(); |
975 | 975 |
} |
976 |
|
|
976 |
|
|
977 |
public String getName() { |
|
978 |
String name = this.getDGNParameters().getFile().getName(); |
|
979 |
int n = name.lastIndexOf("."); |
|
980 |
if( n<1 ) { |
|
981 |
return name; |
|
982 |
} |
|
983 |
return name.substring(0, n); |
|
984 |
} |
|
985 |
|
|
986 |
public String getFullName() { |
|
987 |
return this.getDGNParameters().getFile().getAbsolutePath(); |
|
988 |
} |
|
989 |
|
|
977 | 990 |
public ResourceProvider getResource() { |
978 | 991 |
return resource; |
979 | 992 |
} |
branches/v2_0_0_prep/extensions/org.gvsig.symbology/src/test/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/TestAbstractIntervalLegend.java | ||
---|---|---|
626 | 626 |
public String getProviderName() { |
627 | 627 |
return null; |
628 | 628 |
} |
629 |
|
|
630 |
public String getFullName() { |
|
631 |
// TODO Auto-generated method stub |
|
632 |
return null; |
|
633 |
} |
|
629 | 634 |
} |
630 | 635 |
|
631 | 636 |
private static final FInterval interval0=new FInterval(0,2); |
branches/v2_0_0_prep/extensions/org.gvsig.symbology/src/test/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/TestIClassifiedLegend.java | ||
---|---|---|
629 | 629 |
return null; |
630 | 630 |
} |
631 | 631 |
|
632 |
public String getFullName() { |
|
633 |
// TODO Auto-generated method stub |
|
634 |
return null; |
|
635 |
} |
|
636 |
|
|
632 | 637 |
} |
633 | 638 |
|
634 | 639 |
//private static final FInterval interval0=new FInterval(0,2); |
Also available in: Unified diff