Login Register

The getUIComponentBitmapData method can create bitmapdata for a given IUIComponent. Pass any UIcomponent to get its respective bitmapdata.

public static function getUIComponentBitmapData(target:IUIComponent):BitmapData {      
    var resultBitmapData:BitmapData = new BitmapData(target.width, target.height);     
    var m:Matrix = new Matrix();     
    resultBitmapData.draw(target, m);     
    return resultBitmapData; 

Now convert the bitmapdata to a jpeg bytearray.

private static function encodeToJPEG(data:BitmapData, quality:Number = 75):ByteArray {     
    var encoder:JPGEncoder = new JPGEncoder(quality);     
    return encoder.encode(data); 

Now encode the ByteArray into Base64.

public static function base64Encode(data:ByteArray):String {     
    var encoder:Base64Encoder = new Base64Encoder();     
    return encoder.flush(); 

Upload the base64 encoded ByteArray to the server.

public static uploadData():void {     
    var url:String = "saveFile.php";     
    var urlRequest:URLRequest = new URLRequest(url);     
    urlRequest.method = URLRequestMethod.POST;     
    var urlLoader:URLLoader = new URLLoader();     
    var urlVariables:URLVariables = new URLVariables();     
    urlVariables.file = jpgEncodedFile;    // as returned from base64Encode() = urlVariables;     

The saveFile.php file on the server.

Published in Blogs
Recital 10 introduced the ECHO command. This command operates in the same way as the PHP ECHO command. It does not append a newline to the output but rather operates in the same way as the existing ?? command in Recital. The string being output can contain C-style string escapes \n \t or \r (newline, tab and carriage return respectively) e.g.
echo "Hello world\n"
Published in Blogs

SE Linux is a feature of the Linux kernel that provides mandatory access control. This policy based access control system grants far greater control over the resources on a machine than standard Linux access controls such as permissions.

Many modern Linux distributions are shipping with SELinux enabled by default, Fedora 14 and Rhel 6 both install with it enabled.

When you run Recital Web on a SELinux enabled machine and navigate to the default.rsp page you will see something similar to the screen shot below.

If you launch the SELinux troubleshooter you will see the following problem.

SELinux is blocking the apache server from accessing the Recital server running on port 8001.

To manage you SELinux policy you must have the policycoreutils package group installed. The policycoreutils contains the policy core utilities that are required for basic operation of a SELinux system.

If you wish to use a GUI tool, you must install the policycoreutils-gui package.

At the command prompt execute the following:

As root

$ yum install policycoreutils

$ semanage port -a -t http_port_t -p tcp 8001

$ service recital restart

$ service httpd restart 

We use the semanage command here to allow the http server access to port 8001. Once you have completed the steps detailed above you can go and navigate back to the default.rsp page in your borwser, where you will find the permission denied message is now replaced by the default.rsp page.

SELinux does a great job of restricting services and daemons so rather than simply disabling it, why not work with it!

When it comes to security, every little bit helps...

Published in Blogs

We are pleased to announce the immediate availability of Recital 10.0.1.

Included in this version are:

  • Improved SQL query optimizer
  • *New* apache plugin for building Recital web apps on x86_64 (
  • Performance improvements in connections to Recital Server and Recital Web.
  • Recital ODBC driver performance improvements and bug fixes
  • Miscellaneous bug fixes 
The download is available from in the downloads section of our website.

Existing Recital 10 users can download the patch file and apply it to an existing installation.

Published in Blogs
Recital 10 introduced a FOREACH command, much like PHP and some other languages. This simply gives an easy way to iterate over arrays. foreach works on arrays and objects, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes; the second is a minor but useful extension of the first:
FOREACH array_expression AS value
FOREACH array_expression AS key => value statements... ENDFOR
The first form loops over the array given by array_expression. On each loop, the value of the current element is assigned to value and the internal array pointer is advanced by one (so on the next loop, you'll be looking at the next element).
The second form does the same thing, except that the current element's key will be assigned to the variable key on each loop. This form works only on associative arrays and objects.
Published in Blogs
A number of people have complained about data loss after a system crash when using Ext4.  A bug report was logged. According to multiple posts by a developer of Ext4, Theodore Tso, this is due to differences in approach to security and performance issues between the two file systems.

Ext3 commits writes to disk within approximately 5 seconds - Ext4 can take from 40-150 seconds.  In addition, if a system is using Ext3 and crashes before the commit takes place you will still have the previous contents of a file where under Ext4 the file will be empty.  Theodore Tso feels that this is a failure at the application level and that the file system is behaving as designed and as specified by the POSIX spec (which apparently does not specify what is supposed to happen when a system is not shut down cleanly).  His solution to the issue is to suggest proper use of fsync() and lists various scenarios/examples in post 54 of the bug report (linked above).  In addition he wrote a patch that recognize the rename() situation mentioned in his post 54 yet retains the normal Ext4 behaviors and performance in the majority of cases.  Also a more "proper" solution has been provided which allows the behavior of Ext3 to be retained under Ext4 by mounting it with alloc_on_commit.

A somewhat related topic is the use of on-board caching by hard drives.  This behavior can be modified on most drives by using hdparm.
Published in Blogs

Yes, your FoxPlus and FoxPRO applications should run under Recital with little to no changes at all. We provide expert product support if you have any questions or problems. If you lack the resources to move your applications into Recital we can provide that service to you also if required.
Published in Blogs
Another useful article on IBM developerworks shows how to build PHP extensions using SWIG. You can find the article here.
Published in Blogs
If you are using the Oracle Gateway in Recital, make sure the Oracle environment (ORACLE_HOME, ORACLE_SID etc.) is set up before starting the Recital Server.  If not, you will see the error ORA-01019.  A call to the Oracle environment setup script can be added to the /etc/init.d/recital script if your Recital Server is set to run on startup.
Published in Blogs
A good article describing the configuration of samba for file/record locking can be found here.

Basically you must add these directives to the smb.conf file:

oplocks = False 
level2 oplocks = False

The default oplock type is Level1. Level2 oplocks are enabled on a per-share basis in the smb.conf file. Alternately, you could disable oplocks on a per-file basis within the share: 

veto oplock files = /*.dbf/*.DBF/*.ndx/*.NDX/*.dbx/*.DBX/*.dbt/*.DBT/

You can further tune samba by following this guide.

If you specify the Common Internet File System (CIFS) when you mount the samba share then you must specify the following options
mount -t cifs {mount-point} -o username=name,pass=pass,directio
The directio option is used to not do inode data caching on files opened on this mount. This precludes mmaping files on this mount. In some cases with fast networks and little or no caching benefits on the client (e.g. when the application is doing large sequential reads bigger than page size without rereading the same data) this can provide better performance than the default behavior which caches reads (readahead) and writes (writebehind) through the local Linux client pagecache if oplock (caching token) is granted and held. Note that direct allows write operations larger than page size to be sent to the server.

If you get the following error when trying to mount the {mount-point}
Apr 22 16:57:39 bailey kernel: Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
Apr 22 16:57:39 bailey kernel:  CIFS VFS: Send error in SessSetup = -13
Apr 22 16:57:39 bailey kernel:  CIFS VFS: cifs_mount failed w/return code = -13
The you need to create the Samba user specified on the mount command
smbpasswd -a username
FYI - Make sure you umount all the Samba {mount-point(s)} before shutting down Samba.
Published in Blogs

Copyright © 2019 Recital Software Inc.



User Registration
or Cancel