Hi all, I have a method in acl_users called logout (which calls a py function in my product) and try to use the method from a doc that could be anywhere in the site. The error I get is: Error Type: Unauthorized Error Value: You are not allowed to access user_logout in this context The method logout : <dtml-call "user_logout"> <dtml-call "RESPONSE.redirect('/test_folder/logged_out')"> The call from another doc (could be anywhere) <a href="<dtml-var "acl_users.log_out.absolute_url()">" class="link">LOGOUT</a> I found some links on the zope site dealing with context switches but they werent very helpful. Primarily they said about being careful as to what object I put stuff in, I tried making the logout method a DTML doc with the same result. How do I get around this problem? TIA AM -- ================================================================== Aseem Mohanty Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231 ================================================================== "I saw `cout' being shifted "Hello world" times to the left and stopped right there!!" -- Steve Gonedes ==================================================================
Howdy again, (This is the reason for my question about a 'select all' button in the Catalog tab...) When importing a new version of a site to my live server, the catalog (there's only one in the site, default name, and it's in a subfolder, not in the root) double-indexes everything. That is, after import a catalog search returns two of everything found instead of just one; the catalog tab shows two of each item, and twice the number of expected total items. Import process is: * delete all ('old') objects in root folder * import 'new' site .zexp file, which comes in as a subfolder of root that contains all 'new' site objects * go to imported folder, select all ('new') objects and click 'Cut' * go to root folder and click 'Paste' * delete the (now empty) subfolder that resulted from the import Everything works fine after this except for the catalog... Anyone know why this catalog double-indexing happens in this case and/or how to avoid it? thanks, John S. __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
Are the paths that show up in the Catalog "Catalog" view of the duplicated objects the same as the paths of the non-duplicate objects? Are the objects smart enough to decatalog themselves on deletion (e.g. are they "CatalogAware" or "CatalogPathAware"?) John Schinnerer wrote:
Howdy again,
(This is the reason for my question about a 'select all' button in the Catalog tab...)
When importing a new version of a site to my live server, the catalog (there's only one in the site, default name, and it's in a subfolder, not in the root) double-indexes everything. That is, after import a catalog search returns two of everything found instead of just one; the catalog tab shows two of each item, and twice the number of expected total items.
Import process is: * delete all ('old') objects in root folder * import 'new' site .zexp file, which comes in as a subfolder of root that contains all 'new' site objects * go to imported folder, select all ('new') objects and click 'Cut' * go to root folder and click 'Paste' * delete the (now empty) subfolder that resulted from the import
Everything works fine after this except for the catalog... Anyone know why this catalog double-indexing happens in this case and/or how to avoid it?
thanks, John S.
__________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com "Killing hundreds of birds with thousands of stones"
I had the same problem. Only ofter deleting the catalog and recreating a new one I got rid of the dupplicates. I *think* the problem stems from the fact that the catalog indices have changed between 2.3 and 2.4 Robert ----- Original Message ----- From: "Chris McDonough" <chrism@zope.com> To: "John Schinnerer" <johnschinnerer@yahoo.com> Cc: "zope list" <zope@zope.org> Sent: Thursday, June 06, 2002 2:05 PM Subject: Re: [Zope] Catalog import duplicates entries...how to avoid?
Are the paths that show up in the Catalog "Catalog" view of the duplicated objects the same as the paths of the non-duplicate objects? Are the objects smart enough to decatalog themselves on deletion (e.g. are they "CatalogAware" or "CatalogPathAware"?)
John Schinnerer wrote:
Howdy again,
(This is the reason for my question about a 'select all' button in the Catalog tab...)
When importing a new version of a site to my live server, the catalog (there's only one in the site, default name, and it's in a subfolder, not in the root) double-indexes everything. That is, after import a catalog search returns two of everything found instead of just one; the catalog tab shows two of each item, and twice the number of expected total items.
Import process is: * delete all ('old') objects in root folder * import 'new' site .zexp file, which comes in as a subfolder of root that contains all 'new' site objects * go to imported folder, select all ('new') objects and click 'Cut' * go to root folder and click 'Paste' * delete the (now empty) subfolder that resulted from the import
Everything works fine after this except for the catalog... Anyone know why this catalog double-indexing happens in this case and/or how to avoid it?
thanks, John S.
__________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com "Killing hundreds of birds with thousands of stones"
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hello, The double-cataloging happens when I do the import of the folder containing the new site, after deleting the old objects. That is, if I go look at the catalog in the imported folder right after importing it, everything is already doubled (before the cut and paste into the root). --- Chris McDonough <chrism@zope.com> wrote:
Are the paths that show up in the Catalog "Catalog" view of the duplicated objects the same as the paths of the non-duplicate objects?
No - looks like each object is being 'found' twice, via a different path. One path starts from the root (and includes the imported folder); one starts from the imported folder - like this: /root/imported_folder/gallery/gallery_items/item123 ...and... /imported_folder/gallery/gallery_items/item123 Does that shed light?
Are the objects smart enough to decatalog themselves on deletion (e.g. are they "CatalogAware" or "CatalogPathAware"?)
They're built with ZClasses (never again! ;-) and use CatalogAware. I haven't deleted any objects so far, only added them. What I have been doing is deleting the records(?) in the catalog tab, via ZMI, to clear the duplicates...thus my question about a select all button on that form... thanks, John S. __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
This is due to CatalogAware's penchant for cataloging itself when an object that subclasses it is added to a place. A CatalogAware object defines a method named "manage_afterAdd" that finds a catalog and catalogs itself. Evidently this method is called at import time for each of your CatalogAware objects. So when you import the "temporary" container, the subobjects of the temporary container register themselves with the catalog. Then when you copy the container (or the container's subobjects), they register themselves again in the new place. You might try visiting the "temporary" container and doing "Select All" and delete to see if it clears up the duplicate entries before actually deleting the container. ----- Original Message ----- From: "John Schinnerer" <johnschinnerer@yahoo.com> To: "zope list" <zope@zope.org> Sent: Thursday, June 06, 2002 4:51 PM Subject: Re: [Zope] Catalog import duplicates entries - more info
Hello,
The double-cataloging happens when I do the import of the folder containing the new site, after deleting the old objects.
That is, if I go look at the catalog in the imported folder right after importing it, everything is already doubled (before the cut and paste into the root).
--- Chris McDonough <chrism@zope.com> wrote:
Are the paths that show up in the Catalog "Catalog" view of the duplicated objects the same as the paths of the non-duplicate objects?
No - looks like each object is being 'found' twice, via a different path. One path starts from the root (and includes the imported folder); one starts from the imported folder - like this:
/root/imported_folder/gallery/gallery_items/item123 ...and... /imported_folder/gallery/gallery_items/item123
Does that shed light?
Are the objects smart enough to decatalog themselves on deletion (e.g. are they "CatalogAware" or "CatalogPathAware"?)
They're built with ZClasses (never again! ;-) and use CatalogAware. I haven't deleted any objects so far, only added them.
What I have been doing is deleting the records(?) in the catalog tab, via ZMI, to clear the duplicates...thus my question about a select all button on that form...
thanks, John S.
__________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Howdy,
This is due to CatalogAware's penchant for cataloging itself when an object that subclasses it is added to a place.
A CatalogAware object defines a method named "manage_afterAdd" that finds a catalog and catalogs itself.
Evidently this method is called at import time for each of your CatalogAware objects. So when you import the "temporary" container, the subobjects of the temporary container register themselves with the catalog.
Makes sense, thanks - and seems like a CatalogAware bug vs. import/export functionality...and maybe vs. copy/cut/paste too.
Then when you copy the container (or the container's subobjects), they register themselves again in the new place.
Don't know if this happens - what I'm importing has each item correctly registered once; immediately after import, they're all registered twice. If they do it a third time when I cut/paste, I can't tell, because in my situation the path would be identical to one already cataloged; the total number of items in the Catalog is still only double, not triple.
You might try visiting the "temporary" container and doing "Select All" and delete to see if it clears up the duplicate entries before actually deleting the container.
I'm doing a cut/paste from the temporary container (not copy/paste), so however that works internally, the catalog and objects cataloged are no longer in the temp. container to visit... Larger question: if (no, *when* ;-) I rebuild my gallery objects using python products instead of ZClasses), how can I avoid this problem? And, how do I make the objects really catalog-smart, so they catalog themselves when created, recatalog themselves when edited, etc.? thanks, John S. __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
On Sat, 2002-06-08 at 14:14, John Schinnerer wrote:
Howdy, Makes sense, thanks - and seems like a CatalogAware bug vs. import/export functionality...and maybe vs. copy/cut/paste too.
Maybe.. To be honest, I think you'd need to look at the import/export and cut/paste code to see how it works. It's a very scary beast, and I'm not sure at all of the semantics of when things manage_afterAdd methods are called during an import nor duing a cut and paste. I usually just live with the results. ;-)
I'm doing a cut/paste from the temporary container (not copy/paste), so however that works internally, the catalog and objects cataloged are no longer in the temp. container to visit...
I see. Well, then this might be a problem of the cut and paste machinery not doing the right thing when the objects are moved. You would expect that each object's manage_beforeDelete in the old place would be called before being pasted into the new place, and that their manage_afterAdds would be called as they are pasted into the new place. The cut and paste code frightens me greatly, I try not to think about it. ;-)
Larger question: if (no, *when* ;-) I rebuild my gallery objects using python products instead of ZClasses), how can I avoid this problem?
If you want things to catalog themselves when you add them, manage_afterAdd is the most straightforward and "Zopish" way to do it. Other solutions are possible, but you'd need to play around.
And, how do I make the objects really catalog-smart, so they catalog themselves when created, recatalog themselves when edited, etc.?
Just call methods of the catalog manually. See CatalogAware/CatalogPathAware for ideas on how to do it. - C
participants (4)
-
Aseem Mohanty -
Chris McDonough -
John Schinnerer -
Robert Rottermann