COMPANY
COMMUNITY
BLOG
HELP
MY ACCOUNT
EN PT ES

blog 3 287

Changing the WorkWith in XEv1

Post by Miguel Figueroa on the Blog of the GeneXus Community in Chile about the power of the Patterns tool.
First of all, to follow the tradition and even though it seems a bit late, I’d like to wish all Genuxians in Chile a happy and prosperous 2009.

It seems that during 2008 we were all pretty busy, which means that we didn't organize any activities whatsoever and didn't even write on our blog.

This lack of participation and enthusiasm surely has to do with the usefulness of the GUGXChile for Genuxians in their daily tasks, something that hasn't happened so far. That is to say, it should be a more effective instance for collaboration.

There may be other reasons, but now I’d like to go into the subject of this post.
From GeneXus 9 we have the possibility of working with Patterns which, in simple words, are intelligent "molds" or "templates" used to automate a lot of work that we would usually do manually.

Probably the most used pattern is the WorkWith that comes with GeneXus, so I assume that most of us have experimented a bit creating some transactions and watching how, in seconds, a complete application is obtained with the "work with" screens and tabs with views according to the relationships given by the transaction attributes.

In spite of all those wonderful things, most of us (it happened to me) have probably missed some form of access control and rights and maybe other things as well.
Why didn’t Artech create it with more features? Maybe another improved version is coming soon? No. The idea is that everyone creates his or her own patterns and the WorkWith is just a good example of the power of this tool.

ww2

I wanted to approach this subject not by creating a pattern from scratch, but changing Artech's WorkWith (GXXEv1 Beta1). Based on that work I've prepared a version called ww2 which is available at GXOpen.

This version covers the following topics:
- Creating transactions for Users, Modules and Rights
- Procedure to initialize the admin. user
- Procedures to validate accesses and rights
- Login in the Home Web Panel
- Adding security routines in the generated Web Panels.



Vista del Login en webpanel Home


The expected functionality is more or less like this:
- the user will view, in the menu, only those modules for which he or she is registered.
- in the "work with" screen he or she will only view options depending on rights (Insert, Update, etc.).
- the user will be able to have individual accesses and rights or for being part of a users group.


View of the Menu in the Home Web Panel

Change the Work With

I will not explain the changes in detail, as that would be too long and the idea is that you discover things on your own, with a little guidance, by looking at the XML and DKT files of the ww2.

Change the CSharp project

In the case of the Work With, the sources come with the SDK Platform.
This is a bit advanced and aimed at CSharp programmers rather than GeneXus users.
In the case of the ww2 pattern, the Csharp code had to be altered to change the Work With name to ww2.

Change the resource file

The resource file is an xml file containing the definition of the objects consolidated in the KB the first time the pattern is applied.
To add objects to the resource file you only have to make an export, open the xpz and copy the desired Object element.
In this way I added the transactions and procedures to the resource file of the ww2.

Change the DKT templates
The DKT templates are text files with embedded CSharp programming that is interpreted by GeneXus when applying the pattern. The execution of each template returns the parts (Events, Variables, etc.) of the new objects.
It could be said that it’s a special consolidation (import), not from an xpz file but from the template interpretation.
In these templates we can easily identify, for instance, the parts of GeneXus code which are static and those parts that are dynamically built interpreting Csharp.
A good example is the code of the Permissions routine in the GridEvents.dkt file of the ww2 pattern.

Well, that’s all for now!

*Posted by Miguel Figueroa in GUGX - Chile.




 
Related
Enrique Almeida writes in his Blog about the Beta 1 version of GeneXus X Evolution 1
New extension for GeneXus X Evolution 1
WW PATTERN: When less is more!
Special Edition #GeneXusTheBestOf2014 :: Cloud Computing, the Internet of Things, GeneXus X Evolution 3, Success Stories, Smart Devices and ... Much More!
Release of U2 of GeneXus Evolution 3
Chopo Mobile introduces successful app in Mexico, developed with GeneXus and used for medical studies
GeneXus™ ERP Explorer and Connector for SAP® ERP Now Live on SAP Store
We have a new Download Center! The GeneXus download center has an enhanced appearance at its new location
Demand for Apple TV apps expected to double in 2016
What we've learned about GeneXus by working with Gartner (by Gabriel Simonet)
Agile or Waterfall development? (by Breogán Gonda)
We are pleased to share an interesting white paper about GeneXus, written by Kapil Ambwani from India!
Mickey, Toy Story & GeneXus: Why robots will transform developers?
GeneXus™ Named a NEW Challenger by Gartner In Its 2017 Magic Quadrant for App Development Platforms Report
Free Live Webinar: Conversations on Digital Transformation - Wednesday, November 8, 2:30PM (EST)