Uploaded image for project: 'MidPoint'
  1. MidPoint
  2. MID-7713

Problem merging adminGuiConfiguration for summaryPanel between System configuration and Archetype

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.4.2
    • Fix Version/s: 4.5, 4.4.2
    • Component/s: None
    • Labels:
    • Subscription:
      Internal
    • Backport Version:

      Description

      In archetype employee, in archetypePolicy I have

             <adminGuiConfiguration>
                  <objectDetails>
                      <type>UserType</type>
                      <summaryPanel>
                          <displayName>
                              <expression>
                                  <script>
                                      <code>return basic.concatName(object?.honorificPrefix, object?.givenName, object?.familyName, object?.honorificSuffix)</code>
                                  </script>
                              </expression>
                          </displayName>
                          <identifier>
                              <expression>
                                  <script>
                                      <code>return 'Login: ' + object?.name</code>
                                  </script>
                              </expression>
                          </identifier>
                          <title1>
                              <expression>
                                  <script>
                                      <code>
                                          def telephoneNumberValue
                                          def statusValue
                                          def tmp = object?.telephoneNumber
      
                                          if (!basic.isEmpty(tmp)) {
                                              telephoneNumberValue = 'T: ' + tmp
                                          }
      
                                          switch (basic.getExtensionPropertyValue(object, "http://example.com/midpoint", "empStatus")) {
                                              case 'F':
                                                  statusValue = '(former employee)'
                                                  break
                                              case 'I':
                                                  statusValue = '(temporarily inactive)'
                                                  break
                                              case 'A':
                                                  statusValue = '(active)'
                                                  break
                                              default:
                                                  statusValue = '(n/a)'
                                                  break
                                          }
                                          return basic.concatName(object?.title, statusValue, telephoneNumberValue)
                                      </code>
                                  </script>
                              </expression>
                          </title1>
                          <organization>
                              <expression>
                                  <script>
                                      <code>
                                          import com.evolveum.midpoint.schema.constants.SchemaConstants;
      
                                          tmp = midpoint.getParentOrgsByRelation(object, SchemaConstants.ORG_DEFAULT)
      
                                          for (org in tmp) {
                                              // Archetype Functional OU, oid='dc18c532-6022-11e9-ae4b-53f281ce01f4'
                                              if (midpoint.hasArchetype(org, 'dc18c532-6022-11e9-ae4b-53f281ce01f4')) {
                                                  //                 log.info("XXX would return this one: {}", org?.name)
                                                  return "Member of " + org?.displayName
                                              }
                                          }
                                      </code>
                                  </script>
                              </expression>
                          </organization>
                      </summaryPanel>
                  </objectDetails>
              </adminGuiConfiguration>
      

      This works - if I edit user of this archetype, summary panel is as I want.

      When I add this to systemConfiguration:

      
                      <objectDetailsPage>
                          <type>UserType</type>
                          <summaryPanel>
                              <displayName>
                                  <expression>
                                      <script>
                                          <code>return basic.concatName(object?.honorificPrefix, object?.givenName, object?.familyName, object?.honorificSuffix)</code>
                                      </script>
                                  </expression>
                              </displayName>
                              <identifier>
                                  <expression>
                                      <script>
                                          <code>return 'Username: ' + object?.name</code>
                                      </script>
                                  </expression>
                              </identifier>
                          </summaryPanel>
                      </objectDetailsPage>
      

      Then as user administrator viewing any un-archetyped user I see the result of System configuration setup.
      But when viewing any archetyped user, I see defaults. Not identifier override from System configuration and not from archetype.

        Attachments

          Activity

            People

            Assignee:
            vix Ivan Noris
            Reporter:
            vix Ivan Noris
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: