Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

[dev] some small changes

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


y.2013 at wcm-solutions

Jul 5, 2013, 1:48 AM

Post #1 of 3 (47 views)
Permalink
[dev] some small changes

Hi!


I plan to work on the following changes. Please let me know if you have
questions or objections.


Fix dotted names of CMF interfaces:
===================================

CMF defines many interfaces, so we added some submodules like _content
and _tools. This was meant as a transparent implementation detail, it's
recommended to import from interfaces, not from the submodules. But
unfortunately the full path shows up in several places, e.g. on the
Interfaces tab you see Products.CMFCore.interfaces._content.IFolderish
instead of Products.CMFCore.interfaces.IFolderish.

GenericSetup has a special _getDottedName() method that tries to find
the short version. This hides the issue in profile exports.

AFAICS this could be fixed by setting __module__ explicitly for each
interface, e.g. for IFolderish

__module__ = 'Products.CMFCore.interfaces'

Is this the right approach or will this cause new trouble?


Add 2 new portal types for member areas in CMFDefault:
======================================================

- 'MemberArea' will be a special folder type that uses the normal Portal
Folder class, but a different factory that replaces parts of the
createMemberArea() method. And a different default view that replaces
the 'index_html' Document currently added by createMemberArea().

- 'Members' will be a special folder type that uses the normal Portal
Folder class, but limits sub-items to 'MemberArea' objects and has a
special default view that replaces the 'index_html' DTML Method
currently added to the members folder.


Simplify content views in CMFDefault:
=====================================

- remove registration and lookup of "schema adapters" (e.g.
DocumentSchemaAdapter, LinkSchemaAdapter). Use these adapters directly
in getContent().

- rename '@@view.html' to '@@view', '@@properties.html' to
'@@properties' and so on. This allows to remove some method aliases.


Cheers,

Yuppie

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


tseaver at palladion

Jul 5, 2013, 8:11 AM

Post #2 of 3 (40 views)
Permalink
Re: [dev] some small changes [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/05/2013 04:48 AM, yuppie wrote:
> Hi!
>
>
> I plan to work on the following changes. Please let me know if you
> have questions or objections.
>
>
> Fix dotted names of CMF interfaces:
> ===================================
>
> CMF defines many interfaces, so we added some submodules like
> _content and _tools. This was meant as a transparent implementation
> detail, it's recommended to import from interfaces, not from the
> submodules. But unfortunately the full path shows up in several
> places, e.g. on the Interfaces tab you see
> Products.CMFCore.interfaces._content.IFolderish instead of
> Products.CMFCore.interfaces.IFolderish.
>
> GenericSetup has a special _getDottedName() method that tries to find
> the short version. This hides the issue in profile exports.
>
> AFAICS this could be fixed by setting __module__ explicitly for each
> interface, e.g. for IFolderish
>
> __module__ = 'Products.CMFCore.interfaces'
>
> Is this the right approach or will this cause new trouble?
>
>
> Add 2 new portal types for member areas in CMFDefault:
> ======================================================
>
> - 'MemberArea' will be a special folder type that uses the normal
> Portal Folder class, but a different factory that replaces parts of
> the createMemberArea() method. And a different default view that
> replaces the 'index_html' Document currently added by
> createMemberArea().
>
> - 'Members' will be a special folder type that uses the normal Portal
> Folder class, but limits sub-items to 'MemberArea' objects and has a
> special default view that replaces the 'index_html' DTML Method
> currently added to the members folder.
>
>
> Simplify content views in CMFDefault:
> =====================================
>
> - remove registration and lookup of "schema adapters" (e.g.
> DocumentSchemaAdapter, LinkSchemaAdapter). Use these adapters
> directly in getContent().
>
> - rename '@@view.html' to '@@view', '@@properties.html' to
> '@@properties' and so on. This allows to remove some method aliases.

That all sounds fine to me.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver [at] palladion
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlHW4h0ACgkQ+gerLs4ltQ4Q3ACffh7hOfwQd5AaRPT/0ebwFsdx
X1kAoNbayTq+p53HRbenMG0nG6rqSHxI
=zEdB
-----END PGP SIGNATURE-----

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jul 31, 2013, 3:11 AM

Post #3 of 3 (26 views)
Permalink
Re: [dev] some small changes [In reply to]

Am 09.07.2013, 09:33 Uhr, schrieb yuppie <y.2013 [at] wcm-solutions>:

Hi Yuppie,

> Hi Charlie!

> Thanks for your feedback. You didn't reply to the list, so I just reply
> to you. Feel free to bring this back to the list.

It was just me being stupid and confused by another list that defaults to
reply to user - I'm on several which are configured differently and it's
all too much for my little brain!

> Charlie Clark wrote:

>> Am 05.07.2013, 10:48 Uhr, schrieb yuppie <y.2013 [at] wcm-solutions>:
>>> - rename '@@view.html' to '@@view', '@@properties.html' to
>>> '@@properties' and so on. This allows to remove some method aliases.
>>
>> -1
>>
>> Call me a stick in the mud but I always like to associate a mime type
>> with a file extension.

> I know what you mean, using '@@view.html' and '@@properties.html' in CMF
> was my idea. But meanwhile I think differently:

> Paths like "site/foo.pdf/edit.html" look strange. File extension are
> useful if you want to save files to a file system that has no other way
> to keep track of the mime type. But you don't want to save views that
> have a visible name. You want to save the object using the default view
> and the name of the default view is invisible. So the object needs a
> file extension, not the view.

I don't think I'm entirely convinced about path logic. I guess any of
these conventions are dependent upon what you're doing. Fortunately,
traversal means that we generally don't need to worry too much about the
name we use and extensions in view names are useful only in a minority of
cases, such as, say, .ics for events. I just like the explicitness. OTOH I
also realise that this is somewhat historical - extensions are good way of
distinguishing between views and TTW stuff when entering URLs directly,
like developers but not users do.

> And: These names are already hidden behind aliases, for type specific
> views they are just used internally.

This is probably the biggest reason so no more objections from me.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.