Aikau 1.0.76 - Form Runtime Support

cancel
Showing results for 
Search instead for 
Did you mean: 

Aikau 1.0.76 - Form Runtime Support

Intermediate II
0 2 941

One of the comments I had on my last blog post point out that one of the main problems with using Aikau is that it doesn’t support the XML-based Forms Runtime that Share uses to render forms using the old YUI2 controls.

I decided to take a look into this issue and see what could be done about it. The major issue with the existing implementation is that it the REST APIs return HTML fragments containing references to the YUI2 controls - it’s just not possible to extract the pure data from the API as it is not.

Fortunately one of the many great things about the WebScripts implementation is their ability to be extended and have multiple output formats defined for them. This meant that I was able to extend the FormUIGet Java controller for the WebScript to generate a pure JSON output for the forms data and then define a new WebScript descriptor to access that data.

Because the Forms Runtime only applies to Share and not to to standalone clients, it was necessary to package the Java class and Spring bean configuration into a separate JAR file. This means that to leverage this new capability of Aikau you now need to include an additional dependency in your AMP files (or simply download the JAR from our Maven repository and copy it into the “share/WEB-INF/lib” folder as I do in my demo video).

Now that we can access the forms runtime data we need to be able to convert the form definition into an Aikau forms model. This is capability is provided by the “alfresco/services/FormsRuntimeService” module. At the moment this module is not fully complete - but I wanted to get something working out to the Community as soon as possible in order to get feedback and hopefully some collaborative development.

At the moment only a couple of YUI2 controls are mapped to Aikau controls, but both edit and view modes are supported and the ability to configure in custom mappings is something that will be added in later. Constraints are also only partially handled, but the remaining constraints will be added soon.

The main objective for this first release was to get something out to the Community that demonstrated the end-to-end capability. A test page has been bundled with the Aikau that you can try out. Everything has been done to support multiple versions of both the Aikau and Forms-Runtime-Support JARs.

Take a look at the demo video and let me know what you think… please feel free to add comments to the JIRA epic or raise issues on GitHub to discuss where to take this next.

EDIT: Update for 1.0.77

We've made some more improvements that are shown in this video.

2 Comments
Active Member
Can't believe it, its been 7 days since you published this an no single comment yet for such an important topic!?!?!? Well I'll be the firs then.



Dave that's great, I was wondering how forms would be handled once Aikau starts replacing more and more of Share's pages (hope this happens ASAP, I don't like YUI2 pages at all).



Your approach seems great because allows backward compatibility with whatever forms configuration people might already have in their Alfresco Share projects but I was wondering if this won't also be a missed opportunity. Let me explain myself.



Current way of configuring forms in Share does work, no doubt, but I always find it quite cumbersome, too chatty, not very extension friendly and hard to maintain if you have a medium sized content model.

I was hoping that with the advent of Aikau a completely new form configuration mechanism would be introduced by Alfresco.



But as I said, that's great. Hope this feature goes forward fast so that we can start developing all our Forms related pages with Aikau controls instead of YUI2.
Intermediate II
Thanks for the feedback Igor, it is much appreciated. I would also like to see some improvements for the forms runtime in general - however, we do at least now have Content Model Management that allows inline creation of forms for new models, and as you say this approach will at least be backwards compatible which is very important.



My plan is to make the new FormsRuntimeService in Aikau very configurable so that custom form overrides can be made as well as custom mappings for some of the YUI controls (and you'll be able to scope these customizations as necessary - e.g. just for a particular mode or property, or globally for all forms).



Hopefully we'll be able to get this to the point of being fully usable soon - however, there is a lot of control mapping still to take care of (as you'll now see listed in the JIRA epic https://issues.alfresco.com/jira/browse/AKU-1014)