[Zope-dev] SiteAccess Newbie

2001-02-09 Thread Erich Seifert

Hi,

I just implemented virtual hosting on our web server combining multiple virtual 
hosts and localization as described in the corresonding how-to. But it's very 
(very) slow. How can I speed it up?

Following the External Python Method I used for the Access Rule:

import string

def get_language(self, REQUEST):
  cookie = 'LANG'
  if self.REQUEST.cookies.has_key(cookie):
   lang = self.REQUEST.cookies[cookie]
  else:
   langs = string.split(self.REQUEST['HTTP_ACCEPT_LANGUAGE'], ',')
  for lang in langs:
   lang = string.strip(lang)
   if lang:
lang = string.split(lang, ';')[0]
break
  if not hasattr(self, lang):
   if string.find(lang,'-')=0:
lang = string.split(lang,'-')[0]
   if not hasattr(self, lang):
lang = 'de'
  return lang

def localize(self, REQUEST):
  sitemap  = { ... }
  hostname = 
string.join(string.split(string.lower(string.split(self.REQUEST['HTTP_HOST'], 
':')[0]), '.')[-4:], '.')
  lang = self.get_language(self.REQUEST)
  stack= self.REQUEST['TraversalRequestNameStack']

  if stack and stack[-1]=='Z':
   stack.pop()
   self.REQUEST.setVirtualRoot('Z')
  else:
   if sitemap.has_key(hostname):
self.REQUEST.set('SiteRootPATH', '/')
self.REQUEST['TraversalRequestNameStack'].extend([lang, sitemap[hostname]])
   else:
self.REQUEST.set('SiteRootPATH', '/')


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Using PropertySheets

2000-09-19 Thread Erich Seifert

Hi everbody,

I've played a bit with the PropertySheets interface and I wanted to create two
Stylesheets. Everything works fine, but ...

* I don't get the management tabs in the propertysheet/manage method.
  Perhaps a permission problem?
* I can't pass a default value to a tokens property. How to?
* I can't pass a default value to a boolean property. How to?

Could someone please give me some example code or hints?

Thanks in advance
Eric

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Using PropertySheets

2000-09-19 Thread Erich Seifert

Thanks Steve

Steve Alexander wrote:
 
 Erich Seifert wrote:
 
  
 
  * I can't pass a default value to a tokens property. How to?
 
 Can you pass in a space-separated string, such as '' or 'token1' or
 'token1 token2'?

No I tried that.

  * I can't pass a default value to a boolean property. How to?
 
 How are you trying to do this? You can pass in the string '1' for true
 and '0' for false.

I tried both int numbers 0/1 and strings '0'/'1'

  Could someone please give me some example code or hints?
 
 It would really help to see some of the code you're already using. Can
 you also say a bit about what you are trying to do overall?

I'm currently trying to create a ZBibliography product.

Every class should have a base class which defines the basic properties
in two property sheets 'data' and description'.
For example: the 'data' property sheet currently stores 'persons', and
'title' while the 'description' sheet stores for example 'languages'
(tokens), 'offprint', and 'public' boolean attributes.

I'm not shure if this works: I wanna extend the properties stored in the
'data' sheet in the subclasses 'book', 'article', etc.

Please be patient because this is my first python program.
I hope this helps
Eric

---
Here are parts of my code:
Properties for the 'desc' PropertySheet

self._descprops = (
  {'id':'source', 'type':'string',  'value':'', 'mode':'w',},
  {'id':'languages',  'type':'tokens',  'value':'en', 'mode':'w',},
  {'id':'files',  'type':'lines',   'value':'', 'mode':'w',},
  {'id':'keywords',   'type':'lines',   'value':'', 'mode':'w',},
  {'id':'references', 'type':'lines',   'value':'', 'mode':'w',},
  {'id':'abstracts',  'type':'text','value':'', 'mode':'w',},
  {'id':'annotation', 'type':'text','value':'', 'mode':'w',},
  {'id':'classification', 'mode':'w', 'type':'multiple selection',
   'value':'', 'select_variable':'categories', 'mode':'w',},
  {'id':'offprint',   'type':'boolean', 'value':0,  'mode':'w',},
  {'id':'public', 'type':'boolean', 'value':1,  'mode':'w',},
)

Properties for the 'data' PropertySheet:

self._dataprops = (
  {'id':'persons',  'value':'','type':'lines',  'mode':'w'},
  {'id':'title','value':title, 'type':'string', 'mode':'w'},
  {'id':'title_transl', 'value':'','type':'string', 'mode':'w'},
)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope] Informix and Zope

2000-08-04 Thread Erich Seifert

"Nestor A. Diaz L." wrote:
 
 HI,
 
 Can anybody tell me if there is a posibility to use Zope with Informix 7.3
 on a Linux machine? maybe using odbc driver?
 
 thanks you..

I would be interested in this, too.
Could anyone help or give some hints.

Thanks
Eric

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Datebug?

2000-07-21 Thread Erich Seifert

Hi Peter,

I had the same problem.
The fmt tag outputs GMT time but the methods of DateTime, i.e. day(), month(),
year(), etc. do not. So I used them.

Peter Arvidsson wrote:
 
 Forgot to say that... I run 2.2 final :/
 
 Chris Withers skrev:
 
  Peter Arvidsson wrote:
   It cant really be a timezone issue because it is decreasing the date by
   24 hours and I only live 1 hour from GMT. The date on my computer and
   the server are correct. Does someone knows why this happens when I use
   "fmt" or is this a DateTime bug?
 
  It could be one of a number of bugs. :(
 
  What version of Zope are you using?
 
  Try 2.2 and see fi it still happens...
 
  cheers,
 
  Chris
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 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 )

-- 
* Anyone sending unwanted advertising e-mail to this address will be
charged $25 for network traffic and computing time. By extracting my
address from this message or its header, you agree to these terms.
* Hiermit widerspreche ich der Nutzung oder Uebermittlung meiner Daten
fuer Werbezwecke oder fuer die Markt- oder Meinungsforschung gemaess
Paragraph 28 Absatz 3 des Bundesdatenschutzgesetzes.

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] Implementing full text search

2000-07-19 Thread Erich Seifert

Hi folks,

I tried to create a full text search for my existing site. All went fine:
I can search my whole site's document contents (via PrincipaSourceSearch)
and titles (using 'or' as in advanced zcatalog searching how-to).

The problem I have at the moment is that Zope only searches in unrendered
content and all html and dtml code is found also when searching.
How can I search my documents with all dtml-vars inserted and without all html
code or at least dtml code?

I there a solution?

Any help appreciated.
Eric

---
Erich Seifert [EMAIL PROTECTED]
3 week webmaster and Zope user

___
Zope maillist  -  [EMAIL PROTECTED]
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 )