App-Office-CMS

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "DBI" : "1.611",
            "DBIx::Admin::CreateTable" : "2.1",
            "DBIx::Admin::TableInfo" : "3.03",
            "DBIx::Simple" : "1.35",
            "Data::Session" : "1.17",
            "Date::Format" : "2.24",
            "File::Path" : "2.08",
            "File::Slurper" : "0.01",
            "File::Spec" : "3.31",
            "FindBin" : "1.51",
            "JSON::XS" : "3.02",
            "Lingua::EN::Inflect::Number" : "1.11",
            "Log::Handler" : "0.88",
            "Moo" : "2.003002",
            "Path::Class" : "0.37",
            "Plack::Builder" : "0",
            "String::Dirify" : "1.03",
            "Text::Xslate" : "v3.4.0",
            "Tree" : "1.1",
            "Tree::DAG_Node" : "1.29",
            "Tree::DAG_Node::Persist" : "1.12",

META.yml  view on Meta::CPAN

  DBI: '1.611'
  DBIx::Admin::CreateTable: '2.1'
  DBIx::Admin::TableInfo: '3.03'
  DBIx::Simple: '1.35'
  Data::Session: '1.17'
  Date::Format: '2.24'
  File::Path: '2.08'
  File::Slurper: '0.01'
  File::Spec: '3.31'
  FindBin: '1.51'
  JSON::XS: '3.02'
  Lingua::EN::Inflect::Number: '1.11'
  Log::Handler: '0.88'
  Moo: '2.003002'
  Path::Class: '0.37'
  Plack::Builder: '0'
  String::Dirify: '1.03'
  Text::Xslate: v3.4.0
  Tree: '1.1'
  Tree::DAG_Node: '1.29'
  Tree::DAG_Node::Persist: '1.12'

Makefile.PL  view on Meta::CPAN

		'Date::Format'						=> 2.24,
		'DBD::SQLite'						=> 1.54,
		'DBI'								=> 1.611,
		'DBIx::Admin::CreateTable'			=> 2.10,
		'DBIx::Admin::TableInfo'			=> 3.03,
		'DBIx::Simple'						=> 1.35,
		'File::Path'						=> 2.08,
		'File::Spec'						=> 3.31,
		'File::Slurper'						=> 0.010,
		'FindBin'							=> 1.51,
		'JSON::XS'							=> 3.02,
		'Lingua::EN::Inflect::Number'		=> 1.11,
		'Log::Handler'						=> 0.88,
		'Moo'								=> 2.003002,
		'parent'							=> 0.234,
		'Path::Class'						=> 0.37,
		'Plack::Builder'					=> 0,
		'strict'							=> 0,
		'String::Dirify'					=> 1.03,
		'Text::Xslate'						=> 3.4.0,
		'Tree'								=> 1.10,

lib/App/Office/CMS/Controller.pm  view on Meta::CPAN

use strict;
use warnings;

use App::Office::CMS::Util::Config;
use App::Office::CMS::Util::Validator;
use App::Office::CMS::Database;
use App::Office::CMS::View;

use Data::Session;

use JSON::XS;

use Text::Xslate;

# We don't use Moo because we ias CGI::Application.

our $VERSION = '0.93';

# -----------------------------------------------

sub build_page_hash

lib/App/Office/CMS/Controller/Backup.pm  view on Meta::CPAN

package App::Office::CMS::Controller::Backup;

use parent 'App::Office::CMS::Controller';
use strict;
use warnings;

use JSON::XS;

use Try::Tiny;

# We don't use Moo because we isa CGI::Application.

our $VERSION = '0.93';

# -----------------------------------------------

sub build_error_result

lib/App/Office/CMS/Controller/Backup.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$result = $self -> build_error_result($_, $target_div);
	};

	# update_content_message_div is on screen (under the Edit Content tab)
	# because we're displaying content.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of run.

# -----------------------------------------------

1;

lib/App/Office/CMS/Controller/Content.pm  view on Meta::CPAN

use parent 'App::Office::CMS::Controller';
use strict;
use warnings;

use App::Office::CMS::Util::Validator;

use File::Path 'make_path';

use File::Slurper 'write_text';

use JSON::XS;

use Path::Class; # For file().

use String::Dirify;

use Try::Tiny;

# We don't use Moo because we isa CGI::Application.

our $VERSION = '0.93';

lib/App/Office/CMS/Controller/Content.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$result = $self -> build_error_result($_, $target_div);
	};

	# update_content_message_div is on screen (under the Edit Content tab)
	# because we're displaying content.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of backup.

# -----------------------------------------------

sub build_content_hash
{
	my($self, $valid) = @_;

	$self -> log(debug => 'build_content_hash()');

lib/App/Office/CMS/Controller/Content.pm  view on Meta::CPAN

	{
		$result = $self -> build_error_result($_, $target_div);
	};

	# update_content_div is always on screen (under the Edit Content tab).
	# It appears there by virtue of being within Initialize.build_head_init().
	# update_page_message_div is on screen (under the Edit Pages tab),
	# because we're displaying a page with an Edit button.
	# It appears there by virtue of being within page.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of display.

# -----------------------------------------------

sub generate
{
	my($self) = @_;

	$self -> log(debug => 'generate()');

lib/App/Office/CMS/Controller/Content.pm  view on Meta::CPAN

	{
		$result = $self -> build_error_result($_, $target_div);
	};

	# update_content_div is always on screen (under the Edit Content tab).
	# It appears there by virtue of being within Initialize.build_head_init().
	# update_page_message_div is on screen (under the Edit Pages tab),
	# because we're displaying a page with an Edit button.
	# It appears there by virtue of being within page.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of generate.

# -----------------------------------------------
# Warning: Do not add $self.
# Note: Since this method is called per page, we don't log each entry.

sub generate_web_page
{
	my($node, $opt)       = @_;

lib/App/Office/CMS/Controller/Content.pm  view on Meta::CPAN

	catch
	{
		$result = $self -> build_error_result($_, $target_div);
	};

	# update_content_message_div is on screen (under the Edit Content tab)
	# because we're displaying content.
	# update_page_message_div is on screen (under the Edit Pages tab)
	# because we're displaying a page.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of update.

# -----------------------------------------------

1;

lib/App/Office/CMS/Controller/Design.pm  view on Meta::CPAN

package App::Office::CMS::Controller::Design;

use parent 'App::Office::CMS::Controller';
use strict;
use warnings;

use JSON::XS;

use Try::Tiny;

# We don't use Moo because we isa CGI::Application.

our $VERSION = '0.93';

# -----------------------------------------------

sub cgiapp_init

lib/App/Office/CMS/Controller/Design.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$message = $_;
	};

	# search_result_div is always on screen (under the Edit Site tab).
	# It appears there by virtue of being within search.tx.

	return JSON::XS -> new -> utf8 -> encode
	({
		results =>
		{
			message    => $message,
			target_div => 'search_result_div',
		}
	});

} # End of delete.

lib/App/Office/CMS/Controller/Design.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$message = $_;
	};

	# search_result_div is always on screen (under the Edit Site tab).
	# It appears there by virtue of being within search.tx.

	return JSON::XS -> new -> utf8 -> encode
	({
		results =>
		{
			message    => $message,
			target_div => 'update_site_message_div',
		}
	});

} # End of duplicate.

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN

package App::Office::CMS::Controller::Page;

use parent 'App::Office::CMS::Controller';
use strict;
use warnings;

use JSON::XS;

use Try::Tiny;

# We don't use Moo because we isa CGI::Application.

our $VERSION = '0.93';

# -----------------------------------------------

sub add_child

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$result = $self -> build_error_result($page, $_, $target_div);
	};

	# update_page_message_div is on screen (under the Edit Pages tab),
	# because we're displaying a page using page.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of add_child.

# -----------------------------------------------

sub add_sibling_above
{
	my($self) = @_;

	$self -> log(debug => 'add_sibling_above()');

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$result = $self -> build_error_result($page, $_, $target_div);
	};

	# update_page_message_div is on screen (under the Edit Pages tab),
	# because we're displaying a page using page.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of add_sibling_above.

# -----------------------------------------------

sub add_sibling_below
{
	my($self) = @_;

	$self -> log(debug => 'add_sibling_below()');

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$result = $self -> build_error_result($page, $_, $target_div);
	};

	# update_page_message_div is on screen (under the Edit Pages tab),
	# because we're displaying a page using page.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of add_sibling_below.

# -----------------------------------------------

sub build_error_result
{
	my($self, $page, $message, $target_div) = @_;

 	$self -> log(debug => "build_error_result(..., $target_div)");

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN


	for my $node (@node)
	{
		@daughters = $node -> daughters;

		if ($#daughters >= 0)
		{
			push @$item_data,
			{
				children => $self -> build_structure(@daughters),
				expanded => JSON::XS::true,
				label    => $node -> name,
				type     => 'text',
			};
		}
		else
		{
			push @$item_data,
			{
				label => $node -> name,
				type  => 'text',

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$result = $self -> build_error_result($page, $_, $target_div);
	};

	# update_page_message_div is on screen (under the Edit Pages tab),
	# because we're displaying a page using page.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of click_on_tree.

# -----------------------------------------------

sub delete
{
	my($self) = @_;

	$self -> log(debug => 'delete()');

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$result = $self -> build_error_result($page. $_, $target_div);
	};

	# update_page_message_div is on screen (under the Edit Pages tab),
	# because we're displaying a page using page.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of delete.

# -----------------------------------------------

sub display
{
	my($self) = @_;

	$self -> log(debug => 'display()');

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN

	{
		$result = $self -> build_error_result($page, $_, $target_div);
	};

	# update_page_div is always on screen (under the Edit Pages tab).
	# It appears there by virtue of being within Initialize.build_head_init().
	# update_site_message_div is on screen (under the Edit Site tab),
	# because we're displaying a site with an Edit button.
	# It appears there by virtue of being within search.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of display.

# -----------------------------------------------

sub edit
{
	my($self, $site, $design) = @_;

	$self -> log(debug => 'edit()');

lib/App/Office/CMS/Controller/Page.pm  view on Meta::CPAN

		}
	}
	catch
	{
		$result = $self -> build_error_result($page, $_, $target_div);
	};

	# update_page_message_div is on screen (under the Edit Pages tab),
	# because we're displaying a page using page.tx.

	return JSON::XS -> new -> utf8 -> encode({results => $result});

} # End of update.

# -----------------------------------------------

1;

lib/App/Office/CMS/Controller/Site.pm  view on Meta::CPAN

package App::Office::CMS::Controller::Site;

use parent 'App::Office::CMS::Controller';
use strict;
use warnings;

use JSON::XS;

use Try::Tiny;

# We don't use Moo because we isa CGI::Application.

our $VERSION = '0.93';

# -----------------------------------------------

sub add

lib/App/Office/CMS/Controller/Site.pm  view on Meta::CPAN

	catch
	{
		$message = $_;
	};

	# search_result_div is always on screen (under the Edit Site tab).
	# It appears there by virtue of being within search.tx.
	# The other thing is, we wish to use JS to zap the displayed site
	# and the displayed search results, because that data is obsolete.

	return JSON::XS -> new -> utf8 -> encode
	({
		results =>
		{
			message    => $message,
			target_div => 'search_result_div',
		}
	});

} # End of delete.

lib/App/Office/CMS/Controller/Site.pm  view on Meta::CPAN

	# o Page.edit()
	# o Site.update()
	# We don't put it in a hidden form field, to stop tampering.

	$self -> param('session') -> param(edit_design_id => $design_id);
	$self -> param('session') -> param(edit_site_id   => $site_id);

	# update_site_div is always on screen (under the Edit Site tab).
	# It appears there by virtue of being within search.tx.

	return JSON::XS -> new -> utf8 -> encode
	({
		results =>
		{
			message    => $self -> param('view') -> site -> display($site, $design),
			target_div => 'update_site_div',
		}
	});

} # End of display.

lib/App/Office/CMS/Controller/Site.pm  view on Meta::CPAN

	catch
	{
		$message = $_;
	};

	# search_result_div is always on screen (under the Edit Site tab).
	# It appears there by virtue of being within search.tx.
	# The other thing is, we wish to use JS to zap the displayed site
	# and the displayed search results, because that data is obsolete.

	return JSON::XS -> new -> utf8 -> encode
	({
		results =>
		{
			message    => $message,
			target_div => 'update_site_message_div',
		}
	});

} # End of duplicate.

lib/App/Office/CMS/Controller/Site.pm  view on Meta::CPAN

	{
		$message = $_;
	};

	# search_result_div is always on screen (under the Edit Site tab).
	# It appears there by virtue of being within search.tx.
	# update_site_message_div is only on screen (under the Edit Site tab),
	# when a site has been successfully displayed by clicking on a search result.
	# It appears there by virtue of being within site.tx.

	return JSON::XS -> new -> utf8 -> encode
	({
		results =>
		{
			message    => $message,
			target_div => $target_div,
		}
	});

} # End of update.

lib/App/Office/CMS/View/Search.pm  view on Meta::CPAN

package App::Office::CMS::View::Search;

use strict;
use warnings;

use JSON::XS;

use Moo;

extends 'App::Office::CMS::View::Base';

our $VERSION = '0.93';

# -----------------------------------------------

sub build_search_html

lib/App/Office/CMS/View/Search.pm  view on Meta::CPAN


	if ($#$result >= 0)
	{
		$output = {results => [@$result]};
	}
	else
	{
		$output = {results => [{site_name => "No names match '$name'"}]};
	}

	return JSON::XS -> new -> utf8 -> encode($output);

} # End of display.

# -----------------------------------------------

sub format_search_result
{
	my($self, $record) = @_;
	my($result) = [];

t/00.versions.t  view on Meta::CPAN

use Date::Format;
use DBD::SQLite;
use DBI;
use DBIx::Admin::CreateTable;
use DBIx::Admin::TableInfo;
use DBIx::Simple;
use File::Path;
use File::Spec;
use File::Slurper;
use FindBin;
use JSON::XS;
use Lingua::EN::Inflect::Number;
use Log::Handler;
use Moo;
use parent;
use Path::Class;
use Plack::Builder;
use strict;
use String::Dirify;
use Text::Xslate;
use Tree;

t/00.versions.t  view on Meta::CPAN

	Date::Format
	DBD::SQLite
	DBI
	DBIx::Admin::CreateTable
	DBIx::Admin::TableInfo
	DBIx::Simple
	File::Path
	File::Spec
	File::Slurper
	FindBin
	JSON::XS
	Lingua::EN::Inflect::Number
	Log::Handler
	Moo
	parent
	Path::Class
	Plack::Builder
	strict
	String::Dirify
	Text::Xslate
	Tree



( run in 0.580 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )