From 87b207efd55a72da50172ca87169d70c2e36ee69 Mon Sep 17 00:00:00 2001
From: Alain Takoudjou <talino@tiolive.com>
Date: Fri, 24 May 2013 11:37:58 +0000
Subject: [PATCH] Fix frontend promise, create index.html for websites

---
 software/ajaxplorer/instance-apachephp.cfg  |  8 +++---
 software/ajaxplorer/software.cfg            | 29 ++++++++++++++++-----
 software/ajaxplorer/templates/index.html.in |  9 +++++++
 3 files changed, 36 insertions(+), 10 deletions(-)
 create mode 100644 software/ajaxplorer/templates/index.html.in

diff --git a/software/ajaxplorer/instance-apachephp.cfg b/software/ajaxplorer/instance-apachephp.cfg
index 9c957c2a..1c316e52 100644
--- a/software/ajaxplorer/instance-apachephp.cfg
+++ b/software/ajaxplorer/instance-apachephp.cfg
@@ -339,21 +339,21 @@ port = $${apache-php:port}
 
 [frontend-website-promise]
 recipe = slapos.cookbook:check_url_available
-path = $${basedirectory:promises}/frontend
+path = $${basedirectory:promises}/frontend-website
 url = $${request-frontend:connection-site_url}
 dash_path = ${dash:location}/bin/dash
 curl_path = ${curl:location}/bin/curl
 
 [frontend-website2-promise]
 recipe = slapos.cookbook:check_url_available
-path = $${basedirectory:promises}/frontend
+path = $${basedirectory:promises}/frontend-website2
 url = $${request-frontend2:connection-site_url}
 dash_path = ${dash:location}/bin/dash
 curl_path = ${curl:location}/bin/curl
 
 [frontend-ajaxupload-promise]
 recipe = slapos.cookbook:check_url_available
-path = $${basedirectory:promises}/frontend
+path = $${basedirectory:promises}/frontend-ajaxupload
 url = $${request-frontend-ajaxupload:connection-site_url}
 dash_path = ${dash:location}/bin/dash
 curl_path = ${curl:location}/bin/curl
@@ -362,7 +362,7 @@ curl_path = ${curl:location}/bin/curl
 recipe = slapos.cookbook:check_page_content
 path = $${basedirectory:promises}/content
 url = $${request-frontend-ajaxupload:connection-site_url}
-pattern = AjaXplorer
+match = AjaXplorer
 dash_path = ${dash:location}/bin/dash
 curl_path = ${curl:location}/bin/curl
 
diff --git a/software/ajaxplorer/software.cfg b/software/ajaxplorer/software.cfg
index a9dd380b..6f0649b0 100644
--- a/software/ajaxplorer/software.cfg
+++ b/software/ajaxplorer/software.cfg
@@ -12,7 +12,8 @@ parts =
   instance-mariadb
   template-httpd-conf
   application
-  website
+  website1-template
+  website2-template
   slapos.cookbook-repository
   check-recipe
 
@@ -40,7 +41,7 @@ md5sum = 4c7936accb3658871b635158198b7905
 recipe = slapos.recipe.template
 url = ${:_profile_base_location_}/instance-apachephp.cfg
 output = ${buildout:directory}/template-apachephp.cfg
-md5sum = e89aed0fe9697e18bd210a82b82f3b27
+md5sum = 6874902dc758cf9db49b0395a88aa647
 mode = 0644
 
 [instance-mariadb]
@@ -51,15 +52,31 @@ mode = 0644
 
 [application]
 recipe = hexagonit.recipe.download
-url = http://netcologne.dl.sourceforge.net/project/ajaxplorer/ajaxplorer/dev-channel/4.3.3/ajaxplorer-core-4.3.3.tar.gz
-md5sum = b6b1e767dd3b966a74782a03190130b0
+url = http://garr.dl.sourceforge.net/project/ajaxplorer/ajaxplorer/dev-channel/4.3.4/ajaxplorer-core-4.3.4.tar.gz
+md5sum = 2f2ff8bda7bbe841ef0e870c724eb74f
 strip-top-level-dir = true
 
 [website]
 recipe = z3c.recipe.mkdir
+path1 = ${application:location}/data/files/website
+path2 = ${application:location}/data/files/website2
 paths =
-  ${application:location}/data/files/website
-  ${application:location}/data/files/website2
+  ${:path1}
+  ${:path2}
+
+[website1-template]
+recipe = slapos.recipe.template
+url = ${:_profile_base_location_}/templates/index.html.in
+output = ${website:path1}/index.html
+md5sum = c5695762361b801c284ee23a150cd1f1
+mode = 0644
+
+[website2-template]
+recipe = slapos.recipe.template
+url = ${:_profile_base_location_}/templates/index.html.in
+output = ${website:path2}/index.html
+md5sum = c5695762361b801c284ee23a150cd1f1
+mode = 0644
 
 [template-httpd-conf]
 recipe = slapos.recipe.download
diff --git a/software/ajaxplorer/templates/index.html.in b/software/ajaxplorer/templates/index.html.in
new file mode 100644
index 00000000..164bda59
--- /dev/null
+++ b/software/ajaxplorer/templates/index.html.in
@@ -0,0 +1,9 @@
+<html>
+<head>
+<title>New Document - Created By AjaXplorer</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+<body bgcolor="#FFFFFF" text="#000000">
+  <h2>Hi, this website folder is still empty. Please go to your File Manager administration and replace this folder by your new website files.</h2>
+</body>
+</html>
-- 
2.30.9