-
Notifications
You must be signed in to change notification settings - Fork 7
Wiki aliases #3165
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
Wiki aliases #3165
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cd69c2b
Wiki aliases
labkey-adam ffb0703
Fix NPE when not renaming. Constraint violation -> error message.
labkey-adam 4909d8c
Delete aliases on container and wiki delete. Log redirects. Focus on …
labkey-adam b7372ef
Disallow renaming on the edit wiki page
labkey-adam 3d632d0
Allow editing alias list. Render multiple errors, if present.
labkey-adam 8436545
Make aliases case-insensitive (constraint, resolution, sorting). RowI…
labkey-adam 6ccafb4
Use UNIQUE INDEX on SQL Server as well; not required, but more consis…
labkey-adam 3bbd9b1
Update api/src/org/labkey/api/view/PermanentRedirectException.java
labkey-adam 43a3a8a
Simplify name change handling
labkey-adam 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
8 changes: 8 additions & 0 deletions
8
announcements/resources/schemas/dbscripts/postgresql/comm-22.000-22.001.sql
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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| CREATE TABLE comm.PageAliases | ||
| ( | ||
| Container ENTITYID NOT NULL, | ||
| Alias VARCHAR(255) NOT NULL, | ||
| RowId INT NOT NULL, | ||
|
|
||
| CONSTRAINT PK_PageAliases PRIMARY KEY (Container, Alias) | ||
| ); | ||
5 changes: 5 additions & 0 deletions
5
announcements/resources/schemas/dbscripts/postgresql/comm-22.001-22.002.sql
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ALTER TABLE comm.PageAliases RENAME COLUMN RowId TO PageRowId; | ||
|
|
||
| -- Aliases should be case-insensitive | ||
| ALTER TABLE comm.PageAliases DROP CONSTRAINT PK_PageAliases; | ||
| CREATE UNIQUE INDEX UQ_PageAliases ON comm.PageAliases (Container, LOWER(Alias)); |
8 changes: 8 additions & 0 deletions
8
announcements/resources/schemas/dbscripts/sqlserver/comm-22.000-22.001.sql
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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| CREATE TABLE comm.PageAliases | ||
| ( | ||
| Container ENTITYID NOT NULL, | ||
| Alias NVARCHAR(255) NOT NULL, | ||
| RowId INT NOT NULL, | ||
|
|
||
| CONSTRAINT PK_PageAliases PRIMARY KEY (Container, Alias) | ||
| ); |
1 change: 1 addition & 0 deletions
1
announcements/resources/schemas/dbscripts/sqlserver/comm-22.001-22.002.sql
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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| EXEC sp_rename 'comm.PageAliases.RowId', 'PageRowId', 'COLUMN'; |
3 changes: 3 additions & 0 deletions
3
announcements/resources/schemas/dbscripts/sqlserver/comm-22.002-22.003.sql
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| -- Switch from PK to UNIQUE INDEX to match PostgreSQL | ||
| ALTER TABLE comm.PageAliases DROP CONSTRAINT PK_PageAliases; | ||
| CREATE UNIQUE INDEX UQ_PageAliases ON comm.PageAliases (Container, Alias); |
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
21 changes: 21 additions & 0 deletions
21
api/src/org/labkey/api/view/PermanentRedirectException.java
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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package org.labkey.api.view; | ||
|
|
||
| import org.jetbrains.annotations.NotNull; | ||
| import org.labkey.api.util.URLHelper; | ||
|
|
||
| import javax.servlet.http.HttpServletResponse; | ||
|
|
||
| /** Use when we want search engines, browsers, etc to assume that the redirecting URL is defunct and the target URL should be used going forward */ | ||
| public class PermanentRedirectException extends RedirectException | ||
labkey-adam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| public PermanentRedirectException(@NotNull URLHelper url) | ||
| { | ||
| super(url); | ||
| } | ||
|
|
||
| @Override | ||
| public int getHttpStatusCode() | ||
| { | ||
| return HttpServletResponse.SC_MOVED_PERMANENTLY; | ||
| } | ||
| } | ||
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
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.