Updated: 8/1/2004; 7:37:56 AM.
Bruce Landon's Weblog for Students
My Home Page Psych100 Psych200 Psych360 Psych330 EduTools News Landonline
        

Tuesday, July 13, 2004

LWN: Oracle patents content management systems. [Scripting News]
10:51:47 PM      Google It!.

Progeny Releases Beta 1 of Progeny Debian [Slashdot] his is intended to be a showcase of our Componentized Linux project for building customized Linux distributions,
10:41:25 PM      Google It!.

PHP 5 Released; PHP Compiler, Too [Slashdot]
10:40:08 PM      Google It!.

Japanese Schoolchildren to be Tagged with RFID [Slashdot]
10:29:37 PM      Google It!.

Google Buys an Online Photo Manager. Google bought Picasa Inc., a company that makes technology to help consumers organize and display photos online. [The New York Times > Technology]
10:27:46 PM      Google It!.

Major gift supports OA at Harvard. Harvard has received a $5 million gift to support its Open Collections Program, whose mission is to digitize and provide open access to material from the Harvard libraries. The donors are Lisbet Rausing and Peter Baldwin, both historians and both Harvard alums. Quoting Harvard president Lawrence Summers: "Intellectually curious people from every corner of the globe will have free access to such information, for the benefit of their studies, their interests, and their work." For more details, see the press release. [Open Access News]
10:00:00 AM      Google It!.

Geolocation: Don't Fence Web In. As geolocation -- technology that can track the location of computers surfing the Internet -- improves, corporations and governments are increasingly able to limit what people can view on the Web. [Wired News]
9:27:38 AM      Google It!.

Gush 1.1 RC 1 and Linux Debut. We are happy to announce our newly added support for Linux! Gush now leaves no OS behind. Release candidate 1 sports a few new features, interface improvements, as well as serious improvements under the hood. We've worked hard to improve Gush's memory usage and stability and to provide new additions like the new photoblog friendly image browser. Please refer to the changelog for details. This release is for all platforms and users can now expect synchronized releases from here on out.

As always, get help or leave some suggestions by messaging our support account: bugreports@2entwine.net By Wes. [Gush Blog]
9:22:51 AM      Google It!.

Fair use and academic publishing. The Chronicle of Higher Education will host an online colloquy on Fair Use and Academic Publishing tomorrow, July 14, at 1:00 pm Eastern time. The guest expert will be Wendy Seltzer, an attorney for the Electronic Frontier Foundation and fellow at Harvard's Berkman Center for Internet and Society. Seltzer will answer questions about fair use from members of the public. Participants can wait until tomorrow at 1:00 or submit their questions in advance. Afterwards the Chronicle will post an OA transcript of the colloquy. [Open Access News]
9:19:30 AM      Google It!.

File-Sharing Thrives as Net Users Find New Outlets. LONDON (Reuters) - Internet users download twice as many films, games and music as they did a year ago, despite a big crackdown on the activity, according to a study on Tuesday. [Reuters: Technology]
9:16:29 AM      Google It!.

Mozilla Developers Respond to Malware [Slashdot]
9:15:07 AM      Google It!.

Network Solutions Overhauls Whois Results [Slashdot]
12:05:05 AM      Google It!.

Scripting LDAP with Jython -- Queries.

I've been playing with LDAP directories from Jython and thought I should share a couple of useful examples of what you can do. The first of these is a quick barebones query example. Enjoy.

# Jython LDAP Example

from javax.naming import * from java.util import * from javax.naming.directory import *

# Credentials to access LDAP user = "cn=master" passwd = "password"

# Query starting point and query target search_start = "ou=People,dc=Company,dc=com" search_target = "uid=aUserID"

# Setup LDAP Context Options settings = Hashtable() settings.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory") settings.put(Context.PROVIDER_URL, "ldap://localhost:389") settings.put(Context.SECURITY_PRINCIPAL, user) settings.put(Context.SECURITY_CREDENTIALS, passwd)

# Connect to LDAP Server ctx = InitialDirContext(settings)

srch = SearchControls() srch.setSearchScope(SearchControls.SUBTREE_SCOPE)

# Execute LDAP Search results = ctx.search(search_start, search_target, srch )

#Display Search` for result in results:

attributes = result.getAttributes() names = [] for atr in attributes.getIDs(): names.append(str(atr))

for name in names: print attributes.get(name)

[All things Jythonic]
12:03:30 AM      Google It!.

Scripting LDAP with Jython -- Load Java Objects from LDAP.

A common way to store user preference data for applications is to store them in LDAP as a serialized Java Hastable object. The application then reads that back from ldap on startup using the authenticated userid as the key. Its a convenient way to store application settings. But what if you need to adjust or migrate settings from one place to the other? Here is an approach to reading that data out using Jython. Look for a future post about how to save it back using the context's bind method ...

# Jython LDAP - Retrieve Stored Object from LDAP Example

from javax.naming import * from java.util import * from javax.naming.directory import *

# Credentials to access LDAP user = "cn=master" passwd = "password"

# Setup LDAP Context Options settings = Hashtable() settings.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory") settings.put(Context.PROVIDER_URL, "ldap://localhost:389") settings.put(Context.SECURITY_PRINCIPAL, user) settings.put(Context.SECURITY_CREDENTIALS, passwd)

# Connect to LDAP Server ctx = InitialDirContext(settings)

# load the java Hashtable out of the ldap server prefs = ctx.lookup("cn=ccm_root,ou=Preferences,dc=Company,dc=com")

for pref in prefs.keys(): print "PREF: %s\n VALUE: %s " % (pref, prefs[pref])

[All things Jythonic]
12:03:08 AM      Google It!.

Scripting LDAP with Jython -- Store Java Objects in LDAP.

This is the complement to the earlier example that read a java Hastable out of an ldap directory entry. Here is how you get the data in there to begin with.

# Jython LDAP - Store Java Hashtable into LDAP Example

from javax.naming import * from java.util import * from javax.naming.directory import *

# Credentials to access LDAP user = "cn=master" passwd = "password"

# Setup LDAP Context Options settings = Hashtable() settings.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory") settings.put(Context.PROVIDER_URL, "ldap://localhost:389") settings.put(Context.SECURITY_PRINCIPAL, user) settings.put(Context.SECURITY_CREDENTIALS, passwd)

# Connect to LDAP Server ctx = InitialDirContext(settings)

# build Hastable we want to store userPrefs = Hashtable() userPrefs.put("Server", "Someserver.com") userPrefs.put("Color", "Red") userPrefs.put("Wine", "Cabernet") userPrefs.put("Year", "1994")

ctx.bind("cn=test_user,ou=Preferences,dc=Company,dc=com", userPrefs)

#done

If the entry already exists you need to use the context's rebind method like this:

ctx.rebind("cn=test_user,ou=Preferences,dc=Company,dc=com", userPrefs)
[All things Jythonic]
12:02:18 AM      Google It!.

© Copyright 2004 Bruce Landon.
July 2004
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Jun   Aug
Home

Subscribe to "Bruce Landon's Weblog for Students" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.