[Cubicweb] [CubicWeb / discussion] Improving uicfg

Sylvain Thénault sylvain.thenault at logilab.fr
Fri Dec 13 08:07:38 CET 2013


On 12 décembre 19:36, Vladimir Popescu wrote:
> Dear CubicWeb developers / users,
> 
> In using uicfg to customize a primary view, we have been
> faced with the need to add to uicfg information which is
> not present in the schema.
> 
> We have encountered three basic use cases:
> 
> 1. Be able to add RQL-computed rsets, e.g.
>        pvdc.add_to(('Subject', 'attributes'),
>                    {'rql': 'DISTINCT Any X WHERE ...'
>                            '<restrictions on X>...',
>                     'vid': '...', 'label': '...'}),
> 
>    or
>        pvdc.add_to(('Subject', 'attributes'),
>                    {'rql': 'Any COUNT(X) WHERE ...'
>                     '<restrictions on X>...', ...})
> 
>    where 'X' is implicitly the Subject. Here, we would use
>    'attributes' or 'relations', depending on the nature of
>    the computed rset.

I don't get the meaning of .add_to(('Subject', 'attributes'), would you precise
the arguments and the expected effect ?

At a first glance, I'm not keen on adding ways to add such information using
uicfg since uicfg are already complicated while being all about schema
annotation. I'm not sure I would like them to be something else than that.

Are you aware that ContextualComponent may be used to build part of a primary
view ? Eg either left/right box or even a section below or above
attributes/relations section of the primary view.

> Another issue is the fact that subjects / objects are ignored in
> tag_object_of / tag_subject_of respectively. This poses problems
> when e.g. in tag_object_of we have subjects of several types and
> we want to apply specific views on them.
> 
> A soulutin is to create several views with the same regid and
> apply appropriate selectors which would handle the different
> entity types. But this seems less declarative to me than just
> being able not to ignore the subjects / objects
> as mentioned above.

True, though that's expected that you can't do anything using the uicfg's
declarative way, and that you sometimes have to override the default primary
view. You're use-case are valid and should be investigated. So you should first
show us how you implement them currently, then we shall propose better way using
or not uicfg/API improvments.

> I would like to discuss on the opportunity of
> implementing these improvements / tackling these issues.
> A start could be to decide which tickets to add
> to the CW project.

start a new CWEP http://www.cubicweb.org/card/cwepindex :)

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the Cubicweb mailing list