Jahia Dev Forum > Call Java class...

0 (0 Good)
0 (0 Bad)

Call Java class from Jahia module view and rise another jahia view from the class.

by  Igor Puntus »  2017/04/13 07:56

Hello,

I have created my own Jahia module with simple view (like: jcr:title, body).
Now I want to define form on this view, the form should pass parameters to my own Java class. This class will process form's data (validate) and send them to my standalone restfull service, then will receive response from the service and process it.
As the result of service respond processing the class have to call another view in my Jahia module with filling the module's properties or view's variables (fields).
At the end of this action user will see page with pretty view of the service respond data.

Unfortunately, I complitely don't know:
- how to define and add Java class to my module;
- how to define form for passing parameters to the class;
- how to process form data in the class;
- how to call Jahia view from the class and fill variables (fields) of this view.

Could you help me and give some documentations, advice, simple code examples.

I'm looking forward to your response.
Thank you!

Best regards,
Igor Puntus

Igor Puntus
Number of messages  3
Not registered
0 (0 Good)
0 (0 Bad)

Re: Call Java class from Jahia module view and rise another jahia view from the class.

by  shuber »  2017/04/13 09:52

 

Hello Igor, 

There are a number of different ways to do this, depending on your requirements.

Maybe these resources might help ? 

https://www.youtube.com/watch?v=TUESY3l5XIw

https://academy.jahia.com/documentation/digital-experience-manager/7.2/technical/mvc-using-spring-web-flow

https://academy.jahia.com/documentation/digital-experience-manager/7.2/development/techwiki/content-manipulation#Actions

I'd love to know more about your project, can you share some more info ?

Best regards,

  Serge Huber.

Serge Huber (shuber)

Number of messages  271
Registration date
0 (0 Good)
0 (0 Bad)

Re: Re: Call Java class from Jahia module view and rise another jahia view from the class.

by  Igor Puntus »  2017/04/17 07:48

Hello Serge, 
We are preparing to start develop web-portal for one of the government department.
Now we are developing pilot project (test prototype) for checking that platform fits into project requirements and it's easy to deal with.
There are a lot of integrations in this project. For example, we have to develop own forms (as a Jahia content) and connect their with rest-services on the goverment platform, for CRUD functionality. We want to use own JavaBeans for validating form data and send/receive data to/from third system' services, processing response and fill/call suitable Jahia view.

If you able to provide (via GitHub) us some preaty simple code example (small Jahia module) showing how exactly right we can do it, it will be great!

Best regards,
Igor Puntus

Igor Puntus
Number of messages  3
Not registered
0 (0 Good)
0 (0 Bad)

Re: Re: Re: Call Java class from Jahia module view and rise another jahia view from the class.

by  shuber »  2017/04/18 08:30

Hello Igor, 

Thanks a lot for describing your project, it seems very interesting. Please don't hesitate to reach out directly to our team if you want any more specific help.

As for your request, maybe this resource could help ? 

https://github.com/shyrkov/jahia-spring-webflow-showcase

There is also a great tutorial, but unfortunately it's in french, made by one of our partners, that you may find here (maybe Google Translate will help?) : 

https://github.com/Smile-SA/jahia-webflow-tutorial

Best regards,

  Serge Huber.

Serge Huber (shuber)

Number of messages  271
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page