This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 37953 - no way to set the default server externally (e.g. from installer)
Summary: no way to set the default server externally (e.g. from installer)
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-10 06:23 UTC by Pavel Buzek
Modified: 2006-06-05 00:39 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2003-12-10 06:23:10 UTC
If there are multiple plugins installed in IDE
there can only be one default server. Since the
plugins are independen on each other none of them
can decide what is the default server. It is
required to make it possible to set the default
server externally (e.g. to read it from a file).
Comment 1 Nam Nguyen 2003-12-10 07:06:54 UTC
I plan to have the default instance defined at this location in 
<NB installation dir>/system/services/J2EE/DefaultInstance.xml.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server-string PUBLIC "-//org_netbeans_modules_j2ee//DTD
ServerString 1.0//EN"
                              
"nbres:/org/netbeans/modules/j2ee/deployment/impl/server-string.dtd">
<server-string plugin="J2EESDK" url="deployer:Sun:S1AS::localhost:4848">
    <target name="localhost:4848"/>
</server-string>
Comment 2 Nam Nguyen 2003-12-11 23:22:46 UTC
There will be one default-server.xml per plugin.  In addition, we will
have an entry in install.properties indicating user choice during
installation:

j2eeserver.default=system/services/J2EE/<Server-Plugin Name>
This way add after-installation flexibility, adminitrator can also
change the default instance definition, e.g. admin portnumber, by
editing the file.
Comment 3 Nam Nguyen 2003-12-11 23:39:17 UTC
Each plugin need to check into CVS the ServerString xml file and make
sure ant default build step put a copy of it into
<netbeans>/system/services/J2EE/<user-friendly-filename>
The <user-friendly-filename> could be conveniently used by the
installer to show on chooser UI.

The j2eeserver, on first registry access will try to read property
'j2eeserver.default' from the installation/system/installer.properties
for the relative path to user choice.  If the file exist and
consistent,  read in to registetry.  Else, just read from the layer
file.  If no default specified, the default server is determined by
first one registered.
Comment 4 Nam Nguyen 2004-01-26 23:36:22 UTC
Implemented as proposed, except that the default instance file format
will be java properties file format for easier handle by installer, in
case future installer need to persist input from users.  The
recommended locations to put the default instance files is:

j2eeserver.default=system/J2EE/InstalledServers/<Server-Plugin Name>

Tested on installation having both tomcat and s1as plugins (with s1as
plugin picked as default without any intervention).  Deposit a file in
netbeans/system/J2EE/InstalledServers/Tomcat5 and have this line in
netbeans/system/install.properties:
j2eeserver.default=system/J2EE/InstalledServers/Tomcat5
will make Tomcat5 as preferred default instance over S1AS.