Hi,

Later we will probably support this case out of the box with both your
proposals. We already have a jira task for the latter, 
http://fornax.itemis.de/jira/browse/CSC-162 CSC-162 .

I have a suggestion of how you can do it right now. I suggest that you take
manual control of the list_include.html, by defining gap for the ListTask.
Note that there is some java bean naming issue when using entity names of 1
letter, but that is not a realistic case anyway. I tried it like this:

model.btdesign:

Application MyApp {
    basePackage=org.question

        Module listtask {
        
                Entity Aaa {
                  scaffold 
                  String name 
                  - Set <@Bbb> setOfB <-> ownerA 
                } 
                
                Entity Bbb { 
                  scaffold
                  String subName 
                  - @Aaa ownerA  <-> setOfB 
                  - Set <@Ccc> setOfC <-> ownerB 
                } 
                
                Entity Ccc { 
                  scaffold
                  String lowestLevelName 
                  String description 
                  - @Bbb ownerB  <-> setOfC 
                } 
        
        }
}

model.guidesign:

import 'platform:/resource/listtask/src/main/resources/model.btdesign' 
gui MyWeb for MyApp {
        Module for listtask {
        
                ListTask for Ccc {
                        gap
                        description
                        ownerB.subName
                }
        
        }
}

Copy the generated list_include.html to the directory for hand written
pages: src/main/webapp/WEB-INF/flows/listtask/listCcc/list_include.html

Change in list.html:
<ui:include src="/WEB-INF/flows/listtask/listCcc/list_include.html" />

Now you can edit list_include.html and add your special coulmn for Aaa.name:
                <t:column>
                        <f:facet name="header">
                                
#{msgListtask['model.DomainObject.Ccc.ownerB.ownerA.name']}
                        </f:facet>
                <h:outputText value="#{ccc.ownerB.ownerA.name}" />
                </t:column>


/Patrik



greatfooty wrote:
> 
> Can you let me know if there's an easy way to do this OR if not, whats the
> easiest approach for handling this given the default architecture of a
> sculptor generated app.
> 
> Say we have a hierarchy of entities like this:
> 
> Entity A {
>   String name
>   - Set <@B> setOfB <-> ownerA
> }
> 
> Entity B {
>   String subName
>   - @A ownerA  <-> setOfB 
>   - Set <@C> setOfC <-> ownerB
> }
> 
> Entity C {
>   String lowestLevelName
>   String description
>   - @B ownerB  <-> setOfC 
> }
> 
> 
> Within my gui i want to do a ListTask for C which includes these 4 items:
> 
>   ownerB.ownerA.name
>   ownerB.subName
>   lowestLevelName
>   description
> 
> I know we can do the ownerB.subName as per the GUI DSL docco but i can see
> the dsl editor flags double dereferencing as an error (ie. for something
> like ownerB.ownerA.name)
> 
> Is there an easy way to do this within the GUI dsl or if not, what is the
> best approach given the sculptor architecture?
> 
> Ideas that come to mind are:
> 
> 1. Create a gap classes for the ListCAction and the ListCForm and include
> a call to the AService.findById()
> 
> 2. Or create a new object X as a ValueObject (but non-persisted so really
> being a DTO) to hold all the info that I'm after. For ServiceX define a
> findAll method which uses both CService.findAll() and AService.findById().
> Obviously this would mean handcrafting of UI also.
> 
> Any suggestions? 
>  
> 

-- 
View this message in context: 
http://old.nabble.com/-Sculptor--How-to-do-ListTask-involving-hierarchy-of-entities--tp26635752s17564p26654371.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to