application.getApplicationType() in 4.1

Questions and answers regarding the use of eclipse environment as seen in Servoy Developer

application.getApplicationType() in 4.1

Postby martinh » Fri Mar 20, 2009 2:57 pm

In Servoy 3.5 I check in my script if a program is running from developer

Code: Select all
application.getApplicationType()  == 3


Now in 4.1.1 when using Eclipse it still returns value 3, but not when websolution is tested cfrom Eclipse.
In that case the value 5 is returned, while smartclient return 3 when running from Eclipse and 2 outside Eclipse.

//Get the application type
var type = application.getApplicationType();
//type 1 = SERVER
//type 2 = CLIENT
//type 3 = DEVELOPER
//type 4 = HEADLESS_CLIENT
//type 5 = WEB_CLIENT
//type 6 = RUNTIME


Now I have a problem. In developermode my program must in some places react different then when running as live program.
In 3.5 we were not able to debug webclient

Now we can debug webclient, but since I'm running from Eclipse I want to recognize that I'm running from Elipse.
I think the application.getApplicationType() must keep their values (or value 7 must be added WEBCLIENT DEVELOPER), but I would like to see a new property

Code: Select all
boolean application.runningFromDeveloper();  // or something similar


so that I can recognize it.

Does such an option already exists in 4.1.1 and if not could this be an option to add it?
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: application.getApplicationType() in 4.1

Postby lvostinar » Mon Mar 23, 2009 6:16 pm

You can add a case for this. I see that for debug web client and debug headless client it returns same values as for normal clients while for debug smart client it returns a different value.
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1064
Joined: Tue Feb 19, 2008 10:53 am

Re: application.getApplicationType() in 4.1

Postby jcompagner » Mon Mar 23, 2009 6:21 pm

we are planning to let getApplicationType() only return the real clients value
and that a second methods like isInDebug() or something like that will return true or false.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8868
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: application.getApplicationType() in 4.1

Postby martinh » Mon Mar 23, 2009 6:23 pm

Laurian,

Case 200039 was added.


Three times Servoy asked me to add a case. I never used so much the support system in one day :D :D :D
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: application.getApplicationType() in 4.1

Postby martinh » Mon Mar 23, 2009 6:24 pm

jcompagner wrote:we are planning to let getApplicationType() only return the real clients value
and that a second methods like isInDebug() or something like that will return true or false.


That looks a very good solution to me. Otherwise you have to check 2 values each time when checking smart or webclient
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium


Return to Eclipse Environment

Who is online

Users browsing this forum: No registered users and 2 guests