Skip to content

Commit df35904

Browse files
committed
Update examples
1 parent c08a0e2 commit df35904

19 files changed

+156
-25
lines changed

.classpath

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<classpath>
3-
<classpathentry kind="src" path="src"/>
4-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5-
<classpathentry kind="lib" path="WEB-INF/lib/struct-2.0.jar" sourcepath="/struct2.0/src"/>
6-
<classpathentry kind="lib" path="WEB-INF/lib/servlet-api.jar"/>
7-
<classpathentry kind="lib" path="WEB-INF/lib/mail.jar"/>
8-
<classpathentry kind="lib" path="WEB-INF/lib/mysql-connector-java-5.0.4-bin.jar"/>
9-
<classpathentry kind="output" path="WEB-INF/classes"/>
10-
</classpath>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5+
<classpathentry kind="lib" path="WEB-INF/lib/servlet-api.jar"/>
6+
<classpathentry kind="lib" path="WEB-INF/lib/mail.jar"/>
7+
<classpathentry kind="lib" path="WEB-INF/lib/mysql-connector-java-5.0.4-bin.jar"/>
8+
<classpathentry combineaccessrules="false" kind="src" path="/struct2.0"/>
9+
<classpathentry kind="output" path="WEB-INF/classes"/>
10+
</classpath>

.lock

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"installed":{"smile":"tinystruct.examples.hello","users":"tinystruct.examples.firstApplication","version":"tinystruct.examples.firstApplication","tinyeditor":"tinystruct.examples.tinyeditor","user":"tinystruct.examples.firstApplication","youhappy":"tinystruct.examples.firstApplication","info":"tinystruct.examples.error","time/update":"tinystruct.examples.time","read":"tinystruct.examples.firstApplication","startup":"tinystruct.examples.startup","generate":"tinystruct.examples.firstApplication","time/start":"tinystruct.examples.time","time":"tinystruct.examples.time","say":"tinystruct.examples.firstApplication","tinyeditor/version":"tinystruct.examples.tinyeditor","time/stop":"tinystruct.examples.time","tinyeditor/update":"tinystruct.examples.tinyeditor","praise":"tinystruct.examples.firstApplication","tinyeditor/save":"tinystruct.examples.tinyeditor","error":"tinystruct.examples.error"},"updated":true}

WEB-INF/classes/application.properties

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
[database]
88
#MySQL
99
driver=com.mysql.jdbc.Driver
10-
database.url=jdbc:mysql://localhost:3306/bible?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8
10+
database.url=jdbc:mysql://localhost:3306/database?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8
1111
database.user=root
12-
database.password=0123456
12+
database.password=******
1313
database.connections.max=10
1414

1515
[default]
@@ -18,7 +18,8 @@ default.login.page=user/login
1818
default.home.page=praise
1919
default.reload.mode=true
2020
default.date.format=yyyy-MM-dd HH:mm:ss
21-
default.import.applications=tinystruct.examples.error;tinystruct.examples.firstApplication;tinystruct.examples.time;tinystruct.examples.tinyeditor;
21+
default.import.applications=tinystruct.examples.error;tinystruct.examples.firstApplication;tinystruct.examples.time;tinystruct.examples.tinyeditor;tinystruct.examples.hello
22+
default.url_rewrite=disabled
2223

2324
[error]
2425
default.error.process=false
@@ -27,7 +28,7 @@ default.error.page=error
2728
[event]
2829
log.status=off
2930
log.file=
30-
system.directory=/Users/mover/applications/test
31+
system.directory=/Users/mover/applications/tinystruct2.0
3132

3233
[mail]
3334
mail.ssl.on = true
@@ -40,7 +41,7 @@ mail.smtp.auth=true
4041
mail.pop3.auth=true
4142
mail.store.protocol = pop3
4243
#mail.smtp.auth=false
43-
#smtp.auth.user=services@ingod.asia
44+
#smtp.auth.user=*******@ingod.asia
4445
#smtp.auth.user=*******@gmail.com
45-
smtp.auth.user=moverinfo@gmail.com
46-
smtp.auth.pwd=30ver0123456
46+
smtp.auth.user=*******@gmail.com
47+
smtp.auth.pwd=*******
7.19 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<mapping>
4+
<class name="User" table="User">
5+
<id name="Id" column="id" increment="false" generate="true" length="50" type="varchar"/>
6+
<property name="email" column="email" length="50" type="varchar"/>
7+
<property name="username" column="username" length="50" type="varchar"/>
8+
<property name="password" column="password" length="15" type="varchar"/>
9+
<property name="nickname" column="nickname" length="50" type="varchar"/>
10+
<property name="introduce" column="introduce" length="100" type="varchar"/>
11+
<property name="gender" column="gender" length="4" type="int"/>
12+
<property name="firstName" column="first_name" length="10" type="varchar"/>
13+
<property name="lastName" column="last_name" length="10" type="varchar"/>
14+
<property name="country" column="country" length="50" type="varchar"/>
15+
<property name="city" column="city" length="50" type="varchar"/>
16+
<property name="telephone" column="telephone" length="50" type="varchar"/>
17+
<property name="postcode" column="postcode" length="6" type="varchar"/>
18+
<property name="lastloginIP" column="lastlogin_IP" length="15" type="varchar"/>
19+
<property name="lastloginTime" column="lastlogin_time" length="0" type="datetime"/>
20+
<property name="registrationTime" column="registration_time" length="0" type="datetime"/>
21+
<property name="logo" column="logo" length="50" type="varchar"/>
22+
<property name="status" column="status" length="1" type="bit"/>
23+
</class>
24+
</mapping>

WEB-INF/classes/themes/hello.view

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Hello</title>
5+
</head>
6+
<body>
7+
<p>
8+
:)
9+
</p>
10+
<pre>
11+
<javascript>
12+
//<![CDATA[
13+
if(typeof println == 'undefined') {
14+
println = function(s){ print(s+"\n");};
15+
}
16+
17+
println("Java class '"+self.getName()+"' will execute the JavaScript code:\n\
18+
\n\
19+
for(var i=1;i<10;i++) {\n\
20+
println((i>5?Array(i).join(' '): Array(10 - i).join(' ')) + String.fromCharCode(96+i));\n\
21+
}\n\
22+
");
23+
24+
println('What the result will be? see the below result.');
25+
println(Array(10).join('--'));
26+
for(var i=1;i<10;i++) {
27+
println((i>5?Array(i).join(' '): Array(10 - i).join(' ')) + String.fromCharCode(96+i));
28+
}
29+
println(Array(10).join('--'));
30+
31+
//]]>
32+
</javascript>
33+
</pre>
34+
</body>
35+
</html>

WEB-INF/classes/themes/startup.view

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5+
<title>"Welcome to use CDT!"</title>
6+
7+
<style type="text/css">
8+
iframe { position:absolute;left:-10000px;top:-10000px;display:block;height:1px;width:1px;}
9+
* {min-width:100px;min-height:20px;}
10+
</style>
11+
<script type="text/javascript" src="scripts/firebug-lite.js">
12+
{
13+
overrideConsole: false,
14+
startInNewWindow: true,
15+
startOpened: true,
16+
enableTrace: true
17+
}
18+
</script>
19+
<script type="text/javascript" src="scripts/jquery-2.0.3.js"></script>
20+
<script type="text/javascript" src="scripts/struct.js"></script>
21+
<script type="text/javascript" src="scripts/tools.js" charset="utf-8"></script>
22+
<script type="text/javascript">
23+
function update($time) {
24+
document.getElementById('time').innerHTML=$time;
25+
document.title = $time;
26+
}
27+
28+
var properties = new Menu();
29+
var dialog = new Dialog();
30+
$(function(){
31+
var list = [];
32+
$("*").click(function(event){
33+
if(event.currentTarget === this){
34+
event.target = this;
35+
properties.show(event,this.id);
36+
}
37+
});
38+
39+
$("*").hover(function(event){
40+
if(event.currentTarget === this){
41+
$(this).css({"border":"1px solid #00f"});
42+
43+
$id = Math.floor(Math.random()*list.length+1);
44+
list[$id] = $id;
45+
$(this).attr("id", $id);
46+
47+
properties = new Menu();
48+
properties.appendItem({"action":"javascript:dialog.show({id:'$id',value:'$text'})","caption":"修改属性"});
49+
properties.appendItem({"action":"javascript:void(0)","caption":"注解"});
50+
properties.appendItem({"action":"javascript:copyToClipboard('$text')","caption":"复制"});
51+
}
52+
},function(event){
53+
if(event.currentTarget === this)
54+
$(this).css({"border":"0px solid #00f"});
55+
});
56+
57+
});
58+
</script>
59+
</head>
60+
<body>
61+
<div></div>
62+
<div></div>
63+
<a href="javascript:void(0)" id="hello">Please change my style.</a>
64+
<span id="time"></span>
65+
<!--
66+
<iframe id="activator" src="?q=time/update"></iframe>
67+
-->
68+
<div id="__base__"></div>
69+
</body>
70+
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
3.92 KB
Binary file not shown.
Binary file not shown.
5.28 KB
Binary file not shown.
-446 Bytes
Binary file not shown.

WEB-INF/lib/struct-2.0.jar

-15 KB
Binary file not shown.

bin/dispatcher

100644100755
File mode changed.

bin/dispatcher.bat

100644100755
File mode changed.

src/application.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ default.error.page=error
2828
[event]
2929
log.status=off
3030
log.file=
31-
system.directory=/Users/mover/applications/test
31+
system.directory=/Users/mover/applications/tinystruct2.0
3232

3333
[mail]
3434
mail.ssl.on = true

src/tinystruct/examples/hello.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ public void init() {
1515
// TODO Auto-generated method stub
1616
this.setAction("say", "say");
1717
this.setAction("smile", "smile");
18-
this.setAction("logo", "logo");
18+
this.setAction("--logo", "logo");
19+
this.setAction("--version", "version");
1920
}
2021

2122
@Override
2223
public String version() {
23-
// TODO Auto-generated method stub
24+
System.out.println("tinystruct version 2.0.1");
2425
return null;
2526
}
2627

@@ -35,11 +36,10 @@ public void smile() throws ApplicationException{
3536

3637
public void logo() {
3738
String logo ="\n"+
38-
" _/ ' _ _/ _ _ _/ \n"+
39-
" / / /) (/ _) / / (/ ( / "+this.color(2.0, FORECOLOR.green)+" \n"+
40-
" / \n";
41-
42-
System.out.print(logo);
39+
" _/ ' _ _/ _ _ _/ \n"+
40+
" / / /) (/ _) / / (/ ( / "+this.color(2.0, FORECOLOR.green)+" \n"+
41+
" / \n";
42+
System.out.println(logo);
4343
}
4444

4545
public String color(Object s, int color){

0 commit comments

Comments
 (0)