Skip to content

Commit

Permalink
first push for integrating both client and server projects into singl…
Browse files Browse the repository at this point in the history
…e project for maintainence.

it includes the server-side code for the new site and push two will be to add a list of client-side examples.
  • Loading branch information
thatcher committed Sep 13, 2009
1 parent 43733e0 commit 9cdf856
Show file tree
Hide file tree
Showing 302 changed files with 55,000 additions and 9,670 deletions.
36 changes: 36 additions & 0 deletions WEB-INF/app/boot/server.js
@@ -0,0 +1,36 @@
/**
* Example @VERSION -
*
* Copyright (c) 2008-2009 ClaypoolJS
*
*/
// - BOOT THE APP -
jQuery.noConflict();
(function($){

//A static logger for any initialization routines we might add here
var log = $.logger("Example");

//The environments are described in environments.js
try{
$.env('defaults', "dev.server");
//$.env('defaults', "appengine.server");

}catch(e){
log.error("Environmental selection is invalid!").exception(e);
}

$(document).ready(function(){
log.info("Initializing Application");
$.boot(function(){
//you can do additional initialization here
log.info("Successfully Initialized Application");
//preload all application data
$.$('#docsModel').get();
$.$('#releasesModel').get();
$.$('#newsModel').get();
$.$('#eventsModel').get();
});
});

})(jQuery);
31 changes: 31 additions & 0 deletions WEB-INF/app/configs/config.js
@@ -0,0 +1,31 @@
var Site = {
/**
* Site Claypool @VERSION -
*
* Copyright (c) 2008-2009 ClaypoolJS
*
*/
// - NAMESPACE DECLARATIONS -
// It's good form to go ahead and declare the additional namespaces you might be using
// here. We define just a couple standards. Additional nested namespaces are very
// useful for isolating application log message based on the categories defined by
// the namespace.
Models:{},
Views:{},
Controllers:{},
Services:{}
};
(function($){

//Scanning is a simple convention over configuration
//pattern. All functions on the namespace can be accessed
//via $.$, which will create the instance the first time
//eg $.$('#fooModel') will return a new MyApp.Models.Foo
$.scan([
"Site.Models",
"Site.Views",
"Site.Services"
]);

})(jQuery, Site);

67 changes: 67 additions & 0 deletions WEB-INF/app/configs/environments.js
@@ -0,0 +1,67 @@
/**
*
* Copyright (c) 2008-2009 ClaypoolJS
*
*/
(function($){

//-------------------------------------------------------------------------------------//
// - ENVIRONMENTAL CONFIGURATION -
//______________________________________________________________________________________//
$.env({
defaults:{
root:'/',
data:'/data/',
context_dir:cwd,
app_dir:'/WEB-INF/jsx/',
templates:'file:'+cwd+'/templates/',
rest: {
SERVICE: "Any",
URL: "/rest",
AJAX: "jQuery"
}
},
//-------------------------------------------------------------------------------------//
// - DEVELOPMENT CONFIGURATION -
//______________________________________________________________________________________//
dev:{
server:{
monitorTemplates:'true',
db: {
DRIVER : "org.sqlite.JDBC",
PROVIDER:"JDBC",
DIALECT:"SQLite",
HOST:"jdbc:sqlite:claypool.db",
NAME:"example",
USER:"sa",
PASS:""
}
}
},
//-------------------------------------------------------------------------------------//
// - PRODUCTION CONFIGURATION -
//______________________________________________________________________________________//
prod:{
server:{
db: {
DRIVER : "com.mysql.jdbc.Driver",
PROVIDER:"JDBC",
DIALECT:"MySQL",
HOST:"jdbc:mysql://127.0.0.1:3306/claypool",
USER:"example",
PASS:"example"
}
}
},
//-------------------------------------------------------------------------------------//
// - APPENGINE CONFIGURATION -
//______________________________________________________________________________________//
appengine:{
server:{
templates:'http://jquery-claypool.appspot.com/templates/'
}
}
});

})(jQuery);

11 changes: 11 additions & 0 deletions WEB-INF/app/configs/filters.js
@@ -0,0 +1,11 @@
/**
*
* Copyright (c) 2008-2009 ClaypoolJS
*
*/
(function($){

//No filters at this time

})(jQuery);

27 changes: 27 additions & 0 deletions WEB-INF/app/configs/logging.js
@@ -0,0 +1,27 @@
/**
* ClaypoolSite @VERSION -
*
* Copyright (c) 2008-2009 ClaypoolJS
*
*/

(function($){

$.logging([
{ category:"Site", level:"INFO" },
{ category:"Site.Models", level:"INFO" },
{ category:"Site.Views", level:"INFO" },
{ category:"Site.Controllers", level:"INFO" },
{ category:"Site.Service", level:"INFO" },
{ category:"Claypool", level:"WARN" },
{ category:"Claypool.Application", level:"WARN" },
{ category:"Claypool.Server", level:"INFO" },
{ category:"Claypool.MVC", level:"INFO" },
{ category:"Claypool.IoC", level:"INFO" },
{ category:"Claypool.AOP", level:"WARN" },
{ category:"jQuery.E4X", level:"INFO" },
{ category:"root", level:"WARN" }
]);

})(jQuery);

26 changes: 26 additions & 0 deletions WEB-INF/app/configs/routes.js
@@ -0,0 +1,26 @@
/**
* @author thatcher
*/

(function($){

$.mvc({
"hijax:server" : [{
id:"#envjs-server-routes",
hijaxMap:
[{ urls :"/jsx/$", controller:"#homeService"},
{ urls :"/docs$", controller:"#docsService"},
{ urls :"/doc/<:id(.*):>", controller:"#docsService"},
{ urls :"/support", controller:"#supportService"},
{ urls :"/error$", controller:"#errorService"},
{ urls :"/events$", controller:"#eventsService"},
{ urls :"/event/<:id(.*):>", controller:"#eventsService"},
{ urls :"/home$", controller:"#homeService"},
{ urls :"/news$", controller:"#newsService"},
{ urls :"/news/<:id(.*):>", controller:"#newsService"},
{ urls :"/releases$", controller:"#releasesService"},
{ urls :"/release/<:id(.*):>", controller:"#releasesService"}]
}]
});

})(jQuery);
39 changes: 39 additions & 0 deletions WEB-INF/app/models/docs.js
@@ -0,0 +1,39 @@
/**
* @author thatcher
*/
(function($, $M, _){

var data,// the data
log;

$M.Docs = function(options){
$.extend(true, this, options);
log = $.logger('Site.Models.Docs');
};

$.extend($M.Docs.prototype,{
get: function(){
var url = $.env('data')+'docs/metadata.json';
if(!data){
$.ajax({
type:'GET',
url:url,
datatype:'json',
async:false,
success: function(json){
log.debug('Loaded data %s',json);
data = _.json2js(json)._;
},
error:function(xhr, status, e){
log.error('failed to load data %s', url).
exception(e);
}
});
}

return data;
}
});

})(jQuery, Site.Models, jsPath);

38 changes: 38 additions & 0 deletions WEB-INF/app/models/events.js
@@ -0,0 +1,38 @@
/**
* @author thatcher
*/
(function($, $M, _){

var data,
log;

$M.Events = function(options){
$.extend(true, this, options);
log = $.logger('Site.Models.Events');
};

$.extend($M.Events.prototype,{
get: function(){
var url = $.env('data')+'events/metadata.json';
if(!data){
$.ajax({
type:'GET',
url:url,
datatype:'json',
async:false,
success: function(json){
log.debug('Loaded data %s',json);
data = _.json2js(json)._;
},
error:function(xhr, status, e){
log.error('failed to load data %s',url).
exception(e);
}
});
}
return data;
}
});

})(jQuery, Site.Models, jsPath );

38 changes: 38 additions & 0 deletions WEB-INF/app/models/news.js
@@ -0,0 +1,38 @@
/**
* @author thatcher
*/
(function($, $M, _){

var data,
log;

$M.News = function(options){
$.extend(true, this, options);
log = $.logger('Site.Models.News');
};

$.extend($M.News.prototype,{
get: function(){
var url = $.env('data')+'news/metadata.json';
if(!data){
$.ajax({
type:'GET',
url:url,
datatype:'json',
async:false,
success: function(json){
log.debug('Loaded data %s',json);
data = _.json2js(json)._;
},
error:function(xhr, status, e){
log.error('failed to load data %s',url).
exception(e);
}
});
}
return data;
}
});

})(jQuery, Site.Models, jsPath);

37 changes: 37 additions & 0 deletions WEB-INF/app/models/releases.js
@@ -0,0 +1,37 @@
/**
* @author thatcher
*/
(function($, $M, _){

var data,
log;

$M.Releases = function(options){
$.extend(true, this, options);
log = $.logger('Site.Models.Releases');
};

$.extend($M.Releases.prototype,{
get: function(){
var url = $.env('data')+'releases/metadata.json';
if(!data){
$.ajax({
type:'GET',
url:url,
datatype:'json',
async:false,
success: function(json){
log.debug('Loaded data %s',json);
data = _.json2js(json)._;
},
error:function(xhr, status, e){
log.error('failed to load data %s',url).
exception(e);
}
});
}
return data;
}
});

})(jQuery, Site.Models, jsPath );

0 comments on commit 9cdf856

Please sign in to comment.