#77: Constrain addable types on per-folder basis
Enable and fix up ATContentType's ConstrainTypesMixin, to allow the list of addable types to be whitelisted or blacklisted on a per-folder-instance basis. addableなタイプのリストをwhitelistedされるか、per-folder-instanceの基礎の上でブラックリストに記載させられるために、ATContentTypeのConstrainTypesMixinを可能にして、修理してください。
#77: Constrain addable types on per-folder basis
Motivation 動機づけ
It is a very common use-case to want to have a folder usable only for news items, only for events etc. Currently, this requires making a whole new content type, or mangling getNotAddableTypes.py. それはニュースアイテムだけのために使えるフォルダをイベントその他賛成にしたい非常に一般の使用事件です。そして、現在では、これは全く新しい内容をタイプさせるか、getNotAddableTypes.pyをたたきつぶすことを必要とします。 Proposal 提案
- Enable ConstrainTypesMixin. ConstrainTypesMixinを可能にしてください。 Preserve exisint getNotAddableTypes hook functionality exisintなgetNotAddableTypesフック機能性を保ってください A whitelist of allowed items, which must be a subset of the allowed types specified by the FTI FTIによって指定される許されたタイプのサブセットでなければならない許されたアイテムのwhitelist And a whitelist among these of the in-menu items - rest go on a そして、in-menuアイテムの中のこれらwhitelist−残りは続きます More... より多く... page. ページ。 Option to use portal default, use parent value (presuming parent is of same type - else it doesn't make sense to inherit, so fall back on portal default), or custom as above 上記として入口デフォルト、使用親価値(親を推定することは同じタイプについてす−他に、それは遺伝させ意味をなさなくて、それで、入口デフォルトに頼りません)または習慣を使うオプション
Implementation 実施
- Functionality done, but needs CSS styling + a little JavaScript magic perhaps, and a cleanup of the "select..." page. される機能性、しかし、おそらく+少しのJavaScriptマジックのスタイルを整えているニーズCSS、そして、クリーンアップの「選びます、…」はページをめくります。 * Should probably also clean up 多分掃除をしもしならないでしょう folder_factories.pt folder_factories.pt, which wasn't used much before, but now drives the "more..." page. 現在「より多くのもの...」がページをつけるドライブ以外は、どちらが多くを使われませんでしたか。
NOTE: There are two branches, one in ATCT and one in CMFPlone, and these two branches are shared by PLIPs 77 and 78, since they are closely related and were developed in parallel. The branches are: 注:2つの枝(ATCTの1とCMFPloneの1)があります、そして、彼らが密接に関連があって、平行に発育した時から、これらの2つの枝はPLIPs 77と78によって共有されます。枝は、以下の通りです
- https://svn.plone.org/svn/plone/CMFPlone/branches/uiteam-plip77-78-content-menu-browser-default-refactoring https://svn.plone.org/svn/plone/CMFPlone/branches/uiteam-plip77-78-content-menu-browser-default-refactoring * https://svn.plone.org/svn/plone/ATContentTypes/branches/uiteam-plip77-78-content-menu-browser-default-refactoring https://svn.plone.org/svn/plone/ATContentTypes/branches/uiteam-plip77-78-content-menu-browser-default-refactoring
On the "refectoring" branch, dependencies have been refactored so that the marker interfaces are in CMFPlone, which ATCT optionally imports if HAS_PLONE2 is true. ConstrainTypesMixin is still defined in ATCT. 「refectoring している」枝の上で、目印インターフェースがCMFPloneであるように、属国はrefactoredされました。そして、HAS_PLONE2が真実ならば、それをATCTは任意に輸入します。ConstrainTypesMixinは、ATCTでまだ定められます。
In the long run, the interface could be pushed down to CMFCore, and the mixin down to Archetypes. 長い目で見れば、インターフェースはCMFCoreとArchetypesまでのmixinに押し下げられることができました。