portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sami Leino" <sami.le...@netorek.fi>
Subject Re: YNT: DO NOT REPLY [Bug 19488] - compile error on BaseLDAPObject in Japanese enviroment
Date Thu, 01 May 2003 10:12:18 GMT
> I seen that createID function created by sami for finnish language
> support which include some unencoded characters. I think this function
> is unnecessary and can be removed. Because user must implement this
> functionality on business layer not on data layer like ldap.

I agree that the functionality should be implemented on business layer.
The problem is, however, that there's no such functionality there, since
the database security implementation does not need it. Jetspeed lets
database to create identifiers, but we cannot use LDAP in the same way.
Therefore, we must ensure that the unique identifiers assigned to LDAP
objects are valid, thus we must have a function that removes invalid
characters.

We could of course use Jetspeed's IDGenerator to generate IDs like
'P-f201787cfb-10004', but it would make browsing the LDAP tree impossible.
For example, I think we all agree that the following list of role
definitions

  uid=admin
  uid=user
  uid=guest

.... is more readable in LDAP directory than...

  uid=P-f201787cfb-10004
  uid=P-f201754345-10001
  uid=P-f203252535-10002

I think you get my point. Therefore, I suggest that the createID method
remains, but the characters from the source code will be escaped like
Shinsuke suggested. You can also remove the replace()-methods (which are
only there for converting common scandinavian letters to their
non-scandinavian equivalents) and write the method like this:

    public String createId(String value)
    {
        StringBuffer buf = new StringBuffer();

        for (int i=0; i < value.length(); i++)
        {
            char currentChar = value.charAt(i);

            if (isOK(currentChar))
            {
                buf.append(currentChar);
            }
            else
            {
                buf.append('X');
            }
        }

        return buf.toString();
    }

Regards,

Sami

-- 

Sami Leino
Software Developer, Netorek Oy, Turku, Finland
Email: sami@netorek.fi
Phone: +358 44 0140499



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message