Hi everyone
I've been tagging along an idea of documenting algorythms of ofbiz
processes.

Since I started working with ofbiz, as always I found myself having to dig
into existing code
I found that the clearest way to understand how modules work is to rebuild
the algorithm behind a process .
A process could be a complete run through from url to controller to to
Service , run through the Service to result , to Screen ...etc.

by writting down the main elements of a process this draws quite a clear map
of the algorithm behind the process, and especially
is easily transmitable and readable by others. This also keeps from having
to run through all code , all processes which would be the next step after
reading the algo.

WDYT ?

I think it would be enourmously enrichining for people like myself wanting
to understand quickly what does what, and what is done behind the scenes.

Sometimes these algos quite large for processes like the chekout process
here's a sample I gathered up for the tellafriend process:
I list Service , Maps, redirections... a std format needs to be set up

Form : tellafriend
input : message, sendTo, sendFrom

controller event : org.ofbiz.product.product.ProductEvents"
invoke="tellAFriend"

dans le service tellafriend

[GenericEntity:ProductStoreEmailSetting]
[bccAddress,null()][bodyScreenLocation,null()][ccAddress,null()][contentType,null()][createdStamp,2006-04-21
15:06:47.428(java.sql.Timestamp)]
[createdTxStamp,2006-04-21 15:06:46.848(java.sql.Timestamp
)][emailType,PRDS_TELL_FRIEND(java.lang.String)]
[fromAddress,[EMAIL PROTECTED](java.lang.String)][lastUpdatedStamp,2006-04-21
15:06:47.428(java.sql.Timestamp)]
[lastUpdatedTxStamp,2006-04-21 15:06:46.848(java.sql.Timestamp
)][productStoreId,910(java.lang.String)]
[subject,${sendFrom} has sent you a link!(java.lang.String)]
[templatePath,/applications/petitbateau/templates/email/tellafriend.ftl(
java.lang.String)][xslfoAttachScreenLocation,null()]

{
templateData=
[
[EMAIL PROTECTED],
message=qgfgsdf gsdf gsdf gsdfg sdf,
[EMAIL PROTECTED],
pageUrl=http://localhost/petitbateau/control/product?product_id=94451
],

[EMAIL PROTECTED],
templateName=X:/X_Dev/sequoiaerp/applications/petitbateau/templates/email/tellafriend.ftl,

sendCc=null,
sendBcc=null,
[EMAIL PROTECTED] has sent you a link!,
[EMAIL PROTECTED],
contentType=null}

dispatcher.runAsync("sendGenericNotificationEmail", context);
org.ofbiz.content.email.NotificationServices"
invoke="sendNotification(DispatchContext ctx, Map context)
   >>>>method prepareNotification(ctx, context); //builds the body of the
mail by rendering the corresponding ftl
if body != null >>>>dispatcher.runSync("sendMail", emailContext);
org.ofbiz.content.email.EmailServices" invoke="sendMail"



Regards
Tibor

Reply via email to