[EMAIL PROTECTED] wrote:

> Okay, so here's an initial thought on the DynamicURI problem.
> What if you add a ContextTool to WebMacro. They are
> easy to configure via the property file. With the context
> tool you can access it via $dynamic.setScreen("Blah") etc...
> 
> Here's what it'll look like:
> 
> public class DynamicURITool implements ContextTool
> {
>    public Object init(Context context)
>       throws InvalidContextException
>    {
>       try {
>          WebContext wc = (WebContext) context;
>          DynamicURI uri = new DynamicURI(wc.get("data"));
>          return uri;
>       } catch (ClassCastException ce) {
>          throw new InvalidContextException(
>                "Something meaningful here: " + ce);
>       }
>    }
> }
> 

Adding on to the DynamicURITool above, we could have *one* Screen
in Turbine that ONLY handles generic links between WM pages.

It would get the page to call from the DynamicURI tool set in the 
WM page.

So, in your WM page you would have something like this:

<a
href="$Dynamicuri.setScreen("GetWMPageScreen").addPathInfo("page","apage.wm").toString()">...

The GetWMPageScreen kinda looks like this...

public class GetWMPageScreen extends BaseWebMacroScreen
{
   
   public ConcreteElement build(RunData data)
   {
     String nextpage = data.getParameters().getString("page");
   
     WMContext context = getContext(data);
        
     String results = handleTemplate(context,nextpage);
        
     data.getPage().getBody().addElement(results);

        
     return null;       
  }     
}
   

Thoughts?

-- 
Dave
[EMAIL PROTECTED]
your flame > /dev/null


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to