jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • IzPack
  • IZPACK-178

Conditions on packs do not work properly

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 4.1.0
  • Fix Version/s: 4.1.1
  • Component/s: Installer
  • Labels:
    None
  • Environment:
    Windows XP

Description

when I tried to set condition for packs, it does not work, have any of you met the same problem? Below is the xml part.

<variables>
<variable name="do.test" value="0" />
</variables>
<conditions>
<condition type="variable" id="do_test">
<name>do.test</name>
<value>1</value>
</condition>
</conditions>
<packs>
<pack name="Database Configuration" required="no" condition="do_test">
<description>The database configuration</description>
</pack>
</packs>

When I run the install.jar with -DTRACE-true, I can see the condition do_test is set to false, but the pack is still visible.I tried to find some thing in the souce code, but did not find the place where the conditions of the packs are checked before showing it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Julien Ponge added a comment - 17/Oct/08 2:06 AM

Initially staged for 4.1.1, but Dennis you can move it to another version if timing is an issue.

Show
Julien Ponge added a comment - 17/Oct/08 2:06 AM Initially staged for 4.1.1, but Dennis you can move it to another version if timing is an issue.
Hide
Permalink
Dennis Reil added a comment - 31/Oct/08 7:51 AM

The conditions where only noted in the pack objects but not actually read in and put into the packconditions list when initializing the Rules Engine.

Please note, that every pack has to have an id attribute to work with conditions.

Show
Dennis Reil added a comment - 31/Oct/08 7:51 AM The conditions where only noted in the pack objects but not actually read in and put into the packconditions list when initializing the Rules Engine. Please note, that every pack has to have an id attribute to work with conditions.
Hide
Permalink
steve gorman added a comment - 18/Dec/08 1:54 PM

I tested this today and the problem still seems to exists in 4.2.

here are the files...

install.xml:
<?xml version="1.0"?>
<installation version="1.0">
<info>
<appname>Conditions Test</appname>
<appversion>0.1</appversion>
</info>

<guiprefs resizable="yes" width="700" height="450">
<laf name="looks">
<os family="windows" />
</laf>
<modifier value="true" key="showDebugWindow" />
</guiprefs>

<locale>
<langpack iso3="eng" />
</locale>

<resources>
<res src="userInputSpec.xml" id="userInputSpec.xml" />
</resources>

<conditions>
<condition type="variable" id="pack.choice.A">
<name>testcase.option</name>
<value>A</value>
</condition>
</conditions>

<panels>
<panel classname="UserInputPanel" />
<panel classname="PacksPanel" />
<panel classname="SummaryPanel" />
</panels>

<packs>
<pack name="Pack 1" required="no" preselected="yes" id="1">
<description><![CDATA[Main Pack -- should be seen no matter what]]></description>
</pack>
<pack name="Pack 2" id="2" required="no" condition="!pack.choice.A">
<description><![CDATA[If user chose Option A, This should not be seen]]></description>
</pack>
<pack name="Pack 3" id="3" required="no" condition="pack.choice.A">
<description><![CDATA[If user chose Option B, This should not be seen]]></description>
</pack>
</packs>

</installation>

userInputSpec.xml:
<userInput>
<panel order="0">
<field type="title" bold="true" txt="Choose an Option" />
<field type="combo" variable="testcase.option">
<description align="left"
txt="Option to switch packages on next panel"
id="description.testcase.option" />
<spec txt="Choose : ">
<choice txt="Option A" value="A" />
<choice txt="Option B" value="B" />
</spec>
</field>
</panel>
</userInput>

Show
steve gorman added a comment - 18/Dec/08 1:54 PM I tested this today and the problem still seems to exists in 4.2. here are the files... install.xml: <?xml version="1.0"?> <installation version="1.0"> <info> <appname>Conditions Test</appname> <appversion>0.1</appversion> </info> <guiprefs resizable="yes" width="700" height="450"> <laf name="looks"> <os family="windows" /> </laf> <modifier value="true" key="showDebugWindow" /> </guiprefs> <locale> <langpack iso3="eng" /> </locale> <resources> <res src="userInputSpec.xml" id="userInputSpec.xml" /> </resources> <conditions> <condition type="variable" id="pack.choice.A"> <name>testcase.option</name> <value>A</value> </condition> </conditions> <panels> <panel classname="UserInputPanel" /> <panel classname="PacksPanel" /> <panel classname="SummaryPanel" /> </panels> <packs> <pack name="Pack 1" required="no" preselected="yes" id="1"> <description><![CDATA[Main Pack -- should be seen no matter what]]></description> </pack> <pack name="Pack 2" id="2" required="no" condition="!pack.choice.A"> <description><![CDATA[If user chose Option A, This should not be seen]]></description> </pack> <pack name="Pack 3" id="3" required="no" condition="pack.choice.A"> <description><![CDATA[If user chose Option B, This should not be seen]]></description> </pack> </packs> </installation> userInputSpec.xml: <userInput> <panel order="0"> <field type="title" bold="true" txt="Choose an Option" /> <field type="combo" variable="testcase.option"> <description align="left" txt="Option to switch packages on next panel" id="description.testcase.option" /> <spec txt="Choose : "> <choice txt="Option A" value="A" /> <choice txt="Option B" value="B" /> </spec> </field> </panel> </userInput>
Hide
Permalink
Julien Ponge added a comment - 19/Dec/08 12:11 AM

Dennis, can you please have a look?

Thanks

Show
Julien Ponge added a comment - 19/Dec/08 12:11 AM Dennis, can you please have a look? Thanks
Hide
Permalink
Scott Povlot added a comment - 23/Dec/08 2:28 PM

Pack conditions only work with a conditions.xml resource using <packcondition> [RulesEngine.readConditions( ) ] . If the conditions.xml is used, the pack in the PacksPanel will show disabled (grey).

Normally, the conditions are loaded from the "/rules" jar resources. This data does not have pack conditions stored, only the data from <conditions>.

The unpacker checks the conditions using pack.getConditions( ) so that if the pack condition is set, the pack will not be installed.

Show
Scott Povlot added a comment - 23/Dec/08 2:28 PM Pack conditions only work with a conditions.xml resource using <packcondition> [RulesEngine.readConditions( ) ] . If the conditions.xml is used, the pack in the PacksPanel will show disabled (grey). Normally, the conditions are loaded from the "/rules" jar resources. This data does not have pack conditions stored, only the data from <conditions>. The unpacker checks the conditions using pack.getConditions( ) so that if the pack condition is set, the pack will not be installed.
Hide
Permalink
Dennis Reil added a comment - 28/Dec/08 12:47 PM

I tested this before the release without a conditions.xml, so just by adding it to the install xml and it worked fine. I'll recheck this soon.

Show
Dennis Reil added a comment - 28/Dec/08 12:47 PM I tested this before the release without a conditions.xml, so just by adding it to the install xml and it worked fine. I'll recheck this soon.
Hide
Permalink
ger dos added a comment - 03/Mar/09 9:35 AM

Hi, I'm having this problem using 4.0 version. Is this solved in 4.2?, I compared the code of both versions and I didn't find any changes. Could you tell me, if it's solved, which classes changed for the solution?
If it's not solved, when do you expect it will be?

Thank you very much.

Show
ger dos added a comment - 03/Mar/09 9:35 AM Hi, I'm having this problem using 4.0 version. Is this solved in 4.2?, I compared the code of both versions and I didn't find any changes. Could you tell me, if it's solved, which classes changed for the solution? If it's not solved, when do you expect it will be? Thank you very much.
Hide
Permalink
Dennis Reil added a comment - 04/Mar/09 1:48 AM

What is exactly your problem?

Packs with non-fulfilled conditions will still be shown in the packs panel, but they will not be selectable and will not be automatically selected. So please make sure, that this isn't what you expected.

Show
Dennis Reil added a comment - 04/Mar/09 1:48 AM What is exactly your problem? Packs with non-fulfilled conditions will still be shown in the packs panel, but they will not be selectable and will not be automatically selected. So please make sure, that this isn't what you expected.

People

  • Assignee:
    Dennis Reil
    Reporter:
    yiming du
Vote (1)
Watch (3)

Dates

  • Created:
    16/Oct/08 9:46 AM
    Updated:
    04/Mar/09 1:48 AM
    Resolved:
    31/Oct/08 7:51 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.