Skip to content


Subversion checkout URL

You can clone with
Download ZIP
perlish Application Server
JavaScript Perl HTML CSS

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin only using yotedb from now on
doc added stringify override for Yote::Obj
extra_test only using yotedb from now on
xt/author fixed nit with admin page
yote_root/html added stringify override for Yote::Obj
Build.PL added stringify override for Yote::Obj
ChangeLog added stringify override for Yote::Obj
LICENSE added liscence file and fixed a serious js bug
MANIFEST.SKIP Updated manifest file and builds
README removed crashing debug statement in YoteRoot
ToDo.txt only using yotedb from now on
tasklog incremented version. updated tasklog



    Yote is a platform for creating web based applications by bridging
    client side javascript with server side, automatically persistent perl
    objects. Yote provides javascript objects with methods that map to their
    server side counterparts. 

    Yote also is a simple web server as well as an app server.

    As of this writing Yote is on version 0.1000.
    It is in alpha mode.
    Please email to report bugs or issues or 
    feature requests.

    *   perl version 5.10

Install Yote
	$ export INSTALL_BASE=/usr/local/yote #optional. default is /usr/local/yote
	$ export YOTEPORT=8008 #optional      #optional. default is 8008

	$ # Thru CPAN ---	

	$ cpan Yote

	$ #  OR ---
        $ perl Build.PL 
        $ ./Build
        $ ./Build test
        $ ./Build install

Verify by running html test
      $ yote_server
      open http://<myhost>/yote/unit_tests.html

Using Yote
  Start the Web App Server
    Starting the Web App Server from the command line:

           $ yote_server --port=8008 # default is port set up with, or 8008

    This starts the server on the default port (8008), using SQLiteIO, and
    writing to file ~/.yote/SQLite.yote.db.

    Starting the Web App Server from a package:

           use Yote::WebAppServer;

           my $server = new Yote::WebAppServer();

           $server->start_server( port       => 8008,
	                          webroot    => 'path/to/my/html/files', 
				  sqlitefile => 'yote.database_filename' );

  Coding with Yote
   Client Side
           <script src="/yote/js/jquery-latest.js"></script>
    	   <script src="/yote/js/jquery.dumper.js"></script>
     	   <script src="/yote/js/jquery.cookie.js"></script>
    	   <script src="/yote/js/jquery.base64.min.js"></script>
    	   <script src="/yote/js/json2.js"></script>
    	   <script src="/yote/js/yote.js"></script>
    	   <script src="/yote/js/yote.util.js"></script>
    	   <script src="/yote/js/yote.system.util.js"></script>

	       /* Get the account root singleton object. */
               var hello_app = $.yote.fetch_app( 'Yote::Hello' );

	       /* Returns a string. If the method results in changes in other
	          javascript objects, those objects will automatically be updated. */
               var result = hello_app.hello( { name:"fred" } );

	       /* Returns a counter object */
               var counter = hello_app.get_counter();

	       alert( 'server said ' + result );
	       alert( 'counter in server has count of ' + counter.get_count() );

   Server Side
        package Yote::Hello;

        use strict;
        use Yote::Obj;

	# Any subclass of Yote::AppRoot will have a singleton instance in the Yote engine
	# that will be returned to the client with '$.yote.fetch_app( "app classname" )'.
        use base 'Yote::AppRoot';

	# Init is called only the very first time an Yote::AppRoot is instantiated. 
	# This is not called when this object is retreived from storage.
        sub init {

            my $self = shift;

	    # 'get_counter' does not need an explicit definition. 
	    # A get_ method passed an argument will initialize the field if it is undefined.
            my $counter = $self->get_counter( new Yote::Obj() );

        } #init

	# Any server side method takes 3 optional arguments on the client side :
	#       data, onSucceedFunction, onFailFunction
	# Conversely, any server side method takes 3 automatically passed parameters :
	#    self, data, account.
	#   The argument { name => "wilma" } is passed to the $data parameter of the method.
	#   If a user is logged in to Yote on the client, that user's account will automatcially
	#    be passed into the server side method as the last argument. The account object is
	#    a Yote::Obj object meant to store any information specific to the user *and* this
	#    applications. A user will get a different account object for each different App.
        sub hello {

            my( $self, $data, $acct ) = @_;
            my $name = $data->{name};
            my $counter = $self->get_counter();

	    # 'set_count' does not need an explicit definition.
            $counter->set_count( $counter->get_count() + 1 );

	    # The return value is a string in this case.
	    # var msg = hello_app.hello({name:"foo"}); 
	    # msg will be the string "hello there 'foo'."
            return "hello there '$name'. I have said hello ". $counter->get_count() . " times.";

        } #hello


Something went wrong with that request. Please try again.