Adichatz generates brute Entity Editors to display detail parts of an Entity and the list of its related objects (dependencies). For example the Entity Editor for a Film class is described by an XML file called 'FilmEditorGENERATED.axml' or 'FilmDIGENERATED.axml' (see [[http://www.adichatz.org/document/FilmDI.xml|generated file]]). For example, open file $projectDirectory/resources/xml/model/film/FilmDIGENERATED.xml.\\ \\ **Following XML elements:**
return null==value ? "" : #FV().name; return null==value ? "" : #FV().name; return #FV() < 1900 || #FV() > 2155; return null == value ? null : ((java.math.BigDecimal) value).doubleValue(); return null == value ? null : new java.math.BigDecimal((Double) value); return null == value ? null : ((java.math.BigDecimal) value).doubleValue(); return null == value ? null : new java.math.BigDecimal((Double) value); return ((#MODELPACKAGE().MpaaRatingEnum) element).getValue(); return java.util.Arrays.asList(#MODELPACKAGE().MpaaRatingEnum.values()); return java.util.Arrays.copyOf((Object[]) value, ((Object[]) value).length, String[].class);
\\ **renders the following layout:**\\ {{ tutorial:film_detail_generated.jpg?550 | Film detail (brute)}} \\ \\ \\ **Change XML elements** * Copy FilmDIGENERATED.axml file to FilmDI.axml which will become the reference for generated code. * Replace above XML lines with the following ones:
return null==value ? "" : #FV().name; return null==value ? "" : #FV().name; return ((#MODELPACKAGE().MpaaRatingEnum) element).getValue(); return java.util.Arrays.asList(#MODELPACKAGE().MpaaRatingEnum.values()); #BEAN().isActive() #CONTROLLER(detailContainer).reflowControllers(); return java.util.Arrays.copyOf((Object[]) value, ((Object[]) value).length, String[].class);
** renders the new layout:**\\ {{tutorial:film_detail.jpg?550 | Film detail (improved)}}
Remarks: |< 100% 10em - >| ^ Lines 15:|@#eff5fb:A **text controller** is replaced by an **ImageViewer controller** which displays an image for an URL.| ^ Lines 35-38:|@#eff5fb:show how to create a dynamic block. '**forRentGroup**' pgroup is created only when field **forRent** is set to **true**.| \\ If you are using **sakila** mysql datababase rather than **pagila** postgresql, two changes must be done:\\ replace lines **25-30** by following line. replace lines **46-48** (line **41** after previous change) by following line. //See page [[tutorial:improve_film_detail_sakila|Improve Film Detail (sakila)]].// \\ //Same method can be used for [[tutorial:improve_filmdesc_detail|FilmDescription]]. // \\