[icedtea-web] RFC: add a command line tool to manipulate configuration

Omair Majid omajid at redhat.com
Wed Dec 15 09:52:09 PST 2010


The attached patch adds a tool named itweb-settings-cli (suggestions on 
a better name are welcome!) to read/modify/check the deployment 
configuration being used by IcedTea-Web.

The general pattern with using this tool is:
itweb-settings-cli <command> <options to command>

Sample usage:

$ ./itweb-settings-cli help
   itweb-settings-cli [list|get|set|reset|info|check] [help]
Command line tool to modify, view and check configuration. For help with 
a particular command, try: itweb-settings-cli command help
$ ./itweb-settings-cli get help
   itweb-settings-cli get property-name
Shows the value for property-name
$ ./itweb-settings-cli get deployment.user.cachedir
$ ./itweb-settings-cli set help
   itweb-settings-cli set property-name value
Sets the property-name to value if possible. The value is checked for 
being valid. If the administrator has locked the property, this will 
have no effect
$ ./itweb-settings-cli set deployment.user.cachedir /home/omajid/temp
$ ./itweb-settings-cli get deployment.user.cachedir
$ ./itweb-settings-cli info deployment.user.cachedir
Description: <Unknown>
Value: /home/omajid/temp
	Possible values include the absolute location of a file - it must begin 
with a /
Source: /home/omajid/.icedtea/deployment.properties
$ ./itweb-settings-cli reset deployment.user.cachedir
$ ./itweb-settings-cli get deployment.user.cachedir
$ ./itweb-settings-cli set deployment.proxy.same foobar
Property "deployment.proxy.same" has incorrect value "foobar". Possible 
values are true or false.
$ echo $?
$ ./itweb-settings-cli get deployment.proxy.same
$ ./itweb-settings-cli set foo bar
$ echo $?
$ ./itweb-settings-cli list
deployment.proxy.same: false
foo: bar
deployment.user.logdir: /home/omajid/.icedtea/log
deployment.user.cachedir: /home/omajid/.icedtea/cache
$ ./itweb-settings-cli check
Unknown property-name "foo"
$ echo "deployment.system.cachedir=_this_is_not_a_path" >> 
$ ./itweb-settings-cli check
Property "deployment.system.cachedir" has incorrect value 
"_this_is_not_a_path". Possible values include the absolute location of 
a file - it must begin with a /.
Unknown property-name "foo"

Any thoughts or comments?

2010-12-15  Omair Majid  <omajid at redhat.com>

     * Makefile.am
     (all-local): Add itweb-settings-cli
     (install-exec-local): Install itweb-settings-cli
     (uninstall-local): Uninstall itweb-settings-cli
     ($(NETX_DIR)/launcher/controlpanel-cli/%.o): New target.
     * netx/net/sourceforge/jnlp/config/Defaults.java
     (getDefaults): Set descriptions to Unknown rather than the name.
     Set source to localized form of internal
     * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
     (getProperty): Check for nulls.
     (setProperty): Add unknown as description and source for new
     (checkAndFixConfiguration): Fix translation constants. Remove note
     about setting to default.
     (parsePropertiesFile): Use unknown as description.
     * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java: New file
     (CommandLine): New method.
     (handleHelpCommand): Likewise.
     (printListHelp): Likewise.
     (handleListCommand): Likewise.
     (printGetHelp): Likewise.
     (handleGetCommand): Likewise.
     (printSetHelp): Likewise.
     (handleSetCommand): Likewise.
     (printResetHelp): Likewise.
     (handleResetCommand): Likewise.
     (printInfoHelp): Likewise.
     (handleInfoCommand): Likewise.
     (printCheckHelp): Likewise.
     (handleCheckCommand): Likewise.
     (handle): Likewise.
     (main): Likewise.
     * netx/net/sourceforge/jnlp/resources/Messages.properties: Add
     Usage, Unknown, RConfigurationFatal, DCIncorrectValue,
     DCSourceInternal, DCUnknownSettingWithName, VVPossibleValues,
     CLNoInfo, CLValue, CLValueSource, CLDescription, CLUnknownCommand
     CLUnknownProperty, CLNoIssuesFound, CLIncorrectValue,
     CLListDescription, CLGetDescription, CLSetDescription,
     CLResetDescription, CLInfoDescription, CLCheckDescription and
     CLHelpDescription. Remove DCErrorInSetting and

-------------- next part --------------
A non-text attachment was scrubbed...
Name: command-line-control-panel-05.patch
Type: text/x-patch
Size: 24917 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101215/bec74b12/command-line-control-panel-05.patch 

More information about the distro-pkg-dev mailing list