OpenObjects
See also: OpenObjects API
Return to Introduction  Previous page  Next page

OpenObjects are the "workhorses". This is where all of the actual work and screen output is performed. These are nothing more then strings comprised of a combination of OpenTokens and HTML (or, in the case of the email objects, ascii text).

Objects are created for store admin's to easily specify where in their store to include output from your modules. For example, to embed an object called CHKOUT_LINK in your store, the admin would just use:

%OBJ(CHKOUT_LINK)%  

To create your object(s) into the OpenUI, you can call OUI_Object_Create() function, for example:

<MvASSIGN NAME = "l.code"       VALUE = "{ 'CHKOUT_LINK' }">  
<MvASSIGN NAME = "l.module_id"  VALUE = "{ Modules.d.id }">  
<MvASSIGN NAME = "l.flags"      VALUE = "{ '' }">  
<MvASSIGN NAME = "l.object"     VALUE = "{ '%OUI%<A HREF=\"%VAR(g.secure_sessionurl)%Screen=%IF(NOTLOGIN)%LOGN&Order=1%ELSE%OINF%IFEND%\">Checkout</A>' }">  
<MvASSIGN NAME = "l.properties" VALUE = "{ '' }">  
<MvIF EXPR = "{ g.Merchant_Version LT '4.14' }">  
  <MvIF EXPR = "{ g.OUIX_Module_Version GE '4.907' }">  
    <MvDO FILE = "../ui/oui.mvc" NAME = "l.trash"  VALUE = "{ OUI_Object_Create(l.code, l.module_id, l.flags, l.object, l.properties) }">  
  </MvIF>  
<MvELSE>  
  <MvIF EXPR = "{ g.OUIX_Module_Version GE '4.907' }">  
    <MvDO FILE = "../ui/oui.mv" NAME = "l.trash"  VALUE = "{ OUI_Object_Create(l.code, l.module_id, l.flags, l.object, l.properties) }">  
  </MvIF>  
</MvIF>  

And you can delete your object(s) via the function call OUI_Object_Delete():

<MvIF EXPR = "{ g.Merchant_Version LT '4.14' }">  
  <MvIF EXPR = "{ g.OUIX_Module_Version GE '4.908' }">  
    <MvDO FILE = "../ui/oui.mvc" NAME = "l.trash"  VALUE = "{ OUI_Object_Delete(l.code) }">  
  </MvIF>  
<MvELSE>  
  <MvIF EXPR = "{ g.OUIX_Module_Version GE '4.908' }">  
    <MvDO FILE = "../ui/oui.mv" NAME = "l.trash"  VALUE = "{ OUI_Object_Delete(l.code) }">  
  </MvIF>  
</MvIF>  

 


Send feedback on this documentation.
© 2004 - 2000 Darren Ehlers & OpenUI Developer Consortium