-
Notifications
You must be signed in to change notification settings - Fork 7
Add DomainUtil.getNamesAndLabels utility method for use in reserving variants of column names
#7060
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0304253
More commonality in how we reserve names for domains
labkey-susanh e09cda4
Issue 53416: Don't allow * as a field name
labkey-susanh 4ddbe0d
Update error message
labkey-susanh a84ac6e
More commonality in how we reserve names for domains
labkey-susanh 826833c
Issue 53416: Don't allow * as a field name
labkey-susanh 9e8611d
Update error message
labkey-susanh bea766e
Relocated utility method
labkey-susanh b5f5897
More consistency in reserving names and labels of fields
labkey-susanh 9eab00c
Merge branch 'fb_reservedFields' of https://github.com/LabKey/platfor…
labkey-susanh 0f97b79
Add missing field
labkey-susanh 83c436d
Add missing "Container" class
labkey-susanh 1a7f0f2
Merge remote-tracking branch 'origin/develop' into fb_reservedFields
labkey-susanh 61a70c1
Merge remote-tracking branch 'origin/develop' into fb_reservedFields
labkey-susanh 43927be
Typo
labkey-susanh c0e13ac
Reduce number of sets we are constructing
labkey-susanh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,12 +15,11 @@ | |
| */ | ||
| package org.labkey.api.query; | ||
|
|
||
| import com.google.common.base.Function; | ||
| import com.google.common.collect.Iterables; | ||
| import com.google.common.collect.Sets; | ||
| import org.apache.commons.lang3.StringUtils; | ||
| import org.jetbrains.annotations.NotNull; | ||
| import org.jetbrains.annotations.Nullable; | ||
| import org.json.JSONObject; | ||
| import org.labkey.api.collections.CaseInsensitiveHashSet; | ||
| import org.labkey.api.data.ColumnInfo; | ||
| import org.labkey.api.data.Container; | ||
| import org.labkey.api.data.ContainerType; | ||
|
|
@@ -34,6 +33,7 @@ | |
| import org.labkey.api.exp.api.ExperimentUrls; | ||
| import org.labkey.api.exp.property.BaseAbstractDomainKind; | ||
| import org.labkey.api.exp.property.Domain; | ||
| import org.labkey.api.exp.property.DomainUtil; | ||
| import org.labkey.api.exp.property.PropertyService; | ||
| import org.labkey.api.exp.xar.LsidUtils; | ||
| import org.labkey.api.gwt.client.model.GWTDomain; | ||
|
|
@@ -242,21 +242,16 @@ public boolean canEditDefinition(User user, Domain domain) | |
| } | ||
|
|
||
| @Override | ||
| public Set<String> getReservedPropertyNames(Domain domain, User user) | ||
| public @NotNull Set<String> getReservedPropertyNames(Domain domain, User user) | ||
| { | ||
| SimpleUserSchema.SimpleTable table = domain != null ? getTable(domain, user) : null; | ||
| if (table != null) | ||
| { | ||
| // return the set of built-in column names. | ||
| return Sets.newHashSet(Iterables.transform(table.getBuiltInColumns(), | ||
| new Function<ColumnInfo, String>() { | ||
| @Override | ||
| public String apply(ColumnInfo col) | ||
| { | ||
| return col.getName(); | ||
| } | ||
| } | ||
| )); | ||
| Set<String> set = new CaseInsensitiveHashSet(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is done in DomainUtil then this change is not needed. |
||
| ((Iterable<ColumnInfo>) table.getBuiltInColumns()).forEach(col -> { | ||
| set.addAll(DomainUtil.getNameAndLabels(col.getName())); | ||
| }); | ||
| return set; | ||
| } | ||
| return Collections.emptySet(); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.