Package org.apache.roller

Examples of org.apache.roller.RollerException


            Session session = ((HibernatePersistenceStrategy)strategy).getSession();
            Criteria criteria = session.createCriteria(FolderAssoc.class);
            criteria.add(Expression.eq("folder", folder));
            return criteria.list();
        } catch (HibernateException e) {
            throw new RollerException(e);
        }
    }
View Full Code Here


            int entryCount = criteria.list().size();
           
            // Return true if we have bookmarks or (, failing that, then checking) if we have children
            return (entryCount > 0 || folder.getFolders().size() > 0);
        } catch (HibernateException e) {
            throw new RollerException(e);
        }
    }
View Full Code Here

            Criteria criteria = session.createCriteria(FolderAssoc.class);
            criteria.add(Expression.eq("folder", child));
            criteria.add(Expression.eq("ancestorFolder", ancestor));
            ret = criteria.list().size() > 0;
        } catch (HibernateException e) {
            throw new RollerException(e);
        }
        return ret;
    }
View Full Code Here

            // save our updated website
            userMgr.saveWebsite(website);
           
        } catch (Exception e) {
            mLogger.error("ERROR in action",e);
            throw new RollerException( e );
        }      
    }
View Full Code Here

     * @param is Read file from input stream
     */
    public void saveFile(String weblogHandle, String name, long size, InputStream is)
    throws RollerException {
        if (!canSave(weblogHandle, name, size, new RollerMessages())) {
            throw new RollerException("ERROR: upload denied");
        }
       
        byte[] buffer = new byte[8192];
        int bytesRead = 0;
        String dir = this.upload_dir;
       
        File dirPath = new File(dir + File.separator + weblogHandle);
        if (!dirPath.exists()) {
            dirPath.mkdirs();
        }
        OutputStream bos = null;
        try {
            bos = new FileOutputStream(
                    dirPath.getAbsolutePath() + File.separator + name);
            while ((bytesRead = is.read(buffer, 0, 8192)) != -1) {
                bos.write(buffer, 0, bytesRead);
            }
        } catch (Exception e) {
            throw new RollerException("ERROR uploading file", e);
        } finally {
            try {
                bos.flush();
                bos.close();
            } catch (Exception ignored) {}
View Full Code Here

       
        // NOTE: let the caller handle missing website/page instead
        if ( mWebsite==null || mPage==null )
        {           
            String msg = "Invalid pathInfo: "+StringUtils.join(pathInfo,"|");
            throw new RollerException(msg);
        }
    }      
View Full Code Here

            PageModel pageModel = (PageModel)pageModelClass.newInstance();
            pageModel.init(rreq);
            ctx.put("pageModel", pageModel );
            ctx.put("pages", pageModel.getPages());
        } catch (Exception e) {
            throw new RollerException("ERROR creating Page Model",e);
        }
       
        // Add Velocity page helper to context
        PageHelper pageHelper = new PageHelper(request, response, ctx);
        Roller roller = RollerFactory.getRoller();
View Full Code Here

       
        try {
            URL absUrl = RequestUtils.absoluteURL(request, "/");
            ctx.put("host", absUrl.getHost());
        } catch (MalformedURLException e) {
            throw new RollerException(e);
        }
    }
View Full Code Here

            if (pingTargetId != null && pingTargetId.length() > 0)
            {
                pingTarget = pingTargetMgr.getPingTarget(
                        pingTargetForm.getId());
                if (pingTarget == null)
                    throw new RollerException(
                            "No such ping target id: " + pingTargetId);
                pingTargetForm.copyTo(pingTarget, req.getLocale());
            }
            else
            {
View Full Code Here

                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
            String pingTargetId = pingTargetForm.getId();
            if (pingTargetId == null || pingTargetId.length() == 0)
            {
                throw new RollerException("Missing ping target id.");
            }
            PingTargetData ping = pingTargetMgr.getPingTarget(pingTargetId);
            pingTargetMgr.removePingTarget(ping);
            RollerFactory.getRoller().flush();
            return view(mapping, form, req, res);
View Full Code Here

TOP

Related Classes of org.apache.roller.RollerException

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.