Commit 8a06860b authored by 's avatar

Added DTML Methods/Docs with properties

parent b2d051e8
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
__doc__='''Application support __doc__='''Application support
$Id: Application.py,v 1.84 1999/01/21 22:48:18 jim Exp $''' $Id: Application.py,v 1.85 1999/01/27 20:30:28 brian Exp $'''
__version__='$Revision: 1.84 $'[11:-2] __version__='$Revision: 1.85 $'[11:-2]
import Globals,Folder,os,regex,sys,App.Product, App.ProductRegistry import Globals,Folder,os,regex,sys,App.Product, App.ProductRegistry
...@@ -157,7 +157,9 @@ class Application(Globals.ApplicationDefaultPermissions, Folder.Folder, ...@@ -157,7 +157,9 @@ class Application(Globals.ApplicationDefaultPermissions, Folder.Folder,
folder=ImageFile('www/Folder_icon.gif', globals()) folder=ImageFile('www/Folder_icon.gif', globals())
image =ImageFile('www/Image_icon.gif', globals()) image =ImageFile('www/Image_icon.gif', globals())
file =ImageFile('www/File_icon.gif', globals()) file =ImageFile('www/File_icon.gif', globals())
doc =ImageFile('www/Document_icon.gif', globals()) dtmldoc=doc=ImageFile('www/dtmldoc.gif', globals())
dtmlmethod =ImageFile('www/dtmlmethod.gif', globals())
broken=ImageFile('www/broken.gif', globals()) broken=ImageFile('www/broken.gif', globals())
UserFolder=ImageFile('AccessControl/www/UserFolder_icon.gif') UserFolder=ImageFile('AccessControl/www/UserFolder_icon.gif')
......
This diff is collapsed.
...@@ -105,9 +105,9 @@ ...@@ -105,9 +105,9 @@
Folders are the basic container objects and are analogous to directories. Folders are the basic container objects and are analogous to directories.
$Id: Folder.py,v 1.57 1999/01/19 23:59:09 amos Exp $""" $Id: Folder.py,v 1.58 1999/01/27 20:30:28 brian Exp $"""
__version__='$Revision: 1.57 $'[11:-2] __version__='$Revision: 1.58 $'[11:-2]
from Globals import HTMLFile from Globals import HTMLFile
...@@ -116,7 +116,6 @@ from PropertyManager import PropertyManager ...@@ -116,7 +116,6 @@ from PropertyManager import PropertyManager
from CopySupport import CopyContainer from CopySupport import CopyContainer
from FindSupport import FindSupport from FindSupport import FindSupport
from Image import Image, File from Image import Image, File
from Document import DocumentHandler
from AccessControl.Role import RoleManager from AccessControl.Role import RoleManager
import SimpleItem import SimpleItem
from string import rfind, lower from string import rfind, lower
...@@ -139,16 +138,11 @@ def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, ...@@ -139,16 +138,11 @@ def manage_addFolder(self,id,title='',createPublic=0,createUserF=0,
i.title=title i.title=title
self._setObject(id,i) self._setObject(id,i)
if createUserF: i.manage_addUserFolder() if createUserF: i.manage_addUserFolder()
if createPublic: i.manage_addDocument(id='index_html',title='') if createPublic: i.manage_addDTMLDocument(id='index_html',title='')
if REQUEST is not None: return self.manage_main(self,REQUEST,update_menu=1) if REQUEST is not None: return self.manage_main(self,REQUEST,update_menu=1)
class Folder(ObjectManager, class Folder(ObjectManager, PropertyManager, RoleManager, SimpleItem.Item,
PropertyManager, CopyContainer, FindSupport):
RoleManager,
DocumentHandler,
SimpleItem.Item,
CopyContainer,
FindSupport):
""" """
The basic container object in Principia. Folders can hold almost all The basic container object in Principia. Folders can hold almost all
other Principia objects. other Principia objects.
...@@ -292,8 +286,8 @@ class PUTer(Acquisition.Explicit): ...@@ -292,8 +286,8 @@ class PUTer(Acquisition.Explicit):
else: type=text_type(BODY) else: type=text_type(BODY)
__traceback_info__=suf, dot, name, type __traceback_info__=suf, dot, name, type
if lower(type)[:5]=='text/': if lower(type)[:5]=='text/':
return self._parent.manage_addDocument(name,'',BODY, return self._parent.manage_addDTMLDocument(name,'',BODY,
REQUEST=REQUEST) REQUEST=REQUEST)
if lower(type)[:6]=='image/': if lower(type)[:6]=='image/':
self._parent._setObject(name, Image(name, '', BODY, self._parent._setObject(name, Image(name, '', BODY,
content_type=type)) content_type=type))
......
...@@ -83,22 +83,10 @@ ...@@ -83,22 +83,10 @@
# #
############################################################################## ##############################################################################
"""Property management""" """Property management."""
__version__='$Revision: 1.2 $'[11:-2] __version__='$Revision: 1.3 $'[11:-2]
## from ObjectManager import ObjectManager
## from CopySupport import CopyContainer
## from FindSupport import FindSupport
## from Image import Image, File
## from Document import DocumentHandler
## from AccessControl.Role import RoleManager
## import SimpleItem
## from string import rfind, lower
## from content_types import content_type, find_binary, text_type
## import Globals
from ZPublisher.Converters import type_converters from ZPublisher.Converters import type_converters
from Globals import HTMLFile, MessageDialog from Globals import HTMLFile, MessageDialog
from string import find,join,lower,split from string import find,join,lower,split
...@@ -107,12 +95,6 @@ from DateTime import DateTime ...@@ -107,12 +95,6 @@ from DateTime import DateTime
def aq_base(ob):
if hasattr(ob, 'aq_base'):
return ob.aq_base
return ob
class PropertyManager: class PropertyManager:
""" """
The PropertyManager mixin class provides an object with The PropertyManager mixin class provides an object with
...@@ -328,3 +310,9 @@ class PropertyManager: ...@@ -328,3 +310,9 @@ class PropertyManager:
v=getattr(self,n) v=getattr(self,n)
r.append({'id': n, 'input': imap[t](None,n,t,v)}) r.append({'id': n, 'input': imap[t](None,n,t,v)})
return r return r
def aq_base(ob):
if hasattr(ob, 'aq_base'):
return ob.aq_base
return ob
<HTML> <HTML>
<HEAD> <HEAD>
<TITLE>Add Document</TITLE> <TITLE>Add DTML Document</TITLE>
</HEAD> </HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555"> <BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<H2>Add Document</H2> <H2>Add DTML Document</H2>
<P> <P>
You may create a new html document using the form below. You may create a new DTML Document using the form below.
Also, you may choose to upload an existing html file from your You may also choose to upload an existing html file from your
local computer by clicking the <I>Browse</I> button. local computer by clicking the <I>Browse</I> button.
<FORM ACTION="manage_addDocument" METHOD="POST" <FORM ACTION="manage_addDTMLDocument" METHOD="POST"
ENCTYPE="multipart/form-data" TARGET="manage_main"> ENCTYPE="multipart/form-data" TARGET="manage_main">
<TABLE CELLSPACING="2"> <TABLE CELLSPACING="2">
<TR> <TR>
......
<HTML>
<HEAD>
<TITLE>Add DTML Method</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<H2>Add DTML Method</H2>
<P>
You may create a new DTML Method object using the form below.
You may also choose to upload an existing html file from your
local computer by clicking the <I>Browse</I> button.
<FORM ACTION="manage_addDTMLMethod" METHOD="POST"
ENCTYPE="multipart/form-data" TARGET="manage_main">
<TABLE CELLSPACING="2">
<TR>
<TH ALIGN="LEFT" VALIGN="TOP">Id</TH>
<TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="TEXT" NAME="id" SIZE="40"></TD>
</TR>
<TR>
<TH ALIGN="LEFT" VALIGN="TOP"><EM>Title</EM></TH>
<TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="TEXT" NAME="title" SIZE="40"></TD>
</TR>
<TR>
<TH ALIGN="LEFT" VALIGN="TOP"><EM><STRONG>File</STRONG></EM></TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="file" NAME="file:string" SIZE="25" VALUE="">
</TD>
</TR>
<TR><TH></TH>
<TD>
<INPUT TYPE="SUBMIT" VALUE=" Add ">
<INPUT TYPE="SUBMIT" VALUE=" Add and Edit " NAME="submit">
</TD>
</TR>
</TABLE>
</FORM>
</BODY></HTML>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment