Subscribe: marcocantu.blog
http://blog.marcocantu.com/blog_rss.xmldata
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
blog  choose delphi  choose  classes  community embarcadero  data  delphi  embarcadero  interbase  rad server  rad studio  rad  server  studio 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: marcocantu.blog

marcocantu.blog



Techie Italian Blogging on Delphi and More



Updated: 2017-10-19T14:36:24.822Z

 



Implementing AJAX and JSONP Support in RAD Server for ExtJS

2017-10-19T14:36:24.822Z

Last week at ITDevCon in Rome I’ve given a session about using Sencha ExtJS with RAD Server as backend. For that session I used AJAX calls, but now I’ve also implemented the JSONP support, which provides an alternative in terms of cross-domains calls in browsers. Idera recently acquired Sencha (https://www.sencha.com/) and has added the company products to the Embarcadero business unit, which produced RAD Studio and also the RAD Server web service technology. A natural question arises on how to use the two products together. While there are several options, in this blog post I want to highlight the simple and direct integration of RAD Server and FireDAC with an ExtJS client based on Sencha’s data model architecture. Most of the considerations in this blog post would equally apply to using WebBroker or DataSnap to build the web service.. A Simple Test As first step, I’ve created a simple blank RAD Server application. What this does is to expose standard REST endpoints like “version”. In an ExtJS client build with the Architect IDE, I’ve added a button, picked the Tap event, and written code like the following: onButtonTap: function(button, e, eOpts) { Ext.Ajax.request({ url: 'http://192.168.1.102::8080/version', cors: true, success: function(response, opts) { var obj = Ext.decode(response.responseText); console.dir(obj); button.setText (obj.server); }, }); } What this code does is make a call to the version REST API, create a JavaScript object with the resulting JSON (decode), display the data on the browser console, and display the server field as button text. Defining a Data Model This just proves that the JavaScript application can invoke RAD Server. Next I moved to the data processing. ExtJS has the concept of a data model, so using the visual tool I created a simple one like the following: Ext.define('MyEmployeeApp.model.EmployeeData', { extend: 'Ext.data.Model', requires: [ 'Ext.data.field.Field' ], fields: [ { name: 'first_name' }, { name: 'last_name' }, { name: 'phone_ext' }, { name: 'dept_no' }, { name: 'job_country' } ] }); Returning JSON from RAD Server Next, I had to define a data store. First I used an AJAX data store and to keep things simple I wrote a custom method in RAD Server to expose a plain JSON data structure, built using the TJSONObject and TJSONArray classes. In this code EmployeeTable is a TFDQuery dropped in the data module along with a connection to the classic InterBase employee demo database: procedure TEmployeeDataResource1.Get(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse); var empDataObj: TJSONObject; data: TDataSet; emplArray: TJSONArray; emplObj: TJSONObject; aField: TField; begin data := EmployeeTable; data.Open; empDataObj := TJSONObject.Create; emplArray := TJSONArray.Create; while (not data.EOF) do begin emplObj := TJSONObject.Create; for aField in data.Fields do begin emplObj.AddPair(LowerCase(aField.FieldName), aField.AsString); end; emplArray.Add(emplObj); data.Next; end; empDataObj.AddPair ('employee', emplArray); AResponse.Body.SetValue(empDataObj, True); end; This is the resulting JSON in a browser: With this code and the use of an AJAX call, the JavaScript application by default ends up with with cross-server invocation security problems, when executed in the browser. There is  however a fairly simple solution in RAD Server, which is set a single line in the EMS.INI file, with a configuration like: [Server.APICrossDomain] ;# Write here the domains allowed to call the API. Used for Cross-Domains CrossDomain=* This is fairly over-permissive, in production you’d want to indicate a spe[...]



Talking at ITDevCon 2017, Tomorrow

2017-10-10T15:46:21.332Z

I realized I failed to mention I'm going to talk at a conference in Rome, Italy, tomorrow October 11th and Thursday the 12th,

The conference is organized by Embarcadero partner BitTime and their consulting company BitTime Professionals at their office in Franscati, near Rome, and all of the information is at:

http://www.itdevcon.it/

Well, it might be a little late to join, but I realized I forgot mentioning the event on my blog, so here it goes. If you plan attending, I'll be there tomorrow afternoon and also join the dinner. See the final agenda at http://www.itdevcon.it/agenda

I'll be giving a keynote on the status of RAD Studio, but also two technical sessions covering FireDAC CData Enterprise connectors and offering an introduction to Sencha's ExtJS and Architect tool, along with demos of integration with Delphi powered back ends. Would be interesting, and I'll make sure to share my demos with everyone -- and possibly repeating them at the coming CodeRage online conference next month.

(image)



My Courses on the New Embarcadero Academy

2017-10-04T15:21:10.460Z

Embarcadero Academy launched last month, and I do have 3 classes on the Object Pascal language on it, with more to come.

The online training site Embarcadero Academy, an independently-run but Embarcadero affiliated training web site, was launched a couple of weeks ago: http://www.businesswire.com/news/home/20170918005798/en/Embarcadero-Academy-Debuts-Online-Courses-Developers-Levels. The academy features classes on different topics, but a lot of them are focused on Delphi programming. You can see the list of Delphi classes here:

https://www.embarcaderoacademy.com/courses/category/Delphi

The site has paid online classes by several Delphi experts and it is going to be expanded rapidly with new content and options (live training, beside self-paced tutorials, subscriptions, etc). The classes are mostly video oriented and, in my case, they are slide free and focused on code.

(image) I have currently 3 classes listed, two on interfaces (and there is a bundle to get both at once, as shown in the image) and one on generics. Another one on anonymous methods is in the works. As you can see my initial effort is to focus on the most recent and more complex features of the Object Pascal language, with content that matches my book but is presented in a different way. What I do, in fact, is building the example step by step, showing the feature but also reasoning on alternative coding options and ideas. I plan expanding my contribution completing the advanced area (RTTI, reflection, attributes), and add more core topics (properties and events, classes and objects, etc) and possibly even beginners Pascal material. Ideas are welcome. As an example, the bundle shown and linked here with the two classes on interfaces and my ebook, is currently priced at 29 US$. See https://www.embarcaderoacademy.com/p/interfaces-in-delphi-intro-to-advanced for more information.

(image)



Why I Choose Delphi Summary

2017-10-03T10:58:51.667Z

Over the summer, there has been a number of blog posts on this topic, but I haven't seen a complete list. Here it goes.

Over the summer, there has been a number of blog posts on the "Why I Choose Delphi?" topic. While providing personal ideas, they do have common themes and I think there are very interesting to read, for anyone who is using Delphi today (or used it in the past). Here is the list of the blogs I noted, and I migh have missed others, let me know:

David Harper: https://csvelocity.wordpress.com/2017/07/27/why-i-choose-delphi/

Andre Celestino: http://www.andrecelestino.com/why-i-choose-delphi/

Frank Lauter: http://delphiprofi.blogspot.it/2017/08/whyichoosedelphi.html

Ryan Potts: https://rpottsoh.github.io/Why-I-Choose-Delphi/

Jim McKeeth:  https://community.embarcadero.com/blogs/entry/why-i-keep-choosing-delphi and http://delphi.org/2017/08/why-i-keep-choosing-delphi/

Steffen Nyeland: https://fixedbycode.blogspot.it/2017/08/why-i-keep-preferring-delphi.html

Ray Konopka: https://delphibydesign.com/why-i-choose-delphi/

Jens Fudge: https://community.embarcadero.com/blogs/entry/why-i-choose-delphi

 Robert Calco: http://www.hitcompileandrun.com/2017/08/why-i-choose-delphi.html

"T Theobald":  http://borkedcode.com/wp/?p=1511

(image)



InterBase 2017 Update 1 and Delphi

2017-09-29T09:56:01.799Z

Embarcadero has just released an updated version of the InterBase 2017 database, with improved performance and platform support.

(image) A few months after the InterBase 2017 release, Embarcadero has just made available InterBase 2017 Update 1. If you are an existing InterBase user, this is a nice update the install, given it has some performance improvements, bug fixes, and new features, as explained in the announcement article I just publsihed at:

https://community.embarcadero.com/article/16575-interbase-2017-update-1-is-now-available

InterBase is a great embedded database, and the IBLite/IBToGo versions come included with RAD Studio for all supported platforms (desktop and mibile). The Windows developer edition of the full RDMBS (a fast, hassle free, fully powered SQL engine) is also included in RAD Studio and helps power the RAD Server database. Not only InterBase is on par with most competing (and often more expensive) solution, but it has unique features like ChangeViews that can be leveraged to greatly optimize the data traffic, something even more important in today's mobile and distributed world.

While RAD Studio Tokyo ships with the previous version, InterBase XE7, the InterBase 2017 versions of the developer server and IBLite/IBToGo are available in GetIt -- currently still the original release, Udpate 1 will be made available early next week. Read the linked article above for current download links and more information on this version of InterBase.

 

(image)



Delphi and RAD Studio Roadmap Update Published

2017-09-19T08:03:27.043Z

Today the RAD Studio Product Management team (myself included) has published an updated roadmap.

The article with the new roadmap slides is available at:

https://community.embarcadero.com/article/16563-rad-studio-roadmap-september-2017

The roadmap is updated with the 10.2.1 actual release and the specific 10.2.2 plans, along with the focus areas for 10.3 next year.

(image)



Visiting Delphi Conference in Poland Next Week

2017-09-14T14:28:02.539Z

Next week I'll visit and give a keynote and a technical session at a Delphi event, called "Zlot Programistow Delphi", near Warsaw Poland. And there are other Delphi events in Europe next week.

On September 21st and 22nd (next Thursday and Friday) I'll be attending and giving sessions at a Delphi conference in Poland. The conference is organized by the local Embarcadero partner, BSC Polska. You can find more information at the "Zlot Programistow Delphi" web site,

http://delphi.pl/zlot/

(Site content is in Polish language, but session descriptions are also in English and several sessions -- those by foreign speakers like myself, Stefan, Primoz -- will be in English).

If you live in Poland, this would be a rather unique opportunity to get a lot of first class Delphi content and meet a few Delphi gurus and one of the product PMs (that is, me). So don't miss the opportunity for a chat, some tech info, and even an interesting evening called "Grill - Delphi and Fun". See you.

 

PS: There are other notable Delphi conferences in Europe next week, The Lab in Netherlands on Sept 19th (https://www.barnsten.com/nl/events/details?events_id=294) and ForenTage on Sept 23rd (and previous days) in Germany (https://forentage.de/). It's the first time in a few years I miss this German user groups conference, but I had a conflicting family event. David Milligton, one of the other RAD Studio PMs, is attending both conferences!

(image)



GetIt Content Update, September 2017

2017-09-13T13:39:23.695Z

We keep adding a lot of open source libraries, trial components, and now also demos and database connectors to the GetIt package manager. Here is a roundup of updates.

We keep adding a lot of open source libraries, trial components, and now also demos and database connectors to the GetIt package manager. As I wrote a couple of months back, we added also a lot of new categories to simplify navigating among the 241 packages listed today.

What was added over recent months to the GetIt package manager for 10.2 Tokyo?

  • AQTime Standard Embarcadero edition
  • FaceAPI library (for Microsoft Cognitive Services)
  • Grijjy Cloud Logger
  • NexuxDB Free Embedded Version
  • RAD Server Industry Template - Hospitality Survey Application
  • JCL and JVCL updates
  • 3DElite TCP Server-Client Library
  • Additional TMS trial components
  • Many /n Software trial components
  • BrilliantCode trial
  • FmxLinux trial
  • The 80 or so trial versions of CData Enterprise Connectors

More and more components are being added continuously, and we are open to submissions from the community and from partners.

(image)

 

(image)



12 Years of Blogging

2017-09-08T13:42:31.130Z

Today marks the 12th year of my blog, blog.marcocantu.com. And this is my blog post number 1422.

Today marks the 12th year of my blog, blog.marcocantu.com (now also mirrored on community.embarcadero.com). It is easy for me to remember, as I started the blog on my birthday! And this is my blog post number 1422.

Lots of things happened in this 12 years, but I'm still mostly focused on Delphi, even if in a different role. And if you read the first post (http://blog.marcocantu.com/blog/startingblog.html) you'll see the core engine was written in Kylix -- the ancestor of the newly released Delphi 10.2 Tokyo with Linux support. You can read the 1420 blog posts in between by navigating the full archive at http://blog.marcocantu.com/archives.html.

To capture at a very high level these 12 years, I grabbed all pictures I used in blog post (at least those I uploaded a copy of) and made the collage below (you can expand it for higher resolution). And thanks to those who have been following my blog for these 12 years. Let's have another great year!

(image)

(image)



Hotfix for 10.2.1 Inherited VCL Forms Released

2017-09-06T14:23:25.960Z

Embarcadero just released a hotfix for a regression when using inherited VCL Forms on High-DPI monitors

This hotfix addresses a bug introduced in RAD Studio 10.2.1 and reported as RSP-18792 in Quality Portal. The issue causes an inherited VCL form to fail to scale on high DPI displays. Actually the fix resolves also a couple of related problems.

The download is available at https://cc.embarcadero.com/item/30798

Notice that even if the changes is for only a few lines of source code, the download is over 80 MB, as we are updating all binary files (DCU, BPL) including that code. The list of files is included in the download page.

(image)