Julian Tree | 3 Jan 17:46
Picon

Include .js file for server side and client side

I have a validate.js lib file that I used to do all kinds of
validation such a check date format, time format, string max length,
credit card, etc.  Now, I would like to use this file both on the
client side and server side, for user input validation.

If I put this file in the static dir, then I can include it on the
client side such as
<script type="application-x/javascript" src="static/validate.js"></script>

But then I can't have the same file in Globals/

Is there a way to just have one file and have it included on both the
serverside and clientside?

Thanks guys.

Tree
Julian Tree | 3 Jan 18:26
Picon

How to get my company to switch to Helma, are there any commercial support?

Hi,

I'm pretty new to Helma, coming from PHP, I really like what Helma. My
current company is heavily using PHP. They are small, but has a large
userbase, such as 200,000 active users. They are considering making a
slow switch towards Ruby On Rail.

I have taken a quick look at RoR, but I think it is too automated an
not enough flexibilities.  So I would rather they switch to Helma. 
Can you guys think of any reason to help me convince my company to use
Helma instead of RoR? Also I know that Austrian Broadcasting company
is using Helma, but is there any commercial support? Where can we turn
if there is a problem.

Any suggestion appreciated.

Tree
Matthias Platzer | 3 Jan 19:19
Picon

Re: How to get my company to switch to Helma, are there any commercial support?


Hi Julian,

RoR is also quite a good framework. (and in some parts even better :)

The advantages of Helma are:

* #1: Performance!!: RoR has no caching concept (don't share/cache 
anything) - so you will have to take care about that yourself, or just 
buy more machines. There are Helma applications that serve 10ens of 
millions request per month on a single machine. Apache will be your 
bottleneck, not helma nor the DB. Beside saving you money for buying 
machines it also saves you money for development time.

* Java based  - don't know how important that is for your project, but 
with Java you get tons of libraries for virtually everything.

Undecided:
* More flexible Templates
they use ruby for the templates (just like php) - with the disadvantage 
that you will find a lot of code (and logic) there - what you should avoid.

* Strong MVC framework
If you like that feature you can organize your helma applications just 
like that.

myApp/model/MyClass/functions.js
myApp/controller/MyClass/actions.js
myApp/view/MyClass/main.skin
myApp/view/MyClass/second.skin
(Continue reading)

Michael Platzer | 3 Jan 19:29
Picon

Re: How to get my company to switch to Helma, are there any commercial support?

additionally to matthias answer, you will find "16 good reasons for 
choosing helma" here:
-> 
http://adele.helma.org/download/helma/documentation/documentation.html#IntroWhyHelma

i wrote that part specifically to convince possible interested deciders 
that helma is a good choice.

greets,
  michi

Julian Tree schrieb:

>Hi,
>
>I'm pretty new to Helma, coming from PHP, I really like what Helma. My
>current company is heavily using PHP. They are small, but has a large
>userbase, such as 200,000 active users. They are considering making a
>slow switch towards Ruby On Rail.
>
>I have taken a quick look at RoR, but I think it is too automated an
>not enough flexibilities.  So I would rather they switch to Helma. 
>Can you guys think of any reason to help me convince my company to use
>Helma instead of RoR? Also I know that Austrian Broadcasting company
>is using Helma, but is there any commercial support? Where can we turn
>if there is a problem.
>
>Any suggestion appreciated.
>
>Tree
(Continue reading)

patrick k | 3 Jan 19:40
Picon
Favicon
Gravatar

Re: How to get my company to switch to Helma, are there any commercial support?

i don´t want to confuse you, but maybe you should take a look at django
(http://www.djangoproject.com) before your final decision.

for me, django, helma and RoR are the top frameworks right now.

what i like about django:
1. performance (it´s VERY fast)
2. good support (big community, though not as big as the rails one)
3. integrated admin-interface (you just have to define your models)
4. python based
5. internationalization (something which rails doesn´t care about)

what could be better:
1. documentation (can always be better, but with rails you get some really
good books and more will follow)
2. no integrated AJAX-support right now (although that will change very
soon); you can - of course - use AJAX libraries (e.g. Dojo)

i agree with matthias that "in the end it's a matter of taste".

patrick.

> 
> Hi Julian,
> 
> RoR is also quite a good framework. (and in some parts even better :)
> 
> The advantages of Helma are:
> 
> * #1: Performance!!: RoR has no caching concept (don't share/cache
(Continue reading)

Chris Zumbrunn | 3 Jan 20:29
Gravatar

Re: Include .js file for server side and client side

On Jan 3, 2006, at 5:46 PM, Julian Tree wrote:

> I have a validate.js lib file that I used to do all kinds of
> validation such a check date format, time format, string max length,
> credit card, etc.  Now, I would like to use this file both on the
> client side and server side, for user input validation.
>
> If I put this file in the static dir, then I can include it on the
> client side such as
> <script type="application-x/javascript" 
> src="static/validate.js"></script>
>
> But then I can't have the same file in Globals/
>
> Is there a way to just have one file and have it included on both the
> serverside and clientside?

Hi Julian,

I've shared code between client and server side using the following 
trick:

Root/validate_js.hac:
     res.contentType="application/javascript";
     var codefile = new helma.File(app.dir+'/Global/validate.js');
     res.write(codefile.readAll());

Would that solution work for you?

Chris
(Continue reading)

sonnenklang | 3 Jan 21:21
Picon

error in application2communityprofile

because i find the helma project verry interesting and i am very often <at> orfon and in the forum: what is the holy shit problem ;-) of this new orf-community-application <at> my.orf.at. if i are on the visitcards, on every third or fourth click I get: error in application community2profile or / and please check back later. is this an overload?
 
and in the past sometimes i get a message: max thread count reached on some of the orf-sites. what does this message will say to me? not really user friendly.
 
another question: what application uses ö3? it look likes as a combination of helma and another older system? is this right? sometimes i can see really strange things on the ö3 pages. sometimes there is a story and no forum. i get the: oops-message. Another  problem what I can see on the ö3 page over the last 3 or 4 years is the positioning of the replys in the thread. sometimes it is over the original post, somtimes it is after that... will there be an update on the ö3 page? (...the same as futurezone, oesterreich...?)
 
many questions, where are the answers? :-)
_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user
Julian Tree | 4 Jan 00:25
Picon

Re: Include .js file for server side and client side

Ah, Christ thanks a lot. But do you know if there is any performance
penalty of  having hac file reading from the file system?

Depending on the browser, I know when php load a staic js file through
the script, it will  cause the browser to reload the the js file
everytime the user hit the page.  Where as a static js file will be
cached, and it will only be reloaded from the server when user hit the
"Reload' button.

I was hoping for a way to allow the browser to statically include the
.js file and allow the server side to use that .js as well. But may
Helma on Jetty can handle connection request much better than PHP on
Apache. Thanks for the response again.

Tree

On 1/3/06, Chris Zumbrunn <chris <at> zumbrunn.com> wrote:
> On Jan 3, 2006, at 5:46 PM, Julian Tree wrote:
>
> > I have a validate.js lib file that I used to do all kinds of
> > validation such a check date format, time format, string max length,
> > credit card, etc.  Now, I would like to use this file both on the
> > client side and server side, for user input validation.
> >
> > If I put this file in the static dir, then I can include it on the
> > client side such as
> > <script type="application-x/javascript"
> > src="static/validate.js"></script>
> >
> > But then I can't have the same file in Globals/
> >
> > Is there a way to just have one file and have it included on both the
> > serverside and clientside?
>
> Hi Julian,
>
> I've shared code between client and server side using the following
> trick:
>
> Root/validate_js.hac:
>      res.contentType="application/javascript";
>      var codefile = new helma.File(app.dir+'/Global/validate.js');
>      res.write(codefile.readAll());
>
> Would that solution work for you?
>
> Chris
>
> _______________________________________________
> Helma-user mailing list
> Helma-user <at> helma.org
> http://helma.org/mailman/listinfo/helma-user
>
Stefan Rinner | 4 Jan 12:06
Picon

Re: Include .js file for server side and client side

> Depending on the browser, I know when php load a staic js file through
> the script, it will  cause the browser to reload the the js file
> everytime the user hit the page.  Where as a static js file will be
> cached, and it will only be reloaded from the server when user hit the
> "Reload' button.

if you send it with the correct content header (I suppost "text/ 
javascript"),  some correct caching pragma and perhaps even a ".js"  
in the actionname (by using "function getMyJS.js_action()") the  
browser shouldn't see any diference between a static file and one  
returned by an action

- stefan
Klemens Mantzos | 4 Jan 13:46
Picon

Re: Include .js file for server side and client side

On 1/4/06, Stefan Rinner <rist <at> mac.com> wrote:
> > Depending on the browser, I know when php load a staic js file through
> > the script, it will  cause the browser to reload the the js file
> > everytime the user hit the page.  Where as a static js file will be
> > cached, and it will only be reloaded from the server when user hit the
> > "Reload' button.
>
> if you send it with the correct content header (I suppost "text/
> javascript"),  some correct caching pragma and perhaps even a ".js"
> in the actionname (by using "function getMyJS.js_action()") the
i would suggest: function validate_js_action() {}

i don't know what you're planning to do, exactly. but i think it't
would be better to use 2 different js files (one client side
JavaScript with getElementById/alert stuff, and one for the server
side with "classic" html error messages).

> browser shouldn't see any diference between a static file and one
> returned by an action
>
> - stefan
> _______________________________________________
> Helma-user mailing list
> Helma-user <at> helma.org
> http://helma.org/mailman/listinfo/helma-user
>

--
MfG
klem

---------/Spruchderwoche\--------
When we say "Free Software", we mean "free" as in "free speech", not
as in "free beer". Free Software does not mean gratis, and it
definitely does not mean non-commercial. On the contrary: there are
many good reasons for why Free Software is a highly superior business
model.

Gmane