public Importable translate(Node archiveResource, Document descriptor, String contextPath, String archiveBasePath) { Announcement item = new Announcement(); item.setTitle(XPathHelper.getNodeValue("/ANNOUNCEMENT/TITLE/@value", descriptor)); item.setDescription(XPathHelper.getNodeValue("/ANNOUNCEMENT/DESCRIPTION/TEXT", descriptor)); item.setHtml(Boolean.getBoolean(XPathHelper.getNodeValue("/ANNOUNCEMENT/FLAGS/ISHTML/@value", descriptor))); item.setLiternalNewline(Boolean.getBoolean(XPathHelper.getNodeValue("/ANNOUNCEMENT/FLAGS/ISNEWLINELITERAL/@value", descriptor))); item.setPermanent(Boolean.getBoolean(XPathHelper.getNodeValue("/ANNOUNCEMENT/ISPERMANENT/@value", descriptor))); item.setStart(d); } catch (ParseException e) { log.warn("Could not parse date startdate for "+item.getTitle()+": " + e.toString()); item.setEnd(d); } catch (ParseException e) { log.warn("Could not parse date enddate for "+item.getTitle()+": " + e.toString()); log.info("Translation complete for BB55 announcement item:" + item.getTitle()); log.debug("Announcement item: " + item.toString()); item.setLegacyGroup(Blackboard55FileParser.ANNOUNCEMENT_GROUP); return item;
ac.addAnnouncementMessage(item.getTitle(), true, null, item.getDescription()); } catch (PermissionException e) { log.error("Failed to create announcement message: " + e); log.info("Created new announcement ("+item.getTitle()+") in " + siteId); } else { log.warn("Attempted to import object ("+thing.getClass()+") using wrong handler ("+this.getClass()+")");
public Importable translate(Node resourceNode, Document descriptor, String contextPath, String archiveBasePath) { Announcement item = new Announcement(); item.setLegacyGroup(item.getDisplayType()); item.setTitle(XPathHelper.getNodeValue("/ANNOUNCEMENT/TITLE/@value", descriptor)); item.setDescription(XPathHelper.getNodeValue("/ANNOUNCEMENT/DESCRIPTION/TEXT", descriptor)); item.setHtml(Boolean.getBoolean(XPathHelper.getNodeValue("/ANNOUNCEMENT/FLAGS/ISHTML/@value", descriptor))); item.setLiternalNewline(Boolean.getBoolean(XPathHelper.getNodeValue("/ANNOUNCEMENT/FLAGS/ISNEWLINELITERAL/@value", descriptor))); item.setPermanent(Boolean.getBoolean(XPathHelper.getNodeValue("/ANNOUNCEMENT/ISPERMANENT/@value", descriptor))); item.setStart(d); } catch (ParseException e) { item.setEnd(d); } catch (ParseException e) { item.setLegacyGroup(Blackboard6FileParser.ANNOUNCEMENT_GROUP); return item;