Project

General

Profile

Customization Wt::Auth:AuthWidget

Added by Noname Noname about 10 years ago

Hi, guys

I have spent a lot of time with Wt to get authentication page.

But still i have only an login page from example.

I would like to use Wt for building web applications, but it takes me a lot of time to understand what i need to do for page customization.

I don't search for easy ways, but i think there is a lack of Wt documentation.

I suppose it is the reason why Wt is still not popular, consider that Wt project is not so young.

The last time i was thinking to give up and try do it on python...

Please, help me to how can customize Wt::Auth:AuthWidget?

Thank you, Noname


Replies (10)

RE: Customization Wt::Auth:AuthWidget - Added by Koen Deforche about 10 years ago

Hey,

Have you looked at the qrlogin and feature/auth1 and feature/auth2 examples?

They show how to extend or customize the authentication framework.

If you want to get a good understanding, you will need to get familiar with the basic concepts in Wt (which are really not that many): widgets, WTemplate and WTemplateFormView.

As to why Wt is still not "popular": I believe that's really tied to the language and the general misconception that C would not be suitable for building a web application (because ... well just because). If you limit your search to C developers, then you'll find that it is actually quite popular.

[

As a side-note, I believe Wt attracts two kinds of developers:

  • seasoned C developers that have a need to build a web application. These developers generally fair well, and struggle mostly with CSS. Some of them have Qt experience which will certainly help, but many don't.
  • web developers with little or no experience in C; I do not really know how they come to Wt, but can guess it's because they are frustrated with (development / runtime) efficiency in other platforms, or it's because they want to learn C, or it's because they like Wt for some of its features. My advice to to them is to take it slow, take the time to learn C, which you can do with or without Wt, and follow the tutorial. We've seen people learn C and Wt and over time become really good at both. They also should unlearn many things (like thinking terms of pages or request/responses).

]

Regards,

koen

RE: Customization Wt::Auth:AuthWidget - Added by Noname Noname about 10 years ago

Hi, Koen

Thank you for reply.

I have used auth1 example.

I am already familiar with widget, but WTemplate and WTemplateFormView i need to investigate.

Hope i will cope with it.

Regarding to popularity of Wt. You are right, i think it is most popular C framework for web.

But still, in my point of view, it is needed to be more documented, because it is the main obstacle to start using Wt.

I think it would be great to have tutorial where will be demonstrated using of Wt from Hello world page to complex site.

Regarding kind of developers.

I am c developer with more than 3 years commercial development on server side.

I haven't use Qt, but i read about it architecture basis and i like it.

I believe that C could be used for Web.

I hope I will reach my current goal to develop needed skills for developing with Wt.

Already i have written on my blog about how to install Wt on debian wheezy and how to check that Wt it is installed properly.

I would continue promotion of Wt on my way.

Koen, thank you for support.

It is very important for me, because till this time i filled myself alone with Wt.

RE: Customization Wt::Auth:AuthWidget - Added by I. Lazaridis about 10 years ago

Noname Noname wrote:

Hi, guys

(nice name, noname!)

I understand your troubles with the documentation and you should know that I (as an experienced developer) have problems, too.

It's not only the documentation, but the code itself. If you look at the usage of the Wt::Auth module in some examples, you'll see that they contain again and again the same code. This shows that the library is not abstracted enough.

You can take a look here:

https://github.com/lazaridis-com/wt-starter

Possibly in a few days you'll find some code for the Wt::Auth module.

I do this mainly in order to decide if I use wt or not (for future long-term projects). Because it's not only important to have a good library, but its the same important to have good code, docs, project resources.

Wt has several deficits in those domains, and seeing the attitude of the developers, it does not seem that this will change.

So, for you (if you finally can't make it), python django or ruby rails maybe the solution. Another option is the wakanda studio (full javascript, client and server-side).

RE: Customization Wt::Auth:AuthWidget - Added by Noname Noname about 10 years ago

Thank you for your reply and support.

I agree with you that documentation is not only the one problem.

It is needed to increase quality of examples also, because examples should demonstrate basic technics with Wt.

I am still on stage of deciding use Wt or not, but i am not going to give up easy.

I want to experience development with Wt and if Wt won't be usable I'll start to use python.

Your advices regarding python and ruby are wise.

I appreciate your reply, wish you all the best.

RE: Customization Wt::Auth:AuthWidget - Added by IW M about 10 years ago

As a side-note, I believe Wt attracts two kinds of developers:

* seasoned C developers that have a need to build a web application. These developers generally fair well, and struggle mostly with CSS. Some of them have Qt experience which will certainly help, but many don't.

* web developers with little or no experience in C; I do not really know how they come to Wt, but can guess it's because they are frustrated with (development / runtime) efficiency in other platforms, or it's because they want to learn C, or it's because they like Wt for some of its features. My advice to to them is to take it slow, take the time to learn C, which you can do with or without Wt, and follow the tutorial. We've seen people learn C and Wt and over time become really good at both. They also should unlearn many things (like thinking terms of pages or request/responses).

PHP developer here, with crude C skills. I'm looking for lean and mean for data intensive application.

It's not only the documentation, but the code itself. If you look at the usage of the Wt::Auth module in some examples, you'll see that they contain again and again the same code. This shows that the library is not abstracted enough.

Abstracted enough for?...

I had a heck of a time for my first run - just installing. But I'm starting to see the picture, and how Wt can be a benefit for the right developers and skillset. I don't believe Wt is meant to be as turn-key, do all out of the box for absolutely everyone as you expect it to be. If it where abstracted to the level you think it should be, It could be detrimental to those that are using with success.

I am here partially because it allows me to dig in a bit.

RE: Customization Wt::Auth:AuthWidget - Added by Marco M about 10 years ago

Noname Noname wrote:

Please, help me to how can customize Wt::Auth:AuthWidget?

If you read the documentation, you'll see that AuthWidget inherits from WTemplate.

All the GUI customization of Wt is done with CSS and WTemplate. Quite powerful.

I keep seeing people complaining about Wt, and at the same time it is clear they haven't read the documentation that is available...

RE: Customization Wt::Auth:AuthWidget - Added by I. Lazaridis about 10 years ago

IW M wrote:

[...]

> It's not only the documentation, but the code itself. If you look at the usage of the Wt::Auth module in some examples, you'll see that they contain again and again the same code. This shows that the library is not abstracted enough.

Abstracted enough for?...

[...]

If it where abstracted to the level you think it should be, It could be detrimental to those that are using with success.

Please, I simply state the obvious things: code-repetition when using a library shows that there is work to do for the library developer.

RE: Customization Wt::Auth:AuthWidget - Added by I. Lazaridis about 10 years ago

Koen Deforche wrote:

[...]

As a side-note, I believe Wt attracts two kinds of developers:

* seasoned C developers that have a need to build a web application. These developers generally fair well, and struggle mostly with CSS. Some of them have Qt experience which will certainly help, but many don't.

[...]

If the core-developer writes docu, tutorials, website and finally makes assumptions about the user-base, then it leads to the situation with wt.

No sane "seasoned" C developer likes to waste time for the teach-in.

Especially not for a commercial library (as Wt is).

RE: Customization Wt::Auth:AuthWidget - Added by I. Lazaridis about 10 years ago

After running into several problems with a complete example ( Hangman Example, Auth Session vs. Db Session ), I looked at the simpler Auth1 example and the tutorial http://www.webtoolkit.eu/wt/doc/tutorial/auth.html.

Next, we define a session class, which encapsulates the connection to the database to store authentication information, 
and which also tracks the user currently logged in, in a web session. We choose to use the Wt::Dbo::Session class as a 
base class (which could just as well be an embedded member).

Later on, we’ll see how each web session will instantiate its own persistence/authentication Session object.

This sounds so nice, but when looking at the code... nothing is clear. Interweaving persistence/authentication, inheriting from Dbo::Session instead of using an independent class (and keep it e.g. as an embedded member, as stated, or as a seperate class)... this makes understanding of the code and the concepts difficult.

But the biggest problem is: the library author does not realize the bad quality of the examples.

The example code must be decoupled! Separate classes for persistence, separate for authentication, separate for widget. It is not acceptable for a tutorial to have such a interweaved code.

-

Core developers should do one thing: core development. They should not write examples for their own code - they are just to familiar with it.

The wt project should really accept this defect and act, instead of trying to justify what cannot be justified:

missing clarity and simplicity in the examples/tutorials.

-

The wt-starter contains now a draft of an auth example, see:

https://github.com/lazaridis-com/wt-starter

RE: Customization Wt::Auth:AuthWidget - Added by I. Lazaridis about 10 years ago

Koen Deforche wrote:

Hey,

Have you looked at the qrlogin and feature/auth1 and feature/auth2 examples?

see issue #2880

    (1-10/10)