Dear All, I'm an information designer, and have been working with our programmer on a project. The url is: http://d029.ml.uwcm.ac.uk:8080/imi_test zClasses and forms have been set up to allow contributors to upload information regarding books, journals, etc, which belong to them. This information should then appear in the relevant area. To upload their information, users navigate to their folders, eg. http://d029.ml.uwcm.ac.uk:8080/imi_test/browse_by_contributor/example/book or http://d029.ml.uwcm.ac.uk:8080/imi_test/browse_by_contributor/example2/book and upload their material using the 'Add book' link/form. (username/password for 'example' is example/example, and username/password for 'example2' is example2/example2. Problem in short: information regarding a book which is uploaded into "example's" book section is also appearing in "example2's" book section. The resulting 'book' object is being added to the correct folder, and the zCatalog seems to be picking up the right metadata - except for the 'owner'. (See screengrabs at http://d029.ml.uwcm.ac.uk:8080/imi_test/screengrab). We don't think the 'owner' is getting set using the following code *, which is from the zc_book_add (zc_book constructor): * <html> <head><title>Add zc_book</title></head> <body bgcolor="#FFFFFF" link="#000099" vlink="#555555"> <dtml-call "REQUEST.set('Owner',AUTHENTICATED_USER.getUserName())"> <dtml-with "zc_book.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "REQUEST.set('prop',propertysheets.get('book_properties'))"> <dtml-call "prop.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> <dtml-if DestinationURL> <dtml-call "RESPONSE.redirect(DestinationURL+'/manage_workspace')"> <dtml-else> <dtml-call "RESPONSE.redirect(URL2+'/manage_workspace')"> </dtml-if> </body></html> Roles: 'example' has a local manager role set in the base 'example' folder. 'example2' also has a local manager role in the 'example2' folder. Both of these have been added into an acl_users folder in the root of the site. Am suitably stumped, and would be very grateful for any pointers. tia, Dave. David Smithson Information Designer Media Resources Centre University of Wales College of Medicine Cardiff UK
Dave Smithson writes:
... Owner not indexed ... <dtml-call "REQUEST.set('Owner',AUTHENTICATED_USER.getUserName())"> <dtml-with "zc_book.createInObjectManager(REQUEST['id'], REQUEST)">
<dtml-call "REQUEST.set('prop',propertysheets.get('book_properties'))"> <dtml-call "prop.manage_editProperties(REQUEST)"> <dtml-call reindex_object> How is this supposed to work?
Does your ZClass have a property "Owner"? Dieter
Dieter, Jerome et al, thanks very much for your replies. The darkness surrounding my errant Ownership has not, however, abated...
Dave Smithson writes:
... Owner not indexed ... <dtml-call "REQUEST.set('Owner',AUTHENTICATED_USER.getUserName())"> <dtml-with "zc_book.createInObjectManager(REQUEST['id'], REQUEST)">
<dtml-call "REQUEST.set('prop',propertysheets.get('book_properties'))"> <dtml-call "prop.manage_editProperties(REQUEST)"> <dtml-call reindex_object>
Dieter writes:
How is this supposed to work? Does your ZClass have a property "Owner"?
The basic idea is that 'example', who will a person, has rights to upload information concerning books, journals or miscellaneous items. If they have a book that they want to upload, they navigate to their 'book' folder * and add a book using the form. This information is then processed using the ZClass 'book', and the results displayed in 'example's' book area. * eg. http://d029.ml.uwcm.ac.uk:8080/imi_test/browse_by_contributor/example/book As far as roles go: both 'example' and 'example2' have local managerial rights to their respective folders. The idea is that, after 'example' has logged on and uploaded an item through the form, the Owner is set automatically (through the login), and the book just uploaded by 'example' knows to be shown only in 'example's' folder. The ZClasses ('book', 'journal', etc.) hadn't had a property of 'Owner'. I have added one (as a string), and 'Owner' is now appearing in the metadata and index of the Catalog. However, a book uploaded into 'example' is still appearing in 'example2' as well. Screengrabs of 'book_properties', and of Catalog's updated metadata for a book uploaded into 'example' are located here: http://d029.ml.uwcm.ac.uk:8080/imi_test/screengrab I'm sorry to be speaking pidgin programming here - I'm not sure if I'm giving people enough to work on, or whether it's like a kid walking up to a ship and asking 'How does that work?'. If it's the latter, I'll understand. Cheers for now - any help at all would very gratefully received indeed. Dave. David Smithson Information Designer Media Resources Centre University of Wales College of Medicine Cardiff UK
Dave Smithson writes:
.... As far as roles go: both 'example' and 'example2' have local managerial rights to their respective folders. The idea is that, after 'example' has logged on and uploaded an item through the form, the Owner is set automatically (through the login), and the book just uploaded by 'example' knows to be shown only in 'example's' folder. How?
The ZClasses ('book', 'journal', etc.) hadn't had a property of 'Owner'. I have added one (as a string), and 'Owner' is now appearing in the metadata and index of the Catalog. However, a book uploaded into 'example' is still appearing in 'example2' as well. Hmm... "example" and "example2" are standard folders?
Hopefully not, as you would then have discovered a really serious problem. What are they: topics? for what query? Dieter
Thanks very much indeed for the help so far.
What are they: topics? for what query? I'm sorry, but I don't understand this question. :-(
Dieter wrote:
Hmm... "example" and "example2" are standard folders? Yes they are. I have made screengrabs of the site hierarchy, and the contents of 'example' and 'example2' at:
http://d029.ml.uwcm.ac.uk:8080/imi_test/screengrab Hm. I fear that the Catalog issue is a red herring. The line marked ** in the following code, which is the 'zc_book_add' is, apparently, the problem: <html> <head><title>Add zc_book</title></head> <body bgcolor="#FFFFFF" link="#000099" vlink="#555555"> ** <dtml-call "REQUEST.set('Owner',AUTHENTICATED_USER.getUserName())"> ** <dtml-with "zc_book.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "REQUEST.set('prop',propertysheets.get('book_properties'))"> <dtml-call "prop.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> <dtml-if DestinationURL> <dtml-call "RESPONSE.redirect(DestinationURL+'/manage_workspace')"> <dtml-else> <dtml-call "RESPONSE.redirect(URL2+'/manage_workspace')"> </dtml-if> </body></html> The line <dtml-call "REQUEST.set('Owner',AUTHENTICATED_USER.getUserName())"> should return the username of the authenticated user - but, for some reason, the owner field in the request isn't being set - and hence information uploaded into 'example/book' is also seen in 'example2/book'. I don't know if I'm describing the right problems here. I've added a 'showuser' on the pages, which I think might clarify things a little. Yours in self-doubt, Cheers, Dave. David Smithson Information Designer Media Resources Centre University of Wales College of Medicine Cardiff UK
Dave Smithson writes:
Dieter wrote:
Hmm... "example" and "example2" are standard folders? Yes they are. I have made screengrabs of the site hierarchy, and the contents of 'example' and 'example2' at: And you are sure, that content placed into "example" is seen in "example2", too -- when you view "example2", e.g. through the Management Interface?
That would be really strange! If the Management Interface does not see them there, you do you see them there?
Hm. I fear that the Catalog issue is a red herring. The line marked ** in the following code, which is the 'zc_book_add' is, apparently, the problem:
<html> <head><title>Add zc_book</title></head> <body bgcolor="#FFFFFF" link="#000099" vlink="#555555">
** <dtml-call "REQUEST.set('Owner',AUTHENTICATED_USER.getUserName())"> ** This must be completely innocious!
It simply sets "Owner" in "REQUEST" and your "manage_editProperties" below puts the value into the property. I do not see a reason why it should show up in "example2". But, I am sure, I do not understand something essential in your setup: e.g. where the ZCatalog comes in.
.... The line <dtml-call "REQUEST.set('Owner',AUTHENTICATED_USER.getUserName())"> should return the username of the authenticated user - but, for some reason, the owner field in the request isn't being set - and hence information uploaded into I am sure, it is. 'example/book' is also seen in 'example2/book'. I don't know if I'm describing the right problems here. Please explain the "hence".
I may then understand the relation between "Owner" and "seen in "example2". Dieter
participants (2)
-
Dave Smithson -
Dieter Maurer