@Test public void testFindById() throws Exception { List<BBCode> bbcodes = Arrays.asList(createBBCode("foo", "replacement", "description", "example", true, true)); bbcodeService.save(bbcodes); assertNodeExists(bbcodesPath + "/" + "foo="); BBCode actual = bbcodeService.findById("foo="); assertNotNull(actual); assertEquals("foo", actual.getTagName()); assertEquals("replacement", actual.getReplacement()); assertEquals("description", actual.getDescription()); assertEquals("example", actual.getExample()); assertEquals(true, actual.isOption()); assertEquals(true, actual.isActive()); }
public BBCode findById(String id) throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); BBCode bbCode = new BBCode(); Node bbcNode; try { Node bbCodeHome = getBBcodeHome(sProvider); try { bbcNode = bbCodeHome.getNode(id); bbCode = nodeToBBCode(bbcNode); } catch (Exception e) { log.error("Error loading BBCode" + id, e); } } finally { sProvider.close(); } return bbCode; }
BBCodeServiceImpl implements Startable, BBCodeService, ManagementAware { public BBCode findById(String id) throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); BBCode bbCode = new BBCode(); Node bbcNode; try { Node bbCodeHome = getBBcodeHome(sProvider); try { bbcNode = bbCodeHome.getNode(id); bbCode = nodeToBBCode(bbcNode); } catch (Exception e) { log.error("Error loading BBCode" + id, e); } } finally { sProvider.close(); } return bbCode; } }
BBCodeServiceImpl implements Startable, BBCodeService, ManagementAware { public BBCode findById(String id) throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); BBCode bbCode = new BBCode(); Node bbcNode; try { Node bbCodeHome = getBBcodeHome(sProvider); try { bbcNode = bbCodeHome.getNode(id); bbCode = nodeToBBCode(bbcNode); } catch (Exception e) { log.error("Error loading BBCode" + id, e); } } finally { sProvider.close(); } return bbCode; } BBCodeServiceImpl();  BBCodeServiceImpl(KSDataLocation dataLocator); }
BBCodeServiceImpl implements Startable, BBCodeService, ManagementAware { public BBCode findById(String id) throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); BBCode bbCode = new BBCode(); Node bbcNode; try { Node bbCodeHome = getBBcodeHome(sProvider); try { bbcNode = bbCodeHome.getNode(id); bbCode = nodeToBBCode(bbcNode); } catch (Exception e) { log.error("Error loading BBCode" + id, e); } } finally { sProvider.close(); } return bbCode; } BBCodeServiceImpl();  BBCodeServiceImpl(KSDataLocation dataLocator); void registerBBCodePlugin(BBCodePlugin plugin); void initDefaultBBCodes(); void save(List<BBCode> bbcodes); List<BBCode> getAll(); List<String> getActive(); BBCode findById(String id); void delete(String bbcodeId); void start(); void stop(); void setContext(ManagementContext context); KSDataLocation getDataLocator(); void setDataLocator(KSDataLocation dataLocator); List<BBCodePlugin> getPlugins(); void setPlugins(List<BBCodePlugin> plugins); }
BBCodeServiceImpl implements Startable, BBCodeService, ManagementAware { public BBCode findById(String id) throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); BBCode bbCode = new BBCode(); Node bbcNode; try { Node bbCodeHome = getBBcodeHome(sProvider); try { bbcNode = bbCodeHome.getNode(id); bbCode = nodeToBBCode(bbcNode); } catch (Exception e) { log.error("Error loading BBCode" + id, e); } } finally { sProvider.close(); } return bbCode; } BBCodeServiceImpl();  BBCodeServiceImpl(KSDataLocation dataLocator); void registerBBCodePlugin(BBCodePlugin plugin); void initDefaultBBCodes(); void save(List<BBCode> bbcodes); List<BBCode> getAll(); List<String> getActive(); BBCode findById(String id); void delete(String bbcodeId); void start(); void stop(); void setContext(ManagementContext context); KSDataLocation getDataLocator(); void setDataLocator(KSDataLocation dataLocator); List<BBCodePlugin> getPlugins(); void setPlugins(List<BBCodePlugin> plugins); final static String BBCODE_NODE_TYPE; final static String BBCODE_HOME_NODE_TYPE; }