1.1.7.6.1. gnr.web.gnrwebpage_proxy.apphandler - Web applications handler utilities

Last page update: November 23, 2011

Classes:

Complete reference:

1.1.7.6.1.2. gnr.web.gnrwebpage_proxy.apphandler - The complete reference list

class gnr.web.gnrwebpage_proxy.apphandler.GnrWebAppHandler(page, **kwargs)

A class for web applications handlement

checkFreezedSelection(changelist=None, selectionName=None, where=None, table=None, **kwargs)

TODO

  • checkFreezedSelection() method is decorated with the public_method() decorator
Parameters:
  • changelist – TODO
  • selectionName – TODO
  • where – the sql “WHERE” clause. For more information check the where section
  • 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)
db

TODO

dbSelect(dbtable=None, columns=None, auxColumns=None, hiddenColumns=None, rowcaption=None, _id=None, _querystring='', querystring=None, ignoreCase=True, exclude=None, excludeDraft=True, condition=None, limit=None, alternatePkey=None, order_by=None, selectmethod=None, notnull=None, weakCondition=False, **kwargs)

dbSelect is a FilteringSelect that takes the values through a query on the database: user can choose between all the values contained into the linked table (the table is specified through the dbtable attribute). While user write in the dbSelect, partially matched values will be shown in a pop-up menu below the input text box. You can show more columns in the pop-up menu through the auxColumns attribute

Parameters:
  • dbtable – the database table related to the dbSelect. For more information, check the dbtable section (simple example)
  • columns – list of columns. User can select the record respect all the columns specified through this attribute. For more information, check the columns section (columns example)
  • auxColumns – list of columns separated by a comma. Every columns must have a prefix ($). Show the columns you specify here as auxiliary columns in a pop-up menu (auxColumns example)
  • hiddenColumns – data that is retrieved but they are not shown
  • rowcaption – what user see into the field. Check the rowcaption section
  • querystring – TODO
  • ignoreCase – boolean. Set it True for a case insensitive query from characters typed from user. Set to False for a case sensitive query
  • exclude – TODO
  • excludeDraft – boolean. TODO
  • condition – additional conditions into the query - the basic condition is set by user typing characters in the field (condition example)
  • limit – string. Number of result’s rows (default is 10, set limit to ‘0’ to visualize all data). Corresponding to the sql “LIMIT” operator. For more information, check the limit section
  • alternatePkey – TODO
  • order_by – corresponding to the sql “ORDER BY” operator. For more information check the order_by section
  • selectmethod – custom rpc_method you can use to make the query on the server.
  • notnull – TODO
  • weakCondition – boolean. It will apply the condition if there is a result, but if there is no result for the condition then the condition will not be used. The selectmethod attribute can be used to override this attribute
  • kwargs
    • selected_COLUMNNAME: allow to save in the datastore some columns of the record chosen by user (“COLUMNNAME” is the name of the column). For every column to be taken there must be a “selected_COLUMNNAME” (selected example)
dbSelect_default(tblobj, querycolumns, querystring, resultcolumns, condition=None, exclude=None, limit=None, order_by=None, identifier=None, ignoreCase=None, **kwargs)

TODO

Parameters:
  • tblobj – TODO
  • querycolumns – TODO
  • querystring – TODO
  • resetcolumns – TODO
  • condition – the condition of the dbSelect
  • exclude – TODO
  • limit – number of result’s rows. Corresponding to the sql “LIMIT” operator. For more information, check the limit section
  • order_by – corresponding to the sql “ORDER BY” operator. For more information check the order_by section
  • identifier – TODO
  • ignoreCase – TODO
dbSelect_selection(tblobj, querystring, columns=None, auxColumns=None, **kwargs)

TODO

  • dbSelect_selection() method is decorated with the public_method() decorator
Parameters:
  • tblobj – TODO
  • querystring – TODO
  • columns – it represents the columns to be returned by the “SELECT” clause in the traditional sql query. For more information, check the columns section
  • auxColumns – TODO
dbStructure(path='', **kwargs)

TODO

Parameters:path – the path of the database structure
event_onEnd()

TODO

export_standard(selection, locale=None, columns=None, filename=None, **kwargs)

TODO

Parameters:
  • selection – TODO
  • locale – TODO
  • columns – it represents the columns to be returned by the “SELECT” clause in the traditional sql query. For more information, check the columns section
  • filename – TODO
formAuto(pane, table, columns='', cols=2)

TODO

Parameters:
  • pane – the ContentPane
  • 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)
  • columns – it represents the columns to be returned by the “SELECT” clause in the traditional sql query. For more information, check the columns section
  • cols – a formbuilder attribute
getDb(dbId=None)

TODO

Parameters:dbId – TODO
getPackages()

TODO

getRecord(*args, **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)
  • dbtable – the database table
  • pkg – the package object
  • pkey – the primary key
  • ignoreMissing – boolean. TODO
  • ignoreDuplicate – boolean. TODO
  • lock – boolean. TODO
  • readOnly – boolean. the readOnly attribute
  • from_fld – TODO
  • target_fld – TODO
  • sqlContextName – TODO
  • applymethod – a page method to be called after selecting the related records
  • js_resolver_one – TODO
  • js_resolver_many – TODO
  • loadingParameters – TODO
  • default_kwargs – TODO
  • eager – TODO
  • virtual_columns – TODO
  • onLoadingHandler – TODO
getRelatedRecord(from_fld=None, target_fld=None, pkg=None, pkey=None, ignoreMissing=True, ignoreDuplicate=True, js_resolver_one='relOneResolver', js_resolver_many='relManyResolver', sqlContextName=None, virtual_columns=None, _eager_level=0, **kwargs)

TODO

  • getRelatedRecord() method is decorated with the public_method() decorator
Parameters:
  • from_fld – TODO
  • target_fld – TODO
  • pkg – the package
  • pkey – the record primary key
  • ignoreMissing – boolean. TODO
  • ignoreDuplicate – boolean. TODO
  • js_resolver_one – TODO
  • js_resolver_many – TODO
  • sqlContextName – TODO
  • virtual_columns – TODO
getRelatedSelection(from_fld, target_fld, relation_value=None, columns='', query_columns=None, condition=None, js_resolver_one='relOneResolver', sqlContextName=None, **kwargs)

TODO

  • getRelatedSelection() method is decorated with the public_method() decorator
Parameters:
  • from_fld – TODO
  • target_fld – TODO
  • relation_value – TODO
  • columns – it represents the columns to be returned by the “SELECT” clause in the traditional sql query. For more information, check the columns section
  • query_columns – TODO
  • condition – the condition of the selection
  • js_resolver_one – TODO
  • sqlContextName – TODO
getSelection(table='', distinct=False, columns='', where='', condition=None, order_by=None, limit=None, offset=None, group_by=None, having=None, relationDict=None, sqlparams=None, row_start='0', row_count='0', recordResolver=True, selectionName='', structure=False, numberedRows=True, pkeys=None, fromSelection=None, applymethod=None, totalRowCount=False, selectmethod=None, expressions=None, sum_columns=None, sortedBy=None, excludeLogicalDeleted=True, excludeDraft=True, savedQuery=None, savedView=None, externalChanges=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)
  • distinct – boolean, True for getting a “SELECT DISTINCT”
  • columns – it represents the columns to be returned by the “SELECT” clause in the traditional sql query. For more information, check the columns section
  • where – the sql “WHERE” clause. For more information check the where section
  • condition – the condition of the selection
  • order_by – corresponding to the sql “ORDER BY” operator. For more information check the order_by section
  • limit – number of result’s rows. Corresponding to the sql “LIMIT” operator. For more information, check the limit section
  • offset – TODO
  • group_by – the sql “GROUP BY” clause. For more information check the group_by section
  • having – the sql “HAVING” clause. For more information check the having
  • relationDict – a dict to assign a symbolic name to a relation. For more information check the relationDict documentation section
  • sqlparams – a dictionary which associates sqlparams to their values
  • row_start – TODO
  • row_count – TODO
  • recordResolver – TODO
  • selectionName – TODO
  • structure – TODO
  • numberedRows – TODO
  • pkeys – TODO
  • fromSelection – TODO
  • applymethod – a page method to be called after selecting the related records
  • totalRowCount – TODO
  • selectmethod – TODO
  • expressions – TODO
  • sum_columns – TODO
  • sortedBy – TODO
  • excludeLogicalDeleted – TODO
  • excludeDraft – TODO
  • savedQuery – TODO
  • savedView – TODO
  • externalChanges – TODO
getTableFields(pkg='', table='', **kwargs)

TODO

Parameters:
  • pkg – the package
  • 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)
getTables(pkg=None)

Extract a couple with the istance names and the name of the database tables from a package you specify with the pkg attribute. Return the extracted couples as a list of lists. If no tables are in the package then the method returns an empty list

Parameters:pkg – MANDATORY. The package from which the tables are extracted
getTablesTree()

Set a Bag with the structure of the database tables of a package

gridSelectionData(selection, outsource, recordResolver, numberedRows, logicalDeletionField, _addClassesDict=None)

TODO

Parameters:
  • selection – TODO
  • outsource – TODO
  • recordResolver – TODO
  • numberedRows – TODO
  • logicalDeletionField – TODO
gridSelectionStruct(selection)

TODO

Parameters:selection – TODO
init(**kwargs)

TODO

pdf_standard(selection, locale=None, **kwargs)

TODO

Parameters:
  • selection – TODO
  • locale – TODO
print_standard(selection, locale=None, **kwargs)

TODO

Parameters:
  • selection – TODO
  • locale – TODO
rpc_batchDo(batch, resultpath, forked=False, **kwargs)

Execute a batch

Parameters:
  • batch – the batch to be executed
  • resultpath – TODO
  • forked – boolean. TODO
rpc_dbStructure(path='', **kwargs)

TODO

Parameters:path – the path of the database structure
rpc_downloadPDF(filename, forcedownload=False, **kwargs)

TODO

Parameters:
  • filename – TODO
  • forcedownload – boolean. TODO
rpc_getPackages()

TODO

rpc_getRecordCount(field=None, value=None, table='', distinct=False, columns='', where='', relationDict=None, sqlparams=None, condition=None, **kwargs)

TODO

Parameters:
  • field – TODO
  • value – 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)
  • distinct – boolean, True for getting a “SELECT DISTINCT”
  • columns – it represents the columns to be returned by the “SELECT” clause in the traditional sql query. For more information, check the columns section
  • where – the sql “WHERE” clause. For more information check the where section
  • relationDict – TODO
  • sqlparams – TODO
  • condition – the condition of the count
rpc_getRecordForm(dbtable=None, fields=None, **kwargs)

TODO

Parameters:
rpc_getTableFields(pkg='', table='', **kwargs)

TODO

Parameters:
  • pkg – the package
  • 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)
rpc_getTables(pkg=None)

Extract a couple with the istance names and the name of the database tables from a package you specify with the pkg attribute. Return the extracted couples as a list of lists. If no tables are in the package then the method returns an empty list

Parameters:pkg – MANDATORY. The package from which the tables are extracted
rpc_getTablesTree()

Set a Bag with the structure of the database tables of a package

rpc_getThermo(thermoId, flag=None)

TODO

Parameters:
  • thermoId – TODO
  • flag – TODO
rpc_includedViewAction(action=None, export_mode=None, respath=None, table=None, data=None, selectionName=None, struct=None, datamode=None, downloadAs=None, selectedRowidx=None, **kwargs)

TODO

Parameters:
  • action – TODO
  • export_mode – TODO
  • respath – 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)
  • data – TODO
  • selectionName – TODO
  • struct – TODO
  • datamode – TODO
  • downloadAs – TODO
  • selectedRowidx – TODO
rpc_onSelectionDo(table, selectionName, command, callmethod=None, selectedRowidx=None, recordcall=False, **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)
  • selectionName – TODO
  • command – TODO
  • callmethod – TODO
  • selectedRowidx – TODO
  • recordcall – boolean. TODO
rpc_pdfmaker(pdfmode, txt, **kwargs)

TODO

Parameters:
  • pdfmode – TODO
  • txt – TODO
rpc_printStaticGrid(structbag, storebag, filename=None, makotemplate='standard_print.tpl', **kwargs)

TODO

Parameters:
  • structbag – TODO
  • storebag – TODO
  • filename – TODO
  • makotemplate – TODO
rpc_printStaticGridDownload(filename, **kwargs)

TODO

Parameters:filename – TODO
rpc_recordToPDF(table, pkey, template, **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)
  • pkey – the record primary key
  • template – TODO
runSelectionBatch(table, selectionName=None, batchFactory=None, pkeys=None, thermoId=None, thermofield=None, stopOnError=False, forUpdate=False, onRow=None, **kwargs)

TODO

  • runSelectionBatch() method is decorated with the public_method() decorator
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)
  • selectionName – TODO
  • batchFactory – name of the Class, plugin of table, which executes the batch action
  • pkeys – TODO
  • thermoId – TODO
  • thermofield – the field of the main table to use for thermo display or * for record caption
  • stopOnError – at the first error stop execution
  • forUpdate – load records for update and commit at end (always use for writing batch)
  • onRow – optional method to execute on each record in selection, use if no batchFactory is given
setRecordDefaults(record, defaults)

TODO

Parameters:
  • record – TODO
  • defaults – TODO
setThermo(thermoId, progress_1=None, message_1=None, maximum_1=None, command=None, **kwargs)

TODO

Parameters:
  • thermoId – TODO
  • progress_1 – TODO
  • message_1 – TODO
  • maximum_1 – TODO
  • command – TODO