[Rapforums-developer] src/source/edu/fullcoll/uportal/channels/rap/forum CForum.java,1.4,1.5 ForumSe
Status: Beta
Brought to you by:
brippe
Update of /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17518 Modified Files: CForum.java ForumSearch.java ForumSessionData.java IDManager.java IForum.java IForumCategory.java IForumComment.java IForumsManager.java IForumThread.java ISearchManager.java IUser.java IUserManager.java NestedException.java RAPException.java RAPForum.java RAPForumCategory.java RAPForumComment.java RAPForumsManager.java RAPForumThread.java RAPIDManagerException.java RAPUser.java Log Message: no message Index: IUserManager.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/IUserManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IUserManager.java 26 Jan 2004 18:50:07 -0000 1.3 --- IUserManager.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 29,33 **** * * @author Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface IUserManager { --- 29,33 ---- * * @author Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface IUserManager { Index: ForumSearch.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/ForumSearch.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ForumSearch.java 26 Jan 2004 18:50:07 -0000 1.3 --- ForumSearch.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 36,40 **** * * @author Brad Rippe (br...@fu...) ! * @version 0.8.3 $Revision %G% */ public class ForumSearch implements ISearchManager { --- 36,40 ---- * * @author Brad Rippe (br...@fu...) ! * @version 0.9.0 $Revision %G% */ public class ForumSearch implements ISearchManager { Index: IForum.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/IForum.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IForum.java 26 Jan 2004 18:50:07 -0000 1.3 --- IForum.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 34,38 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface IForum --- 34,38 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface IForum Index: RAPForumCategory.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/RAPForumCategory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPForumCategory.java 26 Jan 2004 18:50:07 -0000 1.3 --- RAPForumCategory.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 28,32 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public class RAPForumCategory implements IForumCategory { --- 28,32 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public class RAPForumCategory implements IForumCategory { Index: RAPIDManagerException.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/RAPIDManagerException.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPIDManagerException.java 26 Jan 2004 18:50:07 -0000 1.3 --- RAPIDManagerException.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 27,31 **** * * @author Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% * @see edu.fullcoll.uportal.channels.rap.forum.RAPForumsManager */ --- 27,31 ---- * * @author Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% * @see edu.fullcoll.uportal.channels.rap.forum.RAPForumsManager */ Index: RAPForumComment.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/RAPForumComment.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPForumComment.java 26 Jan 2004 18:50:07 -0000 1.3 --- RAPForumComment.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 30,34 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% * @testcase test.edu.fullcoll.uportal.channels.rap.forum.TestRAPForumComment */ --- 30,34 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% * @testcase test.edu.fullcoll.uportal.channels.rap.forum.TestRAPForumComment */ Index: NestedException.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/NestedException.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NestedException.java 26 Jan 2004 18:50:07 -0000 1.3 --- NestedException.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 30,34 **** * * @author Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public class NestedException extends Exception { --- 30,34 ---- * * @author Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public class NestedException extends Exception { Index: IDManager.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/IDManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IDManager.java 26 Jan 2004 18:50:07 -0000 1.3 --- IDManager.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 31,35 **** * * @author Brad Rippe (br...@fu...) ! * @version 0.8.3 $Revision %G% * @testcase test.edu.fullcoll.uportal.channels.rap.forum.TestIDManager */ --- 31,35 ---- * * @author Brad Rippe (br...@fu...) ! * @version 0.9.0 $Revision %G% * @testcase test.edu.fullcoll.uportal.channels.rap.forum.TestIDManager */ Index: ISearchManager.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/ISearchManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ISearchManager.java 26 Jan 2004 18:50:07 -0000 1.3 --- ISearchManager.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 30,34 **** * * @author Brad Rippe (br...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface ISearchManager { --- 30,34 ---- * * @author Brad Rippe (br...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface ISearchManager { Index: IUser.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/IUser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IUser.java 26 Jan 2004 18:50:07 -0000 1.3 --- IUser.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 30,34 **** * * @author Brad Rippe (br...@fu...), Christopher Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface IUser { --- 30,34 ---- * * @author Brad Rippe (br...@fu...), Christopher Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface IUser { Index: RAPForumThread.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/RAPForumThread.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPForumThread.java 26 Jan 2004 18:50:07 -0000 1.3 --- RAPForumThread.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 35,39 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% * @testcase test.edu.fullcoll.uportal.channels.rap.forum.TestRAPForumThread */ --- 35,39 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% * @testcase test.edu.fullcoll.uportal.channels.rap.forum.TestRAPForumThread */ Index: CForum.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/CForum.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CForum.java 21 Jul 2004 17:16:16 -0000 1.4 --- CForum.java 4 Feb 2005 00:56:07 -0000 1.5 *************** *** 27,30 **** --- 27,31 ---- import org.jasig.portal.ChannelRuntimeData; import org.jasig.portal.ChannelRuntimeProperties; + import org.jasig.portal.PortalControlStructures; import org.jasig.portal.PortalEvent; import org.jasig.portal.PortalException; *************** *** 33,44 **** import org.jasig.portal.services.GroupService; import org.jasig.portal.services.AuthorizationService; - import org.xml.sax.ContentHandler; import org.jasig.portal.services.LogService; import org.jasig.portal.channels.permissionsmanager.CPermissionsManagerServantFactory; - import org.jasig.portal.channels.groupsmanager.CGroupsManagerServantFactory; - import org.jasig.portal.security.IAuthorizationPrincipal; import org.jasig.portal.IPermissible; import org.jasig.portal.IMultithreadedChannel; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDBException; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDBConfig; --- 34,45 ---- import org.jasig.portal.services.GroupService; import org.jasig.portal.services.AuthorizationService; import org.jasig.portal.services.LogService; import org.jasig.portal.channels.permissionsmanager.CPermissionsManagerServantFactory; import org.jasig.portal.IPermissible; + import org.jasig.portal.IPrivileged; import org.jasig.portal.IMultithreadedChannel; + import org.xml.sax.ContentHandler; + import edu.fullcoll.uportal.channels.rap.forum.database.RAPDBException; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDBConfig; *************** *** 51,54 **** --- 52,57 ---- import edu.fullcoll.uportal.channels.rap.forum.commands.SearchModeCommand; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDB; + import edu.fullcoll.uportal.channels.rap.forum.permissions.RapPermissionsManager; + import edu.fullcoll.uportal.channels.rap.forum.commands.UnAuthorizedModeCommand; import java.util.HashMap; *************** *** 56,61 **** import java.util.Calendar; import java.sql.Timestamp; ! import org.jasig.portal.security.IPermission; ! import edu.fullcoll.uportal.channels.rap.forum.commands.UnAuthorizedModeCommand; /** --- 59,64 ---- import java.util.Calendar; import java.sql.Timestamp; ! ! import javax.servlet.http.HttpServletRequest; /** *************** *** 65,74 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...), and Tung Lai Thanh (lt...@ya...) ! * @version 0.8.3 $Revision %G% */ ! public class CForum implements IPermissible, IMultithreadedChannel { public static String EVERYONE_KEY = "local.0"; ! public CForum() { init(); --- 68,77 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...), and Tung Lai Thanh (lt...@ya...) ! * @version 0.9.0 $Revision %G% */ ! public class CForum implements IPermissible, IMultithreadedChannel, IPrivileged { public static String EVERYONE_KEY = "local.0"; ! public CForum() { init(); *************** *** 80,89 **** try { // This should resemble exact forum ! tasks.put("Subscribe", "Subscribe to Forum"); ! tasks.put("Post", "Post to Forum"); ! tasks.put("Reply", "Reply to Forum"); tasks.put("Delete", "Delete Forum"); tasks.put("Create", "Create Forum"); ! tasks.put("AssignPermissions", "Assign Permissions for this Forum"); } catch(Exception e) { LogService.instance().log(LogService.ERROR, e); --- 83,91 ---- try { // This should resemble exact forum ! tasks.put("Read", "Read Forum"); ! tasks.put("Post", "Post/Reply to Forum"); tasks.put("Delete", "Delete Forum"); tasks.put("Create", "Create Forum"); ! tasks.put("AssignPermissions", "Assign Permissions for this Forum"); } catch(Exception e) { LogService.instance().log(LogService.ERROR, e); *************** *** 174,177 **** --- 176,185 ---- session.isAdminUser = true; } + + //spawn on another thread + //RAPViewXML rapViewXML = ViewXMLFactory.createRAPViewXML(); + //RAPDB dbCon = new RAPDB(); + //rapViewXML.getForumsXML(1, dbCon.getForumCount(), null); + } catch (Exception e) { LogService.instance().log(LogService.ERROR, e); *************** *** 210,213 **** --- 218,222 ---- if(modeStr.equals("AssignPermissions") && session.servantChannel == null) { + //System.out.println("AssignPermissions"); session.myvalidity = now; try { *************** *** 217,225 **** } catch (Exception e) { LogService.instance().log(LogService.ERROR, "RapForums.setRuntimeData(): Problem instantiating servant"+e); ! } } ! if(modeStr.equals("AssignGroup") && session.servantChannel == null) { session.myvalidity = now; if(hasValue(rd.getParameter("subscriberGroup"))) { --- 226,236 ---- } catch (Exception e) { LogService.instance().log(LogService.ERROR, "RapForums.setRuntimeData(): Problem instantiating servant"+e); ! } } ! /* REMOVE THE GROUP ASSIGNMENT FOR NOW ! if(modeStr.equals("AssignGroups") && session.servantChannel == null) { + System.out.println("Assign Groups"); session.myvalidity = now; if(hasValue(rd.getParameter("subscriberGroup"))) { *************** *** 230,236 **** } } - } ! if(session.servantChannel != null) { --- 241,247 ---- } } } ! */ ! if(session.servantChannel != null) { *************** *** 257,271 **** } - /*if(!hasValue(rd.getParameter("command"))) { - rd.remove("command"); - } else { - session.myvalidity = now; - }*/ - if (!hasValue(rd.getParameter("view"))) { ! if (hasValue(session.staticData.get("view"))) { ! ! if (hasValue(session.staticData.get("view"), "AssignGroups") || ! hasValue(session.staticData.get("view"), "AssignPermissions")) { rd.setParameter("view", (String)session.fromViews.get(session.staticData.getParameter("view"))); } else { --- 268,276 ---- } if (!hasValue(rd.getParameter("view"))) { ! //System.out.println("!hasValue(rd.getParameter(\"view\"))"); ! if (hasValue(session.staticData.get("view"))) { ! //hasValue(session.staticData.get("view"), "AssignGroups") || ! if (hasValue(session.staticData.get("view"), "AssignPermissions")) { rd.setParameter("view", (String)session.fromViews.get(session.staticData.getParameter("view"))); } else { *************** *** 275,281 **** } else { rd.setParameter("view", "forum"); // this can probably be removed... ! if (!rd.getParameter("view").equals(session.staticData.get("view"))) { ! session.myvalidity = now; ! } } } --- 280,286 ---- } else { rd.setParameter("view", "forum"); // this can probably be removed... ! if (!rd.getParameter("view").equals(session.staticData.get("view"))) { ! session.myvalidity = now; ! } } } *************** *** 288,301 **** } - // this is really the forum id, but let's get it working first - /*if(!hasValue(rd.getParameter("topicID"))) { - if(hasValue(rd.getParameter("topicID")) && !hasValue(rd.get("view"))) { - rd.setParameter("topicID", session.staticData.getParameter("topicID")); - } else { - rd.remove("topicID"); - session.staticData.remove("topicID"); - } - }*/ - if (hasValue(rd.getParameter("fromView"))) { session.fromViews.put(rd.getParameter("view"), rd.getParameter("fromView")); --- 293,296 ---- *************** *** 305,311 **** session.staticData.setParameter("view", rd.getParameter("view")); } if (hasValue(rd.getParameter("topicID"))) { session.staticData.setParameter("topicID", rd.getParameter("topicID")); ! } if(session.servantChannel == null) { --- 300,308 ---- session.staticData.setParameter("view", rd.getParameter("view")); } + + /* - 12/21 -remove if (hasValue(rd.getParameter("topicID"))) { session.staticData.setParameter("topicID", rd.getParameter("topicID")); ! }*/ if(session.servantChannel == null) { *************** *** 315,318 **** --- 312,329 ---- } + // if there aren't any forums in the db + // allow the user to add forums by directing them + // to the admin features + try { + + int forumCount = new RAPDB().getForumCount(); + if(forumCount == 0 && !modeStr.equals("admin")) { + modeStr = "admin"; + (session.runtimeData).setParameter("type", "adminForum"); + } + } catch(RAPDBException e) { + LogService.instance().log(LogService.ERROR, "RapForums.setRuntimeData(): "+e); + } + if (modeStr.equals("forum")) { session.mode = FORUM_MODE; *************** *** 329,343 **** } else if (modeStr.equals("AssignPermissions")) { session.mode = PERMISSIONS_MODE; ! } else if (modeStr.equals("AssignGroups")) { ! session.mode = GROUPS_MODE; } else if (modeStr.equals("back")) { //session.mode = modeStr; } else { ! session.mode = MAIN_MODE; ! } ! //System.out.println("mode "+session.mode); ! //} else { ! // session.mode = MAIN_MODE; ! //} } --- 340,350 ---- } else if (modeStr.equals("AssignPermissions")) { session.mode = PERMISSIONS_MODE; ! /*} else if (modeStr.equals("AssignGroups")) { ! session.mode = GROUPS_MODE;*/ } else if (modeStr.equals("back")) { //session.mode = modeStr; } else { ! session.mode = MAIN_MODE; // fix main in case there aren't any forums available ! } } *************** *** 347,352 **** */ public void renderXML(ContentHandler out, String uid) throws PortalException { ! long time1 = Calendar.getInstance().getTime().getTime(); ! try { ForumSessionData session = getSessionData(uid); --- 354,358 ---- */ public void renderXML(ContentHandler out, String uid) throws PortalException { ! try { ForumSessionData session = getSessionData(uid); *************** *** 358,428 **** LogService.instance().log(LogService.DEBUG, "RapForums.renderXML(): defering to servant render"); } else { ! switch (session.mode) { ! case MAIN_MODE: { ! MainModeCommand command = new MainModeCommand(); ! command.execute(this, session, out); ! session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); break; } ! case FORUM_MODE: { ! IAuthorizationPrincipal ap = session.staticData.getAuthorizationPrincipal(); ! IPermission[] perms = ap.getAllPermissions(getOwnerToken(), "Subscribe", (session.runtimeData).getParameter("forum") ); ! ! for(int i = 0; i < perms.length; i++) { ! if(perms[i].getType().equals("GRANT")) { ! ForumModeCommand command = new ForumModeCommand(); ! command.execute(this, session, out); ! session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); ! break; ! } else { ! // Unauthorized access to post ! UnAuthorizedModeCommand command = new UnAuthorizedModeCommand(); ! session.unauthorizedMsg = "Sorry, you do not have appropriate permission to view messages in this forum.<br/><br/>"+ ! "Please contact your forum administrator for appropriate access.<br/><br/>Thank you!"; ! command.execute(this, session, out); ! break; ! } ! } } ! case THREAD_MODE: { ! IAuthorizationPrincipal ap = session.staticData.getAuthorizationPrincipal(); ! IPermission[] perms = ap.getAllPermissions(getOwnerToken(), "Post", (session.runtimeData).getParameter("forum") ); ! ! for(int i = 0; i < perms.length; i++) { ! if(perms[i].getType().equals("GRANT")) { ! ThreadModeCommand command = new ThreadModeCommand(); ! command.execute(this, session, out); ! session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); ! break; ! } else { ! // Unauthorized access to post ! UnAuthorizedModeCommand command = new UnAuthorizedModeCommand(); ! session.unauthorizedMsg = "Sorry, you do not have appropriate permission to post messages to this forum.<br/><br/>"+ ! "Please contact your forum administrator for appropriate access.<br/><br/>Thank you!"; ! command.execute(this, session, out); ! break; ! } ! } } ! case POST_MODE: { ! //check authorization for user before displaying a particular view ! IAuthorizationPrincipal ap = session.staticData.getAuthorizationPrincipal(); ! IPermission[] perms = ap.getAllPermissions(getOwnerToken(), "Post", (session.runtimeData).getParameter("forum") ); ! ! for(int i = 0; i < perms.length; i++) { ! if(perms[i].getType().equals("GRANT")) { ! PostModeCommand command = new PostModeCommand(); ! command.execute(this, session, out); ! session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); ! break; ! } else { ! // Unauthorized access to post ! UnAuthorizedModeCommand command = new UnAuthorizedModeCommand(); ! session.unauthorizedMsg = "Sorry, you do not have appropriate permission to post messages to this forum.<br/><br/>"+ ! "Please contact your forum administrator for appropriate access.<br/><br/>Thank you!"; ! command.execute(this, session, out); ! break; ! } ! } break; } --- 364,403 ---- LogService.instance().log(LogService.DEBUG, "RapForums.renderXML(): defering to servant render"); } else { ! ! switch (session.mode) { ! ! case MAIN_MODE: { ! executeMainMode(out, session); break; } ! case FORUM_MODE: { ! if(RapPermissionsManager.hasPermissionsForForum(session.staticData.getAuthorizationPrincipal(), ! "Read", (String) session.runtimeData.getParameter("forum"))) { ! executeForumMode(out, session); ! } else { ! executeUnauthorizedMode(out, session, "Sorry, you do not have appropriate permission to view messages in this forum. <br/><br/>"+ ! "Please contact your forum administrator for appropriate access. <br/><br/>Thank you!"); ! } ! break; } ! case THREAD_MODE: { ! if(RapPermissionsManager.hasPermissionsForForum(session.staticData.getAuthorizationPrincipal(), ! "Read", (String) session.runtimeData.getParameter("forum"))) { ! executeThreadMode(out, session); ! } else { ! executeUnauthorizedMode(out, session, "Sorry, you do not have appropriate permission to post messages to this forum. <br/><br/>"+ ! "Please contact your forum administrator for appropriate access.<br/><br/>Thank you!"); ! } ! break; } ! case POST_MODE: { ! if(RapPermissionsManager.hasPermissionsForForum(session.staticData.getAuthorizationPrincipal(), ! "Post", (String) session.runtimeData.getParameter("forum"))) { ! executePostMode(out, session); ! ! } else { ! executeUnauthorizedMode(out, session, "Sorry, you do not have appropriate permission to post messages to this forum. <br/><br/>"+ ! "Please contact your forum administrator for appropriate access.<br/><br/> Thank you!"); ! } break; } *************** *** 437,445 **** command.execute(this, session, out); break; ! } case ABOUT_MODE: { ! AboutModeCommand aboutCommand = new AboutModeCommand(); ! aboutCommand.execute(this, session, out); ! session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); break; } --- 412,418 ---- command.execute(this, session, out); break; ! } case ABOUT_MODE: { ! executeAboutMode(out, session); break; } *************** *** 453,456 **** --- 426,475 ---- } + private void executePostMode(ContentHandler out, ForumSessionData session) + throws PortalException { + PostModeCommand command = new PostModeCommand(); + command.execute(this, session, out); + session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); + } + + private void executeThreadMode(ContentHandler out, ForumSessionData session) + throws PortalException { + ThreadModeCommand command = new ThreadModeCommand(); + command.execute(this, session, out); + session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); + } + + private void executeUnauthorizedMode( + ContentHandler out, + ForumSessionData session, + String msg) + throws PortalException { + // Unauthorized access to post + UnAuthorizedModeCommand command = new UnAuthorizedModeCommand(); + session.unauthorizedMsg = msg; + command.execute(this, session, out); + } + + private void executeMainMode(ContentHandler out, ForumSessionData session) + throws PortalException { + MainModeCommand command = new MainModeCommand(); + command.execute(this, session, out); + session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); + } + + private void executeForumMode(ContentHandler out, ForumSessionData session) + throws PortalException { + ForumModeCommand command = new ForumModeCommand(); + command.execute(this, session, out); + session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); + } + + private void executeAboutMode(ContentHandler out, ForumSessionData session) + throws PortalException { + AboutModeCommand aboutCommand = new AboutModeCommand(); + aboutCommand.execute(this, session, out); + session.lastRenderedDoc = new Timestamp(Calendar.getInstance().getTime().getTime()); + } + /** * Returns the Admin Group for uPortal *************** *** 510,514 **** everyoneGroup.addMember(forumAdminGroup); ! everyoneGroup.updateMembers(); } --- 529,533 ---- everyoneGroup.addMember(forumAdminGroup); ! everyoneGroup.updateMembers(); } *************** *** 630,633 **** --- 649,668 ---- return ""; } + + /** + * Passes portal control structure to the channel. + * @param pcs + */ + public void setPortalControlStructures(PortalControlStructures pcs) { + HttpServletRequest req = pcs.getHttpServletRequest(); + + uportalBaseURL = req.getScheme()+"://"+req.getServerName()+":"+ + req.getServerPort() + + req.getContextPath(); + } + + public String getUportalBaseURL() { + return uportalBaseURL; + } private static final int MAIN_MODE = 42; *************** *** 638,657 **** private static final int ADMIN_MODE = 47; private static final int PERMISSIONS_MODE = 48; ! private static final int GROUPS_MODE = 49; private static final int ABOUT_MODE = 31337; - // TODO: REMOVE IN ForumSessionData - //private int mode; // determines whether we return in normal or about mode - //private ChannelStaticData staticData; - //private ChannelRuntimeData runtimeData; - private IEntityGroup adminGroup; //the uportal admin group, able to add rap forum admins private IEntityGroup forumAdminGroup; // the rap forum group for admins private IEntityGroup forumManagerGroup; //the rap forum group a step down from admins ! // permissions private static HashMap tasks = null; protected static HashMap sessions = new HashMap(); - } --- 673,686 ---- private static final int ADMIN_MODE = 47; private static final int PERMISSIONS_MODE = 48; ! private static final int GROUPS_MODE = 49; // NOT IN USE YET private static final int ABOUT_MODE = 31337; private IEntityGroup adminGroup; //the uportal admin group, able to add rap forum admins private IEntityGroup forumAdminGroup; // the rap forum group for admins private IEntityGroup forumManagerGroup; //the rap forum group a step down from admins ! private static String uportalBaseURL = ""; // permissions private static HashMap tasks = null; protected static HashMap sessions = new HashMap(); } Index: ForumSessionData.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/ForumSessionData.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ForumSessionData.java 21 Jul 2004 17:17:06 -0000 1.1 --- ForumSessionData.java 4 Feb 2005 00:56:07 -0000 1.2 *************** *** 28,32 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public class ForumSessionData { --- 28,32 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public class ForumSessionData { Index: IForumThread.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/IForumThread.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IForumThread.java 26 Jan 2004 18:50:07 -0000 1.3 --- IForumThread.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 32,36 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface IForumThread { --- 32,36 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface IForumThread { Index: RAPForum.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/RAPForum.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPForum.java 26 Jan 2004 18:50:07 -0000 1.3 --- RAPForum.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 35,39 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% * @testcase test.edu.fullcoll.uportal.channels.rap.forum.TestRAPForum */ --- 35,39 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% * @testcase test.edu.fullcoll.uportal.channels.rap.forum.TestRAPForum */ Index: IForumCategory.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/IForumCategory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IForumCategory.java 26 Jan 2004 18:50:07 -0000 1.3 --- IForumCategory.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 30,34 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface IForumCategory { --- 30,34 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface IForumCategory { Index: RAPUser.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/RAPUser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPUser.java 26 Jan 2004 18:50:07 -0000 1.3 --- RAPUser.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 30,34 **** * * @author Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public class RAPUser implements IUser { --- 30,34 ---- * * @author Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public class RAPUser implements IUser { Index: RAPException.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/RAPException.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPException.java 26 Jan 2004 18:50:07 -0000 1.3 --- RAPException.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 29,33 **** * * @author Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% * @see edu.fullcoll.uportal.channels.rap.forum.NestedException */ --- 29,33 ---- * * @author Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% * @see edu.fullcoll.uportal.channels.rap.forum.NestedException */ Index: IForumsManager.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/IForumsManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IForumsManager.java 26 Jan 2004 18:50:07 -0000 1.3 --- IForumsManager.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 30,34 **** * * @author Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface IForumsManager { --- 30,34 ---- * * @author Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface IForumsManager { Index: IForumComment.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/IForumComment.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IForumComment.java 26 Jan 2004 18:50:07 -0000 1.3 --- IForumComment.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 29,33 **** * Interface for a forum comment. * @author Brad Rippe (br...@fu...), Christopher Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface IForumComment --- 29,33 ---- * Interface for a forum comment. * @author Brad Rippe (br...@fu...), Christopher Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface IForumComment Index: RAPForumsManager.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/RAPForumsManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPForumsManager.java 26 Jan 2004 18:50:07 -0000 1.3 --- RAPForumsManager.java 4 Feb 2005 00:56:07 -0000 1.4 *************** *** 36,40 **** * * @author Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% */ public class RAPForumsManager implements IForumsManager { --- 36,40 ---- * * @author Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% */ public class RAPForumsManager implements IForumsManager { |