diff --git a/documentation/current/community/index.wiki b/documentation/current/community/index.wiki index d1bb61e3..66e76bb5 100644 --- a/documentation/current/community/index.wiki +++ b/documentation/current/community/index.wiki @@ -18,5 +18,5 @@ Community input is welcome. If you are interested in improving and developing Ei To become a contributor, you should be proficient in Eiffel technology and have good written English skills. To become an editor, you should already be a contributor and have contributed significant improvements or additions to the documentation. -If you are interested in becoming a contributor, please send an email to info@eiffel.com with a short description of your Eiffel experience and any other relevant background. +If you are interested in becoming a contributor, please [http://doc.eiffel.com/contact contact us] or send an email to info@eiffel.com with a short description of your Eiffel experience and any other relevant background. diff --git a/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-implementation-layer.wiki b/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-implementation-layer.wiki index 7b6d5013..33169bb9 100644 --- a/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-implementation-layer.wiki +++ b/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-implementation-layer.wiki @@ -22,8 +22,8 @@ The HANDLE_USE class provides access to the unique HAND * Database status information: - status: DB_STATUS - -- Status of active database + status: DB_STATUS + -- Status of active database @@ -35,13 +35,13 @@ Every interface class inherits from the HANDLE_USE class and ca The creation procedure for a DB_CHANGE object is for instance: - make - -- Create an interface object to change active base. - do - implementation := handle.database.db_change - create ht.make (name_table_size) - implementation.set_ht (ht) - end + make + -- Create an interface object to change active base. + do + implementation := handle.database.db_change + create ht.make (name_table_size) + implementation.set_ht (ht) + end ==Access to the DBMS call interface== @@ -65,16 +65,18 @@ Let us give some details about the set_base feature: The corresponding code looks like: - session_status: DB_STATUS - -- A session management object reference. - ... - set_base - ... - update_handle - if session_status = Void then - create session_status.make - end - handle.set_status (session_status) + session_status: DB_STATUS + -- A session management object reference. + + ... + + set_base + ... + update_handle + if session_status = Void then + create session_status.make + end + handle.set_status (session_status) ... diff --git a/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/database-control.wiki b/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/database-control.wiki index 608a2b91..dff39620 100644 --- a/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/database-control.wiki +++ b/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/database-control.wiki @@ -23,13 +23,15 @@ Once you have handled your error, for instance by displaying the error_message o The following example sum up these capabilities: - session_control: DB_CONTROL - ... - session_control.connect - if session_control.is_connected then - -- Perform your transactions here. - session_control.disconnect - end + session_control: DB_CONTROL + + ... + + session_control.connect + if session_control.is_connected then + -- Perform your transactions here. + session_control.disconnect + end ==Committing changes in the database== @@ -40,19 +42,21 @@ With many database systems, modifications you make to the database are usually n The following example illustrates the use of these commands: - session_control: DB_CONTROL - ... - from - until - transaction_completed or else not session_control.is_ok - loop - -- Perform your transaction here. - end - if session_control.is_ok then - session_control.commit - else - session_control.rollback - end + session_control: DB_CONTROL + + ... + + from + until + transaction_completed or else not session_control.is_ok + loop + -- Perform your transaction here. + end + if session_control.is_ok then + session_control.commit + else + session_control.rollback + end The loop performs a multi-step transaction. If transaction is not carried out entirely, the database could stay in an invalid state: this code ensures that database remains in a valid state. diff --git a/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/query-variables.wiki b/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/query-variables.wiki index cc80ad25..da9d8559 100644 --- a/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/query-variables.wiki +++ b/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/query-variables.wiki @@ -15,11 +15,13 @@ Template queries are parsed to replace each variable by its bound value. To crea Variables syntax is simple: the ':' special character followed by the variable name. - selection: DB_SELECTION - Bind_var: STRING = "firstname" - ... - create selection.make - selection.set_query ("Select * from CONTACTS where Firstname = ':" + Bind_var + "'") + selection: DB_SELECTION + Bind_var: STRING = "firstname" + + ... + + create selection.make + selection.set_query ("Select * from CONTACTS where Firstname = ':" + Bind_var + "'") {{note|The code example shows how to bind variables to a [[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] object but the mechanism is exactly the same for [[ref:/libraries/store/reference/db_change_chart|DB_CHANGE]] objects. }} @@ -28,16 +30,18 @@ Variables syntax is simple: the ':' special character followed by the variable n Once you have created your query, you can map variable names to values and execute the query: - selection: DB_SELECTION - Bind_var: STRING is "firstname" - ... - loop - io.read_line - selection.set_map_name (io.laststring, Bind_var) - selection.execute_query - ... - selection.unset_map_name (Bind_var) - end + selection: DB_SELECTION + Bind_var: STRING is "firstname" + + ... + + loop + io.read_line + selection.set_map_name (io.laststring, Bind_var) + selection.execute_query + ... + selection.unset_map_name (Bind_var) + end {{seealso|
diff --git a/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/stored-procedures.wiki b/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/stored-procedures.wiki index 41fc5a06..4daf06c1 100644 --- a/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/stored-procedures.wiki +++ b/documentation/current/solutions/database-access/eiffelstore/eiffelstore-tutorial/eiffelstore-interface-layer/stored-procedures.wiki @@ -12,13 +12,15 @@ EiffelStore lets you use stored procedures with [[ref:/libraries/store/reference To execute a stored procedure: * Create a [[ref:/libraries/store/reference/db_proc_flatshort|DB_PROC]] object and load the stored procedure you want to use: - procedure: DB_PROC - ... - create procedure.make ("UPDATE") - procedure.load - if procedure.exists then - ... - end + procedure: DB_PROC + + ... + + create procedure.make ("UPDATE") + procedure.load + if procedure.exists then + ... + end * Execute the procedure through a [[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] (if a result is expected) or a [[ref:/libraries/store/reference/db_change_chart|DB_CHANGE ]] object (otherwise). @@ -33,11 +35,13 @@ You can execute your request mostly like a basic one: ** Execute the query through the DB_PROC object. - procedure: DB_PROC - expr: DB_CHANGE - ... - procedure.execute (expr) - expr.clear_all + procedure: DB_PROC + expr: DB_CHANGE + + ... + + procedure.execute (expr) + expr.clear_all ** Check for errors and load result if any. @@ -50,19 +54,20 @@ DB_PROC also enables you to create or drop stored procedures: * Use drop to delete one. The following example shows how to overwrite a procedure in the database: - procedure: DB_PROC + procedure: DB_PROC - ... - create procedure.make ("NEW_PROCEDURE") - procedure.load - if procedure.exists then - procedure.drop - end - procedure.load - if not procedure.exists then - procedure.set_arguments (<<"one_arg">>, <<"">>) - procedure.store ("update contacts set firstname = one_arg where contactid = 1") - end + ... + + create procedure.make ("NEW_PROCEDURE") + procedure.load + if procedure.exists then + procedure.drop + end + procedure.load + if not procedure.exists then + procedure.set_arguments (<<"one_arg">>, <<"">>) + procedure.store ("update contacts set firstname = one_arg where contactid = 1") + end diff --git a/documentation/current/solutions/web-technology/eiffelweb/eiffelweb-tutorial/index.wiki b/documentation/current/solutions/web-technology/eiffelweb/eiffelweb-tutorial/index.wiki index deeca036..043ed065 100644 --- a/documentation/current/solutions/web-technology/eiffelweb/eiffelweb-tutorial/index.wiki +++ b/documentation/current/solutions/web-technology/eiffelweb/eiffelweb-tutorial/index.wiki @@ -2,6 +2,8 @@ [[Property:weight|0]] [[Property:uuid|e2b93aea-ec1b-5897-0b0a-adc5681a1dcb]] The Common Gateway Interface (CGI) emerged as the first way to present dynamically generated information on the World Wide Web. It allows the computer to process forms filled by the user and return appropriate information.
+ EiffelWeb was developed by Interactive Software Engineering to provide Eiffel developers access to the CGI technology. The library makes it possible to write Eiffel systems that interact directly with the WEB. + diff --git a/documentation/current/solutions/web-technology/eiffelweb/eiffelweb-tutorial/processing-requests.wiki b/documentation/current/solutions/web-technology/eiffelweb/eiffelweb-tutorial/processing-requests.wiki index 020840e1..08eaf37b 100644 --- a/documentation/current/solutions/web-technology/eiffelweb/eiffelweb-tutorial/processing-requests.wiki +++ b/documentation/current/solutions/web-technology/eiffelweb/eiffelweb-tutorial/processing-requests.wiki @@ -17,19 +17,19 @@ These variables are usually used for the following purposes: ===Accessing Input Values=== -The browser sends in the ''In'' a stream containing the data relative to the user entry and selection at the applications starts. EiffelWeb stores each data element and its associated name within a Hash-Table, the feature form_data of class CGI_INTERFACE. You can access their values from your code with the interface defined in class CGI_FORMS, which allows you to retrieve text entries, to know whether a button was pressed or not, etc. +The browser sends in the ''In'' a stream containing the data relative to the user entry and selection at the applications starts. EiffelWeb stores each data element and its associated name within a Hash-Table, the feature form_data of class CGI_INTERFACE. You can access their values from your code with the interface defined in class CGI_FORMS, which allows you to retrieve text entries, to know whether a button was pressed or not, etc. ===Sending answers to the browser=== -The response has to contain an HTTP header in order to be understood by the browser. Depending on the nature of the reply, an HTML page, a simple re-direction, an error notification, you will select different features and options. Your application must send at least a response header, indicating the status of the request if known. You may want to attach to it the text you wish to send back to the user. This text is usually written in HTML, so that it will display nicely on the user's browser; you can use for this purpose the class HTML_PAGE. You may then send the header followed by your text using the features send_to_browser of classes CGI_RESPONSE_HEADER and HTML_PAGE. +The response has to contain an HTTP header in order to be understood by the browser. Depending on the nature of the reply, an HTML page, a simple re-direction, an error notification, you will select different features and options. Your application must send at least a response header, indicating the status of the request if known. You may want to attach to it the text you wish to send back to the user. This text is usually written in HTML, so that it will display nicely on the user's browser; you can use for this purpose the class HTML_PAGE. You may then send the header followed by your text using the features send_to_browser of classes CGI_RESPONSE_HEADER and HTML_PAGE. {{note|You may not write into a file before you have sent the answer to the browser. }} ===Dealing with Cookies=== -You can access the cookies corresponding to a specific URL/domain thanks to the feature cookies, of class CGI_ENVIRONMENT. It is a hash-table, in which all the data with associated names as keys are stored. +You can access the cookies corresponding to a specific URL/domain thanks to the feature cookies, of class CGI_ENVIRONMENT. It is a hash-table, in which all the data with associated names as keys are stored. -To store a cookie on a machine, you can use the feature set_cookies, of class CGI_RESPONSE_HEADER. +To store a cookie on a machine, you can use the feature set_cookies, of class CGI_RESPONSE_HEADER. ==Advanced Topics== @@ -38,16 +38,16 @@ To store a cookie on a machine, you can use the feature set_cookies, of class CG The information the server sends back may be confidential. Follow these steps to protect the page content: # Create an HTML page, for example by using class HTML_PAGE. # Store this page somewhere, with a random name. -# Create an instance of class CGI_RESPONSE_HEADER and choose the secure redirect option. Then call send_to_browser. +# Create an instance of class CGI_RESPONSE_HEADER and choose the secure redirect option. Then call send_to_browser. ===Complex Headers=== -The Eiffel-Web application has the possibility to send a selection of different HTTP headers. They can be found in class CGI_RESPONSE_HEADER. In particular, it is advised to generate a status for each request, the value of the most common ones may be found in class CGI_ [[ref:/libraries/web/reference/cgi_common_status_types_chart|COMMON_STATUS_TYPE]] . +The Eiffel-Web application has the possibility to send a selection of different HTTP headers. They can be found in class CGI_RESPONSE_HEADER. In particular, it is advised to generate a status for each request, the value of the most common ones may be found in class [[ref:/libraries/web/reference/cgi_common_status_types_chart|CGI_COMMON_STATUS_TYPES]] . ===Debugging facilities=== Design by Contract is one of the greatest strengths of the Eiffel language. When you usually run your application from EiffelStudio, you are notified when an assertion is violated and the tool offers different options in order to be able to find out its sources (feature and class tools, object inspectors, etc). However this cannot be applied to an EiffelWeb application, since it has to be run on the server.
-Therefore, EiffelWeb provides its own facilities for debugging. To test your classes at run-time, all you need to do is to set the Boolean feature is_debug_mode to True in your root class (which should inherit from CGI_INTERFACE). When your application crashes (because of an assertion ora bug), the exception trace will be displayed on the screen. +Therefore, EiffelWeb provides its own facilities for debugging. To test your classes at run-time, all you need to do is to set the Boolean feature is_debug_mode to True in your root class (which should inherit from CGI_INTERFACE). When your application crashes (because of an assertion or a bug), the exception trace will be displayed on the screen.