    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.jigsaw.forms.FormResource

    java.lang.Object
       |
       +----w3c.tools.store.AttributeHolder
               |
               +----w3c.tools.store.Resource
                       |
                       +----w3c.jigsaw.resources.HTTPResource
                               |
                               +----w3c.jigsaw.resources.FilteredResource
                                       |
                                       +----w3c.jigsaw.resources.FileResource
                                               |
                                               +----w3c.jigsaw.forms.PostableResource
                                                       |
                                                       +----w3c.jigsaw.forms.FormResource

public class FormResource
extends PostableResource

This class implements a high level interface to forms. A FormResource is a resource made of form cards. Each card is made of a set of typed fields.

##

CACHE_CONTROL_NOCACHE
PRAGMA_NOCACHE
vcards

##

FormResource()
FormResource(ResourceContext, String)

##

defineCard(FormCardHandler, String, String)
  Define a new form card, with a specific handler.
dump(HtmlGenerator, FormCardResource)
  Dump this form content, the given card being selected.
dumpFooter(HtmlGenerator)
  Add some footer after the form dump.
dumpHeader(HtmlGenerator)
  Add some header before the form dumps itself.
get(Request)
  Get this form resource.
initialize(Object[])
  Setup the list of allowed methods.
lookup(LookupState, LookupResult)
  Lookup an sub resource.
removeFormCard(String)
  Remove a card from the form.
renameCard(String, String)

##

CACHE_CONTROL_NOCACHE

     protected static HttpCacheControl CACHE_CONTROL_NOCACHE

PRAGMA_NOCACHE

     protected static HttpTokenList PRAGMA_NOCACHE

vcards

     protected Vector vcards

##

FormResource

     public FormResource(ResourceContext context,
                         String url)

FormResource

     public FormResource()

##

lookup

     public boolean lookup(LookupState ls,
                           LookupResult lr) throws HTTPException

  Lookup an sub resource. Each form card makes its own resource, that's why the `lookup` method for this resource is special.

  Parameters:
    ls - The current lookup state.
  Returns:
    An HTTPResource matching the name to lookup, or null if none was found.
  Overrides:
    lookup in class FilteredResource

defineCard

     public FormCardResource defineCard(FormCardHandler handler,
                                        String name,
                                        String title)

  Define a new form card, with a specific handler.

  Parameters:
    handler - The handler for this specific card.
    name - The form card name.
    title - The form card title.

renameCard

     public void renameCard(String oldname,
                            String newname)

removeFormCard

     public void removeFormCard(String name)

  Remove a card from the form.

  Parameters:
    name - The name of the card to remove.

dumpHeader

     public void dumpHeader(HtmlGenerator into)

  Add some header before the form dumps itself.

  Parameters:
    into - The html generator to dump the header to.

dumpFooter

     public void dumpFooter(HtmlGenerator into)

  Add some footer after the form dump.

  Parameters:
    into - The html generator to dump the header to.

dump

     protected void dump(HtmlGenerator g,
                         FormCardResource selected)

  Dump this form content, the given card being selected.

  Parameters:
    card - The selected card.

get

     public Reply get(Request request) throws HTTPException

  Get this form resource. This defaults to get the first card for this resource.

  Parameters:
    request - The request to process.
  Throws: HTTPException
    If processing the request failed.
  Overrides:
    get in class PostableResource

initialize

     public void initialize(Object values[])

  Setup the list of allowed methods.

  Overrides:
    initialize in class PostableResource

    All Packages  Class Hierarchy  This Package  Previous  Next  Index