MAOneToManyComponent's report shows all descriptions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

MAOneToManyComponent's report shows all descriptions

Esteban A. Maringolo
Hi,

Magritte's MAOneToManyComponent uses a hardcoded reference to MAReport, which shows all the descriptions of the reference, even those in which #visibleInReport attribute is false.

MAOneToManyComponent>>#buildReport

        ^ (MAReport rows: self value description: self reference)
                sortEnabled: self magritteDescription isOrdered not;
                yourself

Can we add a #reportClass attribute to such component?

With its correspondent #defaultReportClass answering MAReport, and maybe filter the descriptions by #visibleInReport attribute, or simply delegate such behavior to the #reportClass

I fixed it by subclassing MAOneToManyComponent, but I think this should go at base level.

Regards!

Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent's report shows all descriptions

Stephan Eggermont-3
We have a few different subclasses doing

QCToManyComponnet>>buildReport
        | retVal |
        self magritteDescription startEditAll ifTrue: [ self editAll ].
        retVal := (self reportClass rows: self value description: self reference)
                sortEnabled: self magritteDescription isOrdered not;
                yourself.
        retVal columns do: [ :each |
                each mementoCache: self cache.
                (each isKindOf: MADescribedColumn) ifTrue: [
                        self addColumnCommandsTo: each.
                        each filter: true ] ].
        retVal showFilter: self magritteDescription showFilter.
        retVal doubleClickCommand: self editCommand.
        ^retVal

QCQueriedToManyComponent>>buildReport
        | retVal shown |
        retVal := super buildReport.
        shown := self resultsDescription shownColumns.
        retVal columns do: [ :column |
                | desc |
                desc :=  shown detect: [ :each | column magritteDescription = each ] ifNone: [ nil ].
                column visible: desc notNil.
                desc ifNotNil: [ column magritteDescription priority: desc priority ] ].
        retVal columns sort: [ :a :b | a < b ].
        ^retVal

TBSMagritteOneToManyComponent>>buildReport

        ^ (TBSMagritteReport rows: self value description: self reference)
                sortEnabled: self magritteDescription isOrdered not;
                yourself
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent's report shows all descriptions

Esteban A. Maringolo
Hi Stephan,

I know I can subclass and modify what I need, in fact I did that.

Regarding whether to use QC or not I'm always hesitating, because,
given your two examples, I don't know which one does what. It has no
methods or class' comments.

I seems you hit many Magritte "limitations" before, and has been
"extending" it with QC, but even after watching the last ESUG
presentation QC it is unfathomable to me as a whole.


Regards!
Esteban A. Maringolo


2014-09-12 7:13 GMT-03:00 Stephan Eggermont <[hidden email]>:

> We have a few different subclasses doing
>
> QCToManyComponnet>>buildReport
>         | retVal |
>         self magritteDescription startEditAll ifTrue: [ self editAll ].
>         retVal := (self reportClass rows: self value description: self reference)
>                 sortEnabled: self magritteDescription isOrdered not;
>                 yourself.
>         retVal columns do: [ :each |
>                 each mementoCache: self cache.
>                 (each isKindOf: MADescribedColumn) ifTrue: [
>                         self addColumnCommandsTo: each.
>                         each filter: true ] ].
>         retVal showFilter: self magritteDescription showFilter.
>         retVal doubleClickCommand: self editCommand.
>         ^retVal
>
> QCQueriedToManyComponent>>buildReport
>         | retVal shown |
>         retVal := super buildReport.
>         shown := self resultsDescription shownColumns.
>         retVal columns do: [ :column |
>                 | desc |
>                 desc :=  shown detect: [ :each | column magritteDescription = each ] ifNone: [ nil ].
>                 column visible: desc notNil.
>                 desc ifNotNil: [ column magritteDescription priority: desc priority ] ].
>         retVal columns sort: [ :a :b | a < b ].
>         ^retVal
>
> TBSMagritteOneToManyComponent>>buildReport
>
>         ^ (TBSMagritteReport rows: self value description: self reference)
>                 sortEnabled: self magritteDescription isOrdered not;
>                 yourself
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent's report shows all descriptions

DiegoLont
Hi Esteban,

I think the report class is a good improvement to Magritte. I opened a development version on Magritte where I also want to feed back some (backwards compatible) improvements I build for QC Magritte back into Magritte. As Stephan pointed out: yes, the report class was one of them. The major improvement for 3.2 I have in mind is putting builders into Magritte.

So I would say: please put this change into the Magritte repository, and put the version into 3.2.

Regards,
Diego

On 12 Sep 2014, at 15:45, Esteban A. Maringolo <[hidden email]> wrote:

> Hi Stephan,
>
> I know I can subclass and modify what I need, in fact I did that.
>
> Regarding whether to use QC or not I'm always hesitating, because,
> given your two examples, I don't know which one does what. It has no
> methods or class' comments.
>
> I seems you hit many Magritte "limitations" before, and has been
> "extending" it with QC, but even after watching the last ESUG
> presentation QC it is unfathomable to me as a whole.
>
>
> Regards!
> Esteban A. Maringolo
>
>
> 2014-09-12 7:13 GMT-03:00 Stephan Eggermont <[hidden email]>:
>> We have a few different subclasses doing
>>
>> QCToManyComponnet>>buildReport
>>        | retVal |
>>        self magritteDescription startEditAll ifTrue: [ self editAll ].
>>        retVal := (self reportClass rows: self value description: self reference)
>>                sortEnabled: self magritteDescription isOrdered not;
>>                yourself.
>>        retVal columns do: [ :each |
>>                each mementoCache: self cache.
>>                (each isKindOf: MADescribedColumn) ifTrue: [
>>                        self addColumnCommandsTo: each.
>>                        each filter: true ] ].
>>        retVal showFilter: self magritteDescription showFilter.
>>        retVal doubleClickCommand: self editCommand.
>>        ^retVal
>>
>> QCQueriedToManyComponent>>buildReport
>>        | retVal shown |
>>        retVal := super buildReport.
>>        shown := self resultsDescription shownColumns.
>>        retVal columns do: [ :column |
>>                | desc |
>>                desc :=  shown detect: [ :each | column magritteDescription = each ] ifNone: [ nil ].
>>                column visible: desc notNil.
>>                desc ifNotNil: [ column magritteDescription priority: desc priority ] ].
>>        retVal columns sort: [ :a :b | a < b ].
>>        ^retVal
>>
>> TBSMagritteOneToManyComponent>>buildReport
>>
>>        ^ (TBSMagritteReport rows: self value description: self reference)
>>                sortEnabled: self magritteDescription isOrdered not;
>>                yourself
>> _______________________________________________
>> Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent's report shows all descriptions

Esteban A. Maringolo
Diego,

I noticed that even when the reportClass is configurable in
MAOneToManyComponent there is no way I can specify it from the
description.

It is... in my description I can specify which component class is used
to represent it (in Seaside), but there is no way to perform pre or
post configurations of such as setting the report class (pre-config)
or doing something after the component as been instatiated.

So by now I'll continue using my custon MAOneToManyComponent subclass
to deal with the custom needs I have.

Can you, or Stephan, please expand about the builders you're planning
to integrate into the next version?

Thanks in advance!


Esteban A. Maringolo


2014-09-14 15:13 GMT-03:00 Diego Lont <[hidden email]>:

> Hi Esteban,
>
> I think the report class is a good improvement to Magritte. I opened a development version on Magritte where I also want to feed back some (backwards compatible) improvements I build for QC Magritte back into Magritte. As Stephan pointed out: yes, the report class was one of them. The major improvement for 3.2 I have in mind is putting builders into Magritte.
>
> So I would say: please put this change into the Magritte repository, and put the version into 3.2.
>
> Regards,
> Diego
>
> On 12 Sep 2014, at 15:45, Esteban A. Maringolo <[hidden email]> wrote:
>
>> Hi Stephan,
>>
>> I know I can subclass and modify what I need, in fact I did that.
>>
>> Regarding whether to use QC or not I'm always hesitating, because,
>> given your two examples, I don't know which one does what. It has no
>> methods or class' comments.
>>
>> I seems you hit many Magritte "limitations" before, and has been
>> "extending" it with QC, but even after watching the last ESUG
>> presentation QC it is unfathomable to me as a whole.
>>
>>
>> Regards!
>> Esteban A. Maringolo
>>
>>
>> 2014-09-12 7:13 GMT-03:00 Stephan Eggermont <[hidden email]>:
>>> We have a few different subclasses doing
>>>
>>> QCToManyComponnet>>buildReport
>>>        | retVal |
>>>        self magritteDescription startEditAll ifTrue: [ self editAll ].
>>>        retVal := (self reportClass rows: self value description: self reference)
>>>                sortEnabled: self magritteDescription isOrdered not;
>>>                yourself.
>>>        retVal columns do: [ :each |
>>>                each mementoCache: self cache.
>>>                (each isKindOf: MADescribedColumn) ifTrue: [
>>>                        self addColumnCommandsTo: each.
>>>                        each filter: true ] ].
>>>        retVal showFilter: self magritteDescription showFilter.
>>>        retVal doubleClickCommand: self editCommand.
>>>        ^retVal
>>>
>>> QCQueriedToManyComponent>>buildReport
>>>        | retVal shown |
>>>        retVal := super buildReport.
>>>        shown := self resultsDescription shownColumns.
>>>        retVal columns do: [ :column |
>>>                | desc |
>>>                desc :=  shown detect: [ :each | column magritteDescription = each ] ifNone: [ nil ].
>>>                column visible: desc notNil.
>>>                desc ifNotNil: [ column magritteDescription priority: desc priority ] ].
>>>        retVal columns sort: [ :a :b | a < b ].
>>>        ^retVal
>>>
>>> TBSMagritteOneToManyComponent>>buildReport
>>>
>>>        ^ (TBSMagritteReport rows: self value description: self reference)
>>>                sortEnabled: self magritteDescription isOrdered not;
>>>                yourself
>>> _______________________________________________
>>> Magritte, Pier and Related Tools ...
>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>> _______________________________________________
>> Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
>
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki