private void updateContainerLevelInfo() {

        Map<String, CmsContainerPageContainer> containers = new HashMap<String, CmsContainerPageContainer>();
        List<CmsContainerPageContainer> temp = new ArrayList<CmsContainerPageContainer>(m_targetContainers.values());
        m_maxContainerLevel = 0;
        boolean progress = true;
        while (!temp.isEmpty() && progress) {
            int size = containers.size();
            Iterator<CmsContainerPageContainer> it = temp.iterator();
            while (it.hasNext()) {
                CmsContainerPageContainer container = it.next();
                int level = -1;
                if (CmsStringUtil.isEmptyOrWhitespaceOnly(container.getParentContainerId())) {
                    level = 0;
                } else if (containers.containsKey(container.getParentContainerId())) {
                    level = containers.get(container.getParentContainerId()).getContainerLevel() + 1;
                }
                if (level > -1) {
                    container.setContainerLevel(level);
                    containers.put(container.getContainerId(), container);
                    it.remove();
                    if (level > m_maxContainerLevel) {
                        m_maxContainerLevel = level;
                    }
                }
            }
            progress = containers.size() > size;
        }
    }
private void updateContainerLevelInfo ( ) { Map < String , CmsContainerPageContainer > containers = new HashMap < String , CmsContainerPageContainer > ( ) ; List < CmsContainerPageContainer > temp = new ArrayList < CmsContainerPageContainer > ( m_targetContainers . values ( ) ) ; m_maxContainerLevel = 0 ; boolean progress = true ; while ( ! temp . isEmpty ( ) && progress ) { int size = containers . size ( ) ; Iterator < CmsContainerPageContainer > it = temp . iterator ( ) ; while ( it . hasNext ( ) ) { CmsContainerPageContainer container = it . next ( ) ; int level = - 1 ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( container . getParentContainerId ( ) ) ) { level = 0 ; } else if ( containers . containsKey ( container . getParentContainerId ( ) ) ) { level = containers . get ( container . getParentContainerId ( ) ) . getContainerLevel ( ) + 1 ; } if ( level > - 1 ) { container . setContainerLevel ( level ) ; containers . put ( container . getContainerId ( ) , container ) ; it . remove ( ) ; if ( level > m_maxContainerLevel ) { m_maxContainerLevel = level ; } } } progress = containers . size ( ) > size ; } }
Updates the container level info on the present containers.<p>