Mail/Login: Password : forgot my password!

GHANweb: modul Uniface entities

Direct link
Written by -GHAN- // Tags: ghanweb demo live entities

Now what the heck? ... another lister?! You might wonder, why I again start to write about a thing, I've been describing two times by now. But there are so many things that have happened to the code as could be called the ENTITY LISTER III ... But we will from now on call it GHANweb Uniface entities.
This modul will be one of the very basics needed to develop GHANweb and x-ref your projects. It offers search functions, neat features for entities and even code generation.

I would like to point out, that you perhaps will have a benefit to first read the previos versions. Allthough the past contributions had a different purpose, the idea behind it could help you. No longer will this piece of code be a tech demo but much more a tool to work with. We will look at the stuff included now.

Search and Find the entity

As you know, I do things a bit different from the normal habit, I also here follow the main idea of managing data in overviews, details and options. The main content of the server page follows the documented content of a normal GHANweb server page.
So we start the exec trigger with the overview, that lists the entities and lets you discover, what is in store. Skip the idea of entering a GOLD for the retrieve profile ... lets keep this simple to the user! Just enter a part of the searched phrase and hit ENTER. The output is visible imediatly


The details page shows the very details of an entity. Further you got all fields listet and these can be exported to almost any kind of content (which will be explained afterwards). Then we need to mention that you can also browse the KEYS and SUBTYPES of the entity. And finally we can produce a "create table script" for the local defined path. Allthough I wished to produce this script for any connector in the system, it is limited to the default as I do not have the option of making uniface understand, that ORA means ORA and not like DEF MQL! ... So assume this to work with DEF and you will be fine.
If anybody has a solution here asside from creating different .ASN files for each DBMS and then call the creation utility from a userver, then let me know :D

Exporting the entity data

As shown in the former contribution, the content of the detailed entity can be exportet to almost any kind of output. I did some examples with JSON, HTML, XML, CSV and the Uniface parameter whitelist. These had the intention of showing you, that you can put so much in one server page without doing one component for each type.
Again I extended this feature. So now you can simply generate a web form holding the desired fields with its info. This form is almost ready after creation. Just need to load it with your GHANweb component and bring it to the screen. This is something I use very much! With only two or six fields you easy can do this by writing the code manually, but it sucks by time. So the lazy bastard in me made the HTML FORM filter.
If I remembered right, I told you, that you can extend it with your own kind of files. Made my mind about it yesterday and found that NOT to be complete. What I did then, was to pimp those output files with parameter tags, making them as customizable as they might need to be.

Parameters in output files

By now, I just implemented the mainly used stuff to control how the output should be generated to the screen. The parameters control the layout, escaping sequences and special delimiters as needed to do some output. These parameters need to be in the top of the output head file and start with the sequence "!#". They are OPTIONAL.
If placed in any other location, the are NOT recognized. Combine them if you like. They will be cut out at run time. Here is a list:
Sorry- ... please log-in or register to get this!
To show you an example, I picked the JSON output. Have a look
output file for JSON SOURCE CODE
Sorry- ... please log-in or register to get this!

I found it possible to build any kind of output with that. If you got more ideas for more parameters, then let me know.

Building templates files on the fly

I here started off with a editable form template. I guess, I will supply a read-only and an overview set to make it complete. But that will happen later as I might need it and not now :)
So, you just grab the desired fields from the "fields" tab and hit export. A Lightbox will show you the output option were you then just pick the desired one and click on generate.

Want to see the live demo? Well here it is:
Sorry- ... please log-in or register to get this!
- Uniface frontend templating part 3 - The Uniface Entity Lister
- Uniface Entity Lister 2 - Multiple outputs


982 view(s) / 2012-02-26 09:04:57 / LAST UPDATED: 2012-05-18 09:42:16