소스 검색

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!3062
o2null 4 년 전
부모
커밋
5f5aa42155
12개의 변경된 파일367개의 추가작업 그리고 145개의 파일을 삭제
  1. 8 3
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/gson/DoubleDeserializer.java
  2. 8 3
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/gson/FloatDeserializer.java
  3. 5 4
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_cms_assemble_control.java
  4. 2 1
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/ThisApplication.java
  5. 14 14
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishAndNotify.java
  6. 8 9
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishByWorkFlow.java
  7. 5 17
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishContent.java
  8. 36 40
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistSaveDocument.java
  9. 53 53
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/queue/QueueSendDocumentNotify.java
  10. 209 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionUploadWithUrl.java
  11. 18 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java
  12. 1 1
      o2web/source/x_component_query_StatementDesigner/Statement.js

+ 8 - 3
o2server/x_base_core_project/src/main/java/com/x/base/core/project/gson/DoubleDeserializer.java

@@ -15,8 +15,13 @@ public class DoubleDeserializer implements JsonDeserializer<Double> {
 	@Override
 	@Override
 	public Double deserialize(JsonElement json, Type type, JsonDeserializationContext context)
 	public Double deserialize(JsonElement json, Type type, JsonDeserializationContext context)
 			throws JsonParseException {
 			throws JsonParseException {
-		Number num = NumberUtils.createNumber(StringUtils.trimToNull(json.getAsString()));
-		return (num == null) ? null : num.doubleValue();
+		/*Number num = NumberUtils.createNumber(StringUtils.trimToNull(json.getAsString()));
+		return (num == null) ? null : num.doubleValue();*/
+		if(StringUtils.isBlank(json.getAsString())){
+			return null;
+		}else{
+			return Double.parseDouble(StringUtils.trim(json.getAsString()));
+		}
 	}
 	}
 
 
-}
+}

+ 8 - 3
o2server/x_base_core_project/src/main/java/com/x/base/core/project/gson/FloatDeserializer.java

@@ -15,8 +15,13 @@ public class FloatDeserializer implements JsonDeserializer<Float> {
 	@Override
 	@Override
 	public Float deserialize(JsonElement json, Type type, JsonDeserializationContext context)
 	public Float deserialize(JsonElement json, Type type, JsonDeserializationContext context)
 			throws JsonParseException {
 			throws JsonParseException {
-		Number num = NumberUtils.createNumber(StringUtils.trimToNull(json.getAsString()));
-		return (num == null) ? null : num.floatValue();
+		/*Number num = NumberUtils.createNumber(StringUtils.trimToNull(json.getAsString()));
+		return (num == null) ? null : num.floatValue();*/
+		if(StringUtils.isBlank(json.getAsString())){
+			return null;
+		}else{
+			return Float.parseFloat(StringUtils.trim(json.getAsString()));
+		}
 	}
 	}
 
 
-}
+}

+ 5 - 4
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_cms_assemble_control.java

@@ -17,9 +17,10 @@ import com.x.base.core.project.annotation.ModuleType;
 		"com.x.processplatform.core.entity.content.Attachment", "com.x.query.core.entity.Item",
 		"com.x.processplatform.core.entity.content.Attachment", "com.x.query.core.entity.Item",
 		"com.x.query.core.entity.View", "com.x.cms.core.entity.ReadRemind", "com.x.cms.core.entity.DocumentCommend",
 		"com.x.query.core.entity.View", "com.x.cms.core.entity.ReadRemind", "com.x.cms.core.entity.DocumentCommend",
 		"com.x.cms.core.entity.DocumentCommentInfo", "com.x.cms.core.entity.CmsBatchOperation", "com.x.cms.core.entity.Review",
 		"com.x.cms.core.entity.DocumentCommentInfo", "com.x.cms.core.entity.CmsBatchOperation", "com.x.cms.core.entity.Review",
-		"com.x.cms.core.entity.DocumentCommentContent", "com.x.cms.core.entity.DocumentCommentCommend"}, storageTypes = {
-				StorageType.cms, StorageType.processPlatform }, storeJars = { "x_processplatform_core_entity",
-						"x_organization_core_entity", "x_organization_core_express", "x_cms_core_entity","x_cms_core_express",
-						"x_query_core_entity", "x_query_core_express" })
+		"com.x.cms.core.entity.DocumentCommentContent", "com.x.cms.core.entity.DocumentCommentCommend", "com.x.portal.core.entity.Script"
+		, "com.x.processplatform.core.entity.element.Script"}, storageTypes = {
+		StorageType.cms, StorageType.processPlatform }, storeJars = { "x_processplatform_core_entity",
+		"x_organization_core_entity", "x_organization_core_express", "x_cms_core_entity","x_cms_core_express",
+		"x_query_core_entity", "x_query_core_express", "x_portal_core_entity"  })
 public class x_cms_assemble_control extends Deployable {
 public class x_cms_assemble_control extends Deployable {
 }
 }

+ 2 - 1
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/ThisApplication.java

@@ -42,7 +42,7 @@ public class ThisApplication {
 	// 执行数据库中的批处理操作
 	// 执行数据库中的批处理操作
 	public static final QueueBatchOperation queueBatchOperation = new QueueBatchOperation();
 	public static final QueueBatchOperation queueBatchOperation = new QueueBatchOperation();
 	// Document发布时,向所有阅读者推送通知
 	// Document发布时,向所有阅读者推送通知
-	public static final QueueSendDocumentNotify queueSendDocumentNotify = new QueueSendDocumentNotify();
+	public static QueueSendDocumentNotify queueSendDocumentNotify = new QueueSendDocumentNotify();
 	private static final ConcurrentHashMap<String, DataImportStatus> importStatus = new ConcurrentHashMap<>();
 	private static final ConcurrentHashMap<String, DataImportStatus> importStatus = new ConcurrentHashMap<>();
 
 
 	public static Context context() {
 	public static Context context() {
@@ -58,6 +58,7 @@ public class ThisApplication {
 		context().startQueue(queueDataRowImport);
 		context().startQueue(queueDataRowImport);
 		context().startQueue(queueDocumentUpdate);
 		context().startQueue(queueDocumentUpdate);
 		context().startQueue(queueDocumentViewCountUpdate);
 		context().startQueue(queueDocumentViewCountUpdate);
+		queueSendDocumentNotify.initFixedThreadPool(3);
 		context().startQueue(queueSendDocumentNotify);
 		context().startQueue(queueSendDocumentNotify);
 
 
 		// 每天凌晨2点执行一次
 		// 每天凌晨2点执行一次

+ 14 - 14
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishAndNotify.java

@@ -69,20 +69,20 @@ public class ActionPersistPublishAndNotify extends BaseAction {
 				modifyDocStatus( id, "published", effectivePerson.getDistinguishedName() );
 				modifyDocStatus( id, "published", effectivePerson.getDistinguishedName() );
 				document.setDocStatus("published");
 				document.setDocStatus("published");
 				document.setPublishTime(new Date());
 				document.setPublishTime(new Date());
-				
+
 				document = documentPersistService.refreshDocInfoData( document );
 				document = documentPersistService.refreshDocInfoData( document );
-				
+
 				Wo wo = new Wo();
 				Wo wo = new Wo();
 				wo.setId( document.getId() );
 				wo.setId( document.getId() );
 				result.setData( wo );
 				result.setData( wo );
-				
+
 				//检查是否需要删除热点图片
 				//检查是否需要删除热点图片
 				try {
 				try {
 					ThisApplication.queueDocumentUpdate.send( document );
 					ThisApplication.queueDocumentUpdate.send( document );
 				} catch ( Exception e1 ) {
 				} catch ( Exception e1 ) {
 					e1.printStackTrace();
 					e1.printStackTrace();
 				}
 				}
-				
+
 			} catch (Exception e) {
 			} catch (Exception e) {
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统将文档状态修改为发布状态时发生异常。Id:" + id);
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统将文档状态修改为发布状态时发生异常。Id:" + id);
 				result.error(exception);
 				result.error(exception);
@@ -186,7 +186,7 @@ public class ActionPersistPublishAndNotify extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 				logger.error(e, effectivePerson, request, null);
 			}
 			}
 		}
 		}
-		
+
 		//判断是否需要发送通知消息
 		//判断是否需要发送通知消息
 		if (check) {
 		if (check) {
 			try {
 			try {
@@ -204,7 +204,7 @@ public class ActionPersistPublishAndNotify extends BaseAction {
 //					}
 //					}
 					if( categoryInfo.getSendNotify() ){
 					if( categoryInfo.getSendNotify() ){
 						logger.info("try to add notify object to queue for document:" + document.getTitle() );
 						logger.info("try to add notify object to queue for document:" + document.getTitle() );
-						ThisApplication.queueSendDocumentNotify.send( document );
+						ThisApplication.queueSendDocumentNotify.send( document.getId() );
 					}
 					}
 				}
 				}
 			} catch (Exception e) {
 			} catch (Exception e) {
@@ -221,21 +221,21 @@ public class ActionPersistPublishAndNotify extends BaseAction {
 	}
 	}
 
 
 	public static class Wi {
 	public static class Wi {
-		
+
 		public static WrapCopier<Wi, Document> copier = WrapCopierFactory.wi( Wi.class, Document.class, null, JpaObject.FieldsUnmodify );
 		public static WrapCopier<Wi, Document> copier = WrapCopierFactory.wi( Wi.class, Document.class, null, JpaObject.FieldsUnmodify );
-		
+
 		@FieldDescribe( "文档读者." )
 		@FieldDescribe( "文档读者." )
 		private List<PermissionInfo> readerList = null;
 		private List<PermissionInfo> readerList = null;
-		
+
 		@FieldDescribe( "文档编辑者." )
 		@FieldDescribe( "文档编辑者." )
 		private List<PermissionInfo> authorList = null;
 		private List<PermissionInfo> authorList = null;
-		
+
 		@FieldDescribe( "图片列表." )
 		@FieldDescribe( "图片列表." )
 		private List<String> cloudPictures = null;
 		private List<String> cloudPictures = null;
-		
+
 		@FieldDescribe( "不修改权限(跳过权限设置,保留原来的设置)." )
 		@FieldDescribe( "不修改权限(跳过权限设置,保留原来的设置)." )
 		private Boolean skipPermission  = false;
 		private Boolean skipPermission  = false;
-		
+
 		public Boolean getSkipPermission() {
 		public Boolean getSkipPermission() {
 			return skipPermission;
 			return skipPermission;
 		}
 		}
@@ -269,8 +269,8 @@ public class ActionPersistPublishAndNotify extends BaseAction {
 		}
 		}
 
 
 	}
 	}
-	
+
 	public static class Wo extends WoId {
 	public static class Wo extends WoId {
 
 
 	}
 	}
-}
+}

+ 8 - 9
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishByWorkFlow.java

@@ -211,12 +211,11 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
 
 
 		if (check) {
 		if (check) {
 			try {
 			try {
-				JsonElement docData = XGsonBuilder.instance().toJsonTree(wi.getDocData());
 				wi.setDocStatus("published");
 				wi.setDocStatus("published");
 				if(wi.getPublishTime()==null) {
 				if(wi.getPublishTime()==null) {
 					wi.setPublishTime(new Date());
 					wi.setPublishTime(new Date());
 				}
 				}
-				document = documentPersistService.save(wi, docData);
+				document = documentPersistService.save(wi, wi.getDocData());
 			} catch (Exception e) {
 			} catch (Exception e) {
 				check = false;
 				check = false;
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统在创建文档信息时发生异常!");
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统在创建文档信息时发生异常!");
@@ -377,8 +376,8 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
 			}
 			}
 		}
 		}
 
 
-		//判断是否需要发送通知消息
-		if (check) {
+		//判断是否需要发送通知消息 后端业务接口不需要发送消息
+		/*if (check) {
 			try {
 			try {
 				Boolean notify = false;
 				Boolean notify = false;
 				if( categoryInfo.getSendNotify() == null ) {
 				if( categoryInfo.getSendNotify() == null ) {
@@ -392,7 +391,7 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
 				}
 				}
 				if( notify ){
 				if( notify ){
 					logger.info("try to add notify object to queue for document:" + document.getTitle() );
 					logger.info("try to add notify object to queue for document:" + document.getTitle() );
-					ThisApplication.queueSendDocumentNotify.send( document );
+					ThisApplication.queueSendDocumentNotify.send( document.getId() );
 				}
 				}
 			} catch (Exception e) {
 			} catch (Exception e) {
 				check = false;
 				check = false;
@@ -400,7 +399,7 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
 				result.error( exception );
 				result.error( exception );
 				logger.error( e, effectivePerson, request, null);
 				logger.error( e, effectivePerson, request, null);
 			}
 			}
-		}
+		}*/
 
 
 		CacheManager.notify(Document.class);
 		CacheManager.notify(Document.class);
 		return result;
 		return result;
@@ -464,7 +463,7 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
 		private String[] wf_attachmentIds = null;
 		private String[] wf_attachmentIds = null;
 
 
 		@FieldDescribe( "文档数据." )
 		@FieldDescribe( "文档数据." )
-		private Map<?, ?> docData = null;
+		private JsonElement docData = null;
 
 
 		@FieldDescribe( "文档读者." )
 		@FieldDescribe( "文档读者." )
 		private List<PermissionInfo> readerList = null;
 		private List<PermissionInfo> readerList = null;
@@ -521,11 +520,11 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
 			this.dataPaths = dataPaths;
 			this.dataPaths = dataPaths;
 		}
 		}
 
 
-		public Map<?, ?> getDocData() {
+		public JsonElement getDocData() {
 			return docData;
 			return docData;
 		}
 		}
 
 
-		public void setDocData(Map<?, ?> docData) {
+		public void setDocData(JsonElement docData) {
 			this.docData = docData;
 			this.docData = docData;
 		}
 		}
 
 

+ 5 - 17
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishContent.java

@@ -227,12 +227,11 @@ public class ActionPersistPublishContent extends BaseAction {
 
 
 		if (check) {
 		if (check) {
 			try {
 			try {
-				JsonElement docData = XGsonBuilder.instance().toJsonTree(wi.getDocData(), Map.class);
 				wi.setDocStatus("published");
 				wi.setDocStatus("published");
 				if( wi.getPublishTime() == null ) { wi.setPublishTime(new Date()); }
 				if( wi.getPublishTime() == null ) { wi.setPublishTime(new Date()); }
 				document =  wi.copier.copy(wi);
 				document =  wi.copier.copy(wi);
 				document.setId( wi.getId() );
 				document.setId( wi.getId() );
-				document = documentPersistService.save( document, docData );
+				document = documentPersistService.save( document, wi.getDocData() );
 			} catch (Exception e) {
 			} catch (Exception e) {
 				check = false;
 				check = false;
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统在创建文档信息时发生异常!");
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统在创建文档信息时发生异常!");
@@ -441,7 +440,7 @@ public class ActionPersistPublishContent extends BaseAction {
 				}
 				}
 				if( notify ){
 				if( notify ){
 					logger.debug("try to add notify object to queue for document:" + document.getTitle() );
 					logger.debug("try to add notify object to queue for document:" + document.getTitle() );
-					ThisApplication.queueSendDocumentNotify.send( document );
+					ThisApplication.queueSendDocumentNotify.send( document.getId() );
 				}
 				}
 			} catch (Exception e) {
 			} catch (Exception e) {
 				check = false;
 				check = false;
@@ -514,7 +513,7 @@ public class ActionPersistPublishContent extends BaseAction {
 		private String[] cms_attachmentIds = null;
 		private String[] cms_attachmentIds = null;
 
 
 		@FieldDescribe( "文档数据JSON对象." )
 		@FieldDescribe( "文档数据JSON对象." )
-		private Map<?, ?> docData = null;
+		private JsonElement docData = null;
 
 
 		@FieldDescribe( "文档读者,Json数组,权限对象需要包含四个属性:<br/>permission权限类别:读者|阅读|作者|管理,  <br/>permissionObjectType使用者类别:所有人|组织|人员|群组, <br/>permissionObjectCode使用者编码:所有人|组织编码|人员UID|群组编码, <br/>permissionObjectName使用者名称:所有人|组织名称|人员名称|群组名称" )
 		@FieldDescribe( "文档读者,Json数组,权限对象需要包含四个属性:<br/>permission权限类别:读者|阅读|作者|管理,  <br/>permissionObjectType使用者类别:所有人|组织|人员|群组, <br/>permissionObjectCode使用者编码:所有人|组织编码|人员UID|群组编码, <br/>permissionObjectName使用者名称:所有人|组织名称|人员名称|群组名称" )
 		private List<PermissionInfo> readerList = null;
 		private List<PermissionInfo> readerList = null;
@@ -1013,22 +1012,11 @@ public class ActionPersistPublishContent extends BaseAction {
 			this.readerList = readerList;
 			this.readerList = readerList;
 		}
 		}
 
 
-//		public String[] getDataPaths() {
-//			if( dataPaths != null && dataPaths.length == 1 && dataPaths[0].equals("null")){
-//				return null;
-//			}
-//			return dataPaths;
-//		}
-//
-//		public void setDataPaths(String[] dataPaths) {
-//			this.dataPaths = dataPaths;
-//		}
-
-		public Map<?, ?> getDocData() {
+		public JsonElement getDocData() {
 			return docData;
 			return docData;
 		}
 		}
 
 
-		public void setDocData(Map<?, ?> docData) {
+		public void setDocData(JsonElement docData) {
 			this.docData = docData;
 			this.docData = docData;
 		}
 		}
 
 

+ 36 - 40
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistSaveDocument.java

@@ -50,15 +50,15 @@ public class ActionPersistSaveDocument extends BaseAction {
 		try {
 		try {
 			wi = this.convertToWrapIn( jsonElement, Wi.class );
 			wi = this.convertToWrapIn( jsonElement, Wi.class );
 			document = Wi.copier.copy(wi);
 			document = Wi.copier.copy(wi);
-			document.setId( wi.getId() ); //继承传入的ID			
-			identity = wi.getIdentity();	
+			document.setId( wi.getId() ); //继承传入的ID
+			identity = wi.getIdentity();
 		} catch (Exception e ) {
 		} catch (Exception e ) {
 			check = false;
 			check = false;
 			Exception exception = new ExceptionDocumentInfoProcess( e, "系统在将JSON信息转换为对象时发生异常。");
 			Exception exception = new ExceptionDocumentInfoProcess( e, "系统在将JSON信息转换为对象时发生异常。");
 			result.error( exception );
 			result.error( exception );
 			logger.error( e, effectivePerson, request, null);
 			logger.error( e, effectivePerson, request, null);
 		}
 		}
-		
+
 		if (check) {
 		if (check) {
 			if( !"xadmin".equals( effectivePerson.getDistinguishedName() )) {
 			if( !"xadmin".equals( effectivePerson.getDistinguishedName() )) {
 				try {
 				try {
@@ -166,15 +166,15 @@ public class ActionPersistSaveDocument extends BaseAction {
 
 
 		if (check) {
 		if (check) {
 			//补充部分信息
 			//补充部分信息
-//			document.setCategoryId(categoryInfo.getId());	
-			document.setAppId(appInfo.getId());					
-			document.setDocumentType( categoryInfo.getDocumentType() );	
+//			document.setCategoryId(categoryInfo.getId());
+			document.setAppId(appInfo.getId());
+			document.setDocumentType( categoryInfo.getDocumentType() );
 			document.setAppAlias( appInfo.getAppAlias());
 			document.setAppAlias( appInfo.getAppAlias());
 			document.setAppName(appInfo.getAppName());
 			document.setAppName(appInfo.getAppName());
 			document.setCategoryName(categoryInfo.getCategoryName());
 			document.setCategoryName(categoryInfo.getCategoryName());
 			document.setCategoryAlias(categoryInfo.getCategoryAlias());
 			document.setCategoryAlias(categoryInfo.getCategoryAlias());
 			document.setDocumentType( categoryInfo.getDocumentType() );
 			document.setDocumentType( categoryInfo.getDocumentType() );
-			
+
 			if( !"信息".equals(document.getDocumentType()) && !"数据".equals( document.getDocumentType() )) {
 			if( !"信息".equals(document.getDocumentType()) && !"数据".equals( document.getDocumentType() )) {
 				document.setDocumentType( "信息" );
 				document.setDocumentType( "信息" );
 			}
 			}
@@ -184,8 +184,8 @@ public class ActionPersistSaveDocument extends BaseAction {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				if( StringUtils.isNotEmpty( identity )) {
 				if( StringUtils.isNotEmpty( identity )) {
 					document.setCreatorIdentity( identity );
 					document.setCreatorIdentity( identity );
-				}				
-				
+				}
+
 				if (StringUtils.isEmpty( document.getCreatorIdentity() )) {
 				if (StringUtils.isEmpty( document.getCreatorIdentity() )) {
 					if( "cipher".equalsIgnoreCase( effectivePerson.getDistinguishedName() )) {
 					if( "cipher".equalsIgnoreCase( effectivePerson.getDistinguishedName() )) {
 						document.setCreatorIdentity("cipher");
 						document.setCreatorIdentity("cipher");
@@ -202,7 +202,7 @@ public class ActionPersistSaveDocument extends BaseAction {
 						document.setCreatorIdentity(userManagerService.getMajorIdentityWithPerson( effectivePerson.getDistinguishedName()) );
 						document.setCreatorIdentity(userManagerService.getMajorIdentityWithPerson( effectivePerson.getDistinguishedName()) );
 					}
 					}
 				}
 				}
-				
+
 				if ( !StringUtils.equals(  "cipher", document.getCreatorIdentity() ) && !StringUtils.equals(  "xadmin", document.getCreatorIdentity() )) {
 				if ( !StringUtils.equals(  "cipher", document.getCreatorIdentity() ) && !StringUtils.equals(  "xadmin", document.getCreatorIdentity() )) {
 					//说明是指定的发布者,并不使用cipher和xadmin代替
 					//说明是指定的发布者,并不使用cipher和xadmin代替
 					if (StringUtils.isNotEmpty( document.getCreatorIdentity() )) {
 					if (StringUtils.isNotEmpty( document.getCreatorIdentity() )) {
@@ -219,7 +219,7 @@ public class ActionPersistSaveDocument extends BaseAction {
 				result.error(th);
 				result.error(th);
 			}
 			}
 		}
 		}
-		
+
 //		if (check) {
 //		if (check) {
 //			if ( StringUtils.isNotEmpty(identity)) {
 //			if ( StringUtils.isNotEmpty(identity)) {
 //				document.setCreatorIdentity( identity );
 //				document.setCreatorIdentity( identity );
@@ -267,11 +267,7 @@ public class ActionPersistSaveDocument extends BaseAction {
 
 
 		if (check) {
 		if (check) {
 			try {
 			try {
-				JsonElement dataJson = null;
-				if( wi.getDocData() != null ) {
-					dataJson = XGsonBuilder.instance().toJsonTree( wi.getDocData() );
-				}
-				document = documentPersistService.save( document, dataJson );
+				document = documentPersistService.save( document, wi.getDocData() );
 				CacheManager.notify(Document.class);
 				CacheManager.notify(Document.class);
 
 
 				Wo wo = new Wo();
 				Wo wo = new Wo();
@@ -291,7 +287,7 @@ public class ActionPersistSaveDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 				logger.error(e, effectivePerson, request, null);
 			}
 			}
 		}
 		}
-		
+
 		// 处理文档的云文档图片信息
 		// 处理文档的云文档图片信息
 		if (check) {
 		if (check) {
 			try {
 			try {
@@ -363,7 +359,7 @@ public class ActionPersistSaveDocument extends BaseAction {
 				}
 				}
 			}
 			}
 		}
 		}
-		
+
 		if (check) {
 		if (check) {
 			try {//将读者以及作者信息持久化到数据库中
 			try {//将读者以及作者信息持久化到数据库中
 				document = documentPersistService.refreshDocumentPermission( document.getId(), wi.getReaderList(), wi.getAuthorList() );
 				document = documentPersistService.refreshDocumentPermission( document.getId(), wi.getReaderList(), wi.getAuthorList() );
@@ -378,16 +374,16 @@ public class ActionPersistSaveDocument extends BaseAction {
 	}
 	}
 
 
 	public static class Wi{
 	public static class Wi{
-		
+
 		@FieldDescribe("ID,非必填,更新时必填写,不然就是新增文档")
 		@FieldDescribe("ID,非必填,更新时必填写,不然就是新增文档")
 		private String id;
 		private String id;
-		
+
 		@FieldDescribe("文档标题,<font style='color:red'>必填</font>")
 		@FieldDescribe("文档标题,<font style='color:red'>必填</font>")
 		private String title;
 		private String title;
 
 
 		@FieldDescribe("分类ID,<font style='color:red'>必填</font>")
 		@FieldDescribe("分类ID,<font style='color:red'>必填</font>")
 		private String categoryId;
 		private String categoryId;
-		
+
 		@FieldDescribe( "文档操作者身份,如果不传入则取登录者信息。" )
 		@FieldDescribe( "文档操作者身份,如果不传入则取登录者信息。" )
 		private String identity = null;
 		private String identity = null;
 
 
@@ -396,42 +392,42 @@ public class ActionPersistSaveDocument extends BaseAction {
 
 
 		@FieldDescribe("文档状态: published | draft | checking | error,非必填,默认为draft")
 		@FieldDescribe("文档状态: published | draft | checking | error,非必填,默认为draft")
 		private String docStatus = "draft";
 		private String docStatus = "draft";
-		
+
 		@FieldDescribe("文档发布时间")
 		@FieldDescribe("文档发布时间")
 		private Date publishTime;
 		private Date publishTime;
 
 
 		@FieldDescribe("首页图片列表,非必填")
 		@FieldDescribe("首页图片列表,非必填")
-		private List<String> pictureList = null;		
-		
+		private List<String> pictureList = null;
+
 		@FieldDescribe( "数据的路径列表,非必填" )
 		@FieldDescribe( "数据的路径列表,非必填" )
 		private String[] dataPaths = null;
 		private String[] dataPaths = null;
-		
+
 		@FieldDescribe( "启动流程的JobId,非必填" )
 		@FieldDescribe( "启动流程的JobId,非必填" )
 		private String wf_jobId = null;
 		private String wf_jobId = null;
-		
+
 		@FieldDescribe( "启动流程的WorkId,非必填" )
 		@FieldDescribe( "启动流程的WorkId,非必填" )
 		private String wf_workId = null;
 		private String wf_workId = null;
-		
+
 		@FieldDescribe( "启动流程的附件列表,非必填" )
 		@FieldDescribe( "启动流程的附件列表,非必填" )
-		private String[] wf_attachmentIds = null;	
-		
+		private String[] wf_attachmentIds = null;
+
 		@FieldDescribe( "文档数据,非必填" )
 		@FieldDescribe( "文档数据,非必填" )
-		private Map<?, ?> docData = null;
-		
+		private JsonElement docData = null;
+
 		@FieldDescribe( "文档读者,非必填:{'permission':'读者', 'permissionObjectType':'组织', 'permissionObjectCode':'组织全称', 'permissionObjectName':'组织全称'}" )
 		@FieldDescribe( "文档读者,非必填:{'permission':'读者', 'permissionObjectType':'组织', 'permissionObjectCode':'组织全称', 'permissionObjectName':'组织全称'}" )
 		private List<PermissionInfo> readerList = null;
 		private List<PermissionInfo> readerList = null;
-		
+
 		@FieldDescribe( "文档编辑者,非必填:{'permission':'读者', 'permissionObjectType':'组织', 'permissionObjectCode':'组织全称', 'permissionObjectName':'组织全称'}" )
 		@FieldDescribe( "文档编辑者,非必填:{'permission':'读者', 'permissionObjectType':'组织', 'permissionObjectCode':'组织全称', 'permissionObjectName':'组织全称'}" )
 		private List<PermissionInfo> authorList = null;
 		private List<PermissionInfo> authorList = null;
-		
+
 		@FieldDescribe( "图片列表,非必填" )
 		@FieldDescribe( "图片列表,非必填" )
 		private List<String> cloudPictures = null;
 		private List<String> cloudPictures = null;
-		
+
 		@FieldDescribe( "不修改权限(跳过权限设置,保留原来的设置),非必填" )
 		@FieldDescribe( "不修改权限(跳过权限设置,保留原来的设置),非必填" )
-		private Boolean skipPermission  = false;	
+		private Boolean skipPermission  = false;
 
 
 		public static WrapCopier<Wi, Document> copier = WrapCopierFactory.wi( Wi.class, Document.class, null, JpaObject.FieldsUnmodifyExcludeId);
 		public static WrapCopier<Wi, Document> copier = WrapCopierFactory.wi( Wi.class, Document.class, null, JpaObject.FieldsUnmodifyExcludeId);
-		
+
 		public String getId() {
 		public String getId() {
 			return id;
 			return id;
 		}
 		}
@@ -487,7 +483,7 @@ public class ActionPersistSaveDocument extends BaseAction {
 		public void setIdentity(String identity) {
 		public void setIdentity(String identity) {
 			this.identity = identity;
 			this.identity = identity;
 		}
 		}
-		
+
 		public List<PermissionInfo> getReaderList() {
 		public List<PermissionInfo> getReaderList() {
 			return readerList;
 			return readerList;
 		}
 		}
@@ -515,11 +511,11 @@ public class ActionPersistSaveDocument extends BaseAction {
 			this.dataPaths = dataPaths;
 			this.dataPaths = dataPaths;
 		}
 		}
 
 
-		public Map<?, ?> getDocData() {
+		public JsonElement getDocData() {
 			return docData;
 			return docData;
 		}
 		}
 
 
-		public void setDocData(Map<?, ?> docData) {
+		public void setDocData(JsonElement docData) {
 			this.docData = docData;
 			this.docData = docData;
 		}
 		}
 
 
@@ -575,4 +571,4 @@ public class ActionPersistSaveDocument extends BaseAction {
 	public static class Wo extends WoId {
 	public static class Wo extends WoId {
 
 
 	}
 	}
-}
+}

+ 53 - 53
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/queue/QueueSendDocumentNotify.java

@@ -25,72 +25,72 @@ import java.util.List;
 /**
 /**
  * Document正式发布后,向所有的阅读者推送消息通知
  * Document正式发布后,向所有的阅读者推送消息通知
  */
  */
-public class QueueSendDocumentNotify extends AbstractQueue<Document> {
-	
+public class QueueSendDocumentNotify extends AbstractQueue<String> {
+
 	private static  Logger logger = LoggerFactory.getLogger( QueueSendDocumentNotify.class );
 	private static  Logger logger = LoggerFactory.getLogger( QueueSendDocumentNotify.class );
 	private UserManagerService userManagerService = new UserManagerService();
 	private UserManagerService userManagerService = new UserManagerService();
 
 
-	public void execute( Document document ) throws Exception {
-		logger.debug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>QueueSendDocumentNotify:" + document.getTitle() );
-		if( document == null ) {
+	public void execute( String documentId ) throws Exception {
+		logger.debug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>start QueueSendDocumentNotify:" + documentId );
+		if( StringUtils.isEmpty(documentId) ) {
 			logger.debug("can not send publish notify , document is NULL!" );
 			logger.debug("can not send publish notify , document is NULL!" );
 			return;
 			return;
 		}
 		}
-		if( !StringUtils.equalsIgnoreCase( "信息" , document.getDocumentType()) ) {
-			logger.debug("can not send publish notify , document is not '信息'!" );
-			return;
-		}
-		logger.debug("send publish notify for new document:" + document.getTitle() );
+		List<String> persons = null;
+		Document document = null;
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			AppInfo appInfo = emc.find( document.getAppId(), AppInfo.class );
-			CategoryInfo category = emc.find( document.getCategoryId(), CategoryInfo.class );
-
-			if( appInfo != null && category != null ) {
-				ReviewService reviewService = new ReviewService();
-				List<String> persons = reviewService.listPermissionPersons( appInfo, category, document );
-				if( ListTools.isNotEmpty( persons )) {
-					//有可能是*, 一般是所有的人员标识列表
-					if( persons.contains( "*" )) {
-						String topUnitName = document.getCreatorTopUnitName();
-						logger.debug(">>>>>document.getCreatorTopUnitName()=" + topUnitName );
-						if( StringUtils.equalsAnyIgnoreCase("cipher",topUnitName ) || StringUtils.equalsAnyIgnoreCase("xadmin", topUnitName) ){
-							//取发起人所有顶层组织
-							if( !StringUtils.equalsAnyIgnoreCase("cipher",document.getCreatorIdentity() ) &&
-								!StringUtils.equalsAnyIgnoreCase("xadmin",document.getCreatorIdentity() )){
-								topUnitName = userManagerService.getTopUnitNameByIdentity(document.getCreatorIdentity());
-							}else if(!StringUtils.equalsAnyIgnoreCase("cipher",document.getCreatorPerson() ) &&
-									!StringUtils.equalsAnyIgnoreCase("xadmin",document.getCreatorPerson() )){
-								topUnitName = userManagerService.getTopUnitNameWithPerson(document.getCreatorPerson());
+			document = emc.find(documentId, Document.class);
+			if(document !=null && StringUtils.equals( "信息" , document.getDocumentType())) {
+				logger.debug("send publish notify for new document:" + document.getTitle() );
+				AppInfo appInfo = emc.find(document.getAppId(), AppInfo.class);
+				CategoryInfo category = emc.find(document.getCategoryId(), CategoryInfo.class);
+
+				if (appInfo != null && category != null) {
+					ReviewService reviewService = new ReviewService();
+					persons = reviewService.listPermissionPersons(appInfo, category, document);
+					if (ListTools.isNotEmpty(persons)) {
+						//有可能是*, 一般是所有的人员标识列表
+						if (persons.contains("*")) {
+							String topUnitName = document.getCreatorTopUnitName();
+							logger.debug(">>>>>document.getCreatorTopUnitName()=" + topUnitName);
+							if (StringUtils.equalsAnyIgnoreCase("cipher", topUnitName) || StringUtils.equalsAnyIgnoreCase("xadmin", topUnitName)) {
+								//取发起人所有顶层组织
+								if (!StringUtils.equalsAnyIgnoreCase("cipher", document.getCreatorIdentity()) &&
+										!StringUtils.equalsAnyIgnoreCase("xadmin", document.getCreatorIdentity())) {
+									topUnitName = userManagerService.getTopUnitNameByIdentity(document.getCreatorIdentity());
+								} else if (!StringUtils.equalsAnyIgnoreCase("cipher", document.getCreatorPerson()) &&
+										!StringUtils.equalsAnyIgnoreCase("xadmin", document.getCreatorPerson())) {
+									topUnitName = userManagerService.getTopUnitNameWithPerson(document.getCreatorPerson());
+								}
+							}
+							if (StringUtils.isNotEmpty(topUnitName)) {
+								//取顶层组织的所有人
+								persons = listPersonWithUnit(topUnitName);
+							} else {
+								persons = new ArrayList<>();
 							}
 							}
-						}
-						if( StringUtils.isNotEmpty( topUnitName )){
-							//取顶层组织的所有人
-							persons = listPersonWithUnit( topUnitName );
-						}else{
-							persons = new ArrayList<>();
 						}
 						}
 					}
 					}
+				} else {
+					logger.debug("can not send publish notify for document, category or  appinfo not exists! ID: " + document.getId());
 				}
 				}
-				if( ListTools.isNotEmpty( persons )) {
-					//去一下重复
-			        HashSet<String> set = new HashSet<String>( persons );
-			        persons.clear();
-			        persons.addAll(set);
-			        
-					MessageWo wo = MessageWo.copier.copy(document);
-					for( String person : persons ) {
-						if( !StringUtils.equals( "*", person  )) {
-							MessageFactory.cms_publish(person, wo);
-						}
-					}
-					logger.debug("cms send total count:" + persons.size()  );
+			}
+		}
+		if( ListTools.isNotEmpty( persons )) {
+			//去一下重复
+			HashSet<String> set = new HashSet<String>( persons );
+			persons.clear();
+			persons.addAll(set);
+
+			MessageWo wo = MessageWo.copier.copy(document);
+			for( String person : persons ) {
+				if( !StringUtils.equals( "*", person  )) {
+					MessageFactory.cms_publish(person, wo);
 				}
 				}
-				logger.debug("cms send publish notify for new document completed! " );
-				//}
-			}else{
-				logger.debug("can not send publish notify for document, category or  appinfo not exists! ID: " + document.getId() );
 			}
 			}
+			logger.debug(documentId +" cms send total count:" + persons.size()  );
 		}
 		}
+		logger.debug(documentId + " QueueSendDocumentNotify cms send publish notify for new document completed! " );
 	}
 	}
 
 
 	/**
 	/**
@@ -108,7 +108,7 @@ public class QueueSendDocumentNotify extends AbstractQueue<Document> {
 		}
 		}
 		return persons;
 		return persons;
 	}
 	}
-	
+
 	public static class MessageWo{
 	public static class MessageWo{
 
 
 		public static List<String> Excludes = new ArrayList<String>();
 		public static List<String> Excludes = new ArrayList<String>();

+ 209 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionUploadWithUrl.java

@@ -0,0 +1,209 @@
+package com.x.processplatform.assemble.surface.jaxrs.attachment;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.entity.annotation.CheckPersistType;
+import com.x.base.core.project.annotation.FieldDescribe;
+import com.x.base.core.project.config.Config;
+import com.x.base.core.project.config.StorageMapping;
+import com.x.base.core.project.connection.CipherConnectionAction;
+import com.x.base.core.project.connection.ConnectionAction;
+import com.x.base.core.project.exception.ExceptionAccessDenied;
+import com.x.base.core.project.exception.ExceptionEntityFieldEmpty;
+import com.x.base.core.project.exception.ExceptionEntityNotExist;
+import com.x.base.core.project.gson.GsonPropertyObject;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WoId;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.organization.Person;
+import com.x.base.core.project.tools.ExtractTextTools;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.assemble.surface.ThisApplication;
+import com.x.processplatform.assemble.surface.WorkControl;
+import com.x.processplatform.core.entity.content.Attachment;
+import com.x.processplatform.core.entity.content.Work;
+import com.x.processplatform.core.entity.content.WorkCompleted;
+import com.x.processplatform.core.entity.element.ActivityType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.tika.Tika;
+
+class ActionUploadWithUrl extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionUploadWithUrl.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			logger.debug("ActionUploadWithUrl receive:{}.", jsonElement.toString());
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+			if(StringUtils.isEmpty(wi.getWorkId())){
+				throw new ExceptionEntityFieldEmpty(Work.class, wi.getWorkId());
+			}
+			if(StringUtils.isEmpty(wi.getFileName())){
+				throw new ExceptionEntityFieldEmpty(Attachment.class, wi.getFileName());
+			}
+			if(StringUtils.isEmpty(wi.getFileUrl())){
+				throw new ExceptionEntityFieldEmpty(Attachment.class, wi.getFileUrl());
+			}
+			if(StringUtils.isEmpty(wi.getSite())){
+				throw new ExceptionEntityFieldEmpty(Attachment.class, wi.getSite());
+			}
+			if (!business.readableWithWorkOrWorkCompleted(effectivePerson, wi.getWorkId(),
+					new ExceptionEntityNotExist(wi.getWorkId()))) {
+				throw new ExceptionAccessDenied(effectivePerson, wi.getWorkId());
+			}
+			String person = effectivePerson.getDistinguishedName();
+			if(StringUtils.isNotEmpty(wi.getPerson()) && business.canManageApplication(effectivePerson, null)){
+				Person p = business.organization().person().getObject(wi.getPerson());
+				if(p!=null){
+					person = p.getDistinguishedName();
+				}
+			}
+			Attachment attachment = null;
+			/* 后面要重新保存 */
+			Work work = emc.find(wi.getWorkId(), Work.class);
+			/** 判断work是否存在 */
+			if (null == work) {
+				WorkCompleted workCompleted = emc.find(wi.getWorkId(), WorkCompleted.class);
+				if(workCompleted!=null){
+					attachment = this.concreteAttachment(workCompleted, person, wi.getSite());
+				}
+			}else{
+				attachment = this.concreteAttachment(work, person, wi.getSite());
+			}
+			if(attachment==null){
+				new ExceptionEntityNotExist(wi.getWorkId());
+			}
+			byte[] bytes = CipherConnectionAction.getBinary(false, wi.getFileUrl());
+			if(bytes==null || bytes.length==0){
+				throw new Exception("can not down file from url!");
+			}
+			String fileName = wi.getFileName();
+			if (StringUtils.isEmpty(fileName)) {
+				throw new Exception("fileName can not empty!");
+			}
+			StorageMapping mapping = ThisApplication.context().storageMappings().random(Attachment.class);
+			attachment.saveContent(mapping, bytes, fileName);
+			attachment.setType((new Tika()).detect(bytes, fileName));
+			if (Config.query().getExtractImage() && ExtractTextTools.supportImage(attachment.getName())
+					&& ExtractTextTools.available(bytes)) {
+				attachment.setText(ExtractTextTools.image(bytes));
+			}
+			emc.beginTransaction(Attachment.class);
+			emc.persist(attachment, CheckPersistType.all);
+			emc.commit();
+			Wo wo = new Wo();
+			wo.setId(attachment.getId());
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	private Attachment concreteAttachment(Work work, String person, String site) throws Exception {
+		Attachment attachment = new Attachment();
+		attachment.setCompleted(false);
+		attachment.setPerson(person);
+		attachment.setLastUpdatePerson(person);
+		attachment.setSite(site);
+		/** 用于判断目录的值 */
+		attachment.setWorkCreateTime(work.getCreateTime());
+		attachment.setApplication(work.getApplication());
+		attachment.setProcess(work.getProcess());
+		attachment.setJob(work.getJob());
+		attachment.setActivity(work.getActivity());
+		attachment.setActivityName(work.getActivityName());
+		attachment.setActivityToken(work.getActivityToken());
+		attachment.setActivityType(work.getActivityType());
+		return attachment;
+	}
+
+	private Attachment concreteAttachment(WorkCompleted workCompleted, String person, String site) throws Exception {
+		Attachment attachment = new Attachment();
+		attachment.setCompleted(true);
+		attachment.setPerson(person);
+		attachment.setLastUpdatePerson(person);
+		attachment.setSite(site);
+		/** 用于判断目录的值 */
+		attachment.setWorkCreateTime(workCompleted.getStartTime());
+		attachment.setApplication(workCompleted.getApplication());
+		attachment.setProcess(workCompleted.getProcess());
+		attachment.setJob(workCompleted.getJob());
+		attachment.setActivity(workCompleted.getActivity());
+		attachment.setActivityName(workCompleted.getActivityName());
+		attachment.setActivityToken(workCompleted.getActivity());
+		attachment.setActivityType(ActivityType.end);
+		return attachment;
+	}
+
+	public static class Wi extends GsonPropertyObject {
+
+		private static final long serialVersionUID = 6675218812025672288L;
+
+		@FieldDescribe("*Work或WorkCompleted的id.")
+		private String workId;
+
+		@FieldDescribe("*文件名称,带扩展名的文件名.")
+		private String fileName;
+
+		@FieldDescribe("*附件来源url地址.")
+		private String fileUrl;
+
+		@FieldDescribe("*附件分类.")
+		private String site;
+
+		@FieldDescribe("上传人员(仅对管理员生效).")
+		private String person;
+
+		public String getFileName() {
+			return fileName;
+		}
+
+		public void setFileName(String fileName) {
+			this.fileName = fileName;
+		}
+
+		public String getWorkId() {
+			return workId;
+		}
+
+		public void setWorkId(String workId) {
+			this.workId = workId;
+		}
+
+		public String getFileUrl() {
+			return fileUrl;
+		}
+
+		public void setFileUrl(String fileUrl) {
+			this.fileUrl = fileUrl;
+		}
+
+		public String getSite() {
+			return site;
+		}
+
+		public void setSite(String site) {
+			this.site = site;
+		}
+
+		public String getPerson() {
+			return person;
+		}
+
+		public void setPerson(String person) {
+			this.person = person;
+		}
+	}
+
+	public static class Wo extends WoId {
+
+	}
+
+	public static class WoControl extends WorkControl {
+	}
+
+}

+ 18 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java

@@ -1197,4 +1197,22 @@ public class AttachmentAction extends StandardJaxrsAction {
 		}
 		}
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 	}
+
+	@JaxrsMethodDescribe(value = "上传附件", action = ActionUploadWithUrl.class)
+	@POST
+	@Path("upload/with/url")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void uploadWithUrl(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+						  JsonElement jsonElement) {
+		ActionResult<ActionUploadWithUrl.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionUploadWithUrl().execute(effectivePerson, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
 }
 }

+ 1 - 1
o2web/source/x_component_query_StatementDesigner/Statement.js

@@ -286,7 +286,7 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
     loadJpqlTypeSelect : function(){
     loadJpqlTypeSelect : function(){
       this.jpqlTypeSelect.empty();
       this.jpqlTypeSelect.empty();
       var optionList = [{text:"SELECT", value:"select"}];
       var optionList = [{text:"SELECT", value:"select"}];
-      if( this.data.entityCategory === "dynamic" ){
+        if( this.data.entityCategory === "dynamic" || this.data.description.indexOf("update")>-1){
           optionList = optionList.concat([
           optionList = optionList.concat([
               {text:"UPDATE", value:"update"},
               {text:"UPDATE", value:"update"},
               {text:"DELETE", value:"delete"}
               {text:"DELETE", value:"delete"}