Beispiel - Verteilung von Scanprofilen
- Former user (Deleted)
Owned by Former user (Deleted)
Feb. 06, 2017
3 min read
Loading data...
Verteilung von Scanprofilen
Beispiel-Script zur Verteilung von Scanprofilen an definierbare Arbeitsplätze.
Ressourcen und Konfiguration
- Clients
- Clients dient zur Definition der Client PC Namen, die die zu verteilenden Scanprofile erhalten sollen. ACHTUNG: Clients werden per Semikolon getrennt, ohne Leerzeichen.
- Host
- Host dient zur Definition des Client PC Namens, von dem aus alle Scanprofile verteilt werden sollen
- TempPath
- TempPath dienst zum temporären Zwischenspeichern von XML Daten
Voraussetzungen
- Host Client muss ein Scanprofil haben (siehe clarc\Software\clarc qhix daemon\Profiles\Scanner\***Host PC Name***\Profil1, Profil2, ...
- auf den TempPath muss der Dienst-User des clarc enterprise daemon - Dienstes vollzugriff haben
Script
var Distribution, Receivers, SearchPath, Temp, NodeName, NewNode : String; List, List2, PropertyList : Variant; sList, NodeList : TStringList; I, J, K : Integer; begin c4 := TccConfigManager.Create; sList := TStringList.Create; NodeList := TStringList.Create; try c4.CacheEnabled := True; if c4.Connected then begin SearchPath := '/clarc/Software/clarc qhix daemon/Profiles/Scanner'; Temp := ccScriptEngine.GetResource('TempPath', ''); Distribution := ccScriptEngine.GetResource('Host', ''); Distribution := SearchPath + '/' + Distribution; Receivers := ccScriptEngine.GetResource('Clients', ''); sList.Delimiter := ';'; sList.Duplicates := dupIgnore; sList.DelimitedText := Receivers; C4.GetChildNodes(Distribution, False, False, List); Z := VarArrayHighBound(List, 1); for I := 0 to Z do begin Position := Length(List[I]); while List[I][Position] <> '/' do Dec(Position); NodeList.Add(Copy(List[I], Position + 1, Length(List[I]))); C4.Export(List[I], Temp + IntToStr(I) + '.xml', False); end; for I := 0 to sList.Count - 1 do begin CurrReceiver := SearchPath + '/' + sList.Strings[I]; if C4.NodeExists(CurrReceiver, True) then begin C4.GetChildNodes(CurrReceiver, False, False, List2); for J := 0 to VarArrayHighBound(List2, 1) do C4.DeleteNode(List2[J]); end; for J := 0 to Z do begin NewNode := CurrReceiver + '/' + NodeList.Strings[J]; C4.NodeExists(NewNode, True); C4.Import(NewNode, Temp + IntToStr(J) + '.xml', False); end; end; end; finally C4.Free; sList.Free; NodeList.Free; DeleteFile(Temp + '*.xml', 0, False); end; end;