You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by pvillard31 <gi...@git.apache.org> on 2017/06/27 13:12:47 UTC

[GitHub] nifi pull request #1953: NIFI-4130 Add lookup controller service in Transfor...

GitHub user pvillard31 opened a pull request:

    https://github.com/apache/nifi/pull/1953

    NIFI-4130 Add lookup controller service in TransformXML to define XSL…

    …T from the UI
    
    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [X] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [X] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [X] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [X] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [X] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [X] Have you written or updated unit tests to verify your changes?
    - [X] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pvillard31/nifi xslt-text-property

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1953.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1953
    
----
commit dccf15527f64ad7629b90e490b2261321df8ee96
Author: Pierre Villard <pi...@gmail.com>
Date:   2017-06-26T15:48:06Z

    NIFI-4130 Add lookup controller service in TransformXML to define XSLT from the UI

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1953: NIFI-4130 Add lookup controller service in TransformXML to...

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on the issue:

    https://github.com/apache/nifi/pull/1953
  
    Hey @bdesert - I just rebased the PR. I'll probably add a warning about adding large XSLTs in a StringLookupService as it'll be in memory.


---

[GitHub] nifi issue #1953: NIFI-4130 Add lookup controller service in TransformXML to...

Posted by bdesert <gi...@git.apache.org>.
Github user bdesert commented on the issue:

    https://github.com/apache/nifi/pull/1953
  
    Reviewing...


---

[GitHub] nifi issue #1953: NIFI-4130 Add lookup controller service in TransformXML to...

Posted by mattyb149 <gi...@git.apache.org>.
Github user mattyb149 commented on the issue:

    https://github.com/apache/nifi/pull/1953
  
    +1 LGTM, thanks for the review @bdesert and the improvement @pvillard31 ! Merging to master


---

[GitHub] nifi pull request #1953: NIFI-4130 Add lookup controller service in Transfor...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/1953


---

[GitHub] nifi pull request #1953: NIFI-4130 Add lookup controller service in Transfor...

Posted by bdesert <gi...@git.apache.org>.
Github user bdesert commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1953#discussion_r233016908
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java ---
    @@ -82,12 +94,32 @@
     
         public static final PropertyDescriptor XSLT_FILE_NAME = new PropertyDescriptor.Builder()
                 .name("XSLT file name")
    -            .description("Provides the name (including full path) of the XSLT file to apply to the flowfile XML content.")
    -            .required(true)
    +            .description("Provides the name (including full path) of the XSLT file to apply to the flowfile XML content."
    +                    + "One of the XSLT file name and XSLT controller properties must be defined.")
    +            .required(false)
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .addValidator(StandardValidators.FILE_EXISTS_VALIDATOR)
                 .build();
     
    +    public static final PropertyDescriptor XSLT_CONTROLLER = new PropertyDescriptor.Builder()
    +            .name("xslt-controller")
    +            .displayName("XSLT controller")
    --- End diff --
    
    "XSLT Lookup" Would be more readable. 
    Description: "Lookup controller used to store..."
    And: XSLT_CONTROLLER_KEY: "XSLT Lookup Key" (description looks fine)


---

[GitHub] nifi pull request #1953: NIFI-4130 Add lookup controller service in Transfor...

Posted by bdesert <gi...@git.apache.org>.
Github user bdesert commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1953#discussion_r233019686
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java ---
    @@ -82,12 +94,32 @@
     
         public static final PropertyDescriptor XSLT_FILE_NAME = new PropertyDescriptor.Builder()
                 .name("XSLT file name")
    -            .description("Provides the name (including full path) of the XSLT file to apply to the flowfile XML content.")
    -            .required(true)
    +            .description("Provides the name (including full path) of the XSLT file to apply to the flowfile XML content."
    +                    + "One of the XSLT file name and XSLT controller properties must be defined.")
    +            .required(false)
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .addValidator(StandardValidators.FILE_EXISTS_VALIDATOR)
                 .build();
     
    +    public static final PropertyDescriptor XSLT_CONTROLLER = new PropertyDescriptor.Builder()
    +            .name("xslt-controller")
    +            .displayName("XSLT controller")
    +            .description("Controller used to store XSLT definitions. One of the XSLT file name and "
    +                    + "XSLT controller properties must be defined.")
    +            .required(false)
    +            .identifiesControllerService(StringLookupService.class)
    +            .build();
    +
    +    public static final PropertyDescriptor XSLT_CONTROLLER_KEY = new PropertyDescriptor.Builder()
    +            .name("xslt-controller-key")
    +            .displayName("XSLT controller key")
    +            .description("Key used to retrieve the XSLT definition from the XSLT controller. This property must be set when using "
    +                    + "the XSLT controller property.")
    +            .required(false)
    +            .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
    +            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
    --- End diff --
    
    since this property supports EL, shouldn't it be NON_EMPTY_**EL**_VALIDATOR?


---

[GitHub] nifi issue #1953: NIFI-4130 Add lookup controller service in TransformXML to...

Posted by bdesert <gi...@git.apache.org>.
Github user bdesert commented on the issue:

    https://github.com/apache/nifi/pull/1953
  
    +1 LGTM. Tested on local env, with XSLT as a file (regression), with lookup service, cache size 0 and >0, all works as expected. Ready for merge. @mattyb149 , please could you please give a final look?


---

[GitHub] nifi issue #1953: NIFI-4130 Add lookup controller service in TransformXML to...

Posted by jfrazee <gi...@git.apache.org>.
Github user jfrazee commented on the issue:

    https://github.com/apache/nifi/pull/1953
  
    @pvillard31 Right, wouldn't want to do that. I misunderstood what you were doing. This makes sense.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1953: NIFI-4130 Add lookup controller service in TransformXML to...

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on the issue:

    https://github.com/apache/nifi/pull/1953
  
    Yes @jfrazee, that could be an option. However, do you think that's a good idea to have the XSLT as an attribute of the flow files? The XSLT could be really big and I'm not sure users will have the reflex to use an UpdateAttribute to remove it after the TransformXml.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1953: NIFI-4130 Add lookup controller service in TransformXML to...

Posted by jfrazee <gi...@git.apache.org>.
Github user jfrazee commented on the issue:

    https://github.com/apache/nifi/pull/1953
  
    @pvillard31 It seems like we should just use LookupAttribute for this use case. Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1953: NIFI-4130 Add lookup controller service in TransformXML to...

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on the issue:

    https://github.com/apache/nifi/pull/1953
  
    Hey @bdesert - thanks a lot for the review, I just pushed a commit that should address your comments.


---