Takes a list of SectionContent and returns a SectionContainer with the
given SectionContent s in the right structure.
358686
private SectionContainer buildSectionStructure(List<SectionContent> scl)
	{
		SectionContainer result = new SectionContainer(0);

		for (SectionContent sContent : scl)
		{
			int contentLevel = sContent.getLevel();
			SectionContainer sContainer = result;

			// get the right SectionContainer or create it
			for (int containerLevel = result.getLevel() + 1; containerLevel < contentLevel; containerLevel++)
			{
				int containerSubSections = sContainer.nrOfSubSections();
				if (containerSubSections != 0)
				{
					Section temp = sContainer
							.getSubSection(containerSubSections - 1);
					if (temp.getClass() == SectionContainer.class)
					{
						sContainer = (SectionContainer) temp;
					}
					else
					{
						SectionContainer sct = new SectionContainer(temp
								.getTitleElement(), containerLevel);
						sct.addSection(temp);
						if (calculateSrcSpans)
						{
							sct.setSrcSpan(temp.getSrcSpan());
						}
						temp.setTitleElement(null);
						temp.setLevel(containerLevel + 1);
						sContainer.removeSection(temp);
						sContainer.addSection(sct);
						sContainer = sct;
					}
				}
				else
				{
					sContainer = new SectionContainer(null, containerLevel);
				}
			}

			sContainer.addSection(sContent);
		}

		if (calculateSrcSpans)
		{
			result.setSrcSpan(new SrcSpan(0, -1));
		}

		return result;
	}
292768
public function addSection(PHPRtfLite_Container_Section $section = null)
    {
        if ($section === null) {
            $section = new PHPRtfLite_Container_Section($this);
        }

        $this->_sections[] = $section;

        return $section;
    }
1229402
private List<CmsResource> getContents(String folderPath, String type) throws CmsException {

        CmsPathMap<CmsResource> pathMap = getPathMapForType(type);
        return pathMap.getChildValues(folderPath);
    }
855847
public static List<CSNodeWrapper> getAllNodes(final ContentSpecWrapper contentSpec) {
        final List<CSNodeWrapper> nodes = new LinkedList<CSNodeWrapper>();
        if (contentSpec.getChildren() != null) {
            final List<CSNodeWrapper> childrenNodes = contentSpec.getChildren().getItems();
            for (final CSNodeWrapper childNode : childrenNodes) {
                nodes.add(childNode);
                nodes.addAll(getAllChildrenNodes(childNode));
            }
        }

        return nodes;
    }
668111
function createSection (section, content, options) {
  options = options[section] || {}
  var c = content[section] || {}
  var o = options.contents
  var paginationOffset = Math.floor(options.paginationOffset) || 0

  if (typeof o !== 'object') o = {default: o}

  return {
    height: options.height,
    contents: phantom.callback(function (pageNum, numPages) {
      var html = o[pageNum] || c[pageNum]

      var pageNumFinal = pageNum + paginationOffset
      var numPagesFinal = numPages + paginationOffset

      if (pageNumFinal === 1 && !html) html = o.first || c.first
      if (numPagesFinal === numPages && !html) html = o.last || c.last
      return (html || o.default || c.default || '')
        .replace(/{{page}}/g, pageNumFinal)
        .replace(/{{pages}}/g, numPagesFinal) + content.styles
    })
  }
}
604559
def GetSectionByIndex(self, section_index):
    
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    if section_index < 0 or section_index >= len(self._sections):
      return None

    return self._sections[section_index]
1054673
def get_section_by_rva(self, rva):
        """"""
        
        sections = [s for s in self.sections if s.contains_rva(rva)]
        
        if sections:
            return sections[0]
        
        return None
1017833
public static Set<Pair<Integer, Integer>> getTopicIdsFromContentSpec(final ContentSpec contentSpec) {
        // Add the topics at this level to the database
        final Set<Pair<Integer, Integer>> topicIds = new HashSet<Pair<Integer, Integer>>();
        final List<SpecTopic> specTopics = contentSpec.getSpecTopics();
        for (final SpecTopic specTopic : specTopics) {
            if (specTopic.getDBId() != 0) {
                topicIds.add(new Pair<Integer, Integer>(specTopic.getDBId(), specTopic.getRevision()));
            }
        }

        return topicIds;
    }
1300589
public ItemRequest<Section> findById(String section) {
    
        String path = String.format("/sections/%s", section);
        return new ItemRequest<Section>(this, Section.class, path, "GET");
    }
1183784
def get_list(self, section, option):
        
        if self.has_option(section, option):
            return self.get(section, option).replace(' ', '').split(',')
        else:
            raise KeyError('{} with {} does not exist.'.format(section,
                                                               option))
907538
def get_section(self, *key):
        
        section = self._get_item_or_section(key)
        if not section.is_section:
            raise RuntimeError('{} is an item, not a section'.format(key))
        return section
800318
public function setSection(string $section, $container) : SectionedMap
    {
        if ($section === '') {
            throw new \InvalidArgumentException('Arg \'section\' cannot be empty.');
        }
        if (is_array($container)) {
            $this->arrayAccess[$section] = true;
        } elseif (is_object($container)) {
            $this->arrayAccess[$section] = $container instanceof \ArrayAccess;
        } else {
            throw new \TypeError('Arg \'container\' type[' . gettype($container) . '] is not object|array.');
        }
        $this->map[$section] = $container;

        return $this;
    }
744608
def items(self, section=None):
        """"""
        if not section and self.section:
            section = self.section
        config = self.config.get(section, {}) if section else self.config
        return config.items()
203535
function getSection(document, sectionNumber) {
  var content = markupFiles.getSection(document, sectionNumber);
  return replacements(document, replacements(document, content));
}
938496
private String getContentByContainer(
        CmsContainerElementBean element,
        CmsContainer container,
        CmsFormatterConfiguration configs) {

        String content = null;

        I_CmsFormatterBean formatter = getFormatterForContainer(
            m_cms,
            element,
            container,
            m_adeConfig,
            CmsADESessionCache.getCache(m_req, m_cms));
        if (formatter != null) {
            element = element.clone(); // clone element because presets for different containers may be different
            element.initSettings(m_cms, formatter, m_locale, m_req, container.getSettingPresets());
            try {
                content = getElementContent(element, m_cms.readResource(formatter.getJspStructureId()), container);
                //                }
            } catch (Exception e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            if (content != null) {
                content = removeScriptTags(content);
            }
        }
        return content;
    }
1044345
public static Section getSection(Section parent, Properties attributes) {
		Section section = parent.addSection("");
		setSectionParameters(section, attributes);
		return section;
	}
624094
@XmlElementWrapper(name = "sections")
    @XmlElement(name = "s", type = S.class)
    public List<S> getSections() {
        return sections;
    }