Returns the Information of a ParsedPage which are selected by the actual configuration
187694
public String getSelectedText( ParsedPage pp ){
		if( pp == null ) return null;
		
		StringBuilder sb = new StringBuilder();
		
		levelModifier = pp.getSection(0).getLevel()-1;
		
		if( pageHandling == null ){
			if( firstParagraphHandling != null ){				
				handleContent( pp.getFirstParagraph(), firstParagraphHandling, sb );
				deleteParagraph( pp.getFirstParagraphNr(), pp.getSections() );
			}
			for( Section s: pp.getSections() )
				handleSection( s, sb );
		}
		else{
			if( pageHandling.get( CIT.TEXT ) ){
				sb.append( pp.getText() );
			}
			else{
				if( pageHandling.get( CIT.BOLD )){
					handleSpans( pp.getFormatSpans( FormatType.BOLD ), pp.getText(), sb );
				}
				if( pageHandling.get( CIT.ITALIC )){
					handleSpans( pp.getFormatSpans( FormatType.ITALIC ), pp.getText(), sb );
				}
			}
			
			if( pageHandling.get( CIT.LINK ))
				handleLinks( pp.getLinks(), !pageHandling.get( CIT.TEXT ), sb );
		}
		
		return sb.toString().trim();
	}
1092280
def get_context_data(self, **kwargs):
        '''
        
        '''
        context = super(PageList, self).get_context_data(**kwargs)
        page_base_template = "nupages/base.html"
        # if MultiTenantMiddleware is used, use a base template specific to 
        # the tenants SITE_ID
        if hasattr(self.request, 'site_id'):
            page_base_template = select_template(
                ["nupages/tenants/{}/base.html".format(self.request.site_id), 
                page_base_template])
        context['base_template'] = page_base_template
        print page_base_template
        return context
522265
def parser(self):
        """"""
        parser = configparser.RawConfigParser()
        for filename in self.available_files:
            friendly_name = format_path(filename)
            logger.debug("Loading configuration file: %s", friendly_name)
            loaded_files = parser.read(filename)
            if len(loaded_files) == 0:
                self.report_issue("Failed to load configuration file! (%s)", friendly_name)
        logger.debug("Loaded %s from %s.",
                     pluralize(len(parser.sections()), "section"),
                     pluralize(len(self.available_files), "configuration file"))
        return parser
186503
private static function retrievePageForEnableFields()
    {
        if (!is_object(self::$pageForEnableFields)) {
            if (isset($GLOBALS['TSFE'])
                && is_object($GLOBALS['TSFE']->sys_page)
            ) {
                self::$pageForEnableFields = $GLOBALS['TSFE']->sys_page;
            } else {
                self::$pageForEnableFields = GeneralUtility::makeInstance(PageRepository::class);
            }
        }
    }
416840
private int getSelectedTab() {
        String theme = "default";
        List<PageParameters.NamedPair> pairs = getPageParameters().getAllNamed();
        theme = pairs.get(0).getValue();
        if ("grid".equals(theme)) {
            return 1;
        } else if ("skies".equals(theme)) {
            return 2;
        } else if ("gray".equals(theme)) {
            return 3;
        } else if ("darkblue".equals(theme)) {
            return 4;
        } else if ("darkgreen".equals(theme)) {
            return 5;
        } else {
            return 0;
        }
    }
92536
def extract_data(self, page):
        """"""
        response_keys = set(page.keys())
        uncommon_keys = response_keys - self.common_keys

        for possible_data_key in uncommon_keys:
            element = page[possible_data_key]
            if isinstance(element, dict):
                return [self.representation(self.client, self.service_name,
                                            element)]
            if isinstance(element, list):
                return [self.representation(self.client, self.service_name, x)
                        for x in element]
1371874
def get_pagination_context(
    page, pages_to_show=11, url=None, size=None, extra=None, parameter_name="page"
):
    
    pages_to_show = int(pages_to_show)
    if pages_to_show < 1:
        raise ValueError(
            "Pagination pages_to_show should be a positive integer, you specified {pages}".format(
                pages=pages_to_show
            )
        )
    num_pages = page.paginator.num_pages
    current_page = page.number
    half_page_num = int(floor(pages_to_show / 2))
    if half_page_num < 0:
        half_page_num = 0
    first_page = current_page - half_page_num
    if first_page <= 1:
        first_page = 1
    if first_page > 1:
        pages_back = first_page - half_page_num
        if pages_back < 1:
            pages_back = 1
    else:
        pages_back = None
    last_page = first_page + pages_to_show - 1
    if pages_back is None:
        last_page += 1
    if last_page > num_pages:
        last_page = num_pages
    if last_page < num_pages:
        pages_forward = last_page + half_page_num
        if pages_forward > num_pages:
            pages_forward = num_pages
    else:
        pages_forward = None
        if first_page > 1:
            first_page -= 1
        if pages_back is not None and pages_back > 1:
            pages_back -= 1
        else:
            pages_back = None
    pages_shown = []
    for i in range(first_page, last_page + 1):
        pages_shown.append(i)
        # Append proper character to url
    if url:
        # Remove existing page GET parameters
        url = force_text(url)
        url = re.sub(r"\?{0}\=[^\&]+".format(parameter_name), "?", url)
        url = re.sub(r"\&{0}\=[^\&]+".format(parameter_name), "", url)
        # Append proper separator
        if "?" in url:
            url += "&"
        else:
            url += "?"
            # Append extra string to url
    if extra:
        if not url:
            url = "?"
        url += force_text(extra) + "&"
    if url:
        url = url.replace("?&", "?")
    # Set CSS classes, see http://getbootstrap.com/components/#pagination
    pagination_css_classes = ["pagination"]
    if size == "small":
        pagination_css_classes.append("pagination-sm")
    elif size == "large":
        pagination_css_classes.append("pagination-lg")
        # Build context object
    return {
        "bootstrap_pagination_url": url,
        "num_pages": num_pages,
        "current_page": current_page,
        "first_page": first_page,
        "last_page": last_page,
        "pages_shown": pages_shown,
        "pages_back": pages_back,
        "pages_forward": pages_forward,
        "pagination_css_classes": " ".join(pagination_css_classes),
        "parameter_name": parameter_name,
    }
735186
def get_page_text(self, page):
        
        url = self.get_page_text_url(page)
        return self._get_url(url)
1082396
public function AvailableSectionTypes()
    {
        $AvailableTypes = ClassInfo::subclassesfor('Section');
        unset($AvailableTypes['Section']);

        # Get section options from each page type.
        $pageTypeOptions = Config::inst()->get($this->owner->ClassName, 'section_options');

        foreach ($AvailableTypes as $key => $value) {
            $Config = Config::inst();
            $selectable_option = true;
            if ($Config->get($value, 'selectable_option') !== null) {
                $selectable_option = $Config->get($value, 'selectable_option');
            }
            $AvailableTypes[$key] = array(
                'classname' => $value,
                'type' => Section::Type($value),
                'presets' => $Config->get($value, 'presets'),
                'selectable_option' => $selectable_option,
                'limit' => $Config->get($value, 'limit'),
            );

            if (isset($pageTypeOptions[$key])) {
                $AvailableTypes[$key] = array_merge($AvailableTypes[$key], $pageTypeOptions[$key]);
            }

            $AvailableTypes[$key]['limit_reached'] = false;
            if(isset($AvailableTypes[$key]['limit'])){
                if ($AvailableTypes[$key]['limit'] == 0) {
                    $AvailableTypes[$key]['limit_reached'] = true;
                }

                $CurrentSectionCount = $this->owner
                    ->Sections()
                    ->filter('ClassName', $AvailableTypes[$key]['type'])
                    ->count();
                if ($CurrentSectionCount >= $AvailableTypes[$key]['limit']) {
                    $AvailableTypes[$key]['limit_reached'] = true;
                }
            }
        }

        return $AvailableTypes;
    }
61179
def get_pages_for_display(self):
        """"""
        parent_page = self.parent_page_for_menu_items
        pages = self.get_base_page_queryset().filter(
            depth__gt=parent_page.depth,
            depth__lte=parent_page.depth + self.max_levels,
            path__startswith=parent_page.path,
        )
        # Return 'specific' page instances if required
        if(self.use_specific == constants.USE_SPECIFIC_ALWAYS):
            return pages.specific()
        return pages
877690
private void fillWizardPageWithSelectedTypes() {
		final StructuredSelection selection = getSelectedItems();
		if (selection == null) {
			return;
		}
		for (final Iterator<?> iter = selection.iterator(); iter.hasNext();) {
			final Object obj = iter.next();
			if (obj instanceof TypeNameMatch) {
				accessedHistoryItem(obj);
				final TypeNameMatch type = (TypeNameMatch) obj;
				final String qualifiedName = Utilities.getNameWithTypeParameters(type.getType());
				final String message;

				if (addTypeToWizardPage(this.typeWizardPage, qualifiedName)) {
					message = MessageFormat.format(Messages.AbstractSuperTypeSelectionDialog_2,
							TextProcessor.process(qualifiedName, JAVA_ELEMENT_DELIMITERS));
				} else {
					message = MessageFormat.format(Messages.AbstractSuperTypeSelectionDialog_3,
							TextProcessor.process(qualifiedName, JAVA_ELEMENT_DELIMITERS));
				}
				updateStatus(new StatusInfo(IStatus.INFO, message));
			}
		}
	}
230703
private static String getPageDoc(
            IAnnotationBinding[] annotations, AcceptableLocales locales) {
        Map<Locale, String> allPages = getAllPageDocs(annotations);
        if (allPages.isEmpty()) {
            return null; // no @Page found
        }

        for (Locale locale : locales.getLocales()) {
            String value = allPages.get(locale);
            if (value != null) {
                return value;
            }
        }
        // set empty string if no locale matched data is found
        return "";
    }
479763
def get_page_from_string_or_id(page_string, lang=None):
    """"""
    if type(page_string) == int:
        return Page.objects.get(pk=int(page_string))
    # if we have a string coming from some templates templates
    if (isinstance(page_string, SafeText) or
            isinstance(page_string, str)):
        if page_string.isdigit():
            return Page.objects.get(pk=int(page_string))
        return Page.objects.from_path(page_string, lang)
    # in any other case we return the input becasue it's probably
    # a Page object.
    return page_string
172236
private static Page findPage(
		ServletContext servletContext,
		HttpServletRequest req,
		HttpServletResponse resp,
		SemanticCMS semanticCMS
	) throws ServletException, IOException {
		// Path extra info not allowed
		if(req.getPathInfo() != null) {
			return null;
		}
		// Query string not allowed
		if(req.getQueryString() != null) {
			return null;
		}
		String basePath;
		{
			String servletPath = req.getServletPath();
			// Must end in expected extension
			if(!servletPath.endsWith(RssUtils.EXTENSION)) {
				return null;
			}
			basePath = servletPath.substring(0, servletPath.length() - RssUtils.EXTENSION.length());
		}
		// Try to find the page, jspx, then jsp, then direct URL without extension
		String pagePath = null;
		for (String extension : RssUtils.getResourceExtensions()) {
			pagePath = basePath + extension;
			try {
				if(
					!RssUtils.isProtectedExtension(pagePath)
					&& ServletContextCache.getResource(servletContext, pagePath) != null
				) {
					break;
				}
			} catch(MalformedURLException e) {
				// Assume does not exist
			}
		}
		assert pagePath != null : "The last extension should be the default if none matched";
		if(RssUtils.isProtectedExtension(pagePath)) {
			return null;
		}
		// Find book and path
		PageRef pageRef;
		{
			Book book = semanticCMS.getPublishedBook(pagePath);
			if(book == null || !book.isAccessible()) {
				return null;
			}
			BookRef bookRef = book.getBookRef();
			try {
				pageRef = new PageRef(
					bookRef,
					Path.valueOf(pagePath.substring(bookRef.getPrefix().length()))
				);
			} catch(ValidationException e) {
				return null;
			}
		}
		// Capture the page
		return CapturePage.capturePage(
			servletContext,
			req,
			resp,
			pageRef,
			CaptureLevel.META
		);
	}
784021
def _get_page_elements(self):
        
        page_elements = []
        for attribute, value in list(self.__dict__.items()) + list(self.__class__.__dict__.items()):
            if attribute != 'parent' and isinstance(value, CommonObject):
                page_elements.append(value)
        return page_elements
611523
def get_instance(page_to_consume):
    """"""
    global _instances
    if isinstance(page_to_consume, basestring):
        uri = page_to_consume
        page_to_consume = page.get_instance(uri)
    elif isinstance(page_to_consume, page.Page):
        uri = page_to_consume.uri
    else:
        raise TypeError(
            "get_instance() expects a parker.Page or basestring derivative."
        )

    page_to_consume.fetch()
    parsed_page = parser.parse(page_to_consume)

    try:
        instance = _instances[uri]
    except KeyError:
        instance = ConsumePage(
            parsed_page
        )
        _instances[uri] = instance

    return instance
1114024
def get_prefix(self):
        
        for key, value in self.pages_config.items():
            if not hasattr(value, '__iter__'):
                value = (value, )
            for item in value:
                if type(self.node) == item\
                        or type(self.node) == getattr(item, 'model', None):
                    return key