Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
applications:jvx_to_projx [2018/02/07 07:26]
admin
applications:jvx_to_projx [2018/02/07 07:32]
admin
Line 14: Line 14:
   * Change your launcher (run configuration) and add the full qualified resource path of your application.xml as second argument \\ \\ The launcher should have two arguments, e.g. \\ ''​com.sibvisions.apps.projx.ProjX''​ ''/​com/​company/​shop/​application.xml''​   * Change your launcher (run configuration) and add the full qualified resource path of your application.xml as second argument \\ \\ The launcher should have two arguments, e.g. \\ ''​com.sibvisions.apps.projx.ProjX''​ ''/​com/​company/​shop/​application.xml''​
   * **(optional)** Style your application:​ \\ \\ //​Application.Login.image//​ (e.g. /​com/​company/​shop/​images/​login.png),​\\ //​Application.Desktop.image//​ (e.g. /​com/​company/​shop/​images/​background.jpg),​\\ //​Application.Desktop.topimage//​ (e.g. /​com/​company/​shop/​images/​top-shadow.png),​\\ //​Application.Desktop.background//​ (e.g. 255,​255,​255)   * **(optional)** Style your application:​ \\ \\ //​Application.Login.image//​ (e.g. /​com/​company/​shop/​images/​login.png),​\\ //​Application.Desktop.image//​ (e.g. /​com/​company/​shop/​images/​background.jpg),​\\ //​Application.Desktop.topimage//​ (e.g. /​com/​company/​shop/​images/​top-shadow.png),​\\ //​Application.Desktop.background//​ (e.g. 255,​255,​255)
-  * **(optional)** Configure autologin: \\ \\ Application.Login.username\\ Application.Login.password \\ (and be sure that Application.authenticator contains com.sibvisions.apps.auth.UserPwdAuthenticator)+  * **(optional)** Configure autologin: \\ \\ //Application.Login.username//\\ //Application.Login.password// \\ (and be sure that Application.authenticator contains ​''​com.sibvisions.apps.auth.UserPwdAuthenticator''​) 
 + 
 +After above steps, start the application. You'll see an Exception because the workScreenAccess object wasn't found! This object should be added to your Session LCO because it's responsible for the menu/​toolbar configuration. The interface IWorkScreenAccess defines all relevant methods. 
 + 
 +ProjX contains two implementations:​ DBWorkScreenAccess and MemWorkScreenAccess. The DBWorkScreenAccess needs some tables and views in order to work, so for a first test the MemWorkScreenAccess should be good enough. Use following snippet and add it to your ''​Session.java''​ 
 + 
 +<file java> 
 +public IWorkScreenAccess getWorkScreenAccess() throws Exception 
 +
 +    IWorkScreenAccess wsac = (IWorkScreenAccess)get("​workScreenAccess"​);​ 
 +     
 +    if (wsac == null) 
 +    { 
 +        MemWorkScreenAccess mwsac = new MemWorkScreenAccess();​ 
 + 
 +        WorkScreenConfig woscManager= new WorkScreenConfig();​ 
 +        woscManager.setClassName("​com.company.shop.screens.ManagerWorkScreen"​);​ 
 +        woscManager.setMenuStructure("​Shop"​);​ 
 +        woscManager.setText("​Manager"​);​ 
 +         
 +        mwsac.addScreen(woscManager);​ 
 +         
 +        put("​workScreenAccess",​ mwsac); 
 + 
 +        return mwsac; 
 +    } 
 +     
 +    return wsac;                 
 +
 +</​file>​ 
 + 
 +Be sure that your Session class is configured as master session object in your //​config.xml//:​ 
 + 
 +<file xml> 
 +... 
 + 
 +<​lifecycle>​ 
 +    <​mastersession>​com.company.shop.Session</​mastersession>​ 
 +</​lifecycle>​ 
 +</​file>​ 
 + 
 +The next important thing is that you extend your work-screens from DataSourceWorkScreen:​ 
 + 
 +//​ManagerWorkScreen **extends DataSourceWorkScreen**//​ 
 + 
 +instead of 
 + 
 +//​ManagerWorkScreen **extends UIInternalFrame**//​ 
 + 
 +Use following default constructor:​ 
 + 
 +<file java> 
 +public ManagerWorkScreen(RemoteWorkScreenApplication pApp,  
 +                         ​AbstractConnection pConnection,​  
 +                         ​Map<​String,​ Object> pParameter) throws Throwable  
 +
 +    super(pApp, pConnection,​ pParameter);​ 
 + 
 +    initializeModel();​ 
 +    initializeUI();​ 
 +
 +</​file>​ 
 + 
 +Please remove the code from your screen which opens a new SubConnection or a RemoteDataSource. The connection will be opened automatically from ProjX (see constructor parameter pConnection) and the RemoteDataSource will be created from DataSourceWorkScreen. Simply call getDataSource() to get access. 
 + 
 +The DataSourceWorkScreen removes the boiler-plate code from your screens and usually your screens don't take care of application specific problems like save/reload or open/close. It's possible to take care, but not necessary in most screens! 
 + 
 +Start your application again and everything should work without problems. It's also possible to configure the welcome-screen for fast test iterations. To do this, set the parameter //​Application.WelcomeScreen//​ in your application.xml. 
 + 
 +The following ZIP archive contains templates: [[https://​doc.sibvisions.com/​_media/​applications/​jvx_to_projx.zip|JVx to ProjX Templates]]
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information