Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.BookmarkData


        RollerFactory.getRoller().getUserManager().saveWebsite(bookmark.getWebsite());
    }
   
   
    public BookmarkData getBookmark(String id) throws RollerException {
        BookmarkData bd = (BookmarkData)
        strategy.load(id, BookmarkData.class);
        // TODO: huh?  why do we do this?
        if (bd != null) bd.setBookmarkManager(this);
        return bd;
    }
View Full Code Here


            // Currently bookmarks must have at least a name and HTML url to be stored. Previous logic was
            // trying to skip invalid ones, but was letting ones with an xml url and no html url through
            // which could result in a db exception.
            // TODO: Consider providing error feedback instead of silently skipping the invalid bookmarks here.
            if (null != title && null != url) {
                BookmarkData bd = new BookmarkData(parent,
                        title,
                        desc,
                        url,
                        xmlUrl,
                        new Integer(0),
View Full Code Here

        try {
            // Add to destination folder
            LinkedList deleteList = new LinkedList();
            Iterator srcBookmarks = src.getBookmarks().iterator();
            while (srcBookmarks.hasNext()) {
                BookmarkData bd = (BookmarkData)srcBookmarks.next();
                deleteList.add(bd);
               
                BookmarkData movedBd = new BookmarkData();
                movedBd.setData(bd);
                movedBd.setId(null);
               
                dest.addBookmark(movedBd);
                this.strategy.store(movedBd);
            }
           
            // Remove from source folder
            Iterator deleteIter = deleteList.iterator();
            while (deleteIter.hasNext()) {
                BookmarkData bd = (BookmarkData)deleteIter.next();
                src.removeBookmark(bd);
                // TODO: this won't conflict with the bookmark we store above right?
                this.strategy.remove(bd);
            }
           
View Full Code Here

    public void removeFolderContents(FolderData src) throws RollerException {
       
        // just go through the folder and remove each bookmark
        Iterator srcBookmarks = src.getBookmarks().iterator();
        while (srcBookmarks.hasNext()) {
            BookmarkData bd = (BookmarkData)srcBookmarks.next();
            this.strategy.remove(bd);
        }
    }
View Full Code Here

                            .createCriteria(BookmarkData.class);
                    bookmarksQuery.add(Expression.eq("folder", assoc
                            .getFolder()));
                    Iterator bookmarkIter = bookmarksQuery.list().iterator();
                    while (bookmarkIter.hasNext()) {
                        BookmarkData entry = (BookmarkData) bookmarkIter.next();
                        bookmarks.add(entry);
                    }
                }
            }
           
            // get bookmarks in folder
            Criteria bookmarksQuery = session
                    .createCriteria(BookmarkData.class);
            bookmarksQuery.add(Expression.eq("folder", folder));
            Iterator bookmarkIter = bookmarksQuery.list().iterator();
            while (bookmarkIter.hasNext()) {
                BookmarkData bookmark = (BookmarkData) bookmarkIter.next();
                bookmarks.add(bookmark);
            }
            return bookmarks;
        } catch (HibernateException e) {
            throw new RollerException(e);
View Full Code Here

        FolderData parentFolder = null;
        if (null!=rreq.getBookmark() && null==request.getParameter("correct"))
        {
            // If request specifies bookmark and we are not correcting an
            // already submitted form then load that bookmark into the form.
            BookmarkData bd = rreq.getBookmark();
            form.copyFrom(bd, request.getLocale());
            request.setAttribute("state","edit");
               
            // Pass bookmark's Folder on as attribute.                
            parentFolder = bd.getFolder();

            request.setAttribute("model", new BasePageModel(
                "bookmarkForm.edit.title", request, response, mapping));
        }
        else if (null != request.getParameter("correct"))
View Full Code Here

        ActionForward forward = mapping.findForward("Bookmarks");
        BookmarkFormEx form = (BookmarkFormEx)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();

        BookmarkData bd = null;
        if (null != form.getId() && !form.getId().trim().equals(""))
        {
            bd = bmgr.getBookmark(form.getId());
        }
        else
        {
            bd = new BookmarkData();
            FolderData fd = bmgr.getFolder(
                request.getParameter(RequestConstants.FOLDER_ID));
            bd.setFolder(fd);
        }
        RollerSession rses = RollerSession.getRollerSession(request);
        if (bd.getFolder().getWebsite().hasUserPermissions(
                rses.getAuthenticatedUser(), PermissionsData.AUTHOR))
        {
            form.copyTo(bd, request.getLocale());
            bmgr.saveBookmark(bd);
            RollerFactory.getRoller().flush();
           
            CacheManager.invalidate(bd);
           
            request.setAttribute(
                RequestConstants.FOLDER_ID, bd.getFolder().getId());
        }
        else
        {
            ActionErrors errors = new ActionErrors();
            errors.add(null, new ActionError("error.permissions.deniedSave"));
View Full Code Here

TOP

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

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.