Segments the page using the chosen provider and parametres.
551855
private void segmentPage()
    {
        DefaultContentRect.resetId(); //reset the default ID generator to obtain the same IDs for every segmentation
        if (segmentatorCombo.getSelectedIndex() != -1)
        {
            AreaTreeProvider provider = segmentatorCombo.getItemAt(segmentatorCombo.getSelectedIndex());
            proc.segmentPage(provider, null); //the parametres should have been set through the GUI
            setAreaTree(proc.getAreaTree());
        }
    }
929901
def route_dynamic_page(params)

      # split the url up into segments
      segments = params[:slug].split('/')

      # general variables
      url = params[:slug]
      article_url = Setting.get('articles_slug')
      category_url = Setting.get('category_slug')
      tag_url = Setting.get('tag_slug')

      status = "(post_status = 'Published' AND post_date <= CURRENT_TIMESTAMP AND disabled = 'N')"
      # is it a article post or a page post
      case get_type_by_url
      when "CT"
        render_category segments, article_url, true, status
      when "AR"
        render_archive segments, article_url
      when "A"
        render_single segments, article_url, status
      when "C"
        render_category segments, article_url, false, status
      when "P"
        render_page url, status
      end

    end
830864
function _processPages(siteDesc, prefix) {
    if (siteDesc.pages !== undefined && siteDesc.pages !== null) {
        //console.log('pages', siteDesc.pages, 'prefix', prefix);

        for (let i in siteDesc.pages) {
            _processElement(siteDesc.pages[i], prefix);
        }
    }
}
1290428
static function PageUrl(Page $page, array $params = array(), $fragment = '')
    {
        $siteUrl = $page->GetSite()->GetUrl();
        $pageUrl = $page->GetUrl();
        if ($pageUrl == 'index.html') {
            $url = $siteUrl;
        }
        else {
            $url = Path::Combine($siteUrl, $pageUrl);
        }

        $oblParams = self::GatherParams($url);
        $urlObl = self::AttachObligatoryParams($url, $oblParams, $params);

        $urlAllParams = self::AttachMoreParams($urlObl, $oblParams, $params);
        return $fragment ? $urlAllParams . '#' . $fragment : $urlAllParams;
    }
536422
function navigateToUrl(page, ph, url, callback) {

    var oldUrl;
    async.waterfall([
        function (callback) {
            page.get('url', function (url) {
                oldUrl = url;
                callback();
            });
        },

        function (callback) {
            page.evaluate(function (url) {
                try {
                    window.location.href = url;
                } catch (exception) {
                    return exception;
                }
            }, function (error) {
                // do this because if there is no error, the error is still something so we can't simply do callback(error);
                if (error) {
                    callback(error);
                    return;
                }

                callback();
            }, url);
        },

        function (callback) {
            checks.pageHasChanged(page, oldUrl, function (error) {
                callback(error);
            });
        }
    ], function (error) {
        callback(error, page, ph);
    });
}
169749
def parse_pagination(headers):
    
    links = {
        link.rel: parse_qs(link.href).get("page", None)
        for link in link_header.parse(headers.get("Link", "")).links
    }
    return _Navigation(
        links.get("previous", [None])[0],
        links.get("next", [None])[0],
        links.get("last", [None])[0],
        links.get("current", [None])[0],
        links.get("first", [None])[0]
    )
733456
def process_url(self, page_num, page_size, url):
        
        params = dict()
        if page_num is not None:
            url = re.sub('page=\d+', '', url)
            params['page'] = page_num
        if page_size is not None:
            url = re.sub('per_page=\d+', '', url)
            params['per_page'] = page_size
        return params, url
912392
@RequestMapping(value = "", method = RequestMethod.GET)
	public PagedResources<? extends MetricResource> list(
			Pageable pageable,
			PagedResourcesAssembler<Metric<Double>> pagedAssembler,
			@RequestParam(value = "detailed", defaultValue = "false") boolean detailed) {
		/* Page */ Iterable<Metric<?>> metrics = metricRepository.findAll(/* pageable */);
		List<Metric<Double>> content = filterCounters(metrics);
		long count = content.size();
		long pageEnd = Math.min(count, pageable.getOffset() + pageable.getPageSize());
		Page counterPage = new PageImpl<>(content.subList(toIntExact(pageable.getOffset()), toIntExact(pageEnd)),
				pageable, content.size());
		ResourceAssembler<Metric<Double>, ? extends MetricResource> assemblerToUse =
				detailed ? counterResourceAssembler : shallowResourceAssembler;
		return pagedAssembler.toResource(counterPage, assemblerToUse);
	}
630476
def set_next_page_params(self):
        """"""
        if self.items:
            index = self.get_last_item_index()
            self.params[self.mode] = self.get_next_page_param(self.items[index])
171302
def get_narrow_url(self, instance):
        
        text = instance[0]
        request = self.context["request"]
        query_params = request.GET.copy()

        # Never keep the page query parameter in narrowing urls.
        # It will raise a NotFound exception when trying to paginate a narrowed queryset.
        page_query_param = self.get_paginate_by_param()
        if page_query_param and page_query_param in query_params:
            del query_params[page_query_param]

        selected_facets = set(query_params.pop(self.root.facet_query_params_text, []))
        selected_facets.add("%(field)s_exact:%(text)s" % {"field": self.parent_field, "text": text})
        query_params.setlist(self.root.facet_query_params_text, sorted(selected_facets))

        path = "%(path)s?%(query)s" % {"path": request.path_info, "query": query_params.urlencode()}
        url = request.build_absolute_uri(path)
        return serializers.Hyperlink(url, "narrow-url")
1136487
def prepare_page(self, *args, **kwargs):
        '''
        
        '''
        super(BaseBackend, self).prepare_page(*args, **kwargs)
622226
function (e) {
        if (e && e.prevValue === e.newValue) {
            return;
        }

        var last = this.paginator.getTotalPages(),
            par  = this.current ? this.current.parentNode : null;

        if (this.paginator.getCurrentPage() !== last) {
            if (par && this.current === this.span) {
                par.replaceChild(this.link,this.current);
                this.current = this.link;
            }
        } else if (this.current === this.link) {
            if (par) {
                par.replaceChild(this.span,this.current);
                this.current = this.span;
            }
        }
    }
556613
function BasePage(url, id, _options) {
                var _this = _super.call(this, url, id, _options = $.extend({
                    baseHeader: UI.BaseHeaderView,
                    backCommandHandler: "onPageBack",
                    backCommandKind: "pageback",
                    domExtensionOptions: {},
                }, _options)) || this;
                _this._options = _options;
                return _this;
            }
184421
def pages_view(view):
    
    def pages_view_decorator(request, *args, **kwargs):
        # if the current page is already there
        if(kwargs.get('current_page', False) or
                kwargs.get('pages_navigation', False)):
            return view(request, *args, **kwargs)

        path = kwargs.pop('path', None)
        lang = kwargs.pop('lang', None)
        if path:
            from basic_cms.views import details
            response = details(request, path=path, lang=lang,
                only_context=True, delegation=False)
            context = response
            extra_context_var = kwargs.pop('extra_context_var', None)
            if extra_context_var:
                kwargs.update({extra_context_var: context})
            else:
                kwargs.update(context)
        return view(request, *args, **kwargs)
    return pages_view_decorator
1096686
private void findMarkers(String url, String target) {
        final char[] data = url.toCharArray();

        // we only care about the last path segment so find that first
        int i = 0;
        int lastSlash = 0;
        for (; i < data.length; i++) {
            if ('/' == data[i]) {
                lastSlash = i;
            } else if ('?' == data[i]) {
                this.queryMarker = i;
                break; // out of loop since query data is after the path
            }
        }
        // now check for the id marker and/or fragments for the last segment
        for (i = lastSlash; i < data.length; i++) {
            if (i == this.queryMarker) {
                // no fragments or segment parameters were found
                break;
            } else if ('#' == data[i]) {
                // found a "#fragment" at the end of the path segment
                this.fragmentMarker = i;
                break;
            } else if (';' == data[i]) {
                // found a segment parameter block (would appear before the
                // optional fragment or query data)
                this.paramMarker = i;
                if (url.regionMatches(i, target, 0, target.length())) {
                    this.idMarker = i;
                }
            }
        }
    }
576706
def pages_menu(context, page, url='/'):
    
    lang = context.get('lang', pages_settings.PAGE_DEFAULT_LANGUAGE)
    page = get_page_from_string_or_id(page, lang)
    if page:
        children = page.get_children_for_frontend()
        context.update({'children': children, 'page': page})
    return context
961883
def segments(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.segments(index=self._name, **kwargs)