uploaded attachments

12 views
Skip to first unread message

godiyals

unread,
Apr 30, 2020, 12:43:45 PM4/30/20
to orb...@googlegroups.com
How to get uploaded attachments into server side(in action method).
I have developed mu action method.
@PutMapping(path="/saveLoginForm", params = {"app", "form", "document",
"valid", "request"})
public String saveLoginForm(
@RequestParam final String app,
@RequestParam final String form,
@RequestParam final String document,
@RequestParam final String valid,
@RequestParam final String request,
final HttpServletResponse response,@RequestBody final String
xmlBody) throws IOException {

System.out.println("#########################saveLoginForm##############################################################################3");

System.out.println("============================app================================================="+app);

System.out.println("============================form================================================="+form);

System.out.println("============================document================================================="+document);

System.out.println("============================valid================================================="+valid);


System.out.println("============================xmlBody================================================="+xmlBody);

//response.sendRedirect("google.com");
return "Test_Sucess";




}

--
Sent from: http://discuss.orbeon.com/

godiyals

unread,
Apr 30, 2020, 12:43:45 PM4/30/20
to orb...@googlegroups.com
I want to store attachment into my server. i got attachement as part of xml
(.bin)
i get <section-1>
<grid-1>
<FName>Sangeeta</FName>
<LNAME>Godiyal</LNAME>
<Licencetattachment filename="image001.jpg"
mediatype="image/jpeg"
size="1091722">/fr/service/persistence/crud/Test/Test/data/28e2efb8ffaed07316a41b46d93cb9c93b0f1a81/8baddf5bbd89840ac246d24b7a56a53c6ae7955c.bin</Licencetattachment>
<passportattachment filename="cbimage.jpg"
mediatype="image/jpeg"
size="30">/fr/service/persistence/crud/Test/Test/data/28e2efb8ffaed07316a41b46d93cb9c93b0f1a81/c3870b7c522a8bd80fb40600fc6a36993411d171.bin</passportattachment>
<Age>23</Age>
<addresss>5218 Madison Ave</addresss>
</grid-1>
</section-1>
------------------------------------------------------------------My code

Alessandro Vernet

unread,
Apr 30, 2020, 8:48:19 PM4/30/20
to orb...@googlegroups.com
I imagine that this message is is superseded by the one linked below, which
you posted just a few minutes later, so I will answer on that thread.

http://discuss.orbeon.com/uploaded-attachments-td4665172.html

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

Alessandro Vernet

unread,
Apr 30, 2020, 8:48:27 PM4/30/20
to orb...@googlegroups.com
Hi,

I understand that you would like to store an attachment in Orbeon Forms, I
imagine through the REST API. Is that correct? But what is your question?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

godiyals

unread,
May 1, 2020, 11:21:04 AM5/1/20
to orb...@googlegroups.com
I got attachment as a .bin as part of xml .But my requirement is to store
attachments into alfresco server or my local code so what code or
configuration should i write ?

Alessandro Vernet

unread,
May 1, 2020, 12:41:46 PM5/1/20
to orb...@googlegroups.com
When users attach a file to a form they are filling out, Orbeon Forms stores
the file in your database. What database have you setup Orbeon Forms to save
data in? Are you using the builtin eXist-db, or did you set it up to store
data in a relational database, such as SQL Server?

And when would you like the files to be stored in Alfresco? Would you want
this to happen as soon as the form is submitted, or say once a day, or at
some other point?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

Alessandro Vernet

unread,
May 7, 2020, 2:13:32 PM5/7/20
to orb...@googlegroups.com
Did you get to make progress on storing data in Alfresco, or have you maybe
found another way to deal with this in the meantime?

Sangeeta Godiyal

unread,
May 7, 2020, 2:59:12 PM5/7/20
to orb...@googlegroups.com
No Still i did not resolve it.I am getting form submission error.The following is my property-local.xml file.I want to implement custom persistence API.I developed  RestService_Demo restful webservice.
<!--
    This file is an empty template for your own properties-local.xml file. Please follow the instructions here:

    https://doc.orbeon.com/configuration/properties/
-->
<properties xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:oxf="http://www.orbeon.com/oxf/processors">
<property
    as="xs:string"
    name="oxf.fr.detail.buttons.inner.*.*"
    value="wizard-prev wizard-next clear save-progress save-final"/>
<property
    as="xs:anyURI"
    name="oxf.url-rewriting.service.base-uri"
    value="http://localhost:8580/orbeon"/>
<property
    as="xs:string"
    name="oxf.fr.detail.buttons.inner.Nextgen.Form1"
    value="wizard-prev wizard-next save-progress hfi deny save-final"/>

<property as="xs:string"  name="oxf.fr.resource.NextGen.Form1.en.buttons.save-final" value="Create"/>
<property as="xs:string"  name="oxf.fr.resource.NextGen.*.en.buttons.save-progress" value="Save Progress"/>

<property
  as="xs:string"
  name="oxf.fr.persistence.provider.NextGen.*.data"
  value="RestService_Demo"/>

<property
  as="xs:anyURI"
  name="oxf.fr.persistence.my-persistence.uri"
  value="http://localhost:8580/RestService_Demo/orbeon"/>

<property
    as="xs:boolean"
    name="oxf.fr.persistence.RestService_Demo.active"
    value="true"/>

<property
    as="xs:boolean"
    name="oxf.fr.persistence.RestService_Demo.autosave"
    value="true"/>



<property as="xs:string" name="oxf.fr.detail.process.save-progress.NextGen.Form1">
require-uploads
then validate-all
then save
then send(
uri = "http://localhost:8580/RestService_Demo/orbeon/saveLoginForm?request=save",
method= "PUT",
replace = "all",
parameters = "app form document valid request"
)
</property>
<property as="xs:string"  name="oxf.fr.detail.buttons.*.*"> </property>



</properties>
-------------------------------------------Rest method
@PutMapping(path="/saveLoginForm", params = {"app", "form", "document", "valid", "request"})
  public void saveLoginForm(

    @RequestParam final String app,
           @RequestParam final String form,
           @RequestParam final String document,
           @RequestParam final String valid,
           @RequestParam final String request,
           final HttpServletResponse response,@RequestBody final String xmlBody) throws IOException {
System.out.println("#########################saveLoginForm##############################################################################3");
/*System.out.println("============================app================================================="+app);
System.out.println("============================form================================================="+form);
response.sendRedirect("");

}

--
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 orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1588875208081-0.post%40n4.nabble.com.

Alessandro Vernet

unread,
May 9, 2020, 1:01:36 AM5/9/20
to orb...@googlegroups.com
Hi Sangeeta,

I think that this is one of those cases for which it will be hard for me to
help on a forum like this, since I'm unable to run your custom code. So I
can only give you very generic advice, like: run a `tail -f orbeon.log`
while you make queries and stop and analyze any error you see; use a tool
like Wireshark to check what Orbeon Forms sends your service, and what you
answer, checking this everything is where you expect it to be. I'm sorry for
the fairly generic answer, and I hope you'll be able to figure this one out!

Sangeeta Godiyal

unread,
May 9, 2020, 12:41:12 PM5/9/20
to orb...@googlegroups.com
Thanks for getting back to me. I resolved the issue. Its workingfine.

--
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 orbeon+un...@googlegroups.com.

Alessandro Vernet

unread,
May 9, 2020, 7:48:02 PM5/9/20
to orb...@googlegroups.com
Excellent Sangeeta, and thank you for the update!
Reply all
Reply to author
Forward
0 new messages