Closed etj closed 3 years ago
IPA association is found by layer -> group -> groupprofile -> groupprofilerndt -> pa (fk) -> ipa
legenda: x -> available ' ' -> not available
The library takes the IPA from the instance object and checks if is available. if is present, will update the UUID otherwise will take the already assigned UUID.
Cases managed
UUID | IPA | output |
---|---|---|
uuid1 | ||
x | ipa:uuid1 | |
x | uuid1 | |
x | x | ipa:uuid1 |
Cases managed
The library takes the IPA from the instance object and checks if is the same that is present in the uuid. If is the same will keep the old UUID, otherwise will update the UUID by replacing the old IPA with the new one found.
UUID | IPA is not changed | IPA changed | output |
---|---|---|---|
x | x | ipa:uuid1 | |
x | x | newipa:uuid1 |
All the use-case could be found in the tests.py
If the IPA value changes, in the post_save method, all the UUID of the ResouceBase with the related code, will be updated by replacing the code in the UUID
Example: |
IPA | UUID |
---|---|---|
123abc |
123abc:0ae99018-af2c-400b-b60e-34 |
After the update:
IPA | UUID |
---|---|
678gft |
678gft:0ae99018-af2c-400b-b60e-34 |
NOTE:
IPA
(code) has changed, if the Description/Name of the PubblicaAmministrazione change, nothing will happenIf the IPA fk changes, in the post_save method, all the UUID of the ResouceBase with the related code, will be updated by replacing the code in the UUID
Example: |
IPA | UUID |
---|---|---|
123abc |
123abc:0ae99018-af2c-400b-b60e-34 |
After the update:
IPA | UUID |
---|---|
678gft |
678gft:0ae99018-af2c-400b-b60e-34 |
NOTE:
IPA
(code) has changed, if the Description/Name of the PubblicaAmministrazione change, nothing will happen
We want to update a Layer UUID according to the associated
GroupProfile
.When a Layer has an associated GroupProfile, we need to read the related IPA code from
Layer
-->GroupProfile
-->GroupProfileRNDT
-->PubblicaAmministrazione.ipa
The UUID will be trasformed as:
IPA + ":" + UUID
The UUID should always reflect the associated IPA.
The main actions to check for are (not limited to)
GroupProfileRNDT
instance changes its reference to aPubblicaAmminstrazione
We do not want to customize GeoNode logic; we need instead to create hooks wherever needed in order for GeoNode to be extensible. For instance, we may want to create an
UUIDHandler
class that should be used at UUID initialization and whenever the Layer is updated. For instance, ingeonode/layers/models.py
, functionpre_save_layer()
we have:We may want to check the configuration if a constant
LAYER_UUID_HANDLER
exists. If it's there, we may call its methods, for instancehandler.create_uuid(instance)
.