-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve FeatureTypeEditor to provide fields for setting attributes restrictions #233
Conversation
restrictions Signed-off-by: Nikolaos Pringouris <[email protected]>
Tested additional attributes and I'm wondering about null Allowed check. I set name to false and I could create features without a name while the attribute lenght is validated in the table view
I haven't got any feedback for the null-check on edits and on commit. Question : How can we avoid confusing users if e.g. the user selects integer as type and inputs 99 fir attribut lenght. The second configuration doesn't really make sence because of the type itself:
It seems to me, that dependent of the selected type the options may be different. I guess this dialog should be redesigned a bit, e.g. splitted view with attributes on the top and in a detail the possible configuration dependet of the selected type. @nprigour What do you think? |
The enhancement just provides the ability to define restrictions during creation of featureTypes not to impose them when creating/editing features. The result will largely depend on whether they featureType refers to a shapefile layer or a jdbc layer. You can check the constraints by selecting a layer and then right clicking to Properties-->Summary-->Feature Type |
I guess we need to check. I expected a null-value rasther then an empty string is set if the user doesn't input anything/ leaving unset.
Is this a bug in uDig? Maybe I miss something but I expected a validation/check on feature creation if a feature type has such restictions .. Would you please help me to understand, why and how this improvement helps users? What a user cannot do, if the feature isn't present? Many thanks for clarification! |
Hi @fgdrf
Regarding null values indeed I checked it. The values set if you left the a String field empty is empty string and not null and that is the reason it accepts the value. Also both editors are not capable to handle/accept null values in numeric fields or Date types. However all these are really editing issues and not related to the present pull request. If you want you can create another issue on that and address it seperately. |
This was the missing puzzle that helps a lot!
Great to sort out. Now my understanding is that this is an additional feature to support restictions for several data stores that has support for these. Editing features could be improved on the other hand to verify created features before the user tries to commit invalid features which fails on another level Many thanks |
@@ -807,4 +891,26 @@ public void setErrorMessage( String errorMessage ) { | |||
errorDecorator.showHoverText(errorMessage); | |||
} | |||
|
|||
/** | |||
* @param editElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to see a vaild javadoc and only one @return
statement ;)
However, does it make sense to check restrictionName
for null and convert toLowerCase()
for comparision as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK this was addressed as well as some other minor issues
builder.length(MAX_ATTRIBUTE_LENGTH).add(Messages.FeatureTypeEditor_defaultNameAttributeName, String.class); | ||
builder.add(Messages.FeatureTypeEditor_defaultGeometryName, LineString.class); | ||
//no need to provide a default length since length can be specified via the UI | ||
//builder.length(MAX_ATTRIBUTE_LENGTH).add(Messages.FeatureTypeEditor_defaultNameAttributeName, String.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the constant MAX_ATTRIBUTE_LENGTH referenced somewhere else or coult it be deleted? IMHO the comment on the constant indicates that it is a specific value for a specific database which might not make any sense for other storage types (file/other databases)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is not used. Initialy it was used for setting a default length for the lenght of an attribute but this become obsolete since the new column for etting lenght was intriduced
Signed-off-by: Nikolaos Pringouris <[email protected]>
Signed-off-by: Nikolaos Pringouris <[email protected]>
user docs updated |
8871142
to
3d21066
Compare
Looks like FeatureTypeEditor has som conflicts we need to resolve. @nprigour would you please have a look at, I cannot resolve it with my cellphone ;) |
Signed-off-by: Nikolaos Pringouris <[email protected]>
it should be OK for merge now. Note: I did not enabled skipped FeatureEditorTest since it will result in another conflict. You can do it after merge of this to master branch |
Looks like I have to resolve conflicts manually and I need my developer env to do so. Going to merge it next Wednesday! Stay tuned and many thanks for this new feature! |
strange because yesterday I tried to merge this branch to the master one (in my local working directory) and it succeeded So I assumed that there will be no conficts also when merging the pull request |
Maybe it’s because of the commit for test activations which i‘ve Picked to
master and has a different commit hash
However, going to fix it
nprigour <[email protected]> schrieb am Do. 5. Apr. 2018 um 19:07:
… strange because yesterday I tried to merge this branch to the master one
(in my local working directory) and it succeeded So I assumed that there
will be no conficts also when merging the pull request
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#233 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAnUhVknTum751kmEdUMmHy8r6wd-W9Eks5tlk88gaJpZM4NnTFF>
.
|
merged to master ✅ |
The pull request improves FeatureTypeEditor UI (launched during 'create feature type' or 'add feature type' operations) so that:
FeatureTypeEditor improvement.pdf
Signed-off-by: Nikolaos Pringouris [email protected]