Gets the root page in the web page hierarchy.  The root page has no parent.
435251
public final WebPage getRootPage() throws IOException, SQLException {
		WebPage page = this;
		WebPage parent;
		while ((parent = page.getParent()) != null) page = parent;
		return page;
	}
1192044
public synchronized SiteNode findClosestParent(URI uri) {
    	if (uri == null) {
    		return null;
    	}
        SiteNode lastParent = null;
        SiteNode parent = getRoot();
        String folder = "";
        
        try {
        	String host = getHostName(uri);
        	
            // no host yet
            parent = findChild(parent, host);
            if (parent == null) {
                return null;
        	}
            lastParent = parent;
            
            List<String> path = model.getSession().getTreePath(uri);
            for (int i=0; i < path.size(); i++) {
            	folder = path.get(i);
                if (folder != null && !folder.equals("")) {
                    if (i == path.size()-1) {
                        lastParent = parent;
                    } else {
                        parent = findChild(parent, folder);
                        if (parent == null) {
                            break;
                        }
                        lastParent = parent;
                    }
                }
            }
        } catch (URIException e) {
            log.error(e.getMessage(), e);
        }
        
        return lastParent;
    }
377421
public function getLevel()
    {
        if ($page = $this->getCurrentPage(Page::class)) {
            
            if (!$page->Children()->exists()) {
                
                $parent = $page->getParent();
                
                while ($parent && !$parent->Children()->exists()) {
                    $parent = $parent->getParent();
                }
                
                return $parent;
                
            }
            
            return $page;
            
        }
    }
63069
protected function getRootPagesWithIndexingOff()
    {
        $rootPages = $this->getRootPages();
        $rootPagesWithIndexingOff = [];

        foreach ($rootPages as $rootPage) {
            try {
                $this->initializeTSFE($rootPage);
                $solrIsEnabledAndIndexingDisabled = $this->getIsSolrEnabled() && !$this->getIsIndexingEnabled();
                if ($solrIsEnabledAndIndexingDisabled) {
                    $rootPagesWithIndexingOff[] = $rootPage;
                }
            } catch (\RuntimeException $rte) {
                $rootPagesWithIndexingOff[] = $rootPage;
            } catch (ServiceUnavailableException $sue) {
                if ($sue->getCode() == 1294587218) {
                    //  No TypoScript template found, continue with next site
                    $rootPagesWithIndexingOff[] = $rootPage;
                    continue;
                }
            }
        }

        return $rootPagesWithIndexingOff;
    }
1300502
public static function getRootUrl()
    {
        if (empty(self::$root) && defined('ROOT_URL')) {
            self::$root = ROOT_URL;
            if (!preg_match("/\/$/", self::$root)) {
                self::$root .= '/';
            }
        }

        return self::$root;
    }
533441
def root
      if parent_ids.present?
        base_class.find(parent_ids.first)
      else
        self.root? ? self : self.parent.root
      end
    end
932663
def get_xpath_root(xpath):
    

    if xpath:
        if xpath.startswith('@'):
            xpath = ''
        else:
            index = xpath.find('/@' if '@' in xpath else '/{')
            xpath = xpath[:index] if index >= 0 else xpath

    return xpath
473704
public URL getParent() {
        if (isField()) {
            return getCharacteristicURL();
        } else if (isCharacteristic()) {
            return getServiceURL();
        } else if (isService()) {
            return getDeviceURL();
        } else if (isDevice()) {
            return getAdapterURL();
        } else if (isAdapter()) {
            return getProtocolURL();
        } else {
            return null;
        }
    }
218270
public Path getParent() {
    String path = uri.getPath();
    int lastSlash = path.lastIndexOf('/');
    int start = hasWindowsDrive(path, true) ? 3 : 0;
    if ((path.length() == start) ||               // empty path
        (lastSlash == start && path.length() == start+1)) { // at root
      return null;
    }
    String parent;
    if (lastSlash==-1) {
      parent = CUR_DIR;
    } else {
      int end = hasWindowsDrive(path, true) ? 3 : 0;
      parent = path.substring(0, lastSlash==end?end+1:lastSlash);
    }
    return new Path(uri.getScheme(), uri.getAuthority(), parent);
  }
755829
def _get_parent(root):
    

    elem = root

    while True:
        elem = elem.getparent()

        if elem.tag in ['ul', 'ol']:
            return elem
738517
def root(self):
        
        ret = self
        while hasattr(ret, 'parent') and ret.parent:
            ret = ret.parent
        return ret if isinstance(ret, SchemaABC) else None
884438
public String getDetailPage(CmsObject cms, String pageRootPath, String originPath) {

        return getDetailPage(cms, pageRootPath, originPath, null);
    }
1026188
def pages_siblings_menu(context, page, url='/'):
    
    lang = context.get('lang', pages_settings.PAGE_DEFAULT_LANGUAGE)
    page = get_page_from_string_or_id(page, lang)
    if page:
        if page.parent:
            root = page.parent
        else:
            root = page
        children = root.get_children_for_frontend()
        context.update({'children': children, 'page': page})
    return context
1030996
def get_parent(self, level=1):
        '''
        
        '''
        try:
            parent_path = self.path.get_parent(level)
        except ValueError: # abspath cannot get parent
            return None
        assert parent_path
        return DirectoryInfo(parent_path)
410731
def parent(self):
        
        if len(self.nodes) > 0:
            parent = self.nodes[-1].proxy
        else:
            parent = None
        return parent
971896
public Page getSingleValuePage(int position)
    {
        Block[] singleValueBlocks = new Block[this.blocks.length];
        for (int i = 0; i < this.blocks.length; i++) {
            singleValueBlocks[i] = this.blocks[i].getSingleValueBlock(position);
        }
        return new Page(1, singleValueBlocks);
    }
1034103
def get_parent(self):
        """"""
        if self.is_entity():
            return self.get_index_url(**self.default_kwargs_for_urls())
        elif self._parent is not None:
            resource = self._parent.rsplit('_', 1)[0]
            parts = self.default_kwargs_for_urls()

            if '{}_id'.format(resource) in parts:
                id = parts.pop('{}_id'.format(resource))
                parts['id'] = id
            return self.get_full_url(
                self.app.reverse(
                    self._parent, **parts
                )
            )