Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.WeblogCategoryData


        // remove cat
        this.strategy.remove(cat);
       
        // update website default cats if needed
        if(cat.getWebsite().getBloggerCategory().equals(cat)) {
            WeblogCategoryData rootCat = this.getRootWeblogCategory(cat.getWebsite());
            cat.getWebsite().setBloggerCategory(rootCat);
            this.strategy.store(cat.getWebsite());
        }
       
        if(cat.getWebsite().getDefaultCategory().equals(cat)) {
            WeblogCategoryData rootCat = this.getRootWeblogCategory(cat.getWebsite());
            cat.getWebsite().setDefaultCategory(rootCat);
            this.strategy.store(cat.getWebsite());
        }
    }
View Full Code Here


   
   
    public void moveWeblogCategoryContents(String srcId, String destId)
            throws RollerException {
       
        WeblogCategoryData srcCd =
                (WeblogCategoryData) this.strategy.load(
                srcId, WeblogCategoryData.class);
       
        WeblogCategoryData destCd =
                (WeblogCategoryData) this.strategy.load(
                destId, WeblogCategoryData.class);
       
        // TODO: this check should be made before calling this method?
        if (destCd.descendentOf(srcCd)) {
            throw new RollerException(
                    "ERROR cannot move parent category into it's own child");
        }
       
        // get all entries in category and subcats
        List results = getWeblogEntries(srcCd, true);
       
        // Loop through entries in src cat, assign them to dest cat
        Iterator iter = results.iterator();
        WebsiteData website = destCd.getWebsite();
        while (iter.hasNext()) {
            WeblogEntryData entry = (WeblogEntryData) iter.next();
            entry.setCategory(destCd);
            entry.setWebsite(website);
            this.strategy.store(entry);
View Full Code Here

        } else {
            conjunction.add(Expression.lt("pubTime", current.getPubTime()));
        }
       
        if (catName != null) {
            WeblogCategoryData category =
                    getWeblogCategoryByPath(current.getWebsite(), null, catName);
            if (category != null) {
                conjunction.add(Expression.eq("category", category));
            } else {
                throw new RollerException("Cannot find category: "+catName);
View Full Code Here

            Date    endDate,
            String  catName,
            String  status,
            String  sortby,
            Integer maxEntries) throws RollerException {
        WeblogCategoryData cat = null;
        if (StringUtils.isNotEmpty(catName) && website != null) {
            cat = getWeblogCategoryByPath(website, catName);
            if (cat == null) catName = null;
        }
        if (catName != null && catName.trim().equals("/")) {
View Full Code Here

        }
    }
   
    public Date getWeblogLastPublishTime(WebsiteData website, String catName)
    throws RollerException {
        WeblogCategoryData cat = null;
        Roller mRoller = RollerFactory.getRoller();
        if (catName != null && website != null) {
            cat = getWeblogCategoryByPath(website, null, catName);
            if (cat == null) catName = null;
        }
View Full Code Here

    }
   
    public boolean isDuplicateWeblogCategoryName(WeblogCategoryData cat)
    throws RollerException {
        // ensure that no sibling categories share the same name
        WeblogCategoryData parent =
                null == cat.getId() ? (WeblogCategoryData)cat.getNewParent() : cat.getParent();
       
        if (null != parent) // don't worry about root
        {
            List sameNames;
View Full Code Here

                return true;
            }
           
            Iterator cats = cat.getWeblogCategories().iterator();
            while (cats.hasNext()) {
                WeblogCategoryData childCat = (WeblogCategoryData)cats.next();
                if (childCat.isInUse()) {
                    return true;
                }
            }
           
            if (cat.getWebsite().getBloggerCategory().equals(cat)) {
View Full Code Here

        } else {
            cats = category.getWeblogCategories().iterator();
        }
       
        while (cats.hasNext()) {
            WeblogCategoryData possibleMatch = (WeblogCategoryData)cats.next();
            if (possibleMatch.getName().equals(pathArray[0])) {
                if (pathArray.length == 1) {
                    return possibleMatch;
                } else {
                    String[] subpath = new String[pathArray.length - 1];
                    System.arraycopy(pathArray, 1, subpath, 0, subpath.length);
View Full Code Here

                this.strategy.remove(aFolder);
            }
        }
       
        // remove categories
        WeblogCategoryData rootCat = wmgr.getRootWeblogCategory(website);
        if (null != rootCat) {
            this.strategy.remove(rootCat);
        }
       
    }
View Full Code Here

        perms.setPending(false);
        perms.setPermissionMask(PermissionsData.ADMIN);
        this.strategy.store(perms);
       
        // add default categories
        WeblogCategoryData rootCat = new WeblogCategoryData(
                null,      // id
                newWeblog, // newWeblog
                null,      // parent
                "root",    // name
                "root",    // description
                null );    // image
        this.strategy.store(rootCat);
       
        String cats = RollerConfig.getProperty("newuser.categories");
        WeblogCategoryData firstCat = rootCat;
        if (cats != null) {
            String[] splitcats = cats.split(",");
            for (int i=0; i<splitcats.length; i++) {
                WeblogCategoryData c = new WeblogCategoryData(
                    null,            // id
                    newWeblog,       // newWeblog
                    rootCat,         // parent
                    splitcats[i],    // name
                    splitcats[i],    // description
View Full Code Here

TOP

Related Classes of org.apache.roller.pojos.WeblogCategoryData

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.