Quite a lot of new code got piled up so without further ado here are the news.

(You can get all new releases from the download page)

SimpleStorage

This a new major release (1.7.3) of SimpleStorage. And sadly also a breaking one. At least if you were writing your own filters and adapters. There was no other way around if I wanted to write a good and clean code. All changes that were made revolve around filters and adapters. Here is the list of important changes

  • Filters were extended to the document level. This means you can now compress and encrypt XML nodes or whole document in a transparent manner.
  • Chaining was introduced to filters. This means you can now encrypt and compress a document in a single step or if you like, in a single line of code :)
  • Encryption and compression are now integral part of SimpleStorage and no third party components are needed anymore.
  • Adapters and Filter now use cleaner approach, so no more strings as identifiers, to specify which filter or adapter you want.

Let me give you some examples:

Compressing and the encrypting a whole document.

NormalXML.Filter(ZLIB).Filter(XTEA('MyStrongKey')).SaveToFile(FilteredXMLFileTwo);

The same but using a document fiter chain interface.

DocumentFilterChain := CreateDocumentFilterChain;
DocumentFilterChain.AddFilter(CompressedStorage);
DocumentFilterChain.AddFilter(EncryptedStorage('MyStrongKey'));
NormalXML := DocumentFilterChain.LoadFromFile(FilteredXMLFileOne);
NormalXML.SaveToFile(NormalXMLFileOne);

Compressing using the compressed storage interface.

CompressedStorage.SaveToFile(DecompressedXML, CompressedXMLFileOne);

Compressing using the build in ZLIB filter.

DecompressedXML.Filter(ZLIB).SaveToFile(CompressedXMLFileTwo);

Do you see how simple it is to compress and encrypt a XML document. The other change is in the adapter code. There are no more strings to specify which adapter to use. It looks like this:

  SS.Ensure('MemTable').Adapter(DataSet).Load(ClientDS);

and

  SS.Get('MemTable').Adapter(DataSet).Save(ClientDS);

There are other smaller changes, but this are the major ones. Just a warning here. If you were writing adapters or filters (your own) then this is a breaking release and you will have to update your code to the new specifications. The examples that come withe the library are clear enough that it should be a breeze. For normal user nothing changes and the code will stay the same. I also left the old version of SimpleStorage available for download if people don’t want to upgrade right away.

Also I would like to announce that I will begin writing basic documentation for SimpleStorage.

ISAPIServer

This is a new component in the library. It is a standalone ISAPI server capable of processing Delphi ISAPI modules. You don’t need Apache or IIS. And it is build in the way, that you can use your favorite HTTP library to use it. It comes with already made bindings for Indy, but it would be equally simple to do bindings for Synapse or ICS. This is possible because it is designed in a very modular way. If any of you are interested in that, you can contact me and I can help with it. I am posting the whole ISAPI request code for Indy as an example:

procedure TfMain.HTTPServerCommandGet({$IFDEF Indy9}
                                        AThread: TIdPeerThread;
                                      {$ELSE}
                                        AContext: TIdContext;
                                      {$ENDIF}
                                      ARequestInfo: TIdHTTPRequestInfo;
                                      AResponseInfo: TIdHTTPResponseInfo);
var
  ECB: TECBData;
  Port: string;
  TempStr: string;
  PathStr: string;
  RootDir: string;
  DDLFileName: string;
begin
  TempStr := Copy(ARequestInfo.Document, 2, Length(ARequestInfo.Document));
  RootDir := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)));
  PathStr := '/' + StrAfter('/', TempStr);
  DDLFileName := StrBefore('/', TempStr);
 
  {$IFDEF Indy9}
    Port := IntToStr(AThread.Connection.Socket.Binding.Port);
  {$ELSE}
    Port := IntToStr(AContext.Binding.Port);
  {$ENDIF}
 
  ECB := ECBDataList.AcquireNewECB;
  try
    FillECBFromRequest(ECB, HTTPServer.KeepAlive, ARequestInfo, RootDir, DDLFileName, Port, PathStr);
    try
      FISAPIServer.Execute(DDLFileName, ECB);
    finally
      FillResponseFromECB(ECB, AResponseInfo);
    end;
  finally
    ECBDataList.DeleteECB(ECB.ECB.ConnID);
  end;
end;

RoboMailer

This is also a new component. It is intended as a simplified mass mailer component. It can also be used to send a single mail easily with no worries on how to set everything up correctly. It comes with a demo application, which can send mass mails. You can personify each mail with the data you provide.  Maybe it will be of use to somebody. It uses ICS as an engine.

Threading unit

This unit got two interesting additions. First one is a lock free stack based on the windows API. No home made code here, just a wrapper around windows API. And the second one is a thread safe queue. It uses critical sections but tries to lock as little as possible. I have done some tests and it is very fast. In fact it is almost as fast as a lock free one, but the code is much much simpler. There is very little difference in speed in fact it is negligible in real world problems.

ChangleLog:

  • 1.4.0
    • Added TLockFreeStack based on Windows SLISTS
    • Added TThreadSafeQueue based on linked lists
  • 1.3.7
    • Added ShutdownTimeout (INFINITE by default)
    • Wait for all tasks to finish then shutting down the task pool

CRON Scheduler

Change Log:

  • 2.0.3
    • added HasValue function for TChronEntry

SimpleLog

Change Log:

  • 1.2.0
    • Use the new rewritten Cromis.Exceptions
    • Log file limit is now working correctly

XTEA

Change Log:

  • 1.1.0
    • Added overloaded procedures for stream and file encryption / decryption