Package org.jasig.portal

Examples of org.jasig.portal.PortalException


        // Commit the transaction
        RDBMServices.commit(con);
      } catch (Exception e) {
        // Roll back the transaction
        RDBMServices.rollback(con);
        throw new PortalException("userId: "+userId+", userAgent: "+userAgent+", profileId: "+profileId, e);
      }
    } finally {
      RDBMServices.releaseConnection(con);
    }
  }
View Full Code Here


   
   
    try {
    dataHandler = (IDataHandler) Class.forName(dataHandlerClassName).newInstance();
    } catch (Exception e) {
      throw new PortalException("Unable to instantiate CUserManager IDataHandler implementation [" + dataHandlerClassName + "]", e);
    }
   
   
// Ignore since 2.0 (2003.04.21)
//    if( CSD.getParameter( Constants.CHNPARAMNOTMGR ) != null )
View Full Code Here

     xslt.transform();

   }catch( Exception e ){
      log.error(e,e);

      throw new PortalException(e);
    }// catch
  }// renderXML
View Full Code Here

     */
    private static Properties loadConfiguration()
    {
        URL config = Images.class.getResource("org/jasig/portal/channels/jsp/tree/Images.properties");
        if (config == null)
            throw new PortalException("Unable to locate default images list file.");
        Properties defaults = new Properties();
        try
        {
            defaults.load(config.openStream());
        } catch (IOException e)
        {
            throw new PortalException("Unable to load default images list file.", e);
        }
        return defaults;
    }
View Full Code Here

        }
           
        // 1) determine what JSP to forward to
        String jspId = mController.getJspToRender();
        if (jspId == null) {
                throw new PortalException("No JSP id returned by controller.");
        }
               
        String jsp = mJspMap.getProperty(jspId);
        boolean relativeToController = false;
       
        if (jsp == null) {
            throw new PortalException("No mapping available for JSP id '"
                    + jspId + "'.");
        }
           
        if (! jsp.startsWith("/"))
        {
            relativeToController = true;
            jsp =
                mController.getClass().getPackage().getName().replace('.', '/')
                    + "/"
                    + jsp;
        }

        String prefix = "";
        // jsps deployed from a car are deployed in configurable location.
        if (relativeToController ||
            mDeploymentApproach.get(mControllerClassname) == CAR_DEPLOYMENT)
        {
            prefix = getJspContextPath();
        }
       
        // 2) create req/res wrappers and push in model objects returned
        // from controller.
       
        HttpRequestFacade reqF = new HttpRequestFacade(mRequest);
        HttpResponseFacade respF = new HttpResponseFacade(mResponse);

        if (mObjects != null)
        {
            for (Iterator itr = mObjects.entrySet().iterator(); itr.hasNext();)
            {
                Map.Entry entry = (Entry) itr.next();
                reqF.setAttribute((String) entry.getKey(), entry.getValue());
            }
        }
       
        // 3) Add baseActionUrl and baseMediaUrl to the request object.
        // Since classes and JSPs get deployed in some context relative
        // classpath accessible area as determined by the Deployer's
        // getRealPath() the classes will always be loaded by the non-car class
        // loader. Therefore, we can't use traditional ways of determining
        // if the channel was deployed via CAR and the images are still
        // embedded therein. So we use this map which is updated during
        // deployment checks to tell in which way the channel is deployed.
       
        if (mControllerClassname != null)
        {
                reqF.setAttribute(
                    "baseMediaUrl",
                    runtimeData.getBaseMediaURL(mControllerClassname));
            reqF.setAttribute("baseActionUrl", runtimeData.getBaseActionURL(true));
            reqF.setAttribute("userLocale", runtimeData.getLocales()[0]);
        }
       
        // 4 render the JSP for the channel
        String jspPath = prefix + jsp;
        /*
         * When we converted to tomcat we started seeing jsp channel content
         * being swapped and some jsp's not getting their expected models
         * resulting in exceptions. The problem was traced to dispatching
         * somehow getting crossed. Therefore, we synchronize on the request
         * to serialized all jsp rendering for a single user request if
         * configured to do so.
         */
        if (cSerializeJspRendering)
        {
            synchronized(mRequest)
            {
                renderJsp(jspPath, reqF, respF);
            }
        }
        else
        {
            renderJsp(jspPath, reqF, respF);
        }
       
        // 5) if rendering successful, extract characters and use for our UI.
        if (respF.isSuccessful())
        {
            pw.print(respF.getCharacters());
        }
        else
        {
        throw new PortalException(
            "A problem occurred rendering JSP '"
                + jspPath
                + "'. Response Error Code: "
                + respF.getErrorCode()
                + (respF.getErrorMessage() != null
View Full Code Here

                LOG.debug("\n" +
                        "-       FROM:\n", new Throwable("STACK"));
            }
        }
        if (dispatch == null) {
            throw new PortalException(
                "Unable to delegate to JSP '" + jspPath + "'. " +
                mRequest.getClass().getName() + ".getRequestDispatch('" +
                jspPath + "') returned NULL.");
        }
           
        // 4.b) now render the JSP view
        try
        {
            dispatch.forward(reqF, respF);
        }
        catch (IllegalStateException e)
        {
            throw new PortalException(
                "A problem occurred rendering JSP '" + jspPath + "'",
                e);
        }
        catch (ServletException e)
        {
            throw new PortalException(
                "A problem occurred rendering JSP '" + jspPath + "'",
                e);
        }
        catch (Exception e)
        {
            throw new PortalException(
                "A problem occurred rendering JSP '" + jspPath + "'",
                e);
        }
    }
View Full Code Here

        if (mControllerClassname == null) {
          mControllerClassname = this.staticData.getParameter(CONTROLLER_KEY);
        }
         
        if (mControllerClassname == null) {
            throw new PortalException("No implementation of " +
                    "org.jasig.portal.channels.jsp.IController " +
                    "specified on ChannelStaticData.");
        }
       
        syncDeploymentOfResources(mControllerClassname);

        if (mControllerClassname == null) {
            throw new PortalException("No '" + CONTROLLER_KEY + "' specified.");
        }
           
        // now lets load and instantiate the handler
        Class c = null;
        Object obj = null;

        try
        {
            CarResources cRes = CarResources.getInstance();
            ClassLoader cl = cRes.getClassLoader();
            c = cl.loadClass(mControllerClassname);
        }
        catch (Exception e)
        {
            throw new PortalException(
                "Class '"
                    + mControllerClassname
                    + "' specified in parameter '"
                    + CONTROLLER_KEY
                    + "' could not be loaded.",e);
        }
        catch( NoClassDefFoundError e)
        {
            throw new PortalException(
                    "Class '"
                    + mControllerClassname
                    + "' specified in parameter '"
                    + CONTROLLER_KEY
                    + "' could not be loaded.",e);
        }
       
        try
        {
            obj = c.newInstance();
        }
        catch (Exception e)
        {
            throw new PortalException(
                "Unable to instantiate class '"
                    + mControllerClassname
                    + "' specified in parameter '"
                    + CONTROLLER_KEY
                    + "'.",
                e);
        }
        try
        {
            mController = (IController) obj;
        }
        catch (ClassCastException cce)
        {
            throw new PortalException(
                "Class '"
                    + mControllerClassname
                    + "' specified in parameter '"
                    + CONTROLLER_KEY
                    + "' does not implement "
View Full Code Here

        catch (Exception e){
          Utility.logMessage("ERROR", e.toString(), e);
        }
      }
      catch (Exception e){
          throw(new PortalException("CGroupsManagerServantFactory - unable to initialize servant"));
      }
      return (IServant) servant;
    }
View Full Code Here

        servant.getSessionData().highlightedGroupID = Utility.translateKeytoID(groupKey,servant.getSessionData().getUnrestrictedData());
        servant.getSessionData().defaultRootViewGroupID = Utility.translateKeytoID(groupKey,servant.getSessionData().getUnrestrictedData());
      }
      catch (Exception e){
        Utility.logMessage("ERROR", e.toString(), e);
          throw(new PortalException("CGroupsManagerServantFactory - unable to initialize servant"));
      }
        long time2 = Calendar.getInstance().getTime().getTime();
                Utility.logMessage("INFO", "CGroupsManagerFactory took  "
                        + String.valueOf((time2 - time1)) + " ms to instantiate add/remove servant");
        return (IServant) servant;
View Full Code Here

            }
        }
      }
      catch (Exception e){
          Utility.logMessage("ERROR", e.toString(), e);
          throw(new PortalException("CGroupsManagerServantFactory - unable to initialize servant"));
      }
      long time2 = System.currentTimeMillis();
      Utility.logMessage("INFO", "CGroupsManagerFactory took  "
         + String.valueOf((time2 - time1)) + " ms to instantiate selection servant");
      return (IServant) servant;
View Full Code Here

TOP

Related Classes of org.jasig.portal.PortalException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.