Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Rose::HTMLx::Form::Related::RD BO
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ghaverla@materialisations .com  
View profile  
 More options Jul 14 2011, 8:55 pm
From: "ghave...@materialisations.com" <ghave...@materialisations.com>
Date: Thu, 14 Jul 2011 17:55:27 -0700 (PDT)
Local: Thurs, Jul 14 2011 8:55 pm
Subject: Re: Rose::HTMLx::Form::Related::RDBO
I'm working with an application (database) where just about everything
is an enumeration.  Consequently, what makes the most sense for me is
generating forms where just about everything is a PopUpMenu.  And it
is not possible for a computer program to validate any of this data.
The thing I am writing helps engineers validate the data (FYI).

But, I decided to try Rose::HTMLx::Form::Related::RDBO just to see
what would happen (look at the ->html output).  There is man page for
RHFRR, it shows how to set up a perl module file (package) to use it.
There is a man page for RHFR which shows a similar thing.  There is no
man page for RHF, saying how to actually use this.  (Substitute
perldoc for man if you want.)  Looking at google, I can't find any
examples of how people actually use this.

Can anyone point to an example, or write one?

Thanks.
Gord


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Siracusa  
View profile  
 More options Jul 14 2011, 9:12 pm
From: John Siracusa <sirac...@gmail.com>
Date: Thu, 14 Jul 2011 21:12:22 -0400
Local: Thurs, Jul 14 2011 9:12 pm
Subject: Re: Rose::HTMLx::Form::Related::RDBO
On Thu, Jul 14, 2011 at 8:55 PM, ghave...@materialisations.com

You're looking for an example of Rose::HTML::Form in use?  How about
the synopsis here?

http://search.cpan.org/dist/Rose-HTML-Objects/lib/Rose/HTML/Form.pm

-John


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Karman  
View profile  
 More options Jul 14 2011, 9:18 pm
From: Peter Karman <pek...@gmail.com>
Date: Thu, 14 Jul 2011 18:18:56 -0700 (PDT)
Local: Thurs, Jul 14 2011 9:18 pm
Subject: Re: Rose::HTMLx::Form::Related::RDBO

On Jul 14, 7:55 pm, "ghave...@materialisations.com"

<ghave...@materialisations.com> wrote:
> I'm working with an application (database) where just about everything
> is an enumeration.  Consequently, what makes the most sense for me is
> generating forms where just about everything is a PopUpMenu.  And it
> is not possible for a computer program to validate any of this data.
> The thing I am writing helps engineers validate the data (FYI).

Might you want http://search.cpan.org/dist/Rose-HTMLx-Form-Field-PopUpMenuNumeric/
?

> But, I decided to try Rose::HTMLx::Form::Related::RDBO just to see
> what would happen (look at the ->html output).  There is man page for
> RHFRR, it shows how to set up a perl module file (package) to use it.
> There is a man page for RHFR which shows a similar thing.  There is no
> man page for RHF, saying how to actually use this.  (Substitute
> perldoc for man if you want.)  Looking at google, I can't find any
> examples of how people actually use this.

> Can anyone point to an example, or write one?

The docs for RHxFR are woefully lacking in examples and the author
should be severely reprimanded for such shoddy work.

For each Form class, I do something like this:

------------------------------------
package My::Form;
use strict;
use Carp;
use base qw( Rose::HTMLx::Form::Related::RDBO );

sub init_metadata {
    my $self = shift;
    return $self->metadata_class->new(
        form => $self,
        object_class => 'My::RDBOClass',
    );

}

1;
-----------------------

which assumes one Form class == one RDBO class.

Then you use the My::Form class just like you use Rose::HTML::Form.

RHxFR is used extensively by CatalystX::CRUD::YUI.

Let me know if that doesn't get you in the right direction. You can
also check out the http://groups.google.com/group/catalystxcrud list.

pek


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gordon Haverland  
View profile  
 More options Jul 15 2011, 2:46 pm
From: Gordon Haverland <ghave...@materialisations.com>
Date: Fri, 15 Jul 2011 12:46:38 -0600
Local: Fri, Jul 15 2011 2:46 pm
Subject: Re: Rose::HTMLx::Form::Related::RDBO
On July 14, 2011, John Siracusa wrote:

> On Thu, Jul 14, 2011 at 8:55 PM, ghave...@materialisations.com
> <ghave...@materialisations.com> wrote:
> > I'm working with an application (database) where just about
> > everything is an enumeration.

Thanks for replying John and Peter.

Starting from the RHFRR man page (perldoc)
        package MyRDBO::Class::Form;
        use strict;
        use base qw( Rose::HTMLx::Form::Related::RDBO );

        sub init_object_class { 'MyRDBO::Class' }

        1;
I get an error that I must define init_metadata(), or pass a
metadata object in the new().  I presume it is looking for
metadata on MyRDBO::Class, and I also presume that the
init_object_class method defined above is meant to provide the
information required, which means I must have something screwed up
to be seeing the message.  Thinking the tests might have an
answer, I notice that the DBIC example has init_app_class()
instead of init_object_class().  Neither (or both together) works.  
Having:
      use MyRDBO::Class;
defined above (after the use base statement), doesn't help
anything.

Going back to my test program, I generate a metadata object and
pass it as an argument in the new():

use Rose::DB::Object::Metadata;
my $meta = Rose::DB::Object::Metadata->new( class =>
'MyRDBO::Class' );
my $formx = MyRDBO::Class::Form::TableName->new( $meta );

And this gets a different error.  But, I've been single stepping
perldb in emacs for 6 hours already today and I figured that I
would send another note, while I take a break.

I've been changing package names above to match the POD, the dump
below has the original names.

Cannot set element for EngMaterielSpec::FormX::BranchTable at
/home/ghaverla/src/perl/rheaume/Mojolicious/Lite/bh.pl line 24
 at /usr/local/share/perl/5.12.3/Rose/HTML/Form/Field.pm line 684

Rose::HTML::Form::Field::element('EngMaterielSpec::FormX::BranchTable=HASH( 0xa180e00)',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/share/perl5/Rose/Object.pm line 25

Rose::Object::init('EngMaterielSpec::FormX::BranchTable=HASH(0xa180e00)',
'element', 'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/local/share/perl/5.12.3/Rose/HTML/Object.pm line 280
        Rose::HTML::Object::init('element',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/local/share/perl/5.12.3/Rose/HTML/Form.pm line 186

Rose::HTML::Form::init('EngMaterielSpec::FormX::BranchTable=HASH(0xa180e00) ',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/local/share/perl/5.12.3/Rose/HTMLx/Form/Related.pm line 68

Rose::HTMLx::Form::Related::init('EngMaterielSpec::FormX::BranchTable=HASH( 0xa180e00)',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/local/share/perl/5.12.3/Rose/HTML/Form.pm line 125
        Rose::HTML::Form::new('EngMaterielSpec::FormX::BranchTable',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/home/ghaverla/src/perl/rheaume/Mojolicious/Lite/bh.pl line 24

Gord


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gordon Haverland  
View profile  
 More options Jul 16 2011, 7:28 pm
From: Gordon Haverland <ghave...@materialisations.com>
Date: Sat, 16 Jul 2011 17:28:15 -0600
Local: Sat, Jul 16 2011 7:28 pm
Subject: Re: Rose::HTMLx::Form::Related::RDBO
On July 14, 2011, John Siracusa wrote:

> On Thu, Jul 14, 2011 at 8:55 PM, ghave...@materialisations.com

[ snip ]

I don't know.  I can get my own routines which generate popupmenus
of stuff to work, but doing something simple like having this
module (HTFRR) generate a form for a table that consists of 2
columns, one is a primary key and the other is a UNIQUE column
just keeps coming up with errors.  Single stepping through things
and looking at variables, it is not apparent what the problem is.  
But, there are vanishingly few comments in the code, so I have no
idea if having empty lists in certain places is unusual or not.

If the generic .pm in the perldoc works for some people, but
generates errors for me, all I can think of is there is something
in my configuration which is "wrong".  And I've pretty much
exhausted what I can change in doing this.  Heck, I was using
FormX as a directory early on, and I thought maybe something was
sensitive to that capital X at the end, so I changed the modules,
packages and directories to use Form.  No difference, the same
error messages.

The other thing that comes to mind, is that there is vanshingly
little data in what I have in my database (most of the data is an
enumeration of some kind).  Most tables have primary keys, and
most tables with more than 2 columns are filled with foreign keys.  
And there are 3 pivot tables present for Many-to-Many
relationships.  Is interrelated giving up?

At this point, I am going to give up on Related::RDBO.  I really
didn't think it was going to help my situation because of how
dense the foreign keys are: but between the documentation, the
test examples in the CPAN module and the source, I have no idea
where the problem is.

Gord


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Karman  
View profile  
 More options Jul 16 2011, 9:42 pm
From: Peter Karman <pek...@gmail.com>
Date: Sat, 16 Jul 2011 18:42:57 -0700 (PDT)
Local: Sat, Jul 16 2011 9:42 pm
Subject: Re: Rose::HTMLx::Form::Related::RDBO

On Jul 16, 6:28 pm, Gordon Haverland <ghave...@materialisations.com>
wrote:

> On July 14, 2011, John Siracusa wrote:

> > On Thu, Jul 14, 2011 at 8:55 PM, ghave...@materialisations.com

> [ snip ]

> I don't know.  I can get my own routines which generate popupmenus
> of stuff to work, but doing something simple like having this
> module (HTFRR) generate a form for a table that consists of 2
> columns, one is a primary key and the other is a UNIQUE column
> just keeps coming up with errors.  Single stepping through things
> and looking at variables, it is not apparent what the problem is.  
> But, there are vanishingly few comments in the code, so I have no
> idea if having empty lists in certain places is unusual or not.

Thanks for your diligence and good feedback on using RHxFR. It has not
been, to my knowledge, used much outside the module
(CatalystX::CRUD::YUI) from which it was originally spun off, so the
docs are pitiful, I know. RHxFR is mostly useful when you are aiming
for a very tight coupling between your model (e.g. RDBO) and your view
(presentation layer) because it makes the presentation layer more
aware of its internal relationships.

I've added actual RDBO tests to svn that illustrate how to use the
RDBO-based Forms.

https://svn.msi.umn.edu/sw/perl/Rose-HTMLx-Form-Related/trunk/t/01-rd...

Hope those help a bit.

Having said all that, it's not really clear to me what, exactly,
you're trying to accomplish. From your other email it sounded like you
were trying to create a web front-end to an existing database with no
CSS or JS dependencies. If you're using both RDBO and RHTMLO, then I
suggest trying Rose::DBx::Garden, which will interrogate an existing
db and create both the RDBO and RHTMLO classes for you. If you wanted
to then use the interrelated magic of RHxFR, you could simply change
the ISA definition in the base Form class and all the generated Form
classes should then just Do the Right Thing.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »