[Zope] Error with filenames during FTP

The Count the.count at count0.dyndns.org
Tue Sep 21 08:07:24 EDT 2004


On Tue, 21 Sep 2004 09:50:17 +0100, John Poltorak <jp at warpix.org> wrote:
>> >> Either avoid names with characters not allowed in Zope ids
>> >> or relax the Zope id restriction.
>> >
>> >I'm attempting to import a FrontPage-built website into Zope and would
>> >prefer to make as few changes as possible.
>> >
>> >I can't see anything about 'relaxing Zope id restriction'. Any hints 
>> about
>> >where I should look?
>>
>> What characters are allowed in ids is controlled by
>> the "bad_id" regular expression in "OFS.ObjectManager".
>>
>> Be careful, when you allow characters that are not allowed
>> in URL path segments (such as e.g. "?").
>> If you do this, you must ensure that URLs build by Zope
>> are properly url-quoted.
>
> I changed ObjectManager by adding a '%' to the list. Now the previous
> error msg disappears, but there doesn't appear to be any sign of the
> uploaded file.

Because it contains a character used in URLs to denote the beginning of a 
QUERY_STRING.
The purpose of such a QUERY_STRING is to enable the page to dynamically 
modify it's displayed content.
Only solution I think would be practicable without the stuff I'll talk 
about below is to
change every occurence of "?" (in filenames) to "_" and to copy that in 
every existing link.
Then you can have Zope serve these static pages ... but then again this is 
a waste of power,
why use a dynamic server enviroment to serve static content?

> I think I'll give up on this and look at changing the
> filenames before uploading them,

Which is probably the best overall approach.

> but this means that I need to change some
> of the web pages which explicitly reference pages such as
> content.asp?content_category_id=3.

Well, shouldn't the logic used in ASP be contained in the content.asp 
source?
Use the source, Luke!
As I gather you are currently using an offline copy of the page already 
rendered,
of course you'll find a lot of "independent" pages using the same URL ... 
but with a different QUERY_STRING.
IMHO you should try to use the same base pages acting out the QUERY_STRING 
settings just like the ASP site did.
I don't use ASP if I can help it but it works like PHP or DTML ... just 
translate the ASP stuff :)

> Is there a Howto anywhere which suggests ways of incorporating a
> FrontPage-built website into Zope?

I don't know of any, but if you know what happens in the page you should 
be able to construct the same logic in DTML.
For example your content.asp page seems to display different stuff for 
each acceptable value of "content_category_id".
In DTML (though everybody seems to use ZPT nowadays) this would be 
something like
[...]
<dtml-if content_category_id>
<dtml-if "content_category_id=='1'">
<dtml-var cci1>
<dtml-elif "content_category_id=='2'">
<dtml-var cci2>
<dtml-elif "content_category_id=='3'">
<dtml-var cci3>
</dtml-if>
<dtml-else>
This is the <i>normal</i> view.
</dtml-if>
[...]
and if you create Z-Objects "cci1" to "cci3" (say as "DTML Document") you 
can have all alternative content in their own respective container.

Hope that helps.

-- 
---
The Count



More information about the Zope mailing list