Get the page to display. If a view has already been created and
        is cached, use that otherwise initialize the view and proxy. If defer
        loading is used, wrap the view in a FrameLayout and defer add view 
        until later.
485769
def get_view(self):
        
        d = self.declaration
        if d.cached and self.widget:
            return self.widget
        if d.defer_loading:
             self.widget = FrameLayout(self.get_context())
             app = self.get_context()
             app.deferred_call(
                 lambda: self.widget.addView(self.load_view(), 0))
        else:
            self.widget = self.load_view()
        return self.widget
193337
def get_view(self, request, view_class, opts=None):
        
        kwargs = {}
        if opts:
            if not isinstance(opts, dict):
                opts = opts.__dict__
        else:
            opts = {}

        if not view_class in VALID_MIXIN_OPTIONS:
            valid_options = view_class.__dict__.keys()
            for cls in view_class.__bases__:
                if cls != object:
                    valid_options += cls.__dict__.keys()
            VALID_MIXIN_OPTIONS[view_class] = valid_options

        for key in VALID_MIXIN_OPTIONS[view_class]:
            if key in opts:
                kwargs[key] = opts[key]
            elif hasattr(self, key):
                kwargs[key] = getattr(self, key)

        view = view_class(**kwargs)
        view.request = request
        view.kwargs = {}
        return view
46842
def mainview(request, **criterias):
	''
	view_data = initview(request)
	wrap = lambda func: ft.partial(func, _view_data=view_data, **criterias)
	return condition(
			etag_func=wrap(cache_etag),
			last_modified_func=wrap(cache_last_modified) )\
		(_mainview)(request, view_data, **criterias)
493139
def get_response(self, request, parent, *args, **kwargs):
        
        context = {
            'page': self,
        }
        try:
            return TemplateResponse(
                request,
                self.get_layout_template_name(),
                context
            )
        except AttributeError:
            raise AttributeError("You need to define "
                 "`get_layout_template_name()` on your `%s` model, "
                 "or override `get_response()`" % type(self).__name__)
1140720
private void prepareWebView() {
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.setVisibility(View.VISIBLE);
        mWebView.setWebViewClient(new WebViewClient() {

            private boolean done = false;

            @Override
            public void onPageFinished(WebView view, String url) {
                // Catch the redirect url with the parameters added by the provider auth web page
                if (!done && url.startsWith(mAppInfo.getRedirectUrl())) {
                    done = true;
                    getCredentials(url);
                    mWebView.setVisibility(View.INVISIBLE);
                }
            }
        });
    }
971522
function(view) {
    if (view.options.layoutApplied) {
      return view;
    }

    // handle pre-layout middleware
    this.handle('preLayout', view);

    var opts = {};
    lazy.extend(opts, this.options);
    lazy.extend(opts, view.options);
    lazy.extend(opts, view.context());

    // get the layout stack
    var stack = {};
    var alias = this.viewTypes.layout;
    var len = alias.length, i = 0;

    while (len--) {
      var views = this.views[alias[i++]];
      for (var key in views) {
        var val = views[key];
        if (views.hasOwnProperty(key) && typeof val !== 'function' && val.path) {
          stack[key] = val;
        }
      }
    }

    // get the name of the first layout
    var name = view.layout;
    var str = view.content;
    var self = this;

    if (!name) return view;

    // Handle each layout before it's applied to a view
    function handleLayout(layoutObj) {
      view.currentLayout = layoutObj.layout;
      self.handle('onLayout', view);
      delete view.currentLayout;
    }

    // actually apply the layout
    var res = lazy.layouts(str, name, stack, opts, handleLayout);

    view.option('layoutStack', res.history);
    view.option('layoutApplied', true);
    view.content = res.result;

    // handle post-layout middleware
    this.handle('postLayout', view);
    return view;
  }
876530
function updateLayout() {
      var layout = generator.layoutTemplate(newpage);
      $layout.html(generator.renderLayout(newpage));
      $layout.attr('data-render-layout', layout);
      log('jqueryview updateLayout', path, query, hash);
      generator.emit('update-view', path, query, hash, window, $layout);
    }
979879
@Override
    public ViewResource createViewResource(FacesContext context, String resourceName) {
        return getWrapped().createViewResource(context, resourceName);
    }
498588
function load() {
        _load = new $.Deferred();
        Inspector.Page.on("frameNavigated.RemoteAgent", _onFrameNavigated);
        Inspector.Page.on("frameStartedLoading.RemoteAgent", _stopKeepAliveInterval);
        Inspector.DOM.on("attributeModified.RemoteAgent", _onAttributeModified);

        return _load.promise();
    }
799322
def load(self, page = None, verbose=False):
        
        url = self._build_query_url(page, verbose)
        response = self._load(url, verbose)
        response = self._post_load(response, verbose)
        return response
453134
def add_page(self, page, default = True):
        
        """
        self._pages[page.page_id] = page
        page._add_display(self)
        if default or not self._active_page:
            self._active_page = page
32046
public void buildInitialLayout(PageLayoutBuilder pageLayout) {
		for (Iterator iter = _viewDescriptors.iterator(); iter.hasNext();) {
			String viewDescriptorId = (String) iter.next();
			pageLayout.addView(viewDescriptorId); 
		}
	}
1054823
protected function _prepareRendering()
    {
        $this->view->addDefaultViewParam('_template', $this);

        $structure = $this->getPageStructure();
        if (empty($structure)) {
            $this->setPageStructure(self::$default_page_structure);
        }
    }
487969
@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		
		super.onViewCreated(view, savedInstanceState);
		InjectionUtils.inject(INJECTOR_CONFIGURATION);
	}
493715
function(callback){
    var options = this.options,
        cache = this.options.cache,
        logger =  this.options.logger;


    if(this.url){
      logger.log('fetch page: ' + this.url);

      // if there is a cache and it holds the url
      if(cache &&cache.has(this.url)){
        // http status - content located elsewhere, retrieve from there
        this.statusCode = 305;
        this.requestTime = 0;
        this.html = cache.get(this.url);
        logger.log('fetched html from cache: ' + this.url);

        this.parse(function(){
          callback(this);
        })

      // if not get the html from the url  
      }else{

        this.startedRequest = new Date();
        var self = this;

        var requestObj = {
          uri: this.url,
          headers: options.httpHeaders
        }

        request(requestObj, function(requestErrors, response, body){
          if(!requestErrors && response.statusCode === 200){

            self.endedRequest = new Date();
            self.requestTime = self.endedRequest.getTime() - self.startedRequest.getTime();
            logger.log('fetched html from page: ' 
              + self.requestTime + 'ms - ' + self.url);
            
            self.statusCode = response.statusCode;
            self.html = body;

            if(cache){
              cache.set(self.url, body);
            }

            self.parse(function(){
              self.status = "fetched";
              callback(self);
            })

          }else{
            logger.warn('error requesting page: ' + self.url);
            self.error = 'error requesting page: ' + self.url;
            self.status = "errored";
            callback();
          }
        });


      }
    }else{
      logger.warn('no url given');
      this.error = 'no url given';
      this.status = "errored";
      callback();
    }
  }
698760
def get_view_response(self, request, page, view_func, view_args, view_kwargs):
        
        return view_func(request, page, *view_args, **view_kwargs)
1299683
def view_or_add(self, slug):
        '''
        
        '''
        rec_page = MWiki.get_by_uid(slug)

        if rec_page:
            if rec_page.kind == self.kind:
                self.view(rec_page)
            else:
                return False
        else:
            self.to_add(slug)