Package org.apache.roller.ui.authoring.struts.formbeans

Examples of org.apache.roller.ui.authoring.struts.formbeans.BookmarksForm


            request, response, mapping, (BookmarksForm)actionForm);
        WebsiteData website = pageModel.getFolder().getWebsite();
        if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(website))
        {
            BookmarkManager bmgr = roller.getBookmarkManager();
            BookmarksForm form = (BookmarksForm)actionForm;

            mLogger.debug("Deleting folders and bookmarks.");

            String folders[] = form.getSelectedFolders();
            if (null != folders)
            {
                for (int i = 0; i < folders.length; i++)
                {
                    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++)
                {
                    bookmark = bmgr.getBookmark(bookmarks[j]);
View Full Code Here


        if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(website))
        {
            try
            {
                BookmarkManager bmgr = roller.getBookmarkManager();
                BookmarksForm form = (BookmarksForm)actionForm;
   
                mLogger.debug("Moving folders and bookmarks to folder, id="
                    + form.getMoveToFolderId());
   
                // Move subfolders to new folder.
                String folders[] = form.getSelectedFolders();
                FolderData parent = bmgr.getFolder(form.getMoveToFolderId());
                if (null != folders)
                {
                    for (int i = 0; i < folders.length; i++)
                    {
                        FolderData fd = bmgr.getFolder(folders[i]);
   
                        // Don't move folder into itself.
                        if (    !fd.getId().equals(parent.getId())
                             && !parent.descendentOf(fd))
                        {
                            fd.setParent(parent);
                            bmgr.saveFolder(fd);
                        }
                        else
                        {
                            messages.add(null, new ActionMessage(
                                "bookmarksForm.warn.notMoving",fd.getName()));
                        }
                    }
                }
   
                // Move bookmarks.
                String bookmarks[] = form.getSelectedBookmarks();
                if (null != bookmarks)
                {
                    for (int j = 0; j < bookmarks.length; j++)
                    {
                        // maybe we should be using folder.addBookmark()?
View Full Code Here

            e.printStackTrace();
            fail();
        }
       
        // Setup form bean
        BookmarksForm form = (BookmarksForm)
        strutsModule.createActionForm(BookmarksForm.class);
       
        // Setup mapping and request parameters
        MockActionMapping mapping = strutsModule.getMockActionMapping();
        mapping.setupForwards(new String[] {"access-denied","BookmarksForm"});
View Full Code Here

            request, response, mapping, (BookmarksForm)actionForm);
        WebsiteData website = pageModel.getFolder().getWebsite();
        if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(website))
        {
            BookmarkManager bmgr = roller.getBookmarkManager();
            BookmarksForm form = (BookmarksForm)actionForm;

            mLogger.debug("Deleting folders and bookmarks.");

            String folders[] = form.getSelectedFolders();
            if (null != folders)
            {
                for (int i = 0; i < folders.length; i++)
                {
                    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++)
                {
                    bookmark = bmgr.getBookmark(bookmarks[j]);
View Full Code Here

        if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(website))
        {
            try
            {
                BookmarkManager bmgr = roller.getBookmarkManager();
                BookmarksForm form = (BookmarksForm)actionForm;
   
                mLogger.debug("Moving folders and bookmarks to folder, id="
                    + form.getMoveToFolderId());
   
                // Move subfolders to new folder.
                String folders[] = form.getSelectedFolders();
                FolderData parent = bmgr.getFolder(form.getMoveToFolderId());
                if (null != folders)
                {
                    for (int i = 0; i < folders.length; i++)
                    {
                        FolderData fd = bmgr.getFolder(folders[i]);
   
                        // Don't move folder into itself.
                        if (    !fd.getId().equals(parent.getId())
                             && !parent.descendentOf(fd))
                        {
                            fd.setParent(parent);
                            bmgr.saveFolder(fd);
                        }
                        else
                        {
                            messages.add(null, new ActionMessage(
                                "bookmarksForm.warn.notMoving",fd.getName()));
                        }
                    }
                }
   
                // Move bookmarks.
                String bookmarks[] = form.getSelectedBookmarks();
                if (null != bookmarks)
                {
                    for (int j = 0; j < bookmarks.length; j++)
                    {
                        // maybe we should be using folder.addBookmark()?
View Full Code Here

            e.printStackTrace();
            fail();
        }
       
        // Setup form bean
        BookmarksForm form = (BookmarksForm)
        strutsModule.createActionForm(BookmarksForm.class);
       
        // Setup mapping and request parameters
        MockActionMapping mapping = strutsModule.getMockActionMapping();
        mapping.setupForwards(new String[] {"access-denied","BookmarksForm"});
View Full Code Here

TOP

Related Classes of org.apache.roller.ui.authoring.struts.formbeans.BookmarksForm

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.