OFBiz
  1. OFBiz
  2. OFBIZ-4815

PATCH to enable NOT-IN operator to performFind

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: Trunk
    • Component/s: framework
    • Labels:

      Description

      This patch will enable NOT-IN operator to the performFind service.

        Activity

        Jacques Le Roux made changes -
        Status Patch Available [ 10002 ] Closed [ 6 ]
        Assignee Jacques Le Roux [ jacques.le.roux ]
        Resolution Fixed [ 1 ]
        Hide
        Jacques Le Roux added a comment -

        Thanks Daniel,

        Your patch is in trunk at r1328637

        Show
        Jacques Le Roux added a comment - Thanks Daniel, Your patch is in trunk at r1328637
        Hide
        Jacques Le Roux added a comment -

        Thanks Daniel,

        Looks good to me, I will test later

        Show
        Jacques Le Roux added a comment - Thanks Daniel, Looks good to me, I will test later
        Daniel Riquelme made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Daniel Riquelme added a comment - - edited

        Only two lines of the file framework/common/src/org/ofbiz/common/FindServices.java were modified to enable de NOT-IN operator.
        It can be tested with the following code:

        <form name="ListExamples" type="list" list-name="listIt" paginate-target="FindExample" default-entity-name="Example" separate-columns="true"
                odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
                <actions>
                    <set field="notExamples[]" value="EX01" />
        	    <set field="notExamples[]" value="EX03"/>
        	    <set field="parameters.exampleId_fld0_op" value="not-in"/>
        	    <set field="parameters.exampleId_fld0_value" from-field="notExamples" type="List"/>
                    <service service-name="performFind" result-map="result" result-map-list="listIt">
                        <field-map field-name="inputFields" from-field="exampleCtx"/>
                        <field-map field-name="entityName" value="Example"/>
                        <field-map field-name="orderBy" from-field="parameters.sortField"/>
                        <field-map field-name="viewIndex" from-field="viewIndex"/>
                        <field-map field-name="viewSize" from-field="viewSize"/>
                    </service>
                </actions>
                <alt-row-style use-when="&quot;EXST_APPROVED&quot;.equals(statusId)" style="Validate"/>
                <alt-row-style use-when="&quot;EXST_CANCELLED&quot;.equals(statusId)" style="Warn"/>
                <field name="exampleId" title="${uiLabelMap.ExampleExampleId}" widget-style="buttontext">
                    <hyperlink also-hidden="false" description="${exampleId}" target="EditExample">
                        <parameter param-name="exampleId"/>
                    </hyperlink>
                </field>
                <field name="exampleName" title="${uiLabelMap.CommonName}" sort-field="true"><display/></field>
                <field name="exampleTypeId" title="${uiLabelMap.CommonType}"><display-entity entity-name="ExampleType"/></field>
                <field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem"/></field>
                <field name="description" title="${uiLabelMap.CommonDescription}" sort-field="true"><display/></field>
            </form>
        
        Show
        Daniel Riquelme added a comment - - edited Only two lines of the file framework/common/src/org/ofbiz/common/FindServices.java were modified to enable de NOT-IN operator. It can be tested with the following code: <form name= "ListExamples" type= "list" list-name= "listIt" paginate-target= "FindExample" default-entity-name= "Example" separate-columns= "true" odd-row-style= "alternate-row" header-row-style= "header-row-2" default-table-style= "basic-table hover-bar" > <actions> <set field= "notExamples[]" value= "EX01" /> <set field= "notExamples[]" value= "EX03" /> <set field= "parameters.exampleId_fld0_op" value= "not-in" /> <set field= "parameters.exampleId_fld0_value" from-field= "notExamples" type= "List" /> <service service-name= "performFind" result-map= "result" result-map-list= "listIt" > <field-map field-name= "inputFields" from-field= "exampleCtx" /> <field-map field-name= "entityName" value= "Example" /> <field-map field-name= "orderBy" from-field= "parameters.sortField" /> <field-map field-name= "viewIndex" from-field= "viewIndex" /> <field-map field-name= "viewSize" from-field= "viewSize" /> </service> </actions> <alt-row-style use-when= "&quot;EXST_APPROVED&quot;.equals(statusId)" style= "Validate" /> <alt-row-style use-when= "&quot;EXST_CANCELLED&quot;.equals(statusId)" style= "Warn" /> <field name= "exampleId" title= "${uiLabelMap.ExampleExampleId}" widget-style= "buttontext" > <hyperlink also-hidden= "false" description= "${exampleId}" target= "EditExample" > <parameter param-name= "exampleId" /> </hyperlink> </field> <field name= "exampleName" title= "${uiLabelMap.CommonName}" sort-field= "true" > <display/> </field> <field name= "exampleTypeId" title= "${uiLabelMap.CommonType}" > <display-entity entity-name= "ExampleType" /> </field> <field name= "statusId" title= "${uiLabelMap.CommonStatus}" > <display-entity entity-name= "StatusItem" /> </field> <field name= "description" title= "${uiLabelMap.CommonDescription}" sort-field= "true" > <display/> </field> </form>
        Daniel Riquelme made changes -
        Field Original Value New Value
        Attachment OFBIZ-FindServices_NOT-IN.patch [ 12522883 ]
        Daniel Riquelme created issue -

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Daniel Riquelme
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development