Habari Client libraries release 2014.09

Habarisoft released new versions of Habari Client libraries for Delphi and Free Pascal application integration with free open source message brokers.

Tested with current message broker versions

  • Apache ActiveMQ 5.10.0
  • Apollo 1.7
  • HornetQ 2.4.0.Final
  • Open MQ 5.1 b09
  • RabbitMQ 3.3.5

Fixes

  • Unhandled Exceptions in WaitForReceiptFrame are re-raised to notify client code about the exception
  • Fixed compiler error undeclared identifier ‘ShortDateFormat’ when using Log4D with newer Delphi versions
  • Fixed Free Pascal compiler warning about deprecated ShortDateFormat in Log4D
  • Fixed Free Pascal compiler error ‘unknown identifier: TClassList’ and run time error SIGSGEV (Linux)
  • Fixed CurrentUTC method by using LocalTimeToUniversal (Free Pascal)

Improvements

  • changed the Receive methods to update the heart-beat timestamp when heart-beats arrive, even if no message has been received. With this change, it is no longer required to call the CheckHeartbeat method periodically if no message arrived
  • ITextMessage.Text is now of type string instead of WideString
  • all persistent messages will be sent with a receipt request
  • improved Free Pascal and Linux support
  • Eliminate duplicate code in map message transformers
  • Added a check that the STOMP frame ends with a NUL byte and raise a EBTStompError if a non-NUL byte is found, to indicate a STOMP protocol violation (and a potential loss of data)

New features

  • Added a transformer class for map message exchange based on the Superobject JSON library
  • Added a transformer class for map message exchange based on the default XML parser library in Delphi (IXMLDocument)
  • Added class TBTConnectionBuilder which can be used to construct a connection by chaining configuration methods (experimental/unsupported code)
  • Added Free Pascal version of ConsumerTool application
  • Added unit tests for durable subscriptions
  • Added unit tests and a mock server to verify that the library detects a connection loss
  • Added Free Pascal version of throughput test application

DUnit and FPCUnit tests

fpcunit

ScroogeXHTML for the Java™ platform 4.4 – fast RTF to HTML/XHTML converter

Habarisoft released its RTF to HTML/XHTML converter library, ScroogeXHTML for the Java™ platform, version 4.4.

Release Notes:

  • Fixed missing stream#close() calls
  • Fixed potential null pointer exception for documents which contain invalid font table references
  • Fixed uppercase character support in RTF token keywords
  • Experimental support for WMF to PNG conversion using Apache Batik 1.7, the required conversion helper sources are available on request
  • Deprecated all conversion methods which take String arguments for the RTF input file name and encoding, and provided new methods which take File and Charset type parameters
  • MemoryPictureAdapter “base” property defaults to empty string “” instead of “/img?”. Note: this is a potentially breaking change
  • Updated installer to check for installed JDK
  • Updated installer to require JRE 1.6 or newer
  • Updated installer to ask for administrator permissions

On-line demo

The page secure.habariwebcomponents.de/sxd/ allows to upload a RTF file and convert it to different output formats (including HTML5, HTML 4.01 and XHTML).

API documentation

The online API documentation is available at http://www.habarisoft.com/scroogexhtml_j/4.4/docs/api/index.html.

Two server deployment licenses included

For the deployment on client/server production systems, the Single Developer license already includes two server deployment licenses. License types are explained on http://www.habarisoft.com/scroogexhtml_license.html

WMF conversion example

public void testEmbeddedWMF() {
  scrooge.setConvertPictures(true);
  PictureAdapter adapter = new MemoryPictureAdapter();
  adapter.setBase("wmf_");
  scrooge.setPictureAdapter(adapter);
  scrooge.convert(new File("wmf.rtf"), new File("wmf.html"));
  convertWMFPictures(adapter);
}

private void convertWMFPictures(PictureAdapter adapter) {
  for (EmbeddedPicture p : adapter.getPictures().values()) {
    if ("wmf".equals(p.getPictureFormat())) {
      WMFConverter c = new WMFConverter(p);
      try {
        ByteArrayOutputStream bos = c.convert();
        FileOutputStream fos = new FileOutputStream(p.getPictureUrl());
        fos.write(bos.toByteArray());
        fos.close();
      } catch (TranscoderException ex) {
            // ... 
      } catch (IOException ex) {
            // ...
      }
    }
  }
}

Delphi version

The RTF to HTML / XHTML library is also available for Delphi at http://www.habarisoft.com/scroogexhtml_delphi.html
ScroogeXHTMLJ_NetBeans

Open source REST client libraries for Delphi

delphi-oop

delphi-oop includes a REST client to consume RESTful web services using your own annotated class (similar to JAX-RS). It supports Google OAuth 2.0 authentication. The library is mostly tested with Delphi XE and hosted on Google Code at https://code.google.com/p/delphi-oop/

Code example: (more examples on the project page)

TODataNorthwindClient = class(TSvRESTClient)
  public
    [GET] [Path('/Customers')] [Consumes(MEDIA_TYPE.JSON)]
    function GetCustomers(): TCustomers; virtual;
  end;

delphi-rest-client-api

This library by Fabricio Colombo to consume RESTful web services supports two implementations, using Indy 10 and WinHTTP. The API was tested in Delphi XE, XE2 and XE3 and is hosted on Github at https://github.com/fabriciocolombo/delphi-rest-client-api

Code example:

var
  vPerson : TPerson;
begin
  vPerson := RestClient.Resource('http://localhost:8080/java-rest-server/rest/person/1')
                     .Accept(RestUtils.MediaType_Json)
                     .Get<TPerson>();

Open source SAX parsers for Delphi and Free Pascal

SAX (Simple API for XML) provides a mechanism for reading data from an XML document that is an alternative to that provided by the Document Object Model (DOM). Where the DOM operates on the document as a whole, SAX parsers operate on each piece of the XML document sequentially.

SAX is supported by several libraries for Delphi and Free Pascal, some open source libraries are:

WMF to PNG conversion support in ScroogeXHTML for the Java platform 4.4

The RTF to HTML / XHTML library ScroogeXHTML for the Java™ platfom introduces support for embedded WMF images in the upcoming 4.4 release. The conversion uses the Apache Batik transcoder to generate PNG files for all embedded WMF files of type EM_ANISOTROPIC.

ScroogeXHTML is also available for Delphi and Free Pascal.

Habarisoft on-line demo pages migrate to secure domain

Habarisoft started migrating demo web pages for its libraries to the secure domain https://secure.habariwebcomponents.de.

*) the Habari Web Components demo pages include links to non-secure resources (http instead of https) so they may cause browser security warnings.

 

ScroogeXHTML 6.7 – fast RTF to HTML / XHTML converter

Habarisoft is pleased to announce the release of ScroogeXHTML 6.7, a fast RTF to HTML / XHTML converter library for Delphi and Free Pascal. This is mainly a bug fix release.

New in release 6.7

  • Support for mixed case RTF tokens
  • Fixed support for output without indentation (SCROOGE_NO_INDENT option)
  • Updated documentation
  • Removed debug mode (replaced by unit tests)
  • Removed incomplete Linux support code
  • Fixed conditional DecimalSeparator unit reference
  • Minor changes, cleanup and fixes

A off-line demo version, the “Getting Started” guide (PDF) and the complete API documentation are available. An interactive on-line demo is available for ScroogeXHTML for the Java™ platform.