mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-28 18:26:18 +08:00
Update zcl_my_handler_cloud.abap (#395)
* Update zcl_my_handler_cloud.abap * Update zcl_my_handler_onprem.abap * Update README.md * Update README.md * Update README.md * Update faq.md * Update faq.md * Update faq.md
This commit is contained in:
parent
a7a7729fcf
commit
19e03726b5
|
@ -44,7 +44,7 @@
|
|||
* Want to help out? see the contribution guidelines [(abap2UI5/contribution)](https://github.com/abap2UI5/abap2UI5/blob/main/CONTRIBUTING.md)
|
||||
|
||||
#### Apps & Extensions
|
||||
* Integrate your apps to the on-premise fiori laúnchpad [(abap2UI5/integration_fiori_launchpad)](https://github.com/abap2UI5/ext-integration_fiori_launchpad)
|
||||
* Integrate your apps in launchpads and other services [(abap2UI5/ext-service_integration)](https://github.com/abap2UI5/ext-service_integration)
|
||||
* Try out abap2UI5-tools, a useful collection of tools & apps [(abap2UI5/tools)](https://github.com/abap2UI5/app-tools)
|
||||
* Check out other projects using abap2UI5 [(abap2UI5/links)](https://github.com/abap2UI5/abap2UI5/blob/main/docs/links.md)
|
||||
* And finally: Don't forget to explore the [Demo Repository 🧭](https://github.com/abap2UI5/abap2UI5-demos)
|
||||
|
@ -79,6 +79,6 @@ METHOD if_http_service_extension~handle_request.
|
|||
ENDMETHOD.
|
||||
```
|
||||
#### FAQ
|
||||
* check out this [documentation](https://blogs.sap.com/2023/04/14/abap2ui5-6-7-installation-configuration-debugging/) for detailed installation guidelines<br>
|
||||
* want to configure the theme, bootstrapping, language and title? see [configuration & debugging](https://blogs.sap.com/2023/04/14/abap2ui5-6-7-installation-configuration-debugging/)
|
||||
* check out the [documentation](https://blogs.sap.com/2023/04/14/abap2ui5-6-7-installation-configuration-debugging/) for installation & configuration guidelines
|
||||
* still open questions? find an answer here [FAQ](https://github.com/abap2UI5/abap2UI5/blob/main/docs/faq.md)
|
||||
* as always - your comments, questions, wishes and bugs are welcome, please create an [issue](https://github.com/abap2UI5/abap2UI5/issues)
|
||||
|
|
16
docs/faq.md
16
docs/faq.md
|
@ -7,20 +7,22 @@ DATA(lv_search) = client->get( )-s_config-search.
|
|||
DATA(lv_param) = z2ui5_cl_xml_view=>factory( client )->hlp_get_url_param( `myparam` ).
|
||||
```
|
||||
#### **2. How to format numbers, times and dates?**
|
||||
Take a look to the following example:
|
||||
Take a look to the following example: <br>
|
||||
https://github.com/abap2UI5/demo-demos/blob/main/src/z2ui5_cl_app_demo_47.clas.abap
|
||||
<img width="500" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/6b9011b5-94e6-4329-9666-0e779c01b400">
|
||||
|
||||
#### **3. How to format the output of currencies?**
|
||||
Take a look to the following example:
|
||||
Take a look to the following example: <br>
|
||||
https://github.com/abap2UI5/demo-demos/blob/main/src/z2ui5_cl_app_demo_67.clas.abap
|
||||
<img width="500" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/fef6e08c-5a34-4aee-9d34-ebb1c5d45275">
|
||||
|
||||
## Productive Usage
|
||||
#### **1. Can abap2UI5 used in a productive system?**
|
||||
abap2UI5 is technically a HTTP handler and can be used like any other HTTP Service also in a productive system.
|
||||
#### **1. Are any preparations needed before using abap2UI5 in productiv scenario?
|
||||
|
||||
abap2UI5 is technically a HTTP handler and can be used like any other HTTP Service also in a productive system.
|
||||
Yes, the project is technically just an implementation of an HTTP handler and can be used like any other HTTP Service in a productive scenario.
|
||||
#### **2. Are there any dependencies or preparations needed before using abap2UI5 in a productiv scenario?**
|
||||
No, but it is recommended to follow these steps before using abap2UI5 apps in a productive scenario:
|
||||
1. Transport the abap2UI5 HTTP service and the framework first.
|
||||
2. Sometimes an extra activation of the HTTP service is needed, along with an adjustment of the UI5 bootstrapping.
|
||||
3. Test the "hello world" app to ensure that abap2UI5 works correctly.
|
||||
#### **3. Does a stable version of abap2UI5 exist?**
|
||||
The project will be continously further devleoped. Therefore there is now "stable" version, but adjustments to the public APIs will be reduced to a minimum to avoid refactoring of apps. Use the tags and only update from time to time when you use your apps also in production and want to reduce refactoring efforts.
|
||||
The project will be continuously further developed. Therefore, there is no specific "stable" version. However, adjustments to the public APIs will be kept to a minimum to avoid frequent refactoring of apps. You can use [releases](https://github.com/abap2ui5/abap2ui5/releases/) instead of the main branch and only update from time to time when you want to reduce refactoring efforts.
|
||||
|
|
|
@ -15,16 +15,13 @@ CLASS zcl_my_handler_cloud IMPLEMENTATION.
|
|||
|
||||
METHOD if_http_service_extension~handle_request.
|
||||
|
||||
DATA(lt_tab) = request->get_header_fields( ).
|
||||
|
||||
DATA(lv_resp) = SWITCH #( request->get_method( )
|
||||
DATA(lv_resp) = SWITCH #( server->request->get_method( )
|
||||
WHEN 'GET' THEN z2ui5_cl_http_handler=>http_get( )
|
||||
WHEN 'POST' THEN z2ui5_cl_http_handler=>http_post(
|
||||
body = request->get_text( )
|
||||
path_info = lt_tab[ name = `~path_info` ]-value ) ).
|
||||
WHEN 'POST' THEN z2ui5_cl_http_handler=>http_post( server->request->get_cdata( ) ) ).
|
||||
|
||||
response->set_header_field( i_name = 'cache-control' i_value = 'no-cache' ).
|
||||
response->set_status( 200 )->set_text( lv_resp ).
|
||||
server->response->set_header_field( name = `cache-control` value = `no-cache` ).
|
||||
server->response->set_cdata( lv_resp ).
|
||||
server->response->set_status( code = 200 reason = `success` ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
|
|
@ -14,18 +14,12 @@ CLASS zcl_my_handler_onprem IMPLEMENTATION.
|
|||
|
||||
METHOD if_http_extension~handle_request.
|
||||
|
||||
DATA lt_header TYPE tihttpnvp.
|
||||
server->request->get_header_fields( CHANGING fields = lt_header ).
|
||||
|
||||
DATA(lv_resp) = SWITCH #( server->request->get_method( )
|
||||
DATA(lv_resp) = SWITCH #( request->get_method( )
|
||||
WHEN 'GET' THEN z2ui5_cl_http_handler=>http_get( )
|
||||
WHEN 'POST' THEN z2ui5_cl_http_handler=>http_post(
|
||||
body = server->request->get_cdata( )
|
||||
path_info = lt_header[ name = `~path_info` ]-value ) ).
|
||||
WHEN 'POST' THEN z2ui5_cl_http_handler=>http_post( request->get_text( ) ) ).
|
||||
|
||||
server->response->set_header_field( name = `cache-control` value = `no-cache` ).
|
||||
server->response->set_cdata( lv_resp ).
|
||||
server->response->set_status( code = 200 reason = `success` ).
|
||||
response->set_status( 200 )->set_text( lv_resp
|
||||
)->set_header_field( i_name = `cache-control` i_value = `no-cache` ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user