This article provides an example of how you can enable users to update existing parts in an item structure directly in a configured grid view. This specific example shows how to update Header and Footer parts in multiple Documents using a Work Area.
Prerequisites
- Familiar with the SystemWeaver meta model building blocks (e.g., Items, Parts and Attributes)
- Familiar with the SystemWeaver Explorer Interface and common operations
- Familiar with the SystemWeaver Script Language
- An installation of the SystemWeaver Explorer client (swExplorer)
- Assignment of the SW Architect role in the server
- An installation of SystemWeaver version R40 or later
Example Meta Model
Example Data
To update Header and Footer parts in the Documents, place the new Header and Footer Template Items in the structure as shown below. The four Documents have Headers and Footers that need to be replaced with new ones ("New_Footer" and "New_Header).
Example Configuration
<Grid> <Variable name="header" as="Item" select="/IDI[Handle='x04000000000B9A70']"/> <Variable name="footer" as="Item" select="/IDI[Handle='x04000000000B9A73']"/> <Variable name="docs" as="Item" select="/IDI[not . in ($header union $footer)]"/> <ActionBindings> <ActionBinding actionId="updateHeaderFooter"> <WithParam name="newHeader" select="$header"/> <WithParam name="newFooter" select="$footer"/> <WithParam name="documents" select="$docs"/> </ActionBinding> </ActionBindings> <Actions> <Action id="updateHeaderFooter" caption="Update to the New Header #{? /IDI[Handle='x04000000000B9A70']} and Footer #{? /IDI[Handle='x04000000000B9A73']}"> <Parameter name="newHeader" as="Item"/> <Parameter name="newFooter" as="Item"/> <Parameter name="documents" as="[Item]"/> <Item id="NH" match="$newHeader"/> <Item id="NF" match="$newFooter"/> <ForEach select="$documents"> <Item id="DOC_#{Handle}" match="."> <Part id="H_#{Handle}" partType="IRHE" defObj="NH"/> <Part id="F_#{Handle}" partType="IRFO" defObj="NF"/> <!-- <If test="/part::IRHE"> <ForEach select="/part::IRHE"> <Part id="#{Handle}" match="." defObj="NH"/> </ForEach> </If> <If test="/part::IRFO"> <ForEach select="/part::IRFO"> <Part id="#{Handle}" match="." defObj="NF"/> </ForEach> </If> --> </Item> </ForEach> </Action> </Actions> <Columns> <ItemNameColumn width="200"/> </Columns> <Row/> </Grid>
Example Result
Before update
After update
The Execute pop-up will display (if the optional confirmationDialog attribute is set to "true". It should be removed once you roll out the configuration to users.