This discussion is archived
5 Replies Latest reply: Jan 18, 2013 1:21 PM by fac586 RSS

static html with url to apex pages

643606 Explorer
Currently Being Moderated
I have a table with html content that contains url's to apex pages similar to

<a href="f?p=115:300:???:PAGE:::P300_PAGE_NAME:test_page>test page</a>
<a href=f?p=115:300:???:PAGE:::P300_PAGE_NAME:another_test_page">another test page</a>

Where ??? needs to be the session id.

I could use wwv_flow.do_substitutions to render the content and use &SESSION. in place of the question marks. Did not like this option as my content is in a CLOB and didn't want to parse all the content if the links are never clicked, also the content could be very large.

I don't have much control on how the url is generated, only the base path.

I also thought about building my own procedure to change the link value and then call the original f procedure, similar to:
<a href="set_session?p=115:300:#SESSION#:PAGE:::P300_PAGE_NAME:another_test_page>another test page</a>
This set_session procedure would get the session using plsql and then do the substitution and then call the existing f function.

Is there another solution to have static url's and render the content in an html region so that when clicked the session id is maintained?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  • 1. Re: static html with url to apex pages
    fac586 Guru
    Currently Being Moderated
    mwooldridge wrote:
    I have a table with html content that contains url's to apex pages similar to
    <a href="f?p=115:300:???:PAGE:::P300_PAGE_NAME:test_page>test page</a>
    <a href="f?p=115:300:???:PAGE:::P300_PAGE_NAME:another_test_page>another test page</a>
    Always post HTML code using <tt>\
    ...\
    </tt> tags to prevent it being rendered by the forum software.
    Where ??? needs to be the session id.

    I could use wwv_flow.do_substitutions to render the content and use &SESSION. in place of the question marks.
    How do you retrieve and render the content?
    Did not like this option as my content is in a CLOB and didn't want to parse all the content if the links are never clicked, also the content could be very large.
    I don't like that option because it uses an undocumented, unsupported API call.
  • 2. Re: static html with url to apex pages
    643606 Explorer
    Currently Being Moderated
    The content is displayed in an html region with a source that is a plsql proocedure. The procedure simply loops over the CLOB in chunks and uses htp.p
  • 3. Re: static html with url to apex pages
    fac586 Guru
    Currently Being Moderated
    mwooldridge wrote:
    The content is displayed in an html region with a source that is a plsql proocedure. The procedure simply loops over the CLOB in chunks and uses htp.p
    What's wrong with the the source procedure performing a simple replace on whatever placeholder is used in the links when the CLOB is retrieved?
    ...
    l_html := replace(l_html, '???', v('APP_SESSION'));
    ...
  • 4. Re: static html with url to apex pages
    643606 Explorer
    Currently Being Moderated
    Since it is a clob and retrieved in chunks, it is possible the ??? could span a chunk and would not be found. I was hoping to find a way to insert the session when the link is clicked.

    The replace solution would work if the size was < 32767 and could read the all the content into a plsql variable.
  • 5. Re: static html with url to apex pages
    fac586 Guru
    Currently Being Moderated
    mwooldridge wrote:
    Since it is a clob and retrieved in chunks, it is possible the ??? could span a chunk and would not be found. I was hoping to find a way to insert the session when the link is clicked.

    The replace solution would work if the size was &lt; 32767 and could read the all the content into a plsql variable.
    Why is this necessary? works on CLOBs<tt>replace</tt> works on CLOBs.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points