import eu.etaxonomy.cdm.model.description.FeatureNode;\r
import eu.etaxonomy.cdm.model.description.FeatureTree;\r
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;\r
-import eu.etaxonomy.cdm.model.name.Rank;\r
\r
\r
/**\r
//database validation status (create, update, validate ...)\r
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;\r
static final Source berlinModelSource = BerlinModelSources.EDIT_Diptera();\r
- static final ICdmDataSource cdmDestination = CdmDestinations.localH2Diptera();\r
+ static final ICdmDataSource cdmDestination = CdmDestinations.localH2();\r
static final UUID secUuid = UUID.fromString("06fd671f-1226-4e3b-beca-1959b3b32e20");\r
static final int sourceSecId = 1000000;\r
static final UUID featureTreeUuid = UUID.fromString("ae9615b8-bc60-4ed0-ad96-897f9226d568");\r
//make feature tree\r
app = bmImport.getCdmApp();\r
FeatureTree tree = TreeCreator.flatTree(featureTreeUuid, bmImportConfigurator.getFeatureMap(), featureKeyList);\r
+ // add image\r
+ FeatureNode imageNode = FeatureNode.NewInstance(Feature.IMAGE());\r
+ tree.getRoot().addChild(imageNode);\r
+ // add distribution\r
FeatureNode distributionNode = FeatureNode.NewInstance(Feature.DISTRIBUTION());\r
tree.getRoot().addChild(distributionNode);\r
app.getDescriptionService().saveFeatureTree(tree);\r
getDefault().observers.add(observer);
}
+ /**
+ * Remove observer from notify queue
+ * @param observer
+ */
+ public void unregister(ICdmPostDataChangeObserver observer){
+ getDefault().observers.remove(observer);
+ }
+
public void delayedNotify(){
if(delayed && changeEvents.size() > 0){
for( ICdmPostDataChangeObserver observer : observers){
\r
representation = term.getPreferredRepresentation(languages);\r
if(representation != null){\r
- if(representation.getText() != null && !representation.getText().isEmpty()){\r
+ if(representation.getText() != null && representation.getText().length() != 0){\r
json.element("representation_L10n", representation.getText());\r
- } else if (representation.getLabel() != null && !representation.getLabel().isEmpty()) {\r
+ } else if (representation.getLabel() != null && representation.getLabel().length() !=0) {\r
json.element("representation_L10n", representation.getLabel());\r
} else {\r
json.element("representation_L10n", representation.getAbbreviatedLabel());\r
*/
package eu.etaxonomy.cdm.api.conversation;
-import java.util.Map;
-
import javax.sql.DataSource;
import org.apache.log4j.Logger;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
-import org.springframework.transaction.support.ResourceHolder;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener;
this.dataSource = dataSource;
this.sessionFactory = sessionFactory;
this.transactionManager = transactionManager;
+
+ bind();
+
+
+ // moved this from editor to here
+ //
+ if(TransactionSynchronizationManager.hasResource(getDataSource())){
+ TransactionSynchronizationManager.unbindResource(getDataSource());
+ }
}
/**
}
try{
- // FIXME for debugging -> remove
- Map resourceMap = TransactionSynchronizationManager.getResourceMap();
-
logger.info("Starting new Synchronization in TransactionSynchronizationManager.");
TransactionSynchronizationManager.initSynchronization();
* Commit the running transaction.
*/
public void commit(){
- commit(false);
+ commit(true);
}
/**
}
return null;
}
-
-
- /**
- * close the session if it is still open
- */
- public void dispose() {
- if (longSession != null && longSession.isOpen()){
- longSession.close();
- }
- }
/**
* @return the session associated with this conversation manager
public void registerForDataStoreChanges(IConversationEnabled observer) {
CdmPostDataChangeObservableListener.getDefault().register(observer);
}
+
+ /**
+ * Register to get updated after any interaction with the datastore
+ */
+ public void unregisterForDataStoreChanges(IConversationEnabled observer) {
+ CdmPostDataChangeObservableListener.getDefault().unregister(observer);
+ }
}
@After
public void tearDown(){
- conversationHolder1.dispose();
- conversationHolder2.dispose();
- conversationHolder3.dispose();
}
/**
<feature
id="eu.etaxonomy.cdmLibrary"
label="CDM Library"
- version="2.1.0.42"
+ version="2.1.0.50"
provider-name="EDIT">
<description url="http://www.example.com/description">
Bundle-ManifestVersion: 2
Bundle-Name: CDM Library Plug-in
Bundle-SymbolicName: eu.etaxonomy.cdmLibrary;singleton:=true
-Bundle-Version: 2.1.0.42
+Bundle-Version: 2.1.0.50
Bundle-ClassPath: aspectjrt-1.5.4.jar,
antlr-2.7.6.jar,
asm-attrs.jar,
<description url="file:///P:\eclipse\cdmlib\eclipse-updateSite">
Eine schöne Update Site
</description>
- <feature url="features/eu.etaxonomy.cdmLibrary_2.1.0.42.jar" id="eu.etaxonomy.cdmLibrary" version="2.1.0.42">
+ <feature url="features/eu.etaxonomy.cdmLibrary_2.1.0.50.jar" id="eu.etaxonomy.cdmLibrary" version="2.1.0.50">
<category name="CDM Library"/>
</feature>
<category-def name="CDM Library" label="CDM Library">