Notes on Java, Solaris, PHP, LDAP…

December 10, 2008

Single sign-on and guest access to Adobe Connect

Filed under: Java — negev @ 1:04 pm
Tags: , ,

I’ve made our Adobe Connect service single sign-on for our employees and nicely work for our guests – all behind Novell iChain accelerator. It was a pain in the neck to make them work together. A lot of weird HTTP header and URI issues. Even though Adobe Connect offers a nice API to manage meetings, log in users and guests, it’s really proxy-unfriendly.

Some of my troubles and the solution are at http://www.connectusers.com/forums/cucbb/viewtopic.php?id=1496

Advertisements

November 13, 2008

Transparent images for IE 6

Filed under: Java — negev @ 5:05 pm
Tags:

Heh. It turns out that Microsoft Internet Explorer 6 doesn’t like transparent PNGs. When you use them, the IE ignores their transparency. So I use transparent GIFs instead.

September 11, 2008

Generating Unicode email via mailto: link in Javascript

Filed under: Java — negev @ 11:28 am
Tags:

I wanted to generate mailto: link with a subject and body which contained Unicode characters. As an example for Unicode letters I was getting following from a PHP form. The application workflow required that I process any transformation in Javascript rather than on server.
%uB9E4%uB274%uC5BC

That stands for nice Korean 매뉴얼:
javascript:alert( unescape(‘%uB9E4%uB274%uC5BC’) )

which in HTML Unicode escapes is (following without spaces, otherwise WordPress shows them as Korean letters):
& #xB9E4;& #xB274;& #xC5BC;

javascript:alert( ‘%EB%A7%A4%EB%89%B4%EC%96%BC’ )
-> same Korean letters

javascript:alert( escape(‘%EB%A7%A4%EB%89%B4%EC%96%BC’ ) )
-> %uB9E4%uB274%uC5BC

javascript:alert( encodeURI(‘매뉴얼’ ) )
-> %EB%A7%A4%EB%89%B4%EC%96%BC

So my final transformation was:
var encodedSubject= encodeURI( unescape( ‘%uB9E4%uB274%uC5BC’) );
var encodedBody= encodeURI( unescape( ‘%uB9E4%uB274%uC5BC Lala lala’) );
javascript:window.location.href= ‘mailto:?subject=’ +encodedSubject;+ ‘&body=’ +encodedBody;
————————————————————–

I’ve also tried following to  generate HTML escapes of Unicode characters, but it doesn’t work for URLs:

function url_encoded_unicode_to_html( url ) {
var regex_search= new RegExp( “%u([0-9a-fA-F]{4,4})”, “g” );
var regex_replace= ‘&#x$1;’;

return url.replace( regex_search, regex_replace ); //( ‘/%u([0-9a-fA-F]{4,4})/’, ‘&#x$1;’, $text );
}

Unicode emails via PHPMailer

Filed under: Java — negev @ 10:58 am
Tags: ,

My web app has a form and then it sends emails via PHPMailer. But it didn’t work for Unicode messages.

I added accept-charset=”utf-8″ to the <form> tag. Then I changed $CharSet setting from default ‘iso-8859-1’ to ‘utf-8’. That worked for Unicode email body, but not for Unicode subject. In order to get Unicode subjects work I had to update PHPMailer to version 2.0.2.

var $CharSet           = ‘utf-8′; //’iso-8859-1’;
var $ContentType        = ‘text/plain’;
var $Encoding          = ‘8bit’;

August 22, 2008

Limitation of CN length in eDirectory

Filed under: Java — negev @ 8:42 am
Tags: ,

Novell’s eDirectory has limitation of CN length to 64 characters. That is enough for common objects.

However, in my application I auto-generated CN out of some long string. I wanted management groups for user containers of a deep tree (5 levels e.g. ou=Happy Branch,ou=Berline,ou=DE,ou=Europe,o=Company). For some practical and user’s reasons I didn’t want to copy the container tree structure, so I created objects at the same level with CN made out in reverse – e.g. Europe-DE-Berlin-Happy Branch. But for some groups their CN got over 64 letters, and that failed. So I created region containers for them and then I created the groups under those region containers, with CN e.g. DE-Berlin-Happy Branch. Problem solved!

August 21, 2008

Weird Flex states

Filed under: Java — negev @ 6:06 pm
Tags:

I had a weird experience with Flex states in Flex 2.0.1. My component had an initialization function. That set currentState to one of two values depending on something. Later on in the same function it checked for a few rare situations, and if any of those occurred then it set currentState to some special values.

Somehow Flex or Flash player didn’t like that and it rendered the 2nd (special/rare) state on top of the 1st state. Solution: instead of setting currentState directly, set some temp variable e.g. state:String. Then once state doesn’t change assign it to currentState. Note that you can’t use any GUI objects specific to that state before you switch to it.

August 20, 2008

File upload problems in Safari

Filed under: Java — negev @ 1:11 pm
Tags: ,

I had a weird problem: a simple HTML form with a file upload input, processed by PHP. It worked in Firefox but in Safari the uploaded file (small size) didn’t make it to the server about half the times. Not even a first line of PHP was invoked.

It’s a known issue. Solution – an extra header. See http://www.webmasterworld.com/macintosh_webmaster/3300569.htm

Searching for RPM packages?

Filed under: Java — negev @ 1:09 pm
Tags:

Searching for RPM packages? Just type package name at rpmseek.com and it lists them by Linux distributions.

July 17, 2008

Never call your HTML elements ‘content’

Filed under: Java — negev @ 11:25 am
Tags:

I’ve created a simple HTML form with basic Javascript validation of the fields. The form would send an email via the server, so it had a textarea which I called ‘content’ – both name=”content” and id=”content”.

However, it turns out that Javascript (Firefox, Safari) can’t retrieve such an element by document.getElementById( ‘content’ ).  It looks that ‘content’ is special/reserved. Once I changed it to ‘message’ then all worked fine.

June 27, 2008

Virtual hosts on SUSE

Filed under: Java — negev @ 7:45 pm
Tags: ,

When enabling the second vhosts in Apache2 <virtualHost *:80> on a SUSE server, apache restart gave me the following error:

“_default_ VirtualHost overlap on port 80, the first has precedence”

Solution: in /etc/apache2/listen.conf add or uncomment following line:
NameVirtualHost *:80

Next Page »

Create a free website or blog at WordPress.com.