[Rapforums-developer] src/source/edu/fullcoll/uportal/channels/rap/forum/commands UnAuthorizedModeCo
Status: Beta
Brought to you by:
brippe
From: Brad R. <br...@us...> - 2004-07-21 17:15:54
|
Update of /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5378 Added Files: UnAuthorizedModeCommand.java Log Message: no message --- NEW FILE: UnAuthorizedModeCommand.java --- /** * Copyright (c) 2004, Fullerton College. All Rights Reserved. * (http://www.fullcoll.edu) * * This software is distributed under the IBM Public Licence. Please see * the license infomation for more details at http://www.opensource.org/licenses/ibmpl.php. * * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED * ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER * EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * Each Recipient is solely responsible for determining the appropriateness of using * and distributing the Program and assumes all risks associated with its exercise * of rights under this Agreement, including but not limited to the risks and costs * of program errors, compliance with applicable laws, damage to or loss of data, * programs or equipment, and unavailability or interruption of operations. * * This software is OSI Certified Open Source Software. * OSI Certified is a certification mark of the Open Source Initiative * */ package edu.fullcoll.uportal.channels.rap.forum.commands; import org.jasig.portal.utils.XSLT; import org.jasig.portal.PortalException; import edu.fullcoll.uportal.channels.rap.forum.ForumSessionData; import edu.fullcoll.uportal.channels.rap.forum.CForum; import org.xml.sax.ContentHandler; /** * This class provides the display when any non-authorized action is attempted by the user. * * @author Brad Rippe (br...@fu...) * @version 0.9 $Revision */ public class UnAuthorizedModeCommand implements IForumCommand { /** * This method provides the rendering functionality for the unauthorized access display. * * @param forum - the main IChannel used to direct user requests * @param out - the output object for sending user responses */ public void execute(CForum forum, ForumSessionData session, ContentHandler out) throws PortalException { StringBuffer xml = new StringBuffer("<?xml version=\"1.0\" encoding=\"utf-8\"?><rap>"); xml.append("<name>"); xml.append((session.staticData).getPerson().getAttribute("displayName")); xml.append("</name><message>"); xml.append(session.unauthorizedMsg); xml.append("</message></rap>"); String stylesheet = "unauthorizedaction"; // Transform xml XSLT xslt = new XSLT(forum); xslt.setXML(xml.toString()); xslt.setXSL("CForum.ssl", stylesheet, (session.runtimeData).getBrowserInfo()); xslt.setStylesheetParameter("baseActionURL", (session.runtimeData).getBaseActionURL()); xslt.setTarget(out); xslt.transform(); } } |