1.1.7.5. gnr.web.gnrwebpage - Webpages

Last page update: November 23, 2011

Main class:

Other classes:

Complete reference:

1.1.7.5.1. GnrWebPage

addHtmlHeader() getResourceUri() newSourceRoot() rpc_getPrinters()
addToContext() getResourceUriList() onBegin() rpc_getUserPreference()
app() getService() onClosePage() rpc_main()
application() getSiteDocument() onDeleted() rpc_onClosePage()
btc() getTableResourceContent() onDeleting() rpc_ping()
build_arg_dict() getUserPreference() onEnd() rpc_remoteBuilder()
call_args() getUuid() onInit() rpc_sendMessageToClient()
callTableMethod() get_bodyclasses() onIniting() rpc_setInClientPage()
catalog() get_call_handler() onMain() rpc_setInServer()
checkPermission() get_css_genro() onMainCalls() rpc_setStoreSubscription()
clientPage() get_css_icons() onPreIniting() setInClientData()
collectClientDatachanges() get_css_path() onSaved() setJoinCondition()
connectionDocument() get_css_theme() onSaving() setPreference()
connectionDocumentUrl() homeUrl() onServingCss() setTableResourceContent()
connectionStore() htmlHeaders() packageUrl() setUserPreference()
connection_id() importResource() pageFolderRemove() setWorkdate()
externalUrl() importTableResource() pageStore() subscribeTable()
externalUrlToken() instantiateProxies() resolveResourceUri() tableTemplate()
getAuxInstance() isDeveloper() relationExplorer() temporaryDocument()
getCallArgs() isGuest() rootPage() temporaryDocumentUrl()
getDomainUrl() isLocalizer() rpc_callTableScript() toText()
getPreference() lazyBag() rpc_changeLocale() user()
getPublicMethod() mainLeftContent() rpc_doLogin() userDocument()
getResource() mainLeftTop() rpc_getAppPreference() userDocumentUrl()
getResourceContent() mixinComponent() rpc_getGridStruct() userStore()
getResourceExternalUriList() mtimeurl() rpc_getPageStoreData() userTags()
getResourceList() newGridStruct() rpc_getPrinterAttributes()  

1.1.7.5.2. ClientDataChange

1.1.7.5.3. ClientPageHandler

1.1.7.5.4. GnrGenshiPage

1.1.7.5.5. GnrMakoPage

1.1.7.5.6. LazyBagResolver

1.1.7.5.7. gnr.web.gnrwebpage - The complete reference list

class gnr.web.gnrwebpage.ClientDataChange(path, value, attributes=None, reason=None, fired=False, change_ts=None, change_idx=None, delete=False, **kwargs)

TODO

update(other)

TODO

Parameters:other – TODO
class gnr.web.gnrwebpage.ClientPageHandler(parent_page, page_id=None)

proxi to make actions on a client page

copyData(srcpath, dstpath=None, page_id=None)

TODO

Parameters:
  • srcpath – TODO
  • dstpath – TODO
  • page_id – TODO

Let’s see some examples:

self.clientPage(page_id="nknnn").copyData('foo.bar','spam.egg') # copy on MY page
self.clientPage(page_id="nknnn").copyData('foo.bar','bub.egg',page_id='xxxxxx') # copy on the xxxxxx page
self.clientPage(page_id="nknnn").copyData('foo.bar','bub.egg',pageStore=True) # copy on my pageStore
self.clientPage(page_id="nknnn").copyData('foo.bar','bub.egg',page_id='xxxxxx' ,pageStore=True) # copy on the pageStore of the xxxx page
jsexec(path, value, **kwargs)

TODO

set(path, value, attributes=None, fired=None, reason=None, replace=False)

TODO

class gnr.web.gnrwebpage.GnrGenshiPage(site=None, request=None, response=None, request_kwargs=None, request_args=None, filepath=None, packageId=None, pluginId=None, basename=None, environ=None)

TODO

genshi_template()

TODO

onPreIniting(request_args, request_kwargs)

TODO

class gnr.web.gnrwebpage.GnrMakoPage(site=None, request=None, response=None, request_kwargs=None, request_args=None, filepath=None, packageId=None, pluginId=None, basename=None, environ=None)

TODO

mako_template()

TODO

onPreIniting(request_args, request_kwargs)

TODO

class gnr.web.gnrwebpage.GnrWebPage(site=None, request=None, response=None, request_kwargs=None, request_args=None, filepath=None, packageId=None, pluginId=None, basename=None, environ=None)

Standard class for webpages

Parameters:
  • site – TODO
  • request – TODO
  • response – TODO
  • request_kwargs – TODO
  • args (request) – TODO
  • filepath – TODO
  • packageId – TODO
  • basename – TODO
  • environ – TODO
addHtmlHeader(tag, innerHtml='', **kwargs)

TODO

Parameters:
  • tag – TODO
  • innerHtml – TODO
addToContext(value=None, serverpath=None, clientpath=None)

TODO

Parameters:
  • value – TODO
  • serverpath – TODO
  • clientpath – TODO
app

TODO

application

TODO

btc

TODO

build_arg_dict(_nodebug=False, _clocomp=False, **kwargs)

TODO

Parameters:
  • _nodebug – no debug mode
  • _clocomp – enable closure compile
callTableMethod(table=None, methodname=None, **kwargs)

TODO

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • methodname – the method name of the dataRpc
callTableScript(page=None, table=None, respath=None, class_name=None, runKwargs=None, **kwargs)

Call a script from a table’s resources (e.g: _resources/tables/<table>/<respath>).

This is typically used to customize prints and batch jobs for a particular installation

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • respath – TODO
  • class_name – TODO
  • runKwargs – TODO
call_args

TODO

catalog

TODO

checkPermission(pagepath, relative=True)

TODO

Parameters:
  • pagepath – TODO
  • relative – TODO
clientPage(page_id=None)

TODO

Parameters:page_id – the id of the page
collectClientDatachanges()

TODO

connectionDocument(*args)

TODO

connectionDocumentUrl(*args, **kwargs)

TODO

connectionStore(connection_id=None, triggered=True)

TODO

Parameters:
  • connection_id – TODO
  • triggered – boolean. TODO
connection_id

TODO

doLogin(login=None, guestName=None, **kwargs)

Service method. Set user’s avatar into its connection if:

  • The user exists and his password is correct
  • The user is a guest
Parameters:
  • login – TODO
  • guestName – TODO
externalUrl(path, **kwargs)

TODO

Parameters:path – TODO
externalUrlToken(path, _expiry=None, _host=None, method='root', **kwargs)

TODO

Parameters:
  • path – TODO
  • method – TODO
getAuxInstance(name)

TODO

getCallArgs(*args)

TODO

getDomainUrl(path='', **kwargs)

TODO

Parameters:path – TODO
getPreference(path, pkg='', dflt='')

TODO

Parameters:
  • path – TODO
  • pkg – the package object
  • dflt – TODO
getPublicMethod(prefix, method)

TODO

Parameters:
  • prefix

    The method prefix. It can be:

  • method – the method to get
getResource(path, ext=None, pkg=None)

TODO

Parameters:
  • path – TODO
  • ext – TODO
  • pkg – the package object
getResourceContent(resource=None, ext=None, pkg=None)

TODO

  • getResourceContent() method is decorated with the public_method() decorator
Parameters:
  • resource – TODO
  • ext – TODO
  • pkg – the package object
getResourceExternalUriList(path, ext=None, add_mtime=False)

TODO

Parameters:
  • path – TODO
  • ext – TODO
  • add_mtime – TODO
getResourceList(path, ext=None)

TODO

Parameters:
  • path – TODO
  • ext – TODO
getResourcePath(path, ext=None, pkg=None)

TODO

Parameters:
  • path – TODO
  • ext – TODO
  • pkg – the package object
getResourceUri(path, ext=None, add_mtime=False, pkg=None)

TODO

Parameters:
  • path – MANDATORY. A string with the path of the uri
  • ext – TODO
  • add_mtime – TODO
  • pkg – the package object
getResourceUriList(path, ext=None, add_mtime=False)

TODO

Parameters:
  • path – TODO
  • ext – TODO
  • add_mtime – TODO
getService(service_type)

TODO

Parameters:service_type – TODO
getSiteDocument(path, defaultContent=None, **kwargs)

TODO

Parameters:
  • path – TODO
  • defaultContent – TODO
getTableResourceContent(table=None, path=None, value=None, ext=None)

TODO

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • path – TODO
  • value – TODO
  • ext – TODO
getUserPreference(path, pkg='', dflt='', username='')

TODO

Parameters:
  • path – TODO
  • pkg – the package object
  • dflt – TODO
  • username – TODO
getUuid()

TODO

get_bodyclasses()

TODO

get_call_handler(request_args, request_kwargs)

TODO

Parameters:
  • request_args – TODO
  • request_kwargs – TODO
get_css_genro()

TODO

get_css_icons()

Get the css_icons and return it. The css_icons get is the one defined the <gui> tag of your sitesconfig.xml or in a single webpage through the css_icons webpage variable

get_css_path(requires=None)

Get the path of the css resources, that are:

Parameters:requires – TODO If None, get the css_requires string included in a webpage
get_css_theme()

Get the css_theme and return it. The css_theme get is the one defined the <gui> tag of your sitesconfig.xml or in a single webpage through the css_theme webpage variable

homeUrl()

TODO

htmlHeaders()

TODO

importResource(path, classname=None, pkg=None)

TODO

Parameters:
  • path – TODO
  • classname – TODO
  • pkg – the package object
importTableResource(table, path)

TODO

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • path – the table resource path
instantiateProxies()

TODO

isDeveloper()

TODO

isGuest

TODO

isLocalizer()

TODO

lazyBag(bag, name=None, location='page:resolvers')

TODO

Parameters:
  • bag – a Bag
  • name – TODO
  • location – TODO
loadTableScript(table=None, respath=None, class_name=None)

TODO

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • respath – TODO
  • class_name – TODO
log(*args, **kwargs)

Warning

deprecated since version 0.7

mainLeftContent(parentBC, **kwargs)

The main left content of the page

Parameters:parentBC – the root parent BorderContainer
mainLeftTop(pane)

The main left top of the page

Parameters:pane – a ContentPane
mixinComponent(*path, **kwargs)

TODO

Parameters:pkg – the package object
mtimeurl(*args)

TODO

newGridStruct(maintable=None)

It creates a GnrGridStruct class that handles a struct for a grid and return it

Parameters:maintable – the database table to which the struct refers to. For more information, check the maintable section
newSourceRoot()

TODO

onBegin()

TODO

onClosePage()

TODO

onDeleted(record)

TODO

Parameters:record – TODO
onDeleting(recordCluster, recordClusterAttr)

TODO

Parameters:
  • recordCluster – TODO
  • recordClusterAttr – TODO
onEnd()

TODO

onInit()

Hook method. TODO

onIniting(request_args, request_kwargs)

Callback onIniting called in early stages of page initialization

Parameters:
  • request_args – TODO
  • request_kwargs – TODO
onMain()

TODO

onMainCalls()

TODO

onPreIniting(*request_args, **request_kwargs)

TODO

onSaved(record, resultAttr=None, **kwargs)

TODO

Parameters:
  • record – TODO
  • resultAttr – TODO
onSaving(recordCluster, recordClusterAttr, resultAttr=None)

TODO

Parameters:
  • recordCluster – TODO
  • recordClusterAttr – TODO
  • resultAttr – TODO
onServingCss(css_requires)

TODO

Parameters:css_requires – the “css_requires” webpage variable
packageUrl(*args, **kwargs)

TODO

pageFolderRemove()

TODO

pageStore(page_id=None, triggered=True)

TODO

Parameters:
  • page_id – the id of the page
  • triggered – boolean. TODO
relationExplorer(table=None, prevRelation='', prevCaption='', omit='', **kwargs)

TODO

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • prevRelation – TODO
  • prevCaption – TODO
  • omit – TODO
remoteBuilder(handler=None, **kwargs)

TODO

Parameters:handler – TODO
resolveResourceUri(fpath, add_mtime=False, pkg=None)

TODO

Parameters:
  • fpath – TODO
  • add_mtime – TODO
  • pkg – the package object
rootPage(*args, **kwargs)

TODO

rpc_callTableScript(table=None, respath=None, class_name='Main', downloadAs=None, **kwargs)

Call a script from a table’s local resources (i.e. _resources/tables/<table>/<respath>).

This is typically used to customize prints and batch jobs for a particular installation.

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • respath – TODO
  • class_name – TODO
  • downloadAs – TODO
rpc_changeLocale(locale)

TODO

Parameters:locale – the current locale (e.g: en, en_us, it)
rpc_getAppPreference(path='*')

TODO

Parameters:path – TODO
rpc_getGridStruct(struct, table)

TODO

Parameters:
  • struct – TODO
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
Returns:

TODO

rpc_getPageStoreData()

TODO

rpc_getPrinterAttributes(printer_name)

TODO

Parameters:printer_name – TODO
rpc_getPrinters()

TODO

rpc_getUserPreference(path='*')

TODO

Parameters:path – TODO
rpc_main(_auth=0, debugger=None, **kwargs)

The first method loaded in a Genro application

Parameters:
  • _auth – the page authorizations. For more information, check the authorizations page
  • debugger – TODO
rpc_onClosePage(**kwargs)

An rpc on page closure

rpc_ping(**kwargs)

TODO

rpc_sendMessageToClient(message, pageId=None, filters=None, msg_path=None)

TODO

Parameters:
  • message – TODO
  • page_id – TODO
  • filters – TODO
  • msg_path – TODO
rpc_setInClientPage(pageId=None, changepath=None, value=None, fired=None, attr=None, reason=None)

TODO

Parameters:
  • pageId – TODO.
  • changepath – TODO.
  • value – TODO.
  • fired – TODO.
  • attr – TODO.
  • reason – TODO.
rpc_setInServer(path, value=None, pageId=None, **kwargs)

TODO

Parameters:
  • path – TODO
  • value – TODO.
  • pageId – TODO.
setInClientData(path, value=None, attributes=None, page_id=None, filters=None, fired=False, reason=None, public=False, replace=False)

TODO

Parameters:
  • path – TODO
  • value – TODO
  • attributes – TODO
  • page_id – TODO
  • filters – TODO
  • fired – TODO
  • reason – TODO
  • public – TODO
  • replace – TODO
setJoinCondition(ctxname, target_fld='*', from_fld='*', condition=None, one_one=None, applymethod=None, **kwargs)

Define a join condition in a given context (ctxname).

The condition attribute is used to limit the automatic selection of related records. If target_fld AND from_fld equals to ‘*’ then the condition is an additional WHERE clause added to any selection

self.setJoinCondition('mycontext',
                       target_fld = 'mypkg.rows.document_id',
                       from_fld = 'mypkg.document.id',
                       condition = "mypkg.rows.date <= :wkd",
                       condition_wkd = "^mydatacontext.foo.bar.mydate",
                       one_one=False)
Parameters:
  • ctxname – name of the context of the main record
  • target_fld – the many table column of the relation; ‘*’ means the main table of the selection
  • from_fld – the one table column of the relation; ‘*’ means the main table of the selection
  • condition – additional conditions for the WHERE sql condition
  • one_one – the result is returned as a record instead of as a selection. If one_one is True the given condition MUST return always a single record
  • applymethod – a page method to be called after selecting the related records
  • kwargs – named parameters to use in condition. Can be static values or can be readed from the context at query time. If a parameter starts with ‘^’ it is a path in the context where the value is stored. If a parameter is the name of a defined method the method is called and the result is used as the parameter value. The method has to be defined as ‘ctxname_methodname’
setPreference(path, data, pkg='')

TODO

Parameters:
  • path – TODO
  • data – TODO
  • pkg – the package object
setStoreSubscription(storename=None, client_path=None, active=True)

TODO

Parameters:
  • storename – TODO
  • client_path – TODO
  • active – boolean. TODO
setTableResourceContent(table=None, path=None, value=None, ext=None)

TODO

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • path – TODO
  • value – TODO
  • ext – TODO
setUserPreference(path, data, pkg='', username='')

TODO

Parameters:
  • path – TODO
  • data – TODO
  • pkg – the package object
  • username – TODO
setWorkdate(workdate=None)

Set the workdate and return it

Parameters:workdate – the workdate
subscribeTable(table, subscribe=True)

TODO

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • subscribe – boolean. TODO
tableTemplate(table=None, tplname=None, asSource=False)

TODO

Parameters:
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • tplname – the template name
  • ext – TODO
  • asSource – boolean. TODO
temporaryDocument(*args)

TODO

temporaryDocumentUrl(*args, **kwargs)

TODO

toText(obj, locale=None, format=None, mask=None, encoding=None, dtype=None)

TODO

Parameters:
  • obj – TODO
  • locale – the current locale (e.g: en, en_us, it)
  • format – TODO
  • mask – TODO
  • encoding – the encoding type
  • dtype – the dtype
user

TODO

userDocument(*args)

TODO

userDocumentUrl(*args, **kwargs)

TODO

userStore(user=None, triggered=True)

TODO

Parameters:
  • user – the username
  • triggered – boolean. TODO
userTags

TODO

class gnr.web.gnrwebpage.LazyBagResolver(*args, **kwargs)

TODO

getSource()

TODO

load()

TODO

windowTitle()

Return the window title