-
Notifications
You must be signed in to change notification settings - Fork 68
Refactor Bean Scopes: User, Role, Authority, Client, LdapGroup, LdapServer forms #6770
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
Open
thomaslow
wants to merge
24
commits into
kitodo:main
Choose a base branch
from
thomaslow:refactor-bean-scopes-user-form
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f12ff8e
Refactor bean scopes of user, client, ldap server, ldap group, author…
thomaslow 2b44a7f
Merge branch 'main' into refactor-bean-scopes-user-form
thomaslow a11c17f
Replace constructor with init method in AuthorityListView.
thomaslow 99b5f3d
Remove LdapGroupEditView constructor.
thomaslow c45878e
Remove constructor in LdapServerListView.
thomaslow 8867c42
Improve javadoc.
thomaslow 5c42a97
Navigate to respective list view tab after editing an ldap group or s…
thomaslow 4a92d58
Switch to appropriate tab via tabIndex query parameter.
thomaslow c2f5555
Use Javascript to update tabIndex query parameter when switching tabs.
thomaslow 8e3f152
Update activeTabIndex to use UsersTabView.
thomaslow 55bbe44
Fix codacy errors.
thomaslow 262469b
Merge branch 'main' into refactor-bean-scopes-user-form
thomaslow a5000d2
Update user edit view metadata tab after merge with pagination editor…
thomaslow 7f7637a
Move session scoped keepPagination logic into URL query parameter rem…
thomaslow 256a4ab
Encode list view sort state as URL query parameters such that they ca…
thomaslow 2424379
Fix filter menu in user list view.
thomaslow ae438fe
Add missing @Override annotations.
thomaslow 8f76917
Fix selenium tests due to addtional list view url query paramaters in…
thomaslow 1d8eff7
Encode current user list filter as query parameter such that is persi…
thomaslow 9c28cf9
Fix newly saved filters are not listed.
thomaslow f241a34
Add more javadoc.
thomaslow d0f1cbf
Merge branch 'main' into refactor-bean-scopes-user-form
thomaslow a713588
Replace referrerFirstRow view parameter with updated referrerListOpti…
thomaslow d861371
Merge branch 'main' into refactor-bean-scopes-user-form
thomaslow 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
60 changes: 60 additions & 0 deletions
60
Kitodo/src/main/java/org/kitodo/production/forms/AuthorityListView.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,60 @@ | ||
| /* | ||
| * (c) Kitodo. Key to digital objects e. V. <[email protected]> | ||
| * | ||
| * This file is part of the Kitodo project. | ||
| * | ||
| * It is licensed under GNU General Public License version 3 or later. | ||
| * | ||
| * For the full copyright and license information, please read the | ||
| * GPL3-License.txt file that was distributed with this source code. | ||
| */ | ||
|
|
||
| package org.kitodo.production.forms; | ||
|
|
||
| import java.text.MessageFormat; | ||
| import java.util.Set; | ||
|
|
||
| import jakarta.annotation.PostConstruct; | ||
| import jakarta.faces.view.ViewScoped; | ||
| import jakarta.inject.Named; | ||
|
|
||
| import org.kitodo.production.model.LazyBeanModel; | ||
| import org.kitodo.production.services.ServiceManager; | ||
| import org.primefaces.model.SortMeta; | ||
| import org.primefaces.model.SortOrder; | ||
|
|
||
| @Named("AuthorityListView") | ||
| @ViewScoped | ||
| public class AuthorityListView extends BaseListView { | ||
|
|
||
| public static final String VIEW_PATH = MessageFormat.format(REDIRECT_PATH, "users") + "&tabIndex=3"; | ||
|
|
||
| /** | ||
| * Initialize AuthorityListView. | ||
| */ | ||
| @PostConstruct | ||
| public void init() { | ||
| setLazyBeanModel(new LazyBeanModel(ServiceManager.getAuthorityService())); | ||
| sortBy = SortMeta.builder().field("title").order(SortOrder.ASCENDING).build(); | ||
| } | ||
|
|
||
| /** | ||
| * Navigate to the authority edit page to create a new authority. | ||
| * | ||
| * @return page address | ||
| */ | ||
| public String newAuthority() { | ||
| return AuthorityEditView.VIEW_PATH; | ||
| } | ||
|
|
||
| /** | ||
| * The set of allowed sort fields (columns) to sanitize the URL query parameter "sortField". | ||
| * | ||
| * @return the set of allowed sort fields (columns) | ||
| */ | ||
| @Override | ||
| protected Set<String> getAllowedSortFields() { | ||
| return Set.of("title", "type"); | ||
| } | ||
|
|
||
| } | ||
44 changes: 44 additions & 0 deletions
44
Kitodo/src/main/java/org/kitodo/production/forms/BaseEditView.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,44 @@ | ||
| /* | ||
| * (c) Kitodo. Key to digital objects e. V. <[email protected]> | ||
| * | ||
| * This file is part of the Kitodo project. | ||
| * | ||
| * It is licensed under GNU General Public License version 3 or later. | ||
| * | ||
| * For the full copyright and license information, please read the | ||
| * GPL3-License.txt file that was distributed with this source code. | ||
| */ | ||
|
|
||
| package org.kitodo.production.forms; | ||
|
|
||
| /** | ||
| * Base class for an edit view. | ||
| * | ||
| * <p>Manages the view state, e.g. forwarded list view options via URL query parameters.</p> | ||
| * | ||
| * <p>(BaseForm methods specific to edit views should be moved here in the future)</p> | ||
| */ | ||
| public class BaseEditView extends BaseForm { | ||
|
|
||
| protected String referrerListOptions; | ||
|
|
||
| /** | ||
| * Return the list options (URL query parameters) that were used while browsing a list before navigating to an edit view. | ||
| * | ||
| * @return the referrer list view options (URL query parameters) | ||
| */ | ||
| public String getReferrerListOptions() { | ||
| return referrerListOptions; | ||
| } | ||
|
|
||
| /** | ||
| * Set the list options (URL query parameters) that were used while browsing a list before navigating to an edit view. | ||
| * | ||
| * @param referrerListOptions the referrer list options (URL query parameters) | ||
| */ | ||
| public void setReferrerListOptionsFromTemplate(String referrerListOptions) { | ||
| this.referrerListOptions = referrerListOptions; | ||
| } | ||
|
|
||
|
|
||
| } |
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.
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.