Commit f706acee authored by PECQUOT's avatar PECQUOT

[enh] Minor cosmetic changes (Mantis #48001)

[enh] Stop using OLD directory to keep old versions of modules (Mantis #48427)
[fix] PMFMU menus were not correctly configured for national and local referential (Mantis #48500)
Signed-off-by: PECQUOT's avatarlp1ee9d <ludovic.pecquot@e-is.pro>
parent 705a7862
......@@ -171,7 +171,7 @@
<maven.compiler.debug>true</maven.compiler.debug>
<!-- Quadrige3 Core version -->
<quadrige3-core.version>3.5.1</quadrige3-core.version>
<quadrige3-core.version>3.5.3-SNAPSHOT</quadrige3-core.version>
<!-- Last ReefDb launcher version -->
<launcherVersion>3.0.3</launcherVersion>
......@@ -206,12 +206,6 @@
<dbunit.version>2.5.3</dbunit.version>
<junit.version>4.12</junit.version>
<!-- release config -->
<!-- <autoVersionSubmodules>true</autoVersionSubmodules>-->
<!-- <goals>deploy</goals>-->
<!-- <arguments>-Dliquibase.should.run=false</arguments>-->
<!-- <preparationGoals>verify</preparationGoals>-->
<!-- gitflow release plugin -->
<gitflowPluginVersion>1.12.0-EIS</gitflowPluginVersion>
......
......@@ -90,6 +90,7 @@ public interface ReefDbPmfmDao {
ALL_PMFMS_CACHE,
PMFM_BY_ID_CACHE,
PMFMS_BY_IDS_CACHE,
PMFMS_BY_CRITERIA_CACHE,
ReefDbQualitativeValueDao.QUALITATIVE_VALUES_BY_PMFM_ID_CACHE
}, allEntries = true)
void savePmfms(List<? extends PmfmDTO> pmfms);
......@@ -103,6 +104,7 @@ public interface ReefDbPmfmDao {
ALL_PMFMS_CACHE,
PMFM_BY_ID_CACHE,
PMFMS_BY_IDS_CACHE,
PMFMS_BY_CRITERIA_CACHE,
ReefDbQualitativeValueDao.QUALITATIVE_VALUES_BY_PMFM_ID_CACHE
}, allEntries = true)
void deletePmfms(List<Integer> pmfmIds);
......@@ -118,6 +120,7 @@ public interface ReefDbPmfmDao {
ALL_PMFMS_CACHE,
PMFM_BY_ID_CACHE,
PMFMS_BY_IDS_CACHE,
PMFMS_BY_CRITERIA_CACHE,
ReefDbQualitativeValueDao.QUALITATIVE_VALUES_BY_PMFM_ID_CACHE
}, allEntries = true)
void replaceTemporaryPmfm(Integer sourceId, Integer targetId, boolean delete);
......
......@@ -68,7 +68,7 @@ public class SaveAction extends AbstractReefDbSaveAction<ReferentialAnalysisInst
@Override
public void postSuccessAction() {
getUI().getReferentialAnalysisInstrumentsLocalUI().getHandler().reloadMenu();
getUI().getReferentialAnalysisInstrumentsLocalUI().getMenuUI().getHandler().reloadComboBox();
getModel().getLocalUIModel().setModify(false);
getModel().setModify(false);
......
......@@ -154,13 +154,6 @@ public class AnalysisInstrumentsLocalUIHandler extends
getModel().setBeans(analysisInstruments);
}
/**
* <p>reloadMenu.</p>
*/
public void reloadMenu() {
getUI().getMenuUI().getHandler().reloadComboBox();
}
/** {@inheritDoc} */
@Override
protected void onRowsAdded(List<AnalysisInstrumentsTableRowModel> addedRows) {
......
......@@ -112,7 +112,7 @@ public class DeleteAnalysisInstrumentAction extends AbstractReefDbAction<Analysi
if (deleteOk) {
getModel().deleteSelectedRows();
getHandler().reloadMenu();
getUI().getMenuUI().getHandler().reloadComboBox();
}
super.postSuccessAction();
......
......@@ -24,16 +24,13 @@ package fr.ifremer.reefdb.ui.swing.content.manage.referential.analysisinstrument
*/
import fr.ifremer.reefdb.dto.configuration.filter.FilterDTO;
import fr.ifremer.reefdb.service.StatusFilter;
import fr.ifremer.reefdb.ui.swing.content.manage.filter.element.menu.ApplyFilterUI;
import fr.ifremer.reefdb.ui.swing.content.manage.referential.menu.ReferentialMenuUIHandler;
import fr.ifremer.reefdb.ui.swing.util.ReefDbUIs;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JComponent;
import java.util.List;
/**
......@@ -63,9 +60,8 @@ public class AnalysisInstrumentsMenuUIHandler extends ReferentialMenuUIHandler<A
// listen to model changes on 'local' to adapt combo box content
getModel().addPropertyChangeListener(AnalysisInstrumentsMenuUIModel.PROPERTY_LOCAL, evt -> {
StatusFilter statusFilter = StatusFilter.toLocalOrNational(getModel().getLocal());
getUI().getNameCombo().setData(getContext().getReferentialService().getAnalysisInstruments(statusFilter));
getUI().getStatusCombo().setData(getContext().getReferentialService().getStatus(statusFilter));
getUI().getNameCombo().setData(getContext().getReferentialService().getAnalysisInstruments(getModel().getStatusFilter()));
getUI().getStatusCombo().setData(getContext().getReferentialService().getStatus(getModel().getStatusFilter()));
});
// Initialiser les combobox
......@@ -106,8 +102,6 @@ public class AnalysisInstrumentsMenuUIHandler extends ReferentialMenuUIHandler<A
*/
private void initComboBox() {
StatusFilter statusFilter = StatusFilter.toLocalOrNational(getModel().getLocal());
// Combo local
initBeanFilterableComboBox(
getUI().getLocalCombo(),
......@@ -116,11 +110,11 @@ public class AnalysisInstrumentsMenuUIHandler extends ReferentialMenuUIHandler<A
initBeanFilterableComboBox(
getUI().getNameCombo(),
getContext().getReferentialService().getAnalysisInstruments(statusFilter),
getContext().getReferentialService().getAnalysisInstruments(getModel().getStatusFilter()),
null);
initBeanFilterableComboBox(getUI().getStatusCombo(),
getContext().getReferentialService().getStatus(statusFilter),
getContext().getReferentialService().getStatus(getModel().getStatusFilter()),
null);
ReefDbUIs.forceComponentSize(getUI().getLocalCombo());
......@@ -132,7 +126,6 @@ public class AnalysisInstrumentsMenuUIHandler extends ReferentialMenuUIHandler<A
* <p>reloadComboBox.</p>
*/
public void reloadComboBox() {
StatusFilter statusFilter = StatusFilter.toLocalOrNational(getModel().getLocal());
getUI().getNameCombo().setData(getContext().getReferentialService().getAnalysisInstruments(statusFilter));
getUI().getNameCombo().setData(getContext().getReferentialService().getAnalysisInstruments(getModel().getStatusFilter()));
}
}
......@@ -24,7 +24,6 @@ package fr.ifremer.reefdb.ui.swing.content.manage.referential.analysisinstrument
*/
import fr.ifremer.reefdb.dto.referential.AnalysisInstrumentDTO;
import fr.ifremer.reefdb.service.StatusFilter;
import fr.ifremer.reefdb.ui.swing.action.AbstractCheckModelAction;
import fr.ifremer.reefdb.ui.swing.action.AbstractReefDbSaveAction;
import fr.ifremer.reefdb.ui.swing.content.manage.referential.analysisinstruments.ReferentialAnalysisInstrumentsUI;
......@@ -87,7 +86,7 @@ public class SearchAction extends AbstractCheckModelAction<AnalysisInstrumentsMe
public void doAction() {
result = getContext().getReferentialService().searchAnalysisInstruments(
StatusFilter.toLocalOrNational(getModel().getLocal()),
getModel().getStatusFilter(),
getModel().getAnalysisInstrumentId(),
getModel().getStatusCode());
......
......@@ -61,8 +61,7 @@ public class DepartmentMenuUIHandler extends ReferentialMenuUIHandler<Department
// listen to model changes on 'local' to adapt combo box content
getModel().addPropertyChangeListener(DepartmentMenuUIModel.PROPERTY_LOCAL, evt -> {
StatusFilter statusFilter = StatusFilter.toLocalOrNational(getModel().getLocal());
getUI().getStatusCombo().setData(getContext().getReferentialService().getStatus(statusFilter));
getUI().getStatusCombo().setData(getContext().getReferentialService().getStatus(getModel().getStatusFilter()));
getUI().getParentCombo().setData(getContext().getReferentialService().getDepartments(getModel().isLocal() ? StatusFilter.ALL : StatusFilter.NATIONAL));
});
......@@ -107,8 +106,6 @@ public class DepartmentMenuUIHandler extends ReferentialMenuUIHandler<Department
*/
private void initComboBox() {
StatusFilter statusFilter = StatusFilter.toLocalOrNational(getModel().getLocal());
// Combo local
initBeanFilterableComboBox(
getUI().getLocalCombo(),
......@@ -121,7 +118,7 @@ public class DepartmentMenuUIHandler extends ReferentialMenuUIHandler<Department
null);
initBeanFilterableComboBox(getUI().getStatusCombo(),
getContext().getReferentialService().getStatus(statusFilter),
getContext().getReferentialService().getStatus(getModel().getStatusFilter()),
null);
......
......@@ -29,7 +29,9 @@ import fr.ifremer.quadrige3.ui.core.dto.QuadrigeBean;
import fr.ifremer.reefdb.dto.ReefDbBeans;
import fr.ifremer.reefdb.dto.configuration.filter.FilterCriteriaDTO;
import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
import fr.ifremer.reefdb.service.StatusFilter;
import fr.ifremer.reefdb.ui.swing.util.AbstractReefDbBeanUIModel;
import org.apache.commons.collections4.CollectionUtils;
import org.nuiton.util.beans.Binder;
import java.util.ArrayList;
......@@ -94,7 +96,7 @@ public abstract class AbstractReferentialMenuUIModel<F extends FilterCriteriaDTO
@Override
public void setResults(List<? extends QuadrigeBean> results) {
// set the results in a new list to let pcs fire the property change event
delegateObject.setResults(results != null ? new ArrayList<>(results) : null);
delegateObject.setResults(CollectionUtils.isNotEmpty(results) ? new ArrayList<>(results) : null);
}
/** {@inheritDoc} */
......@@ -152,6 +154,10 @@ public abstract class AbstractReferentialMenuUIModel<F extends FilterCriteriaDTO
return Boolean.TRUE.equals(getLocal());
}
public StatusFilter getStatusFilter() {
return StatusFilter.toLocalOrNational(getLocal());
}
/** {@inheritDoc} */
@Override
public Boolean getLocal() {
......
......@@ -67,7 +67,7 @@ public class SaveAction extends AbstractReefDbSaveAction<ManageFractionsUIModel,
public void postSuccessAction() {
getModel().setModify(false);
getUI().getManageFractionsLocalUI().getHandler().reloadMenu();
getUI().getManageFractionsLocalUI().getMenuUI().getHandler().reloadComboBox();
super.postSuccessAction();
}
......
......@@ -114,7 +114,7 @@ public class DeleteFractionAction extends AbstractReefDbAction<ManageFractionsLo
if (deleteOk) {
getModel().deleteSelectedRows();
getHandler().reloadMenu();
getUI().getMenuUI().getHandler().reloadComboBox();
}
super.postSuccessAction();
......
......@@ -224,10 +224,4 @@ public class ManageFractionsLocalUIHandler extends AbstractReefDbTableUIHandler<
}
/**
* <p>reloadMenu.</p>
*/
public void reloadMenu() {
getUI().getMenuUI().getHandler().reloadComboBox();
}
}
......@@ -28,9 +28,6 @@ import fr.ifremer.reefdb.ui.swing.util.ReefDbUIs;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
/**
* Controlleur du menu pour la gestion des Fractions au niveau local
*/
......@@ -88,6 +85,6 @@ public class ManageFractionsMenuUIHandler extends AbstractReefDbUIHandler<Manage
*/
public void reloadComboBox() {
getUI().getLabelCombo().getComboBoxModel().setAllElements(getContext().getReferentialService().getFractions(getModel().getStatusFilter()));
getUI().getLabelCombo().setData(getContext().getReferentialService().getFractions(getModel().getStatusFilter()));
}
}
......@@ -23,57 +23,18 @@ package fr.ifremer.reefdb.ui.swing.content.manage.referential.pmfm.fraction.menu
* #L%
*/
import fr.ifremer.reefdb.dto.BooleanDTO;
import fr.ifremer.quadrige3.ui.core.dto.QuadrigeBean;
import fr.ifremer.reefdb.dto.ReefDbBeanFactory;
import fr.ifremer.reefdb.dto.configuration.filter.FilterCriteriaDTO;
import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
import fr.ifremer.reefdb.dto.referential.pmfm.FractionDTO;
import fr.ifremer.reefdb.service.StatusFilter;
import fr.ifremer.reefdb.ui.swing.util.AbstractReefDbBeanUIModel;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import java.util.List;
import fr.ifremer.reefdb.ui.swing.content.manage.referential.menu.DefaultReferentialMenuUIModel;
/**
* Modele du menu pour la gestion des Fractions au niveau local
*/
public class ManageFractionsMenuUIModel extends AbstractReefDbBeanUIModel<FilterCriteriaDTO, ManageFractionsMenuUIModel> implements FilterCriteriaDTO {
public class ManageFractionsMenuUIModel extends DefaultReferentialMenuUIModel {
/** Constant <code>PROPERTY_FRACTION="fraction"</code> */
public static final String PROPERTY_FRACTION = "fraction";
private static final Binder<ManageFractionsMenuUIModel, FilterCriteriaDTO> TO_BEAN_BINDER =
BinderFactory.newBinder(ManageFractionsMenuUIModel.class, FilterCriteriaDTO.class);
private static final Binder<FilterCriteriaDTO, ManageFractionsMenuUIModel> FROM_BEAN_BINDER =
BinderFactory.newBinder(FilterCriteriaDTO.class, ManageFractionsMenuUIModel.class);
private FractionDTO fraction;
/**
* <p>Constructor for ManageFractionsMenuUIModel.</p>
*/
public ManageFractionsMenuUIModel() {
super(FROM_BEAN_BINDER, TO_BEAN_BINDER);
}
/**
* <p>getStatusFilter.</p>
*
* @return a {@link fr.ifremer.reefdb.service.StatusFilter} object.
*/
public StatusFilter getStatusFilter() {
return StatusFilter.toLocalOrNational(getLocal());
}
/**
* <p>getStatusCode.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getStatusCode() {
return getStatus() == null ? null : getStatus().getCode();
}
/**
* <p>getFractionId.</p>
*
......@@ -102,103 +63,4 @@ public class ManageFractionsMenuUIModel extends AbstractReefDbBeanUIModel<Filter
firePropertyChange(PROPERTY_FRACTION, null, fraction);
}
/** {@inheritDoc} */
@Override
public List<? extends QuadrigeBean> getResults() {
return delegateObject.getResults();
}
/** {@inheritDoc} */
@Override
public void setResults(List<? extends QuadrigeBean> results) {
delegateObject.setResults(results);
// firePropertyChange(PROPERTY_RESULTS, null, results);
}
/** {@inheritDoc} */
@Override
protected FilterCriteriaDTO newBean() {
return ReefDbBeanFactory.newFilterCriteriaDTO();
}
/** {@inheritDoc} */
@Override
public String getName() {
return delegateObject.getName();
}
/** {@inheritDoc} */
@Override
public void setName(String name) {
delegateObject.setName(name);
}
@Override
public boolean isDirty() {
return delegateObject.isDirty();
}
@Override
public void setDirty(boolean dirty) {
delegateObject.setDirty(dirty);
}
@Override
public boolean isReadOnly() {
return delegateObject.isReadOnly();
}
@Override
public void setReadOnly(boolean readOnly) {
delegateObject.setReadOnly(readOnly);
}
/** {@inheritDoc} */
@Override
public StatusDTO getStatus() {
return delegateObject.getStatus();
}
/** {@inheritDoc} */
@Override
public void setStatus(StatusDTO status) {
delegateObject.setStatus(status);
}
/** {@inheritDoc} */
@Override
public BooleanDTO getIsLocal() {
return delegateObject.getIsLocal();
}
/** {@inheritDoc} */
@Override
public void setIsLocal(BooleanDTO isLocal) {
delegateObject.setIsLocal(isLocal);
}
/** {@inheritDoc} */
@Override
public Boolean getLocal() {
return delegateObject.getLocal();
}
/** {@inheritDoc} */
@Override
public void setLocal(Boolean local) {
delegateObject.setLocal(local);
}
/** {@inheritDoc} */
@Override
public boolean isStrictName() {
return delegateObject.isStrictName();
}
/** {@inheritDoc} */
@Override
public void setStrictName(boolean strictName) {
delegateObject.setStrictName(strictName);
}
}
......@@ -67,7 +67,7 @@ public class SaveAction extends AbstractReefDbSaveAction<ManageMatricesUIModel,
public void postSuccessAction() {
getModel().setModify(false);
getUI().getManageMatricesLocalUI().getHandler().reloadMenu();
getUI().getManageMatricesLocalUI().getMenuUI().getHandler().reloadComboBox();
super.postSuccessAction();
}
......
......@@ -113,7 +113,7 @@ public class DeleteMatrixAction extends AbstractReefDbAction<ManageMatricesLocal
if (deleteOk) {
getModel().deleteSelectedRows();
getHandler().reloadMenu();
getUI().getMenuUI().getHandler().reloadComboBox();
}
super.postSuccessAction();
......
......@@ -219,10 +219,4 @@ public class ManageMatricesLocalUIHandler extends AbstractReefDbTableUIHandler<M
}
/**
* <p>reloadMenu.</p>
*/
public void reloadMenu() {
getUI().getMenuUI().getHandler().reloadComboBox();
}
}
......@@ -28,9 +28,6 @@ import fr.ifremer.reefdb.ui.swing.util.ReefDbUIs;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
/**
* Controlleur du menu pour la gestion des Matrices au niveau local
*/
......@@ -88,6 +85,6 @@ public class ManageMatricesMenuUIHandler extends AbstractReefDbUIHandler<ManageM
*/
public void reloadComboBox() {
getUI().getLabelCombo().getComboBoxModel().setAllElements(getContext().getReferentialService().getMatrices(getModel().getStatusFilter()));
getUI().getLabelCombo().setData(getContext().getReferentialService().getMatrices(getModel().getStatusFilter()));
}
}
......@@ -23,57 +23,18 @@ package fr.ifremer.reefdb.ui.swing.content.manage.referential.pmfm.matrix.menu;
* #L%
*/
import fr.ifremer.reefdb.dto.BooleanDTO;
import fr.ifremer.quadrige3.ui.core.dto.QuadrigeBean;
import fr.ifremer.reefdb.dto.ReefDbBeanFactory;
import fr.ifremer.reefdb.dto.configuration.filter.FilterCriteriaDTO;
import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
import fr.ifremer.reefdb.dto.referential.pmfm.MatrixDTO;
import fr.ifremer.reefdb.service.StatusFilter;
import fr.ifremer.reefdb.ui.swing.util.AbstractReefDbBeanUIModel;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import java.util.List;
import fr.ifremer.reefdb.ui.swing.content.manage.referential.menu.DefaultReferentialMenuUIModel;
/**
* Modele du menu pour la gestion des Matrices au niveau local
*/
public class ManageMatricesMenuUIModel extends AbstractReefDbBeanUIModel<FilterCriteriaDTO, ManageMatricesMenuUIModel> implements FilterCriteriaDTO {
public class ManageMatricesMenuUIModel extends DefaultReferentialMenuUIModel {
/** Constant <code>PROPERTY_MATRIX="matrix"</code> */
public static final String PROPERTY_MATRIX = "matrix";
private static final Binder<ManageMatricesMenuUIModel, FilterCriteriaDTO> TO_BEAN_BINDER =
BinderFactory.newBinder(ManageMatricesMenuUIModel.class, FilterCriteriaDTO.class);
private static final Binder<FilterCriteriaDTO, ManageMatricesMenuUIModel> FROM_BEAN_BINDER =
BinderFactory.newBinder(FilterCriteriaDTO.class, ManageMatricesMenuUIModel.class);
private MatrixDTO matrix;
/**
* <p>Constructor for ManageMatricesMenuUIModel.</p>
*/
public ManageMatricesMenuUIModel() {
super(FROM_BEAN_BINDER, TO_BEAN_BINDER);
}
/**
* <p>getStatusFilter.</p>
*
* @return a {@link fr.ifremer.reefdb.service.StatusFilter} object.
*/
public StatusFilter getStatusFilter() {
return StatusFilter.toLocalOrNational(getLocal());
}
/**
* <p>getStatusCode.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getStatusCode() {
return getStatus() == null ? null : getStatus().getCode();
}
/**
* <p>getMatrixId.</p>
*
......@@ -102,103 +63,4 @@ public class ManageMatricesMenuUIModel extends AbstractReefDbBeanUIModel<FilterC
firePropertyChange(PROPERTY_MATRIX, null, matrix);
}
/** {@inheritDoc} */
@Override
public List<? extends QuadrigeBean> getResults() {
return delegateObject.getResults();
}
/** {@inheritDoc} */
@Override
public void setResults(List<? extends QuadrigeBean> results) {
delegateObject.setResults(results);
// firePropertyChange(PROPERTY_RESULTS, null, results);
}
/** {@inheritDoc} */
@Override
protected FilterCriteriaDTO newBean() {
return ReefDbBeanFactory.newFilterCriteriaDTO();
}
/** {@inheritDoc} */
@Override
public String getName() {
return delegateObject.getName();
}
/** {@inheritDoc} */
@Override
public void setName(String name) {
delegateObject.setName(name);
}
@Override
public boolean isDirty() {
return delegateObject.isDirty();
}
@Override
public void setDirty(boolean dirty) {
delegateObject.setDirty(dirty);
}
@Override
public boolean isReadOnly() {
return delegateObject.isReadOnly();
}
@Override
public void setReadOnly(boolean readOnly) {
delegateObject.setReadOnly(readOnly);
}