3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.session
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationRemoteController
;
15 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationState
;
16 import eu
.etaxonomy
.cdm
.model
.NewEntityListener
;
17 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
24 public class DefaultNewEntityListener
implements NewEntityListener
{
26 private static final Logger logger
= Logger
.getLogger(DefaultNewEntityListener
.class);
29 * @see eu.etaxonomy.cdm.model.NewEntityListener#onCreate(eu.etaxonomy.cdm.model.common.CdmBase)
32 public void onCreate(CdmBase cdmBase
) {
33 logger
.info("New Entity created : " + cdmBase
);
34 if(CdmApplicationState
.getCurrentAppConfig() instanceof CdmApplicationRemoteController
){
35 ICdmEntitySession activeSession
= ((CdmApplicationRemoteController
)CdmApplicationState
.getCurrentAppConfig()).getCdmEntitySessionManager().getActiveSession();
36 if(activeSession
!= null) {
37 activeSession
.addNewCdmEntity(cdmBase
);