Mathias L. Baumann | 2 Nov 03:22 2008

Example for Wt::WSocketNotifier

Hey there,

It is now time to have a closer look at witty for me.
I looked at the suggested methodes and using the Wt::WSocketNotifier
sounds nice, but I can't figure out how.

At the moment, I use asio with async sockets. I would need to connect  
those operations/sockets with
the Wt::WSocketNotifier, but i can't find neither an callback function, a  
connect method nor any possiblity to
pass a socket, only an int parameter.. do you use low-level OS sockets  
instead of the asio abstraction there?
and how would I get the signal then

--Mathias

On Mon, 01 Sep 2008 18:38:55 +0200, Wim Dumon <wim@...> wrote:

> Hello Mathias,
>
> Yes you can.
> You will probably need the update lock for synchronisation purposes:
> http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WApplication_1_1UpdateLock.html
>
> Or, as an alternative, you may consider to use SocketNotifier:
> http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WSocketNotifier.html
> In this case, wt will keep track of events on your file descriptors
> and invoke slots when events occur.
>
> Regards,
(Continue reading)

Koen Deforche | 3 Nov 12:41 2008
Picon

Re: Example for Wt::WSocketNotifier

Hey Mathias,

2008/11/2 Mathias L. Baumann <anonym001@...>:
> It is now time to have a closer look at witty for me.
> I looked at the suggested methodes and using the Wt::WSocketNotifier
> sounds nice, but I can't figure out how.
>
> At the moment, I use asio with async sockets. I would need to connect
> those operations/sockets with
> the Wt::WSocketNotifier, but i can't find neither an callback function, a
> connect method nor any possiblity to
> pass a socket, only an int parameter.. do you use low-level OS sockets
> instead of the asio abstraction there?

Yes. We use native file descriptors here. Currently we do not expose
any asio API in Wt because use of asio is limited to only of the two
connectors (wthttpd and not fcgi).

So you need to pass a socket file descriptor.

> and how would I get the signal then

There is an activated<> signal which you can connect to a slot to do
some socket operations.

We will add a socket notifier example to clarify the usage.

Regards,
koen

(Continue reading)

Koen Deforche | 3 Nov 15:35 2008
Picon

Wt 2.2.1 released.

Hey all,

We have uploaded Wt 2.2.1 was uploaded to sourceforge.

As usual, this release is a mix of bug fixes, improvements, and new
features. All changes were recorded in the Changelog.

The most note-worthy new additions:

 - The WAbstractItemModel interface and the WStandardItemModel
implementation now support hierarchical models. This may break
existing code if you have implemented your own model or implemented
your own view class (see the release notes
[http://www.webtoolkit.eu/wt/doc/reference/html/Releasenotes.html] for
details).

 - The WTreeView widget uses the new WAbstractItemModel to implement
an MVC-based tree (table) view component. Learning from existing
experience with WTreeTable and Ext::TableView, this widget has been
designed to be able to deal with large models. Not only is data loaded
incrementally as you expand nodes, also only visible nodes are loaded
into the browser (with some margin). Invisible nodes are stubbed and
replaced with real content as needed. In this way we support
arbitrarily large models with constant memory usage both in the
browser and the server, and a responsive user interface. See the new
treeview example for how to use it (this example is not yet available
online).

Development on this widget is ongoing. Most notably, there is not yet
any support for editing the underlying model, and no general support
(Continue reading)

Anthony Roger Buck | 4 Nov 20:04 2008

Standards & seamless home page degradation...

Hi all,

   I have posed this query before (well of a similar vein) but got a 
"not important enough" reply, however i have come back as yet again it 
has stopped me using the framework with a client. What is main reason 
for improving standards compliance on the "home" page? How difficult 
would it be to change from the current to something complient such as:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; 
charset=iso-8859-1">
        <meta http-equiv='X-UA-Compatible' content='IE=7'>
        <script type='text/javascript'>
            <!--
            /*<![CDATA[*/

            (function(){

                function loadScript(uri){
                    var s = document.createElement('script');

                ......... etc ...........

            })();

            var isLoaded = false;

(Continue reading)

Koen Deforche | 4 Nov 21:56 2008
Picon

Re: Standards & seamless home page degradation...

Hey Anthony,

2008/11/4 Anthony Roger Buck <roja@...>:
> Hi all,
>
>   I have posed this query before (well of a similar vein) but got a
> "not important enough" reply, however i have come back as yet again it
> has stopped me using the framework with a client. What is main reason

We're sorry to hear that. Did your client demand "compliance" based on
the validators offered at w3.org?

> for improving standards compliance on the "home" page? How difficult
> would it be to change from the current to something complient such as:
>
>        </div>
>        <noscript>
>            <div id='script-disabled-page'>
>                <!-- body contents of
> "this.wt?wtd=CwcRUydp5bmwnmEXL9UN3nQvIym5ZxXV&amp;js=no" //-->
>            </div>
>        </noscript>

I understand the approach. However, it does not fit very well with our
API: it is assumed that when you create the widget tree you know
whether your application supports JavaScript, so that you can take
that into account.

In your approach, you would need to first construct your widget tree
assuming no support for JavaScript, and then afterwards either
(Continue reading)

Dushan Savich | 5 Nov 01:57 2008
Picon

[My own Hello World app problem ] Dedicated session processes for test2 terminated cleanly

Hi,

    I've managed to compile Wt libs and to run examples properly. 

    The next step was to set up my own   Hello World project.


    Well,  I've started the project with :

    # ./test2.wt   --docroot . --http-address 0.0.0.0   --http-port 8888


    When I try to open   0.0.0.0:8888 from firefox  I get     404  Error .

     And few seconds later ,from console  , I get the folowing message:


    Dedicated session processes for test2 terminated cleanly.


And it shouldn't  :)  



Now, since the examples work just fine , I'm sure I've just messed something up in my own project ( read CMakeLists.txt file  :)  ) , but I don't know what :)

 

    I've simply    Copy+Pasted a   wt's  hello world example into my own  test2.cpp  file    , so the source itself should not make any trouble :)  .




    Complete project  ( two files :)   )  can be downloaded from here : http://www.stosha.net/test2.tar.gz


Thanks in advance ,

Dushan



P.S :  Here are the CMakeList.txt  and console output.

//-----------------------------------------------------------------------

PROJECT(MY_TEST2)


ADD_EXECUTABLE(test2.wt test2.cpp)

#Boost and Wt are installed there 
#INCLUDE_DIRECTORIES()
INCLUDE_DIRECTORIES(/home/dule/stylet/libs/3rdParty/wt-2.1.0/src/wt)
INCLUDE_DIRECTORIES(/usr/local/include)
LINK_DIRECTORIES(/usr/local/lib)


TARGET_LINK_LIBRARIES(test2.wt  wtfcgi wt
            boost_thread-gcc41-mt
            boost_program_options-gcc41-mt-1_35
            boost_system-gcc41-mt-1_35
            boost_signals-gcc41-mt-1_35   
            libboost_iostreams-gcc41-mt.so)



//------------------------------------EOF-----------------------------







Console output  :




dule <at> dule-laptop:~/stylet/projects/gym-ace-web-verzija/test/test2/build$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.6)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/dule/stylet/projects/gym-ace-web-verzija/test/test2/build
dule <at> dule-laptop:~/stylet/projects/gym-ace-web-verzija/test/test2/build$ make
Scanning dependencies of target test2.wt
[100%] Building CXX object CMakeFiles/test2.wt.dir/test2.o
Linking CXX executable test2.wt
[100%] Built target test2.wt
dule <at> dule-laptop:~/stylet/projects/gym-ace-web-verzija/test/test2/build$ ./test2.wt   --docroot . --http-address 0.0.0.0   --http-port 8888
Reading Wt configuration from: /etc/wt/wt_config.xml
 binding property 'resources' with value 'resources/
 binding property 'extBaseURL' with value 'ext/
Dedicated session processes for test2 terminated cleanly.






Attachment (test2.tar.gz): application/x-gzip, 2202 bytes
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
witty-interest mailing list
witty-interest@...
https://lists.sourceforge.net/lists/listinfo/witty-interest
Koen Deforche | 5 Nov 07:34 2008
Picon

Re: [My own Hello World app problem ] Dedicated session processes for test2 terminated cleanly

Hey Dushan,

2008/11/5 Dushan Savich <dule@...>:
>     # ./test2.wt   --docroot . --http-address 0.0.0.0   --http-port 8888
>
>     When I try to open   0.0.0.0:8888 from firefox  I get     404  Error .
>
>      And few seconds later ,from console  , I get the folowing message:
>
>     Dedicated session processes for test2 terminated cleanly.
>
> And it shouldn't  :)

You have linked against wtfcgi, which is the FastCGI connector used
when running within a web server like Apache.

What you probably want is to link against wthttp, which will give you
a built-in httpd.

> TARGET_LINK_LIBRARIES(test2.wt  wtfcgi wt

Change wtfcgi with wthttp and you should be fine.

Regard,
koen

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Wim Dumon | 5 Nov 08:36 2008
Picon

Re: [My own Hello World app problem ] Dedicated session processes for test2 terminated cleanly

2008/11/5 Koen Deforche <koen@...>:
> Hey Dushan,
>
> 2008/11/5 Dushan Savich <dule@...>:
>>     # ./test2.wt   --docroot . --http-address 0.0.0.0   --http-port 8888
>>
>>     When I try to open   0.0.0.0:8888 from firefox  I get     404  Error .
>>

And secondly, the right address to open is 127.0.0.1:8888. '0.0.0.0'
as parameter to --http-address means 'listen on any local address'.

Regards,
Wim.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Brad Hubbard | 5 Nov 10:47 2008

Re: Wt 2.2.1 released.

Koen Deforche wrote:
Hey all, We have uploaded Wt 2.2.1 was uploaded to sourceforge.
Version Date Description
Wt 2.2.1 Nov, 3, 2008 Wt 2.2.4 source and documentation

>From the download page, shouldn't it be "Wt 2.2.1 source and documentation" or am I missing something?

Downloaded, built and played with this today. The widgetgallery example is terrrific, great work to all involved. Do you guys do this full time? Things seem to move pretty fast.

Kindest regards,
Brad Hubbard
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
witty-interest mailing list
witty-interest@...
https://lists.sourceforge.net/lists/listinfo/witty-interest
Wim Dumon | 5 Nov 11:18 2008
Picon

Re: Wt 2.2.1 released.

2008/11/5 Brad Hubbard <wt@...>:
>
> Version Date Description
> Wt 2.2.1 Nov, 3, 2008 Wt 2.2.4 source and documentation
> >From the download page, shouldn't it be "Wt 2.2.1 source and documentation"
> or am I missing something?
>

I suppose that was wishful thinking on our part. We corrected it, thank you.

> Downloaded, built and played with this today. The widgetgallery example is
> terrrific, great work to all involved. Do you guys do this full time? Things
> seem to move pretty fast.
>

Yes, emweb (http://www.emweb.be/) is committed to further develop Wt,
support it and develop Wt based applications.

Regards,
Wim.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane