Issue 61189 - allow a ValueList in profile items so that portions of the jvmfwkrc classpath can be conditionalized
Summary: allow a ValueList in profile items so that portions of the jvmfwkrc classpath...
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: solenv (show other issues)
Version: 680m152
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: hjs
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks: 52974
  Show dependency tree
 
Reported: 2006-01-26 13:55 UTC by caolanm
Modified: 2013-08-07 15:34 UTC (History)
3 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch to implement this (4.10 KB, patch)
2006-01-26 13:56 UTC, caolanm
no flags Details | Diff
patch 2 (817 bytes, patch)
2006-01-27 15:48 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2006-01-26 13:55:31 UTC
i.e. the attached patch. This would enable issue 52974 to progress
Comment 1 caolanm 2006-01-26 13:56:45 UTC
Created attachment 33576 [details]
patch to implement this
Comment 2 caolanm 2006-01-26 13:57:47 UTC
cmc->hjs: What do you think ? Can I put this in ?
Comment 3 hjs 2006-01-26 17:53:26 UTC
patch looks reasonable to me. but  you should try to get a word from is on this :)
Comment 4 ingo.schmidt-rosbiegal 2006-01-27 10:47:00 UTC
IS: I suppose the patch will work and bring fast good results. But you kill much
functionality of the very general method  "get_all_items_from_script". 
This method simply collects all key - value pairs.  You can define all key -
value pairs language specific.

Key (de) = "abc";
Key (en-US) = "def";
Value (de) = "ghi";
Value (en-US) = "jkl";

Your patch does not support this language functionality.  I think, this is never
used for ProfileItems, but currently it can be used. Besides it is used for many
other scp items (files, dirs, ...).

Another solution is possible:  The file jvmfwk3.ini does not cotain any dynamic
part, that has to be exchanged during packing or installation process. Therefore
it could be possible to change jvmfwk3.ini from a Profile to a File in scp2, to
deliver it and to pack it like most other files.
Then the content of this file can be changed independently from any scp
restrictions. 
Comment 5 hjs 2006-01-27 12:00:35 UTC
the underlying problem isn't limited to this case (jvmfwk3.ini). all keys (left
side) where the value (right side) is some kind of list will require something
simila once the desire pops up to modify this list based on settings in the
build environment.

if this is that generic, why not introduce a

(key_name_pattern)(language_pattern) = multiple
(key_name_pattern)List(language_pattern)

mapping? could be a cheap way to introduce a generic list mechanism without
changing the processing all over the complete script.
Comment 6 ingo.schmidt-rosbiegal 2006-01-27 14:55:27 UTC
This seems to be much functionality for a little collector function. I do not
think that get_all_items_from_script is a good place for this. What happens if
"Value" is language dependent and "ValueList" not? Or vice versa? There are
other functions called later that take care of this language stuff.
get_all_items_from_script only has to collect all the content.
I do not think that it is a good idea to duplicate all this language specific code.

And do we really need a global "List" mechanism for all possible keys? For Name,
Style, Date, Order, ...? And do we always want to control whether there is a
correlated List-entry for all of this keys? I suppose a much simpler solution:

First of all we need keys with unique names for the ValueLists. Otherwise only
the last  ValueList would survive get_all_items_from_script.

<code>

ProfileItem gid_Profileitem_Jvmfwk_Uno_Java_Jfw_Classpath_Urls
    ProfileID = gid_Profile_Jvmfwk_Ini;
    ModuleID = gid_Module_Root;
    Section = "Bootstrap";
    Order = 7;
    Key = "UNO_JAVA_JFW_CLASSPATH_URLS";
    Value = "${${$ORIGIN/$UNO_SETTINGS:PKG_UserUnoFile}
    ValueList1 = ${${$ORIGIN/$UNO_SETTINGS:PKG_SharedUnoFile}
    ValueList2 = $ORIGIN/classes/jurt.jar
    ValueList3 = $ORIGIN/classes/sandbox.jar
    ValueList4 = $ORIGIN/classes/commonwizards.jar 
End

</code>

Then all the normal processing happens, until everything is evaluated and the
File is really created. This happens in create_profiles in profiles.pm.

Instead of simply using the existing value:

<code>
my $value = $oneprofileitem->{'Value'};
</code>

it would now be possible to add all existing ValueLists (separated by blanks?).

<code>
my $value = $oneprofileitem->{'Value'};
for ( my $j = 1; $j <= 10; $j++ )
{
    my $key = "ValueList" . $j;
    if ( $oneprofileitem->{$key} ) { $value = $value . " " .
$oneprofileitem->{$key}; }
</code>

Using the for-loop an ordering of different ValueLists can be introduced. And of
course the maximum number should be determined before. But perhaps you prefer a
foreach without ordering.
Anyhow, I would prefer such a version, where the value is determined as late as
possible.
Comment 7 caolanm 2006-01-27 15:48:15 UTC
Created attachment 33620 [details]
patch 2
Comment 8 caolanm 2006-01-27 15:49:23 UTC
So would that alternative patch be acceptable to everyone ?
Comment 9 ingo.schmidt-rosbiegal 2006-02-01 13:21:36 UTC
For me this patch is acceptable (but please do not use the variable "j" because
it is already used in the surrounding loop).
Comment 10 caolanm 2006-02-01 13:28:51 UTC
accepted for consideration post jaxpapi integration
Comment 11 caolanm 2006-03-22 13:50:00 UTC
done in systemjava
Comment 12 caolanm 2006-03-24 08:59:55 UTC
reopen for qa
Comment 13 caolanm 2006-03-24 09:01:06 UTC
ready for qa
Comment 14 caolanm 2006-03-24 09:01:32 UTC
back to fixed
Comment 15 hjs 2006-04-05 17:22:45 UTC
ok
Comment 16 hjs 2006-06-08 17:54:44 UTC
.