Search in sources :

Example 1 with MCRLabelSetTypeAdapter

use of org.mycore.frontend.classeditor.MCRLabelSetTypeAdapter in project mycore by MyCoRe-Org.

the class MCRClassificationListener method contextInitialized.

@Override
public void contextInitialized(ServletContextEvent arg0) {
    MCRJSONManager mg = MCRJSONManager.instance();
    mg.registerAdapter(new MCRCategoryTypeAdapter());
    mg.registerAdapter(new MCRCategoryIDTypeAdapter());
    mg.registerAdapter(new MCRLabelSetTypeAdapter());
    mg.registerAdapter(new MCRCategoryListTypeAdapter());
}
Also used : MCRCategoryTypeAdapter(org.mycore.frontend.classeditor.MCRCategoryTypeAdapter) MCRCategoryIDTypeAdapter(org.mycore.frontend.classeditor.MCRCategoryIDTypeAdapter) MCRLabelSetTypeAdapter(org.mycore.frontend.classeditor.MCRLabelSetTypeAdapter) MCRJSONManager(org.mycore.common.MCRJSONManager) MCRCategoryListTypeAdapter(org.mycore.frontend.classeditor.MCRCategoryListTypeAdapter)

Example 2 with MCRLabelSetTypeAdapter

use of org.mycore.frontend.classeditor.MCRLabelSetTypeAdapter in project mycore by MyCoRe-Org.

the class MCRClassificationEditorResourceTest method init.

@Before
public void init() {
    MCRJSONManager mg = MCRJSONManager.instance();
    mg.registerAdapter(new MCRCategoryTypeAdapter());
    mg.registerAdapter(new MCRCategoryIDTypeAdapter());
    mg.registerAdapter(new MCRLabelSetTypeAdapter());
    mg.registerAdapter(new MCRCategoryListTypeAdapter());
    try {
        MCRStoreManager.createStore("jportal_jpclassi", MCRMetadataStore.class);
    } catch (ReflectiveOperationException e) {
        LOGGER.error("while creating store jportal_jpclassi", e);
    }
    try {
        /* its important to set the daomock via this method because the factory could be called
             * by a previous test. In this case a class cast exception occur because MCRCategoryDAOImpl
             * was loaded. */
        MCRCategoryDAOFactory.set(CategoryDAOMock.class);
        categDAO = (CategoryDAOMock) MCRCategoryDAOFactory.getInstance();
        categDAO.init();
    } catch (Exception exc) {
        assertTrue(false);
    }
}
Also used : MCRCategoryTypeAdapter(org.mycore.frontend.classeditor.MCRCategoryTypeAdapter) MCRCategoryIDTypeAdapter(org.mycore.frontend.classeditor.MCRCategoryIDTypeAdapter) MCRLabelSetTypeAdapter(org.mycore.frontend.classeditor.MCRLabelSetTypeAdapter) MCRJSONManager(org.mycore.common.MCRJSONManager) MCRCategoryListTypeAdapter(org.mycore.frontend.classeditor.MCRCategoryListTypeAdapter) Before(org.junit.Before)

Aggregations

MCRJSONManager (org.mycore.common.MCRJSONManager)2 MCRCategoryIDTypeAdapter (org.mycore.frontend.classeditor.MCRCategoryIDTypeAdapter)2 MCRCategoryListTypeAdapter (org.mycore.frontend.classeditor.MCRCategoryListTypeAdapter)2 MCRCategoryTypeAdapter (org.mycore.frontend.classeditor.MCRCategoryTypeAdapter)2 MCRLabelSetTypeAdapter (org.mycore.frontend.classeditor.MCRLabelSetTypeAdapter)2 Before (org.junit.Before)1