فهرست منبع

增加误删除的代码

Zhou Rui 5 سال پیش
والد
کامیت
2f4be2c096
41فایلهای تغییر یافته به همراه4532 افزوده شده و 0 حذف شده
  1. 129 0
      o2server/x_general_assemble_control/pom.xml
  2. 24 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/AbstractFactory.java
  3. 33 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/ApplicationServletContextListener.java
  4. 27 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/Business.java
  5. 30 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/ThisApplication.java
  6. 22 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ActionApplication.java
  7. 10 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/AreaJaxrsFilter.java
  8. 10 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/EcnetJaxrsFilter.java
  9. 10 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/OfficeJaxrsFilter.java
  10. 52 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ActionListCity.java
  11. 56 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ActionListDistrict.java
  12. 47 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ActionListProvince.java
  13. 60 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ActionListStreet.java
  14. 106 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/AreaAction.java
  15. 82 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/BaseAction.java
  16. 12 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ExceptionDistrictNotExist.java
  17. 123 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ecnet/ActionCheck.java
  18. 7 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ecnet/BaseAction.java
  19. 48 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ecnet/EcnetAction.java
  20. 12 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ecnet/ExceptionDistrictNotExist.java
  21. 79 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ActionHtmlToWord.java
  22. 46 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ActionHtmlToWordResult.java
  23. 96 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ActionToHtml.java
  24. 44 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/BaseAction.java
  25. 13 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ExceptionHtmlToWordResultObject.java
  26. 12 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ExceptionUnsupportType.java
  27. 89 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/OfficeAction.java
  28. 1 0
      o2server/x_general_assemble_control/src/main/webapp/WEB-INF/web.xml
  29. 258 0
      o2server/x_general_assemble_control/src/main/webapp/jest/attachment.js
  30. 297 0
      o2server/x_general_assemble_control/src/main/webapp/jest/building.js
  31. 6 0
      o2server/x_general_assemble_control/src/main/webapp/jest/clipboard.min.js
  32. 26 0
      o2server/x_general_assemble_control/src/main/webapp/jest/common.js
  33. 77 0
      o2server/x_general_assemble_control/src/main/webapp/jest/debug.js
  34. 1349 0
      o2server/x_general_assemble_control/src/main/webapp/jest/describe.js
  35. 142 0
      o2server/x_general_assemble_control/src/main/webapp/jest/index.html
  36. 1 0
      o2server/x_general_assemble_control/src/main/webapp/jest/jquery.js
  37. 1 0
      o2server/x_general_assemble_control/src/main/webapp/jest/jquery.min.js
  38. 105 0
      o2server/x_general_assemble_control/src/main/webapp/jest/logger.js
  39. 634 0
      o2server/x_general_assemble_control/src/main/webapp/jest/meeting.js
  40. 33 0
      o2server/x_general_assemble_control/src/main/webapp/jest/openMeeting.js
  41. 323 0
      o2server/x_general_assemble_control/src/main/webapp/jest/room.js

+ 129 - 0
o2server/x_general_assemble_control/pom.xml

@@ -0,0 +1,129 @@
+<?xml version="1.0"?>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>o2oa</groupId>
+		<artifactId>o2server</artifactId>
+		<version>4.0.5</version>
+	</parent>
+	<artifactId>x_general_assemble_control</artifactId>
+	<packaging>war</packaging>
+	<dependencies>
+		<dependency>
+			<groupId>o2oa</groupId>
+			<artifactId>x_base_core_project</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>o2oa</groupId>
+			<artifactId>x_organization_core_entity</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>o2oa</groupId>
+			<artifactId>x_organization_core_express</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>o2oa</groupId>
+			<artifactId>x_general_core_entity</artifactId>
+		</dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>exec-maven-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>describeBuilder</id>
+						<phase>prepare-package</phase>
+						<goals>
+							<goal>java</goal>
+						</goals>
+						<configuration>
+							<addOutputToClasspath>true</addOutputToClasspath>
+							<includePluginDependencies>true</includePluginDependencies>
+							<includeProjectDependencies>true</includeProjectDependencies>
+							<mainClass>com.x.base.core.project.annotation.DescribeBuilder</mainClass>
+							<arguments>
+								<argument>${basedir}</argument>
+								<argument>${project.build.sourceDirectory}</argument>
+							</arguments>
+						</configuration>
+					</execution>
+					<execution>
+						<id>apiBuilder</id>
+						<phase>prepare-package</phase>
+						<goals>
+							<goal>java</goal>
+						</goals>
+						<configuration>
+							<addOutputToClasspath>true</addOutputToClasspath>
+							<includePluginDependencies>true</includePluginDependencies>
+							<includeProjectDependencies>true</includeProjectDependencies>
+							<mainClass>com.x.base.core.project.annotation.ApiBuilder</mainClass>
+							<arguments>
+								<argument>${basedir}</argument>
+								<argument>${project.build.sourceDirectory}</argument>
+							</arguments>
+						</configuration>
+					</execution>
+					<execution>
+						<id>checkAssemble</id>
+						<phase>prepare-package</phase>
+						<goals>
+							<goal>java</goal>
+						</goals>
+						<configuration>
+							<addOutputToClasspath>true</addOutputToClasspath>
+							<includePluginDependencies>true</includePluginDependencies>
+							<includeProjectDependencies>true</includeProjectDependencies>
+							<mainClass>com.x.base.core.project.build.CheckAssemble</mainClass>
+						</configuration>
+					</execution>
+					<execution>
+						<id>createWebXml</id>
+						<phase>prepare-package</phase>
+						<goals>
+							<goal>java</goal>
+						</goals>
+						<configuration>
+							<addOutputToClasspath>true</addOutputToClasspath>
+							<includePluginDependencies>true</includePluginDependencies>
+							<includeProjectDependencies>true</includeProjectDependencies>
+							<mainClass>com.x.base.core.project.build.CreateWebXml</mainClass>
+							<arguments>
+								<argument>${basedir}</argument>
+								<argument>${project.artifactId}</argument>
+							</arguments>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-resources-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy-war</id>
+						<phase>verify</phase>
+						<goals>
+							<goal>copy-resources</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>../store</outputDirectory>
+							<resources>
+								<resource>
+									<directory>target</directory>
+									<includes>
+										<include>${project.artifactId}.war</include>
+									</includes>
+								</resource>
+							</resources>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>

+ 24 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/AbstractFactory.java

@@ -0,0 +1,24 @@
+package com.x.general.assemble.control;
+
+import com.x.base.core.container.EntityManagerContainer;
+
+public abstract class AbstractFactory {
+
+	private Business business;
+
+	public AbstractFactory(Business business) throws Exception {
+		try {
+			if (null == business) {
+				throw new Exception("business can not be null.");
+			}
+			this.business = business;
+		} catch (Exception e) {
+			throw new Exception("can not instantiating factory.");
+		}
+	}
+
+	public EntityManagerContainer entityManagerContainer() throws Exception {
+		return this.business.entityManagerContainer();
+	}
+
+}

+ 33 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/ApplicationServletContextListener.java

@@ -0,0 +1,33 @@
+package com.x.general.assemble.control;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.annotation.WebListener;
+
+import com.x.base.core.project.Context;
+
+@WebListener
+public class ApplicationServletContextListener implements ServletContextListener {
+
+	@Override
+	public void contextInitialized(ServletContextEvent servletContextEvent) {
+		try {
+			ThisApplication.context = Context.concrete(servletContextEvent);
+			ThisApplication.init();
+			ThisApplication.context().regist();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	@Override
+	public void contextDestroyed(ServletContextEvent servletContextEvent) {
+		try {
+			ThisApplication.destroy();
+			ThisApplication.context.destrory(servletContextEvent);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+}

+ 27 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/Business.java

@@ -0,0 +1,27 @@
+package com.x.general.assemble.control;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.organization.core.express.Organization;
+
+public class Business {
+
+	private EntityManagerContainer emc;
+
+	public Business(EntityManagerContainer emc) throws Exception {
+		this.emc = emc;
+	}
+
+	public EntityManagerContainer entityManagerContainer() {
+		return this.emc;
+	}
+
+	private Organization organization;
+
+	public Organization organization() throws Exception {
+		if (null == this.organization) {
+			this.organization = new Organization(ThisApplication.context());
+		}
+		return organization;
+	}
+
+}

+ 30 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/ThisApplication.java

@@ -0,0 +1,30 @@
+package com.x.general.assemble.control;
+
+import com.x.base.core.project.Context;
+import com.x.base.core.project.config.Config;
+import com.x.base.core.project.logger.LoggerFactory;
+
+public class ThisApplication {
+
+	protected static Context context;
+
+	public static Context context() {
+		return context;
+	}
+
+	public static void init() {
+		try {
+			LoggerFactory.setLevel(Config.logLevel().x_general_assemble_control());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public static void destroy() {
+		try {
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+}

+ 22 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ActionApplication.java

@@ -0,0 +1,22 @@
+package com.x.general.assemble.control.jaxrs;
+
+import java.util.Set;
+
+import javax.ws.rs.ApplicationPath;
+
+import com.x.base.core.project.jaxrs.AbstractActionApplication;
+import com.x.general.assemble.control.jaxrs.area.AreaAction;
+import com.x.general.assemble.control.jaxrs.ecnet.EcnetAction;
+import com.x.general.assemble.control.jaxrs.office.OfficeAction;
+
+@ApplicationPath("jaxrs")
+public class ActionApplication extends AbstractActionApplication {
+
+	public Set<Class<?>> getClasses() {
+		classes.add(AreaAction.class);
+		classes.add(EcnetAction.class);
+		classes.add(OfficeAction.class);
+		return classes;
+	}
+
+}

+ 10 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/AreaJaxrsFilter.java

@@ -0,0 +1,10 @@
+package com.x.general.assemble.control.jaxrs;
+
+import javax.servlet.annotation.WebFilter;
+
+import com.x.base.core.project.jaxrs.AnonymousCipherManagerUserJaxrsFilter;
+
+@WebFilter(urlPatterns = "/jaxrs/area/*", asyncSupported = true)
+public class AreaJaxrsFilter extends AnonymousCipherManagerUserJaxrsFilter {
+
+}

+ 10 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/EcnetJaxrsFilter.java

@@ -0,0 +1,10 @@
+package com.x.general.assemble.control.jaxrs;
+
+import javax.servlet.annotation.WebFilter;
+
+import com.x.base.core.project.jaxrs.AnonymousCipherManagerUserJaxrsFilter;
+
+@WebFilter(urlPatterns = "/jaxrs/ecnet/*", asyncSupported = true)
+public class EcnetJaxrsFilter extends AnonymousCipherManagerUserJaxrsFilter {
+
+}

+ 10 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/OfficeJaxrsFilter.java

@@ -0,0 +1,10 @@
+package com.x.general.assemble.control.jaxrs;
+
+import javax.servlet.annotation.WebFilter;
+
+import com.x.base.core.project.jaxrs.AnonymousCipherManagerUserJaxrsFilter;
+
+@WebFilter(urlPatterns = "/jaxrs/office/*", asyncSupported = true)
+public class OfficeJaxrsFilter extends AnonymousCipherManagerUserJaxrsFilter {
+
+}

+ 52 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ActionListCity.java

@@ -0,0 +1,52 @@
+package com.x.general.assemble.control.jaxrs.area;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.tools.ListTools;
+import com.x.general.assemble.control.Business;
+import com.x.general.core.entity.area.District;
+
+import net.sf.ehcache.Element;
+
+public class ActionListCity extends BaseAction {
+
+	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String province) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<List<Wo>> result = new ActionResult<>();
+			List<Wo> wos = new ArrayList<>();
+			String cacheKey = ApplicationCache.concreteCacheKey(this.getClass(), province);
+			Element element = cache.get(cacheKey);
+			if ((null != element) && (null != element.getObjectValue())) {
+				wos = (List<Wo>) element.getObjectValue();
+			} else {
+				Business business = new Business(emc);
+				District districtProvince = this.getProvince(business, province);
+				if (null == districtProvince) {
+					throw new ExceptionDistrictNotExist(province);
+				}
+				wos = Wo.copier.copy(this.listCity(business, districtProvince));
+				cache.put(new Element(cacheKey, wos));
+			}
+			result.setData(wos);
+			return result;
+		}
+	}
+
+	public static class Wo extends District {
+
+		private static final long serialVersionUID = -6068531258644538959L;
+		static WrapCopier<District, Wo> copier = WrapCopierFactory.wo(District.class, Wo.class,
+				ListTools.toList(District.zipCode_FIELDNAME, District.center_FIELDNAME, District.name_FIELDNAME,
+						District.level_FIELDNAME),
+				null);
+	}
+
+}

+ 56 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ActionListDistrict.java

@@ -0,0 +1,56 @@
+package com.x.general.assemble.control.jaxrs.area;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.tools.ListTools;
+import com.x.general.assemble.control.Business;
+import com.x.general.core.entity.area.District;
+
+import net.sf.ehcache.Element;
+
+public class ActionListDistrict extends BaseAction {
+
+	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String province, String city) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<List<Wo>> result = new ActionResult<>();
+			List<Wo> wos = new ArrayList<>();
+			String cacheKey = ApplicationCache.concreteCacheKey(this.getClass(), province, city);
+			Element element = cache.get(cacheKey);
+			if ((null != element) && (null != element.getObjectValue())) {
+				wos = (List<Wo>) element.getObjectValue();
+			} else {
+				Business business = new Business(emc);
+				District districtProvince = this.getProvince(business, province);
+				if (null == districtProvince) {
+					throw new ExceptionDistrictNotExist(province);
+				}
+				District districtCity = this.getCity(business, districtProvince, city);
+				if (null == districtCity) {
+					throw new ExceptionDistrictNotExist(city);
+				}
+				wos = Wo.copier.copy(this.listDistrict(business, districtCity));
+				cache.put(new Element(cacheKey, wos));
+			}
+			result.setData(wos);
+			return result;
+		}
+	}
+
+	public static class Wo extends District {
+
+		private static final long serialVersionUID = -6068531258644538959L;
+		static WrapCopier<District, Wo> copier = WrapCopierFactory.wo(District.class, Wo.class,
+				ListTools.toList(District.zipCode_FIELDNAME, District.center_FIELDNAME, District.name_FIELDNAME,
+						District.level_FIELDNAME),
+				null);
+	}
+
+}

+ 47 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ActionListProvince.java

@@ -0,0 +1,47 @@
+package com.x.general.assemble.control.jaxrs.area;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.tools.ListTools;
+import com.x.general.core.entity.area.District;
+
+import net.sf.ehcache.Element;
+
+public class ActionListProvince extends BaseAction {
+
+	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<List<Wo>> result = new ActionResult<>();
+			List<Wo> wos = new ArrayList<>();
+			String cacheKey = ApplicationCache.concreteCacheKey(this.getClass());
+			Element element = cache.get(cacheKey);
+			if ((null != element) && (null != element.getObjectValue())) {
+				wos = (List<Wo>) element.getObjectValue();
+			} else {
+				List<District> os = emc.listEqual(District.class, District.level_FIELDNAME, District.LEVEL_PROVINCE);
+				wos = Wo.copier.copy(os);
+				cache.put(new Element(cacheKey, wos));
+			}
+			result.setData(wos);
+			return result;
+		}
+	}
+
+	public static class Wo extends District {
+
+		private static final long serialVersionUID = -6068531258644538959L;
+		static WrapCopier<District, Wo> copier = WrapCopierFactory.wo(District.class, Wo.class,
+				ListTools.toList(District.zipCode_FIELDNAME, District.center_FIELDNAME, District.name_FIELDNAME,
+						District.level_FIELDNAME, District.sha_FIELDNAME),
+				null);
+	}
+
+}

+ 60 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ActionListStreet.java

@@ -0,0 +1,60 @@
+package com.x.general.assemble.control.jaxrs.area;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.tools.ListTools;
+import com.x.general.assemble.control.Business;
+import com.x.general.core.entity.area.District;
+
+import net.sf.ehcache.Element;
+
+public class ActionListStreet extends BaseAction {
+
+	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String province, String city, String district)
+			throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<List<Wo>> result = new ActionResult<>();
+			List<Wo> wos = new ArrayList<>();
+			String cacheKey = ApplicationCache.concreteCacheKey(this.getClass(), province, city, district);
+			Element element = cache.get(cacheKey);
+			if ((null != element) && (null != element.getObjectValue())) {
+				wos = (List<Wo>) element.getObjectValue();
+			} else {
+				Business business = new Business(emc);
+				District districtProvince = this.getProvince(business, province);
+				if (null == districtProvince) {
+					throw new ExceptionDistrictNotExist(province);
+				}
+				District districtCity = this.getCity(business, districtProvince, city);
+				if (null == districtCity) {
+					throw new ExceptionDistrictNotExist(city);
+				}
+				District districtDistrict = this.getDistrict(business, districtCity, district);
+				if (null == districtDistrict) {
+					throw new ExceptionDistrictNotExist(district);
+				}
+				wos = Wo.copier.copy(this.listStreet(business, districtDistrict));
+			}
+			result.setData(wos);
+			return result;
+		}
+	}
+
+	public static class Wo extends District {
+
+		private static final long serialVersionUID = -6068531258644538959L;
+		static WrapCopier<District, Wo> copier = WrapCopierFactory.wo(District.class, Wo.class,
+				ListTools.toList(District.zipCode_FIELDNAME, District.center_FIELDNAME, District.name_FIELDNAME,
+						District.level_FIELDNAME),
+				null);
+	}
+
+}

+ 106 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/AreaAction.java

@@ -0,0 +1,106 @@
+package com.x.general.assemble.control.jaxrs.area;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+
+import com.x.base.core.project.annotation.JaxrsDescribe;
+import com.x.base.core.project.annotation.JaxrsMethodDescribe;
+import com.x.base.core.project.annotation.JaxrsParameterDescribe;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.http.HttpMediaType;
+import com.x.base.core.project.jaxrs.ResponseFactory;
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+
+@Path("area")
+@JaxrsDescribe("行政区域")
+public class AreaAction extends StandardJaxrsAction {
+
+	private static Logger logger = LoggerFactory.getLogger(AreaAction.class);
+
+	@JaxrsMethodDescribe(value = "获取指定的Attachment信息.", action = ActionListProvince.class)
+	@GET
+	@Path("list")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void listProvince(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
+		ActionResult<List<ActionListProvince.Wo>> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionListProvince().execute(effectivePerson);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "列示指定省下属市", action = ActionListCity.class)
+	@GET
+	@Path("list/province/{province}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void listCity(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("省") @PathParam("province") String province) {
+		ActionResult<List<ActionListCity.Wo>> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionListCity().execute(effectivePerson, province);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "列示指定省/市下属区", action = ActionListStreet.class)
+	@GET
+	@Path("list/province/{province}/city/{city}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void listDistrict(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("省") @PathParam("province") String province,
+			@JaxrsParameterDescribe("市") @PathParam("city") String city) {
+		ActionResult<List<ActionListDistrict.Wo>> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionListDistrict().execute(effectivePerson, province, city);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "列示指定省/市/区的下属街道", action = ActionListStreet.class)
+	@GET
+	@Path("list/province/{province}/city/{city}/district/{district}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void listStreet(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("省") @PathParam("province") String province,
+			@JaxrsParameterDescribe("市") @PathParam("city") String city,
+			@JaxrsParameterDescribe("区") @PathParam("district") String district) {
+		ActionResult<List<ActionListStreet.Wo>> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionListStreet().execute(effectivePerson, province, city, district);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+}

+ 82 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/BaseAction.java

@@ -0,0 +1,82 @@
+package com.x.general.assemble.control.jaxrs.area;
+
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+import com.x.general.assemble.control.Business;
+import com.x.general.core.entity.area.District;
+import com.x.general.core.entity.area.District_;
+
+import net.sf.ehcache.Ehcache;
+
+abstract class BaseAction extends StandardJaxrsAction {
+
+	protected static Ehcache cache = ApplicationCache.instance().getCache(District.class);
+
+	protected District getProvince(Business business, String name) throws Exception {
+		List<District> os = business.entityManagerContainer().listEqualAndEqual(District.class,
+				District.level_FIELDNAME, District.LEVEL_PROVINCE, District.name_FIELDNAME, name);
+		if (os.size() == 1) {
+			return os.get(0);
+		}
+		return null;
+	}
+
+	protected District getCity(Business business, District province, String name) throws Exception {
+		EntityManager em = business.entityManagerContainer().get(District.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<District> cq = cb.createQuery(District.class);
+		Root<District> root = cq.from(District.class);
+		Predicate p = cb.equal(root.get(District_.name), name);
+		p = cb.and(p, cb.equal(root.get(District_.level), District.LEVEL_CITY));
+		p = cb.and(p, cb.equal(root.get(District_.province), province.getId()));
+		cq.select(root).where(p);
+		List<District> os = em.createQuery(cq).getResultList();
+		if (os.size() == 1) {
+			return os.get(0);
+		}
+		return null;
+	}
+
+	protected District getDistrict(Business business, District city, String name) throws Exception {
+		EntityManager em = business.entityManagerContainer().get(District.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<District> cq = cb.createQuery(District.class);
+		Root<District> root = cq.from(District.class);
+		Predicate p = cb.equal(root.get(District_.name), name);
+		p = cb.and(p, cb.equal(root.get(District_.level), District.LEVEL_DISTRICT));
+		p = cb.and(p, cb.equal(root.get(District_.city), city.getId()));
+		cq.select(root).where(p);
+		List<District> os = em.createQuery(cq).getResultList();
+		if (os.size() == 1) {
+			return os.get(0);
+		}
+		return null;
+	}
+
+	protected List<District> listCity(Business business, District province) throws Exception {
+		List<District> os = business.entityManagerContainer().listEqualAndEqual(District.class,
+				District.level_FIELDNAME, District.LEVEL_CITY, District.province_FIELDNAME, province.getId());
+		return os;
+	}
+
+	protected List<District> listDistrict(Business business, District city) throws Exception {
+		List<District> os = business.entityManagerContainer().listEqualAndEqual(District.class,
+				District.level_FIELDNAME, District.LEVEL_DISTRICT, District.city_FIELDNAME, city.getId());
+		return os;
+	}
+
+	protected List<District> listStreet(Business business, District district) throws Exception {
+		List<District> os = business.entityManagerContainer().listEqualAndEqual(District.class,
+				District.level_FIELDNAME, District.LEVEL_STREET, District.district_FIELDNAME, district.getId());
+		return os;
+	}
+
+}

+ 12 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/area/ExceptionDistrictNotExist.java

@@ -0,0 +1,12 @@
+package com.x.general.assemble.control.jaxrs.area;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionDistrictNotExist extends PromptException {
+
+	private static final long serialVersionUID = 7237855733312562652L;
+
+	ExceptionDistrictNotExist(String name) {
+		super("指定的区域不存在:{}.", name);
+	}
+}

+ 123 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ecnet/ActionCheck.java

@@ -0,0 +1,123 @@
+package com.x.general.assemble.control.jaxrs.ecnet;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.config.Config;
+import com.x.base.core.project.connection.ActionResponse;
+import com.x.base.core.project.connection.ConnectionAction;
+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.WrapString;
+
+public class ActionCheck extends BaseAction {
+
+	private static final String ADDRESS = "/o2_collect_assemble/jaxrs/ecnet/check";
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+			ActionResponse response = ConnectionAction.post(Config.collect().url(ADDRESS), null, wi);
+			Wo wo = response.getData(Wo.class);
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	public static class Wi extends WrapString {
+	}
+
+	public static class Wo extends GsonPropertyObject {
+
+		private Integer pos = 0;
+
+		private String origin = "";
+
+		private String correct = "";
+
+		private List<WoItem> itemList = new ArrayList<>();
+
+		public String getOrigin() {
+			return origin;
+		}
+
+		public void setOrigin(String origin) {
+			this.origin = origin;
+		}
+
+		public String getCorrect() {
+			return correct;
+		}
+
+		public void setCorrect(String correct) {
+			this.correct = correct;
+		}
+
+		public List<WoItem> getItemList() {
+			return itemList;
+		}
+
+		public void setItemList(List<WoItem> itemList) {
+			this.itemList = itemList;
+		}
+
+		public Integer getPos() {
+			return pos;
+		}
+
+		public void setPos(Integer pos) {
+			this.pos = pos;
+		}
+
+	}
+
+	public static class WoItem extends GsonPropertyObject {
+
+		private String origin;
+
+		private String correct;
+
+		private Integer begin;
+
+		private Integer end;
+
+		public String getOrigin() {
+			return origin;
+		}
+
+		public void setOrigin(String origin) {
+			this.origin = origin;
+		}
+
+		public String getCorrect() {
+			return correct;
+		}
+
+		public void setCorrect(String correct) {
+			this.correct = correct;
+		}
+
+		public Integer getBegin() {
+			return begin;
+		}
+
+		public void setBegin(Integer begin) {
+			this.begin = begin;
+		}
+
+		public Integer getEnd() {
+			return end;
+		}
+
+		public void setEnd(Integer end) {
+			this.end = end;
+		}
+
+	}
+
+}

+ 7 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ecnet/BaseAction.java

@@ -0,0 +1,7 @@
+package com.x.general.assemble.control.jaxrs.ecnet;
+
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+
+abstract class BaseAction extends StandardJaxrsAction {
+
+}

+ 48 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ecnet/EcnetAction.java

@@ -0,0 +1,48 @@
+package com.x.general.assemble.control.jaxrs.ecnet;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.project.annotation.JaxrsDescribe;
+import com.x.base.core.project.annotation.JaxrsMethodDescribe;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.http.HttpMediaType;
+import com.x.base.core.project.jaxrs.ResponseFactory;
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+
+@Path("ecnet")
+@JaxrsDescribe("文本纠错")
+public class EcnetAction extends StandardJaxrsAction {
+
+	private static Logger logger = LoggerFactory.getLogger(EcnetAction.class);
+
+	@JaxrsMethodDescribe(value = "文本纠错.", action = ActionCheck.class)
+	@POST
+	@Path("check")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void check(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			JsonElement jsonElement) {
+		ActionResult<ActionCheck.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionCheck().execute(effectivePerson, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+}

+ 12 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ecnet/ExceptionDistrictNotExist.java

@@ -0,0 +1,12 @@
+package com.x.general.assemble.control.jaxrs.ecnet;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionDistrictNotExist extends PromptException {
+
+	private static final long serialVersionUID = 7237855733312562652L;
+
+	ExceptionDistrictNotExist(String name) {
+		super("指定的区域不存在:{}.", name);
+	}
+}

+ 79 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ActionHtmlToWord.java

@@ -0,0 +1,79 @@
+package com.x.general.assemble.control.jaxrs.office;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.project.annotation.FieldDescribe;
+import com.x.base.core.project.gson.GsonPropertyObject;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WoId;
+import com.x.base.core.project.tools.StringTools;
+
+import net.sf.ehcache.Element;
+
+class ActionHtmlToWord extends BaseAction {
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+		byte[] bytes = this.local(wi);
+		HtmlToWordResultObject resultObject = new HtmlToWordResultObject();
+
+		resultObject.setBytes(bytes);
+		resultObject.setName(wi.getFileName());
+		resultObject.setPerson(effectivePerson.getDistinguishedName());
+
+		String flag = StringTools.uniqueToken();
+		cache.put(new Element(flag, resultObject));
+		Wo wo = new Wo();
+		wo.setId(flag);
+		result.setData(wo);
+		return result;
+	}
+
+	private byte[] local(Wi wi) throws Exception {
+		String content = "<html><head></head><body>" + wi.getContent() + "</body></html>";
+		try (POIFSFileSystem fs = new POIFSFileSystem();
+				InputStream is = new ByteArrayInputStream(content.getBytes("UTF-8"));
+				ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+			fs.createDocument(is, "WordDocument");
+			fs.writeFilesystem(out);
+			return out.toByteArray();
+		}
+	}
+
+	public static class Wo extends WoId {
+	}
+
+	public static class Wi extends GsonPropertyObject {
+
+		@FieldDescribe("转换文件名.")
+		private String fileName;
+		@FieldDescribe("内容.")
+		private String content;
+
+		public String getFileName() throws Exception {
+			return StringUtils.isEmpty(fileName) ? StringTools.uniqueToken() + ".doc" : fileName;
+		}
+
+		public void setFileName(String fileName) {
+			this.fileName = fileName;
+		}
+
+		public String getContent() {
+			return content;
+		}
+
+		public void setContent(String content) {
+			this.content = content;
+		}
+
+	}
+
+}

+ 46 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ActionHtmlToWordResult.java

@@ -0,0 +1,46 @@
+package com.x.general.assemble.control.jaxrs.office;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.exception.ExceptionAccessDenied;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WoFile;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+
+import net.sf.ehcache.Element;
+
+class ActionHtmlToWordResult extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionHtmlToWordResult.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {
+		logger.info("{}", flag);
+		ActionResult<Wo> result = new ActionResult<>();
+		String cacheKey = ApplicationCache.concreteCacheKey(flag);
+		Element element = cache.get(cacheKey);
+		if (null != element && null != element.getObjectValue()) {
+			HtmlToWordResultObject obj = (HtmlToWordResultObject) element.getObjectValue();
+			if (!StringUtils.equals(effectivePerson.getDistinguishedName(), obj.getPerson())) {
+				throw new ExceptionAccessDenied(effectivePerson);
+			}
+			Wo wo = new Wo(obj.getBytes(), this.contentType(true, obj.getName()),
+					this.contentDisposition(true, obj.getName()));
+			result.setData(wo);
+		} else {
+			throw new ExceptionHtmlToWordResultObject(flag);
+		}
+		return result;
+	}
+
+	public static class Wo extends WoFile {
+
+		public Wo(byte[] bytes, String contentType, String contentDisposition) {
+			super(bytes, contentType, contentDisposition);
+		}
+
+	}
+
+}

+ 96 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ActionToHtml.java

@@ -0,0 +1,96 @@
+package com.x.general.assemble.control.jaxrs.office;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.poi.hwpf.HWPFDocument;
+import org.apache.poi.hwpf.converter.PicturesManager;
+import org.apache.poi.hwpf.converter.WordToHtmlConverter;
+import org.apache.poi.hwpf.usermodel.PictureType;
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.apache.tika.Tika;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.w3c.dom.Document;
+
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WrapString;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+
+import fr.opensagres.poi.xwpf.converter.xhtml.XHTMLConverter;
+import fr.opensagres.poi.xwpf.converter.xhtml.XHTMLOptions;
+
+public class ActionToHtml extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionToHtml.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, byte[] bytes, FormDataContentDisposition disposition)
+			throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		Tika tika = new Tika();
+		String type = tika.detect(bytes);
+		Wo wo = new Wo();
+		switch (type) {
+		case ("application/msword"):
+			wo.setValue(this.doc(bytes));
+			break;
+		case ("application/vnd.openxmlformats-officedocument.wordprocessingml.document"):
+			wo.setValue(this.docx(bytes));
+			break;
+		default:
+			throw new ExceptionUnsupportType(type);
+		}
+		result.setData(wo);
+		return result;
+	}
+
+	private String doc(byte[] bytes) throws Exception {
+		WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(
+				DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument());
+		wordToHtmlConverter.setPicturesManager(new PicturesManager() {
+			public String savePicture(byte[] content, PictureType pictureType, String suggestedName, float widthInches,
+					float heightInches) {
+				return suggestedName;
+			}
+		});
+		try (ByteArrayInputStream in = new ByteArrayInputStream(bytes);
+				ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+			HWPFDocument wordDocument = new HWPFDocument(in);
+			wordToHtmlConverter.processDocument(wordDocument);
+			Document htmlDocument = wordToHtmlConverter.getDocument();
+			DOMSource domSource = new DOMSource(htmlDocument);
+			StreamResult streamResult = new StreamResult(out);
+			TransformerFactory tf = TransformerFactory.newInstance();
+			Transformer serializer = tf.newTransformer();
+			serializer.setOutputProperty(OutputKeys.ENCODING, "GB2312");// 编码格式
+			serializer.setOutputProperty(OutputKeys.INDENT, "yes");// 是否用空白分割
+			serializer.setOutputProperty(OutputKeys.METHOD, "html");// 输出类型
+			serializer.transform(domSource, streamResult);
+			String content = new String(out.toByteArray());
+			return content;
+		}
+	}
+
+	private String docx(byte[] bytes) throws Exception {
+		try (ByteArrayInputStream in = new ByteArrayInputStream(bytes);
+				ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+			XWPFDocument document = new XWPFDocument(in);
+			XHTMLOptions options = XHTMLOptions.create();
+			XHTMLConverter.getInstance().convert(document, out, options);
+			return new String(out.toByteArray());
+		}
+	}
+
+	public static class Wo extends WrapString {
+
+	}
+
+}

+ 44 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/BaseAction.java

@@ -0,0 +1,44 @@
+package com.x.general.assemble.control.jaxrs.office;
+
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.gson.GsonPropertyObject;
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+
+import net.sf.ehcache.Ehcache;
+
+abstract class BaseAction extends StandardJaxrsAction {
+
+	protected static Ehcache cache = ApplicationCache.instance().getCache(BaseAction.class);
+
+	public static class HtmlToWordResultObject extends GsonPropertyObject {
+
+		private byte[] bytes;
+		private String name;
+		private String person;
+
+		public byte[] getBytes() {
+			return bytes;
+		}
+
+		public void setBytes(byte[] bytes) {
+			this.bytes = bytes;
+		}
+
+		public String getName() {
+			return name;
+		}
+
+		public void setName(String name) {
+			this.name = name;
+		}
+
+		public String getPerson() {
+			return person;
+		}
+
+		public void setPerson(String person) {
+			this.person = person;
+		}
+
+	}
+}

+ 13 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ExceptionHtmlToWordResultObject.java

@@ -0,0 +1,13 @@
+package com.x.general.assemble.control.jaxrs.office;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionHtmlToWordResultObject extends PromptException {
+
+	private static final long serialVersionUID = -4908883340253465376L;
+
+	ExceptionHtmlToWordResultObject(String flag) {
+		super("指定的Word结果不存在:{}.", flag);
+	}
+
+}

+ 12 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/ExceptionUnsupportType.java

@@ -0,0 +1,12 @@
+package com.x.general.assemble.control.jaxrs.office;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionUnsupportType extends PromptException {
+
+	private static final long serialVersionUID = 7237855733312562652L;
+
+	ExceptionUnsupportType(String type) {
+		super("不支持的文件格式: {}.", type);
+	}
+}

+ 89 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/office/OfficeAction.java

@@ -0,0 +1,89 @@
+package com.x.general.assemble.control.jaxrs.office;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.FormDataParam;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.project.annotation.JaxrsDescribe;
+import com.x.base.core.project.annotation.JaxrsMethodDescribe;
+import com.x.base.core.project.annotation.JaxrsParameterDescribe;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.http.HttpMediaType;
+import com.x.base.core.project.jaxrs.ResponseFactory;
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+
+@Path("office")
+@JaxrsDescribe("office文件转换")
+public class OfficeAction extends StandardJaxrsAction {
+
+	private static Logger logger = LoggerFactory.getLogger(OfficeAction.class);
+
+	@JaxrsMethodDescribe(value = "转换成html.", action = ActionToHtml.class)
+	@POST
+	@Consumes(MediaType.MULTIPART_FORM_DATA)
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	public void input(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@FormDataParam(FILE_FIELD) final byte[] bytes,
+			@JaxrsParameterDescribe("office文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
+		ActionResult<ActionToHtml.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionToHtml().execute(effectivePerson, bytes, disposition);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "html转换成word.", action = ActionHtmlToWord.class)
+	@POST
+	@Path("html/to/word")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void htmlToWord(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			JsonElement jsonElement) {
+		ActionResult<ActionHtmlToWord.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionHtmlToWord().execute(effectivePerson, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, jsonElement);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "html转换成word结果流文件.", action = ActionHtmlToWordResult.class)
+	@GET
+	@Path("html/to/word/result/{flag}")
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void htmlToWordResult(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("标识") @PathParam("flag") String flag) {
+		ActionResult<ActionHtmlToWordResult.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionHtmlToWordResult().execute(effectivePerson, flag);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+}

+ 1 - 0
o2server/x_general_assemble_control/src/main/webapp/WEB-INF/web.xml

@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><web-app id="x_general_assemble_control" metadata-complete="false" version="3.0"><display-name>x_general_assemble_control</display-name><context-param><param-name>project</param-name><param-value>com.x.base.core.project.x_general_assemble_control</param-value></context-param></web-app>

+ 258 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/attachment.js

@@ -0,0 +1,258 @@
+attachment_parameter = {
+    first : '(0)',
+    last : '(0)',
+    count : 20
+};
+
+function attachment_list_next(id) {
+    var id = (id ? id : attachment_parameter.last);
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/attachment/list/' + id + '/next/' + attachment_parameter.count,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    if (json.data.length > 0) {
+		attachment_parameter.first = json.data[0].id;
+		attachment_parameter.last = json.data[json.data.length - 1].id;
+	    } else {
+		attachment_parameter.first = '(0)';
+	    }
+	    attachment_grid(json.data);
+	} else {
+	    failure(data);
+	}
+    });
+}
+
+function attachment_list_prev(id) {
+    var id = (id ? id : attachment_parameter.first);
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/attachment/list/' + id + '/prev/' + attachment_parameter.count,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    if (json.data.length > 0) {
+		attachment_parameter.first = json.data[0].id;
+		attachment_parameter.last = json.data[json.data.length - 1].id;
+	    } else {
+		attachment_parameter.last = '(0)';
+	    }
+	    attachment_grid(json.data);
+	} else {
+	    failure(data);
+	}
+    });
+}
+
+function attachment_grid(items) {
+    var str = '<table border="1" width="100%"><tobdy>';
+    str += '<tr><th>rank</th><th>id</th><th>name</th><th>fileName</th><th>summary</th><th>length</th><th>operate</th></tr>';
+    $.each(items, function(index, item) {
+	str += '<tr>';
+	str += '<td>' + item.rank + '</td>';
+	str += '<td>' + item.id + '</td>';
+	str += '<td>' + item.name + '</td>';
+	str += '<td>' + item.fileName + '</td>';
+	str += '<td>' + item.summary + '</td>';
+	str += '<td>' + item.length + '</td>';
+	str += '<td>';
+	str += '<a href="#" onclick="attachment_download_select(\'' + item.id + '\')">download</a>&nbsp;';
+	str += '<a href="#" onclick="attachment_update_select(\'' + item.id + '\')">update</a>&nbsp;';
+	str += '<a href="#" onclick="attachment_delete_select(\'' + item.id + '\')">delete</a>';
+	str += '</td>';
+	str += '</tr>';
+    });
+    str += '</tobdy></table>';
+    $('#content').html(str);
+}
+
+function attachment_get_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="get">get</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%" /></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#get').click(function() {
+	attachment_get($('#id').val());
+    });
+}
+
+function attachment_get(id) {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/attachment/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function attachment_listWithMeeting_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="get">get</a></td></tr>';
+    str += '<tr><td>meeting:</td><td><input type="text" id="meeting" style="width:95%" ></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#get').click(function() {
+	attachment_listWithMeeting($('#meeting').val());
+    });
+}
+
+function attachment_listWithMeeting(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/attachment/list/meeting/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    attachment_grid(json.data);
+	}
+    });
+}
+
+function attachment_post_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="post">post</a></td></tr>';
+    str += '<tr><td>meeting:</td><td><input type="text" id="meeting" style="width:95%" /></td></tr>';
+    str += '<tr><td>type:</td><td><select id="type"><option value="attachment">attachment</option><option value="summary">summary</option></select></td></tr>';
+    str += '<tr><td>file:</td><td><input type="file" id="file" style="width:95%" ></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#post').click(function() {
+	attachment_post();
+    });
+}
+
+function attachment_post() {
+    var formData = new FormData();
+    $.each($('input[type=file]'), function(index, item) {
+	formData.append('file', item.files[0]);
+    });
+    var url = '../servlet/attachment/upload/meeting/' + $('#meeting').val();
+    url += $('#type').val() == 'summary' ? '/summary' : '';
+    $.ajax({
+	type : 'POST',
+	url : url,
+	data : formData,
+	contentType : false,
+	processData : false,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    });
+}
+
+function attachment_put_select(id) {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="put">put</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%" ></td></tr>';
+    str += '<tr><td>file:</td><td><input type="file" id="file" style="width:95%" ></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    if (id) {
+	$('#id').val(id);
+    }
+    $('#put').click(function() {
+	attachment_put();
+    });
+}
+
+function attachment_put() {
+    $('#result').html('');
+    var formData = new FormData();
+    $.each($('input[type=file]'), function(index, item) {
+	formData.append('file', item.files[0]);
+    });
+    $.ajax({
+	type : 'POST',
+	url : '../servlet/attachment/update/' + $('#id').val(),
+	data : formData,
+	contentType : false,
+	processData : false,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    });
+}
+
+function attachment_download_select(id) {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="get">get</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%" ></td></tr>';
+    str += '<tr><td>type:</td><td><select id="type"><option value="stream">stream</option><option value="contentType">contentType</option></select></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    if (id) {
+	$('#id').val(id);
+    }
+    $('#get').click(function() {
+	attachment_download();
+    });
+}
+
+function attachment_download() {
+    var url = '../servlet/attachment/download/' + $('#id').val();
+    if ($('#type').val() == 'stream') {
+	url += '/stream';
+    }
+    window.open(url, '_blank');
+}
+
+function attachment_delete_select(id) {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="delete">delete</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%" ></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    if (id) {
+	$('#id').val(id);
+    }
+    $('#delete').click(function() {
+	attachment_delete($('#id').val());
+    });
+}
+
+function attachment_delete(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'delete',
+	dataType : 'json',
+	url : '../jaxrs/attachment/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}

+ 297 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/building.js

@@ -0,0 +1,297 @@
+building_parameter = {
+
+};
+
+function building_grid(items, gridRoom) {
+    var str = '<table border="1" width="100%"><tbody>';
+    str += '<tr><th>id</th><th>name</th><th>address</th><th>operate</th></tr>';
+    if (items) {
+	$.each(items, function(index, item) {
+	    str += '<tr>';
+	    str += '<td>' + item.id + '</td>';
+	    str += '<td>' + item.name + '</td>';
+	    str += '<td>' + item.address + '</td>';
+	    str += '<td>';
+	    str += '<a href="#" onclick="building_put_init(\'' + item.id + '\')">edit</a>&nbsp;';
+	    str += '<a href="#" onclick="building_delete(\'' + item.id + '\')">delete</a>';
+	    str += '</td>';
+	    str += '</tr>';
+	    if (gridRoom) {
+		str += building_grid_room(item.roomList);
+	    }
+	});
+    }
+    str += '</tobdy></table>';
+    $('#content').html(str);
+}
+
+function building_grid_room(items) {
+    var str = "";
+    if (items) {
+	$.each(items, function(index, item) {
+	    str += '<tr>';
+	    str += '<td>' + item.name + '</td>';
+	    str += '<td>' + item.id + '</td><td>';
+	    if (item.photo && item.photo != '') {
+		str += '<img src="data:image/png;base64,' + item.photo + '"/>';
+	    } else {
+		str += '&nbsp;';
+	    }
+	    str += '</td><td>';
+	    str += '<a href="#" onclick="room_put_select(\'' + item.id + '\')">edit</a>&nbsp;';
+	    str += '<a href="#" onclick="room_delete_select(\'' + item.id + '\')">delete</a>&nbsp;';
+	    str += '<a href="#" onclick="room_update_photo_init(\'' + item.id + '\')">photo</a>';
+	    str += '</td>';
+	    str += '</tr>';
+	});
+    }
+    return str;
+}
+
+function building_list() {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/building/list',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    building_grid(json.data, true);
+	}
+    });
+}
+
+function building_listCheckRoomIdle_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="list">list</a>';
+    str += '</td></tr>';
+    str += '<tr><td>start(yyyy-MM-dd HH:mm):</td><td><input type="text" id="start" style="width:95%"/></td></tr>';
+    str += '<tr><td>completed(yyyy-MM-dd HH:mm):</td><td><input type="text" id="completed" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#list').click(function() {
+	building_listCheckRoomIdle($('#start').val(), $('#completed').val());
+    });
+}
+
+function building_listCheckRoomIdle(start, completed) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/building/list//start/' + start + '/completed/' + completed,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    building_grid(json.data, true);
+	}
+    });
+}
+
+function building_post_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="post">post</a></td></tr>';
+    str += '<tr><td>name:</td><td><input type="text" id="name" style="width:95%"/></td></tr>';
+    str += '<tr><td>address:</td><td><input type="text" id="address" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#post').click(function() {
+	building_post();
+    });
+}
+
+function building_post() {
+    $('#result').html('');
+    $.ajax({
+	type : 'post',
+	dataType : 'json',
+	url : '../jaxrs/building',
+	contentType : 'application/json; charset=utf-8',
+	data : JSON.stringify({
+	    name : $('#name').val(),
+	    address : $('#address').val()
+	}),
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function building_put_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">';
+    str += '<a href="#" id="select">select</a>';
+    str += '</td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#select').click(function() {
+	building_put_init($('#id').val());
+    });
+}
+
+function building_put_init(id) {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="put">put</a></td></tr>';
+    str += '<tr><td>id:</td><td id="id"></td></tr>';
+    str += '<tr><td>name:</td><td><input type="text" id="name" style="width:95%"/></td></tr>';
+    str += '<tr><td>address:</td><td><input type="text" id="address" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#put').click(function() {
+	building_put(id);
+    });
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/building/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    $('#id').html(json.data.id);
+	    $('#name').val(json.data.name);
+	    $('#address').val(json.data.address);
+	}
+    });
+}
+
+function building_put(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'put',
+	dataType : 'json',
+	url : '../jaxrs/building/' + id,
+	contentType : 'application/json; charset=utf-8',
+	data : JSON.stringify({
+	    name : $('#name').val(),
+	    address : $('#address').val()
+	}),
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function building_delete_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">';
+    str += '<a href="#" id="delete">delete</a>';
+    str += '</td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#select').click(function() {
+	building_delete($('#id').val());
+    });
+}
+
+function building_delete(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'delete',
+	dataType : 'json',
+	url : '../jaxrs/building/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function building_search_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">';
+    str += '<a href="#" id="listPinyinInitial">listPinyinInitial</a>';
+    str += '&nbsp;';
+    str += '<a href="#" id="listLike">listLike</a>';
+    str += '&nbsp;';
+    str += '<a href="#" id="listLikePinyin">listLikePinyin</a>';
+    str += '</td></tr>';
+    str += '<tr><td>key:</td><td><input type="text" id="key" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#listPinyinInitial').click(function() {
+	building_listPinyinInitial($('#key').val());
+    });
+    $('#listLike').click(function() {
+	building_listLike($('#key').val());
+    });
+    $('#listLikePinyin').click(function() {
+	building_listLikePinyin($('#key').val());
+    });
+}
+
+function building_listPinyinInitial(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/building/list/pinyininitial/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	building_grid(json.data, false);
+    });
+}
+
+function building_listLike(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/building/list/like/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	building_grid(json.data, false);
+    });
+}
+
+function building_listLikePinyin(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/building/list/like/pinyin/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	building_grid(json.data, false);
+    });
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 6 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/clipboard.min.js


+ 26 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/common.js

@@ -0,0 +1,26 @@
+function failure(data) {
+    console.log(data);
+    alert(data.message);
+}
+
+function splitValue(str) {
+    if (str) {
+	if (str.length > 0) {
+	    return str.split(',');
+	}
+    }
+    return [];
+}
+
+function joinValue(o, split) {
+    var s = ',';
+    if (split) {
+	s = '' + split;
+    }
+    if (o) {
+	if (toString.apply(o) === '[object Array]') {
+	    return o.join(s);
+	}
+    }
+    return o;
+}

+ 77 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/debug.js

@@ -0,0 +1,77 @@
+debug_parameter = {};
+
+function debug_init() {
+    $('#result').html('');
+    $('#content').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="get">get</a>&nbsp<a href="#" id="on">on</a>&nbsp;<a href="#" id="off">off</a></td></tr>';
+    str += '<tr><td>debug:</td><td id="status">&nbsp;</td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#get').click(function() {
+	debug_get();
+    });
+    $('#on').click(function() {
+	debug_on();
+    });
+    $('#off').click(function() {
+	debug_off();
+    });
+}
+
+function debug_get() {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/debug',
+	contentType : 'application/json; charset=utf-8',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	if (json.type == 'success') {
+	    $('#status').html(json.data.value + '');
+	}
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function debug_on() {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/debug/true',
+	contentType : 'application/json; charset=utf-8',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	if (json.type == 'success') {
+	    $('#status').html(json.data.value + '');
+	}
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function debug_off() {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/debug/false',
+	contentType : 'application/json; charset=utf-8',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	if (json.type == 'success') {
+	    $('#status').html(json.data.value + '');
+	}
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}

+ 1349 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/describe.js

@@ -0,0 +1,1349 @@
+var Describe = function() {
+	// 20180730
+}
+Describe.splitValue = function(str) {
+	if (str) {
+		if (str.length > 0) {
+			return str.split(',');
+		}
+	}
+	return [];
+}
+Describe.joinValue = function(o, split) {
+	var s = ',';
+	if (split) {
+		s = '' + split;
+	}
+	if (o) {
+		if (toString.apply(o) === '[object Array]') {
+			return o.join(s);
+		}
+	}
+	return o;
+}
+Describe.doPost = function(address, m, data) {
+	$('#url').html(address);
+	if ((m.resultContentType) && m.resultContentType.indexOf('application/json') > -1) {
+		$.ajax({
+			url : address,
+			type : 'POST',
+			headers : {
+				'x-debugger' : true
+			},
+			contentType : (m.contentType.indexOf('application/json') > -1) ? m.contentType : false,
+			processData : (m.contentType.indexOf('application/json') > -1) ? true : false,
+			xhrFields : {
+				'withCredentials' : true
+			},
+			data : ((m.contentType.indexOf('application/json') > -1) && (!m.useStringParameter) ? JSON.stringify(data) : data)
+		}).always(function(resultJson) {
+			$('#result').html(JSON.stringify(resultJson, null, 4));
+			Describe.writeOut(m.outs, resultJson);
+		});
+	} else {
+		$.ajax({
+			url : address,
+			type : 'POST',
+			headers : {
+				'x-debugger' : true
+			},
+			contentType : (m.contentType.indexOf('application/json') > -1) ? m.contentType : false,
+			processData : (m.contentType.indexOf('application/json') > -1) ? true : false,
+			xhrFields : {
+				'withCredentials' : true
+			},
+			data : ((m.contentType.indexOf('application/json') > -1) && (!m.useStringParameter) ? JSON.stringify(data) : data)
+		});
+	}
+}
+Describe.doPut = function(address, m, data) {
+	$('#url').html(address);
+	if ((m.resultContentType) && m.resultContentType.indexOf('application/json') > -1) {
+		$.ajax({
+			url : address,
+			type : 'PUT',
+			headers : {
+				'x-debugger' : true
+			},
+			contentType : (m.contentType.indexOf('application/json') > -1) ? m.contentType : false,
+			processData : (m.contentType.indexOf('application/json') > -1) ? true : false,
+			xhrFields : {
+				'withCredentials' : true
+			},
+			data : ((m.contentType.indexOf('application/json') > -1) && (!m.useStringParameter) ? JSON.stringify(data) : data)
+		}).always(function(resultJson) {
+			$('#result').html(JSON.stringify(resultJson, null, 4));
+			Describe.writeOut(m.outs, resultJson);
+		});
+	} else {
+		$.ajax({
+			url : address,
+			type : 'PUT',
+			headers : {
+				'x-debugger' : true
+			},
+			contentType : (m.contentType.indexOf('application/json') > -1) ? m.contentType : false,
+			processData : (m.contentType.indexOf('application/json') > -1) ? true : false,
+			xhrFields : {
+				'withCredentials' : true
+			},
+			data : ((m.contentType.indexOf('application/json') > -1) && (!m.useStringParameter) ? JSON.stringify(data) : data)
+		});
+	}
+}
+Describe.doGet = function(address, m) {
+	$('#url').html(address);
+	if ((m.resultContentType) && m.resultContentType.indexOf('application/json') > -1) {
+		$.ajax({
+			type : 'GET',
+			dataType : 'json',
+			url : address,
+			headers : {
+				'x-debugger' : true
+			},
+			contentType : m.contentType,
+			xhrFields : {
+				'withCredentials' : true
+			},
+			crossDomain : true
+		}).always(function(resultJson) {
+			$('#result').html(JSON.stringify(resultJson, null, 4));
+			Describe.writeOut(m.outs, resultJson);
+		});
+	} else {
+		window.open(address, '_blank');
+	}
+}
+Describe.doDelete = function(address, m) {
+	$('#url').html(address);
+	if ((m.resultContentType) && m.resultContentType.indexOf('application/json') > -1) {
+		$.ajax({
+			type : 'DELETE',
+			dataType : 'json',
+			url : address,
+			headers : {
+				'x-debugger' : true
+			},
+			contentType : m.contentType,
+			xhrFields : {
+				'withCredentials' : true
+			},
+			crossDomain : true
+		}).always(function(resultJson) {
+			$('#result').html(JSON.stringify(resultJson, null, 4));
+			Describe.writeOut(m.outs, resultJson);
+		});
+	} else {
+		$.ajax({
+			type : 'DELETE',
+			dataType : 'json',
+			url : address,
+			headers : {
+				'x-debugger' : true
+			},
+			contentType : m.contentType,
+			xhrFields : {
+				'withCredentials' : true
+			},
+			crossDomain : true
+		});
+	}
+}
+Describe.writeOut = function(outs, json) {
+	if (outs && (outs.length) && json && json.data) {
+		$.each(Object.keys(json.data), function(i, k) {
+			$('#out_' + k + '_out', '#outs').html(json.data[k]);
+		});
+	}
+}
+
+Describe.createSampleMootools = function(m) {
+	debugger;
+	var address = window.location.href;
+	address = address.substring(0,address.indexOf("/jest/"));
+	var address = address +"/"+ m.path;
+	if (m.pathParameters && m.pathParameters.length > 0) {
+		$.each(m.pathParameters, function(pi, p) {
+			address = address.replace('{' + p.name + '}', '替换参数'+pi);
+		});
+	}
+	if (m.queryParameters && m.queryParameters.length > 0) {
+		$.each(m.queryParameters, function(pi, p) {
+			var query = p.name + '=' + '替换参数'+pi;
+			if (address.indexOf("?") > 0) {
+				address += '&' + query;
+			} else {
+				address += '?' + query;
+			}
+		});
+	}
+	
+	var strSample="";
+	if (m.contentType.indexOf('application/json') > -1) {
+		        strSample =  "var data = {};" + "\n";
+			if (m.ins && m.ins.length > 0) {
+				$.each(m.ins, function(ii, i) {
+							switch (i.type) {
+						default:
+							if (i.isBaseType) {
+								if (i.isCollection) {
+									  strSample += '       data["'+i.name+'"] = ["参数1"];' + "\n";
+								} else {
+									  strSample += '       data["'+i.name+'"] = "参数";' + "\n";
+								}
+							} else {
+									if(i.isCollection){
+										if(i.fieldValue){
+										  if(i.fieldType =='enum'){
+											   strSample += '       data["'+i.name+'"] = ["'+ i.fieldValue +'"];'+"\n";	
+										  }else{
+											   strSample += '       data["'+i.name+'"] = ['+ i.fieldValue +'];'+"\n";	
+										  }
+										  
+										}else{
+										  strSample += '       data["'+i.name+'"] = [{"参数1":"value1","参数2":"value2"}];'+"\n";
+										}
+									}else{
+										  if(i.fieldType =='enum'){
+												   strSample += '       data["'+i.name+'"] = "'+ i.fieldValue +'";'+"\n";	
+											  }else{
+												  
+													strSample += '       data["'+i.name+'"] = {"参数1":"value1","参数2":"value2"};'+"\n";
+											  }
+									}
+							}
+						}
+				});
+			} else if (m.useJsonElementParameter) {
+				strSample += 'data = {"参数1":"value1","参数2":"value2"};' +"\n";
+			} else if (m.useStringParameter) {
+				strSample += 'data = "参数";'+"\n";
+			}
+
+			strSample += " \n var mootoolsRequest = new Request({" + "\n";
+		    strSample += "        url:'"+address + "',\n";
+			strSample += "        method:'"+ m.type + "',\n";
+			strSample += "        dataType:'json',\n";
+		    strSample += "        headers : {'Content-Type':'application/json;charset=utf8','x-token':'实际的x-token'}" + ",\n";
+			if((m.contentType.indexOf('application/json') > -1) && (!m.useStringParameter)){
+				strSample += "        data:JSON.stringify(data),\n";
+			}else{
+			  	strSample += "        data:data,\n";
+			}
+            strSample += "        onRequest: function(){ },"+ "\n";
+            strSample += "        onSuccess: function(responseText){},"+ "\n";
+            strSample += "        onFailure: function(){}"+ "\n";
+           strSample +="}).send();"+ "\n";
+	} else {
+		/*
+			strSample = "var formData = new FormData();" + "\n";
+			if (m.formParameters && m.formParameters.length > 0) {
+				$.each(m.formParameters, function(pi, p) {
+					if (p.type == "File") {
+							//formData.append(p.name, $('input[type=file]', '#formParameters')[0].files[0]);
+					strSample += 'formData.append("'+p.name+'", $("input[type=file]")[0].files[0]);' +  "\n";
+					} else {
+					strSample += 'formData.append("'+p.name+'", "参数'+pi+'");' +  "\n";
+					}
+				});
+			}
+			
+			strSample += "$.ajax({" + "\n";
+			strSample += "type : '"+ m.type + "',\n";
+			strSample += "url : '"+address + "',\n";
+			strSample += "headers : {'x-debugger' : true}" + ",\n";
+			strSample += "contentType : false,\n";
+			strSample += "processData  : false,\n";
+			strSample += "xhrFields : {'withCredentials' : true}" + ",\n";
+			strSample += "crossDomain : true"+ ",\n";
+			strSample += "data : formData"+"\n";
+			strSample += "});";	
+			*/
+	}
+
+	return  strSample;
+   }
+   
+Describe.createSampleJSO2= function(m) {
+	var address = window.location.href;
+	    address = address.substring(0,address.indexOf("/jest/"));
+	var uri = address.substring(address.lastIndexOf("/")+1,address.length);
+	 address =  m.path;
+	 address = address.substring(address.indexOf("jaxrs/")+6,address.length);
+	var parameter = "";
+	if (m.pathParameters && m.pathParameters.length > 0) {
+		$.each(m.pathParameters, function(pi, p) {
+			address = address.replace('{' + p.name + '}', '替换参数'+pi);
+			if(parameter == ""){
+				parameter = "\"" + p.name + "\"" + ":" + '"替换参数'+pi +'"';
+			}else{
+				parameter = parameter +  ",\"" + p.name + "\"" + ":" + '替换参数'+pi +'"';
+			}
+		});
+	}
+	if (m.queryParameters && m.queryParameters.length > 0) {
+		$.each(m.queryParameters, function(pi, p) {
+			var query = p.name + '=' + '替换参数'+pi;
+			if (address.indexOf("?") > 0) {
+				address += '&' + query;
+			} else {
+				address += '?' + query;
+			}
+		});
+	}
+	
+	var strSample="";
+	if (m.contentType.indexOf('application/json') > -1) {
+		  strSample =  "var data = {};" + "\n";
+			if (m.ins && m.ins.length > 0) {
+				$.each(m.ins, function(ii, i) {
+					switch (i.type) {
+						default:
+							if (i.isBaseType) {
+								if (i.isCollection) {
+									  strSample += '       data["'+i.name+'"] = ["参数1"];' + "\n";
+								} else {
+									  strSample += '       data["'+i.name+'"] = "参数";' + "\n";
+								}
+							} else {
+									if(i.isCollection){
+										if(i.fieldValue){
+										  if(i.fieldType =='enum'){
+											   strSample += '       data["'+i.name+'"] = ["'+ i.fieldValue +'"];'+"\n";	
+										  }else{
+											   strSample += '       data["'+i.name+'"] = ['+ i.fieldValue +'];'+"\n";	
+										  }
+										  
+										}else{
+										  strSample += '       data["'+i.name+'"] = [{"参数1":"value1","参数2":"value2"}];'+"\n";
+										}
+									}else{
+										if(i.fieldType =='enum'){
+										  strSample += '       data["'+i.name+'"] = "'+ i.fieldValue + '";' + "\n";
+										}else{
+										  strSample += '       data["'+i.name+'"] = {"参数1":"value1","参数2":"value2"};'+"\n";
+										}
+									}
+							}
+						}
+				});
+			} else if (m.useJsonElementParameter) {
+				strSample += 'data = {"参数1":"value1","参数2":"value2"};' +"\n";
+			} else if (m.useStringParameter) {
+				strSample += 'data = "参数";'+"\n";
+			}
+			 var functionName = "do";
+			 strSample += "\n var root = \"" + uri + "\";" + "\n";
+			 strSample += " var options = { " + "\n";
+			 strSample += "                 " + functionName + ":{ //服务命名1,自定义"+ "\n";
+			 strSample += "                           \"uri\": \"/" + m.path + "\","+ "\n";;
+             strSample += "                           \"method\": \""+m.type+"\""+ "\n";
+			 strSample += "                      }"+ "\n";
+			 strSample += "     }" + "\n";
+			 strSample += "var action = new this.Action( root, options);" + "\n\n";
+			 strSample += "action.invoke({" + "\n";
+			 strSample += "        \"name\": \"" + functionName+ "\", //自定义的服务名" + "\n"; 
+			 strSample += "        \"parameter\": {" + parameter+ "},  //uri参数 " + "\n"; 
+             strSample += "        \"data\": data, //请求的正文, JsonObject " +  "\n"; 
+             strSample += "        \"success\": function(json){ //服务调用成功时的回调方法,json 是服务返回的数据" +  "\n"; 
+             strSample += "        //这里进行具体的处理"+ "\n"; 
+             strSample += "        }.bind(this),"+ "\n"; 
+             strSample += "        \"failure\" : function(xhr){ //服务调用失败时的回调方法,xhr 为 XMLHttpRequest 对象" +  "\n";
+             strSample += "        //这里进行具体的处理"+ "\n"; 
+             strSample += "     },"+ "\n"; 
+             strSample += "        \"async\" : true, //同步还是异步,默认为true" + "\n"; 
+             strSample += "        \"withCredentials\" : true, //是否允许跨域请求,默认为true" + "\n"; 
+             strSample += "        \"urlEncode\" : true //uri参数是否需要通过encodeURIComponent函数编码,默认为true" + "\n";
+             strSample += "});"			
+	} else {
+		
+	}
+	return  strSample;
+  }   
+   
+   
+   
+Describe.createSampleO2= function(m) {
+	var address = window.location.href;
+	    address = address.substring(0,address.indexOf("/jest/"));
+	var uri = address.substring(address.lastIndexOf("/")+1,address.length);
+	 address =  m.path;
+	 address = address.substring(address.indexOf("jaxrs/")+6,address.length);
+	if (m.pathParameters && m.pathParameters.length > 0) {
+		$.each(m.pathParameters, function(pi, p) {
+			address = address.replace('{' + p.name + '}', '替换参数'+pi);
+		});
+	}
+	if (m.queryParameters && m.queryParameters.length > 0) {
+		$.each(m.queryParameters, function(pi, p) {
+			var query = p.name + '=' + '替换参数'+pi;
+			if (address.indexOf("?") > 0) {
+				address += '&' + query;
+			} else {
+				address += '?' + query;
+			}
+		});
+	}
+	
+	var strSample="";
+	if (m.contentType.indexOf('application/json') > -1) {
+		  strSample =  "var data = {};" + "\n";
+			if (m.ins && m.ins.length > 0) {
+				$.each(m.ins, function(ii, i) {
+						switch (i.type) {
+						default:
+							if (i.isBaseType) {
+								if (i.isCollection) {
+									  strSample += '       data["'+i.name+'"] = ["参数1"];' + "\n";
+								} else {
+									  strSample += '       data["'+i.name+'"] = "参数";' + "\n";
+								}
+							} else {
+									if(i.isCollection){
+										if(i.fieldValue){
+										  if(i.fieldType =='enum'){
+											   strSample += '       data["'+i.name+'"] = ["'+ i.fieldValue +'"];'+"\n";	
+										  }else{
+											   strSample += '       data["'+i.name+'"] = ['+ i.fieldValue +'];'+"\n";	
+										  }
+										  
+										}else{
+										  strSample += '       data["'+i.name+'"] = [{"参数1":"value1","参数2":"value2"}];'+"\n";
+										}
+									}else{
+										if(i.fieldType =='enum'){
+											 
+											strSample += '       data["'+i.name+'"] = "'+i.fieldValue+'"\n';
+										}else{
+											strSample += '       data["'+i.name+'"] = {"参数1":"value1","参数2":"value2"};'+"\n";
+										}
+									
+									}
+							}
+						}
+				});
+			} else if (m.useJsonElementParameter) {
+				strSample += 'data = {"参数1":"value1","参数2":"value2"};' +"\n";
+			} else if (m.useStringParameter) {
+				strSample += 'data = "参数";'+"\n";
+			}
+			
+			
+			if(m.type=="POST"){
+			   strSample += " \n var string = JSON.stringify(data);" + "\n";
+               strSample += " var applications = this.Action.applications;"+ "\n";
+               strSample += " var serviceRoot = \"" + uri + "\";"+ "\n";
+               strSample += " var path = \"" + address + "\";"+ "\n"; ;
+               strSample += " var resp = applications.postQuery( serviceRoot, path , string);"+ "\n";
+			}
+			if(m.type=="GET"){
+               strSample += " \n var applications = this.Action.applications;"+ "\n";
+               strSample += " var serviceRoot = \"" + uri + "\";"+ "\n";
+                strSample += " var path = \"" + address + "\";"+ "\n"; ;
+               strSample += " var resp = applications.getQuery( serviceRoot, path );"+ "\n";
+			}
+			if(m.type=="PUT"){
+			   strSample += " \n var string = JSON.stringify(data)"+ "\n";
+               strSample += " var applications = this.Action.applications"+ "\n";
+               strSample += " var serviceRoot = \"" + uri + "\";"+ "\n";
+               strSample += " var path = \"" + address+ "\";"+ "\n"; ;
+               strSample += " var resp = applications.putQuery( serviceRoot, path , string);"+ "\n";
+			}
+			if(m.type=="DELETE"){
+			   strSample += " \n var applications = this.Action.applications;"+ "\n";
+               strSample += " var serviceRoot = \" "+ uri + "\";"+ "\n";
+                 strSample += " var path = \"" + address + "\";"+ "\n"; ;
+               strSample += " var resp = applications.deleteQuery( serviceRoot, path);"+ "\n";
+			}
+			
+               strSample += " var json = JSON.parse( resp.toString() );"+ "\n";
+			
+	} else {
+		
+	}
+	return  strSample;
+  }
+Describe.createSample= function(m) {
+	var address = window.location.href;
+	address = address.substring(0,address.indexOf("/jest/"));
+	var address = address +"/"+ m.path;
+	if (m.pathParameters && m.pathParameters.length > 0) {
+		$.each(m.pathParameters, function(pi, p) {
+			address = address.replace('{' + p.name + '}', '替换参数'+pi);
+		});
+	}
+	if (m.queryParameters && m.queryParameters.length > 0) {
+		$.each(m.queryParameters, function(pi, p) {
+			var query = p.name + '=' + '替换参数'+pi;
+			if (address.indexOf("?") > 0) {
+				address += '&' + query;
+			} else {
+				address += '?' + query;
+			}
+		});
+	}
+	
+	var strSample="";
+	if (m.contentType.indexOf('application/json') > -1) {
+			if (m.ins && m.ins.length > 0) {
+				strSample =  "var data = {};" + "\n";
+				$.each(m.ins, function(ii, i) {
+						switch (i.type) {
+						default:
+							if (i.isBaseType) {
+								if (i.isCollection) {
+									  strSample += '       data["'+i.name+'"] = ["参数1"];' + "\n";
+								} else {
+									  strSample += '       data["'+i.name+'"] = "参数";' + "\n";
+								}
+							} else {
+									if(i.isCollection){
+										if(i.fieldValue){
+										  if(i.fieldType =='enum'){
+											   strSample += '       data["'+i.name+'"] = ["'+ i.fieldValue +'"];'+"\n";	
+										  }else{
+											   strSample += '       data["'+i.name+'"] = ['+ i.fieldValue +'];'+"\n";	
+										  }
+										  
+										}else{
+										  strSample += '       data["'+i.name+'"] = [{"参数1":"value1","参数2":"value2"}];'+"\n";
+										}
+									}else{
+										if(i.fieldType =='enum'){
+											 
+											strSample += '       data["'+i.name+'"] = "'+i.fieldValue+'"\n';
+										}else{
+											strSample += '       data["'+i.name+'"] = {"参数1":"value1","参数2":"value2"};'+"\n";
+										}
+										
+										
+									}
+							}
+						}
+				});
+			} else if (m.useJsonElementParameter) {
+				strSample += '    data = {"参数1":"value1","参数2":"value2"};' +"\n";
+			} else if (m.useStringParameter) {
+				strSample += '    data = "参数";'+"\n";
+			}
+			
+			strSample += "\n$.ajax({" + "\n";
+			strSample += "        type : '"+ m.type + "',\n";
+			strSample += "        dataType : 'json'" + ",\n";
+			strSample += "        url : '"+address + "',\n";
+			strSample += "        headers : {'x-debugger' : true}" + ",\n";
+			strSample += "        contentType : '"+m.contentType+ "',\n";
+			strSample += "        xhrFields : {'withCredentials' : true}" + ",\n";
+			strSample += "        crossDomain : true"+ ",\n";
+			
+		   if((m.contentType.indexOf('application/json') > -1) && (!m.useStringParameter)){
+			 strSample += "       data : JSON.stringify(data),\n";
+			}else{
+			  strSample += "      data : data"+"\n";
+			}
+			
+			strSample += "}).always(function(resultJson) {"+"\n";
+			strSample += "        alert(JSON.stringify(resultJson, null, 4))" +"\n";
+			strSample += "});";
+			
+	} else {
+			strSample = "var formData = new FormData();" + "\n";
+			if (m.formParameters && m.formParameters.length > 0) {
+				$.each(m.formParameters, function(pi, p) {
+					if (p.type == "File") {
+							//formData.append(p.name, $('input[type=file]', '#formParameters')[0].files[0]);
+					strSample += 'formData.append("'+p.name+'", $("input[type=file]")[0].files[0]);' +  "\n";
+					} else {
+					strSample += 'formData.append("'+p.name+'", "参数'+pi+'");' +  "\n";
+					}
+				});
+			}
+			strSample += "$.ajax({" + "\n";
+			strSample += "        type : '"+ m.type + "',\n";
+			strSample += "        url : '"+address + "',\n";
+			strSample += "        headers : {'x-debugger' : true}" + ",\n";
+			strSample += "        contentType : false,\n";
+			strSample += "        processData  : false,\n";
+			strSample += "        xhrFields : {'withCredentials' : true}" + ",\n";
+			strSample += "        crossDomain : true"+ ",\n";
+			strSample += "        data : formData"+"\n";
+			strSample += "});";	
+	}
+
+	return  strSample;
+   }
+Describe.createSampleCommon= function(m,className) {
+	 debugger;
+	var address = window.location.href;
+		address = address.substring(0,address.indexOf("/jest/"));
+	var root = address.substring(address.lastIndexOf("/")+1,address.length);
+
+	var parameter = "";
+	if (m.pathParameters && m.pathParameters.length > 0) {
+			$.each(m.pathParameters, function(pi, p) {
+				if(parameter == ""){
+					parameter =  p.name ;
+				}else{
+					parameter = parameter +  "," + p.name;
+				}
+			});
+		}
+	var query = "";
+		if (m.queryParameters && m.queryParameters.length > 0) {
+			$.each(m.queryParameters, function(pi, p) {
+				if (query == "") {
+					 query = "&" + p.name + '=' + '替换参数'+pi;
+				} else {
+					 query = query + "&"+ p.name + '=' + '替换参数'+pi;
+				}
+			});
+		}
+	var strSample="";
+	var body = "";
+	if (m.contentType.indexOf('application/json') > -1) {
+				if (m.ins && m.ins.length > 0) {
+					 body =  "var data = {};" + "\n";
+					$.each(m.ins, function(ii, i) {
+						switch (i.type) {
+						default:
+							if (i.isBaseType) {
+								if (i.isCollection) {
+									  body += '       data["'+i.name+'"] = ["参数1"];' + "\n";
+								} else {
+									  body += '       data["'+i.name+'"] = "参数";' + "\n";
+								}
+							} else {
+									if(i.isCollection){
+										if(i.fieldValue){
+										  if(i.fieldType =='enum'){
+											   body += '       data["'+i.name+'"] = ["'+ i.fieldValue +'"];'+"\n";	
+											   body +=(i.fieldSample ? "  "+'<span style="color:red">//注解:'+i.fieldSample +'</span>\n':"");
+										  }else{
+											   body += '       data["'+i.name+'"] = ['+ i.fieldValue +'];'+"\n";	
+											   body +=(i.fieldSample ? "  "+'<span style="color:red">//注解:'+i.fieldSample +'</span>\n':"");
+										  }
+										  
+										}else{
+										  body += '       data["'+i.name+'"] = [{"参数1":"value1","参数2":"value2"}];'+"\n";
+										}
+									}else{
+										 if(i.fieldType =='enum'){
+											 body += '       data["'+i.name+'"] = "'+ i.fieldValue +'";'+"\n";	
+											 body +=(i.fieldSample ? "  "+'<span style="color:red">//注解:'+i.fieldSample +'</span>\n':"");
+								
+										 }else{
+										   body += '       data["'+i.name+'"] = {"参数1":"value1","参数2":"value2"};'+"\n";
+										 }
+									}
+							}
+						}
+					});
+				} else if (m.useJsonElementParameter) {
+					body += '       data = {"参数1":"value1","参数2":"value2"};' +"\n";
+				} else if (m.useStringParameter) {
+					body += '       data = "参数";'+"\n";
+				}
+	 if(m.type != "GET" ){
+		 if( body != ""){
+	        strSample += body;	
+		 }	   
+	 }			
+	 strSample += "var action = this.Actions.load(\"" + root + "\");\n";
+	 strSample += "       action."+ className + "."+m.name+ "(//平台封装好的方法\n";
+	 if(parameter!=""){
+	   strSample += "      " + parameter  +",//uri的参数\n";
+	 }
+	 if(m.type != "GET" ){
+		 if( body != ""){
+	        strSample += "      data,//body请求参数\n";	
+		 }	   
+	 }
+	 strSample += "      function( json ){ //服务调用成功的回调函数, json为服务传回的数据\n";
+	 strSample += "         data = json.data; //为变量data赋值\n";
+	 strSample += "      }.bind(this),\n";
+	 strSample +=  "     function( json ){ //服务调用失败的回调函数, json为服务传回的数据\n";
+	 strSample +=  "        data = json.data; //为变量data赋值\n";
+	 strSample +=  "     }.bind(this),\n";
+	 strSample += "      false //同步执行 \n";
+	 strSample += "    );\n";
+				
+	}else{
+			var formData = "var formData = new FormData();" + "\n";
+			if (m.formParameters && m.formParameters.length > 0) {
+				$.each(m.formParameters, function(pi, p) {
+					if (p.type == "File") {
+					formData += '      formData.append("'+p.name+'", $("input[type=file]")[0].files[0]);' +  "\n";
+					} else {
+					formData += '      formData.append("'+p.name+'", "参数值'+pi+'");' +  "\n";
+					}
+				});
+			}
+		 strSample += formData;
+		 strSample += "var action = this.Actions.get(\"" + root + "\");\n";
+		 //strSample += "action."+m.name+ "(//平台封装好的方法\n";
+		 strSample += "       action."+ className + "."+m.name+ "(//平台封装好的方法\n";
+		 strSample += "      "+parameter  +",//uri的参数\n";
+		 strSample +=  "      formData"+",//from参数\n";
+		 strSample +=  "function( json ){ //服务调用成功的回调函数, json为服务传回的数据\n";
+		 strSample +=  "      data = json.data; //为变量data赋值\n";
+		 strSample +=  "}.bind(this),\n";
+		 strSample +=  "function( json ){ //服务调用失败的回调函数, json为服务传回的数据\n";
+		 strSample +=  "      data = json.data; //为变量data赋值\n";
+		 strSample +=  "}.bind(this),\n";
+		 strSample +=  "false //同步执行 \n";
+		 strSample += ");\n"
+		} 
+   return  strSample ;		
+   }
+   
+Describe.prototype = {
+	"load" : function() {
+		var str = '<ul>';
+		$.getJSON('../describe/describe.json?rd=' + Math.random(), function(json) {
+			Describe.json = json;
+			$.each(json.jaxrs, function(ji, j) {
+				str += '<li xtype="menu" ' + 'style="margin-top: 30px;font-size:14px;font-weight:bold;"title="' +'" >' + j.name + ' <span style="font-style:italic">(' + j.description+ ')</span>';
+				$.each(j.methods, function(mi, m) {
+					str += '<ul><li xtype="li"  style="margin-top: 10px;margin-left:-24px;font-size:12px; font-weight:normal;line-height:18px" ><a  title="' + m.path + '"id ="' + j.name + '_' + m.name + '" href="#"><b>' + m.name+'</b><br/><span style="color: #666666;">-'+ m.description + '</span>' + '</a></li></ul>';
+				});
+				str += '</li>'
+			});
+			str += '</ul>';
+			$("#menu").html(str);
+			$.each(json.jaxrs, function(ji, j) {
+				$.each(j.methods, function(mi, m) {
+					$('#' + j.name + '_' + m.name).click(
+							function() {
+								$('#result').html('');
+								var sample = "";
+								var txt = '<fieldset id="method"><legend>Method</legend>';
+								txt += '<table>';
+								txt += '<tr><td style="width:100px;">name:</td><td><a href="../describe/sources/' + m.className.replace(/\./g, '/') + '.java">' + m.name + '</a></td></tr>';
+								txt += '<tr><td>path:</td><td>' + m.path + '</td></tr>';
+								txt += '<tr><td>type:</td><td>' + m.type + '</td></tr>';
+								txt += '<tr><td>description:</td><td>' + m.description + '</td></tr>';
+								txt += '</table>';
+								txt += '<button id="' + m.name + "_" + m.type + '">' + m.type + '</button>';
+								txt += '<div id="url">&nbsp;</div>';
+								txt += '</fieldset>';
+								if (m.pathParameters && m.pathParameters.length > 0) {
+									txt += '<fieldset id="pathParameters"><legend>Path Parameter</legend>';
+									txt += '<table >';
+									$.each(m.pathParameters, function(pi, p) {
+										if (m.name == 'listNext' || m.name == 'listPrev') {
+											switch (p.name) {
+											case 'flag':
+											case 'id':
+												txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid" value="(0)"/></td><td>' + p.name
+														+ ':' + p.description + '</td></tr>';
+												break;
+											case 'count':
+												txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid" value="20"/></td><td>' + p.name + ':'
+														+ p.description + '</td></tr>';
+												break;
+											default:
+												txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + p.name + ':'
+														+ p.description + '</td></tr>';
+												break
+											}
+										} else {
+											txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + p.name + ':'
+													+ p.description + '</td></tr>';
+										}
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								if (m.formParameters && m.formParameters.length > 0) {
+									txt += '<fieldset id="formParameters"><legend>Form Parameter</legend>';
+									txt += '<table >';
+									$.each(m.formParameters, function(pi, p) {
+										if (p.type == "File") {
+											txt += '<tr><td><input type="file" name="' + p.name + '" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>'
+													+ p.name + ':' + p.description + '</td></tr>';
+										} else {
+											txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + p.name + ':'
+													+ p.description + '</td></tr>';
+										}
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								if (m.queryParameters && m.queryParameters.length > 0) {
+									txt += '<fieldset id="queryParameters"><legend>Query Parameter</legend>';
+									txt += '<table >';
+									$.each(m.queryParameters, function(pi, p) {
+										txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + p.name + ':' + p.description
+												+ '</td></tr>';
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+							  if (m.ins && m.ins.length > 0) {
+									txt += '<fieldset id="ins"><legend>In</legend>';
+									txt += '<table>';
+									$.each(m.ins, function(ii, i) {
+										if (i.isCollection) {
+											
+											txt += '<tr><td><textarea id="' + i.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + i.name + ':' + i.description +(i.fieldValue ? "  "+'。数据格式:<span style="color:red">'+i.fieldValue +'</span>':"") + (i.fieldSample ? "  "+'<span style="color:red">'+i.fieldSample +'</span>':"") 
+											+'</td></tr>';
+										} else {
+											txt += '<tr><td><input type="text" id="' + i.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + i.name + ':'
+											
+													+ i.description+ (i.fieldValue ? "  "+'。数据格式:<span style="color:red">'+i.fieldValue +'</span>':"") + (i.fieldSample ? "  "+'<span style="color:red">'+i.fieldSample +'</span>':"") 
+													+'</td></tr>';
+						
+										}
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								
+								
+								if (m.useJsonElementParameter) {
+									txt += '<fieldset><legend>JsonElement</legend>';
+									txt += '<table><tr><td>';
+									txt += '<textarea id="jsonElement" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>';
+									txt += '</td><td>json</td></tr>';
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								if (m.useStringParameter) {
+									txt += '<fieldset><legend>String</legend>';
+									txt += '<table><tr><td>';
+									txt += '<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>';
+									txt += '</td><td>string</td></tr>';
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								if (m.outs && m.outs.length > 0) {
+									txt += '<fieldset id="outs"><legend>Out</legend>';
+									txt += '<table>';
+									$.each(m.outs, function(oi, o) {
+										txt += '<tr><td style="width: 160px;">' + o.name + '</td><td style="width: 90px;">' + o.type + '</td><td style="width: 90px;">' + (o.isCollection ? 'multi' : 'single') + '</td><td style="width: 90px;">' + o.description + '</td><td id="out_'
+												+ o.name + '_out">&nbsp;</td></tr>';
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								$('#content').html(txt);
+								
+								$('#' + m.name + '_' + m.type, '#method').click(function() {
+									var address = '../' + m.path;
+									if (m.pathParameters && m.pathParameters.length > 0) {
+										$.each(m.pathParameters, function(pi, p) {
+											address = address.replace('{' + p.name + '}', encodeURIComponent($('#' + p.name, '#pathParameters').val()));
+										});
+									}
+									if (m.queryParameters && m.queryParameters.length > 0) {
+										$.each(m.queryParameters, function(pi, p) {
+											var query = p.name + '=' + encodeURIComponent($('#' + p.name, '#queryParameters').val());
+											if (address.indexOf("?") > 0) {
+												address += '&' + query;
+											} else {
+												address += '?' + query;
+											}
+										});
+									}
+									if (m.contentType.indexOf('application/json') > -1) {
+										switch (m.type) {
+										case 'POST':
+											var data = {};
+											if (m.ins && m.ins.length > 0) {
+												$.each(m.ins, function(ii, i) {
+													switch (i.type) {
+													default:
+														if (i.isBaseType) {
+															if (i.isCollection) {
+																data[i.name] = Describe.splitValue($('#' + i.name, '#ins').val());
+															} else {
+																data[i.name] = $('#' + i.name, '#ins').val();
+															}
+														} else {
+															//data[i.name] = $.parseJSON($('#' + i.name, '#ins').val());
+															if($('#' + i.name, '#ins').val() == ""){
+																if(i.isCollection){
+																	data[i.name] = [{}];
+																}else{
+																	data[i.name] = {};
+																}
+															}else{
+																data[i.name] = $.parseJSON($('#' + i.name, '#ins').val());
+															}
+														}
+													}
+												});
+											} else if (m.useJsonElementParameter) {
+												data = $.parseJSON($('#jsonElement').val());
+											} else if (m.useStringParameter) {
+												data = $('#string').val();
+											}
+											Describe.doPost(address, m, data);
+											break;
+										case 'PUT':
+											var data = {};
+											if (m.ins && m.ins.length > 0) {
+												$.each(m.ins, function(ii, i) {
+													switch (i.type) {
+													default:
+														if (i.isBaseType) {
+															if (i.isCollection) {
+																data[i.name] = Describe.splitValue($('#' + i.name, '#ins').val());
+															} else {
+																data[i.name] = $('#' + i.name, '#ins').val();
+															}
+														} else {
+															if($('#' + i.name, '#ins').val() == ""){
+																if(i.isCollection){
+																	data[i.name] = [{}];
+																}else{
+																	data[i.name] = {};
+																}
+															}else{
+																data[i.name] = $.parseJSON($('#' + i.name, '#ins').val());
+															}
+														
+														}
+													}
+												});
+											} else if (m.useJsonElementParameter) {
+												data = $.parseJSON($('#jsonElement').val());
+											} else if (m.useStringParameter) {
+												data = $('#string').val();
+											}
+											Describe.doPut(address, m, data);
+											break;
+										case 'GET':
+											Describe.doGet(address, m);
+											break;
+										case 'DELETE':
+											Describe.doDelete(address, m);
+											break;
+										default:
+											break;
+										}
+										
+									} else {
+										switch (m.type) {
+										case 'POST':
+											var formData = new FormData();
+											if (m.formParameters && m.formParameters.length > 0) {
+												$.each(m.formParameters, function(pi, p) {
+													if (p.type == "File") {
+														formData.append(p.name, $('input[type=file]', '#formParameters')[0].files[0]);
+													} else {
+														formData.append(p.name, $('#' + p.name, '#formParameters').val());
+													}
+												});
+											}
+											Describe.doPost(address, m, formData);
+											break;
+										case 'PUT':
+											var formData = new FormData();
+											if (m.formParameters && m.formParameters.length > 0) {
+												$.each(m.formParameters, function(pi, p) {
+													if (p.type == "File") {
+														formData.append(p.name, $('input[type=file]', '#formParameters')[0].files[0]);
+													} else {
+														formData.append(p.name, $('#' + p.name, '#formParameters').val());
+													}
+												});
+											}
+											Describe.doPut(address, m, formData);
+											break;
+										case 'GET':
+											Describe.doGet(address, m);
+											break;
+										case 'DELETE':
+											Describe.doDelete(address, m);
+											break;
+										default:
+											break;
+										}
+									}
+								})
+								
+								debugger;
+							$('#Sample').html("<div style=\"border-bottom:1px solid #E6E6E6;padding-bottom: 40px;line-height:21px\"><span style=\"font-size:17px;font-weight:bold;color: #1E7ACE;\">\n平台推荐脚本样例</span>\n\n"+ Describe.createSampleCommon(m,j.name)+ "</div><div style=\"border-bottom:1px solid #E6E6E6;padding-bottom: 40px;line-height:21px\"><span style=\"font-size:17px;font-weight:bold;\">\n前台脚本样例</span>\n\n"+ Describe.createSampleJSO2(m)+ "</div><div  style=\"border-bottom:1px solid #E6E6E6;padding-bottom: 40px;line-height:21px\"><span style=\"font-size:17px;font-weight:bold;\">\n\n后台脚本样例</span>\n\n" + Describe.createSampleO2(m) + "</div><div  style=\"border-bottom:1px solid #E6E6E6;padding-bottom: 40px;line-height:21px\"><span style=\"font-size:17px;font-weight:bold;\">\n\nmootools样例</span>\n\n"+Describe.createSampleMootools(m)+"</div><div  style=\"line-height:21px\"><span style=\"font-size:17px;font-weight:bold;\">\n\njquery样例</span>\n\n<span style=\"\">"+ Describe.createSample(m)+"</span></div>");
+
+							});
+				});
+			});
+		 
+		  $("[xtype='menu']").click(
+				  function(event) {
+					    if(event.stopPropagation){
+						    event.stopPropagation();
+						  }else{
+						     event.cancelBubble = true;
+						  }
+						$(this).children().each(function(i){
+							debugger;
+							if(this.tagName != "SPAN"){
+							$(this).toggle();
+							}
+						});
+					    //$(this).children().toggle();
+					});
+		  $("[xtype='li']").click( function(event) {
+			    if(event.stopPropagation){
+				    event.stopPropagation();
+				  }else{
+				     event.cancelBubble = true;
+				  }
+			})
+			$("[xtype='menu']").each(function(i){ 
+			if(i!=0){
+			  // $(this).children().toggle();
+			  $(this).children().each(function(i){
+					
+							if(this.tagName != "SPAN"){
+							$(this).toggle();
+							}
+						});
+			  }
+			}
+			);
+		});
+	},
+  "search":function(strKey) {
+	var str = '<ul>';
+	var strTemp = "";
+	    $.each(Describe.json.jaxrs, function(ji, j) {
+			    var flag = false;
+				strTemp = '<li xtype="menu" ' + 'style="margin-top: 30px;font-size:14px;font-weight:bold;"title="' +'" >' + j.name + ' <span style="font-style:italic">(' + j.description+ ')</span>';
+				$.each(j.methods, function(mi, m) {
+					if((m.name.toUpperCase().indexOf(strKey.toUpperCase())>-1) || (m.description.toUpperCase().indexOf(strKey.toUpperCase())>-1) || (m.path.toUpperCase().indexOf(strKey.toUpperCase())>-1)){
+					flag = true;
+					
+					var tempKey =  strKey;
+					var tempReplace = "<span style='color: #f31313'>"+ strKey + "</span>";
+					 debugger;
+					var strDescripthion = m.description.replace(tempKey, tempReplace);
+					var strName = m.name.replace(tempKey, tempReplace);
+					var strPath = m.path;
+					var startPost = m.name.toUpperCase().indexOf(strKey.toUpperCase());
+					if(startPost>-1){
+						tempReplace = m.name.substr(startPost,tempKey.length);
+						tempKey = tempReplace;
+						tempReplace = "<span style='color: #f31313'>"+ tempReplace + "</span>";
+						strName = m.name.replace(tempKey, tempReplace);
+					}
+					tempKey =  strKey;
+					startPost = m.description.toUpperCase().indexOf(strKey.toUpperCase());
+					if(startPost>-1){
+						tempReplace = m.description.substr(startPost,tempKey.length);
+						tempKey =  tempReplace;
+						tempReplace = "<span style='color: #f31313'>"+ tempReplace + "</span>";
+						strDescripthion = m.description.replace(tempKey, tempReplace);
+					}
+					
+					
+					strTemp += '<ul><li xtype="li"  style="margin-top: 10px;margin-left:-24px;font-size:12px; font-weight:normal;line-height:18px" ><a title = "' + strPath+ '"  id ="' + j.name + '_' + m.name + '" href="#"><b>' + strName+'</b><br/><span style="color: #666666;">-'+strDescripthion + '</span>' + '</a></li></ul>';
+					}
+				});
+				strTemp += '</li>';
+				
+				if(flag == true){
+				   str += strTemp;
+				}
+			});
+			str += '</ul>';
+			$("#menu").html(str);
+			this.display(Describe.json);
+  },
+   "display":function(json) {
+			$.each(json.jaxrs, function(ji, j) {
+				$.each(j.methods, function(mi, m) {
+					$('#' + j.name + '_' + m.name).click(
+							function() {
+								$('#result').html('');
+								var sample = "";
+								var txt = '<fieldset id="method"><legend>Method</legend>';
+								txt += '<table>';
+								txt += '<tr><td style="width:100px;">name:</td><td><a href="../describe/sources/' + m.className.replace(/\./g, '/') + '.java">' + m.name + '</a></td></tr>';
+								txt += '<tr><td>path:</td><td>' + m.path + '</td></tr>';
+								txt += '<tr><td>type:</td><td>' + m.type + '</td></tr>';
+								txt += '<tr><td>description:</td><td>' + m.description + '</td></tr>';
+								txt += '</table>';
+								txt += '<button id="' + m.name + "_" + m.type + '">' + m.type + '</button>';
+								txt += '<div id="url">&nbsp;</div>';
+								txt += '</fieldset>';
+								if (m.pathParameters && m.pathParameters.length > 0) {
+									txt += '<fieldset id="pathParameters"><legend>Path Parameter</legend>';
+									txt += '<table >';
+									$.each(m.pathParameters, function(pi, p) {
+										if (m.name == 'listNext' || m.name == 'listPrev') {
+											switch (p.name) {
+											case 'flag':
+											case 'id':
+												txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid" value="(0)"/></td><td>' + p.name
+														+ ':' + p.description + '</td></tr>';
+												break;
+											case 'count':
+												txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid" value="20"/></td><td>' + p.name + ':'
+														+ p.description + '</td></tr>';
+												break;
+											default:
+												txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + p.name + ':'
+														+ p.description + '</td></tr>';
+												break
+											}
+										} else {
+											txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + p.name + ':'
+													+ p.description + '</td></tr>';
+										}
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								if (m.formParameters && m.formParameters.length > 0) {
+									txt += '<fieldset id="formParameters"><legend>Form Parameter</legend>';
+									txt += '<table >';
+									$.each(m.formParameters, function(pi, p) {
+										if (p.type == "File") {
+											txt += '<tr><td><input type="file" name="' + p.name + '" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>'
+													+ p.name + ':' + p.description + '</td></tr>';
+										} else {
+											txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + p.name + ':'
+													+ p.description + '</td></tr>';
+										}
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								if (m.queryParameters && m.queryParameters.length > 0) {
+									txt += '<fieldset id="queryParameters"><legend>Query Parameter</legend>';
+									txt += '<table >';
+									$.each(m.queryParameters, function(pi, p) {
+										txt += '<tr><td><input type="text" id="' + p.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + p.name + ':' + p.description
+												+ '</td></tr>';
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+							  if (m.ins && m.ins.length > 0) {
+									txt += '<fieldset id="ins"><legend>In</legend>';
+									txt += '<table>';
+									$.each(m.ins, function(ii, i) {
+										if (i.isCollection) {
+											
+											txt += '<tr><td><textarea id="' + i.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + i.name + ':' + i.description +(i.fieldValue ? "  "+'。数据格式:<span style="color:red">'+i.fieldValue +'</span>':"") + (i.fieldSample ? "  "+'<span style="color:red">'+i.fieldSample +'</span>':"") 
+											'</td></tr>';
+										} else {
+											txt += '<tr><td><input type="text" id="' + i.name + '" style="width:600px; padding:1px; border:1px #000000 solid"/></td><td>' + i.name + ':'
+													+ i.description
+											'</td></tr>';
+										}
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								
+								
+								if (m.useJsonElementParameter) {
+									txt += '<fieldset><legend>JsonElement</legend>';
+									txt += '<table><tr><td>';
+									txt += '<textarea id="jsonElement" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>';
+									txt += '</td><td>json</td></tr>';
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								if (m.useStringParameter) {
+									txt += '<fieldset><legend>String</legend>';
+									txt += '<table><tr><td>';
+									txt += '<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>';
+									txt += '</td><td>string</td></tr>';
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								if (m.outs && m.outs.length > 0) {
+									txt += '<fieldset id="outs"><legend>Out</legend>';
+									txt += '<table>';
+									$.each(m.outs, function(oi, o) {
+										txt += '<tr><td style="width: 160px;">' + o.name + '</td><td style="width: 90px;">' + o.type + '</td><td style="width: 90px;">' + (o.isCollection ? 'multi' : 'single') + '</td><td style="width: 90px;">' + o.description + '</td><td id="out_'
+												+ o.name + '_out">&nbsp;</td></tr>';
+									});
+									txt += '</table>';
+									txt += '</fieldset>';
+								}
+								
+								$('#content').html(txt);
+								
+								$('#' + m.name + '_' + m.type, '#method').click(function() {
+									var address = '../' + m.path;
+									if (m.pathParameters && m.pathParameters.length > 0) {
+										$.each(m.pathParameters, function(pi, p) {
+											address = address.replace('{' + p.name + '}', encodeURIComponent($('#' + p.name, '#pathParameters').val()));
+										});
+									}
+									if (m.queryParameters && m.queryParameters.length > 0) {
+										$.each(m.queryParameters, function(pi, p) {
+											var query = p.name + '=' + encodeURIComponent($('#' + p.name, '#queryParameters').val());
+											if (address.indexOf("?") > 0) {
+												address += '&' + query;
+											} else {
+												address += '?' + query;
+											}
+										});
+									}
+									if (m.contentType.indexOf('application/json') > -1) {
+										switch (m.type) {
+										case 'POST':
+											var data = {};
+											if (m.ins && m.ins.length > 0) {
+												$.each(m.ins, function(ii, i) {
+													switch (i.type) {
+													default:
+														if (i.isBaseType) {
+															if (i.isCollection) {
+																data[i.name] = Describe.splitValue($('#' + i.name, '#ins').val());
+															} else {
+																data[i.name] = $('#' + i.name, '#ins').val();
+															}
+														} else {
+															//data[i.name] = $.parseJSON($('#' + i.name, '#ins').val());
+															if($('#' + i.name, '#ins').val() == ""){
+																if(i.isCollection){
+																	data[i.name] = [{}];
+																}else{
+																	data[i.name] = {};
+																}
+															}else{
+																data[i.name] = $.parseJSON($('#' + i.name, '#ins').val());
+															}
+														}
+													}
+												});
+											} else if (m.useJsonElementParameter) {
+												data = $.parseJSON($('#jsonElement').val());
+											} else if (m.useStringParameter) {
+												data = $('#string').val();
+											}
+											Describe.doPost(address, m, data);
+											break;
+										case 'PUT':
+											var data = {};
+											if (m.ins && m.ins.length > 0) {
+												$.each(m.ins, function(ii, i) {
+													switch (i.type) {
+													default:
+														if (i.isBaseType) {
+															if (i.isCollection) {
+																data[i.name] = Describe.splitValue($('#' + i.name, '#ins').val());
+															} else {
+																data[i.name] = $('#' + i.name, '#ins').val();
+															}
+														} else {
+															if($('#' + i.name, '#ins').val() == ""){
+																if(i.isCollection){
+																	data[i.name] = [{}];
+																}else{
+																	data[i.name] = {};
+																}
+															}else{
+																data[i.name] = $.parseJSON($('#' + i.name, '#ins').val());
+															}
+														
+														}
+													}
+												});
+											} else if (m.useJsonElementParameter) {
+												data = $.parseJSON($('#jsonElement').val());
+											} else if (m.useStringParameter) {
+												data = $('#string').val();
+											}
+											Describe.doPut(address, m, data);
+											break;
+										case 'GET':
+											Describe.doGet(address, m);
+											break;
+										case 'DELETE':
+											Describe.doDelete(address, m);
+											break;
+										default:
+											break;
+										}
+										
+									} else {
+										switch (m.type) {
+										case 'POST':
+											var formData = new FormData();
+											if (m.formParameters && m.formParameters.length > 0) {
+												$.each(m.formParameters, function(pi, p) {
+													if (p.type == "File") {
+														formData.append(p.name, $('input[type=file]', '#formParameters')[0].files[0]);
+													} else {
+														formData.append(p.name, $('#' + p.name, '#formParameters').val());
+													}
+												});
+											}
+											Describe.doPost(address, m, formData);
+											break;
+										case 'PUT':
+											var formData = new FormData();
+											if (m.formParameters && m.formParameters.length > 0) {
+												$.each(m.formParameters, function(pi, p) {
+													if (p.type == "File") {
+														formData.append(p.name, $('input[type=file]', '#formParameters')[0].files[0]);
+													} else {
+														formData.append(p.name, $('#' + p.name, '#formParameters').val());
+													}
+												});
+											}
+											Describe.doPut(address, m, formData);
+											break;
+										case 'GET':
+											Describe.doGet(address, m);
+											break;
+										case 'DELETE':
+											Describe.doDelete(address, m);
+											break;
+										default:
+											break;
+										}
+									}
+								})
+								
+								debugger;
+							$('#Sample').html("<div style=\"border-bottom:1px solid #E6E6E6;padding-bottom: 40px;line-height:21px\"><span style=\"font-size:17px;font-weight:bold;color: #1E7ACE;\">\n平台推荐脚本样例</span>\n\n"+ Describe.createSampleCommon(m,j.name)+ "</div><div style=\"border-bottom:1px solid #E6E6E6;padding-bottom: 40px;line-height:21px\"><span style=\"font-size:17px;font-weight:bold;\">\n前台脚本样例</span>\n\n"+ Describe.createSampleJSO2(m)+ "</div><div  style=\"border-bottom:1px solid #E6E6E6;padding-bottom: 40px;line-height:21px\"><span style=\"font-size:17px;font-weight:bold;\">\n\n后台脚本样例</span>\n\n" + Describe.createSampleO2(m) + "</div><div  style=\"border-bottom:1px solid #E6E6E6;padding-bottom: 40px;line-height:21px\"><span style=\"font-size:17px;font-weight:bold;\">\n\nmootools样例</span>\n\n"+Describe.createSampleMootools(m)+"</div><div  style=\"line-height:21px\"><span style=\"font-size:17px;font-weight:bold;\">\n\njquery样例</span>\n\n<span style=\"\">"+ Describe.createSample(m)+"</span></div>");
+							});
+				});
+			});
+		 
+		  $("[xtype='menu']").click(
+				  function(event) {
+					    if(event.stopPropagation){
+						    event.stopPropagation();
+						  }else{
+						     event.cancelBubble = true;
+						  }
+						$(this).children().each(function(i){
+							debugger;
+							if(this.tagName != "SPAN"){
+							$(this).toggle();
+							}
+						});
+					});
+		  $("[xtype='li']").click( function(event) {
+			    if(event.stopPropagation){
+				    event.stopPropagation();
+				  }else{
+				     event.cancelBubble = true;
+				  }
+			})
+	}
+}

+ 142 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/index.html

@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8" />
+<meta http-equiv="pragma" content="no-cache" />
+<script src="./jquery.min.js"></script>
+<script src="./clipboard.min.js"></script>
+<style type="text/css">
+	<!--
+	body {
+		font-family: Arial, Helvetica, sans-serif;
+		font-size:12px;
+		color:#666666;
+		background:#fff;
+		text-align:left;
+	}
+	a {
+		color:#1E7ACE;
+		text-decoration:none; 
+	}
+	a:hover {
+		color:#000;
+		text-decoration:underline;
+	}
+	h3 {
+		font-size:14px;
+		font-weight:bold;
+	}
+	
+	pre,p {
+		color:#1E7ACE;
+		margin:4px;
+	}
+	input, select,textarea {
+		padding:1px;
+		margin:2px;
+		font-size:11px;
+	}
+	
+	fieldset {
+		padding:10px;
+		margin-top:10px;
+		border:1px solid #A4CDF2;
+		background:#fff;
+	}
+	
+	fieldset legend {
+		color:#1E7ACE;
+		font-weight:bold;
+		padding:3px 20px 3px 20px;
+		border:1px solid #A4CDF2; 
+		background:#fff;
+	}
+	
+	input {
+		border:1px solid #A4CDF2;
+	}
+	
+	button {
+		border:1px solid #A4CDF2;
+		background-color : #FFFFFF;
+		height:25px;
+		margin-top:10px;
+		font-weight:bold;
+		color:#1E7ACE;
+	}
+	-->
+</style>
+	
+<script>
+    var describe;
+    $.getScript('./describe.js?rd=' + Math.random()).then(function() {
+		describe = new Describe();
+		describe.load();
+    }).catch( function() {
+		alert('get describe error.'); 
+    });
+	
+	$(document).ready(function(){
+        var clipboard = new Clipboard("#btn_copy");
+		$('#butSearch').click(function() {
+		var  strKey = $('#inpSearch').val();
+		  if(strKey == ""){
+		  window.location.reload();
+		  }else{
+		   describe.search(strKey);
+		  }
+		})
+		$('#inpSearch').bind('keyup', function(event) {
+       if (event.keyCode == "13") {
+         $('#butSearch').click();
+         }
+       });
+	});	
+</script>
+</head>
+
+<body style="font-size: 12px; font-family: Microsoft Yahei; margin: 0px;border-image: linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 100%, #ffffff);box-shadow: inset 15px 0 5px -16px #e7e7e7;background-image: -webkit-radial-gradient(right, #f2f2f2, #ffffff 100%);">
+	<table style="width: 1800px; margin: 0 auto">
+		<tr>
+			<td style="width: 350px;" valign="top">
+				<fieldset>
+					<legend>search</legend>
+					<div><input id="inpSearch" style="width:70%;height: 23px; overflow: auto;"/>&nbsp; <button id="butSearch">search</button></div>
+				</fieldset>
+				<fieldset>
+					<legend>API Menu</legend>
+					<div id="menu" style="height: 850px; overflow: auto;">&nbsp;</div>
+				</fieldset>
+			</td>
+			<td valign="top">			
+				<!--<fieldset>
+					<legend>Content</legend>
+					<div id="content"
+						style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word">&nbsp;</div>
+				</fieldset> -->
+				
+				<div id="content"
+						style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word;border-image: linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 100%, #ffffff);box-shadow: inset 15px 0 5px -16px #e7e7e7;background-image: -webkit-radial-gradient(right, #f2f2f2, #ffffff 100%);">&nbsp;</div>
+				<fieldset>
+					<legend>
+						Result&nbsp;<a id="btn_copy" href="javascript:" data-clipboard-target="#result">copy</a>&nbsp;
+					</legend>
+					<div id="result"
+						style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word; width: 1400px">&nbsp;</div>
+				</fieldset>
+				
+			    <fieldset>
+					<legend>
+						Sample&nbsp;<a  id="btn_copy"  href="javascript:" data-clipboard-target="#Sample">copy</a>&nbsp;
+					</legend><div style="padding-left:12px">
+					<div id="Sample"
+						style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word; width: 1400px;">&nbsp;</div>
+						</div>
+				</fieldset>		
+						
+
+			</td>
+		</tr>
+	</table>
+</body>
+</html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/jquery.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/jquery.min.js


+ 105 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/logger.js

@@ -0,0 +1,105 @@
+logger_parameter = {};
+
+function logger_init() {
+    $('#result').html('');
+    $('#content').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="get">get</a>&nbsp<a href="#" id="trace">trace</a>&nbsp;<a href="#" id="debug">debug</a>&nbsp;<a href="#" id="info">info</a>&nbsp;<a href="#" id="warn">warn</a></td></tr>';
+    str += '<tr><td>debug:</td><td id="level">&nbsp;</td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#get').click(function() {
+	logger_get();
+    });
+    $('#trace').click(function() {
+	logger_trace();
+    });
+    $('#debug').click(function() {
+	logger_debug();
+    });
+    $('#info').click(function() {
+	logger_info();
+    });
+    $('#warn').click(function() {
+	logger_warn();
+    });
+}
+
+function logger_get() {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/logger',
+	contentType : 'application/json; charset=utf-8',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	if (json.type == 'success') {
+	    $('#level').html(json.data.value);
+	}
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function logger_trace() {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/logger/trace',
+	contentType : 'application/json; charset=utf-8',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function logger_debug() {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/logger/debug',
+	contentType : 'application/json; charset=utf-8',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function logger_info() {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/logger/info',
+	contentType : 'application/json; charset=utf-8',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function logger_warn() {
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/logger/warn',
+	contentType : 'application/json; charset=utf-8',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}

+ 634 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/meeting.js

@@ -0,0 +1,634 @@
+meeting_parameter = {
+    first : '(0)',
+    last : '(0)',
+    count : 20
+};
+
+function meeting_list_next(id) {
+    $('#result').html('');
+    var id = (id ? id : meeting_parameter.last);
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/' + id + '/next/' + meeting_parameter.count,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    if (json.data.length > 0) {
+		meeting_parameter.first = json.data[0].id;
+		meeting_parameter.last = json.data[json.data.length - 1].id;
+	    } else {
+		meeting_parameter.first = '(0)';
+	    }
+	    meeting_grid(json.data);
+	} else {
+	    failure(data);
+	}
+    });
+}
+
+function meeting_list_prev(id) {
+    $('#result').html('');
+    var id = (id ? id : meeting_parameter.first);
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/' + id + '/prev/' + meeting_parameter.count,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    if (json.data.length > 0) {
+		meeting_parameter.first = json.data[0].id;
+		meeting_parameter.last = json.data[json.data.length - 1].id;
+	    } else {
+		meeting_parameter.last = '(0)';
+	    }
+	    meeting_grid(json.data);
+	} else {
+	    failure(data);
+	}
+    });
+}
+
+function meeting_grid(items) {
+    var str = '<table border="1" width="100%"><tobdy>';
+    str += '<tr><th>rank</th><th>id</th><th>subject</th><th>confirmStatus</th><th>manualCompleted</th></tr>';
+    if (items) {
+	$.each(items, function(index, item) {
+	    str += '<tr>';
+	    str += '<td>' + item.rank + '</td>';
+	    str += '<td>' + item.id + '</td>';
+	    str += '<td>' + item.subject + '</td>';
+	    str += '<td>' + item.confirmStatus + '</td>';
+	    str += '<td>' + item.manualCompleted + '</td>';
+	    str += '</tr>';
+	});
+    }
+    str += '</tobdy></table>';
+    $('#content').html(str);
+}
+
+function meeting_list_waitConfirm() {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/wait/confirm',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	meeting_grid(json.data);
+    });
+}
+
+function meeting_listOnMonth_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="list">list</a></td></tr>';
+    str += '<tr><td>year:</td><td><input type="text" id="year" style="width:95%"/></td></tr>';
+    str += '<tr><td>month:</td><td><input type="text" id="month" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#list').click(function() {
+	meeting_listOnMonth($('#year').val(), $('#month').val());
+    });
+}
+
+function meeting_listOnMonth(year, month) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/year/' + year + '/month/' + month,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	meeting_grid(json.data);
+    });
+}
+
+function meeting_listOnDay_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="list">list</a></td></tr>';
+    str += '<tr><td>year:</td><td><input type="text" id="year" style="width:95%"/></td></tr>';
+    str += '<tr><td>month:</td><td><input type="text" id="month" style="width:95%"/></td></tr>';
+    str += '<tr><td>day:</td><td><input type="text" id="day" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#list').click(function() {
+	meeting_listOnDay($('#year').val(), $('#month').val(), $('#day').val());
+    });
+}
+
+function meeting_listOnDay(year, month, day) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/year/' + year + '/month/' + month + '/day/' + day,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	meeting_grid(json.data);
+    });
+}
+
+function meeting_get_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="get">get</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#get').click(function() {
+	meeting_get($('#id').val());
+    });
+}
+
+function meeting_get(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_post_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="post">post</a></td></tr>';
+    str += '<tr><td>room:</td><td><input type="text" id="room" style="width:95%"/></td></tr>';
+    str += '<tr><td>subject:</td><td><input type="text" id="subject" style="width:95%"/></td></tr>';
+    str += '<tr><td>description:</td><td><input type="text" id="description" style="width:95%"/></td></tr>';
+    str += '<tr><td>startTime:</td><td><input type="text" id="startTime" style="width:95%"/></td></tr>';
+    str += '<tr><td>completedTime:</td><td><input type="text" id="completedTime" style="width:95%"/></td></tr>';
+    str += '<tr><td>invitePersonList:</td><td><textarea id="invitePersonList"  style="width:95%"/></td></tr>';
+    str += '<tr><td>memo:</td><td><textarea id="memo"  style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#post').click(function() {
+	meeting_post();
+    });
+}
+
+function meeting_post() {
+    $('#result').html('');
+    $.ajax({
+	type : 'post',
+	dataType : 'json',
+	url : '../jaxrs/meeting',
+	contentType : 'application/json; charset=utf-8',
+	data : JSON.stringify({
+	    room : $('#room').val(),
+	    subject : $('#subject').val(),
+	    description : $('#description').val(),
+	    startTime : $('#startTime').val(),
+	    completedTime : $('#completedTime').val(),
+	    memo : $('#memo').val(),
+	    invitePersonList : splitValue($('#invitePersonList').val())
+	}),
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_put_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="put">put</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#put').click(function() {
+	meeting_put_init($('#id').val());
+    });
+}
+
+function meeting_put_init(id) {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="put">put</a></td></tr>';
+    str += '<tr><td>id:</td><td id="id"></td></tr>';
+    str += '<tr><td>applicant:</td><td id="applicant"></td></tr>';
+    str += '<tr><td>room:</td><td><input type="text" id="room" style="width:95%"/></td></tr>';
+    str += '<tr><td>subject:</td><td><input type="text" id="subject" style="width:95%"/></td></tr>';
+    str += '<tr><td>description:</td><td><input type="text" id="description" style="width:95%"/></td></tr>';
+    str += '<tr><td>startTime:</td><td><input type="text" id="startTime" style="width:95%"/></td></tr>';
+    str += '<tr><td>completedTime:</td><td><input type="text" id="completedTime" style="width:95%"/></td></tr>';
+    str += '<tr><td>invitePersonList:</td><td><textarea id="invitePersonList" style="width:95%"/></td></tr>';
+    str += '<tr><td>acceptPersonList:</td><td><textarea id="acceptPersonList" style="width:95%"/></td></tr>';
+    str += '<tr><td>rejectPersonList:</td><td><textarea id="rejectPersonList" style="width:95%"/></td></tr>';
+    str += '<tr><td>memo:</td><td><textarea id="memo" style="width:95%"/></td></tr>';
+    str += '<tr><td>confirmStatus:</td><td><select id="confirmStatus"><option value="wait">wait</option><option value="allow">allow</option><option value="deny">deny</option></select></td></tr>';
+    str += '<tr><td>manualCompleted:</td><td><select id="manualCompleted"><option value="true">true</option><option value="false">false</option></select></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#put').click(function() {
+	meeting_put(id);
+    });
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    $('#id').html(json.data.id);
+	    $('#applicant').html(json.data.applicant);
+	    $('#room').val(json.data.room);
+	    $('#subject').val(json.data.subject);
+	    $('#description').val(json.data.description);
+	    $('#startTime').val(json.data.startTime);
+	    $('#completedTime').val(json.data.completedTime);
+	    $('#invitePersonList').val(joinValue(json.data.invitePersonList));
+	    $('#acceptPersonList').val(joinValue(json.data.acceptPersonList));
+	    $('#rejectPersonList').val(joinValue(json.data.rejectPersonList));
+	    $('#memo').val(joinValue(json.data.memo));
+	    $('#confirmStatus').val(json.data.confirmStatus);
+	    $('#manualCompleted').val(json.data.manualCompleted + '');
+	}
+    });
+}
+
+function meeting_put(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'put',
+	dataType : 'json',
+	url : '../jaxrs/room/' + id,
+	contentType : 'application/json; charset=utf-8',
+	data : JSON.stringify({
+	    room : $('#room').val(),
+	    subject : $('#subject').val(),
+	    description : $('#description').val(),
+	    startTime : $('#startTime').val(),
+	    completedTime : $('#completedTime').val(),
+	    invitePersonList : splitValue($('#invitePersonList').val()),
+	    acceptPersonList : splitValue($('#acceptPersonList').val()),
+	    rejectPersonList : splitValue($('#rejectPersonList').val()),
+	    memo : $('#memo').val(),
+	    confirmStatus : $('#confirmStatus').val(),
+	    manualCompleted : $('#manualCompleted').val()
+	}),
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_delete_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="delete">delete</a></td></tr>';
+    str += '<tr><td>delete id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#delete').click(function() {
+	meeting_delete($('#id').val());
+    });
+}
+
+function meeting_delete(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'delete',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_confirm_allow_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="allow">allow</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#allow').click(function() {
+	meeting_confirm_allow($('#id').val());
+    });
+}
+
+function meeting_confirm_allow(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id + '/confirm/allow',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_confirm_deny_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="deny">deny</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#deny').click(function() {
+	meeting_confirm_deny($('#id').val());
+    });
+}
+
+function meeting_confirm_deny(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id + '/confirm/deny',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_accept_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="accept">accept</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#accept').click(function() {
+	meeting_accept($('#id').val());
+    });
+}
+
+function meeting_accept(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id + '/accept',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_reject_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="reject">reject</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#reject').click(function() {
+	meeting_reject($('#id').val());
+    });
+}
+
+function meeting_reject(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id + '/reject',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_manualCompleted_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="completed">completed</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#completed').click(function() {
+	meeting_manualCompleted($('#id').val());
+    });
+}
+
+function meeting_manualCompleted(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id + '/manual/completed',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_addInvite_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="add">add</a></td></tr>';
+    str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
+    str += '<tr><td>invitePersonList:</td><td><textarea type="text" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#add').click(function() {
+	meeting_addInvite($('#id').val());
+    });
+}
+
+function meeting_addInvite(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'put',
+	dataType : 'json',
+	url : '../jaxrs/meeting/' + id + '/add/invite',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	data : JSON.stringify({
+	    invitePersonList : splitValue($('#invitePersonList').val())
+	}),
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function meeting_listComingMonth_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="list">list</a></td></tr>';
+    str += '<tr><td>count:</td><td><input type="count" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#list').click(function() {
+	meeting_listComingMonth($('#count').val());
+    });
+}
+
+function meeting_listComingMonth(count) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/coming/month/' + count,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	meeting_grid(json.data);
+    });
+}
+
+function meeting_listComingDay_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">	<a href="#" id="list">list</a></td></tr>';
+    str += '<tr><td>count:</td><td><input type="count" id="id" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#list').click(function() {
+	meeting_listComingDay($('#count').val());
+    });
+}
+
+function meeting_listComingDay(count) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/coming/day/' + count,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	meeting_grid(json.data);
+    });
+}
+
+function meeting_search_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">';
+    str += '<a href="#" id="listPinyinInitial">listPinyinInitial</a>';
+    str += '&nbsp;';
+    str += '<a href="#" id="listLike">listLike</a>';
+    str += '&nbsp;';
+    str += '<a href="#" id="listLikePinyin">listLikePinyin</a>';
+    str += '</td></tr>';
+    str += '<tr><td>key:</td><td><input type="text" id="key" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#listPinyinInitial').click(function() {
+	meeting_listPinyinInitial($('#key').val());
+    });
+    $('#listLike').click(function() {
+	meeting_listLike($('#key').val());
+    });
+    $('#listLikePinyin').click(function() {
+	meeting_listLikePinyin($('#key').val());
+    });
+}
+
+function meeting_listPinyinInitial(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/pinyininitial/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	meeting_grid(json.data);
+    });
+}
+
+function meeting_listLike(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/like/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	meeting_grid(json.data);
+    });
+}
+
+function meeting_listLikePinyin(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/meeting/list/like/pinyin/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	meeting_grid(json.data);
+    });
+}

+ 33 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/openMeeting.js

@@ -0,0 +1,33 @@
+openMeeting_parameter = {};
+
+function openMeeting_get() {
+    $('#content').html('');
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/openmeeting',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function openMeeting_list_room() {
+    $('#content').html('');
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/openmeeting/list/room',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).always(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}

+ 323 - 0
o2server/x_general_assemble_control/src/main/webapp/jest/room.js

@@ -0,0 +1,323 @@
+room_parameter = {};
+
+function room_grid(items) {
+    var str = '<table border="1" width="100%"><tbody>';
+    str += '<tr><th>id</th><th>name</th><th>address</th><th>operate</th></tr>';
+    if (items) {
+	$.each(items, function(index, item) {
+	    str += '<tr>';
+	    str += '<td>' + item.name + '</td><td colspan="2">';
+	    if (item.photo && item.photo != '') {
+		str += imageBase64(item.photo);
+	    } else {
+		str += '&nbsp;';
+	    }
+	    str += '</td><td>';
+	    str += '<a href="#" onclick="room_put_init(\'' + item.id + '\')">edit</a>&nbsp;';
+	    str += '<a href="#" onclick="room_delete(\'' + item.id + '\')">delete</a>&nbsp;';
+	    str += '<a href="#" onclick="room_update_photo_init(\'' + item.id + '\')">photo</a>';
+	    str += '</td>';
+	    str += '</tr>';
+	});
+    }
+    str += '</tobdy></table>';
+    $('#content').html(str);
+}
+
+function room_list() {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/room/list',
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    room_grid(json.data, true);
+	}
+    });
+}
+
+function room_get_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="get">get</a></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#get').click(function() {
+	room_delete(id);
+    });
+}
+
+function room_get(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/room/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function room_post_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="post">post</a></td></tr>';
+    str += '<tr><td>name:</td><td><input type="text" id="name" style="width:95%"/></td></tr>';
+    str += '<tr><td>building:</td><td><input type="text" id="building" style="width:95%"/></td></tr>';
+    str += '<tr><td>floor:</td><td><input type="text" id="floor" style="width:95%"/></td></tr>';
+    str += '<tr><td>roomNumber:</td><td><input type="text" id="roomNumber" style="width:95%"/></td></tr>';
+    str += '<tr><td>capacity:</td><td><input type="text" id="capacity" style="width:95%"/></td></tr>';
+    str += '<tr><td>auditor:</td><td><input type="text" id="auditor" style="width:95%"/></td></tr>';
+    str += '<tr><td>available:</td><td><select id="available"><option value="true">true</option><option value="false">false</option></select></td></tr>';
+    str += '<tr><td>device:</td><td><textarea id="device" style="width:95%;height:500px"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#post').click(function() {
+	room_post();
+    });
+}
+
+function room_post() {
+    $('#result').html('');
+    $.ajax({
+	type : 'post',
+	dataType : 'json',
+	url : '../jaxrs/room',
+	contentType : 'application/json; charset=utf-8',
+	data : JSON.stringify({
+	    name : $('#name').val(),
+	    building : $('#building').val(),
+	    floor : $('#floor').val(),
+	    roomNumber : $('#roomNumber').val(),
+	    capacity : $('#capacity').val(),
+	    auditor : $('#auditor').val(),
+	    available : $('#available').val(),
+	    device : $('#device').val()
+	}),
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function room_put_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="select">select</a></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#select').click(function() {
+	room_put_init(id);
+    });
+}
+
+function room_put_init(id) {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="put">put</a></td></tr>';
+    str += '<tr><td>id:</td><td id="id"></td></tr>';
+    str += '<tr><td>name:</td><td><input type="text" id="name" style="width:95%"/></td></tr>';
+    str += '<tr><td>building:</td><td><input type="text" id="building" style="width:95%"/></td></tr>';
+    str += '<tr><td>floor:</td><td><input type="text" id="floor" style="width:95%"/></td></tr>';
+    str += '<tr><td>roomNumber:</td><td><input type="text" id="roomNumber" style="width:95%"/></td></tr>';
+    str += '<tr><td>capacity:</td><td><input type="text" id="capacity" style="width:95%"/></td></tr>';
+    str += '<tr><td>auditor:</td><td><input type="text" id="auditor" style="width:95%"/></td></tr>';
+    str += '<tr><td>available:</td><td><select id="available"><option value="true">true</option><option value="false">false</option></select></td></tr>';
+    str += '<tr><td>device:</td><td><textarea id="device" style="width:95%;height:500px"/></td></tr>';
+    str += '<tr><td>photo:</td><td id="photo">&nbsp;</td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#put').click(function() {
+	room_put(id);
+    });
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/room/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	if (json.type == 'success') {
+	    $('#id').html(json.data.id);
+	    $('#name').val(json.data.name);
+	    $('#building').val(json.data.building);
+	    $('#floor').val(json.data.floor);
+	    $('#roomNumber').val(json.data.roomNumber);
+	    $('#capacity').val(json.data.capacity);
+	    $('#auditor').val(json.data.auditor);
+	    $('#available').val(json.data.available + '');
+	    $('#device').val(json.data.device);
+	}
+    });
+}
+
+function room_put(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'put',
+	dataType : 'json',
+	url : '../jaxrs/room/' + id,
+	contentType : 'application/json; charset=utf-8',
+	data : JSON.stringify({
+	    name : $('#name').val(),
+	    building : $('#building').val(),
+	    floor : $('#floor').val(),
+	    roomNumber : $('#roomNumber').val(),
+	    capacity : $('#capacity').val(),
+	    auditor : $('#auditor').val(),
+	    available : $('#available').val(),
+	    device : $('#device').val()
+	}),
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function room_delete_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="delete">delete</a></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#delete').click(function() {
+	room_delete(id);
+    });
+}
+
+function room_delete(id) {
+    $('#result').html('');
+    $.ajax({
+	type : 'delete',
+	dataType : 'json',
+	url : '../jaxrs/room/' + id,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+    });
+}
+
+function room_put_photo_select(id) {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2"><a href="#" id="put">put</a></td></tr>';
+    str += '<tr><td>photo:</td><td><input type="file" id="file" style="width:95%" ></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#put').click(function() {
+	room_put_photo(id);
+    });
+}
+
+function room_put_photo(id) {
+    $('#result').html('');
+    var formData = new FormData();
+    $.each($('input[type=file]'), function(index, item) {
+	formData.append('file', item.files[0]);
+    });
+    $.ajax({
+	type : 'POST',
+	url : '../servlet/room/' + id + '/photo',
+	data : formData,
+	contentType : false,
+	processData : false,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    });
+}
+
+function room_search_select() {
+    $('#result').html('');
+    var str = '<table border="1" width="100%">';
+    str += '<tr><td colspan="2">';
+    str += '<a href="#" id="listPinyinInitial">listPinyinInitial</a>';
+    str += '&nbsp;';
+    str += '<a href="#" id="listLike">listLike</a>';
+    str += '&nbsp;';
+    str += '<a href="#" id="listLikePinyin">listLikePinyin</a>';
+    str += '</td></tr>';
+    str += '<tr><td>key:</td><td><input type="text" id="key" style="width:95%"/></td></tr>';
+    str += '</table>';
+    $('#content').html(str);
+    $('#listPinyinInitial').click(function() {
+	room_listPinyinInitial($('#key').val());
+    });
+    $('#listLike').click(function() {
+	room_listLike($('#key').val());
+    });
+    $('#listLikePinyin').click(function() {
+	room_listLikePinyin($('#key').val());
+    });
+}
+
+function room_listPinyinInitial(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/room/list/pinyininitial/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	room_grid(json.data);
+    });
+}
+
+function room_listLike(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/room/list/like/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	room_grid(json.data);
+    });
+}
+
+function room_listLikePinyin(key) {
+    $('#result').html('');
+    $.ajax({
+	type : 'get',
+	dataType : 'json',
+	url : '../jaxrs/room/list/like/pinyin/' + key,
+	xhrFields : {
+	    'withCredentials' : true
+	},
+	crossDomain : true
+    }).done(function(json) {
+	$('#result').html(JSON.stringify(json, null, 4));
+	room_grid(json.data);
+    });
+}

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است