vrijdag 11 juli 2014

Updating individual component properties

When you want to do some mass updates to your Uniface application the Global Updates functionality can be of great help. But every once in a while there is something the Global Updates cannot do for you.

I wanted to update one of the More Properties of my components and I found out that Global Updates always replace the complete set of component properties with the new set that you have specified. That was not what I wanted because that would override all the properties that I have so carefully set per functional type of component.

So I made a litte tool.

Attached is a Form that fulfilled my requirements.
With this form you can:

  • Add a property when it does not exist
  • Add a property when it does not exist and update the value if it does exist
  • Change the value of a property when it exists
  • Delete a property
  • Delete a property if it has the specified value

To use this, press the download button below. Unzip the file. Import it into a Uniface dictionary. Make sure you have the DICT model in there. Compile and run Form A_PROPERTIES.




woensdag 7 mei 2014

Uniface: Casting in an if statement





Another great Uniface blog entry by Rik Lewis.

Have a look at it:

Uniface: Casting in an if statement (equality versus identi...:

Uniface is a tightly typed language - this means that when we declare variables, we also declare the datatype, such as string or numeric, l...

dinsdag 6 augustus 2013

An Office-style File menu in Uniface

Have you ever looked closely at the File menu of the MS-Office product? When you look closely you will see that these menus are graphically much more complex than you would think. After some experimenting I managed to replicate it in Uniface 9.6.

You need some Command Buttons and a TabEx widget. In the download you find the logical widget definitions and the images that I used. And in the Uniface form so you can see how it works.

I am no legal expert but you may want to modify this sample before you use it in a production application because you don't want to infringe Microsoft's copyright.



maandag 1 juli 2013

Blend in your HTML Widget

Just a little trick to make an HTML widget blend in better with the rest of your application.


Two aspects:

  1. Get the background color that is used in your application
    I retrieve the color from the .ini file. You could also use $windowproperties to get the backcolor of the window.
  2. Set the background color of the HTML using JavaScript.
    The use of the eval function means that you do not have to include a JavaScript function in your HTML, meaning you can even use this for external websites.


; Set background color of the HTML widget to 
; the color specified in the backcolor property of 
; the window logical widget in 
; the [application] section of the .ini file
call lpGetSetting("application\window","backcolor",vColor)
if (vColor <> "")
   show
   $fieldhandle("TEXT.DUMMY")->$widgetoperation( "JS:eval(%%"document.body.style.backgroundColor = '%%vColor%%%';%%")")
endif
end


entry lpGetSetting
params
   string pSetting : IN
   string pTopic : IN
   string pValue : OUT
endparams
variables
   string vTopics
endvariables

   vTopics = $setting("", pSetting, "INIDATA")
   vTopics = vTopics[$scan(vTopics,"(")+1]
   vTopics = vTopics[1:$rscan(vTopics,")")-1]
   vTopics = $replace(vTopics, 1, ";", "·;", -1)
   getitem/id pValue, vTopics, pTopic

end

maandag 10 juni 2013

A Facebook Like button in Uniface

This is really simple:

  1. Determine the URL of what you want your Like button to like.
    If it is a posting you have to hover over the timestamp to see the URL.

  2. Paint an HTML Widget on your Uniface Form.

  3. Assing the following string to the widget:
    "&http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FUnisocialCommunity%2Fposts%2F382515988535596&send=false&layout=button_count&width=450&show_faces=true&font&colorscheme=light&action=like&height=21&appId=222806551068648"

  4. Now the Like button goes to one of my postings.
    To change that replace the URL in the href parameter with your own URL. Use URL encoding, %2F is a foward slash. So you have to replace this bit:
    https%3A%2F%2Fwww.facebook.com%2FUnisocialCommunity%2Fposts%2F382515988535596

  5. Compile and run!
    (If you are not logged on to Facebook yet, a login dialog will appear after you have pressed to button.  Please follow the instructions in the dialog.)

Needless to say that this is just as easy in a Uniface Web application...

maandag 1 april 2013

Recursive Indirection

"Recursive indirection". That sounds pretty impressive but I guess it does not mean much to you without some explanation. Here it comes:

You all know how to assign a value to a variable  in Uniface:
vValue = "Hello world"

And you also know how to assign to value of a field to a variable:
WELCOMETEXT.DUMMY = "Hello world"
vValue = WELCOMETEXT.DUMMY

Most of you also know that you can use indirection.
With indirection you have a field that contains the name of another field., and you use this to assign the value of that field to a variable:

WELCOMETEXT.DUMMY = "Hello world"
WELCOMEFIELD.DUMMY = "WELCOMETEXT.DUMMY"
vValue = @WELCOMEFIELD.DUMMY

Not many people know that (in recent Uniface versions) you can do this recursively:
WELCOMETEXT.DUMMY = "Hello world"
WELCOMEFIELD.DUMMY = "WELCOMETEXT.DUMMY"
WHATFIELD.DUMMY = "WELCOMEFIELD.DUMMY"
vValue = @@WHATFIELD.DUMMY

You probably do not need this often, but it can be valuable in complex user interfaces or maybe a software package that is highly configurable. Don't forget to put in some comments when you use this: it is powerful but it does not make your code easy to understand for your fellow developers!





maandag 11 maart 2013

Sneak preview

In this picture you see some new stuff that is planned (!) for release in Uniface 9.6.02.

Can you see what the differences are without looking at the answers below?


maandag 4 maart 2013

I love the HTML Widget

Back in August 2010 I made a couple of samples to show that you could use web functionality from Uniface client/server applications. It worked, wasn't too difficult, and you could make a lot of nice things with it. But it was a bit of a hassle having to use an OCX container to get a browser window. You can have a look at the old blog entry if you want. 

In Uniface 9.6 creating stuff like this is even much easier. Putting a Google map in your Uniface client/server application is so simple now. A static map is really just supplying a URL to the HTML widget, and a dynamic map with zoom and even Street View is not much more difficult. Have a look at the Sample that I have put on www.uniface.info

Get your kicks with Uniface 9.6


woensdag 16 januari 2013

User Experience and Development Productivity

After reading several posts on User Experience on www.uniface.info I could not resist writing down my opinion on User Experience and Productivity in Uniface.

Read it here

donderdag 10 januari 2013

New sample in Japanese

It was very strange for me to see my work suddenly in a Japanese version. The command button sample on www.uniface.info is now also available in that language.

Thanks to:
  • Kazuyoshi - Translating
  • Junya - Proof reading
  • Michael - Artwork

Click the picture to go to the sample:

donderdag 13 december 2012

(The road to) Uniface 9.6 Samples

Long introduction
My involvement with Uniface started when I worked at KLM Engineering and Maintenance and we decided to move away from the Wang VS platform and the BASIC programming language and we were looking for the best 4GL and the best RDBMS. After a Proof of Concept with multiple 4GL's and RDBMS'ses we chose Uniface and Oracle. And I did not have have RSI anymore from banging out hundreds of lines of code every day.

After eight years of KLM I decided that I wanted to see more companies and meet more people. So I joined Ordina which at that time had a very active unit that provided Uniface services. I worked for a lot of companies and did everything you can do in a Uniface related projects. From programming to designing to testing to project management. After another eight years there was a big recession in the IT world and along with many other colleagues I got fired.

Since there was not a single job available in IT, and I could not sit at home all the time, I worked as a workshop receptionist for a car dealer for a while.

Luckily every recession has an end and I got a new job at Compuware. In the Services department I started to work for Uniface customers again. It was great visiting so many customers in so many countries. But I saw that many customers were not using Uniface to the full extent, so I started putting up little samples on this blog.

After a couple of years it was time to look at Uniface from yet another angle. Two months ago I transferred to the Uniface Lab.

And that brings us to the Uniface 9.6 Samples:
The first thing I was asked to do in the Lab was to make official samples for the new GUI features of Uniface 9.6. That is why it has been a bit quiet on this blog. It was a very nice challenge, because in this role I was one of the very first people that could actually build something with Uniface 9.6. And since 9.6 was not completely finished when I started I also found some bugs so at least there are a few less for you to run into :-)

You can see the results on www.uniface.info/samples.



More samples will become available there soon. At first only the 9.6 GUI samples will be on the website and all other samples are still distributed with the Uniface product. But over time we want all samples to be on the website so it is easier for you to get them and easier for us to make new (versions) of samples.

I hope you like them. Please feel free to contact me if you see room for improvement, or would like to see a sample for a specific topic. If it is something small I can still post it here, otherwise I can direct your request towards the decision makers.

Get your kicks with Uniface 9.6 !

maandag 19 november 2012

Alternative Version Control Solution for Uniface

The Uniface ecosystem is supported by more companies than just Compuware.

There is an alternative solution for version management / source code management available from March Hare. Have a look at www.march-hare.com to see if this can be useful to you.

I just had a conversation with March Hare’s product manager Arthur Barrett. It was good to exchange our ideas on the future and to talk about old times too.

donderdag 15 november 2012

Date picker for Uniface 9.6

In Uniface 9.6 it will be really easy to implement a Date Picker widget.

A Date Picker is a date field with a little icon. When you press the icon a calendar appears. Uniface has this widget available for web development in Dynamic Server Pages. For Windows Forms there is no Date Picker widget. Uniface does however have a Calender widget. And Uniface 9.6 Popup Forms are introduced. Combine the two and you have the full Date Picker functionality.


vrijdag 2 november 2012

Uniface 9.6: billions of buttons

I really need to stop playing with the new Uniface buttons... In Uniface 9.6 you can create "billions" of buttons by specifying an icon that goes on top of the button and four images that represent the button in its four states. Also different text colors for the four states and gradient background color possible. PNG support makes using transparent images easier. No more need to paint both a label and a button if you want both text and icon on a button!
  1. Classic Uniface button with gradient color.
  2. Classic Uniface button with icon and internalized label.
  3. Classic Uniface button with icon and text in field value.
  4. Image button.
  5. Image button with text.
  6. Image button with icon.
  7. Image button with icon. Text from internalized label.
  8. Image button with both icon and text in field value.
  9. Windows button.
  10. Windows Header button.

zondag 28 oktober 2012

Uniface 9.6 tab widget mania

I really need to stop playing with the new Tab widget...

Make a Tab look like a simple ribbon bar



Shiny buttons...



Just using colors



Different colors for different tabs



Accordion with images



Stack with gradient colors



vrijdag 31 augustus 2012

First things first

From many years of experience in many different projects I am of the opinion that you have to have a stable foundation before you start building functionality.

At the start of your project you have to make a list of things that your application framework has to support. Some examples:
  • CRUD functionality (Create, Read, Update, Delete)
  • Menu and security features
  • Use and storage of application configuration data
  • Special user interface requirements 
Making this list prevents you from building a framework that is too heavy for your application.

When you have built your framework, build a small part of your application. This is to verify that your framework actually works.

After that you can build the rest of your application quickly and without worries. Integrating framework-like aspects into an existing application requires a lot of refactoring, which is much more expensive than getting the framework right first. And starting full scale application development when your framework is not finished yet requires temporary stubs that need to be replaced be the real thing later, again making it much more expensive than getting the framework right first.

This is not just my opinion, it is a simple extension of all the studies that say that fixing defects becomes more expensive when done in a later phase of the project. Some people think that “First things first” only fits a waterfall approach to software development, but I disagree. In, for example, a SCRUM project the “First things” can be assigned a high priority so they will be done in the first sprints.

And I know there are many differences between building a house and building software, but would you lay the carpet before installing the plumbing?

vrijdag 29 juni 2012

The new Millenium problem

SEPA and IBAN

As you may have noticed the introduction of SEPA (Single Euro Payments Area) is an initiative to create a single set of standards for euro payments.

The BAN (Bank Account Number) as we are familiar with will, and must be, replaced/implemented by the IBAN (International Bank Account Number) before February 2014.

From February 2014 payments can only be done if you use the mandatory IBAN and the BIC (Bank Identification Codes).

The main schemes involved, for doing that, are the SCT (SEPA Credit Transfer) cross-border scheme, that allows you to transfer payments between any SEPA country, and the SDD (SEPA Direct Debit) scheme to collect payments form any SEPA country. Both will replace the existing domestic schemes. (for example CLIEOP3 ).

Result of SEPA and the IBAN is that the total number of characters exceeds that of the BAN, the format of the interface with your bank will change. So you will have to make changes in your IT environment to deal with it.

Already a bit nervous?

Let me summarize some points for you to get grip on the situation:

  • Where is my BAN published (financial documents, bills, site, relations, business cards etc… )
  • Make an inventory of your existing processes, IT and organization that are hit by the BAN.
  • Setup of a project plan:
  1. to get the new IBAN’s (employees, suppliers, customers etc)
  2. to migrate your existing IT infrastructure. (schemes, BAN/IBAN, Replacement of existing domestic schemes, processes, validations etc… )
  3. to republish your own IBAN.
  4. to testing, testing, testing
  • Make inquiries by your bank to avoid any misunderstanding.
February 2014 seems far away but don’t let it fool you because there are already companies, at the moment, migrating to the IBAN and it seems, as I heard, a lot of work to achieve that.

Bert Hogendoorn, Migration consultant at Compuware Uniface






Uniface Applications

Most Uniface applications have been around long enough to survive the Millenium problem and the introduction of the Euro. They will be able to handle the changes requires for SEPA and IBAN too.

Bank account numbers can be found in Uniface applications more easily than in other applications. For a start search the repository for the bank account numbers and create a cross reference to see in which programs they are used.

The new interface format for the bank is XML based, so importing the WSDL will give you a good start for rebuilding your interface software.

The changes in your Uniface application may not be the biggest challenge. Other aspects like obtaining all your customers and suppliers IBAN's or agreeing with your bank on the details of the interfacing could be even more difficult.
The hard and final deadline is February 2014, but the national implementation plans state that all software should be SEPA ready by October 2012.

Theo Neeskens, Solution architect at Compuware Uniface

donderdag 24 mei 2012

Other Uniface blogs

Just found another Uniface blog. It is from Rik Lewis and so far it contains some nice coding examples: http://uniface.blogspot.co.uk/ Pat Walsh also has some Uniface stuff on his blog: http://www.patwalsh.co.uk/tag/uniface/ James Gallagher, Compuware Uniface sales for Asia Pacific also has a Uniface blog: http://unifacejames.blogspot.co.uk/

zaterdag 3 maart 2012

Build a RESTful webservice in 3 lines of code

After building both SOAP and RESTful webservices in Uniface my opinion is: use REST when you can, SOAP when you must. This article explains why: REST vs. SOAP – The Right WebService

Not many people know how easy it is to build RESTful webservices in Uniface. Because you do not need special statements or features there is no information on it in the documentation.

Here are the steps for building a (very) basic RESTful webservice:

  1. Create a new DSP component RESTBLOG
  2. Remove all code from all triggers (especially Set State)
  3. Add a dummy entity
  4. Enter this sample code into the Execute trigger:

    public web
    variables

       string vInput  ; Input parameter from URL
       string vOutput ; Output content to be returned
    endvariables

       ; --- 1 --- get input parameter
       getitem/id vInput, $webinfo("INPUT"), "name"

       ; --- 2 --- create output based on input
       ; you can do anything here
       vOutput = "Hello %%vInput%%%, I am the output"

       ; --- 3 --- fill the output channel
       $webinfo("output") = vOutput

       ; And we are done !
       return(0)

    end
  5. Compile
  6. Test using a URL like http://localhost:8086/uniface/wrd/RESTBLOG?name=Theo
  7. Congratulations, you have just build your first Uniface RESTful web service!

NB: We did NOTHING in the Layout Editor!