Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/Attic/NbAuthoringStarterAction.java,v diff -u -r1.10 -r1.11 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java 5 Aug 2005 01:34:18 -0000 1.10 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java 10 Aug 2005 06:53:14 -0000 1.11 @@ -84,6 +84,7 @@ public final static String FORM="NbAuthoringForm"; + /** * This struts actionservlet gets called when the author double clicks * on the tool icon. If the toolContentId already exists in the tool content @@ -134,9 +135,18 @@ if (!contentExists(nbService, contentId)) { // Pre-fill the form with the default content - NoticeboardContent nb = nbService.retrieveNoticeboard(NoticeboardConstants.DEFAULT_CONTENT_ID); + //NoticeboardContent nb = nbService.retrieveNoticeboard(NoticeboardConstants.DEFAULT_CONTENT_ID); + Long defaultToolContentId = nbService.getToolDefaultContentIdBySignature(NoticeboardConstants.TOOL_SIGNATURE); + // logger.debug("Default tool content id is " + defaultToolContentId); + NoticeboardContent nb = nbService.retrieveNoticeboard(defaultToolContentId); /** TODO: add a check to see if object is null */ + if (nb==null) + { + String error= "There is data missing in the database"; + logger.error(error); + throw new NbApplicationException(error); + } //create a new noticeboard object and prefill with default content, save to database NoticeboardContent nbContentNew = new NoticeboardContent(contentId,