Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • <https://KUNDE.vertec-mobile.com/xml> mit der Vertec URL

  • Bearer ... mit Bearer [API TOKEN des Service Accounts]

  • Hinweis: %{searchTerm}% war in der alten Konfiguration %{0}% . Beim Übernehmen der SQL-Query bzw. OCL aus dem bestehenden Konfiguration, muss dies angepasst werden.

Code Block
 <!-- Vertec via AddressService -->
  <!-- Vertec address provider - neue Konfiguration ab Vertec 6.7   -->
  <AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
    <!-- Vertec, Server -->
    <AddressProvider id="09C886F1-4B5A-4372-8CB4-4AA6D2F7A47B" Title="Vertec">
      <!-- Vertec, Applikation -->
      <Icon>iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIASURBVDhPfVLbahNBGJ6d2c02BxsTU2qibSqNJ4hiqIiIXgleeOuFeOU7+Bo+iFfeV7Gl0BuVGiEgZouSDbHbbEqSTTbLHmfGfw8EVsWPn53Zb77/OCO83kchBMT81rT3itMVhHhE/Rs4WZf4nzgE9hgC8ynyaMf1AyegDnz9wA1oIkFwyryA8iiWoJ61oZ4QHFOnghAR4JcjLwjeHrSnlk0wfvH4LnBv9o8YQ+K30/eRA4fqnfEOo+LGevn+7euTmWk6LkQUCd6srpXOFdpKv6MOSfPZB90C29Nmn4+P7ym/5qWc1GxsKn3tU7cvSwTKW5iLZmND1UaqPsUSRqERlCFbsiRmRHyjXoOMPW1EcJhaIvj7YGRatuv5AhJSU+Kc52Xp8noloLR3OoZigGScF3Mr0LE+NUWcdqCMV0uFUrEADQyNBbQLJIxou1axXfdkYuKYWoIydrG8CuRoYkDpyfA4v3Ot/nMwjJmUA2TPyRnYzBd2PHXbC3a2L104v3rY+SGLIjApB+hyZtmwyWVliGc6Xq1cePqw9bGjDA0rnkHotIRESHdwpo+NW1e3nj+aCwJu3byi9E7efVGymURJnryMVgFxVnWMB64vqJq+Vsw36rV8Vj782t096kIx4fXHwr9fa8AopRyuLH5OskgiRYJUDzFEjEENTYP0DzVC6DclJP5kwEd/SAAAAABJRU5ErkJggg==</Icon>
      <SearchParameters>
        <SearchParameter Name="searchTerm" Label="Suchbegriff" Type="String" Length="100" Sort="1" />
      </SearchParameters>
      <Debug>true</Debug>
      <Configuration>
        <Step>
          <Request Method="Post" Url="<https://KUNDE.vertec-mobile.com/xml>">
            <!-- API Token  -->
            <Header Name="Authorization" Value="Bearer ..." />
            <!--
                Zum Testen:
                Mit Browser <https://KUNDE.vertec-mobile.com/xml/query> besuchen, dann das ganze "<Body>"-Element dort reinkopieren.
                «'%{0}%'» ersetzen mit Test-Suchbegriff.
                
                -->
            <Body><![CDATA[<Envelope>
                <Body>
                  <Query>
                    <Selection>
                      <ocl>Adresseintrag</ocl>
                      <sqlwhere>
                      aktiv = 1 
                          and
                      (
                      (alias like '%{searchTerm}%') or (name like '%{searchTerm}%') or (nameA like '%{searchTerm}%') or (nameB like '%{searchTerm}%') or (standardadresse like '%{searchTerm}%') or (standardPLZ like '%{searchTerm}%') or (standardOrt like '%{searchTerm}%')
                        or
                      (firma in (select bold_id from adresseintrag where (name like '%{searchTerm}%') or (alias like '%{searchTerm}%') or (standardadresse like '%{searchTerm}%') or (standardPLZ like '%{searchTerm}%') or (standardOrt like '%{searchTerm}%')))
                      )
                  </sqlwhere>
                    </Selection>
                    <Resultdef>
                      <member>Personenkonto</member>
                      <member>Alias</member>
                      <member>LieferantenNr</member>
                      <member>Standardadresse</member>
                      <member>Stellung</member>
                      <member>Zusatz</member>
                      <member>StandardKanton</member>
                      <member>StandardTelefon</member>
                      <member>Bankverbindung</member>
                      <member>StandardMobile</member>
                      <member>Geburtsdatum</member>
                      <member>StandardHomepage</member>
                      <member>StandardLand</member>
                      <member>MWSTNR</member>
                      <member>StandardFax</member>
                      <member>Briefanrede</member>
                      <member>IsMale</member>
                      <member>Grussformel</member>
                      <expression>
                        <alias>Grussformel</alias>
                        <ocl>
                        
                          if self.oclistypeof(Person) then self.oclastype(Person).grussformel
                          else
                            if self.oclistypeof(Kontakt) then
                              if self.oclastype(Kontakt).person->notempty then self.oclastype(Kontakt).person.grussformel 
                              else self.oclastype(Kontakt).grussformel
                              endif
                            else
                              if self.oclistypeof(Firma) then self.oclastype(Firma).grussformel
                              else
                                if sprache.asstring = 'DE' then
                                  'Freundliche Grüsse'
                                else
                                  'Greetings,'
                                endif
                              endif
                            endif
                          endif                        
                        
                        
                       </ocl>
                      </expression>
                      <member>StandardEMail</member>
                      <member>Titel</member>
                      <member>StandardOrt</member>
                      <member>Name</member>
                      <member>Anrede</member>
                      <member>StandardPLZ</member>
                      <expression>
                        <alias>Sprache</alias>
                        <ocl>sprache.asstring</ocl>
                      </expression>
                      <member>KundenNR</member>
                      <expression>
                        <alias>firmenname</alias>
                        <ocl>
                          if self.oclistypeof(Firma) then self.oclastype(Firma).name
                          else
                            if self.oclistypeof(Kontakt) and self.oclastype(Kontakt).firma->notempty then self.oclastype(Kontakt).firma.name
                            else ''
                            endif
                          endif
                        </ocl>
                      </expression>
                      <expression>
                        <alias>kontaktname</alias>
                        <ocl>
                          if self.oclistypeof(Person) then self.oclastype(Person).name
                          else
                            if self.oclistypeof(Kontakt) then 
                              if self.oclastype(Kontakt).person->notempty then self.oclastype(Kontakt).person.name 
                              else self.oclastype(Kontakt).name
                              endif
                            else
                              <!-- Paar-Adressen -->
                              if self.oclistypeof(Paar)
                              then 
                                if self.oclastype(Paar).personA.notNull and self.oclastype(Paar).personB.notNull then
                                  self.oclastype(Paar).personA.vorname + ' ' + self.oclastype(Paar).personA.name + ', ' + self.oclastype(Paar).personB.vorname + ' ' + self.oclastype(Paar).personB.name
                                else 
                                  if self.oclastype(Paar).personA.notNull and self.oclastype(Paar).personB.isNull then
                                    self.oclastype(Paar).personA.vorname + ' ' + self.oclastype(Paar).personA.name + ', ' + self.oclastype(Paar).vornameB + ' ' + self.oclastype(Paar).nameB
                                  else 
                                    if self.oclastype(Paar).personA.isNull and self.oclastype(Paar).personB.notNull then
                                      self.oclastype(Paar).vornameA + ' ' + self.oclastype(Paar).nameA + ', ' + self.oclastype(Paar).personB.vorname + ' ' + self.oclastype(Paar).personB.name
                                    else 
                                      self.oclastype(Paar).vornameA + ' ' + self.oclastype(Paar).nameA  + ', ' + self.oclastype(Paar).vornameB + ' ' + self.oclastype(Paar).nameB
                                    
                                    endif
                                  
                                  endif
                                endif
                                else ''
                              endif
                            
                            endif
                          endif
                        </ocl>
                      </expression>
                      <expression>
                        <alias>kontaktvorname</alias>
                        <ocl>
                          if self.oclistypeof(Person) then self.oclastype(Person).vorname
                          else
                            if self.oclistypeof(Kontakt) then
                              if self.oclastype(Kontakt).person->notempty then self.oclastype(Kontakt).person.vorname
                              else self.oclastype(Kontakt).vorname
                              endif
                            else ''
                            endif
                          endif      
                        </ocl>
                      </expression>
                      <member>adresstext</member>
                      <expression>
                        <alias>Kuerzel</alias>
                        <ocl>
                          if self.oclistypeof(Kontakt) then self.oclastype(Kontakt).abteilung else '' endif
                        </ocl>
                      </expression>
                      <expression>
                        <alias>Abteilung</alias>
                        <ocl>
                          if self.oclistypeof(Kontakt) then zusatzfeldasstring('abteilung') else '' endif
                        </ocl>
                      </expression>
                      <!-- TestNameA: Zeigt, wie man bei Paaren auf den Nachnamen kommt (es gibt nämlich 2 Arten von Paaren) -->
                      <!--
                      <expression>
                        <alias>TestNameA</alias>
                        <ocl>
                          if self.oclistypeof(Paar)
                          then 
                            if self.oclastype(Paar).personA.notNull
                            then self.oclastype(Paar).personA.name
                            else self.oclastype(Paar).nameA
                            endif
                          else 'Blub'
                          endif
                        </ocl>
                      </expression>
                      -->
                    </Resultdef>
                  </Query>
                </Body>
              </Envelope>
            ]]></Body>
          </Request>
          <Response>
            <Contacts XPath="/Envelope/Body/QueryResponse/Kontakt | /Envelope/Body/QueryResponse/Firma | /Envelope/Body/QueryResponse/Person | /Envelope/Body/QueryResponse/Paar ">
              <Mapping>
                <!-- Company -->
                <Map Source="standardOrt" Target="Company_City" />
                <Map Source="standardLand" Target="Company_Country" />
                <Map SourceValue="CH" Target="Company_CountryShortCode" />
                <Map Source="Abteilung" Target="Company_Department" />
                <Map Source="standardEMail" Target="Company_EmailCentral" />
                <Map Source="standardEMail" Target="Company_EmailDirect" />
                <Map Source="standardFax" Target="Company_FaxCentral" />
                <Map Source="standardFax" Target="Company_FaxDirect" />
                <Map Source="standardHomepage" Target="Company_Homepage" />
                <Map Source="firmenname" Target="Company_Name" />
                <Map Source="standardTelefon" Target="Company_PhoneCentral" />
                <Map Source="standardTelefon" Target="Company_PhoneDirect" />
                <!-- Company_PostOfficeBox ToDo -->
                <Map Source="standardAdresse" Target="Company_Street" />
                <Map Source="standardPLZ" Target="Company_ZipCode" />
                <!-- Person -->
                <Map Source="geburtsdatum" Target="Person_BirthDate" />
                <Map Source="standardLand" Target="Person_Country" />
                <Map SourceValue="CH" Target="Person_CountryShortCode" />
                <Map Source="standardOrt" Target="Person_City" />
                <Map Source="standardEMail" Target="Person_EmailDirect" />
                <Map Source="standardOrt" Target="Person_City" />
                <Map Source="standardFax" Target="Person_FaxDirect" />
                <Map Source="kontaktvorname" Target="Person_FirstName" />
                <Map Source="standardHomepage" Target="Person_Homepage" />
                <Map Source="kontaktname" Target="Person_LastName" />
                <Map Source="standardTelefon" Target="Person_PhoneDirect" />
                <Map Source="stellung" Target="Person_Position" />
                <!-- Person_PostOfficeBox ToDo -->
                <Map Source="standardAdresse" Target="Person_Street" />
                <Map Source="titel" Target="Person_Title" />
                <Map Source="standardPLZ" Target="Person_ZipCode" />
                <!-- Common -->
                <Map Source="ID" Target="AddressProviderData_Id" />
                <Map Source="anschrift" Target="AddressProviderData_Label_FormattedString" />
                <Map Source="briefanrede" Target="Person_Salutation" />
                <Map Source="Grussformel" Target="Person_Greeting" />
              </Mapping>
            </Contacts>
          </Response>
        </Step>
      </Configuration>
    </AddressProvider>
  </AddressProvider>

...

Code Block
breakoutModewide
languagexml
<!-- Vertec AddressProvider -->
<AddressProvider id="0861976E-318F-41A1-AE45-6D894A7E7292" order="12" active="false" hiddenIfNotAvailable="true">
  <Uri>http://{host}/xml</Uri>
  <Timeout>10000</Timeout>
  <ContactMapping>
    <ContactItemXPath>//Kontakt</ContactItemXPath>
    <ContactItemXPath>//Firma</ContactItemXPath>
    <ContactItemXPath>//Person</ContactItemXPath>
    <Namespaces />
    <ContactElement id="Company_City">Firma/standardOrt</ContactElement>
    <ContactElement id="Company_City">Kontakt/standardOrt</ContactElement>
    <ContactElement id="Company_Country">Firma/standardLand</ContactElement>
    <ContactElement id="Company_Country">Kontakt/standardLand</ContactElement>
    <!-- CountryShortCode is only mapped when Country also exists. Best practise: Map the country short code into Country and CountryShortCode. -->
    <ContactElement id="Company_CountryShortCode">Kontakt/standardLand</ContactElement>
    <ContactElement id="Company_Department">Kontakt/Abteilung</ContactElement>
    <ContactElement id="Company_EmailCentral">Firma/standardEMail</ContactElement>
    <ContactElement id="Company_EmailDirect">Kontakt/standardEMail</ContactElement>
    <ContactElement id="Company_FaxCentral">Firma/standardFax</ContactElement>
    <ContactElement id="Company_FaxDirect">Kontakt/standardFax</ContactElement>
    <ContactElement id="Company_Homepage">Firma/standardHomepage</ContactElement>
    <ContactElement id="Company_Homepage">Kontakt/standardHomepage</ContactElement>
    <ContactElement id="Company_Mobile"></ContactElement>
    <ContactElement id="Company_Name">firmenname</ContactElement>
    <ContactElement id="Company_PhoneCentral">Firma/standardTelefon</ContactElement>
    <ContactElement id="Company_PhoneDirect">Kontakt/standardTelefon</ContactElement>
    <ContactElement id="Company_PostOfficeBox" fReplace="Postfach,PostfachPostfach" fSubstringAfter="Postfach"></ContactElement>
    <ContactElement id="Company_PostOfficeBox" fReplace="Postfach,PostfachPostfach" fSubstringAfter="Postfach"></ContactElement>
    <ContactElement id="Company_PostOfficeBoxCity"></ContactElement>
    <ContactElement id="Company_Street">Firma/standardAdresse</ContactElement>
    <ContactElement id="Company_Street">Kontakt/standardAdresse</ContactElement>
    <ContactElement id="Company_Supplement"></ContactElement>
    <ContactElement id="Company_ZipCode">Firma/standardPLZ</ContactElement>
    <ContactElement id="Company_ZipCode">Kontakt/standardPLZ</ContactElement>
    <ContactElement id="Greeting">grussformel</ContactElement>
    <ContactElement id="ID">objid</ContactElement>
    <ContactElement id="Language"></ContactElement>
    <ContactElement id="Person_BirthDate">Kontakt/geburtsdatum</ContactElement>
    <ContactElement id="Person_BirthDate">Person/geburtsdatum</ContactElement>
    <ContactElement id="Person_Country">Person/standardLand</ContactElement>
    <!-- CountryShortCode is only mapped when Country also exists. Best practise: Map the country short code into Country and CountryShortCode. -->
    <ContactElement id="Person_CountryShortCode">Person/standardLand</ContactElement>
    <ContactElement id="Person_City">Person/standardOrt</ContactElement>
    <ContactElement id="Person_Email">Person/standardEMail</ContactElement>
    <ContactElement id="Person_Fax">Person/standardFax</ContactElement>
    <ContactElement id="Person_FirstName">Kontakt/kontaktvorname</ContactElement>
    <ContactElement id="Person_FirstName">Person/kontaktvorname</ContactElement>
    <ContactElement id="Person_Homepage">Person/standardHomepage</ContactElement>
    <ContactElement id="Person_LastName">Kontakt/kontaktname</ContactElement>
    <ContactElement id="Person_LastName">Person/kontaktname</ContactElement>
    <ContactElement id="Person_Mobile"></ContactElement>
    <ContactElement id="Person_NickName"></ContactElement>
    <ContactElement id="Person_Phone">Person/standardTelefon</ContactElement>
    <ContactElement id="Person_Position">Kontakt/stellung</ContactElement>
    <ContactElement id="Person_Position">Person/stellung</ContactElement>
    <ContactElement id="Person_PostOfficeBox" fReplace="Postfach,PostfachPostfach" fSubstringAfter="Postfach"></ContactElement>
    <ContactElement id="Person_PostOfficeBoxCity"></ContactElement>
    <ContactElement id="Person_Profession"></ContactElement>
    <ContactElement id="Person_SecondName"></ContactElement>
    <ContactElement id="Person_Street">Person/standardAdresse</ContactElement>
    <ContactElement id="Person_Title">Kontakt/titel</ContactElement>
    <ContactElement id="Person_Title">Person/titel</ContactElement>
    <ContactElement id="Person_ZipCode">Person/standardPLZ</ContactElement>
    <ContactElement id="Provider_AddressLabel">anschrift</ContactElement>
    <ContactElement id="Salutation">briefanrede</ContactElement>
    <ContactElement id="SalutationShort">anrede</ContactElement>
  </ContactMapping>
  <RequestConfiguration>
    <Envelope>
      <Header>
        <!-- ↓ Alte Konfiguration ↓ -->
        <BasicAuth>
          <Name></Name>
          <Password></Password>
        </BasicAuth>
        <!-- ↓ Neue Konfiguration ↓ -->
        <BasicAuth>
          <Token></Token>
        </BasicAuth>
      </Header>
      <Body>
        <Query>
          <Selection>
            <ocl>Adresseintrag</ocl>
            <sqlwhere>
                  aktiv = 1 
                            and
                        (
                    (alias like '%{0}%') or (standardadresse like '%{0}%') or (standardPLZ like '%{0}%') or (standardOrt like '%{0}%')
                      or
                    (firma in (select bold_id from adresseintrag where (name like '%{0}%') or (alias like '%{0}%') or (standardadresse like '%{0}%') or (standardPLZ like '%{0}%') or (standardOrt like '%{0}%')))
                  )
                    </sqlwhere>
          </Selection>
          <Resultdef>
            <member>Personenkonto</member>
            <member>Alias</member>
            <member>LieferantenNr</member>
            <member>Standardadresse</member>
            <member>Stellung</member>
            <member>Zusatz</member>
            <member>StandardKanton</member>
            <member>StandardTelefon</member>
            <member>Bankverbindung</member>
            <member>StandardMobile</member>
            <member>Geburtsdatum</member>
            <member>StandardHomepage</member>
            <member>StandardLand</member>
            <member>MWSTNR</member>
            <member>StandardFax</member>
            <member>Briefanrede</member>
            <member>IsMale</member>
            <member>Grussformel</member>
            <member>StandardEMail</member>
            <member>Titel</member>
            <member>StandardOrt</member>
            <member>Name</member>
            <member>Anrede</member>
            <member>StandardPLZ</member>
            <expression>
              <alias>Sprache</alias>
              <ocl>sprache.asstring</ocl>
            </expression>
            <member>KundenNR</member>
            <expression>
              <alias>firmenname</alias>
              <ocl>
                    if self.oclistypeof(Firma) then self.oclastype(Firma).name
                    else
                    if self.oclistypeof(Kontakt) and self.oclastype(Kontakt).firma-&gt;notempty then self.oclastype(Kontakt).firma.name
                    else ''
                    endif
                    endif
                  </ocl>
            </expression>
            <expression>
              <alias>kontaktname</alias>
              <ocl>
                    if self.oclistypeof(Person) then self.oclastype(Person).name
                    else
                    if self.oclistypeof(Kontakt) then 
                      if self.oclastype(Kontakt).person-&gt;notempty then self.oclastype(Kontakt).person.name 
                      else self.oclastype(Kontakt).name
                      endif
                    else ''
                    endif
                    endif
                  </ocl>
            </expression>
            <expression>
              <alias>kontaktvorname</alias>
              <ocl>
                    if self.oclistypeof(Person) then self.oclastype(Person).vorname
                    else
                    if self.oclistypeof(Kontakt) then
                      if self.oclastype(Kontakt).person-&gt;notempty then self.oclastype(Kontakt).person.vorname
                      else self.oclastype(Kontakt).vorname
                      endif
                    else ''
                    endif
                    endif		  
                  </ocl>
            </expression>
            <member>adresstext</member>
            <expression>
              <alias>Kuerzel</alias>
              <ocl>
                    if self.oclistypeof(Kontakt) then self.oclastype(Kontakt).abteilung else '' endif
                  </ocl>
            </expression>
            <expression>
              <alias>Abteilung</alias>
              <ocl>
                    if self.oclistypeof(Kontakt) then zusatzfeldasstring('abteilung') else '' endif
                  </ocl>
            </expression>
          </Resultdef>
        </Query>
      </Body>
    </Envelope>
  </RequestConfiguration>
</AddressProvider>