Quicker development/debugging/testing turnaround with customised PetraClient startup: Difference between revisions
m (→Example) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 26: | Line 26: | ||
To temporarily suppress the execution of this feature although it is specified either as Command Line Argument or in the .config file or in both, press and keep the ''<ALT>'' key depressed immediately after starting the OpenPetra Client and before the login screen appears. | To temporarily suppress the execution of this feature although it is specified either as Command Line Argument or in the .config file or in both, press and keep the ''<ALT>'' key depressed immediately after starting the OpenPetra Client and before the login screen appears. | ||
== Startup | == Startup Features ''TestAction'' and ''ActionClick'' == | ||
The 'TestAction' feature allows the specification of a Screen and optionally of parameters for a screen. This screen is automatically launched when the Main Menu screen appears after the login. | ===TestAction=== | ||
The ''TestAction'' feature allows the specification of a Screen and optionally of parameters for a screen. This screen is automatically launched when the Main Menu screen appears after the login. | |||
''This means you don't have to go through the OpenPetra menu structure over and over again to launch the same screen that you are just working on!'' | ''This means you don't have to go through the OpenPetra menu structure over and over again to launch the same screen that you are just working on!'' | ||
=== Example === | ==== Example ==== | ||
Example for use as Command Line Argument: | Example for use as Command Line Argument for opening the '''Partner Edit screen''': | ||
-TestAction:"Namespace=Ict.Petra.Client.MPartner.Gui,ActionOpenScreen=TFrmPartnerEdit,PartnerKey=43005002,ShowTabPage=petpDetails" | -TestAction:"Namespace=Ict.Petra.Client.MPartner.Gui,ActionOpenScreen=TFrmPartnerEdit,PartnerKey=43005002,ShowTabPage=petpDetails" | ||
Example for use in the .config file: | Example for use in the .config file: | ||
<add key="TestAction" value="Namespace=Ict.Petra.Client.MPartner.Gui,ActionOpenScreen=TFrmPartnerEdit,PartnerKey=43005004,ShowTabPage=petpAddresses" /> | <add key="TestAction" value="Namespace=Ict.Petra.Client.MPartner.Gui,ActionOpenScreen=TFrmPartnerEdit,PartnerKey=43005004,ShowTabPage=petpAddresses" /> | ||
Notes: | |||
* For screens in the Finance Module Screens that depend on a specific Ledger you always need to add <code>,LedgerNumber=xx</code> to the TestAction line (replacing '<code>xx</code>' with a valid Ledger Number in your test DB) to make sure that such screens are appropriately initialised when opened with the TestAction method! | |||
* Keyboard shortcut for developers: 'CTRL+SHIFT+T'. On pressing this, the 'TestAction' is executed (again and again). That particular key combination is convenient for the re-opening of a screen that the developer needs to close and re-open while testing/debugging! | |||
===ActionClick=== | |||
Use ''ActionClick'' instead of 'TestAction' to call specific public Methods. Look in the UINavigation.yml file to find the appropriate 'ActionClick' target for the screen that you want to launch. Please note that you also need to specify the Namespace in which the public Method is found. | |||
==== Example ==== | |||
Example for use as Command Line Argument for opening the '''Partner Find screen''': | |||
-TestAction:"Namespace=Ict.Petra.Client.MPartner.Gui,ActionClick=TPartnerMain.FindPartner" | |||
Example for use in the .config file: | |||
<add key="TestAction" value="Namespace=Ict.Petra.Client.MPartner.Gui,ActionClick=TPartnerMain.FindPartner" /> | |||
'''Important''': ''Certain screens need specific initialisation before opening them'' - without that they are opened but appear 'broken'. Use 'ActionClick' rather than 'TestAction' to call the initialisation Method (see previous paragraph). An example for this is the '''Partner Find screen'''; use <code>ActionClick=TPartnerMain.FindPartner</code> to open that screen properly. | |||
=== Temporary Suppression of Feature === | === Temporary Suppression of Feature === | ||
To temporarily suppress the execution of this feature although it is specified either as Command Line Argument or in the .config file or in both, press and keep the ''<CTRL>'' key depressed immediately after starting the OpenPetra Client and before the login screen appears. | To temporarily suppress the execution of this feature although it is specified either as Command Line Argument or in the .config file or in both, press and keep the ''<CTRL>'' key depressed immediately after starting the OpenPetra Client and before the login screen appears. |
Latest revision as of 08:17, 10 March 2015
Overview of Startup Features
While developing/debugging/testing a certain function of OpenPetra, developers/testers often need to start the PetraClient application repeatedly, for example while introducing a new functionality or while fixing a Bug.
To make the turnaround of developing/debugging/testing cycles faster, PetraClient can be configured to do things at startup for you, thereby saving a lot of time.
These startup features can be specified as Command Line Arguments or in the .config file, or both. If both are specified, the Command Line Arguments 'win', i.e override the features as specified in the .config file.
For specification of the startup features in the .config file, read this first.
Startup Feature AutoLogin
The 'AutoLogin' feature allows the specification of a username and password which is then used when the OpenPetra Client starts up. The OpenPetra Client automatically logs in with these credentials and presents the Main Menu screen. This means you don't have to type the credentials over and over again!
Please note that this feature is disabled when the CheckBox 'Remember the username' is ticked in the OpenPetra Login dialog.
Example
Example for use as Command Line Argument:
-AutoLogin:demo -AutoLoginPasswd:demo
Example for use in the .config file:
<add key="AutoLogin" value="demo" /> <add key="AutoLoginPasswd" value="demo" />
Temporary Suppression of Feature
To temporarily suppress the execution of this feature although it is specified either as Command Line Argument or in the .config file or in both, press and keep the <ALT> key depressed immediately after starting the OpenPetra Client and before the login screen appears.
Startup Features TestAction and ActionClick
TestAction
The TestAction feature allows the specification of a Screen and optionally of parameters for a screen. This screen is automatically launched when the Main Menu screen appears after the login. This means you don't have to go through the OpenPetra menu structure over and over again to launch the same screen that you are just working on!
Example
Example for use as Command Line Argument for opening the Partner Edit screen:
-TestAction:"Namespace=Ict.Petra.Client.MPartner.Gui,ActionOpenScreen=TFrmPartnerEdit,PartnerKey=43005002,ShowTabPage=petpDetails"
Example for use in the .config file:
<add key="TestAction" value="Namespace=Ict.Petra.Client.MPartner.Gui,ActionOpenScreen=TFrmPartnerEdit,PartnerKey=43005004,ShowTabPage=petpAddresses" />
Notes:
- For screens in the Finance Module Screens that depend on a specific Ledger you always need to add
,LedgerNumber=xx
to the TestAction line (replacing 'xx
' with a valid Ledger Number in your test DB) to make sure that such screens are appropriately initialised when opened with the TestAction method! - Keyboard shortcut for developers: 'CTRL+SHIFT+T'. On pressing this, the 'TestAction' is executed (again and again). That particular key combination is convenient for the re-opening of a screen that the developer needs to close and re-open while testing/debugging!
ActionClick
Use ActionClick instead of 'TestAction' to call specific public Methods. Look in the UINavigation.yml file to find the appropriate 'ActionClick' target for the screen that you want to launch. Please note that you also need to specify the Namespace in which the public Method is found.
Example
Example for use as Command Line Argument for opening the Partner Find screen:
-TestAction:"Namespace=Ict.Petra.Client.MPartner.Gui,ActionClick=TPartnerMain.FindPartner"
Example for use in the .config file:
<add key="TestAction" value="Namespace=Ict.Petra.Client.MPartner.Gui,ActionClick=TPartnerMain.FindPartner" />
Important: Certain screens need specific initialisation before opening them - without that they are opened but appear 'broken'. Use 'ActionClick' rather than 'TestAction' to call the initialisation Method (see previous paragraph). An example for this is the Partner Find screen; use ActionClick=TPartnerMain.FindPartner
to open that screen properly.
Temporary Suppression of Feature
To temporarily suppress the execution of this feature although it is specified either as Command Line Argument or in the .config file or in both, press and keep the <CTRL> key depressed immediately after starting the OpenPetra Client and before the login screen appears.