Merge remote-tracking branch 'modules/master' into subtree
this merges the master head of https://github.com/helma-org/apps-modules-mirror into helma
This commit is contained in:
commit
226552bc24
53 changed files with 12023 additions and 0 deletions
33
modules/test/code/Global/global.js
Executable file
33
modules/test/code/Global/global.js
Executable file
|
@ -0,0 +1,33 @@
|
|||
function onStart() {
|
||||
root.date = new Date();
|
||||
root.string = "root";
|
||||
}
|
||||
|
||||
function hello_macro(param) {
|
||||
return "hello";
|
||||
}
|
||||
|
||||
function echo_macro(param, arg) {
|
||||
return arg || param.what;
|
||||
}
|
||||
|
||||
function isDate_filter(arg) {
|
||||
return arg instanceof Date;
|
||||
}
|
||||
|
||||
function isRootDate_filter(arg) {
|
||||
return (arg instanceof Date) &&
|
||||
arg.getTime() == root.date.getTime();
|
||||
}
|
||||
|
||||
function isResponseDate_filter(arg) {
|
||||
return (arg instanceof Date) && arg == res.data.date;
|
||||
}
|
||||
|
||||
function makeLongString() {
|
||||
var b = new java.lang.StringBuffer();
|
||||
for (var i = 1; i <= 10000; i++) {
|
||||
b.append(i.toString()).append(" ");
|
||||
}
|
||||
return b.toString();
|
||||
}
|
1
modules/test/code/Global/subskins.skin
Executable file
1
modules/test/code/Global/subskins.skin
Executable file
|
@ -0,0 +1 @@
|
|||
mainskin<% #subskin1 %>subskin1<% #subskin2 %>subskin2<% #end %>
|
40
modules/test/code/Organisation/type.properties
Normal file
40
modules/test/code/Organisation/type.properties
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
_db = dbcTest
|
||||
_table = tb_organisation
|
||||
|
||||
_id = org_id
|
||||
_parent = root.organisations
|
||||
|
||||
persons = collection(Person)
|
||||
persons.local = org_id
|
||||
persons.foreign = person_org_id
|
||||
persons.accessname = person_name
|
||||
persons.order = person_name
|
||||
|
||||
range = collection(Person)
|
||||
range.local = org_id
|
||||
range.foreign = person_org_id
|
||||
range.accessname = person_name
|
||||
range.order = person_name
|
||||
range.offset = 100
|
||||
range.maxsize = 100
|
||||
|
||||
generic = collection(Person)
|
||||
generic.local.1 = $prototype
|
||||
generic.foreign.1 = person_generic_prototype
|
||||
generic.local.2 = $id
|
||||
generic.foreign.2 = person_generic_id
|
||||
generic.order = person_name
|
||||
|
||||
groupedGeneric = collection(Person)
|
||||
groupedGeneric.local.1 = $prototype
|
||||
groupedGeneric.foreign.1 = person_generic_prototype
|
||||
groupedGeneric.local.2 = $id
|
||||
groupedGeneric.foreign.2 = person_generic_id
|
||||
groupedGeneric.group = person_name
|
||||
groupedGeneric.group.order = person_name
|
||||
|
||||
name = org_name
|
||||
country = org_country
|
||||
|
||||
someMountpoint = mountpoint(SomeMountpoint)
|
17
modules/test/code/Person/type.properties
Normal file
17
modules/test/code/Person/type.properties
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
_db = dbcTest
|
||||
_table = tb_person
|
||||
|
||||
_id = person_id
|
||||
_parent = organisation.persons, root.persons
|
||||
|
||||
name = person_name
|
||||
height = person_height
|
||||
dateOfBirth = person_dateofbirth
|
||||
|
||||
organisation = object(Organisation)
|
||||
organisation.local = person_org_id
|
||||
organisation.foreign = org_id
|
||||
|
||||
genericPrototype = person_generic_prototype
|
||||
genericId = person_generic_id
|
35
modules/test/code/Root/root.js
Executable file
35
modules/test/code/Root/root.js
Executable file
|
@ -0,0 +1,35 @@
|
|||
function main_action() {
|
||||
res.redirect(root.href("jala.test"));
|
||||
}
|
||||
|
||||
function hello_action() {
|
||||
res.contentType = "text/plain";
|
||||
res.write("Hello");
|
||||
}
|
||||
|
||||
function throwerror_action() {
|
||||
throw Error();
|
||||
}
|
||||
|
||||
function notfound_action() {
|
||||
res.write("Not found");
|
||||
}
|
||||
|
||||
function redirect_action() {
|
||||
res.redirect(this.href("hello"));
|
||||
}
|
||||
|
||||
function error_action() {
|
||||
res.write("Error");
|
||||
}
|
||||
|
||||
function long_action() {
|
||||
res.write(makeLongString());
|
||||
}
|
||||
|
||||
function macro_macro(param) {
|
||||
// change suffix
|
||||
if (param.suffix) param.suffix = ".";
|
||||
return this.string;
|
||||
}
|
||||
|
16
modules/test/code/Root/type.properties
Executable file
16
modules/test/code/Root/type.properties
Executable file
|
@ -0,0 +1,16 @@
|
|||
date = date
|
||||
string = string
|
||||
|
||||
|
||||
organisations = collection(Organisation)
|
||||
organisations.accessname = org_name
|
||||
|
||||
organisationsByCountry = collection(Organisation)
|
||||
organisationsByCountry.group = org_country
|
||||
organisationsByCountry.group.prototype = Country
|
||||
organisationsByCountry.group.order = org_country desc
|
||||
organisationsByCountry.order = org_name desc
|
||||
|
||||
persons = collection(Person)
|
||||
|
||||
someMountpoint = mountpoint(SomeMountpoint)
|
3
modules/test/code/app.properties
Executable file
3
modules/test/code/app.properties
Executable file
|
@ -0,0 +1,3 @@
|
|||
baseUri = http://localhost:8080/test/
|
||||
# hard-code cache size to default value to make sure there's some cache rotation
|
||||
cacheSize = 500
|
15
modules/test/code/db.properties
Normal file
15
modules/test/code/db.properties
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
#MySQL
|
||||
dbcTest.url = jdbc:mysql://localhost/helmaTest
|
||||
dbcTest.driver = com.mysql.jdbc.Driver
|
||||
dbcTest.user = helma
|
||||
dbcTest.password = secret
|
||||
|
||||
# Oracle
|
||||
# dbcTest.url = jdbc:oracle:thin:@localhost:1521:XE
|
||||
# dbcTest.driver = oracle.jdbc.driver.OracleDriver
|
||||
|
||||
# PostgreSQL
|
||||
# dbcTest.url = jdbc:postgresql:helmaTest
|
||||
# dbcTest.driver = org.postgresql.Driver
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue