Thanks!
I installed from svn and now have version 3.79, up from 3.64.
What do you mean by: "include the gantry.js file on your page" ?
I see the gantry.js file in the gantry/js directory but have no idea what
to do with it. I know it's java, that's about it.
The search button (which I had figured out how to make appear before)
does nothing right now.
Can one have more than one field in a table "searchable" ?
Is there an example I can look at that has REAL search capability? Not just
hand waving about how easy it is to add search, a real example?
Thanks again,
Bill
On 6/15/11, John Weigel <John....@knology.com> wrote:
> Hi Bill,
>
> Gantry is still alive - more or less. You'll want to use the version in
> subversion as the version in cpan is somewhat out of date. There is some
> built-in search functionality. You can set livesearch to 1 inside your
> do_main method and you'll get a search box on the results page. Setting
> searchable to 1 inside of your table field block will make it so that
> column is searched. Here's a simple example:
>
> controller Customer is CRUD {
>
>
> method do_main is main_listing {
> controls_table customer;
> livesearch 1;
> }
>
> }
>
> table bp_ach_errors {
> field id {
> is int4, primary_key, auto;
> }
> field name {
> is varchar;
> label Name;
> html_form_type text;
> searchable 1;
>
> }
> }
>
>
> You'll also need to include the gantry.js file on your page. The searching
> uses the livesearch method in there.
>
> -John
>>--
>>You received this message because you are subscribed to the Google Groups
>>"Gantry" group.
>>To post to this group, send email to gan...@googlegroups.com.
>>To unsubscribe from this group, send email to
>>gantry+un...@googlegroups.com.
>>For more options, visit this group at
>>http://groups.google.com/group/gantry?hl=en.
>>
>>
>
>
controller Customer is CRUD {
controls_table customer;
method do_main is main_listing {
livesearch 1;
}
}
table customer {
Gantry is still alive - more or less. You'll want to use the version in
subversion as the version in cpan is somewhat out of date. There is some
built-in search functionality. You can set livesearch to 1 inside your
do_main method and you'll get a search box on the results page. Setting
searchable to 1 inside of your table field block will make it so that
column is searched. Here's a simple example:
controller Customer is CRUD {
method do_main is main_listing {
controls_table customer;
livesearch 1;
}
}
table bp_ach_errors {
field id {
is int4, primary_key, auto;
}
field name {
is varchar;
label Name;
html_form_type text;
searchable 1;
}
}
You'll also need to include the gantry.js file on your page. The searching
uses the livesearch method in there.
-John
On 6/13/11 3:19 PM, "William Dudley" <wfdu...@gmail.com> wrote:
So yes, I now admit that it is theoretically possible to get livesearch to work.
BUT there are NO DOCS for how to get it to work. Which of the 12,000
files in this
thing is the ONE that makes livesearch work?
I see that the sample html directory has a "js" subdir with
"gantry.js" and some other stuff in it. Totally undocumented, but OK,
what the hell. I replicated that in MY application; still no go. No
javascript gets included in my page that has the non-functional Search
box.
Obviously, there's another (or 6 or 7) more secret places where I have
missing files to get this to work.
I'm sorry to be sounding so testy, but when a beginner runs the
*tutorial*, it should work. Especially on a package that is at
version 3.x.
Thanks,
Bill Dudley
On 6/16/11, wfdudley <wfdu...@gmail.com> wrote:
> This is what I get when I run app.server from the sample dir:
>
> ./app.server
> Could not load plugin "Gantry::Plugins::AuthCookie", "Can't locate
> Authen/Htpasswd.pm in @INC (@INC contains: lib ../lib
> /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
> /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .)
> at ../lib/Gantry/Plugins/AuthCookie.pm line 10.
> BEGIN failed--compilation aborted at
> ../lib/Gantry/Plugins/AuthCookie.pm line 10.
> Compilation failed in require at (eval 84) line 3.
> " at ../lib/Gantry.pm line 386.
> BEGIN failed--compilation aborted at ./app.server line 14.
>
> so I try to install the "missing" perl module:
>
> sudo perl -MCPAN -e shell
> cpan[1]> install Gantry::Plugins::AuthCookie
> Going to read '/home/dud/.cpan/Metadata'
> Database was generated on Tue, 07 Jun 2011 15:30:25 GMT
> Going to read '/home/dud/.cpan/sources/authors/01mailrc.txt.gz'
> ............................................................................DONE
> Going to read '/home/dud/.cpan/sources/modules/02packages.details.txt.gz'
> Database was generated on Thu, 16 Jun 2011 17:28:57 GMT
> ............................................................................DONE
> Fetching with LWP:
> http://www.perl.com/CPAN/modules/03modlist.data.gz
> Going to read '/home/dud/.cpan/sources/modules/03modlist.data.gz'
> ............................................................................DONE
> Going to write /home/dud/.cpan/Metadata
> Gantry::Plugins::AuthCookie is up to date (undef).
>
> Now what?
>
> Thanks,
> Bill Dudley
>
>
> On 6/16/11, John Weigel <John....@knology.com> wrote:
>> There is a sample included with gantry of how livesearch works. It was
>> broken until about a minute ago when I committed a change to fix it.
>> So...
>>
>> Get the latest code from subversion.
>> Go to the samples directory and do ./app.server.
>> Point your browser at http://localhost:8080/user.
>> You should have a working example of how livesearch works.
>>
>> -John
yes, I built it according to the README. The problem is that Authen::Htpasswd
was missing.
I'm an engineer by training. One thing I can do is follow instructions.
Thanks,
Bill Dudley
On 6/16/11, John Weigel <John....@knology.com> wrote:
> You shouldn't need to install authcookie separately - its part of gantry.
> Did you install gantry first using perl Build.PL; ./Build install?
>
> -John
I misspoke again. I am using bigtop to regenerate everything:
bigtop docs/our_app.bigtop all
So it's bigtop that's overwriting genwrapper.tt
This line is already in my bigtop file:
template_wrapper `genwrapper.tt` => no_accessor;
I don't understand what the effect of adding this line is supposed to be:
template_wrapper `mywrapper.tt` => no_accessor;
Is that supposed to get bigtop to ignore mywrapper.tt? Copy it for me
(unlikely)?
I'm using the cpan version of bigtop.
I have no idea how to get the svn version. The link from usegantry.org only
talks about getting gantry.
Thanks,
Bill
On 6/16/11, John Weigel <John....@knology.com> wrote:
> Do you have svn version of bigtop? It, like gantry doesn't get regular
> pushes to cpan. As far as tentmaker goes - its possible you've come across
> a problem with it. I've never used tentmaker to build a gantry app. I
> always just create the bigtop file by hand and then use the bigtop command
> line tool to gen/regen. As far as your problem goes with the code being
> removed from the genwrapper template - yeah that’s going to happen any
> time you regenerate the app. The best thing to do is copy the template to
> another name and then update the template wrapper config item in the
> bigtop file and regen.
>
> template_wrapper `mywrapper.tt` => no_accessor;
>
> That way regenerating the app won't overwrite your changes to the wrapper.
>
> -John
>
>
>
> On 6/16/11 3:35 PM, "wfdudley" <wfdu...@gmail.com> wrote:
>
>>John,
>>
>>Again, thanks for your help. This would be hopeless without you.
>>
>>I had already copied js/gantry.js, and I had already added the snippet to
>>templates/genwrapper.tt. I spent a LOT of time with find | xargs grep
>>trying
>>to figure out where the hooks are hidden.
>>
>>I had no idea about plugins `AuthCookie Static`; Since this modifies the
>>bigtop file, I re-ran tentmaker. That erased the <script
>>...gantry.jg.../script>
>>business from genwrapper.tt.
>>
>>So, I replaced the bit in genwrapper.tt, now with the AuthCookie Static
>>plugins
>>cited in the bigtop file.
>>
>>Still, search is a no-op.
>>
>>And, amusingly, the "ajaxrequest" thingy died. I had bolted this into my
>>app
>>by copying bits from the sample app, thinking it would test if any
>>java stuff worked
>>at all. I had it working, until I ran tentmaker. Now it's just as
>>dead as the search
>>box. I've been doing "find | xargs grep" and "ls -lR" etc to try to
>>figure out what
>>broke when I ran tentmaker, but no success there.
>>
>>As far as the larger, philosiphical discussion about docs, here's my two
>>cents:
>>
>>if you want more users, so that the project gains some kind of
>>following, you have
>>to have better docs.
>>
>>If you want to not have to keep answering the same stupid questions over
>>again
>>to newbs on the mailing list, you have to have better docs. There is NO
>>WAY in
>>hell anybody is going to guess the secret "plugins" that goes in the
>>bigtop file,
>>nor that running tentmaker will kill the java script include in
>>genwrapper.tt.
>>
>>I've been using unix from the command line for many years now, programming
>>Perl for a decade or more, and believe me when I say that this is
>>impenetrably
>>hard.
>>
>>That said, I'm willing to mark up changes to the docs to fix some of
>>these problems
>>if I ever get it working.
>>
>>Thanks for all your help,
>>Bill Dudley
>>
>>
>>
>>On 6/16/11, John Weigel <John....@knology.com> wrote:
>>> Copy the gantry.js file from gantry into your project under
>>> html/js/gantry.js. Then add the following to your wrapper template head
>>> element:
>>>
>>> <script type="text/javascript" src="[% self.doc_rootp %]/js/gantry.js">
>>> </script>
>>>
>>> You can look at the genwrapper.tt in the
>>> samples/html/templates/genwrapper.tt file for an example.
>>>
>>> If you're using the appserver (as opposed to running it under apache)
>>>you
>>> need to make sure you have the Static plugin enabled to serve out the
>>> static files. That¹s enabled in the bigtop file with plugins `AuthCookie
>>> Static`; (you can look at the samples bigtop file under samples/docs for
>>> an example).
>>>
>>> I agree the documentation could be better and it could be easier to get
>>> working out of the box but unfortunately there are only a couple people
>>> who contribute to the project and its not the focus of work for any of
>>> them including myself. Given the little time I have to work on gantry
>>>its
>>> mostly all bug fixes I happen to encounter while working on gantry web
>>> applications.
>>>
>>>
>>> -John
>>>
>>> On 6/16/11 1:40 PM, "wfdudley" <wfdu...@gmail.com> wrote:
>>>
>>>>First: John, thanks for spending your time on this.
>>>>
>>>>Second: I need to correct what I said in my last emails. When I said:
>>>>
>>>>"No javascript gets included in my page that has the non-functional
>>>>Search box."
>>>>
>>>>I don't really know that. Firefox "View Source" doesn't show
>>>>javascript apparently,
>>>>since it doesn't show it for the working sample app.server version,
>>>>either.
>>>>
>>>>So we are left with:
>>>>
>>>>livesearch doesn't work in an application built according to the
>>>>"manual", such
>>>>as it is (I even wasted $20 on the Gantry book, silly me). I haven't
>>>>the slightest
>>>>idea why, and there is no debug output that I can find.
>>>>
>>>>Is there *any* documentation on "livesearch" ? I mean, aside from
>>>>the "keywords" docs that say that there are "livesearch" and
>>>>"searchable"
>>>>keywords, but are silent on any other points.
>>>>
>>>>Thanks,
>>>>Bill Dudley
>>>>
>>>>
>>>>On 6/16/11, wfdudley <wfdu...@gmail.com> wrote:
>>>>> Ah-hah. Figured out it wanted "install Authen::Htpasswd, which once
>>>>> installed,
>>>>> app.server now runs.
>>>>>
>>>>> So yes, I now admit that it is theoretically possible to get
>>>>>livesearch
>>>>>to
>>>>> work.
>>>>>
>>>>> BUT there are NO DOCS for how to get it to work. Which of the 12,000
>>>>> files in this
>>>>> thing is the ONE that makes livesearch work?
>>>>>
>>>>> I see that the sample html directory has a "js" subdir with
>>>>> "gantry.js" and some other stuff in it. Totally undocumented, but OK,
>>>>> what the hell. I replicated that in MY application; still no go. No
>>>>> javascript gets included in my page that has the non-functional Search
>>>>> box.
>>>>>
>>>>> Obviously, there's another (or 6 or 7) more secret places where I have
>>>>> missing files to get this to work.
>>>>>
>>>>> I'm sorry to be sounding so testy, but when a beginner runs the
>>>>> *tutorial*, it should work. Especially on a package that is at
>>>>> version 3.x.
>>>>>
Now what?
Thanks,
Bill Dudley
Second: I need to correct what I said in my last emails. When I said:
"No javascript gets included in my page that has the non-functional Search box."
I don't really know that. Firefox "View Source" doesn't show
javascript apparently,
since it doesn't show it for the working sample app.server version, either.
So we are left with:
livesearch doesn't work in an application built according to the "manual", such
as it is (I even wasted $20 on the Gantry book, silly me). I haven't
the slightest
idea why, and there is no debug output that I can find.
Is there *any* documentation on "livesearch" ? I mean, aside from
the "keywords" docs that say that there are "livesearch" and "searchable"
keywords, but are silent on any other points.
Thanks,
Bill Dudley
On 6/16/11, John Weigel <John....@knology.com> wrote:
> Copy the gantry.js file from gantry into your project under
> html/js/gantry.js. Then add the following to your wrapper template head
> element:
>
> <script type="text/javascript" src="[% self.doc_rootp %]/js/gantry.js">
> </script>
>
> You can look at the genwrapper.tt in the
> samples/html/templates/genwrapper.tt file for an example.
>
> If you're using the appserver (as opposed to running it under apache) you
> need to make sure you have the Static plugin enabled to serve out the
> static files. That¹s enabled in the bigtop file with plugins `AuthCookie
> Static`; (you can look at the samples bigtop file under samples/docs for
> an example).
>
> I agree the documentation could be better and it could be easier to get
> working out of the box but unfortunately there are only a couple people
> who contribute to the project and its not the focus of work for any of
> them including myself. Given the little time I have to work on gantry its
> mostly all bug fixes I happen to encounter while working on gantry web
> applications.
>
>
> -John
>
> On 6/16/11 1:40 PM, "wfdudley" <wfdu...@gmail.com> wrote:
>
<script type="text/javascript" src="[% self.doc_rootp %]/js/gantry.js">
</script>
You can look at the genwrapper.tt in the
samples/html/templates/genwrapper.tt file for an example.
If you're using the appserver (as opposed to running it under apache) you
need to make sure you have the Static plugin enabled to serve out the
static files. That¹s enabled in the bigtop file with plugins `AuthCookie
Static`; (you can look at the samples bigtop file under samples/docs for
an example).
I agree the documentation could be better and it could be easier to get
working out of the box but unfortunately there are only a couple people
who contribute to the project and its not the focus of work for any of
them including myself. Given the little time I have to work on gantry its
mostly all bug fixes I happen to encounter while working on gantry web
applications.
-John
On 6/16/11 1:40 PM, "wfdudley" <wfdu...@gmail.com> wrote:
-John
On 6/16/11 1:12 PM, "wfdudley" <wfdu...@gmail.com> wrote:
Get the latest code from subversion.
Go to the samples directory and do ./app.server.
Point your browser at http://localhost:8080/user.
You should have a working example of how livesearch works.
-John
On 6/15/11 4:15 PM, "wfdudley" <wfdu...@gmail.com> wrote:
John, thanks for your efforts. I already had the "searchable" and
"livesearch" things figured out, but the search box still does nada.
I also saw the code update to version 3.80, which I dutifully installed.
Man, I was *so* hopeful.
Livesearch still does nothing. When I do "View Source" in Firefox,
I see that there is no java script in the file, even though I see
where gantry.js is supposed to be included in moxie/gantry_wrapper.tt.
This was also the case in version 3.79.
I'm using the included "development" web server that defaults to
port 8080. Does that not support "INCLUDE" of javascript? Or
is there some other magic involved?
This is way harder than it has any right to be. No wonder people
use Rails.
Thanks,
Bill Dudley
--
Bill Dudley
ext: 2010
phone: 732 719 8047
cell: 310 707 8245
yahoo: w_f_dudley
skype: william.f.dudley