Introduction
A web service is a software system designed to support inter operable machine-to-machine interaction over a network. In ClaySys AppForms you can connect to the web service to read/write data unless you have restrictions from the server to have the connectivity to the web service from the server. The purpose of this document is designed to be a reference for any person wishing to implement or any person interested in the architecture of the web service with the ClaySys AppForms.
Here we will be using a web service called ‘Currency Converter’, to get the conversion rate from one currency to another currency. The label will display the currency conversion rate of two countries from the two combo boxes. Also we can calculate the equivalent amount of money based on this conversion rate in the text boxes. If we select the currency codes of countries from the two combo boxes, two text boxes available in the right side of the page will be enabled. We can enter currency amount in one of the text box and the other will give the corresponding amount based on the conversion rate.
It is designed to guide development and design in ClaySys AppForms, including:
Creating the form
Form Design
Folders are used to store and organize forms that have a logical association or relationship. To create a new form click ‘New Folder’ button on the toolbar of the designer.
Data Source Configuration
Following steps will explain about the Data Source configuration of Combo Box.
When you upload the form, Web service DataSource will automatically be added to “DataSource settings”. Following steps will explain about how to create a new WebService DataSource.
Enter URL for the WebService. Example URL: http://www.webservicex.net/currencyconvertor.asmx?wsdl
Give the DataSource name and select the DataSource type as ‘Webservice’. Click ‘OK’ to continue.
DataSource configuration wizard with all the WebService datasource mapped will be populated. Select the ‘Currency Convertor’ DataSource from the available DataSources. Click ‘Next’ to continue.
Click ‘Add’ button to add the Select command. DataSource operation in webservice can be defined only for ‘Select’.
Select the DataSource object as ‘ConversionRate’. Click ‘Next’ to continue.
A sample SOAP request shows. Click ‘Next’ to continue.
Enter the control name for the selected DataSource object for XML request. In the request XML view, give the ‘FromCurrency’ as ‘cmbCountry1’ combobox and ‘ToCurrency’ as ‘cmbCountry2’ combobox .Click ‘Next’ to continue.
A sample SOAP response shows. Click ‘Next’ to continue.
In the response XML view, give the ‘ConversionRateResult’ as ‘txtConversionRateResult’ textbox. Click ‘Next’ to continue.
Data Source operation for ‘Select’ is now defined.
Once the Data source operation is defined, it is bound to a control or event that triggers its execution. It is given by ‘Add Trigger’ button. So that the corresponding Execute Command rules will be created with associated trigger.
We can add the trigger by clicking the check box corresponding to the control.
Click ‘Create Rule’ will automatically create the corresponding ExecuteCommand( ) rule for the select command associated with the trigger.
Click ‘Finish’ to save and close the data source configuration.
Rules
The rules section is the most powerful section in the AppForms. The rules can be configured using the Rules Engine. Following are the rules associated with the application.
The rule named ‘GetcurrencyConversionRate’ is basically the DataSource select operation of webservice. Based on the two conditions shown in the figure, the textbox controls can be enabled/disabled and the values of ‘ConversionRateResult’ are populated from the webservice also fills the values of ‘Equivalent amount’ label controls on comboboxes (‘cmbCountry1’ and ‘cmbCountry2’) trigger. This process is converted into concise, yet readily understood rule expression statements that represent the underlying execution logic of the form as shown in the figure.
The rule is named ‘CalculateToAmount’ gives an equivalent amount of money in ‘txtToAmount’, which is the multiplicative amount of ‘txtConversionRateResult’ and the ‘txtFromAmount’ on ‘txtFromAmount’ trigger.
The rule is named ‘CalculateFromAmount’ gives an equivalent amount of money in ‘txtFromAmount’ which is the divided amount of ‘txtToAmount’ and ‘txtConversionRateResult’ on ‘txtToAmount’ trigger.
Import Tenant
Following steps will explain about tenant import.
Open the ‘Backup and Restore’ option in AppForms in the destination site and click on the ‘import site’ tab.
Select the backup file we had saved from the source site.
Once the file is selected, click on the load button.
This will show you the different sites that were exported from the source site. If there are more than one site content saved, then you can map each site in backup file to different sites in the current site. Select the required site content that needs to be restored and select the destination site in the current site as shown below. Once we are done with the backup mapping, click on the next button to proceed with the import.
Now we will have to remap the sites we had used in the source website to the actual site in the target site. The dropdown will show you will the sites/sub sites to help you with the datasource mapping. Click ‘Next’ to continue.
Click ‘Import’ to continue.
This will import all the site content we had backed up from the source site and we are ready to work with the forms in the current site.
Forms can be embedded on any SharePoint page by using the ClaySys AppForms Web Part, to create a webpart page, follow these steps:
Click on Site Settings Wheel in the upper right corner of your site and then select “Site Contents Page”.
Select “Site Pages” or simply pages library on Site Contents Page.
Click on “New Wiki Page” to add new site page.
Give the New page name into the pop-up window and click ‘Create’ to add new page.
To add a new web part, click on the ‘Insert’ tab and then click on the ‘WebPart’ button. Then select Claysys -> Claysys HTML WebPart.
Click ‘Add’ button to add the Web Part.
Click on the ‘edit the Web part’ link to edit the page.
A new pop-up window appears and here we can configure the ClaySys AppForms by clicking on the ‘Configure’ button.
Pop-up appears with listed published forms. We can select the appropriate form by click on the form and add the form by clicking on the ‘Select’ button.
Once the configuration is finished, click on the ‘Apply’ button to see the changes. Click ‘OK’ to continue.
Click ‘Save’ button to save the changes.
2019-06-04 11:23:19