-
- Preview browser
- Page designer
- DQL editor
- Application wide settings
- Security settings
- Page caching module
- Modules
- Snippets
- Actions
- Context editor
- Task editor
- Scheduler editor
- Search engine editor
- Web server console
- Site layout editor
- Template editor
- Robots editor
- Style definitions
- Database manipulation
- Table designer
- Transfer editor
- Reporter
- Deployment module
- Deployment server settings
- Debugger
- .end
- .form header
- .form trailer
- .items
- assign
- application status
- backup db
- begin transaction
- break
- call menu
- call program
- case
- cluster by
- commit
- connect
- copy all from
- data-entry
- db status
- delete records
- define
- disconnect
- do
- documents
- exec SQL
- else
- end
- enter a record
- error messages off
- error messages on
- exit
- export
- for
- global
- if
- import
- imports
- in
- input using
- install application
- into
- list records
- lock
- lock db
- modify records
- message
- named
- others
- prompt
- query selection
- record entry
- records
- reorganize
- restore db
- rollback
- run procedure
- servers
- temp
- then
- tran off
- tran on
- unclustered
- unlock
- unlock db
- via form
- while
- with
- abs
- acos
- addressof
- ampm
- anylookup
- asin
- atan
- atan2
- ceil
- CHR
- concat
- ConsoleCopy
- ConsoleMemoCopy
- ConsoleShow
- ConsoleWriteToFile
- cos
- cosh
- date
- DatePicker
- day
- DEOS
- DialogOpen
- DialogOpenRelated
- DocumentCloseName
- DoesObjectExist
- ExecDQL
- ExecuteFile
- exp
- FileExecDQL
- firstc
- firstlast
- firstw
- FixedWidth
- floor
- futurevalue
- GetCurrent
- GetVar
- hours
- if
- installment
- jointext
- julian
- lastc
- lastfirst
- lastw
- length
- log
- log10
- lower
- MemoChunk
- MemoCopy
- MemoDecodePair
- MemoExecDQL
- MemoFind
- MemoGetGlobal
- MemoLength
- MemoMemoCopy
- MemoMemoReplace
- MemoReadFromFile
- MemoReplace
- MemoSetGlobal
- MemoStringBetween
- MemoStringFrom
- MemoStringTo
- MemoWordCount
- MemoWriteToFile
- midc
- midw
- minutes
- mod
- month
- OpenForm
- OpenMenu
- OpenProcedure
- OpenReport
- periods
- power
- presentvalue
- proper
- random
- rate
- RefreshForm
- RefreshScreen
- RefreshStatus
- Remote
- Remote authentication
- Remote POP3
- Remote IMAP
- Remote SMTP
- Remote XML
- seconds
- SetColor
- SetCurrent
- SetFocus
- SetLabelText
- SetMemoValue
- SetState
- SetStyle
- SetValue
- SetVar
- sin
- sinh
- spellcurrency
- spelldate
- spellmonth
- spellnumber
- spellweekday
- sqrt
- StringBetween
- StringEscape
- StringFind
- StringFrom
- StringReplace
- StringTo
- tan
- tanh
- textpos
- timeampm
- ToText
- UniqueID
- upper
- Wait
- weekday
- WriteToFile
- year
- yearday
- yearweek
- " (quotation marks)
- () (parentheses)
- + (addition)
- , (comma)
- - (subtraction)
- . (period)
- -- (comment)
- / (division)
- * (multiplication)
- * (asterisk)
- ? (question mark)
- ~ (tilde)
- : (colon)
- := (assignment operator)
- ; (semicolon)
- < (less than)
- <= (less than or equal to)
- = (equals)
- > (greater than)
- >= (greater than or equal to)
- all
- all files
- and
- any
- between
- blank
- count
- count of
- file
- highest of
- in groups
- in groups with group-totals
- in order
- in reverse
- item (Statistical)
- item (Conditional Statistical)
- lock files
- lock nothing
- lock records
- lookup
- lowest of
- max
- mean
- mean of
- min
- not
- number
- numeric string
- or
- pause
- percent
- selected record
- std.dev.
- std.err.
- sum
- sum of
- text
- time
- to
- variance
- window
- Rules for queries
- * (asterisk)
- ? (question mark)
- ~ (tilde)
- and
- or
- not
- ( ) (parentheses)
- Debug querys
- Livetext tags
- xdg3 query
- Sessions
- Pagination
- Free text search
- Intro on fields
- Text
- Hidden
- Date
- Dropdown
- List
- Checkbox
- Radio button
- Text edit
- Redactor (richtext)
- CKEditor
- TinyMCE
- Intro
- hasPrismConnection
- doAction
- doDerivation
- doMenuItem
- doPrismDerivation
- setFormField
- runPrismFunction
- @GetDefinition
- . document
- . listcommands
- . listdocuments
- . listdrives
- . listfiles
- . listfunctions
- . listinternals
- . listoperators
- . listrelated
- . listtables
- . object
- . table
- . testdql
- @SetDefinition
- . document
- . object
- Extra modules intro
- python
- Qt
- wkhtmltopdf
- PySide
- PyXCC
- django
- Apache
- LightTPD
- nginx
- pywin32
- flup
- cssutils
- Pillow
- psutil
- mysqldb
- psycopg2
- pyodbc
- python_dateutil
- requests
- suds-ews
- setuptools
- Whoosh
- wmi
- django-send
- bootstrap
- bootstrapmultiselect
- jquery
- jqueryui
- ckedit
- tinymce
- redactor
- JavaScript EU VAT Number Validation
- feedparser
- beautifulsoup
- appsdir
- six
- pycparser
- pyOpenSSL
- cryptography
- cffi
- enum34
- pyasn1
- idna
- ipaddress
- PyYAML
- coverage
- coveralls
- docopt
- mock
- funcsigs
- pbr
- nose
- paypalrestsdk
- paypal
- libcurl
- 7zipcpp
- cef
- cpp-jwt
Create custom transfer
This is what to do when creating a custom transfer.
All custom tranfer
All transfers is based on return a repository that can handle table data. To do this a getrepo is called to return an instance of the repository that will read, return and update data in a source. All data in DG3 transfer is looked at as table data, so if you read or write data to xml, JSON, SOAP or similar, you must create table data in the source and create from records in target.
# The getrepo definition you must use def getrepo(ctx=None): return MyRepo(ctx=ctx)
Custom source
In the custom source you need to return a TableDef from gettdf, and return records from an iterator. You must also descend from RepoBase and SourceBase. This will make sure you have the base functionality needed for a no table based source. The custom source do not read any definitions from the filters. This must all be done in your code. The only thing that is sent from the server is the context (ctx) the transfer is run. This might be a page context, task context or any other place where a transfer can be used. You also have the possibility to use the "Test context" to send parameters to your transfer during a test run. This is done bey setting a string in query form like field=value&field2=value2 etc. This comes as the ctx as a dict where fields are keys and values are the dicts values.
from debdata import TableDef, FieldDef, Record, RepoBase, SourceBase, TargetBase, gettypefromtext def getrepo(ctx=None): return SourceRepo(ctx=ctx) class SourceRepo(RepoBase,SourceBase): def __init__(self,ctx = None): RepoBase.__init__(self,ctx=ctx) SourceBase.__init__(self) self.internaldata=None self.max = 100 # maximum records to return def gettdf(self,name): self.tdf = TableDef(name='MySource',type=TableDef.REPOTYPE.TABLE) flddef = FieldDef(name='Name',type=FieldDef.FIELDTYPE.TEXT) self.tdf.add(flddef) flddef = FieldDef(name='EMail',type=FieldDef.FIELDTYPE.TEXT) self.tdf.add(flddef) return self.tdf def getsource(self,tdf=None,filter=None): return self def __iter__(self): self.row = -1 self.internaldata=[['My name','myemail@mydomain.com'],] return self def next(self): self.row+=1 if len(self.internaldata)>self.row and self.row < self.max: fields=self.internaldata[self.row] rec = Record(self.row,self.tdf,fields) return rec else: raise StopIteration def cleanup(self): self.internaldata=None
The first part is to simulate a repository and return a TDF. You can add as many field as you intend to return in your record iterator by creating a TableDef and then add all the fields you need of the type you intend to return to your target. In this example we added two text fields, Name and EMail. Then you return the source object. This is the object you will iterate over when return records. In a custom source, this is usually it self as this is where you also will create the iterator. Then you create the iterator to return one record at the time. Each record returned should also hold the correct row number and be returned as a Record class.At last you need a cleanup method that closes down sources and clean up memory use.
That's it for a custom source. You can use whatever python library and code you need to extract the data from your source.
Custom target
The custom target must define an updaterecord.
Testing in external debugger
The python editor in DG3 is not much good for debugging your code yet. To do this, you are better of using an external debugger that is set up to run the DG3 environment. Make sure you add the paths to the DG3 runtime libraries before in your debugger. These can be found in path to DG3 executables + DE4Web (ex. "C:\Program Files (x86)\DG3\DE4Web")
Add this code to the end of your custom Source to read all data and write it to console:
if __name__ == '__main__': repo = getrepo() heading = [] for field in repo.gettdf('GetData'): heading.append(field.name) print heading for rec in repo: recarr = [] for field in rec: recarr.append(field) print recarr
More to come