wangxl 9 years ago
parent
commit
cbdcc577f6
34 changed files with 330 additions and 295 deletions
  1. 9 9
      display-client/.classpath
  2. 2 1
      display-client/.gitignore
  3. 1 1
      display-client/assets/mobile-config.xml
  4. 17 17
      display-client/project.properties
  5. 1 1
      display-server/build/build.properties
  6. 1 0
      display-server/etc/server-page.xml
  7. 15 0
      display-server/src/com/ai/server/bean/FileBean.java
  8. 0 76
      display-server/src/com/ai/server/bean/FileUpDownload.java
  9. 0 43
      display-server/src/com/ai/server/bean/LoginBean.java
  10. 15 3
      display-server/web/biz/js/plugin/fileupload.js
  11. 10 0
      display-server/web/biz/js/plugin/video.js
  12. 10 1
      display-server/web/res/js/mobile/expand-mobile.js
  13. 11 15
      display-server/web/res/js/mobile/wade-mobile.js
  14. 4 0
      display-server/web/template/webapp/PluginIndex.html
  15. 20 3
      display-server/web/template/webapp/plugin/FileUpload.html
  16. 41 0
      display-server/web/template/webapp/plugin/Video.html
  17. BIN
      display-server/web/upload/default/20151013151525.png
  18. 9 9
      ipu-client/.classpath
  19. 18 18
      ipu-client/project.properties
  20. 22 22
      ipu-client/src/com/ipu/func/Util.java
  21. 50 50
      ipu-server/.classpath
  22. 1 0
      multiple-client/.gitignore
  23. 1 0
      multiple-client/assets/mobile-action.xml
  24. 1 1
      multiple-client/assets/mobile-config.xml
  25. 1 2
      multiple-client/project.properties
  26. 38 0
      multiple-client/src/com/ai/mobile/multiple/func/AppManagePlugin.java
  27. 7 1
      multiple-server/src/com/ai/server/multiple/bean/IndexBean.java
  28. 3 2
      multiple-server/web/biz/js/index.js
  29. 2 0
      multiple-server/web/res/js/mobile/wade-mobile.js
  30. 4 4
      push-server/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs
  31. 8 8
      wade-mobile-common/.classpath
  32. 8 8
      wade-mobile-lib/.classpath
  33. BIN
      wade-mobile-lib/libs/android-support-v4.jar
  34. BIN
      wade-mobile-library/common/wade-mobile-server.jar

+ 9 - 9
display-client/.classpath

@ -1,9 +1,9 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="src" path="src"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
7
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
8
	<classpathentry kind="output" path="bin/classes"/>
9
</classpath>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="src" path="src"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
7
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
8
	<classpathentry kind="output" path="bin/classes"/>
9
</classpath>

+ 2 - 1
display-client/.gitignore

@ -1,4 +1,5 @@
1 1
/.settings
2 2
/bin
3 3
/gen
4
/proguard
4
/proguard
5
/project.properties

+ 1 - 1
display-client/assets/mobile-config.xml

@ -38,4 +38,4 @@
38 38
	<config name="loadurl_timeout" value="20000"/>
39 39
	<!-- 非必须,默认false。打开调试模式,不再比对资源版本,客户端每次下载所有资源-->
40 40
	<!-- <config name="is_debug" value="true"/> -->
41
</configs>
41
</configs>

+ 17 - 17
display-client/project.properties

@ -1,17 +1,17 @@
1
# This file is automatically generated by Android Tools.
2
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
#
4
# This file must be checked in Version Control Systems.
5
#
6
# To customize properties used by the Ant build system edit
7
# "ant.properties", and override values to adapt the script to your
8
# project structure.
9
#
10
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12
13
# Project target.
14
target=android-15
15
android.library.reference.1=../wade-mobile-lib
16
android.library.reference.2=../wade-mobile-common
17
proguard.config=proguard-project.txt
1
# This file is automatically generated by Android Tools.
2
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
#
4
# This file must be checked in Version Control Systems.
5
#
6
# To customize properties used by the Ant build system edit
7
# "ant.properties", and override values to adapt the script to your
8
# project structure.
9
#
10
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12

13
# Project target.
14
target=android-15
15
android.library.reference.1=../wade-mobile-lib
16
android.library.reference.2=../wade-mobile-common
17
proguard.config=proguard-project.txt

+ 1 - 1
display-server/build/build.properties

@ -12,7 +12,7 @@ template=${web}/template
12 12
encrypt=${web}/encrypt
13 13
version_class=com.ailk.mobile.tool.VersionTool
14 14
encrypt_class=com.ailk.mobile.tool.FileEncryptTool
15
version_filter=setup|.gitignore
15
version_filter=setup|.gitignore|.DS_Store
16 16
is_debug=false
17 17

18 18
encode=UTF-8

+ 1 - 0
display-server/etc/server-page.xml

@ -22,6 +22,7 @@
22 22
	<action name="UI-CustomWindow" template="template/webapp/plugin/UI-CustomWindow.html"></action>
23 23
	<action name="UI-SlidingMenu" template="template/webapp/plugin/UI-SlidingMenu.html"></action>
24 24
	<action name="FileUpload" template="template/webapp/plugin/FileUpload.html"></action>
25
	<action name="RecordVideo" template="template/webapp/plugin/Video.html"></action>
25 26
	<!-- Web Component Demo-->
26 27
	<action name="WmTab" template="template/webapp/tag/WmTab.html"></action>
27 28
	<action name="WmTabbar" template="template/webapp/tag/WmTabbar.html"></action>

+ 15 - 0
display-server/src/com/ai/server/bean/FileBean.java

@ -0,0 +1,15 @@
1
package com.ai.server.bean;
2

3
import com.ai.server.core.bean.DisplayBean;
4
import com.ailk.common.data.IData;
5

6
public class FileBean extends DisplayBean{
7

8
	public IData uploadFile(IData param) throws Exception{
9
		return null;
10
	}
11
	
12
	public IData downloadFile(IData param) throws Exception{
13
		return null;
14
	}
15
}

+ 0 - 76
display-server/src/com/ai/server/bean/FileUpDownload.java

@ -108,80 +108,4 @@ public class FileUpDownload extends DisplayBean {
108 108
        }
109 109
        return null;
110 110
	}
111
	/**
112
	 * 文件下载
113
	 * @param param
114
	 * @return
115
	 * @throws Exception
116
	 */
117
	public IData download(IData param) throws Exception{
118
		HttpServletRequest request = ServletManager.getRequest();
119
		//获取文件需要上传到的路径
120
		String appPath = ApplicationPath.getFilePath(request);
121
		String path = appPath + File.separator + "upload" + File.separator + "Steven";
122
		File file = new File(path);
123
		if(! file.exists() && ! file.mkdirs()){
124
			throw new RuntimeException("生成用户上传文件夹失败,无法进行上传操作!");
125
		}
126
		
127
		//获得磁盘文件条目工厂
128
		DiskFileItemFactory factory = new DiskFileItemFactory();
129
       //如果没以下两行设置的话,上传大的文件会占用很多内存
130
       //设置暂时存放的存储室,这个存储室可以和最终存储文件的目录不同
131
       /**
132
        * 原理它是先存到暂时存储室,然后在真正写到对应目录的硬盘上
133
        * 按理来说当上传一个文件时,其实是上传了两份,第一个是以.tem格式的
134
        * 然后再将其真正写到对应目录的硬盘上
135
        */
136
        factory.setRepository(file);
137
        //设置缓存的大小,当上传文件的容量超过该缓存时,直接放到暂时存储室
138
        factory.setSizeThreshold(1024*1024);
139
        //文件上传处理
140
        ServletFileUpload upload = new ServletFileUpload(factory);
141
        
142
        try {
143
	        if (! ServletFileUpload.isMultipartContent(request)) {
144
	    		System.out.println("{'result': false, 'error': 网络异常,请重新上传!}");
145
	    	    return null;
146
	        }
147
	        List<?> fileList = upload.parseRequest(request);
148
	        
149
            for(int i = 0; i < fileList.size(); i++){
150
            	
151
            	FileItem item = (FileItem)fileList.get(i);
152
                //获取表单的属性名字
153
                String name = item.getFieldName();
154
                /**以下三步,主要获取上传文件的名字*/
155
                //获取路径名
156
                String value = item.getName();
157
                //索引到最后一个反斜杠
158
                int start = value.lastIndexOf("\\");
159
                //截取 上传文件的 字符串名字,加1是 去掉反斜杠
160
                String filename = value.substring(start + 1);
161
                request.setAttribute(name, filename);
162
                
163
                //写到磁盘上
164
                OutputStream out = new FileOutputStream(new File(path,filename));
165
                InputStream in = item.getInputStream();
166
                
167
                int length = 0;
168
                byte[] buf = new byte[1024];
169
                
170
                System.out.println("获取上传文件的总共的容量:" + item.getSize());
171
                //in.read(BUF)每次读到的数据存放在BUF数组中
172
                while((length = in.read(buf) ) != -1) {
173
                    //在BUF数组中取出数据写到(输出流)磁盘上
174
                    out.write(buf, 0, length);
175
                }
176
                in.close();
177
                out.close();
178
            }
179
        } catch (FileUploadException e) {
180
            e.printStackTrace();
181
            
182
        }catch (Exception e) {
183
            e.printStackTrace();
184
        }
185
        return null;
186
	}
187 111
}

+ 0 - 43
display-server/src/com/ai/server/bean/LoginBean.java

@ -5,29 +5,13 @@ import com.ai.server.core.context.DisplayContextData;
5 5
import com.ai.server.core.session.DisplaySessionManager;
6 6
import com.ai.server.util.Constant;
7 7
import com.ailk.common.data.IData;
8
import com.ailk.mobile.util.MobileConstant;
9 8

10 9
public class LoginBean extends DisplayBean{
11 10
	
12
	/************************************************
13
	 * 用户登陆操作
14
	 * @param param
15
	 * @return
16
	 * @throws Exception
17
	 */
18 11
	public IData login(IData param) throws Exception{
19
		//1.校验用户名,密码
20
		if(! verifyUserInfo(param))
21
			return param;
22
		
23
		log.debug("==========|" + param + "|===========");
24
		
25
		//2.获取Session信息
26 12
		DisplayContextData displayContextData = new DisplayContextData(param.getString("ACCOUNT"));
27 13
		String sessionId = DisplaySessionManager.getInstance().createSession(displayContextData);
28
		
29 14
		param.put(Constant.Session.SESSION_ID, sessionId);
30
		
31 15
		return param;
32 16
	}
33 17
	
@ -39,31 +23,4 @@ public class LoginBean extends DisplayBean{
39 23
		getContextData().setAccount(param.getString("NEW_ACCOUNT"));
40 24
		return getContextData().getData();
41 25
	}
42
	
43
	/*****************************************************
44
	 * 用户登陆校验
45
	 * @param param
46
	 * @return
47
	 */
48
	protected boolean verifyUserInfo(IData param){
49
		String userName = param.getString("ACCOUNT");
50
		String password = param.getString("PASSWORD");
51

52
		boolean flag = false;//默认校验不通过
53
		//1.数据非空校验
54
		if(userName == null || "".equals(userName.trim()))
55
			;
56
		if(password == null || "".equals(password.trim()))
57
			;
58
		//2.查询数据库
59
		
60
		flag = true;
61
		//3.返回结果
62
		if(! flag){
63
			param.put("X_RESULTCODE", MobileConstant.Result.ERROR_CODE);
64
			param.put("X_RESULTINFO", "用户名或密码错误!");
65
		}
66
		
67
		return flag;
68
	}
69 26
}

+ 15 - 3
display-server/web/biz/js/plugin/fileupload.js

@ -1,12 +1,24 @@
1 1
require(["domReady!","wadeMobile", "util"], function(doc,WadeMobile) {
2
	//建表
3
	$("#location").tap(function() {
2
	//上传
3
	$("#upload").tap(function() {
4
		//文件上传可以下载多个文件
4 5
		var uploadFiles = new Array();
5 6
//		uploadFiles.push('/Users/kevin/Downloads/cat.png');
6 7
		uploadFiles.push('/Users/kevin/Downloads/cat.txt');
7 8
		
8 9
		WadeMobile.uploadFile(uploadFiles, function(){
9
//			alert("上传成功!");
10
			
11
		});
12
	});
13
	
14
	//下载
15
	$("#download").tap(function() {
16
		//文件下载可以下载多个文件
17
		var uploadFiles = new Array();
18
		uploadFiles.push('http://127.0.0.1:9001/display/upload/default/20151013151525.png');//下载文件地址
19
		
20
		WadeMobile.downloadFile(uploadFiles, function(){
21
			
10 22
		});
11 23
	});
12 24
});

+ 10 - 0
display-server/web/biz/js/plugin/video.js

@ -0,0 +1,10 @@
1
require(["domReady!","wadeMobile", "util"], function(doc,WadeMobile) {
2
	//建表
3
	$("#location").tap(function() {
4
		var uploadFiles = new Array();
5
//		uploadFiles.push('/Users/kevin/Downloads/cat.png');
6
		uploadFiles.push('/Users/kevin/Downloads/cat.txt');
7
		
8
		WadeMobile.recordVideo("1", "30");
9
	});
10
});

+ 10 - 1
display-server/web/res/js/mobile/expand-mobile.js

@ -219,6 +219,15 @@ define(["require"],function(require) {
219 219
			},uploadFile:function(filePath,callback,err){
220 220
				storageCallback("uploadFile",callback);
221 221
				execute("uploadFile",[filePath],err);	
222
			},downloadFile:function(filePath,callback,err){
223
				storageCallback("downloadFile",callback);
224
				execute("downloadFile",[filePath],err);	
225
			},recordVideo:function(callback,compressRatio,timeLimit,err){
226
				storageCallback("recordVideo",callback);
227
				execute("recordVideo",[compressRatio,timeLimit],err);	
228
			},playVideo:function(callback,videoPath,err){
229
				storageCallback("playVideo",callback);
230
				execute("playVideo",[videoPath],err);	
222 231
			}
223 232
		};
224 233
	})();
@ -240,4 +249,4 @@ define(["require"],function(require) {
240 249
	}
241 250
	
242 251
	return ExpandMobile;
243
});
252
});

+ 11 - 15
display-server/web/res/js/mobile/wade-mobile.js

@ -3,7 +3,8 @@
3 3
 */
4 4
define(["jcl","base64","util","res/js/mobile/expand-mobile.js","biz/js/common/biz-mobile.js"],function(Wade,Base64) {
5 5
	//终端类型,a为android,i为ios
6
    var terminalType = (function(){
6
	var terminalType = window["TerminalType"];
7
    var deviceType = (function(){
7 8
		var sUserAgent = navigator.userAgent.toLowerCase();
8 9
		var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
9 10
		var bIsIphone = sUserAgent.match(/iphone os/i) == "iphone os";
@ -21,10 +22,8 @@ define(["jcl","base64","util","res/js/mobile/expand-mobile.js","biz/js/common/bi
21 22
	WadeMobile = (function(){
22 23
        return{
23 24
        	isApp:function(){//判断是否是APP应用
24
				return window["PluginManager"] || terminalType=="i";
25
        	},getTerminalType:function(callback,err){
26
        		WadeMobile.callback.storageCallback("getTerminalType",callback);
27
        		execute("getTerminalType", [], err);
25
        		//deviceType=="i"是为了考虑客户端能加载远程Web页面
26
				return window["TerminalType"]||window["PluginManager"]||deviceType=="i";
28 27
        	},getSysInfo:function(callback,key,err){//TELNUMBER|IMEI|IMSI|SDKVERSION|OSVERSION|PLATFORM|SIMNUMBER
29 28
				WadeMobile.callback.storageCallback("getSysInfo",callback);
30 29
				execute("getSysInfo", [key],err);
@ -98,6 +97,7 @@ define(["jcl","base64","util","res/js/mobile/expand-mobile.js","biz/js/common/bi
98 97
	var globalErrorKey = null;//全局错误关键字,定位错误
99 98
	
100 99
	/*绝大多数情况下,success回调函数是用不上的,有需要回调函数的时候异步方式传入取值*/
100
	var isAlert = true;//防止反复弹出alert
101 101
	var execute = function(action, args, error, success){
102 102
        args = stringify(args);
103 103
		if(terminalType=="a"){
@ -107,8 +107,12 @@ define(["jcl","base64","util","res/js/mobile/expand-mobile.js","biz/js/common/bi
107 107
		}else if(terminalType=="w"){
108 108
			winphoneExecute(action, args, error, success);
109 109
		}else{
110
			//alert("无终端类型");
111
			//iosExecute(action, args, error, success);
110
			if(isAlert){
111
				isAlert = false
112
				alert(action+"无终端类型");
113
			}else{
114
				console.log(action+"无终端类型");
115
			}
112 116
		}
113 117
	};
114 118
	
@ -346,14 +350,6 @@ define(["jcl","base64","util","res/js/mobile/expand-mobile.js","biz/js/common/bi
346 350
	    }
347 351
	};
348 352
	
349
	/*从终端中获取类型*/
350
	WadeMobile.getTerminalType(function(type){
351
		console.log("读取真机类型:"+type);
352
		if(type){
353
			terminalType = type;
354
		}
355
	});
356
	
357 353
	var ExpandMobile = require("res/js/mobile/expand-mobile.js");
358 354
	var BizMobile = require("biz/js/common/biz-mobile.js");
359 355
	Wade.extend(WadeMobile,ExpandMobile);//属性合并,ExpandMobile累加到WadeMobile中

+ 4 - 0
display-server/web/template/webapp/PluginIndex.html

@ -43,4 +43,8 @@
43 43
		<div class="pic"><span class="e_ico-storage"></span></div>
44 44
		<div class="text">文件上传</div>
45 45
	</li>
46
	<li action="RecordVideo">
47
		<div class="pic"><span class="e_ico-storage"></span></div>
48
		<div class="text">视频录制</div>
49
	</li>
46 50
</ul>

+ 20 - 3
display-server/web/template/webapp/plugin/FileUpload.html

@ -21,21 +21,38 @@
21 21

22 22
<div class="m_content m_content-nofooter" id="content" >
23 23
<div>
24
	<div class="c_title">文件位置</div>
24
	<div class="c_title">文件上传</div>
25 25
	<div class="c_list">
26 26
		<ul>
27 27
			<li>
28 28
				<div class="content">
29 29
					<div class="main">
30 30
						<div class="title">文件路径</div>
31
						<div class="info" id="fileLocation">请选择上传文件路径</div>
31
						<div class="info" id="fileUpload">请选择上传文件路径</div>
32 32
					</div>
33
					<div class="fn fn-2" id="location">文件路径</div>
33
					<div class="fn fn-2" id="upload">文件上传</div>
34 34
				</div>
35 35
			</li>
36 36
		</ul>
37 37
	</div>
38 38
</div>
39
<div>
40
	<div class="c_title">文件下载</div>
41
	<div class="c_list">
42
		<ul>
43
			<li>
44
				<div class="content">
45
					<div class="main">
46
						<div class="title">文件路径</div>
47
						<div class="info" id="fileDownload">请选择下载文件路径</div>
48
					</div>
49
					<div class="fn fn-2" id="download">文件下载</div>
50
				</div>
51
			</li>
52
		</ul>
53
	</div>
54
</div>
55

39 56
</div>
40 57
</body>
41 58
</html>

+ 41 - 0
display-server/web/template/webapp/plugin/Video.html

@ -0,0 +1,41 @@
1
<!DOCTYPE HTML>
2
<html class="s_bs">
3
<head>
4
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
6
	<title>视频</title>
7
	{%>template/common/Head.html%}
8
	<script type="text/javascript" src="biz/js/plugin/video.js"></script>
9
	<link href="biz/css/project.css" rel="stylesheet" type="text/css" />
10
</head>
11
<body>
12

13
<div class="c_navBar">
14
	<div class="left">
15
		<div class="back">
16
			<span class="e_ico-back"></span>
17
			<span class="text">文件上传</span>
18
		</div>
19
	</div>
20
</div>
21

22
<div class="m_content m_content-nofooter" id="content" >
23
<div>
24
	<div class="c_title">视频</div>
25
	<div class="c_list">
26
		<ul>
27
			<li>
28
				<div class="content">
29
					<div class="main">
30
						<div class="title">视频录制</div>
31
						<div class="info" id="fileLocation">视频录制</div>
32
					</div>
33
					<div class="fn fn-2" id="location">视频录制</div>
34
				</div>
35
			</li>
36
		</ul>
37
	</div>
38
</div>
39
</div>
40
</body>
41
</html>

BIN
display-server/web/upload/default/20151013151525.png


+ 9 - 9
ipu-client/.classpath

@ -1,9 +1,9 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="src" path="gen"/>
5
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
7
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
8
	<classpathentry kind="output" path="bin/classes"/>
9
</classpath>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="src" path="gen"/>
5
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
7
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
8
	<classpathentry kind="output" path="bin/classes"/>
9
</classpath>

+ 18 - 18
ipu-client/project.properties

@ -1,18 +1,18 @@
1
# This file is automatically generated by Android Tools.
2
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
#
4
# This file must be checked in Version Control Systems.
5
#
6
# To customize properties used by the Ant build system edit
7
# "ant.properties", and override values to adapt the script to your
8
# project structure.
9
#
10
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12
13
# Project target.
14
target=android-15
15
android.library.reference.1=../wade-mobile-lib
16
android.library.reference.2=../wade-mobile-common
17
18
proguard.config=proguard-project.txt
1
# This file is automatically generated by Android Tools.
2
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
#
4
# This file must be checked in Version Control Systems.
5
#
6
# To customize properties used by the Ant build system edit
7
# "ant.properties", and override values to adapt the script to your
8
# project structure.
9
#
10
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12

13
# Project target.
14
target=android-15
15
android.library.reference.1=../wade-mobile-lib
16
android.library.reference.2=../wade-mobile-common
17

18
proguard.config=proguard-project.txt

+ 22 - 22
ipu-client/src/com/ipu/func/Util.java

@ -1,22 +1,22 @@
1
package com.ipu.func;
2
3
import org.json.JSONArray;
4
5
import android.content.Intent;
6
import android.net.Uri;
7
8
import com.wade.mobile.frame.IWadeMobile;
9
import com.wade.mobile.frame.plugin.Plugin;
10
11
public class Util extends Plugin {
12
	public Util(IWadeMobile wademobile) {
13
		super(wademobile);
14
	}
15
16
	public void openBrowser(JSONArray param) throws Exception {
17
		String url = param.getString(0);
18
		Uri uri = Uri.parse(url);
19
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
20
		context.startActivity(intent);
21
	}
22
}
1
package com.ipu.func;
2

3
import org.json.JSONArray;
4

5
import android.content.Intent;
6
import android.net.Uri;
7

8
import com.wade.mobile.frame.IWadeMobile;
9
import com.wade.mobile.frame.plugin.Plugin;
10

11
public class Util extends Plugin {
12
	public Util(IWadeMobile wademobile) {
13
		super(wademobile);
14
	}
15

16
	public void openBrowser(JSONArray param) throws Exception {
17
		String url = param.getString(0);
18
		Uri uri = Uri.parse(url);
19
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
20
		context.startActivity(intent);
21
	}
22
}

+ 50 - 50
ipu-server/.classpath

@ -1,50 +1,50 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="src" path="etc"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6
	<classpathentry kind="lib" path="/wade-mobile-library/common/bcprov-jdk16-140.jar"/>
7
	<classpathentry kind="lib" path="/wade-mobile-library/common/beetl-core-2.2.3.jar"/>
8
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-beanutils-1.7.0.jar"/>
9
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-codec-1.3.jar"/>
10
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-collections-3.2.jar"/>
11
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-dbcp-1.4.jar"/>
12
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-digester1.6.jar"/>
13
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-fileupload-1.2.2.jar"/>
14
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-httpclient-3.0.jar"/>
15
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-lang-2.4.jar"/>
16
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-logging-1.1.1.jar"/>
17
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-net-2.0.jar"/>
18
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-pool-1.6.jar"/>
19
	<classpathentry kind="lib" path="/wade-mobile-library/common/dom4j-1.6.1.jar"/>
20
	<classpathentry kind="lib" path="/wade-mobile-library/common/http-unirest-1.3.8.jar"/>
21
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpasyncclient-4.0.1.jar"/>
22
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpclient-4.3.2.jar"/>
23
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-4.4.3.jar"/>
24
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-ab-4.4.3.jar"/>
25
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-nio-4.4.3.jar"/>
26
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpmime-4.3.2.jar"/>
27
	<classpathentry kind="lib" path="/wade-mobile-library/common/java_memcached-release_2.5.3.jar"/>
28
	<classpathentry kind="lib" path="/wade-mobile-library/common/jaxen-1.1.1.jar"/>
29
	<classpathentry kind="lib" path="/wade-mobile-library/common/jedis-2.0.0.jar"/>
30
	<classpathentry kind="lib" path="/wade-mobile-library/common/json-20131018.jar"/>
31
	<classpathentry kind="lib" path="/wade-mobile-library/common/jta.jar"/>
32
	<classpathentry kind="lib" path="/wade-mobile-library/common/junit-4.8.jar"/>
33
	<classpathentry kind="lib" path="/wade-mobile-library/common/log4j-1.2.8.jar"/>
34
	<classpathentry kind="lib" path="/wade-mobile-library/common/mysql-connector-java-5.1.6-bin.jar"/>
35
	<classpathentry kind="lib" path="/wade-mobile-library/common/ojdbc14.jar"/>
36
	<classpathentry kind="lib" path="/wade-mobile-library/common/pinyin4j-2.5.0.jar"/>
37
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-3.8.jar"/>
38
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-ooxml-3.8.jar"/>
39
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-ooxml-schemas-3.8.jar"/>
40
	<classpathentry kind="lib" path="/wade-mobile-library/common/servlet-api2.5.jar"/>
41
	<classpathentry kind="lib" path="/wade-mobile-library/common/sqlite-jdbc-3.8.7.jar"/>
42
	<classpathentry kind="lib" path="/wade-mobile-library/common/velocity-1.7.jar"/>
43
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-apache.jar"/>
44
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-common.jar"/>
45
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-database.jar"/>
46
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-mobile-data.jar"/>
47
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-mobile-server.jar"/>
48
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-sqlite-jdbc.jar"/>
49
	<classpathentry kind="output" path="web/WEB-INF/classes"/>
50
</classpath>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="src" path="etc"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6
	<classpathentry kind="lib" path="/wade-mobile-library/common/bcprov-jdk16-140.jar"/>
7
	<classpathentry kind="lib" path="/wade-mobile-library/common/beetl-core-2.2.3.jar"/>
8
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-beanutils-1.7.0.jar"/>
9
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-codec-1.3.jar"/>
10
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-collections-3.2.jar"/>
11
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-dbcp-1.4.jar"/>
12
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-digester1.6.jar"/>
13
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-fileupload-1.2.2.jar"/>
14
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-httpclient-3.0.jar"/>
15
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-lang-2.4.jar"/>
16
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-logging-1.1.1.jar"/>
17
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-net-2.0.jar"/>
18
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-pool-1.6.jar"/>
19
	<classpathentry kind="lib" path="/wade-mobile-library/common/dom4j-1.6.1.jar"/>
20
	<classpathentry kind="lib" path="/wade-mobile-library/common/http-unirest-1.3.8.jar"/>
21
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpasyncclient-4.0.1.jar"/>
22
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpclient-4.3.2.jar"/>
23
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-4.4.3.jar"/>
24
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-ab-4.4.3.jar"/>
25
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-nio-4.4.3.jar"/>
26
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpmime-4.3.2.jar"/>
27
	<classpathentry kind="lib" path="/wade-mobile-library/common/java_memcached-release_2.5.3.jar"/>
28
	<classpathentry kind="lib" path="/wade-mobile-library/common/jaxen-1.1.1.jar"/>
29
	<classpathentry kind="lib" path="/wade-mobile-library/common/jedis-2.0.0.jar"/>
30
	<classpathentry kind="lib" path="/wade-mobile-library/common/json-20131018.jar"/>
31
	<classpathentry kind="lib" path="/wade-mobile-library/common/jta.jar"/>
32
	<classpathentry kind="lib" path="/wade-mobile-library/common/junit-4.8.jar"/>
33
	<classpathentry kind="lib" path="/wade-mobile-library/common/log4j-1.2.8.jar"/>
34
	<classpathentry kind="lib" path="/wade-mobile-library/common/mysql-connector-java-5.1.6-bin.jar"/>
35
	<classpathentry kind="lib" path="/wade-mobile-library/common/ojdbc14.jar"/>
36
	<classpathentry kind="lib" path="/wade-mobile-library/common/pinyin4j-2.5.0.jar"/>
37
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-3.8.jar"/>
38
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-ooxml-3.8.jar"/>
39
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-ooxml-schemas-3.8.jar"/>
40
	<classpathentry kind="lib" path="/wade-mobile-library/common/servlet-api2.5.jar"/>
41
	<classpathentry kind="lib" path="/wade-mobile-library/common/sqlite-jdbc-3.8.7.jar"/>
42
	<classpathentry kind="lib" path="/wade-mobile-library/common/velocity-1.7.jar"/>
43
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-apache.jar"/>
44
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-common.jar"/>
45
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-database.jar"/>
46
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-mobile-data.jar"/>
47
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-mobile-server.jar"/>
48
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-sqlite-jdbc.jar"/>
49
	<classpathentry kind="output" path="web/WEB-INF/classes"/>
50
</classpath>

+ 1 - 0
multiple-client/.gitignore

@ -4,3 +4,4 @@
4 4
/.classpath
5 5
/proguard
6 6
/bin/
7
/project.properties

+ 1 - 0
multiple-client/assets/mobile-action.xml

@ -7,6 +7,7 @@
7 7
	<action name="shock" class="com.wade.mobile.func.MobileBasic" method="shock"/>
8 8
	<!-- MobileApp -->
9 9
	<action name="close" class="com.wade.mobile.func.MobileApp" method="close"/>
10
	<action name="openIpuApp" class="com.wade.mobile.func.MobileApp" method="openIpuApp"/>
10 11
	<!-- MobileNetWork -->
11 12
	<action name="httpGet" class="com.wade.mobile.func.MobileNetWork" method="httpGet"></action>
12 13
	<action name="dataRequest" class="com.wade.mobile.func.MobileNetWork" method="dataRequest"/>

+ 1 - 1
multiple-client/assets/mobile-config.xml

@ -3,7 +3,7 @@
3 3
    <!-- 请求主机名或请求地址。包括服务器的ip地址和端口 -->
4 4
	<!-- <config name="request_host" value="http://192.168.1.102:8080"/> -->
5 5
	<!-- 必须。10.0.2.2为Android模拟器的保留ip地址。访问到本机电脑时使用 -->
6
	<config name="request_host" value="http://192.168.57.1:8080"/>
6
	<config name="request_host" value="http://10.0.2.2:8080"/>
7 7
	<!-- 必须。容器应用名或请求根路径 -->
8 8
	<config name="request_path" value="/mult"/>
9 9
	<!-- 必须。数据接口的servlet路径 -->

+ 1 - 2
multiple-client/project.properties

@ -12,5 +12,4 @@
12 12
13 13
# Project target.
14 14
target=android-15
15
android.library.reference.1=../wade-mobile-common
16
android.library.reference.2=../wade-mobile-lib
15
android.library.reference.1=..\\wade-mobile-lib

+ 38 - 0
multiple-client/src/com/ai/mobile/multiple/func/AppManagePlugin.java

@ -1,12 +1,18 @@
1 1
package com.ai.mobile.multiple.func;
2 2

3
import java.util.HashMap;
4
import java.util.Map;
5

3 6
import org.json.JSONArray;
4 7

5 8
import android.content.ComponentName;
6 9
import android.content.Intent;
7 10

8 11
import com.wade.mobile.frame.IWadeMobile;
12
import com.wade.mobile.frame.multiple.MultipleAppConfig;
9 13
import com.wade.mobile.frame.plugin.Plugin;
14
import com.wade.mobile.frame.template.TemplateManager;
15
import com.wade.mobile.func.MobileUI;
10 16

11 17
public class AppManagePlugin extends Plugin{
12 18

@ -32,4 +38,36 @@ public class AppManagePlugin extends Plugin{
32 38
			/*如果应用不存在则需要下载,配置需要提供下载的url*/
33 39
		}
34 40
	}
41
	
42
	public void openIpuApp(JSONArray param) throws Exception{
43
		Map<String,Map> multipleAppConfigs = new HashMap<String,Map>();
44
		Map multipleAppConfig = new HashMap();
45
		multipleAppConfig.put("requestHost", "10.0.2.2");
46
		multipleAppConfig.put("requestPath", "display");
47
		multipleAppConfig.put("requestServlet", "mobiledata");
48
		multipleAppConfig.put("appPath", "display-client");
49
		multipleAppConfigs.put("display", multipleAppConfig);
50
		
51
		multipleAppConfig = new HashMap();
52
		multipleAppConfig.put("requestHost", "10.0.2.2");
53
		multipleAppConfig.put("requestPath", "ioo");
54
		multipleAppConfig.put("requestServlet", "mobiledata");
55
		multipleAppConfig.put("appPath", "ioo-client");
56
		multipleAppConfigs.put("ioo", multipleAppConfig);
57
		
58
		String appName = param.getString(0);
59
		String requestHost = multipleAppConfigs.get(appName).get("requestHost").toString();
60
		String requestPath = multipleAppConfigs.get(appName).get("requestPath").toString();
61
		String requestServlet = multipleAppConfigs.get(appName).get("requestServlet").toString();
62
		String appPath = multipleAppConfigs.get(appName).get("appPath").toString();
63
		
64
		MultipleAppConfig.setRequestHost(requestHost);
65
		MultipleAppConfig.setRequestPath(requestPath);
66
		MultipleAppConfig.setRequestServlet(requestServlet);
67
		MultipleAppConfig.setAppPath(appPath);
68
		
69
		TemplateManager.downloadResource();
70
		
71
		wademobile.getPluginManager().getPlugin(MobileUI.class).openPage("", null);
72
	}
35 73
}

+ 7 - 1
multiple-server/src/com/ai/server/multiple/bean/IndexBean.java

@ -27,12 +27,18 @@ public class IndexBean extends MultipleBean {
27 27
	private IDataset getAppDatas(){
28 28
		IDataset appDatas = new DatasetList();
29 29
		IData appData = new DataMap();
30
		appData.put("APP_NAME", "IPU应用");
30
		appData.put("APP_NAME", "Display");
31 31
		appData.put("APP_TYPE", "I");
32 32
		appData.put("APP_ID", "display");
33 33
		appDatas.add(appData);
34 34
		
35 35
		appData = new DataMap();
36
		appData.put("APP_NAME", "Ioo");
37
		appData.put("APP_TYPE", "I");
38
		appData.put("APP_ID", "ioo");
39
		appDatas.add(appData);
40
		
41
		appData = new DataMap();
36 42
		appData.put("APP_NAME", "原生应用1");
37 43
		appData.put("APP_TYPE", "N");
38 44
		appData.put("APP_ID", "APP1");

+ 3 - 2
multiple-server/web/biz/js/index.js

@ -1,4 +1,4 @@
1
require(["wmTabbar","common","mobile","util"], function(WmTabbar,Common,Mobile) {
1
require(["wmTabbar","common","mobile","wademobile","util"], function(WmTabbar,Common,Mobile,WadeMobile) {
2 2
	var wmTabbar = new WmTabbar("tabbar");
3 3
	wmTabbar.create();
4 4
	
@ -20,7 +20,8 @@ require(["wmTabbar","common","mobile","util"], function(WmTabbar,Common,Mobile)
20 20
			Common.callSvc("LoginBean.loginApp",loginData,function(result){
21 21
				alert(result)
22 22
				if(appType=="I"){
23
					alert("打开IPU应用"+appId);
23
					//alert("打开IPU应用"+appId);
24
					WadeMobile.openIpuApp(appId);
24 25
				}else if(appType=="N"){
25 26
					var param = new Wade.DataMap();
26 27
					param.put("TOKEN_ID",result.get("TOKEN_ID"));

+ 2 - 0
multiple-server/web/res/js/mobile/wade-mobile.js

@ -92,6 +92,8 @@ define(["jcl","base64","util","res/js/mobile/expand-mobile.js","biz/js/common/bi
92 92
				execute("openSlidingMenu", [action,param,width,height,leftMargin,topMargin,isEscape],err);
93 93
			},closeSlidingMenu:function(result,state,err){
94 94
				execute("closeSlidingMenu", [result,state],err);
95
			},openIpuApp(callback,appName){
96
				execute("openIpuApp", [appName],err);
95 97
			}
96 98
		};
97 99
	})();

+ 4 - 4
push-server/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs

@ -1,4 +1,4 @@
1
#org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences
2
#Fri Sep 18 14:22:21 CST 2015
3
build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=;
4
org.springsource.ide.eclipse.gradle.rootprojectloc=
1
#org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences
2
#Fri Sep 18 14:22:21 CST 2015
3
build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=;
4
org.springsource.ide.eclipse.gradle.rootprojectloc=

+ 8 - 8
wade-mobile-common/.classpath

@ -1,8 +1,8 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
7
	<classpathentry kind="output" path="bin/classes"/>
8
</classpath>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
7
	<classpathentry kind="output" path="bin/classes"/>
8
</classpath>

+ 8 - 8
wade-mobile-lib/.classpath

@ -1,8 +1,8 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
7
	<classpathentry kind="output" path="bin/classes"/>
8
</classpath>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
7
	<classpathentry kind="output" path="bin/classes"/>
8
</classpath>

BIN
wade-mobile-lib/libs/android-support-v4.jar


BIN
wade-mobile-library/common/wade-mobile-server.jar