|
1 | 1 | """
|
2 |
| -Copyright (c) 2021, 2023, Oracle and/or its affiliates. |
| 2 | +Copyright (c) 2021, 2025, Oracle and/or its affiliates. |
3 | 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
|
4 | 4 | """
|
5 | 5 | from java.util import Properties
|
@@ -456,13 +456,26 @@ def _finalize_folder(self, current_folder, past_folder, change_folder, location)
|
456 | 456 | if location is not None:
|
457 | 457 | folder_path = location.get_model_folders()
|
458 | 458 |
|
459 |
| - # Application and Library should include SourcePath if they have any other elements |
| 459 | + # Application and Library should include all attributes from past and change folders. |
| 460 | + # Changes to source path or underlying jar may require redeployment. |
460 | 461 | if (len(folder_path) == 1) and (folder_path[0] in self.SOURCE_PATH_FOLDERS):
|
461 |
| - # Handling Application and Library changes but keep the original that has not been changed |
462 | 462 | if change_folder:
|
463 |
| - orig_keys = dictionary_utils.get_dictionary_attributes(past_folder) |
464 |
| - for key in orig_keys: |
465 |
| - if key not in change_folder.keys(): |
466 |
| - key_value = dictionary_utils.get_element(past_folder, key) |
| 463 | + past_keys = dictionary_utils.get_dictionary_attributes(past_folder) |
| 464 | + for past_key in past_keys: |
| 465 | + attribute_type = self._aliases.get_model_attribute_type(location, past_key) |
| 466 | + |
| 467 | + if past_key not in change_folder.keys(): |
| 468 | + key_value = dictionary_utils.get_element(past_folder, past_key) |
467 | 469 | if key_value is not None:
|
468 |
| - change_folder[key] = key_value |
| 470 | + change_folder[past_key] = key_value |
| 471 | + |
| 472 | + elif attribute_type in ALIAS_LIST_TYPES: # update list with past + change items (ex: Target) |
| 473 | + past_list = alias_utils.create_list(past_folder[past_key], 'WLSDPLY-08001') |
| 474 | + change_list = alias_utils.create_list(change_folder[past_key], 'WLSDPLY-08000') |
| 475 | + new_list = list() |
| 476 | + for past_item in past_list: |
| 477 | + past_delete_item = model_helper.get_delete_name(past_item) |
| 478 | + if past_item not in change_list and past_delete_item not in change_list: |
| 479 | + new_list.append(past_item) |
| 480 | + new_list.extend(change_list) |
| 481 | + change_folder[past_key] = ','.join(new_list) |
0 commit comments