Copy Structure Values
Copy structure values
The basic idea of the Request Handler handling the copying of the structure values is to
search if a single structure value already exists in the target structure
if not copy the structure value
return the mapping of structure value proxy in the source structure to the structure value proxy in the target structure (to be able to substitute these proxies in further processes like the copy of structure groups)
When is the given structure value considered to already exist in the target structure?
A structureValue is considered already existing if
a structureValue with the same identifier exists in the target structure and
the structureValue in the target structure has no names different to the names of the source structure value
(if the source or the target structureValue have names which the other one doesn't have, that's ok).
Note: Missing entries will be added in the target structureValue
Examples
A structure value in the source structure has
Identifier: XYZ
Name (de) Grün
Name (en) green
and will be copied in on of the following target structures
Target Structure |
StructureValue Identifier |
StructureValue Name(de) |
StructureValue Name(en) |
What to do? |
Structure A |
ABC |
Grün |
green |
create new structure value |
Structure B |
ABC |
Grün |
<something else> |
create new structure value |
Structure C |
XYZ |
Grün |
green |
do nothing |
Structure D |
XYZ |
Grün |
<something else> |
create new structure value |
Structure E |
XYZ |
XL |
XL |
create new structure value |
Structure F |
XYZ |
Grün |
<empty> |
add english name to existing structure value |
Structure G |
XYZ |
<empty> |
<empty> |
add names to existing structure value |
Creating the copy
For copying the structure value createItemDataGraph() and createItem() of the structureValueManager is used together with the StructureEDataObjectCopyService.
This means all field values except id, identifier, structureProxy, deletionDate and logs are copied.
The new identifier
Compared to PIM 7 the creation of the identifier for a new structure value changed.
If the identifier of the source structure value isn't already taken in the target structure, the copy will get the identifier of the source structure value.
Otherwise it will get a new identifier. A new identifier will have the format: <generatedId>_<identifier of the source structure value>. This identifier will be cut on the right hand side to fit the max length of the identifier field.