Package org.apache.jetspeed.page

Examples of org.apache.jetspeed.page.PageNotUpdatedException


        if (pageOrTemplate instanceof FragmentDefinition)
        {
            pageManager.updateFragmentDefinition((FragmentDefinition)pageOrTemplate);
            return;
        }
        throw new PageNotUpdatedException("Unable to classify page by type: "+((pageOrTemplate != null) ? pageOrTemplate.getClass().getName() : "null"));
    }
View Full Code Here


        }
        catch (Exception e)
        {
            String msg = "Unable to update Page.";
            log.error(msg, e);
            throw new PageNotUpdatedException(msg, e);
        }
    }
View Full Code Here

        {
            // validate fragments element
            BaseFragmentsElementImpl fragmentsElementImpl = (BaseFragmentsElementImpl)fragmentsElement;
            if (!fragmentsElementImpl.validateFragments())
            {
                throw new PageNotUpdatedException("Fragments hierarchy invalid for fragments/page: " + fragmentsElement.getPath() + ", not updated.");
            }
           
            // look up and set parent folder if necessary
            FolderImpl parent = (FolderImpl)fragmentsElement.getParent();
            if (parent == null)
            {
                // access folder by path
                String pageElementPath = fragmentsElement.getPath();
                String parentPath = pageElementPath.substring(0, pageElementPath.lastIndexOf(Folder.PATH_SEPARATOR));
                if (parentPath.length() == 0)
                {
                    parentPath = Folder.PATH_SEPARATOR;
                }
                try
                {
                    parent = (FolderImpl)getFolder(parentPath);                   
                }
                catch (FolderNotFoundException fnfe)
                {
                    throw new PageNotUpdatedException("Missing parent folder: " + parentPath);
                }
               
                // check for edit access on parent folder; fragments/page
                // access not checked on create
                parent.checkAccess(JetspeedActions.EDIT);

                // update fragments/page and mark cache transaction
                fragmentsElement.setParent(parent);
                storeEntity(fragmentsElement, pageElementPath, true);
               
                // new fragments/page
                newFragmentsElement[0] = true;
            }
            else
            {
                // check for edit access on fragments/page and parent folder
                fragmentsElement.checkAccess(JetspeedActions.EDIT);

                // update fragments/page and mark cache transaction
                storeEntity(fragmentsElement, fragmentsElement.getPath(), false);

                // updated fragments/page
                newFragmentsElement[0] = false;
            }
           
            // return parent folder to update its caches after update
            return parent;
        }
        catch (PageNotUpdatedException pnue)
        {
            throw pnue;
        }
        catch (SecurityException se)
        {
            throw se;
        }
        catch (Exception e)
        {
            throw new PageNotUpdatedException("Fragments/page element " + fragmentsElement.getPath() + " not updated.", e);
        }       
    }
View Full Code Here

        {
            // validate fragment element
            BaseFragmentElementImpl baseFragmentElementImpl = (BaseFragmentElementImpl)fragment;
            if (baseFragmentElementImpl.getIdentity() == 0)
            {
                throw new PageNotUpdatedException("Properties for transient fragment cannot be updated");
            }

            // update lists only if not global or all scope
            if ((scope != null) && !scope.equals(ALL_PROPERTY_SCOPE))
            {
                // check access
                boolean checkEditAccess = !scope.equals(USER_PROPERTY_SCOPE);
                baseFragmentElementImpl.checkAccess(checkEditAccess ? JetspeedActions.EDIT : JetspeedActions.VIEW);

                // update fragment properties
                updateFragmentPropertyList(baseFragmentElementImpl, scope, null);
            }
            else
            {
                // update entire page
                BaseFragmentsElementImpl baseFragmentsElementImpl = ((baseFragmentElementImpl != null) ? baseFragmentElementImpl.getBaseFragmentsElement() : null);
                if (baseFragmentsElementImpl != null)
                {
                    updateFragmentsElement(baseFragmentsElementImpl, new boolean[]{false});
                }
                else
                {
                    throw new PageNotUpdatedException("Unable to update fragment properties: no owning page");
                }
            }
        }
        catch (PageNotUpdatedException pnue)
        {
            throw pnue;
        }
        catch (SecurityException se)
        {
            throw se;
        }
        catch (Exception e)
        {
            throw new PageNotUpdatedException("Fragment properties for fragment " + fragment.getId() + " not updated.", e);
        }       
    }
View Full Code Here

        {
            updateFragmentsElement(fragmentsElement, FragmentDefinition.DOCUMENT_TYPE, checkEditAccess);
        }
        else
        {
            throw new PageNotUpdatedException("Unable to update fragment properties: no owning page");
        }
    }
View Full Code Here

                {
                    parent = (FolderImpl)getFolder(parentPath);                   
                }
                catch (FolderNotFoundException fnfe)
                {
                    throw new PageNotUpdatedException("Missing parent folder: " + parentPath);
                }
               
                // check for edit access on parent folder; page
                // access not checked on create
                parent.checkAccess(JetspeedActions.EDIT);

                // update page and mark cache transaction
                page.setParent(parent);
                getPersistenceBrokerTemplate().store(page);
                DatabasePageManagerCache.addTransaction(new TransactionedOperation(page.getPath(), TransactionedOperation.ADD_OPERATION));

                // reset parent folder pages cache
                if (parent != null)
                {
                    parent.resetPages(false);
                }

                // notify page manager listeners
                delegator.notifyNewNode(page);
            }
            else
            {
                // check for edit access on page and parent folder
                page.checkAccess(JetspeedActions.EDIT);

                // update page and mark cache transaction
                getPersistenceBrokerTemplate().store(page);
                DatabasePageManagerCache.addTransaction(new TransactionedOperation(page.getPath(), TransactionedOperation.UPDATE_OPERATION));
               
                // reset parent folder pages cache in case
                // parent is holding an out of date copy of
                // this page that was removed from the cache
                // before this one was accessed
                if (parent != null)
                {
                    parent.resetPages(false);
                }

                // notify page manager listeners
                delegator.notifyUpdatedNode(page);
            }
        }
        catch (PageNotUpdatedException pnue)
        {
            throw pnue;
        }
        catch (SecurityException se)
        {
            throw se;
        }
        catch (Exception e)
        {
            throw new PageNotUpdatedException("Page " + page.getPath() + " not updated.", e);
        }       
    }
View Full Code Here

                {
                    parent = (FolderImpl)getFolder(parentPath);                   
                }
                catch (FolderNotFoundException fnfe)
                {
                    throw new PageNotUpdatedException("Missing parent folder: " + parentPath);
                }
               
                // check for edit access on parent folder; page
                // access not checked on create
                parent.checkAccess(JetspeedActions.EDIT);

                // update page and mark cache transaction
                page.setParent(parent);
                getPersistenceBrokerTemplate().store(page);
                DatabasePageManagerCache.addTransaction(new TransactionedOperation(page.getPath(), TransactionedOperation.ADD_OPERATION));

                // reset parent folder pages cache
                if (parent != null)
                {
                    parent.resetPages(false);
                }

                // notify page manager listeners
                delegator.notifyNewNode(page);
            }
            else
            {
                // check for edit access on page and parent folder
                page.checkAccess(JetspeedActions.EDIT);

                // update page and mark cache transaction
                getPersistenceBrokerTemplate().store(page);
                DatabasePageManagerCache.addTransaction(new TransactionedOperation(page.getPath(), TransactionedOperation.UPDATE_OPERATION));
               
                // reset parent folder pages cache in case
                // parent is holding an out of date copy of
                // this page that was removed from the cache
                // before this one was accessed
                if (parent != null)
                {
                    parent.resetPages(false);
                }

                // notify page manager listeners
                delegator.notifyUpdatedNode(page);
            }
        }
        catch (PageNotUpdatedException pnue)
        {
            throw pnue;
        }
        catch (SecurityException se)
        {
            throw se;
        }
        catch (Exception e)
        {
            throw new PageNotUpdatedException("Page " + page.getPath() + " not updated.", e);
        }       
    }
View Full Code Here

                {
                    parent = (FolderImpl)getFolder(parentPath);                   
                }
                catch (FolderNotFoundException fnfe)
                {
                    throw new PageNotUpdatedException("Missing parent folder: " + parentPath);
                }
               
                // check for edit access on parent folder; page
                // access not checked on create
                parent.checkAccess(JetspeedActions.EDIT);

                // update page and mark cache transaction
                page.setParent(parent);
                storeEntity( page, pagePath, true);

                // reset parent folder pages cache
                if (parent != null)
                {
                    parent.resetPages(false);
                }

                // notify page manager listeners
                delegator.notifyNewNode(page);
            }
            else
            {
                // check for edit access on page and parent folder
                page.checkAccess(JetspeedActions.EDIT);

                // update page and mark cache transaction
                storeEntity( page, page.getPath(), false);
               
                // reset parent folder pages cache in case
                // parent is holding an out of date copy of
                // this page that was removed from the cache
                // before this one was accessed
                if (parent != null)
                {
                    parent.resetPages(false);
                }

                // notify page manager listeners
                delegator.notifyUpdatedNode(page);
            }
        }
        catch (PageNotUpdatedException pnue)
        {
            throw pnue;
        }
        catch (SecurityException se)
        {
            throw se;
        }
        catch (Exception e)
        {
            throw new PageNotUpdatedException("Page " + page.getPath() + " not updated.", e);
        }       
    }
View Full Code Here

                {
                    parent = (FolderImpl)getFolder(parentPath);
                }
                catch (FolderNotFoundException fnfe)
                {
                    throw new PageNotUpdatedException("Missing parent folder: " + parentPath);
                }
               
                // check for edit access on parent folder; page
                // access not checked on create
                parent.checkAccess(SecuredResource.EDIT_ACTION);

                try
                {
                    // update parent folder with added page
                    parent.addPage((PageImpl)page);
                    page.setParent(parent);
                    getPersistenceBrokerTemplate().store(parent);
                }
                catch (Exception e)
                {
                    // cleanup parent folder on error
                    parent.removePage((PageImpl)page);
                    throw e;
                }

                // notify page manager listeners
                delegator.notifyNewNode(page);
            }
            else
            {
                // check for edit access on page and parent folder
                page.checkAccess(SecuredResource.EDIT_ACTION);

                // update page
                getPersistenceBrokerTemplate().store(page);

                // notify page manager listeners
                delegator.notifyUpdatedNode(page);
            }
        }
        catch (PageNotUpdatedException pnue)
        {
            throw pnue;
        }
        catch (SecurityException se)
        {
            throw se;
        }
        catch (Exception e)
        {
            throw new PageNotUpdatedException("Page " + page.getPath() + " not updated.", e);
        }
    }
View Full Code Here

        }
        catch (Exception e)
        {
            String msg = "Unable to update Page.";
            log.error(msg, e);
            throw new PageNotUpdatedException(msg, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.page.PageNotUpdatedException

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.