We want to somewhat complex search and replace commands for RIA that allow us to specify real-world. Examples include
CASE 1: Simple search/replace, e.g. For the objects in a group change the Bereich from A to B.
CASE 2: Freigabe = Ja For all objects in a group that don't have an explicit Freigabe = Nein, set Freigabe = Yes. Leave a comment on the reason for changing the Freigabe in Bemerkung.
CASE 3: Freigabe = Nein For all objects in a group, change Freigabe to Nein
CASE 4: Asset Freigabe = Ja For (all) assets attached to objects
Version 1 didn't allow me to change multiple fields at once, e.g. ObjPublicationGrp.TypeVoc and ObjPublicationGrp.PubVoc.
Version 2 didn't allow me to differentiate between creating a new ObjPublicationGrp.TypeVoc and changing an existing ObjPublicationGrp.TypeVoc.
[Source] mtype = "Object" saved_query = 1234 #group #exhibit
[Filter] # filter out all records which have Freigabe = Nein a.ObjPublicationGrp.TypeVoc = 1234 # SMB-Digital b.ObjPublicationGrp.PubVoc = 1234 # Nein
[FreigabeJa] # distinct job name a.ObjPublicationGrp = "new" # if field doesn't exist, make it a.type = "repeatableGroup"
b.ObjPublicationGrp.TypeVoc = "new:1234" # SMB-Digital; if field doesn't exist make it b.type = "repeatableGroup.vocabularyReference"
c.ObjPublicationGrp.PubVoc = 1234 # Ja c.type = "repeatableGroup.vocabularyReference" c.item = b # new field belongs to same item as b
/m:application/m:modules/m:module[@name = '{mtype}']/m:moduleItem[@id = '{ID}']/ m:repeatableGroup[ @name = 'ObjPublicationGrp' ]/m:repeatableGroupItem/m:vocabularyReference[ @name = 'TypeVoc' ]/m:vocabularyReferenceItem[@id = '1234' ] # SMB-Digital
does this exist? If not create it.
this part gets the moduleItem and will be needed multiple times /m:application/m:modules/m:module[@name = '{mtype}']/m:moduleItem[@id = '{ID}']/
We care here mostly for what comes after it
First-order field. I will leave that out as well in subsequent lines: m:repeatableGroup[ @name = 'ObjPublicationGrp' ]/m:repeatableGroupItem
If it doesn't exist, we create it
Second-order field: /m:repeatableGroupItem/m:vocabularyReference[ @name = 'TypeVoc' ]/m:vocabularyReferenceItem[@id = '1234' ] # SMB-Digital
if it doesn't exist, create it /m:repeatableGroupItem/m:vocabularyReference[ @name = 'TypeVoc' ]/m:vocabularyReferenceItem[@id = '1234' ] # SMB-Digital