Skip to content

Commit 6f5f14a

Browse files
committed
open masterdata added
1 parent e6880d3 commit 6f5f14a

File tree

3 files changed

+260
-49
lines changed

3 files changed

+260
-49
lines changed

Samples/OpenConnectUnit1.dfm

Lines changed: 100 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ object MainForm: TMainForm
22
Left = 0
33
Top = 0
44
Caption = 'OpenConnect for Delphi'
5-
ClientHeight = 636
5+
ClientHeight = 682
66
ClientWidth = 1286
77
Color = clBtnFace
88
Font.Charset = DEFAULT_CHARSET
@@ -19,7 +19,7 @@ object MainForm: TMainForm
1919
Left = 0
2020
Top = 0
2121
Width = 1024
22-
Height = 595
22+
Height = 641
2323
Align = alClient
2424
Columns = <>
2525
GridLines = True
@@ -33,7 +33,7 @@ object MainForm: TMainForm
3333
Left = 1024
3434
Top = 0
3535
Width = 262
36-
Height = 595
36+
Height = 641
3737
Align = alRight
3838
BevelOuter = bvNone
3939
TabOrder = 1
@@ -46,28 +46,28 @@ object MainForm: TMainForm
4646
end
4747
object Label6: TLabel
4848
Left = 17
49-
Top = 169
49+
Top = 201
5050
Width = 200
5151
Height = 13
5252
Caption = 'IDSConnect-Unterstuetzung (Onlineshop)'
5353
end
5454
object Label7: TLabel
5555
Left = 17
56-
Top = 185
56+
Top = 217
5757
Width = 31
5858
Height = 13
5959
Caption = 'Label1'
6060
end
6161
object Label4: TLabel
6262
Left = 17
63-
Top = 206
63+
Top = 238
6464
Width = 173
6565
Height = 13
6666
Caption = 'Unterstuetzte IDSConnect Prozesse'
6767
end
6868
object Label5: TLabel
6969
Left = 17
70-
Top = 248
70+
Top = 280
7171
Width = 79
7272
Height = 13
7373
Caption = 'IDSConnect URL'
@@ -95,14 +95,14 @@ object MainForm: TMainForm
9595
end
9696
object Label9: TLabel
9797
Left = 17
98-
Top = 304
98+
Top = 336
9999
Width = 149
100100
Height = 13
101101
Caption = 'Naeheres zu IDSConnect unter'
102102
end
103103
object Label10: TLabel
104104
Left = 17
105-
Top = 320
105+
Top = 352
106106
Width = 230
107107
Height = 33
108108
Cursor = crHandPoint
@@ -117,6 +117,62 @@ object MainForm: TMainForm
117117
WordWrap = True
118118
OnClick = Label10Click
119119
end
120+
object Label11: TLabel
121+
Left = 17
122+
Top = 149
123+
Width = 160
124+
Height = 13
125+
Caption = 'Datanorm-Online-Unterstuetzung'
126+
end
127+
object Label12: TLabel
128+
Left = 17
129+
Top = 165
130+
Width = 31
131+
Height = 13
132+
Caption = 'Label1'
133+
end
134+
object Label13: TLabel
135+
Left = 17
136+
Top = 405
137+
Width = 163
138+
Height = 13
139+
Caption = 'Open Masterdata-Unterstuetzung'
140+
end
141+
object Label14: TLabel
142+
Left = 17
143+
Top = 421
144+
Width = 31
145+
Height = 13
146+
Caption = 'Label1'
147+
end
148+
object Label15: TLabel
149+
Left = 17
150+
Top = 440
151+
Width = 45
152+
Height = 13
153+
Caption = 'Auth URL'
154+
end
155+
object Label16: TLabel
156+
Left = 17
157+
Top = 480
158+
Width = 89
159+
Height = 13
160+
Caption = 'bySupplierPID URL'
161+
end
162+
object Label17: TLabel
163+
Left = 17
164+
Top = 520
165+
Width = 122
166+
Height = 13
167+
Caption = 'byManufacturerData URL'
168+
end
169+
object Label18: TLabel
170+
Left = 17
171+
Top = 560
172+
Width = 58
173+
Height = 13
174+
Caption = 'byGTIN URL'
175+
end
120176
object Button2: TButton
121177
Left = 128
122178
Top = 118
@@ -128,15 +184,15 @@ object MainForm: TMainForm
128184
end
129185
object Edit1: TEdit
130186
Left = 17
131-
Top = 222
187+
Top = 254
132188
Width = 232
133189
Height = 21
134190
TabOrder = 1
135191
OnChange = Edit3Change
136192
end
137193
object Edit2: TEdit
138194
Left = 17
139-
Top = 264
195+
Top = 296
140196
Width = 232
141197
Height = 21
142198
TabOrder = 2
@@ -166,10 +222,42 @@ object MainForm: TMainForm
166222
TabOrder = 5
167223
OnChange = Edit3Change
168224
end
225+
object Edit6: TEdit
226+
Left = 17
227+
Top = 456
228+
Width = 232
229+
Height = 21
230+
TabOrder = 6
231+
OnChange = Edit3Change
232+
end
233+
object Edit7: TEdit
234+
Left = 17
235+
Top = 496
236+
Width = 232
237+
Height = 21
238+
TabOrder = 7
239+
OnChange = Edit3Change
240+
end
241+
object Edit8: TEdit
242+
Left = 17
243+
Top = 536
244+
Width = 232
245+
Height = 21
246+
TabOrder = 8
247+
OnChange = Edit3Change
248+
end
249+
object Edit9: TEdit
250+
Left = 17
251+
Top = 576
252+
Width = 232
253+
Height = 21
254+
TabOrder = 9
255+
OnChange = Edit3Change
256+
end
169257
end
170258
object Panel2: TPanel
171259
Left = 0
172-
Top = 595
260+
Top = 641
173261
Width = 1286
174262
Height = 41
175263
Align = alBottom

Samples/OpenConnectUnit1.pas

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ TMainForm = class(TForm)
3232
Label10: TLabel;
3333
Button3: TButton;
3434
CheckBox1: TCheckBox;
35+
Label11: TLabel;
36+
Label12: TLabel;
37+
Label13: TLabel;
38+
Label14: TLabel;
39+
Label15: TLabel;
40+
Edit6: TEdit;
41+
Edit7: TEdit;
42+
Label16: TLabel;
43+
Edit8: TEdit;
44+
Label17: TLabel;
45+
Edit9: TEdit;
46+
Label18: TLabel;
3547
procedure FormCreate(Sender: TObject);
3648
procedure Button1Click(Sender: TObject);
3749
procedure FormDestroy(Sender: TObject);
@@ -62,8 +74,8 @@ procedure TMainForm.FormCreate(Sender: TObject);
6274

6375
Left := 50;
6476
Top := 50;
65-
Width := Screen.DesktopWidth-100;
66-
Height := Screen.DesktopHeight-100;
77+
Width := Screen.WorkAreaWidth-100;
78+
Height := Screen.WorkAreaHeight-100;
6779

6880
with ListView1.Columns.Add do
6981
begin
@@ -241,8 +253,18 @@ procedure TMainForm.ListView1SelectItem(Sender: TObject; Item: TListItem; Select
241253
procedure TMainForm.Button2Click(Sender: TObject);
242254
var
243255
loginOptions : TOpenConnectLoginOptions;
244-
IDSConnectivity: TOpenConnectIDSConnectivity;
256+
connectivity: TOpenConnectConnectivityOptions;
245257
begin
258+
Label12.Caption := '';
259+
Label7.Caption := '';
260+
Edit1.Text := '';
261+
Edit2.Text := '';
262+
Label14.Caption := '';
263+
Edit6.Text := '';
264+
Edit7.Text := '';
265+
Edit8.Text := '';
266+
Edit9.Text := '';
267+
246268
if ListView1.Selected = nil then
247269
exit;
248270

@@ -251,26 +273,49 @@ procedure TMainForm.Button2Click(Sender: TObject);
251273
loginOptions.Password := Edit5.Text;
252274
loginOptions.ServiceURL := ListView1.Selected.SubItems[1];
253275
loginOptions.SupplierID := StrToInt(ListView1.Selected.SubItems[3]);
254-
276+
255277
Screen.Cursor := crHourGlass;
256278
try
257-
if not TOpenConnectHelper.CheckIDSConnectivitiy(loginOptions,IDSConnectivity) then
279+
if not TOpenConnectHelper.CheckConnectivitiy(loginOptions,connectivity) then
258280
exit;
259-
if IDSConnectivity.IDSConnectAvailable then
281+
282+
if connectivity.DatanormOnlineAvailable then
283+
Label12.Caption := 'verfuegbar'
284+
else
285+
Label12.Caption := 'nicht verfuegbar';
286+
287+
if connectivity.IDSConnectAvailable then
260288
Label7.Caption := 'verfuegbar'
261289
else
262290
Label7.Caption := 'nicht verfuegbar';
263291

264-
Edit1.Text := IDSConnectivity.IDSConnectSupportedProcesses;
292+
Edit1.Text := connectivity.IDSConnectSupportedProcesses;
265293

266294
if Edit2.Text <> '' then
267-
if not SameText(Edit2.Text,IDSConnectivity.IDSConnectURL) then
268-
if (MessageDlg('Die IDSConnect-ServiceURL hat sich geaendert.'+#10+
269-
'Soll die neue URL eingetragen werden?'+#10+
270-
IDSConnectivity.IDSConnectURL, mtWarning, [mbYes, mbNo], 0) = mrNo) then
271-
exit;
272-
273-
Edit2.Text := IDSConnectivity.IDSConnectURL;
295+
begin
296+
if not SameText(Edit2.Text,connectivity.IDSConnectURL) then
297+
if (MessageDlg('Die IDSConnect-ServiceURL hat sich geaendert.'+#10+
298+
'Soll die neue URL eingetragen werden?'+#10+
299+
'Alt: '+Edit2.Text+#10+
300+
'Neu: '+connectivity.IDSConnectURL, mtWarning, [mbYes, mbNo], 0) = mrYes) then
301+
Edit2.Text := connectivity.IDSConnectURL;
302+
end else
303+
Edit2.Text := connectivity.IDSConnectURL;
304+
305+
if connectivity.OpenMasterdataAvailable then
306+
begin
307+
Label14.Caption := 'verfuegbar';
308+
if connectivity.OpenMasterdata_OAuthCustomernumberRequired then
309+
Label14.Caption := Label14.Caption +' +CNr';
310+
if connectivity.OpenMasterdata_OAuthUsernameRequired then
311+
Label14.Caption := Label14.Caption +' +UN';
312+
end else
313+
Label14.Caption := 'nicht verfuegbar';
314+
Edit6.Text := connectivity.OpenMasterdata_OAuthURL;
315+
Edit7.Text := connectivity.OpenMasterdata_bySupplierPIDURL;
316+
Edit8.Text := connectivity.OpenMasterdata_byManufacturerDataURL;
317+
Edit9.Text := connectivity.OpenMasterdata_byGTINURL;
318+
274319
finally
275320
Screen.Cursor := crDefault;
276321
end;

0 commit comments

Comments
 (0)