Erlang/OTP Forums

Author Message

<  Erlyweb mailing list  ~  Newbie to erlyweb

Guest
Posted: Mon Aug 27, 2007 5:18 am Reply with quote
Guest
Hi, I'm a newbie to web stuff, although I do know a few programming
languages (including Erlang - though only as much as Armstrong's new
book teaches).

To start with, all I want to make with Erlyweb is a page that allows
me to submit some text, where hitting submit puts the text in Mnesia,
and updates another page which shows that text. I'm looking at Yariv's
post at http://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erlang-twist-on-web-framworks/,
and while it may be crystal clear to some, for me it's a little bit
opaque. It tells me what to do for Yariv's specific example, but I
don't know why I should do any of those things.

e.g. for the functionality I want, should I be creating a component
(the assumption is that there will be more advanced functionality
later once I get the basics down)? Why should I create a component?
After I create a component and Erlyweb creates the 3 extra files for
me, which functions should I be implementing? What is triggered when?

I'd be very grateful if anyone could clarify things, thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Aug 27, 2007 10:09 pm Reply with quote
Guest
Hi,

The tutorial is admittedly not very rich on the details, but the
online documentation at http://erlyweb.org/doc should demystify how
components work, how controller functions map to urls, how views are
invoked, etc. Are there any areas in the "official" documentation that
you think aren't explained well enough?

Yariv

On 8/26/07, Ghalib Suleiman <cowmoo@gmail.com> wrote:
>
> Hi, I'm a newbie to web stuff, although I do know a few programming
> languages (including Erlang - though only as much as Armstrong's new
> book teaches).
>
> To start with, all I want to make with Erlyweb is a page that allows
> me to submit some text, where hitting submit puts the text in Mnesia,
> and updates another page which shows that text. I'm looking at Yariv's
> post at http://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erlang-twist-on-web-framworks/,
> and while it may be crystal clear to some, for me it's a little bit
> opaque. It tells me what to do for Yariv's specific example, but I
> don't know why I should do any of those things.
>
> e.g. for the functionality I want, should I be creating a component
> (the assumption is that there will be more advanced functionality
> later once I get the basics down)? Why should I create a component?
> After I create a component and Erlyweb creates the 3 extra files for
> me, which functions should I be implementing? What is triggered when?
>
> I'd be very grateful if anyone could clarify things, thanks!
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Sat Sep 01, 2007 11:15 am Reply with quote
Guest
Ok, here is what I'm trying to do (obviously I am doing something
wrong, so if you could let me know, I'd be grateful Smile - I want
http://localhost:8000/testapp/testpage to show the text "testing":

First I call erlyweb:create_app("testapp", "C:/test"). I add the
relevant bits to yaws.conf and restart, and http://localhost:8000/testapp
shows us the "Welcome to 'testapp' " page fine. Now I call
erlyweb:create_component("testpage", "C:/test/testapp").

In testpage_controller.erl, I have:

-module(stories_controller).
-erlyweb_magic(erlyweb_controller).
-export([index/1]).

index(A) ->
{data, "testing"}.

------

In testpage_view.erl, I have:

-module(stories_view).
-erlyweb_magic(erlyweb_view).
-export([index/1]).

index(Data) ->
testpage_show:show_testpage(Data).

-----

In testpage_show.et, I have:

<%@ show_stories(Data) %>
Data

-----

What I want is the text "testing" to appear at http://localhost:8000/testapp/testpage.
I called erlyweb:compile("C:/test/testapp"), and yet loading
http://localhost:8000/testapp/testpage in my browser gives me a 404
Not Found error. What am I doing wrong?

Cheers,
Ghalib

On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> Hi,
>
> The tutorial is admittedly not very rich on the details, but the
> online documentation athttp://erlyweb.org/docshould demystify how
> components work, how controller functions map to urls, how views are
> invoked, etc. Are there any areas in the "official" documentation that
> you think aren't explained well enough?
>
> Yariv
>
> On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
>
>
> > Hi, I'm a newbie to web stuff, although I do know a few programming
> > languages (including Erlang - though only as much as Armstrong's new
> > book teaches).
>
> > To start with, all I want to make with Erlyweb is a page that allows
> > me to submit some text, where hitting submit puts the text in Mnesia,
> > and updates another page which shows that text. I'm looking at Yariv's
> > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > and while it may be crystal clear to some, for me it's a little bit
> > opaque. It tells me what to do for Yariv's specific example, but I
> > don't know why I should do any of those things.
>
> > e.g. for the functionality I want, should I be creating a component
> > (the assumption is that there will be more advanced functionality
> > later once I get the basics down)? Why should I create a component?
> > After I create a component and Erlyweb creates the 3 extra files for
> > me, which functions should I be implementing? What is triggered when?
>
> > I'd be very grateful if anyone could clarify things, thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Sun Sep 02, 2007 7:49 am Reply with quote
Guest
Correction: testpage_show.et contains:

<%@ show_testpage(Data) %>
Data

On Sep 1, 3:14 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> Ok, here is what I'm trying to do (obviously I am doing something
> wrong, so if you could let me know, I'd be grateful Smile - I wanthttp://localhost:8000/testapp/testpageto show the text "testing":
>
> First I call erlyweb:create_app("testapp", "C:/test"). I add the
> relevant bits to yaws.conf and restart, andhttp://localhost:8000/testapp
> shows us the "Welcome to 'testapp' " page fine. Now I call
> erlyweb:create_component("testpage", "C:/test/testapp").
>
> In testpage_controller.erl, I have:
>
> -module(stories_controller).
> -erlyweb_magic(erlyweb_controller).
> -export([index/1]).
>
> index(A) ->
> {data, "testing"}.
>
> ------
>
> In testpage_view.erl, I have:
>
> -module(stories_view).
> -erlyweb_magic(erlyweb_view).
> -export([index/1]).
>
> index(Data) ->
> testpage_show:show_testpage(Data).
>
> -----
>
> In testpage_show.et, I have:
>
> <%@ show_stories(Data) %>
> Data
>
> -----
>
> What I want is the text "testing" to appear athttp://localhost:8000/testapp/testpage.
> I called erlyweb:compile("C:/test/testapp"), and yet loadinghttp://localhost:8000/testapp/testpagein my browser gives me a 404
> Not Found error. What am I doing wrong?
>
> Cheers,
> Ghalib
>
> On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
>
> > Hi,
>
> > The tutorial is admittedly not very rich on the details, but the
> > online documentation athttp://erlyweb.org/docshoulddemystify how
> > components work, how controller functions map to urls, how views are
> > invoked, etc. Are there any areas in the "official" documentation that
> > you think aren't explained well enough?
>
> > Yariv
>
> > On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > Hi, I'm a newbie to web stuff, although I do know a few programming
> > > languages (including Erlang - though only as much as Armstrong's new
> > > book teaches).
>
> > > To start with, all I want to make with Erlyweb is a page that allows
> > > me to submit some text, where hitting submit puts the text in Mnesia,
> > > and updates another page which shows that text. I'm looking at Yariv's
> > > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > > and while it may be crystal clear to some, for me it's a little bit
> > > opaque. It tells me what to do for Yariv's specific example, but I
> > > don't know why I should do any of those things.
>
> > > e.g. for the functionality I want, should I be creating a component
> > > (the assumption is that there will be more advanced functionality
> > > later once I get the basics down)? Why should I create a component?
> > > After I create a component and Erlyweb creates the 3 extra files for
> > > me, which functions should I be implementing? What is triggered when?
>
> > > I'd be very grateful if anyone could clarify things, thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Sep 03, 2007 4:38 am Reply with quote
Guest
Hi,

First, you don't need testpage_view.erl. It's enough to implement
index/1 in testpage_view.et, and ErlyWeb would call it directly,
passing into it the result of testpage_controller:index/1.

One thing that looks suspicious in your code is that your file names
are testpage_controller.erl and testpage_view.erl, yet the module
declarations ('-module(stories_controller)' and
'-module(stories_view)') don't match the file names. Make sure that
the module declarations match the file names and try again accessing
http://locahost:8000/testpage. (To be precise, you don't need
testpage_view.erl -- it's enough to implement testpage_view.et as an
ErlTL template, which doesn't include a module declaration anyways. To
make your example work, you only need to change the module declaration
in testpage_controller.erl.)

Let me know if it works.

Yariv

On 9/2/07, Ghalib Suleiman <cowmoo@gmail.com> wrote:
>
> Correction: testpage_show.et contains:
>
> <%@ show_testpage(Data) %>
> Data
>
> On Sep 1, 3:14 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> > Ok, here is what I'm trying to do (obviously I am doing something
> > wrong, so if you could let me know, I'd be grateful Smile - I wanthttp://localhost:8000/testapp/testpageto show the text "testing":
> >
> > First I call erlyweb:create_app("testapp", "C:/test"). I add the
> > relevant bits to yaws.conf and restart, andhttp://localhost:8000/testapp
> > shows us the "Welcome to 'testapp' " page fine. Now I call
> > erlyweb:create_component("testpage", "C:/test/testapp").
> >
> > In testpage_controller.erl, I have:
> >
> > -module(stories_controller).
> > -erlyweb_magic(erlyweb_controller).
> > -export([index/1]).
> >
> > index(A) ->
> > {data, "testing"}.
> >
> > ------
> >
> > In testpage_view.erl, I have:
> >
> > -module(stories_view).
> > -erlyweb_magic(erlyweb_view).
> > -export([index/1]).
> >
> > index(Data) ->
> > testpage_show:show_testpage(Data).
> >
> > -----
> >
> > In testpage_show.et, I have:
> >
> > <%@ show_stories(Data) %>
> > Data
> >
> > -----
> >
> > What I want is the text "testing" to appear athttp://localhost:8000/testapp/testpage.
> > I called erlyweb:compile("C:/test/testapp"), and yet loadinghttp://localhost:8000/testapp/testpagein my browser gives me a 404
> > Not Found error. What am I doing wrong?
> >
> > Cheers,
> > Ghalib
> >
> > On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> >
> > > Hi,
> >
> > > The tutorial is admittedly not very rich on the details, but the
> > > online documentation athttp://erlyweb.org/docshoulddemystify how
> > > components work, how controller functions map to urls, how views are
> > > invoked, etc. Are there any areas in the "official" documentation that
> > > you think aren't explained well enough?
> >
> > > Yariv
> >
> > > On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
> >
> > > > Hi, I'm a newbie to web stuff, although I do know a few programming
> > > > languages (including Erlang - though only as much as Armstrong's new
> > > > book teaches).
> >
> > > > To start with, all I want to make with Erlyweb is a page that allows
> > > > me to submit some text, where hitting submit puts the text in Mnesia,
> > > > and updates another page which shows that text. I'm looking at Yariv's
> > > > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > > > and while it may be crystal clear to some, for me it's a little bit
> > > > opaque. It tells me what to do for Yariv's specific example, but I
> > > > don't know why I should do any of those things.
> >
> > > > e.g. for the functionality I want, should I be creating a component
> > > > (the assumption is that there will be more advanced functionality
> > > > later once I get the basics down)? Why should I create a component?
> > > > After I create a component and Erlyweb creates the 3 extra files for
> > > > me, which functions should I be implementing? What is triggered when?
> >
> > > > I'd be very grateful if anyone could clarify things, thanks!
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Sep 03, 2007 6:53 am Reply with quote
Guest
Thanks for the reply Yariv. Actually the module declarations do match,
sorry for that typo in my original message.

I removed testpage_view.erl (so now I have testpage_controller.erl,
testpage_view.et, and the file testpage.erl), and made sure about
matching module declarations and recompiled. I still have the same
problem - 404 at http://localhost:8000/testapp/testpage Sad

Is that URL automatically supposed to be valid upon creating the
testpage component and compiling? I wonder if I'm missing some steps.

Perhaps the fact that testpage.erl is blank...? I really don't know.

Thanks.

-Ghalib

On Sep 3, 8:37 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> Hi,
>
> First, you don't need testpage_view.erl. It's enough to implement
> index/1 in testpage_view.et, and ErlyWeb would call it directly,
> passing into it the result of testpage_controller:index/1.
>
> One thing that looks suspicious in your code is that your file names
> are testpage_controller.erl and testpage_view.erl, yet the module
> declarations ('-module(stories_controller)' and
> '-module(stories_view)') don't match the file names. Make sure that
> the module declarations match the file names and try again accessinghttp://locahost:8000/testpage. (To be precise, you don't need
> testpage_view.erl -- it's enough to implement testpage_view.et as an
> ErlTL template, which doesn't include a module declaration anyways. To
> make your example work, you only need to change the module declaration
> in testpage_controller.erl.)
>
> Let me know if it works.
>
> Yariv
>
> On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
>
>
> > Correction: testpage_show.et contains:
>
> > <%@ show_testpage(Data) %>
> > Data
>
> > On Sep 1, 3:14 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> > > Ok, here is what I'm trying to do (obviously I am doing something
> > > wrong, so if you could let me know, I'd be grateful Smile - I wanthttp://localhost:8000/testapp/testpagetoshow the text "testing":
>
> > > First I call erlyweb:create_app("testapp", "C:/test"). I add the
> > > relevant bits to yaws.conf and restart, andhttp://localhost:8000/testapp
> > > shows us the "Welcome to 'testapp' " page fine. Now I call
> > > erlyweb:create_component("testpage", "C:/test/testapp").
>
> > > In testpage_controller.erl, I have:
>
> > > -module(stories_controller).
> > > -erlyweb_magic(erlyweb_controller).
> > > -export([index/1]).
>
> > > index(A) ->
> > > {data, "testing"}.
>
> > > ------
>
> > > In testpage_view.erl, I have:
>
> > > -module(stories_view).
> > > -erlyweb_magic(erlyweb_view).
> > > -export([index/1]).
>
> > > index(Data) ->
> > > testpage_show:show_testpage(Data).
>
> > > -----
>
> > > In testpage_show.et, I have:
>
> > > <%@ show_stories(Data) %>
> > > Data
>
> > > -----
>
> > > What I want is the text "testing" to appear athttp://localhost:8000/testapp/testpage.
> > > I called erlyweb:compile("C:/test/testapp"), and yet loadinghttp://localhost:8000/testapp/testpageinmy browser gives me a 404
> > > Not Found error. What am I doing wrong?
>
> > > Cheers,
> > > Ghalib
>
> > > On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
>
> > > > Hi,
>
> > > > The tutorial is admittedly not very rich on the details, but the
> > > > online documentation athttp://erlyweb.org/docshoulddemystifyhow
> > > > components work, how controller functions map to urls, how views are
> > > > invoked, etc. Are there any areas in the "official" documentation that
> > > > you think aren't explained well enough?
>
> > > > Yariv
>
> > > > On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > > Hi, I'm a newbie to web stuff, although I do know a few programming
> > > > > languages (including Erlang - though only as much as Armstrong's new
> > > > > book teaches).
>
> > > > > To start with, all I want to make with Erlyweb is a page that allows
> > > > > me to submit some text, where hitting submit puts the text in Mnesia,
> > > > > and updates another page which shows that text. I'm looking at Yariv's
> > > > > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > > > > and while it may be crystal clear to some, for me it's a little bit
> > > > > opaque. It tells me what to do for Yariv's specific example, but I
> > > > > don't know why I should do any of those things.
>
> > > > > e.g. for the functionality I want, should I be creating a component
> > > > > (the assumption is that there will be more advanced functionality
> > > > > later once I get the basics down)? Why should I create a component?
> > > > > After I create a component and Erlyweb creates the 3 extra files for
> > > > > me, which functions should I be implementing? What is triggered when?
>
> > > > > I'd be very grateful if anyone could clarify things, thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Sep 03, 2007 7:01 am Reply with quote
Guest
Can I see the configuration for your app in yaws.conf?

(Your appmods value should be <"/testapp", erlyweb> for your example to work)

On 9/2/07, Ghalib Suleiman <cowmoo@gmail.com> wrote:
>
> Thanks for the reply Yariv. Actually the module declarations do match,
> sorry for that typo in my original message.
>
> I removed testpage_view.erl (so now I have testpage_controller.erl,
> testpage_view.et, and the file testpage.erl), and made sure about
> matching module declarations and recompiled. I still have the same
> problem - 404 at http://localhost:8000/testapp/testpage Sad
>
> Is that URL automatically supposed to be valid upon creating the
> testpage component and compiling? I wonder if I'm missing some steps.
>
> Perhaps the fact that testpage.erl is blank...? I really don't know.
>
> Thanks.
>
> -Ghalib
>
> On Sep 3, 8:37 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > Hi,
> >
> > First, you don't need testpage_view.erl. It's enough to implement
> > index/1 in testpage_view.et, and ErlyWeb would call it directly,
> > passing into it the result of testpage_controller:index/1.
> >
> > One thing that looks suspicious in your code is that your file names
> > are testpage_controller.erl and testpage_view.erl, yet the module
> > declarations ('-module(stories_controller)' and
> > '-module(stories_view)') don't match the file names. Make sure that
> > the module declarations match the file names and try again accessinghttp://locahost:8000/testpage. (To be precise, you don't need
> > testpage_view.erl -- it's enough to implement testpage_view.et as an
> > ErlTL template, which doesn't include a module declaration anyways. To
> > make your example work, you only need to change the module declaration
> > in testpage_controller.erl.)
> >
> > Let me know if it works.
> >
> > Yariv
> >
> > On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
> >
> >
> >
> > > Correction: testpage_show.et contains:
> >
> > > <%@ show_testpage(Data) %>
> > > Data
> >
> > > On Sep 1, 3:14 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> > > > Ok, here is what I'm trying to do (obviously I am doing something
> > > > wrong, so if you could let me know, I'd be grateful Smile - I wanthttp://localhost:8000/testapp/testpagetoshow the text "testing":
> >
> > > > First I call erlyweb:create_app("testapp", "C:/test"). I add the
> > > > relevant bits to yaws.conf and restart, andhttp://localhost:8000/testapp
> > > > shows us the "Welcome to 'testapp' " page fine. Now I call
> > > > erlyweb:create_component("testpage", "C:/test/testapp").
> >
> > > > In testpage_controller.erl, I have:
> >
> > > > -module(stories_controller).
> > > > -erlyweb_magic(erlyweb_controller).
> > > > -export([index/1]).
> >
> > > > index(A) ->
> > > > {data, "testing"}.
> >
> > > > ------
> >
> > > > In testpage_view.erl, I have:
> >
> > > > -module(stories_view).
> > > > -erlyweb_magic(erlyweb_view).
> > > > -export([index/1]).
> >
> > > > index(Data) ->
> > > > testpage_show:show_testpage(Data).
> >
> > > > -----
> >
> > > > In testpage_show.et, I have:
> >
> > > > <%@ show_stories(Data) %>
> > > > Data
> >
> > > > -----
> >
> > > > What I want is the text "testing" to appear athttp://localhost:8000/testapp/testpage.
> > > > I called erlyweb:compile("C:/test/testapp"), and yet loadinghttp://localhost:8000/testapp/testpageinmy browser gives me a 404
> > > > Not Found error. What am I doing wrong?
> >
> > > > Cheers,
> > > > Ghalib
> >
> > > > On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> >
> > > > > Hi,
> >
> > > > > The tutorial is admittedly not very rich on the details, but the
> > > > > online documentation athttp://erlyweb.org/docshoulddemystifyhow
> > > > > components work, how controller functions map to urls, how views are
> > > > > invoked, etc. Are there any areas in the "official" documentation that
> > > > > you think aren't explained well enough?
> >
> > > > > Yariv
> >
> > > > > On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
> >
> > > > > > Hi, I'm a newbie to web stuff, although I do know a few programming
> > > > > > languages (including Erlang - though only as much as Armstrong's new
> > > > > > book teaches).
> >
> > > > > > To start with, all I want to make with Erlyweb is a page that allows
> > > > > > me to submit some text, where hitting submit puts the text in Mnesia,
> > > > > > and updates another page which shows that text. I'm looking at Yariv's
> > > > > > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > > > > > and while it may be crystal clear to some, for me it's a little bit
> > > > > > opaque. It tells me what to do for Yariv's specific example, but I
> > > > > > don't know why I should do any of those things.
> >
> > > > > > e.g. for the functionality I want, should I be creating a component
> > > > > > (the assumption is that there will be more advanced functionality
> > > > > > later once I get the basics down)? Why should I create a component?
> > > > > > After I create a component and Erlyweb creates the 3 extra files for
> > > > > > me, which functions should I be implementing? What is triggered when?
> >
> > > > > > I'd be very grateful if anyone could clarify things, thanks!
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Sep 03, 2007 7:57 am Reply with quote
Guest
<server localhost>
port = 8000
listen = 0.0.0.0
appmods = <"/testapp", erlyweb>
docroot = C:/test/testapp/www
<opaque>
appname = testapp
</opaque>
</server>

As I said above, http://localhost:8000/testapp shows me the welcome
text fine.

Also, if it helps any, I am on Windows (as you can tell from the
pathnames).

-Ghalib

On Sep 3, 11:00 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> Can I see the configuration for your app in yaws.conf?
>
> (Your appmods value should be <"/testapp", erlyweb> for your example to work)
>
> On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
>
>
> > Thanks for the reply Yariv. Actually the module declarations do match,
> > sorry for that typo in my original message.
>
> > I removed testpage_view.erl (so now I have testpage_controller.erl,
> > testpage_view.et, and the file testpage.erl), and made sure about
> > matching module declarations and recompiled. I still have the same
> > problem - 404 athttp://localhost:8000/testapp/testpage:(
>
> > Is that URL automatically supposed to be valid upon creating the
> > testpage component and compiling? I wonder if I'm missing some steps.
>
> > Perhaps the fact that testpage.erl is blank...? I really don't know.
>
> > Thanks.
>
> > -Ghalib
>
> > On Sep 3, 8:37 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > > Hi,
>
> > > First, you don't need testpage_view.erl. It's enough to implement
> > > index/1 in testpage_view.et, and ErlyWeb would call it directly,
> > > passing into it the result of testpage_controller:index/1.
>
> > > One thing that looks suspicious in your code is that your file names
> > > are testpage_controller.erl and testpage_view.erl, yet the module
> > > declarations ('-module(stories_controller)' and
> > > '-module(stories_view)') don't match the file names. Make sure that
> > > the module declarations match the file names and try again accessinghttp://locahost:8000/testpage. (To be precise, you don't need
> > > testpage_view.erl -- it's enough to implement testpage_view.et as an
> > > ErlTL template, which doesn't include a module declaration anyways. To
> > > make your example work, you only need to change the module declaration
> > > in testpage_controller.erl.)
>
> > > Let me know if it works.
>
> > > Yariv
>
> > > On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > Correction: testpage_show.et contains:
>
> > > > <%@ show_testpage(Data) %>
> > > > Data
>
> > > > On Sep 1, 3:14 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> > > > > Ok, here is what I'm trying to do (obviously I am doing something
> > > > > wrong, so if you could let me know, I'd be grateful Smile - I wanthttp://localhost:8000/testapp/testpagetoshowthe text "testing":
>
> > > > > First I call erlyweb:create_app("testapp", "C:/test"). I add the
> > > > > relevant bits to yaws.conf and restart, andhttp://localhost:8000/testapp
> > > > > shows us the "Welcome to 'testapp' " page fine. Now I call
> > > > > erlyweb:create_component("testpage", "C:/test/testapp").
>
> > > > > In testpage_controller.erl, I have:
>
> > > > > -module(stories_controller).
> > > > > -erlyweb_magic(erlyweb_controller).
> > > > > -export([index/1]).
>
> > > > > index(A) ->
> > > > > {data, "testing"}.
>
> > > > > ------
>
> > > > > In testpage_view.erl, I have:
>
> > > > > -module(stories_view).
> > > > > -erlyweb_magic(erlyweb_view).
> > > > > -export([index/1]).
>
> > > > > index(Data) ->
> > > > > testpage_show:show_testpage(Data).
>
> > > > > -----
>
> > > > > In testpage_show.et, I have:
>
> > > > > <%@ show_stories(Data) %>
> > > > > Data
>
> > > > > -----
>
> > > > > What I want is the text "testing" to appear athttp://localhost:8000/testapp/testpage.
> > > > > I called erlyweb:compile("C:/test/testapp"), and yet loadinghttp://localhost:8000/testapp/testpageinmybrowser gives me a 404
> > > > > Not Found error. What am I doing wrong?
>
> > > > > Cheers,
> > > > > Ghalib
>
> > > > > On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
>
> > > > > > Hi,
>
> > > > > > The tutorial is admittedly not very rich on the details, but the
> > > > > > online documentation athttp://erlyweb.org/docshoulddemystifyhow
> > > > > > components work, how controller functions map to urls, how views are
> > > > > > invoked, etc. Are there any areas in the "official" documentation that
> > > > > > you think aren't explained well enough?
>
> > > > > > Yariv
>
> > > > > > On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > > > > Hi, I'm a newbie to web stuff, although I do know a few programming
> > > > > > > languages (including Erlang - though only as much as Armstrong's new
> > > > > > > book teaches).
>
> > > > > > > To start with, all I want to make with Erlyweb is a page that allows
> > > > > > > me to submit some text, where hitting submit puts the text in Mnesia,
> > > > > > > and updates another page which shows that text. I'm looking at Yariv's
> > > > > > > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > > > > > > and while it may be crystal clear to some, for me it's a little bit
> > > > > > > opaque. It tells me what to do for Yariv's specific example, but I
> > > > > > > don't know why I should do any of those things.
>
> > > > > > > e.g. for the functionality I want, should I be creating a component
> > > > > > > (the assumption is that there will be more advanced functionality
> > > > > > > later once I get the basics down)? Why should I create a component?
> > > > > > > After I create a component and Erlyweb creates the 3 extra files for
> > > > > > > me, which functions should I be implementing? What is triggered when?
>
> > > > > > > I'd be very grateful if anyone could clarify things, thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Sep 03, 2007 8:27 am Reply with quote
Guest
Does it work if you set appmods to <"/", erlyweb>, and then try
http://localhost:8000/testpage?

If this doesn't help, try again after restarting yaws and calling
erlyweb:compile("c:/test/testapp", {auto_compile, true}). Also, make
sure your controller and view files are under
c:/test/testapp/src/components.

Let me know if any of this helps.

Yariv

On 9/3/07, Ghalib Suleiman <cowmoo@gmail.com> wrote:
>
> <server localhost>
> port = 8000
> listen = 0.0.0.0
> appmods = <"/testapp", erlyweb>
> docroot = C:/test/testapp/www
> <opaque>
> appname = testapp
> </opaque>
> </server>
>
> As I said above, http://localhost:8000/testapp shows me the welcome
> text fine.
>
> Also, if it helps any, I am on Windows (as you can tell from the
> pathnames).
>
> -Ghalib
>
> On Sep 3, 11:00 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > Can I see the configuration for your app in yaws.conf?
> >
> > (Your appmods value should be <"/testapp", erlyweb> for your example to work)
> >
> > On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
> >
> >
> >
> > > Thanks for the reply Yariv. Actually the module declarations do match,
> > > sorry for that typo in my original message.
> >
> > > I removed testpage_view.erl (so now I have testpage_controller.erl,
> > > testpage_view.et, and the file testpage.erl), and made sure about
> > > matching module declarations and recompiled. I still have the same
> > > problem - 404 athttp://localhost:8000/testapp/testpage:(
> >
> > > Is that URL automatically supposed to be valid upon creating the
> > > testpage component and compiling? I wonder if I'm missing some steps.
> >
> > > Perhaps the fact that testpage.erl is blank...? I really don't know.
> >
> > > Thanks.
> >
> > > -Ghalib
> >
> > > On Sep 3, 8:37 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > > > Hi,
> >
> > > > First, you don't need testpage_view.erl. It's enough to implement
> > > > index/1 in testpage_view.et, and ErlyWeb would call it directly,
> > > > passing into it the result of testpage_controller:index/1.
> >
> > > > One thing that looks suspicious in your code is that your file names
> > > > are testpage_controller.erl and testpage_view.erl, yet the module
> > > > declarations ('-module(stories_controller)' and
> > > > '-module(stories_view)') don't match the file names. Make sure that
> > > > the module declarations match the file names and try again accessinghttp://locahost:8000/testpage. (To be precise, you don't need
> > > > testpage_view.erl -- it's enough to implement testpage_view.et as an
> > > > ErlTL template, which doesn't include a module declaration anyways. To
> > > > make your example work, you only need to change the module declaration
> > > > in testpage_controller.erl.)
> >
> > > > Let me know if it works.
> >
> > > > Yariv
> >
> > > > On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
> >
> > > > > Correction: testpage_show.et contains:
> >
> > > > > <%@ show_testpage(Data) %>
> > > > > Data
> >
> > > > > On Sep 1, 3:14 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> > > > > > Ok, here is what I'm trying to do (obviously I am doing something
> > > > > > wrong, so if you could let me know, I'd be grateful Smile - I wanthttp://localhost:8000/testapp/testpagetoshowthe text "testing":
> >
> > > > > > First I call erlyweb:create_app("testapp", "C:/test"). I add the
> > > > > > relevant bits to yaws.conf and restart, andhttp://localhost:8000/testapp
> > > > > > shows us the "Welcome to 'testapp' " page fine. Now I call
> > > > > > erlyweb:create_component("testpage", "C:/test/testapp").
> >
> > > > > > In testpage_controller.erl, I have:
> >
> > > > > > -module(stories_controller).
> > > > > > -erlyweb_magic(erlyweb_controller).
> > > > > > -export([index/1]).
> >
> > > > > > index(A) ->
> > > > > > {data, "testing"}.
> >
> > > > > > ------
> >
> > > > > > In testpage_view.erl, I have:
> >
> > > > > > -module(stories_view).
> > > > > > -erlyweb_magic(erlyweb_view).
> > > > > > -export([index/1]).
> >
> > > > > > index(Data) ->
> > > > > > testpage_show:show_testpage(Data).
> >
> > > > > > -----
> >
> > > > > > In testpage_show.et, I have:
> >
> > > > > > <%@ show_stories(Data) %>
> > > > > > Data
> >
> > > > > > -----
> >
> > > > > > What I want is the text "testing" to appear athttp://localhost:8000/testapp/testpage.
> > > > > > I called erlyweb:compile("C:/test/testapp"), and yet loadinghttp://localhost:8000/testapp/testpageinmybrowser gives me a 404
> > > > > > Not Found error. What am I doing wrong?
> >
> > > > > > Cheers,
> > > > > > Ghalib
> >
> > > > > > On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> >
> > > > > > > Hi,
> >
> > > > > > > The tutorial is admittedly not very rich on the details, but the
> > > > > > > online documentation athttp://erlyweb.org/docshoulddemystifyhow
> > > > > > > components work, how controller functions map to urls, how views are
> > > > > > > invoked, etc. Are there any areas in the "official" documentation that
> > > > > > > you think aren't explained well enough?
> >
> > > > > > > Yariv
> >
> > > > > > > On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
> >
> > > > > > > > Hi, I'm a newbie to web stuff, although I do know a few programming
> > > > > > > > languages (including Erlang - though only as much as Armstrong's new
> > > > > > > > book teaches).
> >
> > > > > > > > To start with, all I want to make with Erlyweb is a page that allows
> > > > > > > > me to submit some text, where hitting submit puts the text in Mnesia,
> > > > > > > > and updates another page which shows that text. I'm looking at Yariv's
> > > > > > > > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > > > > > > > and while it may be crystal clear to some, for me it's a little bit
> > > > > > > > opaque. It tells me what to do for Yariv's specific example, but I
> > > > > > > > don't know why I should do any of those things.
> >
> > > > > > > > e.g. for the functionality I want, should I be creating a component
> > > > > > > > (the assumption is that there will be more advanced functionality
> > > > > > > > later once I get the basics down)? Why should I create a component?
> > > > > > > > After I create a component and Erlyweb creates the 3 extra files for
> > > > > > > > me, which functions should I be implementing? What is triggered when?
> >
> > > > > > > > I'd be very grateful if anyone could clarify things, thanks!
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Sep 03, 2007 8:56 am Reply with quote
Guest
Setting appmods to <"/", erlyweb> didn't work, same thing. My
controller and view files are in the directory you indicated.

I tried erlyweb:com pile("c:/test/testapp", {auto_compile, true})
and I got:

1> erlyweb:compile("C:/test/testapp", {auto_compile, true}).
** exited: {function_clause,[{lists,foldl,
[#Fun<erlyweb_compile.
0.117977794>,
["C:/test/testapp/src"],
{auto_compile,true}]},
{erlyweb_compile,compile,2},
{erl_eval,do_apply,5},
{shell,exprs,6},
{shell,eval_loop,3}]} **

=ERROR REPORT==== 3-Sep-2007::12:48:43 ===
Error in process <0.34.0> with exit value: {function_clause,
[{lists,foldl,[#Fun<
erlyweb_compile.0.117977794>,["C:/test/testapp/src"],
{auto_compile,true}]},{erl
yweb_compile,compile,2},{erl_eval,do_apply,5},{shell,exprs,6},
{shell,eval_loop,3
}]}

---------

But doing an erlyweb:compile("C:/test/testapp") seems to run ok.

On Sep 3, 12:26 pm, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> Does it work if you set appmods to <"/", erlyweb>, and then tryhttp://localhost:8000/testpage?
>
> If this doesn't help, try again after restarting yaws and calling
> erlyweb:compile("c:/test/testapp", {auto_compile, true}). Also, make
> sure your controller and view files are under
> c:/test/testapp/src/components.
>
> Let me know if any of this helps.
>
> Yariv
>
> On 9/3/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
>
>
> > <server localhost>
> > port = 8000
> > listen = 0.0.0.0
> > appmods = <"/testapp", erlyweb>
> > docroot = C:/test/testapp/www
> > <opaque>
> > appname = testapp
> > </opaque>
> > </server>
>
> > As I said above,http://localhost:8000/testappshows me the welcome
> > text fine.
>
> > Also, if it helps any, I am on Windows (as you can tell from the
> > pathnames).
>
> > -Ghalib
>
> > On Sep 3, 11:00 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > > Can I see the configuration for your app in yaws.conf?
>
> > > (Your appmods value should be <"/testapp", erlyweb> for your example to work)
>
> > > On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > Thanks for the reply Yariv. Actually the module declarations do match,
> > > > sorry for that typo in my original message.
>
> > > > I removed testpage_view.erl (so now I have testpage_controller.erl,
> > > > testpage_view.et, and the file testpage.erl), and made sure about
> > > > matching module declarations and recompiled. I still have the same
> > > > problem - 404 athttp://localhost:8000/testapp/testpage:(
>
> > > > Is that URL automatically supposed to be valid upon creating the
> > > > testpage component and compiling? I wonder if I'm missing some steps.
>
> > > > Perhaps the fact that testpage.erl is blank...? I really don't know.
>
> > > > Thanks.
>
> > > > -Ghalib
>
> > > > On Sep 3, 8:37 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > > > > Hi,
>
> > > > > First, you don't need testpage_view.erl. It's enough to implement
> > > > > index/1 in testpage_view.et, and ErlyWeb would call it directly,
> > > > > passing into it the result of testpage_controller:index/1.
>
> > > > > One thing that looks suspicious in your code is that your file names
> > > > > are testpage_controller.erl and testpage_view.erl, yet the module
> > > > > declarations ('-module(stories_controller)' and
> > > > > '-module(stories_view)') don't match the file names. Make sure that
> > > > > the module declarations match the file names and try again accessinghttp://locahost:8000/testpage. (To be precise, you don't need
> > > > > testpage_view.erl -- it's enough to implement testpage_view.et as an
> > > > > ErlTL template, which doesn't include a module declaration anyways. To
> > > > > make your example work, you only need to change the module declaration
> > > > > in testpage_controller.erl.)
>
> > > > > Let me know if it works.
>
> > > > > Yariv
>
> > > > > On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > > > Correction: testpage_show.et contains:
>
> > > > > > <%@ show_testpage(Data) %>
> > > > > > Data
>
> > > > > > On Sep 1, 3:14 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> > > > > > > Ok, here is what I'm trying to do (obviously I am doing something
> > > > > > > wrong, so if you could let me know, I'd be grateful Smile - I wanthttp://localhost:8000/testapp/testpagetoshowthetext "testing":
>
> > > > > > > First I call erlyweb:create_app("testapp", "C:/test"). I add the
> > > > > > > relevant bits to yaws.conf and restart, andhttp://localhost:8000/testapp
> > > > > > > shows us the "Welcome to 'testapp' " page fine. Now I call
> > > > > > > erlyweb:create_component("testpage", "C:/test/testapp").
>
> > > > > > > In testpage_controller.erl, I have:
>
> > > > > > > -module(stories_controller).
> > > > > > > -erlyweb_magic(erlyweb_controller).
> > > > > > > -export([index/1]).
>
> > > > > > > index(A) ->
> > > > > > > {data, "testing"}.
>
> > > > > > > ------
>
> > > > > > > In testpage_view.erl, I have:
>
> > > > > > > -module(stories_view).
> > > > > > > -erlyweb_magic(erlyweb_view).
> > > > > > > -export([index/1]).
>
> > > > > > > index(Data) ->
> > > > > > > testpage_show:show_testpage(Data).
>
> > > > > > > -----
>
> > > > > > > In testpage_show.et, I have:
>
> > > > > > > <%@ show_stories(Data) %>
> > > > > > > Data
>
> > > > > > > -----
>
> > > > > > > What I want is the text "testing" to appear athttp://localhost:8000/testapp/testpage.
> > > > > > > I called erlyweb:compile("C:/test/testapp"), and yet loadinghttp://localhost:8000/testapp/testpageinmybrowsergives me a 404
> > > > > > > Not Found error. What am I doing wrong?
>
> > > > > > > Cheers,
> > > > > > > Ghalib
>
> > > > > > > On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > The tutorial is admittedly not very rich on the details, but the
> > > > > > > > online documentation athttp://erlyweb.org/docshoulddemystifyhow
> > > > > > > > components work, how controller functions map to urls, how views are
> > > > > > > > invoked, etc. Are there any areas in the "official" documentation that
> > > > > > > > you think aren't explained well enough?
>
> > > > > > > > Yariv
>
> > > > > > > > On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > > > > > > Hi, I'm a newbie to web stuff, although I do know a few programming
> > > > > > > > > languages (including Erlang - though only as much as Armstrong's new
> > > > > > > > > book teaches).
>
> > > > > > > > > To start with, all I want to make with Erlyweb is a page that allows
> > > > > > > > > me to submit some text, where hitting submit puts the text in Mnesia,
> > > > > > > > > and updates another page which shows that text. I'm looking at Yariv's
> > > > > > > > > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > > > > > > > > and while it may be crystal clear to some, for me it's a little bit
> > > > > > > > > opaque. It tells me what to do for Yariv's specific example, but I
> > > > > > > > > don't know why I should do any of those things.
>
> > > > > > > > > e.g. for the functionality I want, should I be creating a component
> > > > > > > > > (the assumption is that there will be more advanced functionality
> > > > > > > > > later once I get the basics down)? Why should I create a component?
> > > > > > > > > After I create a component and Erlyweb creates the 3 extra files for
> > > > > > > > > me, which functions should I be implementing? What is triggered when?
>
> > > > > > > > > I'd be very grateful if anyone could clarify things, thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Sep 03, 2007 8:57 am Reply with quote
Guest
Re: Just to clarify my last comment on erlyweb:compile/1, the function
evaluates ok, printing "Compiling <various files>" and returning {ok,
Date}. But the 404 still persists.

On Sep 3, 12:55 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> Setting appmods to <"/", erlyweb> didn't work, same thing. My
> controller and view files are in the directory you indicated.
>
> I tried erlyweb:com pile("c:/test/testapp", {auto_compile, true})
> and I got:
>
> 1> erlyweb:compile("C:/test/testapp", {auto_compile, true}).
> ** exited: {function_clause,[{lists,foldl,
> [#Fun<erlyweb_compile.
> 0.117977794>,
> ["C:/test/testapp/src"],
> {auto_compile,true}]},
> {erlyweb_compile,compile,2},
> {erl_eval,do_apply,5},
> {shell,exprs,6},
> {shell,eval_loop,3}]} **
>
> =ERROR REPORT==== 3-Sep-2007::12:48:43 ===
> Error in process <0.34.0> with exit value: {function_clause,
> [{lists,foldl,[#Fun<
> erlyweb_compile.0.117977794>,["C:/test/testapp/src"],
> {auto_compile,true}]},{erl
> yweb_compile,compile,2},{erl_eval,do_apply,5},{shell,exprs,6},
> {shell,eval_loop,3
>
> }]}
>
> ---------
>
> But doing an erlyweb:compile("C:/test/testapp") seems to run ok.
>
> On Sep 3, 12:26 pm, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
>
> > Does it work if you set appmods to <"/", erlyweb>, and then tryhttp://localhost:8000/testpage?
>
> > If this doesn't help, try again after restarting yaws and calling
> > erlyweb:compile("c:/test/testapp", {auto_compile, true}). Also, make
> > sure your controller and view files are under
> > c:/test/testapp/src/components.
>
> > Let me know if any of this helps.
>
> > Yariv
>
> > On 9/3/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > <server localhost>
> > > port = 8000
> > > listen = 0.0.0.0
> > > appmods = <"/testapp", erlyweb>
> > > docroot = C:/test/testapp/www
> > > <opaque>
> > > appname = testapp
> > > </opaque>
> > > </server>
>
> > > As I said above,http://localhost:8000/testappshowsme the welcome
> > > text fine.
>
> > > Also, if it helps any, I am on Windows (as you can tell from the
> > > pathnames).
>
> > > -Ghalib
>
> > > On Sep 3, 11:00 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > > > Can I see the configuration for your app in yaws.conf?
>
> > > > (Your appmods value should be <"/testapp", erlyweb> for your example to work)
>
> > > > On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > > Thanks for the reply Yariv. Actually the module declarations do match,
> > > > > sorry for that typo in my original message.
>
> > > > > I removed testpage_view.erl (so now I have testpage_controller.erl,
> > > > > testpage_view.et, and the file testpage.erl), and made sure about
> > > > > matching module declarations and recompiled. I still have the same
> > > > > problem - 404 athttp://localhost:8000/testapp/testpage:(
>
> > > > > Is that URL automatically supposed to be valid upon creating the
> > > > > testpage component and compiling? I wonder if I'm missing some steps.
>
> > > > > Perhaps the fact that testpage.erl is blank...? I really don't know.
>
> > > > > Thanks.
>
> > > > > -Ghalib
>
> > > > > On Sep 3, 8:37 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > > > > > Hi,
>
> > > > > > First, you don't need testpage_view.erl. It's enough to implement
> > > > > > index/1 in testpage_view.et, and ErlyWeb would call it directly,
> > > > > > passing into it the result of testpage_controller:index/1.
>
> > > > > > One thing that looks suspicious in your code is that your file names
> > > > > > are testpage_controller.erl and testpage_view.erl, yet the module
> > > > > > declarations ('-module(stories_controller)' and
> > > > > > '-module(stories_view)') don't match the file names. Make sure that
> > > > > > the module declarations match the file names and try again accessinghttp://locahost:8000/testpage. (To be precise, you don't need
> > > > > > testpage_view.erl -- it's enough to implement testpage_view.et as an
> > > > > > ErlTL template, which doesn't include a module declaration anyways. To
> > > > > > make your example work, you only need to change the module declaration
> > > > > > in testpage_controller.erl.)
>
> > > > > > Let me know if it works.
>
> > > > > > Yariv
>
> > > > > > On 9/2/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > > > > Correction: testpage_show.et contains:
>
> > > > > > > <%@ show_testpage(Data) %>
> > > > > > > Data
>
> > > > > > > On Sep 1, 3:14 pm, Ghalib Suleiman <cow...@gmail.com> wrote:
> > > > > > > > Ok, here is what I'm trying to do (obviously I am doing something
> > > > > > > > wrong, so if you could let me know, I'd be grateful Smile - I wanthttp://localhost:8000/testapp/testpagetoshowthetext"testing":
>
> > > > > > > > First I call erlyweb:create_app("testapp", "C:/test"). I add the
> > > > > > > > relevant bits to yaws.conf and restart, andhttp://localhost:8000/testapp
> > > > > > > > shows us the "Welcome to 'testapp' " page fine. Now I call
> > > > > > > > erlyweb:create_component("testpage", "C:/test/testapp").
>
> > > > > > > > In testpage_controller.erl, I have:
>
> > > > > > > > -module(stories_controller).
> > > > > > > > -erlyweb_magic(erlyweb_controller).
> > > > > > > > -export([index/1]).
>
> > > > > > > > index(A) ->
> > > > > > > > {data, "testing"}.
>
> > > > > > > > ------
>
> > > > > > > > In testpage_view.erl, I have:
>
> > > > > > > > -module(stories_view).
> > > > > > > > -erlyweb_magic(erlyweb_view).
> > > > > > > > -export([index/1]).
>
> > > > > > > > index(Data) ->
> > > > > > > > testpage_show:show_testpage(Data).
>
> > > > > > > > -----
>
> > > > > > > > In testpage_show.et, I have:
>
> > > > > > > > <%@ show_stories(Data) %>
> > > > > > > > Data
>
> > > > > > > > -----
>
> > > > > > > > What I want is the text "testing" to appear athttp://localhost:8000/testapp/testpage.
> > > > > > > > I called erlyweb:compile("C:/test/testapp"), and yet loadinghttp://localhost:8000/testapp/testpageinmybrowsergivesme a 404
> > > > > > > > Not Found error. What am I doing wrong?
>
> > > > > > > > Cheers,
> > > > > > > > Ghalib
>
> > > > > > > > On Aug 28, 2:02 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
>
> > > > > > > > > Hi,
>
> > > > > > > > > The tutorial is admittedly not very rich on the details, but the
> > > > > > > > > online documentation athttp://erlyweb.org/docshoulddemystifyhow
> > > > > > > > > components work, how controller functions map to urls, how views are
> > > > > > > > > invoked, etc. Are there any areas in the "official" documentation that
> > > > > > > > > you think aren't explained well enough?
>
> > > > > > > > > Yariv
>
> > > > > > > > > On 8/26/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > > > > > > > Hi, I'm a newbie to web stuff, although I do know a few programming
> > > > > > > > > > languages (including Erlang - though only as much as Armstrong's new
> > > > > > > > > > book teaches).
>
> > > > > > > > > > To start with, all I want to make with Erlyweb is a page that allows
> > > > > > > > > > me to submit some text, where hitting submit puts the text in Mnesia,
> > > > > > > > > > and updates another page which shows that text. I'm looking at Yariv's
> > > > > > > > > > post athttp://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erl...,
> > > > > > > > > > and while it may be crystal clear to some, for me it's a little bit
> > > > > > > > > > opaque. It tells me what to do for Yariv's specific example, but I
> > > > > > > > > > don't know why I should do any of those things.
>
> > > > > > > > > > e.g. for the functionality I want, should I be creating a component
> > > > > > > > > > (the assumption is that there will be more advanced functionality
> > > > > > > > > > later once I get the basics down)? Why should I create a component?
> > > > > > > > > > After I create a component and Erlyweb creates the 3 extra files for
> > > > > > > > > > me, which functions should I be implementing? What is triggered when?
>
> > > > > > > > > > I'd be very grateful if anyone could clarify things, thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Mon Sep 03, 2007 4:55 pm Reply with quote
Guest
Oops, I gave you the wrong instruction. It's
'erlyweb:compile("C:/test/testapp", [{auto_compile, true}]).' (the
second parameter is a list).



On 9/3/07, Ghalib Suleiman <cowmoo@gmail.com> wrote:
>
> Setting appmods to <"/", erlyweb> didn't work, same thing. My
> controller and view files are in the directory you indicated.
>
> I tried erlyweb:com pile("c:/test/testapp", {auto_compile, true})
> and I got:
>
> 1> erlyweb:compile("C:/test/testapp", {auto_compile, true}).
> ** exited: {function_clause,[{lists,foldl,
> [#Fun<erlyweb_compile.
> 0.117977794>,
> ["C:/test/testapp/src"],
> {auto_compile,true}]},
> {erlyweb_compile,compile,2},
> {erl_eval,do_apply,5},
> {shell,exprs,6},
> {shell,eval_loop,3}]} **
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Tue Sep 04, 2007 4:32 am Reply with quote
Guest
Still nothing...same effect as erlyweb:compile/1 :-/

On Sep 3, 8:55 pm, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> Oops, I gave you the wrong instruction. It's
> 'erlyweb:compile("C:/test/testapp", [{auto_compile, true}]).' (the
> second parameter is a list).
>
> On 9/3/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
>
>
> > Setting appmods to <"/", erlyweb> didn't work, same thing. My
> > controller and view files are in the directory you indicated.
>
> > I tried erlyweb:com pile("c:/test/testapp", {auto_compile, true})
> > and I got:
>
> > 1> erlyweb:compile("C:/test/testapp", {auto_compile, true}).
> > ** exited: {function_clause,[{lists,foldl,
> > [#Fun<erlyweb_compile.
> > 0.117977794>,
> > ["C:/test/testapp/src"],
> > {auto_compile,true}]},
> > {erlyweb_compile,compile,2},
> > {erl_eval,do_apply,5},
> > {shell,exprs,6},
> > {shell,eval_loop,3}]} **


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Wed Sep 05, 2007 6:45 am Reply with quote
Guest
Hmm... maybe it's a Windows issue I'm not seeing on the Mac. Is anyone
using ErlyWeb on Windows sucessfully?

There's one more thing you can try... In the yaws shell, type
'testapp_erlyweb_data:components().', and let me know what result
this function returns.

On 9/3/07, Ghalib Suleiman <cowmoo@gmail.com> wrote:
>
> Still nothing...same effect as erlyweb:compile/1 :-/
>
> On Sep 3, 8:55 pm, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > Oops, I gave you the wrong instruction. It's
> > 'erlyweb:compile("C:/test/testapp", [{auto_compile, true}]).' (the
> > second parameter is a list).
> >
> > On 9/3/07, Ghalib Suleiman <cow...@gmail.com> wrote:
> >
> >
> >
> > > Setting appmods to <"/", erlyweb> didn't work, same thing. My
> > > controller and view files are in the directory you indicated.
> >
> > > I tried erlyweb:com pile("c:/test/testapp", {auto_compile, true})
> > > and I got:
> >
> > > 1> erlyweb:compile("C:/test/testapp", {auto_compile, true}).
> > > ** exited: {function_clause,[{lists,foldl,
> > > [#Fun<erlyweb_compile.
> > > 0.117977794>,
> > > ["C:/test/testapp/src"],
> > > {auto_compile,true}]},
> > > {erlyweb_compile,compile,2},
> > > {erl_eval,do_apply,5},
> > > {shell,exprs,6},
> > > {shell,eval_loop,3}]} **
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Wed Sep 05, 2007 7:12 am Reply with quote
Guest
I get {0, nil}. That's probably bad, right?

On Sep 5, 10:45 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> Hmm... maybe it's a Windows issue I'm not seeing on the Mac. Is anyone
> using ErlyWeb on Windows sucessfully?
>
> There's one more thing you can try... In the yaws shell, type
> 'testapp_erlyweb_data:components().', and let me know what result
> this function returns.
>
> On 9/3/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
>
>
> > Still nothing...same effect as erlyweb:compile/1 :-/
>
> > On Sep 3, 8:55 pm, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> > > Oops, I gave you the wrong instruction. It's
> > > 'erlyweb:compile("C:/test/testapp", [{auto_compile, true}]).' (the
> > > second parameter is a list).
>
> > > On 9/3/07, Ghalib Suleiman <cow...@gmail.com> wrote:
>
> > > > Setting appmods to <"/", erlyweb> didn't work, same thing. My
> > > > controller and view files are in the directory you indicated.
>
> > > > I tried erlyweb:com pile("c:/test/testapp", {auto_compile, true})
> > > > and I got:
>
> > > > 1> erlyweb:compile("C:/test/testapp", {auto_compile, true}).
> > > > ** exited: {function_clause,[{lists,foldl,
> > > > [#Fun<erlyweb_compile.
> > > > 0.117977794>,
> > > > ["C:/test/testapp/src"],
> > > > {auto_compile,true}]},
> > > > {erlyweb_compile,compile,2},
> > > > {erl_eval,do_apply,5},
> > > > {shell,exprs,6},
> > > > {shell,eval_loop,3}]} **


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 3
Goto page 1, 2, 3  Next
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum