Add Subjects of the Bookmarkfolder to all Links inside this folder

by Christian Ledermann last modified Dec 30, 2008 05:51 PM
A small script executed in the context of a bookmarkfolder will add the subjects of the folder to all link objects.

As tasty and ATBookmarks had a different approach to categorize the links it may become necessary to add subjects to all links in one folder as a 'batch job' to get the most 'tasty experience' out of your bookmark collection.

Create a python script called setLinkSubjects in your custom folder:

# Add to folder subjects to  Subjects of all contained Links 
kwds = ()
objects = context.objectValues('ATLink')
for object in objects:
kwds = object.Subject() + context.Subject()
subjects = {}
for subj in kwds:
subjects[subj] = None
kwds = subjects.keys()
kwds.sort()
object.setSubject(kwds)
print object.Subject()

return printed

Run the script by appending setLinkSubjects to your Bookmarkfolder URL and update your portal_catalog afterwards.