Browse Source

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!2136
o2null 5 years ago
parent
commit
9618900f14
13 changed files with 73 additions and 276 deletions
  1. 2 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompleted.java
  2. 2 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java
  3. 0 34
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest1.java
  4. 0 22
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest2.java
  5. 0 28
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest3.java
  6. 0 21
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest4.java
  7. 0 23
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest5.java
  8. 0 23
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest52.java
  9. 0 104
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java
  10. 8 0
      o2web/source/x_component_cms_FormDesigner/Module/Comment/comment.html
  11. 18 0
      o2web/source/x_component_cms_FormDesigner/Module/Comment/template.json
  12. 18 1
      o2web/source/x_component_cms_Xform/Comment.js
  13. 25 20
      o2web/source/x_component_cms_Xform/widget/Comment.js

+ 2 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompleted.java

@@ -5,6 +5,7 @@ import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
 import java.util.zip.CRC32;
 
 import org.apache.commons.lang3.BooleanUtils;
@@ -163,6 +164,7 @@ class V2LookupWorkOrWorkCompleted extends BaseAction {
 			_relatedForm.get();
 			_relatedScript.get();
 			list.add(form.getId() + form.getUpdateTime().getTime());
+			list = list.stream().sorted().collect(Collectors.toList());
 			Wo wo = new Wo();
 			wo.setId(form.getId());
 			CRC32 crc = new CRC32();

+ 2 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java

@@ -5,6 +5,7 @@ import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
 import java.util.zip.CRC32;
 
 import org.apache.commons.lang3.BooleanUtils;
@@ -164,6 +165,7 @@ class V2LookupWorkOrWorkCompletedMobile extends BaseAction {
 			_relatedForm.get();
 			_relatedScript.get();
 			list.add(form.getId() + form.getUpdateTime().getTime());
+			list = list.stream().sorted().collect(Collectors.toList());
 			Wo wo = new Wo();
 			wo.setId(form.getId());
 			CRC32 crc = new CRC32();

+ 0 - 34
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest1.java

@@ -1,34 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-import com.x.base.core.project.thread.ParameterRunnable;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest1 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		ThisApplication.context().threadFactory().start(new ParameterRunnable() {
-			public void run() {
-				try {
-					for (int i = 0; i < 180; i++) {
-						System.out.println("aaaaaaaaaaaaaaaaaaaaa" + i);
-						this.parameter.put("asdfasdf", i);
-						Thread.sleep(1000);
-					}
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-
-			}
-		}, "112233");
-		return result;
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-
-}

+ 0 - 22
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest2.java

@@ -1,22 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapString;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest2 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		wo.setValue(ThisApplication.context().threadFactory().alive("112233"));
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends WrapString {
-
-	}
-
-}

+ 0 - 28
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest3.java

@@ -1,28 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import java.util.Map;
-import java.util.TreeMap;
-
-import com.x.base.core.project.gson.XGsonBuilder;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest3 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		Map<Object, Object> value = ThisApplication.context().threadFactory().parameter("112233").orElse(null);
-		if (null != value) {
-			wo = XGsonBuilder.convert(value, Wo.class);
-		}
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends TreeMap<Object, Object> {
-
-	}
-
-}

+ 0 - 21
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest4.java

@@ -1,21 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest4 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		wo.setValue(ThisApplication.context().threadFactory().stop("112233"));
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-}

+ 0 - 23
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest5.java

@@ -1,23 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest5 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-		System.out.println("Action5_id:" + id);
-		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-}

+ 0 - 23
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest52.java

@@ -1,23 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest52 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-		System.out.println("Action52");
-		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-}

+ 0 - 104
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java

@@ -1,7 +1,5 @@
 package com.x.processplatform.service.processing.jaxrs.test;
 
-import java.util.Map;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
@@ -166,106 +164,4 @@ public class TestAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test1")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test1(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest1.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest1().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test2")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test2(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest2.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest2().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test3")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test3(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest3.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest3().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test4")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test4(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest4.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest4().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test5/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test5(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionTest5.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest5().execute(effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest52.class)
-	@GET
-	@Path("test5/123")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test5(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest52.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest52().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
 }

+ 8 - 0
o2web/source/x_component_cms_FormDesigner/Module/Comment/comment.html

@@ -72,6 +72,14 @@
 
 	<!--<div><div id="labelEditScriptValue" class="MWFScriptArea" name="filterScript" title="通过脚本过滤(S)"></div></div>-->
 	<!--</div>-->
+
+	<div title="编辑器"  class="MWFTab">
+		<div class="MWFMaplist" name="editorProperties" title="CKEditor Config"></div>
+		<div class="MWFScriptArea" name="config" title="CKEditor Config 脚本"></div>
+		<div>返回CKEditor的Config对象,用于编辑器初始化</div>
+		<div style="text-align:center">更多属性帮助请查看 <a target="_blank" href="http://docs.ckeditor.com/">CKEditor Documentation</a></div>
+	</div>
+
 	<div title="事件"  class="MWFTab">
 		<div class="MWFEventsArea" name="events"></div>
 	</div>

+ 18 - 0
o2web/source/x_component_cms_FormDesigner/Module/Comment/template.json

@@ -71,6 +71,24 @@
 			"html": ""
 		}
 	},
+	"editorProperties": {
+		"autoGrow_maxHeight": 400,
+		"autoGrow_minHeight": 300,
+		"resize_enabled": true,
+		"resize_maxHeight": "3000",
+		"resize_minHeight": "200",
+		"autoParagraph": true,
+		"autoUpdateElement": true,
+		"enterMode": 1,
+		"height": "200",
+		"width": "",
+		"readOnly": false,
+		"title": ""
+	},
+	"config": {
+		"code": "",
+		"html": ""
+	},
 	"properties": {},
 	"class": "",
 	"styles": {},

+ 18 - 1
o2web/source/x_component_cms_Xform/Comment.js

@@ -5,11 +5,28 @@ MWF.xApplication.cms.Xform.Comment = MWF.CMSComment =  new Class({
 	_loadUserInterface: function(){
 		this.node.empty();
         this.node.setStyle("-webkit-user-select", "text");
+
+        debugger;
+
+        var config = {};
+        if(this.json.editorProperties){
+            config = Object.clone(this.json.editorProperties);
+        }
+        if (this.json.config){
+            if (this.json.config.code){
+                var obj = this.form.Macro.exec(this.json.config.code, this);
+                Object.each(obj, function(v, k){
+                    config[k] = v;
+                });
+            }
+        }
+
         this.comment = new MWF.xApplication.cms.Xform.widget.Comment( this.form.app, this.node, {
             "documentId" : this.form.businessData.document.id,
             "countPerPage" : this.json.countPerPage || 10,
             "isAllowModified" : this.json.isAllowModified,
-            "isAdmin" : this.form.app.isAdmin
+            "isAdmin" : this.form.app.isAdmin,
+            "editorProperties" : config
         });
         this.comment.load();
 	}

+ 25 - 20
o2web/source/x_component_cms_Xform/widget/Comment.js

@@ -355,6 +355,30 @@ O2CMSComment.Editor = new Class({
         this.saveCommentAction.addEvent("click",function(){
             this.saveComment();
         }.bind(this));
+
+        var rtfConfig = {
+            //skin : "bootstrapck",
+            "resize_enabled": false,
+            isSetImageMaxWidth : true,
+            reference : this.advanceCommentId,
+            referenceType: "forumReply",
+            //uiColor : '#9AB8F3',
+            //toolbarCanCollapse : true,
+            toolbar : [
+                //{ name: 'document', items : [ 'Preview' ] },
+                //{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
+                //{ name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','-','RemoveFormat' ] },
+                //{ name: 'paragraph', items : [ 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] },
+                //{ name: 'styles', items : [ 'Font','FontSize' ] },
+                //{ name: 'colors', items : [ 'TextColor','BGColor' ] },
+                //{ name: 'links', items : [ 'Link','Unlink' ] },
+                { name: 'insert', items : [ 'Image' ] }
+                //{ name: 'tools', items : [ 'Maximize','-','About' ] }
+            ]
+        };
+        if( this.comment.options.editorProperties ){
+            rtfConfig = Object.merge( rtfConfig, this.comment.options.editorProperties )
+        }
         MWF.xDesktop.requireApp("Template", "MForm", function () {
             this.form = new MForm(this.node, this.data || {}, {
                 style: "forum",
@@ -368,26 +392,7 @@ O2CMSComment.Editor = new Class({
                         }
                     }.bind(this)},
                     creatorName: { type : "innerText", value : layout.session.user.name },
-                    content: { type : "rtf", RTFConfig : {
-                        //skin : "bootstrapck",
-                        "resize_enabled": false,
-                        isSetImageMaxWidth : true,
-                        reference : this.advanceCommentId,
-                        referenceType: "forumReply",
-                        //uiColor : '#9AB8F3',
-                        //toolbarCanCollapse : true,
-                        toolbar : [
-                            //{ name: 'document', items : [ 'Preview' ] },
-                            //{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
-                            //{ name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','-','RemoveFormat' ] },
-                            //{ name: 'paragraph', items : [ 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] },
-                            //{ name: 'styles', items : [ 'Font','FontSize' ] },
-                            //{ name: 'colors', items : [ 'TextColor','BGColor' ] },
-                            //{ name: 'links', items : [ 'Link','Unlink' ] },
-                            { name: 'insert', items : [ 'Image' ] }
-                            //{ name: 'tools', items : [ 'Maximize','-','About' ] }
-                        ]
-                    }}
+                    content: { type : "rtf", RTFConfig : rtfConfig }
                 }
             }, this, this.comment.css);
             this.form.load();