* Updated DB mappings of File/Files getting closer to the one of Image/Images
* Disabled ip address property in LogEntry (will be removed in the long run) * Removed custom property from Skin (still needs some care) * Removed commented code
This commit is contained in:
parent
29ca787190
commit
9b4a5bc10e
17 changed files with 68 additions and 84 deletions
|
@ -270,15 +270,22 @@ Admin.prototype.moduleSetup_macro = function(param) {
|
||||||
|
|
||||||
Admin.prototype.filterLog = function(data) {
|
Admin.prototype.filterLog = function(data) {
|
||||||
data || (data = {});
|
data || (data = {});
|
||||||
var sql = "where action <> 'main' ";
|
var sql = "";
|
||||||
|
if (data.filter > 0) {
|
||||||
|
sql += "where context_type = '";
|
||||||
switch (data.filter) {
|
switch (data.filter) {
|
||||||
case "1":
|
case "1":
|
||||||
sql += "and context_type = 'Site' "; break;
|
sql += "Site"; break;
|
||||||
case "2":
|
case "2":
|
||||||
sql += "and context_type = 'User' "; break;
|
sql += "User"; break;
|
||||||
case "3":
|
case "3":
|
||||||
sql += "and context_type = 'Root' "; break;
|
sql += "Root"; break;
|
||||||
}
|
}
|
||||||
|
sql += "' and ";
|
||||||
|
} else {
|
||||||
|
sql += "where "
|
||||||
|
}
|
||||||
|
sql += "action <> 'main' ";
|
||||||
if (data.query) {
|
if (data.query) {
|
||||||
var parts = stripTags(data.query).split(" ");
|
var parts = stripTags(data.query).split(" ");
|
||||||
var keyword, like;
|
var keyword, like;
|
||||||
|
@ -291,6 +298,7 @@ Admin.prototype.filterLog = function(data) {
|
||||||
}
|
}
|
||||||
sql += "order by created ";
|
sql += "order by created ";
|
||||||
(data.dir == 1) || (sql += "desc");
|
(data.dir == 1) || (sql += "desc");
|
||||||
|
res.debug(sql)
|
||||||
this.log.subnodeRelation = sql;
|
this.log.subnodeRelation = sql;
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,18 +16,20 @@
|
||||||
## See the License for the specific language governing permissions and
|
## See the License for the specific language governing permissions and
|
||||||
## limitations under the License.
|
## limitations under the License.
|
||||||
##
|
##
|
||||||
## $Revision$
|
## $Revision:3355 $
|
||||||
## $LastChangedBy$
|
## $LastChangedBy:piefke3000 $
|
||||||
## $LastChangedDate$
|
## $LastChangedDate:2007-10-11 15:38:29 +0200 (Thu, 11 Oct 2007) $
|
||||||
## $URL$
|
## $URL$
|
||||||
##
|
##
|
||||||
|
|
||||||
_db = antville
|
_db = antville
|
||||||
_table = file
|
_table = file
|
||||||
_id = id
|
_id = id
|
||||||
|
_prototype = prototype
|
||||||
_parent = site.files
|
_parent = site.files
|
||||||
|
|
||||||
name
|
name
|
||||||
|
prototype
|
||||||
parent_type
|
parent_type
|
||||||
parent_id
|
parent_id
|
||||||
created
|
created
|
||||||
|
@ -39,16 +41,6 @@ requests.private = true
|
||||||
metadata = mountpoint(Metadata)
|
metadata = mountpoint(Metadata)
|
||||||
metadata_source = metadata
|
metadata_source = metadata
|
||||||
|
|
||||||
#alias = FILE_ALIAS
|
|
||||||
#mimetype = FILE_MIMETYPE
|
|
||||||
#name = FILE_NAME
|
|
||||||
#filesize = FILE_SIZE
|
|
||||||
#description = FILE_DESCRIPTION
|
|
||||||
#createtime = FILE_CREATETIME
|
|
||||||
#modifytime = FILE_MODIFYTIME
|
|
||||||
#requestcnt = FILE_REQUESTCNT
|
|
||||||
#requestcnt.private = true
|
|
||||||
|
|
||||||
site = object(Site)
|
site = object(Site)
|
||||||
site.local = site_id
|
site.local = site_id
|
||||||
site.foreign = id
|
site.foreign = id
|
||||||
|
|
|
@ -23,7 +23,9 @@
|
||||||
##
|
##
|
||||||
|
|
||||||
_children = collection(File)
|
_children = collection(File)
|
||||||
_children.local = id
|
|
||||||
_children.foreign = site_id
|
|
||||||
_children.order = created desc
|
|
||||||
_children.accessname = name
|
_children.accessname = name
|
||||||
|
_children.local.1 = $id
|
||||||
|
_children.foreign.1 = parent_id
|
||||||
|
_children.local.2 = $prototype
|
||||||
|
_children.foreign.2 = parent_type
|
||||||
|
_children.order = created desc
|
||||||
|
|
|
@ -93,6 +93,23 @@ jala.i18n.setLocaleGetter(function() {
|
||||||
return res.handlers.site.getLocale();
|
return res.handlers.site.getLocale();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function onStart() {
|
||||||
|
// FIXME: Does database exist?
|
||||||
|
/*var db = getDBConnection("antville");
|
||||||
|
var rows = db.executeRetrieval("select min(id) as id from site");
|
||||||
|
rows.next();
|
||||||
|
var id = rows.getColumnItem("id");
|
||||||
|
//Packages.helma.main.Server.getServer().stopApplication(app.name);
|
||||||
|
rows.release();*/
|
||||||
|
|
||||||
|
// call onStart methods of modules
|
||||||
|
for (var i in app.modules) {
|
||||||
|
if (app.modules[i].onStart)
|
||||||
|
app.modules[i].onStart();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function defineConstants(ctor /*, arguments */) {
|
function defineConstants(ctor /*, arguments */) {
|
||||||
var constants = [], name;
|
var constants = [], name;
|
||||||
for (var i=1; i<arguments.length; i+=1) {
|
for (var i=1; i<arguments.length; i+=1) {
|
||||||
|
@ -115,23 +132,6 @@ function disableMacro(ctor, name) {
|
||||||
return ctor.prototype[name + "_macro"] = idle;
|
return ctor.prototype[name + "_macro"] = idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onStart() {
|
|
||||||
// FIXME: Does database exist?
|
|
||||||
/*var db = getDBConnection("antville");
|
|
||||||
var rows = db.executeRetrieval("select min(id) as id from site");
|
|
||||||
rows.next();
|
|
||||||
var id = rows.getColumnItem("id");
|
|
||||||
//Packages.helma.main.Server.getServer().stopApplication(app.name);
|
|
||||||
rows.release();*/
|
|
||||||
|
|
||||||
// call onStart methods of modules
|
|
||||||
for (var i in app.modules) {
|
|
||||||
if (app.modules[i].onStart)
|
|
||||||
app.modules[i].onStart();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function scheduler() {
|
function scheduler() {
|
||||||
flushLog();
|
flushLog();
|
||||||
Stories.flushRequests();
|
Stories.flushRequests();
|
||||||
|
|
|
@ -29,10 +29,11 @@ _prototype = prototype
|
||||||
_parent = parent.images, parent
|
_parent = parent.images, parent
|
||||||
|
|
||||||
name
|
name
|
||||||
|
prototype
|
||||||
|
parent_type
|
||||||
|
parent_id
|
||||||
created
|
created
|
||||||
modified
|
modified
|
||||||
parent_id
|
|
||||||
parent_type
|
|
||||||
|
|
||||||
metadata = mountpoint(Metadata)
|
metadata = mountpoint(Metadata)
|
||||||
metadata_source = metadata
|
metadata_source = metadata
|
||||||
|
|
|
@ -29,7 +29,6 @@ _children.foreign.1 = parent_id
|
||||||
_children.local.2 = $prototype
|
_children.local.2 = $prototype
|
||||||
_children.foreign.2 = parent_type
|
_children.foreign.2 = parent_type
|
||||||
_children.order = created desc
|
_children.order = created desc
|
||||||
#_children.filter = image_f_image_parent is null
|
|
||||||
|
|
||||||
galleries = collection(Tag)
|
galleries = collection(Tag)
|
||||||
galleries.accessname = name
|
galleries.accessname = name
|
||||||
|
|
|
@ -27,8 +27,6 @@ _table = layout
|
||||||
_id = id
|
_id = id
|
||||||
_parent = site.layout
|
_parent = site.layout
|
||||||
|
|
||||||
## FIXME: is name obsolete?
|
|
||||||
name
|
|
||||||
created
|
created
|
||||||
modified
|
modified
|
||||||
mode
|
mode
|
||||||
|
|
|
@ -26,7 +26,7 @@ LogEntry.prototype.constructor = function(context, action) {
|
||||||
this.context_id = context._id;
|
this.context_id = context._id;
|
||||||
this.context_type = context._prototype;
|
this.context_type = context._prototype;
|
||||||
this.action = action || req.action;
|
this.action = action || req.action;
|
||||||
this.ip = req.data.http_remotehost;
|
//this.ip = req.data.http_remotehost;
|
||||||
this.referrer = req.data.http_referer;
|
this.referrer = req.data.http_referer;
|
||||||
this.creator = session.user;
|
this.creator = session.user;
|
||||||
this.created = new Date;
|
this.created = new Date;
|
||||||
|
|
|
@ -31,7 +31,7 @@ context_id
|
||||||
context_type
|
context_type
|
||||||
action
|
action
|
||||||
referrer
|
referrer
|
||||||
ip
|
#ip
|
||||||
created
|
created
|
||||||
|
|
||||||
creator = object(User)
|
creator = object(User)
|
||||||
|
|
|
@ -23,35 +23,35 @@
|
||||||
##
|
##
|
||||||
|
|
||||||
_children = collection(Membership)
|
_children = collection(Membership)
|
||||||
|
_children.accessname = name
|
||||||
_children.local = id
|
_children.local = id
|
||||||
_children.foreign = site_id
|
_children.foreign = site_id
|
||||||
_children.accessname = name
|
|
||||||
_children.order = name asc
|
_children.order = name asc
|
||||||
|
|
||||||
owners = collection(Membership)
|
owners = collection(Membership)
|
||||||
|
owners.accessname = name
|
||||||
owners.local = id
|
owners.local = id
|
||||||
owners.foreign = site_id
|
owners.foreign = site_id
|
||||||
owners.accessname = name
|
|
||||||
owners.filter = role = 'Owner'
|
owners.filter = role = 'Owner'
|
||||||
owners.order = name asc
|
owners.order = name asc
|
||||||
|
|
||||||
managers = collection(Membership)
|
managers = collection(Membership)
|
||||||
|
managers.accessname = name
|
||||||
managers.local = id
|
managers.local = id
|
||||||
managers.foreign = site_id
|
managers.foreign = site_id
|
||||||
managers.accessname = name
|
|
||||||
managers.filter = role = 'Manager'
|
managers.filter = role = 'Manager'
|
||||||
managers.order = name asc
|
managers.order = name asc
|
||||||
|
|
||||||
contributors = collection(Membership)
|
contributors = collection(Membership)
|
||||||
|
contributors.accessname = name
|
||||||
contributors.local = id
|
contributors.local = id
|
||||||
contributors.foreign = site_id
|
contributors.foreign = site_id
|
||||||
contributors.accessname = name
|
|
||||||
contributors.filter = role = 'Contributor'
|
contributors.filter = role = 'Contributor'
|
||||||
contributors.order = name asc
|
contributors.order = name asc
|
||||||
|
|
||||||
subscribers = collection(Membership)
|
subscribers = collection(Membership)
|
||||||
|
subscribers.accessname = name
|
||||||
subscribers.local = id
|
subscribers.local = id
|
||||||
subscribers.foreign = site_id
|
subscribers.foreign = site_id
|
||||||
subscribers.accessname = name
|
|
||||||
subscribers.filter = role = 'Subscriber'
|
subscribers.filter = role = 'Subscriber'
|
||||||
subscribers.order = name asc
|
subscribers.order = name asc
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
## See the License for the specific language governing permissions and
|
## See the License for the specific language governing permissions and
|
||||||
## limitations under the License.
|
## limitations under the License.
|
||||||
##
|
##
|
||||||
## $Revision$
|
## $Revision:3355 $
|
||||||
## $LastChangedBy$
|
## $LastChangedBy:piefke3000 $
|
||||||
## $LastChangedDate$
|
## $LastChangedDate:2007-10-11 15:38:29 +0200 (Thu, 11 Oct 2007) $
|
||||||
## $URL$
|
## $URL$
|
||||||
##
|
##
|
||||||
|
|
||||||
|
@ -51,6 +51,6 @@ _children.foreign = poll_id
|
||||||
_children.order = id asc
|
_children.order = id asc
|
||||||
|
|
||||||
votes = collection(Vote)
|
votes = collection(Vote)
|
||||||
|
votes.accessname = creator_name
|
||||||
votes.local = id
|
votes.local = id
|
||||||
votes.foreign = poll_id
|
votes.foreign = poll_id
|
||||||
votes.accessname = creator_name
|
|
||||||
|
|
|
@ -525,9 +525,9 @@ Site.prototype.referrers_macro = function() {
|
||||||
date.setDate(date.getDate() - 1);
|
date.setDate(date.getDate() - 1);
|
||||||
var db = getDBConnection("antville");
|
var db = getDBConnection("antville");
|
||||||
var query = "select referrer, count(*) as requests from log " +
|
var query = "select referrer, count(*) as requests from log " +
|
||||||
"where action = 'main' and context_type = 'Site' and context_id = " +
|
"where context_type = 'Site' and context_id = " + this._id +
|
||||||
this._id + " and created > {ts '" + date.format("yyyy-MM-dd HH:mm:ss") +
|
" and created > {ts '" + date.format("yyyy-MM-dd HH:mm:ss") +
|
||||||
"'} group by referrer order by requests desc, referrer asc;";
|
"'} and action = 'main' group by referrer order by requests desc, referrer asc;";
|
||||||
var rows = db.executeRetrieval(query);
|
var rows = db.executeRetrieval(query);
|
||||||
var referrer;
|
var referrer;
|
||||||
while (rows.next()) {
|
while (rows.next()) {
|
||||||
|
|
|
@ -39,10 +39,11 @@ metadata_source = metadata
|
||||||
archive = mountpoint(Archive)
|
archive = mountpoint(Archive)
|
||||||
members = mountpoint(Members)
|
members = mountpoint(Members)
|
||||||
images = mountpoint(Images)
|
images = mountpoint(Images)
|
||||||
#layouts = mountpoint(Layouts)
|
|
||||||
files = mountpoint(Files)
|
files = mountpoint(Files)
|
||||||
stories = mountpoint(Stories)
|
stories = mountpoint(Stories)
|
||||||
polls = mountpoint(Polls)
|
polls = mountpoint(Polls)
|
||||||
|
tags = mountpoint(Tags)
|
||||||
|
galleries = mountpoint(Tags)
|
||||||
|
|
||||||
creator = object(User)
|
creator = object(User)
|
||||||
creator.local = creator_id
|
creator.local = creator_id
|
||||||
|
@ -59,6 +60,3 @@ layout.foreign = id
|
||||||
$tags = collection(Tag)
|
$tags = collection(Tag)
|
||||||
$tags.local = id
|
$tags.local = id
|
||||||
$tags.foreign = site_id
|
$tags.foreign = site_id
|
||||||
|
|
||||||
tags = mountpoint(Tags)
|
|
||||||
galleries = mountpoint(Tags)
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ Skin.CUSTOMIZABLE_PROTOTYPES = ["Archive", "Choice", "Comment", "File",
|
||||||
Skin.prototype.constructor = function(prototype, name) {
|
Skin.prototype.constructor = function(prototype, name) {
|
||||||
this.prototype = prototype;
|
this.prototype = prototype;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.custom = false;
|
|
||||||
this.creator = this.modifier = session.user;
|
this.creator = this.modifier = session.user;
|
||||||
this.created = this.modified = new Date;
|
this.created = this.modified = new Date;
|
||||||
return this;
|
return this;
|
||||||
|
@ -281,6 +280,11 @@ Skin.prototype.getMainSkin = function() {
|
||||||
return createSkin(source);
|
return createSkin(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Skin.prototype.custom_macro = function() {
|
||||||
|
// FIXME:
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
Skin.prototype.render = function() {
|
Skin.prototype.render = function() {
|
||||||
return renderSkin(createSkin(this.getSource()));
|
return renderSkin(createSkin(this.getSource()));
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,8 +33,6 @@ source
|
||||||
created
|
created
|
||||||
modified
|
modified
|
||||||
|
|
||||||
custom = SKIN_ISCUSTOM
|
|
||||||
|
|
||||||
layout = object(Layout)
|
layout = object(Layout)
|
||||||
layout.local = layout_id
|
layout.local = layout_id
|
||||||
layout.foreign = id
|
layout.foreign = id
|
||||||
|
|
|
@ -23,22 +23,20 @@
|
||||||
##
|
##
|
||||||
|
|
||||||
_children = collection(Skin)
|
_children = collection(Skin)
|
||||||
|
_children.accessname = name
|
||||||
_children.local = id
|
_children.local = id
|
||||||
_children.foreign = layout_id
|
_children.foreign = layout_id
|
||||||
_children.accessname = name
|
|
||||||
_children.group = prototype
|
_children.group = prototype
|
||||||
_children.loadmode = aggressive
|
_children.loadmode = aggressive
|
||||||
|
|
||||||
modified = collection(Skin)
|
modified = collection(Skin)
|
||||||
modified.local = id
|
modified.local = id
|
||||||
modified.foreign = layout_id
|
modified.foreign = layout_id
|
||||||
modified.filter = SKIN_ISCUSTOM = 0
|
|
||||||
modified.order = prototype, name
|
modified.order = prototype, name
|
||||||
modified.loadmode = aggressive
|
modified.loadmode = aggressive
|
||||||
|
|
||||||
custom = collection(Skin)
|
custom = collection(Skin)
|
||||||
custom.local = id
|
custom.local = id
|
||||||
custom.foreign = layout_id
|
custom.foreign = layout_id
|
||||||
custom.filter = SKIN_ISCUSTOM = 1
|
|
||||||
custom.order = prototype, name
|
custom.order = prototype, name
|
||||||
custom.loadmode = aggressive
|
custom.loadmode = aggressive
|
||||||
|
|
|
@ -45,20 +45,6 @@ parent_type
|
||||||
metadata = mountpoint(Metadata)
|
metadata = mountpoint(Metadata)
|
||||||
metadata_source = metadata
|
metadata_source = metadata
|
||||||
|
|
||||||
#day = TEXT_DAY
|
|
||||||
#title = TEXT_TITLE
|
|
||||||
#text = TEXT_TEXT
|
|
||||||
#rawcontent = TEXT_RAWCONTENT
|
|
||||||
#online = TEXT_ISONLINE
|
|
||||||
#editableby = TEXT_EDITABLEBY
|
|
||||||
#discussions = TEXT_HASDISCUSSIONS
|
|
||||||
#createtime = TEXT_CREATETIME
|
|
||||||
#modifytime = TEXT_MODIFYTIME
|
|
||||||
#ipaddress = TEXT_IPADDRESS
|
|
||||||
|
|
||||||
#content = mountpoint(PropertyMgr)
|
|
||||||
#content_xml = TEXT_CONTENT
|
|
||||||
|
|
||||||
site = object(Site)
|
site = object(Site)
|
||||||
site.local = site_id
|
site.local = site_id
|
||||||
site.foreign = id
|
site.foreign = id
|
||||||
|
|
Loading…
Add table
Reference in a new issue