Revision 33188 branches/v2_0_0_prep/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreProvider.java
DWGStoreProvider.java | ||
---|---|---|
21 | 21 |
import org.gvsig.fmap.dal.DataServerExplorer; |
22 | 22 |
import org.gvsig.fmap.dal.DataStoreNotification; |
23 | 23 |
import org.gvsig.fmap.dal.DataTypes; |
24 |
import org.gvsig.fmap.dal.FileHelper; |
|
24 | 25 |
import org.gvsig.fmap.dal.exception.DataException; |
25 | 26 |
import org.gvsig.fmap.dal.exception.InitializeException; |
26 | 27 |
import org.gvsig.fmap.dal.exception.OpenException; |
... | ... | |
28 | 29 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
29 | 30 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
30 | 31 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
31 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
32 | 32 |
import org.gvsig.fmap.dal.feature.FeatureType; |
33 | 33 |
import org.gvsig.fmap.dal.feature.exception.CreateGeometryException; |
34 | 34 |
import org.gvsig.fmap.dal.feature.exception.PerformEditingException; |
... | ... | |
50 | 50 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
51 | 51 |
import org.gvsig.fmap.geom.primitive.Envelope; |
52 | 52 |
import org.gvsig.fmap.geom.primitive.Point; |
53 |
import org.gvsig.metadata.MetadataLocator; |
|
54 |
import org.gvsig.metadata.MetadataManager; |
|
55 |
import org.gvsig.metadata.exceptions.MetadataException; |
|
56 |
import org.gvsig.tools.ToolsLocator; |
|
57 |
import org.gvsig.tools.dynobject.DynClass; |
|
58 |
import org.gvsig.tools.dynobject.DynStruct; |
|
59 | 53 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
60 | 54 |
import org.gvsig.tools.exception.NotYetImplemented; |
61 | 55 |
import org.gvsig.tools.persistence.PersistentState; |
... | ... | |
69 | 63 |
|
70 | 64 |
public static final String NAME = "DWG"; |
71 | 65 |
public static final String DESCRIPTION = "DWG file"; |
72 |
public static final String METADATA_DEFINITION_NAME = "DWGStore"; |
|
73 |
protected static DynClass DYNCLASS = null; |
|
66 |
public static final String METADATA_DEFINITION_NAME = NAME; |
|
74 | 67 |
|
75 | 68 |
public static final String NAME_FIELD_ID = "ID"; |
76 | 69 |
public static final String NAME_FIELD_GEOMETRY = "Geometry"; |
... | ... | |
101 | 94 |
private long counterNewsOIDs = 0; |
102 | 95 |
protected GeometryManager geomManager = GeometryLocator.getGeometryManager(); |
103 | 96 |
|
104 |
|
|
105 |
|
|
106 |
|
|
107 | 97 |
public DWGStoreProvider(DWGStoreParameters parameters, |
108 | 98 |
DataStoreProviderServices storeServices) throws InitializeException { |
109 |
super(parameters,storeServices,ToolsLocator |
|
110 |
.getDynObjectManager() |
|
111 |
.createDynObject(DYNCLASS)); |
|
99 |
super(parameters, storeServices, FileHelper |
|
100 |
.newMetadataContainer(METADATA_DEFINITION_NAME)); |
|
112 | 101 |
|
113 | 102 |
counterNewsOIDs = 0; |
114 | 103 |
// projection = CRSFactory.getCRS(getParameters().getSRSID()); |
... | ... | |
121 | 110 |
|
122 | 111 |
resource.addConsumer(this); |
123 | 112 |
|
124 |
this.projection = this.getDWGParameters().getSRS();
|
|
113 |
this.projection = this.getDWGParameters().getCRS();
|
|
125 | 114 |
|
126 | 115 |
|
127 | 116 |
try { |
... | ... | |
134 | 123 |
} |
135 | 124 |
|
136 | 125 |
this.initializeFeatureTypes(); |
137 |
|
|
138 |
|
|
139 | 126 |
} |
140 | 127 |
|
141 | 128 |
private DWGStoreParameters getDWGParameters() { |
... | ... | |
673 | 660 |
resource); |
674 | 661 |
} |
675 | 662 |
|
676 |
protected static void registerMetadataDefinition() throws MetadataException { |
|
677 |
MetadataManager manager = MetadataLocator.getMetadataManager(); |
|
678 |
if (manager.getDefinition(METADATA_DEFINITION_NAME) == null) { |
|
679 |
DynStruct metadataDefinition = manager.addDefinition( |
|
680 |
METADATA_DEFINITION_NAME, null); |
|
681 |
metadataDefinition.extend(manager |
|
682 |
.getDefinition(FeatureStore.METADATA_DEFINITION_NAME)); |
|
683 |
} |
|
684 |
} |
|
685 |
|
|
686 | 663 |
public Object getSourceId() { |
687 | 664 |
return this.getDWGParameters().getFile(); |
688 | 665 |
} |
Also available in: Unified diff