Retrieving PDF file after submission

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Retrieving PDF file after submission

John Bender
I am having trouble retrieving the form PDF after the user submits the form.

In my form I have a Send button and a PDF button.



When I click on the PDF button, a new tab opens with the PDF file. The URL that opens is of this format http://<hostname>/orbeon/fr/service/Template/CustomerServiceRequest/pdf/e49facb3f59844c982325bfc557f2508f91f2b8b/0dd19ce09f727a1736fa16a5b915ab91a36759ff.pdf

When I copy this URL into another browser, I get the error message:
<error>
     <title>
         Session has expired. Unable to process incoming request.
     </title>
</error>

I understand that the PDF is not available outside the current user session. My question is:

How do I make the PDF available outside of the user session?

When the user submits the form, I have a requirement that another user who signs in through another server, be able to view the PDF.

In the URL above, after the /pdf/, I see that it uses the document ID (e49fa...) but I don't know what the second UUID is (0dd19ce...). Even if I knew what that number was, I'm not sure I would be able to get around the session ID requirement.

Can I force Orbeon to save it to the database (SQL Server)? If I could force it to be saved, then I could write a retrieval service to pull it out of the database.

Am I using the correct approach or is there another recommended way to retrieve the PDF after the form is submitted?

Any help would be appreciated.

I'm using Orbeon Forms 4.8.1.201502021959 PE.

Thanks,
John

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Retrieving PDF file after submission

Alessandro  Vernet
Administrator
Hi John,

As you've seen, you cannot use that URL and share it with another user. If you want to make the PDF available to other users, you'd have to have button use the send(content = "pdf-url") action, have the service receiving the URL download the PDF, and somehow make it available to other users. Does this make sense?

Alex

On Wed, Mar 25, 2015 at 10:51 AM, John Bender <[hidden email]> wrote:
I am having trouble retrieving the form PDF after the user submits the form.

In my form I have a Send button and a PDF button.



When I click on the PDF button, a new tab opens with the PDF file. The URL that opens is of this format http://<hostname>/orbeon/fr/service/Template/CustomerServiceRequest/pdf/e49facb3f59844c982325bfc557f2508f91f2b8b/0dd19ce09f727a1736fa16a5b915ab91a36759ff.pdf

When I copy this URL into another browser, I get the error message:
<error>
     <title>
         Session has expired. Unable to process incoming request.
     </title>
</error>

I understand that the PDF is not available outside the current user session. My question is:

How do I make the PDF available outside of the user session?

When the user submits the form, I have a requirement that another user who signs in through another server, be able to view the PDF.

In the URL above, after the /pdf/, I see that it uses the document ID (e49fa...) but I don't know what the second UUID is (0dd19ce...). Even if I knew what that number was, I'm not sure I would be able to get around the session ID requirement.

Can I force Orbeon to save it to the database (SQL Server)? If I could force it to be saved, then I could write a retrieval service to pull it out of the database.

Am I using the correct approach or is there another recommended way to retrieve the PDF after the form is submitted?

Any help would be appreciated.

I'm using Orbeon Forms 4.8.1.201502021959 PE.

Thanks,
John

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Retrieving PDF file after submission

John Bender
I do understand the concept, just having trouble with the syntax and understanding how Orbeon works. I'm very new to Orbeon and don't really know where everything goes. Where exactly would I specify the send(content="pdf-url")? Currently I'm sending the XML  data to my custom servlet.

Here is my properties-local.xml:

    <!-- Define buttons for Template forms -->
    <property as="xs:string" name="oxf.fr.detail.buttons.Template.*" value="validate pdf save-draft send" />
    <property as="xs:boolean" name="oxf.fr.detail.pdf.disable-if-invalid.Template.*" value="true" />
    <property as="xs:boolean" name="oxf.epilogue.xforms.inspector" value="false" />  <!-- set to true for debug -->
    <property as="xs:boolean" name="oxf.fr.detail.send.pdf" value="true"/>

       <!-- web service submission   -->
        <property as="xs:string"
                name="oxf.fr.detail.send.success.uri.Template.*"
                value="http://localhost:8080/BPOpenMDM/SendToBPOpen"/>
        <property as="xs:string" name="oxf.fr.detail.process.send.Template.*">
        require-valid
                then save
                then send("oxf.fr.detail.send.success")
                then success-message("submit-dialog-message")
                recover error-message("error-dialog-title")
        </property>

Thanks for your help.

John


On Thursday, March 26, 2015 at 12:52:37 AM UTC-5, Alessandro Vernet wrote:
Hi John,

As you've seen, you cannot use that URL and share it with another user. If you want to make the PDF available to other users, you'd have to have button use the send(content = "pdf-url") action, have the service receiving the URL download the PDF, and somehow make it available to other users. Does this make sense?

Alex

On Wed, Mar 25, 2015 at 10:51 AM, John Bender <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XnCzYqRh8VkJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jben...@...> wrote:
I am having trouble retrieving the form PDF after the user submits the form.

In my form I have a Send button and a PDF button.



When I click on the PDF button, a new tab opens with the PDF file. The URL that opens is of this format http://<hostname>/orbeon/fr/service/Template/CustomerServiceRequest/pdf/e49facb3f59844c982325bfc557f2508f91f2b8b/0dd19ce09f727a1736fa16a5b915ab91a36759ff.pdf

When I copy this URL into another browser, I get the error message:
<error>
     <title>
         Session has expired. Unable to process incoming request.
     </title>
</error>

I understand that the PDF is not available outside the current user session. My question is:

How do I make the PDF available outside of the user session?

When the user submits the form, I have a requirement that another user who signs in through another server, be able to view the PDF.

In the URL above, after the /pdf/, I see that it uses the document ID (e49fa...) but I don't know what the second UUID is (0dd19ce...). Even if I knew what that number was, I'm not sure I would be able to get around the session ID requirement.

Can I force Orbeon to save it to the database (SQL Server)? If I could force it to be saved, then I could write a retrieval service to pull it out of the database.

Am I using the correct approach or is there another recommended way to retrieve the PDF after the form is submitted?

Any help would be appreciated.

I'm using Orbeon Forms 4.8.1.201502021959 PE.

Thanks,
John

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="XnCzYqRh8VkJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">orbeon+un...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="XnCzYqRh8VkJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">orb...@....

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Retrieving PDF file after submission

John Bender
In reply to this post by John Bender
After playing around with the properties-local.xml, I can now get the PDF url OR the XML but not both on the same send. Can you confirm that this is possible (getting both pdf url AND XML in the same send)?

Here's my current properties-local.xml:

        <property as="xs:string"
                name="oxf.fr.detail.send.success.uri.Template.*"
                value="http://localhost:8080/BPOpenMDM/SendToBPOpen"/>
        <property as="xs:string" name="oxf.fr.detail.process.send.Template.*">
                require-valid
                then save
                then send("oxf.fr.detail.send.success", content="pdf-url")
                then send("oxf.fr.detail.send.success", content="xml")
                then success-message("submit-dialog-message")
                <!-- then navigate(uri="http://localhost:8080/orbeon/fr/Template/CustomerServiceRequest/summary") -->
                recover error-message("error-dialog-title")
        </property>

With these settings, I see only one post to my Tomcat server and I see this warning in the orbeon.log file:

2015-03-26 14:34:09,445 WARN  XFormsServer  - another submission requiring a second pass already exists {existing submission: "fr-send-submission-all", new submission: "fr-send-submission-all"}

Thanks,
John

On Wednesday, March 25, 2015 at 12:51:31 PM UTC-5, John Bender wrote:
I am having trouble retrieving the form PDF after the user submits the form.

In my form I have a Send button and a PDF button.



When I click on the PDF button, a new tab opens with the PDF file. The URL that opens is of this format http://<hostname>/orbeon/fr/service/Template/CustomerServiceRequest/pdf/e49facb3f59844c982325bfc557f2508f91f2b8b/0dd19ce09f727a1736fa16a5b915ab91a36759ff.pdf

When I copy this URL into another browser, I get the error message:
<error>
     <title>
         Session has expired. Unable to process incoming request.
     </title>
</error>

I understand that the PDF is not available outside the current user session. My question is:

How do I make the PDF available outside of the user session?

When the user submits the form, I have a requirement that another user who signs in through another server, be able to view the PDF.

In the URL above, after the /pdf/, I see that it uses the document ID (e49fa...) but I don't know what the second UUID is (0dd19ce...). Even if I knew what that number was, I'm not sure I would be able to get around the session ID requirement.

Can I force Orbeon to save it to the database (SQL Server)? If I could force it to be saved, then I could write a retrieval service to pull it out of the database.

Am I using the correct approach or is there another recommended way to retrieve the PDF after the form is submitted?

Any help would be appreciated.

I'm using Orbeon Forms 4.8.1.201502021959 PE.

Thanks,
John

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Retrieving PDF file after submission

Alessandro  Vernet
Administrator
Hi  John,

You're getting this error because when calling send() with "oxf.fr.detail.send.success", it uses the "parameters" coming from that property. And with "oxf.fr.detail.send.success", replace defaults to "all", i.e. what is returned by the service is expected to be an HTML page, which will be send back to the browser. In that case, of course, it wouldn't make sense to call send() twice. So instead, you want to set replace = "none". The simplest way to do this in your case would be to add that as a parameter to both of your calls to send().

(But in general I prefer to put all the parameters explicitly, rather than relying on a values coming from the "defaults" defined in a property.)


You'll let us know if this works for you,

Alex

On Thu, Mar 26, 2015 at 12:58 PM John Bender <[hidden email]> wrote:
After playing around with the properties-local.xml, I can now get the PDF url OR the XML but not both on the same send. Can you confirm that this is possible (getting both pdf url AND XML in the same send)?

Here's my current properties-local.xml:


        <property as="xs:string"
                name="oxf.fr.detail.send.success.uri.Template.*"
                value="http://localhost:8080/BPOpenMDM/SendToBPOpen"/>
        <property as="xs:string" name="oxf.fr.detail.process.send.Template.*">
                require-valid
                then save
                then send("oxf.fr.detail.send.success", content="pdf-url")
                then send("oxf.fr.detail.send.success", content="xml")
                then success-message("submit-dialog-message")
                <!-- then navigate(uri="http://localhost:8080/orbeon/fr/Template/CustomerServiceRequest/summary") -->

                recover error-message("error-dialog-title")
        </property>

With these settings, I see only one post to my Tomcat server and I see this warning in the orbeon.log file:

2015-03-26 14:34:09,445 WARN  XFormsServer  - another submission requiring a second pass already exists {existing submission: "fr-send-submission-all", new submission: "fr-send-submission-all"}

Thanks,
John


On Wednesday, March 25, 2015 at 12:51:31 PM UTC-5, John Bender wrote:
I am having trouble retrieving the form PDF after the user submits the form.

In my form I have a Send button and a PDF button.



When I click on the PDF button, a new tab opens with the PDF file. The URL that opens is of this format http://<hostname>/orbeon/fr/service/Template/CustomerServiceRequest/pdf/e49facb3f59844c982325bfc557f2508f91f2b8b/0dd19ce09f727a1736fa16a5b915ab91a36759ff.pdf

When I copy this URL into another browser, I get the error message:
<error>
     <title>
         Session has expired. Unable to process incoming request.
     </title>
</error>

I understand that the PDF is not available outside the current user session. My question is:

How do I make the PDF available outside of the user session?

When the user submits the form, I have a requirement that another user who signs in through another server, be able to view the PDF.

In the URL above, after the /pdf/, I see that it uses the document ID (e49fa...) but I don't know what the second UUID is (0dd19ce...). Even if I knew what that number was, I'm not sure I would be able to get around the session ID requirement.

Can I force Orbeon to save it to the database (SQL Server)? If I could force it to be saved, then I could write a retrieval service to pull it out of the database.

Am I using the correct approach or is there another recommended way to retrieve the PDF after the form is submitted?

Any help would be appreciated.

I'm using Orbeon Forms 4.8.1.201502021959 PE.

Thanks,
John

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet