brix-cms / brix-cms

Brix CMS
Apache License 2.0
123 stars 49 forks source link

[request] SitePlugin.selectNode extension point #67

Closed briantopping closed 13 years ago

briantopping commented 13 years ago

Creator - vytautas.civilis

SitePlugin selectNode method looks for NodeManagerContainerPanel. I'd request to create separate interface for this, and use that instead of the concrete class. This way, it would be possible to easier reuse some of this SitePlugin method (selectNode) bound components, generally what gets incorporated into NodeManagerContainerPanel (e.g. NodeManagerEditorPanel). I could guess that these components are not meant to be extended or be reused in any way, but it's not a big change, so perhaps it would be possible to incorporate this. Interface name is arbitrary of course. The proposed patch is attached.

briantopping commented 13 years ago

igor.vaynberg - 2009-07-08 20:58 http://code.google.com/p/brix-cms/issues/detail?id=68#c1

your interface doesnt make sense because whatever implements it also has to be a subclass of Component otherwise it wont work.

do you have a concrete usecase?

briantopping commented 13 years ago

igor.vaynberg - 2009-07-08 20:59 http://code.google.com/p/brix-cms/issues/detail?id=68#c2

Label - -Type-Defect Label - Type-Enhancement

briantopping commented 13 years ago

vytautas.civilis - 2009-07-09 07:01 http://code.google.com/p/brix-cms/issues/detail?id=68#c3

The interface is a designator of a special type of component's container. NodeManagerContainerPanel had the same purpose, and two methods, which selectNode method acted upon. Of course, logically, if you want to find parent component with this interface, the instance will be the component, or it wouldn't be the parent. But this doesn't imho nor break, nor impede anything.

The patch contains the interface, as well, as NodeManagerContainerPanel implementing it, and SitePlugin selectNode using this interface, instead of concrete class. And it is working ok, as much as I tested.

My use case, is that I have my analog implementation of NodeManagerContainerPanel, which I use in other plugin's tab. I want to reuse NodeManagerEditorPanel and other panels/components, but some of them rely on SitePlugin.selectNode method, and as this method looks for parent of NodeManagerContainerPanel, it doesn't find my MyAnalogNodeManagerContainerPanel.

briantopping commented 13 years ago

igor.vaynberg - 2009-07-10 19:12 http://code.google.com/p/brix-cms/issues/detail?id=68#c4

Label - FixedIn-1.0-beta3 Status - Fixed