Esempio n. 1
0
        public void BindUiControls()
        {
            //URL fields:

            URLUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.EndPointURL), true, false, UCValueExpression.eBrowserType.Folder);
            URLUserUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.URLUser), true, false, UCValueExpression.eBrowserType.Folder);
            URLDomainUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.URLDomain), true, false, UCValueExpression.eBrowserType.Folder);
            URLPasswordUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.URLPass), true, false, UCValueExpression.eBrowserType.Folder);

            //Network Credential selection radio button:
            NetworkCredentialsRadioButton.Init(typeof(ApplicationAPIUtils.eNetworkCredentials), NetworkCeredentials, mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.NetworkCredentialsRadioButton, ApplicationAPIUtils.eNetworkCredentials.Default.ToString()), NetworkCreds_SelectionChanged);

            //Request Body Selection radio button:
            RequestBodyTypeRadioButton.Init(typeof(ApplicationAPIUtils.eRequestBodyType), BodySelection, mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.RequestBodyTypeRadioButton, ApplicationAPIUtils.eRequestBodyType.FreeText.ToString()), RequestBodyType_Selection);

            //CertficiateRadioButtons :
            CertificateTypeRadioButton.Init(typeof(ApplicationAPIUtils.eCretificateType), CertificateSelection, mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.CertificateTypeRadioButton, ApplicationAPIUtils.eCretificateType.AllSSL.ToString()), CertificateSelection_Changed);

            //Response validation checkbox:
            GingerCore.GeneralLib.BindingHandler.ActInputValueBinding(DoNotFailActionOnBadRespose, CheckBox.IsCheckedProperty, mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.DoNotFailActionOnBadRespose, "False"));

            //Use Legacy JSON Parsing
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(UseLegacyJSONParsingCheckBox, CheckBox.IsCheckedProperty, mAct, ActWebAPIBase.Fields.UseLegacyJSONParsing);

            //Request Body fields:
            RequestBodyUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.RequestBody), true, false, UCValueExpression.eBrowserType.Folder, "*", null);
            RequestBodyUCValueExpression.AdjustHight(200);
            RequestBodyUCValueExpression.ValueTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;

            //Import Request File
            GingerCore.GeneralLib.BindingHandler.ActInputValueBinding(DoNotImportRequestFile, CheckBox.IsCheckedProperty, mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.ImportRequestFile, "False"));

            //SSL Certificates:
            CertificatePath.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.CertificatePath), true, true, UCValueExpression.eBrowserType.File, "*.*", new RoutedEventHandler(BrowseSSLCertificate));
            CertificatePasswordUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.CertificatePassword), true, false, UCValueExpression.eBrowserType.Folder);

            //Import Certificate
            GingerCore.GeneralLib.BindingHandler.ActInputValueBinding(DoNotCertificateImportFile, CheckBox.IsCheckedProperty, mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.ImportCetificateFile, "False"));

            //Security:
            SecurityTypeComboBox.Init(mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.SecurityType, ApplicationAPIUtils.eSercurityType.None.ToString()), typeof(ApplicationAPIUtils.eSercurityType), false, null);

            //Authorization:
            AuthTypeComboBox.Init(mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.AuthorizationType, ApplicationAPIUtils.eAuthType.NoAuthentication.ToString()), typeof(ApplicationAPIUtils.eAuthType), false, AuthorizationBox);

            //Authorization
            AuthUserUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.AuthUsername), true, false, UCValueExpression.eBrowserType.Folder);
            AuthPasswordUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.AuthPassword), true, false, UCValueExpression.eBrowserType.Folder);

            DynamicElementsGrid.Init(Context.GetAsContext(mAct.Context), mAct.DynamicElements, "Body Content Parameters", "Place Holder", "Value", "Calculated Value");

            HttpHeadersGrid.Init(Context.GetAsContext(mAct.Context), mAct.HttpHeaders, "Request Headers", "Header", "Value", "Calculated Value");

            //FormDataGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddRow));
            SetKeyValuesGrid(mAct.RequestKeyValues);

            CheckNetworkCredentials();
            CheckRequestBodySelection();
            CheckCertificateSelection();
        }
Esempio n. 2
0
 public void Bind()
 {
     URLUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.URL, nameof(ActInputValue.Value));
     SoapActionUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.SOAPAction, nameof(ActInputValue.Value));
     XMLFileNameUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.XMLfileName, nameof(ActInputValue.Value));
     URLDomainUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.URLDomain, nameof(ActInputValue.Value));
     URLPasswordUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.URLPass, nameof(ActInputValue.Value));
     URLUserUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.URLUser, nameof(ActInputValue.Value));
     SetDynamicGrid();
     DynamicXMLElementsGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddDynamicXMLelement));
 }
Esempio n. 3
0
        public ActRESTEditPage(ActREST a)
        {
            InitializeComponent();

            mActREST = a;
            URLUCValueExpression.Init(Context.GetAsContext(mActREST.Context), mActREST.EndPointURL);
            URLDomainUCValueExpression.Init(Context.GetAsContext(mActREST.Context), mActREST.URLDomain, nameof(ActInputValue.Value));
            URLPasswordUCValueExpression.Init(Context.GetAsContext(mActREST.Context), mActREST.URLPass, nameof(ActInputValue.Value));
            URLUserUCValueExpression.Init(Context.GetAsContext(mActREST.Context), mActREST.URLUser, nameof(ActInputValue.Value));
            RequestBodyUCValueExpression.Init(Context.GetAsContext(mActREST.Context), mActREST.RequestBody);
            RequestRespondXmlSaveTextBox.Init(Context.GetAsContext(mActREST.Context), mActREST.SaveRequestResponseFolderPath);

            TemplateFileNameFileBrowser.Init(Context.GetAsContext(mActREST.Context), mActREST.TemplateFile);
            GingerCore.General.FillComboFromEnumObj(RequestTypeComboBox, mActREST.RequestType);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(RequestTypeComboBox, ComboBox.TextProperty, mActREST, ActREST.Fields.RequestType);

            //httpversion content type
            GingerCore.General.FillComboFromEnumObj(HttpVersioncombobox, mActREST.ReqHttpVersion);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(HttpVersioncombobox, ComboBox.SelectedValueProperty, mActREST, ActREST.Fields.ReqHttpVersion);

            //Request content type
            GingerCore.General.FillComboFromEnumObj(ContentTypeComboBox, mActREST.ContentType);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ContentTypeComboBox, ComboBox.SelectedValueProperty, mActREST, ActREST.Fields.ContentType);

            //Response Content Type
            GingerCore.General.FillComboFromEnumObj(ResponseTypeComboBox, mActREST.ResponseContentType);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ResponseTypeComboBox, ComboBox.SelectedValueProperty, mActREST, ActREST.Fields.ResponseContentType);
            //Security Type
            GingerCore.General.FillComboFromEnumObj(SecurityTypeComboBox, mActREST.SecurityType);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(SecurityTypeComboBox, ComboBox.SelectedValueProperty, mActREST, ActREST.Fields.SecurityType);

            //Cookie Mode
            GingerCore.General.FillComboFromEnumObj(CookieMode, mActREST.CookieMode);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(CookieMode, ComboBox.SelectedValueProperty, mActREST, ActREST.Fields.CookieMode);

            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(restRequest, CheckBox.IsCheckedProperty, mActREST, ActREST.Fields.RestRequestSave);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(restResponse, CheckBox.IsCheckedProperty, mActREST, ActREST.Fields.RestResponseSave);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(templateFileRadioBtn, RadioButton.IsCheckedProperty, mActREST, ActREST.Fields.UseRequestBody);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(freeBodyRadioBtn, RadioButton.IsCheckedProperty, mActREST, ActREST.Fields.UseTemplateFile);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(RestFailActionOnBadRespose, CheckBox.IsCheckedProperty, mActREST, ActREST.Fields.DoNotFailActionOnBadRespose);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(AcceptAllSSLCertificate, CheckBox.IsCheckedProperty, mActREST, ActREST.Fields.AcceptAllSSLCertificate);

            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xUseLegacyJSONParsingCheckBox, CheckBox.IsCheckedProperty, mActREST, ActREST.Fields.UseLegacyJSONParsing);

            SetDynamicGrid();

            DynamicElementsGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddDynamicXMLelement));

            SetHeadersGrid();
            HttpHeadersGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddHttpHeader));
        }