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