Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe

Commits:

22 changed files:

Changes:

  • client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
    ... ... @@ -552,12 +552,11 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
    552 552
             return ObserveServiceMainFactory.get().newService(observeServiceInitializer, serviceType);
    
    553 553
         }
    
    554 554
     
    
    555
    -    public ImmutableSetDtoMap<ReferentialDtoReference> getReferentialMap(ImmutableSetStringMap referentialIds) {
    
    556
    -
    
    557
    -        ImmutableSetDtoMap.Builder<ReferentialDtoReference> result = ImmutableSetDtoMap.builder();
    
    558
    -        for (Class<? extends ReferentialDtoReference> dtoType : referentialIds.referentialReferenceTypes()) {
    
    555
    +    public ImmutableSetDtoMap<ReferentialDtoReference<?, ?>> getReferentialMap(ImmutableSetStringMap referentialIds) {
    
    556
    +        ImmutableSetDtoMap.Builder<ReferentialDtoReference<?, ?>> result = ImmutableSetDtoMap.builder();
    
    557
    +        for (Class<? extends ReferentialDtoReference<?, ?>> dtoType : referentialIds.referentialReferenceTypes()) {
    
    559 558
                 Set<String> ids = referentialIds.get(dtoType);
    
    560
    -            Set<ReferentialDtoReference> references = getReferentialReferenceSet(dtoType).toSet().stream()
    
    559
    +            Set<ReferentialDtoReference<?, ?>> references = getReferentialReferenceSet(dtoType).toSet().stream()
    
    561 560
                         .filter(r -> ids.contains(r.getId()))
    
    562 561
                         .collect(Collectors.toSet());
    
    563 562
                 result.put(dtoType, references);
    

  • client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminTabUIHandler.java
    ... ... @@ -284,8 +284,8 @@ public class AdminTabUIHandler<U extends AdminTabUI> {
    284 284
     
    
    285 285
             String message = t("observe.message.show.usage.for.missingReferentials2", centralSourceLabel, targetSourceLabel);
    
    286 286
     
    
    287
    -        ImmutableSetDtoMap<ReferentialDtoReference> usages = centralSource.getReferentialMap(missingReferentialResult.getMissingIds());
    
    288
    -        UsageForDisplayUI usagesUI = UsageForDisplayUI.build(message, usages);
    
    287
    +        ImmutableSetDtoMap<ReferentialDtoReference<?,?>> usages = centralSource.getReferentialMap(missingReferentialResult.getMissingIds());
    
    288
    +        UsageForDisplayUI<?> usagesUI = UsageForDisplayUI.build(message, usages);
    
    289 289
     
    
    290 290
             int response = UIHelper.askUser(null,
    
    291 291
                                             t("observe.title.can.not.export.data2", targetSourceLabel),
    
    ... ... @@ -302,12 +302,12 @@ public class AdminTabUIHandler<U extends AdminTabUI> {
    302 302
     
    
    303 303
             log.info(String.format("Base «%s» - Insertion des référentiels manquants.", targetSourceLabel));
    
    304 304
     
    
    305
    -        for (Class<? extends ReferentialDtoReference> key : usages.referentialReferenceTypes()) {
    
    306
    -            Set<? extends ReferentialDtoReference> references = usages.get(key);
    
    307
    -            String type = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(key));
    
    305
    +        for (Class<? extends ReferentialDtoReference<?,?>> key : usages.referentialReferenceTypes()) {
    
    306
    +            Set<? extends ReferentialDtoReference<?,?>> references = usages.get(key);
    
    307
    +            String type = t(ObserveI18nDecoratorHelper.getTypeI18nKey(key));
    
    308 308
                 sendMessage(t("observe.actions.exportData.message.add.missing.referentials2", targetSourceLabel, references.size(), type));
    
    309
    -            Decorator decorator = decoratorService.getReferenceDecorator(key);
    
    310
    -            for (DtoReference reference : references) {
    
    309
    +            Decorator<?> decorator = decoratorService.getReferenceDecorator(key);
    
    310
    +            for (DtoReference<?,?> reference : references) {
    
    311 311
                     sendMessage(t("observe.actions.exportData.message.add.missing.referential", decorator.toString(reference)));
    
    312 312
                 }
    
    313 313
             }
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ContentReferenceUI.jaxx
    ... ... @@ -19,8 +19,8 @@
    19 19
       -->
    
    20 20
     
    
    21 21
     <fr.ird.observe.client.ui.content.ContentUI abstract='true' superGenericType='E, U'
    
    22
    -                                            title="{pluralTypeI18nKey}"
    
    23
    -                                            contentTitle='{t("observe.type.management", pluralTypeI18nKey)}'
    
    22
    +                                            title="{typeI18nKey}"
    
    23
    +                                            contentTitle='{t("observe.type.management", typeI18nKey)}'
    
    24 24
                                                 genericType='E extends ReferentialDto, R extends ReferentialDtoReference&lt;E, R&gt;, U extends ContentReferenceUI&lt;E, R, U&gt;'>
    
    25 25
     
    
    26 26
       <import>
    
    ... ... @@ -57,11 +57,9 @@
    57 57
         static io.ultreia.java4all.i18n.I18n.t
    
    58 58
       </import>
    
    59 59
     
    
    60
    -  <java.lang.String id='pluralTypeI18nKey'
    
    61
    -                    initializer='t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(bean.getClass()))'/>
    
    62 60
       <java.lang.String id='typeI18nKey' initializer='t(ObserveI18nDecoratorHelper.getTypeI18nKey(bean.getClass()))'/>
    
    63 61
     
    
    64
    -  <java.lang.String id='listText' initializer='t("observe.type.list", pluralTypeI18nKey)'/>
    
    62
    +  <java.lang.String id='listText' initializer='t("observe.type.list", typeI18nKey)'/>
    
    65 63
       <java.lang.String id='createToolTip' initializer='t("observe.type.action.create", typeI18nKey)'/>
    
    66 64
       <java.lang.String id='detailToolTip' initializer='t("observe.type.action.view", typeI18nKey)'/>
    
    67 65
       <java.lang.String id='modifyToolTip' initializer='t("observe.type.action.edit", typeI18nKey)'/>
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIHandler.java
    ... ... @@ -92,7 +92,7 @@ public class ReferenceHomeUIHandler extends ContentUIHandler<ProgramDto, Referen
    92 92
     
    
    93 93
             for (Class<? extends ReferentialDto> type : ui.getModel().getTypes()) {
    
    94 94
     
    
    95
    -            String text = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(type));
    
    95
    +            String text = t(ObserveI18nDecoratorHelper.getTypeI18nKey(type));
    
    96 96
                 JButton button = new JButton(text);
    
    97 97
                 button.addActionListener(e -> navigation.selectSafeNode(referentialNode.findChildByClass(type)));
    
    98 98
                 panel.add(button);
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIModel.java
    ... ... @@ -68,7 +68,7 @@ public abstract class ReferenceHomeUIModel extends ContentUIModel<ProgramDto> {
    68 68
     
    
    69 69
         protected ReferenceHomeUIModel(List<Class<? extends ReferentialDto>> types, String nodeName) {
    
    70 70
             super(ProgramDto.class);
    
    71
    -        this.types = ImmutableList.copyOf(ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale()));
    
    71
    +        this.types = ImmutableList.copyOf(ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale()));
    
    72 72
             this.nodeName = nodeName;
    
    73 73
         }
    
    74 74
     
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUI.jaxx
    ... ... @@ -21,7 +21,7 @@
    21 21
     <!--
    
    22 22
     Interface graphique pour afficher la liste des usages d'une entitee donnee.
    
    23 23
     -->
    
    24
    -<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
    
    24
    +<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference&lt; ?, R&gt;">
    
    25 25
     
    
    26 26
       <import>
    
    27 27
     
    
    ... ... @@ -37,7 +37,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
    37 37
     
    
    38 38
       <script><![CDATA[
    
    39 39
     
    
    40
    -public static <R extends ReferentialDtoReference> UsageForDeleteUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
    
    40
    +public static <R extends ReferentialDtoReference<?, R>> UsageForDeleteUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
    
    41 41
         return new UsageForDeleteUI<>(new JAXXInitialContext().add(message).add(usages).add(references));
    
    42 42
     }
    
    43 43
     
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUIHandler.java
    ... ... @@ -36,7 +36,7 @@ import javax.swing.JPanel;
    36 36
      * @author Tony Chemit - dev@tchemit.fr
    
    37 37
      * @since 5.1
    
    38 38
      */
    
    39
    -public class UsageForDeleteUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDeleteUI<R>> {
    
    39
    +public class UsageForDeleteUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDeleteUI<R>> {
    
    40 40
     
    
    41 41
         @Override
    
    42 42
         protected JLabel getMessage() {
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUI.jaxx
    ... ... @@ -21,7 +21,7 @@
    21 21
     <!--
    
    22 22
     Interface graphique pour afficher la liste des usages d'une entitee donnee.
    
    23 23
     -->
    
    24
    -<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
    
    24
    +<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference&lt; ?, R&gt;">
    
    25 25
       <import>
    
    26 26
     
    
    27 27
         fr.ird.observe.dto.reference.DtoReference
    
    ... ... @@ -37,7 +37,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
    37 37
     
    
    38 38
       <script><![CDATA[
    
    39 39
     
    
    40
    -public static <R extends ReferentialDtoReference> UsageForDesactivateUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
    
    40
    +public static <R extends ReferentialDtoReference<?, R>> UsageForDesactivateUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
    
    41 41
         return new UsageForDesactivateUI<>(new JAXXInitialContext().add(message).add(usages).add(references));
    
    42 42
     }
    
    43 43
     
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUIHandler.java
    ... ... @@ -36,7 +36,7 @@ import javax.swing.JPanel;
    36 36
      * @author Tony Chemit - dev@tchemit.fr
    
    37 37
      * @since 5.1
    
    38 38
      */
    
    39
    -public class UsageForDesactivateUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDesactivateUI<R>> {
    
    39
    +public class UsageForDesactivateUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDesactivateUI<R>> {
    
    40 40
     
    
    41 41
         @Override
    
    42 42
         protected JLabel getMessage() {
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUI.jaxx
    ... ... @@ -21,7 +21,7 @@
    21 21
     <!--
    
    22 22
     Interface graphique pour afficher la liste des usages d'une entitee donnee.
    
    23 23
     -->
    
    24
    -<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
    
    24
    +<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference&lt; ?, R&gt;">
    
    25 25
     
    
    26 26
       <import>
    
    27 27
     
    
    ... ... @@ -35,7 +35,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
    35 35
     
    
    36 36
       <script><![CDATA[
    
    37 37
     
    
    38
    -public static <R extends ReferentialDtoReference> UsageForDisplayUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages) {
    
    38
    +public static <R extends ReferentialDtoReference<?, R>> UsageForDisplayUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages) {
    
    39 39
         return new UsageForDisplayUI<>(new JAXXInitialContext().add(message).add(usages));
    
    40 40
     }
    
    41 41
     
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUIHandler.java
    ... ... @@ -34,7 +34,7 @@ import javax.swing.JPanel;
    34 34
      * @author Tony Chemit - dev@tchemit.fr
    
    35 35
      * @since 5.1
    
    36 36
      */
    
    37
    -public class UsageForDisplayUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDisplayUI<R>> {
    
    37
    +public class UsageForDisplayUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDisplayUI<R>> {
    
    38 38
     
    
    39 39
         @Override
    
    40 40
         protected JLabel getMessage() {
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageUIHandlerSupport.java
    ... ... @@ -64,40 +64,60 @@ import static io.ultreia.java4all.i18n.I18n.t;
    64 64
      * @author Tony Chemit - dev@tchemit.fr
    
    65 65
      * @since 5.1
    
    66 66
      */
    
    67
    -public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U extends JAXXObject> implements UIHandler<U> {
    
    67
    +public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference<?, R>, U extends JAXXObject> implements UIHandler<U> {
    
    68 68
     
    
    69 69
         U ui;
    
    70 70
     
    
    71
    +    public static JButton findButton(Container c, String text) {
    
    72
    +
    
    73
    +        for (Component component : c.getComponents()) {
    
    74
    +            if (component instanceof JButton) {
    
    75
    +                if (text.equals(((JButton) component).getText())) {
    
    76
    +                    return (JButton) component;
    
    77
    +                }
    
    78
    +                continue;
    
    79
    +            }
    
    80
    +            if (component instanceof Container) {
    
    81
    +                JButton button = findButton((Container) component, text);
    
    82
    +                if (button != null) {
    
    83
    +                    return button;
    
    84
    +                }
    
    85
    +            }
    
    86
    +        }
    
    87
    +        return null;
    
    88
    +    }
    
    89
    +
    
    71 90
         protected abstract JLabel getMessage();
    
    72 91
     
    
    73 92
         protected abstract JPanel getUsages();
    
    74 93
     
    
    75 94
         protected abstract JaxxComboBox<R> getReplace();
    
    76 95
     
    
    77
    -        @Override
    
    96
    +    @Override
    
    78 97
         public void beforeInit(U ui) {
    
    79 98
             this.ui = ui;
    
    80 99
         }
    
    81 100
     
    
    82
    -        @Override
    
    101
    +    @SuppressWarnings({"rawtypes", "unchecked"})
    
    102
    +    @Override
    
    83 103
         public void afterInit(U ui) {
    
    84 104
     
    
    85 105
             String message = ui.getContextValue(String.class);
    
    86 106
             getMessage().setText(message);
    
    87
    -        ImmutableSetDtoMap<ReferentialDtoReference> usages = ui.getContextValue(ImmutableSetDtoMap.class);
    
    107
    +        ImmutableSetDtoMap<ReferentialDtoReference<?, ?>> usages = ui.getContextValue(ImmutableSetDtoMap.class);
    
    88 108
             if (usages.isEmpty()) {
    
    89 109
                 getUsages().add(new JLabel(t("observe.message.no.usage.for.entity")));
    
    90 110
             } else {
    
    91 111
     
    
    92
    -            for (Class<? extends ReferentialDtoReference> dtoType : usages.referentialReferenceTypes()) {
    
    112
    +            for (Class<? extends ReferentialDtoReference<?, ?>> dtoType : usages.referentialReferenceTypes()) {
    
    93 113
                     Set references = usages.get(dtoType);
    
    94 114
                     String typeTitle = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoType));
    
    95
    -                addReferentialReferenceUsages(dtoType, references, typeTitle);
    
    115
    +                addReferentialReferenceUsages((Class) dtoType, references, typeTitle);
    
    96 116
                 }
    
    97
    -            for (Class<? extends DataDtoReference> dtoType : usages.dataReferenceTypes()) {
    
    117
    +            for (Class<? extends DataDtoReference<?, ?>> dtoType : usages.dataReferenceTypes()) {
    
    98 118
                     Set references = usages.get(dtoType);
    
    99 119
                     String typeTitle = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoType));
    
    100
    -                addDataReferenceUsages(dtoType, references, typeTitle);
    
    120
    +                addDataReferenceUsages((Class) dtoType, references, typeTitle);
    
    101 121
                 }
    
    102 122
             }
    
    103 123
     
    
    ... ... @@ -124,9 +144,9 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
    124 144
             });
    
    125 145
         }
    
    126 146
     
    
    127
    -    protected <D extends DataDto, R extends DataDtoReference<D, R>> void addDataReferenceUsages(Class<R> dtoType,
    
    128
    -                                                                                                Set<R> references,
    
    129
    -                                                                                                String typeTitle) {
    
    147
    +    protected <D extends DataDto, RR extends DataDtoReference<D, RR>> void addDataReferenceUsages(Class<RR> dtoType,
    
    148
    +                                                                                                  Set<RR> references,
    
    149
    +                                                                                                  String typeTitle) {
    
    130 150
     
    
    131 151
             String typetitle = n("observe.common.Dto.label.usage.data.title");
    
    132 152
             typetitle = t(typetitle, typeTitle, references.size());
    
    ... ... @@ -137,10 +157,9 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
    137 157
             buildUsagePanel(decorator, references, typetitle);
    
    138 158
         }
    
    139 159
     
    
    140
    -
    
    141
    -    protected <D extends ReferentialDto, R extends ReferentialDtoReference<D, R>> void addReferentialReferenceUsages(Class<R> referenceType,
    
    142
    -                                                                                                                     Set<R> references,
    
    143
    -                                                                                                                     String typeTitle) {
    
    160
    +    protected <D extends ReferentialDto, RR extends ReferentialDtoReference<D, RR>> void addReferentialReferenceUsages(Class<RR> referenceType,
    
    161
    +                                                                                                                       Set<RR> references,
    
    162
    +                                                                                                                       String typeTitle) {
    
    144 163
     
    
    145 164
             String title = n("observe.common.Dto.label.usage.referential.title");
    
    146 165
             title = t(title, typeTitle, references.size());
    
    ... ... @@ -151,7 +170,7 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
    151 170
             buildUsagePanel(decorator, references, title);
    
    152 171
         }
    
    153 172
     
    
    154
    -    protected <D extends IdDto, R extends DtoReference<D, R>> void buildUsagePanel(Decorator<?> decorator, Set<R> references, String typetitle) {
    
    173
    +    protected <D extends IdDto, RR extends DtoReference<D, RR>> void buildUsagePanel(Decorator<?> decorator, Set<RR> references, String typeTitle) {
    
    155 174
     
    
    156 175
             List<String> data = new ArrayList<>(references.size());
    
    157 176
             data.addAll(references.stream().map(decorator::toString).collect(Collectors.toList()));
    
    ... ... @@ -163,12 +182,12 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
    163 182
             pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    
    164 183
             pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    
    165 184
             pane.setMinimumSize(new Dimension(300, 30));
    
    166
    -        pane.setColumnHeaderView(new JLabel(typetitle));
    
    185
    +        pane.setColumnHeaderView(new JLabel(typeTitle));
    
    167 186
             pane.setViewportView(l);
    
    168 187
             getUsages().add(pane);
    
    169 188
         }
    
    170 189
     
    
    171
    -    private class DisabledItemSelectionModel extends DefaultListSelectionModel {
    
    190
    +    private static class DisabledItemSelectionModel extends DefaultListSelectionModel {
    
    172 191
     
    
    173 192
             private static final long serialVersionUID = 1L;
    
    174 193
     
    
    ... ... @@ -183,23 +202,4 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
    183 202
     
    
    184 203
         }
    
    185 204
     
    
    186
    -    public static JButton findButton(Container c, String text) {
    
    187
    -
    
    188
    -        for (Component component : c.getComponents()) {
    
    189
    -            if (component instanceof JButton) {
    
    190
    -                if (text.equals(((JButton) component).getText())) {
    
    191
    -                    return (JButton) component;
    
    192
    -                }
    
    193
    -                continue;
    
    194
    -            }
    
    195
    -            if (component instanceof Container) {
    
    196
    -                JButton button = findButton((Container) component, text);
    
    197
    -                if (button != null) {
    
    198
    -                    return button;
    
    199
    -                }
    
    200
    -            }
    
    201
    -        }
    
    202
    -        return null;
    
    203
    -    }
    
    204
    -
    
    205 205
     }

  • client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialNavigationTreeNode.java
    ... ... @@ -40,9 +40,10 @@ import static io.ultreia.java4all.i18n.I18n.t;
    40 40
     public class ReferentialNavigationTreeNode<D extends ReferentialDto> extends ClassNavigationTreeNode<D> {
    
    41 41
     
    
    42 42
         ReferentialNavigationTreeNode(Class<D> data) {
    
    43
    -        super(data, true, t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(data)));
    
    43
    +        super(data, true, t(ObserveI18nDecoratorHelper.getTypeI18nKey(data)));
    
    44 44
         }
    
    45 45
     
    
    46
    +    @SuppressWarnings({"unchecked", "rawtypes"})
    
    46 47
         @Override
    
    47 48
         public Class<? extends ContentUI<?, ?>> getContentClass() {
    
    48 49
             String packageName = getData().getPackage().getName();
    
    ... ... @@ -55,7 +56,7 @@ public class ReferentialNavigationTreeNode<D extends ReferentialDto> extends Cla
    55 56
             } else {
    
    56 57
                 packagePrefix = "common.";
    
    57 58
             }
    
    58
    -        //FIXME Use a ClassMaping
    
    59
    +        //FIXME Use a ClassMapping
    
    59 60
             String className = String.format("fr.ird.observe.client.ui.content.ref.%s%sUI", packagePrefix, StringUtils.removeEnd(getData().getSimpleName(), "Dto"));
    
    60 61
             try {
    
    61 62
                 return (Class) Class.forName(className);
    

  • client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialsNavigationTreeNodeSupport.java
    ... ... @@ -38,8 +38,8 @@ public abstract class ReferentialsNavigationTreeNodeSupport extends StringNaviga
    38 38
     
    
    39 39
         ReferentialsNavigationTreeNodeSupport(String name, ImmutableSet<Class<? extends ReferentialDto>> types) {
    
    40 40
             super(name, true);
    
    41
    -        for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
    
    42
    -            ReferentialNavigationTreeNode child = new ReferentialNavigationTreeNode<>(aClass);
    
    41
    +        for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
    
    42
    +            ReferentialNavigationTreeNode<?> child = new ReferentialNavigationTreeNode<>(aClass);
    
    43 43
                 add(child);
    
    44 44
             }
    
    45 45
         }
    

  • client-core/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java
    ... ... @@ -44,8 +44,8 @@ public class ReferentialsSelectionTreeNode extends SelectionTreeNodeSupport<Stri
    44 44
     
    
    45 45
         public static ReferentialsSelectionTreeNode of(String name, ImmutableSet<Class<? extends ReferentialDto>> types) {
    
    46 46
             ReferentialsSelectionTreeNode result = new ReferentialsSelectionTreeNode(t(name));
    
    47
    -        for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
    
    48
    -            ReferentialSelectionTreeNode child = new ReferentialSelectionTreeNode<>(aClass);
    
    47
    +        for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
    
    48
    +            ReferentialSelectionTreeNode<?> child = new ReferentialSelectionTreeNode<>(aClass);
    
    49 49
                 result.add(child);
    
    50 50
             }
    
    51 51
     
    

  • common-dto/src/main/java/fr/ird/observe/dto/decoration/I18nDecoratorHelper.java
    ... ... @@ -51,28 +51,20 @@ public abstract class I18nDecoratorHelper extends BeanPropertyI18nKeyProducerPro
    51 51
             return ObserveUtil.sortTypes(types, klass -> t(getTypeI18nKey(klass)), locale);
    
    52 52
         }
    
    53 53
     
    
    54
    -    public static <C extends Class<?>> List<C> sortPluralTypes(Collection<C> types, Locale locale) {
    
    55
    -        return ObserveUtil.sortTypes(types, klass -> t(getTypePluralI18nKey(klass)), locale);
    
    56
    -    }
    
    57
    -
    
    58
    -    public static String getPropertyName(Class key) {
    
    54
    +    public static String getPropertyName(Class<?> key) {
    
    59 55
             String name = IdHelper.cleanId(key);
    
    60 56
             return Introspector.decapitalize(name);
    
    61 57
         }
    
    62 58
     
    
    63
    -    public static String getTitle(Class key) {
    
    59
    +    public static String getTitle(Class<?> key) {
    
    64 60
             return load(key) + ".title";
    
    65 61
         }
    
    66 62
     
    
    67
    -    public static String getTypeI18nKey(Class key) {
    
    63
    +    public static String getTypeI18nKey(Class<?> key) {
    
    68 64
             return load(key) + ".type";
    
    69 65
         }
    
    70 66
     
    
    71
    -    public static String getTypePluralI18nKey(Class key) {
    
    72
    -        return load(key) + ".types";
    
    73
    -    }
    
    74
    -
    
    75
    -    public static String getPropertyI18nKey(Class type, String propertyName) {
    
    67
    +    public static String getPropertyI18nKey(Class<?> type, String propertyName) {
    
    76 68
             I18nDecoratorHelper i18nDecoratorHelper = get();
    
    77 69
             return i18nDecoratorHelper.getDefaultLabelsBuilder().getI18nPropertyKey(type, propertyName);
    
    78 70
         }
    
    ... ... @@ -118,7 +110,7 @@ public abstract class I18nDecoratorHelper extends BeanPropertyI18nKeyProducerPro
    118 110
             result.append(String.format("%1$td/%1$tm/%1$tY", date));
    
    119 111
         }
    
    120 112
     
    
    121
    -    private static String load(Class key) {
    
    113
    +    private static String load(Class<?> key) {
    
    122 114
             I18nDecoratorHelper i18nDecoratorHelper = get();
    
    123 115
             return i18nDecoratorHelper.getCommonPrefix() + i18nDecoratorHelper.getDefaultLabelsBuilder().getI18nTypeKey(key);
    
    124 116
         }
    

  • common-dto/src/main/java/fr/ird/observe/spi/map/ImmutableSetMap.java
    ... ... @@ -77,12 +77,12 @@ public abstract class ImmutableSetMap<V> implements ObserveDto {
    77 77
         }
    
    78 78
     
    
    79 79
         @SuppressWarnings("unchecked")
    
    80
    -    public Set<Class<? extends ReferentialDtoReference>> referentialReferenceTypes() {
    
    80
    +    public Set<Class<? extends ReferentialDtoReference<?, ?>>> referentialReferenceTypes() {
    
    81 81
             return (Set) types.values().stream().filter(IdHelper::isReferential).collect(Collectors.toSet());
    
    82 82
         }
    
    83 83
     
    
    84 84
         @SuppressWarnings("unchecked")
    
    85
    -    public Set<Class<? extends DataDtoReference>> dataReferenceTypes() {
    
    85
    +    public Set<Class<? extends DataDtoReference<?,?>>> dataReferenceTypes() {
    
    86 86
             return (Set) types.values().stream().filter(IdHelper::isData).collect(Collectors.toSet());
    
    87 87
         }
    
    88 88
     
    

  • dto/src/main/i18n/getters/eugene.getter
    1 1
     observe.common.ActivityLonglineDto.title
    
    2 2
     observe.common.ActivityLonglineDto.type
    
    3
    -observe.common.ActivityLonglineDto.types
    
    4 3
     observe.common.ActivitySeineDto.title
    
    5 4
     observe.common.ActivitySeineDto.type
    
    6
    -observe.common.ActivitySeineDto.types
    
    7 5
     observe.common.BaitHaulingStatusDto.type
    
    8
    -observe.common.BaitHaulingStatusDto.types
    
    9 6
     observe.common.BaitSettingStatusDto.type
    
    10
    -observe.common.BaitSettingStatusDto.types
    
    11 7
     observe.common.BaitTypeDto.type
    
    12
    -observe.common.BaitTypeDto.types
    
    13 8
     observe.common.BaitsCompositionDto.title
    
    14 9
     observe.common.BaitsCompositionDto.type
    
    15
    -observe.common.BaitsCompositionDto.types
    
    16 10
     observe.common.BasketDto.type
    
    17
    -observe.common.BasketDto.types
    
    18 11
     observe.common.BranchlineDto.title
    
    19 12
     observe.common.BranchlineDto.type
    
    20
    -observe.common.BranchlineDto.types
    
    21 13
     observe.common.BranchlinesCompositionDto.title
    
    22 14
     observe.common.BranchlinesCompositionDto.type
    
    23
    -observe.common.BranchlinesCompositionDto.types
    
    24 15
     observe.common.CatchFateLonglineDto.type
    
    25
    -observe.common.CatchFateLonglineDto.types
    
    26 16
     observe.common.CatchLonglineDto.title
    
    27 17
     observe.common.CatchLonglineDto.type
    
    28
    -observe.common.CatchLonglineDto.types
    
    29 18
     observe.common.CountryDto.type
    
    30
    -observe.common.CountryDto.types
    
    31 19
     observe.common.DataQualityDto.type
    
    32
    -observe.common.DataQualityDto.types
    
    33 20
     observe.common.DetectionModeDto.type
    
    34
    -observe.common.DetectionModeDto.types
    
    35 21
     observe.common.EncounterDto.title
    
    36 22
     observe.common.EncounterDto.type
    
    37
    -observe.common.EncounterDto.types
    
    38 23
     observe.common.EncounterTypeDto.type
    
    39
    -observe.common.EncounterTypeDto.types
    
    40 24
     observe.common.FloatingObjectDto.title
    
    41 25
     observe.common.FloatingObjectDto.type
    
    42
    -observe.common.FloatingObjectDto.types
    
    43 26
     observe.common.FloatingObjectPartDto.title
    
    44 27
     observe.common.FloatingObjectPartDto.type
    
    45
    -observe.common.FloatingObjectPartDto.types
    
    46 28
     observe.common.FloatlinesCompositionDto.title
    
    47 29
     observe.common.FloatlinesCompositionDto.type
    
    48
    -observe.common.FloatlinesCompositionDto.types
    
    49 30
     observe.common.FpaZoneDto.type
    
    50
    -observe.common.FpaZoneDto.types
    
    51 31
     observe.common.GearCaracteristicDto.type
    
    52
    -observe.common.GearCaracteristicDto.types
    
    53 32
     observe.common.GearCaracteristicTypeDto.type
    
    54
    -observe.common.GearCaracteristicTypeDto.types
    
    55 33
     observe.common.GearDto.type
    
    56
    -observe.common.GearDto.types
    
    57 34
     observe.common.GearUseFeaturesLonglineDto.title
    
    58 35
     observe.common.GearUseFeaturesLonglineDto.type
    
    59
    -observe.common.GearUseFeaturesLonglineDto.types
    
    60 36
     observe.common.GearUseFeaturesMeasurementLonglineDto.title
    
    61 37
     observe.common.GearUseFeaturesMeasurementSeineDto.title
    
    62 38
     observe.common.GearUseFeaturesSeineDto.title
    
    63 39
     observe.common.GearUseFeaturesSeineDto.type
    
    64
    -observe.common.GearUseFeaturesSeineDto.types
    
    65 40
     observe.common.HarbourDto.type
    
    66
    -observe.common.HarbourDto.types
    
    67 41
     observe.common.HealthStatusDto.type
    
    68
    -observe.common.HealthStatusDto.types
    
    69 42
     observe.common.HookPositionDto.type
    
    70
    -observe.common.HookPositionDto.types
    
    71 43
     observe.common.HookSizeDto.type
    
    72
    -observe.common.HookSizeDto.types
    
    73 44
     observe.common.HookTypeDto.type
    
    74
    -observe.common.HookTypeDto.types
    
    75 45
     observe.common.HooksCompositionDto.title
    
    76 46
     observe.common.HooksCompositionDto.type
    
    77
    -observe.common.HooksCompositionDto.types
    
    78 47
     observe.common.ItemHorizontalPositionDto.type
    
    79
    -observe.common.ItemHorizontalPositionDto.types
    
    80 48
     observe.common.ItemVerticalPositionDto.type
    
    81
    -observe.common.ItemVerticalPositionDto.types
    
    82 49
     observe.common.LengthLengthParameterDto.type
    
    83
    -observe.common.LengthLengthParameterDto.types
    
    84 50
     observe.common.LengthWeightParameterDto.type
    
    85
    -observe.common.LengthWeightParameterDto.types
    
    86 51
     observe.common.LightsticksColorDto.type
    
    87
    -observe.common.LightsticksColorDto.types
    
    88 52
     observe.common.LightsticksTypeDto.type
    
    89
    -observe.common.LightsticksTypeDto.types
    
    90 53
     observe.common.LineTypeDto.type
    
    91
    -observe.common.LineTypeDto.types
    
    92 54
     observe.common.MaturityStatusDto.type
    
    93
    -observe.common.MaturityStatusDto.types
    
    94 55
     observe.common.MitigationTypeDto.type
    
    95
    -observe.common.MitigationTypeDto.types
    
    96 56
     observe.common.NonTargetCatchDto.title
    
    97 57
     observe.common.NonTargetCatchDto.type
    
    98
    -observe.common.NonTargetCatchDto.types
    
    99 58
     observe.common.NonTargetCatchReleaseConformityDto.type
    
    100
    -observe.common.NonTargetCatchReleaseConformityDto.types
    
    101 59
     observe.common.NonTargetCatchReleaseDto.title
    
    102 60
     observe.common.NonTargetCatchReleaseDto.type
    
    103
    -observe.common.NonTargetCatchReleaseDto.types
    
    104 61
     observe.common.NonTargetCatchReleaseStatusDto.type
    
    105
    -observe.common.NonTargetCatchReleaseStatusDto.types
    
    106 62
     observe.common.NonTargetCatchReleasingTimeDto.type
    
    107
    -observe.common.NonTargetCatchReleasingTimeDto.types
    
    108 63
     observe.common.NonTargetLengthDto.title
    
    109 64
     observe.common.NonTargetLengthDto.type
    
    110
    -observe.common.NonTargetLengthDto.types
    
    111 65
     observe.common.ObjectMaterialDto.type
    
    112
    -observe.common.ObjectMaterialDto.types
    
    113 66
     observe.common.ObjectMaterialTypeDto.type
    
    114
    -observe.common.ObjectMaterialTypeDto.types
    
    115 67
     observe.common.ObjectObservedSpeciesDto.title
    
    116 68
     observe.common.ObjectObservedSpeciesDto.type
    
    117
    -observe.common.ObjectObservedSpeciesDto.types
    
    118 69
     observe.common.ObjectOperationDto.type
    
    119
    -observe.common.ObjectOperationDto.types
    
    120 70
     observe.common.ObjectSchoolEstimateDto.title
    
    121 71
     observe.common.ObjectSchoolEstimateDto.type
    
    122
    -observe.common.ObjectSchoolEstimateDto.types
    
    123 72
     observe.common.ObservedSystemDto.type
    
    124
    -observe.common.ObservedSystemDto.types
    
    125 73
     observe.common.OceanDto.type
    
    126
    -observe.common.OceanDto.types
    
    127 74
     observe.common.OrganismDto.type
    
    128
    -observe.common.OrganismDto.types
    
    129 75
     observe.common.PersonDto.type
    
    130
    -observe.common.PersonDto.types
    
    131 76
     observe.common.ProgramDto.type
    
    132
    -observe.common.ProgramDto.types
    
    133 77
     observe.common.ReasonForDiscardDto.type
    
    134
    -observe.common.ReasonForDiscardDto.types
    
    135 78
     observe.common.ReasonForNoFishingDto.type
    
    136
    -observe.common.ReasonForNoFishingDto.types
    
    137 79
     observe.common.ReasonForNullSetDto.type
    
    138
    -observe.common.ReasonForNullSetDto.types
    
    139 80
     observe.common.RouteDto.type
    
    140
    -observe.common.RouteDto.types
    
    141 81
     observe.common.SchoolEstimateDto.title
    
    142 82
     observe.common.SchoolEstimateDto.type
    
    143
    -observe.common.SchoolEstimateDto.types
    
    144 83
     observe.common.SectionDto.type
    
    145
    -observe.common.SectionDto.types
    
    146 84
     observe.common.SensorBrandDto.type
    
    147
    -observe.common.SensorBrandDto.types
    
    148 85
     observe.common.SensorDataFormatDto.type
    
    149
    -observe.common.SensorDataFormatDto.types
    
    150 86
     observe.common.SensorTypeDto.type
    
    151
    -observe.common.SensorTypeDto.types
    
    152 87
     observe.common.SensorUsedDto.title
    
    153 88
     observe.common.SensorUsedDto.type
    
    154
    -observe.common.SensorUsedDto.types
    
    155 89
     observe.common.SetLonglineDto.title
    
    156 90
     observe.common.SetLonglineDto.type
    
    157
    -observe.common.SetLonglineDto.types
    
    158 91
     observe.common.SetLonglineGlobalCompositionDto.title
    
    159 92
     observe.common.SetSeineDto.title
    
    160 93
     observe.common.SetSeineDto.type
    
    161
    -observe.common.SetSeineDto.types
    
    162 94
     observe.common.SettingShapeDto.type
    
    163
    -observe.common.SettingShapeDto.types
    
    164 95
     observe.common.SexDto.type
    
    165
    -observe.common.SexDto.types
    
    166 96
     observe.common.ShipOwnerDto.type
    
    167
    -observe.common.ShipOwnerDto.types
    
    168 97
     observe.common.SizeMeasureDto.title
    
    169 98
     observe.common.SizeMeasureDto.type
    
    170
    -observe.common.SizeMeasureDto.types
    
    171 99
     observe.common.SizeMeasureTypeDto.type
    
    172
    -observe.common.SizeMeasureTypeDto.types
    
    173 100
     observe.common.SpeciesDto.type
    
    174
    -observe.common.SpeciesDto.types
    
    175 101
     observe.common.SpeciesFateDto.type
    
    176
    -observe.common.SpeciesFateDto.types
    
    177 102
     observe.common.SpeciesGroupDto.type
    
    178
    -observe.common.SpeciesGroupDto.types
    
    179 103
     observe.common.SpeciesGroupReleaseModeDto.type
    
    180
    -observe.common.SpeciesGroupReleaseModeDto.types
    
    181 104
     observe.common.SpeciesListDto.type
    
    182
    -observe.common.SpeciesListDto.types
    
    183 105
     observe.common.SpeciesStatusDto.type
    
    184
    -observe.common.SpeciesStatusDto.types
    
    185 106
     observe.common.StomachFullnessDto.type
    
    186
    -observe.common.StomachFullnessDto.types
    
    187 107
     observe.common.SurroundingActivityDto.type
    
    188
    -observe.common.SurroundingActivityDto.types
    
    189 108
     observe.common.TargetCatchDto.title
    
    190 109
     observe.common.TargetCatchDto.type
    
    191
    -observe.common.TargetCatchDto.types
    
    192 110
     observe.common.TargetLengthDto.title
    
    193 111
     observe.common.TargetLengthDto.type
    
    194
    -observe.common.TargetLengthDto.types
    
    195 112
     observe.common.TdrDto.title
    
    196 113
     observe.common.TdrDto.type
    
    197
    -observe.common.TdrDto.types
    
    198 114
     observe.common.TransmittingBuoyDto.title
    
    199 115
     observe.common.TransmittingBuoyDto.type
    
    200
    -observe.common.TransmittingBuoyDto.types
    
    201 116
     observe.common.TransmittingBuoyOperationDto.type
    
    202
    -observe.common.TransmittingBuoyOperationDto.types
    
    203 117
     observe.common.TransmittingBuoyTypeDto.type
    
    204
    -observe.common.TransmittingBuoyTypeDto.types
    
    205 118
     observe.common.TripLonglineDto.title
    
    206 119
     observe.common.TripLonglineDto.type
    
    207
    -observe.common.TripLonglineDto.types
    
    208 120
     observe.common.TripSeineDto.title
    
    209 121
     observe.common.TripSeineDto.type
    
    210
    -observe.common.TripSeineDto.types
    
    211 122
     observe.common.TripTypeDto.type
    
    212
    -observe.common.TripTypeDto.types
    
    213 123
     observe.common.VesselActivityLonglineDto.type
    
    214
    -observe.common.VesselActivityLonglineDto.types
    
    215 124
     observe.common.VesselActivitySeineDto.type
    
    216
    -observe.common.VesselActivitySeineDto.types
    
    217 125
     observe.common.VesselDto.type
    
    218
    -observe.common.VesselDto.types
    
    219 126
     observe.common.VesselSizeCategoryDto.type
    
    220
    -observe.common.VesselSizeCategoryDto.types
    
    221 127
     observe.common.VesselTypeDto.type
    
    222
    -observe.common.VesselTypeDto.types
    
    223 128
     observe.common.WeightCategoryDto.type
    
    224
    -observe.common.WeightCategoryDto.types
    
    225 129
     observe.common.WeightMeasureDto.title
    
    226 130
     observe.common.WeightMeasureDto.type
    
    227
    -observe.common.WeightMeasureDto.types
    
    228 131
     observe.common.WeightMeasureTypeDto.type
    
    229
    -observe.common.WeightMeasureTypeDto.types
    
    230 132
     observe.common.WindDto.type
    231
    -observe.common.WindDto.types

  • observe-i18n/src/main/i18n/translations/observe_en_GB.properties
    ... ... @@ -2214,8 +2214,8 @@ observe.type.action.view=View selected %s
    2214 2214
     observe.type.activityLongline.unsaved=New activity
    
    2215 2215
     observe.type.activitySeine.unsaved=New activity
    
    2216 2216
     observe.type.floatingObject.unsaved=New floating object (FOB)
    
    2217
    -observe.type.list=List of %s
    
    2218
    -observe.type.management=Management of %s
    
    2217
    +observe.type.list=List of referential of type `%s`
    
    2218
    +observe.type.management=Management of referential of type `%s`
    
    2219 2219
     observe.type.reference.common=Common Referential
    
    2220 2220
     observe.type.reference.longline=Longline Referential
    
    2221 2221
     observe.type.reference.seine=Seine Referential
    

  • observe-i18n/src/main/i18n/translations/observe_es_ES.properties
    ... ... @@ -2214,8 +2214,8 @@ observe.type.action.view=Ver los detalles del objeto de tipo '%s' seleccionado
    2214 2214
     observe.type.activityLongline.unsaved=Nueva actividad
    
    2215 2215
     observe.type.activitySeine.unsaved=Nueva actividad
    
    2216 2216
     observe.type.floatingObject.unsaved=Nuevo FOB
    
    2217
    -observe.type.list=Lista de %s
    
    2218
    -observe.type.management=Gestión de %s
    
    2217
    +observe.type.list=Lista de Referencial of type `%s` \#TODO
    
    2218
    +observe.type.management=Gestión de Referencial of type `%s` \#TODO
    
    2219 2219
     observe.type.reference.common=Referencial Común
    
    2220 2220
     observe.type.reference.longline=Referencial de Palangre
    
    2221 2221
     observe.type.reference.seine=Referencial de Cerco
    

  • observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
    ... ... @@ -2214,8 +2214,8 @@ observe.type.action.view=Voir les détails de l'objet de type '%s' sélectionné
    2214 2214
     observe.type.activityLongline.unsaved=Nouvelle activité
    
    2215 2215
     observe.type.activitySeine.unsaved=Nouvelle activité
    
    2216 2216
     observe.type.floatingObject.unsaved=Nouvel objet flottant (FOB)
    
    2217
    -observe.type.list=Liste des %s
    
    2218
    -observe.type.management=Gestion des %s
    
    2217
    +observe.type.list=Liste des référentiels de type `%s`
    
    2218
    +observe.type.management=Gestion des référentiels de type `%s`
    
    2219 2219
     observe.type.reference.common=Référentiel commun
    
    2220 2220
     observe.type.reference.longline=Référentiel Palangre
    
    2221 2221
     observe.type.reference.seine=Référentiel Senne
    

  • templates/src/main/java/fr/ird/observe/toolkit/eugene/templates/DtoReferenceTransformer.java
    ... ... @@ -247,7 +247,6 @@ public class DtoReferenceTransformer extends ObjectModelTransformerToJava {
    247 247
     
    
    248 248
                     String referenceName = beanClass.getName() + "Reference";
    
    249 249
                     i18nGetterFile.addKey("observe.common." + dtoName + ".type");
    
    250
    -                i18nGetterFile.addKey("observe.common." + dtoName + ".types");
    
    251 250
                     StringBuilder body = new StringBuilder();
    
    252 251
                     body.append("" /*{
    
    253 252
             <%=flushMethodName%>(<%=referenceName%>.DEFINITION);}*/);