Re: Macros in WO
Re: Macros in WO
- Subject: Re: Macros in WO
- From: "Matthew W. Taylor" <email@hidden>
- Date: Thu, 08 May 2008 19:32:31 -0500
- Thread-topic: Macros in WO
Hugi,
We use our own markup system, Magex, for instructors to be able to design
their own online grammar exercises. The markup is layered on top of and is
complementary to HTML markup so that ordinary humans can edit documents in
Dreamweaver (or GoLive), save, upload, preview, and publish for students to
use.
An example exercise (as typed by the instructor) would be:
I [went|go|ate|1] to the store yesterday.
Meaning: multiple-choice popup menu exercise, with correct answer being item
#1.
To process the markup, we use a custom string processing engine that builds
on a half-dozen string processing libraries, including JFlex.
Where the markup is used in any WOComponent, I add a <webobject> of type
WOMagex, which is a WODynamicElement that contains the macro engine to
transform the custom markup (which is supplied to the dynamic element as a
binding) into either a String, or the appropriate embeddable HTML, which is
then added to the response via the WODynamicElement's appendToResponse()
method.
I don't see anything wrong with this method for highly custom applications
where the macros are different from conventional WO tags for conventional WO
elements, or if it's not pre-processing that couldn't be done with OGNL, or
if for some reason you feel that either WO tags or OGNL notations are beyond
your users' capabilities.
For example, if I had a "fill-in-the-blank" WebObject, I could have
conceivably asked users to type (for the example above):
I <wo:MagexPopUpMenu answer1="went" answer2="go" answer3="ate"
correctAnswer="went" /> to the store yesterday.
You can see why I used another notation...
But if the kinds of things you want to do inline could be handled by
ordinary WebObjects with inline bindings and/or OGNL expressions, why not
standardize on such markup and use a response generated from
ERXInlineTemplate as your 'macro' processor?
-=- matt
Matthew Taylor
Multimedia Learning Center
Northwestern University
> From: Hugi fiór›arson <email@hidden>
> Date: Thu, 8 May 2008 17:48:36 +0000
> To: Development WebObjects <email@hidden>
> Subject: Macros in WO
>
> So, if you made it this far - then finally, here's the question:
> Anyone try to implement macros? And - if not, perhaps you harbor some
> ideas of using WO's awesome power instead of writing this all over
> again? Sounds simple, but I can't find any exposed API to do it
> simply...
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Macros in WO (From: Hugi Þórðarson <email@hidden>) |