Examples of DescriptionService


Examples of org.exoplatform.portal.mop.description.DescriptionService

        dataService.save(page);

        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        userPortal.saveNode(selectedNode, null);

        DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
        Map<Locale, Described.State> descriptions = new HashMap<Locale, Described.State>();
        Map<String, String> cachedLabels = uiPageInfo.getCachedLabels();

        for (String strLocale : cachedLabels.keySet()) {
            Locale locale;
            if (strLocale.contains("_")) {
                String[] arr = strLocale.split("_");
                if (arr.length > 2) {
                    locale = new Locale(arr[0], arr[1], arr[2]);
                } else {
                    locale = new Locale(arr[0], arr[1]);
                }
            } else {
                locale = new Locale(strLocale);
            }

            descriptions.put(locale, new Described.State(cachedLabels.get(strLocale), null));
        }

        descriptionService.setDescriptions(createdNode.getId(), descriptions);
        return createdNode;
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

    public void save() {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        try {
            userPortal.saveNode(getRootNode().getNode(), getRootNode());
            DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
            Map<String, Map<Locale, State>> i18nizedLabels = this.userNodeLabels;

            for (String treeNodeId : i18nizedLabels.keySet()) {
                TreeNode node = findNode(treeNodeId);
                if (node != null) {
                    Map<Locale, State> labels = i18nizedLabels.get(treeNodeId);
                    if (labels != null && labels.size() > 0) {
                        descriptionService.setDescriptions(node.getNode().getId(), labels);
                    }
                }

            }
        } catch (NavigationServiceException ex) {
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

    public Scope getScope() {
        return this.navigationScope;
    }

    private void invokeI18NizedLabels(TreeNode node) {
        DescriptionService descriptionService = this.getApplicationComponent(DescriptionService.class);
        try {
            Map<Locale, State> labels = descriptionService.getDescriptions(node.getId());
            node.setI18nizedLabels(labels);
        } catch (NullPointerException npe) {
            // set label list is null if Described mixin has been removed or not exists.
            node.setI18nizedLabels(null);
        }
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

        dataService.save(page);

        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        userPortal.saveNode(selectedNode, null);

        DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
        Map<Locale, Described.State> descriptions = new HashMap<Locale, Described.State>();
        Map<String, String> cachedLabels = uiPageInfo.getCachedLabels();

        for (String strLocale : cachedLabels.keySet()) {
            Locale locale;
            if (strLocale.contains("_")) {
                String[] arr = strLocale.split("_");
                if (arr.length > 2) {
                    locale = new Locale(arr[0], arr[1], arr[2]);
                } else {
                    locale = new Locale(arr[0], arr[1]);
                }
            } else {
                locale = new Locale(strLocale);
            }

            descriptions.put(locale, new Described.State(cachedLabels.get(strLocale), null));
        }

        descriptionService.setDescriptions(createdNode.getId(), descriptions);
        return createdNode;
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

        dataService.save(page);

        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        userPortal.saveNode(selectedNode, null);

        DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
        Map<Locale, Described.State> descriptions = new HashMap<Locale, Described.State>();
        Map<String, String> cachedLabels = uiPageInfo.getCachedLabels();

        for (String strLocale : cachedLabels.keySet()) {
            Locale locale;
            if (strLocale.contains("_")) {
                String[] arr = strLocale.split("_");
                if (arr.length > 2) {
                    locale = new Locale(arr[0], arr[1], arr[2]);
                } else {
                    locale = new Locale(arr[0], arr[1]);
                }
            } else {
                locale = new Locale(strLocale);
            }

            descriptions.put(locale, new Described.State(cachedLabels.get(strLocale), null));
        }

        descriptionService.setDescriptions(createdNode.getId(), descriptions);
        return createdNode;
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

      if (dataStorage == null) throw new OperationException(operationName, "DataStorage was null");

      NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);
      if (navigationService == null) throw new OperationException(operationName, "Navigation service was null");

      DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(DescriptionService.class);
      if (descriptionService == null) throw new OperationException(operationName, "Description service was null");

      String mode = operationContext.getAttributes().getValue("importMode");
      if (mode == null || "".equals(mode)) mode = "merge";
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

      {
         Site site = navigation.getSite();
         String navUri = operationContext.getAddress().resolvePathTemplate("nav-uri");
         SiteKey siteKey = getSiteKey(site);

         DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(DescriptionService.class);
         NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);
         BindingProvider bindingProvider = operationContext.getBindingProvider();
         Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

         NavigationExportTask exportTask = new NavigationExportTask(new NavigationKey(siteKey, navUri), navigationService, descriptionService, marshaller);
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

      Site site = defaultNavigation.getSite();
      SiteKey siteKey = getSiteKey(site);

      //TODO: If there's any benefit in creating our own node model to use with navigation service, lets do it

      DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(DescriptionService.class);
      NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);

      PageNavigation pageNavigation = NavigationUtils.loadPageNavigation(new NavigationKey(siteKey, navUri), navigationService, descriptionService);
      if (pageNavigation == null) throw new ResourceNotFoundException("Navigation node not found for navigation uri '" + navUri +"'");
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

         }
         else if (id != null)
         {
            Locale userLocale = owner.navigation.portal.context.getUserLocale();
            Locale portalLocale = owner.navigation.portal.getLocale();
            DescriptionService descriptionService = owner.navigation.portal.service.getDescriptionService();
            Described.State description = descriptionService.resolveDescription(id, portalLocale, userLocale);
            if (description != null)
            {
               resolvedLabel = description.getName();
            }
         }
View Full Code Here

Examples of org.exoplatform.portal.mop.description.DescriptionService

        NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);
        if (navigationService == null)
            throw new OperationException(operationName, "Navigation service was null");

        DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(
                DescriptionService.class);
        if (descriptionService == null)
            throw new OperationException(operationName, "Description service was null");

        String mode = operationContext.getAttributes().getValue("importMode");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.