[Rapforums-developer] src/source/edu/fullcoll/uportal/channels/rap/forum/commands ForumModeCommand.j
Status: Beta
Brought to you by:
brippe
From: Brad R. <br...@us...> - 2004-07-21 17:15:14
|
Update of /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5117 Modified Files: ForumModeCommand.java IForumCommand.java MainModeCommand.java PostModeCommand.java SearchModeCommand.java ThreadModeCommand.java Log Message: no message Index: MainModeCommand.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/commands/MainModeCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MainModeCommand.java 26 Jan 2004 18:49:27 -0000 1.3 --- MainModeCommand.java 21 Jul 2004 17:15:04 -0000 1.4 *************** *** 28,36 **** import org.jasig.portal.PortalException; import org.jasig.portal.services.LogService; - import edu.fullcoll.uportal.channels.rap.forum.CForum; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDB; import edu.fullcoll.uportal.channels.rap.forum.xml.ViewXMLFactory; import edu.fullcoll.uportal.channels.rap.forum.xml.RAPViewXML; import org.jdom.Document; --- 28,37 ---- import org.jasig.portal.PortalException; import org.jasig.portal.services.LogService; + import edu.fullcoll.uportal.channels.rap.forum.CForum; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDB; import edu.fullcoll.uportal.channels.rap.forum.xml.ViewXMLFactory; import edu.fullcoll.uportal.channels.rap.forum.xml.RAPViewXML; + import edu.fullcoll.uportal.channels.rap.forum.ForumSessionData; import org.jdom.Document; *************** *** 55,59 **** * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; --- 56,60 ---- * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ForumSessionData session, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; *************** *** 64,68 **** int lpg = 0; try { ! lpg = Integer.parseInt(forum.getRuntimeData().getParameter("lpg")); } catch (Exception e) { --- 65,69 ---- int lpg = 0; try { ! lpg = Integer.parseInt((session.runtimeData).getParameter("lpg")); } catch (Exception e) { *************** *** 70,79 **** } - StringWriter writer = new StringWriter(INITITAL_BUFFER_SIZE); try { ! String username = (String) forum.getStaticData().getPerson().getAttribute("displayName"); if(username == null) ! username = (String) forum.getStaticData().getPerson().getAttribute(forum.getStaticData().getPerson().USERNAME); writer.write("<username>" + username + "</username>"); --- 71,79 ---- } StringWriter writer = new StringWriter(INITITAL_BUFFER_SIZE); try { ! String username = (String) (session.staticData).getPerson().getAttribute("displayName"); if(username == null) ! username = (String) (session.staticData).getPerson().getAttribute((session.staticData).getPerson().USERNAME); writer.write("<username>" + username + "</username>"); *************** *** 105,110 **** XSLT xslt = new XSLT(forum); xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, forum.getRuntimeData().getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", forum.getRuntimeData().getBaseActionURL()); xslt.setTarget(out); xslt.transform(); --- 105,110 ---- XSLT xslt = new XSLT(forum); xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, (session.runtimeData).getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", (session.runtimeData).getBaseActionURL()); xslt.setTarget(out); xslt.transform(); Index: PostModeCommand.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/commands/PostModeCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PostModeCommand.java 26 Jan 2004 18:49:27 -0000 1.3 --- PostModeCommand.java 21 Jul 2004 17:15:04 -0000 1.4 *************** *** 23,27 **** package edu.fullcoll.uportal.channels.rap.forum.commands; - import org.jasig.portal.ChannelRuntimeData; import org.jasig.portal.utils.XSLT; import org.xml.sax.ContentHandler; --- 23,26 ---- *************** *** 30,41 **** import edu.fullcoll.uportal.channels.rap.forum.CForum; - import edu.fullcoll.uportal.channels.rap.forum.IForum; import edu.fullcoll.uportal.channels.rap.forum.IForumComment; import edu.fullcoll.uportal.channels.rap.forum.RAPForum; import edu.fullcoll.uportal.channels.rap.forum.filter.IFilterManager; import edu.fullcoll.uportal.channels.rap.forum.filter.RAPFilterManager; - import edu.fullcoll.uportal.channels.rap.forum.database.RAPDB; import edu.fullcoll.uportal.channels.rap.forum.xml.ViewXMLFactory; import edu.fullcoll.uportal.channels.rap.forum.xml.RAPViewXML; import org.jdom.Document; --- 29,39 ---- import edu.fullcoll.uportal.channels.rap.forum.CForum; import edu.fullcoll.uportal.channels.rap.forum.IForumComment; import edu.fullcoll.uportal.channels.rap.forum.RAPForum; import edu.fullcoll.uportal.channels.rap.forum.filter.IFilterManager; import edu.fullcoll.uportal.channels.rap.forum.filter.RAPFilterManager; import edu.fullcoll.uportal.channels.rap.forum.xml.ViewXMLFactory; import edu.fullcoll.uportal.channels.rap.forum.xml.RAPViewXML; + import edu.fullcoll.uportal.channels.rap.forum.ForumSessionData; import org.jdom.Document; *************** *** 60,64 **** * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; --- 58,62 ---- * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ForumSessionData session, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; *************** *** 68,75 **** StringWriter writer = new StringWriter(INITITAL_BUFFER_SIZE); try { ! postType = forum.getRuntimeData().getParameter("postType"); } catch (Exception e) { //todo write out something to the page ! e.printStackTrace(); LogService.instance().log(LogService.ERROR, e); } --- 66,73 ---- StringWriter writer = new StringWriter(INITITAL_BUFFER_SIZE); try { ! postType = (session.runtimeData).getParameter("postType"); } catch (Exception e) { //todo write out something to the page ! //e.printStackTrace(); LogService.instance().log(LogService.ERROR, e); } *************** *** 84,95 **** if (postType.equals("post")) { ! int forumID = Integer.parseInt(forum.getRuntimeData().getParameter("forum")); Document doc = rapViewXML.getPostXML(forumID); Element rootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText(forum.getStaticData().getPerson().getAttribute("displayName") + ""); rootElement.addContent(nameElement); Element userIDElement = new Element("userid"); ! userIDElement.setText(forum.getStaticData().getPerson().getAttribute("username") + ""); rootElement.addContent(userIDElement); Element postTypeElement = new Element("posttype"); --- 82,93 ---- if (postType.equals("post")) { ! int forumID = Integer.parseInt((session.runtimeData).getParameter("forum")); Document doc = rapViewXML.getPostXML(forumID); Element rootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText((session.staticData).getPerson().getAttribute("displayName") + ""); rootElement.addContent(nameElement); Element userIDElement = new Element("userid"); ! userIDElement.setText((session.staticData).getPerson().getAttribute("username") + ""); rootElement.addContent(userIDElement); Element postTypeElement = new Element("posttype"); *************** *** 101,108 **** } else if (postType.equals("doPost")) { ! int forumID = Integer.parseInt(forum.getRuntimeData().getParameter("forum")); ! String subject = forum.getRuntimeData().getParameter("subject"); ! String body = forum.getRuntimeData().getParameter("body"); ! String userID = forum.getRuntimeData().getParameter("userid"); //not currently used int modValue = 0; --- 99,106 ---- } else if (postType.equals("doPost")) { ! int forumID = Integer.parseInt((session.runtimeData).getParameter("forum")); ! String subject = (session.runtimeData).getParameter("subject"); ! String body = (session.runtimeData).getParameter("body"); ! String userID = (session.runtimeData).getParameter("userid"); //not currently used int modValue = 0; *************** *** 118,125 **** Element rootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText(forum.getStaticData().getPerson().getAttribute("displayName") + ""); rootElement.addContent(nameElement); Element userIDElement = new Element("userid"); ! userIDElement.setText(forum.getStaticData().getPerson().getAttribute("username") + ""); rootElement.addContent(userIDElement); Element postTypeElement = new Element("posttype"); --- 116,123 ---- Element rootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText((session.staticData).getPerson().getAttribute("displayName") + ""); rootElement.addContent(nameElement); Element userIDElement = new Element("userid"); ! userIDElement.setText((session.staticData).getPerson().getAttribute("username") + ""); rootElement.addContent(userIDElement); Element postTypeElement = new Element("posttype"); *************** *** 137,157 **** } else if (postType.equals("reply")) { ! int forumID = Integer.parseInt(forum.getRuntimeData().getParameter("forum")); Document doc = rapViewXML.getPostXML(forumID); Element rootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText(forum.getStaticData().getPerson().getAttribute("displayName") + ""); rootElement.addContent(nameElement); Element userIDElement = new Element("userid"); ! userIDElement.setText(forum.getStaticData().getPerson().getAttribute("username") + ""); rootElement.addContent(userIDElement); Element postTypeElement = new Element("posttype"); postTypeElement.setText("reply"); rootElement.addContent(postTypeElement); ! int threadID = Integer.parseInt(forum.getRuntimeData().getParameter("thread")); Element threadIDElement = new Element("threadid"); threadIDElement.setText(threadID + ""); rootElement.addContent(threadIDElement); ! int parentCommentID = Integer.parseInt(forum.getRuntimeData().getParameter("parentcomment")); Element parentIDElement = new Element("parentcommentid"); parentIDElement.setText(parentCommentID + ""); --- 135,155 ---- } else if (postType.equals("reply")) { ! int forumID = Integer.parseInt((session.runtimeData).getParameter("forum")); Document doc = rapViewXML.getPostXML(forumID); Element rootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText((session.staticData).getPerson().getAttribute("displayName") + ""); rootElement.addContent(nameElement); Element userIDElement = new Element("userid"); ! userIDElement.setText((session.staticData).getPerson().getAttribute("username") + ""); rootElement.addContent(userIDElement); Element postTypeElement = new Element("posttype"); postTypeElement.setText("reply"); rootElement.addContent(postTypeElement); ! int threadID = Integer.parseInt((session.runtimeData).getParameter("thread")); Element threadIDElement = new Element("threadid"); threadIDElement.setText(threadID + ""); rootElement.addContent(threadIDElement); ! int parentCommentID = Integer.parseInt((session.runtimeData).getParameter("parentcomment")); Element parentIDElement = new Element("parentcommentid"); parentIDElement.setText(parentCommentID + ""); *************** *** 184,193 **** } else if (postType.equals("doReply")) { ! int forumID = Integer.parseInt(forum.getRuntimeData().getParameter("forum")); ! String subject = forum.getRuntimeData().getParameter("subject"); ! String body = forum.getRuntimeData().getParameter("body"); ! String userID = forum.getRuntimeData().getParameter("userid"); ! int threadID = Integer.parseInt(forum.getRuntimeData().getParameter("thread")); ! int parentCommentID = Integer.parseInt(forum.getRuntimeData().getParameter("parentcomment")); //not currently used int modValue = 0; --- 182,191 ---- } else if (postType.equals("doReply")) { ! int forumID = Integer.parseInt((session.runtimeData).getParameter("forum")); ! String subject = (session.runtimeData).getParameter("subject"); ! String body = (session.runtimeData).getParameter("body"); ! String userID = (session.runtimeData).getParameter("userid"); ! int threadID = Integer.parseInt((session.runtimeData).getParameter("thread")); ! int parentCommentID = Integer.parseInt((session.runtimeData).getParameter("parentcomment")); //not currently used int modValue = 0; *************** *** 204,211 **** Element rootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText(forum.getStaticData().getPerson().getAttribute("displayName") + ""); rootElement.addContent(nameElement); Element userIDElement = new Element("userid"); ! userIDElement.setText(forum.getStaticData().getPerson().getAttribute("username") + ""); rootElement.addContent(userIDElement); Element postTypeElement = new Element("posttype"); --- 202,209 ---- Element rootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText((session.staticData).getPerson().getAttribute("displayName") + ""); rootElement.addContent(nameElement); Element userIDElement = new Element("userid"); ! userIDElement.setText((session.staticData).getPerson().getAttribute("username") + ""); rootElement.addContent(userIDElement); Element postTypeElement = new Element("posttype"); *************** *** 233,238 **** XSLT xslt = new XSLT(forum); xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, forum.getRuntimeData().getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", forum.getRuntimeData().getBaseActionURL()); xslt.setTarget(out); xslt.transform(); --- 231,236 ---- XSLT xslt = new XSLT(forum); xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, (session.runtimeData).getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", (session.runtimeData).getBaseActionURL()); xslt.setTarget(out); xslt.transform(); Index: ThreadModeCommand.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/commands/ThreadModeCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ThreadModeCommand.java 26 Jan 2004 18:49:27 -0000 1.3 --- ThreadModeCommand.java 21 Jul 2004 17:15:04 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- import org.jasig.portal.PortalException; import org.jasig.portal.services.LogService; + import edu.fullcoll.uportal.channels.rap.forum.CForum; import edu.fullcoll.uportal.channels.rap.forum.filter.IFilterManager; *************** *** 34,43 **** --- 35,48 ---- import edu.fullcoll.uportal.channels.rap.forum.xml.ViewXMLFactory; import edu.fullcoll.uportal.channels.rap.forum.xml.RAPViewXML; + import edu.fullcoll.uportal.channels.rap.forum.ForumSessionData; + import org.jdom.Document; import org.jdom.Element; import org.jdom.output.XMLOutputter; + import java.io.StringWriter; import java.util.Iterator; + /** * This class provides the rendering method for threads in rap forum. *************** *** 56,60 **** * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; --- 61,65 ---- * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ForumSessionData session, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; *************** *** 65,69 **** int lpg = 0; try { ! lpg = Integer.parseInt(forum.getRuntimeData().getParameter("lpg")); } catch (Exception e) { --- 70,74 ---- int lpg = 0; try { ! lpg = Integer.parseInt((session.runtimeData).getParameter("lpg")); } catch (Exception e) { *************** *** 81,86 **** // Paging is setup to display only 5 threads at a time' RAPViewXML rapViewXML = ViewXMLFactory.createRAPViewXML(); ! Document doc = rapViewXML.getCommentsXML(Integer.parseInt(forum.getRuntimeData().getParameter("forum")), ! Integer.parseInt(forum.getRuntimeData().getParameter("thread")), startRow, endRow); Element forumsRootElement = doc.getRootElement(); --- 86,91 ---- // Paging is setup to display only 5 threads at a time' RAPViewXML rapViewXML = ViewXMLFactory.createRAPViewXML(); ! Document doc = rapViewXML.getCommentsXML(Integer.parseInt((session.runtimeData).getParameter("forum")), ! Integer.parseInt((session.runtimeData).getParameter("thread")), startRow, endRow); Element forumsRootElement = doc.getRootElement(); *************** *** 108,112 **** Element nameElement = new Element("username"); ! nameElement.setText(forum.getStaticData().getPerson().getAttribute("displayName") + ""); forumsRootElement.addContent(nameElement); --- 113,117 ---- Element nameElement = new Element("username"); ! nameElement.setText((session.staticData).getPerson().getAttribute("displayName") + ""); forumsRootElement.addContent(nameElement); *************** *** 128,133 **** XSLT xslt = new XSLT(forum); xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, forum.getRuntimeData().getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", forum.getRuntimeData().getBaseActionURL()); xslt.setTarget(out); xslt.transform(); --- 133,138 ---- XSLT xslt = new XSLT(forum); xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, (session.runtimeData).getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", (session.runtimeData).getBaseActionURL()); xslt.setTarget(out); xslt.transform(); Index: IForumCommand.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/commands/IForumCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IForumCommand.java 26 Jan 2004 18:49:27 -0000 1.3 --- IForumCommand.java 21 Jul 2004 17:15:04 -0000 1.4 *************** *** 29,32 **** --- 29,33 ---- import edu.fullcoll.uportal.channels.rap.forum.CForum; + import edu.fullcoll.uportal.channels.rap.forum.ForumSessionData; /** *************** *** 44,47 **** * @param out the output stream */ ! public void execute(CForum forum, ContentHandler out) throws PortalException; } --- 45,48 ---- * @param out the output stream */ ! public void execute(CForum forum, ForumSessionData session, ContentHandler out) throws PortalException; } Index: SearchModeCommand.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/commands/SearchModeCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SearchModeCommand.java 26 Jan 2004 18:49:27 -0000 1.3 --- SearchModeCommand.java 21 Jul 2004 17:15:04 -0000 1.4 *************** *** 25,39 **** import org.jasig.portal.ChannelRuntimeData; import org.jasig.portal.utils.XSLT; - import org.xml.sax.ContentHandler; import org.jasig.portal.PortalException; import org.jasig.portal.services.LogService; - import edu.fullcoll.uportal.channels.rap.forum.CForum; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDB; import edu.fullcoll.uportal.channels.rap.forum.xml.ViewXMLFactory; import edu.fullcoll.uportal.channels.rap.forum.xml.RAPViewXML; import org.jdom.Document; import org.jdom.Element; import org.jdom.output.XMLOutputter; import java.io.StringWriter; --- 25,43 ---- import org.jasig.portal.ChannelRuntimeData; import org.jasig.portal.utils.XSLT; import org.jasig.portal.PortalException; import org.jasig.portal.services.LogService; + import org.xml.sax.ContentHandler; + + import edu.fullcoll.uportal.channels.rap.forum.CForum; + import edu.fullcoll.uportal.channels.rap.forum.ForumSessionData; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDB; import edu.fullcoll.uportal.channels.rap.forum.xml.ViewXMLFactory; import edu.fullcoll.uportal.channels.rap.forum.xml.RAPViewXML; + import org.jdom.Document; import org.jdom.Element; import org.jdom.output.XMLOutputter; + import java.io.StringWriter; *************** *** 59,63 **** * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; --- 63,67 ---- * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ForumSessionData session, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; *************** *** 81,129 **** // get the runtime parameters // query string for search ! if (forum.getRuntimeData().getParameter("q") != null) { try { ! searchQry = forum.getRuntimeData().getParameter("q"); } catch (Exception e) { } } // user to search on ! if (forum.getRuntimeData().getParameter("user") != null) { try { ! searchUser = forum.getRuntimeData().getParameter("user"); } catch (Exception e) { } } ! if (forum.getRuntimeData().getParameter("range") != null) { try { ! range = Integer.parseInt(forum.getRuntimeData().getParameter("range")); } catch (Exception e) { } } ! if (forum.getRuntimeData().getParameter("category") != null) { try { ! searchCategory = forum.getRuntimeData().getParameter("category"); } catch (Exception e) { } } ! if (forum.getRuntimeData().getParameter("lf") != null) { try { ! lastForumID = Integer.parseInt(forum.getRuntimeData().getParameter("lf")); } catch (Exception e) { } } ! if (forum.getRuntimeData().getParameter("lt") != null) { try { ! lastThreadID = Integer.parseInt(forum.getRuntimeData().getParameter("lt")); } catch (Exception e) { } } ! if (forum.getRuntimeData().getParameter("lc") != null) { try { ! lastCommentID = Integer.parseInt(forum.getRuntimeData().getParameter("lc")); } catch (Exception e) { } } ! if (forum.getRuntimeData().getParameter("p") != null) { try { ! page = Integer.parseInt(forum.getRuntimeData().getParameter("p")); } catch (Exception e) { } } try { ! writer.write("<username>" + forum.getStaticData().getPerson().getAttribute("displayName") + "</username>"); // Get the xml from the query --- 85,133 ---- // get the runtime parameters // query string for search ! if ((session.runtimeData).getParameter("q") != null) { try { ! searchQry = (session.runtimeData).getParameter("q"); } catch (Exception e) { } } // user to search on ! if ((session.runtimeData).getParameter("user") != null) { try { ! searchUser = (session.runtimeData).getParameter("user"); } catch (Exception e) { } } ! if ((session.runtimeData).getParameter("range") != null) { try { ! range = Integer.parseInt((session.runtimeData).getParameter("range")); } catch (Exception e) { } } ! if ((session.runtimeData).getParameter("category") != null) { try { ! searchCategory = (session.runtimeData).getParameter("category"); } catch (Exception e) { } } ! if ((session.runtimeData).getParameter("lf") != null) { try { ! lastForumID = Integer.parseInt((session.runtimeData).getParameter("lf")); } catch (Exception e) { } } ! if ((session.runtimeData).getParameter("lt") != null) { try { ! lastThreadID = Integer.parseInt((session.runtimeData).getParameter("lt")); } catch (Exception e) { } } ! if ((session.runtimeData).getParameter("lc") != null) { try { ! lastCommentID = Integer.parseInt((session.runtimeData).getParameter("lc")); } catch (Exception e) { } } ! if ((session.runtimeData).getParameter("p") != null) { try { ! page = Integer.parseInt((session.runtimeData).getParameter("p")); } catch (Exception e) { } } try { ! writer.write("<username>" + (session.staticData).getPerson().getAttribute("displayName") + "</username>"); // Get the xml from the query *************** *** 159,164 **** // Transform xml xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, forum.getRuntimeData().getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", forum.getRuntimeData().getBaseActionURL()); xslt.setTarget(out); xslt.transform(); --- 163,168 ---- // Transform xml xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, (session.runtimeData).getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", (session.runtimeData).getBaseActionURL()); xslt.setTarget(out); xslt.transform(); Index: ForumModeCommand.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/commands/ForumModeCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ForumModeCommand.java 26 Jan 2004 18:49:27 -0000 1.3 --- ForumModeCommand.java 21 Jul 2004 17:15:04 -0000 1.4 *************** *** 33,36 **** --- 33,37 ---- import edu.fullcoll.uportal.channels.rap.forum.xml.ViewXMLFactory; import edu.fullcoll.uportal.channels.rap.forum.xml.RAPViewXML; + import edu.fullcoll.uportal.channels.rap.forum.ForumSessionData; import org.jdom.Document; *************** *** 52,56 **** * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; --- 53,57 ---- * @param out - the output object for sending user responses */ ! public void execute(CForum forum, ForumSessionData session, ContentHandler out) throws PortalException { final int INITITAL_BUFFER_SIZE = 5000; String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; *************** *** 61,65 **** int lpg = 0; try { ! lpg = Integer.parseInt(forum.getRuntimeData().getParameter("lpg")); } catch (Exception e) { --- 62,66 ---- int lpg = 0; try { ! lpg = Integer.parseInt((session.runtimeData).getParameter("lpg")); } catch (Exception e) { *************** *** 77,85 **** RAPViewXML rapViewXML = ViewXMLFactory.createRAPViewXML(); ! Document doc = rapViewXML.getThreadsXML(Integer.parseInt(forum.getRuntimeData().getParameter("forum")), startRow, endRow); Element forumsRootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText(forum.getStaticData().getPerson().getAttribute("displayName") + ""); forumsRootElement.addContent(nameElement); --- 78,86 ---- RAPViewXML rapViewXML = ViewXMLFactory.createRAPViewXML(); ! Document doc = rapViewXML.getThreadsXML(Integer.parseInt((session.runtimeData).getParameter("forum")), startRow, endRow); Element forumsRootElement = doc.getRootElement(); Element nameElement = new Element("username"); ! nameElement.setText((session.staticData).getPerson().getAttribute("displayName") + ""); forumsRootElement.addContent(nameElement); *************** *** 89,93 **** XMLOutputter outputter = new XMLOutputter(" ", true); ! outputter.output(forumsRootElement, writer); } catch (Exception e) { //todo write out something to the page --- 90,94 ---- XMLOutputter outputter = new XMLOutputter(" ", true); ! outputter.output(forumsRootElement, writer); } catch (Exception e) { //todo write out something to the page *************** *** 102,107 **** XSLT xslt = new XSLT(forum); xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, forum.getRuntimeData().getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", forum.getRuntimeData().getBaseActionURL()); xslt.setTarget(out); xslt.transform(); --- 103,108 ---- XSLT xslt = new XSLT(forum); xslt.setXML(xml); ! xslt.setXSL("CForum.ssl", stylesheet, (session.runtimeData).getBrowserInfo()); ! xslt.setStylesheetParameter("baseActionURL", (session.runtimeData).getBaseActionURL()); xslt.setTarget(out); xslt.transform(); |