|
|
index_html issue / Cyrus Karbassiyoon <ckarbass@vt.edu>
index_html issue
Cyrus Karbassiyoon <ckarbass(at)vt.edu> |
2005-07-28 08:56:37 |
[
FULL ]
|
I have created an "author" role. When a user is assigned the author role for
an arbitrary folder, the user can then copy/paste any document in the folder
(amongst other things). Well, almost any file. When the user tries to copy
the index_html document and paste the copy back to the same folder (or any
subfolder), the operation fails: Paste could not find clipboard content.
All thought all documents were created equal? Am I missing something?
Plone Version 2.0.2
Zope Version (unreleased version, python 2.3.3, win32)
Python Version 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)]
System Platform win32
Thanks for any help,
Cyrus
|
Re: [ZPUGDC] index_html issue / jamesr <circlecycle@gmail.com>
Re: [ZPUGDC] index_html issue
jamesr <circlecycle(at)gmail.com> |
2005-07-28 15:31:12 |
[
FULL ]
|
index_html is a special case.. it's always renamed to
copy_of_index_html when pasted (check me on this guys) which means, i
deduce, that the 'author' role might need the 'rename files' (or
whatever that is) as well. If you've locked security down really tight,
then you might need to give author that one extra security setting -- i
would imagine that with a normal profile that wouldn't be a problem.
off the cuff,
james.
On Jul 28, 2005, at 9:58 AM, Cyrus Karbassiyoon wrote:
[...]
|
Re: [ZPUGDC] index_html issue / Joel Burton <joel@joelburton.com>
Re: [ZPUGDC] index_html issue
Joel Burton <joel(at)joelburton.com> |
2005-07-29 12:05:02 |
[
FULL ]
|
On Thursday 28 July 2005 1:33 pm, jamesr wrote:[...]
[...]
Uh, no, that's not true. 'index_html' isn't really a special case, nor is this
a question of renaming permissions--the object isn't really renamed.
Instead, whenever you paste an object that can already be found in/on the
folder, you get the "copy_of" -- and, since all folders implement a method
called "index_html", it's *always* found on the folder. So, the handling of
index_html in the pasting isn't unusual--the unusual thing is that you're
creating an object whose id is the same as a method on the folder.
Anyhoo, if you look at the code, you can see that the module that Zope uses to
handle cut/paste is called CopySupport. It has a method, _get_id, which looks
at the id of the item being pasted, and, if it can find something with that
existing ID (including finding methods on the folder, like index_html), it
will prepend the copy_of to the front.
If you want to change that behavior so that your folder's allow you to
directly paste index_html, add this method to your folderish objects (if
these are a custom Folderish Archetype, add this there), if these are
standard Plone folders, you can monkeypatch this to Plone's standard folder:
def _get_id(self, id):
if id == 'index_html': return id
else:
return OFS.CopySupport.CopyContainer._get_id(self, id)
An easier way to handle your problem Cyrus, and usually easier to explain to
users, is to *not* have them create/work with documents called "index_html".
Instead, let them call their index pages whatever they want--and use the
"Create Default Document" feature of Plone to set their index page. Then,
they don't have to create special names, and you don't have to patch folder
code.
I think the whole 'index_html' is a developer-facing convention: we can create
scripts and page templates and such called index_html when we want to
influence the appearance of a folder, but for ordinary users, having them get
to choose the default page via the UI (rather than by remembering and usuing
an obscure name) is much nicer.
HTH,
- j.
|
Re: [ZPUGDC] index_html issue / jonah@newuses4.info
Re: [ZPUGDC] index_html issue
jonah(at)newuses4.info |
2005-07-30 11:19:31 |
[
FULL ]
|
Got a sweet contract for us doing business intel. More soon. Demolition is
stablizing. On my way out of Wyoming now.
Hope you are well,
Jonah
[...][...][...]
|
Re: [ZPUGDC] index_html issue / jonah@newuses4.info
Re: [ZPUGDC] index_html issue
jonah(at)newuses4.info |
2005-07-30 11:19:35 |
[
FULL ]
|
Got a sweet contract for us doing business intel. More soon. Demolition is
stablizing. On my way out of Wyoming now.
Hope you are well,
Jonah
[...][...][...]
|
|