Package org.exoplatform.portal.config.model

Examples of org.exoplatform.portal.config.model.Page


      assertFalse(guest.hasEditPermission(page));
   }

   public void testPageEditableByEveryone()
   {
      Page page = new Page();
      page.setOwnerType(getOwnerType());
      page.setOwnerId("foo");
      page.setAccessPermissions(new String[0]);
      page.setEditPermission("Everyone");

      //
      assertTrue(root.hasPermission(page));
      assertTrue(administrator.hasPermission(page));
      assertTrue(manager.hasPermission(page));
View Full Code Here


      assertTrue(guest.hasEditPermission(page));
   }

   public void testPageAccessibleByGuests()
   {
      Page page = new Page();
      page.setOwnerType(getOwnerType());
      page.setOwnerId("foo");
      page.setAccessPermissions(new String[]{"whatever:/platform/guests"});

      //
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertFalse(manager.hasPermission(page));
View Full Code Here

      assertFalse(guest.hasEditPermission(page));
   }

   public void testPageEditableByGuests()
   {
      Page page = new Page();
      page.setOwnerType(getOwnerType());
      page.setOwnerId("foo");
      page.setAccessPermissions(new String[0]);
      page.setEditPermission("whatever:/platform/guests");

      //
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertFalse(manager.hasPermission(page));
View Full Code Here

      assertTrue(guest.hasEditPermission(page));
   }

   public void testPageAccessibleByEveryOneAndGuests()
   {
      Page page = new Page();
      page.setOwnerType(getOwnerType());
      page.setOwnerId("foo");
      page.setAccessPermissions(new String[]{"Everyone", "whatever:/platform/guests"});

      //
      assertTrue(root.hasPermission(page));
      assertTrue(administrator.hasPermission(page));
      assertTrue(manager.hasPermission(page));
View Full Code Here

      assertFalse(guest.hasEditPermission(page));
   }

   public void testPageWithAccessPermission()
   {
      Page page = new Page();
      page.setOwnerType(getOwnerType());
      page.setOwnerId("foo");
      page.setAccessPermissions(new String[]{"manager:/manageable"});

      //
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertTrue(manager.hasPermission(page));
      assertFalse(user.hasPermission(page));
      assertFalse(guest.hasPermission(page));

      //
      page.setAccessPermissions(new String[]{"*:/manageable"});

      //
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertTrue(manager.hasPermission(page));
View Full Code Here

      assertFalse(guest.hasPermission(page));
   }

   public void testPageWithEditPermission()
   {
      Page page = new Page();
      page.setOwnerType(getOwnerType());
      page.setOwnerId("foo");
      page.setAccessPermissions(new String[0]);
      page.setEditPermission("manager:/manageable");

      //
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertTrue(manager.hasPermission(page));
      assertFalse(user.hasPermission(page));
      assertFalse(guest.hasPermission(page));

      //
      page.setEditPermission("*:/manageable");

      //
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertTrue(manager.hasPermission(page));
View Full Code Here

*/
public class TestUserPageACL extends AbstractTestUserACL
{
   public void testUserPageIsAlwaysUsableOnlyByItsOwner()
   {
      Page page = new Page();
      page.setOwnerType("user");
      page.setOwnerId("user");
      page.setAccessPermissions(new String[0]);
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertFalse(manager.hasPermission(page));
      assertTrue(user.hasPermission(page));
      assertFalse(guest.hasPermission(page));
      assertFalse(root.hasEditPermission(page));
      assertFalse(administrator.hasEditPermission(page));
      assertFalse(manager.hasEditPermission(page));
      assertTrue(user.hasEditPermission(page));
      assertFalse(guest.hasEditPermission(page));

      //
      page = new Page();
      page.setOwnerType("user");
      page.setOwnerId("user");
      page.setAccessPermissions(new String[]{"manager:/manageable"});
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertTrue(manager.hasPermission(page));
      assertTrue(user.hasPermission(page));
      assertFalse(guest.hasPermission(page));
      assertFalse(root.hasEditPermission(page));
      assertFalse(administrator.hasEditPermission(page));
      assertFalse(manager.hasEditPermission(page));
      assertTrue(user.hasEditPermission(page));
      assertFalse(guest.hasEditPermission(page));

      //
      page = new Page();
      page.setOwnerType("user");
      page.setOwnerId("user");
      page.setEditPermission("manager:/manageable");
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertFalse(manager.hasPermission(page));
      assertFalse(manager.hasPermission(page));
      assertTrue(user.hasPermission(page));
      assertFalse(guest.hasPermission(page));
      assertFalse(root.hasEditPermission(page));
      assertFalse(administrator.hasEditPermission(page));
      assertFalse(manager.hasEditPermission(page));
      assertTrue(user.hasEditPermission(page));
      assertFalse(guest.hasEditPermission(page));

      //
      page = new Page();
      page.setOwnerType("user");
      page.setOwnerId("user");
      page.setAccessPermissions(new String[]{"Everyone"});
      assertTrue(root.hasPermission(page));
      assertTrue(administrator.hasPermission(page));
      assertTrue(manager.hasPermission(page));
      assertTrue(user.hasPermission(page));
      assertTrue(guest.hasPermission(page));
      assertFalse(root.hasEditPermission(page));
      assertFalse(administrator.hasEditPermission(page));
      assertFalse(manager.hasEditPermission(page));
      assertTrue(user.hasEditPermission(page));
      assertFalse(guest.hasEditPermission(page));

      //
      page = new Page();
      page.setOwnerType("user");
      page.setOwnerId("user");
      page.setAccessPermissions(new String[0]);
      page.setEditPermission("Everyone");
      assertTrue(root.hasPermission(page));
      assertFalse(administrator.hasPermission(page));
      assertFalse(manager.hasPermission(page));
      assertTrue(user.hasPermission(page));
      assertFalse(guest.hasPermission(page));
View Full Code Here

            UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UIPage uiPage = uiPageForm.getUIPage();
            if (uiPage == null)
                return;

            Page page = new Page();
            uiPageForm.invokeSetBindingBean(page);
            uiPage.setAccessPermissions(page.getAccessPermissions());
            uiPage.setEditPermission(page.getEditPermission());
            uiPage.setTitle(page.getTitle());
            uiPage.setShowMaxWindow(page.isShowMaxWindow());

            uiMaskWS.createEvent("Close", Phase.DECODE, pcontext).broadcast();
            pcontext.getJavascriptManager().require("SHARED/portalComposer", "portalComposer")
                    .addScripts("portalComposer.toggleSaveButton();");
        }
View Full Code Here

            try {
                UserNode rootNode = userPortal.getNode(nav, Scope.CHILDREN, UserNodeFilterConfig.builder().build(), null);
                if (rootNode.getChildren().size() < 1) {
                    // TODO: Retrieve tab name from request
                    Page page = configService.createPageTemplate(PAGE_TEMPLATE, siteKey.getTypeName(), siteKey.getName());
                    page.setName(DEFAULT_TAB_NAME);
                    page.setTitle(DEFAULT_TAB_NAME);

                    //
                    PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                            page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page
                                    .getAccessPermissions()) : null, page.getEditPermission());
                    configService.getPageService().savePage(new PageContext(page.getPageKey(), pageState));

                    //
                    storage.save(page);

                    //
                    UserNode tabNode = rootNode.addChild(DEFAULT_TAB_NAME);
                    tabNode.setLabel(DEFAULT_TAB_NAME);
                    tabNode.setPageRef(PageKey.parse(page.getPageId()));

                    userPortal.saveNode(tabNode, null);
                }
            } catch (Exception ex) {
                log.warn("Navigation " + nav.getKey().getName() + " does not exist!", ex);
View Full Code Here

                        // uiPage.getApplicationComponent(UserGadgetStorage.class) ;
                        // widgetDataService.delete(userName,
                        // uiWidget.getApplicationName(), uiWidget.getId()) ;
                    }
                    if (uiPage.isModifiable()) {
                        Page page = (Page) PortalDataMapper.buildModelObject(uiPage);
                        if (page.getChildren() == null) {
                            page.setChildren(new ArrayList<ModelObject>());
                        }

                        //
                        PageService pageService = uiPage.getApplicationComponent(PageService.class);
                        PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                                page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page
                                        .getAccessPermissions()) : null, page.getEditPermission());
                        pageService.savePage(new PageContext(page.getPageKey(), pageState));

                        //
                        DataStorage dataService = uiPage.getApplicationComponent(DataStorage.class);
                        dataService.save(page);
                    }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.model.Page

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.