• No se han encontrado resultados

3.7.2 5-1* Entradas digitales

If a particular e-journal requires AJAX login, the e-script must be manually edited before it can implement the login correctly. Simply recording the login procedure will not produce the desired result, because with AJAX, a Java script processes the response from the server and makes the required functions available on the web page. When a simple login is performed by HAN, the client- side JavaScript methods are not activated and the browser cannot provide the corresponding functions.

This chapter describes how to edit the e-script manually so that it can perform the AJAX login. The first step is to edit the script, and the next is to initiate a login on the client end using a Java script with dummy data, which data are then replaced by the HAN server when it processes the request. This technique ensures that the login data remain hidden. The procedure is as follows:

1.

In E-Script Administration, create a new e-script and begin the script recording process (then begin recording in the Script Editor).

3.

Optimize the script as needed. Make sure the login URL is the last URL in the script:

4.

Open the e-script properties by clicking on Properties in the ribbon.

6.

Under General login data, enter the login name and password:

7.

Click on OK to save the settings. The next step is to define the AJAX login. First, you need to know what type of identifier is used to address the HTML elements in the web page that save the login data and perform the login. To find out, examine the code in the web page. Open the login page by selecting the page's URL in the Script Editor and clicking on Browser in the ribbon:

Use a browser that has a developer view. This example uses Internet Explorer 9, but other browsers offer comparable functions. The browser you use must be set as the Windows default browser.

The analysis window shows that the input field is identified by both a name (name=username), and an ID (id=username). In the example, we select the id identifier.

Use the id field if possible, because the name identifier is frequently used for a range of different elements in web pages. HAN offers the option of defining two different name elements, but using the id identifier gives you the greatest possible flexibility.

10.

Open the e-script properties in the Script Editor, go to the Login page and select the GetElementByID option under User in the AJAX login data section. Enter the value determined previously for the id identifier; in this example, username:

11.

Determine the identifiers for the password input and the "send" button; in our example, these are Password and Submit, respectively. Enter these as above. In our example, the result is as follows:

The Submit button in our example does not have an ID, it has only the name identifier. So we select the getElementsByName[0] option under Submit.

12.

To define the page on which login takes place, enter the URL of the login page as a regular expression under Insert script in the following page (URL); in this example, http\://www \.reproductivemedicine\.com/login/login\.php:

The Include login script option defines whether the login script is sent only once, or each time the e-script is called. The with each call option is useful for testing purposes, but should not be active during regular operation. When this option is active, the login script is sent again every time the login screen reopens following a logout. The result is an endless login loop that makes it impossible to log out.

13.

The next step is to determine the name of the server to which the login is sent.

To ensure that the login data are not sent to just any server, the HAN server replaces the values only if the server name/domain name is identical to the server/domain name the of the e-script's root URL. If the names are not identical, enter the required URL in the Send login data to this domain field; again, as a regular expression.

Return to the browser and use the selection tool to select the "Submit" button. The code now shows the address to which the data are sent:

In our example, the only value for the action attribute is process_login.php, which means the data will be passed to the root server. No modification is needed here. If a specific URL with a non- matching server/domain name is shown here, enter that server/domain name in the Send login data to this domain field.

14.

Click on OK to save your settings in the e-script properties. Then click on Save in the ribbon of the Script Editor to save the entire e-script. From that point on, an AJAX login will be performed for this e-journal.

To test your e-script, click on Test in the ribbon of the Script Editor.