Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.BookmarkData


        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(RollerRequest.FOLDERID_KEY));
            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(
                RollerRequest.FOLDERID_KEY, bd.getFolder().getId());
        }
        else
        {
            ActionErrors errors = new ActionErrors();
            errors.add(null, new ActionError("error.permissions.deniedSave"));
View Full Code Here

                    FolderData fd = bmgr.getFolder(folders[i]);
                    bmgr.removeFolder(fd); // removes child folders and bookmarks too
                }
            }
           
            BookmarkData bookmark = null;
            String bookmarks[] = form.getSelectedBookmarks();
            if (null != bookmarks)
            {
                for (int j = 0; j < bookmarks.length; j++)
                {
View Full Code Here

                if (null != bookmarks)
                {
                    for (int j = 0; j < bookmarks.length; j++)
                    {
                        // maybe we should be using folder.addBookmark()?
                        BookmarkData bd = bmgr.getBookmark(bookmarks[j]);
                        bd.setFolder(parent);
                        bmgr.saveBookmark(bd);
                    }
                }
                RollerFactory.getRoller().flush();
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();
            BasePageModel pageModel = new BasePageModel(
                    "bookmarkForm.edit.title", request, response, mapping);
            pageModel.setWebsite(parentFolder.getWebsite());
            request.setAttribute("model", pageModel);
        }
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

                    FolderData fd = bmgr.getFolder(folders[i]);
                    bmgr.removeFolder(fd); // removes child folders and bookmarks too
                }
            }
           
            BookmarkData bookmark = null;
            String bookmarks[] = form.getSelectedBookmarks();
            if (null != bookmarks)
            {
                for (int j = 0; j < bookmarks.length; j++)
                {
View Full Code Here

                if (null != bookmarks)
                {
                    for (int j = 0; j < bookmarks.length; j++)
                    {
                        // maybe we should be using folder.addBookmark()?
                        BookmarkData bd = bmgr.getBookmark(bookmarks[j]);
                        bd.setFolder(parent);
                        bmgr.saveBookmark(bd);
                    }
                }
                RollerFactory.getRoller().flush();
View Full Code Here

            if(folder != null) {
                weblog = folder.getWebsite();
            }
        } else if (request.getParameter(RequestConstants.BOOKMARK_ID) != null) {
            String bookmarkId = request.getParameter(RequestConstants.BOOKMARK_ID);
            BookmarkData bookmark = roller.getBookmarkManager().getBookmark(bookmarkId);
            FolderData folder = bookmark.getFolder();
            if(folder != null) {
                weblog = folder.getWebsite();
            }
        } else if (request.getSession().getAttribute(RequestConstants.WEBLOG_SESSION_STASH) != null) {
            String handle = (String)request.getSession().getAttribute(RequestConstants.WEBLOG_SESSION_STASH);
View Full Code Here

        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

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.