You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by James Mitchell <jm...@telocity.com> on 2002/06/03 20:24:09 UTC

Re: Configurable UI Design

I'm pulling this over to the Struts list from servlet interest.
Have you signed up for the struts-users list at apache yet?
It's a pretty high-volume list, so make your choice wisely ;-)

Either way, we should be able to finish this thread and anyone at
struts-users please give comments/insults accordingly (since I'm not
always 'the sharpest knife in the drawer' ;-)

A lot of people familiar with Struts and MVC as a whole would ask you 'why'
you would want to do this.

It sounds a little crazy to me, but I think it can be done.

I'm assuming that you are using some other means of 'remembering' your
users (db, ldap, whatever).  (if not then @see below)

** Inherent Problems:
(if you are depending on cookies to 'remember' your users)
  - users prefs are not remembered if they
      1. delete and/or disable cookie(s) (I mean this across sessions
        and not specifically within a session)
      2. use a different computer (e.g. home pc vs. work pc)
      3. use a different browser (IE, NS, Mozilla)

** Validation:
 I have no idea how you would handle your input validation,
 perhaps some kind of PageManager tag that wraps the jsp and knows how
 to handle the validation (or clue-in your action as to what to do)

 The Validator framework is.....well....just AWESOME if you've ever used it.
 I highly recommend *not* deviating from it if possible.

I have posted a few 'how-to's on wizards, so if I were given your
requirements, I would probably follow a similar approach.

My best guess is that this would need to be a highly customized solution,


**DISCLAIMER - I may be biting off more than I can chew.....but
               here goes...

** Reusing your jsp
If you structure your jsp properly, you can break up a "really long"
form into several pages (keep in mind the impact on validation)

I think Ted Husted might have given some info on this already
 (can't remember, I know, I'm an idiot)

For your question....I'm envisioning/dreaming of something like
this.........
(perhaps this could/should be packaged as a component/add-on specific
for jsp views of course)
* A jsp page manager (wizard) that:
    - can manage the state of the pages/wizard, (e.g. remember
      the 'page ? of ?')
      [the verbage could even come from the bundle/config file]
        wizards.version1.page1of.= You are viewing page {1} of {2}
        wizards.version2.page1of.= Page {0} of {1}.
        wizards.version3.page1of.= {0} of {1}

 - let's you specify that the user be able to configure the page layout
   and fields/views at runtime.

 - can figure out that if the user pushes the last input(s) to a page
   beyond the last one, it adjusts the "page ? of ?" accordingly.
   Also handles the inverse of that situation.

 - enforce the required fields/process flow for the fullfillment of
   the form (now that's a tongue twister, or as they say
   in AU...'teng twistah';) ...sorry, I have kids and we have
   the wiggles over here (US) too...LOL

 - auto-magically handles the previous-next-finish for you.

 - let's you i18n everything in the bundle(s) similar to what the
   validator header/footer requ'd

<pseudo-code reality="Don't shoot me if this seems stupid!!">

<html:form ......
  <optls:jspManager config="true" ....
 <optls:page1of/>

 <!-- beginning of dreaming-state-->
 if your form was 'flat', then it would be nice if you
 could use the DynaActionForm and be able to add a field to
 your application/wizard simply by adding it to the struts-config.xml
 and (optionally) the persistence layer (I have seen and worked with
 'dynamic db fields', done through the magic of a well designed RDBMS)
 [for those of you who know me, i'm talking about the concept of catalog
attributes]
 <!-- end of dreaming-state -->

 <!-- if you can't do the above, oh well... do this -->

 <!-- specify your fields here -->
 <optls:userConfigedFields>
  <html:text property="field1"/>
 </optls:userConfigedFields>

 <optls:userConfigedFields>
  <html:text property="field2"/>
 </optls:userConfigedFields>

 <optls:userConfigedFields>
  <html:text property="field3"/>
 </optls:userConfigedFields>


 <optls:page1of/>

    <optls:previous/><optls:next/><optls:finish/>
  </optls:jspManager
</html:form ......

</pseudo-code>


Best of luck!!

James Mitchell
Software Engineer/Struts Evangalist



----- Original Message -----
From: "Suresh Addagalla" <su...@wipro.com>
To: <jm...@telocity.com>
Cc: <SE...@JAVA.SUN.COM>
Sent: Monday, June 03, 2002 2:50 AM
Subject: RE: Configurable UI Design


>
> Thanks. I am familiarizing with the 'tiles' part of Struts, meanwhile a
> quick question.
>
> It seems like tiles can help me change personalize the layout of a
> single page. I have one more specific requirement. Let us say that my
> HTML form is distributed across 2 or 3 separate HTML pages, which are
> navigated using back, next buttons. I would like the end user to be able
> to personalise by specifying which components of the form are available
> on which page. For example, the user may want to move a not-so-important
> field for him from page 1 to page 3. Any ideas/design
> patterns/frameworks for this kind of a requirement?
>
> Suresh
>
>
>
> -----Original Message-----
> From: James Mitchell [mailto:jmitchtx@telocity.com]
> Sent: Friday, May 31, 2002 11:31 PM
> To: suresh.addagalla@wipro.com
> Subject: RE: Configurable UI Design
>
>
> There are several frameworks that do just what you want.  Struts and/or
> Cocoon from Apache.org
>
> Have you looked at either?  Specifically the 'tiles' component (struts)
> allows you to do this....
>
> http://www.open-tools.org/struts-tiles
> http://www.open-tools.org/tiles-channel
> http://www.open-tools.org/tiles-doc
> http://www.open-tools.org/tiles-template
>
> I am not the author of these, I just happen to have them running on my
> server at home...
>
> Here is the Struts homepage....
> http://jakarta.apache.org/struts/index.html
>
> and here is Cocoon.....
> http://xml.apache.org/cocoon/index.html
>
> Good Luck!
>
> James Mitchell
> Software Engineer\Struts Evangelist
>
>
> > -----Original Message-----
> > From: A mailing list for discussion about Sun Microsystem's
> Java Servlet
> > API Technology. [mailto:SERVLET-INTEREST@JAVA.SUN.COM]On Behalf Of
> > Suresh Addagalla
> > Sent: Friday, May 31, 2002 2:48 AM
> > To: SERVLET-INTEREST@JAVA.SUN.CO M
> > Subject: Configurable UI Design
> >
> >
> > Hi,
> >
> > I am looking for some resources/articles which discuss about
> building a
> > customizable/configurable UI. The basic framework is a web application
> > in servlets/JSP generating HTML based on the configuration of a
> > particular installation. Apart from providing customization
> with respect
> > to colours and fonts, I am looking at something more -- like
> customizing
> > the layout of pages, position of components on a page, hiding certain
> > components on a page, changing the labels on the page and
> buttons, etc.
> > -- while having little or no code changes for each installation.
> >
> > What is your opinion about generating XML data and using XSL
> to generate
> > different HTML pages? Does this involve a lot of work for each
> > installation?
> >
> > Thanks,
> > Suresh
> >
> >
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>