Package org.exoplatform.portal.config.model

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


                String portalIdSelected = uiForm.portalIdSelectBox.getValue();
                UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
                UserPortalConfig userConfig = service.getUserPortalConfig(portalIdSelected, Util.getPortalRequestContext()
                        .getRemoteUser());
                if (userConfig != null) {
                    PortalConfig config = userConfig.getPortalConfig();
                    accessPermissions = config.getAccessPermissions();
                    editPermission = config.getEditPermission();
                    uiForm.findFirstComponentOfType(UIListPermissionSelector.class).setValue(accessPermissions);
                    uiForm.findFirstComponentOfType(UIPermissionSelector.class).setValue(editPermission);
                }
            } else {
                String groupIdSelected = uiForm.groupIdSelectBox.getValue();
View Full Code Here


                        new String[] { currentPortal.getName() }));
                return;
            }

            DataStorage dataStorage = portalApp.getApplicationComponent(DataStorage.class);
            PortalConfig portalConfig = dataStorage.getPortalConfig(pcontext.getSiteType().getName(), pcontext.getSiteName());
            UIPortal transientPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
            PortalDataMapper.toUIPortal(transientPortal, portalConfig);
            transientPortal.setNavPath(currentPortal.getNavPath());
            transientPortal.refreshUIPage();
View Full Code Here

                if (showedUIPortal != null) {
                    showedUIPortal.setNavPath(targetNode);
                    uiPortalApp.setCurrentSite(showedUIPortal);

                    DataStorage storageService = uiPortalApp.getApplicationComponent(DataStorage.class);
                    PortalConfig associatedPortalConfig = storageService.getPortalConfig(targetNav.getKey().getTypeName(),
                            targetNav.getKey().getName());
                    UserPortalConfig userPortalConfig = pcontext.getUserPortalConfig();

                    // Update layout-related data on UserPortalConfig
                    userPortalConfig.setPortalConfig(associatedPortalConfig);
View Full Code Here

                throws Exception {
            DataStorage storage = uiPortalApp.getApplicationComponent(DataStorage.class);
            if (storage == null) {
                return null;
            }
            PortalConfig portalConfig = storage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
            Container layout = portalConfig.getPortalLayout();
            if (layout != null) {
                userPortalConfig.setPortalConfig(portalConfig);
            }
            UIPortal uiPortal = uiPortalApp.createUIComponent(UIPortal.class, null, null);
View Full Code Here

        String userName = context.getRemoteUser();
        if (userName != null && SiteType.USER == context.getSiteType() && userName.equals(context.getSiteName())) {
            DataStorage storage = (DataStorage) PortalContainer.getComponent(DataStorage.class);
            UserPortalConfigService configService = (UserPortalConfigService) PortalContainer
                    .getComponent(UserPortalConfigService.class);
            PortalConfig portalConfig = storage.getPortalConfig("user", userName);

            //
            if (portalConfig == null) {
                log.debug("About to create user site for user " + userName);
                configService.createUserSite(userName);
View Full Code Here

        model.setModifiable(uiPage.isModifiable());
        return model;
    }

    private static PortalConfig toPortal(UIPortal uiPortal) {
        PortalConfig model = new PortalConfig(uiPortal.getSiteType().getName(), uiPortal.getName(), uiPortal.getStorageId());
        model.setAccessPermissions(uiPortal.getAccessPermissions());
        model.setEditPermission(uiPortal.getEditPermission());
        model.setLabel(uiPortal.getLabel());
        model.setDescription(uiPortal.getDescription());
        model.setLocale(uiPortal.getLocale());
        model.setSkin(uiPortal.getSkin());
        model.setModifiable(uiPortal.isModifiable());
        model.setProperties(uiPortal.getProperties());
        model.setPortalRedirects(uiPortal.getPortalRedirects());

        model.setPortalLayout(new Container());

        List<UIComponent> children = uiPortal.getChildren();
        if (children == null)
            return model;
        ArrayList<ModelObject> newChildren = new ArrayList<ModelObject>();
        for (UIComponent child : children) {
            ModelObject component = buildModelObject(child);
            if (component != null)
                newChildren.add(component);
        }
        model.getPortalLayout().setChildren(newChildren);
        return model;
    }
View Full Code Here

        UIPortal editPortal = (UIPortal) uiEditWS.getUIComponent();
        UIPortal uiPortal = Util.getUIPortal();
        String remoteUser = prContext.getRemoteUser();
        String portalName = prContext.getPortalOwner();

        PortalConfig portalConfig = (PortalConfig) PortalDataMapper.buildModelObject(editPortal);
        DataStorage dataStorage = getApplicationComponent(DataStorage.class);
        UserACL acl = getApplicationComponent(UserACL.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
            rebuildUIPortal(uiPortalApp, editPortal, dataStorage);
        }
        prContext.getUserPortalConfig().setPortalConfig(portalConfig);
        PortalConfig pConfig = dataStorage.getPortalConfig(portalName);
        if (pConfig != null) {
            editPortal.setModifiable(acl.hasEditPermission(pConfig));
        } else {
            editPortal.setModifiable(false);
        }
View Full Code Here

        }
        prContext.refreshResourceBundle();
    }

    private void rebuildUIPortal(UIPortalApplication uiPortalApp, UIPortal uiPortal, DataStorage storage) throws Exception {
        PortalConfig portalConfig = storage.getPortalConfig(uiPortal.getSiteType().getName(), uiPortal.getName());
        UserPortalConfig userPortalConfig = Util.getPortalRequestContext().getUserPortalConfig();
        userPortalConfig.setPortalConfig(portalConfig);
        uiPortal.getChildren().clear();
        PortalDataMapper.toUIPortal(uiPortal, userPortalConfig.getPortalConfig());
View Full Code Here

    * @return the config
    * @throws Exception any exception
    */
   public UserPortalConfig getUserPortalConfig(String portalName, String accessUser) throws Exception
   {
      PortalConfig portal = storage_.getPortalConfig(portalName);
      if (portal == null || !userACL_.hasPermission(portal))
      {
         return null;
      }

      List<PageNavigation> navigations = new ArrayList<PageNavigation>();
      PageNavigation navigation = storage_.getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
      if (navigation != null)
      {
         navigation.setModifiable(userACL_.hasPermission(portal.getEditPermission()));
         navigations.add(navigation);
      }

      if (accessUser == null)
      {
View Full Code Here

   {
      // Create the portal from the template
      createUserPortalConfig(PortalConfig.USER_TYPE, userName, "user");

      // Need to insert the corresponding user site if needed
      PortalConfig cfg = storage_.getPortalConfig(PortalConfig.USER_TYPE, userName);
      if (cfg == null)
      {
         cfg = new PortalConfig(PortalConfig.USER_TYPE);
         cfg.setPortalLayout(new Container());
         cfg.setName(userName);
         storage_.create(cfg);
      }

      // Create a blank navigation if needed
      PageNavigation navigation = storage_.getPageNavigation(PortalConfig.USER_TYPE, userName);
View Full Code Here

TOP

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

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.