Open Menu

Synergex Blog


I didn’t know you could do that!

By Richard Morris, Posted on March 23, 2017 at 2:34 pm

Working with the many customers we have is a great opportunity to advance the software we write. Some time ago I blogged about Symphony Bridge – a server based utility that allows you to expose Synergy data and logic through Symphony Harmony using an SQL-like syntax. In essence you can write queries on the client like “select * from part” and the bridge server will return a collection of part objects that are based on a structure you have created in your repository. You can then bind these to grids or input controls on you windows or mobile applications or display them in web pages. In fact you can use the data in any Synergy .Net or non-Synergy application.

Another aspect of Symphony Harmony/Symphony Bridge is the ability to call a remote procedure using the syntax “exec @MyNameSpace.MyClass.MyMethod”. You can pass in arguments and again a data object or a collection of data objects are returned.

During a recent visit with one of our customers who is currently utilizing symphony Harmony and Symphony Bridge to provide third-party access to their systems to allow enquiries on orders, etc. I was asked about “providing the ability to return a standard object that contains the call status AND the response data”. Simple, no problem: Create an RPS structure that defines your response details – call status, error codes, and error message for example. Code generate the required data object and then customize it by exposing a collection of <DataObjectBase> (the base class of all data objects!) As I said – simple.

But the customer was not overly impressed – and they had an idea! Oh dear me thinks – these are seasoned C# developers and I’m not convinced I’ll be able to implement their ideas in Synergy .Net! But how wrong I was…. and without any changes to the Symphony Framework. The basic requirement is to have a “response” class that they can extend with any serializable “type” – be that a single instance or a collection of “type” – without any restrictions.

The starting point was the same – create the required response structure in the repository and code-generate the “response” class. This is the resulting class definition;

public partial class Server_response_Data extends Symphony.Conductor.Model.DataObjectBase

The code generation process creates all the required properties and the logic to serialize the data into JSON or BSON.

The next step was to create a second class with the same name as the response class but this time it will accept a generic – generics are quite cool and allow you to defer the specification of a type until that type is instantiated. So our generic response class definition looks like this;

public class Server_response_Data<T(new)> extends Server_response_Data

By extending the base code-generated class we get all the required Symphony capabilities. The “T” denotes the generic “type”. The (new) ensures that any type you provide must have a parameter-less constructor which ensures that this class can creates an instance of it. We can expose the property so it’s serializable;

{JsonProperty}
public property Result, T
       method get
       endmethod
       method set
       endmethod
endproperty

And in the constructor we can ensure there is an instance (to prevent null object exceptions);

public method Server_response_Data
       endparams
proc
       Result = new T()
endmethod

And that is about it. You can then write your server methods to create an instance of your response class, populate the generic “response.Result” with the required “type” and set the response properties accordingly. For example;

data response = new Server_response_Data<Part_Data>()

Will create a response class with the “Result” as a type of Part_Data data object. If you need to return a collection of Part_Data objects;

data response = new Server_response_Data<List<Part_Data>>()

It’s really as easy as that. On the client you simply make the remote EXEC call through Symphony Harmony;

result = DataExecute.RunDataExecute(connector,
       &      "exec @MyNameSpace.MyClass.MyMethod",
       &      new Server_response_Data<List<Part_Data>>()).Result

You can also await the call on a separate thread.

Big shout-out to Gareth for the idea and his persistence to make me get it working!

I’ll be using these techniques in my DevPartner 2017 post conference workshop as we build a mobile app from start to finish using Symphony Harmony/Symphony Bridge to access remote data and logic.


Let’s get Physical – at DevPartner 2017!

By Richard Morris, Posted on March 8, 2017 at 8:38 am

The DevPartner 2017 conference is rapidly approaching and so I thought I’d follow on from Steve’s recent blog about the conference and what a content packed agenda we have this year. As usual we have the hugely successful customer demonstrations – always great to see how developer are making the most from Synergy today. There are guest speakers taking about testing your software – and I thought if it compiled it was tested, so I’ll be glued to that one. We also have a student Physiotherapist guest speaker – not your usual topic for a Synergy software conference I must agree!

Way back in 1981 a certain blond bombshell by the name of Olivia Newton-John hit our screens in tight pink leggings telling us all to “get physical”. For many around my age she was the pin-up of our times. I’m sure I can recite all the lyrics today! Although we won’t be seeing Miss Newton-John at the conference (sorry) we will be “getting physical”!

As part of an undergraduate degree I’ve developed an interactive mobile app:

Exercise compliance is one of the most important parts in patient rehabilitation, and yet it is given minimal consideration. The Chartered Society of Physiotherapists (CSP) detail that the first step in rehabilitating a patient back to their pre-injury function lies with their Physiotherapist’s ability to educate and motivate their patient through a clear and concise home exercise program. Patients can regularly expect to receive a printed sheet of generic exercises laden with hand-written amendments which look to tailor the exercises to the patient’s needs. Given that more than 70% of adults in the U.K. own a smartphone, there has never been a better time to take the technological leap and focus of connecting with and engaging patients much more remotely. That’s where Physio My Way comes in.”

And so Physio My Way was born. Written entirely in Synergy .Net it’s a true mobile application that is designed to educate patients to perform the correct exercises and monitor their compliance with the exercise schedules defines by their therapist. In-app options include the ability to review the various assigned exercises and stream videos that show just how they should be performed. Guidance is provided through spoken instructions and monitoring patient compliance is recorded using the devices accelerometer.

Movement patterns and screen activity can provide a clear and detailed account of every single repetition that a patient completes. Their Physiotherapist will have secure access to all of their patients’ data through their own personal log in. Specifically, this means that all exercise progressions or regressions will now be based on objective outcome markers, rather than a patient’s subjective recollection of their exercise completion. This gives superior reliability of patient feedback and is based on key Physiotherapy findings such as severity, intensity and frequency of pain and rate of perceived exertion at every interval.”

Our guest student Physiotherapist , Ashley, will be presenting an interesting session on his design and the theory behind the Physio My Way app and the results from his studies – did it improve people’s compliance with their prescribed exercise plan? And I’ll be dissecting the technologies used to develop and deploy data in the cloud and the app to Google Play Store and the Apple App Store:

At the post conference workshop on 12th May I’ll be building, from the ground up, a cross-device mobile application through lecture and demonstration. The session will target both Android and iPhone devices. Using the latest Synergy tools, Xamarin forms and Visual Studio.  We will initially build and deploy a simple cloud based server. From here we will build a client connection module to communicate to our server and also implement the required code to manage Synergy device licensing. Next we will layer on the UI – XAML based cross device compliant forms. We’ll include some cool Xamarin components and finally build and deploy to both iPhone and Android. It’s a not-to-be-missed day if you are interested in expanding your Synergy applications capabilities onto the mobile device platforms.

Make sure to sign up and bring your exercise gear as we “get physical” at DevPartner 2017!


Wheel, Scroll, Oops.

By Richard Morris, Posted on October 14, 2016 at 6:45 am

If you answer “yes” to the following questions, then please read on: Do you have a Synergy UI Toolkit application? Do you use standard (not ActiveX) list processing with a load method? Do you run your software on Microsoft Windows 10?

Windows 10 offers a new feature that allows you to mouse over a list and use the mouse wheel to scroll the list, without the list actually getting focus. It’s a great feature, but if you have a standard list displayed in your UI Toolkit application which uses a load method – then that mouse-over scroll operation will attempt to “process” the list and cause the list load method to execute. Does not sound too bad – but if you have method data being passed through from the l_select() or l_input() routines then this data will not be passed to your load method, because you are not actually in l_select() or l_input(). Also, because the list has not gained focus you have potentially not been through your “my list is gaining focus so set up the load parameters” logic, which again means when your load method executes it’s in an unknown state.

When your load method executes in this “unknown” state and you try to access method data or your uninitialized load data then a segmentation fault may occur. The user uses the Wheel, the list attempts to Scroll and Oops your application crashes.

Thankfully, the Synergex team have found the issue and resolved it – and the fix will be in the upcoming 10.3.3b patch. If you are experiencing this issue today and need a resolution now, you can contact support who can provide you with a hotfix.


Examining and modifying Synergy data

By Richard Morris, Posted on September 5, 2016 at 11:41 pm

The Symphony Framework provides the ability to expose Synergy data as “Data Objects”. A “Data Object” or DO for short, is a class that exposes the fields of your repository structure as properties that can be accessed using Get and Set methods. These DO’s also provide access to the “raw” synergy record data through a property called SynergyRecord. The SynergyRecord property is the basic way to put record data into or get record data out of your DO. There are a lot of additional properties associated with DO’s, like its validity based on repository and custom validation rules, but those are for another blog. By exposing the individual field elements as Get/Set properties this allows us to bind to them from code (Synergy or C#/VB.Net) and in the WPF world the UI layer in XAML.

The Symphony Harmony framework allows you to select data from a Synergy DBMS file using standard SQL style syntax. Under the hood it uses the powerful SynergyDE.Select capabilities to access data in a file after parsing the SQL like query string. The data is returned as a collection of DO’s.  A simple example could be;

Select * from group

Where “group” is the name of a structure/file relationship in your repository. The Symphony Harmony returns all the located records in the form of DO’s. This means we can bind to the individual properties exposed by the DO.

Harmony can accept more complicated requests, for example;

SELECT Id ,Description ,Quantity ,Cost_price FROM part WHERE cost_price BETWEEN 10 AND 20

Is a valid query that will return only the DO’s that match the where clause.

To show the capabilities of the Symphony Data Object and Symphony Harmony I’ve put together a simple “Synergy DBMS Manager” program that allows you to interrogate and manage data in a Synergy ISAM data file. You can select data using SQL like syntax and display the results to the screen. You can also update, insert and delete records again using SQL like syntax. To show the query above using the Synergy DBMS Manager;

SDBMS1

The fields within the query can be typed in longhand or selected from the field list (retrieved dynamically from the DO). When the query is executed, the results grid is dynamically built to include only those fields selected.

As mentioned you can also modify the data in the file using an UPDATE command and you can insert new records using an INSERT command. To complete the capabilities you can also delete records using the DELETE command, but make sure you use a where clause or the whole file will be cleared.

The Synergy DBMS Manager application can be downloaded from SymphonyFramework.Net. You can also access full documentation on the same page or here. You will need a minimum of Synergy 10.3.1 runtime environment to run the Synergy DBMS Manager program. You will also need to create and build a library of Synergy Data Objects that represent your repository structure. This library is totally code-generated and full instructions are included in the documentation.

If you would like to take a look at the Synergy DBMS Manager but don’t have the time to build your library of data objects upload your repository files (zipped please) at: SymphonyFramework.Net and we’ll build it for you!

Why not take a quick look at the documentation to see how easy it is to use the Synergy DBMS Manager?

 


Symphony Framework Update 3.2.6 – File Management Capabilities

By Richard Morris, Posted on July 22, 2016 at 6:24 am

As I wrote about in my last blog the Symphony Harmony namespace provides the ability to execute select queries and stored procedure style method execution using SQL style syntax. The queries and procedures can be executed in-process or via the Symphony Bridge on a remote server via industry standard HTTP/HTTPS/TCP protocols as well as via a Service Bus Relay protocol. In the 3.2.6 release we have added the ability to fully manage the data in the SDBMS files via SQL this style syntax.

Accessing or selecting data through the Symphony Harmony namespace is simple. First you need to define your “connection” to the database. To do this you create an instance of the DBConnector class. For example;

data connector = new DBConnector(“SymLocal:user/password!SimpleHarmonyTestLibrary.TableMapper.MapTableToFile”)

The connection string defines how you want to access the data: SymLocal indicates that it’s in-process and specifying SymRemote indicates it’s via Symphony Bridge. If you are using Symphony Bridge you must include the “server” you wish to connect to – I’ll include an example shortly. The username and password allow you to provide authentication but that’s for another blog. The “SimpleHarmonyTestLibrary.TableMapper.MapTableToFile” is the named method that Symphony Harmony uses to translate the table name to a physical SDBMS filename, and it’s something you can code generate.

Here is an example of a remote access connection;

data connector = new DBConnector(“SymRemote:user/password@localhost:8081!SimpleHarmonyTestLibrary.TableMapper.MapTableToFile”)

Notice the server name and the port the Symphony Bridge server is listening on. Other than the connection string the usage of Symphony Harmony is identical regardless if it’s local or remote data access. Although here we are talking about local and remote data access – we are referring to where the code to perform the query is being executed, either locally in-process or via Symphony Bridge. We are not referring to the physical location of the SDBMS data files which may be local or remote and accessed via xfServer. Both local (in-process) and remote connections via Symphony Bridge can access data locally or via xfServer.

To select records from a file you use the SQL style SELECT syntax and call the DataSelect.RunDataSelect method. You need to instance the Symphony Data Object that will define the response data structure. For example;

data partItem = new Part_Data()

foreach partItem in DataSelect.RunDataSelect(connector, “SELECT * FROM part”, partItem).Result

begin

                Console.WriteLine(“Created ID = ” + partItem.Id + “, ” + partItem.Description + ” Qty = ” + %string(partItem.Quantity) + ” Cost = ” + %string(partItem.Cost_price))

end

Note here that the case of the command is not important however the case of string values within a where clause is. You can limit the fields returned, filter the data and order the results as you require. All of these are valid;

DataSelect.RunDataSelect(connector, “SELECT id, description, quantity FROM part WHERE quantity > 10”, partItem).Result

DataSelect.RunDataSelect(connector, “SELECT description, id FROM part WHERE description like ‘BRAKE’”, partItem).Result

DataSelect.RunDataSelect(connector, “SELECT cost_price, id, description FROM part WHERE cost_price < 1.99 ORDER BY cost_price “, partItem).Result

The order of the fields list is not important. You also don’t have to hard-wire the filter values as you can pass positional arguments. For example;

Data qtyValue   ,int         ,10

DataSelect.RunDataSelect(connector, “SELECT id, quantity, description FROM part WHERE quantity > :1”, partItem, qtyValue).Result

data descValue ,string   ,”BRAKE”

DataSelect.RunDataSelect(connector, “SELECT id, description FROM part WHERE description like :1″, partItem, descValue).Result

Data qtyValue   ,int                         ,10

Data costValue  ,decimal               ,1.99

DataSelect.RunDataSelect(connector, “SELECT id, description, cost_price FROM part WHERE cost_price < :1 AND quantity > :2 ORDER BY cost_price “, partItem, costValue, qtyValue).Result

All of the above will return a collection of data objects of type Part_Data().

As I mentioned above you can now maintain the data in your SDBMS files through Symphony Harmony. We have added the ability to insert data into an SDBMS file using Symphony Harmony. The DataInsert.RunDataInsert() method accepts an INSERT command and a data object and stores the passed-in data object data to the appropriate file. For example;

data partItem = new Part_Data()

partItem.Id = “ID1”

partItem.Description = “this is the description for part 1”

partItem.Technical_info = “lots of additional information for part 1”

partItem.Quantity = 5

partItem.Cost_price = 12.34

DataInsert.RunDataInsert(connector, “INSERT INTO part”, partItem).Wait()

The data in the partItem data object is extracted, placed into a Synergy record and stored into the SDBMS file. Any errors, like duplicate key, will be thrown on the client.

We have also added the ability to update the data in an SDBMS file using Symphony Harmony. The DataUpdate.RunDataUpdate() method accepts an UPDATE command, which should include a WHERE clause, and a data object, and updates the file with the passed data object data. You can optionally pass a list of fields that restrict the data to be updated. So for example if you application wants to simply update a field for a given record;

data numUpdated          ,long

partItem.Cost_price = 999.99

numUpdated = DataUpdate.RunDataUpdate(connector, “UPDATE part SET cost_price where QUANTITY = 13”, partItem).Result

Will update ALL records that have a quantity value of 13 with the updated cost_price value of 999.99. The resulting numUpdated field will contain the number of records that were updated in the file.

The field list is optional, but it’s recommended! If you don’t specify the field list then the whole record is updated, so you must ensure that the data object contains all the required information otherwise you may get exceptions if key values that are defined none-modifiable are changed. You may also inadvertently overwrite changes made by other processes.

And to provide the fully SDBMS data management capabilities we have added the ability to delete data from an SDBMS file using Symphony Harmony. The DataDelete.RunDataDelete() method accepts a DELETE command, which should include a WHERE clause, and a data object and deletes the matching records from the file.

data numDeleted            ,long

numDeleted = DataDelete.RunDataDelete(connector, “DELETE FROM part WHERE id = :1”, partItem, “ID1”).Result

Removes the required records from the file. There is no need to first select or lock them. The numDeleted field will contain the number of records that were deleted from the file. The where clause is optional so the following is valid;

numDeleted = DataDelete.RunDataDelete(connector, “DELETE FROM part”, partItem).Result

And will result in clearing the entire file – you have been warned!!

All this capability is now available in version 3.2.6 of the Symphony Framework, Symphony Harmony and Symphony Harmony Unplugged packages on Nuget.


STOP! Validation Alert

By Richard Morris, Posted on April 12, 2016 at 12:00 pm

It’s the tried and trusted way to get the users attention. At the slighting hint of an issue with their data entry you put up a big dialog box complete with warning icons and meaningful information.

c1

We’ve all done it, and many programs we write today may still do it. Writing code using the Synergy UI Toolkit its common practice to write a change method to perform field level validation. When the user has changed the data and left the field – either by tabbing to the next or clicking the “save my soul” button – the change method executes and validates the entry. It is here were we stop the user in their tracks. How dare they give us invalid data – don’t they know what they should have entered? It’s an ever so regimented approach. The user must acknowledge their mistake by politely pressing the “OK” button before we allow them to continue. Users are usually not OK with this interruption to their daily schedule so there must be a nicer way to say “hey there, this data is not quite as I need it, fancy taking a look before we try to commit it to the database and get firm with you and tell you how bad you are doing at data entry?”

When migrating to a new Windows Presentation Foundation UI we can do things a little different and guide the user through the process of entering the correct data we need to complete a form or window. We will still use the same change method validation logic however as there is no reason to change what we know works.

When using the Symphony Framework you create Symphony Data Objects – these classes represent your repository based data structures. The fields within your structures are exposed as properties that the UI will data-bind to. These data objects are a little bit cleverer that just a collection of properties. Based on the attributes in the repository it knows what fields have change methods associated with them. Because of this the data object can raise an event that we can listen for – an event that says “this field needs validation by means of this named change method”. Here is a snippet of code registering the event handler:

c2

The event handler simply raises the required “change method” event back to the host DBL program;

c3

Back in the DBL program we can now listen for the change method events. Here is the event handler being registered:

c4

Remember, we are now back in the host DBL code so we can now dispatch to the actual change methods registered against the field. This is a code snippet and not the complete event handler code:

c5

We are calling into the original change method and passing through the required structure data and method data. Inside the change method we will have code that validate the entry and then, as this snippet shows, we can perform the error reporting:

c6

If the code is running as a UI Toolkit program the normal message box dialog is used to display the message. However, when running with the new WPF UI the code provides the required error information against the field. No message boxes are displayed. To the user they will see:

c7

The edit control background is coloured to indicate an issue with the data and the tooltip gives full details of the problem. When the user has entered valid data, the field reverts back to the standard renditions:

c8

We shall be exploring the ability to handle field change method processing during the DevPartner 2016 pre-conference workshop as we all migrate an existing UI Toolkit program to a modern WPF user interface.

 


Covers? Better than the original?

By Richard Morris, Posted on March 21, 2016 at 9:51 am

I’m sometimes sceptical when somebody covers a song I know and love as I’m worried that their version may not bring with it the true spirit of the original track. If it’s not done right it just won’t be pleasing to the ear, and music should always invoke passion. When customers ask us to demonstrate how to put a new User Interface over an existing program I’m always conscious that our “cover” needs to retain the proven logic of the original program while offering the user a new and pleasing, easy to use and navigate, user experience.

In recent weeks I’ve been developing the Symphony UI Toolkit, which as the name suggests, helps you to migrate your Traditional Synergy UI Toolkit programs to a modern Windows Presentation Foundation (WPF) based UI. This new member to the Symphony ensemble provides a number of simple techniques for connecting between the WPF UI and the existing “event” driven DBL code.

One recent engagement where I utilise the whole Symphony Framework, including the new Symphony UI Toolkit, was to add a modern UI to an existing UI Toolkit program. The basic solution was to write the new UI in Synergy .NET using XAML for the UI components. Then host this in the existing Toolkit program using the DOTNET API. We started off with:

old

The program presented a list of items from which the user could select from. Other than the slightly dated look and feel the main problem with the application was that the user was restricted to seeing only the information on a single tab page at a time. The brief for the new UI was simple – make the pages dock-able.

Utilizing a number of core features within the Infragistics UI control set I was able to retain all the logic from the original program and bring a fresh new UI to the user:

new

Now as the user navigated the main list of items, while the docked panels display the relevant information. The grid provided the required filtering and grouping capabilities and selecting an item changed the fields on the input panels to edit mode so changes and additions could be made.

The Microsoft styled ribbon control replaced the traditional menu columns and button toolbar. Additional options were made available within an Outlook style navigation bar – which can be hidden with a single click.

The original program code was modified in a way that we can swap between running the traditional UI Toolkit UI and the new WPF UI by changing a single setting in the synergy.ini configuration file:

ini

Although targeting the UI Toolkit the steps involved in migrating to a new WPF UI with the Symphony Framework will work just as well with almost any style of DBL program, and you can try it for yourself at DevPartner 2016. Join me in the recording studio for the Monday pre-conference workshop where together we’ll make a great new cover version of an old Toolkit program. The day will start relaxed as you write code to handle menu, toolbar and button commands. Then we’ll up the tempo and you’ll code event handlers to execute list load methods. Then we’ll jazz things up a little handling change methods and field validation. By the end of the day we’ll have a number 1 hit on our laptops.


DevPartner 2015 – WOW!

By Richard Morris, Posted on May 15, 2015 at 6:37 pm

That was the week that was the DevPartner 2015 conference in Philadelphia. Ok, so I’m biased but I really have to say this was one of the best conference weeks I’ve had the pleasure to be part of for many years. There were some really great sessions: The HBS customer demonstration rocked! They came to a conference a couple of years ago, did a tutorial on xfServerPlus and with this new found knowledge (and some PSG guidance) created a cool web bolt-on to their existing Synergy app.

We saw some fresh new faces from Synergex: Marty blasted through the Workbench and visual Studio development environments we provide and showed some really great tools and techniques. Phil gave us a 101 introduction to many of the “must know” features and capabilities of Synergy SDBMS – and of course was able to address mine and Jeff’s performance issues – you had to be there:). Roger demonstrated his wizardry to enlighten everyone as to the issues you need to consider when transferring your data within local and wide area networks – I was the bad router!

Bill Mooney set the whole tone of the conference with a great opening presentation showing just how committed Synergex are to empowering our customers with the best software development capabilities available.

My first day’s session followed and gave me the opportunity to demonstrate how you actually can bring all our great tools together to create true single-source, cross-platform applications which run on platforms as diverse as OpenVMS, UNIX and Microsoft Windows and onto a Sony watch running Google Wear!

Steve Ives went 3D holographic with videos from his recent trip to the Microsoft Build conference that showed just how amazing the Microsoft platform is becoming – and we aim to continue to be a first class player in that arena.

So many of our products are reaching a level of maturity that blows the competition away. Gary Hoffman from TechAnalysts presented a session showing how to use CodeGen and Symphony in the real world and showed just what you can achieve today in Synergy.

Jeff Greene (Senior .NET engineer @ Synergex) and I presented a rather informal (read written the night before) presentation showing the performance and analysis tools in Visual Studio 2015 that you can use to identify problem area and memory leaks in your application. Within minutes Brad from Automated System forwarded me an email he’d just sent to his team:

“At the Synergex conference just this morning, they just showed fantastic new diagnostics tools in Visual Studio 2015.  I just put the Team on the trail of potential memory issues with these new tools in a Virtual PC environment so we don’t alter our current developer stations. This could both reduce the memory footprint and improve performance.” – You can’t beat such instant feedback!

The tutorial time gives attendees the opportunity to play with the latest tools on a pre-configured virtual machine – plug in and code! And we continued the hands-on theme with Friday’s post conference workshop – where we built the DevPartner 2015 App from the ground up!

nexus_working

Thanks to everyone for coming and making the conference such a great success. It’s our 30th conference next year so keep your eyes and ears open for dates and details – it will be a conference not to miss!


Reasons to Be Cheerful

By Richard Morris, Posted on December 2, 2014 at 10:44 am

Back in 1979 Ian Dury and the Blockheads wrote a song about all the things that made them cheerful.  Titled “Reasons to be cheerful, part 3” it’s a quick fire list of things in his life that not only made him cheerful, but what he believed made everyone feel cheerful.  As 2014 draws to a close we have our own reasons to the cheerful – the release of Synergy version 10.3.1.

Reasons to be cheerful – One, two, three.

Android Development

Now you are able to take you Synergy code, build it in Visual Studio and deploy to any Android device – that’s your phone or tablet.  Using XAML to define your UI can even enable you to write once and deploy to many different device options including iOS – which is being released in beta mode with 10.3.1.

Improved Developer Experience

Both Workbench and Visual Studio Integration continue to exceed expectations when we talk “developer experience”.  Even better IntelliSence and seamless access to .NET capabilities like LinQ.  Build powerful Portable Class Libraries (PCLs) that can be used to deploy your Synergy logic and data access code on multiple target platforms.

Targeted Runtimes

In Visual Studio you can now install the latest Synergy Language Integration and target an older runtime version, for example install SDI 10.3.1 and target runtime 10.1.1.  This keeps you using the latest tools without the need to immediately update your target platform.

Programmatically Track File Changes

Using the new ChangeTracking class you can now access file snapshots and change tracking information directly from Synergy.

Connection Recovery

xfServer between Windows client and server can now be configured to recover from a network interruption and auto-reconnect.  This development continues to strengthen the robust quality of xfServer.

 Device Licensing

Controlling who’s using your applications is important and Synergex recognises this with the ability to utilise device licensing for your Android and iOS (future release of Synergy) apps as well as your Windows store and desktop programs.

To complement the release of Synergy 10.3.1 the Symphony team has developed a new server component called Symphony Bridge.  Symphony Bridge allows you to communicate via HTTP and HTTPS to a server that is exposing your application logic and data.  Bridge utilises Symphony Harmony which is an SQL command interpreter layer that accepts SQL based commands (selection, store procedure execution, etc.) and performs the required tasks on the remote server.  There will be more about Harmony and Bridge in a future blog post.

For now, let’s sing along with Ian and have “Reasons to be cheerful” with the release of 10.3.


Keeping Focus

By Richard Morris, Posted on August 15, 2012 at 6:56 am

In a traditional Synergy application you have usually always had total control over the user interface.  Your program code has displayed the field prompts on the screen, or loaded and placed your UI Toolkit windows.  With the user interface defined and displayed it’s again your application code that controls what the user can do, and when.  If they enter an invalid value in a field the code would usually display some sort of message and force the user back into the field, never to leave until a valid (according again to your application logic) value has been entered.  And the UI Toolkit continues this tight coupling between field validation, user notification and UI navigation control.

As software development moved forward with Microsoft WinForms based applications this trend generally followed.  The code behind each control knows everything about the control, and as such can force the focus back to the field when required.

With the advent of the Windows Presentation Foundation (WPF) application things changed dramatically.  Of course you can still bind code-behind to your controls on your WPF forms, but that’s really not the point of WPF – if you have code behind then the chances are you are going something wrong.  The most powerful feature of WPF is data binding.  Data binding is the ability to bind an object property value to a field or control on your user interface.  Messaging between the UI and the application ensure that your data is kept synchronised.  This is the Model-View-View Model (MVVM) design approach, which is the cornerstone of a Symphony Framework based Synergy .NET WPF application.  MVVM provides for a platform that fully (and correctly) disconnects the user interface from the application data and logic.  But if the application has no knowledge of the UI, and the UI has no knowledge of the application logic, how can your programs force fields on your forms to have focus?  There are many better ways to provide user feedback than to display modal messages and force the user back into the field entry, which I’ll discuss in a future blog.  But there will always be someone who needs to be able to re-focus a field within the user interface from within their program.  Code-behind will be required, yes?  No, not if you use a Symphony Framework Data Object!

Symphony Framework provides the ability to request focus be given to whatever control you are using to bind against a particular Data Object property.  And focusing that control is the responsibility of the View, or XAML code – there is no code-behind requirement.  From within you application you can set a property in the Symphony Framework Data Object indicating that you would like the control associated with that data property to be given focus.  In the XAML you listen for the request and honour it or not, at the discretion of the UI designer.  And that request can bound to simple controls or complex containers.

Do you want to know how?  Instead of writing up lots of code I’ve prepared a short video that demonstrates this powerful new feature of the Symphony Framework.  You can view the video on YouTube by clicking this link: http://youtu.be/XpGzzBOo5mk. Happy viewing!


I Command Thee

By Richard Morris, Posted on June 12, 2012 at 7:10 am

At the DevPartner conference in Chicago (http://conference.synergex.com) we announced an open source project called Symphony Framework.  The Symphony Framework project is a Synergy .NET based set of libraries that assist with the migration of traditional Synergy cell based and UI Toolkit applications to a native .NET Windows Presentation Foundation (WPF) desktop application.  The concept of the Symphony Framework is to simplify the Model-View-View Model (MVVM) design pattern and make it easy to migrate your traditional Synergy code.

An important aspect of any program is responding to user requests.  In a UI Toolkit program this is typically based on menu entries – even ones that don’t exist and are signalled in code using M_SIGNAL().  A WPF desktop application is no exception and commanding is an important aspect of the program.  In the MVVM model you utilise an interface called ICommand.  This interface provides for three very important elements.  Firstly, a hook, or entry point to be executed when the command is processed.  Processing a command can be assigned to the click of a button on the UI, it could be the navigation event around a list, or even a line of code in your program.  Secondly the ICommand model enables a status enquiry point –where the bound UI control can interrogate the command object and determine if it is enabled for execution.  Generally a UI control bound to a command object will render itself differently depending on the executable state of the command.  For example a button will appear greyed out and not clickable.  And thirdly is the ability to notify the UI control that the executable status of the command has changed, which causes the interrogation of the command object to determine is executable state.

The Symphony Framework exposes a number of command types, the easiest to use is the GenericCommand, which can be found in the Symphony.Conductor.Commands namespace.  This class utilises the ICommand interface and makes coding commands very simple.  You can create individual command objects or one generic command.  Here is an example of defining a generic command within your View Model class that can be bound to any number of UI control.

Firstly, reference the correct namespace:

Now create a private class member:

Now expose a public property which we can bind out UI control to:

Note in this code that if the private mCommand class field is null we create an instance of the GenericCommand class and assign it.  We also define the logic to execute when the command is processed.  Now we can write the event handler:

Notice the routine signature.  The “parameter” string argument will be set to the value you assign to the bound command in the UI.  As an example, here we are defining three buttons which all data bind to the Command property:

By using the CommandParameter attribute we can assign the required “operation” to each bound command.  Now we can extend the logic in our event handler routine:

This example shows you how to easily utilise the GenericCommand class within the Symphony Framework.

There are many more examples that you can review from the Examples Explorer which is available when you install the full Symphony Framework.  If you are interested in looking at the Symphony Framework code and becoming part of the development community search www.codeplex.com for “Symphony Framework”.


Starting Services on Linux

By Steve Ives, Posted on July 24, 2010 at 3:14 pm

For a while now I’ve been wondering about what the correct way is to start boot time services such as the Synergy License Manager, xfServer and xfServerPlus on Linux systems. A few years ago I managed to “cobble something together” that seemed to work OK, but I had a suspicion that I only had part of the solution. For example, while I could make my services start at boot time, I’m not sure that they were getting stopped in a “graceful” way during system shutdown. I also wondered why my “services” didn’t show up in the graphical service management tools.

My cobbled together solution involved placing some appropriately coded scripts into the /etc/rc.d/init.d folder, then creating symbolic links to those files in the appropriate folders for the run levels that I wanted my services started in, for example /etc/rc.d/rc5.d.

This week, while working on a project on a Linux system, I decided to do some additional research and see if I couldn’t fill in the blanks and get things working properly.

My previous solution, as I mentioned, involved placing an appropriately coded script in the /etc/rc.d/init.d folder. Turns out that part of my previous solution was correct. For the purposes of demonstration, I’ll use the Synergy License Manager as an example; my script to start, stop, restart and determine the status of License Manager looked like this:

#

# synlm – Start and stop Synergy License Manager

#

. /home/synergy/931b/setsde

case "$1" in

   

start)

        echo -n "Starting Synergy License Manager"

       

synd

       

;;

   

stop)

       

echo -n "Stopping Synergy License Manager"

       

synd –q

       

;;

   

restart)

       

$0 stop

       

$0 start

       

;;

   

status)

       

if ps ax | grep -v grep | grep -v rsynd | grep synd > /dev/null

       

then

           

echo "License Manager is running (pid is `pidof synd`)"

       

else

           

echo "License Manager is NOT running"

        fi

       

;;

   

*)

       

echo $"Usage: synlm {start|stop|restart|status}"

       

exit 1

esac

exit 0

If you have ever done any work with UNIX shell scripts then this code should be pretty self explanatory. The script accepts a single parameter of start, stop, restart or status, and takes appropriate action. The script conforms to the requirements of the old UNIX System V init subsystem, and if placed in an appropriate location will be called by init as the system runlevel changes. As mentioned earlier, I had found that if I wanted the “service” to start, for example when the system went to runlevel5, I could create a symbolic link to the script in the /etc/rc.d/rc5.d folder, like this:

ln –s /etc/rc.d/init.d/synlm /etc/rc.d/rc5.d/S98synlm

Init seems to process files in a run level folder alphabetically, and the existing scripts in the folder all seemed to start with S followed by a two digit number. So I chose the S98 prefix to ensure that License Manager would be started late in the system boot sequence.

This approach seemed to work pretty well, but it was kind of a pain having to create all those symbolic links … after all, on most UNIX and LINUX systems, run levels 2, 3, 4 and 5 are all multi-user states, and probably required License Manager to be started.

Then, almost by accident, I stumbled across a command called chkconfig. Apparently this command is used to register services (or more accurately init scripts) to be executed at various run levels. PERFECT … I thought! I tried it out:

# chkconfig –-level 2345 synlm on

service synlm does not support chkconfig

Oh! … back to Google… Turns out I was something really critical in my script, and believe it or not, what I was missing was a bunch of comments! After doing a little more research I added these lines towards the top of the script:

# chkconfig: 2345 98 20

# description: Synergy/DE License Manager

# processname: synd

Low and behold, this was the missing piece of the puzzle! Comments … you gotta love UNIX! So now all I have to do to start License Manager at boot time, and stop it at system shutdown is use the chkconfig command to “register” the service.

And there’s more … With License Manager registered as a proper service, you can also use the service command to manipulate it. For example, to manually stop the service you can use the command:

# service synlm stop

And of course you can also use similar commands to start, restart, or find the status of the service. Basically, whatever operations are supported by the init script that you provide.

Oh, by the way, because License Manager is now running as a proper service it also shows up in the graphical management tools, and can be manipulated by those tools … very cool!

Of course License Manager is just one of several Synergy services that you could use this same technique with. There’s also xfServer, xfServerPlus and the SQL OpenNet server.


Linux ls Color Coding

By Steve Ives, Posted on July 20, 2010 at 4:32 pm

It’s always driven me CRAZY the way that RedHat, Fedora, and presumably other Linux systems apply color coding to various types of files and directories in the output of the ls command. It wouldn’t be so bad, but it seems like the default colors for various file types and protection modes are just totally unreadable … for example black on dark green doesn’t show up that well!.

Well, today I finally got around to figuring out how to fix it … my preference being to just turn the feature off. Turns out it was pretty easy to do, open a terminal, su to root, and edit /etc/DIR_COLORS. Towards the top of the file there is a command that was set to COLOR tty, and to disable the colorization all I had to do was change it to COLOR none. Problem solved!

Of course if you look further down in the file you’ll see that there are all kinds of settings for the color palettes to be used for various file types, file protection modes, etc. You could spend time “refining” the colors that are used … but personally I’m happier with the feature just GONE!


Learning from Stupidity

By synergexadmin, Posted on July 9, 2010 at 5:56 pm

I'll be the first to admit that I've done some really stupid things in my life.

Like the time I decided to paddle a canoe across a mile-wide river even as threatening clouds loomed on the horizon.  Or the time I got stuck on a hike by taking a "short-cut" which involved shimmying around an overhang, leaving me suspended over a 70-foot drop to some very sharp, very hard rocks below.

Then there was the time I remoted into a production Alpha server and decided to shut down TCP/IP for a few seconds. Now that was fun; I figured my first month on the job was also going to be my last.

But all of these dumb moves — and many others — have at least one thing in common: Though I learned something, everything was over so quickly that I never had much time to worry about the repercussions.

Not so, yesterday.

My laptop had been causing me more and more grief lately, so I decided it was time to re-install the OS and start from scratch. I wasn't in a huge rush, however, and I had other things to do anyways. So it took me several days to complete my preparations for the wipe, during which time I methodically moved files from my laptop to a backup device.

Yesterday, before lunch, I declared my system ready for reinstall, and pulled the proverbial trigger. I reformatted the hard drive, installed a clean copy of Windows 7, and then ran Windows Update to get everything up to snuff. Success! I was really rocking, and I realized that if I hurried, I could get a full backup of my "clean" build before I left for lunch. So of course, I did something incredibly, unbelievably stupid.

Lesson #1: Do NOT destroy a completely valid, disk image backup to make room for a "fresh" disk image backup.

Turns out that my backup device — a 300GB external drive — was getting a little full. I'd been faithfully (more or less) doing disk image backups for quite a while, with the most recent being dated just last Friday. But those files were just SO BIG and I really needed the space for a new backup set.

My rationalization was pretty solid: I'd backed up copies of only those files that I needed, they were all organized well, and I had ISO images of all the programs I was going to need to re-install, so what's the point in keeping a backup of a system I'm never going to use again anyways?

Plus, I really needed the space.

So I deleted the disk image backup, started a new one from scratch, and went to lunch. Upon returning, the backup was complete. Moving right along, I quickly copied my well-organized backup files into place, and started with software installations.

Someone upstairs was watching out for me, however, because the first software I re-installed was a tiny little program that allowed me to access very special, very important and very irreplaceable encrypted files. And though it installed without a hitch, I quickly found that the encrypted files it opens…

…weren't there.

They weren't in the folders I'd copied back to my laptop, and they weren't on the backup drive. I searched network drives, network computers, and even checked a USB flash drive just against the chance that I'd momentarily lost my mind, transferred them there, and then forgotten about it. Perhaps the worst problem was that I had specifically made sure that those files had been backed up two or three days ago, and I knew everything was ok.

Hadn't I?

I finally gave up on locating them the "easy" way, and started downloading software that scanned hard disks to recover deleted files. After trying five different freebie versions, each of which were dismal failures, I'd almost given up hope. So just before midnight, I gave in and downloaded a try-before-you-buy piece of software called File Scavenger.

The demo version offers the ability to scan a hard drive and locate darn near everything that was ever on it and not overwritten, but only lets you recover 64K of a file before it asks you to pay. Knowing I'd happily pay the $49 if it worked, I downloaded and installed it. Upon running it, however, it looked as if it was going to take at least a couple of hours to scan whatever was left of my hard drive after the format/reinstall, so I decided to retire for the night and get some sleep.

Lesson #2: You can't sleep when you've probably just lost something that's irreplaceable.  (It's the Not Knowing and the What-If's that will keep snapping you back to full consciousness…again and again and again.)

Early this morning, I was back at my desk, with the knowledge that if the scan that I had left running was going to find something, it would have done so by now. I watched the ribbons bounce around on my laptop's monitor. I probably stared at them for a full minute before steeling myself for the worst, taking a last sip of coffee, and moving the mouse to break the spell of the screen saver.

There they were. I almost couldn't believe it. All three of the large, encrypted files that contained countless (or at least, well in excess of 150,000) other files.

Lesson #3: When pulled from a wallet too quickly, a credit card can cut through the pocket that holds it. Sometimes, it's safer for your wallet — and easier on you — to try the Pay-For "premium" solution before you waste hours hunting down the free alternative.

It was the fastest online purchase I've ever made. And within 30 minutes, I'd recovered all three files and confirmed that they were intact and had all of their information. I'd also backed them up (again) and re-confirmed their existence on the backup drive. I then put them on the hard drive of two other computers. Gun-shy? Absolutely.

But I've got to say, this software is amazing — and not just a little scary, too. While doing my scans of my laptop's hard drive, I found a lot of stuff that shouldn't be there. Like stuff that's been deleted for years. Doing a scan of my backup drive, a networked drive personal drive we use to keep copies of pictures, music, movies and (eek!) bank account information, and my little USB flash drive, I found lots and lots and lots of stuff that simply shouldn't be there.

Lesson #4 (Unintended): Deleted isn't deleted until you make it so.

Turns out that NTFS is really, really good at keeping your files intact even after they've been deleted — or even subjected to a quick re-format. FAT32 is as fragile as crystal by comparison, but still has the potential to leave a file intact long after you've deleted it. And while most everyone who's reading this already knows to use a disk utility to overwrite "unused" disk space before getting rid of a drive, remember that until you do, the data is likely still there.

And by the by…did you know that most printers and copiers have hard drives in them? Think twice before you donate or sell them, because the person that takes them off of your hands may have File Scavenger (or something similar) in their possession! With what I've learned — and now purchased — it brings a whole new world of (shady) opportunities to the table. For instance, my neighbor down the street actually has a bunch of printers sitting in his yard under a big sign that says "Take Me I'm Free" (no kidding). It's suddenly tempting to pick them up and take a little peek inside, but fortunately (for both of us) I don't have the time right now, as I'm heading out the door on holiday in only a few short hours.

Now, if only I could just learn

Lesson #5: Don't post a blog entry about your stupidity where the director of your department is likely to read about it

I could be reasonably sure that my job is still secure when I return from a well-needed vacation…

And yes: I'm going to Disneyland.


RSS

Subscribe to the RSS Feed!

Recent Posts Categories Tag Cloud Archives