Package org.apache.roller.weblogger.pojos

Examples of org.apache.roller.weblogger.pojos.Weblog


        // get all entries in category and subcats
        List results = srcCat.retrieveWeblogEntries(true);
       
        // Loop through entries in src cat, assign them to dest cat
        Iterator iter = results.iterator();
        Weblog website = destCat.getWebsite();
        while (iter.hasNext()) {
            WeblogEntry entry = (WeblogEntry) iter.next();
            entry.setCategory(destCat);
            entry.setWebsite(website);
            this.strategy.store(entry);
View Full Code Here


   
    /**
     * @inheritDoc
     */
    public void removeWeblogEntry(WeblogEntry entry) throws WebloggerException {
        Weblog weblog = entry.getWebsite();
       
        Query q = strategy.getNamedQuery("WeblogReferrer.getByWeblogEntry");
        q.setParameter(1, entry);
        List referers = q.getResultList();
        for (Iterator iter = referers.iterator(); iter.hasNext();) {
View Full Code Here

       
        // check cache first
        // NOTE: if we ever allow changing handles then this needs updating
        if(this.weblogHandleToIdMap.containsKey(handle)) {
           
            Weblog weblog = this.getWeblog(
                    (String) this.weblogHandleToIdMap.get(handle));
            if(weblog != null) {
                // only return weblog if enabled status matches
                if(enabled == null || enabled.equals(weblog.getEnabled())) {
                    log.debug("weblogHandleToId CACHE HIT - "+handle);
                    return weblog;
                }
            } else {
                // mapping hit with lookup miss?  mapping must be old, remove it
                this.weblogHandleToIdMap.remove(handle);
            }
        }
       
        Query query = strategy.getNamedQuery("Weblog.getByHandle");
        query.setParameter(1, handle);
        Weblog website = null;
        try {
            website = (Weblog)query.getSingleResult();
        } catch (NoResultException e) {
            website = null;
        }
       
        // add mapping to cache
        if(website != null) {
            log.debug("weblogHandleToId CACHE MISS - "+handle);
            this.weblogHandleToIdMap.put(website.getHandle(), website.getId());
        }
       
        if(website != null &&
                (enabled == null || enabled.equals(website.getEnabled()))) {
            return website;
        } else {
            return null;
        }
    }
View Full Code Here

       
    public List getUserWeblogs(User user, boolean enabledOnly) throws WebloggerException {
        List weblogs = new ArrayList();
        List<WeblogPermission> perms = roller.getUserManager().getWeblogPermissions(user);
        for (WeblogPermission perm : perms) {
            Weblog weblog = perm.getWeblog();
            if (!enabledOnly || weblog.getEnabled().booleanValue()) {
                if (weblog.getActive() != null && weblog.getActive().booleanValue()) {
                    weblogs.add(weblog);
                }
            }
        }
        return weblogs;
View Full Code Here

            }
           
            // extract the work weblog and set it
            String weblogHandle = theAction.getWeblog();
            if(!StringUtils.isEmpty(weblogHandle)) {
                Weblog weblog = null;
                try {
                    weblog = WebloggerFactory.getWeblogger().getWeblogManager().getWeblogByHandle(weblogHandle);
                    if(weblog != null) {
                        theAction.setActionWeblog(weblog);
                    }
View Full Code Here

            if (c == null) {
                response.setStatus(HttpServletResponse.SC_NOT_FOUND);
            } else {
                // need post permission to view comments
                RollerSession rses = RollerSession.getRollerSession(request);
                Weblog weblog = c.getWeblogEntry().getWebsite();
                if (weblog.hasUserPermission(rses.getAuthenticatedUser(), WeblogPermission.POST)) {
                    String content = Utilities.escapeHTML(c.getContent());
                    content = WordUtils.wrap(content, 72);
                    content = StringEscapeUtils.escapeJavaScript(content);
                    String json = "{ id: \"" + c.getId() + "\"," + "content: \"" + content + "\" }";
                    response.setStatus(HttpServletResponse.SC_OK);
View Full Code Here

            if (c == null) {
                response.setStatus(HttpServletResponse.SC_NOT_FOUND);
            } else {
                // need post permission to edit comments
                RollerSession rses = RollerSession.getRollerSession(request);
                Weblog weblog = c.getWeblogEntry().getWebsite();
                if (weblog.hasUserPermission(rses.getAuthenticatedUser(), WeblogPermission.POST)) {
                    String content = Utilities.streamToString(request.getInputStream());
                    c.setContent(content);
                    // don't update the posttime when updating the comment
                    c.setPostTime(c.getPostTime());
                    wmgr.saveComment(c);
View Full Code Here

        if (weblogHandle == null)
            return;

        String selfSiteFragment = "/"+weblogHandle;
        Weblog weblog = null;
        WeblogEntry entry = null;

        // lookup the weblog now
        try {
            weblog = roller.getWeblogManager().getWeblogByHandle(weblogHandle);
View Full Code Here

                }
               
                // are we requiring a valid action weblog?
                if (theAction.isWeblogRequired()) {
                   
                    Weblog actionWeblog = ((UIAction)theAction).getActionWeblog();
                    if(actionWeblog == null) {
                        log.debug("DENIED: required action weblog not found");
                        return "access-denied";
                    }
                   
View Full Code Here

               
                // get list of user's enabled websites
                List websites = WebloggerFactory.getWeblogger().getWeblogManager().getUserWeblogs(user, true);
                Iterator iter = websites.iterator();
                while (iter.hasNext()) {
                    Weblog website = (Weblog)iter.next();
                   
                    // only include weblog's that have client API support enabled
                    if (Boolean.TRUE.equals(website.getEnableBloggerApi())) {
                        Hashtable blog = new Hashtable(3);
                        blog.put("url", website.getURL());
                        blog.put("blogid", website.getHandle());
                        blog.put("blogName", website.getName());
                        result.add(blog);
                    }
                }
            } catch (Exception e) {
                String msg = "ERROR in BlooggerAPIHander.getUsersBlogs";
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.pojos.Weblog

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.