Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.DataStorage


        }
    }

    public void buildForm(UIPage uiPage) throws Exception {
        PortalRequestContext pcontext = Util.getPortalRequestContext();
        DataStorage dataStorage = getApplicationComponent(DataStorage.class);

        PortalConfig pConfig = dataStorage.getPortalConfig(pcontext.getPortalOwner());
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        UserACL acl = (UserACL) container.getComponentInstanceOfType(UserACL.class);

        UIFormInputSet uiSettingSet = new UIFormInputSet("PageSetting");
        uiSettingSet.addUIFormInput(new UIFormStringInput("pageId", "pageId", null).setReadOnly(true));
View Full Code Here


        return method.invoke(bean, ReflectionUtil.EMPTY_ARGS);
    }

    @SuppressWarnings("unchecked")
    public void loadPortalConfigs() throws Exception {
        DataStorage service = getApplicationComponent(DataStorage.class);

        Query<PortalConfig> query = new Query<PortalConfig>(null, null, null, null, PortalConfig.class);
        LazyPageList<PortalConfig> temp = service.find(query, new Comparator<PortalConfig>() {
            public int compare(PortalConfig pconfig1, PortalConfig pconfig2) {
                return pconfig1.getName().toLowerCase().compareTo(pconfig2.getName().toLowerCase());
            }
        });
View Full Code Here

                uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.delete-default-portal",
                        new String[] { defaultPortalName }, ApplicationMessage.WARNING));
                return;
            }

            DataStorage dataStorage = uicomp.getApplicationComponent(DataStorage.class);
            UserACL acl = uicomp.getApplicationComponent(UserACL.class);

            PortalConfig pConfig = dataStorage.getPortalConfig(portalName);
            if (pConfig != null) {
                if (acl.hasPermission(pConfig)) {
                    service.removeUserPortalConfig(portalName);
                } else {
                    uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-deletePermission",
View Full Code Here

    public static class EditPortalLayoutActionListener extends EventListener<UISiteManagement> {
        public void execute(Event<UISiteManagement> event) throws Exception {
            UISiteManagement uicomp = event.getSource();
            String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
            UserPortalConfigService service = uicomp.getApplicationComponent(UserPortalConfigService.class);
            DataStorage dataStorage = uicomp.getApplicationComponent(DataStorage.class);
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIPortalApplication portalApp = (UIPortalApplication) prContext.getUIApplication();
            UIWorkingWorkspace uiWorkingWS = portalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);

            PortalConfig pConfig = dataStorage.getPortalConfig(portalName);

            if (pConfig == null) {
                portalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
                        new String[] { portalName }));
                uiWorkingWS.updatePortletsByName("UserToolbarSitePortlet");
View Full Code Here

        UserPortalConfigService dataStorage = getApplicationComponent(UserPortalConfigService.class);
        return dataStorage.getAllPortalNames();
    }

    public String getPortalLabel(String portalName) throws Exception {
        DataStorage storage_ = getApplicationComponent(DataStorage.class);
        PortalConfig portalConfig = storage_.getPortalConfig(portalName);
        String label = portalConfig.getLabel();
        if (label != null && label.trim().length() > 0) {
            return label;
        }
View Full Code Here

            UIPageSelector pageSelector = uiPageNodeForm.getChild(UIPageSelector.class);
            if (pageSelector.getPage() == null) {
                pageSelector.setValue(null);
            } else {
                PageContext pageContext = pageSelector.getPage();
                DataStorage storage = uiPageNodeForm.getApplicationComponent(DataStorage.class);
                PageService pageService = uiPageNodeForm.getApplicationComponent(PageService.class);
                if (pageService.loadPage(pageContext.getKey()) == null) {
                    pageService.savePage(pageContext);

                    //
                    Page page = new Page();
                    page.setOwnerType(pageContext.getKey().getSite().getTypeName());
                    page.setOwnerId(pageContext.getKey().getSite().getName());
                    page.setName(pageContext.getKey().getName());
                    String title = pageContext.getState().getDisplayName();
                    String[] accessPermission = pageContext.getState().getAccessPermissions() == null ? null : pageContext
                            .getState().getAccessPermissions()
                            .toArray(new String[pageContext.getState().getAccessPermissions().size()]);
                    if (title == null || title.trim().length() < 1) {
                        title = page.getName();
                    }
                    page.setTitle(title);
                    page.setShowMaxWindow(false);
                    page.setAccessPermissions(accessPermission);
                    page.setEditPermission(pageContext.getState().getEditPermission());
                    page.setModifiable(true);
                    if (page.getChildren() == null) {
                        page.setChildren(new ArrayList<ModelObject>());
                    }

                    storage.save(page);
                    pageSelector.setValue(page.getPageId());
                }
            }

            if (pageNode.getLabel() == null)
View Full Code Here

         pageNav.setOwnerType(PortalConfig.GROUP_TYPE);
         //UIPortalApplication uiPortalApp = uiForm.getAncestorOfType(UIPortalApplication.class);     
         UIPortalApplication uiPortalApp = Util.getUIPortal().getAncestorOfType(UIPortalApplication.class);

         // ensure this navigation is not exist
         DataStorage dataService = uicomp.getApplicationComponent(DataStorage.class);
         if (dataService.getPageNavigation(pageNav.getOwnerType(), pageNav.getOwnerId()) != null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageNavigationForm.msg.existPageNavigation",
               new String[]{pageNav.getOwnerId()}));
            return;
         }

         // Create group when it does not exist
         if (dataService.getPortalConfig("group", ownerId) == null)
         {
            UserPortalConfigService configService = uicomp.getApplicationComponent(UserPortalConfigService.class);
            configService.createGroupSite(ownerId);
         }

         // create navigation for group
         dataService.create(pageNav);

         uiPortalApp.getUserPortalConfig().getNavigations().add(0, pageNav);
         uiPortalApp.getNavigations().add(0, pageNav);
         uiPortalApp.localizeNavigations();
        
View Full Code Here

      public void execute(Event<UINavigationManagement> event) throws Exception
      {
         PortalRequestContext prContext = Util.getPortalRequestContext();
         UINavigationManagement uiManagement = event.getSource();
         UINavigationNodeSelector uiNodeSelector = uiManagement.getChild(UINavigationNodeSelector.class);
         DataStorage dataService = uiManagement.getApplicationComponent(DataStorage.class);
         UserPortalConfigService portalConfigService = uiManagement.getApplicationComponent(UserPortalConfigService.class);
        
         PageNavigation navigation = uiNodeSelector.getEdittedNavigation();
         String editedOwnerType = navigation.getOwnerType();
         String editedOwnerId = navigation.getOwnerId();
         // Check existed
         PageNavigation persistNavigation =  dataService.getPageNavigation(editedOwnerType, editedOwnerId);
         if (persistNavigation == null)
         {
            UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UINavigationManagement.msg.NavigationNotExistAnymore", null));
            UIPopupWindow uiPopup = uiManagement.getParent();
            uiPopup.setShow(false);
            UIPortalApplication uiPortalApp = (UIPortalApplication)prContext.getUIApplication();
            UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
            prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
            prContext.setFullRender(true);
            return;
         }
        
         if(PortalConfig.PORTAL_TYPE.equals(navigation.getOwnerType()))
         {
            UserPortalConfig portalConfig = portalConfigService.getUserPortalConfig(navigation.getOwnerId(), prContext.getRemoteUser());
            if(portalConfig != null)
            {
               dataService.save(navigation);
            }
            else
            {
               UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
               uiApp.addMessage(new ApplicationMessage("UIPortalForm.msg.notExistAnymore", null));
               UIPopupWindow uiPopup = uiManagement.getParent();
               uiPopup.setShow(false);
               UIPortalApplication uiPortalApp = (UIPortalApplication)prContext.getUIApplication();
               UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
               prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
               prContext.setFullRender(true);
               return;
            }
         }
         else
         {
            dataService.save(navigation);
         }

         // Reload navigation here as some navigation could exist in the back end such as system navigations
         // that would not be in the current edited UI navigation
         navigation = dataService.getPageNavigation(navigation.getOwnerType(), navigation.getOwnerId());

         UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
         setNavigation(uiPortalApp.getNavigations(), navigation);

         // Need to relocalize as it was loaded from storage
View Full Code Here

      String remoteUser = prContext.getRemoteUser();
      String ownerUser = prContext.getPortalOwner();

      PortalConfig portalConfig = (PortalConfig)PortalDataMapper.buildModelObject(editPortal);
      UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
      DataStorage dataStorage = getApplicationComponent(DataStorage.class);

      if (!isPortalExist(editPortal))
      {
         return;
      }
     
      SkinService skinService = getApplicationComponent(SkinService.class);
      skinService.invalidatePortalSkinCache(editPortal.getName(), editPortal.getSkin());
      try
      {
         dataStorage.save(portalConfig);
      }
      catch (StaleModelException ex)
      {
         //Temporary solution for concurrency-related issue. The StaleModelException should be
         //caught in the ApplicationLifecycle
View Full Code Here

   {
      UIWorkingWorkspace uiWorkingWorkspace =
         addChild(UIWorkingWorkspace.class, UIPortalApplication.UI_WORKING_WS_ID, null);
      UIComponentDecorator uiViewWS = uiWorkingWorkspace.addChild(UIComponentDecorator.class, null, UI_VIEWING_WS_ID);

      DataStorage dataStorage = getApplicationComponent(DataStorage.class);
      Container container = dataStorage.getSharedLayout();
      UIPortal uiPortal = createUIComponent(UIPortal.class, null, null);
      PortalDataMapper.toUIPortal(uiPortal, userPortalConfig_);
     
      this.putCachedUIPortal(uiPortal);
      this.showedUIPortal = uiPortal;
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.DataStorage

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.