Re: [discussion] User interfaces (Re: Mitel Managed Application Server)

2013-01-14 Thread Hsing-Foo Wang
> 'I have', he said smugly not that I'm necessarily any the wiser ;-)
>

ditto.
___
Discussion about project organisation and overall direction
To unsubscribe, e-mail discussion-unsubscr...@lists.contribs.org
Searchable archive at http://lists.contribs.org/mailman/public/discussion/

Re: [discussion] User interfaces (Re: Mitel Managed Application Server)

2013-01-14 Thread John Crisp
On 15/01/13 00:54, Charlie Brady wrote:
> 

> the documentation and watching the webcasts I've already pointed to. Have 
> you already done that? Has anyone here?
> 

'I have', he said smugly not that I'm necessarily any the wiser ;-)

But I sure as hell know why, even as a non coder, I found PHP such a
struggle so often !


B. Rgds
John

___
Discussion about project organisation and overall direction
To unsubscribe, e-mail discussion-unsubscr...@lists.contribs.org
Searchable archive at http://lists.contribs.org/mailman/public/discussion/


Re: [discussion] User interfaces (Re: Mitel Managed Application Server)

2013-01-14 Thread Charlie Brady

On Mon, 14 Jan 2013, Charlie Brady wrote:

> > What will it take to get Mojolicious::Lite installed on an existing SME8,
> > and get your example to 'work' pls?
> 
> Is there much value in that? AFAIK this example looks exactly the same as 
> the one currently in SME server.

Looks and works! Actually, it works *slightly* differently. It uses a 
post-redirect-get model, which prevents form re-submission via the back 
button of the browser, and also has cross-site request forgery protection.

http://en.wikipedia.org/wiki/Post/Redirect/Get
http://en.wikipedia.org/wiki/Csrf
___
Discussion about project organisation and overall direction
To unsubscribe, e-mail discussion-unsubscr...@lists.contribs.org
Searchable archive at http://lists.contribs.org/mailman/public/discussion/


Re: [discussion] User interfaces (Re: Mitel Managed Application Server)

2013-01-14 Thread Charlie Brady

On Mon, 14 Jan 2013, Hsing-Foo Wang wrote:

> > To give people an idea of host much better Mojolicious::Lite is to work
> > with, here's one example, the shutdown/reboot panel. This is roughly 100
> > lines of fairly sparse perl code, and 60 lines of HTML template. [There
> > are comment blocks in the original file, but I think they just add bulk.
> 
> What will it take to get Mojolicious::Lite installed on an existing SME8,
> and get your example to 'work' pls?

Is there much value in that? AFAIK this example looks exactly the same as 
the one currently in SME server.

Why do you want to get the example to 'work'? You'll learn more by reading
the documentation and watching the webcasts I've already pointed to. Have 
you already done that? Has anyone here?

---
Charlie
___
Discussion about project organisation and overall direction
To unsubscribe, e-mail discussion-unsubscr...@lists.contribs.org
Searchable archive at http://lists.contribs.org/mailman/public/discussion/


Re: [discussion] User interfaces (Re: Mitel Managed Application Server)

2013-01-14 Thread Charlie Brady

On Mon, 14 Jan 2013, Hsing-Foo Wang wrote:

> > To give people an idea of host much better Mojolicious::Lite is to work
> > with, here's one example, the shutdown/reboot panel. This is roughly 100
> > lines of fairly sparse perl code, and 60 lines of HTML template. [There
> > are comment blocks in the original file, but I think they just add bulk.
> 
> What will it take to get Mojolicious::Lite installed on an existing SME8,
> and get your example to 'work' pls?

Someone would need to create a perl-Mojolicious rpm, which will need to 
contain some small patches to deal with 'taint' issues - details are on 
the Mojolicious mailing list. I would also need to get Mitel permission to 
open source Mitel::MSL::Mojolicious::ServerManager and 
Mojolicious::Plugin::Localization, or I would need to coach someone in 
what is required to make something functionally equivalent - neither is 
especially complex.

Mojolicious::Plugin::Localization, BTW, was designed to use the existing 
/etc/e-smith/locale files unchanged.

I can work on getting those components open sourced, but won't bother 
unless someone is seriously interested in making use of them.

---
Charlie
___
Discussion about project organisation and overall direction
To unsubscribe, e-mail discussion-unsubscr...@lists.contribs.org
Searchable archive at http://lists.contribs.org/mailman/public/discussion/


Re: [discussion] User interfaces (Re: Mitel Managed Application Server)

2013-01-14 Thread Hsing-Foo Wang
> To give people an idea of host much better Mojolicious::Lite is to work
> with, here's one example, the shutdown/reboot panel. This is roughly 100
> lines of fairly sparse perl code, and 60 lines of HTML template. [There
> are comment blocks in the original file, but I think they just add bulk.
>

What will it take to get Mojolicious::Lite installed on an existing SME8,
and get your example to 'work' pls?
___
Discussion about project organisation and overall direction
To unsubscribe, e-mail discussion-unsubscr...@lists.contribs.org
Searchable archive at http://lists.contribs.org/mailman/public/discussion/

[discussion] User interfaces (Re: Mitel Managed Application Server)

2013-01-14 Thread Charlie Brady

On Mon, 14 Jan 2013, Greg Zartman wrote:

> Biggest technical change (other then CentOS 6 base) is that FormMagick is
> > being gradually ripped out and replaced with new server-manager panels
> > based on Mojolicious::Lite.
> >
> Someone finally came to their senses!  :) :)
> 
> FormMagick is a awful.

Well, yes, but so is PHP! :-)

To give people an idea of host much better Mojolicious::Lite is to work 
with, here's one example, the shutdown/reboot panel. This is roughly 100 
lines of fairly sparse perl code, and 60 lines of HTML template. [There 
are comment blocks in the original file, but I think they just add bulk.

#!/usr/bin/perl -T

# heading : Administration
# description : Shutdown or reconfigure
# navigation  : 4000 4700

use Mitel::MSL::Mojolicious::ServerManager;

sub reboot
{
if (system("/sbin/e-smith/signal-event", "reboot") == 0)
{
return 'REBOOT_SUCCEEDED';
}
else
{
return 'REBOOT_FAILED';
}
}


sub shutdown
{
if (system("/sbin/e-smith/signal-event", "halt") == 0)
{
return 'SHUTDOWN_SUCCEEDED';
}
else
{
return 'SHUTDOWN_FAILED';
}
}

sub reconfigure
{
my $retVal = 'RECONFIGURE_FAILED';
  
if (system("/sbin/e-smith/signal-event", "post-upgrade" ) == 0)
{
$retVal = reboot();
}

return $retVal;
}

get '/' => sub
{
my $self = shift;
$self->stash(expires => 1);
$self->render('home', layout => 'server_manager');
} => 'home';

post '/' => sub
{
my $self = shift;
my $task = $self->param('task');

$self->flash('task' => $task);

$self->redirect_to('confirm');
};

get '/confirm' => sub
{
shift->render('confirm', layout => 'server_manager');
} => 'confirm';

post '/confirm' => sub
{
my $self = shift;
my $answer = $self->param('answer');
my $task = lc($self->param('task'));

if ($answer eq "Yes")
{
my $result;

{ 
  no strict "refs";
  $result = &$task();
}

if ($result =~ m/FAILED/)
{
$self->flash(error => $result);
}
else
{
$self->flash(success => $result);
}
}

$self->redirect_to('home');
};

app->start('cgi');

__DATA__

@@ home.html.ep
<%= _('FORM_TITLE') %>
<%= include 'operation_status_report' %>





<%= _('DESCRIPTION') %>




<%= _('LABEL_REBOOT') %>


 <%= _('REBOOT') %> 
 <%= _('RECONFIGURE') %> 
 
<%= _('SHUTDOWN') %> 


 

 
 
 
 
 
 
 


@@ confirm.html.ep
<%= _('FORM_TITLE') %>

<%= _('CONFIRMATION_HEADER') %>




%== _('CONFIRMATION_SENTENCE', {task => flash('task')});












 
   




___
Discussion about project organisation and overall direction
To unsubscribe, e-mail discussion-unsubscr...@lists.contribs.org
Searchable archive at http://lists.contribs.org/mailman/public/discussion/