home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / PSION / 1997 / 999 / PLUGINS.TXT < prev    next >
Encoding:
Text File  |  1997-04-16  |  7.5 KB  |  155 lines

  1. DPBank plugins
  2.  
  3. Because DPBank was intended to be small and fast, it is likely that you
  4. may not find the feature you may be looking for in this program; but
  5. still, you prefer DPBank because of it's better interface, small memory
  6. requirements, or whatever...
  7.  
  8. To resolve this dilemna, I've added the possibility to add third party
  9. programs with the form of "plugins". These plugins will integrate
  10. closely with DPBank and it will look like the new features are built-in.
  11. Indeed, all that is needed is the press of a hotkey and the plugin will
  12. be launched dynamically. Once the plugin has terminated, you will be
  13. prompted back to DPBank. In case you switch back to DPBank before the
  14. plugin has terminated, DPBank will close the plugin for you
  15. automatically because it's not possible to share the account files
  16. between two programs.
  17.  
  18. All this happens without the user knowing it as long as the plugin
  19. author has followed some basic instructions that you can find below.
  20.  
  21. DPBank plugins MUST be placed in an \APP\DPBANK directories in order to
  22. be found.
  23.  
  24. TECHNICAL NOTE TO PROGRAMMERS
  25.  
  26. Since version 1.6, it's now possible to write "plugins" for DPBank. This
  27. option is provided so people who want to use DPBank with more features
  28. than the standard included ones can go ahead while the other users who
  29. liked the original simplicity of the program can still use the "plain
  30. vanilla" DPBank without having to worry about getting more memory.
  31.  
  32. This file explains what you need to do as a programmer in order to
  33. integrate dynamically with DPBank. It also describes the file formats
  34. you may need and what you should and should not do with the files.
  35.  
  36. Note: I have no experience with C programming, so if you want to write a
  37. plugin in C, you'll have to give me some details because I doubt it will
  38. work with the actual method used in DPBank. All the instructions below
  39. apply to plugins wirtten in OPL.
  40.  
  41. First, you need to make a simple Psion Data file (without labels, ie:
  42. with the OPL CREATE command) having the following fields:
  43.  
  44. -The name of your plugin, exactly as you called your APP. This name will
  45.  appear in the plugin menu of DPBank and at the same time, it will be the
  46.  shell name of the app when it will be launched.
  47. -The filename of your plugin (but no need for the path, see below)
  48. -First line to be displayed in the "info" field for your plugin
  49. -The second line of info
  50. -The third line of info
  51. -The fourth line of info
  52.  
  53. All fields should be strings. The info lines are limited to 40
  54. characters per line. ALL fields MUST BE PRESENT! If you don't need all 4
  55. lines of infos, you must set them to "" be they must be present in the
  56. data file, or else DPBank will crash.
  57.  
  58. The info will be displayed in a dialog when the user wants to know more
  59. about your plugin. You may want to include your name, contact address,
  60. version number or whatever else you judge interesting...
  61.  
  62. This Data file must have exactly the same name as your plugin name
  63. except with an extension of "dpb" and must be located in an \APP\DPBANK
  64. directory in order for DPBank to locate it and display it in the menu.
  65.  
  66. If you take for example Nick Dawkin's "Plot" plugin, you'd have the Data
  67. file "plot.dpb" in the \APP\DPBANK directory and the application file
  68. "plot.opa" in the \APP\DPBANK directory of any drive.
  69.  
  70. When the plugin is called from within DPBank, the program will attempt
  71. to find the plugin application itself in the \APP\DPBANK directoy of all
  72. drives. If it cannot find the file, it will let the user know of the
  73. problem.
  74.  
  75. Once it has located your plugin, DPBank will launch it with the command
  76. line parameters set to open the current account datafile. Thus, it would
  77. be equivalent to launching your plugin from the system screen with the
  78. name of one account (and NOT the group as with DPBank itself for
  79. example). Your plugin must receive this info with the OPL CMD$(x)
  80. command. In other words: CMD$(2) will contain for example "accounts.d03"
  81. and CMD$(3) will contain for example "O" for open.
  82.  
  83. If you want your plugin to work seperately (ie: launched from the system
  84. screen), you must make sure you give priority to the command line from
  85. DPBank and not ask the user which account he wants to use. You can
  86. differentiate command lines from DPBank and those of the system screen
  87. because the system will never send a direct account name, but a group
  88. name ("pre" extension).
  89.  
  90. Once your plugin is launched, it will have complete control over the
  91. account data file (as DPBank had previously closed it for himself) and
  92. you can do whatever manipulations you need with it. In fact, DPBank will
  93. have no account files open itself.
  94.  
  95. The transactions datafile database is a plain Psion Data file with no
  96. headers. You simply cannot open them with the normal Data application
  97. because all fields are not strings (which is a limitation of the Data
  98. app).
  99.  
  100. The data has the following format: (note that this WILL change fairly
  101. soon, but once I will have changed the format (for version 2.x files), I
  102. hope it will be more or less definitive)
  103. -yrmody$: date of transaction in YYYYMMDD format
  104. -desc$: description of transaction
  105. -catego$: category of the transaction (short code)
  106. -locamt: local amount of transaction (in money of account's default)
  107. -cleared%: reconciled flag is bit 0. Other flags may appear later.
  108. -foramt: foreign amount (0 if in default money)
  109. -forcurr$: if this string is empty, then the amount is in the local
  110.  amount of the account, otherwise, the amount is of this currency (new
  111.  databases will have something set here always! If the amount is in
  112.  default money, then it will still have the default money's name)
  113. -balance: balance associated to this transaction at this position in
  114.  list.
  115.  
  116. Note: the files are always sorted in chronological order. This is one of
  117. the reasons you can't exit without saving your data. If your plugin
  118. modifies anything on the data file (ie: writes to it), then YOU are
  119. responsible of re-sorting the whole file at ALL times (since you never
  120. know when your program will terminate).
  121.  
  122. It is highly recommended to open the database file in read-only mode for
  123. the above reason.
  124.  
  125. Your plugin should have an exit option (Psion-x) and when activated,
  126. DPBank will re-open the database file, move to the foreground and
  127. re-display the transactions as to reflect any changes.
  128.  
  129. You do not need to worry about switching back to DPBank. This will be
  130. taken care of automatically. In the case where the user would switch
  131. manually back to DPBank, the program would send a close (eXit) process
  132. signal to the plugin. In the event that the plugin is not responsive to
  133. this signal, a kill signal would have to be sent! This could be
  134. catastrophic if the plugin didn't take care to save all changes it made
  135. to the database file at all times.
  136.  
  137. Please don't forget this important point!
  138. *****************************************
  139. Your plugin MUST be responsive to System EXIT messages AT ALL times!
  140.  
  141. DPBank needs to close the plugin because the program needs to have
  142. complete control over the database file and the Psion doesn't allow to
  143. have complete control over a file if it's already opened by another
  144. application.
  145.  
  146. I hope I've answered all your questions with this file. In the case of
  147. the contrary, don't hesitate to contact me by email. I will be happy to
  148. answer any other problems you may have.
  149.  
  150. Thanks for your interest in writing a DPBank plugin. I understand that
  151. certain people need more than simply a "Quicken frontend" if I may say,
  152. and I hope you will take this opportunity to enhance DPBank that little
  153. bit further. I'm sure all DPBank users will appreciate your effort.
  154.  
  155.