Wednesday, August 12, 2015TMS XData is its powerful querying capabilities. With no extra line of code in your server, clients can choose how to retrieve the server objects, filter them, set an order, etc..
For example, you can perform a GET request to get Customer objects but filter only those which name is John:
http://server:2001/tms/xdata/Customer?$filter=Name eq 'John'
You can also filter by properties of associated objects, at any level. The next example gets all customers which associated country name is "USA":
http://server:2001/tms/xdata/Customer?$filter=Country/Name eq 'USA'
You can use order, top and skip to get paged results (get next 20 orders from 41st one):
And, of course, you can combine all those with parenthesis and relational operators to build really complex queries:
http://server:2001/tms/xdata/Customer?$filter=(Name eq 'John' or Name eq 'Jack') and Country/Name eq 'USA'
But the purpose of this post is to tell about the new built-in functions introduced in version 1.5. They increase flexibility of the queries even more. Functions that extract part of of a date/time property were added, so now you can for example filter invoices for year 2014:
http://server:2001/tms/xdata/Invoice?$filter=year(IssueDate) eq 2014
There are of course similar functions to extract Month, Day, Hour, Minute and Second.
String-related functions were also added. Upper and Lower were introduced:
http://server:2001/tms/xdata/Customer?$filter=lower(Name) eq 'paul'
You can also use length function to retrieve the length of a string in characters:
http://server:2001/tms/xdata/Customer?$filter=length(Name) eq 15
And Position and Substring functions can also be used to retrieve the position of a substring in a string (Position) or to retrieve part of a string (Substring). They would be the equivalent of Delphi functions Pos and Copy, respectively:
http://server:2001/tms/xdata/Customer?$filter=substring(CompanyName, 2, 4) eq 'oogl'
http://server:2001/tms/xdata/Customer?$filter=position('jr', Name) gt 0
And it's worth to remember that having TMS Aurelius working behind the scenes, all those queries will work the same way regardless of the database your are using at the server side, be it MS SQL Server, MySQL, Oracle, or any supported database you want. Best part is that it's not going to stop here, stay tuned for future releases that will bring even more querying features!
This blog post has not received any comments yet. Add a comment.
Sunday, June 07, 2015
Step 1: getting Apache up and running
If Apache is already setup on your device, skip this step, otherwise, from the command line, execute:
$ sudo apt-get install apache2
The Raspberry Pi 2 LED flashes for a short while and when completed, verify it is working by opening a browser on a machine in the network and navigate to the IP address of the Raspberry Pi 2 like http://192.168.1.100. When install was successful, you'll be greeted with an "It works!" page.
Step 2: install PHP and tools
In case you had Apache already configured with PHP 5, you can also skip this step.
To install, execute following commands:
$ sudo apt-get install php5 $ sudo apt-get install php5-gd $ sudo apt-get install sqlite $ sudo apt-get install php5-sqlite $ sudo apt-get install php5-curl
After some more LED flickering, these steps will also be executed and the Apache environment with PHP 5 is ready.
Step 3: install ownCloud
To install ownCloud, start by downloading the latest distribution. At this time, this is v8.0.3 and is downloaded with:
$ sudo wget https://download.owncloud.org/community/owncloud-8.0.3.tar.bz2
Next step is to unpack the ownCloud distribution and install it under Apache.
$ sudo mv owncloud-8.0.3.tar.bz2 /var/www $ cd /var/www $ sudo bunzip2 owncloud-8.0.3.tar.bz2 $ sudo tar xf owncloud-8.0.3.tar
Step 4: setting up ownCloud
To finalize, the data folder for ownCloud must be created and an admin account added.
The data folder is created with following steps:
$ sudo mkdir /var/www/owncloud/data $ sudo chown www-data:www-data /var/www/owncloud/data $ sudo chmod 750 /var/www/owncloud/data
At this time it is more convenient to continue the setup from a browser. Either start the graphical shell on the Raspberry Pi 2 or connect from a browser on an external machine and navigate to http://localhost/owncloud or from external machine http://192.168.1.100/owncloud/
The first screen that appears is to create an admin account, so add the credentials for an admin account on this page. With this account added, owncloud is up and running and ready for use.
Step 5: Connecting from Delphi to ownCloud
Now Delphi kicks in and with a little help from the TMS Cloud Pack, let's start using ownCloud from a Delphi app.
Start your IDE, make sure TMS Cloud Pack is installed and drop the component TAdvCalDAV on the form. Configure the TAdvCalDAV component to access your ownCloud. Verify the ownCloud primary CalDAV address by opening the calendar app within ownCloud via: http://192.168.1.100/owncloud/index.php/apps/calendar/ and in the bottom left corner, click on settings where this primary address is shown. By default, this should be:
So, now we can configure the TAdvCalDAV component to connect to ownCloud on Raspberry Pi 2:
try AdvCalDav1.URL := 'http://192.168.1.100/owncloud/remote.php/caldav/'; AdvCalDav1.Username := 'tms'; AdvCalDav1.Password := 'tmsrocks!'; AdvCalDav1.Active := true; except Exit; end;
After a successful connect, the calendars and their events available on ownCloud can be retrieved, here by filling the info in a listview:
var i: integer; cdi: TCalDavItem; li: TListItem; begin // get events for i := 0 to AdvCalDav1.Items.Count - 1 do begin cdi := AdvCalDav1.Items[i]; if cdi.vCalendar.vEvents.Count > 0 then begin li := ListView1.Items.Add; li.Caption := cdi.vCalendar.vEvents.Summary; li.SubItems.Add(FormatDateTime('dd/mm/yyyy hh:nn',cdi.vCalendar.vEvents.DTStart)); li.SubItems.Add(FormatDateTime('dd/mm/yyyy hh:nn',cdi.vCalendar.vEvents.DTEnd)); li.SubItems.Add(cdi.vCalendar.vEvents.Location); li.SubItems.Add(cdi.vCalendar.vEvents.Description.Text); li.Data := cdi; end; end; end;
Adding a new calendar item is equally easy:
var cdi: TCalDavItem; li: TListItem; begin // set the calendar for the event cdi := AdvCalDav1.Items.Insert('Personal'); // add item to the "Personal" calendar cdi.vCalendar.vEvents.Add; cdi.vCalendar.vEvents.Summary := 'Schloss Dyck Classic Days'; cdi.vCalendar.vEvents.Location := 'Jüchen, Deutschland'; cdi.vCalendar.vEvents.Description.Text := 'Automobile Kulturgeschichte auf der Museums-Insel'; cdi.vCalendar.vEvents.DTStart := EncodeDate(2015,7,31); cdi.vCalendar.vEvents.DTEnd := EncodeDate(2015,8;2); cdi.Post; end;
or modifying an existing item
var cdi: TCalDavItem; li: TListItem; begin cdi := ListView1.Selected.Data; cdi.vCalendar.vEvents.Summary := 'Schloss Dyck Classic Days 2015'; cdi.Update; end;
Similar to accessing the calendars of ownCloud, you can also access the contacts with the TAdvCardDAV component in a very similar way. And this rounded up my little weekend fun experiment. With so much ubiquitous computing power around and wonderful technology, aren't we living in very exciting times?
Tuesday, June 02, 2015number one requested component. Today we are excited to confirm its availability as part of TMS Pack for FireMonkey v3.0. So, we are happy to deliver on your requests. But there is more. Check here what TMS Pack for FireMonkey v3.0 brings:
Targetting Windows, Mac OS-X, iOS and Android devices, fine-tuned for desktop and mobile use and packed with features is our new scheduling/planner control TTMSFMXPlanner. It's suitable for a wide range of use-cases, from single resource day planning to multi-resource scenarios with fully customized timeline. In combination with TMS Cloud Pack for FireMonkey, it offers seamless connectivity to a cloud calendar like Google calendar or Microsoft Live calendar. Read more about TTMSFMXPlanner in this blog, the developers guide or check out the fully functional trial version.
Also new in TMS Pack for FireMonkey is this control for capturing ratings for different items, making questionaires or for presenting feature comparison lists. It supports customizable tickmarks, radiogroup or checkgroup behavior for items.
To protect the use of your applications or access to certain parts of your application, the TTMSFMXPassLock is a component for input of a configurable length pass code or pass pattern. One property controls in what mode the pass code can be entered and the component features a pass code learn mode as well. An event is triggered when the pass code is correct or wrong.
Other than these 3 new controls, there are several improvements to existing components as well. The full version history is here.
More good news
And to round up the good news, all customers with an active registration for TMS Pack for FireMonkey receive this v3.0 free. For customers with an expired registration, a renewal discount of about 50% is available for 30 days.
Call to action
Add your feature request or vote on existing feature requests. It is one of the tools that help us align our development efforts with your needs.
This blog post has not received any comments yet. Add a comment.
Saturday, May 23, 2015
While TMS Planner for FireMonkey design benefits from the significant experience the TMS team built-up with the award-winning VCL, IntraWeb and ASP.NET Planner components, the new component has been architected from the ground up for cross-platform, multi-device usage. This includes tuning for performance & footprint to run smoothly on Android or iOS smartphones and making the component flexible enough for complex scheduling applications in desktop or tablet applications.
In a nutshell, the TMS Planner for FireMonkey is a user-interface control representing a timeline and events for single or multiple resources.
The timeline in the TTMSFMXPlanner is configurable. Default, it represents the standard 24hr timeline but this can be easily changed to month mode, a day period mode, a half-day period mode, multi-month mode or a custom timeline mode. With the custom timeline mode, the unit of time along the timeline can be fully programmatically set. In one of the included demos will be a timeline in seconds mode that represents a schedule of TV-adds.
Within the displayed timeline, the TTMSFMXPlanner has the notion of active and inactive time, typically used for open office hours that can be shown in a different collor as well as various ways to to display the actual time on screen. In addition, for period, month, multi-month modes, specific days of the week can also be set as inactive time.
The TTMSFMXPlanner can display events for a single resource or can deal with multiple resources. Multiple-resources can be displayed in different columns (when the timeline is vertical) or different rows (when the timeline is horizontal). But there is more. Views with multiple resources can be combined with multiple days. In this way, multiple resources per day and multiple days per resource can be shown. And in addition to this, there is also the flexible capability to create groups of a different nr. of resources or days, like grouping a number of days in a week or grouping a number of resources to a company etc...
Also for editing events in a TTMSFMXPlanner view, we went to great lengths to offer built-in easy to use and flexible to customize editing capabilities. First of all, changing the start time, end time or dragging the event to a different day or resource is optimized for both classic desktop mouse & keyboard interaction as touch based mobile device operation. Editing of event notes can be done via inplace editing or via a popup dialog. Both inplace editing and use of popup dialogs can be fully customized.
If you want to hookup your TTMSFMXPlanner to a cloud calendar service, we have the adapters ready for you that let you interface the TTMSFMXPlanner to a Google calendar or Microsoft Live calendar. This is achieved by an adapter that interfaces the TTMSFMXPlanner via TTMSFMXPlannerGoogleAdapter or TTMSFMXPlannerLiveAdapter to TMS Cloud Pack components for access to these cloud calendar services.
We realize that scheduling applications all have different rules and particularities. Therefore, the TTMSFMXPlanner has overall extensive customization capabilities. From putting custom text in timeslots, defining event conflict handling, restricting events to resources, custom drawing over events, timeline, resource header, editing validation and much much more. And of course, the TMSFMXPlanner also visually automatically integrates with the selected FireMonkey application style.
All this and more is coming to you in the next major release of TMS Pack for FireMonkey. This new version will be free for all active registered users.
Previous | Next | Index