9 Replies Latest reply: Jun 19, 2011 9:17 AM by Udo RSS

    APEX Listener 1.1 Important Changes to Note

    Colm Divilly-Oracle
      This post focuses on changes to existing functionality but is not a complete discussion of all changes in this release, please refer to the release notes [1] for further information.

      h1. Flexible Parameter Passing

      This release adds support for flexible parameter passing as described in Oracle Application Server mod_plsql User's Guide [2]. For example to invoke a procedure with the following signature:
      procedure flexible_params 
           (name_array IN [array_type],
           value_array IN  [array_type]);
      use a URL like the following:
      http://host:port/apex/!scott.flexible_params?x=john&y=10&z=doe
      h1. Resource Templates Parameter Syntax Change

      In the 1.1 Early Adopter release parameters within the SQL and PL/SQL blocks were delimited with curly braces ({}). To be more consistent with SQL Plus and SQL Developer this has been changed to be delimited with a leading colon (:).

      For example the following SQL in 1.1 Early Adopters Release
      select 'Hello ' || {person} || ' from APEX' greeting from dual
      must be changed to the following in the final 1.1 Release:
      select 'Hello ' || :person || ' from APEX' greeting from dual
      Note this only affects the SQL or PL/SQL parameters, the syntax for the URI Template in a resource template is unchanged, i.e. a URI Template like: hello?who={person} remains the same.

      h1. Resource Templates Query Handler Response Format Change

      In 1.1 Early Adopters Release the response for the following query:
      select 'Hello ' || :person || ' from APEX' greeting from dual
      would look like:
      [
       {
        "greeting": "Hello World from APEX"
       }
      ]
      This has changed to:
      {
       "items": [
        {
         "greeting": "Hello World from APEX"
        }
       ]
      }
      The array of results is now wrapped in a JSON object with a single property named: {noformat}"items"{noformat} whose value is the array of results.

      h2. References
      [1] Apex Listener 1.1 Release Notes: http://download.oracle.com/otn/java/appexpress/1.1/docs/AELRN/E21069_01.pdf
      [2] Oracle Application Server mod_plsql User's Guide: http://download.oracle.com/docs/cd/B14099_19/web.1012/b14010/concept.htm#sthref97

      Edited by: Colm Divilly on Mar 2, 2011 1:39 AM
        • 1. Re: APEX Listener 1.1 Important Changes to Note
          816944
          Flexible Parameter passing - great!

          Thanks Colm
          • 2. Re: APEX Listener 1.1 Important Changes to Note
            jflack
            Sorry, hate to say it, but flexible parameter passing isn't quite there yet. It works for a GET request, but it doesn't work for a POST request. So if your application passes parameters in the URL as in Colm's example, it works fine. But if the same procedure is called as the method of a form, it still doesn't get the parameters from the form, it returns a status 404 - Not Found.

            Close, but no cigar. But I do appreciate the effort of the ApEx Listener developers to get this working.
            • 3. Re: APEX Listener 1.1 Important Changes to Note
              Colm Divilly-Oracle
              Ack! thanks for spotting this, as a workaround, do add a query string to the submit URL, contents can be anything (maybe one of the fields is always present, maybe just add a bogus value), something like this:
              <form name="input" action="/apex/!scott.flexible_params?work=around" method="POST">
              Username: <input type="text" name="user" />
              <input type="submit" value="Submit" />
              </form> 
              The form data will now be received by the procedure as expected.

              Thanks,
              Colm
              • 4. Re: APEX Listener 1.1 Important Changes to Note
                jflack
                Thanks for the work-around. I've said before - Oracle's APEX Listener team is top-notch for responsiveness and listening to us.
                • 5. Re: APEX Listener 1.1 Important Changes to Note
                  user641914
                  The following html code is a working example of passing parameters with the "post" method, using standard Apex URL syntax.

                  <form name="input" action="http://ApexServerName:Port/apex/f" method="POST">
                  F118_SZAGENTID: <input type="hidden" name="p" value="118:1:::::F118_SZAGENTID:SMITH"/>
                  <input type="submit" value="Submit" />
                  </form>


                  where
                  118 is the Apex application ID;
                  "SMITH" is the value of the passed parameter;
                  F118_SZAGENTID is an application item of the invoked application.

                  Regards
                  • 6. Re: APEX Listener 1.1 Important Changes to Note
                    user641914
                    The following html code is a working example of passing parameters with the "post" method, using standard Apex URL syntax.

                    <form name="input" action="http://ApexServerName:Port/apex/f" method="POST">
                    F118_SZAGENTID: <input type="hidden" name="p" value="118:1:::::F118_SZAGENTID:SMITH"/>
                    <input type="submit" value="Submit" />
                    </form>


                    where
                    118 is the Apex application ID;
                    "SMITH" is the value of the passed parameter;
                    F118_SZAGENTID is an application item of the invoked application.

                    Regards
                    • 7. Re: APEX Listener 1.1 Important Changes to Note
                      Colm Divilly-Oracle
                      This problem is fixed in release 1.1.1 and POST requests should now work as expected
                      • 8. Re: APEX Listener 1.1 Important Changes to Note
                        AppsDBA3
                        Is there any way to pass individual item value with POST .. e.g. if item value is a long text I would like to send it as post instead of in the url :

                        Either by using f? format url :
                        <form name="input" action="http://ApexServerName:Port/apex/f" method="POST">
                        <input type="hidden" name="app" value="118"/>
                        <input type="hidden" name="page" value="1"/>
                        Long text : <input type="hidden" name="F1_MYLONGTEXT" value="My long text"/>
                        Long text2 : <input type="hidden" name="F2_MYLONGTEXT" value="Another long text"/>

                        <input type="submit" value="Submit" />
                        </form>

                        OR by using wwv_flow.accept directly -

                        <form name="input" action="http://ApexServerName:Port/apex/wwv_flow.accept" method="POST">
                        <input type="hidden" name="p_flow_id" value="118"/>
                        <input type="hidden" name="p_flow_step_id" value="1"/>
                        <input type="hidden" name="p_request" value="CREATE"/>
                        Long text : <input type="hidden" name="F1_MYLONGTEXT" value="My long text"/>
                        Long text2 : <input type="hidden" name="F2_MYLONGTEXT" value="Another long text"/>

                        <input type="submit" value="Submit" />
                        </form>
                        (Problem with this is that wwv_flow.accept procedure accepts only internal name of the items like p_t01 etc and not item name F1_MYLONGTEXT defined on the page).

                        Will any of these work ? Is there anyway to do this ?

                        Please advise.
                        • 9. Re: APEX Listener 1.1 Important Changes to Note
                          Udo
                          Hello,

                          please, no double postings. This is the wrong forum anyway. Just follow your original thread {thread:id=2240271} in the APEX forum.

                          Thanks,

                          Udo