gvsig-projects-pool / org.gvsig.online / trunk / org.gvsig.online / org.gvsig.online.lib / org.gvsig.online.lib.impl / src / main / java / org / gvsig / online / lib / impl / workspace / tables / EntitiesTable.java @ 9518
History | View | Annotate | Download (21 KB)
1 |
package org.gvsig.online.lib.impl.workspace.tables; |
---|---|
2 |
|
3 |
import java.util.List; |
4 |
import javax.json.JsonObject; |
5 |
import org.apache.commons.collections.CollectionUtils; |
6 |
import org.apache.commons.lang3.StringUtils; |
7 |
import org.cresques.cts.IProjection; |
8 |
import org.gvsig.fmap.crs.CRSFactory; |
9 |
import org.gvsig.fmap.dal.DALLocator; |
10 |
import org.gvsig.fmap.dal.DataManager; |
11 |
import static org.gvsig.fmap.dal.DataManager.RECOMENDED_SIZE_FOR_CLOB; |
12 |
import org.gvsig.fmap.dal.DataTransaction; |
13 |
import org.gvsig.fmap.dal.feature.DisposableFeatureSetIterable; |
14 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
15 |
import org.gvsig.fmap.dal.feature.Feature; |
16 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
17 |
import org.gvsig.fmap.dal.feature.FeatureType; |
18 |
import org.gvsig.json.Json; |
19 |
import org.gvsig.json.JsonObjectBuilder; |
20 |
import org.gvsig.online.lib.api.workingcopy.OnlineEntity; |
21 |
import org.gvsig.online.lib.api.workingcopy.OnlineEntityEditable; |
22 |
import org.gvsig.online.lib.api.OnlineManager; |
23 |
import org.gvsig.online.lib.impl.OnlineUtils; |
24 |
import org.gvsig.tools.dataTypes.DataTypes; |
25 |
import org.gvsig.tools.dispose.DisposeUtils; |
26 |
import org.gvsig.tools.dynform.spi.DynFormSPIManager; |
27 |
import org.gvsig.online.lib.api.workingcopy.OnlineWorkingcopy; |
28 |
import org.gvsig.online.lib.impl.OnlineCategories; |
29 |
import org.gvsig.tools.dynobject.Tags; |
30 |
|
31 |
/**
|
32 |
*
|
33 |
* @author gvSIG Team
|
34 |
*/
|
35 |
@SuppressWarnings("UseSpecificCatch") |
36 |
public class EntitiesTable extends AbstractTable { |
37 |
|
38 |
public static final String TABLE_NAME = OnlineWorkingcopy.TABLE_NAME_ENTITIES; |
39 |
|
40 |
public static final String COD_ENTITY = "COD_ENTITY"; |
41 |
public static final String ENTITY_NAME = "ENT_NAME"; |
42 |
private static final String ENTITY_STATE = "ENT_STATE"; |
43 |
private static final String FEATUREID_FIELD_NAME = "ENT_FEATURECODE"; |
44 |
private static final String GEOMETRY_FIELD_NAME = "ENT_GEOMNAME"; |
45 |
private static final String DESCRIPTION = "ENT_DESCRIPTION"; |
46 |
private static final String FIELD_FOR_LABEL = "ENT_FIELDFORLABEL"; |
47 |
private static final String FEATURETYPE = "ENT_FEATURETYPE"; |
48 |
private static final String LABEL = "ENT_LABEL"; |
49 |
private static final String DATA_MODELS = "ENT_DATA_MODELS"; |
50 |
private static final String CATEGORY = "ENT_CATEGORY"; |
51 |
private static final String ENT_PROJECTION = "ENT_PROJECTION"; |
52 |
private static final String ENT_CUSTOMDATA = "ENT_CUSTOMDATA"; |
53 |
private static final String ENT_TILESIZE = "ENT_TILESIZE"; |
54 |
|
55 |
public static class EntityRow extends AbstractRow implements OnlineEntityEditable { |
56 |
|
57 |
private FeatureType featureType;
|
58 |
private OnlineCategories categories;
|
59 |
|
60 |
public EntityRow(OnlineWorkingcopy workspace) {
|
61 |
super(workspace, TABLE_NAME, COD_ENTITY);
|
62 |
} |
63 |
|
64 |
public EntityRow(OnlineWorkingcopy workspace, Feature feature) {
|
65 |
super(workspace, TABLE_NAME, COD_ENTITY,feature);
|
66 |
} |
67 |
|
68 |
@Override
|
69 |
public String getEntityName() { |
70 |
return this.getString(ENTITY_NAME); |
71 |
} |
72 |
|
73 |
@Override
|
74 |
public String getFeatureIdFieldName() { |
75 |
return this.getString(FEATUREID_FIELD_NAME); |
76 |
} |
77 |
|
78 |
|
79 |
@Override
|
80 |
public String getGeometryFieldName() { |
81 |
return this.getString(GEOMETRY_FIELD_NAME); |
82 |
} |
83 |
|
84 |
@Override
|
85 |
public String getDescription() { |
86 |
return this.getString(DESCRIPTION); |
87 |
} |
88 |
|
89 |
@Override
|
90 |
public String getFieldForLabel() { |
91 |
return this.getString(FIELD_FOR_LABEL); |
92 |
} |
93 |
|
94 |
@Override
|
95 |
public String getEntityCode() { |
96 |
return this.getCode(); |
97 |
} |
98 |
|
99 |
@Override
|
100 |
public String getCategory() { |
101 |
return this.getString(CATEGORY); |
102 |
} |
103 |
|
104 |
@Override
|
105 |
public OnlineCategories getCategoriesAsList() {
|
106 |
if( this.categories == null ) { |
107 |
this.categories = new OnlineCategories(getCategory()); |
108 |
} |
109 |
return this.categories; |
110 |
} |
111 |
|
112 |
@Override
|
113 |
public Tags getCategoryTags(String category) { |
114 |
OnlineCategories l = getCategoriesAsList(); |
115 |
if( l==null ) { |
116 |
return Tags.EMPTY_TAGS;
|
117 |
} |
118 |
return l.getTags(category);
|
119 |
} |
120 |
|
121 |
@Override
|
122 |
public String getFirstCategory() { |
123 |
OnlineCategories l = getCategoriesAsList(); |
124 |
if( CollectionUtils.isEmpty(l) ) {
|
125 |
return null; |
126 |
} |
127 |
return l.get(0); |
128 |
} |
129 |
|
130 |
@Override
|
131 |
public String getFirstDataModel() { |
132 |
List<String> l = getDataModelsAsList(); |
133 |
if( CollectionUtils.isEmpty(l) ) {
|
134 |
return null; |
135 |
} |
136 |
return l.get(0); |
137 |
} |
138 |
|
139 |
@Override
|
140 |
public String getLabel() { |
141 |
return this.getString(LABEL); |
142 |
} |
143 |
|
144 |
@Override
|
145 |
public String getFeatureTypeAsJson() { |
146 |
return this.getString(FEATURETYPE); |
147 |
} |
148 |
|
149 |
@Override
|
150 |
public FeatureType getFeatureType() {
|
151 |
if (this.featureType == null) { |
152 |
String s = this.getFeatureTypeAsJson(); |
153 |
// s = StringUtils.replace(s, "\"\"", "\"");
|
154 |
JsonObject json = Json.createObject(s); |
155 |
this.featureType = DALLocator.getDataManager().createFeatureType(json);
|
156 |
} |
157 |
return this.featureType; |
158 |
} |
159 |
|
160 |
|
161 |
@Override
|
162 |
public EntityRow setEntityName(String entityName) { |
163 |
this.set(ENTITY_NAME, entityName);
|
164 |
if( StringUtils.isBlank(this.getLabel())) { |
165 |
this.setLabel(entityName);
|
166 |
} |
167 |
return this; |
168 |
} |
169 |
|
170 |
@Override
|
171 |
public EntityRow setFeatureIdFieldName(String name) { |
172 |
this.set(FEATUREID_FIELD_NAME, name);
|
173 |
return this; |
174 |
} |
175 |
|
176 |
@Override
|
177 |
public EntityRow setGeometryFieldName(String name) { |
178 |
this.set(GEOMETRY_FIELD_NAME, name);
|
179 |
return this; |
180 |
} |
181 |
|
182 |
@Override
|
183 |
public EntityRow setDescription(String description) { |
184 |
this.set(DESCRIPTION, description);
|
185 |
return this; |
186 |
} |
187 |
|
188 |
@Override
|
189 |
public EntityRow setFieldForLabel(String fieldForLabel) { |
190 |
this.set(FIELD_FOR_LABEL, fieldForLabel);
|
191 |
return this; |
192 |
} |
193 |
|
194 |
@Override
|
195 |
public EntityRow setFeatureTypeAsJson(String json) { |
196 |
this.set(FEATURETYPE, json);
|
197 |
this.featureType = null; |
198 |
return this; |
199 |
} |
200 |
|
201 |
public EntityRow setFeatureType(FeatureType featureType) {
|
202 |
this.set(FEATURETYPE, featureType.toJson().toString());
|
203 |
return this; |
204 |
} |
205 |
|
206 |
@Override
|
207 |
public OnlineEntityEditable setLabel(String label) { |
208 |
if(label != null){ |
209 |
this.set(LABEL, label);
|
210 |
} |
211 |
return this; |
212 |
} |
213 |
|
214 |
public long getCountLocalChanges() { |
215 |
return this.getCountLocalChanges(null); |
216 |
} |
217 |
|
218 |
public long getCountLocalChanges(DataTransaction transaction) { |
219 |
WorkspaceChangesTable changesTable = new WorkspaceChangesTable();
|
220 |
return changesTable.getCountLocalChangesOfEntity(workspace, transaction, this.getCode()); |
221 |
} |
222 |
|
223 |
public long getCountRemoteChanges(DataTransaction transaction) { |
224 |
RemoteChangesTable changesTable = new RemoteChangesTable();
|
225 |
return changesTable.getCountRemoteChangesOfEntity(workspace, transaction, this.getCode()); |
226 |
} |
227 |
|
228 |
/**
|
229 |
* Actualiza el estado si es necesario y retorna cierto si este ha cambiado.
|
230 |
* @return
|
231 |
*/
|
232 |
public boolean updateState() { |
233 |
return this.updateState(null); |
234 |
} |
235 |
|
236 |
public boolean updateState(DataTransaction transaction) { |
237 |
long countChanges;
|
238 |
int prevstate = this.getInt(ENTITY_STATE, -1); |
239 |
int state = prevstate;
|
240 |
if( state == -1 ) { |
241 |
state = OnlineManager.STATE_LOCAL_UNMODIFIED; |
242 |
this.setState(state);
|
243 |
} |
244 |
switch (state) {
|
245 |
case OnlineManager.STATE_DISCONNECTED:
|
246 |
case OnlineManager.STATE_CORRUPT:
|
247 |
return false; |
248 |
case OnlineManager.STATE_LOCAL_UNMODIFIED:
|
249 |
countChanges = this.getCountLocalChanges(transaction);
|
250 |
if (countChanges > 0) { |
251 |
state = OnlineManager.STATE_LOCAL_MODIFIED; |
252 |
if(this.isOutdated()){ |
253 |
state = OnlineManager.STATE_LOCAL_OUTDATED_AND_MODIFIED; |
254 |
} |
255 |
this.setState(state);
|
256 |
} else if(this.isOutdated()){ |
257 |
state = OnlineManager.STATE_LOCAL_OUTDATED; |
258 |
this.setState(state);
|
259 |
} |
260 |
break;
|
261 |
case OnlineManager.STATE_LOCAL_OUTDATED:
|
262 |
if(!this.isOutdated()){ |
263 |
countChanges = this.getCountLocalChanges(transaction);
|
264 |
if (countChanges > 0) { |
265 |
state = OnlineManager.STATE_LOCAL_MODIFIED; |
266 |
} else {
|
267 |
state = OnlineManager.STATE_LOCAL_UNMODIFIED; |
268 |
} |
269 |
} else {
|
270 |
countChanges = this.getCountLocalChanges(transaction);
|
271 |
if (countChanges > 0) { |
272 |
state = OnlineManager.STATE_LOCAL_OUTDATED_AND_MODIFIED; |
273 |
this.setState(state);
|
274 |
} |
275 |
} |
276 |
this.setState(state);
|
277 |
break;
|
278 |
case OnlineManager.STATE_LOCAL_MODIFIED:
|
279 |
countChanges = this.getCountLocalChanges(transaction);
|
280 |
if (countChanges == 0) { |
281 |
state = OnlineManager.STATE_LOCAL_UNMODIFIED; |
282 |
if(this.isOutdated()){ |
283 |
state = OnlineManager.STATE_LOCAL_OUTDATED; |
284 |
} |
285 |
} else {
|
286 |
if(this.isOutdated()){ |
287 |
state = OnlineManager.STATE_LOCAL_OUTDATED_AND_MODIFIED; |
288 |
} |
289 |
} |
290 |
|
291 |
this.setState(state);
|
292 |
break;
|
293 |
case OnlineManager.STATE_LOCAL_OUTDATED_AND_MODIFIED:
|
294 |
if(!this.isOutdated()){ |
295 |
countChanges = this.getCountLocalChanges(transaction);
|
296 |
if (countChanges > 0) { |
297 |
state = OnlineManager.STATE_LOCAL_MODIFIED; |
298 |
this.setState(state);
|
299 |
} else {
|
300 |
state = OnlineManager.STATE_LOCAL_UNMODIFIED; |
301 |
} |
302 |
} else {
|
303 |
countChanges = this.getCountLocalChanges(transaction);
|
304 |
if (countChanges > 0) { |
305 |
state = OnlineManager.STATE_LOCAL_OUTDATED_AND_MODIFIED; |
306 |
this.setState(state);
|
307 |
} else {
|
308 |
state = OnlineManager.STATE_LOCAL_OUTDATED; |
309 |
} |
310 |
} |
311 |
this.setState(state);
|
312 |
break;
|
313 |
|
314 |
case OnlineManager.STATE_LOCAL_NEW:
|
315 |
countChanges = this.getCountLocalChanges(transaction);
|
316 |
if (countChanges > 0) { |
317 |
state = OnlineManager.STATE_LOCAL_MODIFIED; |
318 |
if(this.isOutdated()){ |
319 |
state = OnlineManager.STATE_LOCAL_OUTDATED_AND_MODIFIED; |
320 |
} |
321 |
} else {
|
322 |
state = OnlineManager.STATE_LOCAL_UNMODIFIED; |
323 |
} |
324 |
this.setState(state);
|
325 |
break;
|
326 |
case OnlineManager.STATE_CONFLICT:
|
327 |
//TODO: Migrar a VCSGIS
|
328 |
long countLocalChanges = this.getCountLocalChanges(transaction); |
329 |
long countRemoteChanges = this.getCountRemoteChanges(transaction); |
330 |
if (countRemoteChanges < 1 && countLocalChanges < 1) { |
331 |
state = OnlineManager.STATE_LOCAL_UNMODIFIED; |
332 |
} else if (countRemoteChanges < 1 && countLocalChanges > 0) { |
333 |
state = OnlineManager.STATE_LOCAL_MODIFIED; |
334 |
} else if (countRemoteChanges > 0 && countLocalChanges < 1) { |
335 |
state = OnlineManager.STATE_REMOTE_MODIFIED; |
336 |
} else if (countRemoteChanges > 0 && countLocalChanges > 0) { |
337 |
state = OnlineManager.STATE_CONFLICT; |
338 |
} else {
|
339 |
LOGGER.warn("Por aqui no deberia pasar");
|
340 |
state = OnlineManager.STATE_CORRUPT; |
341 |
} |
342 |
this.setState(state);
|
343 |
break;
|
344 |
|
345 |
default:
|
346 |
if(this.isOutdated()){ |
347 |
state = OnlineManager.STATE_LOCAL_OUTDATED; |
348 |
this.setState(state);
|
349 |
} |
350 |
} |
351 |
return prevstate != state;
|
352 |
} |
353 |
|
354 |
@Override
|
355 |
public int getState() { |
356 |
// this.updateState();
|
357 |
int state = this.getInt(ENTITY_STATE); |
358 |
return state;
|
359 |
} |
360 |
|
361 |
private boolean isOutdated() { |
362 |
return false; |
363 |
// final String repositoryRevisionCode = this.getRepositoryRevisionCode();
|
364 |
// if(StringUtils.isBlank(repositoryRevisionCode)){
|
365 |
// return false;
|
366 |
// }
|
367 |
// return !StringUtils.equalsIgnoreCase(repositoryRevisionCode,this.getLocalRevisionCode());
|
368 |
} |
369 |
|
370 |
public String getStateLabel() { |
371 |
return OnlineUtils.getStateLabel(this.getState()); |
372 |
} |
373 |
|
374 |
public void setState(int state) { |
375 |
this.set(ENTITY_STATE, state);
|
376 |
} |
377 |
|
378 |
@Override
|
379 |
public void update() { |
380 |
super.update();
|
381 |
} |
382 |
|
383 |
@Override
|
384 |
public OnlineEntityEditable getValue() {
|
385 |
return this; |
386 |
} |
387 |
|
388 |
@Override
|
389 |
public String toString() { |
390 |
return OnlineUtils.getLabelOrName(this); |
391 |
} |
392 |
|
393 |
@Override
|
394 |
public EntityRow setEntityCode(String code) { |
395 |
this.setCode(code);
|
396 |
return this; |
397 |
} |
398 |
|
399 |
@Override
|
400 |
public void copyfrom(OnlineEntity entity) { |
401 |
OnlineUtils.copy(entity, this, null); |
402 |
} |
403 |
|
404 |
@Override
|
405 |
public void copyto(OnlineEntityEditable entity) { |
406 |
OnlineUtils.copy(this, entity, null); |
407 |
} |
408 |
|
409 |
@Override
|
410 |
public JsonObject toJson() {
|
411 |
return this.toJsonBuilder().build(); |
412 |
} |
413 |
|
414 |
@Override
|
415 |
public JsonObjectBuilder toJsonBuilder() {
|
416 |
return OnlineUtils.toJsonBuilder(this, null); |
417 |
} |
418 |
|
419 |
@Override
|
420 |
public void fromJson(JsonObject json) { |
421 |
OnlineUtils.fromJson(this, json);
|
422 |
} |
423 |
|
424 |
@Override
|
425 |
public OnlineEntityEditable setDataModels(String dataModels) { |
426 |
this.set(DATA_MODELS, dataModels);
|
427 |
return this; |
428 |
} |
429 |
|
430 |
@Override
|
431 |
public String getDataModels() { |
432 |
return this.getString(DATA_MODELS); |
433 |
} |
434 |
|
435 |
@Override
|
436 |
public List<String> getDataModelsAsList() { |
437 |
String s = getDataModels();
|
438 |
return OnlineUtils.getAsList(s, false); |
439 |
} |
440 |
|
441 |
@Override
|
442 |
public String getLabelOrName() { |
443 |
return OnlineUtils.getLabelOrName(this); |
444 |
} |
445 |
|
446 |
@Override
|
447 |
public String getCRS() { |
448 |
return this.getString(ENT_PROJECTION); |
449 |
} |
450 |
|
451 |
@Override
|
452 |
public IProjection getCRSAsProjection() {
|
453 |
String s = this.getString(ENT_PROJECTION); |
454 |
if( StringUtils.isBlank(s) ) {
|
455 |
return null; |
456 |
} |
457 |
return CRSFactory.getCRS(s);
|
458 |
} |
459 |
|
460 |
@Override
|
461 |
public String getCustomData() { |
462 |
return this.getString(ENT_CUSTOMDATA); |
463 |
} |
464 |
|
465 |
@Override
|
466 |
public int getTileSize() { |
467 |
return this.getInt(ENT_TILESIZE); |
468 |
} |
469 |
|
470 |
@Override
|
471 |
public OnlineEntityEditable setCRS(IProjection crs) {
|
472 |
this.set(ENT_PROJECTION, crs.getAbrev());
|
473 |
return this; |
474 |
} |
475 |
|
476 |
@Override
|
477 |
public OnlineEntityEditable setCRS(String crs) { |
478 |
this.set(ENT_PROJECTION, crs);
|
479 |
return this; |
480 |
} |
481 |
|
482 |
@Override
|
483 |
public OnlineEntityEditable setCustomData(String customData) { |
484 |
this.set(ENT_CUSTOMDATA, customData);
|
485 |
return this; |
486 |
} |
487 |
|
488 |
@Override
|
489 |
public OnlineEntityEditable setTileSize(int tileSize) { |
490 |
this.set(ENT_TILESIZE, tileSize);
|
491 |
return this; |
492 |
} |
493 |
|
494 |
} |
495 |
|
496 |
|
497 |
public EntitiesTable() {
|
498 |
super(TABLE_NAME, featureType());
|
499 |
} |
500 |
|
501 |
public EntityRow getByEntityName(OnlineWorkingcopy workspace, String entityName) { |
502 |
FeatureStore store = null;
|
503 |
try {
|
504 |
store = workspace.getFeatureStore(TABLE_NAME); |
505 |
Feature f = store.findFirst("\"" + ENTITY_NAME + "\"='" + entityName + "'"); |
506 |
if (f == null) { |
507 |
return null; |
508 |
} |
509 |
EntityRow row = new EntityRow(workspace, f);
|
510 |
return row;
|
511 |
} catch (Exception ex) { |
512 |
throw new RuntimeException("Can't retrieve entity '" + entityName + "'.", ex); |
513 |
} finally {
|
514 |
DisposeUtils.disposeQuietly(store); |
515 |
} |
516 |
} |
517 |
|
518 |
public EntityRow getByEntityCode(OnlineWorkingcopy workspace, String entityCode) { |
519 |
FeatureStore store = null;
|
520 |
try {
|
521 |
store = workspace.getFeatureStore(TABLE_NAME); |
522 |
Feature f = store.findFirst("\"" + COD_ENTITY + "\"='" + entityCode + "'"); |
523 |
if (f == null) { |
524 |
return null; |
525 |
} |
526 |
EntityRow row = new EntityRow(workspace, f);
|
527 |
return row;
|
528 |
} catch (Exception ex) { |
529 |
throw new RuntimeException("Can't retrieve entity '" + entityCode + "'.", ex); |
530 |
} finally {
|
531 |
DisposeUtils.disposeQuietly(store); |
532 |
} |
533 |
} |
534 |
|
535 |
public DisposableFeatureSetIterable getAll(OnlineWorkingcopy workspace) {
|
536 |
FeatureStore store = null;
|
537 |
try {
|
538 |
store = workspace.getFeatureStore(TABLE_NAME); |
539 |
DisposableFeatureSetIterable items = store.getFeatureSet().iterable(); |
540 |
return items;
|
541 |
} catch (Exception ex) { |
542 |
throw new RuntimeException("Can't retrieve all entities.", ex); |
543 |
} finally {
|
544 |
if (store != null) { |
545 |
DisposeUtils.dispose(store); |
546 |
} |
547 |
} |
548 |
} |
549 |
|
550 |
public static final FeatureType featureType() { |
551 |
DataManager dataManager = DALLocator.getDataManager(); |
552 |
EditableFeatureType ft = dataManager.createFeatureType(); |
553 |
ft.setLabel("VCSGIS Entities");
|
554 |
ft.getTags().set("ID", TABLE_NAME);
|
555 |
ft.add(COD_ENTITY, DataTypes.STRING) |
556 |
.setSize(OnlineManager.ONLINECODELEN) |
557 |
.setIsPrimaryKey(true)
|
558 |
.setLabel("Code");
|
559 |
ft.add(ENTITY_NAME, DataTypes.STRING) |
560 |
.setIsIndexed(true)
|
561 |
.setAllowIndexDuplicateds(false)
|
562 |
.setSize(200)
|
563 |
.setLabel("Name");
|
564 |
ft.add(FEATUREID_FIELD_NAME, DataTypes.STRING) |
565 |
.setSize(200)
|
566 |
.setLabel("Pk field name")
|
567 |
.setDescription("Name of the primary key of the table.");
|
568 |
ft.add(ENTITY_STATE, DataTypes.INTEGER) |
569 |
.setLabel("State")
|
570 |
.setDescription("State of entity.");
|
571 |
ft.add(GEOMETRY_FIELD_NAME, DataTypes.STRING) |
572 |
.setSize(200)
|
573 |
.setLabel("Geometry field name")
|
574 |
.setDescription("Name of the geometry attribute.");
|
575 |
ft.add(FIELD_FOR_LABEL, DataTypes.STRING) |
576 |
.setSize(200)
|
577 |
.setLabel("Field for label");
|
578 |
ft.add(LABEL, DataTypes.STRING) |
579 |
.setSize(200)
|
580 |
.setLabel("Label");
|
581 |
ft.add(DESCRIPTION, DataTypes.STRING) |
582 |
.setSize(RECOMENDED_SIZE_FOR_CLOB) |
583 |
.setLabel("Description");
|
584 |
ft.add(FEATURETYPE, DataTypes.STRING) |
585 |
.setSize(RECOMENDED_SIZE_FOR_CLOB) |
586 |
.setLabel("Feature type");
|
587 |
ft.add(DATA_MODELS, DataTypes.STRING) |
588 |
.setSize(200)
|
589 |
.setLabel("Data models");
|
590 |
ft.add(ENT_PROJECTION, DataTypes.STRING) |
591 |
.setSize(100)
|
592 |
.setLabel("Projection");
|
593 |
|
594 |
ft.add(ENT_TILESIZE, DataTypes.INTEGER) |
595 |
.setLabel("Tile size");
|
596 |
|
597 |
ft.add(ENT_CUSTOMDATA, DataTypes.STRING) |
598 |
.setTag(DynFormSPIManager.TAG_DYNFORM_RESIZEWEIGHT, 60)
|
599 |
.setTag(DynFormSPIManager.TAG_DYNFORM_LABEL_EMPTY, true)
|
600 |
.setDataProfileName("Text")
|
601 |
.setSize(RECOMENDED_SIZE_FOR_CLOB) |
602 |
.setLabel("Custom data")
|
603 |
.setGroup("Custom data")
|
604 |
.setOrder(10);
|
605 |
|
606 |
return ft.getNotEditableCopy();
|
607 |
} |
608 |
|
609 |
} |