[Laszlo-dev] for review, implementation of <data> literal XML initializer for datasets

Henry Minsky henry.minsky at gmail.com
Wed Aug 1 13:36:45 PDT 2007


On 8/1/07, P T Withington <ptw at openlaszlo.org> wrote:
> Questions:
>
> I'm not sure I like 'datafromchild'.  I'm wondering if we should have
> a dataset `type` which can be 'immediate' (legacy), 'local' (use
> <data> tag) or 'remote' (use src attribute)?

The current dataset behavior is to implicitly decide whether the data
is local or
remote based on

1) if there is a src attribute value,  and there is a "http:" prefix
in the string

2) type=http forces it to load data via http at runtime

So I guess we could add a new legal value for type="local", that would be back
compatible.

Also it seems like there would be some cases where the developer wants
a placeholder initial
data set, but then wants to let it get overwritten at runtime by data
fetched over
the network.  We don't support formally that right now, and maybe it
is too confusing, but
it seems useful.

<dataset name="mystuff" type="local">
   <data>
      <flavor>
          <flavor>vanilla</flavor>
        ...
    </data>
</dataset>

mystuff.setSrc("http:todaysmenu.xml");
mystuff.doRequest();

So the dataset would be loaded initially with a static dataset compiled in, and
then the developer can load it with fresh data at runtime.














>
> What are the 'dataset attributes' that a <data> tag can have?

name, src, and perhaps nsprefix and trimwhitespace are the ones I was
thinking of, but maybe that's overkill, perhaps <data> tags should
just be literal
data exactly as written in the source file. So in that case just
'name' attribute
would be supported.


>
> On 2007-07-31, at 12:08 EDT, Henry Minsky wrote:
>
> > Change 20070731-hqm-2 by hqm at IBM-2E06404CB67 on 2007-07-31 11:56:18
> > EDT
> >     in /cygdrive/c/users/hqm/openlaszlo/wafflecone
> >     for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
> >
> > Summary: add support for <data> xml literal data tag , for
> > initializing datasets
> >
> > New Features:
> >
> > Bugs Fixed:
> >
> > Technical Reviewer: ptw (pending)
> > QA Reviewer: (pending)
> > Doc Reviewer: (pending)
> >
> > Documentation:
> >
> > Release Notes:
> >
> > Details:
> >
> > Implements the spec in the LiteralDataProposal on the wiki
> >
> >
> > Tests:
> >
> > test/lfc/data/alldata.lzx
> > test/data/datatag-1.lzx
> >
> > Files:
> > M      test/lfc/data/dollarpath.lzx
> > M      WEB-INF/lps/schema/lzx.rnc
> > M      WEB-INF/lps/lfc/data/LzDataset.lzs
> > M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
> > M      WEB-INF/lps/server/src/org/openlaszlo/compiler/
> > DataCompiler.java
> > M      WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
> > A      test/data/datatag-1.lzx
> >
> >
> >
> > --
> > Henry Minsky
> > Software Architect
> > hminsky at laszlosystems.com
>
>


-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com


More information about the Laszlo-dev mailing list