Using Form-Builder-Generated-Form with Java Application - orbeon

I tried the approach of using Form-Builder-Generated-Form within Java application suggested here < Running Orbeon-Form-Builder-Generated-Form with Java Application > : downloaded Orbeon nightly build, created a sample form using Form Builder and copy & pasted it into JSP page in my app. However, when I try to access this JSP, it redirects me to: /myapp/fr/unauthorized . Can you please tell me what I maybe doing wrong? Or what is the right way of making Orbeon process Form Builder generated content in Java app?
For my deployment I followed separate deployment and configuration specified in Orbeon documentation. Thanks in advance.

You are not doing anything wrong, but Orbeon Forms doesn't support this type of form deployment.
The separate deployment mode runs the output of your JSP directly through the XForms engine.
Form Builder-generated forms OTOH expect pre-processing via the Form Runner runtime, in particular through the components.xsl XSLT transform. This is needed to support all the Form Runner features, including built-in persistence, error summary, internationalization, etc.
Currently the cleanest way to integrate such forms with your own app is to just run them side by side (Orbeon WAR + your own WAR) and navigate between each other via links and POSTs.
You could also use an iframe, although that is often a disliked solution.
You could also transform the form produced by Form Builder into plain XForms that doesn't assume Form Runner. It wouldn't be too hard to do but would be outside the scope of this StackOverflow question.

Related

TYPO3 8.7 is it possible to output a specific page with multiple url path s

I'm trying to integrate a vue.js application into a typo3 page.
I have a full functional TYPO3 instance where I can create own pages, edit the content and more. Now I want to add an existing vue.js application within this page.
Therefore I created an extension which added all necessary resources (js, css) and added an own content type which controls the integrations and configurations. The content type outputs a vue.js entry point. So far everything works. Smaller vue.js applications works as they should.
Now comes the challenge: When I want to create a more complex application which relies on the router functionality, I run into a problem.
Let's assume, I integrate my application into the page /shop and my application tries to render a product under /shop/product/some-id. This doesn't work. The URL processing is done by TYPO3 (as designed).
I tried to find a solution within the documentation but I'm not sure what I should search. I need a way to output the same page (/shop) regardless the following path. Does someone have a hint?
I found a solution. Within TYPO3 v8 is it possible to use the realurl extension for this purpose.
It is possible to define an own decode preprocessing function and analyse the current url.
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['decodeSpURL_preProc'][] = RealUrlManipulation::class . '->decodeSpURL_preProc';
Within this method is it possible to change the url for TYPO3 inner processing and set it to an known url.

Vue and .NET Core integration (+authentication) choice

As far as I understand that, there are two major options for Vue and .NET Core integration within single MVC/Razor project.
Option 1.
MVC/Razor-rendered non-reactive page is used for authentication with built-in ASP.NET Identity. Vue is not involved for authentication/authorization at all. As soon as users are authenticated, they are redirected to another MVC/Razor page that is used as a HTML template for Vue. It’s possible to combine MVC/Razor rendering and Vue. For example, user name on the top of the page can be rendered by MVC but button actions and data tables will be further processed by Vue. It’s possible to use many pages (so it will be MPA, not SPA), it comes naturally. Using *.vue files is not possible. MVC routing seems to be primary routing option (not sure, would be possible to combine with Vue routing and whether any needs for that). Vue JS files can reside anywhere in the project, for example, can be bound to the HTML pages similarly as CS files in Razor pages do (and it’s nice). Then, all these JS files along with Vue itself can be bundled to the wwwroot by Webpack. Vue CLI is not available but seems there is no need for that.
Option 2.
MVC/Razor is not used for rendering user pages at all. Authentication occurs by third-party solutions like IdentityServer and with Vue-managed pages. .NET Core is used exclusively as a WebAPI for Vue and to hold a project. Vue part is totally independent from the MVC/Razor part, they even render pages to the different HTTP ports so proxy is needed to convert Vue HTTP port to the MVC/Razor HTTP port to make Vue works in the single project. We can use either Microsoft.AspNetCore.SpaServices.Extensions or NuGet third-party VueCliMiddleware for that. All Vue files typically reside within a ClientApp folder and then are building to the wwwroot folder. Using *.vue files is possible. Vue CLI is available and recommended to scaffold new application to the ClientApp folder (but further CLI seems is not needed). Vue router seems to be the only option for routing. SPA seems to be the primary choice as a structure (not sure, whether MPA is readily available option). Webpack is still used for building Vue app from the ClientApp to the wwwroot.
I started mu Vue journey with Option 1 even without webpack and npm, just with CDN tag on the one of the Razor pages and it works very well. For me Option 1 seems less complex while more flexible. My primary concern is that Microsoft uses Option 2 as a built-in templates for Angular and React in Visual Studio, so I probably is missing something and soon I will be pushed to rewrite my app to the Option 2.
What you guys think which option is better and whether my understanding explained above, is correct?

Symfony2 standalone Form component v2.3 - setting up a form

This is the same question asked here: Symfony2 standalone form component - setting up a form. The answer to this question seems to fully address the issue.
Unfortunately back when this question was asked the version of the form component was 2.0.x, and several things have changed since, for example the form creation using the form factory is quite different now compare the old code vs the new one.
I looked around but didn't find any documentation or examples on how to do this with the latest versions.
any updated versions of a sample application using the form component outside of Symfony2?
I have a repository demonstrating the standalone usage of the Form component for Symfony 2.1+ with both Twig and PHP as templating engine (check the branches): https://github.com/bschussek/standalone-forms/blob/2.1%2Btwig/src/setup.php
The crucial part is that you shouldn't instantiate FormFactory objects manually anymore (to give us core developers more flexibility in changing its constructor), but use the Forms class instead:
$formFactory = Forms::createFormFactoryBuilder()
->addExtension(new CsrfExtension($csrfProvider))
->addExtension(new ValidatorExtension($validator))
->getFormFactory();
A nice side benefit is that your IDE will list you the setters of the form factory builder, showing you what you can configure and how.

JSF 2.x Serverside File selection dialog

With a JSF application, is it possible to show a file selection dialog to the user to select a config file from a specific folder on the server?
Under consideration is a scenario where an application needs to allow the user to select a file to use for a workflow or other process.
I have seen examples of client side File choosers, but haven't come across anything on selecting a file on the server. Is it restricted due to security considerations? Is there a way this could be done?
JSF 2.x
My focus is on ICEFaces at the moment, but would be keen to know if this is doable with any JSF framework.

How to properly integrate Orbeon with Grails?

Attempting to integrate Orbeon 3.9 CE with Grails 1.3.7, using the recommended separate war deployment approach specified here:
http://wiki.orbeon.com/forms/doc/developer-guide/xforms-with-java-applications
After having created the form and viewed in Orbeon Form Builder, I placed the resulting xml in a views/xforms directory under the root of the Grails app and called the file test.gsp. I also placed the image file for the logo of the form in the same directory. I created a war file and placed in an instance of Tomcat 7 where the orbeon.war was deployed. When I invoke the test.gsp, the form comes up sans the image file or any of the labels specified in the XForm!
Why would all labels not render?
Where do I place resources such as an image file so that it appears?
Thanks!
I recommend you don't go the route of using Form Builder to generate a form, and copying the source somewhere else. It see 3 main drawbacks:
Some elements generated by Form Builder are expected to be interpreted by the Form Builder runtime; so they won't be understood by Orbeon Forms when they are generated by your code. I am thinking of fr:view, fr:section and the like.
Form Runner services used for persistence, internationalization, PDF generation… most likely won't work.
The copy-paste process is by itself not recommendable.
The separate deployment assumes that you're using another framework and that you're going to be writing XForms in a text editor, while Form Builder is targeted at "form authors" (not necessarily developers); it uses its own runtime which requires request to hit Orbeon Forms, that is those URLs starting with /fr.
All static files, like images must be placed at web-app/*/ dir, and linked by using <g:resource> tag.
For example, for images you have to put your image ('test.png' for example) into web-app/images/ and use following code in your gsp: <img src="${resource(dir:'/images/settings', file:'test.png')}">
See docs for this tag: http://grails.org/doc/latest/ref/Tags/resource.html

Resources