Compare commits

..

1 Commits

250 changed files with 6125 additions and 5163 deletions

View File

@@ -8,20 +8,20 @@
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="config" location=".\library\configuration\config-safe.ecf"/>
<library name="crypto" location="$ISE_LIBRARY\unstable\library\text\encryption\crypto\crypto-safe.ecf"/>
<library name="encoder" location="$EWF_LIBRARY\library\text\encoder\encoder-safe.ecf" readonly="false"/>
<library name="error" location="$EWF_LIBRARY\library\utility\general\error\error-safe.ecf"/>
<library name="http" location="$EWF_LIBRARY\library\network\protocol\http\http-safe.ecf"/>
<library name="http_authorization" location="$EWF_LIBRARY\library\server\authentication\http_authorization\http_authorization-safe.ecf" readonly="false"/>
<library name="encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder-safe.ecf" readonly="false"/>
<library name="error" location="$ISE_LIBRARY\contrib\library\utility\general\error\error-safe.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/>
<library name="http_authorization" location="$ISE_LIBRARY\contrib\library\network\authentication\http_authorization\http_authorization-safe.ecf" readonly="false"/>
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
<library name="layout" location=".\library\layout\layout-safe.ecf"/>
<library name="cms_model" location=".\library\model\cms_model-safe.ecf" readonly="false"/>
<library name="model" location=".\library\model\cms_model-safe.ecf" readonly="false"/>
<library name="smarty" location="$ISE_LIBRARY\contrib\library\text\template\smarty\smarty-safe.ecf" readonly="false"/>
<library name="text_filter" location="$ISE_LIBRARY\unstable\library\text\text_filter\text_filter-safe.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<library name="wsf" location="$EWF_LIBRARY\library\server\wsf\wsf-safe.ecf"/>
<library name="wsf_extension" location="$EWF_LIBRARY\library\server\wsf\wsf_extension-safe.ecf" readonly="false"/>
<library name="wsf_html" location="$EWF_LIBRARY\library\server\wsf_html\wsf_html-safe.ecf" readonly="false"/>
<cluster name="src" location=".\src\" recursive="true">
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension-safe.ecf" readonly="false"/>
<library name="wsf_html" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf_html\wsf_html-safe.ecf" readonly="false"/>
<cluster name="src" location=".\library\src\" recursive="true">
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/CVS$</exclude>

21
cms.ecf
View File

@@ -6,22 +6,23 @@
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="config" location=".\library\configuration\config.ecf"/>
<library name="crypto" location="$ISE_LIBRARY\unstable\library\text\encryption\crypto\crypto.ecf"/>
<library name="encoder" location="$EWF_LIBRARY\library\text\encoder\encoder.ecf" readonly="false"/>
<library name="error" location="$EWF_LIBRARY\library\utility\general\error\error.ecf"/>
<library name="http" location="$EWF_LIBRARY\library\network\protocol\http\http.ecf"/>
<library name="http_authorization" location="$EWF_LIBRARY\library\network\authentication\http_authorization\http_authorization.ecf" readonly="false"/>
<library name="encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder.ecf" readonly="false"/>
<library name="error" location="$ISE_LIBRARY\contrib\library\utility\general\error\error.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http.ecf"/>
<library name="http_authorization" location="$ISE_LIBRARY\contrib\library\network\authentication\http_authorization\http_authorization.ecf" readonly="false"/>
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json.ecf" readonly="false"/>
<library name="config" location=".\library\configuration\config.ecf"/>
<library name="layout" location=".\library\layout\layout.ecf"/>
<library name="cms_model" location=".\library\model\cms_model.ecf" readonly="false"/>
<library name="model" location=".\library\model\cms_model.ecf" readonly="false"/>
<library name="persistence_mysql" location=".\library\persistence\implementation\mysql\persistence_mysql.ecf" readonly="false"/>
<library name="smarty" location="$ISE_LIBRARY\contrib\library\text\template\smarty\smarty.ecf" readonly="false"/>
<library name="text_filter" location="$ISE_LIBRARY\unstable\library\text\text_filter\text_filter.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="wsf" location="$EWF_LIBRARY\library\server\wsf\wsf.ecf"/>
<library name="wsf_extension" location="$EWF_LIBRARY\library\server\wsf\wsf_extension.ecf" readonly="false"/>
<library name="wsf_html" location="$EWF_LIBRARY\library\server\wsf_html\wsf_html.ecf" readonly="false"/>
<cluster name="src" location=".\src\" recursive="true">
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf.ecf"/>
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension.ecf" readonly="false"/>
<library name="wsf_html" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf_html\wsf_html.ecf" readonly="false"/>
<cluster name="src" location=".\library\src\" recursive="true">
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/CVS$</exclude>

View File

@@ -9,50 +9,38 @@
<option warning="true" full_class_checking="false" is_attached_by_default="true" void_safety="transitional" syntax="transitional">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<setting name="console_application" value="true"/>
<setting name="concurrency" value="scoop"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="cms" location="..\..\cms-safe.ecf" readonly="false"/>
<library name="cms_demo_module" location="modules\demo\cms_demo_module-safe.ecf" readonly="false"/>
<library name="cms_model" location="..\..\library\model\cms_model-safe.ecf" readonly="false"/>
<library name="persistence_mysql" location="..\..\library\persistence\implementation\mysql\persistence_mysql-safe.ecf" readonly="false"/>
<library name="layout" location="..\..\library\layout\layout-safe.ecf" readonly="false"/>
<library name="persistence_sqlite" location="..\..\library\persistence\sqlite\persistence_sqlite-safe.ecf" readonly="false"/>
<library name="wsf" location="$EWF_LIBRARY\library\server\wsf\wsf-safe.ecf"/>
<library name="wsf_extension" location="$EWF_LIBRARY\library\server\wsf\wsf_extension-safe.ecf" readonly="false"/>
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension-safe.ecf" readonly="false"/>
</target>
<target name="demo_any" extends="common">
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
<setting name="concurrency" value="scoop"/>
<library name="cgi" location="$EWF_LIBRARY\library\server\wsf\connector\cgi-safe.ecf"/>
<library name="libfcgi" location="$EWF_LIBRARY\library\server\wsf\connector\libfcgi-safe.ecf"/>
<library name="nino" location="$EWF_LIBRARY\library\server\wsf\connector\nino-safe.ecf"/>
<library name="standalone" location="$EWF_LIBRARY\library\server\wsf\connector\standalone-safe.ecf"/>
<library name="cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\cgi-safe.ecf"/>
<library name="libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\libfcgi-safe.ecf"/>
<library name="nino" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\nino-safe.ecf"/>
<cluster name="launcher" location=".\launcher\any\" recursive="true"/>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="demo_standalone" extends="common">
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
<setting name="concurrency" value="scoop"/>
<library name="default_standalone" location="$EWF_LIBRARY\library\server\wsf\default\standalone-safe.ecf"/>
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="demo_nino" extends="common">
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
<setting name="concurrency" value="none"/>
<library name="default_nino" location="$EWF_LIBRARY\library\server\wsf\default\nino-safe.ecf"/>
<library name="default_nino" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\nino-safe.ecf"/>
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="demo_cgi" extends="common">
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
<library name="default_cgi" location="$EWF_LIBRARY\library\server\wsf\default\cgi-safe.ecf"/>
<library name="default_cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\cgi-safe.ecf"/>
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="demo_libfcgi" extends="common">
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
<library name="default_libfcgi" location="$EWF_LIBRARY\library\server\wsf\default\libfcgi-safe.ecf"/>
<library name="default_libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\libfcgi-safe.ecf"/>
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
<cluster name="src" location=".\src\" recursive="true"/>
</target>

View File

@@ -1,2 +1,2 @@
port=9090
#verbose=true
port=8099
#verbose=true

View File

@@ -8,10 +8,10 @@ note
revision: "$Revision: 36 $"
class
APPLICATION_LAUNCHER [G -> WSF_EXECUTION create make end]
APPLICATION_LAUNCHER
inherit
APPLICATION_LAUNCHER_I [G]
APPLICATION_LAUNCHER_I
feature -- Custom

View File

@@ -10,28 +10,24 @@ note
revision: "$Revision: 36 $"
deferred class
APPLICATION_LAUNCHER_I [G -> WSF_EXECUTION create make end]
APPLICATION_LAUNCHER_I
inherit
SHARED_EXECUTION_ENVIRONMENT
feature -- Execution
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
nature: like launcher_nature
do
nature := launcher_nature
if nature = Void then
launch_standalone (opts)
elseif nature = nature_standalone then
launch_standalone (opts)
elseif nature = nature_nino then
launch_nino (opts)
if nature = Void or else nature = nature_nino then
launch_nino (a_service, opts)
elseif nature = nature_cgi then
launch_cgi (opts)
launch_cgi (a_service, opts)
elseif nature = nature_libfcgi then
launch_libfcgi (opts)
launch_libfcgi (a_service, opts)
else
-- bye bye
(create {EXCEPTIONS}).die (-1)
@@ -47,16 +43,14 @@ feature {NONE} -- Access
--| and we could use WSF_DEFAULT_SERVICE_LAUNCHER to configure this at compilation time.
local
p: PATH
l_entry_name: READABLE_STRING_32
ext: detachable READABLE_STRING_32
do
create p.make_from_string (execution_environment.arguments.command_name)
if attached p.entry as l_entry then
ext := l_entry.extension
ext := l_entry.extension
end
if ext /= Void then
if ext.same_string (nature_standalone) then
Result := nature_standalone
end
if ext.same_string (nature_nino) then
Result := nature_nino
end
@@ -67,58 +61,39 @@ feature {NONE} -- Access
Result := nature_libfcgi
end
end
Result := default_nature
end
feature {NONE} -- standalone
nature_standalone: STRING = "standalone"
launch_standalone (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
launcher: WSF_STANDALONE_SERVICE_LAUNCHER [G]
do
create launcher.make_and_launch (opts)
end
feature {NONE} -- nino
nature_nino: STRING = "nino"
launch_nino (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
launch_nino (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
launcher: WSF_NINO_SERVICE_LAUNCHER [G]
launcher: WSF_NINO_SERVICE_LAUNCHER
do
create launcher.make_and_launch (opts)
create launcher.make_and_launch (a_service, opts)
end
feature {NONE} -- cgi
nature_cgi: STRING = "cgi"
launch_cgi (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
launch_cgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
launcher: WSF_CGI_SERVICE_LAUNCHER [G]
launcher: WSF_CGI_SERVICE_LAUNCHER
do
create launcher.make_and_launch (opts)
create launcher.make_and_launch (a_service, opts)
end
feature {NONE} -- libfcgi
nature_libfcgi: STRING = "libfcgi"
launch_libfcgi (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
launch_libfcgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
launcher: WSF_LIBFCGI_SERVICE_LAUNCHER [G]
launcher: WSF_LIBFCGI_SERVICE_LAUNCHER
do
create launcher.make_and_launch (opts)
end
feature -- Default
default_nature: STRING
do
Result := nature_standalone
create launcher.make_and_launch (a_service, opts)
end

View File

@@ -8,10 +8,10 @@ note
revision: "$Revision: 36 $"
class
APPLICATION_LAUNCHER [G -> WSF_EXECUTION create make end]
APPLICATION_LAUNCHER
inherit
APPLICATION_LAUNCHER_I [G]
APPLICATION_LAUNCHER_I
feature -- Custom

View File

@@ -6,19 +6,19 @@ note
you can customize APPLICATION_LAUNCHER
]"
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
revision: "$Revision: 96596 $"
date: "$Date: 2013-06-12 13:55:42 +0200 (mer., 12 juin 2013) $"
revision: "$Revision: 36 $"
deferred class
APPLICATION_LAUNCHER_I [G -> WSF_EXECUTION create make end]
APPLICATION_LAUNCHER_I
feature -- Execution
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
launcher: WSF_DEFAULT_SERVICE_LAUNCHER [G]
launcher: WSF_SERVICE_LAUNCHER
do
create launcher.make_and_launch (opts)
create {WSF_DEFAULT_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts)
end
end

View File

@@ -13,11 +13,11 @@
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
<library name="cms" location="..\..\..\..\cms-safe.ecf" readonly="false"/>
<library name="cms_model" location="..\..\..\..\library\model\cms_model-safe.ecf" readonly="false"/>
<library name="http" location="$EWF_LIBRARY\library\network\protocol\http\http-safe.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/>
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<library name="wsf" location="$EWF_LIBRARY\library\server\wsf\wsf-safe.ecf"/>
<library name="wsf_encoder" location="$EWF_LIBRARY\library\text\encoder\encoder-safe.ecf"/>
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
<library name="wsf_encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder-safe.ecf"/>
<cluster name="src" location=".\" recursive="true"/>
</target>
</system>

View File

@@ -1,8 +1,8 @@
note
description: "Summary description for {CMS_DEMO_MODULE}."
author: ""
date: "$Date: 2015-02-13 13:08:13 +0100 (ven., 13 févr. 2015) $"
revision: "$Revision: 96616 $"
date: "$Date$"
revision: "$Revision$"
class
CMS_DEMO_MODULE
@@ -36,6 +36,7 @@ feature -- Access: router
-- Node router.
do
create Result.make (2)
map_uri_template_agent (Result, "/demo/", agent handle_demo (?,?,a_api))
map_uri_template_agent (Result, "/demo/{id}", agent handle_demo_entry (?,?,a_api))
end
@@ -84,37 +85,11 @@ feature -- Hooks
feature -- Handler
initialize_module (a_api: CMS_API)
local
sql: STRING
do
if attached {CMS_STORAGE_SQL} a_api.storage as sql_db then
sql_db.sql_query ("select count(*) from tb_demo;", Void)
if sql_db.has_error then
-- Initialize db for demo module
sql := "[
CREATE TABLE "tb_demo"(
"did" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("did">=0),
"name" VARCHAR(100) NOT NULL,
"value" TEXT
);
]"
sql_db.reset_error
sql_db.sql_change (sql, Void)
if sql_db.has_error then
a_api.logger.put_error ("Could not initialize database for demo module", generating_type)
end
end
end
end
handle_demo,
handle_demo_entry (req: WSF_REQUEST; res: WSF_RESPONSE; a_api: CMS_API)
local
r: NOT_IMPLEMENTED_ERROR_CMS_RESPONSE
do
initialize_module (a_api)
create r.make (req, res, a_api)
r.set_main_content ("NODE module does not yet implement %"" + req.path_info + "%" ...")
r.add_error_message ("NODE Module: not yet implemented")

View File

@@ -1,34 +0,0 @@
BEGIN;
CREATE TABLE "users"(
"uid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("uid">=0),
"name" VARCHAR(100) NOT NULL,
"password" VARCHAR(100) NOT NULL,
"salt" VARCHAR(100) NOT NULL,
"email" VARCHAR(250) NOT NULL,
"status" INTEGER,
"created" DATETIME NOT NULL,
"signed" DATETIME,
CONSTRAINT "name"
UNIQUE("name")
);
CREATE TABLE "users_roles"(
"rid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("rid">=0),
"role" VARCHAR(100) NOT NULL,
CONSTRAINT "role"
UNIQUE("role")
);
CREATE TABLE "nodes"(
"nid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("nid">=0),
"version" INTEGER,
"type" INTEGER,
"title" VARCHAR(255) NOT NULL,
"summary" TEXT NOT NULL,
"content" MEDIUMTEXT NOT NULL,
"author" INTEGER,
"publish" DATETIME,
"created" DATETIME NOT NULL,
"changed" DATETIME NOT NULL
);
COMMIT;

View File

@@ -1,53 +0,0 @@
ul.horizontal li {
display: inline-block;
}
#header #primary.menu ul li {
color: #555;
background-color: #fff;
padding: 10px;
margin: 0;
}
#header #primary.menu ul li a {
color: #555;
text-decoration: none;
}
#header #primary.menu ul li a:hover {
color: black;
}
#header #primary.menu ul.horizontal {
border-bottom: solid 1px #ddd;
}
#header #primary.menu ul.horizontal li {
border-top: solid 3px #fff;
}
#header #primary.menu ul.horizontal li:hover {
background-color: #ffe;
border-top: solid 3px #999;
}
#header #primary.menu ul.horizontal li.active {
font-weight: bold;
border-top: solid 3px #ddd;
background-color: #ddd;
}
#header #primary.menu ul.horizontal li.active:hover {
border-top: solid 3px blue;
}
#content {
margin-left: 20px;
}
.sidebar {
padding: 5px;
margin: 3px;
border: solid 1px #ccc;
}
.sidebar#sidebar_first {
width: 250px;
float: left;
}
.sidebar#sidebar_second {
width: 250px;
float: right;
}

View File

@@ -1,57 +0,0 @@
ul.horizontal {
li {
display: inline-block;
}
}
#header {
#primary.menu {
ul {
li {
color: #555;
a {
color: #555;
text-decoration: none;
&:hover { color: black; }
}
background-color: #fff;
padding: 10px;
margin: 0;
}
&.horizontal {
border-bottom: solid 1px #ddd;
li {
border-top: solid 3px #fff;
&:hover {
background-color: #ffe;
border-top: solid 3px #999;
}
&.active {
font-weight: bold;
border-top: solid 3px #ddd;
background-color: #ddd;
}
&.active:hover {
border-top: solid 3px blue;
}
}
}
}
}
}
#content {
margin-left: 20px;
}
.sidebar {
padding: 5px;
margin: 3px;
border: solid 1px #ccc;
&#sidebar_first {
width: 250px;
float: left;
}
&#sidebar_second {
width: 250px;
float: right;
}
}

View File

@@ -1,14 +0,0 @@
{assign name="debug_enabled" value="True"/}
{if condition="$debug_enabled"}
<ul>
{assign name="kpage" value="page"/}
{assign name="kregions" value="regions"/}
{foreach key="k" item="i" from="$page.variables"}
{unless condition="$k ~ $kpage"}
{unless condition="$k ~ $kregions"}
<li><strong>{$k/}</strong>={$i/}</li>
{/unless}
{/unless}
{/foreach}
</ul>
{/if}

View File

@@ -1,77 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- EWF CMS -->
<link rel="stylesheet" href="{$site_url/}/theme/css/style.css">
<!-- bootstrap framework -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<title>{$head_title/}</title>
</head>
<body>
<!-- Page Top -->
{if isset="$region_top"}
{$region_top/}
{/if}
<!-- Body -->
<div class='container-fluid'>
<!-- Page Header -->
<div id="header">
{if isset="$page.primary_nav"}
{$page.primary_nav/}
{/if}
</div>
<!-- General Page Content -->
<div id='content' class='row-fluid'>
<!-- Left Sidebar sidebar_first -->
{unless isempty="$page.region_sidebar_first"}
<div id="sidebar_first" class="sidebar">{$page.region_sidebar_first/}</div>
{/unless}
<!-- Right Sidebar sidebar_second-->
{unless isempty="$page.region_sidebar_second"}
<div id="sidebar_second" class="sidebar">{$page.region_sidebar_second/}</div>
{/unless}
<!-- Highlighted, Help, Content -->
<div class='span8 main'>
<!-- Highlighted Section -->
{unless isempty="$page.region_highlighted"}
<div id="highlighted">{$page.region_highlighted/}</div>
{/unless}
<!-- Help Section -->
{unless isempty="$page.region_help"}
<div id="help">{$page.region_help/}</div>
{/unless}
<!-- Main Content Section -->
{unless isempty="$page_title"}<h1 class="page-title">{$page_title/}</h1>{/unless}
{$page.region_content/}
</div>
</div>
</div>
<!--Page footer -->
{$page.region_footer/}
<!-- Page Bottom -->
{$page.region_bottom/}
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<!--
{include file="debug.tpl"/}
-->
</body>
</html>

View File

@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
{include file="master2/head.tpl"/}
</head>
<body>
<!-- Site Navigation -->
{include file="master2/site_navigation.tpl"/}
<div class="container">
<hr>
<div class="row">
<main class="main">
{include file="master2/content.tpl"/}
</main>
</div>
</div>
<div id="footer">
<footer class="site-footer">
{include file="master2/footer.tpl"/}
</footer>
</div>
{if condition="$web"}
{include file="master2/optional_enhancement_js.tpl"/}
{/if}
{if condition="$html"}
{include file="master2/optional_enhancement_js.tpl"/}
{/if}
</body>
</html>

View File

@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
{include file="master2/head.tpl"/}
</head>
<body>
<!-- Site Navigation -->
{include file="master2/site_navigation.tpl"/}
<!--<header class="main-navi">
{include file="master2/header.tpl"/}
</header> -->
<div class="container">
<hr>
<div class="row">
<main class="main">
{include file="master2/content.tpl"/}
</main>
</div>
</div>
<div id="footer">
<footer class="site-footer">
{include file="master2/footer.tpl"/}
</footer>
</div>
{if condition="$web"}
{include file="master2/optional_enhancement_js.tpl"/}
{/if}
{if condition="$html"}
{include file="master2/optional_enhancement_js.tpl"/}
{/if}
</body>
</html>

View File

@@ -0,0 +1,5 @@
<p>You have successfully signed out</p>
You may want to return
Press this neat little button:<a href="{$host/}/">Take Me Home </a>

View File

@@ -0,0 +1,11 @@
<div itemscope itemtype="http://schema.org/ItemList">
<h2 itemprop="name">Top most recent nodes</h2><br>
<meta itemprop="itemListOrder" content="Descending" />
{foreach from="$nodes" item="item"}
<div class="page-header">
<h3><span itemprop="itemListElement"><a href="{$host/}/node/{$item.id/}" rel="node"><strong>{$item.title/}</strong></a></span> <small>{$item.summary/} - {$item.publication_date_output/} </small></h3>
</div>
{/foreach}
</div>

View File

@@ -0,0 +1,18 @@
<h3> Error: {$code/} </h3>
{assign name="status400" value="400"/}
{assign name="status404" value="404"/}
{assign name="status500" value="500"/}
{if condition="$code ~ $status500"}
<p>Internal server error, for the request <strong>{$request/}</string> </p>
{/if}
{if condition="$code ~ $status404"}
<p> Resourse not found, for the request <strong>{$request/}</string> </p>
{/if}
{if condition="$code ~ $status400"}
<p> Bad request, the request <strong>{$request/}</string> is not valid</p>
{/if}

View File

@@ -0,0 +1,7 @@
<small>
<center>
<p class="text-muted"><a href="#" target="_blank" class="info">API Documentation </a>&nbsp;&nbsp;&nbsp;
<a href="#" target="_blank" class="info">Questions? Comments? Let us know! </a></p>
<p>© Copyright 2014 Eiffel Software -- <a href="#" target="_blank" class="info">Privacy Policy</a>
</center>
</small>

View File

@@ -0,0 +1,10 @@
<meta charset="utf-8">
<link rel="icon" href="{$host/}/static/images/favicon.ico">
<title>Eiffel RESTonCMS</title>
{if condition="$web"}
{include file="master2/optional_styling_css.tpl"/}
{/if}
{if condition="$html"}
{include file="master2/optional_styling_css.tpl"/}
{/if}

View File

@@ -0,0 +1,2 @@
<h1>RESTonCMS</h1>
<p>Tagline</p>

View File

@@ -0,0 +1,5 @@
<!--<ul>
<li class="main-navi-item"><a href="">Nav1</a></li>
<li><a href="">Nav2</a></li>
</ul>
-->

View File

@@ -0,0 +1,5 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
{if condition="$web"}
<script src="{$host/}/static/js/roc.js"></script>
{/if}

View File

@@ -0,0 +1,9 @@
{if condition="$html"}
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="http://getbootstrap.com/assets/css/docs.min.css">
{/if}
{if condition="$web"}
<link rel="stylesheet" href="{$host/}/static/css/bootstrap.css">
<link rel="stylesheet" href="{$host/}/static/css/dashboard.css">
{/if}

View File

@@ -0,0 +1,27 @@
<nav id="" class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="{$host/}" rel="home">Rest on CMS</a>
</div>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="nav navbar-nav">
<li class="ListOfNodes"><a title="Nodes" href="{$host/}/nodes" rel="node">List of Nodes</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
{if isset="$user"}
<li><a>{$user/}</a></li>
<li><a title="Node" href="{$host/}/node" rel="node">New Node</a></li>
<li><a title="Logoff" href="{$host/}/basic_auth_logoff" rel="logoff">Logoff</a></li>
{/if}
{unless isset="$user"}
<li><a title="Login" href="{$host/}/basic_auth_login" rel="login">Login</a></li>
<li><a title="Register" href="{$host/}/user" rel="register">Register</a></li>
{/unless}
</ul>
</div>
</div>
</nav>

View File

@@ -0,0 +1,8 @@
{if isset="$user"}
<a title="Logoff" class="" href="{$host/}/logoff">Logoff</a>
{/if}
{unless isset="$user"}
<a title="Login" class="" href="{$host/}/login">Login</a>
<a title="Register" class="" href="{$host/}/Register">Register</a>
{/unless}
<a title="Nodes" class="" href="{$host/}/nodes">List of Nodes</a>

View File

@@ -0,0 +1,174 @@
{if condition="html"}
<!DOCTYPE html>
<html lang="en">
<head>
{include file="master2/head.tpl"/}
</head>
<body>
{/if}
{unless condition="$web"}
<!-- Site Navigation -->
{include file="master2/site_navigation.tpl"/}
{/unless}
{if condition="html"}
<div class="container">
<hr>
<div class="row">
<main class="main">
{/if}
<div class="bs-docs-example">
{if condition="$web"}
<ul id="myTab" class="nav nav-tabs" role="tablist">
<li class=""><a href="#view" role="tab" data-toggle="tab">View</a></li>
<li class="active"><a href="#edit" role="tab" data-toggle="tab">Edit</a></li>
<li class=""><a href="#delete" role="tab" data-toggle="tab">Delete</a></li>
</ul>
{/if}
{if condition="$html"}
<ul id="myTab" class="nav nav-tabs" role="tablist">
<li class=""><a href="#view" role="tab" data-toggle="tab">View</a></li>
<li class="active"><a href="#edit" role="tab" data-toggle="tab">Edit</a></li>
<li class=""><a href="#delete" role="tab" data-toggle="tab">Delete</a></li>
</ul>
{/if}
<div id="myTabContent" class="tab-content">
<div class="tab-pane" id="view">
{if isset="$node"}
<hr>
<div class="container-fluid">
<div class="row" itemscope itemtype="http://schema.org/Article">
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-3"><h1><span itemprop="name">{$node.title/}</span></h1></div>
</div>
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-3"><span itemprop="text">{$node.content/}<span></div>
</div>
</div>
</div>
{/if}
</div>
<div class="tab-pane fade active in" id="edit">
{if isset="$user"}
<hr>
<div class="container-fluid">
<div class="col-xs-12" itemscope itemtype="http://schema.org/Article">
{if isset="$node"}
<form class="form-inline well" action="{$host/}/node/{$node.id/}" itemprop="url" method="POST">
<input type="hidden" name="method" value="PUT">
{/if}
{unless isset="$node"}
<form class="form-inline well" action="{$host/}/node" itemprop="url" method="POST">
{/unless/}
<fieldset>
<legend>Edit Node</legend>
<div class="span3">
<p>Add or Edit a Node</p>
</div>
<div class="row">
<div class="col-xs-1">
{if isset="$node"}
<label><span itemprop="name"><a href="{$host/}/node/{$node.id/}/title" rel="node">Title:</a></span></label>
{/if}
{unless isset="$node"}
<label><span itemprop="name">Title:</span> </label>
{/unless}
</div>
<div class="col-xs-7">
<input id="title" type="text" class="form-control" name="title" placeholder="Title" required value="{$node.title/}"/>
</div>
</div>
<div class="row">
<div class="col-xs-1">
{if isset="$node"}
<label> <span itemprop="description"><a href="{$host/}/node/{$node.id/}/summary" rel="node">Summary:</a></span></label>
{/if}
{unless isset="$node"}
<label> <span itemprop="description">Summary:</span></label>
{/unless}
</div>
<div class="col-xs-7">
<textarea id="summary" rows="3" class="form-control" cols="100" name="summary" placeholder="Node summary" required>{$node.summary/}</textarea>
</div>
</div>
<div class="row">
<div class="col-xs-1">
{if isset="$node"}
<label> <span itemprop="text"><a href="{$host/}/node/{$node.id/}/content" rel="node">Content</a></span> </label>
{/if}
{unless isset="$node"}
<label> <span itemprop="text">Content:</span> </label>
{/unless}
</div>
<div class="col-xs-7">
<textarea id="content" rows="25" cols="100" class="form-control" name="content" placeholder="Node content" required>{$node.content/}</textarea>
</div>
</div>
<div>
<label>
<span>&nbsp;</span>
<input type="Submit" value="Send" />
</label>
</div>
</fieldset>
</form>
</div>
{/if}
</div>
</div>
<div class="tab-pane" id="delete">
{if isset="$user"}
<hr>
<div class="container-fluid">
{if isset="$node"}
<form action="{$host/}/node/{$node.id/}" method="POST" class="">
<input type="hidden" name="method" value="DELETE">
<fieldset>
<legend>Delete Node</legend>
<div>
<label>
<span>&nbsp;</span>
<input type="Submit" value="Delete" />
</label>
</div>
</fieldset>
</form>
{/if}
</div>
{/if}
</div>
</div>
</div>
{if condition="html"}
</main>
</div>
</div>
{/if}
{if condition="html"}
<div id="footer">
<footer class="site-footer">
{include file="master2/footer.tpl"/}
</footer>
</div>
{include file="master2/optional_enhancement_js.tpl"/}
</body>
</html>
{/if}

View File

@@ -0,0 +1,70 @@
{if condition="html"}
<!DOCTYPE html>
<html lang="en">
<head>
{include file="master2/head.tpl"/}
</head>
<body>
{/if}
{unless condition="$web"}
<!-- Site Navigation -->
{include file="master2/site_navigation.tpl"/}
{/unless}
{if condition="html"}
<div class="container">
<hr>
<div class="row">
<main class="main">
{/if}
<div class="container-fluid">
<div class="col-xs-12" itemscope itemtype="http://schema.org/Article">
<form class="form-inline well" action="{$host/}/node/{$id/}/content" method="POST" class="">
<input type="hidden" name="method" value="PUT">
<fieldset>
<legend>Edit Node Content</legend>
<div class="row">
<div class="col-xs-1">
<label> <span itemprop="text">Content:</span> </label>
</div>
<div class="col-xs-7">
<textarea id="content" rows="25" cols="100" class="form-control" name="content" placeholder="Node content" required>{$node_content/}</textarea>
</div>
</div>
<div>
<label>
<span>&nbsp;</span>
<input type="Submit" value="Update" />
</label>
</div>
</fieldset>
</form>
</div>
</div>
{if condition="html"}
</main>
</div>
</div>
{/if}
{if condition="html"}
<div id="footer">
<footer class="site-footer">
{include file="master2/footer.tpl"/}
</footer>
</div>
{include file="master2/optional_enhancement_js.tpl"/}
</body>
</html>
{/if}

View File

@@ -0,0 +1,71 @@
{if condition="html"}
<!DOCTYPE html>
<html lang="en">
<head>
{include file="master2/head.tpl"/}
</head>
<body>
{/if}
{unless condition="$web"}
<!-- Site Navigation -->
{include file="master2/site_navigation.tpl"/}
{/unless}
{if condition="html"}
<div class="container">
<hr>
<div class="row">
<main class="main">
{/if}
<div class="container-fluid">
<div class="col-xs-12" itemscope itemtype="http://schema.org/Article">
<form class="form-inline well" action="{$host/}/node/{$id/}/summary" method="POST">
<input type="hidden" name="method" value="PUT">
<fieldset>
<legend>Edit Node Summary</legend>
<div class="row">
<div class="col-xs-1">
<label> <span itemprop="text">Summary:</span> </label>
</div>
<div class="col-xs-7">
<textarea id="summary" rows="3" cols="80" name="summary" placeholder="Node summary" required>{$node_summary/}</textarea>
</div>
</div>
<div>
<label>
<span>&nbsp;</span>
<input type="Submit" value="Send" />
</label>
</div>
</fieldset>
</form>
</div>
</div>
{if condition="html"}
</main>
</div>
</div>
{/if}
{if condition="html"}
<div id="footer">
<footer class="site-footer">
{include file="master2/footer.tpl"/}
</footer>
</div>
{include file="master2/optional_enhancement_js.tpl"/}
</body>
</html>
{/if}

View File

@@ -0,0 +1,70 @@
{if condition="html"}
<!DOCTYPE html>
<html lang="en">
<head>
{include file="master2/head.tpl"/}
</head>
<body>
{/if}
{unless condition="$web"}
<!-- Site Navigation -->
{include file="master2/site_navigation.tpl"/}
{/unless}
{if condition="html"}
<div class="container">
<hr>
<div class="row">
<main class="main">
{/if}
<div class="container-fluid">
<div class="col-xs-12" itemscope itemtype="http://schema.org/Article">
<form class="form-inline well" action="{$host/}/node/{$id/}/title" method="POST">
<input type="hidden" name="method" value="PUT">
<fieldset>
<legend>Edit Node Title</legend>
<div class="row">
<div class="col-xs-1">
<label> <span itemprop="text">Title:</span> </label>
</div>
<div class="col-xs-7">
<input id="title" type="text" name="title" placeholder="Title" required value="{$node_title/}"/>
</div>
</div>
<div>
<label>
<span>&nbsp;</span>
<input type="Submit" value="Send" />
</label>
</div>
</fieldset>
</form>
</div>
</div>
{if condition="html"}
</main>
</div>
</div>
{/if}
{if condition="html"}
<div id="footer">
<footer class="site-footer">
{include file="master2/footer.tpl"/}
</footer>
</div>
{include file="master2/optional_enhancement_js.tpl"/}
</body>
</html>
{/if}

View File

@@ -0,0 +1,52 @@
{if condition="html"}
<!DOCTYPE html>
<html lang="en">
<head>
{include file="master2/head.tpl"/}
</head>
<body>
{/if}
{unless condition="$web"}
<!-- Site Navigation -->
{include file="master2/site_navigation.tpl"/}
{/unless}
{if condition="html"}
<div class="container">
<hr>
<div class="row">
<main class="main">
{/if}
<div itemscope itemtype="http://schema.org/ItemList">
<h2 itemprop="name">List nodes</h2><br>
<meta itemprop="itemListOrder" content="Descending" />
{foreach from="$nodes" item="item"}
<div class="page-header">
<h3><span itemprop="itemListElement"><a href="{$host/}/node/{$item.id/}" rel="node"><strong>{$item.title/}</strong></a></span> <small>{$item.summary/} -{$item.publication_date_output/} </small></h3>
</div>
{/foreach}
</div>
{if condition="html"}
</main>
</div>
</div>
{/if}
{if condition="html"}
<div id="footer">
<footer class="site-footer">
{include file="master2/footer.tpl"/}
</footer>
</div>
{include file="master2/optional_enhancement_js.tpl"/}
</body>
</html>
{/if}

View File

@@ -0,0 +1,100 @@
{if condition="html"}
<!DOCTYPE html>
<html lang="en">
<head>
{include file="master2/head.tpl"/}
</head>
<body>
{/if}
{unless condition="$web"}
<!-- Site Navigation -->
{include file="master2/site_navigation.tpl"/}
{/unless}
{if condition="html"}
<div class="container">
<hr>
<div class="row">
<main class="main">
{/if}
<div class="container-fluid">
<div class="col-xs-12" itemscope itemtype="http://schema.org/Person">
<form class="form-inline well" action="{$host/}/user" data-rel="user-register" method="POST" >
<fieldset>
<legend>Register</legend>
<div class="span3">
<p>Register new user</p>
</div>
<div class="row">
<div class="col-xs-2">
<label><span itemprop="name">Username:</span> </label>
</div>
<div class="col-xs-7">
<input id="username" type="text" name="username" placeholder="Username" required/>
</div>
</div>
<div class="row" itemscope itemtype="http://schema.org/Text">
<div class="col-xs-2">
<label><span itemprop="accessCode">Password:</span> </label>
</div>
<div class="col-xs-7">
<input id="password" type="password" name="password" placeholder="Password" required/>
</div>
</div>
<div class="row" itemscope itemtype="http://schema.org/Text">
<div class="col-xs-2">
<label><span itemprop="accessCode">Re-type Password:</span> </label>
</div>
<div class="col-xs-7">
<input id="check_password" type="password" name="check_password" placeholder="Password" required/>
</div>
</div>
<div class="row">
<div class="col-xs-2">
<label><span itemprop="email">Email:</span> </label>
</div>
<div class="col-xs-7">
<input id="email" type="email" name="email" placeholder="Email" required/>
</div>
s</div>
<div>
<label>
<span>&nbsp;</span>
<input type="Submit" value="Send" />
</label>
</div>
</fieldset>
</form>
</div>
</div>
{if condition="html"}
</main>
</div>
</div>
{/if}
{if condition="html"}
<div id="footer">
<footer class="site-footer">
{include file="master2/footer.tpl"/}
</footer>
</div>
{include file="master2/optional_enhancement_js.tpl"/}
</body>
</html>
{/if}

View File

@@ -0,0 +1,9 @@
name=api
engine=smarty
author=jvelilla
version=0.1
regions[header] = Header
regions[content] = Content
regions[footer] = Footer
regions[first_sidebar] = first sidebar
regions[second_sidebar] = second sidebar

Binary file not shown.

View File

@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ROC- Layout with defualt Regions</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<style type="text/css">
</style>
<!-- Latest compiled and minified CSS -->
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
</head>
<body>
<head>
<title>{$head_title/}</title>
</head>
<body>
<!-- Page Top -->
{if isset="$region_top"}
{$region_top/}
{/if}
<!-- Body -->
<div class='container-fluid'>
<!-- Page Header -->
<div id="header">
{if isset="$page.primary_nav"}
{$page.primary_nav/}
{/if}
</div>
<!-- General Page Content -->
<div id='content' class='row-fluid'>
<!-- Left Sidebar sidebar_first -->
{unless empty="$page.region_sidebar_first"}
<div style="float: left;">
{$page.region_sidebar_first/}
</div>
{/unless}
<!-- Highlighted, Help, Content -->
<div class='span8 main'>
<!-- Highlighted Section -->
{$page.region_highlighted/}
<!-- Help Section -->
{$page.region_help/}
<!-- Main Content Section -->
{unless empty="$page_title"}<h1 class="page-title">{$page_title/}</h1>{/unless}
{$page.region_content/}
</div>
<!-- Right Sidebar sidebar_second-->
{unless empty="$page.region_sidebar_second"}
<div style="float: right;">
{$page.region_sidebar_second/}
</div>
{/unless}
</div>
</div>
<!--Page footer -->
{$page.region_footer/}
<!-- Page Bottom -->
{$page.region_bottom/}
</body>
<script type="text/javascript">
</script>
</body>
</html>

View File

@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ROC- Layout with defualt Regions</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<style type="text/css">
</style>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<head>
<title>ROC CMS - A responsive layout</title>
</head>
<body>
<!-- Page Top -->
<!-- Page Header -->
<div class='container-fluid'>
<h1>ROC Layout with Defaul Regions</h1>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
</button>
<a class="navbar-brand" href="https://www2.eiffel.com/beta" itemprop="home" rel="home">Eiffel Support Site</a>
</div>
<div class="navbar-collapse collapse" itemscope="itemscope" itemtype="https://www2.eiffel.com/beta/profile/esa_api.xml#report" >
<ul class="nav navbar-nav navbar-left">
<li><a href="https://www2.eiffel.com/beta/reports" class="active" itemprop="all" rel="all">Reports</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://www2.eiffel.com/beta/register" itemprop="register" rel="register">Register</a></li>
<!--<li><a class="login pull-right" data-toggle="modal" data-target="#myModalSignIn">Sign In</a></li> <! Custome Modal -->
<li id="login_pe" ><a href="https://www2.eiffel.com/beta/login" itemprop="login" rel="login">Sign In</a></li> <!-- Custome Modal -->
</ul>
<!--form class="navbar-form navbar-right">
<input type="text" class="form-control" placeholder="Search..."/>
</form -->
</div>
</div>
<div id='content' class='row-fluid'>
<!-- Highlighted-->
<!-- Left Side Bard sidebar_first -->
<div class='span2 sidebar'>
<h3>Left Sidebar</h3>
<ul class="nav nav-tabs nav-stacked">
<li><a href='#'>Another Link 1</a></li>
<li><a href='#'>Another Link 2</a></li>
<li><a href='#'>Another Link 3</a></li>
</ul>
</div>
<!-- Highlighted, Help, Content -->
<div class='span8 main'>
<h1>Highlighted Section</h1>
<h2>Help Section</h2>
<h2>Main Content Section</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.<p>
<p>Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.</p>
</div>
<!-- Left Side Bard sidebar_second-->
<div class='span2 sidebar'>
<h3>Right Sidebar</h3>
<ul class="nav nav-tabs nav-stacked">
<li><a href='#'>Another Link 1</a></li>
<li><a href='#'>Another Link 2</a></li>
<li><a href='#'>Another Link 3</a></li>
</ul>
</div>
</div>
</div>
<!--Page footer -->
<div id="footer">
<small>
<center>
<p class="text-muted"><a href="#" target="_blank" class="info">ROC Documentation </a>&nbsp;&nbsp;&nbsp;
<a href="http://www.eiffel.com/company/contact/" target="_blank" class="info">Questions? Comments? Let us know! </a></p>
<p>© Copyright 2014 Eiffel Software -- <a href="#" target="_blank" class="info">Privacy Policy</a>
</center>
</small>
</div>
<!-- Page Bottom -->
</body>
<script type="text/javascript">
</script>
</body>
</html>

View File

@@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ROC- Layout with defualt Regions</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<style type="text/css">
</style>
<!-- Latest compiled and minified CSS -->
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
</head>
<body>
<head>
<title>ROC CMS - A responsive layout</title>
</head>
<body>
<!-- Page Top -->
<!-- Page Header -->
<!-- <div class='container-fluid'>
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> <a class="navbar-brand" href="#">Eiffel ROC</a>
</div>
<ul class="nav navbar-nav navbar-left">
<li> <a href="#about">Home</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li> <a href="#about">About</a>
</li>
<li> <a href="#services">Service</a>
</li>
<li> <a href="#portfolio" class="">Portfolio</a>
</li>
</ul>
</div>
-->
<div class="container-fluid">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
</button>
<a class="navbar-brand" href="https://www2.eiffel.com/beta" itemprop="home" rel="home">Eiffel Support Site</a>
</div>
<div class="navbar-collapse collapse" itemscope="itemscope" itemtype="https://www2.eiffel.com/beta/profile/esa_api.xml#report" >
<ul class="nav navbar-nav navbar-left">
<li><a href="https://www2.eiffel.com/beta/reports" class="active" itemprop="all" rel="all">Reports</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://www2.eiffel.com/beta/register" itemprop="register" rel="register">Register</a></li>
<li id="login_pe" ><a href="https://www2.eiffel.com/beta/login" itemprop="login" rel="login">Sign In</a></li> <!-- Custome Modal -->
</ul>
</div>
</div>
</div>
<div id='content' class='row-fluid'>
<!-- Highlighted-->
<!-- Left Side Bard sidebar_first -->
<div class="sidebar col-sm-2 col-md-2">
<h3>Left Sidebar</h3>
<ul class="nav nav-tabs nav-stacked">
<li><a href="#">Another Link 1</a></li>
<li><a href="#">Another Link 2</a></li>
<li><a href="#">Another Link 3</a></li>
</ul>
</div>
<!-- Highlighted, Help, Content -->
<div class="main col-sm-8 col-md-8">
<h1>Highlighted Section</h1>
<h2>Help Section</h2>
<h2>Main Content Section</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.<p>
<p>Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.</p>
</div>
<!-- Left Side Bard sidebar_second-->
<div class="sidebar col-sm-2 col-md-2">
<h3>Right Sidebar</h3>
<ul class="nav nav-tabs nav-stacked">
<li><a href="#">Another Link 1</a></li>
<li><a href="#">Another Link 2</a></li>
<li><a href="#">Another Link 3</a></li>
</ul>
</div>
</div>
</div>
<!--Page footer -->
<div id="footer">
<small>
<center>
<p class="text-muted"><a href="#" target="_blank" class="info">ROC Documentation </a>&nbsp;&nbsp;&nbsp;
<a href="http://www.eiffel.com/company/contact/" target="_blank" class="info">Questions? Comments? Let us know! </a></p>
<p>© Copyright 2014 Eiffel Software -- <a href="#" target="_blank" class="info">Privacy Policy</a>
</center>
</small>
</div>
<!-- Page Bottom -->
</body>
<script type="text/javascript">
</script>
</body>
</html>

View File

@@ -0,0 +1,12 @@
{include file="tpl/page-header.tpl"/}
<div id="main-wrapper">
<div id="main">
<div id="first_sidebar" class="sidebar {if isset="$first_sidebar_css_class"}{$first_sidebar_css_class/}{/if}">{if isset="$first_sidebar"}{$first_sidebar/}{/if}</div>
<div id="content" class="{if isset="$content_css_class"}{$content_css_class/}{/if}">
Welcome ... this is the front page
{if isset="$content"}{$content/}{/if}
</div>
<div id="second_sidebar" class="sidebar {if isset="$second_sidebar_css_class"}{$second_sidebar_css_class/}{/if}">{if isset="$second_sidebar"}{$second_sidebar/}{/if}</div>
</div>
</div>
{include file="tpl/page-footer.tpl"/}

View File

@@ -0,0 +1,11 @@
{include file="tpl/page-header.tpl"/}
<div id="main-wrapper">
<div id="main">
<div id="first_sidebar" class="sidebar {if isset="$first_sidebar_css_class"}{$first_sidebar_css_class/}{/if}">{if isset="$first_sidebar"}{$first_sidebar/}{/if}</div>
<div id="content" class="{if isset="$content_css_class"}{$content_css_class/}{/if}">
{if isset="$content"}{$content/}{/if}
</div>
<div id="second_sidebar" class="sidebar {if isset="$second_sidebar_css_class"}{$second_sidebar_css_class/}{/if}">{if isset="$second_sidebar"}{$second_sidebar/}{/if}</div>
</div>
</div>
{include file="tpl/page-footer.tpl"/}

View File

@@ -0,0 +1,91 @@
/*
* EWF CMS javascript based on JQuery
*/
/**
* Override jQuery.fn.init to guard against XSS attacks.
*
* See http://bugs.jquery.com/ticket/9521
*/
(function () {
var jquery_init = jQuery.fn.init;
jQuery.fn.init = function (selector, context, rootjQuery) {
// If the string contains a "#" before a "<", treat it as invalid HTML.
if (selector && typeof selector === 'string') {
var hash_position = selector.indexOf('#');
if (hash_position >= 0) {
var bracket_position = selector.indexOf('<');
if (bracket_position > hash_position) {
throw 'Syntax error, unrecognized expression: ' + selector;
}
}
}
return jquery_init.call(this, selector, context, rootjQuery);
};
jQuery.fn.init.prototype = jquery_init.prototype;
})();
var EWFCMS = EWFCMS || { };
EWFCMS.toggleFieldset = function(fieldset) {
if ($(fieldset).is('.collapsed')) {
var content = $('> div:not(.action)', fieldset);
$(fieldset).removeClass('collapsed');
content.hide();
content.slideDown( {
duration: 'fast',
easing: 'linear',
complete: function() {
//Drupal.collapseScrollIntoView(this.parentNode);
this.parentNode.animating = false;
$('div.action', fieldset).show();
},
step: function() {
// Scroll the fieldset into view
//Drupal.collapseScrollIntoView(this.parentNode);
}
});
} else {
var content = $('> div:not(.action)', fieldset).slideUp('fast', function() {
$(this.parentNode).addClass('collapsed');
this.parentNode.animating = false;
});
}
};
jQuery(document).ready(function(){
//$('.collapsed').hide();
$('fieldset.collapsible > legend').each(function() {
var fieldset = $(this.parentNode);
// turn legen into clickable link and wrap contents
var text = this.innerHTML;
$(this).empty()
.append($('<a href="#">'+ text + '</a>').click(function() {
var fieldset = $(this).parents('fieldset:first')[0];
if (!fieldset.animating) {
fieldset.animating = true;
EWFCMS.toggleFieldset(fieldset);
}
return false;
}
))
.after($('<div class="fieldset-wrapper"></div>')
.append(fieldset.children(':not(legend):not(.action)')))
.addClass('collapse-processed');
});
$('fieldset.collapsed').each(function() {
$(this).removeClass('collapsed');
EWFCMS.toggleFieldset(this);
});
});
jQuery(document).ready(function(){
$('#tabs').tabs();
});
//jQuery(document).ready(function(){
//$('#second_sidebar').hide();
//});

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

View File

@@ -0,0 +1,251 @@
body { margin: 0; background-color: #eeeeff;}
div#header { background-color: #003; color: #fff; border: solid 1px #003; padding: 0px; margin: 0px;}
div#header img#logo { float: left; margin: 5px 15px 5px 10px; }
div#header div#title {font-size: 180%; font-weight: bold; margin-top: 10px; }
ul.horizontal {
list-style-type: none;
}
ul.horizontal li {
display: inline;
padding: 0 5px 0 5px;
}
div#menu-bar li.active {
border: solid 1px #ff0;
color: #ff0;
}
div#menu-bar li:hover {
background-color: #fff;
color: #00f;
}
div#menu-bar li a {
text-decoration: none;
color: #fff;
}
div#menu-bar li:hover a {
color: #00f;
font-style: bold;
}
div#primary-tabs li {
color: #00f;
padding: 2px 5px 2px 5px;
background-color: #eee;
border: solid 1px #ccf;
}
div#primary-tabs li.active {
padding: 2px 7px 1px 7px;
border-top: solid 2px #99f;
border-left: solid 1px #99f;
border-right: solid 1px #99f;
border-bottom: 0;
background-color: #fff;
color: #00f;
}
div#primary-tabs li:hover {
background-color: #fff;
color: #00f;
}
div#primary-tabs li a {
text-decoration: none;
color: #00f;
}
div#primary-tabs li:hover a {
color: #00f;
font-style: bold;
}
div#menu-first { margin-left: 20%; color: #ccf; background-color: #003; }
div#menu-first a { color: #ccf; }
div#menu-second { color: #99f; background-color: #333; }
div#menu-second a { color: #99f; }
div#main-wrapper {
clear: both;
display: block;
height: 0;
}
div#main { margin: 0; padding: 0; clear: both; height:0; display: block; }
div#content {
padding: 5px 3px 5px 20px;
margin-top: 10px;
min-width: 60%;
display: inline;
float: left;
position: relative;
background-color: #ffffff;
padding-bottom: 30px;
}
div#first_sidebar {
width: 20%;
margin: 5px;
padding: 5px;
display: inline;
float: left;
position: relative;
}
div#second_sidebar {
width: 20%;
margin: 5px;
padding: 5px;
display: inline;
float: left;
position: relative;
background-color: #eee;
}
div.sidebar div.block {
margin-bottom: 5px;
padding: 0;
border: dotted 1px #999;
background-color: #fff;
}
div.sidebar div.block div.title {
padding: 3px 3px 3px 3px;
font-weight: bold;
background-color: #dedede;
border-bottom: dotted 1px #999;
}
div.sidebar div.block div.inside {
margin: 3px;
}
div#footer { margin: 10px 0 10px 0; clear: both; display: block; text-align: center; padding: 10px; border-top: solid 1px #00f; color: #fff; background-color: #333;}
div#footer a { color: #ff0; }
form div.error {
border-top: dotted 1px #f00;
border-bottom: dotted 1px #f00;
border-left: solid 3px #f00;
}
div.node div.title {
font-weight: bold;
font-size: 110%;
border-bottom: dotted 1 px #009;
}
div.description {
font-style: italic;
font-color: #999;
}
div.node-wrapper {
margin: 5px 2px 5px 2px;
border: dotted 1px #dddddd;
padding: 5px 3px 5px 3px;
}
div.node div.title {
font-weight: bold;
font-size: 110%;
border-bottom: dotted 1 px #009;
float: left;
}
div.node div.description {
text-align: right;
}
div.node div.inner {
padding: 5px 5px 5px 10px;
border-top: dotted 1px #dddddd;
}
form#user-login {
border: dotted 1px #099;
display: inline-block;
padding: 10px;
margin: 10px;
}
form#user-login>div {
margin-bottom: 10px;
}
form#user-login .input {
float: left;
}
form#user-login img.logo {
}
div#message {
border: solid 1px #fc0;
background-color: #fed;
color: #000;
padding: 5px;
margin: 5px;
}
div#message li {
padding-left: 5px;
margin-left: 3px;
}
div#message li.success {
color: #003300;
background-color: #ccffcc;
}
div#message li.error {
color: #330000;
background-color: #ff9494;
}
div#message li.warning {
color: #aa2200;
background-color: #ffcc99;
}
div.columns {
margin-top: 10px;
display: inline-block;
clear: both;
}
div.columns>* {
padding-left: 10px;
padding-top: 5px;
border-top: dotted 1px #999;
border-left: dotted 1px #999;
margin-left: 1px;
margin-right: 10px;
float: left;
}
/* Link */
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
div.menu ul.vertical {
margin: 0;
padding-left: 10px;
list-style-type: none;
}
div.menu ul.vertical ul {
border-left: solid 3px #eee;
list-style-type: none;
margin: 0;
padding-left: 5px;
margin-left: 5px;
margin-bottom: 5px;
}
/* Fieldset and collapsible */
fieldset.collapsible legend a {
padding-left: 15px;
background: url(menu-expanded.png) 5px 75% no-repeat;
}
fieldset.collapsed legend a {
padding-left: 15px;
background: url(menu-collapsed.png) 5px 50% no-repeat;
}
fieldset.collapsed {
border: none;
border-top: dotted 1px #000;
}

View File

@@ -0,0 +1,10 @@
name=smarty
engine=smarty
author=jfiat
version=0.1
;template_dir=templates
regions[header] = Header
regions[content] = Content
regions[footer] = Footer
regions[first_sidebar] = first sidebar
regions[second_sidebar] = second sidebar

View File

@@ -0,0 +1,6 @@
<div id="footer">{if isset="$footer"}{$footer/}{/if}</div>
</div>
</div>
{if isset="$page_bottom"}{$page_bottom/}{/if}
</body>
</html>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$language/}" lang="{$language/}" version="XHTML+RDFa 1.0" dir="ltr">
<head>
{if isset="$head"}{$head/}{/if}
<title>{$head_title/}</title>
{if isset="$styles"}{$styles/}{/if}
{if isset="$scripts"}{$scripts/}{/if}
{if isset="$head_lines"}{$head_lines/}{/if}
</head>
<div id="page-wrapper">
<div id="page">
<div id="header">
{$header/}
</div>

View File

@@ -2,8 +2,8 @@ note
description: "[
application service
]"
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
revision: "$Revision: 96596 $"
date: "$Date: 2014-11-20 15:03:29 +0100 (jeu., 20 nov. 2014) $"
revision: "$Revision: 96138 $"
class
EWF_ROC_SERVER
@@ -16,9 +16,16 @@ inherit
initialize
end
WSF_SERVICE
redefine
execute
end
REFACTORING_HELPER
SHARED_EXECUTION_ENVIRONMENT
ARGUMENTS
SHARED_LOGGER
create
make_and_launch
@@ -36,19 +43,36 @@ feature {NONE} -- Initialization
do
Precursor
create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI} service_options.make_from_file ("demo.ini")
initialize_cms (cms_setup)
end
feature -- Service
cms_service: CMS_SERVICE
-- cms service.
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
do
cms_service.execute (req, res)
end
feature -- Layout
layout: CMS_LAYOUT
-- cms layout.
feature {NONE} -- Launch operation
launcher: APPLICATION_LAUNCHER [EWF_ROC_SERVER_EXECUTION]
launcher: APPLICATION_LAUNCHER
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
l_retry: BOOLEAN
l_message: STRING
do
if not l_retry then
launcher.launch (opts)
log.write_debug (generator + ".launch")
launcher.launch (a_service, opts)
else
-- error hanling.
create l_message.make (1024)
@@ -68,11 +92,63 @@ feature {NONE} -- Launch operation
l_message.append ("%N%N")
end
-- send email shutdown
log.write_debug (generator + ".launch shutdown")
end
rescue
l_retry := True
retry
end
feature -- CMS Initialization
cms_setup: CMS_DEFAULT_SETUP
do
if attached separate_character_option_value ('d') as l_dir then
log.write_debug (generator + ".cms_setup using a command line argument -d " + l_dir )
create layout.make_with_path (create {PATH}.make_from_string (l_dir))
else
log.write_debug (generator + ".cms_setup using current directory" )
create layout.make_default
end
create Result.make (layout)
setup_storage (Result)
end
initialize_cms (a_setup: CMS_SETUP)
local
cms: CMS_SERVICE
api: CMS_API
do
log.write_debug (generator + ".initialize_cms")
setup_modules (a_setup)
create api.make (a_setup)
create cms.make (api)
cms_service := cms
end
feature -- CMS setup
setup_modules (a_setup: CMS_SETUP)
-- Setup additional modules.
local
m: CMS_MODULE
do
create {BASIC_AUTH_MODULE} m.make
m.enable
a_setup.register_module (m)
create {CMS_DEMO_MODULE} m.make
m.enable
a_setup.register_module (m)
end
setup_storage (a_setup: CMS_SETUP)
do
debug ("refactor_fixme")
to_implement ("To implement custom storage")
end
a_setup.storage_drivers.force (create {CMS_STORAGE_MYSQL_BUILDER}.make, "mysql")
end
end

View File

@@ -1,57 +0,0 @@
note
description: "Summary description for {EWF_ROC_SERVER_EXECUTION}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
EWF_ROC_SERVER_EXECUTION
inherit
CMS_EXECUTION
redefine
initialize
end
REFACTORING_HELPER
SHARED_LOGGER
create
make
feature {NONE} -- Initialization
initialize
do
Precursor
end
feature -- CMS setup
setup_modules (a_setup: CMS_SETUP)
-- Setup additional modules.
local
m: CMS_MODULE
do
create {BASIC_AUTH_MODULE} m.make
if not a_setup.module_with_same_type_registered (m) then
m.enable
a_setup.register_module (m)
end
create {CMS_DEMO_MODULE} m.make
m.enable
a_setup.register_module (m)
end
setup_storage (a_setup: CMS_SETUP)
do
debug ("refactor_fixme")
to_implement ("To implement custom storage")
end
-- a_setup.storage_drivers.force (create {CMS_STORAGE_MYSQL_BUILDER}.make, "mysql")
a_setup.storage_drivers.force (create {CMS_STORAGE_SQLITE_BUILDER}.make, "sqlite")
end
end

View File

@@ -44,8 +44,8 @@ note
@include=file-to-include
]"
date: "$Date: 2015-03-09 19:25:49 +0100 (lun., 09 mars 2015) $"
revision: "$Revision: 96797 $"
date: "$Date: 2014-12-18 16:37:11 +0100 (jeu., 18 déc. 2014) $"
revision: "$Revision: 96383 $"
class
INI_CONFIG
@@ -314,13 +314,10 @@ feature {NONE} -- Implementation
f: PLAIN_TEXT_FILE
l_last_section_name: like last_section_name
retried: BOOLEAN
l_old_associated_path: like associated_path
do
l_old_associated_path := associated_path
if retried then
has_error := True
else
associated_path := p
l_last_section_name := last_section_name
last_section_name := Void
create f.make_with_path (p)
@@ -340,7 +337,6 @@ feature {NONE} -- Implementation
end
end
last_section_name := l_last_section_name
associated_path := l_old_associated_path
rescue
retried := True
retry
@@ -355,7 +351,6 @@ feature {NONE} -- Implementation
lst: LIST [STRING_8]
tb: STRING_TABLE [STRING_8]
i,j: INTEGER
p: PATH
l_section_name: like last_section_name
do
obj := Void
@@ -389,11 +384,7 @@ feature {NONE} -- Implementation
if k.is_case_insensitive_equal_general ("@include") then
create p.make_from_string (v)
if not p.is_absolute and attached associated_path as l_path then
p := l_path.parent.extended_path (p)
end
import_path (p, last_section_name)
import_path (create {PATH}.make_from_string (v), last_section_name)
else
i := k.index_of ('[', 1)
if i > 0 then

View File

@@ -11,19 +11,15 @@ note
- templates (html, Collection+JSON, ...)
- ...
]"
date: "$Date: 2015-02-05 10:25:53 +0100 (jeu., 05 févr. 2015) $"
revision: "$Revision: 96584 $"
date: "$Date$"
revision: "$Revision$"
class
APPLICATION_LAYOUT
inherit
SHARED_EXECUTION_ENVIRONMENT
create
make_default,
make_with_path,
make_with_directory_name
make_with_path
feature {NONE} -- Initialization
@@ -41,34 +37,6 @@ feature {NONE} -- Initialization
-- Create a layour based on a path `p'.
do
path := p.absolute_path.canonical_path
initialize_name
end
make_with_directory_name (a_dirname: READABLE_STRING_GENERAL)
-- Create a layour based on a path `p'.
do
make_with_path (create {PATH}.make_from_string (a_dirname))
end
initialize_name
-- Initialize `name'.
local
p: PATH
s: STRING_32
do
create p.make_from_string (execution_environment.arguments.command_name)
if attached p.entry as e then
p := e
end
create s.make_from_string (p.name)
if attached p.extension as l_extension then
s.remove_tail (l_extension.count + 1)
end
if s.is_whitespace then
set_name ({STRING_8} "app")
else
set_name (s)
end
end
feature -- Access
@@ -76,17 +44,6 @@ feature -- Access
path: PATH
-- Root location.
name: IMMUTABLE_STRING_32
-- Application name, default is "app"
feature -- Change
set_name (a_name: READABLE_STRING_GENERAL)
-- Set `name' from `a_name'.
do
create name.make_from_string_general (a_name)
end
feature -- Access: internal
config_path: PATH
@@ -206,6 +163,6 @@ feature {NONE} -- Implementation
-- Directory for templates (HTML, etc).
;note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -1,7 +1,7 @@
note
description: "Provide access to json configuration"
date: "$Date: 2015-01-27 19:15:02 +0100 (mar., 27 janv. 2015) $"
revision: "$Revision: 96542 $"
date: "$Date: 2015-01-14 16:13:47 +0100 (mer., 14 janv. 2015) $"
revision: "$Revision: 96454 $"
class
APPLICATION_JSON_CONFIGURATION_HELPER
@@ -47,7 +47,7 @@ feature -- Application Configuration
attached {JSON_OBJECT} l_environments.item (l_envrionment.item) as l_environment_selected and then
attached {JSON_STRING} l_environment_selected.item ("connection_string") as l_connection_string
then
create Result.make (l_driver.item, l_connection_string.unescaped_string_32)
create Result.make (l_driver.item, l_connection_string.unescaped_string_8)
end
end
end

View File

@@ -1,7 +1,7 @@
note
description: "Object that represent Database configuration settings"
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
revision: "$Revision: 96596 $"
date: "$Date: 2015-01-14 16:13:47 +0100 (mer., 14 janv. 2015) $"
revision: "$Revision: 96454 $"
class
DATABASE_CONFIGURATION
@@ -33,65 +33,10 @@ feature -- Access
connection_string: READABLE_STRING_32
-- Connection string
do
Result := {STRING_32} "Driver={" + driver + {STRING_32} "};" + database_string
Result := "Driver={"+driver+"};" + database_string;
end
item (a_param: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
local
s: READABLE_STRING_32
lower_s: READABLE_STRING_32
i,j: INTEGER
k: STRING_32
do
create k.make_from_string_general (a_param)
k.to_lower
s := database_string
lower_s := s.as_lower
i := lower_s.substring_index (k + {STRING_32} "=", 1)
if i > 0 then
if i = 1 or else s[i-1] = ';' then
j := s.index_of (';', i + k.count + 1)
if j = 0 then
j := s.count + 1
end
Result := s.substring (i + k.count + 1, j - 1)
end
end
end
server_name: detachable READABLE_STRING_32
do
Result := item ("Server")
end
port: INTEGER
do
if
attached item ("Port") as l_port and then
l_port.is_integer
then
Result := l_port.to_integer
end
end
database_name: detachable READABLE_STRING_32
do
Result := item ("Database")
end
user_id: detachable READABLE_STRING_32
do
Result := item ("Uid")
end
user_password: detachable READABLE_STRING_32
do
Result := item ("Pwd")
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -1,7 +1,7 @@
note
description: "Object that represents Logger configuration settings"
date: "$Date: 2015-02-03 19:11:23 +0100 (mar., 03 févr. 2015) $"
revision: "$Revision: 96575 $"
date: "$Date: 2014-08-20 15:21:15 -0300 (mi., 20 ago. 2014) $"
revision: "$Revision: 95678 $"
class
LOGGER_CONFIGURATION
@@ -29,7 +29,6 @@ feature -- Initialization
do
backup_count := 4
level := Log_debug
location := Void
ensure then
backup_count_set: backup_count = 4
level_set: level = Log_debug
@@ -37,9 +36,6 @@ feature -- Initialization
feature -- Access
location: detachable PATH
-- Location for logs files, if none use default logs location.
backup_count: NATURAL
-- Max number of backup files.
-- When 0, no backup files are created, and the log file is simply truncated when it becomes larger than `max_file_size'.
@@ -50,21 +46,6 @@ feature -- Access
feature -- Element Change
set_location (a_location: detachable PATH)
-- Set `location' to `a_location'.
do
location := a_location
ensure
location_set: a_location ~ location
end
set_location_with_string (a_location: READABLE_STRING_GENERAL)
require
a_location /= Void and then not a_location.is_whitespace
do
set_location (create {PATH}.make_from_string (a_location))
end
set_backup_count (a_backup: NATURAL)
-- Set backup_count to `a_backup'.
do
@@ -97,6 +78,6 @@ feature -- Element Change
end
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -56,10 +56,10 @@ feature -- Element Settings
l_message.append ("An unknown exception was raised.")
end
set_last_error (l_message, a_location)
write_critical_log (generator + ".set_last_error_from_exception " + l_message)
log.write_critical (generator + ".set_last_error_from_exception " + l_message)
else
set_last_error ("Generic error", "")
write_critical_log (generator + ".set_last_error_from_exception Generic Error")
log.write_critical (generator + ".set_last_error_from_exception Generic Error")
end
rescue
l_retried := True
@@ -75,7 +75,7 @@ feature -- Element Settings
attached_location: a_location /= Void
do
create last_error.make (a_message, a_location)
write_critical_log (generator + ".set_last_error " + a_message)
log.write_critical (generator + ".set_last_error " + a_message)
successful := False
ensure
last_error_set: attached last_error
@@ -103,6 +103,6 @@ feature -- Element Settings
successful: successful
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -1,172 +0,0 @@
note
description: "Summary description for {LOGGER}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
LOGGER
inherit
ANY
LOG_PRIORITY_CONSTANTS
export
{NONE} all
end
SHARED_EXECUTION_ENVIRONMENT
export
{NONE} all
end
create
make,
make_with_layout
feature {NONE} -- Initialization
make
do
create log.make
end
make_with_layout (app: APPLICATION_LAYOUT)
do
make
apply_layout (app)
end
feature -- Change
apply_layout (app: APPLICATION_LAYOUT)
do
initialize_logger (app, log)
end
feature {NONE} -- Internal
log: LOGGING_FACILITY
feature -- Logging
put_information (a_message: separate READABLE_STRING_8)
do
log.write_information (create {STRING}.make_from_separate (a_message))
end
put_error (a_message: separate READABLE_STRING_8)
do
log.write_error (create {STRING}.make_from_separate (a_message))
end
put_warning (a_message: separate READABLE_STRING_8)
do
log.write_warning (create {STRING}.make_from_separate (a_message))
end
put_critical (a_message: separate READABLE_STRING_8)
do
log.write_critical (create {STRING}.make_from_separate (a_message))
end
put_alert (a_message: separate READABLE_STRING_8)
do
log.write_alert (create {STRING}.make_from_separate (a_message))
end
put_debug (a_message: separate READABLE_STRING_8)
do
log.write_debug (create {STRING}.make_from_separate (a_message))
end
feature {NONE} -- Implementation
initialize_logger (app: APPLICATION_LAYOUT; a_log: like log)
local
l_log_writer_file: LOG_ROLLING_WRITER_FILE
l_log_writer: LOG_WRITER
l_logs_path: detachable PATH
l_logger_config: LOGGER_CONFIGURATION
ut: FILE_UTILITIES
do
l_logger_config := new_logger_level_configuration (app.application_config_path)
l_logs_path := l_logger_config.location
if l_logs_path = Void then
l_logs_path := app.logs_path
end
if ut.directory_path_exists (l_logs_path) then
create l_log_writer_file.make_at_location (l_logs_path.extended (app.name).appended_with_extension ("log"))
l_log_writer_file.set_max_file_size ({NATURAL_64} 1024 * 1204)
l_log_writer_file.set_max_backup_count (l_logger_config.backup_count)
l_log_writer := l_log_writer_file
else
-- Should we create the directory anyway ?
create {LOG_WRITER_NULL} l_log_writer
end
set_logger_level (l_log_writer, l_logger_config.level)
a_log.register_log_writer (l_log_writer)
end
set_logger_level (a_log_writer: LOG_WRITER; a_priority: INTEGER)
-- Setup the logger level based on `a_priority'
do
if a_priority = log_debug then
a_log_writer.enable_debug_log_level
elseif a_priority = Log_emergency then
a_log_writer.enable_emergency_log_level
elseif a_priority = Log_alert then
a_log_writer.enable_alert_log_level
elseif a_priority = Log_critical then
a_log_writer.enable_critical_log_level
elseif a_priority = Log_error then
a_log_writer.enable_error_log_level
elseif a_priority = Log_warning then
a_log_writer.enable_warning_log_level
elseif a_priority = Log_notice then
a_log_writer.enable_notice_log_level
elseif a_priority = Log_information then
a_log_writer.enable_information_log_level
else
a_log_writer.enable_unkno_log_level
end
end
new_logger_level_configuration (a_path: PATH): LOGGER_CONFIGURATION
-- Retrieve a new logger level configuration.
-- By default, level is set to `DEBUG'.
local
l_parser: JSON_PARSER
ut: FILE_UTILITIES
do
create Result
if
ut.file_path_exists (a_path) and then
attached (create {JSON_FILE_READER}).read_json_from (a_path.name) as json_file
then
create l_parser.make_with_string (json_file)
l_parser.parse_content
if
l_parser.is_valid and then
attached l_parser.parsed_json_object as jv and then
attached {JSON_OBJECT} jv.item ("logger") as l_logger
then
if attached {JSON_STRING} l_logger.item ("location") as l_location then
Result.set_location_with_string (l_location.item)
end
if attached {JSON_STRING} l_logger.item ("backup_count") as l_count then
if l_count.item.is_natural then
Result.set_backup_count (l_count.item.to_natural)
end
end
if attached {JSON_STRING} l_logger.item ("level") as l_level then
Result.set_level (l_level.item)
end
end
end
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -67,6 +67,7 @@ feature -- Output
rescue
l_retry := True
retry
end
write_emergency (msg: STRING)
@@ -134,6 +135,6 @@ feature -- Output
retry
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -1,7 +1,7 @@
note
description: "Provides logger information"
date: "$Date: 2015-02-05 10:25:53 +0100 (jeu., 05 févr. 2015) $"
revision: "$Revision: 96584 $"
date: "$Date: 2015-01-15 00:00:58 +0100 (jeu., 15 janv. 2015) $"
revision: "$Revision: 96461 $"
class
SHARED_LOGGER
@@ -9,107 +9,103 @@ class
inherit
LOG_PRIORITY_CONSTANTS
SHARED_EXECUTION_ENVIRONMENT
ARGUMENTS
feature -- Logger
logger: separate LOGGER
-- `log' facility (once per process)
log: LOGGING_FACILITY
-- New `log' (once per process)
-- that could be shared between threads
-- without reinitializing it.
do
Result := logger_cell_item (logger_cell)
end
logger_cell: separate CELL [separate LOGGER]
once ("PROCESS")
create Result.put (create {separate LOGGER}.make)
end
logger_cell_item (a_cell: like logger_cell): separate LOGGER
do
Result := a_cell.item
end
feature -- Logging
write_debug_log (m: READABLE_STRING_8)
do
write_debug_log_to (m, logger)
end
write_information_log (m: READABLE_STRING_8)
do
write_information_log_to (m, logger)
end
write_warning_log (m: READABLE_STRING_8)
do
write_warning_log_to (m, logger)
end
write_error_log (m: READABLE_STRING_8)
do
write_error_log_to (m, logger)
end
write_critical_log (m: READABLE_STRING_8)
do
write_critical_log_to (m, logger)
end
write_alert_log (m: READABLE_STRING_8)
do
write_alert_log_to (m, logger)
end
feature {NONE} -- Logger: separate implementation
write_debug_log_to (m: READABLE_STRING_8; a_log: like logger)
do
a_log.put_debug (m)
end
write_information_log_to (m: READABLE_STRING_8; a_log: like logger)
do
a_log.put_information (m)
end
write_warning_log_to (m: READABLE_STRING_8; a_log: like logger)
do
a_log.put_warning (m)
end
write_error_log_to (m: READABLE_STRING_8; a_log: like logger)
do
a_log.put_error (m)
end
write_critical_log_to (m: READABLE_STRING_8; a_log: like logger)
do
a_log.put_critical (m)
end
write_alert_log_to (m: READABLE_STRING_8; a_log: like logger)
do
a_log.put_alert (m)
end
feature {NONE} -- Implementation
initialize_logger (app: APPLICATION_LAYOUT)
local
l_logger: LOGGER
do
create l_logger.make_with_layout (app)
set_logger_to (l_logger, logger_cell)
l_log_writer: LOG_ROLLING_WRITER_FILE
l_environment: EXECUTION_ENVIRONMENT
l_path: PATH
l_logger_config: LOGGER_CONFIGURATION
once ("PROCESS")
--| Initialize the logging facility
create Result.make
create l_environment
if attached separate_character_option_value ('d') as l_dir then
l_path := create {PATH}.make_from_string (l_dir)
create l_log_writer.make_at_location (l_path.extended ("logs").appended ("\api.log"))
else
l_path := create {PATH}.make_current
create l_log_writer.make_at_location (l_path.extended("api.log"))
end
l_log_writer.set_max_file_size ({NATURAL_64}1024*1204)
if attached separate_character_option_value ('d') as l_dir then
l_logger_config := new_logger_level_configuration (l_path.extended("config").extended ("application_configuration.json"))
else
l_logger_config := new_logger_level_configuration (l_path.extended ("site").extended("config").extended ("application_configuration.json"))
end
l_log_writer.set_max_backup_count (l_logger_config.backup_count)
set_logger_level (l_log_writer, l_logger_config.level)
log.register_log_writer (l_log_writer)
--| Write an informational message
Result.write_information ("The application is starting up...")
end
set_logger_to (a_logger: separate LOGGER; a_cell: like logger_cell)
feature {NONE} -- JSON
set_logger_level (a_log_writer: LOG_ROLLING_WRITER_FILE; a_priority: INTEGER)
-- Setup the logger level based on `a_priority'
do
a_cell.replace (a_logger)
if a_priority = log_debug then
a_log_writer.enable_debug_log_level
elseif a_priority = Log_emergency then
a_log_writer.enable_emergency_log_level
elseif a_priority = Log_alert then
a_log_writer.enable_alert_log_level
elseif a_priority = Log_critical then
a_log_writer.enable_critical_log_level
elseif a_priority = Log_error then
a_log_writer.enable_error_log_level
elseif a_priority = Log_warning then
a_log_writer.enable_warning_log_level
elseif a_priority = Log_notice then
a_log_writer.enable_notice_log_level
elseif a_priority = Log_information then
a_log_writer.enable_information_log_level
else
a_log_writer.enable_unkno_log_level
end
end
new_logger_level_configuration (a_path: PATH): LOGGER_CONFIGURATION
-- Retrieve a new logger level configuration.
-- By default, level is set to `DEBUG'.
local
l_parser: JSON_PARSER
do
create Result
if attached json_file_from (a_path) as json_file then
l_parser := new_json_parser (json_file)
if attached {JSON_OBJECT} l_parser.parse as jv and then l_parser.is_parsed and then
attached {JSON_OBJECT} jv.item ("logger") as l_logger and then
attached {JSON_STRING} l_logger.item ("backup_count") as l_count and then
attached {JSON_STRING} l_logger.item ("level") as l_level then
Result.set_level (l_level.item)
if l_count.item.is_natural then
Result.set_backup_count (l_count.item.to_natural)
end
end
end
end
json_file_from (a_fn: PATH): detachable STRING
do
Result := (create {JSON_FILE_READER}).read_json_from (a_fn.name.out)
end
new_json_parser (a_string: STRING): JSON_PARSER
do
create Result.make_parser (a_string)
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"

View File

@@ -5,8 +5,8 @@
<option warning="true" void_safety="all">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<setting name="console_application" value="true"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<cluster name="cms_model" location=".\src\" recursive="true">
<file_rule>

View File

@@ -5,8 +5,8 @@
<option warning="true" void_safety="none">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<setting name="console_application" value="true"/>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<cluster name="cms_model" location=".\src\" recursive="true">
<file_rule>

View File

@@ -3,8 +3,8 @@ note
CMS abstraction for CMS content entity, named "node".
]"
status: "draft"
date: "$Date: 2015-01-27 19:15:02 +0100 (mar., 27 janv. 2015) $"
revision: "$Revision: 96542 $"
date: "$Date$"
revision: "$Revision$"
class
CMS_NODE
@@ -83,8 +83,8 @@ feature -- Access
author: detachable CMS_USER
-- Author of current node.
-- collaborators: detachable LIST[CMS_USER]
-- -- Users contributed to current Node.
collaborators: detachable LIST[CMS_USER]
-- Users contributed to current Node.
feature -- status report
@@ -177,18 +177,18 @@ feature -- Element change
auther_set: author = u
end
-- add_collaborator (a_user: CMS_USER)
-- -- Add collaborator `a_user' to the collaborators list.
-- local
-- lst: like collaborators
-- do
-- lst := collaborators
-- if lst = Void then
-- create {ARRAYED_SET [CMS_USER]} lst.make (1)
-- collaborators := lst
-- end
-- lst.force (a_user)
-- end
add_collaborator (a_user: CMS_USER)
-- Add collaborator `a_user' to the collaborators list.
local
lst: like collaborators
do
lst := collaborators
if lst = Void then
create {ARRAYED_SET [CMS_USER]} lst.make (1)
collaborators := lst
end
lst.force (a_user)
end
note
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"

View File

@@ -2,29 +2,18 @@ note
description: "[
Abstraction to represent a URI link in the CMS system.
]"
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
revision: "$Revision: 96596 $"
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_LINK
inherit
REFACTORING_HELPER
undefine
is_equal
end
DEBUG_OUTPUT
undefine
is_equal
end
ITERABLE [CMS_LINK]
undefine
is_equal
end
COMPARABLE
feature -- Access
@@ -34,21 +23,6 @@ feature -- Access
location: READABLE_STRING_8
-- Associated url location.
weight: INTEGER
-- Optional weight used for order.
feature -- Comparison
is_less alias "<" (other: like Current): BOOLEAN
-- Is current object less than `other'?
do
if weight = other.weight then
Result := title < other.title
else
Result := weight < other.weight
end
end
feature -- status report
is_active: BOOLEAN
@@ -79,16 +53,6 @@ feature -- status report
deferred
end
feature -- Element change
set_weight (a_weight: INTEGER)
-- Set `weight' to `a_weight'.
do
weight := a_weight
ensure
weight_set: weight = a_weight
end
feature -- Query
parent: detachable CMS_LINK
@@ -120,12 +84,9 @@ feature -- Status report
create Result.make_from_string (title)
Result.append_string_general (" -> ")
Result.append_string_general (location)
Result.append_string_general (" [")
Result.append_integer (weight)
Result.append_string_general ("]")
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -2,8 +2,8 @@ note
description: "[
Abstraction to represent a links container in the CMS system.
]"
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
revision: "$Revision: 96596 $"
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_LINK_COMPOSITE
@@ -30,27 +30,6 @@ feature -- Element change
deferred
end
sort
-- Sort `items' and also recursively in sub items.
local
l_sorter: QUICK_SORTER [CMS_LINK]
do
create l_sorter.make (create {COMPARABLE_COMPARATOR [CMS_LINK]})
if attached items as lst then
l_sorter.sort (lst)
across
lst as ic
loop
if
attached {CMS_LINK_COMPOSITE} ic.item as l_composite and then
not l_composite.is_empty
then
l_composite.sort
end
end
end
end
feature -- status report
is_empty: BOOLEAN
@@ -68,6 +47,6 @@ feature -- status report
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -2,8 +2,8 @@ note
description: "[
Abstraction to represent a link to a CMS resource.
]"
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
revision: "$Revision: 96596 $"
date: "$Date$"
revision: "$Revision$"
class
CMS_LOCAL_LINK
@@ -16,8 +16,6 @@ inherit
items as children,
extend as add_link,
remove as remove_link
undefine
is_equal
end
create
@@ -170,6 +168,6 @@ feature {NONE} -- Implementation
invariant
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -3,8 +3,8 @@ note
Abstraction to represent a MENU in the CMS system.
It has items as sub menu/link.
]"
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
revision: "$Revision: 96596 $"
date: "$Date$"
revision: "$Revision$"
class
CMS_MENU
@@ -61,17 +61,6 @@ feature -- Status report
Result := items.is_empty
end
has (lnk: CMS_LINK): BOOLEAN
do
across
items as ic
until
Result
loop
Result := ic.item.location.same_string (lnk.location)
end
end
feature -- Element change
extend (lnk: CMS_LINK)
@@ -102,6 +91,6 @@ feature -- Access
invariant
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -2,8 +2,8 @@ note
description: "[
Interface representing a USER in the CMS system.
]"
date: "$Date: 2015-01-27 19:15:02 +0100 (mar., 27 janv. 2015) $"
revision: "$Revision: 96542 $"
date: "$Date$"
revision: "$Revision$"
class
CMS_USER
@@ -13,38 +13,19 @@ inherit
DEBUG_OUTPUT
create
make,
make_with_id -- MAYBE: export to CMS_STORAGE
make
feature {NONE} -- Initialization
make (a_name: READABLE_STRING_32)
-- Create an object with name `a_name'.
require
a_name_not_empty: not a_name.is_whitespace
do
name := a_name
initialize
create creation_date.make_now_utc
ensure
name_set: name = a_name
end
make_with_id (a_id: INTEGER_64)
require
a_id_valid: a_id > 0
do
id := a_id
name := {STRING_32} ""
initialize
ensure
id_set: id = a_id
end
initialize
do
create creation_date.make_now_utc
end
feature -- Access
id: INTEGER_64
@@ -54,10 +35,7 @@ feature -- Access
-- User name.
password: detachable READABLE_STRING_32
-- User password (plain text password).
hashed_password: detachable READABLE_STRING_8
-- Hashed user password.
-- User password.
email: detachable READABLE_STRING_32
-- User email.
@@ -135,20 +113,8 @@ feature -- Change element
-- Set `password' with `a_password'.
do
password := a_password
hashed_password := Void
ensure
password_set: password = a_password
hashed_password_void: hashed_password = Void
end
set_hashed_password (a_hashed_password: like hashed_password)
-- Set `hashed_password' with `a_hashed_password'.
do
hashed_password := a_hashed_password
password := Void
ensure
password_void: password = Void
hashed_password_set: hashed_password = a_hashed_password
end
set_email (a_email: like email)
@@ -212,10 +178,6 @@ feature -- Change element: data
end
end
invariant
id_or_name_set: id > 0 or else not name.is_whitespace
note
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"

View File

@@ -42,7 +42,7 @@ feature -- Initialization
rescue
create db_control.make
-- set_last_error_from_exception ("Connection execution")
-- write_critical_log (generator + ".make_common:" + last_error_message)
-- log.write_critical (generator + ".make_common:" + last_error_message)
if is_connected then
disconnect
end
@@ -73,7 +73,7 @@ feature -- Initialization
rescue
create db_control.make
-- set_last_error_from_exception ("Connection execution")
-- write_critical_log (generator + ".make_common:" + last_error_message)
-- log.write_critical (generator + ".make_common:" + last_error_message)
if is_connected then
disconnect
end
@@ -103,20 +103,20 @@ feature -- Initialization
login_with_connection_string (a_string: STRING)
-- Login with `a_connection_string'and immediately connect to database.
do
write_debug_log (generator +".login_with_connection_string")
log.write_debug (generator +".login_with_connection_string")
create db_application.login_with_connection_string (a_string)
create database_error_handler.make
db_application.set_base
create db_control.make
write_debug_log (generator +".login_with_connection_string, is_keep_connection? "+ is_keep_connection.out )
log.write_debug (generator +".login_with_connection_string, is_keep_connection? "+ is_keep_connection.out )
keep_connection := is_keep_connection
if keep_connection then
connect
if not db_control.is_ok then
write_critical_log (generator +".login_with_connection_string:"+ db_control.error_code.out )
write_critical_log (generator +".login_with_connection_string:"+ db_control.error_message_32 )
log.write_critical (generator +".login_with_connection_string:"+ db_control.error_code.out )
log.write_critical (generator +".login_with_connection_string:"+ db_control.error_message_32 )
end
write_debug_log (generator +".login_with_connection_string, After connect, is_connected? "+ is_connected.out)
log.write_debug (generator +".login_with_connection_string, After connect, is_connected? "+ is_connected.out)
end
end

View File

@@ -1,7 +1,7 @@
note
description: "Abstract Database Handler"
date: "$Date: 2015-01-27 19:15:02 +0100 (mar., 27 janv. 2015) $"
revision: "$Revision: 96542 $"
date: "$Date: 2014-08-20 15:21:15 -0300 (mi., 20 ago. 2014) $"
revision: "$Revision: 95678 $"
deferred class
DATABASE_HANDLER
@@ -153,22 +153,22 @@ feature -- Status Report
end
connection: DATABASE_CONNECTION
-- Database connection.
-- Database connection.
db_control: DB_CONTROL
-- Database control.
-- Database control.
do
Result := connection.db_control
end
db_result: detachable DB_RESULT
-- Database query result.
-- Database query result.
db_selection: detachable DB_SELECTION
-- Database selection.
-- Database selection.
db_change: detachable DB_CHANGE
-- Database modification.
-- Database modification.
feature -- Error handling
@@ -177,7 +177,7 @@ feature -- Error handling
do
if attached db_change as l_change and then not l_change.is_ok then
database_error_handler.add_database_error (l_change.error_message_32, l_change.error_code)
write_error_log (generator + ".check_database_change_error: " + l_change.error_message_32)
log.write_error (generator + ".check_database_change_error: " + l_change.error_message_32)
l_change.reset
end
end
@@ -187,7 +187,7 @@ feature -- Error handling
do
if attached db_selection as l_selection and then not l_selection.is_ok then
database_error_handler.add_database_error (l_selection.error_message_32, l_selection.error_code)
write_error_log (generator + ".check_database_selection_error: " + l_selection.error_message_32)
log.write_error (generator + ".check_database_selection_error: " + l_selection.error_message_32)
l_selection.reset
end
end

View File

@@ -44,7 +44,7 @@ feature -- Functionality
items := l_store.execute_reader (l_db_selection)
check_database_selection_error
end
write_debug_log ( generator+".execute_reader Successful")
log.write_debug ( generator+".execute_reader Successful")
end
rescue
l_retried := True
@@ -69,7 +69,7 @@ feature -- Functionality
l_store.execute_writer (l_db_change)
check_database_change_error
end
write_debug_log ( generator+".execute_writer Successful")
log.write_debug ( generator+".execute_writer Successful")
end
rescue
l_retried := True

View File

@@ -1,12 +1,13 @@
note
description: "Abstract Database Query"
date: "$Date: 2015-01-27 19:15:02 +0100 (mar., 27 janv. 2015) $"
revision: "$Revision: 96542 $"
date: "$Date: 2014-08-20 15:21:15 -0300 (mi., 20 ago. 2014) $"
revision: "$Revision: 95678 $"
class
DATABASE_QUERY
inherit
REFACTORING_HELPER
SHARED_LOGGER
@@ -16,11 +17,11 @@ create
feature {NONE} -- Intialization
data_reader (a_query: STRING; a_parameters: like parameters)
data_reader (a_query: STRING; a_parameters: STRING_TABLE [detachable ANY])
-- SQL data reader for the query `a_query' with arguments `a_parameters'
do
write_information_log (generator + ".data_reader" + " execute query: " + a_query)
write_debug_log (generator + ".data_reader" + " arguments:" + log_parameters (a_parameters))
log.write_information (generator + ".data_reader" + " execute query: " + a_query)
log.write_debug (generator + ".data_reader" + " arguments:" + log_parameters (a_parameters))
query := a_query
parameters := a_parameters
ensure
@@ -43,7 +44,7 @@ feature -- Execution
a_base_selection.load_result
Result := a_base_selection.container
else
write_error_log (generator + "." + a_base_selection.error_message_32)
log.write_error (generator + "." + a_base_selection.error_message_32)
end
unset_map_name (a_base_selection)
a_base_selection.terminate
@@ -64,7 +65,7 @@ feature -- Access
query: STRING
-- SQL query to execute.
parameters: detachable STRING_TABLE [detachable ANY]
parameters: STRING_TABLE [detachable ANY]
-- query parameters.
feature {NONE} -- Implementation
@@ -72,24 +73,26 @@ feature {NONE} -- Implementation
set_map_name (a_base_selection: DB_EXPRESSION)
-- Store parameters `item' and their `key'.
do
if attached parameters as l_parameters then
across
l_parameters as ic
loop
a_base_selection.set_map_name (ic.item, ic.key)
end
from
parameters.start
until
parameters.after
loop
a_base_selection.set_map_name (parameters.item_for_iteration, parameters.key_for_iteration)
parameters.forth
end
end
unset_map_name (a_base_selection: DB_EXPRESSION)
-- Remove parameters item associated with key `key'.
do
if attached parameters as l_parameters then
across
l_parameters as ic
loop
a_base_selection.unset_map_name (ic.key)
end
from
parameters.start
until
parameters.after
loop
a_base_selection.unset_map_name (parameters.key_for_iteration)
parameters.forth
end
end
@@ -98,25 +101,26 @@ feature {NONE} -- Implementation
-- exclude sensitive information.
do
create Result.make_empty
if a_parameters /= Void then
across
a_parameters as ic
loop
Result.append ("name:")
Result.append (ic.key.as_string_32)
Result.append (", value:")
if
ic.key.has_substring ("Password") or else
ic.key.has_substring ("password")
then
-- Data to exclude
else
if attached ic.item as l_item then
Result.append (l_item.out)
end
from
a_parameters.start
until
a_parameters.after
loop
Result.append ("name:")
Result.append (a_parameters.key_for_iteration.as_string_32)
Result.append (", value:")
if
a_parameters.key_for_iteration.has_substring ("Password") or else
a_parameters.key_for_iteration.has_substring ("password")
then
-- Data to exclude
else
if attached a_parameters.item_for_iteration as l_item then
Result.append (l_item.out)
end
Result.append ("%N")
end
Result.append ("%N")
a_parameters.forth
end
end

View File

@@ -1,9 +1,8 @@
note
description: "Help to encode sql queries, to prevent sql injections."
date: "$Date: 2015-01-27 19:15:02 +0100 (mar., 27 janv. 2015) $"
revision: "$Revision: 96542 $"
date: "$Date: 2014-08-20 15:21:15 -0300 (mi., 20 ago. 2014) $"
revision: "$Revision: 95678 $"
EIS: "SQL server injection", "src=http://blogs.msdn.com/b/raulga/archive/2007/01/04/dynamic-sql-sql-injection.aspx", "protocol=url"
expanded class
DATABASE_SQL_SERVER_ENCODER
@@ -13,7 +12,7 @@ inherit
feature -- Escape SQL input
encode (a_string: READABLE_STRING_32): READABLE_STRING_32
encode (a_string:READABLE_STRING_32): READABLE_STRING_32
-- Escape single quote (') and braces ([,]).
local
l_string: STRING

View File

@@ -20,8 +20,8 @@ feature -- Intialization
local
l_retried: BOOLEAN
do
write_information_log (generator + ".data_reader" + " execute store procedure: " + a_sp)
write_debug_log (generator + ".data_reader" + " arguments:" + log_parameters (a_parameters))
log.write_information (generator + ".data_reader" + " execute store procedure: " + a_sp)
log.write_debug (generator + ".data_reader" + " arguments:" + log_parameters (a_parameters))
if not l_retried then
stored_procedure := a_sp
parameters := a_parameters
@@ -33,14 +33,14 @@ feature -- Intialization
if proc.exists then
if proc.text_32 /= Void then
debug
write_debug_log ( generator + ".data_reader: " + proc.text_32)
log.write_debug ( generator + ".data_reader: " + proc.text_32)
end
end
else
has_error := True
error_message := proc.error_message_32
error_code := proc.error_code
write_error_log (generator + ".data_witer message:" + proc.error_message_32 + " code:" + proc.error_code.out)
log.write_error (generator + ".data_witer message:" + proc.error_message_32 + " code:" + proc.error_code.out)
end
else
stored_procedure := a_sp
@@ -49,7 +49,7 @@ feature -- Intialization
end
rescue
set_last_error_from_exception ("SQL execution")
write_critical_log (generator+ ".data_reader " + last_error_message)
log.write_critical (generator+ ".data_reader " + last_error_message)
l_retried := True
retry
end
@@ -59,8 +59,8 @@ feature -- Intialization
local
l_retried: BOOLEAN
do
write_information_log (generator + ".data_reader" + " execute store procedure: " + a_sp)
write_debug_log (generator + ".data_reader" + " arguments:" + log_parameters (a_parameters))
log.write_information (generator + ".data_reader" + " execute store procedure: " + a_sp)
log.write_debug (generator + ".data_reader" + " arguments:" + log_parameters (a_parameters))
if not l_retried then
stored_procedure := a_sp
parameters := a_parameters
@@ -70,14 +70,14 @@ feature -- Intialization
if proc.exists then
if proc.text_32 /= Void then
debug
write_debug_log ( generator + ".data_writer: " + proc.text_32)
log.write_debug ( generator + ".data_writer: " + proc.text_32)
end
end
else
has_error := True
error_message := proc.error_message_32
error_code := proc.error_code
write_error_log (generator + ".data_witer message:" + proc.error_message_32 + " code:" + proc.error_code.out)
log.write_error (generator + ".data_witer message:" + proc.error_message_32 + " code:" + proc.error_code.out)
end
else
stored_procedure := a_sp
@@ -86,11 +86,12 @@ feature -- Intialization
end
rescue
set_last_error_from_exception ("SQL execution")
write_critical_log (generator+ ".data_reader " + last_error_message)
log.write_critical (generator+ ".data_reader " + last_error_message)
l_retried := True
retry
end
execute_reader (a_base_selection: DB_SELECTION): detachable LIST [DB_RESULT]
-- Execute the Current store procedure.
do

View File

@@ -1,7 +1,7 @@
note
description: "Error from database"
date: "$Date: 2014-11-13 16:23:47 +0100 (jeu., 13 nov. 2014) $"
revision: "$Revision: 96085 $"
date: "$Date: 2013-08-08 16:39:49 -0300 (ju. 08 de ago. de 2013) $"
revision: "$Revision: 195 $"
class
DATABASE_ERROR

View File

@@ -1,7 +1,7 @@
note
description: "Database error handler"
date: "$Date: 2014-11-13 16:23:47 +0100 (jeu., 13 nov. 2014) $"
revision: "$Revision: 96085 $"
date: "$Date: 2013-08-08 16:39:49 -0300 (ju. 08 de ago. de 2013) $"
revision: "$Revision: 195 $"
class
DATABASE_ERROR_HANDLER

View File

@@ -1,8 +1,8 @@
note
description: "Summary description for {DATABASE_NO_CHANGE_ERROR}."
author: ""
date: "$Date: 2014-11-13 16:23:47 +0100 (jeu., 13 nov. 2014) $"
revision: "$Revision: 96085 $"
date: "$Date$"
revision: "$Revision$"
class
DATABASE_NO_CHANGE_ERROR

View File

@@ -1,7 +1,7 @@
note
description: "Provides security routine helpers"
date: "$Date: 2015-01-27 19:15:02 +0100 (mar., 27 janv. 2015) $"
revision: "$Revision: 96542 $"
date: "$Date: 2014-08-20 15:21:15 -0300 (mi., 20 ago. 2014) $"
revision: "$Revision: 95678 $"
class
SECURITY_PROVIDER
@@ -34,16 +34,10 @@ feature -- Access
Result.keep_head (Result.count - 2)
end
password_hash (a_password: READABLE_STRING_GENERAL; a_salt: STRING): STRING
password_hash (a_password, a_salt: STRING): STRING
-- Password hash based on password `a_password' and salt value `a_salt'.
local
utf: UTF_CONVERTER
s: STRING
do
create s.make (a_password.count + a_salt.count)
utf.utf_32_string_into_utf_8_string_8 (a_password, s)
s.append (a_salt)
Result := sha1_string (s)
Result := sha1_string (a_password + a_salt )
end
feature {NONE} -- Implementation

View File

@@ -0,0 +1,53 @@
note
description: "Summary description for {STRING_HELPER}."
date: "$Date: 2014-08-08 16:02:11 -0300 (vi., 08 ago. 2014) $"
revision: "$Revision: 95593 $"
class
STRING_HELPER
feature -- Access
is_blank (s: detachable READABLE_STRING_32): BOOLEAN
local
i,n: INTEGER
do
Result := True
if s /= Void then
from
i := 1
n := s.count
until
i > n or not Result
loop
Result := s[i].is_space
i := i + 1
end
end
end
indented_text (pre: READABLE_STRING_8; t: READABLE_STRING_8): READABLE_STRING_8
-- Indendted text.
local
s8: STRING_8
do
s8 := t.string
s8.prepend (pre)
s8.replace_substring_all ("%N", "%N" + pre)
Result := s8
end
json_encode (a_string: STRING): STRING
-- json encode `a_string'.
local
encode: SHARED_JSON_ENCODER
do
create encode
Result := encode.json_encoder.encoded_string (a_string)
debug
print ("%NResult" + Result)
end
end
end

Some files were not shown because too many files have changed in this diff Show More