#57 New zope file types

open
None
5
2004-02-16
2004-01-31
No

The CMFFormController (see collective here on sf.net)
introduced three new file types:

.vpy - validator python script
.cpy - controller python script
.cpt - controller page template

It was easy to add cpt to the list of know file types
but I'm dunno how to add cpy and vpy. See attached file
for the changes.

All three new file types are ordinary py/py files. They
just have a new binding to the state object of the form
controller

A third new file type was introduced in CMF 1.4:

.metadata - a ordinary config file like text file

Could you please add support for these 4 new file
extensions in the next release of boa. Without the
support boa is more or less useless for plone 2 developers.

Tiran

Discussion

  • Jens Klein

    Jens Klein - 2004-02-05

    Logged In: YES
    user_id=474612

    Tiran was faster with his request :)

    Yes, it would be great to add it to the list of boa files. Shouldnt be much work
    and would improve Zope/Plone/Archetypes development with Boa so much!

    Please add it.

    thx for the great product!

     
  • Riaan Booysen

    Riaan Booysen - 2004-02-16

    Logged In: YES
    user_id=438

    Hi Tiran,

    I haven't used Plone yet, so I don't really know what is
    involved. I'll gladly help you to add it though, please mail me
    the problems/issues you had trying to add the support.

    Riaan.

     
  • Riaan Booysen

    Riaan Booysen - 2004-02-16
    • assigned_to: nobody --> riaan
     
  • Riaan Booysen

    Riaan Booysen - 2004-02-16

    Logged In: YES
    user_id=438

    Tiran, there are no files attached to this item, so please
    attach the files you referred to again.

    Riaan.

     
  • Geoff Davis

    Geoff Davis - 2004-03-11

    Logged In: YES
    user_id=584954

    Here is some code I have added to boa/Plug-
    ins/ProdPageTemplates.plug-in.py to make things work (this
    also makes Boa recognize the .conf files used to configure
    zope 2.7)

    Geoff

    EditorHelper.extMap['.pt'] = ZopePageTemplateFSModel
    EditorHelper.extMap['.cpt'] = ZopePageTemplateFSModel

    from Models.PythonEditorModels import ClassModel
    from Models.EditorModels import TextModel
    from Models.Controllers import TextController
    from Models.PythonControllers import PyAppController
    from Views import EditorViews, AppViews, SourceViews,
    PySourceView,
    OGLViews, ProfileView

    class ZopeCPYFSModel(ClassModel):
    modelIdentifier = 'ZopeCPYFSModel'
    defaultName = 'zopecpymethod'
    ext = '.cpy'
    EditorHelper.extMap['.cpy'] = ZopeCPYFSModel

    class ZopeCPYFSController(PyAppController):
    Model = ZopeCPYFSModel
    DefaultViews = [PySourceView.PythonSourceView,
    EditorViews.ExploreView]
    AdditionalViews = [EditorViews.HierarchyView,
    EditorViews.ModuleDocView,
    EditorViews.ToDoView, OGLViews.UMLView,
    PySourceView.PythonDisView] +
    Controllers.SourceController.AdditionalViews
    Controllers.modelControllerReg[ZopeCPYFSModel] =
    ZopeCPYFSController

    class ZopeVPYFSModel(ClassModel):
    modelIdentifier = 'ZopeVPYFSModel'
    defaultName = 'zopevpymethod'
    ext = '.vpy'
    EditorHelper.extMap['.vpy'] = ZopeVPYFSModel

    class ZopeVPYFSController(PyAppController):
    Model = ZopeVPYFSModel
    DefaultViews = [PySourceView.PythonSourceView,
    EditorViews.ExploreView]
    AdditionalViews = [EditorViews.HierarchyView,
    EditorViews.ModuleDocView,
    EditorViews.ToDoView, OGLViews.UMLView,
    PySourceView.PythonDisView] +
    Controllers.SourceController.AdditionalViews
    Controllers.modelControllerReg[ZopeVPYFSModel] =
    ZopeVPYFSController

    class ZPTMetadataFSModel(TextModel):
    modelIdentifier = 'ZPTMetadataFSModel'
    defaultName = 'zptmetadatafs'
    ext = '.metadata'
    EditorHelper.extMap['.metadata'] = ZPTMetadataFSModel

    class ZPTMetadataFSController(TextController):
    Model = ZPTMetadataFSModel
    Controllers.modelControllerReg[ZPTMetadataFSModel] =
    ZPTMetadataFSController

    class ZopeConfModel(TextModel):
    modelIdentifier = 'ZopeConfModel'
    defaultName = 'zopeconf'
    ext = '.conf'
    EditorHelper.extMap['.conf'] = ZopeConfModel

    class ZopeConfController(TextController):
    Model = ZopeConfModel
    Controllers.modelControllerReg[ZopeConfModel] =
    ZopeConfController

     

Log in to post a comment.