Tip: Bulk-Loading Photos into eDirectory
Novell Cool Solutions: Tip
|
Digg This -
Slashdot This
Posted: 23 Feb 2005 |
Here's a tip from Cool Solutions reader Eric Belcher that helps you solve a number of problems associated with adding photos to eDirectory, via eGuide.
Novell TID 10062804 details how to setup NDS and eGuide to use photos. However, adding photos one at a time to eGuide causes a copy of the graphic to be copied to the Tomcat directory. For example, photos could be loaded from \\ebl-003\web3\photos\Staff\ in eGuide and be saved in \\ebl-003\SYS\tomcat\4\webapps\eGuide\Upload\photo\New_Data_Source. So the file 01501.jpg would be saved by eGuide as the filename cn=belce_ou=its_ou=eb_o=acgs.jpg in the Tomcat directory.
The location of the photo file can be found by checking the photo attribute in ConsoleOne under the Other tab.
Problems
This presented a number of problems for us:
- We have central repository for photos that we need to use.
- Saving photos under the Tomcat directory did not suit our cluster situation.
- Photo names names are dictated by the employee's payroll number or the student ID.
- Using the ICE import utility was not going to be pretty, given the requirements above.
Solution
These problems are easily solved - instead of using eGuide to load photos, we used the ICE LFID import to do bulk loads, and manual hex edits for single users. (Yes, the field has to be entered in hex!)
Sample LDIF File
dn: cn=user,ou=admin,ou=users,ou=eb,o=acgs changetype: modify replace: photo photo: https://web.acgs.qld.edu.au/photos/Staff/01966.jpg
The photos need to be available simply by putting the web address into a browser. If this works, eGuide will load the photo from the web address once the information has been ported into eDirectory.
Samples
Here is some sample data you can use to build your queries and import files.
Query
SELECT "UserNDS"."NDS_FullName", "UserNDS"."Given Name", "UserNDS"."CN",
"UserNDS"."NDS_Context", "UserNDS"."workforceID"
FROM "UserNDS" "UserNDS"
WHERE NOT ("UserNDS"."Given Name" LIKE 'Admin%'
OR "UserNDS"."Given Name" LIKE 'sn%')
AND "UserNDS"."NDS_Context" NOT LIKE 'its.eb.acgs%'
AND NOT ("UserNDS"."CN" LIKE 'Admin%'
OR "UserNDS"."CN" LIKE 'gwuser%'
OR "UserNDS"."CN" LIKE 'netback%'
OR "UserNDS"."CN" LIKE 'Slade%')
Query Generator
dn: {1@NDSFullFinal}
changetype: modify
replace: photo
photo: https://web.acgs.qld.edu.au/photos/Staff/{2workforceID}.jpg
Variables
NDSFull1 - "cn="+{UserNDS.NDS_FullName}
NDSFull2 - Replace ({@NDSFull1},".",",ou=")
NDSFullFinal - Replace ({@NDSFull2},"ou=myorg","o=myorg")
Crystal Report
To see a sample Crystal Report used to generate the list, click here. Below is a text version of a single entry from the Crystal Report:
dn: cn=andel,ou=admin,ou=myou,ou=mysite,o=myorg changetype: modify replace: photo photo: https://web.acgs.qld.edu.au/photos/Staff/01966.jpg
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

