Summary: Cannot access new External Methods, olds ones OK. (Zope 2.5.1 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Problem: I have tried correlating this any way I can, but it still doesn't make sense. I can redefine the old methods to use new functions. I can create and test new External Methods. What I can't do is call any methods from DTML using newly created ExternalMethods. This generates a name error. There is only one user to the system (me) and no changes that I know of have been made to any security aspects. Other: So fundamentally, even though the External Method is created OK (the process says everything went fine), it doesn't make it to a point that DTML will recognize it. I can point the old ones (ExternalMethods) to any function I want and they will work. The only thing (more likely a red herring) I can think of that happened was adding the XML module (the images are missing in the docs, btw). Other than that, can't think of anything that changed. I re-read the docs and hunted around the Web and haven't found a solution there yet. I tried comparing all the properties and anything else I could find between the old and new ones. Didn't find anything. I have tried shutting down and restarting the server and even the PC. Any help as to how to go about getting new methods accepted are appreciated. (pls reply to this address is needed as I am not on any mailing list). Thanks. __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
Richard Deeley writes:
Summary: Cannot access new External Methods, olds ones OK.
(Zope 2.5.1 (binary release, python 2.1, win32-x86), python 2.1.3, win32)
... I can redefine the old methods to use new functions. I can create and test new External Methods. What I can't do is call any methods from DTML using newly created ExternalMethods. This generates a name error. Thus, you can create the External Method, manage it, call its "Test" tab but you cannot use it from DTML. When you try, you get a "Error type: NameError; Error value: your_External_Method", right?
Are you sure, the DTML object is called correctly (its two positional arguments passed correctly)? Did you check the External Method's "Permission" tab? Sometimes, magic resets some permissions and Zope sometimes maps "Unauthorized" to "AttributeError". Dieter
--- Dieter Maurer <dieter@handshake.de> wrote:
Richard Deeley writes:
Summary: Cannot access new External Methods, olds ones OK.
(Zope 2.5.1 (binary release, python 2.1, win32-x86), python 2.1.3, win32)
... I can redefine the old methods to use new functions. I can create and test new External Methods. What I can't do is call any methods from DTML using newly created ExternalMethods. This generates a name error. Thus, you can create the External Method, manage it, call its "Test" tab but you cannot use it from DTML. When you try, you
Right.
get a "Error type: NameError; Error value: your_External_Method", right?
Yes.
Are you sure, the DTML object is called correctly (its two positional arguments passed correctly)?
Pretty sure. In debugging, I cloned an existing function and dtml call and simply changed its name by one character in both cases to try to eliminate errors here.
Did you check the External Method's "Permission" tab? Sometimes, magic resets some permissions and Zope sometimes maps "Unauthorized" to "AttributeError".
OK. But I see Security and Owner (me) tabs. All the security boxes are set to 'Aquire' (ie unchanged). The error I get is: Error Type: NameError Error Value: global name 'searchReplaceStr3' is not defined Is there an easy way to get the status of the internals of Zope in a limited manner ? ie is there a way of dumping relevant parts to text that contains enough information to be useful without being overwhelming ? Regarding Permission tab: Don't see one of those. Are you refering to Security or is there another tab I ought to see (or another access method I need). Just for something to try, I ticked all the boxes under Manager and Owner for both the DTML and the ExternalMethod and tried again. Same result. The disconnect appears to be in the calling of the method. Which I would guess means either: it cannot resolve the new function look up. Or it is denying access to it. I guess I could go though the python trace and find out but that would be the hard way to go, I would think. It would also have to wait a while - I just cleaned out 200' of a neighbors drainage ditch this morning and with all the dust/pollen etc, the screen looks distinctly fuzzy. Any ideas who to narrow in on the problem or things to try would be appreciated and I have have another bash at it when I can. Thanks.
Dieter
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
Got it... After reinstalling the whole thing on another machine, I still could not get ExternalMethods to work. I also found a discrepancy on the help pages. On the searchReplaceStr example there is no 'self' parameter. On the main page, seems to suggest there really ought to be one. So this is confusing. But I digress. There appears to be an 8 character limit issue floating around. Methods will work fine as far as I can tell if (and only if) the ID is kept to less than 8 characters. The function name, I think can be longer, as the original example is searchReplaceStr and I got that to work on one occaision. (This is Win98SE os, btw). Once you get a long ID in there, things get messy. I tried to redefine one back to normality by adding in a new method using a shorter ID. But no luck there. I think that function name is now toast for eternity. Is there a rule that IDs must be less than 8 characters ? (wasn't in the section on ExternalMethods, but possibly it is documented elsewhere as a generic rule). (ie is this all my fault for missing it in the manual) Any clarifications appreciated. Thanks. --- Dieter Maurer <dieter@handshake.de> wrote:
Richard Deeley writes:
Summary: Cannot access new External Methods, olds ones OK.
(Zope 2.5.1 (binary release, python 2.1, win32-x86), python 2.1.3, win32)
... I can redefine the old methods to use new functions. I can create and test new External Methods. What I can't do is call any methods from DTML using newly created ExternalMethods. This generates a name error. Thus, you can create the External Method, manage it, call its "Test" tab but you cannot use it from DTML. When you try, you get a "Error type: NameError; Error value: your_External_Method", right?
Are you sure, the DTML object is called correctly (its two positional arguments passed correctly)?
Did you check the External Method's "Permission" tab? Sometimes, magic resets some permissions and Zope sometimes maps "Unauthorized" to "AttributeError".
Dieter
__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
--- Dieter Maurer <dieter@handshake.de> wrote:
Richard Deeley writes:
But I digress. There appears to be an 8 character limit issue floating around. You are almost surely on the wrong way...
I never met an 8 character limit in Zope.
You are right. I just ran through the same experiment (but with new names, other than that nothing changed) and it seemed happy with longer names today. My procedure for checking this stuff was to write one routine then clone it with new names, add the ExternalMethod and change the call in the DTML. ie a pretty systematic approach. Things started working again when the size was less than 8. I did two more checks after this to make sure that this was the common theme (it seemed pretty unlikely to me at the time, but I really could not see any reason for why any of these were not being handled correctly. To put it mildly it was driving me nuts, because each step I checked was identical as far as I could tell. Yet it would persistently refuse to accept any new ExternalMethods. Initially I went through dozens of attempts in between shutdowns, reboots etc. without making any headway at all. The most bizarre of all was installing the entire thing on a new machine and going through the searchReplaceStr tutorial step by step and running into the same problem. This was particularly odd as I had run this exact same thing before. Except that is, that the first time through, I had shortened some stuff to save extra typing) But, looks as though that was simply coincidence. I guess I don't know why trialLong failed to be accepted and trialLon worked just fine (for example). They were defined and added in exactly the same manner, so I think pilot error is probably not the cause here. Don't think there is any more I can add here, alas. For now, I can get some stuff done. Some concerns that this might come back again, but will deal with that when it happens. Thanks for the responses though. I think we can close this one unless there are any new ideas on this.
Dieter
__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
participants (2)
-
Dieter Maurer -
Richard Deeley