Revision 08af4f8a
Added by Cherian Mathew almost 9 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmVaadinSessionUtilities.java | ||
---|---|---|
9 | 9 |
*/ |
10 | 10 |
package eu.etaxonomy.cdm.vaadin.util; |
11 | 11 |
|
12 |
import org.apache.log4j.Logger; |
|
13 |
|
|
12 | 14 |
import com.vaadin.server.VaadinSession; |
13 | 15 |
|
16 |
import eu.etaxonomy.cdm.vaadin.session.BasicEventService; |
|
14 | 17 |
import eu.etaxonomy.cdm.vaadin.session.CdmDataChangeService; |
15 | 18 |
import eu.etaxonomy.cdm.vaadin.session.SelectionService; |
16 | 19 |
|
... | ... | |
21 | 24 |
*/ |
22 | 25 |
public class CdmVaadinSessionUtilities { |
23 | 26 |
|
27 |
private static final Logger logger = Logger.getLogger(CdmVaadinSessionUtilities.class); |
|
28 |
|
|
24 | 29 |
public static void setCurrentAttribute(String name, Object value) { |
25 | 30 |
try { |
26 | 31 |
VaadinSession.getCurrent().getLockInstance().lock(); |
... | ... | |
31 | 36 |
} |
32 | 37 |
|
33 | 38 |
public static void initCdmDataChangeService() { |
39 |
if(getCurrentCdmDataChangeService() != null) { |
|
40 |
logger.warn("replacing data change service with new one"); |
|
41 |
} |
|
34 | 42 |
setCurrentAttribute(CdmDataChangeService.KEY, new CdmDataChangeService()); |
35 | 43 |
} |
36 | 44 |
|
... | ... | |
39 | 47 |
} |
40 | 48 |
|
41 | 49 |
public static void initSelectionService() { |
50 |
if(getCurrentSelectionService() != null) { |
|
51 |
logger.warn("replacing selection service with new one"); |
|
52 |
} |
|
42 | 53 |
setCurrentAttribute(SelectionService.KEY, new SelectionService()); |
43 | 54 |
} |
44 | 55 |
|
45 | 56 |
public static SelectionService getCurrentSelectionService() { |
46 | 57 |
return (SelectionService) VaadinSession.getCurrent().getAttribute(SelectionService.KEY); |
47 | 58 |
} |
59 |
|
|
60 |
public static void initBasicEventService() { |
|
61 |
if(getCurrentBasicEventService() != null) { |
|
62 |
logger.warn("replacing basic event service with new one"); |
|
63 |
} |
|
64 |
setCurrentAttribute(BasicEventService.KEY, new BasicEventService()); |
|
65 |
} |
|
66 |
|
|
67 |
public static BasicEventService getCurrentBasicEventService() { |
|
68 |
return (BasicEventService) VaadinSession.getCurrent().getAttribute(BasicEventService.KEY); |
|
69 |
} |
|
48 | 70 |
} |
Also available in: Unified diff
ConceptRelationshipComposite: added enabling / disabling of edit / delete buttons and firing event when edit concept relationship dialog is opened
EditConceptRelationshipComposite : fixed problems with async calls , adapted to updated operation class, added show in dialog method
NewTaxonBaseComposite : adapted to updated operation class
StatusComposite : added methods to update taxa table ui
D3ConceptRelationshipTree : added possibility to display one to one relationships
EditConceptRelationshipPresenter, EditConceptRelationshipPresenterTest : added method to get data to setup composite
CdmBaseUI, CdmVaadinSessionUtilities : using new basic events
CdmSpringContextHelper : fixed connection bug by closing connection after getting database metadata
CdmVaadinOperation : fixed problems with async calls
ConceptRelationshipView : setup ui changes for status composite depending on whether it is a primary of secondary composite
d3.conceptrelationshiptree_connector.js : added selected node capability