Products



Stay in touch

Add your e-mail address here to receive the monthly TMS Software alerts.


    

Content:
Product releases
Product articles
Technical articles
Website changes
Software development

Products:

<< >>
October 2014



Friday, October 24, 2014

TMS XData Service Operations

The latest TMS XData 1.1 version introduces a major feature: Service Operations. In addition to having your objects published as REST resources automatically, you can now add server-side logic in a very easy and straightforward way.

Service operations are defined as interfaces. Any interface can become a set of operations, all you need to do is add the [ServiceContract] attribute to the interface:
type
  [ServiceContract]
  IMyService = interface(IInvokable)
  ['{BAD477A2-86EC-45B9-A1B1-C896C58DD5E0}']
    function HelloWorld: string;
    function FindOverduePayments(CustomerId: integer): TList<TPayment>;
  end;
The nice thing is that in addition to sending and receiving values of scalar types, you can also send and receive Aurelius entities. You can also use TStream for low-level operations.

The next step is to write the server logic, which is done just by implementing the interface in some class, and adding the attribute [ServiceImplementation] to that class:
type
  [ServiceImplementation]
  TMyService = class(TInterfacedObject, IMyService)
  private
    function HelloWorld: string;
    function FindOverduePayments(CustomerId: integer): TList<TPayment>;
  end;
 
implementation
 
function TMyService.HelloWorld: string;
begin
  Result := 'Hello, World';
end;

function TMyService.FindOverduePayments(CustomerId: integer): TList<TPayment>;
begin
  Result := TXDataOperationContext.Current.GetManager.Find<TPayment>
    .CreateAlias('Customer', 'c')
    .Where(TLinq.Eq('c.Id', CustomerId) and TLinq.LowerThan('DueDate', Now))
    .List;
end;
And that's it. When you create the XData server module, it will find the interfaces and implementations automatically through the attributes, and will make the operations available through the server.

The FindOverduePayments method implementation illustrates how smooth is the integration with TMS Aurelius. The TXDataOperationContext class provides you with some useful properties to implement your server logic. The main property is GetManager, which provides you with an Aurelius TObjectManager.

All you have to do is use the manager to persist objects, or to query objects using the Aurelius full query API. When implementing the server logic, you don't have to deal with database connections (XData uses its connection pool), you don't need to instantiate the object manager, you don't need to deal with memory management and also with JSON serialization.

To invoke the service operation from any client using HTTP, you just POST to the operation address, passing the parameters in JSON format:
POST /tms/xdata/MyService/FindOverduePayments HTTP/1.1
 
{
  "CustomerId": 10
}
XData will parse the parameters, invoke your method, which in turn will use Aurelius to query the database, retrieve all TPayment objects that match the criteria, and return a plain JSON array with the payment objects in JSON format.

Another great thing is if your client is written in Dephi, you can use the TXDataClient class. You can then benefit from the interface you declared and use it at client side as well. Use the TXDataClient to retrieve the interface, and call the interface method. XData will do all the HTTP requesta and JSON conversion for you, and will give you the TPayment objects:
var
  Client: TXDataClient;
  MyService: IMyService;
  Payments: TList<TPayment>;
begin
  Client := TXDataClient.Create;
  Client.Uri := 'http://myserver/tms/xdata';
  MyService := Client.Service<IMyService>;
  Payments := MyService.FindOverduePayments(10);
  // add your logic that deals with TPayment objects
end;
You can even pass your Payments list to a TAureliusDataset to easily show them in a TDBGrid or any other control that is data aware or using Live Bindings.

You can learn more about XData using the official online documentation. Or you can refer directly to the Service Operations chapter.

Bookmarks: 

Wagner Landgraf




This blog post has not received any comments yet. Add a comment.



Thursday, September 25, 2014

Hands-on TMS Business Subscription training day

TMS software organizes on Wednesday November 19th a hands-on training day on our TMS Business Subscription line of tools in Kortrijk, Belgium.
All day, sessions will be spent on our ORM, data modeling and remoting tools TMS Aurelius, TMS Data Modeler, TMS RemoteDB, TMS XData, ... with sufficient time for your questions and room for interaction to help you getting the maximum out of these TMS tools. The sessions will be given by Wagner Landgraf, the product Manager of TMS Business Subscription. Bring your laptop if you want to follow the samples live or if you want our expert to have a look at your implementations


Tentative session program
  • 09h00-09h30: Registration & coffee
  • 09h30-10h30: TMS Aurelius
  • 10h30-11h00: Q&A
  • 11h00-11h30: Coffee break
  • 11h30-12h00: TMS Data Modeler & TMS Aurelius
  • 12h00-12h30: Q&A
  • 12h30-13h30: Lunch
  • 13h30-14h30: TMS XData
  • 14h30-15h00: Q&A
  • 15h00-15h30: Coffee break
  • 15h30-16h15: TMS RemoteDB & additional tools
  • 16h15-17h00: Discussion, architecture approaches, Q&A
Registrations until October 31st
The cost of the hands-on TMS Business Subscription training day is 75EUR for TMS Business Subscription users and 125EUR for non TMS Business Subscription users. This includes a full day access to the sessions and coffee/lunch during this day. The extra 50EUR for non TMS Business Subscription users will be deductible from any TMS Business Subscription purchase. Don't delay your registration as the number of seats is limited to 10 persons for a maximum interactivity!

Signup here via the online registration form

Location

  • Kennedy Hotel, Pres. Kennedypark 1, B-8500 Kortrijk
  • Free parking
  • Nearby highway (E17) exit
  • Facilities for hotel rooms at the event are available for international attendees


Bookmarks: 

Bruno Fierens




This blog post has received 4 comments. Add a comment.



Friday, August 29, 2014

TMS Day in Denmark on November 4th

We are excited to announce that Jens Fudge, Embarcadero MVP for Denmark, and TMS software are planning a TMS day in Denmark on November 4th.

All day, sessions will be spent on TMS VCL components, TMS cloud components and TMS FireMonkey components with also sufficient session time allocated to handle your specific questions on TMS components. The sessions will be given by Bruno Fierens, Embarcadero MVP in Belgium and CTO from tmssoftware.com.


Tentative session program:


  • 9h00-9h30 : Registration & coffee
  • 9h30-10h30 : Getting the most out of TMS VCL grids
  • 10h30-11h00: Coffee break
  • 11h00-12h00: Embracing the cloud with TMS cloud components
  • 12h00-12h30: Q&A
  • 12h30-13h30: Lunch
  • 13h30-14h30: TMS FireMonkey components including TMS grid for FireMonkey
  • 14h30-15h00: Coffee break
  • 15h00-15h30: An introduction to TMS iCL & TMS mCL
  • 15h30-16h00: Tricks with TMS VCL components
  • 16h00-17h00: Q&A and round-table discussion on Delphi components & Delphi development with TMS components in general

Sign-up now for the TMS Day in Denmark in Videnpark Trekanten, Fredericia, Denmark on November 4, 2014. The cost of the TMS Day is only a small fee 20EUR (150DKK) for the food during this day. The price of food will be deductible from any future purchase from TMS software. Don't delay your registration as the number of seats is limited. During sign-up please also express your interests for topics during this day and possibly questions you might have so we can fine-tune the session program as much as possible to your needs. A few weeks in advance, we will then present the final session program.

Signup here via the online registration form


Bookmarks: 

Bruno Fierens




This blog post has received 2 comments. Add a comment.



Monday, August 25, 2014

Visualize TMS Planner event relations with arrows

It's already for a longer time that our Planner scheduling components supports linking events. That means that when the start time or end time or both times of an event is changed, the start or end time of a linked event will also change. The change in start or end time of linked event will have the same delta as the source event. The link action of choice can be selected with PlannerItem.LinkType and offers following choices:

  • ltLinkFull: when start time and end time of the event is changed, the start and end time of the linked item also changes.
  • ltLinkBeginEnd: when the start time of an event is changed, the end time of the linked event also changes.
  • ltLinkEndBegin: when the end time of an event is changed, the start time of the linked event also changes.
  • ltLinkBeginBegin: when the start time of an event is changed, the start time of the linked event also changes.
  • ltLinkEndEnd: when the end time of an event is changed, the end time of the linked event also changes.
Now, it may not always be desirable that any type of linking will affect the start or end time of the linked item, a visualization might be sufficient. For this case, we have added the link type: ltNone. At the same time, a better visualization of linked items will also benefit "classic" linked items. Therefore, in the latest version of the TMS Planner, we went one step further and have now optionally visual connections with lines with arrows between linked events. To see how easy it is to set this up, imagine two events were created with the code:
var
  plit1,plit2: TPlannerItem;
begin
  plit1 := Planner1.CreateItem;
  plit1.ItemStartTime := EncodeTime(10,0,0,0);
  plit1.ItemEndTime := EncodeTime(12,0,0,0);
  plit1.ItemPos := 0;
  plit1.CaptionType := ctText;
  plit1.CaptionText := 'item 1';
  plit1.Text.Text := 'link from';
  plit2 := Planner1.CreateItem;
  plit2.ItemStartTime := EncodeTime(14,0,0,0);
  plit2.ItemEndTime := EncodeTime(16,0,0,0);
  plit2.ItemPos := 1;
  plit2.CaptionType := ctText;
  plit2.CaptionText := 'item 2';
  plit2.Text.Text := 'link to';
end;


When applying one link with code:
  plit1.LinkedItem := plit2;
  plit1.LinkType := ltLinkFull;
then moving or resizing the event "item 1" will result in event "item 2" also moving or resizing. Moving or resizing event "item 2" will not cause changes to event "item 1". When we'd want a bidirectional link, we'd initialize the link with:
  
  plit1.LinkedItem := plit2;
  plit1.LinkType := ltLinkFull;
  plit2.LinkedItem := plit1;
  plit2.LinkType := ltLinkFull;
In a next step, we'll visualize the link between items with arrow lines. To enable link visualization in the TMS Planner globally, set Planner.ShowLinks = true and set Planner.LinkArrowShape = asFilled when you want fully filled arrows instead of just arrows (asNormal). To have two events that are linked with an arrow line from one event to the other event without specific link relationship, setup the items with:
  plit1.LinkedItem := plit2;
  plit1.LinkType := ltLinkNone;
  plit1.LinkArrow := laFromTo;
  plit1.LinkColor := clGreen;
To have the arrows go in both directions, simply set the property LinkArrow to laBoth as in this sample:
  plitA.LinkedItem := plitB;
  plitA.LinkType := ltLinkNone;
  plitA.LinkArrow := laBoth;
  plitA.LinkColor := clRed;


We hope you'll find this new feature useful and you can benefit from it to create better applications for your customers. Check out this and more in the TMS Planner.

Bookmarks: 

Bruno Fierens




This blog post has not received any comments yet. Add a comment.



Friday, August 22, 2014

TMS iCL native iOS peer 2 peer communication

We've created a short (8 minute) presentation / demo video to show you how our newest native iOS peer 2 peer communication component in TMS iCL works. It shows how you can send an object and text via Bluetooth or local WiFi to nearby peers. Underlying, everything is done via 100% native iOS APIs, so, no Indy or other libraries are being used.

Check out the video here:


Bookmarks: 

Bruno Fierens




This blog post has not received any comments yet. Add a comment.




Previous  |  Next  |  Index


Copyright © 1995 - 2014 TMS Software v4.0