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
;
22 public class DefaultNewEntityListener
implements NewEntityListener
{
24 private static final Logger logger
= Logger
.getLogger(DefaultNewEntityListener
.class);
27 public void onCreate(CdmBase cdmBase
) {
28 logger
.info("New Entity created : " + cdmBase
);
29 if(CdmApplicationState
.getCurrentAppConfig() instanceof CdmApplicationRemoteController
){
30 ICdmEntitySession activeSession
= ((CdmApplicationRemoteController
)CdmApplicationState
.getCurrentAppConfig()).getCdmEntitySessionManager().getActiveSession();
31 if(activeSession
!= null) {
32 activeSession
.addNewCdmEntity(cdmBase
);