I have started a new Weblog for cataloging all the useful BSP Utility Classes.
/people/thomas.jung3/blog/2005/01/13/bsp-utility-classes
I encourage everyone to submit their favorite utility class, method, or even program that helps with BSP development. Even if I already have some entries for your favorite, perhaps you have a better explaination or example. I will collect and add all these entries to the weblog.
Hallo Thomas,
This weblog is very good. It is funny how these down to earth content can have such an impact. In principle, one just needs someone to show the road once, and this is what you did here!
Allow me one remark: cl_http_ext_webapp=>create_url_for_bsp_application is very old (ancient?). I would recommend using directly cl_bsp_runtime=>construct_bsp_url.
Then let me add CL_BSP_SERVER_SIDE_COOKIE. This is really an absolute bread-and-butter class for anyone considering to write high scalable applications (always stateless and leave everything in the server).
And then, for those that can not help themselves, and insist on generating their own BSP applications: CL_BSP_API_GENERATE.
There are times that people would like to get stuff in and out of the MIME repository. Here a colleague wrote an excellent API (after one has tried to mess with LOIOs!): IF_MR_API and CL_MIME_REPOSITORY_API (I can not remember if we did port this down onto 640).
My personal favourite is CL_HTTP_EXT_BASE_HANDLER. This is the place where rubber meets the road and your first web service is done in 15 minutes. This is a base class that I use often to quickly write test programs with. See also: <a href="/people/brian.mckellar/blog/2003/09/30/bsp-in-depth-writing-an-http-handler">BSP In-Depth: Writing an HTTP Handler</a>.
bye, brian
Hi Thomas,
first of all: great weblog of yours. Looks like a good reference for coding BSPs... 😊
Some days ago I looked for a method which allows me to send emails from BSP pages. I stumbled across CL_WUI_UTIL an made a few tests with the method SEND_EMAIL. Unfortunately I was not able to continue on this and therefor I cannot provide any details about this method at the moment.
Anybody using the method of this class for sending emails?
Do you think this fits into your weblog? I thought about writing a weblog about sending mails from BSP in the future. Looking at my todo-list this 'future' is not likely to happen anytime soon...
Regards,
Alex
CL_BSP_MESSAGES
-- methods --
ADD_MESSAGE: insert a new message into the message list. If the message is already into the list is is overwritten.
ASSERT: this method returns the message index for a given condition - every message could have a condition.
ASSERT_MESSAGE: is has the same functionality that ASSERT but returns the MESSAGE instead of the message INDEX.
ASSERT_SEVERITY: is has the same functionality that ASSERT but returns the message SEVERITY instead of the message INDEX.
GET_MESSAGE: given the message index, returns the entire message information.
NUM_MESSAGES: returns the number of messages of the message list.
DELETE_MESSAGE: deletes a message from the message list. You must indicate the message condition.
RESET: deletes ALL messages from the message list.
MODIFY_MESSAGE: it allows to change a message.
MERGE: appends an instance of CL_BSP_MESSAGES into another instance of CL_BSP_MESSAGES.
-- Sample --
ADDING A MESSAGE
IF SY-SUBRC EQ 0.
page->messages->add_message(
condition = 'mtv'
message = 'File uploaded succesfully'
severity = page->messages->co_severity_info ).
ENDIF.
SHOWING A MESSAGE
<phtmlb:horizontalDivider hasRule="TRUE" separationHeight="MEDIUM" width="100%"/>
<%-- system messages --%>
<% IF page->messages->num_messages( ) NE 0. %>
<% DATA: text TYPE string,
messtyp TYPE i.
page->messages->get_message(
EXPORTING
INDEX = 1
IMPORTING
MESSAGE = text
SEVERITY = messtyp ).
%>
<htmlb:gridLayout rowSize="1" columnSize="1" cellSpacing="0" width="100%">
<htmlb:gridLayoutCell columnIndex="1" rowIndex="1" width="100%">
<% IF messtyp EQ page->messages->co_severity_error. %>
<phtmlb:messageBar id="errMessage" text="<%=text%>" type="ERROR"></phtmlb:messageBar>
<% ELSE. %>
<phtmlb:messageBar id="infoMessage" text="<%=text%>" type="OK"></phtmlb:messageBar>
<% ENDIF.%>
</htmlb:gridLayoutCell>
</htmlb:gridLayout>
<phtmlb:horizontalDivider hasRule="FALSE" separationHeight="SMALL" width="100%"/>
<% ENDIF. %>
Add a comment