Package org.exoplatform.portal.config.model

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


        }
    }

    private PageNode unmarshalNode(StaxNavigator<Element> navigator) throws StaxNavException {
        PageNode node = new PageNode();
        I18NString labels = new I18NString();
        ArrayList<PageNode> children = new ArrayList<PageNode>();

        Element current = navigator.child();
        while (current != null) {
            switch (navigator.getName()) {
                case URI: // For backwards compatibility
                    current = navigator.sibling();
                    break;
                case NAME:
                    node.setName(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case LABEL:
                    labels.add(Utils.parseLocalizedString(navigator));
                    current = navigator.sibling();
                    break;
                case ICON:
                    node.setIcon(navigator.getContent());
                    current = navigator.sibling();
View Full Code Here


        }
    }

    private NodeContext<?> add(PageNode target, NodeContext<?> previous, NodeContext<?> parent,
            Map<NodeContext<?>, Map<Locale, Described.State>> labelMap) {
        I18NString labels = target.getLabels();

        //
        Map<Locale, Described.State> description;
        if (labels.isSimple()) {
            description = null;
        } else if (labels.isEmpty()) {
            description = null;
        } else {
            description = new HashMap<Locale, Described.State>();
            for (Map.Entry<Locale, String> entry : labels.getExtended(portalLocale).entrySet()) {
                description.put(entry.getKey(), new Described.State(entry.getValue(), null));
            }
        }

        //
View Full Code Here

    private void update(PageNode src, NodeContext<?> target, Map<NodeContext<?>, Map<Locale, Described.State>> labelMap) {
        target.setState(src.getState());

        // Update extended labels if necessary
        I18NString labels = src.getLabels();
        Map<Locale, Described.State> description;
        if (labels.isSimple()) {
            description = null;
        } else if (labels.isEmpty()) {
            description = null;
        } else {
            description = new HashMap<Locale, Described.State>();
            for (Map.Entry<Locale, String> entry : labels.getExtended(portalLocale).entrySet()) {
                description.put(entry.getKey(), new Described.State(entry.getValue(), null));
            }
        }

        if (description != null) {
View Full Code Here

        pageNode.setName(node.getName());

        if (node.getState().getLabel() == null) {
            Map<Locale, Described.State> descriptions = service.getDescriptions(node.getId());
            if (descriptions != null && !descriptions.isEmpty()) {
                I18NString labels = new I18NString();
                for (Map.Entry<Locale, Described.State> entry : descriptions.entrySet()) {
                    labels.add(new LocalizedString(entry.getValue().getName(), entry.getKey()));
                }

                pageNode.setLabels(labels);
            }
        } else {
View Full Code Here

        }
    }

    private PageNode unmarshalNode(StaxNavigator<Element> navigator) throws StaxNavException {
        PageNode node = new PageNode();
        I18NString labels = new I18NString();
        ArrayList<PageNode> children = new ArrayList<PageNode>();

        Element current = navigator.child();
        while (current != null) {
            switch (navigator.getName()) {
                case URI: // For backwards compatibility
                    current = navigator.sibling();
                    break;
                case NAME:
                    node.setName(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case LABEL:
                    labels.add(Utils.parseLocalizedString(navigator));
                    current = navigator.sibling();
                    break;
                case ICON:
                    node.setIcon(navigator.getContent());
                    current = navigator.sibling();
View Full Code Here

      PageNode target,
      NodeContext<?> previous,
      NodeContext<?> parent,
      Map<NodeContext<?>, Map<Locale, Described.State>> labelMap)
   {
      I18NString labels = target.getLabels();

      //
      Map<Locale, Described.State> description;
      if (labels.isSimple())
      {
         description = null;
      }
      else if (labels.isEmpty())
      {
         description = null;
      }
      else
      {
         description = new HashMap<Locale, Described.State>();
         for (Map.Entry<Locale, String> entry : labels.getExtended(portalLocale).entrySet())
         {
            description.put(entry.getKey(), new Described.State(entry.getValue(), null));
         }
      }
View Full Code Here

                       Map<NodeContext<?>, Map<Locale, Described.State>> labelMap)
   {
      target.setState(src.getState());

      // Update extended labels if necessary
      I18NString labels = src.getLabels();
      Map<Locale, Described.State> description;
      if (labels.isSimple())
      {
         description = null;
      }
      else if (labels.isEmpty())
      {
         description = null;
      }
      else
      {
         description = new HashMap<Locale, Described.State>();
         for (Map.Entry<Locale, String> entry : labels.getExtended(portalLocale).entrySet())
         {
            description.put(entry.getKey(), new Described.State(entry.getValue(), null));
         }
      }
View Full Code Here

      if (node.getState().getLabel() == null)
      {
         Map<Locale, Described.State> descriptions = service.getDescriptions(node.getId());
         if (descriptions != null && !descriptions.isEmpty())
         {
            I18NString labels = new I18NString();
            for (Map.Entry<Locale, Described.State> entry : descriptions.entrySet())
            {
               labels.add(new LocalizedString(entry.getValue().getName(), entry.getKey()));
            }

            pageNode.setLabels(labels);
         }
      }
View Full Code Here

   }

   private PageNode unmarshalNode(StaxNavigator<Element> navigator) throws StaxNavException
   {
      PageNode node = new PageNode();
      I18NString labels = new I18NString();
      ArrayList<PageNode> children = new ArrayList<PageNode>();

      Element current = navigator.child();
      while (current != null)
      {
         switch (navigator.getName())
         {
            case URI: // For backwards compatibility
               current = navigator.sibling();
               break;
            case NAME:
               node.setName(navigator.getContent());
               current = navigator.sibling();
               break;
            case LABEL:
               labels.add(Utils.parseLocalizedString(navigator));
               current = navigator.sibling();
               break;
            case ICON:
               node.setIcon(navigator.getContent());
               current = navigator.sibling();
View Full Code Here

        }
    }

    private PageNode unmarshalNode(StaxNavigator<Element> navigator) throws StaxNavException {
        PageNode node = new PageNode();
        I18NString labels = new I18NString();
        ArrayList<PageNode> children = new ArrayList<PageNode>();

        Element current = navigator.child();
        while (current != null) {
            switch (navigator.getName()) {
                case URI: // For backwards compatibility
                    current = navigator.sibling();
                    break;
                case NAME:
                    node.setName(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case LABEL:
                    labels.add(Utils.parseLocalizedString(navigator));
                    current = navigator.sibling();
                    break;
                case ICON:
                    node.setIcon(navigator.getContent());
                    current = navigator.sibling();
View Full Code Here

TOP

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

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.