Package org.apache.jetspeed.page

Examples of org.apache.jetspeed.page.PageNotFoundException


    {
        // get fragment definition
        FragmentDefinition fragmentDefinition = (FragmentDefinition) getAllNodes().subset(FragmentDefinition.DOCUMENT_TYPE).get(name);
        if (fragmentDefinition == null)
        {
            throw new PageNotFoundException("Jetspeed PSML fragment definition not found: " + name);
        }

        // check access
        if (checkAccess)
        {
View Full Code Here


            Object q = persistenceStore.newQuery(pageClass, filter);
            persistenceStore.getTransaction().begin();
            Page page = (Page) persistenceStore.getObjectByQuery(q);
            if (page == null)
            {
                throw new PageNotFoundException("Jetspeed PSML page not found: " + id);
            }

            pageCache.put(id, page);
            return page;
        }
View Full Code Here

            f = new File(this.documentRootDir, path + extension);
        }

        if (!f.exists())
        {
            throw new PageNotFoundException("Document not found: " + path);
        }

        try
        {
            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbfactory.newDocumentBuilder();

            org.w3c.dom.Document d = builder.parse(f);

            Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
            document = (Document) unmarshaller.unmarshal((org.w3c.dom.Node) d);
            document.setId(path);
            document.setPath(path);
            AbstractBaseElement documentImpl = (AbstractBaseElement)document;
            documentImpl.setHandlerFactory(handlerFactory);
            documentImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
            documentImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
        }
        catch (IOException e)
        {
            throw new PageNotFoundException("Could not load the file " + f.getAbsolutePath(), e);
        }
        catch (MarshalException e)
        {
            throw new PageNotFoundException("Could not unmarshal the file " + f.getAbsolutePath(), e);
        }
        catch (MappingException e)
        {
            throw new PageNotFoundException("Could not unmarshal the file " + f.getAbsolutePath(), e);
        }
        catch (ValidationException e)
        {
            throw new DocumentNotFoundException("Document " + f.getAbsolutePath() + " is not valid", e);
        }
        catch (SAXException e)
            {
            throw new PageNotFoundException("Could not unmarshal the file " + f.getAbsolutePath(), e);
            }
        catch (ParserConfigurationException e)
            {
            throw new PageNotFoundException("Could not unmarshal the file " + f.getAbsolutePath(), e);
            }
       

        if (document == null)
        {
View Full Code Here

TOP

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

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.