Search in sources :

Example 1 with FormDataValueConverter

use of edu.stanford.bmir.protege.web.server.form.FormDataValueConverter in project webprotege by protegeproject.

the class MorphiaProvider method get.

@Override
public Morphia get() {
    Morphia morphia = new Morphia();
    Mapper mapper = morphia.getMapper();
    mapper.getOptions().setStoreEmpties(true);
    mapper.getOptions().setObjectFactory(new CustomMorphiaObjectFactory());
    Converters converters = mapper.getConverters();
    converters.addConverter(userIdConverter);
    converters.addConverter(entityConverter);
    converters.addConverter(projectIdConverter);
    converters.addConverter(threadIdConverter);
    converters.addConverter(commentIdConverter);
    FormDataValueConverter formDataValueConverter = new FormDataValueConverter(new OWLDataFactoryImpl(), entityConverter);
    converters.addConverter(formDataValueConverter);
    converters.addConverter(new FormDataConverter(formDataValueConverter));
    converters.addConverter(collectionIdConverter);
    converters.addConverter(formIdConverter);
    converters.addConverter(tagIdConverter);
    converters.addConverter(colorConverter);
    converters.addConverter(new CollectionIdConverter());
    converters.addConverter(new CollectionItemConverter());
    morphia.map(EntityDiscussionThread.class);
    morphia.map(UserActivityRecord.class);
    morphia.map(RoleAssignment.class);
    return morphia;
}
Also used : CollectionIdConverter(edu.stanford.bmir.protege.web.server.collection.CollectionIdConverter) Mapper(org.mongodb.morphia.mapping.Mapper) FormDataConverter(edu.stanford.bmir.protege.web.server.form.FormDataConverter) Morphia(org.mongodb.morphia.Morphia) FormDataValueConverter(edu.stanford.bmir.protege.web.server.form.FormDataValueConverter) CollectionItemConverter(edu.stanford.bmir.protege.web.server.collection.CollectionItemConverter) Converters(org.mongodb.morphia.converters.Converters) OWLDataFactoryImpl(uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl)

Aggregations

CollectionIdConverter (edu.stanford.bmir.protege.web.server.collection.CollectionIdConverter)1 CollectionItemConverter (edu.stanford.bmir.protege.web.server.collection.CollectionItemConverter)1 FormDataConverter (edu.stanford.bmir.protege.web.server.form.FormDataConverter)1 FormDataValueConverter (edu.stanford.bmir.protege.web.server.form.FormDataValueConverter)1 Morphia (org.mongodb.morphia.Morphia)1 Converters (org.mongodb.morphia.converters.Converters)1 Mapper (org.mongodb.morphia.mapping.Mapper)1 OWLDataFactoryImpl (uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl)1