Category Archives: Clarion News

Upcoming releases and news from Denver

The Clarion User conference was a great success. I presented the keynote remotely, and in this post I’ll cover the highlights of the presentation.

First on the Clarion for Windows Win32 side – I mentioned that the next release for Clarion 7 will be version 7.3, and in that release we’ll deliver several key RTL bug fixes and additional fixes for ReportWriter and the IDE. The 7.3 release will be ready to go out around mid-month.  I also did a brief demo of Clarion8, I only touched upon some of the new features already implemented, such as the new “edit as text” mode for the Data pad, and the new locators added to every list in the Dictionary editor (and added to the Data pad as well).  I also announced that we’ll be making an early access release for Clarion8 available to everyone with a subscription, and that will be ready by the end of this month.

On the .Net side I showed a short preview of the .Net Application Generator UI, and Pierre did further demonstrations during the conference. I explained that we are busy writing the .Net templates – and that the process of writing and testing the templates leads to bug fixes in the code generation engine.  With lots of hard work, and a bit of luck, we hope you’ll see a beta release in December.  I also mentioned that we’ll be putting all the templates (.Net and Win32) into a repository that will be open to the community. Doing this will allow Clarion developers instant access to the latest templates, and any template fixes or changes, and it will also allow Clarion developers to contribute their own templates and to participate in extending and refining existing templates. Later this week I’ll post another blog with some screenshots of the AppGen.Net UI – and as always we look forward to your feedback.

Thoughts of Denver CLDC 2010

Almost a week has passed since I first landed in Denver for the start of the 2010 Clarion Live Developer’s Conference. As I am still traveling this week across the heartland visiting friends and relatives. I wanted to share with you my thoughts that have stayed with me in these past few days.

First, it was great to see and catch up with a lot of the Clarion developers from years past, some of them who I haven’t seen since the last developer’s conference in Orlando 2004 and Gatlinburg in 2005. With nearly 100 people in attendance, it was hard to meet and talk to everyone, but I think that I got close to doing that.

I was honored to be a presenter and help to kick off the conference in the first two days as a representative of SoftVelocity. My colleague Pierre Tremblay gave the last technical presentation of the conference and helped to end it on a very high note as attendees got a first look at the Application Generator for Clarion.NET.

But in between our presentations were session after session of great technical presentations by well respected Clarion users like Bruce Johnson, Mike Hanson, Rick Martin, Shawn Mason and many more. The presentations were “linear”, which meant that nothing was missed and often went on very late into the night.

I was unable to catch a lot of the presentations, but all are recorded and available for download on ClarionLive. The reason that I missed them was due to the time that I spent in the Solutions room, getting feedback from many attendees and just stopping by to say Hi and talk about all things SoftVelocity. What we could show them with the soon to be released Clarion 8 and Clarion.NET was encouraging and energizing to all.

So I left the conference energized and refreshed as well. The attendees seemed to “get it” and know that there are great things in store for SoftVelocity and Clarion users coming very soon.

I will be flying home in less than 24 hours now, and I can’t wait to get started.

Robert Zaunere will be blogging soon regarding Clarion 8, Clarion 7.3 and more. Again, thank you to everyone that could be at the conference. It was great to see you again and we hope to see you again in 2011.

Clarion Developer event in Denver

John Hickey and Arnold Young, hosts of the weekly ClarionLive! webinars, are hosting a Clarion Developers conference from October 29th through the 31st 2010 in Denver,  Colorado

SoftVelocity’s Bob Foreman and Pierre Tremblay will be there and both of them will be presenting sessions, and I’ll be presenting a keynote address via live webcast.

Additional presenters include Clarion developers such as Bruce Johnson, Dave Harms, Mike Hanson, Gordon Holfelder, Rick Martin, Russ Eggen, and more.  The entire conference will be streamed live, so if you can’t make it to Denver you can still sign up and benefit from the conference remotely.

All the registration details, including pricing, location, and conference brochure are available at the ClarionLive website.

I’m sure this will be a great event and I encourage you to check out the details at www.clarionlive.com

For more information on the event visit www.clarionlive.com or email clarionlive@gmail.com.

AppGen.Net – news

These last weeks we’ve been working on the integration of the Data Schema and the Embeds (two of the more intricate connections needed for the new AppGen.Net)
Here’s a screenshot of the Embeds interface (in this screenshot we are using a textbox dialog not the full Source editor)

embeds3

The concept of “embeds” is uniquely Clarion, and I don’t know any code generation system that has copied this functionality, and of course the idea of “embed” functionality is not part of any T4 implementation. Implementing “embeds” allows us to deliver true two-way extensibility.

The embeds can be used in two ways; an extension template can inject code into the target source file, or a user can write their own code into an embed point. Either way it becomes a part of the final output from the code generation process.

An extension template can extend the functionality of a Procedure or Application template by adding code to in an embed created in the Parent template.  With embeds Clarion can extend the generated code from the bottom to top, instead of the top to bottom hierarchy used with OOP derivation. The extension template doesn’t need to know anything about the code generated by its parent in order to insert its own code into the process, all it needs is the embed name and its priority of execution. The embed points, as in the Win32 template system supports a name that is unique to the active scope, and displays text that supports display within a tree structure, and a description to be used as quick context help (as a tool tip).  Also, as with its Win32 counterpart, it supports the concept of “hidden” embeds that create an embed point that can only by used by an extension template, and isn’t visible to the end user. An embed also supports a condition that is evaluated at code generation time to allow conditional embeded code generation. The embed points support the use of a priority, and in the case of template generated code a description.

Declaring an embed in the templates is very simple:
<#% EmbedName tree=”Display Name|other level|other level” description=”some short text” hidden=”True” condition=”expression” #>

for the AtEmbed directive the syntax is:
<#%+ EmbedName condition=”expression” priority = “5000” Description=”text”#>

between the beginning  (<#%+ #>) and end (<#%-#>) of the AtEmbed, both both static code and dynamic code can be inserted.

Here’s a screenshot showing the Data Schema pad.

datapad

The dictionary is the heart of a Clarion Application, and for that reason we needed a way to interact with the Data Schema, so of course we chose to suport the same UI as we have for Win32 applications; the Data Schema Pad. And the same as in our Win32 template system the templates have access to the the data defined in the Schema to be used at the Application or Procedure level using properties of the templates.


Diego Borojovich

Clarion T4 template walk-through

T4 templates have a simple ASP.NET-like syntax and consist of processing directives, text blocks and code blocks. For this discussion we’re using the attached DCTTreeWizard.tt file which is a Utility template. Download it from here

We have two types of Utility Templates; DCT Utility Templates and ApplicationUtility Templates. Within the IDE when the “Document” tab that has focus is a .DCT or an .APPX the “Run Utility Template” menu item under the File menu is enabled, and depending on the type of the active document, the “Run Utility Template” Menu item will show a Selection Dialog displaying the appropriate Utility Templates for the document (DCT Utility Templates or Application Utility Templates) The big difference between a standard template and a Utility Template, is that the when the Utility Template is executed, the code will not output any text/code automatically. The template developer must define the output using the built-in Open/Close or Create/Close methods.

The DCT Utility template focuses on the DataDictionary object. The DataDictionary object is of type IDataDictionary, and using the IDE’s code completion we can learn how to use it; seeing its properties and methods with the complete descriptions. The DataDictionary object is very straight forward and easy to undertand. For example, it’s likely pretty clear that “this.DataDictionary.Tables” returns all the tables defined in the Dictionary.

The Application Utility template also has the DataDictionary object, but it has another object called “Application”. And of course you can query “this.Application.Procedures”, and guess what that returns? Yes you guessed it, all the procedures defined in that .APPX file.

Let’s do a walk-through of our simple DCT Utility template.

We’ll start with a look at Directives. The syntax of a directive is:

<#@ DirectiveName [ParameterName = “ParameterValue”] #>

for an example look at line 1 from the attached template:

<#@ template language=”C#” debug=”true” type=”Utility” name = “DCTTreeWizard” chain=”Clarion.File”#>

The “language” parameter specifies which language is used in the code blocks of the template, and in this case we specify C#.

The “debug” paramater allows you to debug templates. When that parameter is on, and the corresponding IDE option is also on, the template source code files are copied to the %root%..Templatesdotnet folder. And when there is an error in compiling the template (compilation occurs when you register the template), the error is displayed in the Error pad, and you can then double-click on the error and the .TT file with the error is opened for editing at the line with the error.

The “type” parameter specifies the type of template, current possible types are:
Application,
Procedure,
ApplicationExtension,
ProcedureExtension,
Utility,
UtilityApplication,
WizardApplication,
WizardProcedure

The “name” parameter assigns a name to this template, and finally the “chain” parameter specifies the template family.

Lines 2-6 use the “assembly” directive:
<#@ assembly name=”mscorlib.dll” #>
<#@ assembly name=”System.dll” #>
<#@ assembly name=”System.Drawing.dll” #>
<#@ assembly name=”System.Design.dll” #>
<#@ assembly name=”System.Drawing.Design.dll” #>

The “assembly” directive identifies an assembly to be referenced by the template so that you can use types within that assembly from within the code in your template. Using the assembly directive is equivalent to using the Add Reference feature in the Clarion# IDE. The “assembly” directive does not affect the source code of the compiled template.

Lines 7-12 use the “import” directive.
<#@ import namespace=”System.Collections.Generic” #>
<#@ import namespace=”System” #>
<#@ import namespace=”SoftVelocity.TextTemplating” #>
<#@ import namespace=”System.Drawing” #>
<#@ import namespace=”System.Drawing.Design” #>
<#@ import namespace=”SoftVelocity.DataDictionary.Design” #>

The import directive allows you to refer to types within a text template without providing a fully qualified name. The “namespace” parameter is transformed into a .Net “using” directive in the compiled template.

Now look at line 13:
<#@ property processor=”PropertyProcessor” name=”OutputFile” type=”System.String” defaultValue=”none” editor=”System.Windows.Forms.Design.FileNameEditor”#>

The “property” directive defines an editable property of the template. It corresponds to #PROMPT in our Win32 template language. The parameters are probably self-explanatory; “name” is the name that is displayed in the property grid, “type” defines what type of value is accepted, “defaultValue” is exactly as the name suggests, and “editor” is the object that is used to visually edit the property. The “editor” can be just the default; a simple text string, but it can also be a dialog window, a dropList, a checkbox, or by default a simple textBox.

Line 14 is interesting: <#+ string _OutputFile = “”;#>

the <#+ tag indicates a template helper block. The helper block allows the template developer to add code at the TextTransformation Class level. The code added can be a Method, a Field, or a Property declaration.

If a Method is declared within the helper block, it can be compared to a #GROUP from our Win32 template language. Embeds can also be declared inside a helper block.

for example:

<#+ void MyPseudoGroup() {#> <#% MyEmbed #> <#+}#>

In this case when the method MyPseudoGroup is called, the content of the MyEmbed will be also executed.

Line 15: <# this._OutputFile = this.OutputFile;#>

just the value set in the “OutputFile” within the property directive to the internal _OutputFile variable.

Line 16: <# Create(this._OutputFile);#>

calls an internal method that creates a file on disk to receive the generated text (code or other text). It corresponds to our Win32 counterpart #CREATE.

Line 17:
*************************

is a text block, as there are no template directives surrounding it. Text blocks are copied to the output “as is”, with no further processing.

Line 18: – Listing for Dictionary: <#= this.DataDictionary.FileName #>

mixes a text block: ‘– Listing for Dictionary: ‘ with an expression block:
<#= this.DataDictionary.FileName #>

You use expression blocks in text templates to add strings to the generated text output. In this case we’re asking for the name of the Dictionary that we’re processing. Expression blocks are delineated by using the <#= template tag. The syntax is: <#= ExpressionCode #>

Lines 19-49 use code blocks. The syntax for a code block is: <# Code block #>

Code blocks can generate template output. In our template the code block uses a few nested foreach loops to walk the dictionary. We’re using a mix of text blocks and expression blocks to write the details of the dictionary to the output file. Code blocks can use any available .NET APIs. In this template we’re using the DataDictionary API to output the Dictionaries collections and properties; Tables, Columns, Keys and Relationships.

I hope this walk-through has provided a good introduction to the new template syntax used in AppGen.Net.  For those who are thinking of writing some T4 templates the attached example is a good starting point to get familiar with the essentials. Next time we’ll go a bit deeper into the template syntax.