aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes [URLyBird]What contents in file suncertify.properties ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "[URLyBird]What contents in file suncertify.properties ?" Watch "[URLyBird]What contents in file suncertify.properties ?" New topic
Author

[URLyBird]What contents in file suncertify.properties ?

Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi ranchers,

According to assignment instruction:
Your programs must not require use of command line property specifications. All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.
Could you tell me how to design file properties?


SCJP 1.4 SCJD
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Basically, the properties file must contain everything the user can enter in the user interface that should be persisted between sessions and has no place in the database.

That includes (but isn't necessarilly limited to) the location of the database (server and port, and for the local database the file name and path).

I've included some more things to initialise the correct classes for my client (I've made it flexible through providing expansion mechanisms, for example a pluggable search function).

You might consider putting the last search criteria used into there as well if you think it would be a good idea to have the user start his application with the same filters he left it with.

At the moment mine contains (among others):


Different options can be stored for client and server (according to my assignment both must use the same properties file, not my choice) so you could have a server running and a client from the same machine access a different server elsewhere.
[ April 23, 2006: Message edited by: Jeroen T Wenting ]

42
Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi Jeroen,

Thanks for your reply. I want to ask two more quesions:

1. Why you have both client.config.datafile=db-2x2.db and server.file=db-2x2.db? db-2x2.db should only locate in server side.

2. I am still unclear about "client.config.server=10.1.0.10". That may means my drawback in knowledge of RMI. Could you explain it for me?
Jar Jaquiso
Greenhorn

Joined: Apr 20, 2006
Posts: 26
I'd say client.config.datafile is used when you start the application in standalone mode and server.file is used when you start in server mode.
Also the client needs to know the servers ip address so you use the client.config.server parameter.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
client.config.datafile is used by the client when run standalone (so in fact using an embedded server).
server.file is used by the network server.

Default for both is just the file in the working directory, but that would change to a complete path if needed.

My connection dialog on the client can switch between local and networked mode, either client.config.datafile or client.config.server is initially displayed (and the port number is displayed only when running in networked mode, which can be toggled using a checkbox on the connection dialog).

My client doesn't basically care about the "alone" flag when starting up, except that it toggles that checkbox on when the flag is present (which automatically switches to local mode and showing the filename instead network address).
If the user so wishes he can thus start in networked mode, disconnect, and reconnect in local mode or vice versa.
[ April 24, 2006: Message edited by: Jeroen T Wenting ]
Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi Jeroen,

Thanks again.

My client doesn't basically care about the "alone" flag when starting up, except that it toggles that checkbox on when the flag is present (which automatically switches to local mode and showing the filename instead network address).
So your default is network. And where did you locate the checkbox? If possible, could you let me see the picture your GUI.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
yes, the default mode is network (like the default startup, if no commandline argument is supplied that means network).

The connect dialog has 2 input fields (port number and database location), and the checkbox.
If the checkbox is selected to indicate standalone mode, the port number is turned invisible and a button to select a file appears behind the database location (which pops up a standard file selection dialog when pushed).



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [URLyBird]What contents in file suncertify.properties ?