Cours tecfa staf 2x 18.02.2002 ZOPE Dynamic websites

F. Filliettaz

lundi 17

9h - 10h30 : qu'est-ce donc que Zope?

11h - 12h30 : comment ça marche (en gros), en pratique

14h - 15h30 : l'environnement de développement

16h - 17h30 : idem + pratique

mardi 18

9h - 10h30 : l'acquisition

11h - 12h30 : le DTML (en détail) 1ère partie

14h - 15h30 : le DTML (en détail) 2ème partie

16h - 17h30 : CMF (portail Zope)


orig ??? breton
framework=struct mettant a dispo div composants serv
objets <=> url serv
db (inclue ou ext SQL)

contenus
templates
scripts  (Python ou Perl)
db GUI
ZClass = DTML (langage Zope progr. objet) pas très sûr, pb sécu
intégration pg python

Open Source
orienté objets
objet: état (valeur attributs),  comportement (ensemble méthode applicables à cet objet); appartient à classe; persistants, objets zope Folder, DTML Doc & DTML Meth .
Sécurisé
multi plate-formes
pseudo moteur de recherche par indéxation fourni (vrai installable)
communauté zope helpdesk super good
pb avec ftp ange-mode emacs? ok av dreamweaver, golive

/ contenu-logique-présentation + templates
user friendly (for no-programm)
unité de style, màj auto (indexation), de navigation
CSS

[PHP excite]

Installation
zope.org/Products/Zope

puis
localhost:8080/manage

ici sur serveur
:9080/manage

anciennement: 9180
(ça doit marcher aussi sur 8080?)

/
index.html
standard_html_footer & ...header... on peut copier-coller-modifier + bas & ça s'applique
[admin / pwtecfa]
installation composants dans: (default=WebServer).../lib/Python/Products
CMF a repiquer
back up fichier var/Data.fs

créer utilisateur
...

pour administrer:
http://tecfa.unige.ch:9080/radeff/manage

pour voir:
http://tecfa.unige.ch:9080/radeff/

distinction: publier contenu = DTML Document; manipuler objects = DTML Method, on peut personnaliser dans les presentation templates des layouts séparément du contenu)

dtml-var: introduction des variables

à faire: récupérer variable REQUEST???


ATTENTION, polycop p. 33 modifier en
login rl pw test
http://tecfa.unige.ch:9080/radeff/utilisateurs/rl/manage

ex: p. 28 créer des listings automatiques:
http://tecfa.unige.ch:9080/radeff/utilisateurs/utilisateurs/rl/index
<

19.2.02
pour récupérer des données:
depuis un <form>, envoyer sur:

ATTENTION: LES VARIABLES SONT RECUPEREES COMME TEXTE, POUR LES VAR=NUM LES TRANSFORMER (ICI EN ENTIER AVEC LA FUNCTION "INT")

<dtml-var standard_html_header>
<dtml-var expr="_.int(REQUEST.select)+5"><br>
<dtml-var expr="REQUEST.texte">
<dtml-var standard_html_footer>

booléen:
<dtml-if condition>
<dtml-return "'Oui'">
<dtml-else>
<dtml-return "'Non'">
</dtml-if>

****
dtml-call permet de faire un calcul sans afficher le résultat (p. ex. compteur)

<dtml-in articles>pour afficher les fichiers/propriétés de 'articles'

<dtml-var sequence-item> pour afficher; s'il ne trouve rien il n'affiche pas =>
</dtml-in>

=>
<dtml-else>
Aucun article
***************
pour récupérer des listes d'objets:

<dtml-in "articles.objectsIds()">
<dtml-var sequence item>
</dtml-in>

<dtml-in "articles.objectIds(['DTML Document'])">
<dtml-var sequence item>
</dtml-in>
**********
ex. de listes etc. tirés de "magasin" index_html
http://tecfa.unige.ch:9080/radeff/magasin/
****
templates:
article sur site zope qui explique comment utiliser dreamweaver, golive etc.
ajouter CMF-site
bonne adresse:
http://cmf.zope.org
http://cmf.zope.org/CMF/Members/beehive/ZWACKChap5.html

mise en forme portail:
... cf. doc papier imprimé ci-dessus

pour python, voir le site www.python.org (doc) et mes liens; voici un extrait:
  • Bouquin de base pour Python



  • Doc python beginners