Package org.jasig.portal

Examples of org.jasig.portal.PortalException


            if (!ui.getPerson().isGuest()) {
                try {
                    localeManager.persistUserLocales(new Locale[] { userLocale });
                    upm.getUserLayoutManager().loadUserLayout();
                } catch (Exception e) {
                    throw new PortalException(e);
                }
            }
        }
  }
View Full Code Here


      userLayoutStore.updateUserProfile(person, userProfile);
      logger.info("resetUserLayout complete for " + person);
    } catch (Exception e) {
      final String msg = "Exception caught during resetUserLayout for " + person;
      logger.error(msg, e);
      throw new PortalException(msg, e);
    }

  }
View Full Code Here

             res.sendRedirect(res.encodeRedirectURL(sb.toString()));
        } catch (IOException ioe) {
            log.error(
                "URLUtil::redirectGet() " +
                "Failed redirecting to framework: " + sb.toString(), ioe);
            throw new PortalException(ioe);
        }
    }
View Full Code Here

            urlStr.append(up.getUPFile());
        } else {
            log.error(
                "URLUtil::redirectPost() " +
                "Invalid url, no tag found: " + thisUri);
            throw new PortalException("Invalid URL, no tag found: " +
                thisUri);
        }
   
        if (log.isDebugEnabled())
            log.debug(
                    "URLUtil::redirectPost() " +
                    "Redirecting to framework: " + urlStr.toString());
        OutputStreamWriter wr = null;
        BufferedReader br = null;
        HttpURLConnection conn = null;
   
        try {
            URL url = new URL(urlStr.toString());
            conn = (HttpURLConnection)url.openConnection();

            conn.setDoOutput(true);
            conn.setDoInput(true);

            // forward the headers
            buildHeader(req, conn);

            // post the parameters
            wr = new OutputStreamWriter(conn.getOutputStream(), charset);
            wr.write(parameters);
            wr.flush();
           
            // now let's get the results
            conn.connect(); // throws IOException
            br = new BufferedReader(
                new InputStreamReader(conn.getInputStream(), charset));
            StringBuffer results = new StringBuffer(512);
            String oneline;
            while ( (oneline = br.readLine()) != null) {
                results.append(oneline).append('\n');
            }
          
            // send the results back to the original requestor
            res.getWriter().print(results.toString());
        } catch (IOException ioe) {
            log.error(ioe, ioe);
            throw new PortalException(ioe);
        } finally {
      try {
        if (br != null)
          br.close();
        if (wr != null)
View Full Code Here

            // support which basically merges a non-persisted channel
            // into the layout
            IUserLayoutManager ulmWrapper = new TransientUserLayoutManagerWrapper(ulm);
            return ulmWrapper;
        } catch (Exception e) {
            throw new PortalException("Unable to instantiate a \""+coreUserLayoutManagerImpl.getName()+"\"",e);
        }
    }
View Full Code Here

    private IUserLayoutNodeDescription newNodeDescription = null;


    public SimpleUserLayoutManager(IPerson owner, UserProfile profile, IUserLayoutStore store) throws PortalException {
        if(owner==null) {
            throw new PortalException("A non-null owner needs to be specified.");
        }

        if(profile==null) {
            throw new PortalException("A non-null profile needs to be specified.");
        }

        this.owner=owner;
        this.profile=profile;
        this.rootNodeId = null;
View Full Code Here

    }

    public void getUserLayout(ContentHandler ch) throws PortalException {
        Document ulm=this.getUserLayoutDOM();
        if(ulm==null) {
            throw new PortalException("User layout has not been initialized");
        } else {
            getUserLayout(ulm,ch);
        }
    }
View Full Code Here

    public void getUserLayout(String nodeId, ContentHandler ch) throws PortalException {
        Document ulm=this.getUserLayoutDOM();

        if(ulm==null) {
            throw new PortalException("User layout has not been initialized");
        } else {
            Node rootNode=ulm.getElementById(nodeId);

            if(rootNode==null) {
                throw new PortalException("A requested root node (with id=\""+nodeId+"\") is not in the user layout.");
            } else {
                getUserLayout(rootNode,ch);
            }
        }
    }
View Full Code Here

            } else {
                Transformer emptyt=TransformerFactory.newInstance().newTransformer();
                emptyt.transform(new DOMSource(n), new SAXResult(ch));
            }
        } catch (Exception e) {
            throw new PortalException("Encountered an exception trying to output user layout",e);
        }
    }
View Full Code Here

        this.loadUserLayout(false);
    }

    public void loadUserLayout(boolean reload) throws PortalException {
        if(this.getLayoutStore()==null) {
            throw new PortalException("Store implementation has not been set.");
        } else {
            try {
                Document uli=this.getLayoutStore().getUserLayout(this.owner,this.profile);
                if(uli!=null) {
                    this.setUserLayoutDOM(uli);
                    clearDirtyFlag();
                    // inform listeners
                    for(Iterator i=listeners.iterator();i.hasNext();) {
                        LayoutEventListener lel=(LayoutEventListener)i.next();
                        lel.layoutLoaded();
                    }
                    updateCacheKey();
                } else {
                    throw new PortalException("Null user layout returned for ownerId=\""+owner.getID()+"\", profileId=\""+profile.getProfileId()+"\", layoutId=\""+profile.getLayoutId()+"\"");
                }
            } catch (PortalException pe) {
                throw pe;
            } catch (Exception e) {
                throw new PortalException("Exception encountered while reading a layout for userId="+this.owner.getID()+", profileId="+this.profile.getProfileId(),e);
            }
        }
    }
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.