Просмотр исходного кода

修正form的获取路径,产生一个cacheTag用于标识路径

zhourui 5 лет назад
Родитель
Сommit
e751516ab8
18 измененных файлов с 280 добавлено и 451 удалено
  1. 20 6
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/ResponseFactory.java
  2. 0 16
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WoFastETag.java
  3. 1 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WoFile.java
  4. 28 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WoMaxAgeFastETag.java
  5. 1 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WoText.java
  6. 23 25
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/script/ActionUpdate.java
  7. 4 1
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionEdit.java
  8. 1 0
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/script/ActionEdit.java
  9. 2 2
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGet.java
  10. 2 3
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetMobile.java
  11. 2 3
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithApplication.java
  12. 2 6
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithApplicationMobile.java
  13. 0 164
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompleted.java
  14. 0 162
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompletedMobile.java
  15. 2 2
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/BaseAction.java
  16. 0 38
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/FormAction.java
  17. 95 9
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompleted.java
  18. 97 11
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java

+ 20 - 6
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/ResponseFactory.java

@@ -125,11 +125,18 @@ public class ResponseFactory {
 				}
 			} else {
 				// default
-				EntityTag tag = new EntityTag(etagDefault(result.getData()));
-				if (notModified(request, tag)) {
-					return Response.notModified().tag(tag).build();
+				Integer maxAge = maxAgeDefault(result.getData());
+				if (null != maxAge) {
+					CacheControl cacheControl = new CacheControl();
+					cacheControl.setMaxAge(3600 * 4);
+					return Response.ok(result.toJson()).cacheControl(cacheControl).build();
+				} else {
+					EntityTag tag = new EntityTag(etagDefault(result.getData()));
+					if (notModified(request, tag)) {
+						return Response.notModified().tag(tag).build();
+					}
+					return Response.ok(result.toJson()).tag(tag).build();
 				}
-				return Response.ok(result.toJson()).tag(tag).build();
 			}
 		}
 	}
@@ -172,8 +179,8 @@ public class ResponseFactory {
 
 	private static String etagDefault(Object o) {
 		CRC32 crc = new CRC32();
-		if (o instanceof WoFastETag) {
-			WoFastETag fast = ((WoFastETag) o);
+		if (o instanceof WoMaxAgeFastETag) {
+			WoMaxAgeFastETag fast = ((WoMaxAgeFastETag) o);
 			if (StringUtils.isNotEmpty(fast.getFastETag())) {
 				crc.update(fast.getFastETag().getBytes(DefaultCharset.charset_utf_8));
 			} else {
@@ -185,6 +192,13 @@ public class ResponseFactory {
 		return crc.getValue() + "";
 	}
 
+	private static Integer maxAgeDefault(Object o) {
+		if (o instanceof WoMaxAgeFastETag) {
+			return ((WoMaxAgeFastETag) o).getMaxAge();
+		}
+		return null;
+	}
+
 	private static String callback(WoCallback woCallback) {
 		ActionResult<Object> result = new ActionResult<>();
 		result.setData(woCallback.getObject());

+ 0 - 16
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WoFastETag.java

@@ -1,16 +0,0 @@
-package com.x.base.core.project.jaxrs;
-
-import com.x.base.core.project.gson.GsonPropertyObject;
-
-public class WoFastETag extends GsonPropertyObject {
-
-	private String fastETag;
-
-	public String getFastETag() {
-		return fastETag;
-	}
-
-	public void setFastETag(String fastETag) {
-		this.fastETag = fastETag;
-	}
-}

+ 1 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WoFile.java

@@ -2,7 +2,7 @@ package com.x.base.core.project.jaxrs;
 
 import com.x.base.core.project.annotation.FieldDescribe;
 
-public abstract class WoFile extends WoFastETag {
+public abstract class WoFile extends WoMaxAgeFastETag {
 
 	private static final long serialVersionUID = -4566232046358204025L;
 	@FieldDescribe("说明")

+ 28 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WoMaxAgeFastETag.java

@@ -0,0 +1,28 @@
+package com.x.base.core.project.jaxrs;
+
+import com.x.base.core.project.gson.GsonPropertyObject;
+
+public class WoMaxAgeFastETag extends GsonPropertyObject {
+
+	private static final long serialVersionUID = -8408799363043605326L;
+
+	private String fastETag;
+
+	private Integer maxAge = null;
+
+	public String getFastETag() {
+		return fastETag;
+	}
+
+	public void setFastETag(String fastETag) {
+		this.fastETag = fastETag;
+	}
+
+	public Integer getMaxAge() {
+		return maxAge;
+	}
+
+	public void setMaxAge(Integer maxAge) {
+		this.maxAge = maxAge;
+	}
+}

+ 1 - 2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WoText.java

@@ -3,10 +3,9 @@ package com.x.base.core.project.jaxrs;
 import org.apache.commons.lang3.StringUtils;
 
 import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.HttpMediaType;
 
-public class WoText extends WoFastETag {
+public class WoText extends WoMaxAgeFastETag {
 
 	public WoText() {
 	}

+ 23 - 25
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/script/ActionUpdate.java

@@ -8,7 +8,6 @@ import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.JpaObject;
 import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.cache.CacheManager;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.ActionResult;
@@ -18,22 +17,21 @@ import com.x.cms.assemble.control.ExceptionWrapInConvert;
 import com.x.cms.core.entity.Log;
 import com.x.cms.core.entity.element.Script;
 
-
 class ActionUpdate extends BaseAction {
-	ActionResult<Wo> execute( EffectivePerson effectivePerson, String id, JsonElement jsonElement ) throws Exception {
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
 		Wi wrapIn = null;
 		Boolean check = true;
-		
+
 		try {
-			wrapIn = this.convertToWrapIn( jsonElement, Wi.class );
-		} catch (Exception e ) {
+			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
+		} catch (Exception e) {
 			check = false;
-			Exception exception = new ExceptionWrapInConvert( e, jsonElement );
-			result.error( exception );
+			Exception exception = new ExceptionWrapInConvert(e, jsonElement);
+			result.error(exception);
 			e.printStackTrace();
 		}
-		if( check ){
+		if (check) {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Script script = emc.find(id, Script.class);
 				if (null == script) {
@@ -41,19 +39,19 @@ class ActionUpdate extends BaseAction {
 				}
 				emc.beginTransaction(Script.class);
 				wrapIn.copyTo(script, JpaObject.ID_DISTRIBUTEFACTOR);
-				script.setLastUpdatePerson( effectivePerson.getDistinguishedName());
+				script.setLastUpdatePerson(effectivePerson.getDistinguishedName());
 				script.setLastUpdateTime(new Date());
 				emc.commit();
 				// 清除所有的Script缓存
 				CacheManager.notify(Script.class);
-
 				// 记录日志
 				emc.beginTransaction(Log.class);
-				logService.log(emc, effectivePerson.getDistinguishedName(), script.getName(), script.getAppId(), "", "", script.getId(), "SCRIPT", "更新");
+				logService.log(emc, effectivePerson.getDistinguishedName(), script.getName(), script.getAppId(), "", "",
+						script.getId(), "SCRIPT", "更新");
 				emc.commit();
-				
+
 				Wo wo = new Wo();
-				wo.setId( script.getId() );
+				wo.setId(script.getId());
 				result.setData(wo);
 			} catch (Throwable th) {
 				th.printStackTrace();
@@ -62,36 +60,36 @@ class ActionUpdate extends BaseAction {
 		}
 		return result;
 	}
-	
+
 	public class Wi extends GsonPropertyObject {
 
 		@FieldDescribe("创建时间.")
 		private Date createTime;
-		
+
 		@FieldDescribe("更新时间.")
 		private Date updateTime;
-		
+
 		@FieldDescribe("ID.")
 		private String id;
-		
+
 		@FieldDescribe("脚本名称.")
 		private String name;
-		
+
 		@FieldDescribe("脚本别名.")
 		private String alias;
-		
+
 		@FieldDescribe("脚本说明.")
 		private String description;
-		
+
 		@FieldDescribe("是否验证成功.")
 		private Boolean validated;
-		
+
 		@FieldDescribe("所属栏目ID.")
 		private String appId;
-		
+
 		@FieldDescribe("脚本内容.")
 		private String text;
-		
+
 		@FieldDescribe("依赖的脚本ID列表.")
 		private List<String> dependScriptList;
 
@@ -176,7 +174,7 @@ class ActionUpdate extends BaseAction {
 		}
 
 	}
-	
+
 	public static class Wo extends WoId {
 
 	}

+ 4 - 1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionEdit.java

@@ -2,6 +2,8 @@ package com.x.portal.assemble.designer.jaxrs.script;
 
 import java.util.Date;
 
+import org.apache.commons.text.StringEscapeUtils;
+
 import com.google.gson.JsonElement;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
@@ -16,9 +18,10 @@ import com.x.base.core.project.jaxrs.WoId;
 import com.x.portal.assemble.designer.Business;
 import com.x.portal.core.entity.Portal;
 import com.x.portal.core.entity.Script;
+import com.x.processplatform.core.entity.element.Form;
 
 class ActionEdit extends BaseAction {
-	
+
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {

+ 1 - 0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/script/ActionEdit.java

@@ -16,6 +16,7 @@ import com.x.base.core.project.jaxrs.WoId;
 import com.x.processplatform.assemble.designer.Business;
 import com.x.processplatform.assemble.designer.ThisApplication;
 import com.x.processplatform.core.entity.element.Application;
+import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.Script;
 import com.x.processplatform.core.entity.element.ScriptVersion;
 

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

@@ -5,7 +5,7 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.project.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WoFastETag;
+import com.x.base.core.project.jaxrs.WoMaxAgeFastETag;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.element.Form;
 
@@ -27,7 +27,7 @@ class ActionGet extends BaseAction {
 		}
 	}
 
-	public static class Wo extends WoFastETag {
+	public static class Wo extends WoMaxAgeFastETag {
 
 		private String data;
 

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

@@ -3,10 +3,9 @@ package com.x.processplatform.assemble.surface.jaxrs.form;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 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.WoFastETag;
+import com.x.base.core.project.jaxrs.WoMaxAgeFastETag;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.element.Form;
 
@@ -28,7 +27,7 @@ class ActionGetMobile extends BaseAction {
 		}
 	}
 
-	public static class Wo extends WoFastETag {
+	public static class Wo extends WoMaxAgeFastETag {
 
 		private String data;
 

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

@@ -3,10 +3,9 @@ package com.x.processplatform.assemble.surface.jaxrs.form;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 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.WoFastETag;
+import com.x.base.core.project.jaxrs.WoMaxAgeFastETag;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.element.Application;
 import com.x.processplatform.core.entity.element.Form;
@@ -30,7 +29,7 @@ class ActionGetWithApplication extends BaseAction {
 		}
 	}
 
-	public static class Wo extends WoFastETag {
+	public static class Wo extends WoMaxAgeFastETag {
 
 		private String data;
 

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

@@ -2,14 +2,10 @@ package com.x.processplatform.assemble.surface.jaxrs.form;
 
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
 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.WoFastETag;
+import com.x.base.core.project.jaxrs.WoMaxAgeFastETag;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.element.Application;
 import com.x.processplatform.core.entity.element.Form;
@@ -33,7 +29,7 @@ class ActionGetWithApplicationMobile extends BaseAction {
 		}
 	}
 
-	public static class Wo extends WoFastETag {
+	public static class Wo extends WoMaxAgeFastETag {
 
 		private String data;
 

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

@@ -1,164 +0,0 @@
-//package com.x.processplatform.assemble.surface.jaxrs.form;
-//
-//import java.util.Map.Entry;
-//import java.util.concurrent.CompletableFuture;
-//
-//import org.apache.commons.lang3.BooleanUtils;
-//import org.apache.commons.lang3.StringUtils;
-//
-//import com.x.base.core.container.EntityManagerContainer;
-//import com.x.base.core.container.factory.EntityManagerContainerFactory;
-//import com.x.base.core.project.exception.ExceptionAccessDenied;
-//import com.x.base.core.project.exception.ExceptionEntityNotExist;
-//import com.x.base.core.project.http.ActionResult;
-//import com.x.base.core.project.http.EffectivePerson;
-//import com.x.base.core.project.logger.Logger;
-//import com.x.base.core.project.logger.LoggerFactory;
-//import com.x.base.core.project.tools.DateTools;
-//import com.x.base.core.project.tools.PropertyTools;
-//import com.x.processplatform.assemble.surface.Business;
-//import com.x.processplatform.core.entity.content.Work;
-//import com.x.processplatform.core.entity.content.WorkCompleted;
-//import com.x.processplatform.core.entity.content.WorkCompletedProperties;
-//import com.x.processplatform.core.entity.element.Activity;
-//import com.x.processplatform.core.entity.element.Form;
-//import com.x.processplatform.core.entity.element.Script;
-//
-//class ActionGetWithWorkOrWorkCompleted extends BaseAction {
-//
-//	private static Logger logger = LoggerFactory.getLogger(ActionGetWithWorkOrWorkCompleted.class);
-//
-//	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
-//		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-//			ActionResult<Wo> result = new ActionResult<>();
-//			Business business = new Business(emc);
-//
-//			CompletableFuture<Wo> _wo = CompletableFuture.supplyAsync(() -> {
-//				Wo wo = null;
-//				try {
-//					Work work = emc.find(workOrWorkCompleted, Work.class);
-//					if (null != work) {
-//						wo = this.work(business, work);
-//					} else {
-//						wo = this.workCompleted(business, emc.flag(workOrWorkCompleted, WorkCompleted.class));
-//					}
-//				} catch (Exception e) {
-//					logger.error(e);
-//				}
-//				return wo;
-//			});
-//
-//			CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
-//				Boolean value = false;
-//				try {
-//					value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-//							new ExceptionEntityNotExist(workOrWorkCompleted));
-//				} catch (Exception e) {
-//					logger.error(e);
-//				}
-//				return value;
-//			});
-//
-//			if (BooleanUtils.isFalse(_control.get())) {
-//				throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
-//			}
-//
-//			result.setData(_wo.get());
-//			return result;
-//		}
-//	}
-//
-//	private Wo work(Business business, Work work) throws Exception {
-//		Wo wo = new Wo();
-//		String id = work.getForm();
-//		if (StringUtils.isEmpty(id)) {
-//			Activity activity = business.getActivity(work);
-//			id = PropertyTools.getOrElse(activity, Activity.form_FIELDNAME, String.class, "");
-//		}
-//		if (StringUtils.isNotEmpty(id)) {
-//			Form form = business.form().pick(id);
-//			if (null != form) {
-//				wo.setForm(toWoFormDataOrMobileData(form));
-//				wo.setFastETag(DateTools.format(form.getUpdateTime()) + form.getId());
-//				related(business, wo, form);
-//			}
-//		}
-//		return wo;
-//	}
-//
-//	private Wo workCompleted(Business business, WorkCompleted workCompleted) throws Exception {
-//		Wo wo = new Wo();
-//		// 先使用当前库的表单,如果不存在使用储存的表单.
-//		if (StringUtils.isNotEmpty(workCompleted.getForm())) {
-//			Form form = business.form().pick(workCompleted.getForm());
-//			if (null != form) {
-//				wo.setForm(toWoFormDataOrMobileData(form));
-//				wo.setFastETag(DateTools.format(form.getUpdateTime()) + form.getId());
-//				related(business, wo, form);
-//			}
-//		} else if (null != workCompleted.getProperties().getForm()) {
-//			wo.setForm(toWoFormDataOrMobileData(workCompleted.getProperties().getForm()));
-//			if (StringUtils.isNotBlank(workCompleted.getProperties().getForm().getData())) {
-//				workCompleted.getProperties().getRelatedFormList()
-//						.forEach(o -> wo.getRelatedFormMap().put(o.getId(), toWoFormDataOrMobileData(o)));
-//			} else {
-//				workCompleted.getProperties().getMobileRelatedFormList()
-//						.forEach(o -> wo.getRelatedFormMap().put(o.getId(), toWoFormMobileDataOrData(o)));
-//			}
-//		}
-//		workCompleted.getProperties().getRelatedScriptList().stream()
-//				.forEach(o -> wo.getRelatedScriptMap().put(o.getId(), toWoScript(o)));
-//		return wo;
-//	}
-//
-//	private void related(Business business, Wo wo, Form form) throws Exception {
-//		if (StringUtils.isNotBlank(form.getData())) {
-//			for (String relatedFormId : form.getProperties().getRelatedFormList()) {
-//				Form relatedForm = business.form().pick(relatedFormId);
-//				if (null != relatedForm) {
-//					wo.getRelatedFormMap().put(relatedFormId, toWoFormDataOrMobileData(relatedForm));
-//				}
-//			}
-//		} else {
-//			for (String mobileRelatedFormId : form.getProperties().getMobileRelatedFormList()) {
-//				Form mobileRelatedForm = business.form().pick(mobileRelatedFormId);
-//				if (null != mobileRelatedForm) {
-//					wo.getRelatedFormMap().put(mobileRelatedFormId, toWoFormMobileDataOrData(mobileRelatedForm));
-//				}
-//			}
-//		}
-//		relatedScript(business, wo, form);
-//	}
-//
-//	protected void relatedScript(Business business, AbstractWo wo, Form form) throws Exception {
-//		for (Entry<String, String> entry : form.getProperties().getRelatedScriptMap().entrySet()) {
-//			switch (entry.getValue()) {
-//			case WorkCompletedProperties.Script.TYPE_PROCESSPLATFORM:
-//				Script relatedScript = business.script().pick(entry.getKey());
-//				if (null != relatedScript) {
-//					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedScript));
-//				}
-//				break;
-//			case WorkCompletedProperties.Script.TYPE_CMS:
-//				com.x.cms.core.entity.element.Script relatedCmsScript = business.cms().script().pick(entry.getKey());
-//				if (null != relatedCmsScript) {
-//					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedCmsScript));
-//				}
-//				break;
-//			case WorkCompletedProperties.Script.TYPE_PORTAL:
-//				com.x.portal.core.entity.Script relatedPortalScript = business.portal().script().pick(entry.getKey());
-//				if (null != relatedPortalScript) {
-//					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedPortalScript));
-//				}
-//				break;
-//			default:
-//				break;
-//			}
-//		}
-//	}
-//
-//	public static class Wo extends AbstractWo {
-//
-//	}
-//
-//}

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

@@ -1,162 +0,0 @@
-//package com.x.processplatform.assemble.surface.jaxrs.form;
-//
-//import java.util.Map.Entry;
-//import java.util.concurrent.CompletableFuture;
-//
-//import org.apache.commons.lang3.BooleanUtils;
-//import org.apache.commons.lang3.StringUtils;
-//
-//import com.x.base.core.container.EntityManagerContainer;
-//import com.x.base.core.container.factory.EntityManagerContainerFactory;
-//import com.x.base.core.project.exception.ExceptionAccessDenied;
-//import com.x.base.core.project.exception.ExceptionEntityNotExist;
-//import com.x.base.core.project.http.ActionResult;
-//import com.x.base.core.project.http.EffectivePerson;
-//import com.x.base.core.project.logger.Logger;
-//import com.x.base.core.project.logger.LoggerFactory;
-//import com.x.base.core.project.tools.PropertyTools;
-//import com.x.processplatform.assemble.surface.Business;
-//import com.x.processplatform.core.entity.content.Work;
-//import com.x.processplatform.core.entity.content.WorkCompleted;
-//import com.x.processplatform.core.entity.content.WorkCompletedProperties;
-//import com.x.processplatform.core.entity.element.Activity;
-//import com.x.processplatform.core.entity.element.Form;
-//import com.x.processplatform.core.entity.element.Script;
-//
-//class ActionGetWithWorkOrWorkCompletedMobile extends BaseAction {
-//
-//	private static Logger logger = LoggerFactory.getLogger(ActionGetWithWorkOrWorkCompletedMobile.class);
-//
-//	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
-//		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-//			ActionResult<Wo> result = new ActionResult<>();
-//
-//			Business business = new Business(emc);
-//
-//			CompletableFuture<Wo> _wo = CompletableFuture.supplyAsync(() -> {
-//				Wo wo = null;
-//				try {
-//					Work work = emc.find(workOrWorkCompleted, Work.class);
-//					if (null != work) {
-//						wo = this.work(business, work);
-//					} else {
-//						wo = this.workCompleted(business, emc.flag(workOrWorkCompleted, WorkCompleted.class));
-//					}
-//				} catch (Exception e) {
-//					logger.error(e);
-//				}
-//				return wo;
-//			});
-//
-//			CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
-//				Boolean value = false;
-//				try {
-//					value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-//							new ExceptionEntityNotExist(workOrWorkCompleted));
-//				} catch (Exception e) {
-//					logger.error(e);
-//				}
-//				return value;
-//			});
-//
-//			if (BooleanUtils.isFalse(_control.get())) {
-//				throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
-//			}
-//
-//			result.setData(_wo.get());
-//			return result;
-//		}
-//	}
-//
-//	private Wo work(Business business, Work work) throws Exception {
-//		Wo wo = new Wo();
-//		String id = work.getForm();
-//		if (StringUtils.isEmpty(id)) {
-//			Activity activity = business.getActivity(work);
-//			id = PropertyTools.getOrElse(activity, Activity.form_FIELDNAME, String.class, "");
-//		}
-//		if (StringUtils.isNotEmpty(id)) {
-//			Form form = business.form().pick(id);
-//			if (null != form) {
-//				wo.setForm(toWoFormMobileDataOrData(form));
-//				related(business, wo, form);
-//			}
-//		}
-//		return wo;
-//	}
-//
-//	private Wo workCompleted(Business business, WorkCompleted workCompleted) throws Exception {
-//		Wo wo = new Wo();
-//		// 先使用当前库的表单,如果不存在使用储存的表单.
-//		if (StringUtils.isNotEmpty(workCompleted.getForm())) {
-//			Form form = business.form().pick(workCompleted.getForm());
-//			if (null != form) {
-//				wo.setForm(toWoFormMobileDataOrData(form));
-//				related(business, wo, form);
-//			}
-//		} else if (null != workCompleted.getProperties().getForm()) {
-//			wo.setForm(toWoFormMobileDataOrData(workCompleted.getProperties().getForm()));
-//			if (StringUtils.isNotBlank(workCompleted.getProperties().getForm().getMobileData())) {
-//				workCompleted.getProperties().getMobileRelatedFormList()
-//						.forEach(o -> wo.getRelatedFormMap().put(o.getId(), toWoFormMobileDataOrData(o)));
-//			} else {
-//				workCompleted.getProperties().getRelatedFormList()
-//						.forEach(o -> wo.getRelatedFormMap().put(o.getId(), toWoFormDataOrMobileData(o)));
-//			}
-//		}
-//		workCompleted.getProperties().getRelatedScriptList().stream()
-//				.forEach(o -> wo.getRelatedScriptMap().put(o.getId(), toWoScript(o)));
-//		return wo;
-//	}
-//
-//	private void related(Business business, Wo wo, Form form) throws Exception {
-//		if (StringUtils.isNotBlank(form.getMobileData())) {
-//			for (String mobileRelatedFormId : form.getProperties().getMobileRelatedFormList()) {
-//				Form relatedForm = business.form().pick(mobileRelatedFormId);
-//				if (null != relatedForm) {
-//					wo.getRelatedFormMap().put(mobileRelatedFormId, toWoFormMobileDataOrData(relatedForm));
-//				}
-//			}
-//		} else {
-//			for (String relatedFormId : form.getProperties().getRelatedFormList()) {
-//				Form relatedForm = business.form().pick(relatedFormId);
-//				if (null != relatedForm) {
-//					wo.getRelatedFormMap().put(relatedFormId, toWoFormDataOrMobileData(relatedForm));
-//				}
-//			}
-//		}
-//		relatedScript(business, wo, form);
-//	}
-//
-//	protected void relatedScript(Business business, AbstractWo wo, Form form) throws Exception {
-//		for (Entry<String, String> entry : form.getProperties().getMobileRelatedScriptMap().entrySet()) {
-//			switch (entry.getValue()) {
-//			case WorkCompletedProperties.Script.TYPE_PROCESSPLATFORM:
-//				Script relatedScript = business.script().pick(entry.getKey());
-//				if (null != relatedScript) {
-//					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedScript));
-//				}
-//				break;
-//			case WorkCompletedProperties.Script.TYPE_CMS:
-//				com.x.cms.core.entity.element.Script relatedCmsScript = business.cms().script().pick(entry.getKey());
-//				if (null != relatedCmsScript) {
-//					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedCmsScript));
-//				}
-//				break;
-//			case WorkCompletedProperties.Script.TYPE_PORTAL:
-//				com.x.portal.core.entity.Script relatedPortalScript = business.portal().script().pick(entry.getKey());
-//				if (null != relatedPortalScript) {
-//					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedPortalScript));
-//				}
-//				break;
-//			default:
-//				break;
-//			}
-//		}
-//	}
-//
-//	public static class Wo extends AbstractWo {
-//
-//	}
-//
-//}

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

@@ -5,7 +5,7 @@ import java.util.Map;
 
 import com.x.base.core.project.cache.Cache.CacheCategory;
 import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.jaxrs.WoFastETag;
+import com.x.base.core.project.jaxrs.WoMaxAgeFastETag;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.RelatedForm;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.RelatedScript;
 import com.x.processplatform.core.entity.element.Form;
@@ -16,7 +16,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 	CacheCategory cacheCategory = new CacheCategory(Form.class, Script.class, com.x.portal.core.entity.Script.class,
 			com.x.cms.core.entity.element.Script.class);
 
-	public static class AbstractWo extends WoFastETag {
+	public static class AbstractWo extends WoMaxAgeFastETag {
 
 		private static final long serialVersionUID = 9043017746047829883L;
 

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

@@ -28,44 +28,6 @@ public class FormAction extends StandardJaxrsAction {
 
 	private static Logger logger = LoggerFactory.getLogger(FormAction.class);
 
-//	@JaxrsMethodDescribe(value = "根据工作或完成工作标识获取表单.", action = ActionGetWithWorkOrWorkCompleted.class)
-//	@GET
-//	@Path("workorworkcompleted/{workOrWorkCompleted}")
-//	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-//	@Consumes(MediaType.APPLICATION_JSON)
-//	public void getWithWorkOrWorkCompleted(@Suspended final AsyncResponse asyncResponse,
-//			@Context HttpServletRequest request,
-//			@JaxrsParameterDescribe("工作或完成工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted) {
-//		ActionResult<ActionGetWithWorkOrWorkCompleted.Wo> result = new ActionResult<>();
-//		EffectivePerson effectivePerson = this.effectivePerson(request);
-//		try {
-//			result = new ActionGetWithWorkOrWorkCompleted().execute(effectivePerson, workOrWorkCompleted);
-//		} catch (Exception e) {
-//			logger.error(e, effectivePerson, request, null);
-//			result.error(e);
-//		}
-//		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-//	}
-
-//	@JaxrsMethodDescribe(value = "根据工作或完成工作标识获取移动表单.", action = ActionGetWithWorkOrWorkCompletedMobile.class)
-//	@GET
-//	@Path("workorworkcompleted/{workOrWorkCompleted}/mobile")
-//	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-//	@Consumes(MediaType.APPLICATION_JSON)
-//	public void getWithWorkOrWorkCompletedMobile(@Suspended final AsyncResponse asyncResponse,
-//			@Context HttpServletRequest request,
-//			@JaxrsParameterDescribe("工作或完成工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted) {
-//		ActionResult<ActionGetWithWorkOrWorkCompletedMobile.Wo> result = new ActionResult<>();
-//		EffectivePerson effectivePerson = this.effectivePerson(request);
-//		try {
-//			result = new ActionGetWithWorkOrWorkCompletedMobile().execute(effectivePerson, workOrWorkCompleted);
-//		} catch (Exception e) {
-//			logger.error(e, effectivePerson, request, null);
-//			result.error(e);
-//		}
-//		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-//	}
-
 	@JaxrsMethodDescribe(value = "获取表单内容.", action = ActionGet.class)
 	@GET
 	@Path("{flag}")

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

@@ -1,12 +1,20 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.zip.CRC32;
 
 import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.JpaObject;
+import com.x.base.core.project.cache.Cache.CacheKey;
+import com.x.base.core.project.cache.CacheManager;
 import com.x.base.core.project.exception.ExceptionAccessDenied;
 import com.x.base.core.project.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.gson.XGsonBuilder;
@@ -15,12 +23,14 @@ import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.tools.ListTools;
-import com.x.base.core.project.tools.PropertyTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.content.WorkCompleted;
+import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.StoreForm;
 import com.x.processplatform.core.entity.element.Activity;
+import com.x.processplatform.core.entity.element.Form;
+import com.x.processplatform.core.entity.element.Script;
 
 class V2LookupWorkOrWorkCompleted extends BaseAction {
 
@@ -74,21 +84,87 @@ class V2LookupWorkOrWorkCompleted extends BaseAction {
 	}
 
 	private Wo work(Business business, Work work) throws Exception {
-		Wo wo = new Wo();
-		if (null != business.form().pick(work.getForm())) {
-			wo.setId(work.getForm());
-		} else {
+		Form form = business.form().pick(work.getForm());
+		if (null == form) {
 			Activity activity = business.getActivity(work);
-			wo.setId(PropertyTools.getOrElse(activity, Activity.form_FIELDNAME, String.class, ""));
+			if (null != activity) {
+				form = business.form().pick(activity.getForm());
+			}
+		}
+		if (null != form) {
+			return this.get(business, form);
+		}
+		return new Wo();
+	}
+
+	private Wo get(Business business, Form form) throws Exception {
+		CacheKey cacheKey = new CacheKey(this.getClass(), form.getId());
+		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+		if (optional.isPresent()) {
+			return (Wo) optional.get();
+		} else {
+			List<String> list = new CopyOnWriteArrayList<>();
+			CompletableFuture<Void> _relatedForm = CompletableFuture.runAsync(() -> {
+				try {
+					Form _f;
+					for (String _id : form.getProperties().getRelatedFormList()) {
+						_f = business.form().pick(_id);
+						if (null != _f) {
+							list.add(_f.getId() + _f.getUpdateTime().getTime());
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			});
+			CompletableFuture<Void> _relatedScript = CompletableFuture.runAsync(() -> {
+				try {
+					for (Entry<String, String> entry : form.getProperties().getRelatedScriptMap().entrySet()) {
+						switch (entry.getValue()) {
+						case WorkCompletedProperties.RelatedScript.TYPE_PROCESSPLATFORM:
+							Script _pp = business.script().pick(entry.getKey());
+							if (null != _pp) {
+								list.add(_pp.getId() + _pp.getUpdateTime().getTime());
+							}
+							break;
+						case WorkCompletedProperties.RelatedScript.TYPE_CMS:
+							com.x.cms.core.entity.element.Script _cms = business.cms().script().pick(entry.getKey());
+							if (null != _cms) {
+								list.add(_cms.getId() + _cms.getUpdateTime().getTime());
+							}
+							break;
+						case WorkCompletedProperties.RelatedScript.TYPE_PORTAL:
+							com.x.portal.core.entity.Script _p = business.portal().script().pick(entry.getKey());
+							if (null != _p) {
+								list.add(_p.getId() + _p.getUpdateTime().getTime());
+							}
+							break;
+						default:
+							break;
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			});
+			_relatedForm.get();
+			_relatedScript.get();
+			list.add(form.getId() + form.getUpdateTime().getTime());
+			Wo wo = new Wo();
+			wo.setId(form.getId());
+			CRC32 crc = new CRC32();
+			crc.update(StringUtils.join(list, "#").getBytes());
+			wo.setCacheTag(crc.getValue() + "");
+			return wo;
 		}
-		return wo;
 	}
 
 	private Wo workCompleted(Business business, WorkCompleted workCompleted) throws Exception {
 		// 先使用当前库的表单,如果不存在使用储存的表单.
 		Wo wo = new Wo();
-		if (null != business.form().pick(workCompleted.getForm())) {
-			wo.setId(workCompleted.getForm());
+		Form form = business.form().pick(workCompleted.getForm());
+		if (null != form) {
+			return this.get(business, form);
 		} else if (null != workCompleted.getProperties().getStoreForm()) {
 			StoreForm storeForm = workCompleted.getProperties().getStoreForm();
 			wo = XGsonBuilder.convert(storeForm, Wo.class);
@@ -100,6 +176,8 @@ class V2LookupWorkOrWorkCompleted extends BaseAction {
 
 		private String id;
 
+		private String cacheTag;
+
 		public String getId() {
 			return id;
 		}
@@ -108,6 +186,14 @@ class V2LookupWorkOrWorkCompleted extends BaseAction {
 			this.id = id;
 		}
 
+		public String getCacheTag() {
+			return cacheTag;
+		}
+
+		public void setCacheTag(String cacheTag) {
+			this.cacheTag = cacheTag;
+		}
+
 	}
 
 }

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

@@ -1,12 +1,20 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.zip.CRC32;
 
 import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.JpaObject;
+import com.x.base.core.project.cache.Cache.CacheKey;
+import com.x.base.core.project.cache.CacheManager;
 import com.x.base.core.project.exception.ExceptionAccessDenied;
 import com.x.base.core.project.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.gson.XGsonBuilder;
@@ -15,12 +23,14 @@ import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.tools.ListTools;
-import com.x.base.core.project.tools.PropertyTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.content.WorkCompleted;
+import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.StoreForm;
 import com.x.processplatform.core.entity.element.Activity;
+import com.x.processplatform.core.entity.element.Form;
+import com.x.processplatform.core.entity.element.Script;
 
 class V2LookupWorkOrWorkCompletedMobile extends BaseAction {
 
@@ -74,23 +84,89 @@ class V2LookupWorkOrWorkCompletedMobile extends BaseAction {
 	}
 
 	private Wo work(Business business, Work work) throws Exception {
-		Wo wo = new Wo();
-		if (null != business.form().pick(work.getForm())) {
-			wo.setId(work.getForm());
-		} else {
+		Form form = business.form().pick(work.getForm());
+		if (null == form) {
 			Activity activity = business.getActivity(work);
-			wo.setId(PropertyTools.getOrElse(activity, Activity.form_FIELDNAME, String.class, ""));
+			if (null != activity) {
+				form = business.form().pick(activity.getForm());
+			}
+		}
+		if (null != form) {
+			return this.get(business, form);
+		}
+		return new Wo();
+	}
+
+	private Wo get(Business business, Form form) throws Exception {
+		CacheKey cacheKey = new CacheKey(this.getClass(), form.getId());
+		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+		if (optional.isPresent()) {
+			return (Wo) optional.get();
+		} else {
+			List<String> list = new CopyOnWriteArrayList<>();
+			CompletableFuture<Void> _relatedForm = CompletableFuture.runAsync(() -> {
+				try {
+					Form _f;
+					for (String _id : form.getProperties().getMobileRelatedFormList()) {
+						_f = business.form().pick(_id);
+						if (null != _f) {
+							list.add(_f.getId() + _f.getUpdateTime().getTime());
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			});
+			CompletableFuture<Void> _relatedScript = CompletableFuture.runAsync(() -> {
+				try {
+					for (Entry<String, String> entry : form.getProperties().getMobileRelatedScriptMap().entrySet()) {
+						switch (entry.getValue()) {
+						case WorkCompletedProperties.RelatedScript.TYPE_PROCESSPLATFORM:
+							Script _pp = business.script().pick(entry.getKey());
+							if (null != _pp) {
+								list.add(_pp.getId() + _pp.getUpdateTime().getTime());
+							}
+							break;
+						case WorkCompletedProperties.RelatedScript.TYPE_CMS:
+							com.x.cms.core.entity.element.Script _cms = business.cms().script().pick(entry.getKey());
+							if (null != _cms) {
+								list.add(_cms.getId() + _cms.getUpdateTime().getTime());
+							}
+							break;
+						case WorkCompletedProperties.RelatedScript.TYPE_PORTAL:
+							com.x.portal.core.entity.Script _p = business.portal().script().pick(entry.getKey());
+							if (null != _p) {
+								list.add(_p.getId() + _p.getUpdateTime().getTime());
+							}
+							break;
+						default:
+							break;
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			});
+			_relatedForm.get();
+			_relatedScript.get();
+			list.add(form.getId() + form.getUpdateTime().getTime());
+			Wo wo = new Wo();
+			wo.setId(form.getId());
+			CRC32 crc = new CRC32();
+			crc.update(StringUtils.join(list, "#").getBytes());
+			wo.setCacheTag(crc.getValue() + "");
+			return wo;
 		}
-		return wo;
 	}
 
 	private Wo workCompleted(Business business, WorkCompleted workCompleted) throws Exception {
 		// 先使用当前库的表单,如果不存在使用储存的表单.
 		Wo wo = new Wo();
-		if (null != business.form().pick(workCompleted.getForm())) {
-			wo.setId(workCompleted.getForm());
-		} else if (null != workCompleted.getProperties().getStoreFormMobile()) {
-			StoreForm storeForm = workCompleted.getProperties().getStoreFormMobile();
+		Form form = business.form().pick(workCompleted.getForm());
+		if (null != form) {
+			return this.get(business, form);
+		} else if (null != workCompleted.getProperties().getStoreForm()) {
+			StoreForm storeForm = workCompleted.getProperties().getStoreForm();
 			wo = XGsonBuilder.convert(storeForm, Wo.class);
 		}
 		return wo;
@@ -100,6 +176,8 @@ class V2LookupWorkOrWorkCompletedMobile extends BaseAction {
 
 		private String id;
 
+		private String cacheTag;
+
 		public String getId() {
 			return id;
 		}
@@ -108,6 +186,14 @@ class V2LookupWorkOrWorkCompletedMobile extends BaseAction {
 			this.id = id;
 		}
 
+		public String getCacheTag() {
+			return cacheTag;
+		}
+
+		public void setCacheTag(String cacheTag) {
+			this.cacheTag = cacheTag;
+		}
+
 	}
 
 }