[Laszlo-dev] Adding a class to LFC?

Cortlandt Winters cort at notebookmargins.com
Sun Jun 5 18:22:46 PDT 2005


Yes, I know. I'm just kidding. It's important to know how to edit them for
experimenting or prototyping new functionality, but that's all. I was just
kidding about the nightmare of minor clones.

Also, It would be a nightmare to have Oliver burdened with having to review
lots of silly extentions to the lfc. But if noone knows how to do it, there
won't be any experimental submissions, which wouldn't be great either.

I'm just grateful to be able to experiment properly with the whole system
now, I was feeling crippled by not being able to create a class at the lfc
level to prototype with.

Thanks again for the help, too.

-Cort

> -----Original Message-----
> From: laszlo-dev-bounces at openlaszlo.org
> [mailto:laszlo-dev-bounces at openlaszlo.org]On Behalf Of Henry Minsky
> Sent: Sunday, June 05, 2005 8:32 PM
> To: cort at notebookmargins.com
> Cc: OpenLaszlo development development
> Subject: Re: [Laszlo-dev] Adding a class to LFC?
>
>
> Oliver ( steele at laszlosystems.com)  is the keeper of the schema, and
> all that goes along with that high position of authority.
>
>
>
>
> On 6/5/05, Cortlandt Winters <cort at notebookmargins.com> wrote:
> > For PT, the adventuresome and trivia buffs of the future. I do want to
> > report that PT's advice did the trick.
> >
> > The details: There were two places where I found lzx.rnc, one
> in tools and
> > one in WEB-INF\lps\schema, I changed both. The change was tiny and
> > practically meaningless, like the whole example thus far. I just added
> > frogview as being like view,
> >
> > #
> > # View elements
> > #
> >
> > viewElement = (
> >
> >   element view {viewContent}
> >   |
> >   element frogview {viewContent}
> >   |
> >   element drawview {viewContent}
> >   |
> >
> > LasloInitiator.as was in WEB-INF\lps\lfc\glue and the change
> was similarly
> > simple.
> >
> > ConstructorMap = {
> >     animator: "LzAnimator" ,
> >         ...
> >     view:  "LzView",
> >     viewtemplate: "LzViewTemplate",
> >     frogview:"LzFrogView"
> > };
> >
> > in my lzx I was able to then use view syntax ok with a frogview
> > <frogview height="300" width="500">
> >         ... some viewcontent
> > </frogview>
> >
> > So now it seems we can do great damage to ourselves and others
> and create a
> > grand mess of laszlo clones with minor lfc differences, huzah!
> We'll need to
> > become familiar with relax ng compact in order to create more meaningful
> > tags, and I imagine there are some higher level rules of thumb
> for designing
> > lfc classes that work with the language features, but it is
> good to know.
> > When I get more familiar with the relaxng compact syntax and
> have created a
> > more meaningful example, I'll post this info to the wiki.
> >
> > Thank you for getting me over this hump!
> >
> > -Cort
> >
> > > -----Original Message-----
> > > From: laszlo-dev-bounces at openlaszlo.org
> > > [mailto:laszlo-dev-bounces at openlaszlo.org]On Behalf Of
> Cortlandt Winters
> > > Sent: Wednesday, June 01, 2005 7:51 AM
> > > To: P T Withington
> > > Cc: OpenLaszlo development development
> > > Subject: RE: [Laszlo-dev] Adding a class to LFC?
> > >
> > >
> > > Hi PT,
> > >
> > > Thank you for responding so quickly,
> > >
> > > Yes, I was going to be more specific than saying "without
> sucess" but I
> > > managed to muck up my source so that it fails for some other
> > > reason now and
> > > I need to start again with a fresh tree of source without all
> my noodling
> > > included.
> > >
> > > If my memory is correct when I tried to instantiate a frogview tag the
> > > compiler gave me a warning that the class didn't seem to
> exist and did I
> > > spell it corectly?
> > >
> > > Thank you for both of these additional steps, I'll try them both
> > > out. And I
> > > will take notes for the future and add to the wiki when I
> figure it out.
> > >
> > > Thanks again!
> > >
> > > -Cort
> > >
> > > > -----Original Message-----
> > > > From: P T Withington [mailto:ptw at pobox.com]
> > > > Sent: Wednesday, June 01, 2005 7:43 AM
> > > > To: cort at notebookmargins.com
> > > > Cc: OpenLaszlo development development
> > > > Subject: Re: [Laszlo-dev] Adding a class to LFC?
> > > >
> > > >
> > > > What do you mean by 'without success'?
> > > >
> > > > One thing you might have missed if you are trying to invoke
> the class
> > > > by <frogview> is the ConstructorMap in LaszloInitiator.as and the
> > > > fact that you have to add your new tag to the schema in lzx.rnc.
> > > > (For 'user' code, the mapping from tag to class is 1-1 and
> the schema
> > > > is extended automatically by the compiler.  It's on the wishlist for
> > > > this to be more uniform.)
> > > >
> > > > Hm, this should probably be written up on the Wiki.  Hope you're
> > > > taking notes :).
> > > >
> > > > On 1 Jun 2005, at 07:13, Cortlandt Winters wrote:
> > > >
> > > > > Hi Folk,
> > > > >
> > > > > I wonder if somebody could tell me what the steps are to compile a
> > > > > new LFC
> > > > > class?
> > > > >
> > > > > So by way of example, if I were to have a class like this one.
> > > > >
> > > > > /
> > > > >
> **********************************************************************
> > > > > *****
> > > > > ***
> > > > >  * FrogView.as
> > > > >
> > > > >
> **********************************************************************
> > > > > ******
> > > > > */
> > > > >
> > > > > //===================================================
> > > > > // DEFINE OBJECT: FrogView
> > > > > // View of a frog minded amphibian or an actual Frog
> > > > > //===================================================
> > > > > var LzFrogView = Class ( "LzFrogView" , LzView  );
> > > > >
> > > > > LzFrogView.prototype._viewconstruct = LzView.prototype.construct;
> > > > >
> > > > >
> //--------------------------------------------------------------------
> > > > > ------
> > > > > ---
> > > > > // @keywords private
> > > > >
> //--------------------------------------------------------------------
> > > > > ------
> > > > > ---
> > > > > LzFrogView.prototype.construct = function ( parent, args ) {
> > > > >     Debug.write("FrogView Being Constructed");
> > > > >         this._viewconstruct( parent , args );
> > > > > }
> > > > >
> > > > > and I wanted to add it to the LFC, how would I do it?
> > > > >
> > > > > Currently I've tried putting it in the following directory
> > > > >
> > > > > C:\lz3\lps-3.0-src\lps-3.0\WEB-INF\lps\lfc\views
> > > > >
> > > > > And by adding
> > > > > #include "views/LzFrogView.as"
> > > > >
> > > > > in the Library.as file in it's parent directory, but
> without success.
> > > > >
> > > > > Is there a minimal set of methods that a LFC object must implement
> > > > > or some
> > > > > other method of getting one compiled? I'm just guessing from
> > > > > looking at the
> > > > > directory structure and their contents that that might
> have worked.
> > > > >
> > > > > Any help would be greatly appreciated.
> > > > >
> > > > > Thanks!
> > > > >
> > > > > -Cort
> > > > >
> > > > > _______________________________________________
> > > > > Laszlo-dev mailing list
> > > > > Laszlo-dev at openlaszlo.org
> > > > > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
> > > > >
> > > > >
> > > >
> > >
> > > _______________________________________________
> > > Laszlo-dev mailing list
> > > Laszlo-dev at openlaszlo.org
> > > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
> >
> > _______________________________________________
> > Laszlo-dev mailing list
> > Laszlo-dev at openlaszlo.org
> > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
> >
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>
> _______________________________________________
> Laszlo-dev mailing list
> Laszlo-dev at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev



More information about the Laszlo-dev mailing list