This repository was archived by the owner on Aug 3, 2021. It is now read-only.
#81: Backport all changes to 3.7.x#84
Open
oarrietadotcms wants to merge 2 commits into
Open
Conversation
jdotcms
reviewed
Apr 10, 2018
| @Consumes(MediaType.MULTIPART_FORM_DATA) | ||
| @Produces({MediaType.APPLICATION_JSON, "application/javascript"}) | ||
| public final Response createIdpConfig(@Context final HttpServletRequest req, | ||
| @FormDataParam("id") String id, |
Contributor
There was a problem hiding this comment.
it would be easy just to encapsulate it into a Form
Contributor
Author
There was a problem hiding this comment.
do you have an example of this?
| return response; | ||
| } // deleteIdpConfig. | ||
|
|
||
| @POST |
Contributor
There was a problem hiding this comment.
this should be PUT since it is an update
| @Consumes(MediaType.MULTIPART_FORM_DATA) | ||
| @Produces({MediaType.APPLICATION_JSON, "application/javascript"}) | ||
| public final Response saveDisabledSited(@Context final HttpServletRequest req, | ||
| @FormDataParam("disabledsites") String disabledSites) { |
Contributor
There was a problem hiding this comment.
It would be better to use a Form Bean here
Contributor
Author
There was a problem hiding this comment.
Again, if you have an example it would be great!
| import java.util.Objects; | ||
| import java.util.Properties; | ||
|
|
||
| public class IdpConfig { |
Contributor
There was a problem hiding this comment.
I wonder why it is not a immutable bean
|
|
||
| public List<IdpConfig> getIdpConfigs() throws IOException, JSONException { | ||
| final List<IdpConfig> idpConfigs = IdpConfigWriterReader.readIdpConfigs(new File(idpfilePath)); | ||
| //Collections.sort(idpConfigs, new IdpConfigComparator()); |
| public static String readDefaultIdpConfigId(final File idpConfigFile) throws IOException, JSONException { | ||
| String defaultIdpConfigId = ""; | ||
|
|
||
| if (idpConfigFile.exists()) { |
| public static List<IdpConfig> readIdpConfigs(final File idpConfigFile) throws IOException, JSONException { | ||
| List<IdpConfig> idpConfigList = new ArrayList<>(); | ||
|
|
||
| if (idpConfigFile.exists()) { |
| public class SiteJsonTransformer { | ||
|
|
||
| public static JSONObject getJsonObjecFromtMap(Map<String, String> map) throws JSONException { | ||
| JSONObject jo = new JSONObject(); |
| import java.util.concurrent.atomic.AtomicInteger; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class IdpConfigPaginator implements Paginator<IdpConfig> { |
| if (UtilMethods.isSet(filter)){ | ||
| idpConfigs = idpConfigs.stream() | ||
| .filter(x -> x.contains(filter)) | ||
| .collect(Collectors.toList()); |
Contributor
There was a problem hiding this comment.
You can use CollectionUtils.toImmutableList()
Contributor
There was a problem hiding this comment.
Sorry you can not, it is on 4.x not on 3.x
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.