Loading ...
Sorry, an error occurred while loading the content.

.NET-style components and development

Expand Messages
  • John Drago
    Is anyone aware of work being done to duplicate ASP.NET in an Apache::ASP type of environment? There are several features of ASP.NET I would like to take
    Message 1 of 13 , Mar 10 8:05 AM
    • 0 Attachment
      Is anyone aware of work being done to duplicate ASP.NET in an
      Apache::ASP type of environment?
      There are several features of ASP.NET I would like to take advantage of,
      but I want to still use Apache and mod_perl.
      I haven't come across anything on various web searches, so I'm asking
      here.

      If there are others willing to get involved in the planning of such a
      task, I am willing to set aside some time to work on coding ASP.NET for
      Apache.

      Any takers?

      _______________________________________________________________

      John Drago | Chief Architect of Software Development
      E-com Media Group, Inc. [www.e-commedia.com]
      office
      ::
       303.790.7940 x25
      email
      ::
       jdrago@...



      E - b u s i n e s s   w i t h   D i m e n s i o n TM




      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... The only one that I know of is Mono, http://developer.ximian.com/projects/mono/ What features of ASP.NET did you want to use? Regards, Josh
      Message 2 of 13 , Mar 10 8:09 AM
      • 0 Attachment
        John Drago wrote:
        > Is anyone aware of work being done to duplicate ASP.NET in an
        > Apache::ASP type of environment?
        > There are several features of ASP.NET I would like to take advantage of,
        > but I want to still use Apache and mod_perl.
        > I haven't come across anything on various web searches, so I'm asking
        > here.
        >
        > If there are others willing to get involved in the planning of such a
        > task, I am willing to set aside some time to work on coding ASP.NET for
        > Apache.
        >
        > Any takers?
        >

        The only one that I know of is Mono, http://developer.ximian.com/projects/mono/

        What features of ASP.NET did you want to use?

        Regards,

        Josh

        ________________________________________________________________________
        Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
        Chamas Enterprises Inc. | NodeWorks Directory - http://dir.nodeworks.com
        http://www.chamas.com | Apache::ASP - http://www.apache-asp.org



        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • John Drago
        Hi, I m not too excited about Mono because I can t use perl with it :) (C# is a fine language, but I want to stick with perl.) What I want is simple enough to
        Message 3 of 13 , Mar 10 9:13 AM
        • 0 Attachment
          Hi,

          I'm not too excited about Mono because I can't use perl with it :) (C#
          is a fine language, but I want to stick with perl.)

          What I want is simple enough to explain (I think) so I'll give it a
          shot.

          Right now with XMLSubs, we can do the following:

          ---------------------------------------------------------------
          [asp.pm]
          package asp;

          sub listbox
          {
          my ($args, $html) = @_;
          print qq{<select id="$args->{id}">html</select>};
          }# end listbox()


          [listbox.asp]
          <asp:listbox id="list1">
          <option selected>Select One</option>
          <option value="1">Blue</option>
          <option value="2">Red</option>
          </asp:listbox>
          ---------------------------------------------------------------

          What I want to do would look something like so:
          ---------------------------------------------------------------
          [listbox.asp]

          <asp:listbox id="list1">
          <asp:listitem>Select One</asp:listitem>
          </asp:listbox>

          <%
          # Dynamically add items to the list before it's rendered:
          $Page->list1->Items->add(
          asp::listitem->new( Value => "1", Text => "Blue" ) );
          $Page->list1->Items->add(
          asp::listitem->new( Value => "2", Text => "Red" ) );

          # or, iterate through items within the listbox:
          foreach my $item ( $Page->list1->Items )
          {
          if( $item->Value == 1 )
          {
          $item->Text = "Blue [this is my favorite...isn't it yours?]";
          }# end if()
          }# end foreach()

          %>
          ---------------------------------------------------------------

          Something tells me that this isn't too far away from what we already
          have with Apache::ASP...that with some extra methods inherited from a
          package subclassed by asp::listbox and asp::listitem, it is 100%
          possible.

          I would need some help with where to bless the $Page object into the
          namespace the ASP pages are executed in.

          While I see great value in the current XMLSubs framework, I see this as
          the next logical step.

          There are some things about the ASP.NET model I don't like, and some I
          do.

          Apache::ASP does *almost* everything I want it to do, and this kind of
          extension would make it a lot more powerful in my opinion.


          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        • Josh Chamas
          ... If you set up a $List object in global.asa, it will be seen in includes and scripts, but not in the scope of the XMLSubs packages. So you might create it
          Message 4 of 13 , Mar 15 4:18 PM
          • 0 Attachment
            John Drago wrote:
            >
            > What I want to do would look something like so:
            > ---------------------------------------------------------------
            > [listbox.asp]
            >
            > <asp:listbox id="list1">
            > <asp:listitem>Select One</asp:listitem>
            > </asp:listbox>
            >
            > <%
            > # Dynamically add items to the list before it's rendered:
            > $Page->list1->Items->add(
            > asp::listitem->new( Value => "1", Text => "Blue" ) );
            > $Page->list1->Items->add(
            > asp::listitem->new( Value => "2", Text => "Red" ) );
            >
            > # or, iterate through items within the listbox:
            > foreach my $item ( $Page->list1->Items )
            > {
            > if( $item->Value == 1 )
            > {
            > $item->Text = "Blue [this is my favorite...isn't it yours?]";
            > }# end if()
            > }# end foreach()
            >
            > %>
            > ---------------------------------------------------------------
            >
            > Something tells me that this isn't too far away from what we already
            > have with Apache::ASP...that with some extra methods inherited from a
            > package subclassed by asp::listbox and asp::listitem, it is 100%
            > possible.
            >
            > I would need some help with where to bless the $Page object into the
            > namespace the ASP pages are executed in.
            >

            If you set up a $List object in global.asa, it will be seen in includes
            and scripts, but not in the scope of the XMLSubs packages. So you might
            create it in the main package to reference from like this:

            # global.asa
            use vars qw($List);
            sub Script_OnStart {
            $List = $main::List = List->new();
            }
            sub Script_OnEnd {
            $List->can('DESTROY') && $List->DESTROY;
            $List = $main::List = undef;
            }

            Then in the script, you can:

            <%
            $List->->add('list1',
            ListItem->new( Value => "1", Text => "Blue" )
            );
            %>

            And then you can:

            <asp:listbox id="list1">
            <asp:listitem>Select One</asp:listitem>
            </asp:listbox>

            And have XMLSubs defined to handle asp:listbox & asp:listitem properly,
            looking at the $main::List object.

            If you really want to build objects through code though, you might check
            out CGI.pm, which has plenty of methods for doing exactly this. Output
            from a CGI.pm object should be compatible with Apache::ASP.

            > Apache::ASP does *almost* everything I want it to do, and this kind of
            > extension would make it a lot more powerful in my opinion.

            What is the extension in particular that you are looking for?
            Is there something particular about <asp:listbox /> handling that you
            like in ASP.NET that you want implemented as is? Particularly what
            features of ASP.NET do you think should make it into Apache::ASP ?

            Regards,

            Josh

            ________________________________________________________________________
            Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
            Chamas Enterprises Inc. | NodeWorks Directory - http://dir.nodeworks.com
            http://www.chamas.com | Apache::ASP - http://www.apache-asp.org




            ---------------------------------------------------------------------
            To unsubscribe, e-mail: asp-unsubscribe@...
            For additional commands, e-mail: asp-help@...
          • John Drago
            If anyone is interested, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h tml/frlrfSystemWebUI.asp?frame=true is the msdn section
            Message 5 of 13 , Mar 17 8:13 AM
            • 0 Attachment
              If anyone is interested,
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUI.asp?frame=true is the msdn section dealing with the
              System.Web.UI namespace.

              My guess is that 80% of what's there is unnecessary to get the desired
              functionality. By chance or fate, 80% of what's there has no place in a
              perl implementation of similar functionality, because of the tools
              already available within perl.

              -------------------------------------------------------------------
              I figure we would need to emulate the functionality of: System.Web.UI
              (as a base class, and defining certain constants).

              o System.Web.UI.Control (base class, inherited by all default and
              custom controls).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUIControlClassTopic.asp?frame=true

              o System.Web.UI.ControlCollection (this functionality could be rolled
              into System.Web.UI.Control).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUIControlCollectionClassTopic.asp?frame=true

              o System.Web.UI.IPostBackDataHandler & IPostBackEventHandler
              (inheritable interface that allows controls to handle how their postback
              data is handled).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUIIPostBackDataHandlerClassTopic.asp?frame=true

              o System.Web.UI.Page (represents an .aspx file, and is used as a base
              class when creating a web forms class in codebehind mode).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUIPageClassTopic.asp?frame=true

              o System.Web.UI.PageParser (parses .aspx files).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUIPageParserClassTopic.asp?frame=true

              o System.Web.UI.TemplateBuilder (supports the PageParser in building a
              template and the child controls it contains).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUITemplateBuilderClassTopic.asp?frame=true

              o System.Web.UI.TemplateControl (inheritable base class. Provides the
              Page class and UserControl class a base set of functionality).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUITemplateControlClassTopic.asp?frame=true

              o System.Web.UI.UserControl (represents an .ascx file which implements
              and/or extends the TemplateControl class to produce some functionality
              or html).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUIUserControlClassTopic.asp?frame=true

              o System.Web.UI.UserControlControlBuilder (Does a recursive descent
              into the sub-controls contained within a UserControl, building them as
              it goes, so that UserControls can contain other controls inside them).
              http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
              tml/frlrfSystemWebUIUserControlControlBuilderClassTopic.asp?frame=true

              -------------------------------------------------------------------

              Let me make myself clear. I do not want to duplicate the entire ASP.NET
              thing in perl. I merely wish to skim the good stuff off the top and
              move along. In fact, there's more I dislike about ASP.NET than there is
              I *do* like about it. However, I recognize some things there that could
              save me loads of time on a large-scale project.

              Mason has some similar functionality with its *.mas components
              http://www.masonbook.com/book/chapter-1.mhtml#TOC-ANCHOR-3 but lacks the
              PostBack way of dealing with round-trip forms (as with server-side form
              validation). It also lacks the built-in ability to do things like
              append listitems to a <select> tag.

              _______________________________________________________________

              John Drago | Chief Architect of Software Development
              E-com Media Group, Inc. [www.e-commedia.com]
              office
              ::
               303.790.7940 x25
              email
              ::
               jdrago@...



              E - b u s i n e s s   w i t h   D i m e n s i o n TM


              | -----Original Message-----
              | From: Josh Chamas [mailto:josh@...]
              | Sent: Monday, March 15, 2004 5:19 PM
              | To: asp@...
              | Subject: Re: .NET-style components and development
              |
              | John Drago wrote:
              | >
              | > What I want to do would look something like so:
              | > ---------------------------------------------------------------
              | > [listbox.asp]
              | >
              | > <asp:listbox id="list1">
              | > <asp:listitem>Select One</asp:listitem>
              | > </asp:listbox>
              | >
              | > <%
              | > # Dynamically add items to the list before it's rendered:
              | > $Page->list1->Items->add(
              | > asp::listitem->new( Value => "1", Text => "Blue" ) );
              | > $Page->list1->Items->add(
              | > asp::listitem->new( Value => "2", Text => "Red" ) );
              | >
              | > # or, iterate through items within the listbox:
              | > foreach my $item ( $Page->list1->Items )
              | > {
              | > if( $item->Value == 1 )
              | > {
              | > $item->Text = "Blue [this is my favorite...isn't it yours?]";
              | > }# end if()
              | > }# end foreach()
              | >
              | > %>
              | > ---------------------------------------------------------------
              | >
              | > Something tells me that this isn't too far away from what we already

              | > have with Apache::ASP...that with some extra methods inherited from
              | > a package subclassed by asp::listbox and asp::listitem, it is 100%
              | > possible.
              | >
              | > I would need some help with where to bless the $Page object into the

              | > namespace the ASP pages are executed in.
              | >
              |
              | If you set up a $List object in global.asa, it will be seen in
              | includes and scripts, but not in the scope of the XMLSubs packages.
              | So you might create it in the main package to reference from like
              | this:
              |
              | # global.asa
              | use vars qw($List);
              | sub Script_OnStart {
              | $List = $main::List = List->new();
              | }
              | sub Script_OnEnd {
              | $List->can('DESTROY') && $List->DESTROY;
              | $List = $main::List = undef;
              | }
              |
              | Then in the script, you can:
              |
              | <%
              | $List->->add('list1',
              | ListItem->new( Value => "1", Text => "Blue" )
              | );
              | %>
              |
              | And then you can:
              |
              | <asp:listbox id="list1">
              | <asp:listitem>Select One</asp:listitem>
              | </asp:listbox>
              |
              | And have XMLSubs defined to handle asp:listbox & asp:listitem
              | properly, looking at the $main::List object.
              |
              | If you really want to build objects through code though, you might
              | check out CGI.pm, which has plenty of methods for doing exactly this.

              | Output from a CGI.pm object should be compatible with Apache::ASP.
              |
              | > Apache::ASP does *almost* everything I want it to do, and this kind
              | > of extension would make it a lot more powerful in my opinion.
              |
              | What is the extension in particular that you are looking for? Is there

              | something particular about <asp:listbox /> handling that you like in
              | ASP.NET that you want implemented as is? Particularly what features
              | of ASP.NET do you think should make it into Apache::ASP ?
              |
              | Regards,
              |
              | Josh
              |
              |
              ________________________________________________________________________
              | Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
              | Chamas Enterprises Inc. | NodeWorks Directory -
              http://dir.nodeworks.com
              | http://www.chamas.com | Apache::ASP - http://www.apache-asp.org
              |
              |
              |
              |
              | ---------------------------------------------------------------------
              | To unsubscribe, e-mail: asp-unsubscribe@...
              | For additional commands, e-mail: asp-help@...



              ---------------------------------------------------------------------
              To unsubscribe, e-mail: asp-unsubscribe@...
              For additional commands, e-mail: asp-help@...
            • Josh Chamas
              ... Sorry I have not gotten back to you on this yet. I wanted to give the .Net stuff a good read first before I started an informed discussion with you about
              Message 6 of 13 , Apr 8, 2004
              • 0 Attachment
                John Drago wrote:
                > If anyone is interested,
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUI.asp?frame=true is the msdn section dealing with the
                > System.Web.UI namespace.
                >
                > My guess is that 80% of what's there is unnecessary to get the desired
                > functionality. By chance or fate, 80% of what's there has no place in a
                > perl implementation of similar functionality, because of the tools
                > already available within perl.

                Sorry I have not gotten back to you on this yet. I wanted to give the
                .Net stuff a good read first before I started an informed discussion
                with you about this, which I still have not done :( . I would like to
                extend the Apache::ASP framework to be able to handle extensions that
                can fully replicate the .NET taglibs, and I understand that the XMLSubs
                falls well short of that. I am not sure about other aspects of the
                newer objects architecture, but there may be a place for those also.

                To help focus the discussion, it may be useful to know exactly what
                feature(s) would be useful for you to begin work on as a shorter term goal.
                It seemed like the dynamic list boxes was a place you wanted to start
                at, but more input here would be good.

                Regards,

                Josh

                >
                > -------------------------------------------------------------------
                > I figure we would need to emulate the functionality of: System.Web.UI
                > (as a base class, and defining certain constants).
                >
                > o System.Web.UI.Control (base class, inherited by all default and
                > custom controls).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUIControlClassTopic.asp?frame=true
                >
                > o System.Web.UI.ControlCollection (this functionality could be rolled
                > into System.Web.UI.Control).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUIControlCollectionClassTopic.asp?frame=true
                >
                > o System.Web.UI.IPostBackDataHandler & IPostBackEventHandler
                > (inheritable interface that allows controls to handle how their postback
                > data is handled).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUIIPostBackDataHandlerClassTopic.asp?frame=true
                >
                > o System.Web.UI.Page (represents an .aspx file, and is used as a base
                > class when creating a web forms class in codebehind mode).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUIPageClassTopic.asp?frame=true
                >
                > o System.Web.UI.PageParser (parses .aspx files).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUIPageParserClassTopic.asp?frame=true
                >
                > o System.Web.UI.TemplateBuilder (supports the PageParser in building a
                > template and the child controls it contains).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUITemplateBuilderClassTopic.asp?frame=true
                >
                > o System.Web.UI.TemplateControl (inheritable base class. Provides the
                > Page class and UserControl class a base set of functionality).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUITemplateControlClassTopic.asp?frame=true
                >
                > o System.Web.UI.UserControl (represents an .ascx file which implements
                > and/or extends the TemplateControl class to produce some functionality
                > or html).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUIUserControlClassTopic.asp?frame=true
                >
                > o System.Web.UI.UserControlControlBuilder (Does a recursive descent
                > into the sub-controls contained within a UserControl, building them as
                > it goes, so that UserControls can contain other controls inside them).
                > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                > tml/frlrfSystemWebUIUserControlControlBuilderClassTopic.asp?frame=true
                >
                > -------------------------------------------------------------------
                >
                > Let me make myself clear. I do not want to duplicate the entire ASP.NET
                > thing in perl. I merely wish to skim the good stuff off the top and
                > move along. In fact, there's more I dislike about ASP.NET than there is
                > I *do* like about it. However, I recognize some things there that could
                > save me loads of time on a large-scale project.
                >
                > Mason has some similar functionality with its *.mas components
                > http://www.masonbook.com/book/chapter-1.mhtml#TOC-ANCHOR-3 but lacks the
                > PostBack way of dealing with round-trip forms (as with server-side form
                > validation). It also lacks the built-in ability to do things like
                > append listitems to a <select> tag.
                >
                > _______________________________________________________________
                >
                > John Drago | Chief Architect of Software Development
                > E-com Media Group, Inc. [www.e-commedia.com]
                > office
                > ::
                > 303.790.7940 x25
                > email
                > ::
                > jdrago@...
                >
                >
                >
                > E - b u s i n e s s w i t h D i m e n s i o n TM
                >
                >
                > | -----Original Message-----
                > | From: Josh Chamas [mailto:josh@...]
                > | Sent: Monday, March 15, 2004 5:19 PM
                > | To: asp@...
                > | Subject: Re: .NET-style components and development
                > |
                > | John Drago wrote:
                > | >
                > | > What I want to do would look something like so:
                > | > ---------------------------------------------------------------
                > | > [listbox.asp]
                > | >
                > | > <asp:listbox id="list1">
                > | > <asp:listitem>Select One</asp:listitem>
                > | > </asp:listbox>
                > | >
                > | > <%
                > | > # Dynamically add items to the list before it's rendered:
                > | > $Page->list1->Items->add(
                > | > asp::listitem->new( Value => "1", Text => "Blue" ) );
                > | > $Page->list1->Items->add(
                > | > asp::listitem->new( Value => "2", Text => "Red" ) );
                > | >
                > | > # or, iterate through items within the listbox:
                > | > foreach my $item ( $Page->list1->Items )
                > | > {
                > | > if( $item->Value == 1 )
                > | > {
                > | > $item->Text = "Blue [this is my favorite...isn't it yours?]";
                > | > }# end if()
                > | > }# end foreach()
                > | >
                > | > %>
                > | > ---------------------------------------------------------------
                > | >
                > | > Something tells me that this isn't too far away from what we already
                >
                > | > have with Apache::ASP...that with some extra methods inherited from
                > | > a package subclassed by asp::listbox and asp::listitem, it is 100%
                > | > possible.
                > | >
                > | > I would need some help with where to bless the $Page object into the
                >
                > | > namespace the ASP pages are executed in.
                > | >
                > |
                > | If you set up a $List object in global.asa, it will be seen in
                > | includes and scripts, but not in the scope of the XMLSubs packages.
                > | So you might create it in the main package to reference from like
                > | this:
                > |
                > | # global.asa
                > | use vars qw($List);
                > | sub Script_OnStart {
                > | $List = $main::List = List->new();
                > | }
                > | sub Script_OnEnd {
                > | $List->can('DESTROY') && $List->DESTROY;
                > | $List = $main::List = undef;
                > | }
                > |
                > | Then in the script, you can:
                > |
                > | <%
                > | $List->->add('list1',
                > | ListItem->new( Value => "1", Text => "Blue" )
                > | );
                > | %>
                > |
                > | And then you can:
                > |
                > | <asp:listbox id="list1">
                > | <asp:listitem>Select One</asp:listitem>
                > | </asp:listbox>
                > |
                > | And have XMLSubs defined to handle asp:listbox & asp:listitem
                > | properly, looking at the $main::List object.
                > |
                > | If you really want to build objects through code though, you might
                > | check out CGI.pm, which has plenty of methods for doing exactly this.
                >
                > | Output from a CGI.pm object should be compatible with Apache::ASP.
                > |
                > | > Apache::ASP does *almost* everything I want it to do, and this kind
                > | > of extension would make it a lot more powerful in my opinion.
                > |
                > | What is the extension in particular that you are looking for? Is there
                >
                > | something particular about <asp:listbox /> handling that you like in
                > | ASP.NET that you want implemented as is? Particularly what features
                > | of ASP.NET do you think should make it into Apache::ASP ?
                > |
                > | Regards,
                > |
                > | Josh
                > |
                > |
                > ________________________________________________________________________
                > | Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
                > | Chamas Enterprises Inc. | NodeWorks Directory -
                > http://dir.nodeworks.com
                > | http://www.chamas.com | Apache::ASP - http://www.apache-asp.org
                > |
                > |
                > |
                > |
                > | ---------------------------------------------------------------------
                > | To unsubscribe, e-mail: asp-unsubscribe@...
                > | For additional commands, e-mail: asp-help@...
                >
                >
                >
                > ---------------------------------------------------------------------
                > To unsubscribe, e-mail: asp-unsubscribe@...
                > For additional commands, e-mail: asp-help@...
                >
                >



                ---------------------------------------------------------------------
                To unsubscribe, e-mail: asp-unsubscribe@...
                For additional commands, e-mail: asp-help@...
              • John Drago
                Hi Josh, In a nutshell, I want to be able to define a reusable component (*.ascx) and associate the display-layer of that component (*.ascx) with a package
                Message 7 of 13 , Apr 9, 2004
                • 0 Attachment
                  Hi Josh,

                  In a nutshell, I want to be able to define a reusable component (*.ascx)
                  and associate the display-layer of that component (*.ascx) with a
                  package (*.pm) that defines its function separately. This way I could
                  have a "Button" component that is used in 10 different places, and they
                  all do different things. This also allows for component inheritance
                  (BlueButton extends Button).

                  The second feature is to have the ability to reference instances of
                  these components from within the perl code, at runtime, and access
                  methods defined in their package (*.pm).

                  For instance:

                  [asp code]
                  <asp:label id="label1" runat="server" />
                  <%
                  $label1->{text} = "This would be nice!";
                  %>

                  [ Which outputs ]
                  <span id="label1">This would be nice!</span>

                  In the case of things like listboxes, they could expose their "items" as
                  a public array, or follow the asp.net way of using a public method to
                  adjust the items within an instance of the component.

                  [in package System::Web::UI::ListBox ]

                  use base qw/ System::Web::UI::Component /;
                  sub addItem
                  {
                  my ($s,$item) = @_;
                  push @{$s->{items}}, $item;
                  }# end addItem()

                  # This method overrides the same in System::Web::UI::Component:
                  sub renderComponent
                  {
                  my $s = shift;
                  my $str = q{<select name="$s->{id}" >\n};
                  $str .= "\t<option value="$_->{value}">$_->{text}</option>\n"
                  foreach @{$s->{items}};
                  $str .= q{</select>};
                  return $str;
                  }# end renderComponent()


                  Let me know if this is more clear.

                  Thanks!
                  John Drago


                  | -----Original Message-----
                  | From: Josh Chamas [mailto:josh@...]
                  | Sent: Thursday, April 08, 2004 11:02 PM
                  | To: John Drago
                  | Cc: asp@...
                  | Subject: Re: .NET-style components and development
                  |
                  | John Drago wrote:
                  | > If anyone is interested,
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUI.asp?frame=true is the msdn section dealing with
                  the
                  | > System.Web.UI namespace.
                  | >
                  | > My guess is that 80% of what's there is unnecessary to get the
                  desired
                  | > functionality. By chance or fate, 80% of what's there has no place
                  in a
                  | > perl implementation of similar functionality, because of the tools
                  | > already available within perl.
                  |
                  | Sorry I have not gotten back to you on this yet. I wanted to give the
                  | Net stuff a good read first before I started an informed discussion
                  | with you about this, which I still have not done :( . I would like to
                  | extend the Apache::ASP framework to be able to handle extensions that
                  | can fully replicate the .NET taglibs, and I understand that the
                  XMLSubs
                  | falls well short of that. I am not sure about other aspects of the
                  | newer objects architecture, but there may be a place for those also.
                  |
                  | To help focus the discussion, it may be useful to know exactly what
                  | feature(s) would be useful for you to begin work on as a shorter term
                  | goal.
                  | It seemed like the dynamic list boxes was a place you wanted to start
                  | at, but more input here would be good.
                  |
                  | Regards,
                  |
                  | Josh
                  |
                  | >
                  | > -------------------------------------------------------------------
                  | > I figure we would need to emulate the functionality of:
                  System.Web.UI
                  | > (as a base class, and defining certain constants).
                  | >
                  | > o System.Web.UI.Control (base class, inherited by all default and
                  | > custom controls).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUIControlClassTopic.asp?frame=true
                  | >
                  | > o System.Web.UI.ControlCollection (this functionality could be
                  rolled
                  | > into System.Web.UI.Control).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUIControlCollectionClassTopic.asp?frame=true
                  | >
                  | > o System.Web.UI.IPostBackDataHandler & IPostBackEventHandler
                  | > (inheritable interface that allows controls to handle how their
                  postback
                  | > data is handled).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUIIPostBackDataHandlerClassTopic.asp?frame=true
                  | >
                  | > o System.Web.UI.Page (represents an .aspx file, and is used as a
                  base
                  | > class when creating a web forms class in codebehind mode).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUIPageClassTopic.asp?frame=true
                  | >
                  | > o System.Web.UI.PageParser (parses .aspx files).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUIPageParserClassTopic.asp?frame=true
                  | >
                  | > o System.Web.UI.TemplateBuilder (supports the PageParser in
                  building a
                  | > template and the child controls it contains).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUITemplateBuilderClassTopic.asp?frame=true
                  | >
                  | > o System.Web.UI.TemplateControl (inheritable base class. Provides
                  the
                  | > Page class and UserControl class a base set of functionality).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUITemplateControlClassTopic.asp?frame=true
                  | >
                  | > o System.Web.UI.UserControl (represents an .ascx file which
                  implements
                  | > and/or extends the TemplateControl class to produce some
                  functionality
                  | > or html).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | > tml/frlrfSystemWebUIUserControlClassTopic.asp?frame=true
                  | >
                  | > o System.Web.UI.UserControlControlBuilder (Does a recursive descent
                  | > into the sub-controls contained within a UserControl, building them
                  as
                  | > it goes, so that UserControls can contain other controls inside
                  them).
                  | >
                  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                  | >
                  tml/frlrfSystemWebUIUserControlControlBuilderClassTopic.asp?frame=true
                  | >
                  | > -------------------------------------------------------------------
                  | >
                  | > Let me make myself clear. I do not want to duplicate the entire
                  ASP.NET
                  | > thing in perl. I merely wish to skim the good stuff off the top and
                  | > move along. In fact, there's more I dislike about ASP.NET than
                  there is
                  | > I *do* like about it. However, I recognize some things there that
                  could
                  | > save me loads of time on a large-scale project.
                  | >
                  | > Mason has some similar functionality with its *.mas components
                  | > http://www.masonbook.com/book/chapter-1.mhtml#TOC-ANCHOR-3 but lacks
                  the
                  | > PostBack way of dealing with round-trip forms (as with server-side
                  form
                  | > validation). It also lacks the built-in ability to do things like
                  | > append listitems to a <select> tag.
                  | >
                  | > _______________________________________________________________
                  | >
                  | > John Drago | Chief Architect of Software Development
                  | > E-com Media Group, Inc. [www.e-commedia.com]
                  | > office
                  | > ::
                  | > 303.790.7940 x25
                  | > email
                  | > ::
                  | > jdrago@...
                  | >
                  | >
                  | >
                  | > E - b u s i n e s s w i t h D i m e n s i o n TM
                  | >
                  | >
                  | > | -----Original Message-----
                  | > | From: Josh Chamas [mailto:josh@...]
                  | > | Sent: Monday, March 15, 2004 5:19 PM
                  | > | To: asp@...
                  | > | Subject: Re: .NET-style components and development
                  | > |
                  | > | John Drago wrote:
                  | > | >
                  | > | > What I want to do would look something like so:
                  | > | > ---------------------------------------------------------------
                  | > | > [listbox.asp]
                  | > | >
                  | > | > <asp:listbox id="list1">
                  | > | > <asp:listitem>Select One</asp:listitem>
                  | > | > </asp:listbox>
                  | > | >
                  | > | > <%
                  | > | > # Dynamically add items to the list before it's rendered:
                  | > | > $Page->list1->Items->add(
                  | > | > asp::listitem->new( Value => "1", Text => "Blue" ) );
                  | > | > $Page->list1->Items->add(
                  | > | > asp::listitem->new( Value => "2", Text => "Red" ) );
                  | > | >
                  | > | > # or, iterate through items within the listbox:
                  | > | > foreach my $item ( $Page->list1->Items )
                  | > | > {
                  | > | > if( $item->Value == 1 )
                  | > | > {
                  | > | > $item->Text = "Blue [this is my favorite...isn't it
                  yours?]";
                  | > | > }# end if()
                  | > | > }# end foreach()
                  | > | >
                  | > | > %>
                  | > | > ---------------------------------------------------------------
                  | > | >
                  | > | > Something tells me that this isn't too far away from what we
                  already
                  | >
                  | > | > have with Apache::ASP...that with some extra methods inherited
                  from
                  | > | > a package subclassed by asp::listbox and asp::listitem, it is
                  100%
                  | > | > possible.
                  | > | >
                  | > | > I would need some help with where to bless the $Page object into
                  the
                  | >
                  | > | > namespace the ASP pages are executed in.
                  | > | >
                  | > |
                  | > | If you set up a $List object in global.asa, it will be seen in
                  | > | includes and scripts, but not in the scope of the XMLSubs
                  packages.
                  | > | So you might create it in the main package to reference from like
                  | > | this:
                  | > |
                  | > | # global.asa
                  | > | use vars qw($List);
                  | > | sub Script_OnStart {
                  | > | $List = $main::List = List->new();
                  | > | }
                  | > | sub Script_OnEnd {
                  | > | $List->can('DESTROY') && $List->DESTROY;
                  | > | $List = $main::List = undef;
                  | > | }
                  | > |
                  | > | Then in the script, you can:
                  | > |
                  | > | <%
                  | > | $List->->add('list1',
                  | > | ListItem->new( Value => "1", Text => "Blue" )
                  | > | );
                  | > | %>
                  | > |
                  | > | And then you can:
                  | > |
                  | > | <asp:listbox id="list1">
                  | > | <asp:listitem>Select One</asp:listitem>
                  | > | </asp:listbox>
                  | > |
                  | > | And have XMLSubs defined to handle asp:listbox & asp:listitem
                  | > | properly, looking at the $main::List object.
                  | > |
                  | > | If you really want to build objects through code though, you might
                  | > | check out CGI.pm, which has plenty of methods for doing exactly
                  this.
                  | >
                  | > | Output from a CGI.pm object should be compatible with Apache::ASP.
                  | > |
                  | > | > Apache::ASP does *almost* everything I want it to do, and this
                  kind
                  | > | > of extension would make it a lot more powerful in my opinion.
                  | > |
                  | > | What is the extension in particular that you are looking for? Is
                  there
                  | >
                  | > | something particular about <asp:listbox /> handling that you like
                  in
                  | > | ASP.NET that you want implemented as is? Particularly what
                  features
                  | > | of ASP.NET do you think should make it into Apache::ASP ?
                  | > |
                  | > | Regards,
                  | > |
                  | > | Josh
                  | > |
                  | > |
                  | >
                  ________________________________________________________________________
                  | > | Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
                  | > | Chamas Enterprises Inc. | NodeWorks Directory -
                  | > http://dir.nodeworks.com
                  | > | http://www.chamas.com | Apache::ASP - http://www.apache-asp.org
                  | > |
                  | > |
                  | > |
                  | > |
                  | > |
                  ---------------------------------------------------------------------
                  | > | To unsubscribe, e-mail: asp-unsubscribe@...
                  | > | For additional commands, e-mail: asp-help@...
                  | >
                  | >
                  | >
                  | >
                  ---------------------------------------------------------------------
                  | > To unsubscribe, e-mail: asp-unsubscribe@...
                  | > For additional commands, e-mail: asp-help@...
                  | >
                  | >
                  |
                  |
                  |
                  | ---------------------------------------------------------------------
                  | To unsubscribe, e-mail: asp-unsubscribe@...
                  | For additional commands, e-mail: asp-help@...
                  |



                  ---------------------------------------------------------------------
                  To unsubscribe, e-mail: asp-unsubscribe@...
                  For additional commands, e-mail: asp-help@...
                • John Drago
                  Here s more. If I have a component BlueButton.ascx which extends Button.ascx, I should be able to do something like this within BlueButton.ascx: [inside
                  Message 8 of 13 , Apr 9, 2004
                  • 0 Attachment
                    Here's more.

                    If I have a component BlueButton.ascx which extends Button.ascx, I
                    should be able to do something like this within BlueButton.ascx:

                    [inside BlueButton.ascx]
                    <asp:Button id="$s->{id}" style="background-color: blue;" runat="server"
                    />
                    We could also have other components within *.ascx files. For instance:
                    <asp:Label id="theLabel" style="color: red;" runat="server" />
                    <% $theLabel->{text} = q{Here's some "Text" for "theLabel"}; %>

                    This page shows an example of this in ASP.NET:
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    tml/frlrfSystemWebUIUserControlClassTopic.asp?frame=true


                    Thanks,
                    John Drago


                    | -----Original Message-----
                    | From: Josh Chamas [mailto:josh@...]
                    | Sent: Thursday, April 08, 2004 11:02 PM
                    | To: John Drago
                    | Cc: asp@...
                    | Subject: Re: .NET-style components and development
                    |
                    | John Drago wrote:
                    | > If anyone is interested,
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUI.asp?frame=true is the msdn section dealing with
                    the
                    | > System.Web.UI namespace.
                    | >
                    | > My guess is that 80% of what's there is unnecessary to get the
                    desired
                    | > functionality. By chance or fate, 80% of what's there has no place
                    in a
                    | > perl implementation of similar functionality, because of the tools
                    | > already available within perl.
                    |
                    | Sorry I have not gotten back to you on this yet. I wanted to give the
                    | Net stuff a good read first before I started an informed discussion
                    | with you about this, which I still have not done :( . I would like to
                    | extend the Apache::ASP framework to be able to handle extensions that
                    | can fully replicate the .NET taglibs, and I understand that the
                    XMLSubs
                    | falls well short of that. I am not sure about other aspects of the
                    | newer objects architecture, but there may be a place for those also.
                    |
                    | To help focus the discussion, it may be useful to know exactly what
                    | feature(s) would be useful for you to begin work on as a shorter term
                    | goal.
                    | It seemed like the dynamic list boxes was a place you wanted to start
                    | at, but more input here would be good.
                    |
                    | Regards,
                    |
                    | Josh
                    |
                    | >
                    | > -------------------------------------------------------------------
                    | > I figure we would need to emulate the functionality of:
                    System.Web.UI
                    | > (as a base class, and defining certain constants).
                    | >
                    | > o System.Web.UI.Control (base class, inherited by all default and
                    | > custom controls).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUIControlClassTopic.asp?frame=true
                    | >
                    | > o System.Web.UI.ControlCollection (this functionality could be
                    rolled
                    | > into System.Web.UI.Control).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUIControlCollectionClassTopic.asp?frame=true
                    | >
                    | > o System.Web.UI.IPostBackDataHandler & IPostBackEventHandler
                    | > (inheritable interface that allows controls to handle how their
                    postback
                    | > data is handled).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUIIPostBackDataHandlerClassTopic.asp?frame=true
                    | >
                    | > o System.Web.UI.Page (represents an .aspx file, and is used as a
                    base
                    | > class when creating a web forms class in codebehind mode).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUIPageClassTopic.asp?frame=true
                    | >
                    | > o System.Web.UI.PageParser (parses .aspx files).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUIPageParserClassTopic.asp?frame=true
                    | >
                    | > o System.Web.UI.TemplateBuilder (supports the PageParser in
                    building a
                    | > template and the child controls it contains).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUITemplateBuilderClassTopic.asp?frame=true
                    | >
                    | > o System.Web.UI.TemplateControl (inheritable base class. Provides
                    the
                    | > Page class and UserControl class a base set of functionality).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUITemplateControlClassTopic.asp?frame=true
                    | >
                    | > o System.Web.UI.UserControl (represents an .ascx file which
                    implements
                    | > and/or extends the TemplateControl class to produce some
                    functionality
                    | > or html).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | > tml/frlrfSystemWebUIUserControlClassTopic.asp?frame=true
                    | >
                    | > o System.Web.UI.UserControlControlBuilder (Does a recursive descent
                    | > into the sub-controls contained within a UserControl, building them
                    as
                    | > it goes, so that UserControls can contain other controls inside
                    them).
                    | >
                    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                    | >
                    tml/frlrfSystemWebUIUserControlControlBuilderClassTopic.asp?frame=true
                    | >
                    | > -------------------------------------------------------------------
                    | >
                    | > Let me make myself clear. I do not want to duplicate the entire
                    ASP.NET
                    | > thing in perl. I merely wish to skim the good stuff off the top and
                    | > move along. In fact, there's more I dislike about ASP.NET than
                    there is
                    | > I *do* like about it. However, I recognize some things there that
                    could
                    | > save me loads of time on a large-scale project.
                    | >
                    | > Mason has some similar functionality with its *.mas components
                    | > http://www.masonbook.com/book/chapter-1.mhtml#TOC-ANCHOR-3 but lacks
                    the
                    | > PostBack way of dealing with round-trip forms (as with server-side
                    form
                    | > validation). It also lacks the built-in ability to do things like
                    | > append listitems to a <select> tag.
                    | >
                    | > _______________________________________________________________
                    | >
                    | > John Drago | Chief Architect of Software Development
                    | > E-com Media Group, Inc. [www.e-commedia.com]
                    | > office
                    | > ::
                    | > 303.790.7940 x25
                    | > email
                    | > ::
                    | > jdrago@...
                    | >
                    | >
                    | >
                    | > E - b u s i n e s s w i t h D i m e n s i o n TM
                    | >
                    | >
                    | > | -----Original Message-----
                    | > | From: Josh Chamas [mailto:josh@...]
                    | > | Sent: Monday, March 15, 2004 5:19 PM
                    | > | To: asp@...
                    | > | Subject: Re: .NET-style components and development
                    | > |
                    | > | John Drago wrote:
                    | > | >
                    | > | > What I want to do would look something like so:
                    | > | > ---------------------------------------------------------------
                    | > | > [listbox.asp]
                    | > | >
                    | > | > <asp:listbox id="list1">
                    | > | > <asp:listitem>Select One</asp:listitem>
                    | > | > </asp:listbox>
                    | > | >
                    | > | > <%
                    | > | > # Dynamically add items to the list before it's rendered:
                    | > | > $Page->list1->Items->add(
                    | > | > asp::listitem->new( Value => "1", Text => "Blue" ) );
                    | > | > $Page->list1->Items->add(
                    | > | > asp::listitem->new( Value => "2", Text => "Red" ) );
                    | > | >
                    | > | > # or, iterate through items within the listbox:
                    | > | > foreach my $item ( $Page->list1->Items )
                    | > | > {
                    | > | > if( $item->Value == 1 )
                    | > | > {
                    | > | > $item->Text = "Blue [this is my favorite...isn't it
                    yours?]";
                    | > | > }# end if()
                    | > | > }# end foreach()
                    | > | >
                    | > | > %>
                    | > | > ---------------------------------------------------------------
                    | > | >
                    | > | > Something tells me that this isn't too far away from what we
                    already
                    | >
                    | > | > have with Apache::ASP...that with some extra methods inherited
                    from
                    | > | > a package subclassed by asp::listbox and asp::listitem, it is
                    100%
                    | > | > possible.
                    | > | >
                    | > | > I would need some help with where to bless the $Page object into
                    the
                    | >
                    | > | > namespace the ASP pages are executed in.
                    | > | >
                    | > |
                    | > | If you set up a $List object in global.asa, it will be seen in
                    | > | includes and scripts, but not in the scope of the XMLSubs
                    packages.
                    | > | So you might create it in the main package to reference from like
                    | > | this:
                    | > |
                    | > | # global.asa
                    | > | use vars qw($List);
                    | > | sub Script_OnStart {
                    | > | $List = $main::List = List->new();
                    | > | }
                    | > | sub Script_OnEnd {
                    | > | $List->can('DESTROY') && $List->DESTROY;
                    | > | $List = $main::List = undef;
                    | > | }
                    | > |
                    | > | Then in the script, you can:
                    | > |
                    | > | <%
                    | > | $List->->add('list1',
                    | > | ListItem->new( Value => "1", Text => "Blue" )
                    | > | );
                    | > | %>
                    | > |
                    | > | And then you can:
                    | > |
                    | > | <asp:listbox id="list1">
                    | > | <asp:listitem>Select One</asp:listitem>
                    | > | </asp:listbox>
                    | > |
                    | > | And have XMLSubs defined to handle asp:listbox & asp:listitem
                    | > | properly, looking at the $main::List object.
                    | > |
                    | > | If you really want to build objects through code though, you might
                    | > | check out CGI.pm, which has plenty of methods for doing exactly
                    this.
                    | >
                    | > | Output from a CGI.pm object should be compatible with Apache::ASP.
                    | > |
                    | > | > Apache::ASP does *almost* everything I want it to do, and this
                    kind
                    | > | > of extension would make it a lot more powerful in my opinion.
                    | > |
                    | > | What is the extension in particular that you are looking for? Is
                    there
                    | >
                    | > | something particular about <asp:listbox /> handling that you like
                    in
                    | > | ASP.NET that you want implemented as is? Particularly what
                    features
                    | > | of ASP.NET do you think should make it into Apache::ASP ?
                    | > |
                    | > | Regards,
                    | > |
                    | > | Josh
                    | > |
                    | > |
                    | >
                    ________________________________________________________________________
                    | > | Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
                    | > | Chamas Enterprises Inc. | NodeWorks Directory -
                    | > http://dir.nodeworks.com
                    | > | http://www.chamas.com | Apache::ASP - http://www.apache-asp.org
                    | > |
                    | > |
                    | > |
                    | > |
                    | > |
                    ---------------------------------------------------------------------
                    | > | To unsubscribe, e-mail: asp-unsubscribe@...
                    | > | For additional commands, e-mail: asp-help@...
                    | >
                    | >
                    | >
                    | >
                    ---------------------------------------------------------------------
                    | > To unsubscribe, e-mail: asp-unsubscribe@...
                    | > For additional commands, e-mail: asp-help@...
                    | >
                    | >
                    |
                    |
                    |
                    | ---------------------------------------------------------------------
                    | To unsubscribe, e-mail: asp-unsubscribe@...
                    | For additional commands, e-mail: asp-help@...
                    |



                    ---------------------------------------------------------------------
                    To unsubscribe, e-mail: asp-unsubscribe@...
                    For additional commands, e-mail: asp-help@...
                  • Craig Dayton
                    Is anyone working on W3C xform implementation within Apache::ASP? Thanks, Craig ... To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org For additional
                    Message 9 of 13 , Apr 9, 2004
                    • 0 Attachment
                      Is anyone working on W3C xform implementation within Apache::ASP?

                      Thanks, Craig



                      ---------------------------------------------------------------------
                      To unsubscribe, e-mail: asp-unsubscribe@...
                      For additional commands, e-mail: asp-help@...
                    • Craig Dayton
                      Hi John, ... Xforms? Yes, basically. Ideally, it would be implementation similar to www.formsplayer.com and would play nicely with Apache2, mod_perl &
                      Message 10 of 13 , Apr 13, 2004
                      • 0 Attachment
                        Hi John,

                        >Are you looking for an object-oriented way to generate the XML to represent
                        Xforms?

                        Yes, basically. Ideally, it would be implementation similar to
                        www.formsplayer.com and would play nicely with Apache2, mod_perl &
                        Apache::ASP or any other Apache templating solution.

                        -Craig

                        -----Original Message-----
                        From: John Drago [mailto:jdrago@...]
                        Sent: Tuesday, April 13, 2004 07:34
                        To: 'Craig Dayton'; asp@...
                        Subject: RE: W3C xform specification


                        After looking into these examples
                        http://www.w3.org/MarkUp/Forms/2002/Examples/spec-examples/ and then hitting
                        CPAN and searching "Xform" I found this:
                        http://search.cpan.org/search?query=xform&mode=all . Still doesn't help
                        much, as it appears to be tied to X11::Xforms.

                        Are you looking for an object-oriented way to generate the XML to represent
                        Xforms?

                        _______________________________________________________________

                        John Drago | Chief Architect of Software Development
                        E-com Media Group, Inc. [www.e-commedia.com]
                        office
                        ::
                         303.790.7940 x25
                        email
                        ::
                         jdrago@...



                        E - b u s i n e s s   w i t h   D i m e n s i o n TM


                        | -----Original Message-----
                        | From: Craig Dayton [mailto:cadayton@...]
                        | Sent: Friday, April 09, 2004 7:02 PM
                        | To: asp@...
                        | Subject: W3C xform specification
                        |
                        | Is anyone working on W3C xform implementation within Apache::ASP?
                        |
                        | Thanks, Craig
                        |
                        |
                        |
                        | ---------------------------------------------------------------------
                        | To unsubscribe, e-mail: asp-unsubscribe@...
                        | For additional commands, e-mail: asp-help@...
                        |



                        ---------------------------------------------------------------------
                        To unsubscribe, e-mail: asp-unsubscribe@...
                        For additional commands, e-mail: asp-help@...
                      • John Drago
                        I have put together a rough, working example of a parser that could grow to support this ASP.NET-style development we ve been talking about. I can post what I
                        Message 11 of 13 , Apr 26, 2004
                        • 0 Attachment
                          I have put together a rough, working example of a parser that could grow
                          to support this ASP.NET-style development we've been talking about.

                          I can post what I have, but it's only about 50 lines and wouldn't help
                          anyone much. Another couple weeks of free time on this project should
                          yield more progress.

                          The parser I have written works for the following code.

                          ---- test.aspx -----
                          <%@ Register prefix="test" class="MyLibs::ASP::Test" %>
                          <html>
                          <head>
                          <title>Testing</title>
                          </head>
                          <body>
                          <test:header id="hd1" runat="server" arg1="foo" stuff="bar">
                          <test:hlink runat="server" id="bob">Click Me.</test:hlink>
                          </test:header>
                          </body>
                          </html>
                          ---- end test.aspx ----

                          Then, in MyLibs/ASP/Test.pm, I do this:

                          ---- MyLibs/ASP/Test.pm ----
                          package MyLibs::ASP::Test;
                          use strict;

                          #====================================================
                          sub header
                          {
                          my ($s, $args, $html) = @_;
                          qq{<span class="header" id="$args->{id}">$html</span>};
                          }# end header

                          #====================================================
                          sub hlink
                          {
                          my ($s, $args, $html) = @_;
                          return "<a href=\"" . $s->_link($args) . "\">$html</a>";
                          }# end hlink

                          #====================================================
                          sub _link
                          {
                          my ($s,$args) = @_;
                          # Do something special with $args, return a URI
                          }# end _link
                          ---- end MyLibs/ASP/Test.pm ----


                          | -----Original Message-----
                          | From: Josh Chamas [mailto:josh@...]
                          | Sent: Thursday, April 08, 2004 11:02 PM
                          | To: John Drago
                          | Cc: asp@...
                          | Subject: Re: .NET-style components and development
                          |
                          | John Drago wrote:
                          | > If anyone is interested,
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUI.asp?frame=true is the msdn section dealing with
                          the
                          | > System.Web.UI namespace.
                          | >
                          | > My guess is that 80% of what's there is unnecessary to get the
                          desired
                          | > functionality. By chance or fate, 80% of what's there has no place
                          in a
                          | > perl implementation of similar functionality, because of the tools
                          | > already available within perl.
                          |
                          | Sorry I have not gotten back to you on this yet. I wanted to give the
                          | Net stuff a good read first before I started an informed discussion
                          | with you about this, which I still have not done :( . I would like to
                          | extend the Apache::ASP framework to be able to handle extensions that
                          | can fully replicate the .NET taglibs, and I understand that the
                          XMLSubs
                          | falls well short of that. I am not sure about other aspects of the
                          | newer objects architecture, but there may be a place for those also.
                          |
                          | To help focus the discussion, it may be useful to know exactly what
                          | feature(s) would be useful for you to begin work on as a shorter term
                          | goal.
                          | It seemed like the dynamic list boxes was a place you wanted to start
                          | at, but more input here would be good.
                          |
                          | Regards,
                          |
                          | Josh
                          |
                          | >
                          | > -------------------------------------------------------------------
                          | > I figure we would need to emulate the functionality of:
                          System.Web.UI
                          | > (as a base class, and defining certain constants).
                          | >
                          | > o System.Web.UI.Control (base class, inherited by all default and
                          | > custom controls).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUIControlClassTopic.asp?frame=true
                          | >
                          | > o System.Web.UI.ControlCollection (this functionality could be
                          rolled
                          | > into System.Web.UI.Control).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUIControlCollectionClassTopic.asp?frame=true
                          | >
                          | > o System.Web.UI.IPostBackDataHandler & IPostBackEventHandler
                          | > (inheritable interface that allows controls to handle how their
                          postback
                          | > data is handled).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUIIPostBackDataHandlerClassTopic.asp?frame=true
                          | >
                          | > o System.Web.UI.Page (represents an .aspx file, and is used as a
                          base
                          | > class when creating a web forms class in codebehind mode).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUIPageClassTopic.asp?frame=true
                          | >
                          | > o System.Web.UI.PageParser (parses .aspx files).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUIPageParserClassTopic.asp?frame=true
                          | >
                          | > o System.Web.UI.TemplateBuilder (supports the PageParser in
                          building a
                          | > template and the child controls it contains).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUITemplateBuilderClassTopic.asp?frame=true
                          | >
                          | > o System.Web.UI.TemplateControl (inheritable base class. Provides
                          the
                          | > Page class and UserControl class a base set of functionality).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUITemplateControlClassTopic.asp?frame=true
                          | >
                          | > o System.Web.UI.UserControl (represents an .ascx file which
                          implements
                          | > and/or extends the TemplateControl class to produce some
                          functionality
                          | > or html).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | > tml/frlrfSystemWebUIUserControlClassTopic.asp?frame=true
                          | >
                          | > o System.Web.UI.UserControlControlBuilder (Does a recursive descent
                          | > into the sub-controls contained within a UserControl, building them
                          as
                          | > it goes, so that UserControls can contain other controls inside
                          them).
                          | >
                          http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
                          | >
                          tml/frlrfSystemWebUIUserControlControlBuilderClassTopic.asp?frame=true
                          | >
                          | > -------------------------------------------------------------------
                          | >
                          | > Let me make myself clear. I do not want to duplicate the entire
                          ASP.NET
                          | > thing in perl. I merely wish to skim the good stuff off the top and
                          | > move along. In fact, there's more I dislike about ASP.NET than
                          there is
                          | > I *do* like about it. However, I recognize some things there that
                          could
                          | > save me loads of time on a large-scale project.
                          | >
                          | > Mason has some similar functionality with its *.mas components
                          | > http://www.masonbook.com/book/chapter-1.mhtml#TOC-ANCHOR-3 but lacks
                          the
                          | > PostBack way of dealing with round-trip forms (as with server-side
                          form
                          | > validation). It also lacks the built-in ability to do things like
                          | > append listitems to a <select> tag.
                          | >
                          | > _______________________________________________________________
                          | >
                          | > John Drago | Chief Architect of Software Development
                          | > E-com Media Group, Inc. [www.e-commedia.com]
                          | > office
                          | > ::
                          | > 303.790.7940 x25
                          | > email
                          | > ::
                          | > jdrago@...
                          | >
                          | >
                          | >
                          | > E - b u s i n e s s w i t h D i m e n s i o n TM
                          | >
                          | >
                          | > | -----Original Message-----
                          | > | From: Josh Chamas [mailto:josh@...]
                          | > | Sent: Monday, March 15, 2004 5:19 PM
                          | > | To: asp@...
                          | > | Subject: Re: .NET-style components and development
                          | > |
                          | > | John Drago wrote:
                          | > | >
                          | > | > What I want to do would look something like so:
                          | > | > ---------------------------------------------------------------
                          | > | > [listbox.asp]
                          | > | >
                          | > | > <asp:listbox id="list1">
                          | > | > <asp:listitem>Select One</asp:listitem>
                          | > | > </asp:listbox>
                          | > | >
                          | > | > <%
                          | > | > # Dynamically add items to the list before it's rendered:
                          | > | > $Page->list1->Items->add(
                          | > | > asp::listitem->new( Value => "1", Text => "Blue" ) );
                          | > | > $Page->list1->Items->add(
                          | > | > asp::listitem->new( Value => "2", Text => "Red" ) );
                          | > | >
                          | > | > # or, iterate through items within the listbox:
                          | > | > foreach my $item ( $Page->list1->Items )
                          | > | > {
                          | > | > if( $item->Value == 1 )
                          | > | > {
                          | > | > $item->Text = "Blue [this is my favorite...isn't it
                          yours?]";
                          | > | > }# end if()
                          | > | > }# end foreach()
                          | > | >
                          | > | > %>
                          | > | > ---------------------------------------------------------------
                          | > | >
                          | > | > Something tells me that this isn't too far away from what we
                          already
                          | >
                          | > | > have with Apache::ASP...that with some extra methods inherited
                          from
                          | > | > a package subclassed by asp::listbox and asp::listitem, it is
                          100%
                          | > | > possible.
                          | > | >
                          | > | > I would need some help with where to bless the $Page object into
                          the
                          | >
                          | > | > namespace the ASP pages are executed in.
                          | > | >
                          | > |
                          | > | If you set up a $List object in global.asa, it will be seen in
                          | > | includes and scripts, but not in the scope of the XMLSubs
                          packages.
                          | > | So you might create it in the main package to reference from like
                          | > | this:
                          | > |
                          | > | # global.asa
                          | > | use vars qw($List);
                          | > | sub Script_OnStart {
                          | > | $List = $main::List = List->new();
                          | > | }
                          | > | sub Script_OnEnd {
                          | > | $List->can('DESTROY') && $List->DESTROY;
                          | > | $List = $main::List = undef;
                          | > | }
                          | > |
                          | > | Then in the script, you can:
                          | > |
                          | > | <%
                          | > | $List->->add('list1',
                          | > | ListItem->new( Value => "1", Text => "Blue" )
                          | > | );
                          | > | %>
                          | > |
                          | > | And then you can:
                          | > |
                          | > | <asp:listbox id="list1">
                          | > | <asp:listitem>Select One</asp:listitem>
                          | > | </asp:listbox>
                          | > |
                          | > | And have XMLSubs defined to handle asp:listbox & asp:listitem
                          | > | properly, looking at the $main::List object.
                          | > |
                          | > | If you really want to build objects through code though, you might
                          | > | check out CGI.pm, which has plenty of methods for doing exactly
                          this.
                          | >
                          | > | Output from a CGI.pm object should be compatible with Apache::ASP.
                          | > |
                          | > | > Apache::ASP does *almost* everything I want it to do, and this
                          kind
                          | > | > of extension would make it a lot more powerful in my opinion.
                          | > |
                          | > | What is the extension in particular that you are looking for? Is
                          there
                          | >
                          | > | something particular about <asp:listbox /> handling that you like
                          in
                          | > | ASP.NET that you want implemented as is? Particularly what
                          features
                          | > | of ASP.NET do you think should make it into Apache::ASP ?
                          | > |
                          | > | Regards,
                          | > |
                          | > | Josh
                          | > |
                          | > |
                          | >
                          ________________________________________________________________________
                          | > | Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
                          | > | Chamas Enterprises Inc. | NodeWorks Directory -
                          | > http://dir.nodeworks.com
                          | > | http://www.chamas.com | Apache::ASP - http://www.apache-asp.org
                          | > |
                          | > |
                          | > |
                          | > |
                          | > |
                          ---------------------------------------------------------------------
                          | > | To unsubscribe, e-mail: asp-unsubscribe@...
                          | > | For additional commands, e-mail: asp-help@...
                          | >
                          | >
                          | >
                          | >
                          ---------------------------------------------------------------------
                          | > To unsubscribe, e-mail: asp-unsubscribe@...
                          | > For additional commands, e-mail: asp-help@...
                          | >
                          | >
                          |
                          |
                          |
                          | ---------------------------------------------------------------------
                          | To unsubscribe, e-mail: asp-unsubscribe@...
                          | For additional commands, e-mail: asp-help@...
                          |



                          ---------------------------------------------------------------------
                          To unsubscribe, e-mail: asp-unsubscribe@...
                          For additional commands, e-mail: asp-help@...
                        • Josh Chamas
                          ... I really like the idea of a type directive. Is this from .Net specifically, or are you just making this up for the purpose of getting
                          Message 12 of 13 , Apr 28, 2004
                          • 0 Attachment
                            John Drago wrote:
                            > I have put together a rough, working example of a parser that could grow
                            > to support this ASP.NET-style development we've been talking about.
                            >
                            > I can post what I have, but it's only about 50 lines and wouldn't help
                            > anyone much. Another couple weeks of free time on this project should
                            > yield more progress.
                            >
                            > The parser I have written works for the following code.
                            >
                            > ---- test.aspx -----
                            > <%@ Register prefix="test" class="MyLibs::ASP::Test" %>
                            > <html>
                            > <head>
                            > <title>Testing</title>
                            > </head>
                            > <body>
                            > <test:header id="hd1" runat="server" arg1="foo" stuff="bar">
                            > <test:hlink runat="server" id="bob">Click Me.</test:hlink>
                            > </test:header>

                            I really like the idea of a <% Register %> type directive.
                            Is this from .Net specifically, or are you just making this up
                            for the purpose of getting XMLSubs extended? If we are just
                            making it up, we might borrow a standard syntax for this from
                            JSP taglibs or some such.

                            I would like to enable something like this though, and if we
                            could get the idea hammered out, I could get you an extension
                            for Apache::ASP that makes this work.

                            Regards,

                            Josh

                            ________________________________________________________________________
                            Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
                            Chamas Enterprises Inc. | NodeWorks Directory - http://dir.nodeworks.com
                            http://www.chamas.com | Apache::ASP - http://www.apache-asp.org



                            ---------------------------------------------------------------------
                            To unsubscribe, e-mail: asp-unsubscribe@...
                            For additional commands, e-mail: asp-help@...
                          • John Drago
                            ... [JD:] It was inspired by the .Net Register directives. Borrowing the syntax from JSP makes sense. ... [JD:] That would be great. Basically a dev
                            Message 13 of 13 , Apr 29, 2004
                            • 0 Attachment
                              |
                              | I really like the idea of a <% Register %> type directive.
                              | Is this from .Net specifically, or are you just making this up
                              | for the purpose of getting XMLSubs extended? If we are just
                              | making it up, we might borrow a standard syntax for this from
                              | JSP taglibs or some such.

                              [JD:] It was "inspired" by the .Net Register directives. Borrowing the
                              syntax from JSP makes sense.

                              |
                              | I would like to enable something like this though, and if we
                              | could get the idea hammered out, I could get you an extension
                              | for Apache::ASP that makes this work.

                              [JD:] That would be great. Basically a dev version that I could work
                              with? I also want to have the ability to reference in-page widgets by
                              ID. For instance:
                              <asp:button id="button1" />
                              [...elsewhere...]
                              $button1->{Text} = "Click Me";

                              I'm going to implement recursive parsing, so that the output of one of
                              these elements will also be parsed and the output collected, in case it
                              also contains things like taglib registrations, xmlSubs, ASP tags (<%
                              %>), etc.

                              One thing that ASP.NET has is the <%@ Cache %> directives. We can
                              specify the caching parameters based on timeout, parameter, sessionID or
                              whatever. Because we could end up with a lot of overhead on the parsing
                              end of things, caching parsed versions would be good. I know you
                              already do this in Apache::ASP, but I don't completely understand
                              how/where it is cached. Some detail on this would be good.

                              OK, now here's the kicker. I have a situation here where we have an
                              application written in ASP-VBscript for IIS that will need to integrate
                              with Apache::ASP. I have written a module that allows COM-enabled code
                              (VBScript, JScript, PerlScript) to be used together in the Inline::
                              style. I call it Inline::COM. If we can get something worked out using
                              these XMLSubs where basically anything within a <com:vbscript> tag could
                              be executed by this Inline::COM module, it would solve a lot of
                              problems. We could even make it so Inline::Java, Inline::C or really
                              anything could be called out to very easily from within an Apache::ASP
                              page.

                              This could get very interesting.


                              |
                              | Regards,
                              |
                              | Josh
                              |
                              |
                              ________________________________________________________________________
                              | Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
                              | Chamas Enterprises Inc. | NodeWorks Directory -
                              http://dir.nodeworks.com
                              | http://www.chamas.com | Apache::ASP - http://www.apache-asp.org
                              |
                              |



                              ---------------------------------------------------------------------
                              To unsubscribe, e-mail: asp-unsubscribe@...
                              For additional commands, e-mail: asp-help@...
                            Your message has been successfully submitted and would be delivered to recipients shortly.