Package org.apache.jetspeed.exception

Examples of org.apache.jetspeed.exception.JetspeedException


    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        Page page = context.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin PageAggregator.build");
        }

        Fragment root = page.getRootFragment();

        if (root == null)
        {
            throw new JetspeedException("No root Fragment found in Page");
        }

        String layoutDecorator = root.getDecorator();
        if (layoutDecorator == null)
        {
View Full Code Here


            final String innerUserFolderPath = userFolderPath;
            final PageManager innerPageManager = pageManager;
            final String innerUserName = userName;
            final User innerUser = user;
            User powerUser = userManager.getUser(this.adminUser);
            JetspeedException pe = (JetspeedException) JSSubject.doAsPrivileged(userManager.getSubject(powerUser), new PrivilegedAction()
                {
                    public Object run()
                    {
                        try
                        {
                            if (innerUserFolderPath != null)
                            {
                                innerUser.getSecurityAttributes().getAttribute(User.JETSPEED_USER_SUBSITE_ATTRIBUTE, true).setStringValue(innerUserFolderPath);
                                userManager.updateUser(innerUser);
                            }                                        
                            // create user's home folder                       
                            // deep copy from the default folder template tree, creating a deep-copy of the template
                            // in the new user's folder tree
                            Folder source = innerPageManager.getFolder(innerFolderTemplate);
                            innerPageManager.deepCopyFolder(source, innerUserFolderPath, innerUserName);
                            Folder newFolder = pageManager.getFolder(innerUserFolderPath);                           
                            newFolder.setTitle("My Home Space");
                            newFolder.setShortTitle("My Space");                            
                            return null;
                        }
                        catch (SecurityException s1)
                        {
                            return s1;
                        }
                        catch (FolderNotFoundException e1)
                        {
                            return e1;
                        }
                        catch (InvalidFolderException e1)
                        {
                            return e1;
                        }
                        catch (NodeException e1)
                        {
                            return e1;
                        }
                    }
                }, null);
               
            if(pe != null)
            {
                // rollback user creation and cascade roles, groups, etc
                try
                {
                    if (userManager.getUser(userName) != null)
                    {
                        userManager.removeUser(userName);
                    }
                }
                catch (Exception e)
                {
                    log.error("Registration Error: Failed to rollback user " + userName);
                }
                log.error("Registration Error: Failed to create user folders for " + userName + ", " + pe.toString());
                throw pe;
            }
                       
        }
        catch (Exception e)
View Full Code Here

    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        ContentPage page = context.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        // handle maximized state
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        PortletWindow window = nav.getMaximizedWindow();
        if (null != window)
View Full Code Here

    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        ContentPage page = context.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        // handle maximized state
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        PortletWindow window = nav.getMaximizedWindow();
        if (null != window)
View Full Code Here

    throws JetspeedException
    {
        ContentPage page = request.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        if (!isNonStandardAction(actionWindow))
        {
            notifyFragments(root, request, page);
        }
View Full Code Here

    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        ContentPage page = context.getPage();
        if ( null == page )
        {
            throw new JetspeedException( "Failed to find PSML Pin ContentPageAggregator.build" );
        }

        ContentFragment root = page.getRootContentFragment();

        if ( root == null )
        {
            throw new JetspeedException( "No root ContentFragment found in ContentPage" );
        }

        // add named-resources and named-resources-added maps as request attributes
        Map dynamicConfigDefault = getHeaderDynamicConfigurationDefault();
        Map namedResourcesDefault = getHeaderNamedResourcesDefault();
View Full Code Here

    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        ContentPage page = context.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        // handle maximized state
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        PortletWindow window = nav.getMaximizedWindow();
        if (null != window)
View Full Code Here

            final String innerUserFolderPath = userFolderPath;
            final PageManager innerPageManager = pageManager;
            final String innerUserName = userName;
            final User innerUser = user;
            User powerUser = userManager.getUser(this.adminUser);
            JetspeedException pe = (JetspeedException) JSSubject.doAsPrivileged(powerUser.getSubject(), new PrivilegedAction()
                {
                    public Object run()
                    {
                         try
                        {
                             if (innerUserFolderPath != null)
                             {
                                 Preferences attributes = innerUser.getUserAttributes();
                                 attributes.put(User.USER_INFO_SUBSITE, innerUserFolderPath);                                   
                             }                                        
                             // create user's home folder                       
                             // deep copy from the default folder template tree, creating a deep-copy of the template
                             // in the new user's folder tree
                            Folder source = innerPageManager.getFolder(innerFolderTemplate);
                           
                           
                            innerPageManager.deepCopyFolder(source, innerUserFolderPath, innerUserName);
                            Folder newFolder = pageManager.getFolder(innerUserFolderPath);                           
                            newFolder.setTitle("Home Folder");
                            newFolder.setShortTitle("Home");
                            
                            return null;
                        }
                         catch (FolderNotFoundException e1) {
                             return e1;
                         } catch (InvalidFolderException e1){
                             return e1;
                         } catch (NodeException e1){
                             return e1;
                         }
                    }
                }, null);
               
            if(pe != null)
            {
                // rollback user creation and cascade roles, groups, etc
                try
                {
                    if (userManager.getUser(userName) != null)
                    {
                        userManager.removeUser(userName);
                    }
                }
                catch (Exception e)
                {
                    log.error("Registration Error: Failed to rollback user " + userName);
                }
                log.error("Registration Error: Failed to create user folders for " + userName + ", " + pe.toString());
                throw pe;
            }
                       
        }
        catch (Exception e)
View Full Code Here

    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        ContentPage page = context.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        // handle maximized state
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        PortletWindow window = nav.getMaximizedWindow();
        if (null != window)
View Full Code Here

        }
        catch (Throwable e)
        {
            e.printStackTrace();
            log.error(e.toString());
            throw new JetspeedException("Jetspeed Initialization exception!", e);
        }
        finally
        {           
            Date endTime = new Date();
            long elapsedTime = (endTime.getTime() - startTime.getTime()) / 1000;
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.exception.JetspeedException

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.