[izpack-users] Reading Attributes from install.xml

Klaus Bartz bartzkau at gmx.net
Mon Jan 9 23:41:52 CET 2006


Hi Hal,

Am 09.01.2006, 21:33 Uhr, schrieb Hal Vaughan <hal at thresholddigital.com>:

> On Monday 09 January 2006 02:09 pm, Klaus Bartz wrote:
>> Hi Hal,
> ...
>> But if you would, why not a SimplePanelsSpec.xml. If so, I prefer if
>> there will be a (static ?) method in SpecHelper like
>> XMLElement getCommonPanelsSpec()
>> which loads once the spec and returns every call the root of the spec.
>> Or - if elements are fixed -
>> String getCommonPanelsValue(String panelName, String valueKey)
>> One point for a generic solution is the docu. It is not relevant
>> whether we love it or not (I hate it) but it has do be written.
>
> I find only a few references to SpecHelper and I'm not clear if an  
> instance of
> it exists where it can be easily retrieved by a panel (I can't find a  
> way to
> access it yet, but I'm looking).
>
> Is SpecHelper constructed at the start already and is it easily  
> available to a
> panel?
>
> If not, is it important this be in that class, or would another class
> specifically targeted at this work?
>

I have implemented the class for the custom action stuff. It simple makes  
the
job to simplify the loading and variable substitution. And some helper  
methods there.
It is used in the custom action stuff
and in some of my custom panels which are not part of the common IzPack.
An instance can be created with the default constructor (it is a private
member in SimpleInstallerListener). You can use it in the same manner as  
it is used
in the custom action stuff (one of the hole difference is that the base  
class do
not support it).
To use it first read the spec with e.g.
getSpecHelper().readSpec(SPEC_FILE_NAME, new  
VariableSubstitutor(idata.getVariables()));
With this the spec will be loaded from the subdir res from the jar file  
and the
IzPack variables will be replaced. This is a little bit difficult for  
panels if you
need the spec for the layout; the layout should be created at construction  
time,
this is after language selection and before any IzPanel; at this time only  
variables
which are written in install.xml are present (and the defaults of the  
common
variables). Makes not big sense. If you need the spec at panelActivate()  
you have
all variables declared before. Therefore it can make sense sometimes to  
declare
two specs, may be SimplePanelsLayoutSpec.xml and SimplePanelsSpec.xml (or  
so).
In AntInstallListener the parsing of the xml is placed in readAntCall  
(line 273ff).

Cheers

Klaus



> Hal
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de
> http://lists.berlios.de/mailman/listinfo/izpack-users
>
>
> __________ NOD32 1.1356 (20060108) Information __________
>
> Diese E-Mail wurde vom NOD32 Antivirus System geprüft
> http://www.nod32.com
>
>



-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/



More information about the izpack-users mailing list