huqi 5 лет назад
Родитель
Сommit
92b00d95b2

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

@@ -58,13 +58,13 @@ public class ActionQueryGetControl extends BaseAction {
 		List<String> unitNames = null;
 		List<String> groupNames = null;
 		String personName = effectivePerson.getDistinguishedName();
-		
+
 		if ( StringUtils.isEmpty(id)) {
 			check = false;
 			Exception exception = new ExceptionDocumentIdEmpty();
 			result.error(exception);
 		}
-		
+
 		if (check) {
 			try {
 				if (effectivePerson.isManager()) {
@@ -77,7 +77,7 @@ public class ActionQueryGetControl extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		if (check) {
 			try {
 				document = documentQueryService.get(id);
@@ -93,16 +93,16 @@ public class ActionQueryGetControl extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		Cache.CacheKey cacheKey = new Cache.CacheKey( this.getClass(), effectivePerson.getDistinguishedName(), id, isManager );
 		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey );
 
 		if (optional.isPresent()) {
 			result.setData((Wo) optional.get());
 			woControl = wo.getControl();
-		} else {			
+		} else {
 			if (check) {
-				try {					
+				try {
 					reviewCount = documentQueryService.getViewableReview(id, personName);
 					if (reviewCount > 0 ) {
 						woControl.setAllowVisit(true);
@@ -114,7 +114,7 @@ public class ActionQueryGetControl extends BaseAction {
 					logger.error(e, effectivePerson, request, null);
 				}
 			}
-			
+
 			//判断用户是否是文档的创建者,创建者是有权限编辑文档的
 			if (check) {
 				if (wo != null && StringUtils.equals( personName, document.getCreatorPerson())) {
@@ -122,13 +122,13 @@ public class ActionQueryGetControl extends BaseAction {
 					woControl.setAllowVisit(true);
 				}
 			}
-			
+
 			if (check) {
 				wo.setControl(woControl);
 				CacheManager.put(cacheCategory, cacheKey, wo );
 			}
 		}
-		
+
 		/////////////////////////////////////////////////////////////
 		//不管是从缓存还是数据库查出来,都要重新进行处理权限判断
 		/////////////////////////////////////////////////////////////
@@ -143,10 +143,10 @@ public class ActionQueryGetControl extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		AppInfo appInfo = null;
 		CategoryInfo categoryInfo = null;
-		
+
 		if (check) {
 			try {
 				appInfo = appInfoServiceAdv.get( document.getAppId() );
@@ -162,7 +162,7 @@ public class ActionQueryGetControl extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		if ( check ) {
 			try {
 				categoryInfo = categoryInfoServiceAdv.get(document.getCategoryId());
@@ -178,7 +178,7 @@ public class ActionQueryGetControl extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		//判断用户是否是分类的管理者,分类管理者是有权限编辑文档的
 		if (check) {
 			try {
@@ -219,19 +219,19 @@ public class ActionQueryGetControl extends BaseAction {
 				// 判断当前登录者是不是该文档的可编辑者
 				try {
 					if( ListTools.isNotEmpty( document.getAuthorPersonList() )) {
-						if ( document.getAuthorPersonList().contains( personName )) {
+						if ( document.getAuthorPersonList().contains( getShortTargetFlag(personName) )) {
 							woControl.setAllowVisit(true);
 							woControl.setAllowEdit(true);
 						}
 					}
 					if( ListTools.isNotEmpty( document.getAuthorUnitList() )) {
-						if( ListTools.containsAny( unitNames , document.getAuthorUnitList() )) {
+						if( ListTools.containsAny( getShortTargetFlag(unitNames) , document.getAuthorUnitList() )) {
 							woControl.setAllowVisit(true);
 							woControl.setAllowEdit(true);
 						}
 					}
 					if( ListTools.isNotEmpty( document.getAuthorGroupList() )) {
-						if( ListTools.containsAny( groupNames , document.getAuthorGroupList() )) {
+						if( ListTools.containsAny( getShortTargetFlag(groupNames) , document.getAuthorGroupList() )) {
 							woControl.setAllowVisit(true);
 							woControl.setAllowEdit(true);
 						}
@@ -248,7 +248,7 @@ public class ActionQueryGetControl extends BaseAction {
 		result.setData(wo);
 		return result;
 	}
-	
+
 
 	public static class Wo extends GsonPropertyObject {
 
@@ -262,9 +262,9 @@ public class ActionQueryGetControl extends BaseAction {
 
 		public void setControl(WoControl control) {
 			this.control = control;
-		}		
+		}
 	}
-	
+
 	public static class WoControl extends GsonPropertyObject {
 
 		@FieldDescribe("是否允许查看.")
@@ -298,9 +298,9 @@ public class ActionQueryGetControl extends BaseAction {
 
 		public void setAllowDelete(Boolean allowDelete) {
 			this.allowDelete = allowDelete;
-		}		
+		}
 	}
-	
+
 //	public static class WoFileInfo extends FileInfo {
 //
 //		private static final long serialVersionUID = -5076990764713538973L;
@@ -316,7 +316,7 @@ public class ActionQueryGetControl extends BaseAction {
 //		public void setControl(WoControl control) {
 //			this.control = control;
 //		}
-//		
+//
 //		public static WrapCopier<FileInfo, WoFileInfo> copier = WrapCopierFactory.wo(FileInfo.class, WoFileInfo.class,
 //				null, JpaObject.FieldsInvisible);
 //
@@ -344,7 +344,7 @@ public class ActionQueryGetControl extends BaseAction {
 //
 //		public static List<String> Excludes = new ArrayList<String>();
 //	}
-	
+
 //	public static class WoControl extends GsonPropertyObject {
 //
 //		private Boolean allowRead = false;
@@ -375,7 +375,7 @@ public class ActionQueryGetControl extends BaseAction {
 //			this.allowControl = allowControl;
 //		}
 //	}
-	
+
 //	private boolean read( WoFileInfo woFileInfo, EffectivePerson effectivePerson, List<String> identities, List<String> units) throws Exception {
 //		boolean value = false;
 //		if (effectivePerson.isPerson(woFileInfo.getCreatorUid())) {
@@ -422,4 +422,4 @@ public class ActionQueryGetControl extends BaseAction {
 //		}
 //		return value;
 //	}
-}
+}

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

@@ -51,13 +51,13 @@ public class ActionQueryGetDocument extends BaseAction {
 		List<String> unitNames = null;
 		List<String> groupNames = null;
 		String personName = effectivePerson.getDistinguishedName();
-		
+
 		if ( StringUtils.isEmpty(id)) {
 			check = false;
 			Exception exception = new ExceptionDocumentIdEmpty();
 			result.error(exception);
 		}
-		
+
 		if (check) {
 			try {
 				if (effectivePerson.isManager()) {
@@ -104,7 +104,7 @@ public class ActionQueryGetDocument extends BaseAction {
 					logger.error(e, effectivePerson, request, null);
 				}
 			}
-			
+
 			if (check) {
 				if (wrapOutDocument != null) {
 					try {
@@ -148,7 +148,7 @@ public class ActionQueryGetDocument extends BaseAction {
 					}
 				}
 			}
-			
+
 			//判断用户是否是文档的创建者,创建者是有权限编辑文档的
 			if (check) {
 				if (wo.getDocument() != null && wo.getDocument().getCreatorPerson() != null && wo.getDocument().getCreatorPerson().equals(personName)) {
@@ -156,17 +156,17 @@ public class ActionQueryGetDocument extends BaseAction {
 					wo.setIsCreator(isCreator);
 				}
 			}
-			
+
 			if (check) {
 				wo.setDocumentLogList(new ArrayList<WoLog>());
 				CacheManager.put(cacheCategory, cacheKey, wo );
 			}
 		}
-		
+
 		if (check) {
 			try {
 				unitNames = userManagerService.listUnitNamesWithPerson( personName );
-				groupNames = userManagerService.listGroupNamesByPerson( personName );									
+				groupNames = userManagerService.listGroupNamesByPerson( personName );
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionDocumentInfoProcess(e, "查询用户所有的组织和群组信息时发生异常!user:" + personName);
@@ -174,11 +174,11 @@ public class ActionQueryGetDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		/////////////////////////////////////////////////////////////
 		//不管是从缓存还是数据库查出来,都要重新进行处理权限判断
 		/////////////////////////////////////////////////////////////
-		
+
 		if (check) {
 			try {
 				appInfo = appInfoServiceAdv.get( document.getAppId() );
@@ -209,7 +209,7 @@ public class ActionQueryGetDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		//判断用户是否是分类的管理者,分类管理者是有权限编辑文档的
 		if (check) {
 			try {
@@ -245,27 +245,18 @@ public class ActionQueryGetDocument extends BaseAction {
 			} else {
 				// 判断当前登录者是不是该文档的可编辑者
 				try {
-//					if( ListTools.isEmpty(wrapOutDocument.getAuthorPersonList()) ) {
-//						wrapOutDocument.setAuthorPersonList( composeAuthorPersonsWithAppAndCagetory( appInfo, categoryInfo ) );
-//					}
-//					if( ListTools.isEmpty(wrapOutDocument.getAuthorUnitList()) ) {
-//						wrapOutDocument.setAuthorUnitList(composeAuthorUnitsWithAppAndCagetory( appInfo, categoryInfo ));
-//					}
-//					if( ListTools.isEmpty(wrapOutDocument.getAuthorGroupList()) ) {
-//						wrapOutDocument.setAuthorGroupList(composeAuthorGroupsWithAppAndCagetory( appInfo, categoryInfo ));
-//					}
 					if( ListTools.isNotEmpty( document.getAuthorPersonList() )) {
-						if ( wrapOutDocument.getAuthorPersonList().contains( personName )) {
+						if ( wrapOutDocument.getAuthorPersonList().contains( getShortTargetFlag(personName) )) {
 							isEditor = true;
 						}
 					}
 					if( ListTools.isNotEmpty( document.getAuthorUnitList() )) {
-						if( ListTools.containsAny( unitNames , wrapOutDocument.getAuthorUnitList() )) {
+						if( ListTools.containsAny( getShortTargetFlag(unitNames) , wrapOutDocument.getAuthorUnitList() )) {
 							isEditor = true;
 						}
 					}
 					if( ListTools.isNotEmpty( document.getAuthorGroupList() )) {
-						if( ListTools.containsAny( groupNames , wrapOutDocument.getAuthorGroupList() )) {
+						if( ListTools.containsAny( getShortTargetFlag(groupNames) , wrapOutDocument.getAuthorGroupList() )) {
 							isEditor = true;
 						}
 					}
@@ -287,105 +278,6 @@ public class ActionQueryGetDocument extends BaseAction {
 		return result;
 	}
 
-//	private List<String> composeAuthorUnitsWithAppAndCagetory(AppInfo appInfo, CategoryInfo category) {
-//		List<String> authorUnits = new ArrayList<>();
-//		if( ListTools.isNotEmpty( appInfo.getManageableUnitList() )) {
-//			for( String name : appInfo.getManageableUnitList() ) {
-//				if( !authorUnits.contains( name )) {
-//					authorUnits.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( appInfo.getPublishableUnitList() )) {
-//			for( String name : appInfo.getPublishableUnitList() ) {
-//				if( !authorUnits.contains( name )) {
-//					authorUnits.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( category.getManageableUnitList() )) {
-//			for( String name : category.getManageableUnitList() ) {
-//				if( !authorUnits.contains( name )) {
-//					authorUnits.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( category.getPublishableUnitList() )) {
-//			for( String name : category.getPublishableUnitList() ) {
-//				if( !authorUnits.contains( name )) {
-//					authorUnits.add( name );
-//				}
-//			}
-//		}
-//		return authorUnits;
-//	}
-//
-//	private List<String> composeAuthorGroupsWithAppAndCagetory(AppInfo appInfo, CategoryInfo category) {
-//		List<String> authorGroups = new ArrayList<>();
-//		if( ListTools.isNotEmpty( appInfo.getManageableGroupList() )) {
-//			for( String name : appInfo.getManageableGroupList() ) {
-//				if( !authorGroups.contains( name )) {
-//					authorGroups.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( appInfo.getPublishableGroupList() )) {
-//			for( String name : appInfo.getPublishableGroupList() ) {
-//				if( !authorGroups.contains( name )) {
-//					authorGroups.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( category.getManageableGroupList() )) {
-//			for( String name : category.getManageableGroupList() ) {
-//				if( !authorGroups.contains( name )) {
-//					authorGroups.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( category.getPublishableGroupList() )) {
-//			for( String name : category.getPublishableGroupList() ) {
-//				if( !authorGroups.contains( name )) {
-//					authorGroups.add( name );
-//				}
-//			}
-//		}
-//		return authorGroups;
-//	}
-//
-//	private List<String> composeAuthorPersonsWithAppAndCagetory(AppInfo appInfo, CategoryInfo category) {
-//		List<String> authorPersons = new ArrayList<>();
-//		if( ListTools.isNotEmpty( appInfo.getManageablePersonList() )) {
-//			for( String name : appInfo.getManageablePersonList() ) {
-//				if( !authorPersons.contains( name )) {
-//					authorPersons.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( appInfo.getPublishablePersonList() )) {
-//			for( String name : appInfo.getPublishablePersonList() ) {
-//				if( !authorPersons.contains( name )) {
-//					authorPersons.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( category.getManageablePersonList() )) {
-//			for( String name : category.getManageablePersonList() ) {
-//				if( !authorPersons.contains( name )) {
-//					authorPersons.add( name );
-//				}
-//			}
-//		}
-//		if( ListTools.isNotEmpty( category.getPublishablePersonList() )) {
-//			for( String name : category.getPublishablePersonList() ) {
-//				if( !authorPersons.contains( name )) {
-//					authorPersons.add( name );
-//				}
-//			}
-//		}
-//		return authorPersons;
-//	}
-
 	public static class Wo extends GsonPropertyObject {
 
 		@FieldDescribe("作为输出的CMS文档数据对象.")
@@ -548,7 +440,7 @@ public class ActionQueryGetDocument extends BaseAction {
 //		public void setControl(WoControl control) {
 //			this.control = control;
 //		}
-//		
+//
 //		public static WrapCopier<FileInfo, WoFileInfo> copier = WrapCopierFactory.wo(FileInfo.class, WoFileInfo.class,
 //				null, JpaObject.FieldsInvisible);
 //
@@ -576,7 +468,7 @@ public class ActionQueryGetDocument extends BaseAction {
 
 		public static List<String> Excludes = new ArrayList<String>();
 	}
-	
+
 //	public static class WoControl extends GsonPropertyObject {
 //
 //		private Boolean allowRead = false;
@@ -607,7 +499,7 @@ public class ActionQueryGetDocument extends BaseAction {
 //			this.allowControl = allowControl;
 //		}
 //	}
-	
+
 //	private boolean read( WoFileInfo woFileInfo, EffectivePerson effectivePerson, List<String> identities, List<String> units) throws Exception {
 //		boolean value = false;
 //		if (effectivePerson.isPerson(woFileInfo.getCreatorUid())) {
@@ -654,4 +546,4 @@ public class ActionQueryGetDocument extends BaseAction {
 //		}
 //		return value;
 //	}
-}
+}

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

@@ -48,8 +48,8 @@ public class ActionQueryViewDocument extends BaseAction {
 			check = false;
 			Exception exception = new ExceptionDocumentIdEmpty();
 			result.error(exception);
-		}		
-		
+		}
+
 		if (check) {
 			try {
 				if ( effectivePerson.isManager() ) {
@@ -62,7 +62,7 @@ public class ActionQueryViewDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		Cache.CacheKey cacheKey = new Cache.CacheKey( this.getClass(), id, isAnonymous, isManager, effectivePerson.getDistinguishedName() );
 		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey );
 
@@ -74,7 +74,7 @@ public class ActionQueryViewDocument extends BaseAction {
 			result = getDocumentQueryResult( id, request, effectivePerson, isManager );
 			CacheManager.put(cacheCategory, cacheKey, result );
 		}
-		
+
 		if (check ) {
 			//只要不是管理员访问,则记录该文档的访问记录
 			if ( !"xadmin".equalsIgnoreCase( personName) ) {
@@ -85,16 +85,16 @@ public class ActionQueryViewDocument extends BaseAction {
 					logger.error(e, effectivePerson, request, null);
 				}
 			}
-			
+
 			//异步更新item里的访问量,便于视图统计
 			try {
 				ThisApplication.queueDocumentViewCountUpdate.send( result.getData().getDocument() );
 			} catch ( Exception e1 ) {
 				e1.printStackTrace();
 			}
-			
+
 		}
-		return result;			
+		return result;
 	}
 
 	/**
@@ -121,11 +121,11 @@ public class ActionQueryViewDocument extends BaseAction {
 		List<String> groupNames = null;
 		Boolean isAnonymous = effectivePerson.isAnonymous();
 		String personName = effectivePerson.getDistinguishedName();
-		
+
 		if( !isAnonymous ) {
 			try {
 				unitNames = userManagerService.listUnitNamesWithPerson( personName );
-				groupNames = userManagerService.listGroupNamesByPerson( personName );									
+				groupNames = userManagerService.listGroupNamesByPerson( personName );
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionDocumentInfoProcess(e, "查询用户所有的组织和群组信息时发生异常!user:" + personName);
@@ -133,7 +133,7 @@ public class ActionQueryViewDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		if (check) {
 			try {
 				document = documentQueryService.view( id, effectivePerson );
@@ -149,7 +149,7 @@ public class ActionQueryViewDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null );
 			}
 		}
-		
+
 		if (check) {
 			try {
 				appInfo = appInfoServiceAdv.get( document.getAppId() );
@@ -180,7 +180,7 @@ public class ActionQueryViewDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		if (check) {
 			if( isAnonymous ) {
 				//检查这个文档所在的栏目和分类是否都是全员可见
@@ -206,12 +206,12 @@ public class ActionQueryViewDocument extends BaseAction {
 				}
 			}
 		}
-		
-		
+
+
 		if (check) {
 			try {
 				woOutDocument = WoDocument.copier.copy( document );
-				
+
 				if ( woOutDocument != null && categoryInfo != null ) {
 					try {
 						woOutDocument.setForm(categoryInfo.getFormId());
@@ -220,7 +220,7 @@ public class ActionQueryViewDocument extends BaseAction {
 						woOutDocument.setReadFormName(categoryInfo.getReadFormName());
 						woOutDocument.setCategoryName(categoryInfo.getCategoryName());
 						woOutDocument.setCategoryAlias(categoryInfo.getCategoryAlias());
-						
+
 						if( woOutDocument.getCreatorPerson() != null && !woOutDocument.getCreatorPerson().isEmpty() ) {
 							woOutDocument.setCreatorPersonShort( woOutDocument.getCreatorPerson().split( "@" )[0]);
 						}
@@ -238,9 +238,9 @@ public class ActionQueryViewDocument extends BaseAction {
 						logger.error(e, effectivePerson, request, null);
 					}
 				}
-				
+
 				if ( woOutDocument != null ) {
-					try {						
+					try {
 						wo.setData( documentQueryService.getDocumentData( document ) );
 					} catch (Exception e) {
 						check = false;
@@ -256,7 +256,7 @@ public class ActionQueryViewDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		//判断用户是否是文档的创建者,创建者是有权限编辑文档的
 		if (check) {
 			if( wo.getDocument() != null && wo.getDocument().getCreatorPerson() != null && wo.getDocument().getCreatorPerson().equals( personName )) {
@@ -264,7 +264,7 @@ public class ActionQueryViewDocument extends BaseAction {
 					wo.setIsCreator( isCreator );
 			}
 		}
-	
+
 		//判断用户是否是分类的管理者,分类管理者是有权限编辑文档的
 		if (check) {
 			try {
@@ -278,7 +278,7 @@ public class ActionQueryViewDocument extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		//判断用户是否是栏目的管理者,栏目管理者是有权限编辑文档的
 		if (check) {
 			try {
@@ -301,21 +301,21 @@ public class ActionQueryViewDocument extends BaseAction {
 				try {
 					if( !isAnonymous ) {
 						if( ListTools.isNotEmpty( document.getAuthorPersonList() )) {
-							if( document.getAuthorPersonList().contains( personName ) ) {
+							if( document.getAuthorPersonList().contains( getShortTargetFlag(personName) ) ) {
 								isEditor = true;
 							}
 						}
 						if( ListTools.isNotEmpty( document.getAuthorUnitList() )) {
-							if( ListTools.containsAny( unitNames, document.getAuthorUnitList())) {
+							if( ListTools.containsAny( getShortTargetFlag(unitNames), document.getAuthorUnitList())) {
 								isEditor = true;
 							}
 						}
 						if( ListTools.isNotEmpty( document.getAuthorGroupList() )) {
-							if( ListTools.containsAny( groupNames, document.getAuthorGroupList())) {
+							if( ListTools.containsAny( getShortTargetFlag(groupNames), document.getAuthorGroupList())) {
 								isEditor = true;
 							}
 						}
-					}					
+					}
 				} catch (Exception e) {
 					check = false;
 					Exception exception = new ExceptionDocumentInfoProcess(e, "判断用户是否可编辑文档时发生异常!user:" + personName);
@@ -324,12 +324,12 @@ public class ActionQueryViewDocument extends BaseAction {
 				}
 			}
 		}
-		
+
 		wo.setIsManager( isManager );
 		wo.setIsAppAdmin( isAppAdmin );
 		wo.setIsCategoryAdmin( isCategoryAdmin );
 		wo.setIsEditor( isEditor );
-		
+
 		result.setData(wo);
 		return result;
 	}
@@ -347,13 +347,13 @@ public class ActionQueryViewDocument extends BaseAction {
 
 		@FieldDescribe( "文档所有数据信息." )
 		private Data data;
-		
+
 		@FieldDescribe( "作为编辑的CMS文档表单." )
 		private WoForm form;
-		
+
 		@FieldDescribe( "作为查看的CMS文档表单." )
 		private WoForm readForm;
-		
+
 		private Boolean isAppAdmin = false;
 		private Boolean isCategoryAdmin = false;
 		private Boolean isManager = false;
@@ -447,24 +447,24 @@ public class ActionQueryViewDocument extends BaseAction {
 		public void setIsCreator(Boolean isCreator) {
 			this.isCreator = isCreator;
 		}
-		
+
 	}
-	
+
 	public static class WoDocument extends Document {
-		
+
 		private static final long serialVersionUID = -5076990764713538973L;
-		
+
 		public static List<String> Excludes = new ArrayList<String>();
-		
+
 		public static WrapCopier<Document, WoDocument> copier = WrapCopierFactory.wo( Document.class, WoDocument.class, null,JpaObject.FieldsInvisible);
-		
+
 		/**
 		 * 只作显示用
 		 */
 		private String creatorPersonShort = "";
-		
+
 		private String creatorUnitNameShort = "";
-		
+
 		private String creatorTopUnitNameShort = "";
 
 		public String getCreatorPersonShort() {
@@ -491,13 +491,13 @@ public class ActionQueryViewDocument extends BaseAction {
 			this.creatorTopUnitNameShort = creatorTopUnitNameShort;
 		}
 	}
-//	
+//
 //	public static class WoFileInfo extends FileInfo {
-//		
+//
 //		private static final long serialVersionUID = -5076990764713538973L;
-//		
+//
 //		public static List<String> Excludes = new ArrayList<String>();
-//		
+//
 //		private WoControl control = new WoControl();
 //
 //		public WoControl getControl() {
@@ -507,34 +507,34 @@ public class ActionQueryViewDocument extends BaseAction {
 //		public void setControl(WoControl control) {
 //			this.control = control;
 //		}
-//		
+//
 //		public static WrapCopier<FileInfo, WoFileInfo> copier = WrapCopierFactory.wo( FileInfo.class, WoFileInfo.class, null, JpaObject.FieldsInvisible);
-//		
+//
 //		private Long referencedCount;
-//		
+//
 //		public Long getReferencedCount() {
 //			return referencedCount;
 //		}
-//		
+//
 //		public void setReferencedCount(Long referencedCount) {
 //			this.referencedCount = referencedCount;
 //		}
 //	}
-	
+
 	public static class WoLog extends Log {
-		
+
 		private static final long serialVersionUID = -5076990764713538973L;
-		
+
 		public static List<String> Excludes = new ArrayList<String>();
 	}
-	
+
 	public static class WoForm extends Form {
-		
+
 		private static final long serialVersionUID = -5076990764713538973L;
-		
+
 		public static List<String> Excludes = new ArrayList<String>();
 	}
-	
+
 //	public static class WoControl extends GsonPropertyObject {
 //
 //		private Boolean allowRead = false;
@@ -565,7 +565,7 @@ public class ActionQueryViewDocument extends BaseAction {
 //			this.allowControl = allowControl;
 //		}
 //	}
-//	
+//
 //	private boolean read( WoFileInfo woFileInfo, EffectivePerson effectivePerson, List<String> identities, List<String> units) throws Exception {
 //		boolean value = false;
 //		if (effectivePerson.isPerson(woFileInfo.getCreatorUid())) {
@@ -611,4 +611,4 @@ public class ActionQueryViewDocument extends BaseAction {
 //		}
 //		return value;
 //	}
-}
+}

+ 34 - 28
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/BaseAction.java

@@ -1,5 +1,6 @@
 package com.x.cms.assemble.control.jaxrs.document;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import com.x.base.core.container.EntityManagerContainer;
@@ -37,7 +38,7 @@ public class BaseAction extends StandardJaxrsAction {
 	protected DocumentViewRecordServiceAdv documentViewRecordServiceAdv = new DocumentViewRecordServiceAdv();
 	protected DocumentPersistService documentPersistService = new DocumentPersistService();
 	protected DocumentQueryService documentQueryService = new DocumentQueryService();
-	
+
 	protected DocCommendPersistService docCommendPersistService = new DocCommendPersistService();
 
 	protected FormServiceAdv formServiceAdv = new FormServiceAdv();
@@ -50,10 +51,10 @@ public class BaseAction extends StandardJaxrsAction {
 	protected boolean modifyDocStatus( String id, String stauts, String personName ) throws Exception{
 		Business business = null;
 		Document document = null;
-		
+
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			business = new Business(emc);
-		
+
 			//进行数据库持久化操作
 			emc.beginTransaction( Document.class );
 			document = business.getDocumentFactory().get(id);
@@ -63,7 +64,7 @@ public class BaseAction extends StandardJaxrsAction {
 				document.setPublishTime( new Date() );
 				//保存文档信息
 				emc.check( document, CheckPersistType.all);
-			}			
+			}
 			emc.commit();
 			return true;
 		} catch (Exception th) {
@@ -171,10 +172,10 @@ public class BaseAction extends StandardJaxrsAction {
 	 * @param groupNames
 	 * @param appInfo
 	 * @return
-	 * @throws Exception 
+	 * @throws Exception
 	 */
 	private boolean appInfoViewable(String personName, Boolean isAnonymous, List<String> unitNames, List<String> groupNames, AppInfo appInfo, Boolean manager) throws Exception {
-		
+
 		if( appInfo.getAllPeopleView() || appInfo.getAllPeoplePublish() ) {
 			return true;
 		}
@@ -182,33 +183,33 @@ public class BaseAction extends StandardJaxrsAction {
 			if( manager ) {
 				return true;
 			}
-			
+
 			if( ListTools.isNotEmpty( appInfo.getManageablePersonList() )) {
 				if( appInfo.getManageablePersonList().contains( personName )) {
 					return true;
 				}
-			}			
+			}
 			if( ListTools.isNotEmpty( appInfo.getViewableUnitList() )) {
 				if( ListTools.containsAny( unitNames, appInfo.getViewableUnitList())) {
 					return true;
 				}
-			}			
+			}
 			if( ListTools.isNotEmpty( appInfo.getViewableGroupList() )) {
 				if( ListTools.containsAny( groupNames, appInfo.getViewableGroupList())) {
 					return true;
 				}
-			}			
+			}
 			if( ListTools.isNotEmpty( appInfo.getPublishableUnitList() )) {
 				if( ListTools.containsAny( unitNames, appInfo.getPublishableUnitList())) {
 					return true;
 				}
-			}			
+			}
 			if( ListTools.isNotEmpty( appInfo.getPublishableGroupList() )) {
 				if( ListTools.containsAny( groupNames, appInfo.getPublishableGroupList())) {
 					return true;
 				}
 			}
-		}		
+		}
 		return false;
 	}
 
@@ -247,22 +248,6 @@ public class BaseAction extends StandardJaxrsAction {
 				return true;
 			}
 		}
-		//是否是作者
-		if( ListTools.isNotEmpty( document.getAuthorPersonList() )) {
-			if( document.getAuthorPersonList().contains( personName ) ) {
-				return true;
-			}
-		}
-		if( ListTools.isNotEmpty( document.getAuthorUnitList() )) {
-			if( ListTools.containsAny( unitNames, document.getAuthorUnitList())) {
-				return true;
-			}
-		}
-		if( ListTools.isNotEmpty( document.getAuthorGroupList() )) {
-			if( ListTools.containsAny( groupNames, document.getAuthorGroupList())) {
-				return true;
-			}
-		}
 
 		if(business.isHasPlatformRole(personName, ThisApplication.ROLE_CMSManager)){
 			return true;
@@ -288,6 +273,27 @@ public class BaseAction extends StandardJaxrsAction {
 		return target;
 	}
 
+	protected List<String> getShortTargetFlag(List<String> nameList) {
+		List<String> targetList = new ArrayList<>();
+		if( ListTools.isNotEmpty( nameList ) ){
+			for(String distinguishedName : nameList) {
+				String target = distinguishedName;
+				String[] array = distinguishedName.split("@");
+				StringBuffer sb = new StringBuffer();
+				if (array.length == 3) {
+					target = sb.append(array[1]).append("@").append(array[2]).toString();
+				} else if (array.length == 2) {
+					//2段
+					target = sb.append(array[0]).append("@").append(array[1]).toString();
+				} else {
+					target = array[0];
+				}
+				targetList.add(target);
+			}
+		}
+		return targetList;
+	}
+
 
 
 //	/**

+ 3 - 2
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/sso/ActionPostEncrypt.java

@@ -43,8 +43,9 @@ class ActionPostEncrypt extends BaseAction {
 			throw new ExceptionClientNotExist(wi.getClient());
 		}
 		String str = wi.getCredential() + TOKEN_SPLIT + new Date().getTime();
-		byte[] bs = Crypto.encrypt(str.getBytes(DefaultCharset.charset), wi.getKey().getBytes());
-		String token = new String(Base64.encodeBase64(bs), DefaultCharset.charset);
+		//byte[] bs = Crypto.encrypt(str.getBytes(DefaultCharset.charset), wi.getKey().getBytes());
+		//String token = new String(Base64.encodeBase64(bs), DefaultCharset.charset);
+		String token = Crypto.encrypt(str, wi.getKey());
 		Wo wo = new Wo();
 		wo.setToken(token);
 		result.setData(wo);

+ 4 - 0
o2web/package.json

@@ -51,7 +51,11 @@
   },
   "dependencies": {
     "gulp-cli": "^2.3.0",
+<<<<<<< HEAD
     "jsdoc": "^3.6.6",
     "tidy-jsdoc-o2": "0.0.8"
+=======
+    "gulp-git": "^2.10.1"
+>>>>>>> wrdp
   }
 }

+ 748 - 0
o2web/source/o2_core/o2/widget/JavascriptEditor_bk.js

@@ -0,0 +1,748 @@
+o2.widget = o2.widget || {};
+o2.require("o2.widget.codemirror", null, false);
+o2.require("o2.xDesktop.UserData", null, false);
+o2.widget.JavascriptEditor = new Class({
+	Implements: [Options, Events],
+	options: {
+        //"type": "ace",
+        "type": "monaco",
+		"title": "JavascriptEditor",
+		"style": "default",
+		"option": {
+			value: "",
+			mode: "javascript",
+			"lineNumbers": true
+		},
+		"runtime": "all"
+	},
+	initialize: function(node, options){
+		this.setOptions(options);
+		this.unbindEvents = [];
+		this.node = $(node);
+	},
+    getDefaultEditorData: function(){
+	    switch (this.options.type) {
+            case "ace":
+                return {
+                    "javascriptEditor": {
+                        "theme": "tomorrow",
+                        "fontSize" : "12px"
+                    }
+                };
+            case "monaco":
+                return {
+                    "javascriptEditor": {
+                        "monaco_theme": "vs",
+                        "fontSize" : "12px"
+                    }
+                };
+        }
+    },
+    getEditorTheme: function(callback){
+        if (!o2.editorData){
+            o2.UD.getData("editor", function(json){
+                if (json.data){
+                    o2.editorData = JSON.decode(json.data);
+                }else{
+                    o2.editorData = this.getDefaultEditorData();
+                }
+                if (callback) callback();
+            }.bind(this));
+        }else{
+            if (callback) callback();
+        }
+    },
+    load: function(callback){
+        this.getEditorTheme(function(json){
+            this.options.type = o2.editorData.javascriptEditor.editor || "monaco";
+            if (this.options.type.toLowerCase()=="ace"){
+                this.loadAce(callback);
+            }
+            if (this.options.type.toLowerCase()=="monaco"){
+                this.loadMonaco(callback);
+            }
+            if (this.options.type.toLowerCase()=="codeMirror"){
+                this.loadCodeMirror(callback);
+            }
+
+            while (this.unbindEvents.length){
+                var ev = this.unbindEvents.shift();
+                this.addEditorEvent(ev.name, ev.fun);
+            }
+        }.bind(this));
+    },
+
+    loadMonacoEditor: function(callback){
+        if (!window.monaco){
+            o2.load("monaco", {"sequence": true}, function(){
+                require.config({ paths: { "vs": "../o2_lib/vs" }});
+                require(["vs/editor/editor.main"], function() {
+                    if (callback) callback();
+                });
+            }.bind(this));
+        }else{
+            if (callback) callback();
+        }
+    },
+    loadMonaco: function(callback){
+        if (o2.editorData.javascriptEditor){
+            this.theme = o2.editorData.javascriptEditor.monaco_theme;
+            this.fontSize = o2.editorData.javascriptEditor.fontSize;
+        }else{
+            o2.editorData.javascriptEditor = {
+                "monaco_theme": "vs",
+                "fontSize" : "12px"
+            };
+        }
+        if (!this.theme) this.theme = "vs";
+        if( !this.fontSize )this.fontSize = "12px";
+
+
+        o2.require("o2.widget.monaco", function () {
+            this.editorClass = o2.widget.monaco;
+
+            this.editorClass.load(function(){
+
+                this.editor = monaco.editor.create(this.node, {
+                    value: this.options.option.value,
+                    language: this.options.option.mode,
+                    theme: this.theme,
+                    fontSize: this.fontSize,
+                    lineNumbersMinChars: 3,
+                    lineNumbers: this.options.option.lineNumbers ? "on" : "off",
+                    mouseWheelZoom: true,
+                    automaticLayout: true
+                });
+                this.focus();
+
+                this.editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, function(e){
+                    this.fireEvent("save");
+                }.bind(this));
+
+                this.editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyMod.Alt | monaco.KeyCode.KEY_I, function(e){
+                    this.format();
+                }.bind(this));
+                this.editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyMod.Alt | monaco.KeyCode.KEY_F, function(e){
+                    this.format();
+                }.bind(this));
+
+                this.editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyMod.Alt | monaco.KeyCode.KEY_F, function(e){
+                    this.format();
+                }.bind(this));
+
+                // this.editor.onKeyDown(function(e){
+                //     debugger;
+                //     e.preventDefault();
+                // });
+
+                if( this.fontSize ){
+                    this.editor.updateOptions( {"fontSize": this.fontSize} );
+                }
+
+                this.editor.onDidFocusEditorText(function(e){
+                    o2.shortcut.keyboard.deactivate();
+                }.bind(this));
+                this.editor.onDidBlurEditorText(function(e){
+                    o2.shortcut.keyboard.activate();
+                }.bind(this));
+
+
+                //o2.widget.JavascriptEditor.getCompletionEnvironment(this.options.runtime, function(){
+                    this.monacoModel = this.editor.getModel();
+                    this.monacoModel.o2Editor = this;
+                    this.registerCompletion();
+                //}.bind(this));
+
+                this.fireEvent("postLoad");
+                if (callback) callback();
+
+            }.bind(this));
+        }.bind(this));
+    },
+
+    loadAce: function(callback){
+        if (o2.editorData.javascriptEditor){
+            this.theme = o2.editorData.javascriptEditor.theme;
+            this.fontSize = o2.editorData.javascriptEditor.fontSize;
+        }else{
+            o2.editorData.javascriptEditor = {
+                "theme": "tomorrow",
+                "fontSize" : "12px"
+            };
+        }
+        if (!this.theme) this.theme = "tomorrow";
+        if( !this.fontSize )this.fontSize = "12px";
+
+        o2.require("o2.widget.ace", function(){
+            this.editorClass = o2.widget.ace;
+
+            this.editorClass.load(function(){
+                this.editor = ace.edit(this.node);
+                this.editor.session.setMode("ace/mode/"+this.options.option.mode);
+                this.editor.setTheme("ace/theme/"+this.theme);
+                this.editor.setOptions({
+                    enableBasicAutocompletion: true,
+                    enableSnippets: true,
+                    enableLiveAutocompletion: true,
+                    showLineNumbers: this.options.option.lineNumbers
+                });
+                if (this.options.option.value) this.editor.setValue(this.options.option.value);
+                this.editor.o2Editor = this;
+
+                this.focus();
+
+                this.editor.commands.addCommand({
+                    name: 'save',
+                    bindKey: {win: 'Ctrl-S',  mac: 'Command-S'},
+                    exec: function(editor) {
+                        this.fireEvent("save");
+                    }.bind(this),
+                    readOnly: false
+                });
+
+                this.editor.commands.addCommand({
+                    name: 'format',
+                    bindKey: {win: 'Ctrl-Alt-i|Ctrl-Alt-f',  mac: 'Command-i|Command-f'},
+                    exec: function(editor, e, e1) {
+                        this.format();
+                    }.bind(this),
+                    readOnly: false
+                });
+
+                this.editor.commands.addCommand({
+                    name: "showKeyboardShortcuts",
+                    bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"},
+                    exec: function(editor) {
+                        ace.config.loadModule("ace/ext/keybinding_menu", function(module) {
+                            module.init(editor);
+                            editor.showKeyboardShortcuts()
+                        })
+                    }.bind(this)
+                });
+
+                this.node.addEvent("keydown", function(e){
+                    e.stopPropagation();
+                });
+
+                if( this.fontSize ){
+                    this.setFontSize( this.fontSize );
+                }
+
+                o2.widget.JavascriptEditor.getCompletionEnvironment(this.options.runtime, function(){
+                    this.registerCompletion();
+                }.bind(this));
+
+                this.fireEvent("postLoad");
+                if (callback) callback();
+            }.bind(this));
+        }.bind(this));
+    },
+    registerCompletion: function(){
+
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.registerCompletionAce(); break;
+                case "monaco": this.registerCompletionMonaco(); break;
+            }
+        }
+    },
+
+    filterRangeScript: function(s, f1, f2){
+        var textScript = "";
+        var n = 0;
+        for (var i=s.length-1; i>=0; i--){
+            var char = s.charAt(i);
+            if (char==f2) n++;
+            if (char==f1){
+                n--;
+                if (n<0) break;
+            }
+            textScript = char+textScript;
+        }
+        return textScript;
+    },
+
+    getCompletionObject: function(textPrefix, runtime){
+        var macro = o2.widget.JavascriptEditor.runtimeEnvironment[runtime];
+        var o = null;
+        if (macro){
+            debugger;
+            textPrefix = this.filterRangeScript(textPrefix, "(", ")");
+            textPrefix = this.filterRangeScript(textPrefix, "{", "}");
+            textPrefix = this.filterRangeScript(textPrefix, "[", "]");
+
+            textPrefix = textPrefix.substr(textPrefix.lastIndexOf("=")+1)
+                .substr(textPrefix.lastIndexOf(":")+1)
+                .substr(textPrefix.lastIndexOf(",")+1)
+                .substr(textPrefix.lastIndexOf(";")+1);
+
+            code = "try {return "+textPrefix+";}catch(e){return null;}";
+            o = macro.exec(code);
+        }
+        return o;
+    },
+    registerCompletionMonaco: function(){
+        if (!o2.widget.monaco.registeredCompletion){
+            monaco.languages.registerCompletionItemProvider('javascript', {
+                "triggerCharacters": ["."],
+                provideCompletionItems: function (model, position, context, token) {
+                    var textUntilPosition = model.getValueInRange({ startLineNumber: position.lineNumber, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column });
+                    var textPrefix = textUntilPosition.substr(0, textUntilPosition.lastIndexOf("."));
+
+                    var o = this.getCompletionObject(textPrefix, model.o2Editor.options.runtime);
+
+                    var word = model.getWordUntilPosition(position);
+                    var range = { startLineNumber: position.lineNumber, endLineNumber: position.lineNumber, startColumn: word.startColumn, endColumn: word.endColumn };
+
+                    if (o) {
+                        var arr = [];
+                        Object.keys(o).each(function (key) {
+                            var keyType = typeOf(o[key]);
+                            if (keyType === "function") {
+                                var count = o[key].length;
+                                var v = key + "(";
+                                for (var i = 1; i <= count; i++) v += (i == count) ? "par" + i : "par" + i + ", ";
+                                v += ")";
+                                arr.push({ label: key, kind: monaco.languages.CompletionItemKind.Function, insertText: v, range: range, detail: keyType });
+                            } else {
+                                arr.push({ label: key, kind: monaco.languages.CompletionItemKind.Interface, insertText: key, range: range, detail: keyType });
+                            }
+                        });
+                    }
+                    return new Promise(function(s){s({suggestions: arr})});
+                }.bind(this)
+            });
+            o2.widget.monaco.registeredCompletion = true;
+        }
+    },
+    registerCompletionAce: function(){
+        if (!o2.widget.ace.registeredCompletion){
+            //添加自动完成列表
+            var exports = ace.require("ace/ext/language_tools");
+            exports.addCompleter({
+                identifierRegexps: [
+                    ///[a-zA-Z_0-9\$\-\u00A2-\uFFFF\(\)\{\}\[\]\.]/
+                    /./
+                ],
+                getCompletions: function(editor, session, pos, prefix, callback){
+                    debugger;
+                    var x = prefix.substr(0, prefix.lastIndexOf("."));
+                    var o = this.getCompletionObject(x, editor.o2Editor.options.runtime);
+
+                    if (o){
+                        var arr = [];
+                        Object.keys(o).each(function(key){
+                            var keyType = typeOf(o[key]);
+                            if (keyType==="function") {
+                                var count = o[key].length;
+                                var v = x+"."+key+"(";
+                                for (var i=1; i<=count; i++) v+= (i==count) ? "par"+i :  "par"+i+", ";
+                                v+=")";
+                                arr.push({ caption: x+"."+key, value: v, score: 3, meta: keyType, type: keyType, docText: o[key] });
+                            }else{
+                                arr.push({ caption: x+"."+key, value: x+"."+key, score: 3, meta: keyType, type: keyType, docText: o[key] });
+                            }
+                        });
+                        callback(null, arr);
+                    }
+                }.bind(this)
+            });
+            o2.widget.ace.registeredCompletion = true;
+        }
+    },
+    changeEditor: function(type){
+
+        if (this.editor){
+            var value = this.getValue();
+            this.destroyEditor();
+            this.options.type = type;
+            this.load(function(){
+                this.setValue(value);
+            }.bind(this));
+        }else{
+            this.options.type = o2.editorData.javascriptEditor.editor;
+            if (this.options.type.toLowerCase()=="ace"){
+                this.loadAce(callback);
+            }
+            if (this.options.type.toLowerCase()=="monaco"){
+                this.loadMonaco(callback);
+            }
+            if (this.options.type.toLowerCase()=="codeMirror"){
+                this.loadCodeMirror(callback);
+            }
+        }
+    },
+    destroyEditor: function(){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.destroy(); this.node.empty(); break;
+                case "monaco": this.editor.dispose(); break;
+            }
+        }
+    },
+    setTheme: function(theme){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.setTheme( "ace/theme/"+theme); break;
+                case "monaco": monaco.editor.setTheme(theme); break;
+            }
+        }
+    },
+    setFontSize: function(fontSize){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.setFontSize( fontSize ); break;
+                case "monaco": this.editor.updateOptions({"fontSize": fontSize}); break;
+            }
+        }
+    },
+    setValue: function(v){
+        if (this.editor) this.editor.setValue(v);
+    },
+    insertValue : function(v){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace":
+                    this.editor.insert(v);
+                    break;
+                case "monaco":
+                    // this.editor.getModel().applyEdits([{
+                    this.editor.executeEdits("", [{
+                        range: monaco.Range.fromPositions(this.editor.getPosition()),
+                        text: v
+                    }]);
+                    break;
+            }
+        }
+    },
+    getValue: function(){
+        return (this.editor) ? this.editor.getValue() : "";
+    },
+    resize: function(y){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.resize(); break;
+                case "monaco": this.editor.layout(); break;
+            }
+        }
+    },
+    addEditorEvent: function(name, fun){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.on(name, fun); break;
+                case "monaco":
+                    var ev = name;
+                    switch (ev) {
+                        case "change": ev = "onDidChangeModelContent"; break;
+                        case "blur": ev = "onDidBlurEditorText"; break;
+
+                    }
+                    if (this.editor[ev]) this.editor[ev](fun);
+                    break;
+            }
+        }else{
+            this.unbindEvents.push({"name": name, "fun": fun});
+        }
+    },
+    validatedAce: function(){
+        var session = this.editor.getSession();
+        var annotations = session.getAnnotations();
+        for (var i=0; i<annotations.length; i++){
+            if (annotations[i].type=="error") return false;
+        }
+        return true;
+    },
+    validatedMonaco: function(){
+        var mod = this.editor.getModel();
+        var ms = monaco.editor.getModelMarkers({"resource": mod.uri});
+        for (var i=0; i<ms.length; i++){
+            if (ms[i].severity==8) return false;
+        }
+        return true;
+    },
+
+    validated: function(){
+        if (this.editor){
+           switch (this.options.type.toLowerCase()) {
+               case "ace": return this.validatedAce();
+               case "monaco": return this.validatedMonaco();
+           }
+            return true;
+        }
+        return true
+    },
+
+    formatAce: function(){
+        var mode = this.options.option.mode.toString().toLowerCase();
+        if (mode==="javascript"){
+            o2.load("JSBeautifier", function(){
+                this.editor.setValue(js_beautify(editor.getValue()));
+            }.bind(this));
+        }else if (mode==="html"){
+            o2.load("JSBeautifier_html", function(){
+                this.editor.setValue(html_beautify(editor.getValue()));
+            }.bind(this));
+        }else if (mode==="css"){
+            o2.load("JSBeautifier_css", function(){
+                this.editor.setValue(css_beautify(editor.getValue()));
+            }.bind(this));
+        }else{
+            o2.load("JSBeautifier", function(){
+                this.editor.setValue(js_beautify(editor.getValue()));
+            }.bind(this));
+        }
+    },
+    formatMonaco: function(){
+        this.editor.getAction("editor.action.formatDocument").run();
+    },
+    format: function(){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.formatAce();
+                case "monaco": this.formatMonaco();
+            }
+        }
+    },
+
+    focus: function(){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.focus(); this.goto(); break;
+                case "monaco": this.editor.focus();
+            }
+        }
+    },
+    goto: function(){
+        var p = this.editor.getCursorPosition();
+        if (p.row==0){
+            p.row = this.editor.renderer.getScrollBottomRow();
+        }
+        this.editor.gotoLine(p.row+1, p.column+1, true);
+    },
+    showLineNumbers: function(){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.setOption("showLineNumbers", true); break;
+                case "codeMirror":  this.editor.setOption("lineNumbers", true); break;
+                case "monaco": this.editor.updateOptions({"lineNumbers": "on"});
+            }
+        }
+    },
+    hideLineNumbers: function(){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.setOption("showLineNumbers", false); break;
+                case "codeMirror":  this.editor.setOption("lineNumbers", false); break;
+                case "monaco": this.editor.updateOptions({"lineNumbers": "off"});
+            }
+        }
+    },
+    max: function(){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "codeMirror": this.editor.setSize("100%", "100%"); break;
+                case "ace": this.editor.resize(); break;
+                case "monaco": this.editor.layout(); break;
+            }
+        }
+    },
+
+	loadCodeMirror: function(callback){
+		if (this.fireEvent("queryLoad")){
+			this.editorClass.load(function(){
+				this.editorClass.loadJavascript(function(editor){
+					this.options.option.mode = "javascript";
+					this.editor = CodeMirror(this.node, this.options.option);
+
+					this.editor.setSize("100%", "100%");
+					this.fireEvent("postLoad");
+
+                    if (callback) callback();
+				}.bind(this));
+			}.bind(this));
+		}
+	},
+
+    getCursorPixelPosition: function(){
+        var session = this.editor.getSession();
+        var pos = this.editor.getCursorPosition();
+        var line = session.getLine(pos.row);
+        var prefix = this.retrievePrecedingIdentifier(line, pos.column);
+
+        var base = session.doc.createAnchor(pos.row, pos.column - prefix.length);
+        base.$insertRight = true;
+
+        var renderer = this.editor.renderer;
+        var pos = renderer.$cursorLayer.getPixelPosition(base, true);
+
+        var rect = this.editor.container.getBoundingClientRect();
+        pos.top += rect.top - renderer.layerConfig.offset;
+        pos.left += rect.left - this.editor.renderer.scrollLeft;
+        pos.left += renderer.gutterWidth;
+
+        return pos;
+    },
+    retrievePrecedingIdentifier: function(text, pos, regex) {
+        regex = regex || /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/;
+        var buf = [];
+        for (var i = pos-1; i >= 0; i--) {
+            if (regex.test(text[i]))
+                buf.push(text[i]);
+            else
+                break;
+        }
+        return buf.reverse().join("");
+    }
+});
+
+o2.widget.JavascriptEditor.runtimeEnvironment = {};
+o2.widget.JavascriptEditor.getCompletionEnvironment = function(runtime, callback) {
+
+    if (!o2.widget.JavascriptEditor.runtimeEnvironment[runtime]) {
+        o2.require("o2.xScript.Macro", function() {
+            switch (runtime) {
+                case "service":
+                    o2.widget.JavascriptEditor.getServiceCompletionEnvironment(runtime,callback);
+                    break;
+                case "server":
+                    o2.widget.JavascriptEditor.getServerCompletionEnvironment(runtime,callback);
+                    break;
+                case "all":
+                    o2.widget.JavascriptEditor.getAllCompletionEnvironment(runtime,callback);
+                    break;
+                default:
+                    o2.widget.JavascriptEditor.getDefaultCompletionEnvironment(runtime,callback);
+            }
+        });
+    } else {
+        if (callback) callback();
+    }
+};
+
+o2.widget.JavascriptEditor.getServiceCompletionEnvironment = function(runtime, callback) {
+    //var serviceScriptText = null;
+    var serviceScriptSubstitute = null;
+    var check = function () {
+        //if (o2.typeOf(serviceScriptText) !== "null" && o2.typeOf(serviceScriptSubstitute) !== "null") {
+        if (o2.typeOf(serviceScriptSubstitute) !== "null") {
+            //var code = "o2.Macro.swapSpace.tmpMacroCompletionFunction = function (){\n" + serviceScriptSubstitute + "\n" + serviceScriptText + "\nreturn bind;" + "\n};";
+            var code = "o2.Macro.swapSpace.tmpMacroCompletionFunction = function (){\n" + serviceScriptSubstitute + "\nreturn bind;" + "\n};";
+            Browser.exec(code);
+            var ev = o2.Macro.swapSpace.tmpMacroCompletionFunction() ;
+            o2.widget.JavascriptEditor.runtimeEnvironment[runtime] = {
+                "environment": ev,
+                exec: function(code){
+                    return o2.Macro.exec(code, this.environment);
+                }
+            }
+            if (callback) callback();
+        }
+    }
+
+    // o2.xhr_get("../x_desktop/js/initialServiceScriptText.js", function (xhr) {
+    //     serviceScriptText = xhr.responseText;
+    //     check();
+    // }, function () {
+    //     serviceScriptText = "";
+    //     check();
+    // });
+    o2.xhr_get("../x_desktop/js/initalServiceScriptSubstitute.js", function (xhr) {
+        serviceScriptSubstitute = xhr.responseText;
+        check();
+    }, function () {
+        serviceScriptSubstitute = "";
+        check();
+    });
+};
+
+o2.widget.JavascriptEditor.getServerCompletionEnvironment = function(runtime, callback) {
+   //var serverScriptText = null;
+    var serverScriptSubstitute = null;
+    var check = function () {
+        // if (o2.typeOf(serverScriptText) !== "null" && o2.typeOf(serverScriptSubstitute) !== "null") {
+        //     var code = "o2.Macro.swapSpace.tmpMacroCompletionFunction = function (){\n" + serverScriptSubstitute + "\n" + serverScriptText + "\nreturn bind;" + "\n};";
+        if (o2.typeOf(serverScriptSubstitute) !== "null") {
+            var code = "o2.Macro.swapSpace.tmpMacroCompletionFunction = function (){\n" + serverScriptSubstitute + "\nreturn bind;" + "\n};";
+            Browser.exec(code);
+            var ev = o2.Macro.swapSpace.tmpMacroCompletionFunction();
+            o2.widget.JavascriptEditor.runtimeEnvironment[runtime] = {
+                "environment": ev,
+                exec: function(code){
+                    return o2.Macro.exec(code, this.environment);
+                }
+            }
+            if (callback) callback();
+        }
+    }
+
+    // o2.xhr_get("../x_desktop/js/initialScriptText.js", function (xhr) {
+    //     serverScriptText = xhr.responseText;
+    //     check();
+    // }, function () {
+    //     serverScriptText = "";
+    //     check();
+    // });
+    o2.xhr_get("../x_desktop/js/initalScriptSubstitute.js", function (xhr) {
+        serverScriptSubstitute = xhr.responseText;
+        check();
+    }, function () {
+        serverScriptSubstitute = "";
+        check();
+    });
+};
+
+o2.widget.JavascriptEditor.getDefaultCompletionEnvironment = function(runtime, callback){
+    var json = null;
+    o2.getJSON("../o2_core/o2/widget/$JavascriptEditor/environment.json", function (data) {
+        json = data;
+        o2.widget.JavascriptEditor.runtimeEnvironment[runtime] = new o2.Macro.FormContext(json);
+        if (callback) callback();
+    });
+}
+
+o2.widget.JavascriptEditor.getAllCompletionEnvironment = function(runtime, callback){
+    var check = function(){
+        if (o2.widget.JavascriptEditor.runtimeEnvironment["service"] && o2.widget.JavascriptEditor.runtimeEnvironment["server"] && o2.widget.JavascriptEditor.runtimeEnvironment["web"] ){
+        //if (o2.widget.JavascriptEditor.runtimeEnvironment["web"] ){
+            var ev = Object.merge(o2.widget.JavascriptEditor.runtimeEnvironment["service"].environment,
+                o2.widget.JavascriptEditor.runtimeEnvironment["server"].environment,
+                o2.widget.JavascriptEditor.runtimeEnvironment["web"].environment)
+
+            //var ev = o2.widget.JavascriptEditor.runtimeEnvironment["web"].environment;
+
+            o2.widget.JavascriptEditor.runtimeEnvironment[runtime] = {
+                "environment": ev,
+                exec: function(code){
+                    return o2.Macro.exec(code, this.environment);
+                }
+            }
+            if (callback) callback();
+        }
+    }
+    o2.widget.JavascriptEditor.getServiceCompletionEnvironment("service", check);
+    o2.widget.JavascriptEditor.getServerCompletionEnvironment("server", check);
+    o2.widget.JavascriptEditor.getDefaultCompletionEnvironment("web", check);
+
+}
+
+o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = {
+    init: function(){
+        this.callbackPool = {};
+        this.scriptWorker = new Worker("../o2_core/o2/widget/$JavascriptEditor/scriptWorker.js");
+        this.scriptWorker.onmessage = function(e) {
+            var o = e.data;
+            var bo = this.callbackPool[o.id];
+            if (bo.uuid==o.uuid) if (bo.callback) bo.callback(o.o);
+        }
+    },
+    exec: function(o, callback){
+        if (!this.scriptWorker) this.init();
+        var uuid = o2.uuid();
+        o.uuid = uuid;
+        this.callbackPool[o.id] = {
+            "callback": callback,
+            "id": uuid
+        }
+        this.scriptWorker.postMessage(o);
+    }
+}

BIN
o2web/source/x_component_query_TableDesigner/$Main/default/toolbar/formExcelExplode.png


BIN
o2web/source/x_component_query_TableDesigner/$Main/default/toolbar/formExcelImplode.png


+ 4 - 3
o2web/source/x_component_query_TableDesigner/$Main/default/toolbars.html

@@ -4,14 +4,15 @@
 	<span MWFnodetype="MWFToolBarSeparator"></span>
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="build.png" title="发布数据表,进入可编译状态" MWFButtonAction="statusBuild" MWFButtonText=""></span>
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="draft.png" title="取消数据库编译,重新编译时会删除已编译的数据表" MWFButtonAction="statusDraft" MWFButtonText=""></span>
-	<span MWFnodetype="MWFToolBarSeparator"></span>
-
-
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="run.png" title="编译所有数据表" MWFButtonAction="buildAllView" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarSeparator"></span>
 
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formExplode.gif" title="数据导出" MWFButtonAction="tableExplode" MWFButtonText=""></span>
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formImplode.gif" title="数据导入" MWFButtonAction="tableImplode" MWFButtonText=""></span>
 
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formExcelExplode.png" title="Excel导出" MWFButtonAction="tableExcelExplode" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formExcelImplode.png" title="Excel导入" MWFButtonAction="tableExcelImplode" MWFButtonText=""></span>
+
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="clear.png" title="清空表数据" MWFButtonAction="tableClear" MWFButtonText=""></span>
 
 	<span MWFnodetype="MWFToolBarSeparator"></span>

+ 6 - 0
o2web/source/x_component_query_TableDesigner/Main.js

@@ -178,6 +178,12 @@ MWF.xApplication.query.TableDesigner.Main = new Class({
     tableImplode: function(){
         this.view.tableImplode();
     },
+    tableExcelExplode: function(){
+        this.view.tableExcelExplode();
+    },
+    tableExcelImplode: function(){
+        this.view.tableExcelImplode();
+    },
     tableClear: function(){
         this.view.tableClear();
     },

+ 181 - 2
o2web/source/x_component_query_TableDesigner/Table.js

@@ -533,6 +533,41 @@ MWF.xApplication.query.TableDesigner.Table = new Class({
             this.close();
         }, null);
     },
+    tableExcelImplode: function(e){
+        var _self = this;
+        if (!e) e = this.node;
+        this.designer.confirm("warn", e, MWF.APPDTBD.LP.tableExcelImplodeTitle, MWF.APPDTBD.LP.tableExcelImplodeInfo, 480, 120, function(){
+            _self.implodeExcelLocal();
+            this.close();
+        }, function(){
+            this.close();
+        }, null);
+    },
+    implodeExcelLocal : function (){
+        var ExcelUtils = new MWF.xApplication.query.TableDesigner.Table.ExcelUtils();
+        var uploadFileAreaNode = new Element("div");
+        var html = "<input name=\"file\" type=\"file\" accept=\"*\" />";
+        uploadFileAreaNode.set("html", html);
+
+        var fileUploadNode = uploadFileAreaNode.getFirst();
+        fileUploadNode.addEvent("change", function () {
+            var files = fileNode.files;
+            if (files.length) {
+                var file = files.item(0);
+                //第三个参数是日期的列
+                ExcelUtils.import( file, function(json){
+                    console.log(JSON.stringify(json));
+
+                    this.designer.actions.rowSave(this.data.id,json[0],function(json){
+                        this.designer.notice(this.designer.lp.tableImplode_success, "success", this.node, {"x": "left", "y": "bottom"});
+                    }.bind(this));
+                }.bind(this) );
+
+            }
+        }.bind(this));
+        var fileNode = uploadFileAreaNode.getFirst();
+        fileNode.click();
+    },
     implodeLocal: function(){
         if (!this.uploadFileAreaNode){
             this.uploadFileAreaNode = new Element("div");
@@ -582,6 +617,48 @@ MWF.xApplication.query.TableDesigner.Table = new Class({
             this.close();
         }, null);
     },
+    tableExcelExplode: function(e){
+        var ExcelUtils = new MWF.xApplication.query.TableDesigner.Table.ExcelUtils();
+        var _self = this;
+        if (!e) e = this.node;
+        this.designer.confirm("warn", e, MWF.APPDTBD.LP.tableExcelExplodeTitle, MWF.APPDTBD.LP.tableExplodeInfo, 480, 120, function(){
+            var fieldList = JSON.parse(_self.view.data.data).fieldList;
+            var fieldArr = [];
+            var resultArr = [];
+            fieldList.each(function (field){
+                fieldArr.push(field.name);
+                resultArr.push("o." + field.name);
+            })
+            var array = [fieldArr];
+            var jpql = {
+                "data": "select " + resultArr.join() + " from " + _self.data.name + " o",
+                "type": "select",
+                "firstResult": 0,
+                "maxResults": 1000
+            }
+            _self.designer.actions.executeJpql(_self.data.id, jpql, function(json){
+                json.data.each(function (d){
+                    var f = [];
+                    if(o2.typeOf(json.data[0])==="string"){
+                        f = [d];
+                    }else {
+                        d.each(function (dd){
+                            if(!dd){
+                                f.push("");
+                            }else {
+                                f.push(dd);
+                            }
+                        })
+                    }
+                    array.push(f);
+                })
+                ExcelUtils.export(array, "导出数据"+(new Date).format("db"));
+            }.bind(this));
+            this.close();
+        }, function(){
+            this.close();
+        }, null);
+    },
     setContentHeight: function(){
         var size = this.areaNode.getSize();
         var titleSize = this.viewTitleNode.getSize()
@@ -680,8 +757,6 @@ MWF.xApplication.query.TableDesigner.Table = new Class({
     }
 });
 
-
-
 MWF.xApplication.query.TableDesigner.Table.Column = new Class({
     Extends:MWF.xApplication.query.ViewDesigner.ViewBase.Column,
     initialize: function(json, view, next){
@@ -1218,3 +1293,107 @@ MWF.xApplication.query.TableDesigner.Table.JPQLRunner = new Class({
         }
     }
 });
+
+MWF.xApplication.query.TableDesigner.Table.ExcelUtils = new Class({
+    _loadResource : function( callback ){
+        var uri = "/x_component_Template/framework/xlsx/xlsx.full.js";
+        var uri2 = "/x_component_Template/framework/xlsx/xlsxUtils.js";
+        COMMON.AjaxModule.load(uri, function(){
+            COMMON.AjaxModule.load(uri2, function(){
+                callback();
+            }.bind(this))
+        }.bind(this))
+    },
+    _openDownloadDialog: function(url, saveName){
+        /**
+         * 通用的打开下载对话框方法,没有测试过具体兼容性
+         * @param url 下载地址,也可以是一个blob对象,必选
+         * @param saveName 保存文件名,可选
+         */
+        if( Browser.name !== 'ie' ){
+            if(typeof url == 'object' && url instanceof Blob){
+                url = URL.createObjectURL(url); // 创建blob地址
+            }
+            var aLink = document.createElement('a');
+            aLink.href = url;
+            aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效
+            var event;
+            if(window.MouseEvent && typeOf( window.MouseEvent ) == "function" ) event = new MouseEvent('click');
+            else
+            {
+                event = document.createEvent('MouseEvents');
+                event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+            }
+            aLink.dispatchEvent(event);
+        }else{
+            window.navigator.msSaveBlob( url, saveName);
+        }
+    },
+    export : function(array, fileName){
+        this._loadResource( function(){
+            data = xlsxUtils.format2Sheet(array, 0, 0, null);//偏移3行按keyMap顺序转换
+            var wb = xlsxUtils.format2WB(data, "sheet1", undefined);
+            var wopts = { bookType: 'xlsx', bookSST: false, type: 'binary' };
+            var dataInfo = wb.Sheets[wb.SheetNames[0]];
+
+            var widthArray = [];
+            array[0].each( function( v, i ){
+
+                widthArray.push( {wpx: 100} );
+
+                var at = String.fromCharCode(97 + i).toUpperCase();
+                var di = dataInfo[at+"1"];
+                // di.v = v;
+                // di.t = "s";
+                di.s = {  //设置副标题样式
+                    font: {
+                        //name: '宋体',
+                        sz: 12,
+                        color: {rgb: "#FFFF0000"},
+                        bold: true,
+                        italic: false,
+                        underline: false
+                    },
+                    alignment: {
+                        horizontal: "center" ,
+                        vertical: "center"
+                    }
+                };
+            }.bind(this));
+            dataInfo['!cols'] = widthArray,
+
+                this._openDownloadDialog(xlsxUtils.format2Blob(wb), fileName +".xlsx");
+        }.bind(this))
+    },
+    import : function( file, callback, dateColArray ){
+        this._loadResource( function(){
+            var reader = new FileReader();
+            var workbook, data;
+            reader.onload = function (e) {
+                //var data = data.content;
+                if (!e) {
+                    data = reader.content;
+                }else {
+                    data = e.target.result;
+                }
+                workbook = XLSX.read(data, { type: 'binary' });
+                //wb.SheetNames[0]是获取Sheets中第一个Sheet的名字
+                //wb.Sheets[Sheet名]获取第一个Sheet的数据
+                var sheet = workbook.SheetNames[0];
+                var jsonList = [];
+                for (var sheet in workbook.Sheets) {
+                    if (workbook.Sheets.hasOwnProperty(sheet)) {
+                        fromTo = workbook.Sheets[sheet]['!ref'];
+                        console.log(fromTo);
+                        var json = XLSX.utils.sheet_to_json(workbook.Sheets[sheet]);
+                        console.log(JSON.stringify(json));
+                        jsonList.push(json);
+                        // break; // 如果只取第一张表,就取消注释这行
+                    }
+                }
+                if(callback)callback(jsonList);
+            };
+            reader.readAsBinaryString(file);
+        })
+    }
+});

+ 1 - 0
o2web/source/x_component_query_TableDesigner/lp/zh-cn.js

@@ -67,6 +67,7 @@ MWF.xApplication.query.TableDesigner.LP = {
 
     "tableImplodeTitle": "导入数据",
     "tableImplodeInfo": "导入的数据会覆盖。确认是否导入?",
+    "tableExcelImplodeInfo": "导入的数据如果有id字段,会覆盖,否则会新增。确认是否导入?",
     "tableImplode_success": "导入成功",
 
     "tableClearTitle": "清空数据",

+ 27 - 0
o2web/source/x_desktop/js/cmsDocMobile_bak.js

@@ -0,0 +1,27 @@
+o2.addReady(function () {
+    //修改支持x-token
+    var uri = new URI(window.location.href);
+    var options = uri.get("data");
+    if (options["x-token"]) {
+        Cookie.write("x-token", options["x-token"]);
+    }
+    layout.load = function () {
+        this.options = uri.get("data");
+        if (!this.options.documentId) this.options.documentId = this.options.id
+        this.options.name = "cms.Document";
+        this.loadDocument(this.options);
+
+        var appNames = "cms.Document";
+        layout.openApplication(null, appName, this.options, null);
+    };
+
+    if (layout.session && layout.session.user){
+        _load();
+    }else{
+        if (layout.sessionPromise){
+            layout.sessionPromise.then(function(){
+                _load();
+            },function(){});
+        }
+    }
+});

+ 1 - 3
o2web/source/x_desktop/oauth2.html

@@ -7,9 +7,8 @@
         <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
 
         <script src="../o2_core/o2.min.js"></script>
-        <script src="js/base_simple.min.js"></script>
+        <script src="js/base.min.js"></script>
         <script src="js/oauth2.js"></script>
-
         <title></title>
 
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -20,7 +19,6 @@
     </head>
     <body style="overflow: auto; margin:0px; height: 100%;">
         <div id="appContent" style="overflow: hidden; height:100%;">
-            <div id="loaddingArea" style="overflow: hidden;width:0px; height:2px; background-color:#4e82bd; position: absolute; top: 0; z-index: 10000"></div>
         </div>
     </body>
 </html>

+ 106 - 0
o2web/source/x_test/x.json

@@ -0,0 +1,106 @@
+{
+  "scriptWrapList": [
+    {
+      "moduleType": "processPlatform|cms|portal|service",
+      "appId": "4e498504-855a-423b-a8d0-0fcea2c87c18",
+      "appName": "测试流程",
+      "designerId": "5f852a32-0444-4d8b-bc31-52aa7404e167",
+      "designerName": "file",
+      "pattern": [
+        {"property": "", "line": [23, 33]},
+        {"property": "", "line": [23, 33]}
+      ]
+    }
+  ],
+  "formWrapList": [
+    {
+      "moduleType": "processPlatform|cms",
+      "appId": "4e498504-855a-423b-a8d0-0fcea2c87c18",
+      "appName": "测试流程",
+      "designerId": "5f852a32-0444-4d8b-bc31-52aa7404e167",
+      "designerName": "file",
+      "pattern": [
+        {"property": ""},
+        {"property": ""}
+      ]
+    }
+  ],
+  "processWrapList": [
+    {
+      "moduleType": "processPlatform",
+      "appId": "4e498504-855a-423b-a8d0-0fcea2c87c18",
+      "appName": "测试流程",
+      "designerId": "5f852a32-0444-4d8b-bc31-52aa7404e167",
+      "designerName": "file",
+      "pattern": [
+        {"elementType": "activity | process", "elementId": "", "elementName": "", "property": ""},
+        {"elementType": "activity | process", "elementId": "", "elementName": "", "property": ""}
+      ]
+    }
+  ],
+  "pageWrapList": [
+    {
+      "moduleType": "portal",
+      "appId": "4e498504-855a-423b-a8d0-0fcea2c87c18",
+      "appName": "测试流程",
+      "designerId": "5f852a32-0444-4d8b-bc31-52aa7404e167",
+      "designerName": "file",
+      "pattern": [
+        {"property": ""},
+        {"property": ""}
+      ]
+    }
+  ],
+  "widgetWrapList": [
+    {
+      "moduleType": "portal",
+      "appId": "4e498504-855a-423b-a8d0-0fcea2c87c18",
+      "appName": "测试流程",
+      "designerId": "5f852a32-0444-4d8b-bc31-52aa7404e167",
+      "designerName": "file",
+      "pattern": [
+        {"property": ""},
+        {"property": ""}
+      ]
+    }
+  ],
+  "viewWrapList": [
+    {
+      "moduleType": "query",
+      "appId": "4e498504-855a-423b-a8d0-0fcea2c87c18",
+      "appName": "测试流程",
+      "designerId": "5f852a32-0444-4d8b-bc31-52aa7404e167",
+      "designerName": "file",
+      "pattern": [
+        {"property": ""},
+        {"property": ""}
+      ]
+    }
+  ],
+  "statementWrapList": [
+    {
+      "moduleType": "query",
+      "appId": "4e498504-855a-423b-a8d0-0fcea2c87c18",
+      "appName": "测试流程",
+      "designerId": "5f852a32-0444-4d8b-bc31-52aa7404e167",
+      "designerName": "file",
+      "pattern": [
+        {"property": ""},
+        {"property": ""}
+      ]
+    }
+  ],
+  "statWrapList": [
+    {
+      "moduleType": "query",
+      "appId": "4e498504-855a-423b-a8d0-0fcea2c87c18",
+      "appName": "测试流程",
+      "designerId": "5f852a32-0444-4d8b-bc31-52aa7404e167",
+      "designerName": "file",
+      "pattern": [
+        {"property": ""},
+        {"property": ""}
+      ]
+    }
+  ]
+}

+ 15 - 14
package.json

@@ -53,29 +53,30 @@
         },
         "author": "",
         "license": "ISC",
-        "dependencies": {
-                "dateformat": "^3.0.3",
-                "docdash": "^1.2.0",
-                "fast-glob": "^3.2.2",
-                "gulp": "^4.0.2",
+        "devDependencies": {
+                "gulp": "^4.0.0",
                 "gulp-changed": "^3.2.0",
                 "gulp-concat": "^2.6.1",
                 "gulp-deleted": "^1.0.0",
-                "gulp-git": "^2.10.1",
+                "gulp-ftp": "^1.1.0",
                 "gulp-if": "^2.0.2",
-                "gulp-logger": "0.0.2",
                 "gulp-rename": "^1.4.0",
-                "gulp-shell": "^0.8.0",
+                "gulp-sftp-up4": "^0.1.8",
                 "gulp-sourcemaps": "^3.0.0",
                 "gulp-tm-asset-rev": "^0.0.18",
                 "gulp-tm-uglify": "3.0.1",
                 "gulp-uglify-es": "^2.0.0",
-                "gulp-util": "^3.0.8",
+                "jasmine-core": "^3.6.0",
+                "karma": "^5.2.3",
+                "karma-chrome-launcher": "^3.1.0",
+                "karma-coverage": "^2.0.3",
+                "karma-ie-launcher": "^1.0.0",
+                "karma-jasmine": "^4.0.1",
+                "merge-stream": "^1.0.1",
                 "minimist": "^1.2.0",
-                "progress-stream": "^2.0.0",
-                "request": "^2.88.2",
-                "single-line-log": "^1.1.2",
-                "targz": "^1.0.1",
-                "tidy-jsdoc-o2": "latest"
+                "readline-sync": "^1.4.10",
+                "gulp-cli": "^2.3.0",
+                "jsdoc": "^3.6.6",
+                "tidy-jsdoc-o2": "0.0.8"
         }
 }