diff --git a/.classpath b/.classpath new file mode 100644 index 00000000..1151b0d2 --- /dev/null +++ b/.classpath @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch b/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch new file mode 100644 index 00000000..627021fb --- /dev/null +++ b/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch b/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch new file mode 100644 index 00000000..6ef634c6 --- /dev/null +++ b/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.project b/.project new file mode 100644 index 00000000..ee52646f --- /dev/null +++ b/.project @@ -0,0 +1,52 @@ + + + mcms + + + + + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 00000000..085a4246 --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..91dd7c1a --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,96 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..5a91e532 --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..4045d870 --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.settings/org.eclipse.wst.jsdt.ui.prefs b/.settings/org.eclipse.wst.jsdt.ui.prefs new file mode 100644 index 00000000..6bf5ec1a --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.wst.jsdt.ui.text.custom_code_templates= diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 00000000..3bd5d0a4 --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 00000000..05bd71b6 --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 00000000..04cad8cb --- /dev/null +++ b/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/.settings/org.eclipse.wst.xsl.core.prefs b/.settings/org.eclipse.wst.xsl.core.prefs new file mode 100644 index 00000000..e28962cd --- /dev/null +++ b/.settings/org.eclipse.wst.xsl.core.prefs @@ -0,0 +1,11 @@ +CHECK_CALL_TEMPLATES=2 +CHECK_XPATHS=2 +CIRCULAR_REF=2 +DUPLICATE_PARAMETER=2 +EMPTY_PARAM=1 +MISSING_INCLUDE=2 +MISSING_PARAM=1 +NAME_ATTRIBUTE_EMPTY=2 +NAME_ATTRIBUTE_MISSING=2 +TEMPLATE_CONFLICT=2 +eclipse.preferences.version=1 diff --git a/README.md b/README.md new file mode 100644 index 00000000..7930a0d9 --- /dev/null +++ b/README.md @@ -0,0 +1,103 @@ +#铭飞MCMS内容管理系统完整开源版J2EE代码 + +当前版本:5.4.4 +铭飞MS官网:http://ms.ming-soft.com +官网同时提供一键运行版本下载,请步移官网.... +QQ交流群号:221335098 +#特点 +免费开源:纯Java开发,MS开发团队承诺将MCMS内容系统永久完整开源; + +终端统一: 铭飞MCMS支持PC与MOBILE皮肤定制,同时使用MS团队移动JS插件,轻松实现手机多屏幕适配,想想看你发布的信息第一时间在PC上展示又能在手机上展示,这是件多么幸福的事情,数据统一、平台统一、终端统一是MS团队一直在努力的方向; + +扩展性:以铭飞MCMS为核心,MS官网提供第三方插件安装,最新的插件用户可以通过更新功能获得,同时MS也鼓励并支持第三方开发人员发布优质的插件; + +更新升级: 铭飞MCMS提供了行业内最完美的升级方案,从此升级无需手动下载复制粘贴,一切完全由MS升级插件无缝完成; + +文档手册:铭飞不断向外部公布最新文档,如二次开发手册、标签使用手册,减轻用户学习成本; + +站群:MCMS支持站群,只需在服务器上架设一套铭飞MCMS就可以创建多个个网站,并且网站之间的数据是独立存在,很大程度降低了维护成本,与服务器资源的开销; + +其他:html静态生成、标签式建站 + +技术支持:提永久升级服务技术交流群,不定期会升级系统,开发可以关注后台的更新板块; + + +#面向对象 +铭飞MCMS是企业在创立初期很好的技术基础框架,加快公司项目开发进度,当然也可以对现有的系统进行升级; + +个人开发者也可以使用MCMS承接外包项目; + +初学JAVA的同学可以下载源代码来进行学习交流; + + +#开发框及语言 + +铭飞MCMS(铭飞内容管理系统)是一款支持不同平台、不同终端并且支持多站点的内容管理系统, + +· SpringMVC4+Spring4+MyBatis3+Freemarker技术架构 + +· 基于java技术开发,继承其强大、稳定、安全、高效、跨平台等多方面的优点; + +· 标签化建站,只要你懂html就能建站; + +· 完全生成全站静态页面; + +· 可自定义路径结构,全面提高页面访问速度; + +有人说铭飞MCMS是全国唯一完整开源的J2EE版本系统!团队希望看到更多的优秀好用的开源系统,我们一直会努力下去! + + +#运行环境 + +原则上支持全系列JAVA运行环境; + +WEB服务器:Weblogic、Tomcat、WebSphere、JBoss、Jetty 等 + +数据库服务器:Mysql等 + +操作系统:Windows、Linux、Unix 等 + + +#开发环境 + +建议开发者使用以下环境,这样避免版本带来的问题 + +IDE:eclipse、MyEclise + +DB:Mysql5.5 + +JDK:JAVA 7、J2EE6 + + +#重要文件说明 + +数据库连接文件: config.properties + +数据库文件:doc/db-mcms-open.sql + +数据库编码:UTF-8 + +模板文件:templets/1549/mooc + +后台访问路径: + +http://+ip地址(或localhost)+tomcat端口+项目发布名/ms/login.do + +如果出现无法访问的情况输入 + +http://+ip地址(或localhost)+tomcat端口+项目发布名/initApp进行初始化 + +账号:msopen + +密码:msopen + + +#代码部署与常见问题 + +参考铭飞MS官方开发社区文档 http://ms.ming-soft.com/mbbs/12998/detail.do + +#系统美图 +![输入图片说明](http://git.oschina.net/uploads/images/2015/1029/110523_6727b755_542665.jpeg "铭飞模版商城,模版商城") +![输入图片说明](http://git.oschina.net/uploads/images/2015/1108/143215_21e5f30a_542665.png "铭飞模版商城,插件商城") +![输入图片说明](http://git.oschina.net/uploads/images/2015/1029/104525_0cfcedb7_542665.png "铭飞MS后台演示") +![输入图片说明](http://git.oschina.net/uploads/images/2015/1029/105109_bf9db869_542665.png "铭飞内容管理系统后台演示") \ No newline at end of file diff --git a/doc/db-mcms-open.sql b/doc/db-mcms-open.sql new file mode 100644 index 00000000..c68eb08a --- /dev/null +++ b/doc/db-mcms-open.sql @@ -0,0 +1,555 @@ +/* + Navicat Premium Data Transfer + + Source Server : localhost + Source Server Type : MySQL + Source Server Version : 50624 + Source Host : localhost + Source Database : db-mcms-open + + Target Server Type : MySQL + Target Server Version : 50624 + File Encoding : utf-8 + + Date: 10/27/2015 23:01:15 PM +*/ + +SET NAMES utf8; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for `app` +-- ---------------------------- +DROP TABLE IF EXISTS `app`; +CREATE TABLE `app` ( + `APP_ID` int(22) NOT NULL AUTO_INCREMENT COMMENT '站点ID,关联基础表BasicId', + `APP_NAME` varchar(60) NOT NULL COMMENT '站点名称', + `APP_URL` varchar(200) NOT NULL COMMENT '站点域名', + `APP_LOGO` varchar(120) DEFAULT NULL COMMENT '站点LOGO', + `APP_KEYWORD` varchar(1000) DEFAULT NULL COMMENT '站点关键字', + `APP_COPYRIGHT` varchar(1000) DEFAULT NULL COMMENT '站点版权信息', + `APP_STYLE` varchar(50) DEFAULT NULL COMMENT '站点风格', + `APP_MANAGERID` int(11) DEFAULT NULL COMMENT '站点管理员ID', + `APP_DESCRIPTION` varchar(1000) DEFAULT NULL COMMENT '站点描述', + `APP_DATETIME` datetime DEFAULT NULL COMMENT '应用发布日期', + `APP_MOBILE_STYLE` varchar(11) DEFAULT NULL COMMENT '应用移动端风格', + `APP_PAY_DATE` datetime DEFAULT NULL COMMENT '应用续费时间', + `APP_PAY` varchar(45) DEFAULT NULL COMMENT '费用清单', + PRIMARY KEY (`APP_ID`) +) ENGINE=MyISAM AUTO_INCREMENT=1550 DEFAULT CHARSET=utf8 COMMENT='应用表'; + +-- ---------------------------- +-- Records of `app` +-- ---------------------------- +BEGIN; +INSERT INTO `app` VALUES ('1549', 'MCMS-OPEN', 'http://localhost:8080', '', '', '', 'mooc', '50', '', null, null, null, ''); +COMMIT; + +-- ---------------------------- +-- Table structure for `basic` +-- ---------------------------- +DROP TABLE IF EXISTS `basic`; +CREATE TABLE `basic` ( + `BASIC_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长ID', + `BASIC_TITLE` varchar(300) DEFAULT NULL COMMENT '标题', + `BASIC_DESCRIPTION` text COMMENT '描述', + `BASIC_THUMBNAILS` varchar(1000) DEFAULT NULL COMMENT '缩略图', + `BASIC_HIT` bigint(22) DEFAULT NULL COMMENT '点击次数', + `BASIC_SORT` int(11) DEFAULT NULL COMMENT '排序', + `BASIC_DATETIME` datetime DEFAULT NULL COMMENT ' 发布时间', + `BASIC_UPDATETIME` datetime DEFAULT NULL COMMENT '更新时间', + `BASIC_PEOPLEID` int(22) DEFAULT NULL COMMENT '用户编号', + `BASIC_CATEGORYID` int(22) DEFAULT NULL COMMENT '所属分类编号', + `BASIC_APPID` int(11) DEFAULT NULL COMMENT '应用编号', + `BASIC_MODELID` int(11) DEFAULT NULL COMMENT '模块编号', + PRIMARY KEY (`BASIC_ID`), + UNIQUE KEY `SYS_C009068` (`BASIC_ID`), + KEY `BASIC_TITLE` (`BASIC_TITLE`(255)), + KEY `BASIC_APPID` (`BASIC_APPID`) USING BTREE, + KEY `BASIC_MODELID` (`BASIC_MODELID`) USING BTREE, + KEY `BASIC_CATEGORYID` (`BASIC_CATEGORYID`) USING BTREE, + KEY `BASIC_DATETIME` (`BASIC_DATETIME`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='基础表'; + +-- ---------------------------- +-- Records of `basic` +-- ---------------------------- +BEGIN; +INSERT INTO `basic` VALUES ('1', 'sdadsa', 'qwe', '/upload/article/1549/1442553027420.jpg', '0', '11', '2015-09-18 13:10:38', '2015-09-18 13:10:38', '0', '15', '0', '8'), ('2', '外国工艺美术史', '本课程为清华大学人文素质核心课程。自从地球上有了人类,工艺美术也就开始产生了。\r\n一部工艺美术史,实际上也是人类文明不断发展、演变和进步历程的形象记录。上下百万年,人们创造的分布在世界各地、难以数计的工艺美术作品,无一不是人类文明高容量的载体。\r\n外国工艺美术史研究是人文学科中的重要环节。它对培养国人的文化素质,提高我国综合素质教育质量,完善人文学科,树立学术形象,提升综合学术地位,皆有重要意义。', '/upload/article/1549/1442556661232.png', '0', '0', '2015-09-18 14:11:46', '2015-09-18 17:59:57', '0', '48', '0', '8'), ('3', '古文字学', '讲授甲骨、金文、战国古文等古代文字的课程。\r\n本课程主要讲授汉字的起源、发展及不同历史时期的文字面貌,涉及甲骨文、金文、小篆、战国古文、早期隶书、《说文》部首等,使学生对于中国文字的形态及文字学历史有一个概貌性的认识,并初步掌握识读古文字的方法。另外,通过讲授古文字学的基本理论(如古文字学的性质、任务,汉字起源,古文字的考释方法,古文字的演变规律等)和各种古文字原材料(如甲骨文、金文、简帛、玺印、货币文字等),开拓学生视野,熟悉古文字遗产,掌握有关古文字的基础知识,具有阅读和钻研古文字原材料的初步能力,为进一步学习和研究古代的语言文字打下基础,进而初步具备整理古籍文献及出土文献的方法及进一步从事古文字研究、比较文字学研究的能力。', '/upload/article/1549/1442556728074.png', '0', '0', '2015-09-18 14:13:07', '2015-09-18 18:00:05', '0', '48', '0', '8'), ('4', 'Data Analysis and Statistical Inference', '认清数据收集的重要性,认清数据收集方法的局限,认清这些因素是如何影响推断的。使用数据软件(R)来在数字上和在视觉上总结数据,并且呈现对数据的分析。\r\n对统计推断的本质有一个概念上的理解。利用评估和测试方法(置信区间和假说测试)来分析单一变量和两个变量之间的关系,以便于理解自然现象的本质以及做出基于数据的决策。利用回归框架做模型来研究两个或更多数据之间的关系。', '/upload/article/1549/1442556817573.png', '0', '0', '2015-09-18 14:15:34', '2015-09-18 17:17:44', '0', '48', '0', '8'), ('5', 'Understanding IELTS: Techniques for English Language Tests', '这门课程不仅适合考虑参加英语语言考试的学习者,也适合正在学习英语的学习者。本课程专注于雅思考试。雅思是全球最普及的为出国学习或者生活做准备的语言考试。全世界有9000个包括大学,公司,移民机构,职业机构等组织承认雅思考试。去年全球雅思考试数量超过了2百万。这门关于雅思的课程将引导你进入每一个雅思考试阶段:从阅读,写作,口语到听力。每阶段我们的老师和经验丰富的雅思辅导者都会提供考试指导。本课程开始时间为9月21日。\r\n', '/upload/article/1549/1442557011444.png', '0', '0', '2015-09-18 14:18:24', '2015-09-18 18:00:13', '0', '48', '0', '8'), ('6', '社会和经济网络:模型和分析 ', '社会网络渗透于我们社会和经济生活的每一个角落。他们在传递就业机会信息中发挥了核心作用,对很多商品和服务的贸易也至关重要。他们在决定我们购买的何种产品、我们讲述何种语言、我们如何投票、我们是否决定犯罪、我们受到多少教育、我们获得专业成功的可能性。网络结构通过无数方式影响我们的生活,因此,理解下述问题就显得至关重要:社会网络结构如何影响行为,何种网络结构更容易在社会中出现,为何我们时常组织起来。借鉴社会学家、经济学家、计算机科学家、物理学家和数学家的研究成果,本门课程提供了社会和经济网络的一个概述和综合性研究。', '/upload/article/1549/1442557261924.png', '0', '0', '2015-09-18 14:22:16', '2015-09-18 18:00:21', '0', '48', '0', '8'), ('7', 'Internet History, Technology, and Security', '科技和网络给我们生活、文化、社会带来的影响不断增强。最有利的证明就是你可以在世界各地上这门课,你需要的是过去的六十个年头依赖被设计、创造的科技工具,我们应理解网络科技是怎么运作的。这门课在互联网上公开,向你展示它是如何创造,谁创造的,以及它怎样运作。展示的过程中,我们将带领你采访开发互联网和网络技术的领军人物。\r\n', '/upload/article/1549/1442557424762.png', '0', '0', '2015-09-18 14:24:18', '2015-09-18 17:59:40', '0', '48', '0', '8'), ('8', '婴儿令人惊奇的逻辑思维', '这个课程的目标是帮助你培养一种有价值的思维能力—— 一种我们祖先在这3000年来慢慢培养出来的强大的思维方式。数学思维和做数学题不一样——至少和学校里学的数学不一样。在学校里,学数学主要是学习如何解决一些来自日常生活,科学,或者数学本身的有固定模式的题目。在学校数学中成功的关键是学会用固定的方法思考。与之相反,数学思维的关键之一是创造性思维——现代社会中一个很重要的能力。这个课程帮助学生养成这种重要的思维习惯。课程的主要对象是想以数学或者需要数学的学科为专业的大学一年级学生,和想学这些专业的高中三年级学生(对于美国来说是高中四年级)。这些人需要数学思维来成功的学好他们的专业。但是,数学思维也是一个很有价值的生活技能,任何17岁以上的人都可以从本课程中获益。', '/upload/article/1549/1442557545286.png', '0', '0', '2015-09-18 14:26:56', '2015-09-18 15:17:09', '0', '49', '0', '8'), ('9', '前所未见,野性自然', '这门课程不仅适合考虑参加英语语言考试的学习者,也适合正在学习英语的学习者。本课程专注于雅思考试。雅思是全球最普及的为出国学习或者生活做准备的语言考试。全世界有9000个包括大学,公司,移民机构,职业机构等组织承认雅思考试。去年全球雅思考试数量超过了2百万。这门关于雅思的课程将引导你进入每一个雅思考试阶段:从阅读,写作,口语到听力。每阶段我们的老师和经验丰富的雅思辅导者都会提供考试指导。本课程开始时间为9月21日。', '/upload/article/1549/1442557671339.png', '0', '0', '2015-09-18 14:29:10', '2015-09-18 15:17:02', '0', '49', '0', '8'), ('10', '宇宙的设计', '这门课程介绍了起源于硅谷并在全世界出现的高科技企业的基础知识。你将会学习高科技企业家建立公司的过程。内容包括产生创意,寻找商业机会,收集人才资金资源,研究如何推销及策划创意及控制公司快速发展。在学习过程中学生组织成小组并以小组为单位研究创业项目。\r\n这是第二次公开授课,上次有来自全世界的大约40000名学生参与了课程并进行了小组合作。表现优异的小组将会配备硅谷的导师,最好的小组的创意将会被推荐给投资者。上次课程的许多学生都建立了自己的创业公司并被定期指导。', '/upload/article/1549/1442557772177.png', '0', '0', '2015-09-18 14:30:09', '2015-09-18 15:16:56', '0', '49', '0', '8'), ('11', '水处理工程', '环境工程、市政工程等专业的主干专业课,主要讲述水和废水处理中主要的物化和生物处理方法的基本原理、工艺构成、运行特点、工艺计算方法以及部分工程实例。该课程是从事水处理技术研究、设计以及运行管理人员的必修课。', '/upload/article/1549/1442557870059.png', '0', '0', '2015-09-18 14:31:38', '2015-09-18 15:16:45', '0', '49', '0', '8'), ('12', '科研不易,研究生新生的11门必修课! ', '要成为一名出色的科研工作者,你需要从研究生阶段开始培养自己的科研能力和交流能力——两者缺一不可。前者让你能够确定有价值的问题,制定严谨可行的实验计划;后者使你能够把研究成果有效地介绍给其他学者与大众,激发进一步的讨论。此外,高效时间管理与健康的身体也十分重要。MOOC学院与多伦多大学生理学博士@梧桐清声 选出11门课程,让你的科研之路更加顺利!', '/upload/article/1549/1442557954327.png', '0', '0', '2015-09-18 14:33:13', '2015-09-18 15:16:38', '0', '37', '0', '8'), ('13', '再思考:如何推理与举证', '推理是非常重要的。这门课程将教会你如何正确推理。你将会学到如何理解并评断他人的论据,以及如何基于感兴趣的话题构造自己的论据。\r\n', '/upload/article/1549/1442558049812.jpg', '0', '0', '2015-09-18 14:35:41', '2015-09-18 14:35:41', '0', '37', '0', '8'), ('14', '如何开始创业 How to Start a Startup', '通过本课程,免费跟随世界级专家那里学习如何开始创业。\r\nCS183B是斯坦福大学的一门课,这是专门为想创业的人设计的一门独立的商业课程,一共有20个课程视频,有的是由一个讲师讲授,有的是两个讲师,还有的是一个小组,所有课程视频总长为1000分钟。\r\n', '/upload/article/1549/1442558186693.jpg', '0', '0', '2015-09-18 14:38:08', '2015-09-18 15:16:49', '0', '37', '0', '8'), ('15', '数学之旅', '数学的重要特征是它的抽象性,这一特征是令人生畏的。但也正是这一特征可以使人们在繁杂的世界中逐步懂得宇宙深处伟大设计图的语言;可以用理性的思维达到超出人类感官所及的宇宙的根本。而这一切正是数学的魅力所在,也是数学在人类历史上起着其它科学不可替代作用的重要原因。但这也是很多学生畏惧数学或学习数学的困难所在。', '/upload/article/1549/1442558351296.jpg', '0', '0', '2015-09-18 14:40:04', '2015-09-18 15:16:26', '0', '37', '0', '8'), ('16', 'mooc幻灯一', '', '/upload/article/1549/1442558436452.jpg', '0', '0', '2015-09-18 14:40:53', '2015-09-18 14:40:53', '0', '50', '0', '8'), ('17', 'mooch幻灯2', '', '/upload/article/1549/1442558480746.jpg', '0', '0', '2015-09-18 14:41:23', '2015-09-18 14:41:23', '0', '51', '0', '8'), ('18', '首页幻灯', '', '/upload/article/1549/1442558658877.jpg', '0', '0', '2015-09-18 14:43:17', '2015-09-18 14:44:20', '0', '15', '0', '8'), ('19', '天体生物学和寻找外星生命', '两千年多以前,古希腊人曾探究过宇宙中是否存在其他世界。现在,人们正通过实验来验证这个问题。这门课程由英国爱丁堡大学的天体生物学中心提供,旨在介绍天体生物学,也是MOOC首次探索此类课题。这门课程将探讨地球上生物的起源和演化,以及地球以外存在生命的可能性。\r\n“天体生物学”解答了人们普遍感兴', '/upload/article/1549/1442558964440.jpg', '0', '0', '2015-09-18 14:50:16', '2015-09-18 15:16:19', '0', '22', '0', '8'), ('20', '文物精品与文化中国', '中国考古学是以往100年中发展最为迅速的领域之一,大批珍贵文物的出土,不断刷新人们对文化中国的认识。本课程以4-6件(组)精品文物作引子,将学术界探索中华文明的过程作为线索,介绍古代中国在造船、玉器等诸多领域的杰出成就,其中不乏学术前沿的考古发现与研究成果,内容精彩纷呈,雅俗共赏,学生可以藉此获得对文化中国全方位的、直观而深入的认识。', '/upload/article/1549/1442559055570.jpg', '0', '0', '2015-09-18 14:51:29', '2015-09-18 15:16:07', '0', '22', '0', '8'), ('21', '中国建筑史', '', '/upload/article/1549/1442559113247.png', '0', '0', '2015-09-18 14:52:39', '2015-09-18 15:16:01', '0', '22', '0', '8'), ('22', '新媒体概论', '本课程主要探讨新媒体与社会之间的互动关系,一方面关注各种社会力量对新媒体的塑造,另一方面讨论新媒体对社会各个层面的影响。课程在探讨新媒体的概念、特征、形式、内容和历史的基础上,同时关注新媒体的采纳、扩散、伦理和法制,以及新媒体在政治、经济、文化和社会结构上对社会的影响。本课程有助于学生掌握新媒体的相关概念和理论,理解新媒体在社会控制和社会变迁中的重要角色,成为新媒体时代具有批判能力和责任意识的现代公民。', '/upload/article/1549/1442559199247.jpg', '0', '0', '2015-09-18 14:53:47', '2015-09-18 15:15:55', '0', '22', '0', '8'), ('23', '合作代理', '​门槛最低,功能最全最灵活,利润最大,支撑最大!\r\n支撑优势\r\n甩单支撑产品培训销售培训迟训升级\r\n远程咨询地区保护落地支撑奖金激励', '', '0', '0', '2015-09-18 16:30:54', '2015-09-18 16:37:14', '0', '18', '0', '8'), ('24', '关于我们', ' 公司于2012年3月8日,已正式向《景德镇市工商行政管理局》领取营业 执照。\r\n 公司名称:景德镇铭飞科技有限公司\r\n 经营范围:计算机系统服务及技术开发、咨询服务', '', '0', '0', '2015-09-18 16:31:18', '2015-09-18 16:33:09', '0', '19', '0', '8'), ('25', '产品服务', ' 公司于2012年3月8日,已正式向《景德镇市工商行政管理局》领取营业 执照。\r\n 公司名称:景德镇铭飞科技有限公司\r\n 经营范围:计算机系统服务及技术开发、咨询服务', '', '0', '0', '2015-09-18 16:31:55', '2015-09-18 16:31:55', '0', '16', '0', '8'), ('26', '产品服务', '终端统一:MCMS支持PC与MOBILE皮肤定制,同时使用MS团队移动JS插件,轻松实现手机多屏幕适配,想想看你发布的信息第一时间在pc上展示又能在手机上展示,这是件多么幸福的事情,数据统一、平台统一、终端统一是MS团队一直在努力的方向;', '', '0', '0', '2015-09-18 16:31:57', '2015-09-18 16:39:16', '0', '16', '0', '8'); +COMMIT; + +-- ---------------------------- +-- Table structure for `basic_attention` +-- ---------------------------- +DROP TABLE IF EXISTS `basic_attention`; +CREATE TABLE `basic_attention` ( + `ba_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长ID', + `ba_peopleID` int(11) DEFAULT NULL COMMENT '用户id', + `ba_appID` int(11) DEFAULT NULL COMMENT '用户应用id', + `ba_basicID` int(11) DEFAULT NULL COMMENT '用户收藏关联的基础id', + `ba_type` int(11) DEFAULT NULL COMMENT '收藏类型 1: 收藏 2:顶', + `ba_datetime` datetime DEFAULT NULL COMMENT '用户收藏文章,帖子或商品时的时间', + `ba_url` varchar(200) DEFAULT NULL COMMENT '收藏的文章,帖子,商品的链接地址', + PRIMARY KEY (`ba_id`), + KEY `BA_PEOPLEID` (`ba_peopleID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户收藏表'; + +-- ---------------------------- +-- Table structure for `basic_category` +-- ---------------------------- +DROP TABLE IF EXISTS `basic_category`; +CREATE TABLE `basic_category` ( + `bc_basic_id` int(11) NOT NULL COMMENT '文章编号', + `bc_category_id` int(11) NOT NULL COMMENT '分类编号', + UNIQUE KEY `bc_basic_id` (`bc_basic_id`,`bc_category_id`), + KEY `bc_category_id` (`bc_category_id`), + KEY `bc_category_id_2` (`bc_category_id`), + KEY `bc_category_id_3` (`bc_category_id`), + CONSTRAINT `basic_category_ibfk_1` FOREIGN KEY (`bc_basic_id`) REFERENCES `basic` (`BASIC_ID`) ON DELETE CASCADE, + CONSTRAINT `basic_category_ibfk_2` FOREIGN KEY (`bc_category_id`) REFERENCES `category` (`CATEGORY_ID`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章多分类表'; + +-- ---------------------------- +-- Table structure for `category` +-- ---------------------------- +DROP TABLE IF EXISTS `category`; +CREATE TABLE `category` ( + `CATEGORY_ID` int(22) NOT NULL AUTO_INCREMENT COMMENT '类别ID', + `CATEGORY_TITLE` varchar(50) DEFAULT NULL COMMENT '类别标题', + `CATEGORY_SORT` int(10) DEFAULT NULL COMMENT '类别排序', + `CATEGORY_DATETIME` datetime DEFAULT NULL COMMENT '类别发布时间', + `CATEGORY_MANAGERID` int(22) DEFAULT NULL COMMENT '发布用户ID', + `CATEGORY_MODELID` int(11) DEFAULT NULL COMMENT '所属模块ID', + `CATEGORY_CATEGORYID` int(22) DEFAULT NULL COMMENT '父类别编号', + `CATEGORY_SMALLIMG` varchar(120) DEFAULT NULL COMMENT '缩略图', + `CATEGORY_APPID` int(11) DEFAULT NULL COMMENT '应用编号', + `CATEGORY_DESCRIPTION` varchar(45) DEFAULT NULL COMMENT '栏目描述', + PRIMARY KEY (`CATEGORY_ID`), + KEY `CATEGORY_APPID` (`CATEGORY_APPID`), + KEY `CATEGORY_MANAGERID` (`CATEGORY_MANAGERID`), + KEY `CATEGORY_MODELID` (`CATEGORY_MODELID`), + KEY `CATEGORY_CATEGORYID` (`CATEGORY_CATEGORYID`) +) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8 COMMENT='分类表'; + +-- ---------------------------- +-- Records of `category` +-- ---------------------------- +BEGIN; +INSERT INTO `category` VALUES ('15', '首页幻灯', '0', '2015-09-01 15:27:46', '50', '7', '0', null, '1549', null), ('16', '产品服务', '0', '2015-09-01 15:30:24', '50', '7', '0', null, '1549', null), ('17', '物联网', '0', '2015-09-01 15:30:59', '50', '7', '0', null, '1549', null), ('18', '合作代理', '0', '2015-09-01 15:31:19', '50', '7', '0', null, '1549', null), ('19', '关于我们', '0', '2015-09-01 15:31:30', '50', '7', '0', null, '1549', null), ('20', '成功案例', '0', '2015-09-01 15:31:47', '50', '7', '0', null, '1549', null), ('21', '解决方案', '0', '2015-09-01 15:32:14', '50', '7', '0', null, '1549', null), ('22', '新闻动态', '0', '2015-09-01 15:32:59', '50', '7', '0', null, '1549', null), ('23', '常见问题', '0', '2015-09-01 15:33:54', '50', '87', '0', null, '1549', null), ('24', '常见问题', '0', '2015-09-01 15:34:50', '50', '7', '0', null, '1549', null), ('25', '免责声明', '0', '2015-09-01 16:48:18', '50', '7', '0', null, '1549', null), ('26', '前端开发', '0', '2015-09-01 17:13:36', '50', '7', '0', null, '1549', null), ('27', '网页设计', '0', '2015-09-01 17:13:49', '50', '7', '0', null, '1549', null), ('28', '移动开发', '0', '2015-09-01 17:14:04', '50', '7', '0', null, '1549', null), ('29', '实用工具', '0', '2015-09-01 17:14:16', '50', '7', '0', null, '1549', null), ('30', '程序人生', '0', '2015-09-01 17:14:33', '50', '7', '0', null, '1549', null), ('31', '素材资源', '0', '2015-09-01 17:14:52', '50', '7', '0', null, '1549', null), ('32', '创意欣赏', '0', '2015-09-01 17:15:06', '50', '7', '0', null, '1549', null), ('33', '投资', '0', '2015-09-02 00:32:02', '50', '87', '0', null, '1549', null), ('34', '商业', '0', '2015-09-02 00:32:49', '50', '7', '0', null, '1549', null), ('35', '案列', '0', '2015-09-02 00:33:03', '50', '7', '0', null, '1549', null), ('36', '精选', '0', '2015-09-02 00:33:16', '50', '7', '0', null, '1549', null), ('37', '评测', '0', '2015-09-02 00:33:32', '50', '7', '0', null, '1549', null), ('38', '业界', '0', '2015-09-02 00:33:57', '50', '7', '0', null, '1549', null), ('39', '手机', '0', '2015-09-02 00:34:11', '50', '7', '0', null, '1549', null), ('40', '家电', '0', '2015-09-02 00:34:20', '50', '7', '0', null, '1549', null), ('41', '投资', '0', '2015-09-02 00:35:56', '50', '7', '0', null, '1549', null), ('42', '智客', '0', '2015-09-02 00:36:33', '50', '7', '0', null, '1549', null), ('48', '课程', '0', '2015-09-16 23:26:56', '50', '7', '0', null, '1549', null), ('49', '演讲', '0', '2015-09-16 23:27:19', '50', '7', '0', null, '1549', null), ('50', 'moocSlide', '0', '2015-09-17 12:14:47', '50', '7', '0', null, '1549', null), ('51', 'moocsoidq', '0', '2015-09-17 12:17:48', '50', '7', '0', null, '1549', null); +COMMIT; + +-- ---------------------------- +-- Table structure for `cms_article` +-- ---------------------------- +DROP TABLE IF EXISTS `cms_article`; +CREATE TABLE `cms_article` ( + `ARTICLE_BASICID` int(20) DEFAULT NULL COMMENT '文章ID', + `ARTICLE_AUTHOR` varchar(20) DEFAULT NULL COMMENT '文章作者', + `ARTICLE_CONTENT` longtext COMMENT '文章内容', + `ARTICLE_TYPE` varchar(100) DEFAULT NULL COMMENT '文章类型', + `ARTICLE_SOURCE` varchar(300) DEFAULT NULL COMMENT '文章来源', + `ARTICLE_URL` varchar(200) DEFAULT NULL COMMENT '文章跳转链接地址', + `ARTICLE_KEYWORD` varchar(300) DEFAULT NULL COMMENT '文章关键字', + `ARTICLE_FREEORDER` int(255) DEFAULT NULL COMMENT '文章自定义显示顺序', + `ARTICLE_WEBID` int(11) DEFAULT NULL COMMENT '文章管理的应用id', + UNIQUE KEY `ARTICLE_BASICID` (`ARTICLE_BASICID`) USING BTREE, + KEY `ARTICLE_WEBID` (`ARTICLE_WEBID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文章表'; + +-- ---------------------------- +-- Records of `cms_article` +-- ---------------------------- +BEGIN; +INSERT INTO `cms_article` VALUES ('2', '铭飞科技', '

本课程为清华大学人文素质核心课程。自从地球上有了人类,工艺美术也就开始产生了。
一部工艺美术史,实际上也是人类文明不断发展、演变和进步历程的形象记录。上下百万年,人们创造的分布在世界各地、难以数计的工艺美术作品,无一不是人类文明高容量的载体。
外国工艺美术史研究是人文学科中的重要环节。它对培养国人的文化素质,提高我国综合素质教育质量,完善人文学科,树立学术形象,提升综合学术地位,皆有重要意义。

课程章节

第一章 古代埃及工艺美术
1.1 古代埃及概述
1.2 古代埃及陶工艺
1.3 古代埃及石工艺
1.4 古代埃及金属工艺
1.5 古代埃及玻璃工艺
1.6 古代埃及木工艺、小结
第1周作业

第二章 古代两河流域工艺美术

第三章 古代波斯工艺美术

第四章 古代印度工艺美术

第五章 古代日本工艺美术

第六章 古代地中海区域工艺美术

第七章 古代希腊工艺美术

第八章 埃特鲁里亚工艺美术

第九章 古代罗马工艺美术

第十章 古代伊斯兰工艺美术

第十一章 欧洲中世纪工艺美术

第十二章 文艺复兴时期工艺美术

第十三章 巴洛克时期工艺美术

第十四章 洛可可时期工艺美术

第十五章 新古典主义时期工艺美术


', '', '铭飞科技', '/48\\2.html', '', '0', '1549'), ('3', '铭飞科技', '

讲授甲骨、金文、战国古文等古代文字的课程。

本课程主要讲授汉字的起源、发展及不同历史时期的文字面貌,涉及甲骨文、金文、小篆、战国古文、早期隶书、《说文》部首等,使学生对于中国文字的形态及文字学历史有一个概貌性的认识,并初步掌握识读古文字的方法。另外,通过讲授古文字学的基本理论(如古文字学的性质、任务,汉字起源,古文字的考释方法,古文字的演变规律等)和各种古文字原材料(如甲骨文、金文、简帛、玺印、货币文字等),开拓学生视野,熟悉古文字遗产,掌握有关古文字的基础知识,具有阅读和钻研古文字原材料的初步能力,为进一步学习和研究古代的语言文字打下基础,进而初步具备整理古籍文献及出土文献的方法及进一步从事古文字研究、比较文字学研究的能力。

证书要求
本课程非常重视平时练习,平时成绩占二分之一。考试范围原则上不超出教材及课堂所讲述的内容。成绩合格率一般在95%左右,优秀比例视平时成绩而定,总数不限。

预备知识
古代汉语、训诂学、文献学


授课大纲
大致以五分之一的课时讲授基本理论,以五分之四的课时讲授甲骨文、金文、战国文字等各类古文字原材料。课程内容与每周内容分配:
隶变与古文字源起,占1周;
甲骨文,2周;
金文,2周;
战国古文,3周;
秦及汉初文字,1周;
古文字文化解读与解秘,3周。


参考资料
陈炜湛、唐钰明《古文字学纲要》,中山大学出版社1988年初版,2009年12月第二版。陈世辉、汤余惠《古文字学概要》,福建人民出版社2011年4月。
裘锡圭《文字学概要》,商务印书馆1988年版。
张桂光《汉字学简论》广东高等教育出版社2004年版。
唐兰《中国文字学》,商务印书馆1930年代排印本,1986年上海古籍出版社据开明书店1949年3月版重印本。
高明《古文字类编》增订本,上海古籍出版社2011年版。


', '', '铭飞科技', '/48\\3.html', '', '0', '1549'), ('23', '铭飞科技', '

门槛最低,功能最全最灵活,利润最大,支撑最大!

支撑优势

甩单支撑产品培训销售培训迟训升级

远程咨询地区保护落地支撑奖金激励


最大利润空间

超低折扣报价有效营销指导灵活报价策略免费现场支撑


功能优势

海量,可快速定制化的、灵活化功能模块供客户选择:

在线支付在线预约购物车消息推送

灵活桌面LBS地图导航分享问卷调查

3d全景一键拨号后台分级更多功能


行业覆盖


\r\n

', '', '铭飞科技', '/18\\index.html', '', '0', '1549'), ('24', '铭飞科技', '

  公司于2012年3月8日,已正式向《景德镇市工商行政管理局》领取营业   执照。

  公司名称:景德镇铭飞科技有限公司

  经营范围:计算机系统服务及技术开发、咨询服务


', '', '铭飞科技', '/19\\index.html', '', '0', '1549'), ('25', '铭飞科技', '

  公司于2012年3月8日,已正式向《景德镇市工商行政管理局》领取营业   执照。

  公司名称:景德镇铭飞科技有限公司

  经营范围:计算机系统服务及技术开发、咨询服务


', '', '铭飞科技', '/16\\index.html', '', '0', '1549'), ('26', '铭飞科技', '

1.特点

免费开源:纯Java开发,MS开发团队承诺将MCMS内容系统永久完整开源;

终端统一:MCMS支持PC与MOBILE皮肤定制,同时使用MS团队移动JS插件,轻松实现手机多屏幕适配,想想看你发布的信息第一时间在pc上展示又能在手机上展示,这是件多么幸福的事情,数据统一、平台统一、终端统一是MS团队一直在努力的方向;

扩展性:以MCMS为核心,MS官网提供第三方插件安装,最新的插件用户可以通过更新功能获得,同时MS也鼓励并支持第三方开发人员发布优质的插件;

更新升级:MCMS提供了行业内最完美的升级方案,从此升级无需手动下载/复制/粘贴,一切完全由MS升级插件无缝完成;

文档手册:提供MCMS的数据字典、二次开发手册、标签使用手册,帮助第三方开发人员能的快速进行第二次开发;

站群:MCMS支持站群,只需在服务器上架设一套MCMS就可以创建多个个网站,并且网站之间的数据是独立存在,很大程度降低了维护成本,与服务器资源的开销;

其他:html静态生成、标签式建站

技术支持:提永久升级服务技术交流群,不定期会升级系统,开发可以关注后台的更新板块;


2.面向对象

MCMS是企业在创立初期很好的技术基础框架,加快公司项目开发进度,当然也可以对现有的系统进行升级;

个人开发者也可以使用MCMS承接外包项目;

初学JAVA的同学可以下载源代码来进行学习交流;


3.简介

 MCMS(铭飞内容管理系统)是一款支持不同平台、不同终端并且支持多站点的内容管理系统,

· SpringMVC4+Spring4+MyBatis3+Freemarker技术架构

· 基于java技术开发,继承其强大、稳定、安全、高效、跨平台等多方面的优点;


· 标签化建站,只要你懂html就能建站;


· 完全生成全站静态页面;

· 可自定义路径结构,全面提高页面访问速度;


有人说MCMS是全国唯一完整开源的J2EE版本系统!我们一直会努力下去!


4.运行环境


原则上支持全系列JAVA运行环境;

WEB服务器:Weblogic、Tomcat、WebSphere、JBoss 等

数据库服务器:Mysql等

操作系统:Windows、Linux、Unix 等


', '', '铭飞科技', '/16\\index.html', '', '0', '1549'), ('4', '铭飞科技', '

这门课程的教学目标如下:


课程大纲
第1周:第一单元 - 介绍数据
第一部分 - 设计研究
第二部分 - 探索数据分析
第三部分 - 介绍通过仿真推断

第2周:第二单元 - 概率和分布
第一部分 - 定义概率
第二部分 - 条件概率
第三部分 - 正态分布
第四部分 - 二项分布

第3周:第三单元 - 推断基础
第一部分 - 估值可变性和中心极限理论
第二部分 - 置信区间
第三部分 - 假设测试

第4周:完成第三单元 + 期中
第四部分 - 其他估计量的推断
第五部分 - 判断的错误、重要性和可信度

第5周:第四单元 - 数字变量的推断
第一部分 - 比较两种方法
第二部分 - 另解
第三部分 - t分布推断
第四部分 - 比较三种或更多方法(ANOVA)

第6周:第五单元 - 明确变量推断
第一部分 - 单比例
第二部分 - 两比例对比
第三部分 - 通过仿真比例推断
第四部分 - 比较三种或更多比例(Chi-square)

第7周:第六单元 - 介绍线性回归
第一部分 - 两个数字变量之间的关系
第二部分 - 单一预测的线性回归
第三部分 - 线性回归中的异常值
第四部分 - 线性回归中的推断

第8周:第七单元 - 多重线性回归
第一部分 - 多预测的线性回归
第二部分 - 多重线性回归推断
第三部分 - 模型选择
第四部分 - 模型诊断

第9周:复习/答疑周
贝叶斯推论 vs. 概率推论

第10周:期末考试


先修知识
基础数学,不需要编程经验。对数据分析的真心热爱是附加条件!


参考资料
这门课设计成自我包含所有内容的形式。但是我们建议学生参考《OpenIntro Statistics》(第七版)。这门课紧跟这本书,所以书中内容可以作为视频材料的补充。除此之外,练习题会从这本书中出。本书是公开资源,可以在网站openintro.org上免费在线阅读。


授课形式
这门课会包括视频课程,5到10分钟的长度,每个视频会有几个视频内测试。家庭作业包括评分的选择题测试、不计分的书中问题、数据计算分析作业、一个数据分析项目、期中和期末考试。


常见问题解答
完成这门课程后能获得证书吗?
能。只要你依据评分规则成功完成了这门课,就能得到证书。

这门课是免费的吗?
是的!你免费上这门课,并且获得免费的证书。
不过,如果你想要认证证书,你需要支付费用。你可以在这里阅读更多的认证证书信息,来看看有没有你感兴趣的地方。除此之外,如果你想要获得推理论证、数据分析和写作的系列课程认证,你就需要认证证书。你可以点击这里了解更多关于系列课程的信息。

上这门课需要之前学习编程知识吗?
这门课不需要编程背景。所有你需要学习的这门课都已经包括了。

这门课需要什么资源?
你需要稳定的网络连接以便观看视频,得到推荐的阅读材料,完成测试和考试。为了完成实验和大作业,你需要能够运行R(一个免费的数据计算和图形化软件)和RStudio(一个以R作为用户接口的集成开发环境)。
或者,你可以选择在DataCamp.com搭建实验环境(不是项目),这是一个在线的交互学习平台。这个平台提供这门课所用到的交互版的R实验环境,它提供提示和安装反馈,可以促进学习过程。这些提示就像是对你的一个引导,及时反馈帮助你避免很多因为学习新的编程语言猜测隐晦的报错信息带来的沮丧。

R/RStudio可以在任何系统上运行吗?
R可以在Windows、Mac Os和Ubuntu上运行。你可以在http://www.r-project.org下载R,在http://www.rstudio.com/上下载RStudio。一旦这门课开始,我们会提供怎么安装启动R和RStudio的视频。

完成这门课我需要学习R吗?
你可以顺利通过某些课程内容而不需要使用R,但是你需要用R来做实验和大作业来争取获得优秀证书。

R可以在智能手机或者平板上运行吗?
R可以在智能手机和平板上运行(看这里),但是这需要权限接触RStudio服务器,本门课不提供这些。RStudio服务器安装教程在RStudio的网站上提供,点击这里。


', '', '铭飞科技', '/48\\4.html', '', '0', '1549'), ('5', '铭飞科技', '

课程介绍
这门课程不仅适合考虑参加英语语言考试的学习者,也适合正在学习英语的学习者。本课程专注于雅思考试。雅思是全球最普及的为出国学习或者生活做准备的语言考试。全世界有9000个包括大学,公司,移民机构,职业机构等组织承认雅思考试。去年全球雅思考试数量超过了2百万。这门关于雅思的课程将引导你进入每一个雅思考试阶段:从阅读,写作,口语到听力。每阶段我们的老师和经验丰富的雅思辅导者都会提供考试指导。本课程开始时间为9月21日。


课程目标
课程结束后,你将
(1) 熟悉所有的雅思考试部分
(2) 获得一些有用的贴士,帮助你实现理想的
雅思考试目标
(3) 理解雅思考试的评估标准


课程特色
本课程由雅思考试机构- 英国文化协会教授。英国文化协会在英语语言教学和评估方面有超过80年的历史。


课程目标学习者
本课程针对母语为非英语的学习者,难度在中级左右。


关于课程更多信息
我们的免费课程 '了解雅思' 目标在于给你更多的自信。通过了解雅思考试需要的核心语言技能,学习者能够清晰的了解雅思考试,同时在学习的过程中提高英语水平。我们希望这个六周的课程能够帮助你们建立对于雅思考试的信心。课程结束后,你们能在考试中发挥最好的水平。我们的视频课程介绍了雅思考试,提供准备考试的资料。这门课程对任何想学习英语,在国外工作或学习,准备英语语言考试的学习者都有帮助,特别是如果你想参加雅思考试的话。这门课程集中在考试的每一个部分(听力,阅读,口语和书写),以给你提供最好的机会获得最理想的雅思成绩。


', '', '铭飞科技', '/48\\5.html', '', '0', '1549'), ('6', '铭飞科技', '

社会网络渗透于我们社会和经济生活的每一个角落。他们在传递就业机会信息中发挥了核心作用,对很多商品和服务的贸易也至关重要。他们在决定我们购买的何种产品、我们讲述何种语言、我们如何投票、我们是否决定犯罪、我们受到多少教育、我们获得专业成功的可能性。网络结构通过无数方式影响我们的生活,因此,理解下述问题就显得至关重要:社会网络结构如何影响行为,何种网络结构更容易在社会中出现,为何我们时常组织起来。借鉴社会学家、经济学家、计算机科学家、物理学家和数学家的研究成果,本门课程提供了社会和经济网络的一个概述和综合性研究。
课程刚开始时,将是一些社会网络分析的经验背景、以及一些用于描述和度量网络概念的概述。接下来,课程将介绍一些网络如何形成的模型,包括随机网络模型(random network models)、战略形成模型(strategic formation models)和混合模型。然后我们讨论一些列网络如何影响行为的模型,包括传染(contagion)、扩散(diffusion)、学习(learning)、同行影响(peer influences)。

课程大纲
第一周:介绍、经验背景和定义
社会网络的例子,以及他们的影响、定义、度量和属性——包括点度(Degrees)、半径(Diameters)、小世界(Small Worlds),弱联系和强联系(Weak and Strong Ties),点度分布(Degree Distributions)。【注1】
第二周:背景、定义、度量(续)
同质性(Homophily),动态(Dynamics),中心性度量:点度(Degree),中介中心性(Betweenness),接近中心性(Closeness),特征中心性(Eigenvector),Bonacich中心性(Katz-Bonacich的理论),E-R随机网络(Erdos and Renyi Random Networks)——阈值和相变。【注2】
第三周:随机网络
泊松随机网络(Poisson Random Networks),指数随机图模型(Exponential Random Graph Models),成长性随机网络(Growing Random Networks),优先连接(Preferential Attachment)和幂律(Power Laws),网络形成的混合模型。【注3】
第四周:战略网络形成
网络形成的博弈模型,连接模型(The Connections Model),激励与效率之间的冲突,动态分析,有向网络(Directed Networks),选择与机会的混合模型。【注4】
第五周:网络的扩散
经验背景,Bass模型,随机网络的传染,SIS模型,模拟网络拟合实际数据。
第六周:网络的学习
贝叶斯学习网络(Bayesian Learning on Networks),DeGroot学习模型,意见的趋同(Convergence of Beliefs),群体的智慧,网络位置的影响。【注5】
第七周:网络的博弈
网络博弈,同行影响:战略性补充与替代,网络结构与行为的关系,线性二次博弈,重复相互作用与网络结构。

推荐背景
本课程需要以下前置技能(^_^):数学Lv1和统计学Lv1。我们假定参加的学生都已经非常熟悉相关的一些基本概念,包括线性代数,概率论(概率分布、期望、贝叶斯法则),统计学(假设检验),和一些简单计算(偏微分和积分)。除此以外,课程内都已包含。
【注6】

推荐阅读
所有解答测验和考试所需的定义概念都在视频课程中包含了。大部分课堂材料都包含在授课教授的书中(Jackson M O. Social and economic networks[M]. Princeton University Press, 2010. ),但这本书不是课堂必读读物。进一步的背景阅读,包括研究论文和课程中几个主题的综述,都在授课人的主页上(打开即可看见那张大脸:)。

课程形式
课程持续8周,每周会有视频提供,以及独立的问题集和数据练习。课程结束时,参加期末考试才可以拿到课程认证。

问答:
Q:完成课程后,能获得结课证书吗?
A:能,成功完成课程的学习者将获得有教师签名的结课证明。

============
译注1:专有名词在国内有多种翻译,此处使用中文文献中使用最广的译法。参考:[英]约翰•斯科特,刘军译.社会网络分析法[M].重庆:重庆大学出版社,2007
译注2:关于复杂网络的发展,1960提出随机网络模型(ER网络),1998年提出小世界模型,1999年提出无标度网络(Scale-free)模型(BA模型)。复杂网络分为随机网络、小世界网络和自相似网络。
译注3:随机网络模型这章解决的是计算机模拟的网络与现实世界网络的不一致。通过不断改进模型来贴近现实。
译注4:本章的内容是个体的收益成本随着网络连接的不同而不同。如Connection Model是一种成本与直接联系有关而网络间接收益依照连接距离增加而递减的算法。
译注5:学习模型,即通过观察周围人是怎么做的,来调整自己的行为。
译注6:本课程以社会网络建模为主要内容,即第二部分网络形式和第三部分网络与行为。在第一部分仅仅是简要介绍了后续建模所必须的简单概念,而缺乏对社会网络特征分析的介绍。推荐在社会网络有一定基础的社会学科高年级学生进行深入研究模型、或对数学模型熟悉的同学了解实际应用。本课程的简介(需翻墙)有说明,课程教授的是网络分析研究的方法,针对群体是硕士到博士,但是对感兴趣的同学入门也不难。


', '', '铭飞科技', '/48\\6.html', '', '0', '1549'), ('7', '铭飞科技', '

科技和网络给我们生活、文化、社会带来的影响不断增强。最有利的证明就是你可以在世界各地上这门课,你需要的是过去的六十个年头依赖被设计、创造的科技工具,我们应理解网络科技是怎么运作的。这门课在互联网上公开,向你展示它是如何创造,谁创造的,以及它怎样运作。展示的过程中,我们将带领你采访开发互联网和网络技术的领军人物。


你将学到什么?
这门课程之后你会意识到Internet 和Web的出现并不是理所应当的。你会更好地了解现代社会面对的技术问题。还可以了解到Internet 和Web是个创新空间,在这里如何创新。如果你对课程材料很感兴趣,那么这对Web设计,Web开发、编程,甚至是网络管理是个不错的引入。至少,你会成为一个更聪明的网民。


课程大纲
Week 1:课程导论和电子计算的黎明(1940-1960)
Week 2: 第一个因特网
Week 3: 万维网
Week 4:社会化和经济增长(1995-2000)
Week 5: 因特网和数据包
Week 6: 传输和安全
Week 7: 网络应用
Week 8: 信息保护
Week 9: 同一认定
期末考试


背景知识
这门课不需要什么提前准预备知识,也不要求变成。所以任何人都能来学,大家都应该学这门课。


推荐阅读
这门课提供所有需要的材料。
Katie Hafner写的Where Wizards Stay Up Late: The Origins Of The Internet 
Tim Berners-Lee和Tim Berners-Lee写的Weaving the Web: The Original Design and Ultimate Destiny of the World Wide Web
Robert Cailliau写的How the Web was Born: The Story of the World Wide Web 
这些有趣的补充材料从不同角度看发展历史。在课程中我们也会不断扩充阅读材料。


课程形式
这门课由5-20分钟的课程视频组成,其中包含互联网先驱的采访。课程视频将嵌入测试,这样可以帮助学生检测自己的学习。每周有家庭作业式的测验,同样帮助学生检测所学,深入探索。历史部分结束后有一个期中考试,课程最后有一个期末考试。

问答
为什么要介绍历史?
历史不只记录时间、地点、人名,那些考试中的答案。互联网和万维网的历史远不这么肤浅。这段历史中有英雄,也有恶棍。有亟待解决的工程难题。从创建者那里直接聆听这段历史中发生了什么,我们也将了解到人类怎样一起解决复杂、未知的难题。
课程形式是什么样的?
这门课由60%的课程和40%的网络领军人物的视频采访组成。视频在10-30分钟左右,在最后还提供评估材料。每周需要2-5个小时看这些材料,做补充阅读,和其他同学一起讨论,做作业。
我需要课本吗?
不需要。我们在网上提供所有需要的材料。
我需要编程吗?
不需要。
有关时间,我可以自己分配吗?
在一定程度上可以。在任何一周的课程里,你都可以看所有材料和评估,不管你在哪个时区。但是你需要和这门课同步,并在截止时间钱提交作业。所以你不能再最后一周补上所有的东西。我们希望你每周都能抽出时间学习这门课。
在Twitter上这门课的标签是什么?
#IHTS,搜索它,你可以看到大家对于这门课的讨论。
我们可以联系到教授吗?
教授一直在关注这门课。如果出现问题,在线办公时间或者及时解决大多数同学都遇到的问题。讨论区也是课程的重要部分,那里的学生可以解答大部分问题。课程指导也将在讨论区和大家交流。你可以在Twitter上关注指导老师@ drchuck 。
我需要了解HTML吗?
不需要。不过上过这门课后,希望你有学习HTML的打算。
完成这门课后我可以获得证书吗?
可以。凡是顺利完成这门课的学生都可以获得证书。


', '', '铭飞科技', '/48\\7.html', '', '0', '1549'), ('8', '铭飞科技', '

学会如何像数学家那样思考——一种在几千年来慢慢形成的强大的认知方式。

这个课程的目标是帮助你培养一种有价值的思维能力—— 一种我们祖先在这3000年来慢慢培养出来的强大的思维方式。数学思维和做数学题不一样——至少和学校里学的数学不一样。在学校里,学数学主要是学习如何解决一些来自日常生活,科学,或者数学本身的有固定模式的题目。在学校数学中成功的关键是学会用固定的方法思考。与之相反,数学思维的关键之一是创造性思维——现代社会中一个很重要的能力。这个课程帮助学生养成这种重要的思维习惯。课程的主要对象是想以数学或者需要数学的学科为专业的大学一年级学生,和想学这些专业的高中三年级学生(对于美国来说是高中四年级)。这些人需要数学思维来成功的学好他们的专业。但是,数学思维也是一个很有价值的生活技能,任何17岁以上的人都可以从本课程中获益。


课程大纲
教师的欢迎和简介

  1. 入门材料

  2. 语言分析——逻辑连词

  3. 语言分析——暗示

  4. 语言分析——等价

  5. 语言分析——量词

  6. 处理量词

  7. 证明

  8. 有量词的证明

  9. 数论的基本原则

  10. 开始真正的分析


知识背景
高中数学就够了。


推荐阅读
课程开始时会有一个阅读任务,提供一些背景知识。
会有一个额外的阅读单元介绍基础的集合论,以方便那些不了解的学生。
课程推荐一本教科书,Keith Devlin写的数学思维导论(《Introduction to Mathematical Thinking》),你可以在Amazon上以10美元(约61-62人民币)以下的低价买到实体书或者Kindle版本,但是这不是必需的。如果你想要了解大概的数学背景和数学在现代世界中所扮演的角色,可以看一看2012斯坦福秋季学期Devlin老师的数学概要课程(“Mathematics: Making the Invisible Visible")。你可以从iTunes University(Stanford)免费下载,也可以在YouTube上看(共五集),尤其可以关注讲座1和讲座4的前半部分。


课程形式
这个课持续十周,包括八周的讲座和两周的讨论与小组合作和一个需要在倒数第二周完成,在最后一周通过同学互评来打分的开卷的期末考试。教师会在指导视频中讲解上一周的作业。


常见问题解答
完成这个课程我能拿到证书吗?
如果你完成了这个课程,你能拿到证书。那些在课程和期末考试中表现出色的学生能拿到表现出色证书。但是你无法通过这个课程获得斯坦福的学分。

课程的作业是什么呢?
每个讲座之后,都会有一个作业(可下载的PDF格式,和讲座一同放出)。作业的目的是引导你理解你学的东西。作业的解答会在下一周指导视频中由教师给出。你可以在解答的指导下,综合其他学生的信息,为自己作业的打分。这些作业的目的是让你更好的理解和发展,而不是获得分数。我们强烈建议你和其他同学一起在任何时候讨论你的作业。这些作业(和自评分数)是本课程的核心。学习如何以数学的思维思考问题的唯一方法是不停试着这么做,把你的结果和专家的结果相比较并且和同学们一起讨论。

这个课程会有期末考试吗?
在倒数第二周的开始,会有一个那一周要完成的开卷期末考试。完成的考试作业要用图片(或者扫描的PDF)上传。如果你足够熟悉Tex,你可以在网站上直接用键盘输入。最后一周会通过同学互评的方式评分。

这个课程有哪些等级?
有两个:“完成”和“优异地完成”。你需要看所有的讲座并且完成所有的测试(包括讲座内嵌入的测试和每周测试)来获取“完成”的等级。能否获取”优异的完成:取决于你在每周测试中所拿到的分数和期末考试的结果。


', '', '铭飞科技', '/49\\8.html', '', '0', '1549'), ('9', '铭飞科技', '

课程介绍
这门课程不仅适合考虑参加英语语言考试的学习者,也适合正在学习英语的学习者。本课程专注于雅思考试。雅思是全球最普及的为出国学习或者生活做准备的语言考试。全世界有9000个包括大学,公司,移民机构,职业机构等组织承认雅思考试。去年全球雅思考试数量超过了2百万。这门关于雅思的课程将引导你进入每一个雅思考试阶段:从阅读,写作,口语到听力。每阶段我们的老师和经验丰富的雅思辅导者都会提供考试指导。本课程开始时间为9月21日。


课程目标
课程结束后,你将
(1) 熟悉所有的雅思考试部分
(2) 获得一些有用的贴士,帮助你实现理想的
雅思考试目标
(3) 理解雅思考试的评估标准


课程特色
本课程由雅思考试机构- 英国文化协会教授。英国文化协会在英语语言教学和评估方面有超过80年的历史。


课程目标学习者
本课程针对母语为非英语的学习者,难度在中级左右。


关于课程更多信息
我们的免费课程 '了解雅思' 目标在于给你更多的自信。通过了解雅思考试需要的核心语言技能,学习者能够清晰的了解雅思考试,同时在学习的过程中提高英语水平。我们希望这个六周的课程能够帮助你们建立对于雅思考试的信心。课程结束后,你们能在考试中发挥最好的水平。我们的视频课程介绍了雅思考试,提供准备考试的资料。这门课程对任何想学习英语,在国外工作或学习,准备英语语言考试的学习者都有帮助,特别是如果你想参加雅思考试的话。这门课程集中在考试的每一个部分(听力,阅读,口语和书写),以给你提供最好的机会获得最理想的雅思成绩。


', '', '铭飞科技', '/49\\9.html', '', '0', '1549'), ('10', '铭飞科技', '

这门课程介绍了起源于硅谷并在全世界出现的高科技企业的基础知识。你将会学习高科技企业家建立公司的过程。内容包括产生创意,寻找商业机会,收集人才资金资源,研究如何推销及策划创意及控制公司快速发展。在学习过程中学生组织成小组并以小组为单位研究创业项目。
这是第二次公开授课,上次有来自全世界的大约40000名学生参与了课程并进行了小组合作。表现优异的小组将会配备硅谷的导师,最好的小组的创意将会被推荐给投资者。上次课程的许多学生都建立了自己的创业公司并被定期指导。
根据课程内容,我们希望你学会如何
1。对如何从产生创意到寻找商业机会(高水平(high performing)学生将能够讨论替代方案模型的优缺点)
2。建立并验证一个寻找人才和资本的方案。
3。建立并验证一个如何推销及策划创业创意的商业模型。
4。建立一个在创业过程中如何将问题转化成机会的思维过程,这种思维模式也适用于大型公司及其他环境。

', '', '铭飞科技', '/49\\10.html', '', '0', '1549'), ('11', '铭飞科技', '

环境工程、市政工程等专业的主干专业课,主要讲述水和废水处理中主要的物化和生物处理方法的基本原理、工艺构成、运行特点、工艺计算方法以及部分工程实例。该课程是从事水处理技术研究、设计以及运行管理人员的必修课。

课程简介
《水处理工程》是环境工程、环境科学、市政工程等相关专业的主干专业课。本课程旨在向学生全面讲授水和废水处理中主要的物化和生物处理技术单元的基本原理和特点、工艺的基本计算方法和应用范围、主要构筑物的构成和运行特点、典型的水与废水处理工艺以及相关技术的国内外最新研究进展。整个课程分为两篇:第一篇—水与废水物化处理的原理与工艺,主要介绍各种物化处理单元,包括:混凝、沉淀与澄清、气浮、过滤、消毒、氧化还原、膜分离和离子交换;第二篇为废水生物处理的原理与工艺,主要讲述废水的好氧和厌氧生物处理工艺、生物脱氮除磷工艺、废水的天然处理工艺以及污泥的处理与处置。


【FAQ】
请问教材和参考书是什么?
教材:1. 张晓健、黄霞:水与废水物化处理的原理与工艺,清华大学出版社, 2011;2. 张自杰:排水工程(下册)(第四版),中国建筑工业出版社,2000;参考书:1. 严煦世、范瑾初:给水工程(第四版),中国建筑工业出版社,1999;2. Wastewater Engineering: Treatment and Reuse. Fourth Edition. Metcalf & Eddy, Inc., 2003(清华大学出版社影印版)。


', '', '铭飞科技', '/49\\11.html', '', '0', '1549'), ('12', '铭飞科技', '

好奇心是人类最重要的特征之一。它使我们能够把未知变成已知,打破壁垒,启发和阐明生活的各个方面,包括日常爱好,也包括对天空中的星星的解释。我们获得的许多值得骄傲的成就,都归因于我们与生俱来的探索欲望。本课程将帮助你培养自己的好奇心,并利用它来以学术的方式开始自己的研究项目。


本课程是面向正在进行或计划进行某项学术研究的任何人员,你的研究内容可以是专题项目资格,国际文凭专题论文,课件,或者某项独立奖学金。
本课程由热衷研究的学者开发、讲授,将支持你研究过程的每一步,从提出假设、寻找资源,到撰写论文、发表自己的研究成果。
课程注重实际动手能力,你将有机会与来自世界各地的其他研究人员分享你的想法,收到学习同伴关于你的研究议案的反馈,审查和评论其他研究人员的工作,从而建立一个支持志同道合的充满好奇的学习者的社区。
如果你想加入参与课程,并通过社交网络加入关于本课程的讨论


先修要求
没有特别的课程要求,只需要好奇心,以及展开一些学术研究的热情。
值得注意的是,参加本次课程,你将有机会让其他学习者评审你的工作内容,同样的,你也将评审他人的作业。虽然不强制要求参与这类活动,积极参与无疑将增强你的体验。


', '', '铭飞科技', '/37\\12.html', '', '0', '1549'), ('13', '铭飞科技', '

推理是非常重要的。这门课程将教会你如何正确推理。你将会学到如何理解并评断他人的论据,以及如何基于感兴趣的话题构造自己的论据。


课程大纲
第一部分:如何分析论据(即确定论据,并将其简化、归纳以便突出联系彼此的结构)
第一周:如何确认一条论据
第二周:如何分解一条论据
第三周:如何重塑一条论据

第二部分:演绎论证的评断(即其前提与结论之间是否存在有效关联)
第四周:命题逻辑及真值表
第五周:分类逻辑及三段论

第三部分:归纳论证的评断(即其前提是否提供了结论所需要的足够证据)
第六周:归纳论证论据的定义
第七周:因果论证
第八周:归纳概率与决断

第四部分:一团糟的论据(即常见的容易犯的错误)
第九周:谬误之模糊与歧义
第十周:谬误之相关性谬论及空白性谬论
第十一周:如何反驳一条论据
第十二周:联系日常的学以致用


先修知识
这门课非常适合大学新生或者高年级中学生,或者(事实上是)任何对此感兴趣的人。因而我们除了要求学生具备相关的英语知识,再无其他。


课程相关教材
注册该课程的学生将能在课程期间免费阅读相关章节,这些都是由授课教师为课程精心选择的。你可以通过Chegg网站上的电子阅读器来阅读教材的Coursera精简电子版。如果你选择了“购买此书”,你可以买到这本教材的完整版,而不限于本课程中涉及的章节。这是由Coursera与出版商及Chegg联合发起的。
圣智优选:掌握论据
作者:Sinnott-Armstrong, Walter, Sinnott-Armstrong, Walter (WalterSinnott-Armstrong), Fogelin, Robert J.
出版商:圣智学习出版集团


推荐阅读
期望学习更多详细例子和附加练习,或是进一步深入了解这些话题的学生可以参看《掌握论据:非正式逻辑导论》
你可以在这里找到电子版。


授课形式
每一周的课程将会提供一些教学视频,这些视频可以独立观看亦可以当作三个关联讲座。每段视频后会要求学生完成小测验(确保你理解了课程内容),另外还有长些中期测验。


常见问题解答
1. 完成这门课后能获得证书吗?
是的。成功完成这门课的学生将会收到授课教师署名的认证证书。
2. 这门课需要我做什么准备?
一台能上网的电脑。
3. 这门课将带给我最酷的事?
用“说话模棱两可的人”这样的添堵称呼来代表那些企图用糟糕的论据来愚弄你的人。
4. 别人怎么评价这门课?
这里有一些来自于已经学过这门课的学生的评语:
“我很感谢这门课的两位老师。这课相当有趣,具有启发性,并且我非常喜欢世界各地不同观点、不同背景人们的加入。”
“课程刚开始的一两周内,我一度沉浸在不知是对某些概念还是对某次家庭作业的思考中;然后我突然意识到:‘也许这才是真正的思考?’。事实上,我来自一个思考氛围浓厚的家庭;我自己也一直在思考关于人生和职业的事…但是不知为何我意识到,尽管我过去一直在思考,但类似这类的思考还真是不怎么多见…所以,非常感谢!”
“Dr. Sinott-Armstrong和Dr. Neta之间的融洽关系以及他们的幽默感使得这门课引人入胜,趣味横生。他们毫不吝啬地展现了对这个话题的激情,并且在解释时充满耐心。”


另外还有一些近期的文章和新闻提到了这门课,请戳链接:
1.Raleigh News and Observer Article - January 20, 2013
()
2."How Free Online Courses are Changing the Traditional Liberal Arts Education" PBS Newshour - January 8, 2013()


', '', '铭飞科技', '/37\\13.html', '', '0', '1549'), ('14', '铭飞科技', '

* 本课程全部视频可直接在站内播放,感谢@YC创业课中文社区 提供资源,及课程视频中文翻译工作


通过本课程,免费跟随世界级专家那里学习如何开始创业。
CS183B是斯坦福大学的一门课,这是专门为想创业的人设计的一门独立的商业课程,一共有20个课程视频,有的是由一个讲师讲授,有的是两个讲师,还有的是一个小组,所有课程视频总长为1000分钟。


课程内容包括:如何提出想法并对其进行评价,如何得到用户并扩大用户人数,如何做销售和市场营销,如何聘请人才,如何筹集资金,以及公司的文化、运作与管理,企业策略等等。


我们不能教给创业者使其成功创业的所有知识,但我认为我们可以教给其很大一部分知识帮助其成功创业。经过一番努力,我们请来了过去9年中在Y Combinator晚宴上最好的演说家,并以最有可能产生效果的方式对其进行安排。


我们这样做是因为我们相信帮助更多人更好地创业对每个人都有利。这即使是对那些不想创业的人来说也是非常有价值的。


这样的谈话确实帮助了YCombinator的建立者创建了他们的公司,希望你也能在此获得有价值的东西!


课程安排
作业在该网站上提交。
你可以在Q&A板块向特邀嘉宾提问问题。
从iTunes U上下载该课程视频将要延迟2至3天。


演讲者
主题

Sam Altman, President, Y Combinator
Dustin Moskovitz, Cofounder, Facebook, Cofounder, Asana, Cofounder, Good Ventures
欢迎词
理念,产品,团队和管理(一)
为什么要创业?

Sam Altman, President, Y Combinator
理念,产品,团队和管理(二)

Paul Graham, Founder, Y Combinator
创业中的反直觉,以及
如何获得想法

Adora Cheung, Founder, Homejoy
产品构建,与用户交谈,并获得越来越多的用户

Peter Thiel, Founder, Paypal, Founder, Palantir, and Founder, Founders Fund
企业战略与垄断理论

Alex Schultz, VP Growth, Facebook
实现增长

Kevin Hale, Founder, Wufoo and Partner, Y Combinator
如何构建用户喜爱的产品(一)

TBA


Marc Andreessen, Founder, Andreessen Horowitz and Founder, Netscape
Ron Conway, Founder, SV Angel
Parker Conrad, Founder, Zenefits
如何筹集资金

Alfred Lin, Former COO, Zappos and Partner, Sequoia Capital
Brian Chesky, Founder, Airbnb
企业文化与建立团队(一)

Patrick and John Collison, Founders, Stripe
Ben Silbermann, Founder & CEO, Pinterest
企业文化与建立团队(二)

Aaron Levie, Founder, Box
销售与市场营销

Reid Hoffman, Partner, Greylock Ventures and Founder, LinkedIn
待定

Keith Rabois, Partner, Khosla Ventures
如何运行公司

Ben Horowitz, Founder, Andreessen Horowitz, and Founder, and Opsware
如何管理公司

Marissa Mayer, CEO, Yahoo
待定

Hosain Rahman, Founder, Jawbone
如何构建用户喜爱的产品(二)

Kirsty Nathoo and Carolynn Levy, Partners, Y Combinator
运行机制—法律,财务,人力资源等

TBA


Sam Altman, President, Y Combinator
最终思考及后期咨询


', '', '铭飞科技', '/37\\14.html', '', '0', '1549'); +INSERT INTO `cms_article` VALUES ('15', '铭飞科技', '

数学的重要特征是它的抽象性,这一特征是令人生畏的。但也正是这一特征可以使人们在繁杂的世界中逐步懂得宇宙深处伟大设计图的语言;可以用理性的思维达到超出人类感官所及的宇宙的根本。而这一切正是数学的魅力所在,也是数学在人类历史上起着其它科学不可替代作用的重要原因。但这也是很多学生畏惧数学或学习数学的困难所在。

本课程针对这一情况,试图和学生一起从思想上重走一遍前辈们走过的路,作一次轻松的数学之旅。在这一旅途中我们不断揭示一些概念和数学思想形成的过程和历史,理解数学抽象的必要性和魅力,真实体会数学抽象所表现出的人类心智的荣耀,潜移默化地从中培养数学抽象的能力。并试图就一些简单的数学例子介绍数学抽象的一些特点,并试图就学习数学时,如何克服抽象带来的困难谈一些看法。主讲人有信心使这门课程成为一次轻松的“抽象”旅游。并希望对学生的数学课程的学习和数学思维的形成,在心理和心智上都有所帮助。
好的旅游不是旅游点的累积,而是心与自然、心与心的交流。我们的“数学之旅”不期待你知道了多少数学概念,而期待你开始对数学的抽象有了体会,意识到数学的抽象其实不“抽象”,感受到数学思维所表现出的人类心智的荣耀。


授课大纲
第1周
第一章数学是什么
第一章数学思维
第一章 数学学习
第一章知识点复习、作业、习题等

第2周
第二章从圆的面积谈起
第二章牛顿和莱布尼兹的微积分
第二章分析的严格化
第二章知识点复习、作业、习题等

第3周
第三章距离与范数
第三章线性结构
第三章空间种种
第三章知识点复习、作业、习题等

第4周
第四章布劳威尔不动点原理
第四章无穷维的不动点原理
第四章经济学的应用
第四章知识点复习、作业、习题等

第5周
第五章 Fourier定理
第五章 Fourier分析的应用
第五章 Fourier分析的发展
第五章知识点复习、作业、习题等

第6周
第六章混沌
第六章分形
第六章“混沌的游戏”
第六章 知识点复习、作业、习题等


先修知识
有一定的微积分和线性代数基础的大学生。


参考资料
1. 数学及其历史,John Stillwell(袁向东,冯绪宁译),高等教育出版社,ISBN:
2. 现代世界中的数学,Morris Kline(齐民友译)上海教育出版社, ISBN:
3. 数学与文化,齐民友, 湖南教育出版社, ISBN:
4. 混沌,开创新科学,詹姆斯 格莱克,(张淑誉译),上海译文出版社
5. 诺贝尔经济学奖与数学,史树中,清华大学出版社, ISBN:


授课形式
学生通过观看教学视频、学习教材课件(PPT),结合完成作业练习以及测试的形式进行自学。
鼓励学生通过论坛与同学和老师积极交流学习经验和体会,帮助其掌握和巩固所学知识。


【FAQ】
Q:课程评分标准是什么?
A:期末考试成绩占总成绩的70%;作业及测验占总成绩的30%。
Q:课程通过标准是什么?
A:总成绩 60 分以上者,满分为100分

这门课曾于2013年12月在Coursera开课,课程链接:https://www.coursera.org/course/sjtuma153


', '', '铭飞科技', '/37\\15.html', '', '0', '1549'), ('16', '', null, 'f,', '', '/50\\index.html', '', '0', '1549'), ('17', '', null, 'f,', '', '/51\\index.html', '', '0', '1549'), ('18', '', null, 'f,', '', '/15\\18.html', '', '0', '1549'), ('19', '铭飞科技', '

了解生命的起源和演化,寻找地球以外的生物。


课程概述
两千年多以前,古希腊人曾探究过宇宙中是否存在其他世界。现在,人们正通过实验来验证这个问题。这门课程由英国爱丁堡大学的天体生物学中心提供,旨在介绍天体生物学,也是MOOC首次探索此类课题。这门课程将探讨地球上生物的起源和演化,以及地球以外存在生命的可能性。

“天体生物学”解答了人们普遍感兴趣和十分关注的问题,如:地球上的生命从何而来?生命的出现是一个必然过程吗,宇宙中到处存在生命吗?天体生物学是一门跨学科的科学,涉及到如天体物理学、生物学、地学和化学等不同领域。

这门课程中,我们将探讨我们所了解的有关生命在地球极端环境中的存活能力。我们将着眼于生命起源的不同假设,以及一些探寻我们所在的太阳系中和环绕遥远恒星旋转的行星上生命的使命。我们将讨论地球上的一些极端环境,这有助于我们理解生命的极限以及生命如何适应这些极端条件。我们将探索外星智能生物存在的可能性以及相关探测的影响。这门课程将为天体生物学提供学习基础,并向学生介绍不同科学领域的相关概念。


课程大纲
第一周:生命是什么,以及生命该如何定义?我们对生命的起源了解哪些内容,以及对于地球上生命的起源,当下存在哪些假设?
第二周:在生命诞生时,早期地球的环境是怎样的,以及我们对于地球形成初期的生命了解哪些内容?生命是如何演化以适应极端环境存活的?地球上生命的主要演化转变时期是什么?
第三周:对于我们太阳系中的其他行星上的生命有哪些展望,以及我们如何去寻找?一颗行星宜居的必要条件有哪些?
第四周:我们如何寻找环绕遥远恒星旋转的类地行星,以及我们如何探测其上的生命?
第五周:地球以外存在智能生物的可能性有多大?我们如何与地外文明接触,以及这将对社会造成什么影响?谁将代表地球?


先修知识
无任何专业背景要求。


参考资料
关于天体生物学的书籍种类繁多。这些书籍不是课程的必读书目,而且并非课程专用。这仅是我们建议阅读的有用书籍中的一部分。

这门课程的授课教师也创作了若干与天体生物学相关的书籍,你可以选择性阅读,不做硬性要求。


授课形式
这门课程包含一系列教学视频,时长为10至15分钟,每周共计1至1.5小时。


常见问题解答
- 完成这门课程后,我会获得证书吗?
是的。凡是顺利修完这门课程的学生将获得授课教师签署的完成声明。

- 完成这门课程,我会获得爱丁堡大学的学分吗?
不会。完成声明不包含在大学的正式认证中。但是,这门课程有助于你向高等教育机构或潜在雇主展示你在所学专业中的先前学习成果和兴趣所在。

- 我需要为这门课程准备什么?
无需做准备。

- 这门课程的学习收获是什么,我为什么要修读?
你将了解对地球以外生命的探寻过程。


', '', '铭飞科技', '/22\\19.html', '', '0', '1549'), ('20', '铭飞科技', '

中国考古学是以往100年中发展最为迅速的领域之一,大批珍贵文物的出土,不断刷新人们对文化中国的认识。本课程以4-6件(组)精品文物作引子,将学术界探索中华文明的过程作为线索,介绍古代中国在造船、玉器等诸多领域的杰出成就,其中不乏学术前沿的考古发现与研究成果,内容精彩纷呈,雅俗共赏,学生可以藉此获得对文化中国全方位的、直观而深入的认识。

课程章节
泉州宋船与中国古代造船技术
文献所见原始渡河工具
绰墩山出土的渡河浮木
我国古代舟船的遗迹
中国古船制造的原创性技术
泉州宋船的基本情况
宋船上的遗物
船的主体结构
多层船板叠合工艺
宋船上的水密隔舱
宋船的建造
宋明航海史小结
作业

良渚“琮王”与中国史前时代的玉文化
玉的定义
新石器时代的中国古玉
古玉王国良渚
鬼斧神工的良渚玉器
良渚“神徽”解读
良渚典型器介绍
含山玉器:史前制玉的又一奇迹
中国古代的玉文化
作业

贾湖骨笛与中国古代七声音阶的起源
先秦文献所见七声音阶
史前陶埙的音阶序列
周代有七声音阶:曾侯乙编钟作证
河南舞阳贾湖遗址概况
贾湖骨笛的鉴定
贾湖骨笛的年代与分期
贾湖骨笛的制作技巧
贾湖骨笛的未解之谜
上古时代为何偏爱五声音阶
作业

正统针灸铜人与中国古代的经络学说
针、灸、经络溯源
扁鹊与仓公的针灸医术
《内经》与针灸
马王堆帛书、张家山汉简中的经络文献
明代正统针灸铜人
针灸对当今世界的影响
作业

殷墟甲骨与中国早期的文字
甲骨的发现
殷墟甲骨的发掘与研究
甲骨占卜与刻辞
甲骨文中的六书
作业


磁山石磨盘与中国古代农业文明
农业文明起源诸学说
磁山遗址所见粟遗存
磁山遗址中的石磨盘与石磨棒
磁山遗址中的陶器
亚洲稻系起源诸说
河姆渡遗址的发现
河姆渡遗址中的稻谷遗存
河姆渡遗址所出土的农具
太湖流域稻作农业
中国是否有作为栽培稻基础的野生稻
作业
作业

妇好偶方彝与中国古代礼乐文化
青铜器的定义
青铜器的滥觞期与鼎盛期
妇好偶方彝
青铜器的颓败期、中兴期与衰落期
何谓礼文化
何谓乐文化
中国古代的青铜礼器
青铜食器
青铜酒器
青铜盥洗器
青铜礼器的组合
青铜乐器(上)
青铜乐器(中)
青铜乐器(下)
作业
作业

《周易》《周礼》与故宫北京城
《周易》其书
《周礼》其书
《周礼》建国之制的实行
北京城的中轴线
故宫、北京城的阴阳思想
故宫、北京城的五行思想
重檐庑殿
九种屋顶
屋顶装饰
故宫的空间处理
太和殿及其周围
作业

曾侯乙墓漆箱星宿图与二十八宿
羲和四子敬受民时
上古天文观测仪器
中国上古的四分历
北极、北斗和二十八宿
恒星体系为何取“二十八”之数
二十八宿体系起源于巴比伦?
二十八宿体系起源于中国
关于中国二十八宿形成时间的考证
曾侯乙墓漆箱盖主星图解读
曾侯乙墓漆箱侧立面星图解读
濮阳西水坡45号墓:远古时代的北斗二宫图
西水坡45号墓墓主身份之谜
作业

曾侯乙墓均钟与中国古代的律吕
三分损益法与隔八相生法
中国古代的十二不平均律
曾侯乙编钟的乐律体系
钟的调音问题
五弦琴乎?筑乎?
均钟!湮没千年的均钟!
雨台山律管:又一种战国调音器
作业

越王勾践剑与吴越地区的冶铸技术
中国古剑的几大谱系
文献中的吴越之剑
剑与先秦社会
吴王夫差剑,出土知多少?
楚地所出越王剑
浙江省博物馆购藏越王剑
吴越之剑的菱形暗格纹技术
吴越之剑的薄壁同心圆剑首技术
吴越之剑的双色剑制作技术
青铜剑的发展与衰落
作业

河姆渡蚕纹杖饰与先秦服饰文化
中国蚕桑起源的传说与考古发现
蚕桑起源的地域分布
中国纺织业起源的考古发现
粘附在铜锈上的商代丝织品
成为国家行为的周代蚕桑业
东周时代丝织品概观
马山一号墓的丝织品
先秦时代的服饰文化
作业

秦陵铜车马与先秦时代造车技术
先秦文献所见交通用车
先秦文献所见战车
田野考古所见的商周车辆
《考工记》记载的造车工艺
秦陵铜车马概说
秦陵铜车马的学术价值
秦陵铜车马的精湛工艺
期中考试
考试公告
期中考试
期中考试成绩查询

上家村寨舞蹈纹盆与甘青地区的彩陶文化
妇好墓象牙杯与先秦时期的生态环境
殷墟妇好墓概述
妇好墓象牙杯诸细节
殷墟中与象相关的文物
“殷人服象”的文字与文献根据
史前时代华北地区的生态环境
先秦社会生活中的象牙
青铜器中象的造型
解读吉美象尊
象逐步南移与消失的原因之一
象逐步南移与消失的原因之二
象逐步南移与消失的原因之三
象逐步南移与消失的原因之四

四羊方尊与长江流域的商代文明
注:本课程原来分为文物精品与文化中国(上)与(下)两门,现在已合并成一门课。


', '', '铭飞科技', '/22\\20.html', '', '0', '1549'), ('21', '铭飞科技', '

数千年的中国历史上,曾出现了很多伟大的城市,汉长安、北魏洛阳、隋唐长安和洛阳、北宋开封、元大都,都是当时世界上最繁华的大都市。这些城市虽已星光黯淡,却留下了一座座优美壮丽的建筑杰作,令人叹为观止。中国的宫殿、宗教建筑、佛塔、陵寝和园林等建筑类型,无论建造技术还是美学追求,都达到了很高的水平。中国古代的建筑有着自成体系的一套营造方法,以木结构为主,也有不少砖石结构的佛塔和陵寝。历史上建造了大量宫殿建筑,北京故宫是现存世界上最大宫殿建筑群。自南北朝至唐,出现了大批佛教寺院与石窟寺。南北朝以来各地建造的砖石塔,也使中国砖石建筑达到很高水平。唐、辽、宋、金时期留下了一大批宗教建筑遗存,包括大型殿堂,多层楼阁,与高度达67米的高层木塔。明清时期坛壝、祠庙、陵墓与民居,有了高度发展,北京天坛,曲阜孔庙、明十三陵,北京四合院等,是这一时期重要建筑实例。北京颐和园、承德避暑山庄是古代皇家园林代表,明清私家园林则是数千年中国园林艺术的结晶。宋《营造法式》和清《工部工程做法则例》是中国官式建筑两部重要文本,对于理解中国建筑有着重要的意义。课程资料中也将包括这两部著作的电子版。

课程章节
1 中国建筑概说
中国建筑特征
中国建筑历史分期
中国建筑类型学讨论
古代城市的规划思想与两种规划理念
古代建筑原则
古代建筑思想

2 史前至秦汉时期的中国建筑
早期文明和建筑形态
夏商时期建筑
周代的建筑
秦汉时期的中国文明与城市
秦汉时期的宫室
秦汉时期的住宅、墓葬和其它建筑类型

3 三国、两晋、南北朝时期的中国建筑
三国、两晋、南北朝时期的城市和宫殿
佛教的发展及佛教建筑的繁荣
南北朝时期的佛教建筑遗迹
南北朝时期的佛教石窟寺
石窟寺建筑形象反映的木结构建筑发展过程
秦汉至南北朝时期的园林

4 隋唐时期的城市、住宅、宫殿与园林
隋唐时期的中国文明
隋唐两京城
隋唐两京里坊与住宅
隋唐宫殿中的重要建筑
隋唐园林

5 隋唐时期的宗教建筑与主要遗存,建筑技术与艺术
隋唐时期的宗教建筑
隋唐时期的木结构佛教殿堂建筑遗存
隋唐时期的砖石塔幢遗存
隋唐时期的建筑风格与设计方法
隋唐时期的木结构建筑技术
隋唐时期的砖石结构建筑技术
建筑技术的进步和艺术的发展

6 五代、两宋、辽、金时期的城市,宫殿与苑囿
五代、两宋、辽、金、西夏历史
北宋汴梁城
南宋临安府、南宋平江府、辽南京与金中都
北宋汴梁与南宋临安宫殿
金中都宫殿
两宋辽金时的园林

7 五代、两宋、辽、金建筑遗存
九开间大型木构殿堂遗存
七开间木构殿堂遗存
五开间木构殿堂遗存
三开间木构殿堂遗存
单层重檐殿堂遗存
两宋、辽、金木构楼阁
两宋、辽、金时期的佛塔建筑

8《营造法式》与小结
宋《营造法式》介绍
两宋、辽、金建筑总结
两宋、辽、金建筑讨论

期中考试

9 元代的城市与建筑
元代的城市与建筑综述
元上都与元大都
元大都宫殿
元代宗教建筑
元代科技建筑

10 明代的城市与建筑
明代制度重建及其城市与建筑综述
明代北京城
明代地方城市
明代北京紫禁城
明代北京皇家坛庙
明代曲阜孔庙
明代南京孝陵与昌平十三陵
明代佛教建筑
明代道教建筑
明代教育建筑

11 清代建筑概述与紫禁城
清代建筑概述
紫禁城
陵寝建筑

12 城乡生活与建筑类型
清代城市
律制生活与衙署类建筑
信仰生活与礼制宗教建筑等
工商行业与与商业、会馆建筑
娱乐生活与演出建筑

13 清代建筑技术与艺术
中国与世界:艺术和科学&工程做法
“准”建筑师
建筑匠
案例赏析
期中测试:动手画图

14 明清时期古典园林
中国古典园林概述
明清时期皇家园林
江南私家园林
岭南私家园林
北方私家园林

15 中国传统民居建筑
中国民居建筑发展简史
北方合院式民居
江南厅井式民居
南方厅井式民居
东南客家土楼
黄土高原窑洞民居
中国传统民居建筑设计成就

16 中国多民族的建筑
回族建筑
满族、朝鲜族民居建筑
蒙古族建筑
新疆维吾尔族建筑
西藏地区的藏族建筑
西南地区多民族建筑艺术
民族建筑小结


期末考试
考试说明与题目

【FAQ】

这门课需要教科书吗?
这门课没有指定的教科书,但为了更好的学习效果,建议参考刘敦桢著,中国建筑工业出版社出版的《中国古代建筑史》。另外,每节课的内容中也会包含老师指定的参考书目,上课前会上传到课程文件当中,同学们可以自行下载。

这门课曾经被分成了中国建筑史(1)和中国建筑史(2)两门,现在合并成了一门课~之前课程的传送门:中国建筑史


', '', '铭飞科技', '/22\\21.html', '', '0', '1549'), ('22', '铭飞科技', '

本课程主要探讨新媒体与社会之间的互动关系,一方面关注各种社会力量对新媒体的塑造,另一方面讨论新媒体对社会各个层面的影响。课程在探讨新媒体的概念、特征、形式、内容和历史的基础上,同时关注新媒体的采纳、扩散、伦理和法制,以及新媒体在政治、经济、文化和社会结构上对社会的影响。本课程有助于学生掌握新媒体的相关概念和理论,理解新媒体在社会控制和社会变迁中的重要角色,成为新媒体时代具有批判能力和责任意识的现代公民。


证书要求
本课程的评价分为以下四个部分:
1、课程讨论(10%):获取满分学生需要在指定的“课堂讨论”中发帖和回帖的数量总共达50条及以上。需要参加在课件中作为教学内容的讨论,才能计算成绩。本课程每一小节都会指定讨论题目,学生可根据兴趣选择参与。
2、章节测验(30%):每次测验包括5个单选题和5个判断题,每题1分,共10分。每次测验需要在60分钟内完成,允许尝试2次,有效得分为平均分值。本课程一共有8次章节测验。
3、家庭作业(30%):要求学生在观看教学视频和阅读延伸文献的基础上,经过调研和分析,撰写书面作业。具体要求参见每次作业说明。家庭作业采取学生互评的方式评分,作业互评最少个数为6个。互评完成度的奖惩计分规则为,未参与互评的学生将获0分,未完成互评的学生将给与所得分数的50%,全部完成互评的学生将给与所得分数的100%。系统默认互评下的学生作业成绩,每个得分项去掉最低最高分取平均分,然后相加。本课程一共有3次家庭作业。
4、期末考试(30%):包括15个单选题和15个判断题,每题1分,共30分。需要在60分钟内完成,只允许尝试1次。
总成绩60分及以上合格,90分及以上优秀,并可申请相应证书。

预备知识
作为一门概论课程,本课程无特殊要求的先修课程。欢迎所有对新媒体感兴趣的同学选修。


授课大纲
第1周:新媒体导论
1.1 什么是新媒体
1.2 新媒体的历史
第2周:新媒体与社会的关系
2.1 技术决定论
2.2 社会决定论
2.3 技术社会互动论
第3周:新媒体的采纳与扩散
3.1 社会学习论
3.1 创新扩散论
3.1 技术接受论
第4周:新媒体的伦理与法制
4.1 新媒体伦理
4.2 新媒体法制
4.2 其他控制手段
第5周:新媒体的社会结构影响
5.1 网络社会
5.2 阶层结构
5.3 数字鸿沟
第6周:新媒体的政治影响
6.1 电子政务
6.2 网络参与
6.3 网络治理
第7周:新媒体的经济影响
7.1 电子商务
7.2 创意产业
7.3 信息经济
第8周:新媒体的文化影响
8.1 网络身份
8.2 网络社区
8.3 网络文化


【FAQ】

1、本课程所有视频一般都有标清、高清、超清三种格式,大家可以根据自己的网速进行选择。
2、建议大家根据教师设置的课件内容顺序进行学习,以达到最佳学习效果。
3、请大家在进行测验和作业之前,务必仔细阅读评分标准,以避免不必要的失分。
4、我的博士生谢点同学将担任本课程助教,为大家提供各种必要的协助。
5、由于选课人数众多,对于大家的疑问,我们会通过公告的形式统一回复,请大家注意公告内容更新。


', '', '铭飞科技', '/22\\22.html', '', '0', '1549'); +COMMIT; + +-- ---------------------------- +-- Table structure for `cms_class_50` +-- ---------------------------- +DROP TABLE IF EXISTS `cms_class_50`; +CREATE TABLE `cms_class_50` ( + `basicId` int(11) NOT NULL, + `school` varchar(220) DEFAULT NULL, + `platform` varchar(220) DEFAULT NULL, + PRIMARY KEY (`basicId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of `cms_class_50` +-- ---------------------------- +BEGIN; +INSERT INTO `cms_class_50` VALUES ('2', '1', '2'), ('3', '3', '2'), ('4', '1', '4'), ('5', '2', '1'), ('6', '2', '1'), ('7', '1', '1'); +COMMIT; + +-- ---------------------------- +-- Table structure for `cms_column` +-- ---------------------------- +DROP TABLE IF EXISTS `cms_column`; +CREATE TABLE `cms_column` ( + `COLUMN_CATEGORYID` int(22) NOT NULL DEFAULT '0' COMMENT '关联category表(类别表ID)', + `COLUMN_KEYWORD` varchar(300) DEFAULT NULL COMMENT '栏目简介', + `COLUMN_DESCRIP` varchar(500) DEFAULT NULL COMMENT '栏目关键字描述', + `COLUMN_TYPE` int(2) DEFAULT NULL COMMENT '1,代表列表栏目。2,代表缩单篇。', + `COLUMN_URL` varchar(50) DEFAULT NULL COMMENT '如果是外部链接,则保持外部链接地址。如果为最终列表栏目,就保存文章显示列表', + `COLUMN_LISTURL` varchar(50) DEFAULT NULL COMMENT '最终列表栏目的列表模板地址', + `COLUMN_TENTMODELID` int(22) DEFAULT NULL COMMENT '栏目类型,直接影响栏目发布的表单样式', + `COLUMN_WEBSITEID` int(22) DEFAULT NULL COMMENT '栏目所属站点ID', + `COLUMN_PATH` varchar(150) DEFAULT NULL COMMENT '栏目路径', + `COLUMN_CONTENTMODELID` int(11) DEFAULT '0' COMMENT '栏目管理的内容模型id', + PRIMARY KEY (`COLUMN_CATEGORYID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='栏目表'; + +-- ---------------------------- +-- Records of `cms_column` +-- ---------------------------- +BEGIN; +INSERT INTO `cms_column` VALUES ('15', '', '', '1', 'about.htm', 'about.htm', null, '1549', '/15', '0'), ('16', '', '', '2', 'about.htm', 'about.htm', null, '1549', '/16', '0'), ('17', '', '', '2', 'about.htm', 'about.htm', null, '1549', '/17', '0'), ('18', '', '', '2', 'about.htm', 'about.htm', null, '1549', '/18', '0'), ('19', '', '', '2', 'about.htm', 'about.htm', null, '1549', '/19', '0'), ('20', '', '', '2', 'about.htm', 'about.htm', null, '1549', '/20', '0'), ('21', '', '', '2', 'about.htm', 'about.htm', null, '1549', '/21', '0'), ('22', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/22', '0'), ('23', '', '', '1', 'about.htm', 'liebiao.htm', null, '1549', '/23', '0'), ('24', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/24', '0'), ('25', '', '', '2', 'about.htm', 'about.htm', null, '1549', '/25', '0'), ('26', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/26', '0'), ('27', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/27', '0'), ('28', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/28', '0'), ('29', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/29', '0'), ('30', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/30', '0'), ('31', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/31', '0'), ('32', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/32', '0'), ('33', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/33', '0'), ('34', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/34', '0'), ('35', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/35', '0'), ('36', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/36', '0'), ('37', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/37', '0'), ('38', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/38', '0'), ('39', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/39', '0'), ('40', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/40', '0'), ('41', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/41', '0'), ('42', '', '', '1', 'detail.htm', 'list.htm', null, '1549', '/42', '0'), ('48', '', '', '1', 'detail.htm', 'lists.html', null, '1549', '/48', '1'), ('49', '', '', '1', 'detail.htm', 'speech.htm', null, '1549', '/49', '0'), ('50', '', '', '2', 'detail.htm', null, null, '1549', '/50', '0'), ('51', '', '', '2', 'detail.htm', null, null, '1549', '/51', '0'); +COMMIT; + +-- ---------------------------- +-- Table structure for `cms_content_mode_field` +-- ---------------------------- +DROP TABLE IF EXISTS `cms_content_mode_field`; +CREATE TABLE `cms_content_mode_field` ( + `FIELD_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '字段自增长id', + `FIELD_TIPSNAME` varchar(30) DEFAULT NULL COMMENT '字段提示文字', + `FIELD_FIELDNAME` varchar(20) DEFAULT NULL COMMENT '字段名称', + `FIELD_TYPE` int(11) DEFAULT NULL COMMENT '字段类型(如1.单行,2.多行,3.图片,等)', + `FIELD_DEFAULT` varchar(250) DEFAULT NULL COMMENT '字段默认值', + `FIELD_ISNULL` int(11) DEFAULT NULL COMMENT '字段是否为空 0:必填 1:可选', + `FIELD_CMID` int(11) DEFAULT NULL COMMENT '关联内容模型表id', + `FIELD_SORT` int(11) DEFAULT NULL COMMENT '字段排序', + `FIELD_ISSEARCH` int(255) DEFAULT NULL COMMENT '字段是否支持后台搜索0:不支持,1:支持', + PRIMARY KEY (`FIELD_ID`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='自定义内容模型关联字段表'; + +-- ---------------------------- +-- Records of `cms_content_mode_field` +-- ---------------------------- +BEGIN; +INSERT INTO `cms_content_mode_field` VALUES ('1', '学校', 'school', '9', '筛选演示一,筛选演示二,筛选演示三', '1', '1', null, '1'), ('2', '机构', 'platform', '9', '筛选演示一,筛选演示二,筛选演示三', '1', '1', null, '1'); +COMMIT; + +-- ---------------------------- +-- Table structure for `cms_content_model` +-- ---------------------------- +DROP TABLE IF EXISTS `cms_content_model`; +CREATE TABLE `cms_content_model` ( + `CM_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长id', + `CM_TIPSNAME` varchar(30) NOT NULL COMMENT '表单提示文字', + `CM_TABLENAME` varchar(20) NOT NULL COMMENT '表单名称', + `CM_MANAGERID` int(11) NOT NULL COMMENT '表单管理员ID', + PRIMARY KEY (`CM_ID`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='自定义模型表'; + +-- ---------------------------- +-- Records of `cms_content_model` +-- ---------------------------- +BEGIN; +INSERT INTO `cms_content_model` VALUES ('1', '课程', 'cms_class_50', '50'); +COMMIT; + +-- ---------------------------- +-- Table structure for `cms_search` +-- ---------------------------- +DROP TABLE IF EXISTS `cms_search`; +CREATE TABLE `cms_search` ( + `SEARCH_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长ID', + `SEARCH_NAME` varchar(20) NOT NULL COMMENT '搜索名称', + `SEARCH_TEMPLETS` varchar(50) NOT NULL COMMENT '搜索结果模版', + `SEARCH_WEBSITEID` int(11) NOT NULL COMMENT '搜索管理的应用id', + PRIMARY KEY (`SEARCH_ID`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='自定义搜索表'; + +-- ---------------------------- +-- Records of `cms_search` +-- ---------------------------- +BEGIN; +INSERT INTO `cms_search` VALUES ('1', '头部', 'search.htm', '1549'), ('9', '列表页面搜索', 'search-list.htm', '1549'); +COMMIT; + +-- ---------------------------- +-- Table structure for `comment` +-- ---------------------------- +DROP TABLE IF EXISTS `comment`; +CREATE TABLE `comment` ( + `COMMENT_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '评论ID(主键)', + `COMMENT_COMMENTID` int(11) NOT NULL COMMENT '父评论ID', + `COMMENT_CONTENT` text NOT NULL COMMENT '评论的内容', + `COMMENT_PICTURE` varchar(300) DEFAULT NULL COMMENT '评论时发布的图片,可上传多张图片', + `COMMENT_TIME` datetime NOT NULL COMMENT '评论时间', + `COMMENT_TYPE` int(11) NOT NULL DEFAULT '2' COMMENT '评论的类型:1 匿名,2 公开,默认为公开', + `COMMENT_PEOPLEID` int(11) DEFAULT '0' COMMENT '评论者ID,默认为非会员用户(即游客)', + `COMMENT_POINTS` int(11) DEFAULT '0' COMMENT '评价打分(-1至5分)', + `COMMENT_BASICID` int(11) NOT NULL COMMENT '(文章、商品...)绑定basicId(外键)', + `COMMENT_APPID` int(11) DEFAULT NULL COMMENT '(文章、商品)绑定的应用编号', + PRIMARY KEY (`COMMENT_ID`), + KEY `index2` (`COMMENT_BASICID`) USING BTREE +) ENGINE=MyISAM AUTO_INCREMENT=78 DEFAULT CHARSET=utf8 COMMENT='评论表'; + +-- ---------------------------- +-- Table structure for `diy_form` +-- ---------------------------- +DROP TABLE IF EXISTS `diy_form`; +CREATE TABLE `diy_form` ( + `DF_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长id', + `DF_TIPSNAME` varchar(30) NOT NULL COMMENT '自定义表单提示文字', + `DF_TABLENAME` varchar(20) NOT NULL COMMENT '自定义表单表名', + `DF_MANAGERID` int(11) NOT NULL COMMENT '自定义表单关联的关联员id', + `DF_APPID` int(11) DEFAULT NULL COMMENT '自定义表单关联的应用编号', + PRIMARY KEY (`DF_ID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='自定义表单表'; + +-- ---------------------------- +-- Table structure for `diy_form_field` +-- ---------------------------- +DROP TABLE IF EXISTS `diy_form_field`; +CREATE TABLE `diy_form_field` ( + `DFF_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '字段自增长id', + `DFF_TIPSNAME` varchar(30) DEFAULT NULL COMMENT '字段提示文字', + `DFF_FIELDNAME` varchar(20) DEFAULT NULL COMMENT '字段名称', + `DFF_TYPE` int(11) DEFAULT NULL COMMENT '字段类型(如1.单行,2.多行,3.图片,等)', + `DFF_DEFAULT` varchar(250) DEFAULT NULL COMMENT '字段的默认值', + `DFF_ISNULL` int(11) DEFAULT NULL COMMENT '字段是否为空', + `DFF_SORT` int(11) DEFAULT NULL COMMENT '自定义表单的排序', + `DFF_FORMID` int(11) DEFAULT NULL COMMENT '字段管理的表单id', + PRIMARY KEY (`DFF_ID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='自定义表单字段表'; + +-- ---------------------------- +-- Table structure for `manager` +-- ---------------------------- +DROP TABLE IF EXISTS `manager`; +CREATE TABLE `manager` ( + `MANAGER_ID` bigint(22) NOT NULL AUTO_INCREMENT COMMENT '管理员ID(主键)', + `MANAGER_NAME` varchar(15) DEFAULT NULL COMMENT '管理员用户名', + `MANAGER_NICKNAME` varchar(15) DEFAULT NULL COMMENT '管理员昵称', + `MANAGER_PASSWORD` varchar(45) DEFAULT NULL COMMENT '管理员密码', + `MANAGER_ROLEID` bigint(22) DEFAULT NULL COMMENT '角色编号', + `MANAGER_PEOPLEID` bigint(22) DEFAULT '0' COMMENT '用户编号即商家编号', + `MANAGER_TIME` datetime DEFAULT NULL COMMENT '管理员创建时间', + PRIMARY KEY (`MANAGER_ID`) +) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8 COMMENT='管理员表'; + +-- ---------------------------- +-- Records of `manager` +-- ---------------------------- +BEGIN; +INSERT INTO `manager` VALUES ('50', 'msopen', 'msopen', '9d8622060de5f24937b60585c3f4d66b', '48', '0', '2015-09-18 11:54:36'); +COMMIT; + +-- ---------------------------- +-- Table structure for `manager_model_page` +-- ---------------------------- +DROP TABLE IF EXISTS `manager_model_page`; +CREATE TABLE `manager_model_page` ( + `mmp_managerID` int(11) DEFAULT NULL COMMENT '自增长id', + `mmp_modelID` int(11) DEFAULT NULL COMMENT '模块编号', + `mmp_url` varchar(255) DEFAULT NULL COMMENT '默认后台显示的主界面' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='后台主界面管理表'; + +-- ---------------------------- +-- Table structure for `model` +-- ---------------------------- +DROP TABLE IF EXISTS `model`; +CREATE TABLE `model` ( + `MODEL_ID` int(22) NOT NULL AUTO_INCREMENT COMMENT '模块自增长id', + `MODEL_TITLE` varchar(150) DEFAULT NULL COMMENT '模块标题', + `MODEL_CODE` varchar(255) DEFAULT NULL COMMENT '模块编码', + `MODEL_MODELID` int(22) DEFAULT NULL COMMENT '模块的父模块id', + `MODEL_URL` varchar(255) DEFAULT NULL COMMENT '模块连接地址', + `MODEL_DATETIME` datetime DEFAULT NULL, + `MODEL_ICON` varchar(120) DEFAULT NULL COMMENT '模块图标', + `MODEL_MODELMANAGERID` int(11) DEFAULT NULL COMMENT '模块关联的关联员id', + `MODEL_SORT` int(11) DEFAULT NULL COMMENT '模块的排序', + `MODEL_ISMENU` int(1) DEFAULT NULL COMMENT '模块是否是菜单', + PRIMARY KEY (`MODEL_ID`), + UNIQUE KEY `SYS_C009201` (`MODEL_ID`), + KEY `MODEL_MODELID` (`MODEL_MODELID`), + KEY `model_code` (`MODEL_CODE`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=92 DEFAULT CHARSET=utf8 COMMENT='模块表'; + +-- ---------------------------- +-- Records of `model` +-- ---------------------------- +BEGIN; +INSERT INTO `model` VALUES ('1', '内容管理', '02000000', '0', '', '2014-08-01 16:19:50', '', '0', null, null), ('4', '管理员管理', '01020000', '23', '/manager/manager/queryList.do', '2014-08-03 09:15:02', '', '0', null, null), ('5', '角色管理', '01010000', '23', '/manager/role/queryList.do', '2014-08-03 09:15:14', '', '0', null, null), ('7', '栏目管理', '02990000', '1', '/manager/cms/column/list.do', '2014-08-03 09:16:29', '', '0', null, null), ('8', '文章管理', '02980000', '1', '/manager/cms/article/index.do', '2014-08-03 09:17:10', '', '0', null, null), ('22', '会员中心', '07000000', '0', '', '2014-09-08 08:11:28', '', '0', null, '1'), ('23', '权限管理', '01000000', '0', '', '2014-09-08 08:12:22', '', '0', null, null), ('33', '数据导入', '02090000', '0', '', '2014-10-07 11:32:07', '', '0', null, null), ('34', '织梦数据导入', '02090100', '33', '/manager/cms/dede/dede.do', '2014-10-07 11:32:47', '', '0', null, null), ('35', '自定义模型', '02060000', '84', '/manager/cms/contentModel/list.do', '2014-10-13 18:27:23', '', '0', null, null), ('36', '自定义搜索', '02050000', '84', '/manager/cms/search/list.do', '2014-10-13 18:28:34', '', '0', null, null), ('79', '生成器', '11000000', '0', '', '2014-12-18 11:36:16', '', '0', null, null), ('80', '生成主页', '11010000', '79', '/manager/cms/generate/index.do', '2014-12-18 11:37:15', '', '0', null, null), ('81', '生成栏目', '11020000', '79', '/manager/cms/generate/column.do', '2014-12-18 11:37:53', '', '0', null, null), ('82', '生成文章', '11030000', '79', '/manager/cms/generate/article.do', '2014-12-18 11:38:38', '', '0', null, null), ('84', '系统管理', '12000000', '0', '', '2014-12-18 18:30:24', '', '0', null, null), ('86', '应用设置', '12010000', '84', '/manager/app/-1/edit.do', '2014-12-18 18:31:59', '', '0', null, null), ('88', '用户管理', '07020100', '22', '/manager/people/user/list.do', '2015-09-18 11:44:54', '', '0', null, '1'), ('89', '自定义页面', '12030100', '84', '/manager/modeltemplate/list.do', '2015-09-18 17:32:04', null, '0', null, null), ('90', '自定义表单', '12050000', '84', '/manager/diy/form/list.do', '2015-09-18 22:06:02', null, null, null, null), ('91', '模板管理', '12020000', '84', '/manager/cms/templet/queryTempletSkin.do', null, null, null, null, null); +COMMIT; + +-- ---------------------------- +-- Table structure for `model_template` +-- ---------------------------- +DROP TABLE IF EXISTS `model_template`; +CREATE TABLE `model_template` ( + `mt_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长id', + `mt_modelID` int(11) DEFAULT NULL COMMENT '模块id', + `mt_appID` int(11) DEFAULT NULL COMMENT '应用id', + `mt_path` varchar(255) DEFAULT NULL COMMENT '自定义页面绑定模板的路径', + `mt_title` varchar(255) DEFAULT NULL COMMENT '自定义页面标题', + `mt_key` varchar(255) DEFAULT NULL COMMENT '自定义页面访问路径', + PRIMARY KEY (`mt_id`), + KEY `mt_key` (`mt_key`) USING BTREE, + KEY `mt_appID` (`mt_appID`), + KEY `mt_modelID` (`mt_modelID`) USING BTREE +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='自定义页面表'; + +-- ---------------------------- +-- Records of `model_template` +-- ---------------------------- +BEGIN; +INSERT INTO `model_template` VALUES ('1', '0', '1549', 'register.htm', '注册', 'register'), ('2', '0', '1549', 'login.htm', '登录', 'login'), ('3', '0', '1549', 'userCenter.htm', '个人中心', 'people/userCenter'), ('4', '0', '1549', 'changePassWord.htm', '修改密码', 'changePassWord'); +COMMIT; + +-- ---------------------------- +-- Table structure for `people` +-- ---------------------------- +DROP TABLE IF EXISTS `people`; +CREATE TABLE `people` ( + `PEOPLE_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '增长自ID', + `PEOPLE_PHONE` varchar(30) DEFAULT NULL COMMENT '手机号码', + `PEOPLE_NAME` varchar(30) DEFAULT NULL COMMENT '陆登账号', + `PEOPLE_PASSWORD` varchar(50) DEFAULT NULL COMMENT '陆登密码', + `PEOPLE_DATETIME` datetime NOT NULL COMMENT '注册时间', + `PEOPLE_APP_ID` int(11) NOT NULL COMMENT '用户所属用户ID', + `PEOPLE_MAIL` varchar(120) DEFAULT NULL COMMENT '用户邮箱', + `PEOPLE_STATE` int(2) DEFAULT '0' COMMENT '用户状态', + `PEOPLE_CODE` varchar(15) DEFAULT NULL COMMENT '随机验证码', + `PEOPLE_CODESENDDATE` datetime DEFAULT NULL, + `PEOPLE_PHONECHECK` int(1) DEFAULT NULL, + `PEOPLE_MAILLCHECK` int(1) DEFAULT NULL, + PRIMARY KEY (`PEOPLE_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='户用基础表'; + +-- ---------------------------- +-- Table structure for `people_user` +-- ---------------------------- +DROP TABLE IF EXISTS `people_user`; +CREATE TABLE `people_user` ( + `PU_PEOPLE_ID` int(11) NOT NULL COMMENT '用户ID关联people表的(people_id)', + `PU_REAL_NAME` varchar(50) DEFAULT NULL COMMENT '用户真实名称', + `PU_ADDRESS` varchar(200) DEFAULT NULL COMMENT '用户地址', + `PU_ICON` varchar(120) DEFAULT NULL COMMENT '用户头像图标地址', + `PU_NICKNAME` varchar(50) DEFAULT NULL COMMENT '用户昵称', + `PU_SEX` int(2) DEFAULT NULL COMMENT '用户性别(0.未知、1.男、2.女)', + `PU_BIRTHDAY` date DEFAULT NULL COMMENT '用户出生年月日', + `PU_CARD` varchar(255) DEFAULT NULL COMMENT '身份证', + `PU_APP_ID` int(11) NOT NULL COMMENT '用户所属应用ID', + PRIMARY KEY (`PU_PEOPLE_ID`), + KEY `PU_PEOPLE_ID` (`PU_PEOPLE_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户基础信息表'; + +-- ---------------------------- +-- Table structure for `role` +-- ---------------------------- +DROP TABLE IF EXISTS `role`; +CREATE TABLE `role` ( + `ROLE_ID` bigint(22) NOT NULL AUTO_INCREMENT COMMENT '角色ID,自增长', + `ROLE_NAME` varchar(30) DEFAULT NULL COMMENT '角色名', + `ROLE_MANAGERID` bigint(22) DEFAULT '0' COMMENT '角色管理员编号', + PRIMARY KEY (`ROLE_ID`) +) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8 COMMENT='角色表'; + +-- ---------------------------- +-- Records of `role` +-- ---------------------------- +BEGIN; +INSERT INTO `role` VALUES ('48', 'msopen', '50'); +COMMIT; + +-- ---------------------------- +-- Table structure for `role_model` +-- ---------------------------- +DROP TABLE IF EXISTS `role_model`; +CREATE TABLE `role_model` ( + `RM_MODELID` int(22) DEFAULT NULL COMMENT '模块编号', + `RM_ROLEID` int(22) DEFAULT NULL COMMENT '角色编号', + UNIQUE KEY `index` (`RM_MODELID`,`RM_ROLEID`) USING BTREE, + KEY `RM_MODELID` (`RM_MODELID`) USING BTREE, + CONSTRAINT `role_model_ibfk_1` FOREIGN KEY (`RM_MODELID`) REFERENCES `model` (`MODEL_ID`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色模块关联表'; + +-- ---------------------------- +-- Records of `role_model` +-- ---------------------------- +BEGIN; +INSERT INTO `role_model` VALUES ('1', '48'), ('4', '48'), ('5', '48'), ('7', '48'), ('8', '48'), ('22', '48'), ('23', '48'), ('33', '48'), ('34', '48'), ('35', '48'), ('36', '48'), ('79', '48'), ('80', '48'), ('81', '48'), ('82', '48'), ('84', '48'), ('86', '48'), ('88', '48'), ('89', '48'), ('90', '48'), ('91', '48'); +COMMIT; + +-- ---------------------------- +-- Table structure for `system_main_page` +-- ---------------------------- +DROP TABLE IF EXISTS `system_main_page`; +CREATE TABLE `system_main_page` ( + `smp_appID` int(11) DEFAULT NULL COMMENT '自增长ID', + `smp_url` varchar(255) DEFAULT NULL COMMENT '默认后台显示的主界面', + `smp_modelID` int(11) DEFAULT NULL COMMENT '模块编号', + `smp_managerID` int(11) DEFAULT NULL COMMENT '管理员编号' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='后台主界面管理界面'; + +-- ---------------------------- +-- Table structure for `system_skin` +-- ---------------------------- +DROP TABLE IF EXISTS `system_skin`; +CREATE TABLE `system_skin` ( + `ss_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长ID', + `ss_loginpage` varchar(255) DEFAULT NULL COMMENT '登陆页面', + `ss_backgroundimg` varchar(255) DEFAULT NULL COMMENT '背景图片', + `ss_color` varchar(255) DEFAULT NULL COMMENT '字体颜色', + `ss_css` varchar(255) DEFAULT NULL COMMENT '样式', + `ss_datetime` datetime DEFAULT NULL COMMENT '生成时间', + `ss_appID` int(11) DEFAULT NULL COMMENT '0后台发布大于0表示是应用自定义', + `ss_categoryID` int(11) DEFAULT NULL COMMENT '主题分类', + PRIMARY KEY (`ss_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='后台皮肤管理表'; + +-- ---------------------------- +-- Table structure for `system_skin_manager` +-- ---------------------------- +DROP TABLE IF EXISTS `system_skin_manager`; +CREATE TABLE `system_skin_manager` ( + `ssm_managerID` int(11) NOT NULL DEFAULT '0' COMMENT '系统管理员编号', + `ssm_system_skin_ID` int(11) DEFAULT NULL COMMENT '系统皮肤管理员编号', + PRIMARY KEY (`ssm_managerID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统皮肤与管理员关联表'; + +-- ---------------------------- +-- View structure for `v_article` +-- ---------------------------- +DROP VIEW IF EXISTS `v_article`; +CREATE VIEW `v_article` AS select `cms_article`.`ARTICLE_BASICID` AS `ARTICLE_BASICID`,`basic`.`BASIC_ID` AS `BASIC_ID`,`basic`.`BASIC_CATEGORYID` AS `BASIC_CATEGORYID`,`basic`.`BASIC_TITLE` AS `BASIC_TITLE`,`basic`.`BASIC_DESCRIPTION` AS `BASIC_DESCRIPTION`,`basic`.`BASIC_THUMBNAILS` AS `BASIC_THUMBNAILS`,`basic`.`BASIC_HIT` AS `BASIC_HIT`,`basic`.`BASIC_DATETIME` AS `BASIC_DATETIME`,`basic`.`BASIC_UPDATETIME` AS `BASIC_UPDATETIME`,`basic`.`BASIC_PEOPLEID` AS `BASIC_PEOPLEID`,`cms_article`.`ARTICLE_AUTHOR` AS `ARTICLE_AUTHOR`,`cms_article`.`ARTICLE_CONTENT` AS `ARTICLE_CONTENT`,`cms_article`.`ARTICLE_TYPE` AS `ARTICLE_TYPE`,`cms_article`.`ARTICLE_SOURCE` AS `ARTICLE_SOURCE`,`cms_article`.`ARTICLE_URL` AS `ARTICLE_URL`,`cms_article`.`ARTICLE_KEYWORD` AS `ARTICLE_KEYWORD`,`cms_article`.`ARTICLE_FREEORDER` AS `ARTICLE_FREEORDER`,`cms_article`.`ARTICLE_WEBID` AS `ARTICLE_WEBID`,`cms_column`.`COLUMN_KEYWORD` AS `COLUMN_KEYWORD`,`cms_column`.`COLUMN_DESCRIP` AS `COLUMN_DESCRIP`,`cms_column`.`COLUMN_TYPE` AS `COLUMN_TYPE`,`cms_column`.`COLUMN_URL` AS `COLUMN_URL`,`cms_column`.`COLUMN_LISTURL` AS `COLUMN_LISTURL`,`cms_column`.`COLUMN_TENTMODELID` AS `COLUMN_TENTMODELID`,`cms_column`.`COLUMN_WEBSITEID` AS `COLUMN_WEBSITEID`,`cms_column`.`COLUMN_PATH` AS `column_path`,`cms_column`.`COLUMN_CONTENTMODELID` AS `COLUMN_CONTENTMODELID`,`category`.`CATEGORY_TITLE` AS `CATEGORY_TITLE`,`category`.`CATEGORY_APPID` AS `CATEGORY_APPID`,`cms_column`.`COLUMN_CATEGORYID` AS `COLUMN_CATEGORYID`,`category`.`CATEGORY_ID` AS `CATEGORY_ID`,`basic`.`BASIC_SORT` AS `BASIC_SORT` from (((`basic` join `cms_article` on((`basic`.`BASIC_ID` = `cms_article`.`ARTICLE_BASICID`))) join `cms_column` on((`basic`.`BASIC_CATEGORYID` = `cms_column`.`COLUMN_CATEGORYID`))) join `category` on((`cms_column`.`COLUMN_CATEGORYID` = `category`.`CATEGORY_ID`))); + +-- ---------------------------- +-- View structure for `v_people_user` +-- ---------------------------- +DROP VIEW IF EXISTS `v_people_user`; +CREATE VIEW `v_people_user` AS select `people`.`PEOPLE_ID` AS `PEOPLE_ID`,`people`.`PEOPLE_PHONE` AS `PEOPLE_PHONE`,`people`.`PEOPLE_NAME` AS `PEOPLE_NAME`,`people`.`PEOPLE_PASSWORD` AS `PEOPLE_PASSWORD`,`people`.`PEOPLE_DATETIME` AS `PEOPLE_DATETIME`,`people`.`PEOPLE_APP_ID` AS `PEOPLE_APP_ID`,`people`.`PEOPLE_MAIL` AS `PEOPLE_MAIL`,`people`.`PEOPLE_STATE` AS `PEOPLE_STATE`,`people`.`PEOPLE_CODE` AS `PEOPLE_CODE`,`people`.`PEOPLE_CODESENDDATE` AS `PEOPLE_CODESENDDATE`,`people`.`PEOPLE_PHONECHECK` AS `PEOPLE_PHONECHECK`,`people`.`PEOPLE_MAILLCHECK` AS `PEOPLE_MAILLCHECK`,`people_user`.`PU_PEOPLE_ID` AS `PU_PEOPLE_ID`,`people_user`.`PU_REAL_NAME` AS `PU_REAL_NAME`,`people_user`.`PU_ADDRESS` AS `PU_ADDRESS`,`people_user`.`PU_ICON` AS `PU_ICON`,`people_user`.`PU_NICKNAME` AS `PU_NICKNAME`,`people_user`.`PU_SEX` AS `PU_SEX`,`people_user`.`PU_BIRTHDAY` AS `PU_BIRTHDAY`,`people_user`.`PU_CARD` AS `PU_CARD`,`people_user`.`PU_APP_ID` AS `PU_APP_ID` from (`people` left join `people_user` on((`people`.`PEOPLE_ID` = `people_user`.`PU_PEOPLE_ID`))); + +-- ---------------------------- +-- Procedure structure for `p_getAllChildren` +-- ---------------------------- +DROP PROCEDURE IF EXISTS `p_getAllChildren`; +delimiter ;; +CREATE PROCEDURE `p_getAllChildren`(`pId` int,`appId`int,`modelId` int) +BEGIN + + declare lev int; + set lev=1; + drop TEMPORARY table if exists tmp_category; + drop TEMPORARY table if exists tmp_category_child; + CREATE TEMPORARY TABLE tmp_category(category_id int(40),category_title varchar(50),category_categoryid varchar(40) ,lev INT) engine=memory; + CREATE TEMPORARY TABLE tmp_category_child(category_id int(40),category_title varchar(50),category_categoryid varchar(40) ,lev INT) engine=memory; + INSERT tmp_category SELECT category_id,category_title,category_categoryid,1 FROM `category` WHERE category_categoryid=pid and category_appid=appId and category_modelId=modelId; + INSERT tmp_category_child SELECT category_id,category_title,category_categoryid,1 FROM `category` WHERE category_categoryid=pid and category_appid=appId and category_modelId=modelId; + while ROW_COUNT()>0 + do set lev=lev+1; + INSERT tmp_category SELECT c.category_id,c.category_title,c.category_categoryid,lev from category c join tmp_category_child a on c.category_categoryid = a.category_id AND a.lev=lev-1 and c.category_appid=appId and c.category_modelId=modelId; + INSERT tmp_category_child SELECT c.category_id,c.category_title,c.category_categoryid,lev from category c join tmp_category a on c.category_categoryid = a.category_id AND a.lev=lev-1 and c.category_appid=appId and c.category_modelId=modelId; + end while ; + INSERT tmp_category SELECT c.category_id,c.category_title,c.category_categoryid,0 FROM category c WHERE c.category_id=pid and c.category_appid=appId and c.category_modelId=modelId; + SELECT * FROM tmp_category; +END + ;; +delimiter ; + +SET FOREIGN_KEY_CHECKS = 1; diff --git "a/doc/\344\275\277\347\224\250\346\211\213\345\206\214-\351\241\271\347\233\256\351\203\250\347\275\262.doc" "b/doc/\344\275\277\347\224\250\346\211\213\345\206\214-\351\241\271\347\233\256\351\203\250\347\275\262.doc" new file mode 100644 index 00000000..72eb44cc Binary files /dev/null and "b/doc/\344\275\277\347\224\250\346\211\213\345\206\214-\351\241\271\347\233\256\351\203\250\347\275\262.doc" differ diff --git a/libs/Sdk4J-2.0.jar b/libs/Sdk4J-2.0.jar new file mode 100644 index 00000000..78074448 Binary files /dev/null and b/libs/Sdk4J-2.0.jar differ diff --git a/libs/Sdk4J.jar b/libs/Sdk4J.jar new file mode 100644 index 00000000..78074448 Binary files /dev/null and b/libs/Sdk4J.jar differ diff --git a/libs/activation-1.1.jar b/libs/activation-1.1.jar new file mode 100644 index 00000000..53f82a1c Binary files /dev/null and b/libs/activation-1.1.jar differ diff --git a/libs/aopalliance-1.0.jar b/libs/aopalliance-1.0.jar new file mode 100644 index 00000000..578b1a0c Binary files /dev/null and b/libs/aopalliance-1.0.jar differ diff --git a/libs/asm-4.2.jar b/libs/asm-4.2.jar new file mode 100644 index 00000000..693913dd Binary files /dev/null and b/libs/asm-4.2.jar differ diff --git a/libs/aspectjweaver-1.8.1.jar b/libs/aspectjweaver-1.8.1.jar new file mode 100644 index 00000000..50cb74d6 Binary files /dev/null and b/libs/aspectjweaver-1.8.1.jar differ diff --git a/libs/bonecp-0.7.1.RELEASE.jar b/libs/bonecp-0.7.1.RELEASE.jar new file mode 100644 index 00000000..51e5ea18 Binary files /dev/null and b/libs/bonecp-0.7.1.RELEASE.jar differ diff --git a/libs/c3p0-0.9.1.1.jar b/libs/c3p0-0.9.1.1.jar new file mode 100644 index 00000000..8d283e4e Binary files /dev/null and b/libs/c3p0-0.9.1.1.jar differ diff --git a/libs/cglib-3.1.jar b/libs/cglib-3.1.jar new file mode 100644 index 00000000..25a5df15 Binary files /dev/null and b/libs/cglib-3.1.jar differ diff --git a/libs/cglib-nodep-2.2.jar b/libs/cglib-nodep-2.2.jar new file mode 100644 index 00000000..ed07cb50 Binary files /dev/null and b/libs/cglib-nodep-2.2.jar differ diff --git a/libs/commons-beanutils-1.8.0.jar b/libs/commons-beanutils-1.8.0.jar new file mode 100644 index 00000000..caf7ae33 Binary files /dev/null and b/libs/commons-beanutils-1.8.0.jar differ diff --git a/libs/commons-codec-1.10.jar b/libs/commons-codec-1.10.jar new file mode 100644 index 00000000..1d7417c4 Binary files /dev/null and b/libs/commons-codec-1.10.jar differ diff --git a/libs/commons-collections-3.2.jar b/libs/commons-collections-3.2.jar new file mode 100644 index 00000000..75580be2 Binary files /dev/null and b/libs/commons-collections-3.2.jar differ diff --git a/libs/commons-digester-1.8.jar b/libs/commons-digester-1.8.jar new file mode 100644 index 00000000..1110f0aa Binary files /dev/null and b/libs/commons-digester-1.8.jar differ diff --git a/libs/commons-fileupload-1.3.1.jar b/libs/commons-fileupload-1.3.1.jar new file mode 100644 index 00000000..af0cda22 Binary files /dev/null and b/libs/commons-fileupload-1.3.1.jar differ diff --git a/libs/commons-httpclient-3.1-rc1.jar b/libs/commons-httpclient-3.1-rc1.jar new file mode 100644 index 00000000..09fe533a Binary files /dev/null and b/libs/commons-httpclient-3.1-rc1.jar differ diff --git a/libs/commons-io-2.2.jar b/libs/commons-io-2.2.jar new file mode 100644 index 00000000..84ca5658 Binary files /dev/null and b/libs/commons-io-2.2.jar differ diff --git a/libs/commons-lang-2.5.jar b/libs/commons-lang-2.5.jar new file mode 100644 index 00000000..ae491da8 Binary files /dev/null and b/libs/commons-lang-2.5.jar differ diff --git a/libs/commons-logging-1.1.1.jar b/libs/commons-logging-1.1.1.jar new file mode 100644 index 00000000..1deef144 Binary files /dev/null and b/libs/commons-logging-1.1.1.jar differ diff --git a/libs/core-3.1.0.jar b/libs/core-3.1.0.jar new file mode 100644 index 00000000..63c228a9 Binary files /dev/null and b/libs/core-3.1.0.jar differ diff --git a/libs/dom4j-1.6.1.jar b/libs/dom4j-1.6.1.jar new file mode 100644 index 00000000..c8c4dbb9 Binary files /dev/null and b/libs/dom4j-1.6.1.jar differ diff --git a/libs/dom4j-2.0.0-RC1.jar b/libs/dom4j-2.0.0-RC1.jar new file mode 100644 index 00000000..ec16d435 Binary files /dev/null and b/libs/dom4j-2.0.0-RC1.jar differ diff --git a/libs/druid-1.0.6.jar b/libs/druid-1.0.6.jar new file mode 100644 index 00000000..ee25ca04 Binary files /dev/null and b/libs/druid-1.0.6.jar differ diff --git a/libs/ezmorph-1.0.6.jar b/libs/ezmorph-1.0.6.jar new file mode 100644 index 00000000..30fad12d Binary files /dev/null and b/libs/ezmorph-1.0.6.jar differ diff --git a/libs/fastjson-1.1.41.jar b/libs/fastjson-1.1.41.jar new file mode 100644 index 00000000..5f58cef3 Binary files /dev/null and b/libs/fastjson-1.1.41.jar differ diff --git a/libs/fastjson-1.2.6.jar b/libs/fastjson-1.2.6.jar new file mode 100644 index 00000000..2e904185 Binary files /dev/null and b/libs/fastjson-1.2.6.jar differ diff --git a/libs/filters-2.0.235.jar b/libs/filters-2.0.235.jar new file mode 100644 index 00000000..39e4dd59 Binary files /dev/null and b/libs/filters-2.0.235.jar differ diff --git a/libs/freemarker-2.3.20.jar b/libs/freemarker-2.3.20.jar new file mode 100644 index 00000000..91390441 Binary files /dev/null and b/libs/freemarker-2.3.20.jar differ diff --git a/libs/guava-r08.jar b/libs/guava-r08.jar new file mode 100644 index 00000000..618a3cb1 Binary files /dev/null and b/libs/guava-r08.jar differ diff --git a/libs/hamcrest-core-1.3.jar b/libs/hamcrest-core-1.3.jar new file mode 100644 index 00000000..9d5fe16e Binary files /dev/null and b/libs/hamcrest-core-1.3.jar differ diff --git a/libs/httpclient-4.3.4.jar b/libs/httpclient-4.3.4.jar new file mode 100644 index 00000000..f8a7afeb Binary files /dev/null and b/libs/httpclient-4.3.4.jar differ diff --git a/libs/httpcore-4.3.2.jar b/libs/httpcore-4.3.2.jar new file mode 100644 index 00000000..813ec234 Binary files /dev/null and b/libs/httpcore-4.3.2.jar differ diff --git a/libs/jackson-core-asl-1.9.11.jar b/libs/jackson-core-asl-1.9.11.jar new file mode 100644 index 00000000..145fc489 Binary files /dev/null and b/libs/jackson-core-asl-1.9.11.jar differ diff --git a/libs/jackson-core-asl-1.9.13.jar b/libs/jackson-core-asl-1.9.13.jar new file mode 100644 index 00000000..bb4fe1da Binary files /dev/null and b/libs/jackson-core-asl-1.9.13.jar differ diff --git a/libs/jackson-mapper-asl-1.9.11.jar b/libs/jackson-mapper-asl-1.9.11.jar new file mode 100644 index 00000000..3e686c6f Binary files /dev/null and b/libs/jackson-mapper-asl-1.9.11.jar differ diff --git a/libs/jackson-mapper-asl-1.9.13.jar b/libs/jackson-mapper-asl-1.9.13.jar new file mode 100644 index 00000000..0f2073fc Binary files /dev/null and b/libs/jackson-mapper-asl-1.9.13.jar differ diff --git a/libs/java-image-scaling-0.8.6.jar b/libs/java-image-scaling-0.8.6.jar new file mode 100644 index 00000000..fbc21e25 Binary files /dev/null and b/libs/java-image-scaling-0.8.6.jar differ diff --git a/libs/javase-3.1.0.jar b/libs/javase-3.1.0.jar new file mode 100644 index 00000000..2647da23 Binary files /dev/null and b/libs/javase-3.1.0.jar differ diff --git a/libs/javax.mail-1.4.5.jar b/libs/javax.mail-1.4.5.jar new file mode 100644 index 00000000..1037d7d7 Binary files /dev/null and b/libs/javax.mail-1.4.5.jar differ diff --git a/libs/javax.servlet-api-3.1.0.jar b/libs/javax.servlet-api-3.1.0.jar new file mode 100644 index 00000000..6b14c3d2 Binary files /dev/null and b/libs/javax.servlet-api-3.1.0.jar differ diff --git a/libs/jaxb-api-2.2.12.jar b/libs/jaxb-api-2.2.12.jar new file mode 100644 index 00000000..3f4638ce Binary files /dev/null and b/libs/jaxb-api-2.2.12.jar differ diff --git a/libs/jaxen-1.1.6.jar b/libs/jaxen-1.1.6.jar new file mode 100644 index 00000000..52f47a4f Binary files /dev/null and b/libs/jaxen-1.1.6.jar differ diff --git a/libs/json-lib-2.2.3-jdk15.jar b/libs/json-lib-2.2.3-jdk15.jar new file mode 100644 index 00000000..8c92fab0 Binary files /dev/null and b/libs/json-lib-2.2.3-jdk15.jar differ diff --git a/libs/jsp-api-2.2.1-b03.jar b/libs/jsp-api-2.2.1-b03.jar new file mode 100644 index 00000000..c20a4916 Binary files /dev/null and b/libs/jsp-api-2.2.1-b03.jar differ diff --git a/libs/jsr311-api-1.1-ea.jar b/libs/jsr311-api-1.1-ea.jar new file mode 100644 index 00000000..4cdc0891 Binary files /dev/null and b/libs/jsr311-api-1.1-ea.jar differ diff --git a/libs/junit-4.11.jar b/libs/junit-4.11.jar new file mode 100644 index 00000000..aaf74448 Binary files /dev/null and b/libs/junit-4.11.jar differ diff --git a/libs/jxl-2.6.12.jar b/libs/jxl-2.6.12.jar new file mode 100644 index 00000000..4a1fc64f Binary files /dev/null and b/libs/jxl-2.6.12.jar differ diff --git a/libs/jxl-2.6.jar b/libs/jxl-2.6.jar new file mode 100644 index 00000000..313cab7f Binary files /dev/null and b/libs/jxl-2.6.jar differ diff --git a/libs/log4j-1.2.17.jar b/libs/log4j-1.2.17.jar new file mode 100644 index 00000000..1d425cf7 Binary files /dev/null and b/libs/log4j-1.2.17.jar differ diff --git a/libs/ms-proxy-1.0.0.jar b/libs/ms-proxy-1.0.0.jar new file mode 100644 index 00000000..8ffc4176 Binary files /dev/null and b/libs/ms-proxy-1.0.0.jar differ diff --git a/libs/ms-upgrader.jar b/libs/ms-upgrader.jar new file mode 100644 index 00000000..c6b25e80 Binary files /dev/null and b/libs/ms-upgrader.jar differ diff --git a/libs/mybatis-3.2.6.jar b/libs/mybatis-3.2.6.jar new file mode 100644 index 00000000..cdd850fc Binary files /dev/null and b/libs/mybatis-3.2.6.jar differ diff --git a/libs/mybatis-spring-1.2.2.jar b/libs/mybatis-spring-1.2.2.jar new file mode 100644 index 00000000..63a226f4 Binary files /dev/null and b/libs/mybatis-spring-1.2.2.jar differ diff --git a/libs/mysql-connector-java-5.1.31.jar b/libs/mysql-connector-java-5.1.31.jar new file mode 100644 index 00000000..26864e49 Binary files /dev/null and b/libs/mysql-connector-java-5.1.31.jar differ diff --git a/libs/mysql-connector-java-5.1.8.jar b/libs/mysql-connector-java-5.1.8.jar new file mode 100644 index 00000000..5a7c6fb0 Binary files /dev/null and b/libs/mysql-connector-java-5.1.8.jar differ diff --git a/libs/protobuf-java-2.3.0.jar b/libs/protobuf-java-2.3.0.jar new file mode 100644 index 00000000..e952209c Binary files /dev/null and b/libs/protobuf-java-2.3.0.jar differ diff --git a/libs/pull-parser-2.jar b/libs/pull-parser-2.jar new file mode 100644 index 00000000..f5153fd4 Binary files /dev/null and b/libs/pull-parser-2.jar differ diff --git a/libs/quartz-2.2.1.jar b/libs/quartz-2.2.1.jar new file mode 100644 index 00000000..7cf3ca4d Binary files /dev/null and b/libs/quartz-2.2.1.jar differ diff --git a/libs/relaxngDatatype-20020414.jar b/libs/relaxngDatatype-20020414.jar new file mode 100644 index 00000000..db9206f6 Binary files /dev/null and b/libs/relaxngDatatype-20020414.jar differ diff --git a/libs/shiro-core-1.2.1.jar b/libs/shiro-core-1.2.1.jar new file mode 100644 index 00000000..a5dede0f Binary files /dev/null and b/libs/shiro-core-1.2.1.jar differ diff --git a/libs/shiro-ehcache-1.2.1.jar b/libs/shiro-ehcache-1.2.1.jar new file mode 100644 index 00000000..ef52711f Binary files /dev/null and b/libs/shiro-ehcache-1.2.1.jar differ diff --git a/libs/shiro-spring-1.2.1.jar b/libs/shiro-spring-1.2.1.jar new file mode 100644 index 00000000..38fc9a27 Binary files /dev/null and b/libs/shiro-spring-1.2.1.jar differ diff --git a/libs/shiro-web-1.2.1.jar b/libs/shiro-web-1.2.1.jar new file mode 100644 index 00000000..f93594bc Binary files /dev/null and b/libs/shiro-web-1.2.1.jar differ diff --git a/libs/slf4j-api-1.5.10.jar b/libs/slf4j-api-1.5.10.jar new file mode 100644 index 00000000..9ec867b2 Binary files /dev/null and b/libs/slf4j-api-1.5.10.jar differ diff --git a/libs/slf4j-api-1.6.6.jar b/libs/slf4j-api-1.6.6.jar new file mode 100644 index 00000000..4c03fa6b Binary files /dev/null and b/libs/slf4j-api-1.6.6.jar differ diff --git a/libs/slf4j-log4j12-1.5.11.jar b/libs/slf4j-log4j12-1.5.11.jar new file mode 100644 index 00000000..ea7225be Binary files /dev/null and b/libs/slf4j-log4j12-1.5.11.jar differ diff --git a/libs/spring-aop-4.0.5.RELEASE.jar b/libs/spring-aop-4.0.5.RELEASE.jar new file mode 100644 index 00000000..062619c6 Binary files /dev/null and b/libs/spring-aop-4.0.5.RELEASE.jar differ diff --git a/libs/spring-aspects-4.0.5.RELEASE.jar b/libs/spring-aspects-4.0.5.RELEASE.jar new file mode 100644 index 00000000..2bcf455b Binary files /dev/null and b/libs/spring-aspects-4.0.5.RELEASE.jar differ diff --git a/libs/spring-beans-4.0.5.RELEASE.jar b/libs/spring-beans-4.0.5.RELEASE.jar new file mode 100644 index 00000000..fb2f32ab Binary files /dev/null and b/libs/spring-beans-4.0.5.RELEASE.jar differ diff --git a/libs/spring-context-4.0.5.RELEASE.jar b/libs/spring-context-4.0.5.RELEASE.jar new file mode 100644 index 00000000..fd6a0251 Binary files /dev/null and b/libs/spring-context-4.0.5.RELEASE.jar differ diff --git a/libs/spring-context-support-4.0.5.RELEASE.jar b/libs/spring-context-support-4.0.5.RELEASE.jar new file mode 100644 index 00000000..2167df7a Binary files /dev/null and b/libs/spring-context-support-4.0.5.RELEASE.jar differ diff --git a/libs/spring-core-4.0.5.RELEASE.jar b/libs/spring-core-4.0.5.RELEASE.jar new file mode 100644 index 00000000..ef9166ed Binary files /dev/null and b/libs/spring-core-4.0.5.RELEASE.jar differ diff --git a/libs/spring-expression-4.0.5.RELEASE.jar b/libs/spring-expression-4.0.5.RELEASE.jar new file mode 100644 index 00000000..248cbd22 Binary files /dev/null and b/libs/spring-expression-4.0.5.RELEASE.jar differ diff --git a/libs/spring-integration-core-4.0.4.RELEASE.jar b/libs/spring-integration-core-4.0.4.RELEASE.jar new file mode 100644 index 00000000..f39ad2b9 Binary files /dev/null and b/libs/spring-integration-core-4.0.4.RELEASE.jar differ diff --git a/libs/spring-integration-mail-4.0.4.RELEASE.jar b/libs/spring-integration-mail-4.0.4.RELEASE.jar new file mode 100644 index 00000000..14ad5fd5 Binary files /dev/null and b/libs/spring-integration-mail-4.0.4.RELEASE.jar differ diff --git a/libs/spring-jdbc-4.0.5.RELEASE.jar b/libs/spring-jdbc-4.0.5.RELEASE.jar new file mode 100644 index 00000000..3f695ecd Binary files /dev/null and b/libs/spring-jdbc-4.0.5.RELEASE.jar differ diff --git a/libs/spring-messaging-4.0.7.RELEASE.jar b/libs/spring-messaging-4.0.7.RELEASE.jar new file mode 100644 index 00000000..2e84e7db Binary files /dev/null and b/libs/spring-messaging-4.0.7.RELEASE.jar differ diff --git a/libs/spring-orm-4.0.5.RELEASE.jar b/libs/spring-orm-4.0.5.RELEASE.jar new file mode 100644 index 00000000..5212f22e Binary files /dev/null and b/libs/spring-orm-4.0.5.RELEASE.jar differ diff --git a/libs/spring-retry-1.1.1.RELEASE.jar b/libs/spring-retry-1.1.1.RELEASE.jar new file mode 100644 index 00000000..65c3d730 Binary files /dev/null and b/libs/spring-retry-1.1.1.RELEASE.jar differ diff --git a/libs/spring-test-4.0.5.RELEASE.jar b/libs/spring-test-4.0.5.RELEASE.jar new file mode 100644 index 00000000..d75b2396 Binary files /dev/null and b/libs/spring-test-4.0.5.RELEASE.jar differ diff --git a/libs/spring-tx-4.0.5.RELEASE.jar b/libs/spring-tx-4.0.5.RELEASE.jar new file mode 100644 index 00000000..25660663 Binary files /dev/null and b/libs/spring-tx-4.0.5.RELEASE.jar differ diff --git a/libs/spring-web-4.0.5.RELEASE.jar b/libs/spring-web-4.0.5.RELEASE.jar new file mode 100644 index 00000000..c57f315c Binary files /dev/null and b/libs/spring-web-4.0.5.RELEASE.jar differ diff --git a/libs/spring-webmvc-4.0.5.RELEASE.jar b/libs/spring-webmvc-4.0.5.RELEASE.jar new file mode 100644 index 00000000..f4a817c1 Binary files /dev/null and b/libs/spring-webmvc-4.0.5.RELEASE.jar differ diff --git a/libs/stax-api-1.0-2.jar b/libs/stax-api-1.0-2.jar new file mode 100644 index 00000000..015169dc Binary files /dev/null and b/libs/stax-api-1.0-2.jar differ diff --git a/libs/ueditor.jar b/libs/ueditor.jar new file mode 100644 index 00000000..e8a1d992 Binary files /dev/null and b/libs/ueditor.jar differ diff --git a/libs/xml-apis-1.0.b2.jar b/libs/xml-apis-1.0.b2.jar new file mode 100644 index 00000000..ad33a5af Binary files /dev/null and b/libs/xml-apis-1.0.b2.jar differ diff --git a/libs/xpp3-1.1.4c.jar b/libs/xpp3-1.1.4c.jar new file mode 100644 index 00000000..451ac82a Binary files /dev/null and b/libs/xpp3-1.1.4c.jar differ diff --git a/libs/xsdlib-2013.6.1.jar b/libs/xsdlib-2013.6.1.jar new file mode 100644 index 00000000..a3156d01 Binary files /dev/null and b/libs/xsdlib-2013.6.1.jar differ diff --git a/ms-rolling.log b/ms-rolling.log new file mode 100644 index 00000000..138b2523 --- /dev/null +++ b/ms-rolling.log @@ -0,0 +1,3 @@ +[2015-12-26 17:14:52,448] qtp1468696365-19 com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId DEBUG - <== Total: 0 +[2015-12-26 17:15:51,356] Thread-1 com.mingsoft.base.listener.StartUpListener DEBUG - -===== +[2015-12-26 17:15:51,365] Thread-1 com.alibaba.druid.pool.DruidDataSource INFO - {dataSource-1} closed diff --git a/ms-rolling.log.1 b/ms-rolling.log.1 new file mode 100644 index 00000000..11c34003 --- /dev/null +++ b/ms-rolling.log.1 @@ -0,0 +1,106 @@ +[2015-12-26 17:10:55,719] qtp500076814-20 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$e8e5a627.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$4a907b69.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.base.action.BaseAction.getTemplatePath(BaseAction.java:1056) + at com.mingsoft.cms.action.web.ErrorAction._500(ErrorAction.java:89) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) +[2015-12-26 17:10:56,309] Thread-1 com.mingsoft.base.listener.StartUpListener DEBUG - -===== +[2015-12-26 17:10:56,314] Thread-1 com.alibaba.druid.pool.DruidDataSource INFO - {dataSource-1} closed +[2015-12-26 17:14:37,025] main com.alibaba.druid.pool.DruidAbstractDataSource ERROR - maxIdle is deprecated +[2015-12-26 17:14:37,104] main com.alibaba.druid.pool.DruidDataSource INFO - {dataSource-1} inited +[2015-12-26 17:14:40,489] main com.mingsoft.base.listener.StartUpListener DEBUG - MS启动初始化开始 +[2015-12-26 17:14:40,494] main com.mingsoft.base.listener.StartUpListener DEBUG - MS启动初始化结束 +[2015-12-26 17:14:40,501] main com.mingsoft.basic.security.BaseAuthFilter DEBUG - Initializing filter 'baseAuthFilter' +[2015-12-26 17:14:40,520] main com.mingsoft.basic.security.BaseAuthFilter DEBUG - Filter 'baseAuthFilter' configured successfully +[2015-12-26 17:14:52,288] qtp1468696365-19 com.mingsoft.basic.dao.IAppDao.getByUrl DEBUG - ==> Preparing: select * from app where APP_URL like CONCAT('%',?,'%') limit 0,1 +[2015-12-26 17:14:52,379] qtp1468696365-19 com.mingsoft.basic.dao.IAppDao.getByUrl DEBUG - ==> Parameters: localhost:8080(String) +[2015-12-26 17:14:52,402] qtp1468696365-19 com.mingsoft.basic.dao.IAppDao.getByUrl DEBUG - <== Total: 1 +[2015-12-26 17:14:52,441] qtp1468696365-19 com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId DEBUG - ==> Preparing: select * from system_skin left join system_skin_manager on ss_id=ssm_system_skin_ID where ssm_managerID=? +[2015-12-26 17:14:52,444] qtp1468696365-19 com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId DEBUG - ==> Parameters: 50(Integer) diff --git a/ms-rolling.log.2 b/ms-rolling.log.2 new file mode 100644 index 00000000..352f216e --- /dev/null +++ b/ms-rolling.log.2 @@ -0,0 +1,186 @@ +[2015-12-26 17:10:54,952] qtp500076814-16 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$e8e5a627.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$4a907b69.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.base.action.BaseAction.getTemplatePath(BaseAction.java:1056) + at com.mingsoft.cms.action.web.ErrorAction._500(ErrorAction.java:89) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) +[2015-12-26 17:10:55,414] qtp500076814-19 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$e8e5a627.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$4a907b69.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.base.action.BaseAction.getTemplatePath(BaseAction.java:1056) + at com.mingsoft.cms.action.web.ErrorAction._500(ErrorAction.java:89) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) diff --git a/ms-rolling.log.3 b/ms-rolling.log.3 new file mode 100644 index 00000000..a6e50c0f --- /dev/null +++ b/ms-rolling.log.3 @@ -0,0 +1,193 @@ +[2015-12-26 17:10:08,301] qtp1843315060-16 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$c2f2f9e8.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$3c24aefc.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.base.action.BaseAction.getTemplatePath(BaseAction.java:1056) + at com.mingsoft.cms.action.web.ErrorAction._500(ErrorAction.java:89) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) +[2015-12-26 17:10:08,980] Thread-1 com.mingsoft.base.listener.StartUpListener DEBUG - -===== +[2015-12-26 17:10:08,987] Thread-1 com.alibaba.druid.pool.DruidDataSource INFO - {dataSource-1} closed +[2015-12-26 17:10:41,744] main com.alibaba.druid.pool.DruidAbstractDataSource ERROR - maxIdle is deprecated +[2015-12-26 17:10:41,818] main com.alibaba.druid.pool.DruidDataSource INFO - {dataSource-1} inited +[2015-12-26 17:10:44,671] main com.mingsoft.base.listener.StartUpListener DEBUG - MS启动初始化开始 +[2015-12-26 17:10:44,675] main com.mingsoft.base.listener.StartUpListener DEBUG - MS启动初始化结束 +[2015-12-26 17:10:44,683] main com.mingsoft.basic.security.BaseAuthFilter DEBUG - Initializing filter 'baseAuthFilter' +[2015-12-26 17:10:44,703] main com.mingsoft.basic.security.BaseAuthFilter DEBUG - Filter 'baseAuthFilter' configured successfully +[2015-12-26 17:10:54,430] qtp500076814-18 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$e8e5a627.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$4a907b69.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.basic.action.LoginAction.login(LoginAction.java:82) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) diff --git a/ms-rolling.log.4 b/ms-rolling.log.4 new file mode 100644 index 00000000..791a4520 --- /dev/null +++ b/ms-rolling.log.4 @@ -0,0 +1,186 @@ +[2015-12-26 17:10:07,465] qtp1843315060-18 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$c2f2f9e8.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$3c24aefc.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.base.action.BaseAction.getTemplatePath(BaseAction.java:1056) + at com.mingsoft.cms.action.web.ErrorAction._500(ErrorAction.java:89) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) +[2015-12-26 17:10:07,820] qtp1843315060-19 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$c2f2f9e8.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$3c24aefc.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.base.action.BaseAction.getTemplatePath(BaseAction.java:1056) + at com.mingsoft.cms.action.web.ErrorAction._500(ErrorAction.java:89) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) diff --git a/ms-rolling.log.5 b/ms-rolling.log.5 new file mode 100644 index 00000000..9a1a09e0 --- /dev/null +++ b/ms-rolling.log.5 @@ -0,0 +1,186 @@ +[2015-12-26 17:10:06,544] qtp1843315060-21 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$c2f2f9e8.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$3c24aefc.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.base.action.BaseAction.getTemplatePath(BaseAction.java:1056) + at com.mingsoft.cms.action.web.ErrorAction._500(ErrorAction.java:89) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) +[2015-12-26 17:10:07,136] qtp1843315060-17 WARN WARN - Handler execution resulted in exception +org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mingsoft.basic.dao.IAppDao.getByUrl + at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189) + at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43) + at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) + at com.sun.proxy.$Proxy42.getByUrl(Unknown Source) + at com.mingsoft.basic.biz.impl.AppBizImpl.getByUrl(AppBizImpl.java:53) + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$c2f2f9e8.getByUrl() + at com.mingsoft.basic.biz.impl.AppBizImpl$$FastClassBySpringCGLIB$$ac3288e3.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) + at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) + at com.mingsoft.basic.biz.impl.AppBizImpl$$EnhancerBySpringCGLIB$$3c24aefc.getByUrl() + at com.mingsoft.base.action.BaseAction.getApp(BaseAction.java:883) + at com.mingsoft.base.action.BaseAction.getTemplatePath(BaseAction.java:1056) + at com.mingsoft.cms.action.web.ErrorAction._500(ErrorAction.java:89) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) + at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) + at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) + at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) + at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) + at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) + at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) + at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) + at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1311) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) + at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) + at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067) + at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) + at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) + at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) + at org.eclipse.jetty.server.Server.handle(Server.java:360) + at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) + at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) + at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) + at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) + at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) + at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622) + at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) + at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) + at java.lang.Thread.run(Thread.java:745) diff --git a/ms.log b/ms.log new file mode 100644 index 00000000..fe505eeb --- /dev/null +++ b/ms.log @@ -0,0 +1,14 @@ +[framework] 2015-12-26 17:14:37,025 - com.alibaba.druid.pool.DruidAbstractDataSource -0 [main] ERROR com.alibaba.druid.pool.DruidAbstractDataSource - maxIdle is deprecated +[framework] 2015-12-26 17:14:37,104 - com.alibaba.druid.pool.DruidDataSource -79 [main] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited +[framework] 2015-12-26 17:14:40,489 - com.mingsoft.base.listener.StartUpListener -3464 [main] DEBUG com.mingsoft.base.listener.StartUpListener - MS启动初始化开始 +[framework] 2015-12-26 17:14:40,494 - com.mingsoft.base.listener.StartUpListener -3469 [main] DEBUG com.mingsoft.base.listener.StartUpListener - MS启动初始化结束 +[framework] 2015-12-26 17:14:40,501 - com.mingsoft.basic.security.BaseAuthFilter -3476 [main] DEBUG com.mingsoft.basic.security.BaseAuthFilter - Initializing filter 'baseAuthFilter' +[framework] 2015-12-26 17:14:40,520 - com.mingsoft.basic.security.BaseAuthFilter -3495 [main] DEBUG com.mingsoft.basic.security.BaseAuthFilter - Filter 'baseAuthFilter' configured successfully +[framework] 2015-12-26 17:14:52,288 - com.mingsoft.basic.dao.IAppDao.getByUrl -15263 [qtp1468696365-19] DEBUG com.mingsoft.basic.dao.IAppDao.getByUrl - ==> Preparing: select * from app where APP_URL like CONCAT('%',?,'%') limit 0,1 +[framework] 2015-12-26 17:14:52,379 - com.mingsoft.basic.dao.IAppDao.getByUrl -15354 [qtp1468696365-19] DEBUG com.mingsoft.basic.dao.IAppDao.getByUrl - ==> Parameters: localhost:8080(String) +[framework] 2015-12-26 17:14:52,402 - com.mingsoft.basic.dao.IAppDao.getByUrl -15377 [qtp1468696365-19] DEBUG com.mingsoft.basic.dao.IAppDao.getByUrl - <== Total: 1 +[framework] 2015-12-26 17:14:52,441 - com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId -15416 [qtp1468696365-19] DEBUG com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId - ==> Preparing: select * from system_skin left join system_skin_manager on ss_id=ssm_system_skin_ID where ssm_managerID=? +[framework] 2015-12-26 17:14:52,444 - com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId -15419 [qtp1468696365-19] DEBUG com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId - ==> Parameters: 50(Integer) +[framework] 2015-12-26 17:14:52,448 - com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId -15423 [qtp1468696365-19] DEBUG com.mingsoft.basic.dao.ISystemSkinDao.getByManagerId - <== Total: 0 +[framework] 2015-12-26 17:15:51,356 - com.mingsoft.base.listener.StartUpListener -74331 [Thread-1] DEBUG com.mingsoft.base.listener.StartUpListener - -===== +[framework] 2015-12-26 17:15:51,365 - com.alibaba.druid.pool.DruidDataSource -74340 [Thread-1] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} closed diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..e5da86f6 --- /dev/null +++ b/pom.xml @@ -0,0 +1,432 @@ + + 4.0.0 + com.mingsoft + mcms + war + 4.5.4 + 铭飞MCMS开源系统 + http://ms.ming-soft.com + + + + com.mingsoft + ms-proxy + 1.0.0 + system + ${project.basedir}/src/main/webapp/WEB-INF/lib/ms-proxy-1.0.0.jar + + + com.mingsoft + ms-upgrader + 1.0.0 + system + ${project.basedir}/src/main/webapp/WEB-INF/lib/ms-upgrader.jar + + + + com.baidu + ueditor + 1.4.3 + system + ${project.basedir}/src/main/webapp/WEB-INF/lib/ueditor.jar + + + com.baidu + ueditor + 1.4.3 + system + ${project.basedir}/src/main/webapp/WEB-INF/lib/sigar.jar + + + + net.gplatform + Sdk4J + 2.0 + + + + javax.xml.stream + stax-api + 1.0-2 + + + javax.xml.bind + jaxb-api + 2.2.12 + + + com.jolbox + bonecp + 0.7.1.RELEASE + + + javax.ws.rs + jsr311-api + 1.1.1 + + + jaxen + jaxen + 1.1.6 + + + net.java.dev.msv + xsdlib + 2013.6.1 + + + xpp3 + xpp3 + 1.1.4c + + + com.jhlabs + filters + 2.0.235 + + + + relaxngDatatype + relaxngDatatype + 20020414 + + + org.quartz-scheduler + quartz + 2.2.1 + + + c3p0 + c3p0 + + + + + pull-parser + pull-parser + 2 + + + com.google.protobuf + protobuf-java + 2.3.0 + + + com.mortennobel + java-image-scaling + 0.8.6 + + + com.google.guava + guava + 18.0 + + + javax.mail + mail + 1.4.5 + + + dom4j + dom4j + 1.6.1 + + + junit + junit + 4.11 + + + org.mybatis + mybatis + 3.2.6 + + + org.mybatis + mybatis-spring + 1.2.2 + + + org.springframework + spring-context + 4.0.5.RELEASE + + + commons-logging + commons-logging + + + + + org.springframework + spring-aspects + 4.0.5.RELEASE + + + org.springframework + spring-orm + 4.0.5.RELEASE + + + org.springframework + spring-context-support + 4.0.5.RELEASE + + + org.springframework + spring-web + 4.0.5.RELEASE + + + + + org.apache.shiro + shiro-core + 1.2.1 + + + org.apache.shiro + shiro-ehcache + 1.2.1 + + + org.apache.shiro + shiro-spring + 1.2.1 + + + org.apache.shiro + shiro-web + 1.2.1 + + + + + org.springframework + spring-webmvc + 4.0.5.RELEASE + + + mysql + mysql-connector-java + 5.1.31 + + + com.alibaba + druid + 1.0.6 + + + org.apache.httpcomponents + httpclient + 4.3.4 + + + commons-logging + commons-logging + + + commons-codec + commons-codec + + + + + org.springframework + spring-jdbc + 4.0.5.RELEASE + + + net.sourceforge.jexcelapi + jxl + 2.6.12 + + + org.freemarker + freemarker + 2.3.20 + + + org.aspectj + aspectjweaver + 1.8.1 + + + org.codehaus.jackson + jackson-mapper-asl + 1.9.13 + + + + commons-digester + commons-digester + 1.8 + + + commons-logging + commons-logging + + + + + commons-fileupload + commons-fileupload + 1.3.1 + + + commons-collections + commons-collections + 3.2 + + + org.apache.commons + commons-lang3 + 3.4 + + + commons-codec + commons-codec + 1.10 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + com.alibaba + fastjson + 1.2.6 + + + + com.google.zxing + javase + 3.1.0 + + + + com.google.zxing + core + 3.1.0 + + + + org.springframework + spring-test + 4.0.5.RELEASE + + + org.springframework.integration + spring-integration-mail + 4.0.4.RELEASE + + + org.springframework + spring-tx + 4.0.5.RELEASE + + + javax.servlet.jsp + jsp-api + 2.2.1-b03 + + + cglib + cglib + 3.1 + + + + org.slf4j + slf4j-api + 1.7.5 + + + org.slf4j + slf4j-log4j12 + 1.7.5 + runtime + + + + org.slf4j + jcl-over-slf4j + 1.7.5 + runtime + + + + org.slf4j + jul-to-slf4j + 1.7.5 + runtime + + + + log4j + log4j + 1.2.17 + + + + org.eclipse.jetty.orbit + javax.servlet.jsp.jstl + 1.2.0.v201105211821 + + + + + + mcms + + + src/main/java + + **/*.xml + **/*.properties + + + + src/main/resources + + **/*.xml + **/*.properties + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + UTF-8 + + + ${java.home}/lib/rt.jar:${java.home}/lib/jce.jar + + + + + + + org.mortbay.jetty + jetty-maven-plugin + 8.1.5.v20120716 + + 8888 + foo + 10 + + / + + + + + compile + + diff --git a/src/main/java/.DS_Store b/src/main/java/.DS_Store new file mode 100644 index 00000000..440c9540 Binary files /dev/null and b/src/main/java/.DS_Store differ diff --git a/src/main/java/com/jagregory/shiro/freemarker/AuthenticatedTag.java b/src/main/java/com/jagregory/shiro/freemarker/AuthenticatedTag.java new file mode 100644 index 00000000..9300ca41 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/AuthenticatedTag.java @@ -0,0 +1,44 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.core.Environment; +import freemarker.log.Logger; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; + +import java.io.IOException; +import java.util.Map; + + +/** + * JSP tag that renders the tag body only if the current user has executed a successful authentication attempt + * during their current session. + * + *

This is more restrictive than the {@link UserTag}, which only + * ensures the current user is known to the system, either via a current login or from Remember Me services, + * which only makes the assumption that the current user is who they say they are, and does not guarantee it like + * this tag does. + * + *

The logically opposite tag of this one is the {@link NotAuthenticatedTag} + * + *

Equivalent to {@link org.apache.shiro.web.tags.AuthenticatedTag}

+ * + * @since 0.2 + */ +public class AuthenticatedTag extends SecureTag { + private static final Logger log = Logger.getLogger("AuthenticatedTag"); + + @Override + public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException { + if (getSubject() != null && getSubject().isAuthenticated()) { + if (log.isDebugEnabled()) { + log.debug("Subject exists and is authenticated. Tag body will be evaluated."); + } + + renderBody(env, body); + } else { + if (log.isDebugEnabled()) { + log.debug("Subject does not exist or is not authenticated. Tag body will not be evaluated."); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/jagregory/shiro/freemarker/GuestTag.java b/src/main/java/com/jagregory/shiro/freemarker/GuestTag.java new file mode 100644 index 00000000..2ac4cde7 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/GuestTag.java @@ -0,0 +1,42 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.core.Environment; +import freemarker.log.Logger; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; + +import java.io.IOException; +import java.util.Map; + + +/** + * JSP tag that renders the tag body if the current user is not known to the system, either because they + * haven't logged in yet, or because they have no 'RememberMe' identity. + * + *

The logically opposite tag of this one is the {@link UserTag}. Please read that class's JavaDoc as it explains + * more about the differences between Authenticated/Unauthenticated and User/Guest semantic differences. + * + *

Equivalent to {@link org.apache.shiro.web.tags.GuestTag}

+ * + * @since 0.9 + */ +public class GuestTag extends SecureTag { + private static final Logger log = Logger.getLogger("AuthenticatedTag"); + + @Override + public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException { + if (getSubject() == null || getSubject().getPrincipal() == null) { + if (log.isDebugEnabled()) { + log.debug("Subject does not exist or does not have a known identity (aka 'principal'). " + + "Tag body will be evaluated."); + } + + renderBody(env, body); + } else { + if (log.isDebugEnabled()) { + log.debug("Subject exists or has a known identity (aka 'principal'). " + + "Tag body will not be evaluated."); + } + } + } +} diff --git a/src/main/java/com/jagregory/shiro/freemarker/HasAnyRolesTag.java b/src/main/java/com/jagregory/shiro/freemarker/HasAnyRolesTag.java new file mode 100644 index 00000000..9a80bc9a --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/HasAnyRolesTag.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.jagregory.shiro.freemarker; + +import org.apache.shiro.subject.Subject; + + +/** + * Displays body content if the current user has any of the roles specified. + * + *

Equivalent to {@link org.apache.shiro.web.tags.HasAnyRolesTag}

+ * + * @since 0.2 + */ +public class HasAnyRolesTag extends RoleTag { + // Delimeter that separates role names in tag attribute + private static final String ROLE_NAMES_DELIMETER = ","; + + protected boolean showTagBody(String roleNames) { + boolean hasAnyRole = false; + Subject subject = getSubject(); + + if (subject != null) { + // Iterate through roles and check to see if the user has one of the roles + for (String role : roleNames.split(ROLE_NAMES_DELIMETER)) { + if (subject.hasRole(role.trim())) { + hasAnyRole = true; + break; + } + } + } + + return hasAnyRole; + } +} \ No newline at end of file diff --git a/src/main/java/com/jagregory/shiro/freemarker/HasPermissionTag.java b/src/main/java/com/jagregory/shiro/freemarker/HasPermissionTag.java new file mode 100644 index 00000000..9d25515b --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/HasPermissionTag.java @@ -0,0 +1,12 @@ +package com.jagregory.shiro.freemarker; + +/** + *

Equivalent to {@link org.apache.shiro.web.tags.HasPermissionTag}

+ * + * @since 0.1 + */ +public class HasPermissionTag extends PermissionTag { + protected boolean showTagBody(String p) { + return isPermitted(p); + } +} diff --git a/src/main/java/com/jagregory/shiro/freemarker/HasRoleTag.java b/src/main/java/com/jagregory/shiro/freemarker/HasRoleTag.java new file mode 100644 index 00000000..806b2340 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/HasRoleTag.java @@ -0,0 +1,10 @@ +package com.jagregory.shiro.freemarker; + +/** + *

Equivalent to {@link org.apache.shiro.web.tags.HasRoleTag}

+ */ +public class HasRoleTag extends RoleTag { + protected boolean showTagBody(String roleName) { + return getSubject() != null && getSubject().hasRole(roleName); + } +} diff --git a/src/main/java/com/jagregory/shiro/freemarker/LacksPermissionTag.java b/src/main/java/com/jagregory/shiro/freemarker/LacksPermissionTag.java new file mode 100644 index 00000000..61481a81 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/LacksPermissionTag.java @@ -0,0 +1,10 @@ +package com.jagregory.shiro.freemarker; + +/** + *

Equivalent to {@link org.apache.shiro.web.tags.LacksPermissionTag}

+ */ +public class LacksPermissionTag extends PermissionTag { + protected boolean showTagBody(String p) { + return !isPermitted(p); + } +} diff --git a/src/main/java/com/jagregory/shiro/freemarker/LacksRoleTag.java b/src/main/java/com/jagregory/shiro/freemarker/LacksRoleTag.java new file mode 100644 index 00000000..62ae0d90 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/LacksRoleTag.java @@ -0,0 +1,11 @@ +package com.jagregory.shiro.freemarker; + +/** + *

Equivalent to {@link org.apache.shiro.web.tags.LacksRoleTag}

+ */ +public class LacksRoleTag extends RoleTag { + protected boolean showTagBody(String roleName) { + boolean hasRole = getSubject() != null && getSubject().hasRole(roleName); + return !hasRole; + } +} diff --git a/src/main/java/com/jagregory/shiro/freemarker/NotAuthenticatedTag.java b/src/main/java/com/jagregory/shiro/freemarker/NotAuthenticatedTag.java new file mode 100644 index 00000000..ddfd250f --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/NotAuthenticatedTag.java @@ -0,0 +1,32 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.core.Environment; +import freemarker.log.Logger; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; + +import java.io.IOException; +import java.util.Map; + + +/** + * Freemarker tag that renders the tag body only if the current user has not executed a successful authentication + * attempt during their current session. + * + *

The logically opposite tag of this one is the {@link org.apache.shiro.web.tags.AuthenticatedTag}. + * + *

Equivalent to {@link org.apache.shiro.web.tags.NotAuthenticatedTag}

+ */ +public class NotAuthenticatedTag extends SecureTag { + static final Logger log = Logger.getLogger("NotAuthenticatedTag"); + + @Override + public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException { + if (getSubject() == null || !getSubject().isAuthenticated()) { + log.debug("Subject does not exist or is not authenticated. Tag body will be evaluated."); + renderBody(env, body); + } else { + log.debug("Subject exists and is authenticated. Tag body will not be evaluated."); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/jagregory/shiro/freemarker/PermissionTag.java b/src/main/java/com/jagregory/shiro/freemarker/PermissionTag.java new file mode 100644 index 00000000..19963188 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/PermissionTag.java @@ -0,0 +1,42 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.core.Environment; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateModelException; +import java.io.IOException; +import java.util.Map; + +/** + *

Equivalent to {@link org.apache.shiro.web.tags.PermissionTag}

+ */ +public abstract class PermissionTag extends SecureTag { + String getName(Map params) { + return getParam(params, "name"); + } + + @Override + protected void verifyParameters(Map params) throws TemplateModelException { + String permission = getName(params); + + if (permission == null || permission.length() == 0) { + throw new TemplateModelException("The 'name' tag attribute must be set."); + } + } + + @Override + public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException { + String p = getName(params); + + boolean show = showTagBody(p); + if (show) { + renderBody(env, body); + } + } + + protected boolean isPermitted(String p) { + return getSubject() != null && getSubject().isPermitted(p); + } + + protected abstract boolean showTagBody(String p); +} diff --git a/src/main/java/com/jagregory/shiro/freemarker/PrincipalTag.java b/src/main/java/com/jagregory/shiro/freemarker/PrincipalTag.java new file mode 100644 index 00000000..e5238ba2 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/PrincipalTag.java @@ -0,0 +1,119 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.core.Environment; +import freemarker.log.Logger; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateModelException; + +import java.beans.BeanInfo; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.io.IOException; +import java.util.Map; + +/** + *

Tag used to print out the String value of a user's default principal, + * or a specific principal as specified by the tag's attributes.

+ * + *

If no attributes are specified, the tag prints out the toString() + * value of the user's default principal. If the type attribute + * is specified, the tag looks for a principal with the given type. If the + * property attribute is specified, the tag prints the string value of + * the specified property of the principal. If no principal is found or the user + * is not authenticated, the tag displays nothing unless a defaultValue + * is specified.

+ * + *

Equivalent to {@link org.apache.shiro.web.tags.PrincipalTag}

+ * + * @since 0.2 + */ +public class PrincipalTag extends SecureTag { + static final Logger log = Logger.getLogger("PrincipalTag"); + + /** + * The type of principal to be retrieved, or null if the default principal should be used. + */ + String getType(Map params) { + return getParam(params, "type"); + } + + /** + * The property name to retrieve of the principal, or null if the toString() value should be used. + */ + String getProperty(Map params) { + return getParam(params, "property"); + } + + @SuppressWarnings("unchecked") + @Override + public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException { + String result = null; + + if (getSubject() != null) { + // Get the principal to print out + Object principal; + + if (getType(params) == null) { + principal = getSubject().getPrincipal(); + } else { + principal = getPrincipalFromClassName(params); + } + + // Get the string value of the principal + if (principal != null) { + String property = getProperty(params); + + if (property == null) { + result = principal.toString(); + } else { + result = getPrincipalProperty(principal, property); + } + } + } + + // Print out the principal value if not null + if (result != null) { + try { + env.getOut().write(result); + } catch (IOException ex) { + throw new TemplateException("Error writing ["+result+"] to Freemarker.", ex, env); + } + } + } + + @SuppressWarnings("unchecked") + Object getPrincipalFromClassName(Map params) { + String type = getType(params); + + try { + Class cls = Class.forName(type); + + return getSubject().getPrincipals().oneByType(cls); + } catch (ClassNotFoundException ex) { + log.error("Unable to find class for name ["+type+"]", ex); + } + + return null; + } + + String getPrincipalProperty(Object principal, String property) throws TemplateModelException { + try { + BeanInfo beanInfo = Introspector.getBeanInfo(principal.getClass()); + + // Loop through the properties to get the string value of the specified property + for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) { + if (propertyDescriptor.getName().equals(property)) { + Object value = propertyDescriptor.getReadMethod().invoke(principal, (Object[]) null); + + return String.valueOf(value); + } + } + + // property not found, throw + throw new TemplateModelException("Property ["+property+"] not found in principal of type ["+principal.getClass().getName()+"]"); + } catch (Exception ex) { + throw new TemplateModelException("Error reading property ["+property+"] from principal of type ["+principal.getClass().getName()+"]", ex); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/jagregory/shiro/freemarker/RoleTag.java b/src/main/java/com/jagregory/shiro/freemarker/RoleTag.java new file mode 100644 index 00000000..bd1abfe3 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/RoleTag.java @@ -0,0 +1,26 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.core.Environment; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import java.io.IOException; +import java.util.Map; + +/** + *

Equivalent to {@link org.apache.shiro.web.tags.RoleTag}

+ */ +public abstract class RoleTag extends SecureTag { + String getName(Map params) { + return getParam(params, "name"); + } + + @Override + public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException { + boolean show = showTagBody(getName(params)); + if (show) { + renderBody(env, body); + } + } + + protected abstract boolean showTagBody(String roleName); +} \ No newline at end of file diff --git a/src/main/java/com/jagregory/shiro/freemarker/SecureTag.java b/src/main/java/com/jagregory/shiro/freemarker/SecureTag.java new file mode 100644 index 00000000..cac24532 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/SecureTag.java @@ -0,0 +1,43 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.core.Environment; +import freemarker.template.*; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; +import java.io.IOException; +import java.util.Map; + +/** + *

Equivalent to {@link org.apache.shiro.web.tags.SecureTag}

+ */ +public abstract class SecureTag implements TemplateDirectiveModel { + public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException { + verifyParameters(params); + render(env, params, body); + } + + public abstract void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException; + + protected String getParam(Map params, String name) { + Object value = params.get(name); + + if (value instanceof SimpleScalar) { + return ((SimpleScalar)value).getAsString(); + } + + return null; + } + + protected Subject getSubject() { + return SecurityUtils.getSubject(); + } + + protected void verifyParameters(Map params) throws TemplateModelException { + } + + protected void renderBody(Environment env, TemplateDirectiveBody body) throws IOException, TemplateException { + if (body != null) { + body.render(env.getOut()); + } + } +} diff --git a/src/main/java/com/jagregory/shiro/freemarker/ShiroTags.java b/src/main/java/com/jagregory/shiro/freemarker/ShiroTags.java new file mode 100644 index 00000000..07e22269 --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/ShiroTags.java @@ -0,0 +1,23 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.template.SimpleHash; + +/** + * Shortcut for injecting the tags into Freemarker + * + *

Usage: cfg.setSharedVeriable("shiro", new ShiroTags());

+ */ +public class ShiroTags extends SimpleHash { + public ShiroTags() { + put("authenticated", new AuthenticatedTag()); + put("guest", new GuestTag()); + put("hasAnyRoles", new HasAnyRolesTag()); + put("hasPermission", new HasPermissionTag()); + put("hasRole", new HasRoleTag()); + put("lacksPermission", new LacksPermissionTag()); + put("lacksRole", new LacksRoleTag()); + put("notAuthenticated", new NotAuthenticatedTag()); + put("principal", new PrincipalTag()); + put("user", new UserTag()); + } +} \ No newline at end of file diff --git a/src/main/java/com/jagregory/shiro/freemarker/UserTag.java b/src/main/java/com/jagregory/shiro/freemarker/UserTag.java new file mode 100644 index 00000000..229d2d9a --- /dev/null +++ b/src/main/java/com/jagregory/shiro/freemarker/UserTag.java @@ -0,0 +1,37 @@ +package com.jagregory.shiro.freemarker; + +import freemarker.core.Environment; +import freemarker.log.Logger; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; + +import java.io.IOException; +import java.util.Map; + +/** + * Freemarker tag that renders the tag body if the current user known to the system, either from a successful login attempt + * (not necessarily during the current session) or from 'RememberMe' services. + * + *

Note: This is less restrictive than the AuthenticatedTag since it only assumes + * the user is who they say they are, either via a current session login or via Remember Me services, which + * makes no guarantee the user is who they say they are. The AuthenticatedTag however + * guarantees that the current user has logged in during their current session, proving they really are + * who they say they are. + * + *

The logically opposite tag of this one is the {@link org.apache.shiro.web.tags.GuestTag}. + * + *

Equivalent to {@link org.apache.shiro.web.tags.UserTag}

+ */ +public class UserTag extends SecureTag { + static final Logger log = Logger.getLogger("UserTag"); + + @Override + public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException { + if (getSubject() != null && getSubject().getPrincipal() != null) { + log.debug("Subject has known identity (aka 'principal'). Tag body will be evaluated."); + renderBody(env, body); + } else { + log.debug("Subject does not exist or have a known identity (aka 'principal'). Tag body will not be evaluated."); + } + } +} diff --git a/src/main/java/com/mingsoft/base/action/BaseAction.java b/src/main/java/com/mingsoft/base/action/BaseAction.java new file mode 100644 index 00000000..a0890633 --- /dev/null +++ b/src/main/java/com/mingsoft/base/action/BaseAction.java @@ -0,0 +1,1222 @@ +package com.mingsoft.base.action; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.LineNumberReader; +import java.io.PrintWriter; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import javax.servlet.ServletContext; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.log4j.Logger; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.context.support.WebApplicationContextUtils; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.constant.e.BaseEnum; +import com.mingsoft.base.entity.ResultJson; +import com.mingsoft.base.entity.SessionEntity; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.ModelEntity; +import com.mingsoft.basic.entity.ModelTemplateEntity; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.parser.IGeneralParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.AESUtil; +import com.mingsoft.util.Base64Util; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.StringUtil; + +/** + * 基础控制类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@SuppressWarnings({ "rawtypes", "unchecked" }) +public abstract class BaseAction { + + /* + * log4j日志记录 + */ + protected final Logger LOG = Logger.getLogger(this.getClass()); + + /** + * 默认页码参数 + */ + private final String PAGE_NO = "pageNo"; + + /** Wap网关Via头信息中特有的描述信息 */ + private static String mobileGateWayHeaders[] = new String[] { "ZXWAP",// 中兴提供的wap网关的via信息,例如:Via=ZXWAP + // GateWayZTE + // Technologies, + "chinamobile.com",// 中国移动的诺基亚wap网关,例如:Via=WTP/1.1 + // GDSZ-PB-GW003-WAP07.gd.chinamobile.com (Nokia + // WAP Gateway 4.1 CD1/ECD13_D/4.1.04) + "monternet.com",// 移动梦网的网关,例如:Via=WTP/1.1 + // BJBJ-PS-WAP1-GW08.bj1.monternet.com. (Nokia WAP + // Gateway 4.1 CD1/ECD13_E/4.1.05) + "infoX",// 华为提供的wap网关,例如:Via=HTTP/1.1 GDGZ-PS-GW011-WAP2 (infoX-WISG + // Huawei Technologies),或Via=infoX WAP Gateway V300R001 + // Huawei Technologies + "XMS 724Solutions HTG",// 国外电信运营商的wap网关,不知道是哪一家 + "wap.lizongbo.com",// 自己测试时模拟的头信息 + "Bytemobile",// 貌似是一个给移动互联网提供解决方案提高网络运行效率的,例如:Via=1.1 Bytemobile OSN + // WebProxy/5.1 + }; + /** 电脑上的IE或Firefox浏览器等的User-Agent关键词 */ + private static String[] pcHeaders = new String[] { "Windows 98", "Windows ME", "Windows 2000", "Windows XP", "Windows NT", "Ubuntu" }; + /** 手机浏览器的User-Agent里的关键词 */ + private static String[] mobileUserAgents = new String[] { "Nokia",// 诺基亚,有山寨机也写这个的,总还算是手机,Mozilla/5.0 + // (Nokia5800 + // XpressMusic)UC + // AppleWebkit(like + // Gecko) + // Safari/530 + "SAMSUNG",// 三星手机 + // SAMSUNG-GT-B7722/1.0+SHP/VPP/R5+Dolfin/1.5+Nextreaming+SMM-MMS/1.2.0+profile/MIDP-2.1+configuration/CLDC-1.1 + "MIDP-2",// j2me2.0,Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2 + // NokiaE75-1 /110.48.125 Profile/MIDP-2.1 + // Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML like + // Gecko) Safari/413 + "CLDC1.1",// M600/MIDP2.0/CLDC1.1/Screen-240X320 + "SymbianOS",// 塞班系统的, + "MAUI",// MTK山寨机默认ua + "UNTRUSTED/1.0",// 疑似山寨机的ua,基本可以确定还是手机 + "Windows CE",// Windows CE,Mozilla/4.0 (compatible; MSIE 6.0; + // Windows CE; IEMobile 7.11) + "iPhone",// iPhone是否也转wap?不管它,先区分出来再说。Mozilla/5.0 (iPhone; U; CPU + // iPhone OS 4_1 like Mac OS X; zh-cn) AppleWebKit/532.9 + // (KHTML like Gecko) Mobile/8B117 + "iPad",// iPad的ua,Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; + // zh-cn) AppleWebKit/531.21.10 (KHTML like Gecko) + // Version/4.0.4 Mobile/7B367 Safari/531.21.10 + "Android",// Android是否也转wap?Mozilla/5.0 (Linux; U; Android + // 2.1-update1; zh-cn; XT800 Build/TITA_M2_16.22.7) + // AppleWebKit/530.17 (KHTML like Gecko) Version/4.0 + // Mobile Safari/530.17 + "BlackBerry",// BlackBerry8310/2.7.0.106-4.5.0.182 + "UCWEB",// ucweb是否只给wap页面? Nokia5800 + // XpressMusic/UCWEB7.5.0.66/50/999 + "ucweb",// 小写的ucweb貌似是uc的代理服务器Mozilla/6.0 (compatible; MSIE 6.0;) + // Opera ucweb-squid + "BREW",// 很奇怪的ua,例如:REW-Applet/0x20068888 (BREW/3.1.5.20; DeviceId: + // 40105; Lang: zhcn) ucweb-squid + "J2ME",// 很奇怪的ua,只有J2ME四个字母 + "YULONG",// 宇龙手机,YULONG-CoolpadN68/10.14 IPANEL/2.0 CTC/1.0 + "YuLong",// 还是宇龙 + "COOLPAD",// 宇龙酷派YL-COOLPADS100/08.10.S100 POLARIS/2.9 CTC/1.0 + "TIANYU",// 天语手机TIANYU-KTOUCH/V209/MIDP2.0/CLDC1.1/Screen-240X320 + "TY-",// 天语,TY-F6229/701116_6215_V0230 JUPITOR/2.2 CTC/1.0 + "K-Touch",// 还是天语K-Touch_N2200_CMCC/TBG110022_1223_V0801 MTK/6223 + // Release/30.07.2008 Browser/WAP2.0 + "Haier",// 海尔手机,Haier-HG-M217_CMCC/3.0 Release/12.1.2007 + // Browser/WAP2.0 + "DOPOD",// 多普达手机 + "Lenovo",// 联想手机,Lenovo-P650WG/S100 LMP/LML Release/2010.02.22 + // Profile/MIDP2.0 Configuration/CLDC1.1 + "LENOVO",// 联想手机,比如:LENOVO-P780/176A + "HUAQIN",// 华勤手机 + "AIGO-",// 爱国者居然也出过手机,AIGO-800C/2.04 TMSS-BROWSER/1.0.0 CTC/1.0 + "CTC/1.0",// 含义不明 + "CTC/2.0",// 含义不明 + "CMCC",// 移动定制手机,K-Touch_N2200_CMCC/TBG110022_1223_V0801 MTK/6223 + // Release/30.07.2008 Browser/WAP2.0 + "DAXIAN",// 大显手机DAXIAN X180 UP.Browser/6.2.3.2(GUI) MMP/2.0 + "MOT-",// 摩托罗拉,MOT-MOTOROKRE6/1.0 LinuxOS/2.4.20 Release/8.4.2006 + // Browser/Opera8.00 Profile/MIDP2.0 Configuration/CLDC1.1 + // Software/R533_G_11.10.54R + "SonyEricsson",// 索爱手机,SonyEricssonP990i/R100 Mozilla/4.0 + // (compatible; MSIE 6.0; Symbian OS; 405) Opera + // 8.65 [zh-CN] + "GIONEE",// 金立手机 + "HTC",// HTC手机 + "ZTE",// 中兴手机,ZTE-A211/P109A2V1.0.0/WAP2.0 Profile + "HUAWEI",// 华为手机, + "webOS",// palm手机,Mozilla/5.0 (webOS/1.4.5; U; zh-CN) + // AppleWebKit/532.2 (KHTML like Gecko) Version/1.0 + // Safari/532.2 Pre/1.0 + "GoBrowser",// 3g GoBrowser.User-Agent=Nokia5230/GoBrowser/2.0.290 + // Safari + "IEMobile",// Windows CE手机自带浏览器, + "WAP2.0"// 支持wap 2.0的 + }; + + /** + * 获取当前页码,默认参数名称pageNo + * + * @param request HttpServletRequest对象 + * @return 默认1,如果存在pageNo参数就返回相应的值 + */ + protected Integer getPageNo(HttpServletRequest request) { + return this.getInt(request, PAGE_NO, 1); + } + + /** + * 获取整型值 + * + * @param request HttpServletRequest对象 + * @param param 参数名称 + * @return 返回整型值,没找到返回null + */ + protected Integer getInt(HttpServletRequest request, String param) { + String value = request.getParameter(param); + if (StringUtil.isInteger(value)) { + return Integer.parseInt(value); + } else { + return null; + } + } + + /** + * 获取整型值 + * + * @param request HttpServletRequest对象 + * @param param + * 参数名称 + * @param def + * 默认值,如果参数不存在或不符合规则就用默认值替代 + * @return 返回整型值 + */ + protected Integer getInt(HttpServletRequest request, String param, int def) { + String value = request.getParameter(param); + if (StringUtil.isInteger(value)) { + return Integer.parseInt(value); + } else { + return def; + } + } + + /** + * 获取base64机密的整型值 + * + * @param request HttpServletRequest对象 + * @param param + * 参数名称 + * @return 返回base64的整型值,没找到返回null + */ + protected Integer getIntBase64(HttpServletRequest request, String param) { + String value = request.getParameter(param); + if (StringUtil.isInteger(value)) { + return Integer.parseInt(new String(Base64Util.decode(value))); + } else { + return null; + } + } + + /** + * 获取布尔值 + * + * @param request HttpServletRequest对象 + * @param param + * 参数名称 + * @return 返回布尔值,没找到返回null + */ + protected Boolean getBoolean(HttpServletRequest request, String param) { + String value = request.getParameter(param); + try { + return Boolean.parseBoolean(value); + } catch (Exception e) { + return false; + } + } + + /** + * 获取session的值 + * + * @param request HttpServletRequest对象 + * @param key + * 枚举类中的值 + * @return session中获取的对象 + */ + protected Object getSession(HttpServletRequest request, SessionConst key) { + return request.getSession().getAttribute(key.toString()); + } + + /** + * 设置session的值 + * @param request HttpServletRequest对象 + * @param key + * 枚举类中的值 + */ + protected void setSession(HttpServletRequest request, SessionConst key, Object value) { + request.getSession().setAttribute(key.toString(), value); + } + + /** + * 移除session的值 + * @param request HttpServletRequest对象 + * @param key + * 枚举类中的值 + */ + protected void removeSession(HttpServletRequest request, SessionConst key) { + request.getSession().removeAttribute(key.toString()); + } + + /** + * 获取Cookie的值 + * @param request HttpServletRequest对象 + * @param key + * 枚举类中的值 + * @return Cookie中获取的对象 + */ + protected String getCookie(HttpServletRequest request, CookieConst key) { + if (request.getCookies() != null) { + for (Cookie c : request.getCookies()) { + if (c.getName().equals(key.name())) { + return c.getValue(); + } + } + } + return null; + } + + /** + * 设置Cookie值 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse对象 + * @param key + * 枚举类中的值 + * @param value + * 存储对象 + */ + protected void setCookie(HttpServletRequest request, HttpServletResponse response, CookieConst key, Object value) { + request.getSession().setAttribute(key.toString(), value); + Cookie cookie = new Cookie(key.name(), (String) value); + cookie.setPath("/"); + cookie.setValue((String) value); + response.addCookie(cookie); + } + + /** + * 设置Cookie值 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse对象 + * @param key + * 枚举类中的值 + * @param value + * 存储对象 + * @param maxAge + * cookie生命周期 以秒为单位 + */ + protected void setCookie(HttpServletRequest request, HttpServletResponse response, CookieConst key, Object value, int maxAge) { + request.getSession().setAttribute(key.toString(), value); + Cookie cookie = new Cookie(key.name(), value.toString()); + cookie.setPath("/"); + cookie.setValue(value.toString()); + cookie.setMaxAge(maxAge); + response.addCookie(cookie); + } + + /** + * 输出json数据 + * @param response HttpServletResponse对象 + * @param code + * 模块编号
+ * @param flag + * 成功状态,true:成功、false:失败 + * @param msg + * 提示信息 + */ + protected void outJson(HttpServletResponse response, BaseEnum code, boolean flag, String msg) { + try { + ResultJson result = new ResultJson(); + if (code != null) { + result.setCode(code.toString()); + } + result.setResult(flag); + result.setResultMsg(msg); + response.setCharacterEncoding("utf-8"); + PrintWriter out = response.getWriter(); + out.print(JSONObject.toJSON(result)); + LOG.debug(JSONObject.toJSON(result)); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + LOG.error(e); + } + } + + /** + * 输出json数据 + * @param response HttpServletResponse对象 + * @param code + * 模块编号
+ * @param flag + * 成功状态,true:成功、false:失败 + */ + protected void outJson(HttpServletResponse response, BaseEnum code, boolean flag) { + try { + ResultJson result = new ResultJson(); + if (code != null) { + result.setCode(code.toString()); + } + result.setResult(flag); + response.setCharacterEncoding("utf-8"); + PrintWriter out = response.getWriter(); + out.print(JSONObject.toJSON(result)); + LOG.debug(JSONObject.toJSON(result)); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + LOG.error(e); + } + } + + /** + * 输出json数据 + * @param response HttpServletResponse对象 + * @param code + * 模块编号
+ * @param flag + * 成功状态,true:成功、false:失败 + * @param msg + * 提示信息 + * @param data + * 数据 + */ + protected void outJson(HttpServletResponse response, BaseEnum code, boolean flag, String msg, String data) { + try { + ResultJson result = new ResultJson(); + if (code != null) { + result.setCode(code.toString()); + } + result.setResult(flag); + result.setResultMsg(msg); + result.setResultData(data); + response.setCharacterEncoding("utf-8"); + PrintWriter out = response.getWriter(); + out.print(JSONObject.toJSON(result)); + LOG.debug(JSONObject.toJSON(result)); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + LOG.error(e); + } + } + + /** + * 输出json数据字符串 + * @param response HttpServletResponse对象 + * @param jsonDataStr + * 字符串 + */ + protected void outJson(HttpServletResponse response, Object jsonDataStr) { + try { + response.setContentType("application/json;charset=utf-8"); + PrintWriter out = response.getWriter(); + out.print(jsonDataStr); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + LOG.error(e); + } + } + + /** + * 输出String数据字符串 + * @param response HttpServletResponse对象 + * @param dataStr + * 字符串 + */ + protected void outString(HttpServletResponse response, Object dataStr) { + try { + response.setContentType("text/html;charset=utf-8"); + PrintWriter out = response.getWriter(); + out.print(dataStr); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + LOG.error(e); + } + } + + /** + * 获取项目路径 + * @param request HttpServletRequest对象 + * @return 返回项目路径,例如:http://www.ip.com/projectName 后面没有反斜杠,后面接地址或参数必须加/ + */ + protected String getUrl(HttpServletRequest request) { + String path = request.getContextPath(); + String basePath = request.getScheme() + "://" + request.getServerName(); + if (request.getServerPort() == 80) { + basePath += path; + } else { + basePath += ":" + request.getServerPort() + path; + } + return basePath + "/"; + } + + /** + * 获取请求域名,域名不包括http请求协议头 + * + * @param request HttpServletRequest对象 + * @return 返回域名地址 + */ + protected String getDomain(HttpServletRequest request) { + String path = request.getContextPath(); + String domain = request.getServerName(); + if (request.getServerPort() == 80) { + domain += path; + } else { + domain += ":" + request.getServerPort() + path; + } + return domain; + } + + /** + * 读取服务器主机信息 + * + * @param request HttpServletRequest对象 + * @return 返回主机信息 + */ + protected String getHost(HttpServletRequest request) { + String basePath = request.getServerName(); + if (request.getServerPort() != 80) { + basePath += ":" + request.getServerPort(); + } + return basePath; + } + + /** + * 读取服务器主机ip信息 + * @return 返回主机IP,异常将会获取不到ip + */ + protected String getHostIp() { + InetAddress addr; + try { + addr = InetAddress.getLocalHost(); + return addr.getHostAddress().toString();// 获得本机IP + } catch (UnknownHostException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return ""; + } + + /** + * 读取国际化资源文件 + * + * @param key 键值 + * @return 返回获取到的字符串 + */ + protected String getResString(String key) { + return Const.RESOURCES.getString(key); + } + + /** + * 读取国际化资源文件,优先模块对应的资源文件,如果模块资源文件找不到就会优先基础层 + * + * @param key 键值 + * @param rb 模块对应资源文件 + * @return 返回获取到的字符串 + */ + protected String getResString(String key, ResourceBundle rb) { + try { + return rb.getString(key); + } catch (MissingResourceException e) { + return Const.RESOURCES.getString(key); + } + } + + /** + * 读取国际化资源文件 + * + * @param key + * 键值 + * @param fullStrs + * 需填充的值 + * @return 返回获取到的字符串 + */ + protected String getResString(String key, String... fullStrs) { + String temp = Const.RESOURCES.getString(key); + for (int i = 0; i < fullStrs.length; i++) { + temp = temp.replace("{" + i + "}", fullStrs[i]); + } + return temp; + } + + /** + * 读取国际化资源文件,优先模块对应的资源文件,如果模块资源文件找不到就会优先基础层 + * + * @param key 键值 + * @param rb + * 模块对应资源文件 + * @return 返回获取到的字符串 + */ + protected String getResString(String key, ResourceBundle rb, String... fullStrs) { + String temp = ""; + try { + temp = rb.getString(key); + } catch (MissingResourceException e) { + temp = Const.RESOURCES.getString(key); + ; + } + for (int i = 0; i < fullStrs.length; i++) { + temp = temp.replace("{" + i + "}", fullStrs[i]); + } + return temp; + } + + /** + * 通过spring的webapplicationcontext上下文对象读取bean对象 + * + * @param sc + * 上下文servletConext对象 + * @param beanName + * 要读取的bean的名称 + * @return 返回获取到的对象。获取不到返回null + */ + protected Object getBean(ServletContext sc, String beanName) { + return WebApplicationContextUtils.getWebApplicationContext(sc).getBean(beanName); + } + + /** + * 通过spring的webapplicationcontext上下文对象读取bean对象 + * @param beanName + * 要读取的bean的名称 + * @return 返回获取到的对象。获取不到返回nul + */ + protected Object getBean(String beanName) { + return com.mingsoft.base.constant.Const.CONTEXT.getBean(beanName); + } + + /** + * 返回重定向 + * + * @param request HttpServletRequest对象 + * @param flag + * true:提供给springMVC返回,false:只是获取地址 + * @return 返回重定向后的地址 + */ + protected String redirectBack(HttpServletRequest request, boolean flag) { + if (flag) { + return "redirect:" + this.getCookie(request, CookieConst.BACK_COOKIE); + } else { + return this.getCookie(request, CookieConst.BACK_COOKIE); + } + + } + + /** + * 根据当前请求的特征,判断该请求是否来自手机终端,主要检测特殊的头信息,以及user-Agent这个header + * + * @param request HttpServletRequest对象,http请求 + * @return 如果命中手机特征规则,则返回对应的特征字符串 + */ + public boolean isMobileDevice(HttpServletRequest request) { + boolean b = false; + boolean pcFlag = false; + boolean mobileFlag = false; + String via = request.getHeader("Via"); + String userAgent = request.getHeader("user-agent"); + for (int i = 0; via != null && !via.trim().equals("") && i < mobileGateWayHeaders.length; i++) { + if (via.contains(mobileGateWayHeaders[i])) { + mobileFlag = true; + break; + } + } + for (int i = 0; !mobileFlag && userAgent != null && !userAgent.trim().equals("") && i < mobileUserAgents.length; i++) { + if (userAgent.contains(mobileUserAgents[i])) { + mobileFlag = true; + break; + } + } + for (int i = 0; userAgent != null && !userAgent.trim().equals("") && i < pcHeaders.length; i++) { + if (userAgent.contains(pcHeaders[i])) { + pcFlag = true; + break; + } + } + if (mobileFlag == true && pcFlag == false) { + b = true; + } + return b;// false pc true shouji + + } + + /** + * 读取用户sessoin + * @param request HttpServletRequest对象 + * @return 返回获取到的用户session,获取不到返回nul + */ + protected SessionEntity getPeopleBySession(HttpServletRequest request) { + // 传入用户请求,读取用户的session || super,调用父类的protected属性的getSession方法 + Object obj = this.getSession(request, SessionConst.PEOPLE_SESSION); + if (obj != null) { + // 返回用户的所有信息 + return (SessionEntity) obj; + } + return null; + } + + /** + * 读取管理员session + * @param request HttpServletRequest对象 + * @return 返回管理员session,获取不到就返回null + */ + protected SessionEntity getManagerBySession(HttpServletRequest request) { + // 传入用管理员请求,读取管理员的session || super,调用父类的protected属性的getSession方法 + Object obj = this.getSession(request, SessionConst.MANAGER_ESSION); + if (obj != null) { + // 返回管理员的所有信息 + return (SessionEntity) obj; + } + return null; + } + + /** + * 读取管理员session + * @param request HttpServletRequest对象 + * @return 返回管理员session,获取不到就返回null + */ + protected String getCodeBySession(HttpServletRequest request) { + // 传入用管理员请求,读取管理员的session || super,调用父类的protected属性的getSession方法 + Object obj = this.getSession(request, SessionConst.CODE_SESSION); + if (obj != null) { + // 返回管理员的所有信息 + return (String) obj; + } + return null; + } + + /** + * 根据属性配置文件返回map + * + * @return 返回Map + */ + protected Map getMapByProperties(String filePath) { + if (StringUtil.isBlank(filePath)) { + return null; + } + ResourceBundle rb = ResourceBundle.getBundle(filePath); + Map map = new HashMap(); + Enumeration en = rb.getKeys(); + while (en.hasMoreElements()) { + String key = en.nextElement(); + map.put(key, rb.getString(key)); + } + return map; + } + + + /** + * 获取当期项目物理路径 + * + * @param request HttpServletRequest对象 + * @param filePath + *  相对路径文件夹 + * @return 返回当期项目物理路径 + */ + protected String getRealPath(HttpServletRequest request, String filePath) { + return request.getServletContext().getRealPath("/") + File.separator + filePath; + } + + /** + * 获取当前模块编号 + * + * @param request HttpServletRequest对象 + * @return 返回当前模块编号,没找到返回0 + */ + protected int getModelCodeId(HttpServletRequest request) { + Object obj = this.getSession(request, SessionConst.MODEL_ID_SESSION); + if (obj != null) { + return Integer.parseInt(obj.toString()); + } + return 0; + } + + /** + * 根据当前模块编码父模块编号 + * + * @param request HttpServletRequest对象 + * @return 返回模块编号,如果没有返回0 + */ + protected int getRootModelCodeId(HttpServletRequest request) { + Object obj = this.getSession(request, SessionConst.MODEL_ID_SESSION); + if (StringUtil.isInteger(obj)) { + com.mingsoft.basic.biz.IModelBiz modelBiz = (com.mingsoft.basic.biz.IModelBiz) getBean(request.getServletContext(), "modelBiz"); + ModelEntity model = (ModelEntity) modelBiz.getEntity(Integer.parseInt(obj.toString())); + return model.getModelModelId(); + } else { + return 0; + } + } + + /** + * 根据模块编码获得模块编号 + * + * @param request HttpServletRequest对象 + * @param code + * 编码 + * @return 返回模块编号,如果没有返回0 + */ + protected int getModelCodeId(HttpServletRequest request, BaseEnum code) { + com.mingsoft.basic.biz.IModelBiz modelBiz = (com.mingsoft.basic.biz.IModelBiz) getBean(request.getServletContext(), "modelBiz"); + ModelEntity model = modelBiz.getEntityByModelCode(code); + if (model != null) { + return model.getModelId(); + } + return 0; + } + + + /** + * 根据模块编码获得模块编号 + * + * @param request HttpServletRequest对象 + * @param code + * 编码 + * @return 返回模块编号,如果没有返回0 + * @deprecated 推荐使用加密过的模块编码获取模块编号,如getModelCodeIdForAES + */ + protected int getModelCodeId(HttpServletRequest request,String code) { + com.mingsoft.basic.biz.IModelBiz modelBiz = (com.mingsoft.basic.biz.IModelBiz) getBean(request.getServletContext(), "modelBiz"); + ModelEntity model = modelBiz.getEntityByModelCode(code); + if (model != null) { + return model.getModelId(); + } + return 0; + } + + /** + * 根据加密过的模块编码获得模块编号 + * + * @param request HttpServletRequest对象 + * @param code + * 编码 + * @return 返回模块编号,如果没有返回0 + */ + protected int getModelCodeIdForAES(HttpServletRequest request,String code) { + com.mingsoft.basic.biz.IModelBiz modelBiz = (com.mingsoft.basic.biz.IModelBiz) getBean(request.getServletContext(), "modelBiz"); + ModelEntity model = modelBiz.getEntityByModelCode(this.decryptByAES(request, code)); + + if (model != null) { + return model.getModelId(); + } + return 0; + } + + /** + * 根据cookie获取历史页码 + * + * @param request HttpServletRequest对象 + * @return 返回历史页码,没找到返回0 + */ + protected int getHistoryPageNoByCookie(HttpServletRequest request) { + if (Integer.valueOf(this.getCookie(request, CookieConst.PAGENO_COOKIE)) >= 1) { + return Integer.valueOf(this.getCookie(request, CookieConst.PAGENO_COOKIE)); + } + return 0; + } + + /** + * 根据地址来查询对应的站点信息,依赖于websiteBiz + * + * @param request HttpServletRequest对象 + * @param websiteBiz 站点业务 + * @return 返回站点实体 + */ + protected AppEntity getAppIdByUrl(HttpServletRequest request, IAppBiz websiteBiz) { + String contentPath = request.getContextPath(); // 项目名称 + StringBuffer url = request.getRequestURL(); // 完整请求地址 + String websiteUrl = url.substring(0, url.indexOf("/")); + if (!StringUtil.isBlank(contentPath)) { + websiteUrl = url.substring(0, url.indexOf("/")) + "/" + contentPath; + } + // 查询数据库获取域名对应Id + AppEntity website = websiteBiz.getByUrl(websiteUrl); + if (website != null) { + return website; + } + return null; + } + + /** + * 获取当前模块对应的appid , appid主要根据用户的请求地址获得 + * + * @param request HttpServletRequest对象 + * @return 返回appId,找不到对应app,返回0 + */ + protected int getAppId(HttpServletRequest request) { + + // 获取用户所请求的域名地址 + IAppBiz websiteBiz = (IAppBiz) getBean(request.getServletContext(), "appBiz"); + AppEntity website = websiteBiz.getByUrl(this.getDomain(request)); + if (website == null) { + return 0; + } + return website.getAppId(); + } + + /** + * 获取当前模块对应的appid , appid主要根据用户的请求地址获得 + * + * @param request HttpServletRequest对象 + * @return 返回appId,找不到对应app,返回0 + */ + protected AppEntity getApp(HttpServletRequest request) { + AppEntity app = new AppEntity(); + // 获取用户所请求的域名地址 + IAppBiz appBiz = (IAppBiz) getBean(request.getServletContext(), "appBiz"); + AppEntity website = appBiz.getByUrl(this.getDomain(request)); + if (website == null) { + return null; + } + BeanUtils.copyProperties(website, app); + return app; + } + + /** + * 获取验证码 + * + * @param request HttpServletRequest对象 + * @return 返回验证码,获取不到返回null + */ + protected String getRandCode(HttpServletRequest request) { + return this.getSession(request, SessionConst.CODE_SESSION) + ""; + } + + /** + * 获取应用信息 + * + * @param host + *  主机地址 + * @param request HttpServletRequest对象 + * @return 返回应用实体 + */ + protected AppEntity getApp(String host, HttpServletRequest request) { + AppEntity app = new AppEntity(); + // 获取用户所请求的域名地址 + IAppBiz appBiz = (IAppBiz) getBean(request.getServletContext(), "appBiz"); + AppEntity website = appBiz.getByUrl(this.getDomain(request)); + if (website == null) { + return null; + } + BeanUtils.copyProperties(website, app); + return app; + } + + + /** + * 动态生成页面,根据model_template表 + * + * @param key 对应表中的key值 + * @param req HttpServletRequest对象 + * @return 如果没有读到模版返回的是null,没读到的情况有两种原因一种是找不到相应的应用,一种是模版文件不存在 + */ + protected String generaterPage(String key, IGeneralParser parser, HttpServletRequest req) { + AppEntity app = this.getApp(req); + if (app == null) { + return null; + } + + com.mingsoft.basic.biz.IModelTemplateBiz modelTemplateBiz = (com.mingsoft.basic.biz.IModelTemplateBiz) getBean(req.getServletContext(), "modelTemplateBiz"); + ModelTemplateEntity mte = modelTemplateBiz.getEntity(app.getAppId(), key); + if (mte == null) { + return null; + } + String templatePath = mte.getModelTemplatePath(); + String path = getRealPath(req, IParserRegexConstant.REGEX_SAVE_TEMPLATE) + File.separator + app.getAppId() + File.separator + app.getAppStyle() + File.separator; + String content = ""; + if (isMobileDevice(req) && !StringUtil.isBlank(app.getAppMobileStyle())) { // 移动端 + String htmlContent = FileUtil.readFile(path + app.getAppMobileStyle() + File.separator + templatePath); // 读取模版文件内容 + Map map = new HashMap(); + map.put(IGeneralParser.MOBILE, app.getAppMobileStyle()); + content = parser.parse(htmlContent, app, map); + } else { + String htmlContent = FileUtil.readFile(path + templatePath); + content = parser.parse(htmlContent, app); + } + + if (content == null) { + return this.getResString("err"); + } + Map param = req.getParameterMap(); + // 将get或post提交过来的参数映射到界面上去 + for (Entry entry : param.entrySet()) { + String value = entry.getValue()[0]; // 处理由get方法请求中文乱码问题 + if (StringUtil.isBlank(value)) { + continue; + } + if (req.getMethod().equals(RequestMethod.GET)) { // 如果是get方法需要将请求地址参数转吗 + value = StringUtil.isoToUTF8(value); + } + content = content.replace("{" + entry.getKey() + "/}", value); + } + return content; + } + + /** + * 读取模板文件内容 + * + * @param fileName + * 文件名称 + * @param request HttpServletRequest对象 + * @return 返回模板文件内容 + */ + protected String readTemplate(String fileName, HttpServletRequest request) { + AppEntity app = this.getApp(request); + if (app == null) { + return null; + } + String path = this.getRealPath(request, File.separator) + File.separator + IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + app.getAppId() + File.separator + app.getAppStyle(); + path += File.separator + fileName; + return FileUtil.readFile(path); + } + + /** + * 自定义页面生成, + * + * @param key + * 模板键值 + * @param host + * 主机地址,根据主机地址查询对应应用 + * @param prarser + * 解析器 + * @param req HttpServletRequest对象 + * @return 返回应用自定义页面内容 + */ + protected String generaterPage(String key, String host, IGeneralParser prarser, HttpServletRequest req) { + + AppEntity app = this.getApp(host, req); + if (app == null) { + return null; + } + com.mingsoft.basic.biz.IModelTemplateBiz modelTemplateBiz = (com.mingsoft.basic.biz.IModelTemplateBiz) getBean(req.getServletContext(), "modelTemplateBiz"); + ModelTemplateEntity mte = modelTemplateBiz.getEntity(app.getAppId(), key); + if (mte == null) { + return null; + } + String templatePath = mte.getModelTemplatePath(); + String path = getRealPath(req, IParserRegexConstant.REGEX_SAVE_TEMPLATE) + File.separator + app.getAppId() + File.separator + app.getAppStyle() + File.separator; + String content = ""; + if (isMobileDevice(req) && !StringUtil.isBlank(app.getAppMobileStyle())) { // 移动端 + String htmlContent = FileUtil.readFile(path + app.getAppMobileStyle() + File.separator + templatePath); // 读取模版文件内容 + Map map = new HashMap(); + map.put(IGeneralParser.MOBILE, app.getAppMobileStyle()); + content = prarser.parse(htmlContent, app, map); + } else { + String htmlContent = FileUtil.readFile(path + templatePath); + content = prarser.parse(htmlContent, app);// generaterFactory.builder(app, + // null, + // htmlContent, path); + } + + return content; + + } + + /** + * 解析ms标签内容 + * + * @param html + * 模板文件html内容 + * @param req HttpServletRequest对象 + * @return 返回解析好的内容 + */ + protected String parserMsTag(String html,IGeneralParser parser, HttpServletRequest req) { + if (StringUtil.isBlank(html)) { + return ""; + } + Map map = new HashMap(); + if (this.isMobileDevice(req)) { + map.put(IGeneralParser.MOBILE, IParserRegexConstant.MOBILE); + } + return parser.parse(html,this.getApp(req), map); + } + + /** + * 获取模板路径 + * @param req HttpServletRequest对象 + * @return 返回模板路径 + */ + protected String getTemplatePath(HttpServletRequest req) { + AppEntity app = this.getApp(req); + String tmpName = app.getAppStyle();// 获取模版名称 + String tmpPath = getRealPath(req, IParserRegexConstant.REGEX_SAVE_TEMPLATE); // 获取系统模版存放物理路径 + String webSiteTmpPath = tmpPath + File.separator + app.getAppId() + File.separator + tmpName;// 根据站点id组装站点信息路径 格式:templets/站点ID/模版风格 + if (this.isMobileDevice(req)) { + webSiteTmpPath += File.separator + app.getAppMobileStyle(); // 应用移动模板存放路径 + } + return webSiteTmpPath; + } + + /** + * 将请求的request的参数重新组装。主要是将空值的替换成null,因为requestMap空值是"",这样处理有利于外部判断, + * 同时将获取到的值映射到页面上 + * + * @param request HttpServletRequest对象 + * @return 返回处理过后的数据 + */ + protected Map assemblyRequestMap(HttpServletRequest request) { + Map params = new HashMap(); + Map map = request.getParameterMap(); + Iterator key = map.keySet().iterator(); + while (key.hasNext()) { + String k = (String) key.next(); + String[] value = map.get(k); + + if (value.length == 1) { + String temp = null; + if (!StringUtil.isBlank(value[0])) { + temp = value[0]; + } + params.put(k, temp); + request.setAttribute(k, temp); + } else if (value.length == 0) { + params.put(k, null); + request.setAttribute(k, null); + } else if (value.length > 1) { + params.put(k, value); + request.setAttribute(k, value); + } + } + return params; + } + + /** + * 获取请求的数据流,主要提供给微信平台接口使用 + * + * @param request + * HttpServletRequest对象 + * @return 返回请求的数据流字符串,例如:微信平台会返回JSON或xml字符串 + */ + protected String readStreamParameter(HttpServletRequest request) { + StringBuilder buffer = new StringBuilder(); + BufferedReader reader = null; + try { + reader = new BufferedReader(new InputStreamReader(request.getInputStream(), "utf-8")); + String line = null; + while ((line = reader.readLine()) != null) { + buffer.append(line); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (null != reader) { + try { + reader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return buffer.toString(); + } + + /** + * 验证验证码 + * + * @param param 表单验证码参数名称 + * @param request HttpServletRequest对象 + * @return 如果相同,返回true,否则返回false + */ + protected boolean checkRandCode(HttpServletRequest request, String param) { + String sessionCode = this.getRandCode(request); + String requestCode = request.getParameter(param); + if (sessionCode.equalsIgnoreCase(requestCode)) { + return true; + } + return false; + } + + /** + * 验证验证码 + * + * @param request HttpServletRequest对象 + * @return 如果相同,返回true,否则返回false + */ + protected boolean checkRandCode(HttpServletRequest request) { + return checkRandCode(request, SessionConst.CODE_SESSION.toString()); + } + + /** + * AES解密字符串,key值为当前应用编号 + * @param request HttpServletRequest对象 + * @param str 需要解密的字符串 + * @return 返回解密后的字符串 + */ + protected String decryptByAES(HttpServletRequest request,String str) { + return AESUtil.decrypt(str, StringUtil.Md5(this.getApp(request).getAppId()+"").substring(16)); + } + + + /** + * AES加密字符串,key值为当前应用编号 + * @param request HttpServletRequest对象 + * @param str 需要加密的字符串 + * @return 返回加密后的字符串 + */ + protected String encryptByAES(HttpServletRequest request,String str) { + return AESUtil.encrypt(str, StringUtil.Md5(this.getApp(request).getAppId()+"").substring(16)); + } + + + /** + * 获取请求客户端ip + * @param request + * @return ip地址 + */ + public String getRemoteAddress(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")) { + ip = request.getRemoteAddr(); + } + return ip; + } + + /** + * 获取对应ip地址的mac地址 + * @param ip + * @return mac地址 + */ + public String getMACAddress(String ip) { + String str = ""; + String macAddress = ""; + try { + Process p = Runtime.getRuntime().exec("nbtstat -A " + ip); + InputStreamReader ir = new InputStreamReader(p.getInputStream()); + LineNumberReader input = new LineNumberReader(ir); + for (int i = 1; i < 100; i++) { + str = input.readLine(); + if (str != null) { + if (str.indexOf("MAC Address") > 1) { + macAddress = str.substring(str.indexOf("MAC Address") + 14, str.length()); + break; + } + } + } + } catch (IOException e) { + e.printStackTrace(System.out); + } + return macAddress; + } +} diff --git a/src/main/java/com/mingsoft/base/action/resources.properties b/src/main/java/com/mingsoft/base/action/resources.properties new file mode 100644 index 00000000..fbda7edc --- /dev/null +++ b/src/main/java/com/mingsoft/base/action/resources.properties @@ -0,0 +1,132 @@ +#\u5168\u5c40\u9519\u8bef\u4fe1\u606f +err=\u60a8\u7684\u64cd\u4f5c\u88ab\u7cfb\u7edf\u62d2\u7edd\uff0c\u8bf7\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u4eba\u5458\uff01 +err.empty={0}\u4e0d\u80fd\u4e3a\u7a7a! +err.error={0}\u9519\u8bef! +err.length={0}\u957f\u5ea6\u9519\u8bef,\u5fc5\u987b\u5728{1}\uff0c{2}\u4e4b\u95f4! +err.exist={0}\u5df2\u5b58\u5728! +err.not.exist={0}\u4e0d\u5b58\u5728! +rand.code=\u9a8c\u8bc1\u7801 + +ok=\u64cd\u4f5c\u6210\u529f +ok.name={0}\u6210\u529f + +#----------------\u7ba1\u7406\u5458\u548c\u89d2\u8272\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb----------------- +managerName=\u7ba1\u7406\u5458\u5e10\u53f7 +managerNickName=\u7ba1\u7406\u5458\u6635\u79f0 +managerPassword=\u7ba1\u7406\u5458\u5bc6\u7801 +rolrName=\u89d2\u8272\u540d\u79f0 +err.nameEmpty=\u7cfb\u7edf\u4e0d\u5b58\u5728\u6b64\u7528\u6237 +err.password=\u5bc6\u7801\u9519\u8bef +err.modelNoSelected=\u53cb\u60c5\u63d0\u793a\uff0c\u60a8\u6ca1\u6709\u9009\u62e9\u529f\u80fd\u6a21\u5757 +err.notUpdateManager=\u60a8\u597d\uff0c\u60a8\u5c1a\u672a\u66f4\u65b0\u7ba1\u7406\u5458 +err.length={0}\u957f\u5ea6\u4e0d\u6b63\u786e\uff01\u957f\u5ea6\u5e94\u8be5\u4e3a{1}\u5230{2}\u4e4b\u95f4 +err.exist={0}\u5df2\u5b58\u5728 +#----------------\u7ba1\u7406\u5458\u548c\u89d2\u8272\u8fd4\u56de\u4fe1\u606f\u7ed3\u675f----------------- + +#----------------\u8bc4\u8bba\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb----------------- +commentContent=\u8bc4\u8bba\u5185\u5bb9 +commenterr=\u7528\u6237\u6ca1\u6709\u8d2d\u4e70\u8be5\u5546\u54c1 +comment=\u8bc4\u8bba +#----------------\u8bc4\u8bba\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb----------------- + +#----------------\u8ba2\u5355\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb----------------- +orderAddress=\u5bdd\u5ba4\u53f7 +orderPhone=\u624b\u673a\u53f7\u7801 +err.dataType={0}\u5fc5\u987b\u662f\u6570\u5b57 +err.orderPhone=\u8bf7\u6b63\u786e\u8f93\u5165\u624b\u673a\u53f7 +#----------------\u8ba2\u5355\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb----------------- + +#----------------\u7ad9\u70b9\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb----------------- +#\u7ad9\u70b9\u6807\u9898 +appTitle=\u7ad9\u70b9\u6807\u9898 +#\u7ad9\u70b9\u57df\u540d +appUrl=\u7ad9\u70b9\u57df\u540d +#\u7ad9\u70b9\u6a21\u677f +appStyle=\u7ad9\u70b9\u6a21\u677f\u98ce\u683c +#\u7ad9\u70b9\u57df\u540d\u662f\u5426\u5b58\u5728 +appKeyword=\u7ad9\u70b9\u5173\u952e\u5b57 +#\u7ad9\u70b9\u7248\u6743\u4fe1\u606f +appCopyright=\u7ad9\u70b9\u7248\u6743\u4fe1\u606f +#\u7ad9\u70b9\u63cf\u8ff0 +appDescrip=\u7ad9\u70b9\u63cf\u8ff0 +#----------------\u7ad9\u70b9\u8fd4\u56de\u4fe1\u606f\u7ed3\u675f----------------- + +#----------------\u6587\u7ae0\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb----------------- +basicTitle=\u6587\u7ae0\u6807\u9898 +articleContent=\u6587\u7ae0\u5185\u5bb9 +basicCategoryId=\u6587\u7ae0\u680f\u76ee +articleSource=\u6587\u7ae0\u6765\u6e90 +articleAuthor=\u6587\u7ae0\u4f5c\u8005 +basicDescription=\u6587\u7ae0\u63cf\u8ff0 +articleKeyword=\u6587\u7ae0\u5173\u952e\u5b57 +err.empty={0}\u4e0d\u80fd\u4e3a\u7a7a +err.length={0}\u957f\u5ea6\u4e0d\u6b63\u786e\uff01\u957f\u5ea6\u5e94\u8be5\u4e3a{1}\u5230{2}\u4e4b\u95f4 +#----------------\u6587\u7ae0\u8fd4\u56de\u4fe1\u606f\u7ed3\u675f----------------- + +#---------------\u680f\u76ee\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb------------------ +categoryTitle=\u680f\u76ee\u6807\u9898 +columnType=\u680f\u76ee\u5c5e\u6027 +columnDescrip=\u680f\u76ee\u63cf\u8ff0 +columnKeyword=\u680f\u76ee\u7b80\u4ecb +err.empty={0}\u4e0d\u80fd\u4e3a\u7a7a +err.length={0}\u957f\u5ea6\u4e0d\u6b63\u786e\uff01\u957f\u5ea6\u5e94\u8be5\u4e3a{1}\u5230{2}\u4e4b\u95f4 +#---------------\u680f\u76ee\u8fd4\u56de\u4fe1\u606f\u7ed3\u675f------------------ + +#----------------\u6b63\u5219\u89e3\u6790\u65f6\u8fd4\u56de\u4fe1\u606f\u5f00\u59cb(\u7f16\u7801\u5e8f\u53f7200)----------------- +#\u672a\u627e\u5230\u663e\u793a\u8be5\u5185\u5bb9\u7684\u6a21\u7248 +view.not.html=201 +#\u672a\u627e\u5230\u8be5\u6807\u7b7e\u5185\u5bb9 +regex.error=202 + +#-------------\u8bfe\u8868\u63d2\u4ef6---------- +curriculum.cookie.maxage= 31536000 +curriculum.people.null.error=\u6682\u65e0\u8bfe\u8868\u8bb0\u5f55 +curriculum.people.classIds.null.error=\u6682\u65e0\u8bfe\u8868\u8bb0\u5f55 + +#-----------------\u8868\u5355\u7c7b\u578b\u7ba1\u7406\u7684\u8fd4\u56de\u4fe1\u606f---------------- +fieldTipsName = \u5b57\u6bb5\u63d0\u793a\u540d +fieldFieldName = \u5b57\u6bb5\u540d +fieldType = \u5b57\u6bb5\u7c7b\u578b + +#-----------------\u641c\u7d22\u7ba1\u7406\u7684\u8fd4\u56de\u4fe1\u606f---------------- +searchName = \u641c\u7d22\u540d\u79f0 +searchTemplets = \u641c\u7d22\u7ed3\u679c\u6a21\u677f + +#---------qq\u767b\u5f55-------- +api.qq.login.cookie.maxage = 2592000 +api.qq.login.return.url.error = \u8df3\u8f6c\u5730\u5740\u9519\u8bef,\u8bf7\u91cd\u65b0\u767b\u5f55\uff01 + +#---------\u5fae\u4fe1\u76f8\u5173-------- +#\u4e8c\u7ef4\u7801 +weixin.qrcode.no.error=\u4e8c\u7ef4\u7801\u56fe\u7247\u4e0d\u5b58\u5728 +weixin.qrcode.error=\u4e8c\u7ef4\u7801\u53c2\u6570\u9519\u8bef + + + +#----------------\u79ef\u5206\u6a21\u5757-------- +bank.people.msg.null.error=\u672a\u83b7\u53d6\u5230\u8be5\u7528\u6237\u79ef\u5206! +bank.people.data.null.error=08030100 + + +#----------------\u5206\u671f\u8ba2\u5355------------- +staging.order.inventory.shortage=\u5546\u54c1\u5e93\u5b58\u4e0d\u8db3 + +#--------------------\u5206\u671f\u8d39\u7387------------------------- +stagingRateIssue = \u5206\u671f\u671f\u6570 +stagingRateRate = \u5206\u671f\u8d39\u7387 +#---------------------\u652f\u4ed8\u6a21\u5757-------------- +bankPayType=\u652f\u4ed8\u7c7b\u578b +bankPayNo = \u8d26\u53f7 +bankPayApiType=\u63a5\u53e3\u652f\u4ed8\u7c7b\u578b +bankPayPartner=\u5408\u4f5c\u7f16\u53f7 +bankPayKey=\u63a5\u53e3 +#-------------------\u8ba2\u5355\u6a21\u5757-------------- +order.no = \u8ba2\u5355\u7f16\u53f7 +#----------------\u81ea\u5b9a\u4e49\u8868\u5355\u6a21\u5757------------- +diy.form=\u81ea\u5b9a\u4e49\u8868\u5355 +diy.form.field=\u81ea\u5b9a\u4e49\u8868\u5355\u5b57\u6bb5 +diy.form.table.name=\u81ea\u5b9a\u4e49\u8868\u5355\u8868\u540d + +#---\u6a21\u5757\u7ba1\u7406 +modelCode=\u6a21\u5757\u7f16\u7801 +modelTitle=\u6a21\u5757\u6807\u9898 \ No newline at end of file diff --git a/src/main/java/com/mingsoft/base/biz/IBaseBiz.java b/src/main/java/com/mingsoft/base/biz/IBaseBiz.java new file mode 100644 index 00000000..b88ac671 --- /dev/null +++ b/src/main/java/com/mingsoft/base/biz/IBaseBiz.java @@ -0,0 +1,164 @@ +package com.mingsoft.base.biz; + +import java.util.List; +import java.util.Map; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.util.PageUtil; + +/** + * 基础业务类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IBaseBiz { + + /** + * 保存 + * + * @param entity + * 实体 + * @return 返回保存后的id + */ + int saveEntity(BaseEntity entity); + + /** + * 根据id删除实体 + * + * @param id + * 要删除的主键id + */ + void deleteEntity(int id); + + /** + * 更新实体 + * @param entity + */ + void updateEntity(BaseEntity entity); + + /** + * 查询所有 + * @return 返回list实体数组 + */ + List queryAll(); + + /** + * 分页查询 + * @param page PageUtil对象,主要封装分页的方法 + * @param orderBy 排序字段 + * @param order 排序方式true:asc false:desc + * @return 返回list实体数组 + */ + List queryByPage(PageUtil page, String orderBy,boolean order); + + /** + * 查询数据表中记录集合总数
+ * 可配合分页使用
+ * @return 返回集合总数 + */ + int queryCount(); + + /** + * 更具ID查询实体信息 + * @param id 实体ID + * @return 返回实体 + */ + BaseEntity getEntity(int id); + + /** + * 动态sql查询 + * @param table 表名称 + * @param fields list集合 + * @param wheres 条件 都是key-value对应 + * @param begin 开始 + * @param end 结束 + * @return 返回list实体数组 + */ + @SuppressWarnings("rawtypes") + List queryBySQL(String table, List fields, Map wheres,Integer begin,Integer end); + /** + * 查询表中记录总数 + * @param table 表名称 + * @param wheres 条件 都是key-value对应 + * @return 返回查询总数 + */ + int countBySQL(String table, Map wheres); + /** + * 动态sql查询 + * @param table 表名称 + * @param fields list集合 + * @param wheres 条件 都是key-value对应 + * @return 返回list实体数组 + */ + @SuppressWarnings("rawtypes") + List queryBySQL(String table, List fields, Map wheres); + + /** + *动态SQL更新 + * @param table 表名称 + * @param fields list集合每个map都是key-value对应 + * @param wheres 条件 都是key-value对应 + */ + @SuppressWarnings("rawtypes") + void updateBySQL(String table,Map fields, Map wheres); + + /** + * 动态SQL删除 + * @param table 表名称 + * @param wheres 條件 都是key-value对应 + */ + @SuppressWarnings("rawtypes") + void deleteBySQL(String table, Map wheres); + + /** + * 添加记录 + * @param table 表名称 + * @param fields 编号 + */ + @SuppressWarnings("rawtypes") + void insertBySQL(String table,Map fields); + + /** + * 创建表 + * @param table 表名称 + * @param fileds key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填 + */ + @SuppressWarnings("rawtypes") + void createTable(String table,Map fileds); + + /** + * 修改表 + * @param table 表名称 + * @param fileds key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填 + */ + @SuppressWarnings("rawtypes") + void alterTable(String table,Map fileds,String type); + + /** + * 删除表 + * @param table 表名称 + */ + void dropTable(String table); + + /** + * 导入执行数据 + * @param sql sql语句 + */ + void excuteSql(String sql); + /** + * 批量新增 + * @param list 新增数据 + */ + void saveBatch(List list); + + /** + * 根据id集合实现批量的删除 + * @param ids id集合 + */ + void delete(String[] ids); + + + +} diff --git a/src/main/java/com/mingsoft/base/biz/impl/BaseBizImpl.java b/src/main/java/com/mingsoft/base/biz/impl/BaseBizImpl.java new file mode 100644 index 00000000..31fb7279 --- /dev/null +++ b/src/main/java/com/mingsoft/base/biz/impl/BaseBizImpl.java @@ -0,0 +1,146 @@ +package com.mingsoft.base.biz.impl; + +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.util.PageUtil; + + +/** + * 基础业务实现 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public abstract class BaseBizImpl implements IBaseBiz { + + /** + * LOG对象 + */ + protected final Logger LOG = Logger.getLogger(this.getClass()); + + @Override + public int saveEntity(BaseEntity entity) { + return getDao().saveEntity(entity); + } + + @Override + public void deleteEntity(int id) { + // TODO Auto-generated method stub + getDao().deleteEntity(id); + } + + @Override + public void updateEntity(BaseEntity entity) { + + // TODO Auto-generated method stub + getDao().updateEntity(entity); + } + + @Override + public List queryAll() { + // TODO Auto-generated method stub + return getDao().queryAll(); + } + + + + + @Override + public List queryByPage(PageUtil page,String orderBy,boolean order) { + // TODO Auto-generated method stub + return getDao().queryByPage(page.getPageNo(),page.getPageSize(), orderBy, order); + } + + @Override + public int queryCount(){ + return getDao().queryCount(); + } + + @Override + public BaseEntity getEntity(int id){ + return getDao().getEntity(id); + } + + + + + @Override + public List queryBySQL(String table, List fields,Map wheres,Integer begin,Integer end) { + // TODO Auto-generated method stub + return getDao().queryBySQL(table, fields, wheres,begin,end,null); + } + + @Override + public int countBySQL(String table, Map wheres) { + // TODO Auto-generated method stub + return getDao().countBySQL(table, wheres); + } + + @Override + public List queryBySQL(String table, List fields, Map wheres) { + // TODO Auto-generated method stub + return getDao().queryBySQL(table, fields, wheres,null,null,null); + } + + @Override + public void updateBySQL(String table, Map fields, Map wheres) { + // TODO Auto-generated method stub + getDao().updateBySQL(table, fields, wheres); + } + + @Override + public void deleteBySQL(String table, Map wheres) { + // TODO Auto-generated method stub + getDao().deleteBySQL(table, wheres); + } + + @Override + public void insertBySQL(String table, Map fields) { + // TODO Auto-generated method stub + getDao().insertBySQL(table, fields); + } + + + + @Override + public void createTable(String table, Map fileds) { + // TODO Auto-generated method stub + getDao().createTable(table, fileds); + } + + @Override + public void alterTable(String table, Map fileds,String type) { + // TODO Auto-generated method stub + getDao().alterTable(table, fileds,type); + } + + @Override + public void dropTable(String table) { + // TODO Auto-generated method stub + getDao().dropTable(table); + } + + @Override + public void excuteSql(String sql) { + // TODO Auto-generated method stub + + } + + protected abstract IBaseDao getDao(); + + @Override + public void saveBatch(List list){ + getDao().saveBatch(list); + } + + @Override + public void delete(String[] ids){ + getDao().delete(ids); + } +} diff --git a/src/main/java/com/mingsoft/base/constant/Const.java b/src/main/java/com/mingsoft/base/constant/Const.java new file mode 100644 index 00000000..28c69be5 --- /dev/null +++ b/src/main/java/com/mingsoft/base/constant/Const.java @@ -0,0 +1,76 @@ +package com.mingsoft.base.constant; + +import java.util.ResourceBundle; +import org.springframework.context.ApplicationContext; + + +/** + * 基础枚举类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public final class Const { + + /** + * 当前请求路径,BaseFilter赋值 + */ + public static String BASE_URL; + + /** + * 项目名称,BaseFilter赋值 + */ + public static String BASE; + + /** + * 项目物理路径,BaseFilter赋值 + */ + public static String PROJECT_PATH; + + /** + * spring资源文件加载上下文对象 + */ + public static ApplicationContext CONTEXT; + + /** + * action层对应的国际化资源文件 + */ + public final static ResourceBundle RESOURCES = ResourceBundle + .getBundle("com.mingsoft.base.action.resources"); + + /** + * 默认系统管理员所对应的角色ID为1 + */ + public final static int DEFAULT_SYSTEM_MANGER_ROLE_ID = 1; + + /** + * 默认站点管理员所对应的角色ID为2 + */ + public final static int DEFAULT_WEBSITE_MANGER_ROLE_ID = 2; + + /** + * 默认CMS所对应的模块ID为1 + */ + public final static int DEFAULT_CMS_MODEL_ID = 1; + + /** + * 顶级栏目的父栏目ID为0 + */ + public final static int COLUMN_TOP_CATEGORY_ID = 0; + + /** + * 服务器发布地址,带有http:// 在StrutsFilter类里面设置 + */ + public static String HOST_URL = ""; + + + /** + * 默认编码格式 + */ + public final static String UTF8 = "utf-8"; + + + +} diff --git a/src/main/java/com/mingsoft/base/constant/CookieConst.java b/src/main/java/com/mingsoft/base/constant/CookieConst.java new file mode 100644 index 00000000..9dcea7c1 --- /dev/null +++ b/src/main/java/com/mingsoft/base/constant/CookieConst.java @@ -0,0 +1,65 @@ +package com.mingsoft.base.constant; + + +/** + * cookie枚举类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public enum CookieConst{ + /** + * 用户的cookie + */ + PEOPLE_COOKIE("people_cookie"), + + /** + * 分页cookie + */ + PAGENO_COOKIE("pageno_cookie"), + + /** + *上次访问地址 + */ + BACK_COOKIE("back_cookie"), + + + /** + * 保存用户QQ登录cookie
+ * cookie为openId + */ + API_LOGIN_QQ_COOKIE("api_login_qq_cookie"), + + /** + * 课表cookie,保存用户所在的班级 + */ + CURRICULUM_COOKIE("curriculum_cookie"), + + /** + * QQ登录保存当前用户点击地址的session + */ + API_LOGIN_QQ_URL("api_login_qq_url"); + + + /** + * 设置CookieConst的常量 + * @param attr 常量 + */ + CookieConst(String attr) { + this.attr = attr; + } + + private String attr; + + /** + * 返回该CookieConst常量的字符串表示 + * @return 字符串 + */ + @Override + public String toString() { + // TODO Auto-generated method stub + return attr; + } +} diff --git a/src/main/java/com/mingsoft/base/constant/ModelCode.java b/src/main/java/com/mingsoft/base/constant/ModelCode.java new file mode 100644 index 00000000..919f9c32 --- /dev/null +++ b/src/main/java/com/mingsoft/base/constant/ModelCode.java @@ -0,0 +1,242 @@ +package com.mingsoft.base.constant; + +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * 模块编号
+ * 模块编号说明:八位整型数据
+ * 项目编号(2位)+模块编号(2位)+功能编号(2位)+子功能编号(2位)
+ * 如:01(微信项目编号)01(微页面模块编号)01(模版管理编号)01(添加模版)
+ * 若为:01010100则代表整个模块管理功能模块
+ * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public enum ModelCode implements BaseEnum{ + + /** + * 登录模块编号 + */ + ADMIN_LOGIN("00000000"), + /** + * 权限管理:角色权限模块编号 + */ + ROLE("01010000"), + + /** + * 管理员管理 + */ + ROLE_MANAGER("01020000"), + + /** + * 内容:站点模块编号 + */ + APP("02010000"), + /** + * 内容:栏目模块编号 + */ + CMS_COLUMN("02990000"), + + /** + * 内容:文章模块编号 + */ + CMS_ARTICLE("02980100"), + /** + * 内容:文章列表 + */ + CMS_ARTICLE_BASIC("02980000"), + /** + * 内容:自定义搜索 + */ + CMS_SEARCH("02050000"), + + /** + * 内容:自定义模型 + */ + CMS_CONTENT_MODEL("02060000"), + + /** + * 内容:一键更新 + */ + CMS_GENERATE_ALL("02070100"), + + /** + * 内容:更新主页 + */ + CMS_GENERATE_INDEX("02070200"), + + /** + * 内容:更新文档 + */ + CMS_GENERATE_ARTICLE("02070300"), + + /** + * 内容: 更新栏目 + */ + CMS_GENERATE_COLUMN("02070400"), + + /** + * 内容:模版 + */ + CMS_TEMPLETSKIN("02080000"), + + + + /** + * 内容:织梦数据导入 + */ + COM_DEDE_DATA_IMPORT("02090100"), + + /** + * 内容:栏目属性管理模块 + */ + CMS_COLUMN_TYPE("02090200"), + + /** + * 评论系统:评论模块编号 + */ + COMMENT("05010000"), + + + + /** + * 学校管理 + */ + CURRICULUM_SCHOOL("03010100"), + + /** + * 系管理 + */ + CURRICULUM_FACULTY("03010200"), + + /** + * 教室管理 + */ + CURRICULUM_CLASS_ROOM("03010300"), + + /** + * 老师管理 + */ + CURRICULUM_TEACHER("03010400"), + + /** + * 课程管理编号 + */ + CURRICULUM_COURSE("03010500"), + + /** + * 初始化课表管理 + */ + CURRICULUM("03020100"), + + /** + * 自定义课表管理 + */ + CURRICULUM_CUSTOM("03020200"), + + /** + * 课表用户管理 + */ + CURRICULUM_PEOPLE("03020300"), + + /** + * 微信图文素材 + */ + WEIXIN_NEWS("05030100"), + + /** + * 微信图片素材 + */ + WEIXIN_NEWS_IMAGE("05030200"), + + /** + * 微信文本素材 + */ + WEIXIN_NEWS_TEXT("05030300"), + + /** + * 微信消息模块 + */ + WEIXIN_MESSAGE("05050000"), + + /** + * 微信网页2.0授权管理 + */ + WEIXIN_OAUTH("05070000"), + + /** + * 用户信息模块 + */ + PEOPLE("07000000"), + + /** + * 用户注册 + */ + PEOPLE_REGISTER("07010100"), + + /** + * 用户登录 + */ + PEOPLE_LOGIN("07010200"), + + /** + * 普通用户管理 + */ + PEOPLE_USER("07020100"), + + + + /** + * 关注 + */ + ATTENTION("09000000"), + + + + /** + * 快递单号 + */ + EXPRESS_NO("03980000"), + /** + * 城市 + */ + CITY("10990000"), + + /** + * 学校 + */ + SCHOOL("10980000"); + + + + /** + * 设置modelCode的常量 + * @param code 常量 + */ + ModelCode(String code) { + this.code = code; + } + + private String code; + + /** + * 返回该modelCode常量的字符串表示 + * @return 字符串 + */ + @Override + public String toString() { + // TODO Auto-generated method stub + return code; + } + + /** + * 返回该modelCode常量的整型表示 + * @return 整型 + */ + public int toInt() { + // TODO Auto-generated method stub + return Integer.parseInt(code); + } +} diff --git a/src/main/java/com/mingsoft/base/constant/SessionConst.java b/src/main/java/com/mingsoft/base/constant/SessionConst.java new file mode 100644 index 00000000..e98f73e6 --- /dev/null +++ b/src/main/java/com/mingsoft/base/constant/SessionConst.java @@ -0,0 +1,92 @@ +package com.mingsoft.base.constant; + + +/** + * session枚举类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public enum SessionConst { + + + /** + * 用户的session + */ + PEOPLE_SESSION("people_session"), + + /** + *用户取回密码的session + */ + PEOPLE_GET_PASSWORD_SESSION("people_get_password_session"), + + /** + * 用户更改手机号码的session + */ + PEOPEL_SET_PHONE_SESSION("people_set_phone_seesion"), + + /** + * 模块idsession + */ + MODEL_ID_SESSION("model_id_session"), + + /** + * 模块名称 + */ + MODEL_TITLE_SESSION("model_title_session"), + + /** + * 普通管理员的sesison + */ + MANAGER_ESSION("manager_session"), + + /** + * 验证码session + */ + CODE_SESSION("rand_code"), + + /** + * 普通管理员角色菜单的sesison + */ + MANAGER_ROLE_MODEL_ESSION("manager_role_model_session"), + + + /** + * 模块编号 + */ + MANAGER_MODEL_CODE("manager_model_code"), + + /** + * QQ登录保存当前用户点击地址的session + */ + API_LOGIN_QQ_URL("api_login_qq_url"); + + + + /** + * 设置session常量 + * @param attr 常量 + */ + SessionConst(String attr) { + this.attr = attr; + } + + + + private String attr; + + + + /** + * 返回SessionConst常量的字符串表示 + * @return 字符串 + */ + @Override + public String toString() { + // TODO Auto-generated method stub + return attr; + } + +} diff --git a/src/main/java/com/mingsoft/base/constant/e/BaseEnum.java b/src/main/java/com/mingsoft/base/constant/e/BaseEnum.java new file mode 100644 index 00000000..9e6380cd --- /dev/null +++ b/src/main/java/com/mingsoft/base/constant/e/BaseEnum.java @@ -0,0 +1,25 @@ +package com.mingsoft.base.constant.e; + +/** + * 模块用枚举类接口 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface BaseEnum { + + /** + * 返回该对象的字符串表示 + * @return 字符串 + */ + public String toString(); + + /** + * 返回该对象的整型表示 + * @return 整型 + */ + public int toInt() ; + +} diff --git a/src/main/java/com/mingsoft/base/dao/IBaseDao.java b/src/main/java/com/mingsoft/base/dao/IBaseDao.java new file mode 100644 index 00000000..dc79dd4b --- /dev/null +++ b/src/main/java/com/mingsoft/base/dao/IBaseDao.java @@ -0,0 +1,151 @@ +package com.mingsoft.base.dao; + +import java.util.List; +import java.util.Map; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.entity.BaseEntity; + +/** + * 基础dao + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IBaseDao { + + /** + * 保存 + * @param entity 实体 + * @return 返回保存后的id + */ + int saveEntity(BaseEntity entity); + + /** + * 根据id删除实体 + * @param id 要删除的主键id + */ + void deleteEntity(int id); + + /** + * 更新实体 + * @param entity 实体 + */ + void updateEntity(BaseEntity entity); + + /** + * 查询所有 + * @return 返回list数组 + */ + List queryAll(); + + + /** + * 分页查询 + * @param pageNo 页码 + * @param pageSize 显示条数 + * @param orderBy 排序字段 + * @param order order 排序方式,true:asc;fales:desc + * @return 返回list数组 + */ + List queryByPage(@Param("pageNo")int pageNo,@Param("pageSize")int pageSize,@Param("orderBy")String orderBy,@Param("order") boolean order); + + /** + * 查询数据表中记录集合总数 + * @return 返回查询总条数 + */ + int queryCount(); + + /** + * 根据ID查询实体信息 + * @param id 实体ID + * @return 返回base实体 + */ + BaseEntity getEntity(Integer id); + + + /** + * 动态sql查询 + * @param table 表名称 + * @param fields list集合 + * @param wheres 条件 都是key-value对应 + * @param begin 开始位置 + * @param end 结束位置 + * @param order 排序方式,true:asc;fales:desc + * @return 返回查询结果 + */ + @SuppressWarnings("rawtypes") + List queryBySQL(@Param("table")String table,@Param("fields") List fields,@Param("wheres") Map wheres,@Param("begin") Integer begin,@Param("end") Integer end,@Param("order") String order); + + /** + * 总数 + * @param table 表名称 + * @param wheres 条件 都是key-value对应 + * @return 总数 + */ + int countBySQL(@Param("table")String table,@Param("wheres") Map wheres); + + /** + *动态SQL更新 + * @param table 表名称 + * @param fields list集合每个map都是key-value对应 + * @param wheres 条件 都是key-value对应 + */ + void updateBySQL(@Param("table")String table,@Param("fields") Map fields,@Param("wheres") Map wheres); + + /** + * 动态SQL删除 + * @param table 表名称 + * @param wheres 條件 都是key-value对应 + */ + + void deleteBySQL(@Param("table")String table,@Param("wheres") Map wheres); + + /** + * 添加记录 + * @param table 表名称 + * @param fields 编号 + */ + void insertBySQL(@Param("table")String table,@Param("fields") Map fields); + + /** + * 创建表 + * @param table 表名称 + * @param fileds key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填 + */ + void createTable(@Param("table")String table,@Param("fileds")Map fileds); + + + + /** + * 修改表 + * @param table 表名称 + * @param fileds key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填 + */ + void alterTable(@Param("table")String table,@Param("fileds")Map fileds,@Param("type") String type); + + /** + * 删除表 + * @param table 表名称 + */ + void dropTable(@Param("table")String table); + + /** + * 导入执行数据 + * @param sql sql语句 + */ + void excuteSql(@Param("sql")String sql); + + /** + * 批量新增 + * @param list 新增数据 + */ + void saveBatch(@Param("list")List list); + + /** + * 根据id集合实现批量的删除 + * @param ids id集合 + */ + void delete(@Param("ids")String[] ids); +} diff --git a/src/main/java/com/mingsoft/base/dao/IBaseDao.xml b/src/main/java/com/mingsoft/base/dao/IBaseDao.xml new file mode 100644 index 00000000..0309ac33 --- /dev/null +++ b/src/main/java/com/mingsoft/base/dao/IBaseDao.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + update ${table} set + + `${name}`=#{field} + + where + ${key} = ${item} + + + + + + delete from ${table} where + ${key} = #{item} + + + + + + insert into ${table} + `${key}` + values + #{field} + ; + + + + + + CREATE TABLE `${table}` ( + `basicId` int(11) NOT NULL, + PRIMARY KEY (`basicId`) + ) ENGINE=InnoDB + AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + + + + + + + + + ALTER TABLE ${table} add `${fileds.fieldName}` ${fileds.fieldType} + + default null + default '${fileds.default}' + + + + + + ALTER TABLE ${table} change `${fileds.fieldOldName}` + `${fileds.fieldName}` ${fileds.fieldType} + + default null + default '${fileds.default}' + + + + + ALTER TABLE ${table} drop column + `${fileds.fieldName}` + + + + + + + + + + + DROP TABLE ${table} + + + + + + ${sql} + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/base/entity/BaseEntity.java b/src/main/java/com/mingsoft/base/entity/BaseEntity.java new file mode 100644 index 00000000..614dc54e --- /dev/null +++ b/src/main/java/com/mingsoft/base/entity/BaseEntity.java @@ -0,0 +1,15 @@ +package com.mingsoft.base.entity; + +import java.io.Serializable; + +/** + * 基础实体类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public abstract class BaseEntity implements Serializable{ + +} diff --git a/src/main/java/com/mingsoft/base/entity/ListJson.java b/src/main/java/com/mingsoft/base/entity/ListJson.java new file mode 100644 index 00000000..05f5771b --- /dev/null +++ b/src/main/java/com/mingsoft/base/entity/ListJson.java @@ -0,0 +1,43 @@ +package com.mingsoft.base.entity; + +import java.util.List; + +/** + * 列表通用json对象 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ListJson { + + private int count; + private List list; + + /** + * 构造方法,添加条数和数组 + * @param count + * @param list + */ + public ListJson(int count, List list) { + this.count = count; + this.list = list; + } + + /** + * 获取数量 + * @return 返回数量 + */ + public int getCount() { + return count; + } + + /** + * 获取list数组 + * @return 返回list数组 + */ + public List getList() { + return list; + } +} diff --git a/src/main/java/com/mingsoft/base/entity/ResultJson.java b/src/main/java/com/mingsoft/base/entity/ResultJson.java new file mode 100644 index 00000000..885e5c37 --- /dev/null +++ b/src/main/java/com/mingsoft/base/entity/ResultJson.java @@ -0,0 +1,121 @@ +package com.mingsoft.base.entity; + + +/** + * json数据返回数据格式 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ResultJson { + + /** + * 模块编号 + */ + private String code; + + /** + * 返回状态:true成功 false:失败 + */ + private boolean result; + + /** + * 返回信息提示 + */ + private String resultMsg; + + + /** + * 返回数据 + */ + private String resultData = ""; + + /** + * 返回后跳的地址 + */ + private String url; + + /** + * 获取后跳的地址 + * @return 返回后跳的地址 + */ + public String getUrl() { + return url; + } + + /** + * 设置后跳的地址 + * @param url 后跳地址 + */ + public void setUrl(String url) { + this.url = url; + } + + /** + * 获取模块编号 + * @return 返回模块编号 + */ + public String getCode() { + return code; + } + + /** + * 设置模块编号 + * @param code 模块编号 + */ + public void setCode(String code) { + this.code = code; + } + + /** + * 获取返回状态 + * @return 返回状态 + */ + public boolean isResult() { + return result; + } + + /** + * 设置返回状态 + * @param result 返回状态 + */ + public void setResult(boolean result) { + this.result = result; + } + + /** + * 设置返回信息提示 + * @return 返回提示信息 + */ + public String getResultMsg() { + return resultMsg; + } + + /** + * 设置返回信息提示 + * @param resultMsg 返回提示信息 + */ + public void setResultMsg(String resultMsg) { + this.resultMsg = resultMsg; + } + + /** + * 获取返回数据 + * @return 返回数据 + */ + public String getResultData() { + return resultData; + } + + /** + * 设置返回数据 + * @param resultData 返回数据 + */ + public void setResultData(String resultData) { + this.resultData = resultData; + } + + +} diff --git a/src/main/java/com/mingsoft/base/entity/SessionEntity.java b/src/main/java/com/mingsoft/base/entity/SessionEntity.java new file mode 100644 index 00000000..1910181a --- /dev/null +++ b/src/main/java/com/mingsoft/base/entity/SessionEntity.java @@ -0,0 +1,14 @@ +package com.mingsoft.base.entity; + + +/** + * 调用session实体 + * @author 成卫雄QQ:330216230 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class SessionEntity extends BaseEntity{ + +} diff --git a/src/main/java/com/mingsoft/base/filter/BaseFilter.java b/src/main/java/com/mingsoft/base/filter/BaseFilter.java new file mode 100644 index 00000000..ba12042c --- /dev/null +++ b/src/main/java/com/mingsoft/base/filter/BaseFilter.java @@ -0,0 +1,122 @@ +package com.mingsoft.base.filter; + + +import java.io.IOException; +import java.util.Enumeration; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import org.apache.log4j.Logger; +import com.mingsoft.base.constant.Const; + + +/** + * 基础filer类,任何一个请求都能在页面获取base变量。子类调用的时候必须使用super(); + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public abstract class BaseFilter implements Filter { + + /* + * log4j日志记录 + */ + protected Logger logger = Logger.getLogger(this.getClass()); + + /** + * 过滤 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @param chain 过滤器链 + * @throws Exception 异常处理 + */ + public abstract void doFilter(ServletRequest request, + ServletResponse response, FilterChain chain) throws IOException, + ServletException; + + /** + * log4j日志输出 + * + * @param request + * ServletRequest对象
+ * @param response + * ServletResponse对象 + */ + public void log4jPrintOut(ServletRequest request, ServletResponse response) { + HttpServletRequest httpRequest = (HttpServletRequest) request; + // log4j debug开启状态 + if (logger.isDebugEnabled()) { + StringBuffer sb = new StringBuffer(); + Enumeration names; + sb.append("Logging : \n"); + sb.append("--- Request URL: ---\n").append("\t").append( + ((HttpServletRequest) httpRequest).getRequestURL()).append( + "\n"); + names = httpRequest.getParameterNames(); + sb.append("--- Request Parameters: ---\n"); + while (names.hasMoreElements()) { + String name = names.nextElement(); + sb.append("\t").append(name).append(":").append( + httpRequest.getParameter(name)).append("\n"); + } + names = httpRequest.getAttributeNames(); + sb.append("--- Request Attributes: ---\n"); + while (names.hasMoreElements()) { + String name = names.nextElement(); + sb.append("\t").append(name).append(":").append( + httpRequest.getAttribute(name)).append("\n"); + } + names = httpRequest.getHeaderNames(); + sb.append("--- Request Heards: ---\n"); + while (names.hasMoreElements()) { + String name = names.nextElement(); + sb.append("\t").append(name).append(":").append( + httpRequest.getHeader(name)).append("\n"); + } + + names = httpRequest.getSession().getAttributeNames(); + sb.append("--- Request Sessions: ---\n"); + while (names.hasMoreElements()) { + String name = names.nextElement(); + sb.append("\t").append(name).append(":").append( + httpRequest.getSession().getAttribute(name)).append( + "\n"); + } + + Cookie[] cookies = httpRequest.getCookies(); + sb.append("--- Request Cookies: ---\n"); + if (cookies != null) { + for (int i = 0; i < cookies.length; i++) { + Cookie thisCookie = cookies[i]; + sb.append("\t").append(thisCookie.getName()).append(":") + .append(thisCookie.getValue()).append("\n"); + } + } + logger.debug(sb.toString()); + } + + } + + /** + * 使过滤器为处理做准备 + * @param filterConfig 过滤器初始化参数 + */ + @Override + public void init(FilterConfig filterConfig) throws ServletException { + Const.BASE = filterConfig.getServletContext().getContextPath(); + Const.PROJECT_PATH = filterConfig.getServletContext().getRealPath("/"); + } + + /** + * 执行清理操作 + */ + @Override + public void destroy() {} +} diff --git a/src/main/java/com/mingsoft/base/job/BaseJob.java b/src/main/java/com/mingsoft/base/job/BaseJob.java new file mode 100644 index 00000000..57695e3c --- /dev/null +++ b/src/main/java/com/mingsoft/base/job/BaseJob.java @@ -0,0 +1,29 @@ +package com.mingsoft.base.job; + +import org.apache.log4j.Logger; +import org.quartz.Job; + +/** + * 基础job类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public abstract class BaseJob implements Job { + + /* + * log4j日志记录 + */ + protected final Logger LOG = Logger.getLogger(this.getClass()); + + /** + * 通过spring的webapplicationcontext上下文对象读取bean对象 + * @param beanName 要读取的bean的名称 + * @return 返回bean对象,获取不到返回null + */ + protected Object getBean(String beanName) { + return com.mingsoft.base.constant.Const.CONTEXT.getBean(beanName); + } +} diff --git a/src/main/java/com/mingsoft/base/listener/StartUpListener.java b/src/main/java/com/mingsoft/base/listener/StartUpListener.java new file mode 100644 index 00000000..0d6e7e1f --- /dev/null +++ b/src/main/java/com/mingsoft/base/listener/StartUpListener.java @@ -0,0 +1,57 @@ +package com.mingsoft.base.listener; + +import java.io.File; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; +import org.apache.log4j.Logger; +import org.springframework.web.context.support.WebApplicationContextUtils; +import com.mingsoft.base.constant.Const; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.StringUtil; + +/** + * 启动监听 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@WebListener("startUpListener") +public class StartUpListener implements ServletContextListener { + + /* + * log4j日志记录 + */ + protected final Logger LOG = Logger.getLogger(this.getClass()); + + + /** + * + * 监听项目启动,进行初始化 + * @param sce ServletContextEvent对象 + */ + @Override + public void contextInitialized(ServletContextEvent sce) { + // TODO Auto-generated method stub + LOG.debug("MS启动初始化开始"); + Const.PROJECT_PATH = sce.getServletContext().getRealPath(File.separator); + Const.CONTEXT = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext()); + LOG.debug("MS启动初始化结束"); + + } + + /** + * 监听项目终止,进行销毁 + * @param sce ServletContextEvent对象 + */ + @Override + public void contextDestroyed(ServletContextEvent sce) { + // TODO Auto-generated method stub + LOG.debug("-====="); + } + +} diff --git a/src/main/java/com/mingsoft/basic/action/AppAction.java b/src/main/java/com/mingsoft/basic/action/AppAction.java new file mode 100644 index 00000000..97a8e70c --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/AppAction.java @@ -0,0 +1,253 @@ +package com.mingsoft.basic.action; + +import java.io.File; +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.biz.IManagerBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 网站基本信息控制层 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-07-14
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/app/") +public class AppAction extends BaseAction{ + + /** + * appBiz业务层的注入 + */ + @Autowired + private IAppBiz appBiz; + + /** + * managerBiz业务层的注入 + */ + @Autowired + private IManagerBiz managerBiz; + + + + /** + * 根据id删除站点信息 + * @param basicId 要删除的站点Id + * @param request 请求对象 + * @return 返回当前页数 + */ + @RequestMapping("/{basicId}/delete") + @ResponseBody + public int delete(@PathVariable int basicId, HttpServletRequest request){ + AppEntity app = (AppEntity) appBiz.getEntity(basicId); + /* + * 删除对应的站点管理员 + */ + if(app!=null){ + int managerId = app.getAppManagerId(); + managerBiz.deleteEntity(managerId); + appBiz.deleteBasic(basicId); + } + int pageNo = 2; + //保存页面cookie值 + int cookie = Integer.valueOf(this.getCookie(request, CookieConst.PAGENO_COOKIE)); + if(cookie>=1){ + pageNo=cookie; + } + return pageNo; + } + + /** + * 跳转到站点保存页面 + * @param request 请求对象 + * @param mode ModelMap实体对象 + * @return 站点保存页面 + */ + @RequestMapping("/add") + public String add(HttpServletRequest request,ModelMap mode){ + //超级管理员识别 + mode.addAttribute("SystemManager",true); + AppEntity app = new AppEntity(); + //传入一个空的app + mode.addAttribute("app",app); + return "/manager/app/app"; + } + + /** + * 跳转到修改页面 + * @param mode ModelMap实体对象 + * @param appId 站点id + * @param request 请求对象 + * @return 站点修改页面 + */ + @RequestMapping(value="/{appId}/edit") + public String edit(ModelMap mode,@PathVariable int appId, HttpServletRequest request) { + AppEntity app = null; + if (appId<0) { + app = this.getApp(request); + } else { + app = (AppEntity) appBiz.getEntity(appId); + } + + //判断否是超级管理员,是的话不显示站点风格 + if(this.isSystemManager(request)){ + mode.addAttribute("SystemManager",true); + }else{ + mode.addAttribute("SystemManager",false); + } + + mode.addAttribute("app",app); + return "/manager/app/app"; + } + + /** + * 更新站点信息 + * @param mode ModelMap实体对象 + * @param app 站点对象 + * @param request 请求对象 + * @param response 相应对象 + */ + @RequestMapping("/update") + public void update(ModelMap mode,@ModelAttribute AppEntity app, HttpServletRequest request, HttpServletResponse response){ + mode.clear(); + // 获取Session值 + ManagerEntity managerSession = (ManagerEntity) getManagerBySession(request); + if(managerSession==null){ + return ; + } + mode.addAttribute("managerSession",managerSession); + + //判断否是超级管理员,不是则不修改应用续费时间和清单 + if(!this.isSystemManager(request)){ + app.setAppPayDate(null); + app.setAppPay(null); + // 设置当前的站点id + app.setAppId(this.getAppId(request)); + } + int managerRoleID = managerSession.getManagerRoleID(); + //判断站点数据的合法性 + // 获取cookie + String cookie =this.getCookie(request, CookieConst.PAGENO_COOKIE); + int pageNo = 1; + //判断cookies是否为空 + if(!StringUtil.isBlank(cookie) && Integer.valueOf(cookie)>0){ + pageNo=Integer.valueOf(cookie); + } + mode.addAttribute("pageNo", pageNo); + if(!checkForm(app,response)){ + return; + } + if(!StringUtil.isBlank(app.getAppLogo())) { + app.setAppLogo( app.getAppLogo().replace("|", "")); + } + //更新站点信息 + appBiz.updateEntity(app); + this.outJson(response, ModelCode.APP, true, String.valueOf(pageNo), String.valueOf(managerRoleID)); + } + + /** + * 保存站点信息 + * @param app 站点实体对象 + * @param request 请求对象 + * @param response 相应对象 + */ + @RequestMapping("/save") + public void save(@ModelAttribute AppEntity app, HttpServletRequest request, HttpServletResponse response){ + //验证站点数据的合法性 + if(!checkForm(app,response)){ + return; + } + //问题:由于上传的图片路径后面可能带有|符合。所以要进行将“|”替换空 + //空值判断 + if(!StringUtil.isBlank(app.getAppLogo())) { + app.setAppLogo( app.getAppLogo().replace("|", "")); + } + //问题:去掉域名后面的"/" + String appUrl = app.getAppHostUrl(); + app.setAppUrl(appUrl); + appBiz.saveEntity(app); + if(isSystemManager(request)) { + String file = this.getRealPath(request,IParserRegexConstant.REGEX_SAVE_TEMPLATE+File.separator+ app.getAppId()); + File fileName = new File(file); + fileName.mkdir(); + } + this.outJson(response, ModelCode.APP, true,null); + } + + /** + * 判断站点域名的合法性 + * @param app 要验证的站点信息 + * @param response response对象 + */ + public boolean checkForm(AppEntity app, HttpServletResponse response){ + + /* + * 判断数据的合法性 + */ + if(!StringUtil.checkLength(app.getAppKeyword(), 0,1000)){ + this.outJson(response, ModelCode.APP, false,getResString("err.length",this.getResString("appKeyword"),"0","1000")); + return false; + } + if(!StringUtil.checkLength(app.getAppCopyright(), 0,1000)){ + this.outJson(response, ModelCode.APP, false,getResString("err.length",this.getResString("appCopyright"),"0","1000")); + return false; + } + if(!StringUtil.checkLength(app.getAppDescription(), 0,1000)){ + this.outJson(response, ModelCode.APP, false,getResString("err.length",this.getResString("appDescrip"),"0","1000")); + return false; + } + if(!StringUtil.checkLength(app.getAppName(),1,50)){ + this.outJson(response, ModelCode.APP, false,getResString("err.length",this.getResString("appTitle"),"1","50")); + return false; + } + if(!StringUtil.isBlank(app.getAppStyle()) && !StringUtil.checkLength(app.getAppStyle(),1,30)){ + this.outJson(response, ModelCode.APP, false,getResString("err.length",this.getResString("appStyle"),"1","30")); + return false; + } + if(!StringUtil.checkLength(app.getAppHostUrl(),10,150)){ + this.outJson(response, ModelCode.APP, false,getResString("err.length",this.getResString("appUrl"),"10","150")); + return false; + } + return true; + } + + /** + * 判断是否有重复的域名 + * @param request 请求对象 + * @return true:重复,false:不重复 + */ + @RequestMapping("/checkUrl") + @ResponseBody + public boolean checkUrl(HttpServletRequest request){ + if(request.getParameter("appUrl")!=null){ + if(appBiz.countByUrl(request.getParameter("appUrl"))>0){ + return true; + }else{ + return false; + } + }else{ + return false; + } + + } +} diff --git a/src/main/java/com/mingsoft/basic/action/BaseAction.java b/src/main/java/com/mingsoft/basic/action/BaseAction.java new file mode 100644 index 00000000..37afe0d0 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/BaseAction.java @@ -0,0 +1,177 @@ +package com.mingsoft.basic.action; + +import javax.servlet.http.HttpServletRequest; +import com.mingsoft.basic.biz.IMailBiz; +import com.mingsoft.basic.biz.IMailTemplateBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.biz.impl.MailTemplateBizImpl; +import com.mingsoft.basic.constant.e.MailEnum; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.MailEntity; +import com.mingsoft.basic.entity.MailTemplateEntity; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.basic.entity.ModelEntity; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.util.MailUtil; +import com.mingsoft.util.StringUtil; + +/** + * 基础应用层的父类base + * @author 成卫雄 + * @version + * 版本号:100-000-000
+ * 创建日期:2015-7-19
+ * 历史修订:
+ */ +public class BaseAction extends com.mingsoft.base.action.BaseAction{ + + + /** + * 根据当前的模块获取到当前模块的分类模块信息 + * @param request 请求对象 + * @return 错误返回null,正确返回模块实体对象 + */ + protected ModelEntity getCategoryModelCode(HttpServletRequest request) { + Object obj = this.getSession + (request, SessionConst.MODEL_ID_SESSION); + if (StringUtil.isInteger(obj)) { + com.mingsoft.basic.biz.IModelBiz modelBiz = (com.mingsoft.basic.biz.IModelBiz) getBean(request.getServletContext(), "modelBiz"); + return modelBiz.getModel(IModelBiz.CATEGORY_MODEL, Integer.parseInt(obj.toString())); + } else { + return null; + } + } + + /** + * 根据当前的模块获取到当前模块的basic文章模块信息 + * @param request 请求对象 + * @return 错误返回null,正确返回模块实体对象 + */ + protected ModelEntity getBasicModelCode(HttpServletRequest request) { + Object obj = this.getSession(request, SessionConst.MODEL_ID_SESSION); + if (StringUtil.isInteger(obj)) { + com.mingsoft.basic.biz.IModelBiz modelBiz = (com.mingsoft.basic.biz.IModelBiz) getBean(request.getServletContext(), "modelBiz"); + return modelBiz.getModel(IModelBiz.BASIC_MODEL, Integer.parseInt(obj.toString())); + } else { + return null; + } + } + + /** + * 获得当前应用的邮件服务器 + * @param request 请求对象 + * @return null 表示没有找到,正确返回邮箱实体对象 + */ + protected MailEntity getMail(HttpServletRequest request) { + AppEntity app = getApp(request); + if (app == null) { + return null; + } + // 获取用户所请求的域名地址 + IMailBiz mailBiz = (IMailBiz) getBean(request.getServletContext(), "mailBiz"); + MailEntity mail = mailBiz.getByAppId(app.getAppId()); + if (mail == null) { + return null; + } + return mail; + } + + /** + * 发送邮件 + * @param request 请求对象 + * @param mailType 邮件类型(MailEntity.TEXT MailEntity.HTML) + * @param title 标题 + * @param content 内容 + * @param toUser 接收用户 + */ + protected void sendMail(HttpServletRequest request, MailEnum mailType, String title, String content, String[] toUser) { + MailEntity mail = getMail(request); + if (mailType.toInt() == MailEnum.TEXT.toInt()) { + MailUtil.sendText(mail.getMailServer(), mail.getMailPort(), mail.getMailName(), mail.getMailPassword(), title, content, toUser); + } else if (mailType.toInt() == MailEnum.HTML.toInt()) { + MailUtil.sendHtml(mail.getMailServer(), mail.getMailPort(), mail.getMailName(), mail.getMailPassword(), title, content, toUser); + } + } + + /** + * 发送html邮件内容 + * @param request 请求对象 + * @param modelCode 模块编码 + * @param toUser 接收用户邮件地址 + * @param content 发送内容 + */ + @Deprecated + protected void sendMail(HttpServletRequest request, String modelCode, String[] toUser,String content) { + IMailTemplateBiz mailTemplateBiz = (MailTemplateBizImpl)this.getBean(request.getServletContext(), "mailTemplateBiz"); + int modelId = this.getModelCodeId(request, modelCode); + MailTemplateEntity mte = mailTemplateBiz.getByAppIdAndModelCode(this.getAppId(request), modelId); + if (mte!=null) { + String _content = mte.getMailTemplateContent(); + _content = _content.replace("{content}", content); + //如果实体不为空就获取邮箱模板的标题和内容一起发送指定的邮箱地址 + this.sendMail(request, MailEnum.HTML,mte.getMailTemplateTitle(),_content, toUser); + } + } + + /** + * 发送html邮件内容,谨慎使用 + * @param request 请求对象 + * @param modelCodeId 模块编号,一般提供给后台没有对模块进行统一管理的模块 + * @param toUser 接收用户邮件地址 + */ + protected void sendMail(HttpServletRequest request, int modelCodeId, String[] toUser) { + IMailTemplateBiz mailTemplateBiz = (MailTemplateBizImpl)this.getBean(request.getServletContext(), "mailTemplateBiz"); + MailTemplateEntity mte = mailTemplateBiz.getByAppIdAndModelCode(this.getAppId(request), modelCodeId); + if (mte!=null) { + //如果实体不为空就获取邮箱模板的标题和内容一起发送指定的邮箱地址 + this.sendMail(request, MailEnum.HTML,mte.getMailTemplateTitle(),mte.getMailTemplateContent(), toUser); + } + } + + /** + * 获取管理员id,规则:没有父ID就获取自身的ID + * @param request 请求对象 + * @return 管理员编号 + */ + protected int getManagerId(HttpServletRequest request) { + ManagerSessionEntity managerSession = (ManagerSessionEntity) this.getManagerBySession(request); + int managerParent = managerSession.getManagerParentID(); + + if (managerParent == 0) { + return managerSession.getManagerId(); + } else { + return managerParent; + } + } + + /** + * 判断当前管理员是否是系统平台管理员 + * @param request 请求对象 + * @return true:是系统平台管理员,false:不是系统平台管理员 + */ + protected boolean isSystemManager(HttpServletRequest request) { + ManagerSessionEntity manager = (ManagerSessionEntity) getManagerBySession(request); + if (manager.getManagerRoleID() == Const.DEFAULT_SYSTEM_MANGER_ROLE_ID) { + return true; + } else { + return false; + } + } + + /** + * 读取管理员session + * @param request 请求对象 + * @return 获取不到就返回null + */ + protected ManagerSessionEntity getManagerBySession(HttpServletRequest request) { + // 传入用管理员请求,读取管理员的session || super,调用父类的protected属性的getSession方法 + ManagerSessionEntity managerSession = (ManagerSessionEntity) this.getSession(request, SessionConst.MANAGER_ESSION); + if (managerSession != null) { + // 返回管理员的所有信息 + return managerSession; + } + return null; + } + +} diff --git a/src/main/java/com/mingsoft/basic/action/BasicAction.java b/src/main/java/com/mingsoft/basic/action/BasicAction.java new file mode 100644 index 00000000..60f8901f --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/BasicAction.java @@ -0,0 +1,216 @@ +package com.mingsoft.basic.action; + +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.basic.biz.IBasicBiz; +import com.mingsoft.basic.biz.ICategoryBiz; +import com.mingsoft.basic.entity.BasicEntity; +import com.mingsoft.basic.entity.CategoryEntity; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.basic.entity.ModelEntity; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 基础应用层 + * @author 王天培 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-6-15
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/basic") +public class BasicAction extends BaseAction { + + /** + * 业务层的注入 + */ + @Autowired + private IBasicBiz basicBiz; + + /** + * 业务层的注入 + */ + @Autowired + private ICategoryBiz categoryBiz; + + /** + * 加载页面显示所有文章信息 + * @param request 请求对象 + * @param mode ModelMap实体对象 + * @param response 响应对象 + * @return 返回文章页面显示地址 + */ + @SuppressWarnings("static-access") + @RequestMapping("/index") + public String index(HttpServletRequest request, ModelMap mode, HttpServletResponse response) { + + // 获取站点id + int appId = ((ManagerSessionEntity) this.getManagerBySession(request)).getBasicId(); + ModelEntity model = this.getCategoryModelCode(request); + if (model==null) { + this.outString(response, this.getResString("err")); + return null; + } + List list = categoryBiz.queryByAppIdOrModelId(appId,model.getModelId() ); + JSONObject ja = new JSONObject(); + request.setAttribute("listCategory", ja.toJSON(list).toString()); + // 返回路径 + return "/manager/basic/index"; + } + + /** + * 加载文章列表页面,显示列表信息 + * @param request 请求对象 + * @param categoryId 栏目id + * @return 文章列表页面 + */ + @RequestMapping("/{categoryId}/list") + public String list(HttpServletRequest request,@PathVariable int categoryId) { + String keyWord = request.getParameter("keyword"); + String categoryTitle = request.getParameter("categoryTitle"); + // 当前页面 + int pageNo = 1; + // 获取页面的当页数 + if (request.getParameter("pageNo") != null) { + pageNo = Integer.parseInt(request.getParameter("pageNo")); + } + String url = "/manager/basic/"+categoryId+"/list.do?categoryTitle="+StringUtil.encodeStringByUTF8(categoryTitle)+"&keyword="+(keyWord==null?"":keyWord); + int count = 0; + // 分页集合 + PageUtil page = new PageUtil(pageNo, 60, count, getUrl(request) + url); + // 实例化对象 + List basicList = basicBiz.query(this.getAppId(request),categoryId, keyWord, page,this.getModelCodeId(request),null); + request.setAttribute("basicList", basicList); + request.setAttribute("categoryId", categoryId); + return "/manager/basic/basic_list"; + } + + /** + * 加载添加文章页面 + * @param request 请求对象 + * @param response 响应对象 + * @return 添加页面地址 + */ + @RequestMapping("/add") + public String add(HttpServletRequest request, HttpServletResponse response) { + String categoryId = request.getParameter("categoryId"); + request.setAttribute("categoryId", categoryId); + return "/manager/basic/basic"; + } + + /** + * 保存文章实体 + * @param basic 文章实体对象 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/save") + public void save(@ModelAttribute BasicEntity basic, HttpServletRequest request, HttpServletResponse response) { + basic.setBasicAppId(this.getAppId(request)); + basic.setBasicModelId(this.getModelCodeId(request)); + basicBiz.saveEntity(basic); + this.outJson(response, null, true); + } + + /** + * 加载编辑文档页面 + * @param basicId 文章id + * @param request 请求对象 + * @return 编辑文档页面 + */ + @RequestMapping("/{basicId}/edit") + public String edit(@PathVariable int basicId, HttpServletRequest request) { + BasicEntity basic = basicBiz.getBasicEntity(basicId); + request.setAttribute("basic", basic); + return "/manager/basic/basic"; + } + + /** + * 修改文章实体 + * @param basic 文章实体 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/update") + @ResponseBody + public void update(@ModelAttribute BasicEntity basic, HttpServletRequest request, HttpServletResponse response) { + basicBiz.updateBasic(basic); + this.outJson(response, null, true); + } + + /** + * 根据文章id删除文章实体 + * @param basicId 文章id + * @param response 响应对象 + * @param request 请求对象 + */ + @RequestMapping("/{basicId}/delete") + @ResponseBody + public void delete(@PathVariable int basicId, HttpServletResponse response, HttpServletRequest request) { + basicBiz.deleteBasic(basicId); + this.outJson(response, null, true); + } + + /** + * 文章多选删除方法 + * @param response 响应对象 + * @param request 请求对象 + */ + @RequestMapping("/allDelete") + @ResponseBody + public void allDelete(HttpServletResponse response, HttpServletRequest request) { + String checkboxData[] = request.getParameterValues("checkbox"); + if (!StringUtil.isBlank(checkboxData)) { + for (int i = 0; i < checkboxData.length; i++) { + int basicId = Integer.parseInt(checkboxData[i]); + // 获取id,查询该文章是否在该站点下 + basicBiz.deleteBasic(basicId); + } + } + this.outJson(response, null, true); + } + + /** + * 获取列表提供给ajax使用 + * @param response 响应对象 + * @param request 请求对象 + */ + @RequestMapping("/listForAjax") + public void listForAjax( HttpServletResponse response, HttpServletRequest request) { + PageUtil page = new PageUtil(1000); + List list = basicBiz.query(this.getAppId(request),null, null, page,this.getBasicModelCode(request).getModelId(),null); + this.outJson(response, JSONArray.toJSONString(list)); + } + + /** + * 获取所有json数据 + */ + /** + * 查询栏目下所有文章 + * @param categoryId 栏目id + * @param request 请求对象 + * @param mode ModelMap实体对象 + * @param response 响应对象 + */ + @RequestMapping("/{categoryId}/query") + public void query( @PathVariable Integer categoryId,HttpServletRequest request, ModelMap mode, HttpServletResponse response) { + List list = basicBiz.query(categoryId); + String jsonStr = JSONObject.toJSONString(list); + LOG.debug(jsonStr); + this.outJson(response, jsonStr); + } + +} diff --git a/src/main/java/com/mingsoft/basic/action/CategoryAction.java b/src/main/java/com/mingsoft/basic/action/CategoryAction.java new file mode 100644 index 00000000..f6382389 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/CategoryAction.java @@ -0,0 +1,322 @@ +package com.mingsoft.basic.action; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.basic.biz.ICategoryBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.CategoryEntity; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 无限极分类 + * @author 王天培 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-6-15
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/category") +public class CategoryAction extends BaseAction { + /** + * 业务层的注入 + */ + @Autowired + private ICategoryBiz categoryBiz; + + /** + * 加载添加栏目页面 + * @param request 请求对象 + * @return 添加栏目页面 + */ + @RequestMapping("/add") + public String add(HttpServletRequest request) { + String categoryCategoryId = request.getParameter("categoryCategoryId"); + CategoryEntity category = new CategoryEntity(); + if (!StringUtil.isBlank(categoryCategoryId)) { + category.setCategoryCategoryId(Integer.parseInt(categoryCategoryId)); + } + category.setCategoryManagerId(this.getManagerId(request)); + category.setCategoryModelId(this.getModelCodeId(request)); + List list = categoryBiz.queryChilds(category); + + String listJsonString = JSONObject.toJSON(list).toString(); + + request.setAttribute("categoryCategoryId", categoryCategoryId); //提供给子栏目使用 + request.setAttribute("listCategory", listJsonString); + request.setAttribute("modelTitle",request.getParameter("modelTitle")); + request.setAttribute("modelId",request.getParameter("modelId")); + return "/manager/category/category_form"; + } + + /** + * 添加栏目 + * @param category 栏目对象 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/save") + public void save(@ModelAttribute CategoryEntity category, + HttpServletRequest request, HttpServletResponse response) { + + if (!checkForm(category, response)) { + return; + } + category.setCategoryManagerId(((ManagerEntity) getManagerBySession(request)).getManagerId()); + category.setCategoryDateTime(new Timestamp(System.currentTimeMillis())); + category.setCategoryAppId(this.getAppId(request)); + category.setCategoryModelId(this.getModelCodeId(request)); + categoryBiz.saveCategoryEntity(category); + + this.outJson(response, ModelCode.CMS_COLUMN, true, null,String.valueOf(category.getCategoryId())); + } + + /** + * 加载栏目更新页面 + * @param categoryId 栏目id + * @param request 请求对象 + * @return 栏目更新页面地址 + */ + @RequestMapping("/{categoryId}/edit") + public String edit(@PathVariable int categoryId, HttpServletRequest request) { + // 站点ID + List list = new ArrayList(); + + // 判断管理员权限,查询其管理的栏目集合 + CategoryEntity category = new CategoryEntity(); + category.setCategoryManagerId(this.getManagerId(request)); + category.setCategoryModelId(this.getModelCodeId(request)); + list = categoryBiz.queryChilds(category); + + CategoryEntity column = (CategoryEntity) categoryBiz.getEntity(categoryId); + request.setAttribute("category", column); + // 获取父栏目对象 + if (column.getCategoryCategoryId() != 0) { + CategoryEntity columnSuper = (CategoryEntity) categoryBiz.getEntity(column.getCategoryCategoryId()); + request.setAttribute("columnSuper", columnSuper); + } + + String listJsonString = JSONObject.toJSON(list).toString(); + request.setAttribute("listCategory", listJsonString); + + request.setAttribute("modelTitle", request.getParameter("modelTitle")); + request.setAttribute("modelId",request.getParameter("modelId")); + return "/manager/category/category_form"; + } + + /** + * 栏目更新 + * @param category 栏目实体 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/update") + public void update(@ModelAttribute CategoryEntity category, + HttpServletRequest request, HttpServletResponse response) { + if (!checkForm(category, response)) { + return; + } + category.setCategoryManagerId(((ManagerEntity) getManagerBySession(request)).getManagerId()); + categoryBiz.updateCategoryEntity(category); + this.outJson(response, ModelCode.CMS_COLUMN, true, null,JSONArray.toJSONString(category.getCategoryId())); + + } + + /** + * 栏目首页面列表显示 + * @param request 请求对象 + * @param response 响应对象 + * @return 栏目列表页面地址 + */ + @RequestMapping("/list") + public String list(HttpServletRequest request,HttpServletResponse response) { + String modelId = request.getParameter("modelId"); + String categoryCategoryId = request.getParameter("categoryCategoryId");//提供展开效果使用 + this.setSession(request, SessionConst.MANAGER_MODEL_CODE, modelId); + //获取登录的session + ManagerSessionEntity managerSession = (ManagerSessionEntity) getManagerBySession(request); + //传入一个实体,提供查询条件 + CategoryEntity category = new CategoryEntity(); + category.setCategoryModelId(Integer.parseInt(modelId)); + + AppEntity app = this.getApp(request); + + + //查询指定的appId下的分类 + category.setCategoryAppId(app.getAppId()); + //判断是否为该网站总管理员,如果是管理员查询分类时则可以不受管理员限制,即可以查看所有的分类 + if(managerSession.getManagerId()!=app.getAppManagerId()){ + category.setCategoryManagerId(managerSession.getManagerId()); + } + PageUtil page = new PageUtil(0,1000,""); + List list = categoryBiz.queryByPageList(category, page, "category_id", true); + //保存cookie值 + this.setCookie(request, response, CookieConst.BACK_COOKIE,"/manager/category/list.do"); + request.setAttribute("categoryCategoryId", categoryCategoryId); + request.setAttribute("categoryJson", JSONArray.toJSONString(list)); + request.setAttribute("modelId",request.getParameter("modelId")); + return "/manager/category/category_list"; + } + + /** + * 根据栏目id删除栏目 + * @param categoryId 栏目id + * @param response 响应对象 + * @param request 请求对象 + */ + @RequestMapping("/{categoryId}/delete") + public void delete(@PathVariable int categoryId, + HttpServletResponse response, HttpServletRequest request) { + CategoryEntity category = new CategoryEntity(); + category.setCategoryCategoryId(categoryId); + category.setCategoryManagerId(this.getManagerId(request)); + category.setCategoryModelId(this.getModelCodeId(request)); + + // 查询该栏目是否有子栏目,如果存在子栏目则返回错误提示,否则删除该栏目 + if (categoryBiz.count(category) > 0) { + this.outJson(response, ModelCode.CMS_COLUMN, true, "0"); + } else { + categoryBiz.deleteCategoryEntity(categoryId); + this.outJson(response, ModelCode.CMS_COLUMN, true, "1"); + } + } + + /** + * 验证栏目实体是否合法 + * @param category + * @param response + * @return true:实体信息合法,false:实体信息不合法 + */ + private boolean checkForm(CategoryEntity category, + HttpServletResponse response) { + + // 栏目标题空值验证 + if (StringUtil.isBlank(category.getCategoryTitle())) { + this.outJson( + response, + ModelCode.CMS_COLUMN, + false, + getResString("err.empty", + this.getResString("categoryTitle"))); + return false; + } + // 栏目标题长度验证 + if (!StringUtil.checkLength(category.getCategoryTitle(), 1, 31)) { + this.outJson( + response, + ModelCode.CMS_COLUMN, + false, + getResString("err.length", + this.getResString("categoryTitle"), "1", "30")); + return false; + } + + return true; + } + + + /** + * 根据分类id查找分类实体和它的父分类 + * @param categoryId + * @param request + * @param mode + * @param response + */ + /** + * 根据分类id查找分类实体和它的父分类 + * @param categoryId 栏目id + * @param request 请求对象 + * @param mode + * @param response + */ + @RequestMapping("/{categoryId}/query") + public void query(@PathVariable int categoryId,HttpServletRequest request, ModelMap mode, HttpServletResponse response) { + //根据分类id查询分类实体 + CategoryEntity category = (CategoryEntity)categoryBiz.getEntity(categoryId); + //如何分类实体不存在 + if(category==null){ + return; + } + //查询该分类的父分类 + CategoryEntity categoryCategory = (CategoryEntity)categoryBiz.getEntity(category.getCategoryCategoryId()); + + List list = new ArrayList(); + list.add(categoryCategory); + list.add(category); + this.outJson(response, JSONObject.toJSONString(list)); + } + + + /** + * 根据分类id查找分类子分类 + * @param categoryId + * @param request + * @param mode + * @param response + */ + @RequestMapping("/{categoryId}/queryChildren") + public void queryChildren(@PathVariable int categoryId,HttpServletRequest request, ModelMap mode, HttpServletResponse response) { + CategoryEntity category = (CategoryEntity) this.categoryBiz.getEntity(categoryId); + if(category!=null){ + List list = this.categoryBiz.queryChilds(category); + this.outJson(response, JSONObject.toJSONString(list)); + } + + } + + /** + * 加载栏目列表页并查询所有栏目下子栏目 + * @param categoryId 栏目id + * @param request 请求对象 + * @param response 响应对象 + * @return 栏目列表地址 + */ + @RequestMapping("/{categoryId}/childList") + public String childList(@PathVariable int categoryId,HttpServletRequest request,HttpServletResponse response) { + String modelId = request.getParameter("modelId"); + String categoryCategoryId = request.getParameter("categoryCategoryId");//提供展开效果使用 + this.setSession(request, SessionConst.MANAGER_MODEL_CODE, modelId); + //获取登录的session + ManagerSessionEntity managerSession = (ManagerSessionEntity) getManagerBySession(request); + //传入一个实体,提供查询条件 + CategoryEntity category = new CategoryEntity(); + category.setCategoryModelId(Integer.parseInt(modelId)); + + AppEntity app = this.getApp(request); + int appId = app.getAppId(); + //查询指定的appId下的分类 + category.setCategoryAppId(appId); + //判断是否为该网站总管理员,如果是管理员查询分类时则可以不受管理员限制,即可以查看所有的分类 + if(managerSession.getManagerId()!=app.getAppManagerId()){ + category.setCategoryManagerId(managerSession.getManagerId()); + } + + List list=categoryBiz.queryChildrenCategory(categoryId, appId,this.getModelCodeId(request)); + + //保存cookie值 + this.setCookie(request, response, CookieConst.BACK_COOKIE,"/manager/category/list.do"); + request.setAttribute("categoryCategoryId", categoryCategoryId); + request.setAttribute("categoryJson", JSONArray.toJSONString(list)); + request.setAttribute("modelId",request.getParameter("modelId")); + return "/manager/category/category_list"; + } + +} diff --git a/src/main/java/com/mingsoft/basic/action/DiyFormAction.java b/src/main/java/com/mingsoft/basic/action/DiyFormAction.java new file mode 100644 index 00000000..1975062f --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/DiyFormAction.java @@ -0,0 +1,276 @@ +package com.mingsoft.basic.action; + +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.basic.biz.IDiyFormBiz; +import com.mingsoft.basic.biz.IDiyFormFieldBiz; +import com.mingsoft.basic.entity.DiyFormEntity; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 通用自定义表单 + * @author 王天培 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-6-15
+ * 历史修订:
+ */ +@Controller("diyForm") +@RequestMapping("/manager/diy/form") +public class DiyFormAction extends BaseAction{ + + /** + * 自定义表前缀 + */ + private static final String TABLE_NAME_PREFIX = "diy_"; + + /** + * 表名分隔符 + */ + private static final String TABLE_NAME_SPLIT= "_"; + + /** + * 注入自定义表单biz + */ + @Autowired + IDiyFormBiz diyFormBiz; + + /** + * 注入自定义表单字段的biz + */ + @Autowired + IDiyFormFieldBiz diyFormFieldBiz; + + /** + * 加载自定义表单列表页面 + * @param request 请求对象 + * @param model ModelMap实体对象 + * @return 自定义表单页面地址 + */ + @RequestMapping("/list") + public String list(HttpServletRequest request,ModelMap model) { + List list = diyFormBiz.query(this.getAppId(request)); + model.addAttribute("list", list); + return "/manager/diy/form/diy_form_list"; + } + + /** + * 加载自定义表单的数据列表页面 + * @param diyFormId 自定义表单id + * @param request 请求对象 + * @param model ModelMap实体对象 + * @return 自定义表单数据列表页面地址 + */ + @RequestMapping("/{diyFormId}/query") + public String query(@PathVariable("diyFormId") int diyFormId,HttpServletRequest request,ModelMap model) { + // 当前页面 + int pageNo = 1; + // 获取页面的当页数 + if (request.getParameter("pageNo") != null) { + pageNo = Integer.parseInt(request.getParameter("pageNo")); + } + int appId = this.getAppId(request); + int count = diyFormBiz.countDiyFormData(diyFormId, appId); + PageUtil page = new PageUtil(pageNo, 30,count,"/manager/diy/form/"+diyFormId+"/data.do"); + Map map = diyFormBiz.queryDiyFormData(diyFormId, appId, page); + if (map!=null) { + if (map.get("fields") != null) { + model.addAttribute("fields", map.get("fields")); + } + if (map.get("list") != null) { + model.addAttribute("list", map.get("list")); + } + } + + model.addAttribute("title", request.getParameter("title")); + model.addAttribute("page", page); + return "/manager/diy/form/diy_form_data_list"; + } + + /** + * 根据id删除自定义表单 + * @param id 自定义表单的自增长id + * @param diyFormId 自定义表单id + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/{diyFormId}/{id}/delete") + @ResponseBody + public void delete(@PathVariable("id") int id,@PathVariable("diyFormId") int diyFormId,HttpServletRequest request,HttpServletResponse response) { + diyFormBiz.deleteQueryDiyFormData(id, diyFormId); + this.outJson(response, null, true); + } + + /** + * 批量删除(返回删除后的页面数) + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/allDelete") + @ResponseBody + public void allDelete(HttpServletRequest request,HttpServletResponse response) { + int pageNo = 1; + //接收页面传来的多选框数组 + String[] ids = request.getParameterValues("ids"); + if (StringUtil.isDoubles(ids)) { + //删除多条自定义模版 + diyFormBiz.deleteAll(ids); + //返回json数据,结束 + this.getHistoryPageNoByCookie(request); + this.outJson(response,null,true,String.valueOf(pageNo)); + }else{ + this.outJson(response,null,false,String.valueOf(pageNo)); + } + } + + /** + * 加载自定义表单页面 + * @param request 请求对象 + * @return 自定义表单页面地址 + */ + @RequestMapping("/add") + public String add(HttpServletRequest request) { + return "/manager/diy/form/diy_form"; + } + + /** + * 加载自定义表单编辑页面 + * @param diyFormId 自定义表单id + * @param model ModelMap实体对象 + * @return 自定义表单编辑页面地址 + */ + @RequestMapping("/{diyFormId}/edit") + public String edit(@PathVariable int diyFormId,ModelMap model){ + DiyFormEntity diyForm = (DiyFormEntity) this.diyFormBiz.getEntity(diyFormId); + model.addAttribute("diyForm", diyForm); + + return "/manager/diy/form/diy_form"; + } + + /** + * 保存自定义表单 + * @param diyForm 自定义表单实体对象 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/save") + public void save(@ModelAttribute DiyFormEntity diyForm,HttpServletRequest request, HttpServletResponse response){ + // 更新前判断数据是否合法 + if(!StringUtil.checkLength(diyForm.getDiyFormTableName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldTipsName"),"1","20")); + return ; + } + if(!StringUtil.checkLength(diyForm.getDiyFormTipsName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldFieldName"),"1","20")); + return ; + } + + // 获取当前管理员实体 + ManagerEntity managerSession = (ManagerEntity) getSession(request, SessionConst.MANAGER_ESSION); + //获取当前管理员Id + int managerId = managerSession.getManagerId(); + //获取实际创建的表名 + String diyFormTableName =TABLE_NAME_PREFIX+managerId+TABLE_NAME_SPLIT+diyForm.getDiyFormTableName(); + //判断是否存在重复的表 + if( this.diyFormBiz.getByTableName(diyFormTableName)!=null){ + this.outJson(response, null, false,this.getResString("err.exist",this.getResString("diy.form.table.name"))); + return; + } + //获取appId + int appId = this.getAppId(request); + //设置appId + diyForm.setDiyFormAppId(appId); + //设置管理员id + diyForm.setDiyFormManagerId(managerId); + //设置自定义表单的表面 + String tableName = TABLE_NAME_PREFIX+managerId+TABLE_NAME_SPLIT+diyForm.getDiyFormTableName(); + diyForm.setDiyFormTableName(tableName); + + //在数据库中创建自定义表单的表 + this.diyFormBiz.createDiyFormTable(diyForm.getDiyFormTableName(), null); + //保存自定义表单实体 + diyFormBiz.saveEntity(diyForm); + int diyFormId = diyFormBiz.getByTableName(tableName).getDiyFormId(); + this.outJson(response, null, true,String.valueOf(diyFormId)); + } + + /** + * 更新自定义表单 + * @param diyForm 自定义表单实体 + * @param response 响应对象 + * @param request 请求对象 + */ + @RequestMapping("/update") + public void update(@ModelAttribute DiyFormEntity diyForm, HttpServletResponse response,HttpServletRequest request){ + // 更新前判断数据是否合法 + if(!StringUtil.checkLength(diyForm.getDiyFormTableName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldTipsName"),"1","20")); + return ; + } + if(!StringUtil.checkLength(diyForm.getDiyFormTipsName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldFieldName"),"1","20")); + return ; + } + + //自增长ID + int diyFormId = diyFormBiz.getByTableName(diyForm.getDiyFormTableName()).getDiyFormId(); + diyForm.setDiyFormId(diyFormId); + //更新自定义表单实体 + diyFormBiz.updateEntity(diyForm); + + this.outJson(response, null, true,String.valueOf(diyFormId)); + } + + /** + * 验证自定义表名合法性 + * @param diyFormTableName 自定义表单表名 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/{diyFormTableName}/checkTableNameExist") + public void checkTable(@PathVariable String diyFormTableName, HttpServletRequest request, HttpServletResponse response){ + // 获取当前管理员实体 + ManagerEntity managerSession = (ManagerEntity) getSession(request, SessionConst.MANAGER_ESSION); + //获取当前管理员Id + int managerId = managerSession.getManagerId(); + //组装表名 + diyFormTableName =TABLE_NAME_PREFIX+managerId+TABLE_NAME_SPLIT+diyFormTableName; + DiyFormEntity diyForm = this.diyFormBiz.getByTableName(diyFormTableName); + if(diyForm==null){ + this.outJson(response, null, false); + } + this.outJson(response, null, true); + } + + /** + * 删除自定义表单 + * @param diyFormId 自定义表单id + * @param response 响应对象 + */ + @RequestMapping("/{diyFormId}/delete") + public void delete(@PathVariable int diyFormId, HttpServletResponse response){ + + //根据表单id查找表单实体 + DiyFormEntity diyForm = (DiyFormEntity) this.diyFormBiz.getEntity(diyFormId); + if(diyForm==null){ + this.outJson(response, null, false,this.getResString("err.not.exist",this.getResString("diy.form"))); + return; + } + diyFormBiz.dropTable(diyForm.getDiyFormTableName()); + diyFormBiz.deleteEntity(diyFormId); + this.outJson(response, null, true); + } +} diff --git a/src/main/java/com/mingsoft/basic/action/DiyFormFieldAction.java b/src/main/java/com/mingsoft/basic/action/DiyFormFieldAction.java new file mode 100644 index 00000000..c2e3207a --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/DiyFormFieldAction.java @@ -0,0 +1,250 @@ +package com.mingsoft.basic.action; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.basic.biz.IDiyFormBiz; +import com.mingsoft.basic.biz.IDiyFormFieldBiz; +import com.mingsoft.basic.entity.DiyFormEntity; +import com.mingsoft.basic.entity.DiyFormFieldEntity; +import com.mingsoft.util.StringUtil; + +/** + * 表单字段义字段管理 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2015-1-10
+ * 历史修订:
+ */ +@Controller("diyFormField") +@RequestMapping("/manager/diy/formField") +public class DiyFormFieldAction extends BaseAction{ + + /** + * 默认的字段id + */ + private static final String FIELD_ID="id"; + + /** + * 默认的字段date + */ + private static final String FIELD_DATE="date"; + + /** + * 默认的字段formId + */ + private static final String FIELD_FORMID="formId"; + + /** + * 注入自定义表单字段biz + */ + @Autowired + private IDiyFormFieldBiz diyFormFieldBiz; + + + /** + * 注入自定义表单biz + */ + @Autowired + private IDiyFormBiz diyFormBiz; + + /** + * 查询字段的列表信息 + * @param diyFormId 自定义表单id + * @param request 请求对象 + * @param response 响应对象 + * @return 包含字段的map集合 + */ + @RequestMapping("/list") + @ResponseBody + public Map list(int diyFormId,HttpServletRequest request, HttpServletResponse response){ + Map map = new HashMap(); + //查询所有的字段信息 + List fieldList = diyFormFieldBiz.queryByDiyFormId(diyFormId); + map.put("fieldList", fieldList); + //获取字段属性 + Map fieldType = this.getfieldType(); + map.put("fieldType",fieldType); + map.put("fieldNum",fieldType.size()); + return map; + } + + /** + * 获取字段属性 + * @return 字段类型 + */ + public Map getfieldType(){ + Map maps = new LinkedHashMap(); + maps = getMapByProperties("com/mingsoft/basic/resources/field_type"); + Map fieldType= new LinkedHashMap(); + Map map= new LinkedHashMap(); + for(Entry entry : maps.entrySet()){ + map.put(Integer.valueOf(entry.getKey()), entry.getValue()); + } + for(int i=1; i<=maps.size(); i++){ + fieldType.put(i, map.get(i)); + } + return fieldType; + } + + /** + * 添加自定义字段 + * @param diyFormfield 自定义字段实体 + * @param diyFormId 自定义表单id + * @param response 响应对象 + */ + @RequestMapping("/{diyFormId}/save") + @ResponseBody + public void save(@ModelAttribute DiyFormFieldEntity diyFormfield,@PathVariable int diyFormId, HttpServletResponse response) { + //获取自定义表单实体 + DiyFormEntity diyForm = (DiyFormEntity) diyFormBiz.getEntity(diyFormId); + if(diyForm==null){ + this.outJson(response, null, false,this.getResString("err.not.exist",this.getResString("diy.form"))); + return; + } + // 更新前判断数据是否合法 + if(!StringUtil.checkLength(diyFormfield.getDiyFormFieldTipsName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldTipsName"),"1","20")); + return ; + } + if(!StringUtil.checkLength(diyFormfield.getDiyFormFieldFieldName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldFieldName"),"1","20")); + return ; + } + + //读取属性配置文件 + Map maps = new LinkedHashMap(); + maps = getMapByProperties("com/mingsoft/basic/resources/field_data_type"); + //动态的修改表结构 + //获取字段信息 + Map fileds = new HashMap(); + //压入字段名 + fileds.put("fieldName", diyFormfield.getDiyFormFieldFieldName()); + //字段的数据类型 + fileds.put("fieldType",maps.get(String.valueOf(diyFormfield.getDiyFormFieldType()))); + fileds.put("default", diyFormfield.getDiyFormFieldDefault()); + //在表中创建字段 + diyFormFieldBiz.alterTable(diyForm.getDiyFormTableName(), fileds,"add"); + this.diyFormFieldBiz.saveEntity(diyFormfield); + this.outJson(response, null, true, null); + } + + /** + * 获取编辑的字段实体的信息 + * @param diyFormFieldId 自定义字段id + * @param request 请求对象 + * @return 返回自定义字段的map集合 + */ + @RequestMapping("/{diyFormFieldId}/edit") + @ResponseBody + public Map edit(@PathVariable int diyFormFieldId, HttpServletRequest request){ + Map mode = new HashMap(); + DiyFormFieldEntity diyFormfield = (DiyFormFieldEntity) diyFormFieldBiz.getEntity(diyFormFieldId); + mode.put("diyFormfield", diyFormfield); + return mode; + } + + /** + * 更新字段信息 + * @param diyFormfield 要更新的字段信息的id + * @param response 响应对象 + */ + @RequestMapping("/update") + @ResponseBody + public void update(@ModelAttribute DiyFormFieldEntity diyFormfield, HttpServletResponse response){ + // 更新前判断数据是否合法 + if(!StringUtil.checkLength(diyFormfield.getDiyFormFieldTipsName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldTipsName"),"1","20")); + return ; + } + if(!StringUtil.checkLength(diyFormfield.getDiyFormFieldFieldName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldFieldName"),"1","20")); + return ; + } + + //获取自定义表单实体 + DiyFormEntity diyForm = (DiyFormEntity) diyFormBiz.getEntity(diyFormfield.getDiyFormFieldFormId()); + //读取属性配置文件 + Map maps = new LinkedHashMap(); + maps = getMapByProperties("com/mingsoft/basic/resources/field_data_type"); + // 获取更改前的字段实体 + DiyFormFieldEntity oldField =(DiyFormFieldEntity) diyFormFieldBiz.getEntity(diyFormfield.getDiyFormFieldId()); + Map fields = new HashMap(); + //更改前的字段名 + fields.put("fieldOldName",oldField.getDiyFormFieldFieldName()); + //新字段名 + fields.put("fieldName",diyFormfield.getDiyFormFieldFieldName()); + //字段的数据类型 + fields.put("fieldType", maps.get(String.valueOf(diyFormfield.getDiyFormFieldType()))); + if(diyForm==null){ + this.outJson(response, null, false,this.getResString("err.not.exist")); + return; + } + // 更新表的字段名 + diyFormFieldBiz.alterTable(diyForm.getDiyFormTableName(), fields, "modify"); + diyFormFieldBiz.updateEntity(diyFormfield); + this.outJson(response, null, true, null); + } + + /** + * 判断字段名是否存在重复 + * @param diyFormFieldFieldName 字段名 + * @param request 请求对象 + * @return true:存在重复,false:不存在重复 + */ + @RequestMapping("/{diyFormFieldFieldName}/checkFieldNameExist") + @ResponseBody + public boolean checkFieldNameExist(@PathVariable String diyFormFieldFieldName, HttpServletRequest request){ + int diyFormFieldFormId = 1; + if(request.getParameter("diyFormFieldFormId")!=null){ + diyFormFieldFormId =Integer.parseInt(request.getParameter("diyFormFieldFormId")); + } + //判断同一表单中是否存在表字段重名 + if(diyFormFieldFieldName.equalsIgnoreCase(FIELD_ID)||diyFormFieldFieldName.equalsIgnoreCase(FIELD_DATE)|| diyFormFieldFieldName.equalsIgnoreCase(FIELD_FORMID)||diyFormFieldBiz.getByFieldName(diyFormFieldFormId, diyFormFieldFieldName)!=null){ + return true; + }else{ + return false; + } + + } + + /** + * 删除自定义字段 + * @param fieldId 表单ID + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/{fieldId}/delete") + public void delete(@PathVariable int fieldId, HttpServletRequest request, HttpServletResponse response) { + // + DiyFormFieldEntity diyFormField = (DiyFormFieldEntity) this.diyFormFieldBiz.getEntity(fieldId); + if(diyFormField ==null){ + this.outJson(response, null, false,this.getResString("err.not.exist",this.getResString("diy.form.field"))); + return; + } + DiyFormEntity diyForm = (DiyFormEntity) this.diyFormBiz.getEntity(diyFormField.getDiyFormFieldFormId()); + if(diyForm==null){ + this.outJson(response, null, false,this.getResString("err.not.exist",this.getResString("diy.form"))); + return; + } + Map fields = new HashMap(); + // 要删除的字段名 + fields.put("fieldName",diyFormField.getDiyFormFieldFieldName()); + //删除列 + diyFormFieldBiz.alterTable(diyForm.getDiyFormTableName(),fields,"drop"); + diyFormFieldBiz.deleteEntity(diyFormField.getDiyFormFieldId()); + this.outJson(response, null,true); + } +} diff --git a/src/main/java/com/mingsoft/basic/action/LoginAction.java b/src/main/java/com/mingsoft/basic/action/LoginAction.java new file mode 100644 index 00000000..3629c9e7 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/LoginAction.java @@ -0,0 +1,182 @@ +package com.mingsoft.basic.action; + +import java.io.File; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authc.UsernamePasswordToken; +import org.apache.shiro.subject.Subject; +import org.hyperic.sigar.SigarException; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.biz.IManagerBiz; +import com.mingsoft.basic.biz.IRoleBiz; +import com.mingsoft.basic.biz.ISystemSkinBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.basic.entity.RoleEntity; +import com.mingsoft.basic.entity.SystemSkinEntity; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.ServerUtil; +import com.mingsoft.util.StringUtil; + +/** + * 登录的基础应用层 + * + * @author 王天培 + * @version 版本号:100-000-000
+ * 创建日期:2015-1-10
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/ms") +public class LoginAction extends BaseAction { + + /** + * 管理员业务层 + */ + @Autowired + private IManagerBiz managerBiz; + + /** + * 角色业务request层 + */ + @Autowired + private IRoleBiz roleBiz; + + /** + * 站点业务层 + */ + @Autowired + private IAppBiz appBiz; + + /** + * 系统皮肤业务处理层 + */ + @Autowired + private ISystemSkinBiz systemSkinBiz; + + /** + * 加载管理员登录界面 + * + * @param request + * 请求对象 + * @return 管理员登录界面地址 + */ + @RequestMapping("/login") + public String login(HttpServletRequest request) { + // 根据请求地址来显示标题 + AppEntity app = this.getApp(request); + // 判断应用实体是否存在 + if (app != null) { + // 检测应用是否有自定义界面b + SystemSkinEntity sse = systemSkinBiz.getByManagerId(app.getAppManagerId()); + if (sse != null && !StringUtil.isBlank(sse.getSystemSkinLoginPage())) { + return "redirect:/" + sse.getSystemSkinLoginPage(); + } + } else { + + File file = new File(this.getRealPath(request, "WEB-INF/ms.install")); + if (file.exists()) { + String defaultId = FileUtil.readFile(this.getRealPath(request, "WEB-INF/ms.install")).trim(); + if (!StringUtil.isBlank(defaultId)) { + app = (AppEntity) appBiz.getEntity(Integer.parseInt(defaultId)); + app.setAppUrl(this.getUrl(request)); + appBiz.updateEntity(app); + // 获取tomcat下面默认的manager文件夹 + File managerFile = new File(request.getSession().getServletContext().getRealPath("/")); + new File(managerFile.getParent() + File.separator + "/manager").delete(); + FileUtil.writeFile(defaultId, this.getRealPath(request, "WEB-INF/ms.install.bak"), Const.UTF8); + file.delete(); + } + } + + } + request.setAttribute("app", app); + + return "/manager/login"; + } + + /** + * 验证登录 + * + * @param manager + * 管理员实体 + * @param request + * 请求 + * @param response + * 响应 + */ + @RequestMapping("/checkLogin") + public void checkLogin(@ModelAttribute ManagerEntity manager, HttpServletRequest request, + HttpServletResponse response) { + AppEntity urlWebsite = null; + urlWebsite = appBiz.getByUrl(this.getDomain(request)); // 根据url地址获取站点信息,主要是区分管理员对那些网站有权限 + if (urlWebsite == null) { + this.outJson(response, ModelCode.ADMIN_LOGIN, false, this.getResString("err")); + return; + } + // 根据账号获取当前管理员信息 + ManagerEntity _manager = managerBiz.queryManagerByManagerName(manager.getManagerName()); + if (_manager == null) { + // 系统不存在此用户 + this.outJson(response, ModelCode.ADMIN_LOGIN, false, this.getResString("err.nameEmpty")); + } else { + // 判断当前用户输入的密码是否正确 + if (StringUtil.Md5(manager.getManagerPassword()).equals(_manager.getManagerPassword())) { + SystemSkinEntity systemSkin = systemSkinBiz.getByManagerId(_manager.getManagerId()); + // 创建管理员session对象 + ManagerSessionEntity managerSession = new ManagerSessionEntity(); + AppEntity website = new AppEntity(); + // 获取管理员所在的角色 + RoleEntity role = (RoleEntity) roleBiz.getEntity(_manager.getManagerRoleID()); + website = (AppEntity) appBiz.getByManagerId(role.getRoleManagerId()); + // 判断当前登录管理员是否为该网站的系统管理员,如果是,如果不是则判断是否为超级管理员 + if (website != null && urlWebsite != null && urlWebsite.getAppId() == website.getAppId() + && _manager.getManagerRoleID() > Const.DEFAULT_SYSTEM_MANGER_ROLE_ID) { + + List childManagerList = managerBiz.queryAllChildManager(managerSession.getManagerId()); + managerSession.setBasicId(website.getAppId()); + managerSession.setManagerParentID(role.getRoleManagerId()); + managerSession.setManagerChildIDs(childManagerList); + managerSession.setStyle(website.getAppStyle()); + // 压入管理员seesion + setSession(request, SessionConst.MANAGER_ESSION, managerSession); + } else { + if (!(_manager.getManagerRoleID() == Const.DEFAULT_SYSTEM_MANGER_ROLE_ID)) { + this.outJson(response, ModelCode.ADMIN_LOGIN, false, this.getResString("err")); + } else { + setSession(request, SessionConst.MANAGER_ESSION, managerSession); + } + } + BeanUtils.copyProperties(_manager, managerSession); + if (systemSkin != null) { + managerSession.setSystemSkin(systemSkin); + } + + Subject subject = SecurityUtils.getSubject(); + UsernamePasswordToken upt = new UsernamePasswordToken(managerSession.getManagerName(), + managerSession.getManagerPassword()); + subject.login(upt); + this.outJson(response, ModelCode.ADMIN_LOGIN, true, null); + } else { + // 密码错误 + this.outJson(response, ModelCode.ADMIN_LOGIN, false, this.getResString("err.password")); + } + } + } + +} diff --git a/src/main/java/com/mingsoft/basic/action/MailAction.java b/src/main/java/com/mingsoft/basic/action/MailAction.java new file mode 100644 index 00000000..385977bb --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/MailAction.java @@ -0,0 +1,105 @@ +package com.mingsoft.basic.action; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.basic.biz.IMailBiz; +import com.mingsoft.basic.constant.e.MailEnum; +import com.mingsoft.basic.entity.MailEntity; +import com.mingsoft.util.StringUtil; + +/** + * 邮箱接口管理层 + * @author 杨新远 + * @version + * 版本号:100-000-000
+ * 创建日期:2015-1-10
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/mail") +public class MailAction extends BaseAction{ + + /** + * 邮箱业务层 + */ + @Autowired + private IMailBiz mailBiz; + + /** + * 加载邮箱接口配置页面并返回邮箱实体 + * @param request 请求对象 + * @param response 响应对象 + * @return 邮箱接口配置页面地址 + */ + @RequestMapping("/mailConfig") + public String mailConfig(HttpServletRequest request, HttpServletResponse response){ + int appId = this.getAppId(request); + MailEntity mailEntity = mailBiz.getByAppId(appId); + request.setAttribute("mailEntity", mailEntity); + return "/manager/mail/mail"; + } + + /** + * 测试邮件接口 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/mailTest") + public void mailTest(HttpServletRequest request, HttpServletResponse response){ + int appId = this.getAppId(request); + String[] toUser = request.getParameterValues("toUser"); + this.sendMail(request, MailEnum.TEXT, "测试邮件-文本", "测试内容", toUser); + this.sendMail(request, MailEnum.HTML, "测试邮件-html文本", "

Hello Html Email 纯屌丝

", toUser); + } + + /** + * 添加邮箱接口 + * @param mailEntity 邮箱实体 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/save") + public void save(@ModelAttribute MailEntity mailEntity,HttpServletRequest request, HttpServletResponse response){ + + if( + StringUtil.isBlank(mailEntity.getMailName()) + ||StringUtil.isBlank(mailEntity.getMailPassword()) + ||StringUtil.isBlank(mailEntity.getMailServer()) + ||StringUtil.isBlank(mailEntity.getMailPort()) + ){ + this.outJson(response,null,false); + return; + } + mailEntity.setMailAppId(this.getAppId(request)); + mailEntity.setMailModelId(this.getModelCodeId(request)); + mailBiz.saveEntity(mailEntity); + this.outJson(response,null,true); + } + + /** + * 更新邮箱接口 + * @param mailEntity 邮箱接口实体 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/update") + public void update(@ModelAttribute MailEntity mailEntity,HttpServletRequest request, HttpServletResponse response){ + if(mailEntity!=null){ + mailEntity.setMailAppId(this.getAppId(request)); + mailBiz.updateEntity(mailEntity); + this.outJson(response,null,true); + return; + } + this.outJson(response,null,false); + } +} + + + + + + diff --git a/src/main/java/com/mingsoft/basic/action/MailTemplateAction.java b/src/main/java/com/mingsoft/basic/action/MailTemplateAction.java new file mode 100644 index 00000000..ca48b153 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/MailTemplateAction.java @@ -0,0 +1,175 @@ +package com.mingsoft.basic.action; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IMailTemplateBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.constant.e.ModelEnum; +import com.mingsoft.basic.entity.MailTemplateEntity; +import com.mingsoft.util.StringUtil; + +/** + * 邮箱模板管理层 + * @author 杨新远 + * @version + * 版本号:100-000-000
+ * 创建日期:2015-1-10
+ * 历史修订:
+ */ +@Controller("mailTemplate") +@RequestMapping("/manager/mail/template") +public class MailTemplateAction extends BaseAction{ + //注入邮件模板业务层 + @Autowired + IMailTemplateBiz mailTemplateBiz; + //注入模块业务层 + @Autowired + private IModelBiz modelBiz; + + /** + * 加载邮箱模板列表页面 + * @param request 请求对象 + * @param model ModelMap实体对象 + * @return 邮箱模板列表页面地址 + */ + @RequestMapping("/list") + public String list(HttpServletRequest request, ModelMap model){ + //得到邮箱模板实体列表(通过站点id) + List mailTemplateList = mailTemplateBiz.queryAllByAppId(this.getAppId(request)); + //返回给页面 + model.addAttribute("mailTemplateList", mailTemplateList); + + //通过模块枚举类的值获取模块实体数组 + List modelEntityList = modelBiz.queryModelByIsMenu(ModelEnum.NOTMENU); + if(!modelEntityList.isEmpty()){ + //将Object类型的数组转为JSON传到页面 + String modelEntityListJson = JSONObject.toJSONString(modelEntityList); + //返回页面 + model.addAttribute("modelEntityList", modelEntityListJson); + } + return "/manager/mail/mail_template_list"; + } + + /** + * 通过 mailTemplateId 查询邮箱模板实体 + * @param mailTemplateId 邮箱模板id + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/getEntity") + public void getEntity(String mailTemplateId,HttpServletRequest request,HttpServletResponse response){ + int mtId = Integer.parseInt(mailTemplateId); + //得到邮箱模板实体 + MailTemplateEntity mailTemplateEntity = (MailTemplateEntity) mailTemplateBiz.getEntity(mtId); + //判断实体是否为空,若不为空输出实体 + if(mailTemplateEntity!=null){ + this.outJson(response,null,true,JSONObject.toJSONString(mailTemplateEntity)); + }else{ + this.outJson(response, null,false); + } + } + + /** + * 保存页面传来的邮箱模板实体 + * @param mailTemplateEntity 邮箱模板实体 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/save") + public void save(@ModelAttribute MailTemplateEntity mailTemplateEntity,HttpServletRequest request, HttpServletResponse response){ + //判断实体是否有值,如果没有则返回false + if( + StringUtil.isBlank(mailTemplateEntity.getMailTemplateContent()) + ||StringUtil.isBlank(mailTemplateEntity.getMailTemplateModelId()) + ){ + this.outJson(response,null,false); + return; + } + //传入的实体中的modelId + int modelId = mailTemplateEntity.getMailTemplateModelId(); + //由于同一个模块id只能对应一个值,所以如果在数据库中已经存在 + //一个modelid对应的邮件模板,那么就返回false + if(mailTemplateBiz.getByAppIdAndModelCode(this.getAppId(request), modelId)!=null){ + this.outJson(response,null,false,this.getResString("err.exist")); + return; + } + //加入站点id + mailTemplateEntity.setMailTemplateAppId(this.getAppId(request)); + //进行持久化 + mailTemplateBiz.saveEntity(mailTemplateEntity); + //返回正确 + this.outJson(response,null,true); + } + + /** + * 更新邮箱模板实体 + * @param mailTemplateEntity 邮箱模板实体 + * @param mailTemplateId 邮箱模板id + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/{mailTemplateId}/update") + public void update(@ModelAttribute MailTemplateEntity mailTemplateEntity, @PathVariable int mailTemplateId,HttpServletRequest request, HttpServletResponse response){ + //判断实体是否为空 + if(mailTemplateEntity!=null){ + mailTemplateEntity.setMailTemplateAppId(this.getAppId(request)); + mailTemplateEntity.setMailTemplateId(mailTemplateId); + mailTemplateBiz.updateEntity(mailTemplateEntity); + this.outJson(response,null,true); + return; + } + this.outJson(response,null,false); + } + + + /** + * 批量删除邮箱模板 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/delete") + public void delete(HttpServletRequest request, HttpServletResponse response){ + //接收页面传来的多选框数组 + String[] ids = request.getParameterValues("radioCategoryId"); + if (StringUtil.isDoubles(ids)) { + //删除多条评论 + mailTemplateBiz.deleteAll(ids); + //返回json数据,结束 + this.outJson(response, null, true,"",this.redirectBack(request,false)); + return ; + } + this.outJson(response,null,false,this.getResString("err")); + return ; + } +} + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/mingsoft/basic/action/MainAction.java b/src/main/java/com/mingsoft/basic/action/MainAction.java new file mode 100644 index 00000000..fae570e9 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/MainAction.java @@ -0,0 +1,212 @@ +package com.mingsoft.basic.action; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IManagerBiz; +import com.mingsoft.basic.biz.IManagerModelPageBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.basic.entity.ManagerModelPageEntity; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.basic.entity.ModelEntity; +import com.mingsoft.util.StringUtil; +/** + * 主界面控制层 + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-7-14
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager") +public class MainAction extends BaseAction { + + /** + * 模块业务层 + */ + @Autowired + private IModelBiz modelBiz; + + /** + * 管理员业务层 + */ + @Autowired + private IManagerBiz managerBiz; + + /** + * 管理员模块页面业务层 + */ + @Autowired + private IManagerModelPageBiz managerModelPageBiz; + + /** + * 加载后台主界面,并查询数据 + * @param request 请求对象 + * @return 主界面地址 + */ + @RequestMapping("/index") + public String index(HttpServletRequest request) { + ManagerSessionEntity managerSession = (ManagerSessionEntity) getManagerBySession(request); + List modelList = new ArrayList(); + modelList = modelBiz.queryModelByRoleId(managerSession.getManagerRoleID()); + request.setAttribute("managerSession", managerSession); + request.setAttribute("modelList", JSONObject.toJSONString(modelList)); + int managerId = managerSession.getManagerId(); + //根据管理员id查找管理员模块页面实体对象 + ManagerModelPageEntity managerModelPage =(ManagerModelPageEntity) managerModelPageBiz.getByManagerIdAndModelId(managerId,0); + //如果存在管理员模块页面实体对象,则返回到页面 + if(managerModelPage!=null){ + request.setAttribute("managerModelPage", managerModelPage); + } + return "/manager/index"; + } + + /** + * 查询该父模块下的子模块 + * @param modelId 模块ID + * @param request 请求对象 + * @return 子模块列表map集合 + */ + @RequestMapping(value = "/{modelId}/queryListByModelId", method = RequestMethod.POST) + @ResponseBody + public Map queryListByModelId(@PathVariable int modelId, HttpServletRequest request) { + Map modelMap = new HashMap(); + List modelList = null; + ManagerSessionEntity managerSession = (ManagerSessionEntity) getManagerBySession(request); + if (isSystemManager(request) && modelId == Const.DEFAULT_CMS_MODEL_ID) { // 若为系统管理员且操作CMS模块 + modelList = modelBiz.queryModelByManagerId(Const.DEFAULT_SYSTEM_MANGER_ROLE_ID, modelId); + } else if (isSystemManager(request)) { // 若为系统管理员且非操作CMS模块 + modelList = modelBiz.queryChildList(modelId); + } else { // 其他管理员 + modelList = modelBiz.queryModelByRoleId(managerSession.getManagerRoleID()); + for (int i = 0; i < modelList.size(); i++) { + ModelEntity model = (ModelEntity) modelList.get(i); + if (model.getModelModelId() != modelId) { + modelList.remove(i); + i--; + } + } + } + modelMap.put("modelList", modelList); + return modelMap; + } + + /** + * 修改登录密码 + * @param response 响应对象 + * @param request 请求对象 + */ + @RequestMapping("/editPassword") + @ResponseBody + public void editPassword(HttpServletResponse response, HttpServletRequest request) { + //获取管理员信息 + ManagerEntity manager = (ManagerEntity) this.getManagerBySession(request); + this.outJson(response, ModelCode.ROLE, false, JSONObject.toJSONString(manager.getManagerName())); + } + + /** + * 修改登录密码,若不填写密码则表示不修改 + * + * @param request + * 请求 + * @param response + * 响应 + */ + @RequestMapping("/updatePassword") + @ResponseBody + public void updatePassword( HttpServletResponse response,HttpServletRequest request) { + //获取旧的密码,MD5加密 + String oldManagerPassword = StringUtil.Md5(request.getParameter("oldManagerPassword")); + //获取新的密码 + String newManagerPassword = request.getParameter("newManagerPassword"); + //获取管理员信息 + ManagerEntity manager = (ManagerEntity) this.getManagerBySession(request); + // 判断新密码和旧密码是否为空 + if (StringUtil.isBlank(newManagerPassword) || StringUtil.isBlank(oldManagerPassword)) { + this.outJson(response, ModelCode.ROLE, false, getResString("err.empty", this.getResString("managerPassword"))); + return; + } + + //判断旧的密码是否正确 + if(!oldManagerPassword.equals(manager.getManagerPassword())){ + this.outJson(response, ModelCode.ROLE, false, getResString("err.password", this.getResString("managerPassword"))); + return; + } + // 判断新密码长度 + if (!StringUtil.checkLength(newManagerPassword, 1, 16)) { + this.outJson(response, ModelCode.ROLE, false, getResString("err.length", this.getResString("managerPassword"), "1", "16")); + return; + } + //更改密码 + manager.setManagerPassword(StringUtil.Md5(newManagerPassword)); + //更新 + managerBiz.updateUserPasswordByUserName(manager); + this.outJson(response, ModelCode.ROLE, true, null); + } + + /** + * 退出系统 + * @param request 请求对象 + * @return true退出成功 + */ + @RequestMapping("/loginOut") + @ResponseBody + public boolean loginOut(HttpServletRequest request) { + removeSession(request, SessionConst.MANAGER_ESSION); + Subject subject = SecurityUtils.getSubject(); + subject.logout(); + return true; + } + + /** + * 加载UI页面 + * @param request + * @return UI页面地址 + */ + @RequestMapping("/ui") + public String ui(HttpServletRequest request) { + return "/manager/ui"; + } + + /** + * 加载UI列表界面 + * @param request + * @return 列表界面地址 + */ + @RequestMapping("/ui/list") + public String list(HttpServletRequest request) { + return "/manager/ui/list"; + } + + /** + * 加载UI的表单页面 + * @param request + * @return 表单页面地址 + */ + @RequestMapping("/ui/form") + public String form(HttpServletRequest request) { + return "/manager/ui/from"; + } +} diff --git a/src/main/java/com/mingsoft/basic/action/ManagerAction.java b/src/main/java/com/mingsoft/basic/action/ManagerAction.java new file mode 100644 index 00000000..df26e08e --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/ManagerAction.java @@ -0,0 +1,433 @@ +package com.mingsoft.basic.action; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.biz.IManagerBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.biz.IRoleBiz; +import com.mingsoft.basic.biz.IRoleModelBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.basic.entity.RoleEntity; +import com.mingsoft.basic.entity.RoleModelEntity; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 管理员控制层 + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-7-14
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/manager") +public class ManagerAction extends BaseAction { + + /** + * 管理员业务层 + */ + @Autowired + private IManagerBiz managerBiz; + + /** + * 角色业务层 + */ + @Autowired + private IRoleBiz roleBiz; + + /** + * 模块业务层 + */ + @Autowired + private IModelBiz modelBiz; + + /** + * 角色模块关联业务层 + */ + @Autowired + private IRoleModelBiz roleModelBiz; + + /** + * 站点业务层 + */ + @Autowired + private IAppBiz appBiz; + + /** + * 普通管理员列表路径 + */ + private final static String PAGE_URL = "/manager/manager/queryList.do"; + + /** + * 加载管理员列表页面并查询管理员列表 + * @param request 请求对象 + * @param model ModelMap实体对象 + * @param response 响应对象 + * @return 管理员列表地址 + */ + @RequestMapping("/queryList") + public String queryList(HttpServletRequest request, ModelMap model, HttpServletResponse response) { + List listManager = new ArrayList(); + ManagerSessionEntity managerSession = getManagerBySession(request); + //若为网站管理员,则显示自己和其创建的子管理员 + if (managerSession.getManagerRoleID() == Const.DEFAULT_WEBSITE_MANGER_ROLE_ID) { + listManager = managerBiz.queryAllChildManager(managerSession.getManagerId()); + listManager.add(managerSession); + } + //若为子管理员,则显示其父管理员下的所有子管理员 + else { + listManager = managerBiz.queryAllChildManager(managerSession.getManagerParentID()); + } + String pageNo = request.getParameter("pageNo"); + if (!StringUtil.isInteger(pageNo)) { + pageNo = "1"; + } + int recordCount = listManager.size(); + PageUtil page = new PageUtil(StringUtil.string2Int(pageNo), recordCount, getUrl(request)+ PAGE_URL); + this.setCookie(request, response, CookieConst.PAGENO_COOKIE, pageNo); + listManager = managerBiz.queryByPage(managerSession.getManagerId(), page, "m.MANAGER_ID", false); + request.setAttribute("managerSession", managerSession); + + List listRole = roleBiz.queryRoleByManagerId(managerSession.getManagerId()); + if(listRole != null){ + model.addAttribute("listRole", listRole); + } + model.addAttribute("listManager", listManager); + model.addAttribute("page", page); + return "/manager/manager/manager"; + } + + /** + * 增加/更新管理员时查询的角色列表 + * @param model Map集合(存放角色的集合) + * @param request 请求 + */ + public void queryRoleList(Map model, HttpServletRequest request){ + ManagerSessionEntity managerSession = getManagerBySession(request); + List listRole = roleBiz.queryRoleByManagerId(managerSession.getManagerId()); + if(listRole != null){ + model.put("listRole", listRole); + } + } + + /** + * 增加/更新管理员时查询的模块列表 + * @param request 请求对象 + * @param model Map集合(存放模块的集合) + */ + public void queryModelList(HttpServletRequest request, Map model){ + ManagerSessionEntity managerSession = getManagerBySession(request); + List listModel = null; + if(managerSession.getManagerRoleID() == Const.DEFAULT_SYSTEM_MANGER_ROLE_ID){ + listModel = modelBiz.queryModelByManager(); + } else { + listModel = modelBiz.queryModelByRoleId(managerSession.getManagerRoleID()); + } + if(!StringUtil.isBlank(listModel)){ + model.put("listModel", listModel); + } + } + + /** + * 增加管理员 返回模块列表以供选择 + * @param request + * @return 模块列表集合 + */ + @RequestMapping("/add") + @ResponseBody + public Map add(HttpServletRequest request) { + Map model = new HashMap(); + //查询的角色列表 + this.queryRoleList(model,request); + //查询的模块列表 + this.queryModelList(request,model); + model.put("flag", true); + model.put("listSelModel", ""); + return model; + } + + /** + * 更新管理员 返回模块列表以供选择和管理员自身信息到更新页面:帐号、昵称、密码、角色 + * @param managerId 管理员id + * @param request 请求对象 + * @return 模块列表集合 + */ + @RequestMapping("/{managerId}/edit") + @ResponseBody + public Map edit(@PathVariable int managerId, HttpServletRequest request) { + Map model = new HashMap(); + //查询的角色列表 + this.queryRoleList(model,request); + //查询的模块列表 + this.queryModelList(request,model); + ManagerEntity manager = (ManagerEntity) managerBiz.getEntity(managerId); + //返回已拥有的模块列表 + List listSelModel = modelBiz.queryModelByRoleId(manager.getManagerRoleID()); + manager.setManagerPassword(null); + model.put("manager", manager); + if(!StringUtil.isBlank(listSelModel)){ + model.put("listSelModel", listSelModel); + } + model.put("flag", false); + return model; + } + + /** + * 表单验证 + * @param manager 管理员实体 + * @param response 响应 + * @return 返回验证结果true:通过,false不通过 + */ + public boolean checkForm(ManagerEntity manager, HttpServletResponse response) { + //验证帐号长度 + if (!StringUtil.checkLength(manager.getManagerName(), 1, 12)) { + this.outJson( response, ModelCode.ROLE, false, getResString("err.length", this.getResString("managerName"), "1", "12")); + return false; + } + //验证昵称长度 + if (!StringUtil.checkLength(manager.getManagerNickName(), 2, 15)) { + this.outJson( response, ModelCode.ROLE, false, getResString("err.length", this.getResString("managerNickName"), "2", "15")); + return false; + } + //若密码为空则表示是从更新模态框传递过来的数据,并且表示不更新管理员,若密码不为空,一定要进行验证 + if(!StringUtil.isBlank(manager.getManagerPassword())){ + //验证密码长度 + if (!StringUtil.checkLength(manager.getManagerPassword(), 1, 16)) { + this.outJson( response, ModelCode.ROLE, false, getResString("err.length", this.getResString("managerPassword"), "1", "16")); + return false; + } + } + return true; + } + + /** + * 保存或修改角色 + * @param role 角色实体 + * @param request + * @param response + * @param flag true:保存 false:更新 + */ + public void saveOrUpdateRole(RoleEntity role,HttpServletRequest request, HttpServletResponse response, boolean flag){ + String oldRoleName = request.getParameter("oldRoleName"); + //若为更新角色,数据库中存在该角色名称且当前名称不为更改前的名称,则属于重名 + if(!flag && roleBiz.countRoleName(role.getRoleName(),role.getRoleManagerId()) != 0 && !role.getRoleName().equals(oldRoleName)){ + this.outJson(response, ModelCode.ROLE, false, getResString("roleName.exist")); + return; + } + if(flag){ + //增加角色 + roleBiz.saveEntity(role); + } else { + //更新角色 + roleBiz.updateEntity(role); + } + int roleId = roleBiz.queryRoleByRoleName(role.getRoleName(), role.getRoleManagerId()).getRoleId(); + //为该角色增加/更新功能模块 + List roleModelList = null; + String modelId[] = request.getParameterValues("modelIds"); + if(!StringUtil.isBlank(modelId)){ + //将获取的模块ID分割成数组 + modelId = modelId[0].split(","); + } + //若没有选择功能模块,则提示错误,并将其数据库中该已存在的模块删除 + if(StringUtil.isBlank(modelId[0])){ + roleModelBiz.deleteEntity(roleId); + return; + } + roleModelList = new ArrayList(); + for(int i=0; i + * 创建日期:2015-01-16
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/managerModelPage") +public class ManagerModelPageAction extends BaseAction{ + /** + * 注入业务层 + */ + @Autowired + private IManagerModelPageBiz managerModelPageBiz; + + /** + * 管理员添加页面模块 + * @param managerModelPage 管理员页面实体 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/save") + public void save(@ModelAttribute ManagerModelPageEntity managerModelPage,HttpServletRequest request, HttpServletResponse response){ + //根据管理员id查找管理员模块页面实体对象 + ManagerModelPageEntity oldManagerModelPage =(ManagerModelPageEntity) managerModelPageBiz.getByManagerIdAndModelId(managerModelPage.getManagerModelPagemanagerId(),managerModelPage.getManagerModelPageModelId()); + //判断记录是否已经存在,如果存在则进行更新 + if(oldManagerModelPage!=null){ + managerModelPageBiz.updateEntity(managerModelPage); + this.outJson(response, null, true); + return; + } + managerModelPageBiz.saveEntity(managerModelPage); + this.outJson(response, null, true); + } + + /** + * 根据管理员id查找实体 + * @param managerModelPageModelId 管理员id + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/{managerModelPageModelId}/getEntity") + public void getEntity(@PathVariable("managerModelPageModelId") int managerModelPageModelId,HttpServletRequest request, HttpServletResponse response){ + //获取 + ManagerSessionEntity managerSession = getManagerBySession(request); + int managerId = managerSession.getManagerId(); + //根据管理员id查找管理员模块页面实体对象 + ManagerModelPageEntity managerModelPage =(ManagerModelPageEntity) managerModelPageBiz.getByManagerIdAndModelId(managerId,managerModelPageModelId); + if(managerModelPage==null){ + this.outJson(response,null, false); + return; + } + this.outJson(response,null, true,JSONObject.toJSONString(managerModelPage)); + } +} diff --git a/src/main/java/com/mingsoft/basic/action/ModelAction.java b/src/main/java/com/mingsoft/basic/action/ModelAction.java new file mode 100644 index 00000000..02be7726 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/ModelAction.java @@ -0,0 +1,212 @@ +package com.mingsoft.basic.action; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IManagerBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.basic.entity.ModelEntity; +import com.mingsoft.util.StringUtil; + +/** + * 模块控制层 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-6-29
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/model") +public class ModelAction extends BaseAction { + + /** + * 注入模块业务层 + */ + @Autowired + private IModelBiz modelBiz; + + @Autowired + private IManagerBiz managerBiz; + + /** + * 增加模块 + * @param model 模块实体 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/save") + @ResponseBody + public void save(@ModelAttribute ModelEntity model, + HttpServletRequest request, HttpServletResponse response) { + //获取管理员id并赋值给模块的id + model.setModelId(getManagerId(request)); + // 获取模块保存时间 + model.setModelDatetime(new Timestamp(System.currentTimeMillis())); + if (!StringUtil.checkLength(model.getModelTitle(), 1, 20) ) { + this.outJson(response,getResString("err.length",this.getResString("modelTitle"),"2","20")); + return; + } + if(!StringUtil.checkLength(model.getModelCode(), 1, 20)){ + this.outJson(response,getResString("err.length",this.getResString("modelCode"),"2","20")); + return; + } + + //判断图标是否为空,不为空去掉,图标地址中含有的“|” + //空值判断 + if(!StringUtil.isBlank(model.getModelIcon())) { + model.setModelIcon( model.getModelIcon().replace("|", "")); + } + modelBiz.saveEntity(model); + //返回模块id到页面 + this.outJson(response, ModelCode.ROLE, true,String.valueOf(model.getModelId())); + } + + /** + * 查询所有模块,以json格式输出 + * @param response 响应对象 + */ + @RequestMapping("/queryAll") + public void queryAll(HttpServletResponse response) { + List modelList = modelBiz.queryAll(); + this.outJson(response, JSONObject.toJSONString(modelList)); + } + + /** + * 根据模块id编辑模块 + * @param modelId 模块id + * @return 模块实体Map集合 + */ + @RequestMapping("/edit/{modelId}") + @ResponseBody + public Map edit( @PathVariable int modelId) { + Map mode = new HashMap(); + List allModel = modelBiz.queryAll(); + mode.clear(); + //根据id获取模块 + ModelEntity model = (ModelEntity) modelBiz.getEntity(modelId); + //根据父模块id查寻模块 + ModelEntity parentModel = (ModelEntity) modelBiz.getEntity(model.getModelModelId()); + mode.put("allModel", allModel); + mode.put("parentModel", parentModel); + mode.put("model", model); + return mode; + } + + /** + * 修改模块 + * @param model 模块实体 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/update") + @ResponseBody + public void update(@ModelAttribute ModelEntity model, + HttpServletRequest request, HttpServletResponse response) { + if (!StringUtil.checkLength(model.getModelTitle(), 2, 20) + || !StringUtil.checkLength(model.getModelCode(), 2, 20)) { + return; + } + //判断图标是否为空,不为空去掉,图标地址中含有的“|” + //空值判断 + if(!StringUtil.isBlank(model.getModelIcon())) { + model.setModelIcon( model.getModelIcon().replace("|", "")); + } + modelBiz.updateEntity(model); + this.outJson(response, ModelCode.ROLE, true,String.valueOf(model.getModelId())); + } + + /** + * 加载模块列表页 + * @param mode ModelMap实体对象 + * @param request 请求对象 + * @return 模块列表页面地址 + */ + @RequestMapping("/list") + public String list(ModelMap mode, HttpServletRequest request) { + List parentModelList = modelBiz.queryAll(); + mode.addAttribute("parentModelList", JSONArray.toJSONString(parentModelList)); + return "/manager/model/model_list"; + } + + /** + * 根据模块id查询所有子模块列表 + * @param modelId 模块id + * @param response 响应对象 + * @return 子模块的map集合 + */ + @RequestMapping("/{modelId}/childlist") + @ResponseBody + public Map childList(@PathVariable int modelId, + HttpServletResponse response) { + Map model = new HashMap(); + List childModelList = modelBiz.queryChildList(modelId); + model.put("chileModelList", childModelList); + return model; + } + + /** + * 根据id查询是否有子模块 + * @param modelId 模块id + * @param response 响应对象 + */ + @RequestMapping("/{modelId}/isChildModel") + @ResponseBody + public void isChildModel(@PathVariable int modelId, HttpServletResponse response) { + int childCount = modelBiz.queryChildList(modelId).size(); + if (childCount > 0) { + this.outJson(response,true); + }else{ + this.outJson(response,modelId); + } + + } + + /** + * 根据Id删除模块 + * @param modelId 模块id + * @param response 响应对象 + */ + @RequestMapping("/{modelId}/delete") + @ResponseBody + public void delete(@PathVariable int modelId, HttpServletResponse response) { + ModelEntity model = (ModelEntity) modelBiz.getEntity(modelId); + modelBiz.deleteEntity(modelId); + this.outJson(response, ModelCode.ROLE, true, + String.valueOf(model.getModelModelId())); + } + + /** + * 根据管理员ID查询模块集合 + * @param managerId 管理员id + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/{managerId}/queryModelByRoleId") + public void queryModelByRoleId(@PathVariable int managerId,HttpServletRequest request, HttpServletResponse response) { + ManagerEntity manager =(ManagerEntity) managerBiz.getEntity(managerId); + if(manager==null){ + return; + } + List modelList = new ArrayList(); + modelList = modelBiz.queryModelByRoleId(manager.getManagerRoleID()); + this.outJson(response, null,true, JSONObject.toJSONString(modelList)); + + } +} diff --git a/src/main/java/com/mingsoft/basic/action/ModelTemplateAction.java b/src/main/java/com/mingsoft/basic/action/ModelTemplateAction.java new file mode 100644 index 00000000..3a9bb6fa --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/ModelTemplateAction.java @@ -0,0 +1,105 @@ +package com.mingsoft.basic.action; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.basic.biz.IModelTemplateBiz; +import com.mingsoft.basic.entity.ModelTemplateEntity; + +/** + * 模块自定义页面 + * @author 王天培 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-6-29
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/modeltemplate/") +public class ModelTemplateAction extends BaseAction { + + /** + * appBiz业务层的注入 + */ + @Autowired + private IModelTemplateBiz modelTemplateBiz; + + /** + * 加载自定义模块列表页面 + * @param mode ModelMap实体对象 + * @param request 请求对象 + * @return 自定义模块列表页面地址 + */ + @RequestMapping(value="/list") + public String list(ModelMap mode,HttpServletRequest request){ + List list = modelTemplateBiz.queryByAppId(this.getAppId(request)); + mode.addAttribute("list", list); + return "/manager/model_template/model_template_list"; + } + + /** + * 加载模块编辑页面 + * @return 模板模块编辑地址 + */ + @RequestMapping(value="/add") + public String add(){ + return "model_template_add"; + } + + /** + * 添加模板模块 + * @param modelTemplate 模板模块实体 + * @param response 响应对象 + * @param request 请求对象 + */ + @RequestMapping(value="/save") + public void save(@ModelAttribute ModelTemplateEntity modelTemplate,HttpServletResponse response,HttpServletRequest request){ + modelTemplate.setModelTemplateAppId(this.getAppId(request)); + modelTemplateBiz.saveEntity(modelTemplate); + this.outJson(response, null, true); + } + + /** + * 根据模板模块id编辑模板模块 + * @param id 模板模块id + * @param response 响应对象 + */ + @RequestMapping(value="/{id}/edit") + public void edit(@PathVariable int id,HttpServletResponse response){ + ModelTemplateEntity modelTemplate = (ModelTemplateEntity) modelTemplateBiz.getEntity(id); + this.outJson(response, null, true, null, JSONObject.toJSONString(modelTemplate)); + } + + /** + * 根据模板模块id更新模板实体 + * @param id 模板模块id + * @param modelTemplate 模板模块实体 + * @param response 响应对象 + */ + @RequestMapping(value="/{id}/update") + public void update(@PathVariable int id,@ModelAttribute ModelTemplateEntity modelTemplate,HttpServletResponse response){ + modelTemplate.setModelTemplateId(id); + modelTemplateBiz.updateEntity(modelTemplate); + this.outJson(response, null, true); + } + + /** + * 根据id删除自定义模块 + * @param id 自定义模块id + * @param response 响应对象 + */ + @RequestMapping(value="/{id}/delete") + public void delete(@PathVariable int id,HttpServletResponse response){ + modelTemplateBiz.deleteEntity(id); + this.outJson(response, null, true); + } +} diff --git a/src/main/java/com/mingsoft/basic/action/RoleAction.java b/src/main/java/com/mingsoft/basic/action/RoleAction.java new file mode 100644 index 00000000..c7f44abc --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/RoleAction.java @@ -0,0 +1,313 @@ +package com.mingsoft.basic.action; +import java.util.ArrayList; +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IManagerBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.biz.IRoleBiz; +import com.mingsoft.basic.biz.IRoleModelBiz; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.basic.entity.RoleEntity; +import com.mingsoft.basic.entity.RoleModelEntity; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 角色控制层 + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-7-14
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/role") +public class RoleAction extends BaseAction{ + + /** + * 角色业务层 + */ + @Autowired + private IRoleBiz roleBiz; + + /** + * 模块业务层 + */ + @Autowired + private IModelBiz modelBiz; + + /** + * 管理员业务层 + */ + @Autowired + private IManagerBiz managerBiz; + + /** + * 角色模块关联业务层 + */ + @Autowired + private IRoleModelBiz roleModelBiz; + + /** + * 普通管理员角色列表路径 + */ + private final static String PAGE_URL = "/manager/role/queryList.do"; + + /** + * 加载角色列表页面并查询角色查询 + * @param request 请求对象 + * @param mode ModelMap实体对象 + * @param response 响应对象 + * @return 角色列表页面地址 + */ + @RequestMapping("/queryList") + public String queryList(HttpServletRequest request, ModelMap mode, HttpServletResponse response){ + List listRole = new ArrayList(); + ManagerSessionEntity managerSession = getManagerBySession(request); + String pageNo = request.getParameter("pageNo"); + if (!StringUtil.isInteger(pageNo)) { + pageNo = "1"; + } + int recordCount = roleBiz.getCountByManagerId(managerSession.getManagerId()); + PageUtil page = new PageUtil(StringUtil.string2Int(pageNo),recordCount, getUrl(request) + PAGE_URL); + this.setCookie(request, response, CookieConst.PAGENO_COOKIE, pageNo); + String url = "/manager/role/queryList.do"; + //压入返回的url地址 + this.setCookie(request, response, CookieConst.BACK_COOKIE,url+"?pageNo="+pageNo); + listRole = roleBiz.queryByPage(managerSession.getManagerId(), page, "ROLE_ID", false); + mode.addAttribute("listRole",listRole); + mode.addAttribute("page", page); + mode.addAttribute("managerRoleId", managerSession.getManagerRoleID()); + return "/manager/role/role_list"; + } + + /** + * 增加/更新角色时查询的模块列表 + * @param model ModelMap实体对象 + * @param request 请求 + */ + public void queryModelList(HttpServletRequest request,ModelMap model){ + ManagerSessionEntity managerSession = getManagerBySession(request); + List listModel = modelBiz.queryModelByRoleId(managerSession.getManagerRoleID()); + if(!StringUtil.isBlank(listModel)){ + model.addAttribute("listModel", JSONObject.toJSONString(listModel)); + } + } + + /** + * 加载添加角色界面 + * @param request 请求对象 + * @param model ModelMap实体对象 + * @return 添加角色界面地址 + */ + @RequestMapping("/add") + public String add(HttpServletRequest request, ModelMap model){ + //查询的模块列表 + this.queryModelList(request,model); + model.addAttribute("flag", true); + return "/manager/role/role"; + } + + /** + * 更新角色 + * @param roleId 角色id + * @param model ModelMap实体对象 + * @param request 请求对象 + * @return 角色编辑页面地址 + */ + @RequestMapping("/{roleId}/edit") + public String edit(@PathVariable int roleId,ModelMap model,HttpServletRequest request){ + if(roleId == 0){ + return "/manager/role/list"; + } + //查询的模块列表 + this.queryModelList(request,model); + RoleEntity role = (RoleEntity)roleBiz.getEntity(roleId); + List listSelModel = modelBiz.queryModelByRoleId(roleId); + model.addAttribute("role",role); + if(!StringUtil.isBlank(listSelModel)){ + model.addAttribute("listSelModel", listSelModel); + } + model.addAttribute("flag", false); + return "/manager/role/role"; + + } + + /** + * 表单验证 + * @param role 角色实体 + * @param response 响应 + * @return 返回验证结果 + */ + public boolean validateForm(RoleEntity role, HttpServletResponse response) { + //判断角色名称的长度 + if(!StringUtil.checkLength(role.getRoleName(), 2, 8)){ + this.outJson(response, ModelCode.ROLE, false, getResString("err.length", this.getResString("rolrName"), "2", "8")); + return false; + } + //验证该角色名称是否已存在 + if(roleBiz.countRoleName(role.getRoleName(),role.getRoleManagerId()) != 0){ + this.outJson(response, ModelCode.ROLE, false, getResString("err.exist",this.getResString("rolrName"))); + return false; + } + return true; + } + + /** + * 增加/更新角色 + * @param role 角色实体 + * @param request 请求 + * @param response 响应 + * @param flag 判断是增加还是更新 true:增加 false:更新 + */ + public void saveOrUpdateRole(RoleEntity role,HttpServletRequest request, HttpServletResponse response, boolean flag){ + //验证表单 + if (!this.validateForm(role, response)) { + return; + } + //若为更新角色,数据库中存在该角色名称且当前名称不为更改前的名称,则属于重名 + if(!flag && roleBiz.countRoleName(role.getRoleName(),role.getRoleManagerId()) != 0 && !role.getRoleName().equals(request.getParameter("oldRoleName"))){ + this.outJson(response, ModelCode.ROLE, false, getResString("roleName.exist")); + return; + } + ManagerSessionEntity managerSession = getManagerBySession(request); + //设置该角色创建者ID + role.setRoleManagerId(managerSession.getManagerId()); + if(flag){ + //增加角色 + roleBiz.saveEntity(role); + } else { + //更新角色 + roleBiz.updateEntity(role); + } + //为该角色增加/更新功能模块 + List roleModelList = null; + String modelId[] = request.getParameterValues("modelId"); + if(!StringUtil.isBlank(modelId)){ + //将获取的模块ID分割成数组 + modelId = modelId[0].split(","); + } + //若没有选择功能模块,则提示错误,并将其数据库中该已存在的模块删除 + if(StringUtil.isBlank(modelId[0])){ + roleModelBiz.deleteEntity(role.getRoleId()); + this.outJson(response, ModelCode.ROLE, false, getResString("err.modelNoSelected")); + return; + } + roleModelList = new ArrayList(); + for(int i=0; i + * 创建日期:2015-1-10
+ * 历史修订:
+ */ +@Controller +@RequestMapping("/manager/systemSkin/") +public class SystemSkinAciton extends BaseAction{ + + /** + * 主题业务 + */ + @Autowired + private ISystemSkinBiz systemSkinBiz; + + /** + * 通过系统主题id更新主题 + * @param request 请求对象 + * @param response 响应对象 + * @param systemSkinId 系统主题id + */ + @RequestMapping("/{systemSkinId}/updateForManager") + @ResponseBody + public void updateForManager(HttpServletRequest request,HttpServletResponse response,@PathVariable int systemSkinId){ + ManagerSessionEntity mse = this.getManagerBySession(request); + SystemSkinEntity sse = systemSkinBiz.updateManagerSystemSkin(mse.getManagerId(), systemSkinId); + if (sse!=null) { + mse.setSystemSkin(sse); + this.setSession(request, SessionConst.MANAGER_ESSION, mse); + } + } + + /** + * 查询所有主题以json格式返回list集合 + * @param request 请求对象 + * @param response 响应对象 + */ + @RequestMapping("/query") + @ResponseBody + public void query(HttpServletRequest request,HttpServletResponse response){ + List list = systemSkinBiz.queryAll(); + this.outJson(response, JSONArray.toJSONString(list)); + } +} diff --git a/src/main/java/com/mingsoft/basic/action/web/CategoryAction.java b/src/main/java/com/mingsoft/basic/action/web/CategoryAction.java new file mode 100644 index 00000000..9ede8a43 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/web/CategoryAction.java @@ -0,0 +1,82 @@ +package com.mingsoft.basic.action.web; + +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.basic.biz.ICategoryBiz; +import com.mingsoft.basic.entity.CategoryEntity; + +/** + * 供前端查询分类信息使用 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Controller("webCategory") +@RequestMapping("/category") +public class CategoryAction extends BaseAction{ + + /** + * 分类业务处理层注入 + */ + @Autowired + private ICategoryBiz categoryBiz; + + /** + * 根据分类id查找其父分类实体,如果父分类不存在则返回该分类实体 + * @param categoryId 分类ID + * @param request HttpServletRequest对象 + * @param response HttpServletResponse对象 + */ + @RequestMapping("/{categoryId}/getParentCategory") + @ResponseBody + public void getParentCategory(@PathVariable int categoryId,HttpServletRequest request, HttpServletResponse response){ + CategoryEntity category = this.categoryBiz.getCategory(categoryId); + if(category!=null){ + CategoryEntity paCategory = categoryBiz.getCategory(category.getCategoryCategoryId()); + if(paCategory==null){ + this.outJson(response, JSONObject.toJSONString(category)); + } + this.outJson(response, JSONObject.toJSONString(paCategory)); + } + } + + /** + * 获取指定站点下的省份数据 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse对象 + */ + @RequestMapping("/queryProvince") + @ResponseBody + public void queryProvince(HttpServletRequest request, HttpServletResponse response){ + int appId = this.getAppId(request); + //获取省数据 + ListlistProvince = categoryBiz.queryByAppIdOrModelId(appId,this.getModelCodeId(request,com.mingsoft.base.constant.ModelCode.CITY)); + this.outJson(response,JSONObject.toJSONStringWithDateFormat(listProvince,"yyyy-MM-dd HH:mm:ss")); + } + + /** + * 根据指定分类id查询其子分类 + * @param categoryId 分类id + * @param request HttpServletRequest对象 + * @param response HttpServletResponse对象 + */ + @RequestMapping("/{categoryId}/queryChildren") + public void queryChildren(@PathVariable int categoryId,HttpServletRequest request, HttpServletResponse response){ + CategoryEntity category = (CategoryEntity) this.categoryBiz.getEntity(categoryId); + if(category!=null){ + List list = this.categoryBiz.queryChilds(category); + this.outJson(response, JSONObject.toJSONStringWithDateFormat(list,"yyyy-MM-dd HH:mm:ss")); + } + } + +} diff --git a/src/main/java/com/mingsoft/basic/action/web/DiyFormAction.java b/src/main/java/com/mingsoft/basic/action/web/DiyFormAction.java new file mode 100644 index 00000000..6e4d9b66 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/web/DiyFormAction.java @@ -0,0 +1,99 @@ +package com.mingsoft.basic.action.web; + +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSON; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.basic.biz.IDiyFormBiz; +import com.mingsoft.util.PageUtil; +import com.mingsoft.base.constant.SessionConst; + +/** + * 通用自定义表单 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Controller("webDiyForm") +@RequestMapping("/from") +public class DiyFormAction extends BaseAction{ + + /** + * 自定义表单业务处理层 + */ + @Autowired + IDiyFormBiz diyFormBiz; + + /** + * 保存 + * @param idBase64 Base64编码数据 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse对象 + */ + @RequestMapping("{idBase64}") + @ResponseBody + public void save(@PathVariable("idBase64") String idBase64,HttpServletRequest request,HttpServletResponse response) { + String temp =this.decryptByAES(request, idBase64); + + Object obj = this.getSession(request, SessionConst.CODE_SESSION); + if (obj!=null) { + if (!this.checkRandCode(request)) { + this.outJson(response, null, false); + return; + } + } + int formId = Integer.parseInt(temp); + if (formId !=0 ) { + LOG.debug("fromId:" + formId); + diyFormBiz.saveDiyFormData(formId,assemblyRequestMap(request)); + this.outJson(response, null, true); + + } + } + + /** + * 提供前端查询自定义表单提交数据 + * @param idBase64 Base64编码数据 + * @param request + * @param response + */ + @RequestMapping("{idBase64}/queryData") + @ResponseBody + public void queryData(@PathVariable("idBase64") String idBase64,HttpServletRequest request,HttpServletResponse response){ + String temp =this.decryptByAES(request, idBase64); + //获取自定义表单的id + int formId = Integer.parseInt(temp); + if (formId !=0 ) { + int appId = this.getAppId(request); + //当前页面 + int pageNo = this.getPageNo(request); + //每页显示数量 + int pageSize = this.getInt(request, "pageSize",10); + //提交记录总数 + int count = diyFormBiz.countDiyFormData(formId, appId); + PageUtil page = new PageUtil(pageNo,pageSize,count,""); + Map map = diyFormBiz.queryDiyFormData(formId, appId, page); + if (map!=null) { + if (map.get("list") != null) { + this.outJson(response, JSON.toJSONString(map.get("list"))); + return; + } + } + this.outJson(response, null); + + } + + } + +} diff --git a/src/main/java/com/mingsoft/basic/action/web/MailAction.java b/src/main/java/com/mingsoft/basic/action/web/MailAction.java new file mode 100644 index 00000000..1174de65 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/action/web/MailAction.java @@ -0,0 +1,53 @@ +package com.mingsoft.basic.action.web; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.util.StringUtil; + +/** + * 自由调用邮箱层 + * @author 杨新远 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Controller("webMail") +@RequestMapping("/mail") +public class MailAction extends BaseAction{ + /** + * 自由调用邮箱 + * @param peopleMail 邮件地址 + * @param modelCode 模块编码(AES加密过的) + * @param request HttpServletRequest对象 + * @param response HttpServletResponse对象 + */ + @RequestMapping("{peopleMail}/sendMail") + public void sendMail(String peopleMail,String modelCode,HttpServletRequest request,HttpServletResponse response) { + + //后台验证传来的用户邮箱地址是否合法 + if(!StringUtil.isEmail(peopleMail)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.msg.mail.error")); + return; + } + //验证模块编码是否为空 + if(StringUtil.isBlank(modelCode)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.dataType")); + return; + } + //获取验证码 + String peopleCode= StringUtil.randomNumber(6); + //解密 + String _modelCode = this.decryptByAES(request, modelCode); + //将邮箱地址压如String数组 + String[] user={peopleMail}; + //发送邮箱 + this.sendMail(request, _modelCode, user,peopleCode); + //返回操作成功信息 + this.outJson(response, null, true, this.getResString("ok")); + } +} diff --git a/src/main/java/com/mingsoft/basic/aop/DownloadAdvice.java b/src/main/java/com/mingsoft/basic/aop/DownloadAdvice.java new file mode 100644 index 00000000..4a3dafb0 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/aop/DownloadAdvice.java @@ -0,0 +1,68 @@ +package com.mingsoft.basic.aop; + +import java.util.Date; + +import javax.servlet.http.HttpSession; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.base.constant.SessionConst; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 + * QQ:78750478 + * + *

+ * Comments:分期模块管理操作订单状态日志 + *

+ * + *

+ * Create Date:2015-2-11 + *

+ * + *

+ * Modification history: + *

+ */ +// @Aspect : 标记为切面类 +// @Pointcut : 指定匹配切点集合 +// @Before : 指定前置通知,value中指定切入点匹配 +// @AfterReturning :后置通知,具有可以指定返回值 +//@AfterThrowing :异常通知 +//注意:前置/后置/异常通知的函数都没有返回值,只有环绕通知有返回值 +@Component +// 首先初始化切面类 +@Aspect +// 声明为切面类,底层使用动态代理实现AOP +public class DownloadAdvice { + + // 指定切入点匹配表达式,注意它是以方法的形式进行声明的。 + // 即切点集合是:aop.annotation包下所有类所有方法 + // 第一个* 代表返回值类型 + // 如果要设置多个切点可以使用 || 拼接 + // and args(com.mingsoft.order.entity.OrderEntity + @Pointcut(" execution(* com.mingsoft.basic.servlet.DownloadServlet.doGet(..) ) ") + public void doGet() {} + + + @Around("doGet()") + public void doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable { + } +} diff --git a/src/main/java/com/mingsoft/basic/biz/IAppBiz.java b/src/main/java/com/mingsoft/basic/biz/IAppBiz.java new file mode 100644 index 00000000..5fb9fdea --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IAppBiz.java @@ -0,0 +1,34 @@ +package com.mingsoft.basic.biz; + +import com.mingsoft.basic.entity.AppEntity; + +/** + * 网站基本信息业务层接口 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IAppBiz extends IBasicBiz{ + + /** + * 查找域名相同站点的个数 + * @param websiteUrl 域名 + * @return 返回站点个数 + */ + int countByUrl(String websiteUrl); + + /** + * 根据站点管理员id查找站点 + * @param managerId 站点管理员id + * @return 返回站点实体 + */ + AppEntity getByManagerId(int managerId); + /** + * 根据站点域名获取站点实体 + * @param websiteUrl 域名 + * @return 返回站点实体 + */ + AppEntity getByUrl(String websiteUrl); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IBasicAttentionBiz.java b/src/main/java/com/mingsoft/basic/biz/IBasicAttentionBiz.java new file mode 100644 index 00000000..3cdfe240 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IBasicAttentionBiz.java @@ -0,0 +1,95 @@ +/** + * + */ +package com.mingsoft.basic.biz; + +import java.util.List; + + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.BasicAttentionEntity; +import com.mingsoft.util.PageUtil; + +/** + * + *

+ * <铭飞科技-基础/b> + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 成卫雄 + * QQ:330216230 + * + *

+ * Comments:关注业务层接口 + *

+ * + *

+ * Create Date:2014-11-12 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IBasicAttentionBiz extends IBaseBiz{ + + /** + * 根据basicId,关注类型,用户ID,AppId查询
+ * 查询用户是否关注过该商品
+ * @param basicAttention 保存basicId,关注类型,用户ID,AppId查询的关注实体 + * @return + */ + public BasicAttentionEntity getEntityByPeopleAttention(BasicAttentionEntity basicAttention); + + /** + * 根据用户ID和APPID查询用户关注内容列表开始(带分页) + * @param peopleId 用户ID + * @param appId 应用ID + * @param attentionType 类型 + * @param page 分页 + * @return 用户关注列表 + */ + public List queryPageByPeopleIdAndAppId(int peopleId,int appId,int attentionType,PageUtil page); + + /** + * 根据用户ID和APPID查询用户关注内容列表开始(带分页) + * @param peopleId 用户ID + * @param appId 应用ID + * @param attentionType 类型 + * @param modelId 模块编号,主要区分文章的收藏与商品的收藏,等其他的 + * @param page 分页 + * @return 用户关注列表 + */ + public List queryPageByPeopleIdAndAppId(int peopleId,int appId,int attentionType,int modelId,PageUtil page); + + + /** + * 根据用户ID和APPID查询用户关注内容数量 + * @param peopleId 用户ID + * @param appId 应用ID + * @param attentionType 类型 + * @return 数量 + */ + public int queryCountByPeopleIdAndAppId(int peopleId,int appId,int attentionType); + + /** + * 根据用户ID和APPID查询用户关注内容数量 + * @param peopleId 用户ID + * @param appId 应用ID + * @param modelId 模块编号,主要区分文章的收藏与商品的收藏,等其他的 + * @param attentionType 类型 + * @return 数量 + */ + public int queryCountByPeopleIdAndAppId(int peopleId,int appId,int attentionType,int modelId); + + /** + * 根据收藏id数组和用户id删除收藏记录 + * @param ids 收藏id数组 + * @param peopleId 用户id + */ + public void delete(String[] ids,int peopleId); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IBasicBiz.java b/src/main/java/com/mingsoft/basic/biz/IBasicBiz.java new file mode 100644 index 00000000..21e63cd5 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IBasicBiz.java @@ -0,0 +1,108 @@ +package com.mingsoft.basic.biz; + +import java.util.List; +import java.util.Map; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.BasicEntity; +import com.mingsoft.util.PageUtil; + +/** + * 基本信息的业务层接口 + * @author 荣繁奎 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IBasicBiz extends IBaseBiz { + + /** + * 保存基本信息实体 + * @param basic basic实体 + * @return 返回编号,确认是否保存 + */ + int saveBasic(BasicEntity basic); + + /** + * 更新基本信息实体 + * @param basic basic实体 + */ + void updateBasic(BasicEntity basic); + + /** + * 删除基本信息实体 + * @param basicId 信息编号 + */ + void deleteBasic(int basicId); + + /** + * 获取基本信息实体 + * @param basicId 信息编号 + * @return 返回基本信息实体 + */ + BasicEntity getBasicEntity(int basicId); + + /** + * 根据点击次数 + * @param basicId 信息编号 + * @param num null:为递增 + */ + void updateHit(int basicId,Integer num); + + /** + * 根据分类统计总数 + * @param categoryId 分类编号 + * @return 返回统计总数 + */ + int count(int categoryId); + + /** + * 根据分类与关键子统计总数 + * @param categoryId 分类编号 + * @param keyWord 关键字 + * @return 返回统计总数 + */ + int count(int categoryId,String keyWord); + + + /** + * 根据分类查询 + * @param categoryId  分类编号 + * @return 返回信息实体集合 + */ + List query(int categoryId); + + /** + * 根据分类与关键子统计总数 + * @param categoryId 分类编号 + * @param keyWord 关键字 + * @return 返回信息实体集合 + */ + List query(int categoryId,String keyWord); + + + /** + * 根据分类与关键子统计总数 + * @param appId 应用编号 + * @param categoryId 分类编号 + * @param keyWord 关键字 + * @param page 分页 + * @param modelId 模块编号 + * @param where 条件 + * @return 返回信息实体集合 + */ + List query(Integer appId,Integer categoryId,String keyWord,PageUtil page,Integer modelId,Map where); + + /** + * 获取当前文章basicId的上一篇与下一篇 + * @param basicId 当前文章 + * @return 返回信息实体集合 list.get(0):上一篇list.get(1): 下一篇 + */ + List getPreviousAndNext(int basicId); + + /** + * 根据id集合删除 + * @param basicIds 基本信息实体id集合 + */ + void deletes(String[] basicIds); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IBasicCategoryBiz.java b/src/main/java/com/mingsoft/basic/biz/IBasicCategoryBiz.java new file mode 100644 index 00000000..2fcf955a --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IBasicCategoryBiz.java @@ -0,0 +1,36 @@ +package com.mingsoft.basic.biz; + +import java.util.List; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.BasicCategoryEntity; + +/** + * 类别基础信息关联业务层接口 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IBasicCategoryBiz extends IBaseBiz{ + + /** + * 批量更新基础分类关联表 + * @param basicCategoryList 基础分类列表实体 + */ + void updateBatch(List basicCategoryList); + + /** + * 根据baiscId查询基础分类关联信息 + * @param bcBasicId 基础basicId + * @return 返回基础分类关联列表信息 + */ + List queryByBasicId(int bcBasicId); + + /** + * 根据分类id集合去查询符合条件的basicId集合 + * @param categoryIds 分类id集合 + * @return 返回basicId集合 + */ + List queryBasicIdsByCategoryId(int[] categoryIds); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IBasicChildBiz.java b/src/main/java/com/mingsoft/basic/biz/IBasicChildBiz.java new file mode 100644 index 00000000..8879dfd2 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IBasicChildBiz.java @@ -0,0 +1,37 @@ +package com.mingsoft.basic.biz; + +import java.util.List; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.BasicChildEntity; + +/** + + * 基础表之间的子父关联关系业务层接口 + + * @author 史爱华 QQ:924690193 + + * @version + + * 版本号:100-000-000
+ + * 创建日期:2015-08-21
+ + * 历史修订:
+ + */ +public interface IBasicChildBiz extends IBaseBiz{ + + /** + * 根据基础表id删除数据 + * @param basicId 基础表id + */ + void delete(int basicId); + + /** + * 根据基础表id查询基础表关联数据集合 + * @param basicId 基础表id + * @return 基础表关联数据集合 + */ + List queryByBasicId(int basicId); +} diff --git a/src/main/java/com/mingsoft/basic/biz/ICategoryBiz.java b/src/main/java/com/mingsoft/basic/biz/ICategoryBiz.java new file mode 100644 index 00000000..39e859b2 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/ICategoryBiz.java @@ -0,0 +1,208 @@ +package com.mingsoft.basic.biz; + +import java.util.List; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.CategoryEntity; +import com.mingsoft.util.PageUtil; + + +/** + * 类别业务层接口,继承接口IBaseBiz + * @author 刘继平 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface ICategoryBiz extends IBaseBiz { + + /** + * 添加类别
有拓展表继承时使用
+ * + * @param categoryEntity 类别实体 + * @return 返回类别ID + */ + public int saveCategory(CategoryEntity categoryEntity); + + /** + * 添加类别
没有拓展表继承时使用
+ * + * @param categoryEntity 类别实体 + * @return 返回类别ID + */ + public int saveCategoryEntity(CategoryEntity categoryEntity); + + /** + * 根据分类标题和分类的模块ID查询该分类是否存在
若存在则不持久化直接返回数据库中原来的数据
若不存在则持久化并返回实体信息 + * + * @param categoryTitle + * 分类标题 + * @param categoryCategoryId + * 父ID + * @param categoryModelId + * 模块ID + * @return 返回分类实体 + */ + public CategoryEntity saveByCategoryTitle(String categoryTitle, int categoryCategoryId, int categoryModelId); + + /** + * 类别更新
有拓展表继承时使用
+ * + * @param categoryEntity 类别实体 + */ + public void updateCategory(CategoryEntity categoryEntity); + + /** + * 类别更新
没有拓展表继承时使用
+ * + * @param categoryEntity 类别实体 + */ + public void updateCategoryEntity(CategoryEntity categoryEntity); + + /** + * 删除类别
有拓展表继承时使用
+ * + * @param categoryId 类别ID + */ + public void deleteCategory(int categoryId); + + /** + * 删除类别
没有拓展表继承时使用
+ * + * @param categoryId 类别ID + */ + public void deleteCategoryEntity(int categoryId); + + /** + * 获取类别 + * + * @param categoryId 类别ID + * @return 返回类别实体 + */ + public CategoryEntity getCategory(int categoryId); + + /** + * 分页查询
查询分类集合
+ * + * @param category + * 查询条件 + * @param page + * 对象,主要封装分页的方法 + * @param orderBy + * 排序字段 + * @param order + * 排序方式true:asc false:desc + * @return 返回分类集合 + */ + public List queryByPageList(CategoryEntity category, PageUtil page, String orderBy, boolean order); + + /** + * 根据分类ID查询子分类
+ * + * @param category 分类实体 + * @return 返回分类集合 + */ + public List queryChilds(CategoryEntity category); + + /** + * 根据分类ID查询子分类总数
+ * + * @param category 分类实体 + * @return 返回子分类总数 + */ + public int count(CategoryEntity category); + + /** + * 根据modelId查询分类 + * + * @param category 分类实体 + * @return 返回分类集合 + */ + public List queryByModelId(CategoryEntity category); + + /** + * 根据分类名称查询分类ID集合(课表数据采集使用) + * + * @param categoryTitle 分类名称 + * @param categoryModelId 模块ID + * @return 返回分类集合 + */ + public List queryCategoryIdByTitle(String categoryTitle, int categoryModelId); + + /** + * 根据学校名称查询该学校所有专业ID + * + * @param categoryTitle + * 学校名称 + * @param fatherModelId + * 系所属模块ID + * @param sonModelId + * 学校所属模块ID + * @return 返回该学校下专业ID的集合 + */ + public List queryCategoryIdByCategoryTitle(String categoryTitle, int fatherModelId, int sonModelId); + + /** + * 根据ID批量查询分类实体 + * + * @param listId ID集合 + * @return 返回分类实体集合 + */ + public List queryBatchCategoryById(List listId); + + /** + * 查询当前分类下面的子分类 + * + * @param categoryId 当前分类编号 + * @param appId 应用编号 + * @return 返回子分类列表集合 + */ + public List queryChildrenCategory(int categoryId, int appId,int modelId); + + /** + * 查询当前分类下面的子分类的id + * + * @param categoryId 当前分类编号 + * @return appId 应用编号 + * @return 返回子分类id集合 + */ + public List queryChildrenCategoryIds(int categoryId, int appId,int modelId); + + /** + * 根据应用编号与模块编号查询分类 + * + * @param appId 应用编号 + * @param modelId 模块编号 + * @return 返回分类集合 + */ + public List queryByAppIdOrModelId(Integer appId, Integer modelId); + + /** + * 递归活取父栏目, + * @param appId + * 应用编号 + * @param modelId + * 模块编号 + * @param categoryId 可选 + * @return 返回分类集合 + */ + public List queryParent(int appId, int modelId,Integer categoryId); + + /** + * 主要用于属性查询 + * @param appId 应用id + * @param modelId 模块id + * @param categoryDescription 分类描述 + * @return 返回分类列表 + */ + public List queryByDescription(int appId, int modelId,String categoryDescription); + + /** + * 根据应用id和模块id查询分类id的集合 + * @param appId 应用id + * @param modelId 模块id + * @return 返回ID集合 + */ + public List queryCategoryIdsByModelIdAndAppId(int appId,int modelId); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IDiyFormBiz.java b/src/main/java/com/mingsoft/basic/biz/IDiyFormBiz.java new file mode 100644 index 00000000..d1cc1a4d --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IDiyFormBiz.java @@ -0,0 +1,77 @@ +package com.mingsoft.basic.biz; + +import java.util.List; +import java.util.Map; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.DiyFormEntity; +import com.mingsoft.util.PageUtil; + +/** + * 自定义表单接口 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IDiyFormBiz extends IBaseBiz{ + + /** + * 保存自定义表单的数据 + * @param formId 表单编号 + * @param params 参数值集合 + */ + void saveDiyFormData( int formId,Map params); + + /** + * 查询自定义表单的数据 + * @param diyFormId 自定义表单ID + * @param appId 站点ID + * @param page PageUtil实体 + * @return 返回map fileds:字段列表 list:记录集合 + */ + Map queryDiyFormData(int diyFormId,int appId,PageUtil page); + + /** + * 删除记录 + * @param id 记录编号 + * @param diyFormId 表单编号 + */ + void deleteQueryDiyFormData(int id,int diyFormId); + + /** + * 查询总数 + * @param diyFormId 表单ID + * @param appId 站点ID + * @return 返回查询总数 + */ + int countDiyFormData(int diyFormId,int appId); + + /** + * 查询列表 + * @param appId 应用编号 + * @return 返回列表集合 + */ + List query(int appId); + + /** + * 根据表单名称获取表单实体 + * @param diyFormTableName 表单名称 + * @return 返回表单实体 + */ + DiyFormEntity getByTableName(String diyFormTableName); + + /** + * 创建表 + * @param table 表名称 + * @param fileds Map,key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填 + */ + @SuppressWarnings("rawtypes") + void createDiyFormTable(String table,Map fileds); + + /** + * 多选删除 + * @param ids 前端传来的勾选的checkbox的序列化id值 + */ + void deleteAll(String[] ids); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IDiyFormFieldBiz.java b/src/main/java/com/mingsoft/basic/biz/IDiyFormFieldBiz.java new file mode 100644 index 00000000..63c5f97e --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IDiyFormFieldBiz.java @@ -0,0 +1,32 @@ +package com.mingsoft.basic.biz; + +import java.util.List; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.DiyFormFieldEntity; + +/** + * 自定义表单接口 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IDiyFormFieldBiz extends IBaseBiz{ + + /** + * 通过from的id获取实体 + * @param diyFormId 自定义表单id + * @return 返回实体 + */ + List queryByDiyFormId( int diyFormId); + + /** + * 获取自定义表单字段 + * @param diyFormFieldFormId 自定义表单id + * @param diyFormFieldFieldName  自定义表单字段名 + * @return 返回自定义表单实体 + */ + DiyFormFieldEntity getByFieldName(Integer diyFormFieldFormId,String diyFormFieldFieldName); + +} diff --git a/src/main/java/com/mingsoft/basic/biz/IMailBiz.java b/src/main/java/com/mingsoft/basic/biz/IMailBiz.java new file mode 100644 index 00000000..40c4740c --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IMailBiz.java @@ -0,0 +1,30 @@ +package com.mingsoft.basic.biz; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.MailEntity; + +/** + * 邮件业务层接口 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IMailBiz extends IBaseBiz{ + + /** + * 通过应用编号与模块编号获取邮件信息 + * @param appId 应用编号 + * @param modelId 模块编号 + * @return 返回邮件服务器信息 + */ + MailEntity get(int appId,int modelId); + + /** + * 通过应用编号获取邮件信息 + * @param appId 应用编号 + * @return 返回邮件服务器信息 + */ + MailEntity getByAppId(int appId); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IMailTemplateBiz.java b/src/main/java/com/mingsoft/basic/biz/IMailTemplateBiz.java new file mode 100644 index 00000000..c767f416 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IMailTemplateBiz.java @@ -0,0 +1,36 @@ +package com.mingsoft.basic.biz; + +import java.util.List; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.MailTemplateEntity; + +/** + * 邮件模板业务层接口 + * @author 杨新远 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IMailTemplateBiz extends IBaseBiz{ + + /** + * 通过站点id绑定的邮箱模板对应的应用编号查询邮箱模板列表 + * @param mailTemplateAppId 应用编号 + * @return 返回邮箱模板列表 + */ + List queryAllByAppId(int mailTemplateAppId); + /** + * 根据应用编号与模块编号获取邮件模板 + * @param mailTemplateAppId 应用编号 + * @param modelId 模块id, + * @return 返回邮箱模板实体 null:没有找到 + */ + MailTemplateEntity getByAppIdAndModelCode(int mailTemplateAppId,int modelId); + /** + * 多选删除 + * @param ids 前端传来的勾选的checkbox的id序列化值 + */ + void deleteAll(String[] ids); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IManagerBiz.java b/src/main/java/com/mingsoft/basic/biz/IManagerBiz.java new file mode 100644 index 00000000..250b02f2 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IManagerBiz.java @@ -0,0 +1,62 @@ +package com.mingsoft.basic.biz; + +import java.util.List; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.util.PageUtil; + +/** + * 管理员业务层,接口,继承IBaseBiz + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IManagerBiz extends IBaseBiz { + + /** + * 通过账号查询管理员,主要用于登陆模块 + * @param managerName 帐号 + * @return 返回管理员实体 + */ + public ManagerEntity queryManagerByManagerName(String managerName); + + /** + * 根据用户名修改用户密码 + * @param manager 管理员实体 + */ + public void updateUserPasswordByUserName(ManagerEntity manager); + + /** + * 统计该管理员帐号在数据库中的存在数 + * @param managerName 管理员帐号 + * @return 返回存在数量 + */ + public String countManagerName(String managerName); + + /** + * 查询当前登录的管理员的所有子管理员 + * @return 返回管理员集合 + */ + public List queryAllChildManager(int managerId); + + /** + * 通过角色ID删除管理员实体 + * @param managerRoleID 角色ID + */ + public void deleteManagerByRoleId(int managerRoleID); + + /** + * 分页查询当前管理员所创建的角色 + * @param managerId 管理员ID + * @param page Map对象 + * @param orderBy 排序字段 + * @param order 排序方式,true:asc;fales:desc + * @return 返回角色实体集合 + */ + public List queryByPage(int managerId, PageUtil page,String orderBy,boolean order); + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/IManagerModelPageBiz.java b/src/main/java/com/mingsoft/basic/biz/IManagerModelPageBiz.java new file mode 100644 index 00000000..cdec98bd --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IManagerModelPageBiz.java @@ -0,0 +1,23 @@ +package com.mingsoft.basic.biz; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.ManagerModelPageEntity; + +/** + * 管理员模块页面业务层,接口,继承IBaseBiz + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IManagerModelPageBiz extends IBaseBiz { + + /** + * 根据模块id和管理员id查找实体信息 + * @param managerModelPagemanagerId 管理员id + * @param managerModelPageModelId 模块id + * @return 返回管理员实体 + */ + ManagerModelPageEntity getByManagerIdAndModelId(int managerModelPagemanagerId,int managerModelPageModelId); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IModelBiz.java b/src/main/java/com/mingsoft/basic/biz/IModelBiz.java new file mode 100644 index 00000000..798f759e --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IModelBiz.java @@ -0,0 +1,98 @@ +package com.mingsoft.basic.biz; + +import java.util.List; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.base.constant.e.BaseEnum; +import com.mingsoft.basic.constant.e.ModelEnum; +import com.mingsoft.basic.entity.ModelEntity; + +/** + * 模块业务接口 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IModelBiz extends IBaseBiz { + + /** + * 通用分类 + */ + String CATEGORY_MODEL = "99"; + + /** + * 通用文章 + */ + String BASIC_MODEL = "98"; + /** + * 通用订单 + */ + String ORDER_MODEL = "97"; + /** + * 通用订单状态 + */ + String ORDER_STATUS_MODEL = "96"; + + /** + * 根据父模块id查找子模块 + * @return 返回子模块集合 + */ + List queryChildList(int modelModelId); + + /** + * 查找顶级模块 + * @return 返回模块集合 + */ + List queryParent(); + + /** + * 根据管理员ID查询模块集合 + * @param managerId 管理员ID + * @return 返回模块集合 + */ + List queryModelByManagerId(int managerId,int modelId); + + /** + * 查找管理员Id不为-1的模块 + * @return 返回模块集合 + */ + List queryModelByManager(); + + /** + * 根据角色ID查询模块集合 + * @param roleId 角色ID + * @return 返回模块集合 + */ + List queryModelByRoleId(int roleId); + + /** + * 根据模块枚举类查询模块集合 + * @param modelEnum 模块枚举类的值 + * @return 返回模块集合 + */ + List queryModelByIsMenu(ModelEnum modelEnum); + + /** + * 根据模块编号查询模块实体 + * @param modelCode 模块编号 + * @return 返回模块实体 + */ + ModelEntity getEntityByModelCode(BaseEnum modelCode); + + /** + * 根据模块编号查询模块实体 + * @param modelCode 模块编号 + * @return 返回模块实体 + */ + ModelEntity getEntityByModelCode(String modelCode); + + /** + * 根据模块id获取当前项目中的分类模块id,规则根据modelcode定。**99******,只用是第3位与第4位99 + * @param modelType 模块类型  + * @param modelId 模块ID + * @return 返回模块实体 + */ + ModelEntity getModel(String modelType,int modelId); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IModelTemplateBiz.java b/src/main/java/com/mingsoft/basic/biz/IModelTemplateBiz.java new file mode 100644 index 00000000..e1039fd9 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IModelTemplateBiz.java @@ -0,0 +1,41 @@ +package com.mingsoft.basic.biz; + +import java.util.List; +import com.mingsoft.basic.entity.ModelTemplateEntity; +import com.mingsoft.base.biz.IBaseBiz; + +/** + * 模块模版业务接口 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IModelTemplateBiz extends IBaseBiz { + + /** + * 获取模版路径 + * @param appId 应用编号 + * @param modelId 模块编号 + * @param key 模块关键字 + * @return 返回模块模版 + */ + ModelTemplateEntity getEntity(int appId,int modelId,String key); + + /** + * 获取模版路径 + * @param appId 应用编号 + * @param key 模块关键字 + * @return 返回模块模版 + */ + ModelTemplateEntity getEntity(int appId,String key); + + + /** + * 查询当前应用下面的所有自定义页面 + * @param appId 应用编号 + * @return 返回记录集合 + */ + List queryByAppId(int appId); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IRoleBiz.java b/src/main/java/com/mingsoft/basic/biz/IRoleBiz.java new file mode 100644 index 00000000..da078f1b --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IRoleBiz.java @@ -0,0 +1,65 @@ +package com.mingsoft.basic.biz; +import java.util.List; + + +import com.mingsoft.basic.entity.RoleEntity; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.util.PageUtil; + +/** + * 角色业务层,接口,继承IBaseBiz + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IRoleBiz extends IBaseBiz{ + + /** + * 根据角色名称查询角色 + * @param roleName 角色名称 + * @param roleManagerId 角色管理员ID + * @return 返回角色实体 + */ + public RoleEntity queryRoleByRoleName(String roleName,int roleManagerId); + + /** + * 根据管理员ID查询角色 + * @param roleManagerId 管理员ID + * @return 返回角色实体集合 + */ + public List queryRoleByManagerId(int roleManagerId); + + /** + * 统计该角色名称在数据库中的存在数 + * @param roleName 角色实体 + * @param roleManagerId 管理员ID + * @return 返回存在数量 + */ + public int countRoleName(String roleName, int roleManagerId); + + /** + * 分页查询当前管理员所创建的角色 + * @param roleManagerId 管理员ID + * @param page PageUtil实体 + * @param orderBy 排序字段 + * @param order 排序方式,true:asc;fales:desc + * @return 返回返回角色实体集合 + */ + public List queryByPage(int roleManagerId, PageUtil page,String orderBy,boolean order); + + /** + * 多选删除 + * @param ids 前端传来的勾选的checkbox的序列化id值 + */ + public void deleteAll(String[] ids); + + /** + * 根据管理员id查询角色总数 + * @param managerId 管理员id + * @return 角色总数 + */ + public int getCountByManagerId(int managerId); +} diff --git a/src/main/java/com/mingsoft/basic/biz/IRoleModelBiz.java b/src/main/java/com/mingsoft/basic/biz/IRoleModelBiz.java new file mode 100644 index 00000000..41be0602 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/IRoleModelBiz.java @@ -0,0 +1,28 @@ +package com.mingsoft.basic.biz; + +import java.util.List; +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.RoleModelEntity; + +/** + * 角色模块关联业务层接口 + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IRoleModelBiz extends IBaseBiz{ + + /** + * 保存该角色对应的模块集合 + * @param roleModelList 集合 + */ + public void saveEntity(List roleModelList); + + /** + * 更新该角色对应的模块集合 + * @param roleModelList 集合 + */ + public void updateEntity(List roleModelList); +} diff --git a/src/main/java/com/mingsoft/basic/biz/ISystemSkinBiz.java b/src/main/java/com/mingsoft/basic/biz/ISystemSkinBiz.java new file mode 100644 index 00000000..c753a6fd --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/ISystemSkinBiz.java @@ -0,0 +1,31 @@ +package com.mingsoft.basic.biz; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.basic.entity.SystemSkinEntity; + +/** + * 系统主题业务处理层接口 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface ISystemSkinBiz extends IBaseBiz{ + + /** + * 获取管理员对应的管理皮肤 + * @param managerId 管理员编号 + * @return 返回主题实体 + */ + SystemSkinEntity getByManagerId(int managerId); + + /** + *设置管理员的后台皮肤 + * @param managerId 管理员编号 + * @param systemSkinId 皮肤编号 + */ + SystemSkinEntity updateManagerSystemSkin(int managerId,int systemSkinId); + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/AppBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/AppBizImpl.java new file mode 100644 index 00000000..b24da1b9 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/AppBizImpl.java @@ -0,0 +1,56 @@ +package com.mingsoft.basic.biz.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.dao.IAppDao; +import com.mingsoft.basic.entity.AppEntity; + +/** + * 网站基本信息业务层实现类 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("appBiz") +public class AppBizImpl extends BasicBizImpl implements IAppBiz{ + + /** + * 声明IAppDao持久化层 + */ + @Autowired + private IAppDao appDao; + + + @Override + public AppEntity getByManagerId(int managerId) { + // TODO Auto-generated method stub + return (AppEntity) appDao.getByManagerId(managerId); + } + + /** + * 获取应用持久化层 + * @return appDao 返回应用持久化层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return appDao; + } + + @Override + public int countByUrl(String websiteUrl) { + // TODO Auto-generated method stub + return appDao.countByUrl(websiteUrl); + } + + @Override + public AppEntity getByUrl(String url) { + // TODO Auto-generated method stub + return (AppEntity) appDao.getByUrl(url); + } + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/BasicAttentionBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/BasicAttentionBizImpl.java new file mode 100644 index 00000000..95af959b --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/BasicAttentionBizImpl.java @@ -0,0 +1,110 @@ +/** + * + */ +package com.mingsoft.basic.biz.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IBasicAttentionBiz; +import com.mingsoft.basic.dao.IBasicAttentionDao; +import com.mingsoft.basic.entity.BasicAttentionEntity; +import com.mingsoft.util.PageUtil; + +/** + * + *

+ * 铭飞科技-基础 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 成卫雄 + * QQ:330216230 + * + *

+ * Comments:关注业务层 + *

+ * + *

+ * Create Date:2014-11-12 + *

+ * + *

+ * Modification history: + *

+ */ +@Service("basicAttentionBiz") +public class BasicAttentionBizImpl extends BaseBizImpl implements IBasicAttentionBiz{ + + /** + * 注入关注持久化层 + */ + @Autowired + private IBasicAttentionDao basicAttentionDao; + + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return this.basicAttentionDao; + } + + /** + * 根据basicId,关注类型,用户ID,AppId查询
+ * 查询用户是否关注过该商品
+ * @param basicAttention 保存basicId,关注类型,用户ID,AppId查询的关注实体 + * @return + */ + public BasicAttentionEntity getEntityByPeopleAttention(BasicAttentionEntity basicAttention){ + return this.basicAttentionDao.getEntityByPeopleAttention(basicAttention); + } + + /** + * 根据用户ID和APPID查询用户关注内容列表开始(带分页) + * @param peopleId 用户ID + * @param appId 应用ID + * @param attentionType 积分类型 + * @param page 分页 + * @return 用户关注列表 + */ + public List queryPageByPeopleIdAndAppId(int peopleId,int appId,int attentionType,PageUtil page){ + return this.basicAttentionDao.queryPageByPeopleIdAndAppId(peopleId, appId,attentionType,null, page); + } + + @Override + public List queryPageByPeopleIdAndAppId(int peopleId, int appId, int attentionType, int modelId, PageUtil page) { + // TODO Auto-generated method stub + return this.basicAttentionDao.queryPageByPeopleIdAndAppId(peopleId, appId,attentionType, modelId,page); + } + + /** + * 根据用户ID和APPID查询用户关注内容数量 + * @param peopleId 用户ID + * @param appId 应用ID + * @param attentionType 积分类型 + * @return 数量 + */ + public int queryCountByPeopleIdAndAppId(int peopleId,int appId,int attentionType){ + return this.basicAttentionDao.queryCountByPeopleIdAndAppId(peopleId, appId,attentionType,null); + } + + @Override + public int queryCountByPeopleIdAndAppId(int peopleId, int appId, int attentionType, int modelId) { + // TODO Auto-generated method stub + return this.basicAttentionDao.queryCountByPeopleIdAndAppId(peopleId, appId,attentionType,modelId); + } + + + @Override + public void delete(String[] ids, int peopleId) { + // TODO Auto-generated method stub + this.basicAttentionDao.delete(ids, peopleId); + } + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/BasicBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/BasicBizImpl.java new file mode 100644 index 00000000..7f00d067 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/BasicBizImpl.java @@ -0,0 +1,117 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IBasicBiz; +import com.mingsoft.basic.dao.IBasicDao; +import com.mingsoft.basic.entity.BasicEntity; +import com.mingsoft.util.PageUtil; + +/** + * 基本信息的业务层实现类 + * @author 荣繁奎 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("basicBiz") +public class BasicBizImpl extends BaseBizImpl implements IBasicBiz { + + /** + * 注入基本信息持久化层 + */ + @Autowired + private IBasicDao basicDao; + + /** + * 获取基本信息持久化层 + * @return basicDao 返回基本信息持久化层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return basicDao; + } + + @Override + public int saveBasic(BasicEntity basic) { + basicDao.saveEntity(basic); + return saveEntity(basic); + } + + @Override + public void updateBasic(BasicEntity basic) { + basicDao.updateEntity(basic); + updateEntity(basic); + } + + @Override + public void deleteBasic(int basicId) { + basicDao.deleteEntity(basicId); + deleteEntity(basicId); + } + + @Override + public BasicEntity getBasicEntity(int basicId){ + return (BasicEntity) basicDao.getEntity(basicId); + } + + @Override + public void deletes(String[] basicIds) { + // TODO Auto-generated method stub + basicDao.delete(basicIds); + delete(basicIds); + } + + @Override + public void updateHit(int basicId, Integer num) { + // TODO Auto-generated method stub + basicDao.updateHit(basicId, num); + } + + @Override + public int count(int categoryId) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int count(int categoryId, String keyWord) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public List query(int categoryId) { + // TODO Auto-generated method stub + return basicDao.query(null,categoryId, null, null, null, null, null,null,null); + } + + @Override + public List query(int categoryId, String keyWord) { + // TODO Auto-generated method stub + return basicDao.query(null,categoryId, keyWord, null, null, null, null,null,null); + } + + @Override + public List query(Integer appId,Integer categoryId, String keyWord, PageUtil page,Integer modelId,Map where) { + // TODO Auto-generated method stub + if (page==null) { + return basicDao.query(appId,categoryId, keyWord, null, null, null, null,modelId,where); + } + return basicDao.query(appId,categoryId, keyWord, page.getPageSize()*page.getPageNo(), page.getPageSize(), null, null,modelId,where); + } + + @Override + public List getPreviousAndNext(int basicId) { + // TODO Auto-generated method stub + return basicDao.getPreviousAndNext(basicId); + } + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/BasicCategoryBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/BasicCategoryBizImpl.java new file mode 100644 index 00000000..cc29988e --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/BasicCategoryBizImpl.java @@ -0,0 +1,61 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IBasicCategoryBiz; +import com.mingsoft.basic.dao.IBasicCategoryDao; +import com.mingsoft.basic.entity.BasicCategoryEntity; + +/** + * 类别基础信息关联业务层 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("basicCategoryBizImpl") +public class BasicCategoryBizImpl extends BaseBizImpl implements IBasicCategoryBiz{ + + /** + * 注入分类关联持久化层 + */ + @Autowired + private IBasicCategoryDao basicCategoryDao; + + + @Override + public void updateBatch(List basicCategoryList) { + // TODO Auto-generated method stub + basicCategoryDao.updateBatch(basicCategoryList); + } + + /** + * 获取分类关联持久化层 + * @return basicCategoryDao 返回分类关联持久化层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return basicCategoryDao; + } + + @Override + public List queryByBasicId(int bcBasicId) { + // TODO Auto-generated method stub + return basicCategoryDao.queryByBasicId(bcBasicId); + } + + @Override + public List queryBasicIdsByCategoryId(int[] categoryIds) { + // TODO Auto-generated method stub + if(categoryIds==null || categoryIds.length<1){ + return null; + } + return basicCategoryDao.queryBasicIdsByCategoryId(categoryIds,categoryIds.length); + } + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/BasicChildBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/BasicChildBizImpl.java new file mode 100644 index 00000000..50294b94 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/BasicChildBizImpl.java @@ -0,0 +1,56 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IBasicChildBiz; +import com.mingsoft.basic.dao.IBasicChildDao; +import com.mingsoft.basic.entity.BasicChildEntity; + +/** + + * 基础表之间的子父关联关系业务层实现类 + + * @author 史爱华 QQ:924690193 + + * @version + + * 版本号:100-000-000
+ + * 创建日期:2015-08-21
+ + * 历史修订:
+ + */ +@Service("basicChildBiz") +public class BasicChildBizImpl extends BaseBizImpl implements IBasicChildBiz{ + + /** + * 基础表之间的子父关联关系持久层 + */ + @Autowired + private IBasicChildDao basicChildDao; + + @Override + public void delete(int basicId) { + // TODO Auto-generated method stub + basicChildDao.delete(basicId); + } + + @Override + public List queryByBasicId(int basicId) { + // TODO Auto-generated method stub + return basicChildDao.queryByBasicId(basicId); + } + + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return basicChildDao; + } + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/CategoryBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/CategoryBizImpl.java new file mode 100644 index 00000000..2284eaff --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/CategoryBizImpl.java @@ -0,0 +1,237 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.ICategoryBiz; +import com.mingsoft.basic.dao.ICategoryDao; +import com.mingsoft.basic.entity.CategoryEntity; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 类别业务层实现类,继承IBaseBiz,实现ICategoryBiz接口 + * @author 刘继平 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("categoryBiz") +public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz { + + /** + * 注入类别持久化层 + */ + private ICategoryDao categoryDao; + + /** + * 获取类别持久化层 + * @return categoryDao 返回类别持久化层 + */ + public ICategoryDao getCategoryDao() { + return categoryDao; + } + + @Autowired + public void setCategoryDao(ICategoryDao categoryDao) { + this.categoryDao = categoryDao; + } + + /** + * 获取类别持久化层 + * @return categoryDao 返回类别持久话层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return categoryDao; + } + + @Override + public int saveCategory(CategoryEntity categoryEntity) { + // TODO Auto-generated method stub + categoryDao.saveEntity(categoryEntity); + return saveEntity(categoryEntity); + } + + @Override + public int saveCategoryEntity(CategoryEntity categoryEntity) { + // TODO Auto-generated method stub + return categoryDao.saveEntity(categoryEntity); + } + + @Override + public void deleteCategory(int categoryId) { + // TODO Auto-generated method stub + categoryDao.deleteEntity(categoryId); + deleteEntity(categoryId); + } + + @Override + public void deleteCategoryEntity(int categoryId) { + // TODO Auto-generated method stub + categoryDao.deleteEntity(categoryId); + } + + @Override + public void updateCategory(CategoryEntity categoryEntity) { + // TODO Auto-generated method stub + categoryDao.updateEntity(categoryEntity); + updateEntity(categoryEntity); + } + + @Override + public void updateCategoryEntity(CategoryEntity categoryEntity) { + // TODO Auto-generated method stub + categoryDao.updateEntity(categoryEntity); + } + + @Override + public CategoryEntity getCategory(int categoryId) { + // TODO Auto-generated method stub + return (CategoryEntity)categoryDao.getEntity(categoryId); + } + + @Override + public List queryByPageList(CategoryEntity category, PageUtil page,String orderBy, boolean order) { + // TODO Auto-generated method stub + return categoryDao.queryByPageList(category,page, orderBy, order); + } + + @Override + public List queryChilds(CategoryEntity category) { + // TODO Auto-generated method stub + return categoryDao.queryChilds(category); + } + + @Override + public int count(CategoryEntity category) { + // TODO Auto-generated method stub + return categoryDao.count(category); + } + + + @Override + public List queryByModelId(CategoryEntity category){ + // TODO Auto-generated method stub + return categoryDao.queryByModelId(category); + } + + @Override + public List queryCategoryIdByTitle(String categoryTitle,int categoryModelId){ + // TODO Auto-generated method stub + return categoryDao.queryCategoryIdByTitle(categoryTitle,categoryModelId); + } + + @Override + public List queryCategoryIdByCategoryTitle(String categorySchoolName,int schoolModelId,int facultyModelId){ + // TODO Auto-generated method stub + return categoryDao.queryCategoryIdByCategoryTitle(categorySchoolName, schoolModelId, facultyModelId); + } + + @Override + public CategoryEntity saveByCategoryTitle(String categoryTitle,int categoryCategoryId,int categoryModelId){ + // TODO Auto-generated method stub + CategoryEntity category = new CategoryEntity(); + int categoryId = 0; + if(StringUtil.isBlank(categoryTitle)){ + category.setCategoryId(categoryId); + return category; + }else{ + //查询数据库中属否存在该分类数据 + List list = queryCategoryIdByTitle(categoryTitle,categoryModelId); + if(list != null && list.size()>0){ + categoryId = list.get(list.size()-1); + } + } + + //当数据库中不存在该分类数据时则持久化 + if( categoryId == 0){ + category.setCategoryTitle(categoryTitle); + category.setCategoryCategoryId(categoryCategoryId); + category.setCategoryModelId(categoryModelId); + saveCategoryEntity(category); + }else{ + category.setCategoryId(categoryId); + } + return category; + } + + @Override + public List queryBatchCategoryById(List listId){ + // TODO Auto-generated method stub + return categoryDao.queryBatchCategoryById(listId); + } + + @Override + public List queryChildrenCategory(int categoryId,int appId,int modelId) { + // TODO Auto-generated method stub + return categoryDao.queryChildrenCategoryId(categoryId,appId,modelId); + } + + @Override + public synchronized List queryChildrenCategoryIds(int categoryId,int appId,int modelId) { + // TODO Auto-generated method stub + List list = categoryDao.queryChildrenCategoryId(categoryId,appId,modelId); + List ids = new ArrayList(); + for (int i=0;i queryByAppIdOrModelId(Integer appId, Integer modelId) { + // TODO Auto-generated method stub + return categoryDao.queryByAppIdOrModelId(appId,modelId); + } + + /* (non-Javadoc) + * @see com.mingsoft.basic.biz.ICategoryBiz#queryParent(int, int, java.lang.Integer) + */ + @Override + public List queryParent(int appId, int modelId, Integer categoryId) { + // TODO Auto-generated method stub + //先查出父ids + String ids = categoryDao.queryParentIds(categoryId); + if (!StringUtil.isBlank(ids)) { + List list =new ArrayList(); + String[] _ids = ids.split(","); + for (int i=0;i<_ids.length;i++) { + list.add(Integer.parseInt(_ids[i])); + } + return categoryDao.queryBatchCategoryById(list); + } + return null; + } + + @Override + public List queryByDescription(int appId, int modelId, + String categoryDescription) { + // TODO Auto-generated method stub + if(StringUtil.isBlank(categoryDescription)){ + return null; + } + return this.categoryDao.queryByDescription(appId, modelId,categoryDescription); + } + + @Override + public List queryCategoryIdsByModelIdAndAppId(int appId,int modelId){ + // TODO Auto-generated method stub + List list = categoryDao.queryByAppIdOrModelId(appId, modelId); + List ids = new ArrayList(); + for (int i=0;i + * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service +public class DiyFormBizImpl extends BaseBizImpl implements IDiyFormBiz { + + /** + * 自定义表单的默认字段 + */ + private static final String FORM_ID = "fromID"; + + private static final String DATE = "date"; + + /** + * 自定义表单生成的表自增长编号 + */ + private static final String ID = "id"; + + /** + * 注入自定义表单持久化层 + */ + @Autowired + private IDiyFormDao diyFormDao; + + /** + * 自定义表单字段持久化层的注入 + */ + @Autowired + private IDiyFormFieldDao diyFormFieldDao; + + /** + * 获取类别持久化层 + * @return diyFormDao 返回类别持久话层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return diyFormDao; + } + + @Override + public void saveDiyFormData(int formId, Map params) { + // TODO Auto-generated method stub + DiyFormEntity dfe = (DiyFormEntity) diyFormDao.getEntity(formId); + if (dfe == null) { + return; + } + String tableName = dfe.getDiyFormTableName(); + List filedList = diyFormFieldDao.queryByDiyFormId(formId); + if (filedList == null) { + return; + } + Map values = builderSqlMap(filedList,params); + values.put(FORM_ID, formId); + values.put(DATE, new Date()); + diyFormFieldDao.insertBySQL(tableName,values); + } + + @Override + public Map queryDiyFormData(int diyFormId,int appId,PageUtil page) { + // TODO Auto-generated method stub + DiyFormEntity dfe = (DiyFormEntity) diyFormDao.getEntity(diyFormId); + if (dfe!=null) { + List fieldList = diyFormFieldDao.queryByDiyFormId(diyFormId); + List> fields = new ArrayList>(); + for (int i=0;i field = new HashMap(); + field.put(fieldList.get(i).getDiyFormFieldFieldName(), fieldList.get(i).getDiyFormFieldTipsName()); + fields.add(field); + } + Map wheres = new HashMap(); + wheres.put(FORM_ID, diyFormId); + List list = diyFormDao.queryBySQL(dfe.getDiyFormTableName(), null, wheres, page.getPageSize()*page.getPageNo(), page.getPageSize(),ID); + Map r = new HashMap(); + r.put("fields", fieldList); + r.put("list", list); + return r; + } + + return null; + } + + + @Override + public void deleteQueryDiyFormData(int id,int diyFormId) { + // TODO Auto-generated method stub + DiyFormEntity dfe = (DiyFormEntity) diyFormDao.getEntity(diyFormId); + Map wheres = new HashMap(); + wheres.put(FORM_ID, diyFormId); + wheres.put(ID, id); + diyFormDao.deleteBySQL(dfe.getDiyFormTableName(), wheres); + } + + @Override + public int countDiyFormData(int diyFormId, int appId) { + // TODO Auto-generated method stub + DiyFormEntity dfe = (DiyFormEntity) diyFormDao.getEntity(diyFormId); + Map wheres = new HashMap(); + wheres.put(FORM_ID, diyFormId); + return diyFormDao.countBySQL(dfe.getDiyFormTableName(),wheres ); + } + + @Override + public List query(int appId) { + // TODO Auto-generated method stub + return diyFormDao.query(appId); + } + + + /** + * 遍历出所有字段的信息 + * + * @param listField 字段列表 + * @param params 请求参数 + * @return 返回所有字段的信息 + */ + private Map builderSqlMap(List listField, Map params) { + Map mapParams = new HashMap(); + // 遍历字段名 + for (int i = 0; i < listField.size(); i++) { + DiyFormFieldEntity field = (DiyFormFieldEntity) listField.get(i); + String fieldName = field.getDiyFormFieldFieldName(); + int fieldType = field.getDiyFormFieldType(); + if (fieldType == DiyFormFieldEnum.CHECKBOX.toInt() ) { + String langtyp[] = (String[])params.get(fieldName); + if (langtyp != null) { + StringBuffer sb = new StringBuffer(); + for (int j = 0; j < langtyp.length; j++) { + sb.append(langtyp[j] + ","); + } + mapParams.put(fieldName, sb.toString()); + } else { + mapParams.put(fieldName, langtyp); + } + } else { + if (StringUtil.isBlank(params.get(fieldName))) { + mapParams.put(fieldName, null); + } else { + mapParams.put(fieldName, params.get(fieldName)); + } + } + } + return mapParams; + } + + @Override + public DiyFormEntity getByTableName(String diyFormTableName) { + // TODO Auto-generated method stub + return diyFormDao.getByTableName(diyFormTableName); + } + + @Override + public void createDiyFormTable(String table, Map fileds) { + // TODO Auto-generated method stub + diyFormDao.createDiyFormTable(table, fileds); + } + + @Override + public void deleteAll(String[] ids) { + // TODO Auto-generated method stub + diyFormDao.deleteAll(ids); + } + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/DiyFormFieldBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/DiyFormFieldBizImpl.java new file mode 100644 index 00000000..1c362b6b --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/DiyFormFieldBizImpl.java @@ -0,0 +1,51 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.basic.biz.IDiyFormFieldBiz; +import com.mingsoft.basic.dao.IDiyFormFieldDao; +import com.mingsoft.basic.entity.DiyFormFieldEntity; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; + +/** + * 自定义表单字段接口实现类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service +public class DiyFormFieldBizImpl extends BaseBizImpl implements IDiyFormFieldBiz { + + /** + * 注入自定义表单字段持久化层 + */ + @Autowired + private IDiyFormFieldDao diyFormFieldDao; + + /** + * 获取自定义表单字段持久化层 + * @return diyFormFieldDao 返回自定义表单字段持久化层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return diyFormFieldDao; + } + @Override + public List queryByDiyFormId(int diyFormId) { + // TODO Auto-generated method stub + return diyFormFieldDao.queryByDiyFormId(diyFormId); + } + @Override + public DiyFormFieldEntity getByFieldName(Integer diyFormFormId, + String diyFormFieldFieldName) { + // TODO Auto-generated method stub + return diyFormFieldDao.getByFieldName(diyFormFormId, diyFormFieldFieldName); + } + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/MailBIzImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/MailBIzImpl.java new file mode 100644 index 00000000..ec517b4f --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/MailBIzImpl.java @@ -0,0 +1,50 @@ +package com.mingsoft.basic.biz.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.basic.dao.IMailDao; +import com.mingsoft.basic.entity.MailEntity; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IMailBiz; + +/** + * 邮件业务层接口实现类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service(value="mailBiz") +public class MailBIzImpl extends BaseBizImpl implements IMailBiz { + + /** + * 注入邮件持久化层 + */ + @Autowired + private IMailDao mailDao; + + /** + * 获取邮件持久化层 + * @return mailDao 返回邮件持久化层 + */ + @Override + protected IBaseDao getDao() { + return mailDao; + } + + @Override + public MailEntity get(int appId, int modelId) { + // TODO Auto-generated method stub + return mailDao.get(appId, modelId) ; + } + + @Override + public MailEntity getByAppId(int appId) { + // TODO Auto-generated method stub + return mailDao.get(appId, null) ; + } + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/MailTemplateBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/MailTemplateBizImpl.java new file mode 100644 index 00000000..7a68f846 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/MailTemplateBizImpl.java @@ -0,0 +1,61 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IMailTemplateBiz; +import com.mingsoft.basic.dao.IMailTemplateDao; +import com.mingsoft.basic.entity.MailTemplateEntity; + +/** + * 邮件模板业务层接口实现类 + * @author 杨新远 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("mailTemplateBiz") +public class MailTemplateBizImpl extends BaseBizImpl implements IMailTemplateBiz { + /** + * 注入邮件模板持久化层 + */ + @Autowired + private IMailTemplateDao mailTemplateDao; + + /** + * 获取邮件模板持久化层 + * @return mailTemplateDao 返回邮件模板持久化层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return mailTemplateDao; + } + + @Override + public List queryAllByAppId(int mailTemplateAppId) { + // TODO Auto-generated method stub + return mailTemplateDao.queryAllByAppId(mailTemplateAppId); + } + + + + @Override + public MailTemplateEntity getByAppIdAndModelCode(int mailTemplateAppId, int modelId) { + if (modelId<=0 || mailTemplateAppId <= 0) { + return null; + } + // TODO Auto-generated method stub + return mailTemplateDao.getByAppIdAndModelCode(mailTemplateAppId,modelId); + } + + @Override + public void deleteAll(String[] ids) { + + mailTemplateDao.deleteAll(ids); + } + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/ManagerBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/ManagerBizImpl.java new file mode 100644 index 00000000..06fedbb7 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/ManagerBizImpl.java @@ -0,0 +1,122 @@ +package com.mingsoft.basic.biz.impl; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IManagerBiz; +import com.mingsoft.basic.dao.IManagerDao; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:管理员业务层实现类,继承BaseBizImpl,实现IManagerBiz + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +@Service("managerBiz") +public class ManagerBizImpl extends BaseBizImpl implements IManagerBiz { + + /** + * 注入管理员持久化层 + */ + private IManagerDao managerDao; + + /** + * 获取管理员持久化层 + * @return managerDao 返回管理员持久化层 + */ + public IManagerDao getManagerDao() { + return managerDao; + } + + /** + * 设置managerDao + * @param managerDao 管理员持久化层 + */ + @Autowired + public void setManagerDao(IManagerDao managerDao) { + // TODO Auto-generated method stub + this.managerDao = managerDao; + } + + /** + * 获取管理员持久化层 + * @return managerDao 返回管理员持久化层 + */ + @Override + public IBaseDao getDao() { + // TODO Auto-generated method stub + return managerDao; + } + + @Override + public ManagerEntity queryManagerByManagerName(String managerName) { + // TODO Auto-generated method stub + return managerDao.queryManagerByManagerName(managerName); + } + + @Override + public void updateUserPasswordByUserName(ManagerEntity manager) { + // TODO Auto-generated method stub + managerDao.updateUserPasswordByUserName(manager); + } + + @Override + public String countManagerName(String managerName){ + // TODO Auto-generated method stub + return managerDao.countManagerName(managerName); + } + + @Override + public List queryAllChildManager(int managerId){ + // TODO Auto-generated method stub + return managerDao.queryAllChildManager(managerId); + } + + @Override + public void deleteManagerByRoleId(int managerRoleID){ + // TODO Auto-generated method stub + managerDao.deleteManagerByRoleId(managerRoleID); + } + + @Override + public List queryByPage(int managerId, PageUtil page,String orderBy,boolean order){ + // TODO Auto-generated method stub + return managerDao.queryByPage(managerId, page.getPageNo(),page.getPageSize(), orderBy, order); + } + + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/ManagerModelPageBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/ManagerModelPageBizImpl.java new file mode 100644 index 00000000..db749028 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/ManagerModelPageBizImpl.java @@ -0,0 +1,45 @@ +package com.mingsoft.basic.biz.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IManagerModelPageBiz; +import com.mingsoft.basic.dao.IManagerModelPageDao; +import com.mingsoft.basic.entity.ManagerModelPageEntity; + +/** + * 管理员模块页面业务层接口实现类,接口,继承IBaseBiz + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service +public class ManagerModelPageBizImpl extends BasicBizImpl implements IManagerModelPageBiz{ + /** + * 声明管理员模块页面持久化层 + */ + @Autowired + private IManagerModelPageDao managerModelPageDao; + + /** + * 获取管理员模块页面持久化层 + * @return managerModelPageDao 返回管理员模块页面持久化层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return managerModelPageDao; + } + + @Override + public ManagerModelPageEntity getByManagerIdAndModelId( + int managerModelPagemanagerId, int managerModelPageModelId) { + // TODO Auto-generated method stub + return managerModelPageDao.getByManagerIdAndModelId(managerModelPagemanagerId, managerModelPageModelId); + } + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/ModelBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/ModelBizImpl.java new file mode 100644 index 00000000..d75c1e0e --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/ModelBizImpl.java @@ -0,0 +1,105 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.base.constant.e.BaseEnum; +import com.mingsoft.basic.constant.e.ModelEnum; +import com.mingsoft.basic.dao.IModelDao; +import com.mingsoft.basic.entity.ModelEntity; + +/** + * 模块业务接口实现类 + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("modelBiz") +public class ModelBizImpl extends BaseBizImpl implements IModelBiz{ + + @Override + public List queryChildList(int modelModelId) { + // TODO Auto-generated method stub + return modelDao.queryChildList(modelModelId); + } + + @Override + public List queryParent() { + // TODO Auto-generated method stub + return modelDao.queryParent(); + } + + @Override + public List queryModelByManagerId(int managerId,int modelId){ + // TODO Auto-generated method stub + return modelDao.queryModelByManagerId(managerId,modelId); + } + + @Override + public List queryModelByManager() { + // TODO Auto-generated method stub + return modelDao.queryModelByManager(); + } + + @Override + public List queryModelByRoleId(int roleId){ + // TODO Auto-generated method stub + return modelDao.queryModelByRoleId(roleId); + } + + @Override + public ModelEntity getEntityByModelCode(BaseEnum modelCode){ + // TODO Auto-generated method stub + return modelDao.getEntityByModelCode(modelCode.toString()); + } + + @Override + public ModelEntity getEntityByModelCode(String modelCode) { + // TODO Auto-generated method stub + return modelDao.getEntityByModelCode(modelCode); + } + + /** + * 模块持久化层 + */ + private IModelDao modelDao; + + + /** + * 获取模块持久化层 + * @return modelDao 返回模块持久化层 + */ + public IModelDao getModelDao() { + return modelDao; + } + + @Autowired + public void setModelDao(IModelDao modelDao) { + this.modelDao = modelDao; + } + + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return modelDao; + } + + @Override + public ModelEntity getModel(String modelType,int modelId) { + // TODO Auto-generated method stub + return modelDao.getModel(modelType,modelId); + } + + @Override + public List queryModelByIsMenu(ModelEnum modelEnum) { + // TODO Auto-generated method stub + return modelDao.queryModelByIsMenu(modelEnum.toInt()); + } + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/ModelTemplateBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/ModelTemplateBizImpl.java new file mode 100644 index 00000000..bc1844d4 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/ModelTemplateBizImpl.java @@ -0,0 +1,55 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.basic.dao.IModelTemplateDao; +import com.mingsoft.basic.entity.ModelTemplateEntity; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IModelTemplateBiz; + +/** + * 模块模版业务接口实现类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("modelTemplateBiz") +public class ModelTemplateBizImpl extends BaseBizImpl implements IModelTemplateBiz{ + + /** + * 注入模块模版持久化层 + */ + @Autowired + private IModelTemplateDao modelTemplateDao; + + @Override + public ModelTemplateEntity getEntity(int appId, int modelId,String key) { + return modelTemplateDao.getEntity(appId, modelId,key); + } + + @Override + public ModelTemplateEntity getEntity(int appId, String key) { + return modelTemplateDao.getEntityByAppIdAndKey(appId, key); + } + + /** + * 获取模块模版持久化层 + * @return modelTemplateDao 返回模块模版持久化层 + */ + @Override + protected IBaseDao getDao() { + return modelTemplateDao; + } + + @Override + public List queryByAppId(int appId) { + // TODO Auto-generated method stub + return modelTemplateDao.queryByAppId(appId); + } + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/RoleBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/RoleBizImpl.java new file mode 100644 index 00000000..911157b7 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/RoleBizImpl.java @@ -0,0 +1,73 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IRoleBiz; +import com.mingsoft.basic.dao.IRoleDao; +import com.mingsoft.basic.entity.RoleEntity; +import com.mingsoft.util.PageUtil; + +/** + * 角色业务层接口实现类 + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("roleBiz") +public class RoleBizImpl extends BaseBizImpl implements IRoleBiz { + + /** + * 注入角色持久化层 + */ + @Autowired + private IRoleDao roleDao; + + /** + * 获取角色持久化层 + * @return roleDao 返回角色持久化层 + */ + @Override + public IBaseDao getDao() { + return roleDao; + } + + @Override + public RoleEntity queryRoleByRoleName(String roleName,int roleManagerId){ + return roleDao.queryRoleByRoleName(roleName, roleManagerId); + } + + @Override + public List queryRoleByManagerId(int roleManagerId){ + return roleDao.queryRoleByManagerId(roleManagerId); + } + + @Override + public int countRoleName(String roleName, int roleManagerId){ + return roleDao.countRoleName(roleName,roleManagerId); + } + + @Override + public List queryByPage(int roleManagerId, PageUtil page,String orderBy,boolean order){ + return roleDao.queryByPage(roleManagerId, page.getPageNo(),page.getPageSize(), orderBy, order); + } + + @Override + public void deleteAll(String[] ids) { + // TODO Auto-generated method stub + roleDao.deleteAll(ids); + } + + @Override + public int getCountByManagerId(int managerId) { + // TODO Auto-generated method stub + return roleDao.getCountByManagerId(managerId); + } + + +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/RoleModelBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/RoleModelBizImpl.java new file mode 100644 index 00000000..37e90c15 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/RoleModelBizImpl.java @@ -0,0 +1,51 @@ +package com.mingsoft.basic.biz.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.IRoleModelBiz; +import com.mingsoft.basic.dao.IRoleModelDao; +import com.mingsoft.basic.entity.RoleModelEntity; + + +/** + * 角色模块关联业务层接口实现类 + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("roleModelBiz") +public class RoleModelBizImpl extends BaseBizImpl implements IRoleModelBiz { + + /** + * 角色模块关联持久化层 + */ + @Autowired + private IRoleModelDao roleModelDao; + + /** + * 获取角色模块持久化层 + * @return roleModelDao 返回角色模块持久化层 + */ + @Override + public IBaseDao getDao() { + // TODO Auto-generated method stub + return roleModelDao; + } + + @Override + public void saveEntity(List roleModelList){ + // TODO Auto-generated method stub + roleModelDao.saveEntity(roleModelList); + } + + @Override + public void updateEntity(List roleModelList){ + // TODO Auto-generated method stub + roleModelDao.updateEntity(roleModelList); + } +} diff --git a/src/main/java/com/mingsoft/basic/biz/impl/SystemSkinBizImpl.java b/src/main/java/com/mingsoft/basic/biz/impl/SystemSkinBizImpl.java new file mode 100644 index 00000000..1c6b645d --- /dev/null +++ b/src/main/java/com/mingsoft/basic/biz/impl/SystemSkinBizImpl.java @@ -0,0 +1,56 @@ +package com.mingsoft.basic.biz.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.ISystemSkinBiz; +import com.mingsoft.basic.dao.ISystemSkinDao; +import com.mingsoft.basic.entity.SystemSkinEntity; + +/** + * 系统主题业务处理层接口实现 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@Service("systemSkinBiz") +public class SystemSkinBizImpl extends BaseBizImpl implements ISystemSkinBiz{ + /** + * 系统主题持久化层 + */ + @Autowired + private ISystemSkinDao systemSkinDao; + + @Override + public SystemSkinEntity getByManagerId(int managerId) { + // TODO Auto-generated method stub + return systemSkinDao.getByManagerId(managerId); + } + + @Override + public SystemSkinEntity updateManagerSystemSkin(int managerId,int systemSkinId) { + // TODO Auto-generated method stub + SystemSkinEntity sse = systemSkinDao.getByManagerId(managerId); + if (sse!=null) { + systemSkinDao.updateManagerSystemSkin(managerId, systemSkinId); + } else { + systemSkinDao.saveManagerSystemSkin(managerId, systemSkinId); + } + return (SystemSkinEntity)systemSkinDao.getEntity(systemSkinId); + + } + + /** + * 获取系统主题持久化层 + * @return systemSkinDao 返回系统主题持久化层 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return systemSkinDao; + } + +} diff --git a/src/main/java/com/mingsoft/basic/configurer/ShiroTagFreeMarkderConfigurer.java b/src/main/java/com/mingsoft/basic/configurer/ShiroTagFreeMarkderConfigurer.java new file mode 100644 index 00000000..4b5a16de --- /dev/null +++ b/src/main/java/com/mingsoft/basic/configurer/ShiroTagFreeMarkderConfigurer.java @@ -0,0 +1,23 @@ +package com.mingsoft.basic.configurer; + +import java.io.IOException; + +import com.jagregory.shiro.freemarker.ShiroTags; + +import freemarker.template.TemplateException; + +/** + * shiro,freemarker标签设置 + * @author killfen + * @version + * 项目名:ms-basic
+ * 创建日期::2015年9月9日 
+ * 历史修订:
+ */ +public class ShiroTagFreeMarkderConfigurer extends org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer { + @Override + public void afterPropertiesSet() throws IOException, TemplateException { + super.afterPropertiesSet(); + this.getConfiguration().setSharedVariable("shiro", new ShiroTags()); + } +} diff --git a/src/main/java/com/mingsoft/basic/constant/e/AttentionTypeEnum.java b/src/main/java/com/mingsoft/basic/constant/e/AttentionTypeEnum.java new file mode 100644 index 00000000..4f3a3b0d --- /dev/null +++ b/src/main/java/com/mingsoft/basic/constant/e/AttentionTypeEnum.java @@ -0,0 +1,47 @@ +package com.mingsoft.basic.constant.e; + +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * 收藏类型枚举类 + * @author 刘越卫 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public enum AttentionTypeEnum implements BaseEnum { + + /** + * 收藏 + */ + COLLECT(1), + + /** + * 顶 + */ + TOP(2); + + /** + * 构造方法 + * @param code 传入的枚举类型 + */ + AttentionTypeEnum(Object code) { + this.code = code; + } + + /** + * 枚举类型 + */ + private Object code; + + + /** + * 实现父类方法转换为整形 + */ + @Override + public int toInt() { + return Integer.valueOf(code.toString()); + } + +} diff --git a/src/main/java/com/mingsoft/basic/constant/e/BaseEnum.java b/src/main/java/com/mingsoft/basic/constant/e/BaseEnum.java new file mode 100644 index 00000000..fcefd6c5 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/constant/e/BaseEnum.java @@ -0,0 +1,36 @@ +package com.mingsoft.basic.constant.e; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 + * QQ:78750478 + * + *

+ * Comments:模块用枚举类接口 + *

+ * + *

+ * Create Date:2014-12-20 + *

+ * + *

+ * Modification history: + *

+ */ +public interface BaseEnum { + + public String toString(); + + public int toInt() ; + +} diff --git a/src/main/java/com/mingsoft/basic/constant/e/DiyFormFieldEnum.java b/src/main/java/com/mingsoft/basic/constant/e/DiyFormFieldEnum.java new file mode 100644 index 00000000..5393491a --- /dev/null +++ b/src/main/java/com/mingsoft/basic/constant/e/DiyFormFieldEnum.java @@ -0,0 +1,86 @@ +package com.mingsoft.basic.constant.e; + +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * 自定义表单类型 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public enum DiyFormFieldEnum implements BaseEnum { + /** + * 单行文本 + */ + TEXT(1), + /** + * 多行文本 + */ + TEXTAREA(2), + + /** + * HTML + */ + HTML(3), + + /** + * 整型 + */ + INT(4), + + /** + * 小數 + */ + DOUBLE(5), + + /** + * 時間 + */ + DATE(6), + /** + * 图片 + */ + IMAGE(7), + /** + * 附件 + */ + ATTACHMENT(8), + /** + * 下拉框 + */ + SELECT(9), + /** + * 單選 + */ + RADIO(10), + /** + * 多選 + */ + CHECKBOX(11), + /** + * 许为空 + */ + IS_NULL(1); + + /** + * 构造方法 + * @param code 传入的枚举类型 + */ + DiyFormFieldEnum(Object code) { + this.code = code; + } + + /** + * 枚举类型 + */ + private Object code; + + @Override + public int toInt() { + // TODO Auto-generated method stub + return Integer.valueOf(code.toString()); + } + +} diff --git a/src/main/java/com/mingsoft/basic/constant/e/MailEnum.java b/src/main/java/com/mingsoft/basic/constant/e/MailEnum.java new file mode 100644 index 00000000..9cc47eea --- /dev/null +++ b/src/main/java/com/mingsoft/basic/constant/e/MailEnum.java @@ -0,0 +1,35 @@ +package com.mingsoft.basic.constant.e; + +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * 邮箱枚举类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public enum MailEnum implements BaseEnum { + TEXT(1), HTML(2); + + /** + * 枚举类型 + */ + Object code; + + /** + * 构造方法 + * @param code 传入的枚举类型 + */ + MailEnum(Object code) { + this.code = code; + } + + @Override + public int toInt() { + // TODO Auto-generated method stub + return Integer.parseInt(this.code.toString()); + } + +} diff --git a/src/main/java/com/mingsoft/basic/constant/e/ModelEnum.java b/src/main/java/com/mingsoft/basic/constant/e/ModelEnum.java new file mode 100644 index 00000000..3daf739e --- /dev/null +++ b/src/main/java/com/mingsoft/basic/constant/e/ModelEnum.java @@ -0,0 +1,47 @@ +package com.mingsoft.basic.constant.e; + +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * 模块枚举类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public enum ModelEnum implements BaseEnum { + + /** + * 模块类型是菜单 + */ + MENU(0), + + /** + *模块类型是非菜单 + */ + NOTMENU(1); + + + /** + * 枚举类型 + */ + private Object code; + + /** + * 构造方法 + * @param code 传入的枚举类型 + */ + ModelEnum(Object code) { + this.code = code; + } + + /** + * 实现父类方法转换为整形 + */ + @Override + public int toInt() { + return Integer.valueOf(code.toString()); + } + +} diff --git a/src/main/java/com/mingsoft/basic/dao/IAppDao.java b/src/main/java/com/mingsoft/basic/dao/IAppDao.java new file mode 100644 index 00000000..f2530288 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IAppDao.java @@ -0,0 +1,36 @@ +package com.mingsoft.basic.dao; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; + +/** + * 网站基本信息持久化层 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IAppDao extends IBaseDao{ + + /** + * 根据域名查找相同域名的个数 + * @param websiteUrl 域名 + * @return 返回相同域名的个数 + */ + int countByUrl(String websiteUrl); + + /** + * 根据域名查找站点实体 + * @param websiteUrl 域名 + * @return 返回站点实体 + */ + BaseEntity getByUrl(String websiteUrl); + + /** + * 更据站点管理员id查找站点 + * @param managerId 管理员id + * @return 返回站点实体 + */ + BaseEntity getByManagerId(int managerId); +} diff --git a/src/main/java/com/mingsoft/basic/dao/IAppDao.xml b/src/main/java/com/mingsoft/basic/dao/IAppDao.xml new file mode 100644 index 00000000..173189fc --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IAppDao.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + insert into app + + + APP_NAME, + APP_DESCRIPTION, + APP_LOGO, + APP_DATETIME, + APP_KEYWORD, + APP_COPYRIGHT, + APP_STYLE, + APP_URL, + APP_MANAGERID, + APP_PAY_DATE, + APP_PAY, + + + + #{appName}, + #{appDescription}, + #{appLogo}, + #{appDatetime}, + #{appKeyword}, + #{appCopyright}, + #{appStyle}, + #{appUrl}, + #{appManagerId}, + #{appMobileStyle}, + #{appPayDate}, + #{appPay}, + + + + + + + + delete from app + where + APP_id = #{appId} + + + + + + update app + + APP_NAME =#{appName}, + APP_DESCRIPTION =#{appDescription}, + APP_LOGO =#{appLogo}, + APP_DATETIME =#{appDatetime}, + + APP_keyword =#{appKeyword}, + APP_copyright =#{appCopyright}, + APP_style =#{appStyle}, + APP_URL=#{appUrl}, + APP_managerId=#{appManagerId}, + APP_MOBILE_STYLE=#{appMobileStyle}, + APP_PAY_DATE=#{appPayDate}, + APP_PAY=#{appPay}, + + where APP_Id = #{appId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IBasicAttentionDao.java b/src/main/java/com/mingsoft/basic/dao/IBasicAttentionDao.java new file mode 100644 index 00000000..8efe280f --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IBasicAttentionDao.java @@ -0,0 +1,78 @@ +/** + * + */ +package com.mingsoft.basic.dao; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.BasicAttentionEntity; +import com.mingsoft.util.PageUtil; + +/** + * + *

+ * 铭飞科技-基础 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 成卫雄 + * QQ:330216230 + * + *

+ * Comments:关注持久化接口 + *

+ * + *

+ * Create Date:2014-11-12 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IBasicAttentionDao extends IBaseDao { + + /** + * 根据basicId,关注类型,用户ID,AppId查询
+ * 查询用户是否关注过该商品
+ * @param basicAttention 保存basicId,关注类型,用户ID,AppId查询的关注实体 + * @return + */ + public BasicAttentionEntity getEntityByPeopleAttention(@Param("basicAttention") BasicAttentionEntity basicAttention); + + /** + * 根据用户ID和APPID查询用户关注内容列表(带分页) + * @param peopleId 用户ID + * @param appId 应用ID + * @param page 分页 + * @param attentionType 积分类型 + * @param modelId 模块编号 + * @return 用户关注列表 + */ + public List queryPageByPeopleIdAndAppId(@Param("peopleId")int peopleId,@Param("appId")int appId,@Param("attentionType") int attentionType,@Param("modelId") Integer modelId,@Param("page")PageUtil page); + + /** + * 根据用户ID和APPID查询用户关注内容数量 + * @param peopleId 用户ID + * @param appId 应用ID + * @param attentionType 积分类型 + * @return 数量 + */ + public int queryCountByPeopleIdAndAppId(@Param("peopleId")int peopleId,@Param("appId")int appId,@Param("attentionType") int attentionType,@Param("modelId") Integer modelId); + + + /** + * 根据收藏id数组和用户id删除收藏记录 + * @param ids 收藏id数组 + * @param peopleId 用户id + */ + public void delete(@Param("ids") String[] ids,@Param("peopleId") int peopleId); + + +} diff --git a/src/main/java/com/mingsoft/basic/dao/IBasicAttentionDao.xml b/src/main/java/com/mingsoft/basic/dao/IBasicAttentionDao.xml new file mode 100644 index 00000000..4939ac09 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IBasicAttentionDao.xml @@ -0,0 +1,137 @@ + + + + + ba.ba_id,ba.ba_peopleid,ba.ba_basicid,ba.ba_appid,ba.ba_type,ba.ba_datetime,b.basic_title,b.ba_url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into BASIC_ATTENTION + + + BA_PEOPLEID, + BA_BASICID, + BA_APPID, + BA_TYPE, + BA_DATETIME, + BA_Url, + + + + + #{basicAttentionPeopleId}, + #{basicAttentionBasicId}, + #{basicAttentionAppId}, + #{basicAttentionType}, + #{basicAttentionTime}, + #{basicAttentionUrl}, + + + + + + + + + + + + + + + + delete from + basic_attention + where ba_id = #{basicAttentionId} + + + + + + DELETE FROM basic_attention + + + and ba_peopleID = #{peopleId} + + and ba_id in #{item} + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IBasicCategoryDao.java b/src/main/java/com/mingsoft/basic/dao/IBasicCategoryDao.java new file mode 100644 index 00000000..fe59abc7 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IBasicCategoryDao.java @@ -0,0 +1,45 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.BasicCategoryEntity; + +/** + * 类别基础信息关联持久化层 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IBasicCategoryDao extends IBaseDao{ + + /** + * 批量更新基础分类关联表 + * @param basicCategoryList 基础分类列表实体 + */ + void updateBatch(List basicCategoryList); + + /** + * 根据baiscId查询基础分类关联信息 + * @param bcBasicId 基础basicId + * @return 返回基础分类关联列表信息 + */ + List queryByBasicId(int bcBasicId); + + /** + * 根据分类id集合和分类id集合的长度去查询符合条件的basicId集合 + * @param categoryIds 分类id集合 + * @param categoryIdsSize 分类id集合的长度 + * @return 返回basicId的list集合 + */ + List queryBasicIdsByCategoryId(@Param("categoryIds")int[] categoryIds,@Param("categoryIdsSize")int categoryIdsSize); + + /** + * 根据分类id集合去查询符合条件的总数 + * @param categoryIds + * @return 返回basicId的list集合 + */ + List getCountByCategoryId(@Param("categoryIds")int[] categoryIds); +} diff --git a/src/main/java/com/mingsoft/basic/dao/IBasicCategoryDao.xml b/src/main/java/com/mingsoft/basic/dao/IBasicCategoryDao.xml new file mode 100644 index 00000000..7ce661c9 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IBasicCategoryDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + insert into basic_category (bc_basic_Id,bc_category_id) values + + (#{item.bcBasicId},#{item.bcCategoryId}) + + + + + + replace into basic_category (bc_basic_Id,bc_category_id) values + + (#{item.bcBasicId},#{item.bcCategoryId}) + + + + + + delete from basic_category where bc_basic_Id=#{bcBasicId} + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IBasicChildDao.java b/src/main/java/com/mingsoft/basic/dao/IBasicChildDao.java new file mode 100644 index 00000000..103b9089 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IBasicChildDao.java @@ -0,0 +1,38 @@ +package com.mingsoft.basic.dao; + +import java.util.List; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.BasicChildEntity; + + +/** + + * 基础表之间的子父关联关系持久化接口 + + * @author 史爱华 QQ:924690193 + + * @version + + * 版本号:100-000-000
+ + * 创建日期:2015-08-21
+ + * 历史修订:
+ + */ +public interface IBasicChildDao extends IBaseDao{ + + /** + * 根据基础表id删除数据 + * @param basicId 基础表id + */ + void delete(int basicId); + + /** + * 根据基础表id查询基础表关联数据集合 + * @param basicId 基础表id + * @return 基础表关联数据集合 + */ + List queryByBasicId(int basicId); +} diff --git a/src/main/java/com/mingsoft/basic/dao/IBasicChildDao.xml b/src/main/java/com/mingsoft/basic/dao/IBasicChildDao.xml new file mode 100644 index 00000000..53655776 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IBasicChildDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + insert into basic_child (bc_basic_Id,bc_basic_child_Id) values + + (#{item.basicId},#{item.basicChildId}) + + + + + + + + delete from basic_child where + bc_basic_Id = #{basicId} + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IBasicDao.java b/src/main/java/com/mingsoft/basic/dao/IBasicDao.java new file mode 100644 index 00000000..9e9632f6 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IBasicDao.java @@ -0,0 +1,63 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import java.util.Map; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.BasicEntity; + +/** + * 基本信息的数据层(接口) + * @author 荣繁奎 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IBasicDao extends IBaseDao { + + /** + * 更新点击次数 + * + * @param basicId 文章编号 + * @param num null:为递增 + */ + void updateHit(@Param("basicId") int basicId, @Param("num") Integer num); + + /** + * 根据分类与关键子统计总数 + * + * @param categoryId + *  分类编号 + * @param keyWord + * 关键字 + * @return 返回总数 + */ + int count(@Param("categoryId") int categoryId, @Param("keyWord") String keyWord); + + /** + * 根据分类与关键子统计总数 + * @param appId 站点ID + * @param categoryId + *  分类编号 + * @param keyWord + *  关键字 + * @param begin 开始 + * @param end 结束 + * @param orderField 排序字段 + * @param ad 排序方式true:升序 false:倒序 + * @param modelId 模块ID + * @param where 查询条件 + * @return 返回列表实体 + */ + List query(@Param("appId") Integer appId,@Param("categoryId") Integer categoryId, @Param("keyWord") String keyWord, @Param("begin") Integer begin, @Param("end") Integer end, @Param("orderField")String orderField, @Param("ad")Boolean ad, @Param("modelId")Integer modelId,@Param("where")Map where); + + /** + * 获取当前文章basicId的上一篇与下一篇 + * @param basicId 当前文章 + * @return 返回列表实体,list.get(0):上一篇list.get(1): 下一篇 + */ + List getPreviousAndNext(int basicId); + + +} diff --git a/src/main/java/com/mingsoft/basic/dao/IBasicDao.xml b/src/main/java/com/mingsoft/basic/dao/IBasicDao.xml new file mode 100644 index 00000000..1d03a793 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IBasicDao.xml @@ -0,0 +1,155 @@ + + + + + + BASIC_ID,BASIC_TITLE,BASIC_DESCRIPTION,BASIC_THUMBNAILS,BASIC_HIT,BASIC_DATETIME,BASIC_UPDATETIME,BASIC_PEOPLEID,BASIC_CATEGORYID,BASIC_APPID + + + + + + + + + + + + + + + + + + insert into basic + + basic_title, + basic_description, + basic_thumbnails, + basic_hit, + BASIC_CATEGORYID, + BASIC_PEOPLEID, + BASIC_Datetime, + BASIC_updatetime, + BASIC_APPID, + BASIC_SORT, + BASIC_MODELID, + + + #{basicTitle}, + #{basicDescription}, + #{basicThumbnails}, + #{basicHit}, + #{basicCategoryId}, + #{basicPeopleId}, + #{basicDateTime}, + #{basicUpdateTime}, + #{basicAppId}, + #{basicSort}, + #{basicModelId}, + + + + + + + update basic + + basic_title=#{basicTitle}, + basic_description=#{basicDescription}, + BASIC_THUMBNAILS=#{basicThumbnails}, + BASIC_HIT=#{basicHit}, + BASIC_UPDATETIME=#{basicUpdateTime}, + BASIC_PEOPLEID=#{basicPeopleId}, + BASIC_CATEGORYID=#{basicCategoryId}, + BASIC_Datetime=#{basicDateTime}, + BASIC_SORT=#{basicSort}, + + where basic_id = #{basicId} + + + delete from basic where + basic_id = #{basicId} + + + delete from basic where + basic_id = #{basicId} and basic_appid=#{appId} + + + + + + + + + + + + + + + + + + update basic set + + basic_hit = #{num} + + + basic_hit = basic_hit+1 + + where basic_id=#{basicId} + + + + + delete from basic + + basic_id in #{item} + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/ICategoryDao.java b/src/main/java/com/mingsoft/basic/dao/ICategoryDao.java new file mode 100644 index 00000000..19d75599 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/ICategoryDao.java @@ -0,0 +1,126 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.CategoryEntity; +import com.mingsoft.util.PageUtil; + +/** + * 类别数据持久层,继承IBaseDao + * @author 刘继平 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface ICategoryDao extends IBaseDao { + + /** + * 分页查询
+ * 查询分类集合
+ * @param category 分类实体 + * @param page pageUtil实体 + * @param orderBy 排序字段 + * @param order 排序方式true:asc false:desc + * @return 返回分类集合 + */ + public List queryByPageList(@Param("category")CategoryEntity category,@Param("page")PageUtil page,@Param("orderBy")String orderBy,@Param("order") boolean order); + + /** + * 根据分类ID查询子分类
+ * @param category 分类实体 + */ + public List queryChilds(@Param("category")CategoryEntity category); + + + /** + * 根据分类ID查询子分类总数
+ * @param category 分类实体 + */ + public int count(@Param("category")CategoryEntity category); + + /** + * 根据modelId查询分类 + * @param category 分类实体 + * @return 返回分类集合 + */ + public List queryByModelId(@Param("category")CategoryEntity category); + + /** + * 根据分类名称查询分类Id集合(课表数据采集使用) + * @param categoryTitle 分类名称 + * @param categoryModelId 模块ID + * @return 返回查询到的分类集合 + */ + public List queryCategoryIdByTitle(@Param("categoryTitle")String categoryTitle,@Param("categoryModelId")int categoryModelId); + + /** + * 根据学校名称查询该学校所有专业ID + * @param categoryTitle 学校名称 + * @param fatherModelId 系所属模块ID + * @param sonModelId 子分类模块ID + * @return 返回该学校下专业ID的集合 + * @deprecated 因为categoryTitle可能会出现重复 + */ + public List queryCategoryIdByCategoryTitle(@Param("categoryTitle")String categoryTitle,@Param("fatherModelId")int fatherModelId,@Param("sonModelId")int sonModelId); + + /** + * 查询categoryId分类下的子分类数据 + * @param categoryId 父分类编号 + * @param fatherModelId 父分类所属模块ID + * @param sonModelId 子分类模块ID + * @return 返回子分类集合 + */ + public List queryCategoryIdByCategoryId(@Param("categoryId")int categoryId,@Param("fatherModelId")int fatherModelId,@Param("sonModelId")int sonModelId); + + /** + * 根据ID批量查询分类实体 + * @param listId ID集合 + * @return 返回分类实体 + */ + public List queryBatchCategoryById(@Param("listId")List listId); + + /** + * 查询当前分类下面的子分类 + * @param categoryId 当前分类编号 + * @param appId 应用编号 + * @return 返回子分类列表 + */ + public List queryChildrenCategoryId(@Param("categoryId")int categoryId,@Param("appId")int appId,@Param("modelId")int modelId); + + + /** + * 根据应用编号与模块编号查询分类 + * + * @param appId 应用编号 + * @param modelId 模块编号 + * @return 返回分类集合 + */ + public List queryByAppIdOrModelId(@Param("appId")Integer appId,@Param("modelId") Integer modelId); + + /** + * 递归活取父栏目, + * @param categoryId + * @return 返回父类id,格式 1,3,4,5 + */ + public String queryParentIds(int categoryId); + + /** + * 主要用于属性查询 + * @param appId 应用id + * @param modelId 模块id + * @param categoryDescription 分类描述 + * @return 返回分类集合 + */ + public List queryByDescription(@Param("appId")Integer appId,@Param("modelId") Integer modelId,@Param("categoryDescription")String categoryDescription); + + /** + * 查询当前分类下面的子分类 + * @param categoryId 当前分类编号 + * @param appId 应用编号 + * @param modelId 模块Id + * @return 返回子分类列表集合 + */ + public List queryChildrenCategoryIdByModelId(@Param("categoryId")Integer categoryId,@Param("appId")int appId,@Param("modelId")int modelId); +} diff --git a/src/main/java/com/mingsoft/basic/dao/ICategoryDao.xml b/src/main/java/com/mingsoft/basic/dao/ICategoryDao.xml new file mode 100644 index 00000000..54913221 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/ICategoryDao.xml @@ -0,0 +1,250 @@ + + + + + c.category_id,c.category_title,c.category_sort,c.category_datetime,c.category_managerid,c.category_modelId,c.category_categoryid,c.category_smallimg,c.category_description + + + + + + + + + + + + + + + + insert into category + + + category_title, + category_sort, + category_datetime, + category_managerid, + category_modelId, + category_categoryid, + category_smallimg, + category_appid, + category_description, + + + #{categoryTitle}, + #{categorySort}, + #{categoryDateTime}, + #{categoryManagerId}, + #{categoryModelId}, + #{categoryCategoryId}, + #{categorySmallImg}, + #{categoryAppId}, + #{categoryDescription} + + + + + + + + update category + + category_title=#{categoryTitle}, + category_sort=#{categorySort}, + category_datetime=#{categoryDateTime}, + category_managerid=#{categoryManagerId}, + category_categoryid=#{categoryCategoryId}, + category_smallimg=#{categorySmallImg}, + category_description=#{categoryDescription}, + + where category_id = #{categoryId} + + + + + + delete from category + where + category_id = #{categoryId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IDiyFormDao.java b/src/main/java/com/mingsoft/basic/dao/IDiyFormDao.java new file mode 100644 index 00000000..52fd5d0c --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IDiyFormDao.java @@ -0,0 +1,44 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import java.util.Map; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.DiyFormEntity; + +/** + * 自定义表单 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IDiyFormDao extends IBaseDao{ + /** + * 查询列表 + * @param appId 应用编号 + * @return 返回列表集合 + */ + List query(@Param("diyFormAppId")int appId); + + /** + * 根据表名查找自定义表单实体 + * @param diyFormTableName + * @return 返回自定义表单实体 + */ + DiyFormEntity getByTableName(@Param("diyFormTableName")String diyFormTableName); + + /** + * 为自定义表单创建表 + * @param table 表名 + * @param fileds 字段集合 + */ + void createDiyFormTable(@Param("table")String table,@Param("fileds")Map fileds); + + /** + * 删除自定义表单,多条或者一条 + * @param ids 多条表单集合(id) + */ + public void deleteAll(@Param("ids")String[] ids); +} diff --git a/src/main/java/com/mingsoft/basic/dao/IDiyFormDao.xml b/src/main/java/com/mingsoft/basic/dao/IDiyFormDao.xml new file mode 100644 index 00000000..03c7470e --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IDiyFormDao.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + insert into diy_form + + + DF_TIPSNAME, + DF_TABLENAME, + DF_MANAGERID, + DF_APPID, + + + + + #{diyFormTipsName}, + #{diyFormTableName}, + #{diyFormManagerId}, + #{diyFormAppId}, + + + + + + + update diy_form + + DF_TIPSNAME=#{diyFormTipsName}, + DF_TABLENAME=#{diyFormTableName}, + + where DF_ID = #{diyFormId} + + + + + + delete from diy_form + where DF_ID = #{diyFormId} + + + + + + DELETE FROM `diy_form` + + DF_ID in #{item} + + + + + + + + + + + + + + + + + + + + + + CREATE TABLE `${table}` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `date` timestamp NULL DEFAULT NULL COMMENT 'CURRENT_TIMESTAMP', + `fromID` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`) + ) ENGINE=InnoDB + AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IDiyFormFieldDao.java b/src/main/java/com/mingsoft/basic/dao/IDiyFormFieldDao.java new file mode 100644 index 00000000..231a74e2 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IDiyFormFieldDao.java @@ -0,0 +1,32 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.DiyFormFieldEntity; + +/** + * 自定义表单字段 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IDiyFormFieldDao extends IBaseDao{ + + /** + * 通过from的id获取实体 + * @param diyFormId 自定义表单id + * @return 返回实体 + */ + List queryByDiyFormId(@Param("diyFormFieldFormId") int diyFormId); + + /** + * 获取自定义表单字段 + * @param diyFormId 自定义表单id + * @param diyFormFieldFieldName  自定义表单字段名 + * @return 返回自定义表单实体 + */ + DiyFormFieldEntity getByFieldName(@Param("diyFormFieldFormId") Integer diyFormId,@Param("diyFormFieldFieldName") String diyFormFieldFieldName); +} diff --git a/src/main/java/com/mingsoft/basic/dao/IDiyFormFieldDao.xml b/src/main/java/com/mingsoft/basic/dao/IDiyFormFieldDao.xml new file mode 100644 index 00000000..0595b1aa --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IDiyFormFieldDao.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + insert into diy_form_field + + + DFF_TIPSNAME, + DFF_FIELDNAME, + DFF_TYPE, + DFF_DEFAULT, + DFF_SORT, + DFF_ISNULL, + DFF_FORMID, + + + + + #{diyFormFieldTipsName}, + #{diyFormFieldFieldName}, + #{diyFormFieldType}, + #{diyFormFieldDefault}, + #{diyFormFieldSort}, + #{diyFormFieldIsNull}, + #{diyFormFieldFormId}, + + + + + + + update diy_form_field + + DFF_TIPSNAME=#{diyFormFieldTipsName}, + DFF_FIELDNAME=#{diyFormFieldFieldName}, + DFF_TYPE=#{diyFormFieldType}, + DFF_DEFAULT=#{diyFormFieldDefault}, + DFF_SORT=#{diyFormFieldSort}, + DFF_ISNULL=#{diyFormFieldIsNull}, + + where DFF_ID = #{diyFormFieldId} + + + + + + delete from diy_form_field + where DFF_ID = #{diyFormFieldId} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IMailDao.java b/src/main/java/com/mingsoft/basic/dao/IMailDao.java new file mode 100644 index 00000000..0f1cd77b --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IMailDao.java @@ -0,0 +1,24 @@ +package com.mingsoft.basic.dao; + +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.MailEntity; + +/** + * 邮件持久化层 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IMailDao extends IBaseDao{ + /** + * 通过应用编号与模块编号获取邮件信息 + * @param appId 应用编号 + * @param modelId 模块编号 + * @return 返回邮件服务器信息 + */ + MailEntity get(@Param(value="appId")int appId, @Param(value="modelId")Integer modelId); + +} diff --git a/src/main/java/com/mingsoft/basic/dao/IMailDao.xml b/src/main/java/com/mingsoft/basic/dao/IMailDao.xml new file mode 100644 index 00000000..46b7e18c --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IMailDao.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + insert into mail + + + + MAIL_APPID, + MAIL_MODELID, + MAIL_NAME, + MAIL_PASSWORD, + MAIL_PORT, + MAIL_SERVER, + MAIL_CONTENT, + MAIL_RECEIVE, + + + + + #{mailAppId}, + #{mailModelId}, + #{mailName}, + #{mailPassword}, + #{mailPort}, + #{mailServer}, + #{mailContent}, + #{mailReceive}, + + + + + + + + + update mail + + mail_name =#{mailName}, + mail_password =#{mailPassword}, + mail_port =#{mailPort}, + mail_server=#{mailServer}, + mail_content =#{mailContent}, + mail_receive=#{mailReceive}, + + where mail_appid=#{mailAppId} + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IMailTemplateDao.java b/src/main/java/com/mingsoft/basic/dao/IMailTemplateDao.java new file mode 100644 index 00000000..0b684145 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IMailTemplateDao.java @@ -0,0 +1,37 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.MailTemplateEntity; + + /** + * 邮件模板持久化层 + * @author 杨新远 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IMailTemplateDao extends IBaseDao{ + /** + * 根据站点id得到邮箱模板列表 + * @param mailTemplateAppId 站点id + * @return 返回MailTemplateEntity列表 + */ + List queryAllByAppId(@Param("mailTemplateAppId") int mailTemplateAppId); + + /** + * 删除评论,多条或者一条 + * @param ids 多条评论集合 + */ + public void deleteAll(@Param("ids")String[] ids); + + /** + * 根据应用编号与模块编号获取邮件模板 + * @param mailTemplateAppId 应用编号 + * @param modelId 模块编码 + * @return 返回MailTemplateEntity null:没有找到 + */ + MailTemplateEntity getByAppIdAndModelCode(@Param("mailTemplateAppId")int mailTemplateAppId,@Param("modelId") int modelId); +} diff --git a/src/main/java/com/mingsoft/basic/dao/IMailTemplateDao.xml b/src/main/java/com/mingsoft/basic/dao/IMailTemplateDao.xml new file mode 100644 index 00000000..38be119b --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IMailTemplateDao.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + insert into mail_template + + + + mt_appID, + mt_modelID, + mt_content, + mt_receive, + mt_title, + + + + + #{mailTemplateAppId}, + #{mailTemplateModelId}, + #{mailTemplateContent}, + #{mailTemplateReceive}, + #{mailTemplateTitle}, + + + + + + + + + + + + update mail_template + + mt_modelID =#{mailTemplateModelId}, + mt_title =#{mailTemplateTitle}, + mt_content =#{mailTemplateContent}, + mt_receive=#{mailTemplateReceive}, + + where mt_id=#{mailTemplateId} + + + + + + + + + + DELETE FROM mail_template + + mt_id in #{item} + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IManagerDao.java b/src/main/java/com/mingsoft/basic/dao/IManagerDao.java new file mode 100644 index 00000000..1c6e40fb --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IManagerDao.java @@ -0,0 +1,64 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.entity.ManagerEntity; + +/** + * 管理员持久化 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IManagerDao extends IBaseDao { + + /** + * 通过账号查询管理员,主要用于登陆模块 + * @param managerName 帐号 + * @return 返回管理员实体 + */ + public ManagerEntity queryManagerByManagerName(String managerName); + + /** + * 根据用户名修改用户密码 + * @param manager 管理员实体 + */ + public void updateUserPasswordByUserName(ManagerEntity manager); + + /** + * 统计该管理员帐号在数据库中的存在数 + * @param managerName 管理员帐号 + * @return 返回存在数量 + */ + public String countManagerName(String managerName); + + /** + * 查询当前登录的管理员的所有子管理员 + * @return 返回管理员集合 + */ + public List queryAllChildManager(int managerId); + + /** + * 通过角色ID删除管理员实体 + * @param managerRoleID 角色ID + */ + public void deleteManagerByRoleId(int managerRoleID); + + /** + * 分页查询当前管理员所创建的角色 + * @param managerId 管理员ID + * @param pageNo 当前页数 + * @param pageSize 显示条数 + * @param orderBy 排序字段 + * @param order 排序方式,true:asc;fales:desc + * @return 返回角色集合 + */ + public List queryByPage(@Param("managerId")int managerId,@Param("pageNo")int pageNo,@Param("pageSize")int pageSize,@Param("orderBy")String orderBy,@Param("order") boolean order); + + + +} diff --git a/src/main/java/com/mingsoft/basic/dao/IManagerDao.xml b/src/main/java/com/mingsoft/basic/dao/IManagerDao.xml new file mode 100644 index 00000000..9b39b333 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IManagerDao.xml @@ -0,0 +1,150 @@ + + + + + + MANAGER_ID,MANAGER_NAME,MANAGER_NICKNAME,MANAGER_PASSWORD,MANAGER_ROLEID,MANAGER_PEOPLEID,MANAGER_TIME + + + + m.MANAGER_ID,m.MANAGER_NAME,m.MANAGER_NICKNAME,m.MANAGER_PASSWORD,m.MANAGER_ROLEID,m.MANAGER_PEOPLEID,m.MANAGER_TIME, + r.ROLE_NAME + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into manager + + MANAGER_NAME, + MANAGER_NICKNAME, + MANAGER_PASSWORD, + MANAGER_ROLEID, + MANAGER_PEOPLEID, + MANAGER_TIME, + + + #{managerName}, + #{managerNickName}, + #{managerPassword}, + #{managerRoleID}, + #{managerPeopleID}, + #{managerTime}, + + + + + + + delete from manager where MANAGER_ID = #{managerId} + + + + + + delete from manager where MANAGER_ROLEID = #{managerRoleID} + + + + + + + + + + update manager + + MANAGER_NAME=#{managerName}, + MANAGER_NICKNAME=#{managerNickName}, + MANAGER_PASSWORD=#{managerPassword}, + MANAGER_ROLEID=#{managerRoleID}, + MANAGER_PEOPLEID=#{managerPeopleID}, + MANAGER_TIME=#{managerTime} + + where MANAGER_ID = #{managerId} + + + + + + update manager + + MANAGER_PASSWORD=#{managerPassword} + + where MANAGER_NAME = #{managerName} + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IManagerModelPageDao.java b/src/main/java/com/mingsoft/basic/dao/IManagerModelPageDao.java new file mode 100644 index 00000000..375bfeb9 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IManagerModelPageDao.java @@ -0,0 +1,23 @@ +package com.mingsoft.basic.dao; + +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.ManagerModelPageEntity; + +/** + * 管理员持久化 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IManagerModelPageDao extends IBaseDao { + /** + * 根据模块id和管理员id查找实体信息 + * @param managerModelPagemanagerId 管理员id + * @param managerModelPageModelId 模块id + * @return 返回管理员实体 + */ + ManagerModelPageEntity getByManagerIdAndModelId(@Param("managerModelPagemanagerId")int managerModelPagemanagerId,@Param("managerModelPageModelId")int managerModelPageModelId); +} diff --git a/src/main/java/com/mingsoft/basic/dao/IManagerModelPageDao.xml b/src/main/java/com/mingsoft/basic/dao/IManagerModelPageDao.xml new file mode 100644 index 00000000..9e8a202d --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IManagerModelPageDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + insert into manager_model_page + + + mmp_managerID, + mmp_modelID, + mmp_url, + + + + + #{managerModelPagemanagerId}, + #{managerModelPageModelId}, + #{managerModelPageUrl}, + + + + + + + update manager_model_page + + mmp_modelID =#{managerModelPageModelId}, + mmp_url =#{managerModelPageUrl}, + + where mmp_managerID = #{managerModelPagemanagerId} + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IModelDao.java b/src/main/java/com/mingsoft/basic/dao/IModelDao.java new file mode 100644 index 00000000..d4075ca7 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IModelDao.java @@ -0,0 +1,76 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.ModelEntity; + +/** + * 模块持久化 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IModelDao extends IBaseDao{ + + /** + * 根据父模块id查找子id + * @return 返回子模块实体 + */ + List queryChildList(int modelModelId); + + /** + *查找顶级模块 + * @return 返回模块实体集合 + */ + List queryParent(); + + /** + * 根据管理员ID查询模块集合 + * @param modelManagerId 管理员ID + * @param modelId 模块ID + * @return 返回模块集合 + */ + List queryModelByManagerId(@Param ("modelManagerId") int modelManagerId,@Param ("modelId") int modelId); + + /** + * 查找管理员Id不为-1的模块 + * @return 返回模块集合 + */ + List queryModelByManager(); + + /** + * 根据角色ID查询模块集合 + * @param roleId 角色ID + * @return 返回模块集合 + */ + List queryModelByRoleId(int roleId); + + /** + * 根据模块枚举类查询模块集合 + * @param modelEnum 模块枚举类的值 + * @return 返回模块集合 + */ + List queryModelByIsMenu(@Param("modelEnum")int modelEnum); + + /** + * 根据模块编号查询模块实体 + * @param modelCode 模块编号 + * @return 返回模块实体 + */ + ModelEntity getEntityByModelCode(@Param("modelCode")String modelCode); + + /** + * 根据模块id获取当前项目中的分类模块id,规则根据modelcode定。**99******,只用是第3位与第4位99 + * @param modelCodeRegex 规则。详细见IModelBiz + * @see IModelBiz + * @param modelId 模块根id + * @return 返回模块集合 + */ + ModelEntity getModel(@Param("modelCodeRegex") String modelCodeRegex,@Param("modelId") int modelId); + +} diff --git a/src/main/java/com/mingsoft/basic/dao/IModelDao.xml b/src/main/java/com/mingsoft/basic/dao/IModelDao.xml new file mode 100644 index 00000000..004b697b --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IModelDao.xml @@ -0,0 +1,172 @@ + + + + + + MODEL_ID,MODEL_TITLE,MODEL_CODE,MODEL_MODELID,MODEL_URL,MODEL_DATETIME,MODEL_ICON,MODEL_MODELMANAGERID,MODEL_ISMENU + + + + + + + + + + + + + + + + insert into model + + MODEL_TITLE, + MODEL_CODE, + MODEL_MODELID, + MODEL_URL, + MODEL_DATETIME, + MODEL_ICON, + MODEL_MODELMANAGERID, + MODEL_ISMENU, + + + #{modelTitle}, + #{modelCode}, + #{modelModelId}, + #{modelUrl}, + #{modelDatetime}, + #{modelIcon}, + #{modelManagerId}, + #{modelIsMenu}, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update model + + MODEL_TITLE=#{modelTitle}, + MODEL_CODE=#{modelCode}, + MODEL_MODELID=#{modelModelId}, + MODEL_URL=#{modelUrl}, + MODEL_DATETIME=#{modelDatetime}, + MODEL_ICON=#{modelIcon}, + MODEL_MODELMANAGERID=#{modelManagerId}, + MODEL_ISMENU=#{modelIsMenu} + + where model_id=#{modelId} + + + + + + + + + + + + + + + + + + + + delete from model + where + model_id = + #{modelId} + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IModelTemplateDao.java b/src/main/java/com/mingsoft/basic/dao/IModelTemplateDao.java new file mode 100644 index 00000000..0de9c836 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IModelTemplateDao.java @@ -0,0 +1,41 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.ModelTemplateEntity; + +/** + * 模块持久化 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IModelTemplateDao extends IBaseDao{ + /** + * 获取模版路径 + * @param appId 应用编号 + * @param modelId 模块编号 + * @param key 对应路径地址 + * @return 返回模块模版 + */ + ModelTemplateEntity getEntity(@Param("appId")int appId,@Param("modelId")int modelId,@Param("key")String key); + + /** + * 获取模版路径 + * @param appId 应用编号 + * @param key 对应路径地址 + * @return 返回模块模版 + */ + ModelTemplateEntity getEntityByAppIdAndKey(@Param("appId")int appId,@Param("key")String key); + + /** + * 查询当前应用下面的所有自定义页面 + * @param appId 应用编号 + * @return 返回记录集合 + */ + List queryByAppId(@Param("appId")int appId); + +} diff --git a/src/main/java/com/mingsoft/basic/dao/IModelTemplateDao.xml b/src/main/java/com/mingsoft/basic/dao/IModelTemplateDao.xml new file mode 100644 index 00000000..a243e769 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IModelTemplateDao.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + insert into model_template + + mt_path, + mt_title, + mt_key, + mt_appid, + mt_modelid, + + + #{modelTemplatePath}, + #{modelTemplateTitle}, + #{modelTemplateKey}, + #{modelTemplateAppId}, + #{modelTemplateModelId}, + + + + + + + delete from + model_template + where + mt_id = #{id} + + + update model_template + + mt_title=#{modelTemplateTitle}, + mt_path=#{modelTemplatePath}, + mt_key=#{modelTemplateKey}, + + where mt_id = #{modelTemplateId} + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IPeopleDao.xml b/src/main/java/com/mingsoft/basic/dao/IPeopleDao.xml new file mode 100644 index 00000000..788b668d --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IPeopleDao.xml @@ -0,0 +1,155 @@ + + + + + + + P.PEOPLE_ID,P.PEOPLE_PHONE,P.PEOPLE_NAME,P.PEOPLE_PASSWORD,P.PEOPLE_CODE, + P.PEOPLE_DATETIME,P.PEOPLE_APP_ID,P.PEOPLE_MAIL,P.PEOPLE_STATE,P.PEOPLE_CODESENDDATE, + P.PEOPLE_PHONECHECK,P.PEOPLE_MAILLCHECK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into people + + PEOPLE_PHONE, + PEOPLE_NAME, + PEOPLE_PASSWORD, + PEOPLE_DATETIME, + PEOPLE_APP_ID, + PEOPLE_MAIL, + PEOPLE_STATE, + PEOPLE_CODE, + PEOPLE_CODESENDDATE, + PEOPLE_MAILLCHECK, + PEOPLE_PHONECHECK, + + + #{peoplePhone}, + #{peopleName}, + #{peoplePassword}, + #{peopleDateTime}, + #{peopleAppId}, + #{peopleMail}, + #{peopleState}, + #{peopleCode}, + #{peopleCodeSendDate}, + #{peopleMailCheck}, + #{peoplePhoneCheck}, + + + + + + + + + + + update people + + PEOPLE_PHONE=#{peoplePhone}, + PEOPLE_NAME=#{peopleName}, + PEOPLE_PASSWORD=#{peoplePassword}, + PEOPLE_DATETIME=#{peopleDateTime}, + PEOPLE_MAIL=#{peopleMail}, + PEOPLE_STATE=#{peopleState}, + PEOPLE_CODE=#{peopleCode}, + PEOPLE_CODESENDDATE=#{peopleCodeSendDate}, + PEOPLE_MAILLCHECK=#{peopleMailCheck}, + PEOPLE_PHONECHECK=#{peoplePhoneCheck}, + + where PEOPLE_ID = #{peopleId} + + + + + + delete from people where PEOPLE_ID = #{peopleId} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IPeopleStudentDao.xml b/src/main/java/com/mingsoft/basic/dao/IPeopleStudentDao.xml new file mode 100644 index 00000000..a8d3f18f --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IPeopleStudentDao.xml @@ -0,0 +1,173 @@ + + + + + + + ps.ps_peopleID,ps.ps_education,ps.ps_indate,ps.ps_cityID,ps.ps_school,ps.ps_department,ps.ps_specialty, + ps.ps_class,ps.ps_no,ps.ps_room + + + + ps.ps_peopleID,ps.ps_education,ps.ps_indate,ps.ps_cityID,ps.ps_school,ps.ps_department,ps.ps_specialty,ps.ps_class,ps.ps_no,ps.ps_room, + P.PEOPLE_ID,P.PEOPLE_PHONE,P.PEOPLE_NAME,P.PEOPLE_PASSWORD,P.PEOPLE_DATETIME,P.PEOPLE_APP_ID,P.PEOPLE_MAIL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into people_student + + ps_peopleID, + ps_education, + ps_indate, + ps_cityID, + ps_school, + ps_department, + ps_class, + ps_no, + ps_room, + + + #{peopleId}, + #{peopleStudentEducation}, + #{peopleStudentIndate}, + #{peopleStudentCityID}, + #{peopleStudentSchool}, + #{peopleStudentDepartment}, + #{peopleStudentClass}, + #{peopleStudentNo}, + #{peopleStudentRoom}, + + + + + + + update people_Student + + ps_education=#{peopleStudentEducation}, + ps_indate=#{peopleStudentIndate}, + ps_cityID=#{peopleStudentCityID}, + ps_school=#{peopleStudentSchool}, + ps_department=#{peopleStudentDepartment}, + ps_class=#{peopleStudentClass}, + ps_no=#{peopleStudentNo}, + ps_room=#{peopleStudentRoom}, + ps_specialty=#{peopleStudentSpecialty}, + + where ps_peopleID = #{peopleId} + + + + + + + + + + delete from people_student where ps_peopleID = #{peopleID} + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IPeopleUserDao.xml b/src/main/java/com/mingsoft/basic/dao/IPeopleUserDao.xml new file mode 100644 index 00000000..7adb49d9 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IPeopleUserDao.xml @@ -0,0 +1,99 @@ + + + + + + + PU.PU_PEOPLE_ID,PU.PU_REAL_NAME,PU.PU_ADDRESS,PU.PU_ICON,PU.PU_CARD, + PU.PU_NICKNAME,PU.PU_SEX,PU.PU_BIRTHDAY,PU.PU_APP_ID + + + + PU.PU_PEOPLE_ID,PU.PU_REAL_NAME,PU.PU_ADDRESS,PU.PU_ICON,PU.PU_NICKNAME,PU.PU_SEX,PU.PU_BIRTHDAY,PU.PU_APP_ID,PU.PU_CARD, + P.PEOPLE_ID,P.PEOPLE_PHONE,P.PEOPLE_NAME,P.PEOPLE_PASSWORD,P.PEOPLE_DATETIME,P.PEOPLE_APP_ID,P.PEOPLE_MAIL + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into people_user + + PU_PEOPLE_ID, + PU_REAL_NAME, + PU_ADDRESS, + PU_ICON, + PU_NICKNAME, + PU_SEX, + PU_BIRTHDAY, + PU_APP_ID, + PU_CARD, + + + #{peopleId}, + #{peopleUserRealName}, + #{peopleUserAddress}, + #{peopleUserIcon}, + #{peopleUserNickName}, + #{peopleUserSex}, + #{peopleUserBirthday}, + #{peopleUserAppId}, + #{peopleUserCard}, + + + + + + + update people_user + + PU_PEOPLE_ID=#{peopleId}, + PU_REAL_NAME=#{peopleUserRealName}, + PU_ADDRESS=#{peopleUserAddress}, + PU_ICON=#{peopleUserIcon}, + PU_NICKNAME=#{peopleUserNickName}, + PU_SEX=#{peopleUserSex}, + PU_BIRTHDAY=#{peopleUserBirthday}, + PU_CARD=#{peopleUserCard}, + + where PU_PEOPLE_ID = #{peopleId} + + + + + + + + + + + delete from people_user where pu_people_id = #{id} + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IPeopleWebsiteModelDao.xml b/src/main/java/com/mingsoft/basic/dao/IPeopleWebsiteModelDao.xml new file mode 100644 index 00000000..c29bc108 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IPeopleWebsiteModelDao.xml @@ -0,0 +1,58 @@ + + + + + + + pwm_peopleid,pwm_websiteid,pwm_modelid + + + + + + + + + + + + + insert into people_website_model + + pwm_peopleid, + pwm_websiteid, + pwm_modelid, + + + #{peopleWebsiteModelPeopleId}, + #{peopleWebsiteModelWebsiteId}, + #{peopleWebsiteModelModelId}, + + + + + + delete from people_website_model where pwm_peopleid = #{peopleWebsiteModelPeopleId} and pwm_websiteid=#{peopleWebsiteModelWebsiteId} and + pwm_modelid=#{peopleWebsiteModelModelId} + + + + + + + delete from people_website_model where pwm_peopleid = #{peopleWebsiteModelPeopleId} + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IRoleDao.java b/src/main/java/com/mingsoft/basic/dao/IRoleDao.java new file mode 100644 index 00000000..b358ebbf --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IRoleDao.java @@ -0,0 +1,76 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.mingsoft.basic.entity.RoleEntity; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; + +/** + * 角色持久化层,接口 + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IRoleDao extends IBaseDao{ + + /** + * 根据角色名称查询角色 + * @param roleName 角色名称 + * @param roleManagerId 角色管理员ID + * @return 返回角色实体 + */ + public RoleEntity queryRoleByRoleName(@Param("roleName")String roleName,@Param("roleManagerId")int roleManagerId); + + /** + * 根据管理员ID查询角色 + * @param roleManagerId 管理员ID + * @return 返回实体 + */ + public List queryRoleByManagerId(int roleManagerId); + + /** + * 查询该角色名称在数据库中的存在数 + * @param roleName 角色实体 + * @return 返回存在数量 + */ + public int countRoleName(@Param("roleName")String roleName, @Param("roleManagerId")int roleManagerId); + + /** + * 分页查询当前管理员所创建的角色 + * @param roleManagerId 管理员ID + * @param pageNo 当前页码 + * @param pageSize 显示条数 + * @param orderBy 排序字段 + * @param order 排序方式,true:asc;fales:desc + * @return 返回当前管理员所创建的角色集合 + */ + public List queryByPage(@Param("roleManagerId")int roleManagerId,@Param("pageNo")int pageNo,@Param("pageSize")int pageSize,@Param("orderBy")String orderBy,@Param("order") boolean order); + + /** + * 批量删除角色,多条或者一条 + * @param ids 多条表单集合(id) + */ + public void deleteAll(@Param("ids")String[] ids); + + /** + * 根据管理员id查询角色总数 + * @param managerId 管理员id + * @return 角色总数 + */ + public int getCountByManagerId(@Param("roleManagerId")int roleManagerId); +} + + + + + + + + + + + + diff --git a/src/main/java/com/mingsoft/basic/dao/IRoleDao.xml b/src/main/java/com/mingsoft/basic/dao/IRoleDao.xml new file mode 100644 index 00000000..661b00d4 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IRoleDao.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into role + + ROLE_NAME, + ROLE_MANAGERID + + + #{roleName}, + #{roleManagerId} + + + + + + + delete r,rm + from role r left join role_model rm on r.ROLE_ID=rm.RM_ROLEID left join model m on m.MODEL_ID=rm.RM_MODELID where r.ROLE_ID=#{roleId}; + + + + + + DELETE FROM `role` + + ROLE_ID in #{item} + + + + + + + + + + + + + + + update role + + ROLE_NAME=#{roleName}, + ROLE_MANAGERID=#{roleManagerId} + + where ROLE_ID = #{roleId} + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/IRoleModelDao.java b/src/main/java/com/mingsoft/basic/dao/IRoleModelDao.java new file mode 100644 index 00000000..2e3a4da0 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IRoleModelDao.java @@ -0,0 +1,28 @@ +package com.mingsoft.basic.dao; + +import java.util.List; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.RoleModelEntity; + +/** + * 角色模块关联持久化层,接口,继承IBaseDao + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface IRoleModelDao extends IBaseDao{ + + /** + * 保存该角色对应的模块集合 + * @param roleModelList 集合 + */ + public void saveEntity(List roleModelList); + + /** + * 更新该角色对应的模块集合 + * @param roleModelList 集合 + */ + public void updateEntity(List roleModelList); +} diff --git a/src/main/java/com/mingsoft/basic/dao/IRoleModelDao.xml b/src/main/java/com/mingsoft/basic/dao/IRoleModelDao.xml new file mode 100644 index 00000000..dfb21ab7 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/IRoleModelDao.xml @@ -0,0 +1,30 @@ + + + + + + + + insert into role_model (RM_MODELID,RM_ROLEID) values + + (#{item.modelId},#{item.roleId}) + + + + + + + replace into role_model (RM_MODELID,RM_ROLEID) values + + (#{item.modelId},#{item.roleId}) + + + + + + + delete from role_model where RM_ROLEID=#{roleId} + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/dao/ISystemSkinDao.java b/src/main/java/com/mingsoft/basic/dao/ISystemSkinDao.java new file mode 100644 index 00000000..1a91b196 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/ISystemSkinDao.java @@ -0,0 +1,37 @@ +package com.mingsoft.basic.dao; + +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.SystemSkinEntity; + +/** + * 系统主题持久化 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public interface ISystemSkinDao extends IBaseDao{ + + /** + * 获取管理员对应的管理皮肤 + * @param managerId 管理员编号 + * @return 返回主题实体 + */ + public SystemSkinEntity getByManagerId(@Param("managerId")int managerId); + + /** + *更新管理员的后台皮肤 + * @param managerId 管理员编号 + * @param systemSkinId 皮肤编号 + */ + public void updateManagerSystemSkin(@Param("managerId")int managerId,@Param("systemSkinId")int systemSkinId); + + /** + *保存管理员的后台皮肤 + * @param managerId 管理员编号 + * @param systemSkinId 皮肤编号 + */ + public void saveManagerSystemSkin(@Param("managerId")int managerId,@Param("systemSkinId")int systemSkinId); +} diff --git a/src/main/java/com/mingsoft/basic/dao/ISystemSkinDao.xml b/src/main/java/com/mingsoft/basic/dao/ISystemSkinDao.xml new file mode 100644 index 00000000..64dce1ac --- /dev/null +++ b/src/main/java/com/mingsoft/basic/dao/ISystemSkinDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + update system_skin_manager set ssm_system_skin_ID=#{systemSkinId} where ssm_managerID=#{managerId} + + + insert into system_skin_manager values(#{managerId},#{systemSkinId}); + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/entity/AppEntity.java b/src/main/java/com/mingsoft/basic/entity/AppEntity.java new file mode 100644 index 00000000..fc577159 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/AppEntity.java @@ -0,0 +1,246 @@ +package com.mingsoft.basic.entity; + +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.mingsoft.base.entity.BaseEntity; + +/** + * 网站基本信息实体类 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class AppEntity extends BaseEntity { + + /** + * 应用名称 + */ + private String appName; + + /** + * 应用描述 + */ + private String appDescription; + + /** + * 应用logo + */ + private String appLogo; + + /** + * 应用编号 + */ + private int appId; + + /** + * 网站采用的模板风格 + */ + + private String appStyle; + + /** + * 移动端样式目录 + */ + private String appMobileStyle; + + + /** + * 网站关键字 + */ + private String appKeyword; + + /** + * 网站版权信息 + */ + private String appCopyright; + + /** + * 网站域名 + */ + private String appUrl; + + /** + * 管理站点的管理员id + */ + private int appManagerId; + + /** + * 站点日期 + */ + private Date appDatetime; + + /** + * 应用续费时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date appPayDate; + + /** + * 应用费用清单 + */ + private String appPay; + + public Date getAppPayDate() { + return appPayDate; + } + + public void setAppPayDate(Date appPayDate) { + this.appPayDate = appPayDate; + } + + public String getAppPay() { + return appPay; + } + + public void setAppPay(String appPay) { + this.appPay = appPay; + } + + public Date getAppDatetime() { + return appDatetime; + } + + public void setAppDatetime(Date appDatetime) { + this.appDatetime = appDatetime; + } + + /** + * 获取网站版权信息 + * + * @return 返回网站版权信息 + */ + public String getAppCopyright() { + return appCopyright; + } + + public String getAppDescription() { + return appDescription; + } + + public int getAppId() { + return appId; + } + + /** + * 获取网站的关键字 + * + * @return 返回网站关键字 + */ + public String getAppKeyword() { + return appKeyword; + } + + /** + * 获取管理员的id + * + * @return 返回管理员ID + */ + public int getAppManagerId() { + return appManagerId; + } + + public String getAppName() { + return appName; + } + + /** + * 获取网站使用的模板风格 + * + * @return 返回网站使用的模板风格 + */ + public String getAppStyle() { + return appStyle; + } + + /** + * 获取网站域名 + */ + public String getAppUrl() { + return appUrl; + } + + /** + * 获取网站域名 + */ + public String getAppHostUrl() { + if (appUrl.indexOf("\n") > 0) { //存在多个域名绑定 + return appUrl.split("\n")[0].trim(); + } + return appUrl; + } + + public String getAppLogo() { + return appLogo; + } + + /** + * 设置网站版权信息 + * + * @param appCopyright + */ + public void setAppCopyright(String appCopyright) { + this.appCopyright = appCopyright; + } + + public void setAppDescription(String appDescription) { + this.appDescription = appDescription; + } + + public void setAppId(int appId) { + this.appId = appId; + } + + /** + * 设置网站关键字 + * + * @param appKeyword + */ + public void setAppKeyword(String appKeyword) { + this.appKeyword = appKeyword; + } + + /** + * 设置管理员的id + */ + public void setAppManagerId(int appManagerId) { + this.appManagerId = appManagerId; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + /** + * 设置网站使用的模板风格 + * + * @param appStyle + */ + public void setAppStyle(String appStyle) { + this.appStyle = appStyle; + } + + /** + * 设置网站域名 + * + * @param appUrl + */ + public void setAppUrl(String appUrl) { + this.appUrl = appUrl; + } + + + public String getAppMobileStyle() { + return appMobileStyle; + } + + public void setAppMobileStyle(String appMobileStyle) { + this.appMobileStyle = appMobileStyle; + } + + public void setAppLogo(String appLogo) { + this.appLogo = appLogo; + } + +} diff --git a/src/main/java/com/mingsoft/basic/entity/BasicAttentionEntity.java b/src/main/java/com/mingsoft/basic/entity/BasicAttentionEntity.java new file mode 100644 index 00000000..08c0d057 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/BasicAttentionEntity.java @@ -0,0 +1,216 @@ +/** + * + */ +package com.mingsoft.basic.entity; + +import java.util.Date; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * + *

+ * 铭飞科技-基础 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 成卫雄 + * QQ:330216230 + * + *

+ * Comments:关注实体 + *

+ * + *

+ * Create Date:2014-11-12 + *

+ * + *

+ * Modification history: + *

+ */ +public class BasicAttentionEntity extends BaseEntity{ + + /** + * 关注类型 1.收藏 + */ + public final static int TYPE_COLLECT = 1; + + /** + * 关注类型 2.顶 + */ + public final static int TYPE_TOP = 2; + + /** + * 自增长ID + */ + private int basicAttentionId; + + /** + * 关联用户Id + */ + private int basicAttentionPeopleId; + + /** + * 关联关注内容Id + */ + private int basicAttentionBasicId; + + /** + * 关联应用Id + */ + private int basicAttentionAppId; + + /** + * 关注类型 + * 1.收藏 + * 2.顶 + */ + private int basicAttentionType; + + + /** + * 关注时间 + */ + private Date basicAttentionTime = new Date(); + + + + /** + * 收藏内容的标题 + */ + private BasicEntity basicEntity; + + + /** + * 收藏内容的链接地址 + */ + private String basicAttentionUrl; + + + + public String getBasicAttentionUrl() { + return basicAttentionUrl; + } + + public void setBasicAttentionUrl(String basicAttentionUrl) { + this.basicAttentionUrl = basicAttentionUrl; + } + + /** + * 获取basicEntity + * @return basicEntity + */ + public BasicEntity getBasicEntity() { + return basicEntity; + } + + /** + * 设置basicEntity + * @param basicEntity + */ + public void setBasicEntity(BasicEntity basicEntity) { + this.basicEntity = basicEntity; + } + + /** + * 获取basicAttentionId + * @return basicAttentionId + */ + public int getBasicAttentionId() { + return basicAttentionId; + } + + /** + * 设置basicAttentionId + * @param basicAttentionId + */ + public void setBasicAttentionId(int basicAttentionId) { + this.basicAttentionId = basicAttentionId; + } + + /** + * 获取basicAttentionPeopleId + * @return basicAttentionPeopleId + */ + public int getBasicAttentionPeopleId() { + return basicAttentionPeopleId; + } + + /** + * 设置basicAttentionPeopleId + * @param basicAttentionPeopleId + */ + public void setBasicAttentionPeopleId(int basicAttentionPeopleId) { + this.basicAttentionPeopleId = basicAttentionPeopleId; + } + + /** + * 获取basicAttentionBasicId + * @return basicAttentionBasicId + */ + public int getBasicAttentionBasicId() { + return basicAttentionBasicId; + } + + /** + * 设置basicAttentionBasicId + * @param basicAttentionBasicId + */ + public void setBasicAttentionBasicId(int basicAttentionBasicId) { + this.basicAttentionBasicId = basicAttentionBasicId; + } + + /** + * 获取basicAttentionAppId + * @return basicAttentionAppId + */ + public int getBasicAttentionAppId() { + return basicAttentionAppId; + } + + /** + * 设置basicAttentionAppId + * @param basicAttentionAppId + */ + public void setBasicAttentionAppId(int basicAttentionAppId) { + this.basicAttentionAppId = basicAttentionAppId; + } + + /** + * 获取basicAttentionType + * @return basicAttentionType + */ + public int getBasicAttentionType() { + return basicAttentionType; + } + + /** + * 设置basicAttentionType + * @param basicAttentionType + */ + public void setBasicAttentionType(int basicAttentionType) { + this.basicAttentionType = basicAttentionType; + } + + /** + * 获取basicAttentionTime + * @return basicAttentionTime + */ + public Date getBasicAttentionTime() { + return basicAttentionTime; + } + + /** + * 设置basicAttentionTime + * @param basicAttentionTime + */ + public void setBasicAttentionTime(Date basicAttentionTime) { + this.basicAttentionTime = basicAttentionTime; + } + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/BasicCategoryEntity.java b/src/main/java/com/mingsoft/basic/entity/BasicCategoryEntity.java new file mode 100644 index 00000000..29249934 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/BasicCategoryEntity.java @@ -0,0 +1,55 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * 类别基础信息关联表 + * @author 成卫雄QQ:330216230 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class BasicCategoryEntity extends BaseEntity { + /** + * 类别编号 + */ + private int bcCategoryId; + + /** + * 基本信息编号 + */ + private int bcBasicId; + + /** + *获取 bcCategoryId + * @return bcCategoryId + */ + public int getBcCategoryId() { + return bcCategoryId; + } + + /** + *设置bcCategoryId + * @param bcCategoryId + */ + public void setBcCategoryId(int bcCategoryId) { + this.bcCategoryId = bcCategoryId; + } + + /** + *获取 bcBasicId + * @return bcBasicId + */ + public int getBcBasicId() { + return bcBasicId; + } + + /** + *设置bcBasicId + * @param bcBasicId + */ + public void setBcBasicId(int bcBasicId) { + this.bcBasicId = bcBasicId; + } +} diff --git a/src/main/java/com/mingsoft/basic/entity/BasicChildEntity.java b/src/main/java/com/mingsoft/basic/entity/BasicChildEntity.java new file mode 100644 index 00000000..1b98c992 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/BasicChildEntity.java @@ -0,0 +1,53 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + + * 基础表之间的子父关联关系 + + * @author 史爱华 QQ:924690193 + + * @version + + * 版本号:100-000-000
+ + * 创建日期:2015-08-21
+ + * 历史修订:
+ + */ +public class BasicChildEntity extends BaseEntity{ + + /** + * 基础basicId + */ + private int basicId; + + /** + * 基础basicId关联的子id + */ + private int basicChildId; + + + + public int getBasicId() { + return basicId; + } + + public void setBasicId(int basicId) { + this.basicId = basicId; + } + + public int getBasicChildId() { + return basicChildId; + } + + public void setBasicChildId(int basicChildId) { + this.basicChildId = basicChildId; + } + + + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/BasicEntity.java b/src/main/java/com/mingsoft/basic/entity/BasicEntity.java new file mode 100644 index 00000000..7b8277b2 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/BasicEntity.java @@ -0,0 +1,252 @@ +package com.mingsoft.basic.entity; + +import java.sql.Timestamp; +import java.util.Date; +import com.mingsoft.base.entity.BaseEntity; + +/** + * 基本应用实体绑定 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class BasicEntity extends BaseEntity { + /** + * 基本实体自增长编号 + */ + private int basicId; + + /** + *标题 + *长度:200 + */ + private String basicTitle; + + /** + * 描述 + * 长度:1500 + */ + private String basicDescription; + + /** + * 缩略图 + * 长度:200 + */ + private String basicThumbnails; + + /** + * 点击次数 + */ + private int basicHit; + + /** + * 发布时间 + */ + private Timestamp basicDateTime; + + /** + * 更新时间 + */ + private Date basicUpdateTime; + + /** + * 用户编号 + */ + private int basicPeopleId; + + /** + * 排序 + */ + private int basicSort; + + + + /** + *所属分类编号 + */ + private int basicCategoryId=0; + + /** + * 文章所属应用 + */ + private int basicAppId; + + /** + * 模块编号 + */ + private int basicModelId; + + public int getBasicModelId() { + return basicModelId; + } + + public void setBasicModelId(int basicModelId) { + this.basicModelId = basicModelId; + } + + public int getBasicAppId() { + return basicAppId; + } + + /** + *获取 basicCategoryId + * @return basicCategoryId + */ + public int getBasicCategoryId() { + return basicCategoryId; + } + + /** + *获取 basicDateTime + * @return basicDateTime + */ + public Timestamp getBasicDateTime() { + return basicDateTime; + } + + /** + *获取 basicDescription + * @return basicDescription + */ + public String getBasicDescription() { + return basicDescription; + } + + /** + *获取 basicHit + * @return basicHit + */ + public int getBasicHit() { + return basicHit; + } + + /** + *获取 basicId + * @return basicId + */ + public int getBasicId() { + return basicId; + } + + /** + *获取 basicPeopleId + * @return basicPeopleId + */ + public int getBasicPeopleId() { + return basicPeopleId; + } + + /** + *获取 basicThumbnails + * @return basicThumbnails + */ + public String getBasicThumbnails() { + return basicThumbnails; + } + + + /** + *获取 basicTitle + * @return basicTitle + */ + public String getBasicTitle() { + return basicTitle; + } + + /** + *获取 basicUpdateTime + * @return basicUpdateTime + */ + public Date getBasicUpdateTime() { + return basicUpdateTime; + } + + public void setBasicAppId(int basicAppId) { + this.basicAppId = basicAppId; + } + + /** + *设置basicCategoryId + * @param basicCategoryId + */ + public void setBasicCategoryId(int basicCategoryId) { + this.basicCategoryId = basicCategoryId; + } + + + /** + *设置basicDateTime + * @param basicDateTime + */ + public void setBasicDateTime(Timestamp basicDateTime) { + this.basicDateTime = basicDateTime; + } + + /** + *设置basicDescription + * @param basicDescription + */ + public void setBasicDescription(String basicDescription) { + this.basicDescription = basicDescription; + } + + /** + *设置basicHit + * @param basicHit + */ + public void setBasicHit(int basicHit) { + this.basicHit = basicHit; + } + + /** + *设置basicId + * @param basicId + */ + public void setBasicId(int basicId) { + this.basicId = basicId; + } + + /** + *设置basicPeopleId + * @param basicPeopleId + */ + public void setBasicPeopleId(int basicPeopleId) { + this.basicPeopleId = basicPeopleId; + } + + /** + *设置basicThumbnails + * @param basicThumbnails + */ + public void setBasicThumbnails(String basicThumbnails) { + this.basicThumbnails = basicThumbnails; + } + + /** + *设置basicTitle + * @param basicTitle + */ + public void setBasicTitle(String basicTitle) { + this.basicTitle = basicTitle; + } + + /** + *设置basicUpdateTime + * @param basicUpdateTime + */ + public void setBasicUpdateTime(Date basicUpdateTime) { + this.basicUpdateTime = basicUpdateTime; + } + + public int getBasicSort() { + return basicSort; + } + + public void setBasicSort(int basicSort) { + this.basicSort = basicSort; + } + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/CategoryEntity.java b/src/main/java/com/mingsoft/basic/entity/CategoryEntity.java new file mode 100644 index 00000000..b3d457a3 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/CategoryEntity.java @@ -0,0 +1,162 @@ +package com.mingsoft.basic.entity; + +import java.sql.Timestamp; +import com.mingsoft.base.entity.BaseEntity; + +/** + * 类别实体 + * @author 荣繁奎 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class CategoryEntity extends BaseEntity { + + /** + * 类别的编号自增长id + */ + private int categoryId; + + /** + * 类别的标题 + */ + private String categoryTitle; + + /** + * 类别的排序 + */ + private int categorySort; + + /** + * 类别发布时间 + */ + private Timestamp categoryDateTime; + + /** + * 发布用户编号(发布者编号) + */ + private int categoryManagerId; + + /** + * 所属模块编号 + */ + private int categoryModelId; + + + + /** + * 父类别的编号 + */ + private int categoryCategoryId; + + /** + * 缩略图 + */ + private String categorySmallImg; + + /** + * 分类所属应用编号 + */ + private int categoryAppId; + + /** + * 栏目描述 + */ + private String categoryDescription; + + + + public String getCategoryDescription() { + return categoryDescription; + } + + public void setCategoryDescription(String categoryDescription) { + this.categoryDescription = categoryDescription; + } + + public CategoryEntity() { + super(); + } + + public CategoryEntity(int categoryId,String categoryTitle) { + this.categoryId = categoryId; + this.categoryTitle = categoryTitle; + } + + public int getCategoryAppId() { + return categoryAppId; + } + + public void setCategoryAppId(int categoryAppId) { + this.categoryAppId = categoryAppId; + } + + public int getCategoryId() { + return categoryId; + } + + public void setCategoryId(int categoryId) { + this.categoryId = categoryId; + } + + public String getCategoryTitle() { + return categoryTitle; + } + + public void setCategoryTitle(String categoryTitle) { + this.categoryTitle = categoryTitle; + } + + public int getCategorySort() { + return categorySort; + } + + public void setCategorySort(int categorySort) { + this.categorySort = categorySort; + } + + public Timestamp getCategoryDateTime() { + return categoryDateTime; + } + + public void setCategoryDateTime(Timestamp categoryDateTime) { + this.categoryDateTime = categoryDateTime; + } + + + public int getCategoryManagerId() { + return categoryManagerId; + } + + public void setCategoryManagerId(int categoryManagerId) { + this.categoryManagerId = categoryManagerId; + } + + public int getCategoryModelId() { + return categoryModelId; + } + + public void setCategoryModelId(int categoryModelId) { + this.categoryModelId = categoryModelId; + } + + public int getCategoryCategoryId() { + return categoryCategoryId; + } + + public void setCategoryCategoryId(int categoryCategoryId) { + this.categoryCategoryId = categoryCategoryId; + } + + public String getCategorySmallImg() { + return categorySmallImg; + } + + public void setCategorySmallImg(String categorySmallImg) { + this.categorySmallImg = categorySmallImg; + } + + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/DiyFormEntity.java b/src/main/java/com/mingsoft/basic/entity/DiyFormEntity.java new file mode 100644 index 00000000..ec43cc20 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/DiyFormEntity.java @@ -0,0 +1,97 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.util.AESUtil; +import com.mingsoft.util.StringUtil; + +/** + * 自定义表单实体 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class DiyFormEntity extends BaseEntity{ + /** + * 自增长ID + */ + private int diyFormId; + + /** + * 表名提示文字 + */ + private String diyFormTipsName; + + /** + * 表单名称 + */ + private String diyFormTableName; + + /** + * 表单所属的管理员id + */ + private int diyFormManagerId; + + /** + * 表单所属的管理员id + */ + private int diyFormAppId; + + /** + * 表单的访问地址 + */ + private String diyFormUrl; + + public int getDiyFormId() { + return diyFormId; + } + + public void setDiyFormId(int diyFormId) { + this.diyFormId = diyFormId; + } + + public String getDiyFormTipsName() { + return diyFormTipsName; + } + + public void setDiyFormTipsName(String diyFormTipsName) { + this.diyFormTipsName = diyFormTipsName; + } + + public String getDiyFormTableName() { + return diyFormTableName; + } + + public void setDiyFormTableName(String diyFormTableName) { + this.diyFormTableName = diyFormTableName; + } + + public int getDiyFormManagerId() { + return diyFormManagerId; + } + + public void setDiyFormManagerId(int diyFormManagerId) { + this.diyFormManagerId = diyFormManagerId; + } + + public int getDiyFormAppId() { + return diyFormAppId; + } + + public void setDiyFormAppId(int diyFormAppId) { + this.diyFormAppId = diyFormAppId; + + } + + public String getDiyFormUrl() { + diyFormUrl=AESUtil.encrypt(this.diyFormId+"", StringUtil.Md5(this.diyFormAppId+"").substring(16)); + return diyFormUrl; + } + + public void setDiyFormUrl(String diyFormUrl) { + this.diyFormUrl = diyFormUrl; + } + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/DiyFormFieldEntity.java b/src/main/java/com/mingsoft/basic/entity/DiyFormFieldEntity.java new file mode 100644 index 00000000..72963794 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/DiyFormFieldEntity.java @@ -0,0 +1,128 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.constant.e.DiyFormFieldEnum; + +/** + * 自定义表单字段 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class DiyFormFieldEntity extends BaseEntity{ + /** + * 字段的默认值 + */ + private String diyFormFieldDefault; + + /** + * 字段名称 + */ + private String diyFormFieldFieldName; + + /** + * 对应的自定义from的id + */ + private int diyFormFieldFormId; + + /** + * 自增长ID + */ + private int diyFormFieldId; + + /** + * 判断字段为必填还是可选 + * 参考:DiyFormFieldEnum.IS_NULL + */ + private int diyFormFieldIsNull; + + /** + * 排序 + */ + private int diyFormFieldSort; + + /** + * 字段提示文字 + */ + private String diyFormFieldTipsName; + + /** + * 字段类型 + * 参考:DiyFormFieldEnum + */ + private int diyFormFieldType; + + public String getDiyFormFieldDefault() { + return diyFormFieldDefault; + } + + public String getDiyFormFieldFieldName() { + return diyFormFieldFieldName; + } + + public int getDiyFormFieldFormId() { + return diyFormFieldFormId; + } + + public int getDiyFormFieldId() { + return diyFormFieldId; + } + + public int getDiyFormFieldIsNull() { + return diyFormFieldIsNull; + } + + public int getDiyFormFieldSort() { + return diyFormFieldSort; + } + + public String getDiyFormFieldTipsName() { + return diyFormFieldTipsName; + } + + public int getDiyFormFieldType() { + return diyFormFieldType; + } + + public void setDiyFormFieldDefault(String diyFormFieldDefault) { + this.diyFormFieldDefault = diyFormFieldDefault; + } + public void setDiyFormFieldFieldName(String diyFormFieldFieldName) { + this.diyFormFieldFieldName = diyFormFieldFieldName; + } + + public void setDiyFormFieldFormId(int diyFormFieldFormId) { + this.diyFormFieldFormId = diyFormFieldFormId; + } + + public void setDiyFormFieldId(int diyFormFieldId) { + this.diyFormFieldId = diyFormFieldId; + } + + public void setDiyFormFieldIsNull(int diyFormFieldIsNull) { + this.diyFormFieldIsNull = diyFormFieldIsNull; + } + + public void setDiyFormFieldSort(int diyFormFieldSort) { + this.diyFormFieldSort = diyFormFieldSort; + } + + public void setDiyFormFieldTipsName(String diyFormFieldTipsName) { + this.diyFormFieldTipsName = diyFormFieldTipsName; + } + + public void setDiyFormFieldType(DiyFormFieldEnum diyFormFieldType) { + this.diyFormFieldType = diyFormFieldType.toInt(); + } + + public void setDiyFormFieldType(int diyFormFieldType) { + this.diyFormFieldType = diyFormFieldType; + } + + + + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/MailEntity.java b/src/main/java/com/mingsoft/basic/entity/MailEntity.java new file mode 100644 index 00000000..a417e13d --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/MailEntity.java @@ -0,0 +1,111 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * 邮件实体类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class MailEntity extends BaseEntity { + + /** + * 邮件对应的站点id + */ + private int mailAppId; + /** + * 邮件对应的模块id + */ + private int mailModelId; + /** + * 发件方名称 + */ + private String mailName; + /** + * 发件方密码 + */ + private String mailPassword; + /** + * 邮件端口 + */ + private int mailPort; + /** + * 接收方名称 + */ + private String mailServer; + /** + * 邮件内容 + */ + private String mailContent; + /** + * 收件方地址 + */ + private String mailReceive; + + public int getMailAppId() { + return mailAppId; + } + + public String getMailContent() { + return mailContent; + } + + public int getMailModelId() { + return mailModelId; + } + + public String getMailName() { + return mailName; + } + + public String getMailPassword() { + return mailPassword; + } + + public int getMailPort() { + return mailPort; + } + + public String getMailReceive() { + return mailReceive; + } + + public String getMailServer() { + return mailServer; + } + + public void setMailAppId(int mailAppId) { + this.mailAppId = mailAppId; + } + + public void setMailContent(String mailContent) { + this.mailContent = mailContent; + } + + public void setMailModelId(int mailModelId) { + this.mailModelId = mailModelId; + } + + public void setMailName(String mailName) { + this.mailName = mailName; + } + + public void setMailPassword(String mailPassword) { + this.mailPassword = mailPassword; + } + + public void setMailPort(int mailPort) { + this.mailPort = mailPort; + } + + public void setMailReceive(String mailReceive) { + this.mailReceive = mailReceive; + } + + public void setMailServer(String mailServer) { + this.mailServer = mailServer; + } +} \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/entity/MailTemplateEntity.java b/src/main/java/com/mingsoft/basic/entity/MailTemplateEntity.java new file mode 100644 index 00000000..66fd913f --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/MailTemplateEntity.java @@ -0,0 +1,100 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * 邮件实体类 + * @author 杨新远 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class MailTemplateEntity extends BaseEntity{ + + /** + * 邮箱id + */ + private int mailTemplateId; + /** + * 邮箱模板对应的站点id + */ + private int mailTemplateAppId; + /** + * 邮箱模板对应的模块id + */ + private int mailTemplateModelId; + /** + * 模板内容 + */ + private String mailTemplateContent; + + /** + * 模板标题 + */ + private String mailTemplateTitle; + + + /** + * 模板接收用户 + */ + private String mailTemplateReceive; + + public String getMailTemplateTitle() { + return mailTemplateTitle; + } + public void setMailTemplateTitle(String mailTemplateTitle) { + this.mailTemplateTitle = mailTemplateTitle; + } + + public int getMailTemplateId() { + return mailTemplateId; + } + public void setMailTemplateId(int mailTemplateId) { + this.mailTemplateId = mailTemplateId; + } + public int getMailTemplateAppId() { + return mailTemplateAppId; + } + public void setMailTemplateAppId(int mailTemplateAppId) { + this.mailTemplateAppId = mailTemplateAppId; + } + public int getMailTemplateModelId() { + return mailTemplateModelId; + } + public void setMailTemplateModelId(int mailTemplateModelId) { + this.mailTemplateModelId = mailTemplateModelId; + } + public String getMailTemplateContent() { + return mailTemplateContent; + } + public void setMailTemplateContent(String mailTemplateContent) { + this.mailTemplateContent = mailTemplateContent; + } + public String getMailTemplateReceive() { + return mailTemplateReceive; + } + public void setMailTemplateReceive(String mailTemplateReceive) { + this.mailTemplateReceive = mailTemplateReceive; + } + +} + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/mingsoft/basic/entity/ManagerEntity.java b/src/main/java/com/mingsoft/basic/entity/ManagerEntity.java new file mode 100644 index 00000000..70416079 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/ManagerEntity.java @@ -0,0 +1,163 @@ +package com.mingsoft.basic.entity; +import java.util.Date; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.base.entity.SessionEntity; + +/** + * 管理员实体类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ManagerEntity extends SessionEntity { + + /** + * 自增长编号 + */ + private int managerId; + + /** + * 帐号 + */ + private String managerName; + + /** + * 昵称 + */ + private String managerNickName; + + /** + * 密码 + */ + private String managerPassword; + + /** + * 角色ID + */ + private int managerRoleID; + + /** + * 用户ID + */ + private int managerPeopleID; + + /** + * 添加时间 + */ + private Date managerTime = new Date(); + + /** + * 获取managerTime + * @return managerTime + */ + public Date getManagerTime() { + return managerTime; + } + + /** + * 设置managerTime + * @param managerTime + */ + public void setManagerTime(Date managerTime) { + this.managerTime = managerTime; + } + + /** + * 获取managerId + * @return managerId + */ + public int getManagerId() { + return managerId; + } + + /** + * 设置managerId + * @param managerId + */ + public void setManagerId(int managerId) { + this.managerId = managerId; + } + + /** + * 获取managerName + * @return managerName + */ + public String getManagerName() { + return managerName; + } + + /** + * 设置managerName + * @param managerName + */ + public void setManagerName(String managerName) { + this.managerName = managerName; + } + + /** + * 获取managerPassword + * @return managerPassword + */ + public String getManagerPassword() { + return managerPassword; + } + + /** + * 设置managerPassword + * @param managerPassword + */ + public void setManagerPassword(String managerPassword) { + this.managerPassword = managerPassword; + } + + /** + * 获取managerPeopleID + * @return managerPeopleID + */ + public int getManagerPeopleID() { + return managerPeopleID; + } + + /** + * 设置managerPeopleID + * @param managerPeopleID + */ + public void setManagerPeopleID(int managerPeopleID) { + this.managerPeopleID = managerPeopleID; + } + + /** + * 获取managerNickName + * @return managerNickName + */ + public String getManagerNickName() { + return managerNickName; + } + + /** + * 设置managerNickName + * @param managerNickName + */ + public void setManagerNickName(String managerNickName) { + this.managerNickName = managerNickName; + } + + /** + * 获取managerRoleID + * @return managerRoleID + */ + public int getManagerRoleID() { + return managerRoleID; + } + + /** + * 设置managerRoleID + * @param managerRoleID + */ + public void setManagerRoleID(int managerRoleID) { + this.managerRoleID = managerRoleID; + } + +} diff --git a/src/main/java/com/mingsoft/basic/entity/ManagerModelPageEntity.java b/src/main/java/com/mingsoft/basic/entity/ManagerModelPageEntity.java new file mode 100644 index 00000000..5a463c25 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/ManagerModelPageEntity.java @@ -0,0 +1,55 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * 管理页面实体类 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ManagerModelPageEntity extends BaseEntity { + + /** + * 管理员id + */ + private int managerModelPagemanagerId; + + /** + * 后台显示界面地址 + */ + private String managerModelPageUrl; + + /** + * 模块编号 + */ + private int managerModelPageModelId; + + public int getManagerModelPagemanagerId() { + return managerModelPagemanagerId; + } + + public void setManagerModelPagemanagerId(int managerModelPagemanagerId) { + this.managerModelPagemanagerId = managerModelPagemanagerId; + } + + public String getManagerModelPageUrl() { + return managerModelPageUrl; + } + + public void setManagerModelPageUrl(String managerModelPageUrl) { + this.managerModelPageUrl = managerModelPageUrl; + } + + public int getManagerModelPageModelId() { + return managerModelPageModelId; + } + + public void setManagerModelPageModelId(int managerModelPageModelId) { + this.managerModelPageModelId = managerModelPageModelId; + } + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/ManagerSessionEntity.java b/src/main/java/com/mingsoft/basic/entity/ManagerSessionEntity.java new file mode 100644 index 00000000..5e165f9b --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/ManagerSessionEntity.java @@ -0,0 +1,107 @@ +package com.mingsoft.basic.entity; + +import java.util.List; +import com.mingsoft.base.entity.BaseEntity; + +/** + * Session管理员实体,继承ManagerEntity + * @author 张敏 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ManagerSessionEntity extends ManagerEntity { + + /** + * 父管理员ID + */ + private int managerParentID; + + /** + * 子管理员集合 + */ + private List managerChildIDs; + + /** + * 站点ID + */ + private int basicId; + + /** + * 当前应用使用的默认风格 + */ + private String style; + + + public String getStyle() { + return style; + } + + public void setStyle(String style) { + this.style = style; + } + + /** + * 管理员的后台皮肤 + */ + private SystemSkinEntity systemSkin; + + /** + * 获取managerParentID + * @return managerParentID + */ + public int getManagerParentID() { + return managerParentID; + } + + /** + * 设置managerParentID + * @param managerParentID + */ + public void setManagerParentID(int managerParentID) { + this.managerParentID = managerParentID; + } + + /** + * 获取managerChildIDs + * @return managerChildIDs + */ + public List getManagerChildIDs() { + return managerChildIDs; + } + + /** + * 设置managerChildIDs + * @param managerChildIDs + */ + public void setManagerChildIDs(List managerChildIDs) { + this.managerChildIDs = managerChildIDs; + } + + /** + * 获取basicId + * @return basicId + */ + public int getBasicId() { + return basicId; + } + + /** + * 设置basicId + * @param basicId + */ + public void setBasicId(int basicId) { + this.basicId = basicId; + } + + public SystemSkinEntity getSystemSkin() { + return systemSkin; + } + + public void setSystemSkin(SystemSkinEntity systemSkin) { + this.systemSkin = systemSkin; + } + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/ModelEntity.java b/src/main/java/com/mingsoft/basic/entity/ModelEntity.java new file mode 100644 index 00000000..fcbac133 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/ModelEntity.java @@ -0,0 +1,200 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.constant.e.ModelEnum; + +import java.sql.Timestamp; + +/** + * 模块实体 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ModelEntity extends BaseEntity { + + /** + * 模块的编号 + */ + private int modelId; + + /** + * 模块的标题 + */ + private String modelTitle; + + /** + * 发布时间 + */ + private Timestamp modelDatetime; + + /** + * 模块父id + */ + private int modelModelId; + + /** + * 链接地址 + */ + private String modelUrl; + + /** + * 模块编码 + */ + private String modelCode; + + /** + * 模块图标 + */ + private String modelIcon = null; + + /** + *模块管理员Id + */ + private int modelManagerId; + + public int getModelIsMenu() { + return modelIsMenu; + } + + @Deprecated + public void setModelIsMenu(int modelIsMenu) { + this.modelIsMenu = modelIsMenu; + } + + public void setModelIsMenu(ModelEnum modelIsMenu) { + this.modelIsMenu = modelIsMenu.toInt(); + } + + private int modelIsMenu; + + /** + * 获取modelCode + * @return modelCode + */ + public String getModelCode() { + return modelCode; + } + + /** + * 设置modelCode + * @param modelCode + */ + public void setModelCode(String modelCode) { + this.modelCode = modelCode; + } + + /** + * 获取modelIcon + * @return modelIcon + */ + public String getModelIcon() { + return modelIcon; + } + + /** + * 设置modelIcon + * @param modelIcon + */ + public void setModelIcon(String modelIcon) { + this.modelIcon = modelIcon; + } + + /** + * 获取modelModelId + * @return modelModelId + */ + public int getModelModelId() { + return modelModelId; + } + + /** + * 设置modelModelId + * @param modelModelId + */ + public void setModelModelId(int modelModelId) { + this.modelModelId = modelModelId; + } + + /** + * 获取modelUrl + * @return modelUrl + */ + public String getModelUrl() { + return modelUrl; + } + + /** + * 设置modelUrl + * @param modelUrl + */ + public void setModelUrl(String modelUrl) { + this.modelUrl = modelUrl; + } + + /** + * 获取modelId + * @return modelId + */ + public int getModelId() { + return modelId; + } + + /** + * 设置modelId + * @param modelId + */ + public void setModelId(int modelId) { + this.modelId = modelId; + } + + /** + * 获取modelDatetime + * @return modelDatetime + */ + public Timestamp getModelDatetime() { + return modelDatetime; + } + + /** + * 设置modelDatetime + * @param modelDatetime + */ + public void setModelDatetime(Timestamp modelDatetime) { + this.modelDatetime = modelDatetime; + } + + /** + * 获取modelTitle + * @return modelTitle + */ + public String getModelTitle() { + return modelTitle; + } + + /** + * 设置modelTitle + * @param modelTitle + */ + public void setModelTitle(String modelTitle) { + this.modelTitle = modelTitle; + } + + /** + * 获取管理员id + * @return 返回管理员ID + */ + public int getModelManagerId() { + return modelManagerId; + } + + /** + * 设置管理员id + * @param modelManagerId 管理员ID + */ + public void setModelManagerId(int modelManagerId) { + this.modelManagerId = modelManagerId; + } +} diff --git a/src/main/java/com/mingsoft/basic/entity/ModelTemplateEntity.java b/src/main/java/com/mingsoft/basic/entity/ModelTemplateEntity.java new file mode 100644 index 00000000..62763d01 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/ModelTemplateEntity.java @@ -0,0 +1,96 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; +import java.sql.Timestamp; + +/** + * 模块模版实体 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ModelTemplateEntity extends BaseEntity { + + /** + * 自动编号 + */ + private int modelTemplateId; + + /** + * 应用编号 + */ + private int modelTemplateAppId; + + /** + * 模块的编号 + */ + private int modelTemplateModelId; + + /** + * 对应路径 + */ + private String modelTemplatePath; + + /** + * 标题 + */ + private String modelTemplateTitle; + + + public String getModelTemplateTitle() { + return modelTemplateTitle; + } + + public void setModelTemplateTitle(String modelTemplateTitle) { + this.modelTemplateTitle = modelTemplateTitle; + } + + /** + * 路径值 + */ + private String modelTemplateKey; + + + public String getModelTemplateKey() { + return modelTemplateKey; + } + + public void setModelTemplateKey(String modelTemplateKey) { + this.modelTemplateKey = modelTemplateKey; + } + + public int getModelTemplateAppId() { + return modelTemplateAppId; + } + + public void setModelTemplateAppId(int modelTemplateAppId) { + this.modelTemplateAppId = modelTemplateAppId; + } + + public int getModelTemplateModelId() { + return modelTemplateModelId; + } + + public void setModelTemplateModelId(int modelTemplateModelId) { + this.modelTemplateModelId = modelTemplateModelId; + } + + public String getModelTemplatePath() { + return modelTemplatePath; + } + + public void setModelTemplatePath(String modelTemplatePath) { + this.modelTemplatePath = modelTemplatePath; + } + + public int getModelTemplateId() { + return modelTemplateId; + } + + public void setModelTemplateId(int modelTemplateId) { + this.modelTemplateId = modelTemplateId; + } + +} diff --git a/src/main/java/com/mingsoft/basic/entity/RoleEntity.java b/src/main/java/com/mingsoft/basic/entity/RoleEntity.java new file mode 100644 index 00000000..9f8879e2 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/RoleEntity.java @@ -0,0 +1,79 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * 管理员角色表 + * @author 成卫雄QQ:330216230 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class RoleEntity extends BaseEntity { + + /** + * 管理员角色自增长Id + */ + private int roleId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 该角色的创建者ID + */ + private int roleManagerId; + + + /** + *获取 roleId + * @return roleId + */ + public int getRoleId() { + return roleId; + } + + /** + *设置roleId + * @param roleId + */ + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + /** + *获取 roleName + * @return roleName + */ + public String getRoleName() { + return roleName; + } + + /** + *设置roleName + * @param roleName + */ + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + /** + * 获取rolePeopleId + * @return rolePeopleId + */ + public int getRoleManagerId() { + return roleManagerId; + } + + /** + * 设置rolePeopleId + * @param rolePeopleId + */ + public void setRoleManagerId(int rolePeopleId) { + this.roleManagerId = rolePeopleId; + } + +} diff --git a/src/main/java/com/mingsoft/basic/entity/RoleModelEntity.java b/src/main/java/com/mingsoft/basic/entity/RoleModelEntity.java new file mode 100644 index 00000000..a5c2db1c --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/RoleModelEntity.java @@ -0,0 +1,56 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * 角色与模块关联表 + * @author 成卫雄QQ:330216230 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class RoleModelEntity extends BaseEntity { + + /** + * 模块编号 + */ + private int modelId; + + /** + * 角色编号 + */ + private int roleId; + + /** + *获取 modelId + * @return modelId + */ + public int getModelId() { + return modelId; + } + + /** + *设置modelId + * @param modelId + */ + public void setModelId(int modelId) { + this.modelId = modelId; + } + + /** + *获取 roleId + * @return roleId + */ + public int getRoleId() { + return roleId; + } + + /** + *设置roleId + * @param roleId + */ + public void setRoleId(int roleId) { + this.roleId = roleId; + } +} diff --git a/src/main/java/com/mingsoft/basic/entity/SystemSkinEntity.java b/src/main/java/com/mingsoft/basic/entity/SystemSkinEntity.java new file mode 100644 index 00000000..2dfd8f9e --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/SystemSkinEntity.java @@ -0,0 +1,99 @@ +package com.mingsoft.basic.entity; + +import java.util.Date; +import com.mingsoft.base.entity.BaseEntity; + +/** + * 系统皮肤 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class SystemSkinEntity extends BaseEntity{ + + private int systemSkinId; + + /** + * 背景图 + */ + private String systemSkinBackgroundImg; + + /** + * 字体颜色 + */ + private String systemSkinColor; + + /** + * 全局样式 + */ + private String systemSkinCss; + + private Date systemSkinDate; + + private int systemSkinAppId; + /** + * 登陆页面 + */ + private String systemSkinLoginPage; + + + public String getSystemSkinLoginPage() { + return systemSkinLoginPage; + } + + public void setSystemSkinLoginPage(String systemSkinLoginPage) { + this.systemSkinLoginPage = systemSkinLoginPage; + } + + public int getSystemSkinAppId() { + return systemSkinAppId; + } + + public void setSystemSkinAppId(int systemSkinAppId) { + this.systemSkinAppId = systemSkinAppId; + } + + public Date getSystemSkinDate() { + return systemSkinDate; + } + + public void setSystemSkinDate(Date systemSkinDate) { + this.systemSkinDate = systemSkinDate; + } + + public int getSystemSkinId() { + return systemSkinId; + } + + public void setSystemSkinId(int systemSkinId) { + this.systemSkinId = systemSkinId; + } + + public String getSystemSkinBackgroundImg() { + return systemSkinBackgroundImg; + } + + public void setSystemSkinBackgroundImg(String systemSkinBackgroundImg) { + this.systemSkinBackgroundImg = systemSkinBackgroundImg; + } + + public String getSystemSkinColor() { + return systemSkinColor; + } + + public void setSystemSkinColor(String systemSkinColor) { + this.systemSkinColor = systemSkinColor; + } + + public String getSystemSkinCss() { + return systemSkinCss; + } + + public void setSystemSkinCss(String systemSkinCss) { + this.systemSkinCss = systemSkinCss; + } + + +} diff --git a/src/main/java/com/mingsoft/basic/entity/UpgraderEntity.java b/src/main/java/com/mingsoft/basic/entity/UpgraderEntity.java new file mode 100644 index 00000000..a6a75942 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/entity/UpgraderEntity.java @@ -0,0 +1,99 @@ +package com.mingsoft.basic.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * 上传更新实体 + * @author 杨新远 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class UpgraderEntity extends BaseEntity{ + + /** + * 上传更新id + */ + private int upgraderId; + + /** + * 所属模块编号 + */ + private int upgraderModelId; + + /** + * 版本信息 + */ + private int upgraderVersion; + + /** + * 描述 + */ + private String upgraderDesc; + + /** + * 更新补丁包的位置 + */ + private String upgraderPatch ; + + + public int getUpgraderId() { + return upgraderId; + } + + public void setUpgraderId(int upgraderId) { + this.upgraderId = upgraderId; + } + + public int getUpgraderModelId() { + return upgraderModelId; + } + + public void setUpgraderModelId(int upgraderModelId) { + this.upgraderModelId = upgraderModelId; + } + + public int getUpgraderVersion() { + return upgraderVersion; + } + + public void setUpgraderVersion(int upgraderVersion) { + this.upgraderVersion = upgraderVersion; + } + + public String getUpgraderDesc() { + return upgraderDesc; + } + + public void setUpgraderDesc(String upgraderDesc) { + this.upgraderDesc = upgraderDesc; + } + + public String getUpgraderPatch() { + return upgraderPatch; + } + + public void setUpgraderPatch(String upgraderPatch) { + this.upgraderPatch = upgraderPatch; + } + +} + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/mingsoft/basic/filter/ManagerFilter.java b/src/main/java/com/mingsoft/basic/filter/ManagerFilter.java new file mode 100644 index 00000000..bc53b6eb --- /dev/null +++ b/src/main/java/com/mingsoft/basic/filter/ManagerFilter.java @@ -0,0 +1,54 @@ +package com.mingsoft.basic.filter; + +import java.io.IOException; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.annotation.WebFilter; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.mingsoft.base.filter.BaseFilter; +import com.mingsoft.base.constant.SessionConst; + + +/** + * 后台过滤器 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +//@WebFilter(filterName="managerFilter",urlPatterns="/manager/*") +public class ManagerFilter extends BaseFilter { + + /** + * 过滤 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @param chain 过滤器链 + * @throws ServletException Servlet异常处理 + * @throws IOException IO异常处理 + */ + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletRequest httpRequest = (HttpServletRequest) request; + HttpServletResponse httpResponse = (HttpServletResponse) response; + Object mangerObj = httpRequest.getSession().getAttribute(SessionConst.MANAGER_ESSION.toString()); + try { + if (mangerObj!=null) { + chain.doFilter(request, response); + } else { + httpResponse.sendRedirect(request.getScheme() + "://"+ request.getServerName() + (request.getServerPort()==80?"":":"+request.getServerPort())+ httpRequest.getContextPath() + "/ms/login.do"); + } + } catch (IOException e) { + e.printStackTrace(); + } catch (ServletException e) { + e.printStackTrace(); + } + } + + +} diff --git a/src/main/java/com/mingsoft/basic/interceptor/ActionInterceptor.java b/src/main/java/com/mingsoft/basic/interceptor/ActionInterceptor.java new file mode 100644 index 00000000..1ecb0902 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/interceptor/ActionInterceptor.java @@ -0,0 +1,60 @@ +package com.mingsoft.basic.interceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.log4j.Logger; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.util.StringUtil; + +/** + * 所有action的拦截器,主要是设置base与basepath + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ActionInterceptor extends HandlerInterceptorAdapter { + + protected Logger logger = Logger.getLogger(this.getClass()); + + private static String BASE = "base"; + + private static String BASE_PATH = "basePath"; + + private static String MODEL_ID = "modelId"; + + + public static boolean IS_WINDOWS = false; + + + static { + if (System.getProperty("os.name").toLowerCase().indexOf("windows" )>0) { + IS_WINDOWS = true; + } + } + + /** + * 所有action的拦截,主要拦截base与basepath + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @param handler 处理器 + * @throws Exception 异常处理 + * @return 处理后返回true + */ + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + String modelId = request.getParameter(MODEL_ID); //获取模块编号 + if (StringUtil.isInteger(modelId)) { + request.getSession().setAttribute(SessionConst.MODEL_ID_SESSION.toString(), modelId); + request.getSession().setAttribute(SessionConst.MODEL_TITLE_SESSION.toString(), request.getParameter("modelTitle")); + + } + request.setAttribute(BASE, Const.BASE); + request.setAttribute(BASE_PATH,request.getScheme() + "://"+ request.getServerName() + (request.getServerPort()==80?"":":"+request.getServerPort())+ Const.BASE); + return true; + } + +} diff --git a/src/main/java/com/mingsoft/basic/interceptor/BaseInterceptor.java b/src/main/java/com/mingsoft/basic/interceptor/BaseInterceptor.java new file mode 100644 index 00000000..b7600dd9 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/interceptor/BaseInterceptor.java @@ -0,0 +1,59 @@ +/** + * + */ +package com.mingsoft.basic.interceptor; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import org.apache.log4j.Logger; +import org.springframework.web.context.support.WebApplicationContextUtils; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.util.StringUtil; + +/** + * 基础拦截器 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public abstract class BaseInterceptor extends HandlerInterceptorAdapter{ + + public Logger logger = Logger.getLogger(this.getClass()); + + /** + * 通过spring的webapplicationcontext上下文对象读取bean对象 + * @param sc 上下文servletConext对象 + * @param beanName 要读取的bean的名称 + * @return 获取到返回对象,否则返回null + */ + protected Object getBean(ServletContext sc,String beanName) { + return WebApplicationContextUtils.getWebApplicationContext(sc).getBean(beanName); + } + + /** + * 设置session + * @param request HttpServletRequest对象 + * @param key 键SessionConst里面定义 + * @param obj 对象 + */ + protected void setSession(HttpServletRequest request,SessionConst key,Object obj) { + if (StringUtil.isBlank(obj.toString())) { + return; + } + request.getSession().setAttribute(key.toString(), obj); + } + + + + /** + * 获取session + * @param request HttpServletRequest对象 + * @param key 键SessionConst里面定义 + */ + protected Object getSession(HttpServletRequest request,SessionConst key) { + return request.getSession().getAttribute(key.toString()); + } +} diff --git a/src/main/java/com/mingsoft/basic/interceptor/ManagerInterceptor.java b/src/main/java/com/mingsoft/basic/interceptor/ManagerInterceptor.java new file mode 100644 index 00000000..d3838292 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/interceptor/ManagerInterceptor.java @@ -0,0 +1,42 @@ +package com.mingsoft.basic.interceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.log4j.Logger; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +/** + * 后台拦截器 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ManagerInterceptor extends HandlerInterceptorAdapter { + + protected Logger logger = Logger.getLogger(this.getClass()); + + /** + * 后台拦截器 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @param handler 处理器 + * @throws Exception 异常处理 + * @return 处理后返回true + */ + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { +// String modelId = request.getParameter("modelId"); //获取模块编号 +// if (StringUtil.isInteger(modelId)) { +// request.getSession().setAttribute(SessionConst.MODEL_ID_SESSION.toString(), modelId); +// request.getSession().setAttribute(SessionConst.MODEL_TITLE_SESSION.toString(), request.getParameter("modelTitle")); +// } +// request.setAttribute(BASE, Const.BASE); +// request.setAttribute(BASE_PATH,request.getScheme() + "://"+ request.getServerName() + (request.getServerPort()==80?"":":"+request.getServerPort())+ Const.BASE); + return true; + } + + + +} diff --git a/src/main/java/com/mingsoft/basic/resources/field_data_type.properties b/src/main/java/com/mingsoft/basic/resources/field_data_type.properties new file mode 100644 index 00000000..06485206 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/resources/field_data_type.properties @@ -0,0 +1,6 @@ +#\u5b57\u6bb5\u7684\u6570\u636e\u7c7b\u578b +1=varchar(220) +2=date +3=text +4=int(22) +5=float diff --git a/src/main/java/com/mingsoft/basic/resources/field_type.properties b/src/main/java/com/mingsoft/basic/resources/field_type.properties new file mode 100644 index 00000000..6252bb14 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/resources/field_type.properties @@ -0,0 +1,6 @@ +#\u6570\u636e\u7684\u7c7b\u578b +1=\u5b57\u7b26\u7c7b\u578b +2=\u65f6\u95f4\u7c7b\u578b +3=\u6587\u672c\u7c7b\u578b +4=\u6574\u5f62 +5=\u6d6e\u70b9\u7c7b\u578b diff --git a/src/main/java/com/mingsoft/basic/security/BaseAuthFilter.java b/src/main/java/com/mingsoft/basic/security/BaseAuthFilter.java new file mode 100644 index 00000000..6728e608 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/security/BaseAuthFilter.java @@ -0,0 +1,31 @@ +package com.mingsoft.basic.security; + +import javax.servlet.Filter; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebFilter; + +import org.springframework.web.context.WebApplicationContext; + +import com.mingsoft.base.constant.Const; + +/** + * + * 权限过滤器 + * @author killfen QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2015年9月8日
+ * 历史修订:
+ */ +@WebFilter(filterName = "baseAuthFilter", urlPatterns = "/*") +public class BaseAuthFilter extends org.springframework.web.filter.DelegatingFilterProxy { + + @Override + protected Filter initDelegate(WebApplicationContext wac) throws ServletException { + // TODO Auto-generated method stub + Const.BASE = wac.getServletContext().getContextPath(); + Const.PROJECT_PATH = wac.getServletContext().getRealPath("/"); + return super.initDelegate(wac); + } + +} diff --git a/src/main/java/com/mingsoft/basic/security/BaseAuthRealm.java b/src/main/java/com/mingsoft/basic/security/BaseAuthRealm.java new file mode 100644 index 00000000..b5d1e3b2 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/security/BaseAuthRealm.java @@ -0,0 +1,114 @@ +package com.mingsoft.basic.security; + +import java.util.List; + +import org.apache.shiro.authc.AuthenticationException; +import org.apache.shiro.authc.AuthenticationInfo; +import org.apache.shiro.authc.AuthenticationToken; +import org.apache.shiro.authc.SimpleAuthenticationInfo; +import org.apache.shiro.authc.UsernamePasswordToken; +import org.apache.shiro.authc.credential.SimpleCredentialsMatcher; +import org.apache.shiro.authz.AuthorizationInfo; +import org.apache.shiro.authz.SimpleAuthorizationInfo; +import org.apache.shiro.cache.Cache; +import org.apache.shiro.realm.AuthorizingRealm; +import org.apache.shiro.subject.PrincipalCollection; +import org.apache.shiro.subject.SimplePrincipalCollection; +import org.springframework.beans.factory.annotation.Autowired; + +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IManagerBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.basic.entity.ModelEntity; +import com.mingsoft.util.StringUtil; + +/** + * 权限 + * + * @author killfenQQ:78750478 + * @version 版本号:
+ * 创建日期:2015年9月9日
+ * 历史修订:
+ */ +public class BaseAuthRealm extends AuthorizingRealm { + + /** + * 管理员业务层 + */ + @Autowired + private IManagerBiz managerBiz; + + /** + * 模块业务层 + */ + @Autowired + private IModelBiz modelBiz; + + /** + * 构造 + */ + public BaseAuthRealm() { + // TODO Auto-generated constructor stub + super(); + // 设置认证token的实现类 + setAuthenticationTokenClass(UsernamePasswordToken.class); + // 设置加密算法 + setCredentialsMatcher(new SimpleCredentialsMatcher()); + } + + /** + * 功能操作授权 + */ + protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) { + String loginName = (String) principalCollection.fromRealm(getName()).iterator().next(); + ManagerEntity manager = managerBiz.queryManagerByManagerName(loginName); + if (null == manager) { + return null; + } else { + SimpleAuthorizationInfo result = new SimpleAuthorizationInfo(); + // 查询管理员对应的角色 + List models = modelBiz.queryModelByRoleId(manager.getManagerRoleID()); + for (BaseEntity e:models) { + ModelEntity me = (ModelEntity) e; + if (!StringUtil.isBlank(me.getModelUrl())) { + result.addStringPermission(me.getModelUrl()); + } + } + return result; + + } + } + + /** + * 新登用户验证 + */ + protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { + UsernamePasswordToken upToken = (UsernamePasswordToken) token; + ManagerEntity manager = managerBiz.queryManagerByManagerName(upToken.getUsername()); + if (manager != null) { + return new SimpleAuthenticationInfo(manager.getManagerName(), manager.getManagerPassword(), getName()); + } + return null; + } + + /** + * 更新用户授权信息缓存. + */ + public void clearCachedAuthorizationInfo(String principal) { + SimplePrincipalCollection principals = new SimplePrincipalCollection(principal, getName()); + clearCachedAuthorizationInfo(principals); + } + + /** + * 清除所有用户授权信息缓存. + */ + public void clearAllCachedAuthorizationInfo() { + Cache cache = getAuthorizationCache(); + if (cache != null) { + for (Object key : cache.keys()) { + cache.remove(key); + } + } + } +} diff --git a/src/main/java/com/mingsoft/basic/servlet/BaseServlet.java b/src/main/java/com/mingsoft/basic/servlet/BaseServlet.java new file mode 100644 index 00000000..3c37251f --- /dev/null +++ b/src/main/java/com/mingsoft/basic/servlet/BaseServlet.java @@ -0,0 +1,563 @@ +package com.mingsoft.basic.servlet; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.log4j.Logger; +import org.springframework.web.context.support.WebApplicationContextUtils; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.entity.ResultJson; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.util.StringUtil; + +/** + * 基础通用servlet + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@SuppressWarnings("serial") +public abstract class BaseServlet extends HttpServlet { + + /* + * log4j日志记录 + */ + public Logger logger = Logger.getLogger(this.getClass()); + + /** + * 执行清理操作 + */ + public void destroy() { + super.destroy(); + } + + + /** Wap网关Via头信息中特有的描述信息 */ + private static String mobileGateWayHeaders[] = new String[] { "ZXWAP",// 中兴提供的wap网关的via信息,例如:Via=ZXWAP + // GateWayZTE + // Technologies, + "chinamobile.com",// 中国移动的诺基亚wap网关,例如:Via=WTP/1.1 + // GDSZ-PB-GW003-WAP07.gd.chinamobile.com (Nokia + // WAP Gateway 4.1 CD1/ECD13_D/4.1.04) + "monternet.com",// 移动梦网的网关,例如:Via=WTP/1.1 + // BJBJ-PS-WAP1-GW08.bj1.monternet.com. (Nokia WAP + // Gateway 4.1 CD1/ECD13_E/4.1.05) + "infoX",// 华为提供的wap网关,例如:Via=HTTP/1.1 GDGZ-PS-GW011-WAP2 (infoX-WISG + // Huawei Technologies),或Via=infoX WAP Gateway V300R001 + // Huawei Technologies + "XMS 724Solutions HTG",// 国外电信运营商的wap网关,不知道是哪一家 + "wap.lizongbo.com",// 自己测试时模拟的头信息 + "Bytemobile",// 貌似是一个给移动互联网提供解决方案提高网络运行效率的,例如:Via=1.1 Bytemobile OSN + // WebProxy/5.1 + }; + /** 电脑上的IE或Firefox浏览器等的User-Agent关键词 */ + private static String[] pcHeaders = new String[] { "Windows 98", + "Windows ME", "Windows 2000", "Windows XP", "Windows NT", "Ubuntu" }; + /** 手机浏览器的User-Agent里的关键词 */ + private static String[] mobileUserAgents = new String[] { "Nokia",// 诺基亚,有山寨机也写这个的,总还算是手机,Mozilla/5.0 + // (Nokia5800 + // XpressMusic)UC + // AppleWebkit(like + // Gecko) + // Safari/530 + "SAMSUNG",// 三星手机 + // SAMSUNG-GT-B7722/1.0+SHP/VPP/R5+Dolfin/1.5+Nextreaming+SMM-MMS/1.2.0+profile/MIDP-2.1+configuration/CLDC-1.1 + "MIDP-2",// j2me2.0,Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2 + // NokiaE75-1 /110.48.125 Profile/MIDP-2.1 + // Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML like + // Gecko) Safari/413 + "CLDC1.1",// M600/MIDP2.0/CLDC1.1/Screen-240X320 + "SymbianOS",// 塞班系统的, + "MAUI",// MTK山寨机默认ua + "UNTRUSTED/1.0",// 疑似山寨机的ua,基本可以确定还是手机 + "Windows CE",// Windows CE,Mozilla/4.0 (compatible; MSIE 6.0; + // Windows CE; IEMobile 7.11) + "iPhone",// iPhone是否也转wap?不管它,先区分出来再说。Mozilla/5.0 (iPhone; U; CPU + // iPhone OS 4_1 like Mac OS X; zh-cn) AppleWebKit/532.9 + // (KHTML like Gecko) Mobile/8B117 + "iPad",// iPad的ua,Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; + // zh-cn) AppleWebKit/531.21.10 (KHTML like Gecko) + // Version/4.0.4 Mobile/7B367 Safari/531.21.10 + "Android",// Android是否也转wap?Mozilla/5.0 (Linux; U; Android + // 2.1-update1; zh-cn; XT800 Build/TITA_M2_16.22.7) + // AppleWebKit/530.17 (KHTML like Gecko) Version/4.0 + // Mobile Safari/530.17 + "BlackBerry",// BlackBerry8310/2.7.0.106-4.5.0.182 + "UCWEB",// ucweb是否只给wap页面? Nokia5800 + // XpressMusic/UCWEB7.5.0.66/50/999 + "ucweb",// 小写的ucweb貌似是uc的代理服务器Mozilla/6.0 (compatible; MSIE 6.0;) + // Opera ucweb-squid + "BREW",// 很奇怪的ua,例如:REW-Applet/0x20068888 (BREW/3.1.5.20; DeviceId: + // 40105; Lang: zhcn) ucweb-squid + "J2ME",// 很奇怪的ua,只有J2ME四个字母 + "YULONG",// 宇龙手机,YULONG-CoolpadN68/10.14 IPANEL/2.0 CTC/1.0 + "YuLong",// 还是宇龙 + "COOLPAD",// 宇龙酷派YL-COOLPADS100/08.10.S100 POLARIS/2.9 CTC/1.0 + "TIANYU",// 天语手机TIANYU-KTOUCH/V209/MIDP2.0/CLDC1.1/Screen-240X320 + "TY-",// 天语,TY-F6229/701116_6215_V0230 JUPITOR/2.2 CTC/1.0 + "K-Touch",// 还是天语K-Touch_N2200_CMCC/TBG110022_1223_V0801 MTK/6223 + // Release/30.07.2008 Browser/WAP2.0 + "Haier",// 海尔手机,Haier-HG-M217_CMCC/3.0 Release/12.1.2007 + // Browser/WAP2.0 + "DOPOD",// 多普达手机 + "Lenovo",// 联想手机,Lenovo-P650WG/S100 LMP/LML Release/2010.02.22 + // Profile/MIDP2.0 Configuration/CLDC1.1 + "LENOVO",// 联想手机,比如:LENOVO-P780/176A + "HUAQIN",// 华勤手机 + "AIGO-",// 爱国者居然也出过手机,AIGO-800C/2.04 TMSS-BROWSER/1.0.0 CTC/1.0 + "CTC/1.0",// 含义不明 + "CTC/2.0",// 含义不明 + "CMCC",// 移动定制手机,K-Touch_N2200_CMCC/TBG110022_1223_V0801 MTK/6223 + // Release/30.07.2008 Browser/WAP2.0 + "DAXIAN",// 大显手机DAXIAN X180 UP.Browser/6.2.3.2(GUI) MMP/2.0 + "MOT-",// 摩托罗拉,MOT-MOTOROKRE6/1.0 LinuxOS/2.4.20 Release/8.4.2006 + // Browser/Opera8.00 Profile/MIDP2.0 Configuration/CLDC1.1 + // Software/R533_G_11.10.54R + "SonyEricsson",// 索爱手机,SonyEricssonP990i/R100 Mozilla/4.0 + // (compatible; MSIE 6.0; Symbian OS; 405) Opera + // 8.65 [zh-CN] + "GIONEE",// 金立手机 + "HTC",// HTC手机 + "ZTE",// 中兴手机,ZTE-A211/P109A2V1.0.0/WAP2.0 Profile + "HUAWEI",// 华为手机, + "webOS",// palm手机,Mozilla/5.0 (webOS/1.4.5; U; zh-CN) + // AppleWebKit/532.2 (KHTML like Gecko) Version/1.0 + // Safari/532.2 Pre/1.0 + "GoBrowser",// 3g GoBrowser.User-Agent=Nokia5230/GoBrowser/2.0.290 + // Safari + "IEMobile",// Windows CE手机自带浏览器, + "WAP2.0"// 支持wap 2.0的 + }; + + /** + * 使过滤器为处理做准备 + */ + public void init() throws ServletException { + super.init(); + } + + /** + * 输出html文本 + * + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @param html html文本内容 + */ + protected void sendHtml(HttpServletRequest request, + HttpServletResponse response, String html) { + try { + PrintWriter out = response.getWriter(); + response.setContentType("text/html"); + response.setCharacterEncoding("utf-8".toString()); + out.write(html.toString()); + out.close(); + } catch (IOException e) { + logger.error(e); + } + } + + + /** + * 获取用户真实IP + * + * @param request HttpServletRequest对象 + * @return 返回用户IP + */ + public String getIpAddr(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + return ip; + } + + /** + * 获取请求的数据流,主要提供给微信平台接口使用 + * @param request HttpServletRequest对象 + * @return 返回请求的数据流,例如:微信平台会返回JSON或xml字符串 + */ + public String readStreamParameter(HttpServletRequest request) { + StringBuilder buffer = new StringBuilder(); + BufferedReader reader = null; + try { + reader = new BufferedReader(new InputStreamReader(request.getInputStream(),"utf-8")); + String line = null; + while ((line = reader.readLine()) != null) { + buffer.append(line); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (null != reader) { + try { + reader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return buffer.toString(); + } + + /** + * 输出String数据字符串 + * @param response HttpServletResponse 对象 + * @param dataStr 数据对象 + */ + protected void outString(HttpServletResponse response,Object dataStr) { + try { + response.setContentType("text/html"); + response.setCharacterEncoding("utf-8".toString()); + PrintWriter out = response.getWriter(); + out.print(dataStr); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + logger.error(e); + } + } + + /** + * 输出json数据字符串 + * @param response HttpServletResponse 对象 + * @param jsonDataStr json数据对象 + */ + protected void outJson(HttpServletResponse response,Object jsonDataStr) { + try { + response.setContentType("application/json;charset=utf-8"); + PrintWriter out = response.getWriter(); + out.print(jsonDataStr); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 设置session + * @param request HttpServletRequest 对象 + * @param key 键SessionConst里面定义 + * @param obj 对象 + */ + protected void setSession(HttpServletRequest request,SessionConst key,Object obj) { + if (StringUtil.isBlank(obj.toString())) { + return; + } + request.getSession().setAttribute(key.toString(), obj); + } + + + /** + * 获取session + * @param request HttpServletRequest 对象 + * @param key 键SessionConst里面定义 + */ + protected Object getSession(HttpServletRequest request,SessionConst key) { + return request.getSession().getAttribute(key.toString()); + } + + /** + * 设置Cookie的attr中的值 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @param key 枚举类中的值 + * @param value 存储对象 + */ + protected void setCookie(HttpServletRequest request,HttpServletResponse response,CookieConst key, Object value) { + request.getSession().setAttribute(key.toString(), value); + Cookie cookie = new Cookie(key.name(), (String) value); + cookie.setPath("/"); + cookie.setValue((String) value); + response.addCookie(cookie); + } + + + + /** + * 获取项目路径 + * @param request HttpServletRequest对象 + * @return 返回项目路径,例如:http://www.ip.com/projectName 后面没有反斜杠,后面接地址或参数必须加/ + */ + protected String getUrl(HttpServletRequest request) { + String path = request.getContextPath(); + String basePath = request.getScheme() + "://" + request.getServerName(); + if (request.getServerPort()==80) { + basePath += path; + } else { + basePath += ":" + request.getServerPort() + path; + } + return basePath; + } + + /** + * 获取请求域名,域名不包括http请求协议头 + * @param request HttpServletRequest对象 + * @return 返回域名地址 + */ + protected String getDomain(HttpServletRequest request) { + String path = request.getContextPath(); + String domain = request.getServerName(); + if (request.getServerPort() == 80) { + domain += path; + } else { + domain += ":" + request.getServerPort() + path; + } + return domain; + } + + /** + * 输出json数据 + * @param resp HttpServletRequest对象 + * @param code 模块编号
+ * @param flag 成功状态,true:成功、false:失败 + * @param msg 提示信息 + */ + protected void outJson(HttpServletResponse resp,ModelCode code, boolean flag, String msg) { + try { + ResultJson result = new ResultJson(); + if (code!=null) { + result.setCode(code.toString()); + } + result.setResult(flag); + result.setResultMsg(msg); + PrintWriter out = resp.getWriter(); + out.print(JSONObject.toJSON(result)); + logger.debug(JSONObject.toJSON(result)); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 输出json数据 + * + * @param resp HttpServletRequest对象 + * @param code 模块编号
+ * @param flag 成功状态,true:成功、false:失败 + * @param msg 提示信息 + * @param data 返回数据 + */ + protected void outJson(HttpServletResponse resp,ModelCode code, boolean flag, String msg,String data) { + try { + ResultJson result = new ResultJson(); + if (code!=null) { + result.setCode(code.toString()); + } + result.setResult(flag); + result.setResultMsg(msg); + result.setResultData(data); + PrintWriter out = resp.getWriter(); + out.print(JSONObject.toJSON(result)); + logger.debug(JSONObject.toJSON(result)); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 根据字段获取请求参数中的字符串值 + * @param request HttpServletRequest对象 + * @param fieldName 字段名称 + * @return 返回请求到的字符串,获取不到返回null + */ + protected String getString(HttpServletRequest request,String fieldName) { + if (StringUtil.isBlank(request.getParameter(fieldName))) { + return null; + } + return request.getParameter(fieldName); + } + + /** + * 根据字段获取请求参数中的整型值 + * @param request HttpServletRequest对象 + * @param fieldName 字段名称 + * @return 返回请求到的整型值,获取不到返回0,也有例外,具体更具业务来定 + */ + protected int getInt(HttpServletRequest request,String fieldName) { + if (!StringUtil.isInteger(request.getParameter(fieldName))) { + return 0; + } + return Integer.parseInt(request.getParameter(fieldName)); + } + + /** + * 根据字段获取请求参数中的整型值 + * @param request HttpServletRequest对象 + * @param fieldName 字段名称 + * @param defaultValue 默认值 + * @return 返回请求到的整型值,获取不到返回默认值 + */ + protected int getInt(HttpServletRequest request,String fieldName,int defaultValue) { + if (!StringUtil.isInteger(request.getParameter(fieldName))) { + return defaultValue; + } + return Integer.parseInt(request.getParameter(fieldName)); + } + + /** + * 通过spring的webapplicationcontext上下文对象读取bean对象 + * @param sc 上下文servletConext对象 + * @param beanName 要读取的bean的名称 + * @return 返回读取的对象,获取不到返回null + */ + protected Object getBean(ServletContext sc,String beanName) { + return WebApplicationContextUtils.getWebApplicationContext(sc).getBean(beanName); + } + + /** + * 获取当期项目物理路径 + * @param request HttpServletRequest对象 + * @param filePath 相对文件夹 + * @return 返回当前项目的物理路径 + */ + protected String getRealPath(HttpServletRequest request,String filePath) { + if (filePath!=null) { + return request.getServletContext().getRealPath(File.separator)+File.separator+filePath; + } + return request.getServletContext().getRealPath(File.separator); + } + + /** + * 读取国际化资源文件 + * @param key 资源文件键值 + * @return 返回键对应的值 + */ + protected String getResString(String key) { + return Const.RESOURCES.getString(key); + } + + /** + * 读取国际化资源文件 + * @param key 资源文件键值 + * @param fullStrs 需填充的值 + * @return 返回键对应的值 + */ + protected String getResString(String key,String ... fullStrs) { + String temp= Const.RESOURCES.getString(key); + for (int i=0;i assemblyRequestMap(HttpServletRequest request) { + Map params = new HashMap(); + Map map = request.getParameterMap(); + Iterator key = map.keySet().iterator(); + while (key.hasNext()) { + String k = (String) key.next(); + String[] value = map.get(k); + + if (value.length == 1) { + String temp = null; + if (!StringUtil.isBlank(value[0])) { + temp = value[0]; + } + params.put(k, temp); + request.setAttribute(k, temp); + } else if (value.length == 0) { + params.put(k, null); + request.setAttribute(k, null); + } else if (value.length > 1) { + params.put(k, value); + request.setAttribute(k, value); + } + } + return params; + } + +} + diff --git a/src/main/java/com/mingsoft/basic/servlet/CodeServlet.java b/src/main/java/com/mingsoft/basic/servlet/CodeServlet.java new file mode 100644 index 00000000..ffa66e1c --- /dev/null +++ b/src/main/java/com/mingsoft/basic/servlet/CodeServlet.java @@ -0,0 +1,254 @@ +package com.mingsoft.basic.servlet; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.Random; +import javax.imageio.ImageIO; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import com.mingsoft.base.constant.SessionConst; + + +/** + * 验证码生成通用servlet + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@WebServlet(urlPatterns = "/code") +public class CodeServlet extends BaseServlet { + + /** + * 图片默认宽度 + */ + private int imgWidth = 100; + + /** + * 图片默认高度 + */ + private int imgHeight = 50; + + /** + * 验证码个数 + */ + private int codeCount = 4; + + /** + * 验证码画布x轴 + */ + private int x = 0; + + /** + * 字体高度 + */ + private int fontHeight; + + /** + * 验证码画布y轴 + */ + private int codeY; + + /** + * 验证码样式 + */ + private String fontStyle; + + /** + * 版本id + */ + private static final long serialVersionUID = 128554012633034503L; + + /** + * 初始化配置参数 + */ + public void init() throws ServletException { + // 从web.xml中获取初始信息 + // 宽度 + String strWidth = this.getInitParameter("imgWidth"); + // 高度 + String strHeight = this.getInitParameter("imgHeight"); + // 字符个数 + String strCodeCount = this.getInitParameter("codeCount"); + + fontStyle = this.getInitParameter("fontStyle"); + + // 将配置的信息转换成数值 + try { + if (strWidth != null && strWidth.length() != 0) { + imgWidth = Integer.parseInt(strWidth); + } + if (strHeight != null && strHeight.length() != 0) { + imgHeight = Integer.parseInt(strHeight); + } + if (strCodeCount != null && strCodeCount.length() != 0) { + codeCount = Integer.parseInt(strCodeCount); + } + } catch (NumberFormatException e) { + e.printStackTrace(); + } + + x = imgWidth / (codeCount + 1); + fontHeight = imgHeight - 2; + codeY = imgHeight - 12; + } + + /** + * 验证码请求处理过程 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException 异常处理 + * @throws IOException 异常处理 + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + response.setContentType("image/jpeg"); + response.setHeader("Pragma", "No-cache"); + response.setHeader("Cache-Control", "no-cache"); + response.setDateHeader("Expires", 0); + HttpSession session = request.getSession(); + + // 在内存中创建图象 + BufferedImage image = new BufferedImage(imgWidth, imgHeight, BufferedImage.TYPE_INT_RGB); + + // 获取图形上下文 + Graphics2D g = image.createGraphics(); + + // 生成随机类 + Random random = new Random(); + + // 设定背景色 + g.setColor(Color.WHITE); + g.fillRect(0, 0, imgWidth, imgHeight); + + // 设定字体 + g.setFont(new Font(fontStyle, Font.PLAIN + Font.ITALIC, fontHeight)); + + // 画边框 + g.setColor(new Color(55, 55, 12)); + //g.drawRect(0, 0, imgWidth - 1, imgHeight - 1); + + // 随机产生155条干扰线,使图象中的认证码不易被其它程序探测到 + g.setColor(getRandColor(160, 200)); + for (int i = 0; i < 60; i++) { + int x = random.nextInt(imgWidth); + int y = random.nextInt(imgHeight); + int xl = random.nextInt(12); + int yl = random.nextInt(12); + g.drawLine(x, y, x + xl, y + yl); + } + + // 取随机产生的认证码(4位数字) + String sRand = ""; + int red = 0, green = 0, blue = 0; + for (int i = 0; i < codeCount; i++) { + red = random.nextInt(255); + green = random.nextInt(255); + blue = random.nextInt(255); + int wordType = random.nextInt(3); + char retWord = 0; + switch (wordType) { + case 0: + retWord = this.getSingleNumberChar(); + break; + case 1: + retWord = this.getLowerOrUpperChar(0); + break; + case 2: + retWord = this.getLowerOrUpperChar(1); + break; + } + sRand += String.valueOf(retWord); + g.setColor(new Color(red, green, blue)); + g.drawString(String.valueOf(retWord), (i) * x, codeY); + + } + // 将认证码存入SESSION + session.setAttribute(SessionConst.CODE_SESSION.toString(), sRand); + // 图象生效 + g.dispose(); + ServletOutputStream responseOutputStream = response.getOutputStream(); + // 输出图象到页面 + ImageIO.write(image, "JPEG", responseOutputStream); + + // 以下关闭输入流! + responseOutputStream.flush(); + responseOutputStream.close(); + } + + /** + * 给定范围获得随机颜色 + * @param fc 范围1 + * @param bc 范围2 + * @return 返回生成颜色 + */ + Color getRandColor(int fc, int bc) { + Random random = new Random(); + if (fc > 255) + fc = 255; + if (bc > 255) + bc = 255; + int r = fc + random.nextInt(bc - fc); + int g = fc + random.nextInt(bc - fc); + int b = fc + random.nextInt(bc - fc); + return new Color(r, g, b); + } + + /** + * 处理post请求验证码 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException 异常处理 + * @throws IOException 异常处理 + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + processRequest(request, response); + } + + /** + * 处理post请求验证码 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException 异常处理 + * @throws IOException 异常处理 + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + processRequest(request, response); + } + + /** + * 获取数据数字字符 + * @return 数字字符 + */ + private char getSingleNumberChar() { + Random random = new Random(); + int numberResult = random.nextInt(10); + int ret = numberResult + 48; + return (char) ret; + } + + /** + * 获取字符 + * @param upper 是否大小写 0:小写 1:大写 + * @return 字符 + */ + private char getLowerOrUpperChar(int upper) { + Random random = new Random(); + int numberResult = random.nextInt(26); + int ret = 0; + if (upper == 0) {// 小写 + ret = numberResult + 97; + } else if (upper == 1) {// 大写 + ret = numberResult + 65; + } + return (char) ret; + } + +} diff --git a/src/main/java/com/mingsoft/basic/servlet/DownloadServlet.java b/src/main/java/com/mingsoft/basic/servlet/DownloadServlet.java new file mode 100644 index 00000000..85c0084f --- /dev/null +++ b/src/main/java/com/mingsoft/basic/servlet/DownloadServlet.java @@ -0,0 +1,68 @@ +package com.mingsoft.basic.servlet; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +/** + * 文件下载通用servlet + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@WebServlet(urlPatterns = "/download") +public class DownloadServlet extends BaseServlet { + + /** + * 处理get请求下载文件 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException Servlet异常处理 + * @throws IOException IO异常处理 + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + // 获取网站部署路径(通过ServletContext对象),用于确定下载文件位置,从而实现下载 + String type = request.getParameter("type"); + String filePath = request.getParameter("file"); + filePath = "/upload/"+filePath; + // 1.设置文件ContentType类型,这样设置,会自动判断下载文件类型 + response.setContentType("multipart/form-data"); + // 2.设置文件头:最后一个参数是设置下载文件名(假如我们叫a.pdf) + response.setHeader("Content-Disposition", "attachment;fileName=" + request.getParameter("file")); + ServletOutputStream out; + // 通过文件路径获得File对象(假如此路径中有一个download.pdf文件) + File file = new File(this.getRealPath(request, filePath)); + + try { + FileInputStream inputStream = new FileInputStream(file); + + // 3.通过response获取ServletOutputStream对象(out) + out = response.getOutputStream(); + + int b = 0; + byte[] buffer = new byte[512]; + while (b != -1) { + b = inputStream.read(buffer); + // 4.写到输出流(out)中 + out.write(buffer, 0, b); + } + inputStream.close(); + out.close(); + out.flush(); + + } catch (IOException e) { + e.printStackTrace(); + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/mingsoft/basic/servlet/ProxyServlet.java b/src/main/java/com/mingsoft/basic/servlet/ProxyServlet.java new file mode 100644 index 00000000..d1e36b90 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/servlet/ProxyServlet.java @@ -0,0 +1,159 @@ +package com.mingsoft.basic.servlet; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.Map; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.mingsoft.util.StringUtil; +import com.mingsoft.util.proxy.Header; +import com.mingsoft.util.proxy.Proxy; +import com.mingsoft.util.proxy.Result; + +/** + * 发送请求的代理的servlet + * + * 发送GET请求和POST请求,支持https
+ * 携带参数说明
+ * url:请求地址(带http,必须);
+ * hostUrl:请求主机;
+ * reqCoding:发送请求的编码,默认为UTF8;
+ * headerCoding:头部请求编码,默认为UTF8;
+ * contentCoding:接收返回值的编码,默认为UTF-8;
+ * cookie:发送请求携带的COOKIE;
+ * headerStr:自定义头部携带参数(每组参数之间用"|"隔开,等号两边为参数名和参数值,如:name=cwx|age=20);
+ * params:自定义请求参数(每组参数之间用"|"隔开,等号两边为参数名和参数值,如:name=cwx|age=20);
+ * @author 成卫雄QQ:330216230 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@WebServlet(urlPatterns = "/proxy") +public class ProxyServlet extends BaseServlet{ + + /** + * 代理发送GET请求 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException Servlet异常处理 + * @throws IOException IO异常处理 + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + this.proxy(request, response, true); + } + + /** + * 代理发送PSOT请求 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException Servlet异常处理 + * @throws IOException IO异常处理 + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + this.proxy(request, response, false); + } + + /** + * 发送代理请求
+ * 请求参数:
+ * url:请求地址(带http,必须);
+ * hostUrl:请求主机;
+ * charset:发送请求的编码,默认为UTF8;
+ * cookie:发送请求携带的COOKIE;
+ * headerStr:自定义头部携带参数(每组参数之间用"|"隔开,等号两边为参数名和参数值,如:name@cwx|age@20);
+ * params:自定义请求参数(每组参数之间用"|"隔开,等号两边为参数名和参数值,如:name@cwx|age@20);
+ * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @param way 请求方式,true:发送GET请求,false:发送POST请求 + * @throws IOException IO异常处理 + */ + private void proxy(HttpServletRequest request, HttpServletResponse response,Boolean way) throws IOException{ + response.setCharacterEncoding("UTF-8"); + PrintWriter out = response.getWriter(); + try{ + //请求地址 + String url = request.getParameter("url"); + if(StringUtil.isBlank(url)){ + //请求地址不能为空 + out.write("url err"); + return; + } + + //请求主机地址 + String hostUrl = request.getParameter("hostUrl"); + + //头部请求编码默认为UTF8 + String charset = request.getParameter("charset"); + if(StringUtil.isBlank(charset)){ + charset = "utf-8"; + } + + //请求头部信息 + Header header = new Header(hostUrl,charset); + + //cookie + String cookie = request.getParameter("cookie"); + if(!StringUtil.isBlank(cookie)){ + header.setCookie(cookie); + } + + + //自定义头部携带参数(每组参数之间用"|"隔开,等号两边为参数名和参数值,如:name=cwx|age=20) + String headerStr = request.getParameter("headerStr"); + if(!StringUtil.isBlank(headerStr)){ + String[] _headerStr = headerStr.split("\\|"); + for(int i=0;i<_headerStr.length;i++){ + String str = _headerStr[i]; + if(StringUtil.isBlank(str.split("@")[0]) || StringUtil.isBlank(str.split("@")[0])){ + //返回自定义头部请求参数错误 + out.write("header parameter err"); + return ; + }else{ + header.setHeader(str.split("@")[0], str.split("@")[1]); + } + } + } + + //自定义请求参数(每组参数之间用"|"隔开,等号两边为参数名和参数值,如:name=cwx|age=20) + String params = request.getParameter("params"); + Map paramsMap = null; + if(!StringUtil.isBlank(params)){ + paramsMap = new HashMap(); + String[] _params = params.split("\\|"); + for(int i=0;i<_params.length;i++){ + String str = _params[i]; + if(StringUtil.isBlank(str.split("@")[0]) || StringUtil.isBlank(str.split("@")[0])){ + //返回自定义参数参数错误 + out.write("parameter err"); + return ; + }else{ + paramsMap.put(str.split("@")[0], str.split("@")[1]); + } + } + } + Result result = way?Proxy.get(url,header, paramsMap,charset): Proxy.post(url,header, paramsMap,charset); + String resultContent = result.getContent(charset); + if(result != null && !StringUtil.isBlank(resultContent)){ + out.print(resultContent); + } + }catch (Exception e) { + out.write("request err"); + return ; + } + + out.flush(); + out.close(); + } + + +} diff --git a/src/main/java/com/mingsoft/basic/servlet/QrcodeServlet.java b/src/main/java/com/mingsoft/basic/servlet/QrcodeServlet.java new file mode 100644 index 00000000..fd54ae85 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/servlet/QrcodeServlet.java @@ -0,0 +1,98 @@ +package com.mingsoft.basic.servlet; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import javax.imageio.ImageIO; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.google.zxing.BarcodeFormat; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.WriterException; +import com.google.zxing.common.BitMatrix; + +/** + * 二维码生成通用servlet + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@WebServlet(urlPatterns = "/qrcode") +public class QrcodeServlet extends BaseServlet { + + /** + * 黑色颜色值 + */ + private static final int BLACK = 0xff000000; + + /** + * 白色颜色值 + */ + private static final int WHITE = 0xFFFFFFFF; + + /** + * 二维码生成过程 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException Servlet异常处理 + * @throws IOException IO异常处理 + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + response.setContentType("image/jpeg"); + response.setHeader("Pragma", "No-cache"); + response.setHeader("Cache-Control", "no-cache"); + response.setDateHeader("Expires", 0); + String contents = request.getParameter("contents"); + int width = this.getInt(request, "width",100); + int height = this.getInt(request, "height",100); + + try { + BitMatrix bitMatrix = new MultiFormatWriter().encode(contents, BarcodeFormat.QR_CODE, width, height); + // 在内存中创建图象 + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + image.setRGB(x, y, bitMatrix.get(x, y) == true ? BLACK : WHITE); + } + } + ServletOutputStream responseOutputStream = response.getOutputStream(); + // 输出图象到页面 + ImageIO.write(image, "png", responseOutputStream); + // 以下关闭输入流! + responseOutputStream.flush(); + responseOutputStream.close(); + } catch (WriterException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + /** + * 处理post请求二维码 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException Servlet异常处理 + * @throws IOException IO异常处理 + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + processRequest(request, response); + } + + /** + * 处理get请求二维码 + * @param request HttpServletRequest对象 + * @param response HttpServletResponse 对象 + * @throws ServletException Servlet异常处理 + * @throws IOException IO异常处理 + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + processRequest(request, response); + } + + +} diff --git a/src/main/java/com/mingsoft/basic/servlet/UploadServlet.java b/src/main/java/com/mingsoft/basic/servlet/UploadServlet.java new file mode 100644 index 00000000..99c0f018 --- /dev/null +++ b/src/main/java/com/mingsoft/basic/servlet/UploadServlet.java @@ -0,0 +1,141 @@ +package com.mingsoft.basic.servlet; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Pattern; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileUploadException; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.fileupload.servlet.ServletFileUpload; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.StringUtil; + +/** + * 文件上传通用servlet + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +@WebServlet(urlPatterns = "/upload") +public class UploadServlet extends BaseServlet { + + /** + * 处理post请求上传文件 + * @param req HttpServletRequest对象 + * @param res HttpServletResponse 对象 + * @throws ServletException 异常处理 + * @throws IOException 异常处理 + */ + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { + PrintWriter out = res.getWriter(); + String uploadPath = this.getServletContext().getRealPath(File.separator); // 上传的文件路径 + String isRename = "";// 是否重命名 true:重命名 + String _tempPath = req.getServletContext().getRealPath(File.separator) + "temp";//存放文件的临时目录路径 + FileUtil.createFolder(_tempPath); + File tempPath = new File(_tempPath); // 用于存放临时文件的目录 + + int maxSize = 1000000; // 允许上传文件大小,最大上传文件,单位:字节 1000000/1024=0.9M + //String allowedFile = ".jpg,.gif,.png,.zip"; // 允许上传文件 + String deniedFile = ".exe,.com,.cgi,.asp"; // 不允许上传文件 + + DiskFileItemFactory factory = new DiskFileItemFactory(); + // maximum size that will be stored in memory + // 允许设置内存中存储数据的门限,单位:字节 + factory.setSizeThreshold(4096); + // the location for saving data that is larger than getSizeThreshold() + // 如果文件大小大于SizeThreshold,则保存到临时目录 + factory.setRepository(tempPath); + + ServletFileUpload upload = new ServletFileUpload(factory); + // maximum size before a FileUploadException will be thrown + + try { + List fileItems = upload.parseRequest(req); + + Iterator iter = fileItems.iterator(); + + // 正则匹配,过滤路径取文件名 + String regExp = ".+\\\\(.+)$"; + + // 过滤掉的文件类型 + String[] errorType = deniedFile.split(","); + Pattern p = Pattern.compile(regExp); + String outPath = ""; //输出保存后的图片路径 + while (iter.hasNext()) { + + FileItem item = (FileItem) iter.next(); + if (item.getFieldName().equals("uploadPath")) { + outPath += item.getString(); + uploadPath += outPath; + } else if (item.getFieldName().equals("isRename")) { + isRename = item.getString(); + } else if (item.getFieldName().equals("maxSize")) { + maxSize = Integer.parseInt(item.getString())*1048576; + } else if (item.getFieldName().equals("allowedFile")) { +// allowedFile = item.getString(); + } else if (item.getFieldName().equals("deniedFile")) { + deniedFile = item.getString(); + } else if (!item.isFormField()) { // 忽略其他不是文件域的所有表单信息 + String name = item.getName(); + long size = item.getSize(); + if ((name == null || name.equals("")) && size == 0) + continue; + try { + // 最大上传文件,单位:字节 1000000/1024=0.9M + upload.setSizeMax(maxSize); + + // 保存上传的文件到指定的目录 + // 在下文中上传文件至数据库时,将对这里改写 + String fileName = System.currentTimeMillis() + name.substring(name.indexOf(".")); + String savePath = uploadPath + File.separator; + FileUtil.createFolder(savePath); + // 重命名 + if (StringUtil.isBlank(isRename) || Boolean.parseBoolean(isRename)) { + savePath += fileName; + outPath += fileName; + } else { + savePath += name; + outPath += name; + } + item.write(new File(savePath)); + out.print(outPath.trim()); + logger.debug("upload file ok return path " + outPath); + out.flush(); + out.close(); + } catch (Exception e) { + this.logger.debug(e); + } + + } + } + } catch (FileUploadException e) { + this.logger.debug(e); + } + } + +// /** +// * 处理get请求上传文件 +// * @param request HttpServletRequest对象 +// * @param response HttpServletResponse 对象 +// * @throws ServletException Servlet异常处理 +// * @throws IOException IO异常处理 +// */ +// @Override +// protected void doGet(HttpServletRequest request, HttpServletResponse response) +// throws ServletException, IOException { +// String uploadPath = request.getParameter("uploadPath"); // 上传的文件路径 +// String fileSize = request.getParameter("fileSize"); // 上传的文件大小 +// String fileType = request.getParameter("fileType"); // 上传的文件类型 +// String deniedFileType = request.getParameter("deniedFileType"); // 不允许上传的文件类型, +// } +} \ No newline at end of file diff --git a/src/main/java/com/mingsoft/cms/action/ArticleAction.java b/src/main/java/com/mingsoft/cms/action/ArticleAction.java new file mode 100644 index 00000000..585cc32b --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/ArticleAction.java @@ -0,0 +1,648 @@ +package com.mingsoft.cms.action; + +import java.io.File; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.base.entity.ListJson; +import com.mingsoft.basic.entity.BasicCategoryEntity; +import com.mingsoft.cms.biz.IArticleBiz; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.constant.e.ColumnTypeEnum; +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.cms.entity.FieldEntity; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + * 铭飞CMS-铭飞内容管理系统

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 郭鹏辉 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:文章控制层 , 继承BasicAction + *

+ * + *

+ * Create Date:2014-7-5 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/cms/article") +public class ArticleAction extends BaseAction { + /** + * 业务层的注入 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 文章管理业务处理层 + */ + @Autowired + private IArticleBiz articleBiz; + + /** + * 字段管理业务层 + */ + @Autowired + private IFieldBiz fieldBiz; + + /** + * 内容管理业务层 + */ + @Autowired + private IContentModelBiz contentBiz; + + + + + /** + * 判断是否为checkbox类型 + */ + private static final int checkBox = 11; + + /** + * 获取文章属性 + * + * @return + */ + public List> articleType() { + Map map = getMapByProperties("com/mingsoft/cms/resources/article_attribute"); + Set> set = map.entrySet(); + List> articleType = new ArrayList>(); + for (Iterator> it = set.iterator(); it.hasNext();) { + Map.Entry entry = (Map.Entry) it.next(); + articleType.add(entry); + } + return articleType; + } + + /** + * 加载页面显示所有文章信息 + * + * @param request + * @return 返回文章页面显示地址 + */ + @SuppressWarnings("static-access") + @RequestMapping("/index") + public String index(HttpServletRequest request, ModelMap mode, HttpServletResponse response) { + // 获取站点id + int appId = this.getAppId(request); + List list = columnBiz.queryAll(appId, this.getModelCodeId(request,ModelCode.CMS_COLUMN)); + JSONObject ja = new JSONObject(); + request.setAttribute("listColumn", ja.toJSON(list).toString()); + // 返回路径 + return "/manager/cms/article/index"; // 这里表示显示/manager/cms/article/article_list.ftl + } + + /** + * 加载页面显示所有文章信息 + * + * @param request + * @return 返回文章页面显示地址 + */ + @SuppressWarnings("static-access") + @RequestMapping("/{categoryId}/list") + public String queryList(HttpServletRequest request, ModelMap mode, HttpServletResponse response, @PathVariable int categoryId) { + String categoryTitle = request.getParameter("categoryTitle"); + String articleType = request.getParameter("articleType"); + String keyword = request.getParameter("keyword"); + //判断关键字是否为null + if(StringUtil.isBlank(keyword)){ + keyword = null; + } + // 获取站点id + int websiteId = this.getAppId(request); + + // 查询数据表中记录集合总数 + int count = articleBiz.count(websiteId, categoryId, articleType, null,keyword); + + // 当前页面 + int pageNo = 1; + // 获取页面的当页数 + if (request.getParameter("pageNo") != null) { + pageNo = Integer.parseInt(request.getParameter("pageNo")); + } + + String url = "/manager/cms/article/"+categoryId+"/list.do?categoryTitle="+StringUtil.encodeStringByUTF8(categoryTitle)+"&articleType="+(articleType==null?"":articleType)+"&keyword="+(keyword==null?"":keyword); + // 分页集合 + PageUtil page = new PageUtil(pageNo, 20, count, getUrl(request) + url); + // 实例化对象 + List listArticle = articleBiz.queryList(page, "a.ARTICLE_BASICID", true, keyword, articleType, categoryId, websiteId); + + // 返回文章类型 + // 文章属性 + mode.addAttribute("articleTypeList", articleType()); + // 实例化对象 + mode.addAttribute("listArticle", listArticle); + mode.addAttribute("page", page); + + mode.addAttribute("articleShow", ""); + + //将搜索的参数再传回页面 + mode.addAttribute("keyword", keyword); + mode.addAttribute("articleType", articleType); + mode.addAttribute("categoryTitle", categoryTitle); + mode.addAttribute("categoryId", categoryId); + + // 返回路径 + this.setCookie(request, response, CookieConst.BACK_COOKIE,url+"&pageNo="+pageNo); + return "manager/cms/article/article_list"; + } + + + /** + * 添加文章页面 + * + * @return 保存文章的页面地址 + */ + @SuppressWarnings("static-access") + @RequestMapping("/add") + public String add(ModelMap mode, HttpServletRequest request) { + int categoryId = this.getInt(request, "categoryId",0); + String categoryTitle = request.getParameter("categoryTitle"); + //判断栏目是否为"" + if(StringUtil.isBlank(categoryTitle)){ + categoryTitle=null; + } + // 文章属性 + mode.addAttribute("articleType", articleType()); + + // 站点ID + int websiteId = this.getAppId(request); + List list = columnBiz.queryAll(websiteId,this.getModelCodeId(request, ModelCode.CMS_COLUMN)); + JSONObject ja = new JSONObject(); + mode.addAttribute("websiteId", websiteId); + mode.addAttribute("listColumn", ja.toJSON(list).toString()); + boolean isEditCategory = false; //新增,不是单篇 + //获取栏目id + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(categoryId); + //判断栏目是否是单篇 + if(column!=null && column.getColumnType()==ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()){ + isEditCategory = true; //是单页 + }; + mode.addAttribute("categoryTitle", categoryTitle); + + mode.addAttribute("isEditCategory", isEditCategory); //新增状态 + mode.addAttribute("categoryId", categoryId); + + //添加一个空的article实体 + ArticleEntity article = new ArticleEntity(); + mode.addAttribute("article",article); + // 返回路径 + return "/manager/cms/article/article"; // 这里表示显示/manager/cms/article/article_save.ftl + } + + /** + * 获取表单信息进行保存 + * + * @param article + * 文章对象 + */ + @RequestMapping("/save") + public void save(@ModelAttribute ArticleEntity article, HttpServletRequest request, HttpServletResponse response) { + // 获取站点id + int webId = this.getAppId(request); + // 验证文章,文章自由排序,栏目id + + if (fromTest(article, response)) { + // 设置发布时间 + article.setBasicDateTime(new Timestamp(System.currentTimeMillis())); + article.setBasicUpdateTime(new Timestamp(System.currentTimeMillis())); + // 文章类型 + String langtyp[] = request.getParameterValues("articleType"); + if (langtyp != null) { + StringBuffer sb = new StringBuffer(); + for (int j = 0; j < langtyp.length; j++) { + sb.append(langtyp[j] + ","); + } + } + article.setArticleType(request.getParameter("checkboxType")); + // 问题:由于上传的图片路径后面可能带有|符合。所以要进行将“|”替换空 + // 空值判断 + if (!StringUtil.isBlank(article.getBasicThumbnails())) { + article.setBasicThumbnails(article.getBasicThumbnails().replace("|", "")); + } + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId()); + article.setColumn(column); + // 添加文章所属的站点id + article.setArticleWebId(webId); + //绑定模块编号 + article.setBasicModelId(this.getModelCodeId(request)); + // 保存所属应用id + article.setBasicAppId(webId); + String articleType = request.getParameter("articleTypeJson"); + //判断是否存在自定义栏目属性对象 + if(!StringUtil.isBlank(articleType)){ + // 将JSON字符串转换为数组 + List basicCategoryList = JSONArray.parseArray(articleType, BasicCategoryEntity.class); + articleBiz.saveArticle(article, basicCategoryList); + }else{ + // 保存文章信息 + articleBiz.saveBasic(article); + } + if(column.getColumnType()==ColumnTypeEnum.COLUMN_TYPE_LIST.toInt()) {//列表 + article.setArticleUrl(column.getColumnPath()+File.separator+article.getBasicId()+".html"); + } else if (column.getColumnType()==ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()) {//单篇 + article.setArticleUrl(column.getColumnPath()+File.separator+IParserRegexConstant.HTML_INDEX); + } + articleBiz.updateBasic(article); + + // 判断栏目是否存在新增字段 + if (column.getColumnContentModelId() != 0) { + // 保存所有的字段信息 + List listField = fieldBiz.queryListByCmid(column.getColumnContentModelId()); + // 获取内容模型实体 + ContentModelEntity contentModel = (ContentModelEntity) contentBiz.getEntity(column.getColumnContentModelId()); + if (contentModel != null) { + // 保存新增字段的信息 + Map param = this.checkField(listField, request, article.getBasicId()); + fieldBiz.insertBySQL(contentModel.getCmTableName(), param); + } + + } + + // + + if (article.getColumn().getColumnType()==ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()) { + this.outJson(response, ModelCode.CMS_ARTICLE, true, "" + article.getColumn().getCategoryId()); + } else { + this.outJson(response, ModelCode.CMS_ARTICLE, true, "" + article.getColumn().getCategoryId(),this.redirectBack(request,false)); + } + } + } + + /** + * 验证表单 + * + * @param article + * @param response + * @return 返回Boolean类型 true:通过,false:有错 + */ + public boolean fromTest(ArticleEntity article, HttpServletResponse response) { + // 对表单数据进行再次验证 + // 验证文章标题是否为空 + if (StringUtil.isBlank(article.getBasicTitle())) { + this.outJson(response, ModelCode.CMS_ARTICLE, false, getResString("err.empty", this.getResString("basicTitle"))); + return false; + } + // 验证文章所属是否为0 + if (article.getBasicCategoryId() == 0) { + this.outJson(response, ModelCode.CMS_ARTICLE, false, getResString("err.empty", this.getResString("basicCategoryId"))); + return false; + } + // 验证文章标题长度,若超过定义长度则截取 + if (!StringUtil.checkLength(article.getBasicTitle(), 1, 300)) { + this.outJson(response, ModelCode.CMS_ARTICLE, false, getResString("err.length", this.getResString("basicTitle"), "1", "300")); + return false; + } + // 验证文章来源长度,若超过定义长度则截取 + if (!StringUtil.isBlank(article.getArticleSource()) && !StringUtil.checkLength(article.getArticleSource(), 1, 300)) { + this.outJson(response, ModelCode.CMS_ARTICLE, false, getResString("err.length", this.getResString("articleSource"), "1", "300")); + return false; + } + // 验证文章作者长度,若超过定义长度则截取 + if (!StringUtil.isBlank(article.getArticleAuthor()) && !StringUtil.checkLength(article.getArticleAuthor(), 1, 12)) { + this.outJson(response, ModelCode.CMS_ARTICLE, false, getResString("err.length", this.getResString("articleAuthor"), "1", "12")); + return false; + } + // 验证文章描述长度,若超过定义长度则截取 + if (!StringUtil.isBlank(article.getBasicDescription()) && !StringUtil.checkLength(article.getBasicDescription(), 1, 400)) { + this.outJson(response, ModelCode.CMS_ARTICLE, false, getResString("err.length", this.getResString("basicDescription"), "1", "400")); + return false; + } + // 验证文章关键字长度,若超过定义长度则截取 + if (!StringUtil.isBlank(article.getArticleKeyword()) && !StringUtil.checkLength(article.getArticleKeyword(), 1, 155)) { + this.outJson(response, ModelCode.CMS_ARTICLE, false, getResString("err.length", this.getResString("articleKeyword"), "1", "155")); + return false; + } + return true; + } + + /** + * 更新文章 + * @param basicId 文章id + * @param article 文章实体 + * @param request + * @param response + */ + @RequestMapping("/{basicId}/update") + public void update(@PathVariable int basicId, @ModelAttribute ArticleEntity article, HttpServletRequest request, HttpServletResponse response) { + // 获取站点id + int webId =this.getAppId(request); + article.setBasicUpdateTime(new Timestamp(System.currentTimeMillis())); + // 文章类型 + article.setArticleType(request.getParameter("checkboxType")); + // 问题:由于上传的图片路径后面可能带有|符合。所以要进行将“|”替换空 + // 空值判断 + if (!StringUtil.isBlank(article.getBasicThumbnails())) { + article.setBasicThumbnails(article.getBasicThumbnails().replace("|", "")); + } + // 获取更改前的文章实体 + ArticleEntity oldArticle = (ArticleEntity) articleBiz.getEntity(basicId); + // 获取栏目实体 + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId()); + if (!StringUtil.isBlank(oldArticle)) { + // 获取更改前的文章所属栏目实体 + ColumnEntity oldColumn = (ColumnEntity) columnBiz.getEntity(oldArticle.getBasicCategoryId()); + + // 通过表单类型id判断是否更改了表单类型,如果更改则先删除记录 + if (oldColumn.getColumnContentModelId() != column.getColumnContentModelId()) { + // 获取旧的内容模型id + ContentModelEntity contentModel = (ContentModelEntity) contentBiz.getEntity(oldColumn.getColumnContentModelId()); + // 删除旧的内容模型中保存的值 + Map wheres = new HashMap(); + wheres.put("basicId", article.getBasicId()); + if (contentModel != null) { + fieldBiz.deleteBySQL(contentModel.getCmTableName(), wheres); + } + // 判断栏目是否存在新增字段 + if (column.getColumnContentModelId() != 0) { + // 保存所有的字段信息 + List listField = fieldBiz.queryListByCmid(column.getColumnContentModelId()); + ContentModelEntity newContentModel = (ContentModelEntity) contentBiz.getEntity(column.getColumnContentModelId()); + if (newContentModel != null) { + Map param = this.checkField(listField, request, article.getBasicId()); + fieldBiz.insertBySQL(newContentModel.getCmTableName(), param); + } + } + } + } + + // 添加文章所属的站点id + article.setArticleWebId(webId); + // 设置文章所属的栏目实体 + article.setColumn(column); + + article.setBasicUpdateTime(new Date()); + + String articleType = request.getParameter("articleTypeJson"); + if(!StringUtil.isBlank(articleType)){ + // 将JSON字符串转换为数组 + List basicCategoryList = JSONArray.parseArray(articleType, BasicCategoryEntity.class); + articleBiz.updateArticle(article, basicCategoryList); + }else{ + // 更新文章信息 + articleBiz.updateBasic(article); + } + + // 判断该文章是否存在新增字段 + if (column.getColumnContentModelId() != 0) { + // 保存所有的字段信息 + List listField = fieldBiz.queryListByCmid(column.getColumnContentModelId()); + // // update中的where条件 + Map where = new HashMap(); + // 压入默认的basicId字段 + where.put("basicId", article.getBasicId()); + // 遍历字段的信息 + Map param = this.checkField(listField, request, article.getBasicId()); + ContentModelEntity contentModel = (ContentModelEntity) contentBiz.getEntity(column.getColumnContentModelId()); + if (contentModel != null) { + // 遍历所有的字段实体,得到字段名列表信息 + List listFieldName = new ArrayList(); + listFieldName.add("basicId"); + // 查询新增字段的信息 + List fieldLists = fieldBiz.queryBySQL(contentModel.getCmTableName(), listFieldName, where); + + // 判断新增字段表中是否存在该文章,不存在则保存,否则更新 + if (fieldLists == null || fieldLists.size()==0) { + fieldBiz.insertBySQL(contentModel.getCmTableName(), param); + } else { + fieldBiz.updateBySQL(contentModel.getCmTableName(), param, where); + } + + } + } + + switch(column.getColumnType()) { + case ColumnEntity.COLUMN_TYPE_COVER: + this.outJson(response, ModelCode.CMS_ARTICLE, true,column.getCategoryId()+"",""); + break; + case ColumnEntity.COLUMN_TYPE_LIST: + this.outJson(response, ModelCode.CMS_ARTICLE, true,column.getCategoryId()+"",this.redirectBack(request,false)); + } + + } + + /** + * 显示更新内容 + * + * @param request + * @return 修改文章的页面地址 + */ + @RequestMapping("/{id}/edit") + public String edit(@PathVariable int id, ModelMap model, HttpServletRequest request) { + + // 如果_categoryId大于0表示是编辑封面栏目,应该先查询分类下面的唯一一篇文章 + String categoryTitle = request.getParameter("categoryTitle"); + //板块id + int categoryId = this.getInt(request, "categoryId",0); + + ArticleEntity articleEntity = null; + int appId = this.getAppId(request); + model.addAttribute("websiteId", appId); + if (categoryId > 0) { //分类获取文章 + articleEntity = articleBiz.getByCategoryId(categoryId); + model.addAttribute("article", articleEntity); + // 文章属性 + model.addAttribute("articleType", articleType()); + + model.addAttribute("categoryTitle",categoryTitle); + model.addAttribute("categoryId", categoryId);//编辑封面 + model.addAttribute("isEditCategory", true);//编辑封面 + return "/manager/cms/article/article"; + } else if(id>0){ //文章id获取 + //允许编辑文章时更改分类 + List list = columnBiz.queryAll(appId, this.getModelCodeId(request, ModelCode.CMS_COLUMN)); + JSONObject ja = new JSONObject(); + @SuppressWarnings("static-access") + String listJsonString = ja.toJSON(list).toString(); + request.setAttribute("listColumn", listJsonString); + // 文章属性 + model.addAttribute("articleType", articleType()); + + articleEntity = (ArticleEntity) articleBiz.getEntity(id); + model.addAttribute("article", articleEntity); + //判断是否是封面类型的栏目,如果是封面类型的栏目有些信息需要屏蔽,例如分类 + ColumnEntity column = articleEntity.getColumn(); + if (column.getColumnType()==ColumnEntity.COLUMN_TYPE_COVER) { + model.addAttribute("categoryTitle",categoryTitle); + model.addAttribute("categoryId", column.getCategoryId());//编辑封面 + model.addAttribute("isEditCategory", true);//编辑封面 + } else { + model.addAttribute("categoryTitle",articleEntity.getColumn().getCategoryTitle()); + model.addAttribute("isEditCategory", false);//编辑文章 + } + model.addAttribute("categoryId", column.getCategoryId());//编辑封面 + return "/manager/cms/article/article"; + } else {//非法 + //return "/manager/cms/article/article"; + return this.redirectBack(request,true); + } + } + + + /** + * 删除文章 + * @param request + * @param response + * @return + */ + @RequestMapping("/delete") + public void delete(HttpServletRequest request, HttpServletResponse response){ + int appId = this.getAppId(request); + String [] ids = request.getParameterValues("ids"); + if(ids.length==0 || ids ==null){ + this.outJson(response, ModelCode.CMS_ARTICLE, false,"",this.redirectBack(request,false)); + return; + } + //删除多个帖子 + articleBiz.deletes(ids); + this.outJson(response, ModelCode.CMS_ARTICLE, true,"",this.redirectBack(request,false)); + } + + /** + * 查询单页栏目是否绑定了文章 + * + * @param article + * 文章对象 + */ + @RequestMapping("/{id}/queryColumnArticle") + public void queryColumnArticle(@PathVariable int id, HttpServletResponse response) { + List articls = articleBiz.queryListByColumnId(id); + if (articls == null || articls.size() == 0) { + this.outJson(response, ModelCode.CMS_ARTICLE, true, null); + } else { + this.outJson(response, ModelCode.CMS_ARTICLE, false, null); + } + } + + /** + * 通用查询文章 + * + * @param mode + * @param response + */ + @RequestMapping("/queryArticleJson") + @ResponseBody + public void queryArticleJson(HttpServletRequest request, HttpServletResponse response) { + String categoryId = request.getParameter("categoryId"); // 分类编号 + String flag = request.getParameter("flag"); // 文章属性 + String noFlag = request.getParameter("noFlag"); // 文章不允许属性 + String pageNo = request.getParameter("pageNo"); + String pageSize = request.getParameter("pageSize"); + String orderBy = request.getParameter("orderBy"); + String order = request.getParameter("order"); + int _categoryId = 0; + if (StringUtil.isInteger(categoryId)) { + _categoryId = Integer.parseInt(categoryId); + } + int _pageNO = 1; + if (StringUtil.isInteger(pageNo)) { + _pageNO = Integer.parseInt(pageNo); + } + int _pageSize = 1; + if (StringUtil.isInteger(pageSize)) { + _pageSize = Integer.parseInt(pageSize); + } + + int appId = this.getAppId(request); + List articleList = articleBiz.queryList(appId, _categoryId, flag, noFlag, ((_pageNO > 1 ? _pageNO : 1) - 1) * _pageSize, + _pageSize, orderBy, true); + int count = articleBiz.count(appId, _categoryId, flag, noFlag,null); + ListJson json = new ListJson(count, articleList); + this.outJson(response, JSONObject.toJSONString(json)); + } + + /** + * 遍历出所有文章新增字段的信息 + * + * @param listField + * :字段列表 + * @param request + * @param articleId + * 文章id + * @return 字段信息 + */ + private Map checkField(List listField, HttpServletRequest request, int articleId) { + Map mapParams = new HashMap(); + // 压入默认的basicId字段 + mapParams.put("basicId", articleId); + // 遍历字段名 + for (int i = 0; i < listField.size(); i++) { + FieldEntity field = (FieldEntity) listField.get(i); + String fieldName = field.getFieldFieldName(); + // 判断字段类型是否为checkbox类型 + if (field.getFieldType() == checkBox) { + String langtyp[] = request.getParameterValues(field.getFieldFieldName()); + if (langtyp != null) { + StringBuffer sb = new StringBuffer(); + for (int j = 0; j < langtyp.length; j++) { + sb.append(langtyp[j] + ","); + } + mapParams.put(field.getFieldFieldName(), sb.toString()); + } else { + mapParams.put(field.getFieldFieldName(), langtyp); + } + } else { + if (StringUtil.isBlank(request.getParameter(field.getFieldFieldName()))) { + mapParams.put(field.getFieldFieldName(), null); + } else { + mapParams.put(field.getFieldFieldName(), request.getParameter(field.getFieldFieldName())); + } + } + } + return mapParams; + } + +} diff --git a/src/main/java/com/mingsoft/cms/action/ColumnAction.java b/src/main/java/com/mingsoft/cms/action/ColumnAction.java new file mode 100644 index 00000000..a015c433 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/ColumnAction.java @@ -0,0 +1,391 @@ +package com.mingsoft.cms.action; + +import java.io.File; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.constant.e.ColumnTypeEnum; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.StringUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: 栏目控制层,继承BasicAction + *

+ * + *

+ * Create Date:2014-7-15 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/cms/column") +public class ColumnAction extends BaseAction { + + /** + * 业务层的注入 + */ + @Autowired + private IColumnBiz columnBiz; + + + /** + * 模块业务层注入 + */ + @Autowired + private IModelBiz modelBiz; + + + /** + * 业务层的注入表单内容模型 + */ + @Autowired + private IContentModelBiz contentModelBiz; + + /** + * 栏目添加 + * + * @param column + * 栏目对象 + * @return 返回页面跳转 + */ + @RequestMapping("/save") + public void save(@ModelAttribute ColumnEntity column, + HttpServletRequest request,HttpServletResponse response) { + if(!checkForm(column,response)){ + return; + } + column.setCategoryAppId( this.getAppId(request)); + column.setColumnWebsiteId(this.getAppId(request)); + column.setCategoryManagerId(getManagerBySession(request).getManagerId()); + column.setCategoryDateTime(new Timestamp(System.currentTimeMillis())); + column.setCategoryModelId(this.getModelCodeId(request)); + + if(column.getColumnType()==ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()){ + column.setColumnListUrl(null); + } + columnBiz.saveCategory(column); + this.columnPath(request,column); + this.outJson(response, ModelCode.CMS_COLUMN, true,null,JSONArray.toJSONString(column.getCategoryId())); + } + + /** + * 栏目添加跳转页面 + * + * @return + */ + @RequestMapping("/add") + public String add(HttpServletRequest request,ModelMap model) { + ManagerEntity managerSession = (ManagerEntity) getSession(request, SessionConst.MANAGER_ESSION); + // 站点ID + int appId =this.getAppId(request); + List list = columnBiz.queryAll(appId, this.getModelCodeId(request)); + // 查询属于当前管理员的内容模型 + List listCm = contentModelBiz.queryByManagerId(managerSession.getManagerId()); + ColumnEntity columnSuper = new ColumnEntity(); + model.addAttribute("columnSuper", columnSuper); + model.addAttribute("column",new ColumnEntity()); + model.addAttribute("listColumn", JSONObject.toJSON(list).toString()); + model.addAttribute("listCm", listCm); + return "/manager/cms/column/column"; + } + + /** + * 栏目首页面列表显示 + */ + @RequestMapping("/list") + public String list(HttpServletRequest request) { + + // 站点ID有session获取 + int websiteId = this.getAppId(request); + // 需要打开的栏目节点树的栏目ID + int categoryId = 0; + List list = new ArrayList(); + + Object cId = request.getParameter("categoryId"); + if (!StringUtil.isBlank(cId)) { + categoryId = Integer.parseInt(cId.toString()); + } + // 是否为顶级栏目 + //if (categoryId == Const.COLUMN_TOP_CATEGORY_ID) { + list = columnBiz.queryAll(websiteId, this.getModelCodeId(request));// columnBiz.queryChild(categoryId,websiteId,this.getModelCodeId(request)); +// } else { +// list = columnBiz.queryColumnChildListRecursionByWebsiteId(categoryId, websiteId); +// } + + + //栏目链接标签拼接字符串 + request.setAttribute("columnRegexConstant", IParserRegexConstant.HTML_SAVE_PATH+File.separator+websiteId); + + request.setAttribute("listColumn", JSONArray.toJSONString(list)); + return "/manager/cms/column/column_list"; + } + + /** + * 子栏目列表显示 + */ + @RequestMapping("/{categoryId}/childList") + public void childList(@PathVariable int categoryId,HttpServletResponse response, HttpServletRequest request) { + + // 站点ID有session获取 + int websiteId =this.getAppId(request); + // 需要打开的栏目节点树的栏目ID + List list = new ArrayList(); + + list = columnBiz.queryChild(categoryId, websiteId,this.getModelCodeId(request)); + + response.setCharacterEncoding("utf-8"); + this.outJson(response, ModelCode.CMS_COLUMN, true, "", JSONObject.toJSON(list).toString()); + } + /** + * 根据栏目ID删除栏目记录 + * + * @param request + * @return 重定向 + */ + @RequestMapping("/{categoryId}/delete") + public void delete(@PathVariable int categoryId, + HttpServletResponse response, HttpServletRequest request) { + + // 站点ID有session获取 + int websiteId = this.getAppId(request); + // 查询该栏目是否有子栏目,如果存在子栏目则返回错误提示,否则删除该栏目 + if (columnBiz.queryChild(categoryId, websiteId,this.getModelCodeId(request)).size() > 0) { + this.outJson(response, ModelCode.CMS_COLUMN, true, "false"); + } else { + columnBiz.deleteCategory(categoryId); + this.outJson(response, ModelCode.CMS_COLUMN, true, "true"); + } + } + /** + * 根据栏目ID进行栏目删除确认,如果有子栏目则不能被删除 + * @param categoryId 栏目ID + * @param response + * @param request + */ + @RequestMapping("/{categoryId}/deleteConfirm") + public void deleteConfirm(@PathVariable int categoryId, + HttpServletResponse response, HttpServletRequest request){ + // 站点ID有session获取 + int websiteId = this.getAppId(request); + // 查询该栏目是否有子栏目,如果存在子栏目则返回错误提示,否则删除该栏目 + if (columnBiz.queryColumnChildListCountByWebsiteId(categoryId, websiteId) > 0) { + this.outJson(response, ModelCode.CMS_COLUMN, true, "false"); + } else { + this.outJson(response, ModelCode.CMS_COLUMN, true, "true"); + } + } + + /** + * 栏目路径 + * @param column 栏目实体 + */ + public void columnPath(HttpServletRequest request,ColumnEntity column){ + String columnPath = ""; + String file = this.getRealPath(request,null)+IParserRegexConstant.HTML_SAVE_PATH+File.separator+ column.getColumnWebsiteId(); + String delFile = ""; + //修改栏目路径时,删除已存在的文件夹 + column = (ColumnEntity) columnBiz.getEntity(column.getCategoryId()); + delFile = file + column.getColumnPath(); + if(!StringUtil.isBlank(delFile)){ + File delFileName = new File(delFile); + delFileName.delete(); + } + //若为顶级栏目,则路径为:/+栏目ID + if(column.getCategoryCategoryId() == 0){ + column.setColumnPath(File.separator+column.getCategoryId()); + file = file + File.separator + column.getCategoryId(); + } else { + List list = columnBiz.queryParentColumnByColumnId(column.getCategoryId()); + if(!StringUtil.isBlank(list)){ + String temp = ""; + for(int i = list.size()-1; i>=0; i--){ + ColumnEntity entity = list.get(i); + columnPath = columnPath + File.separator + entity.getCategoryId(); + temp = temp + File.separator + entity.getCategoryId(); + } + column.setColumnPath(columnPath + File.separator + column.getCategoryId()); + file = file + temp + File.separator + column.getCategoryId(); + } + } + columnBiz.updateEntity(column); + //生成文件夹 + File fileName = new File(file); + fileName.mkdir(); + } + + /** + * 栏目更新 + * + * @param column + * 栏目实体 + * @return 重定向 + */ + @RequestMapping("/update") + public void update(@ModelAttribute ColumnEntity column, + HttpServletRequest request,HttpServletResponse response) { + + if(!checkForm(column,response)){ + return; + } + if(column.getColumnType()==ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()){ + column.setColumnListUrl(null); + } + column.setCategoryManagerId(getManagerBySession(request).getManagerId()); + column.setColumnWebsiteId(this.getAppId(request)); + columnBiz.updateCategory(column); + this.columnPath(request,column); + this.outJson(response, ModelCode.CMS_COLUMN, true,null,JSONArray.toJSONString(column.getCategoryId())); + + } + + /** + * 栏目更新页面跳转 + * + * @param request + * @return + */ + @RequestMapping("/{columnId}/edit") + public String edit(@PathVariable int columnId, HttpServletRequest request,ModelMap model) { + // 获取管理实体 + ManagerEntity managerSession = (ManagerEntity) getSession(request, SessionConst.MANAGER_ESSION); + // 站点ID + int appId = this.getAppId(request); + List list = new ArrayList(); + // 判断管理员权限,查询其管理的栏目集合 + list = columnBiz.queryAll(appId, this.getModelCodeId(request)); + + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(columnId); + // 查询属于当前管理员的内容模型 + List listCm = contentModelBiz.queryByManagerId(managerSession.getManagerId()); + model.addAttribute("column", column); + model.addAttribute("columnc", column.getCategoryId()); + model.addAttribute("listCm", listCm); + ColumnEntity columnSuper = new ColumnEntity(); + // 获取父栏目对象 + if (column.getCategoryCategoryId() != Const.COLUMN_TOP_CATEGORY_ID) { + columnSuper = (ColumnEntity) columnBiz.getEntity(column.getCategoryCategoryId()); + } + model.addAttribute("columnSuper", columnSuper); + model.addAttribute("listColumn", JSONObject.toJSON(list).toString()); + return "/manager/cms/column/column"; + } + + /** + * 查询全部栏目集合 使用queryJsonAll替代 + * + * @param response + */ + @Deprecated + @RequestMapping("/columnList") + public void columnList(HttpServletResponse response, + HttpServletRequest request) { + + // 该站点ID有session提供 + int websiteId = this.getAppId(request); + List list = columnBiz.queryColumnListByWebsiteId(websiteId); + response.setCharacterEncoding("utf-8"); + this.outJson(response, ModelCode.CMS_COLUMN, true, "", JSONObject.toJSON(list).toString()); + } + + @RequestMapping("/queryJsonAll") + public void queryJsonAll(HttpServletResponse response, + HttpServletRequest request) { + + // 该站点ID有session提供 + int websiteId = this.getAppId(request); + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + //获取所有的内容管理栏目 + List list = columnBiz.queryAll(websiteId,modelId); + response.setCharacterEncoding("utf-8"); + this.outJson(response, ModelCode.CMS_COLUMN, true, "", JSONObject.toJSON(list).toString()); + } + + + /** + * 后台验证填写的栏目信息是否合法 + * @param column 栏目信息 + * @param response + * @return false:不合法 true:合法 + */ + private boolean checkForm(ColumnEntity column, HttpServletResponse response){ + + + //栏目标题空值验证 + if(StringUtil.isBlank(column.getCategoryTitle())){ + this.outJson( response, ModelCode.CMS_COLUMN, false, getResString("err.empty", this.getResString("categoryTitle"))); + return false; + } + //栏目标题长度验证 + if(!StringUtil.checkLength(column.getCategoryTitle(), 1, 31)){ + this.outJson( response, ModelCode.CMS_COLUMN, false, getResString("err.length", this.getResString("categoryTitle"), "1", "30")); + return false; + } + //栏目属性空值验证 + if(StringUtil.isBlank(column.getColumnType())){ + this.outJson( response, ModelCode.CMS_COLUMN, false, getResString("err.empty", this.getResString("columnType"))); + return false; + } + //栏目描述处理 + if(StringUtil.checkLength(column.getColumnDescrip(), 0, 500)){ + column.setColumnDescrip(StringUtil.subString(column.getColumnDescrip(), 500)); + } + //栏目简介处理 + if(StringUtil.checkLength(column.getColumnKeyword(), 0, 500)){ + column.setColumnKeyword(StringUtil.subString(column.getColumnKeyword(), 500)); + } + + return true; + } + +} diff --git a/src/main/java/com/mingsoft/cms/action/ColumnTypeAction.java b/src/main/java/com/mingsoft/cms/action/ColumnTypeAction.java new file mode 100644 index 00000000..68f49b79 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/ColumnTypeAction.java @@ -0,0 +1,138 @@ +package com.mingsoft.cms.action; + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.alibaba.fastjson.JSONArray; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.basic.biz.IBasicCategoryBiz; +import com.mingsoft.basic.biz.ICategoryBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.BasicCategoryEntity; +import com.mingsoft.basic.entity.CategoryEntity; +import com.mingsoft.basic.entity.ModelEntity; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.entity.ColumnEntity; + +/** + * + *

+ * 铭飞基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 史爱华 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:类别基础信息关联业务层 + *

+ * + *

+ * Create Date:2015-08-14 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/cms/type") +public class ColumnTypeAction extends BaseAction { + + /** + * 业务层的注入 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 模块业务层的注入 + */ + @Autowired + private IModelBiz modelBiz; + + /** + * 注入分类业务层 + */ + @Autowired + private ICategoryBiz categoryBiz; + + /** + * 注入基础分类关联业务层 + */ + @Autowired + private IBasicCategoryBiz basicCategoryBiz; + + /** + * 加载页面显示所有文章信息 + * + * @param request + * @return 返回文章页面显示地址 + */ + @SuppressWarnings("static-access") + @RequestMapping("/index") + public String index(HttpServletRequest request, ModelMap mode, HttpServletResponse response) { + // 站点ID有session获取 + int appId = this.getAppId(request); + // 需要打开的栏目节点树的栏目ID + List list = new ArrayList(); + //查询栏目管理 + ModelEntity columModel = modelBiz.getEntityByModelCode(com.mingsoft.base.constant.ModelCode.CMS_COLUMN); + list = columnBiz.queryAll(appId, columModel.getModelId()); + // columnBiz.queryChild(categoryId,websiteId,this.getModelCodeId(request)); + //获取属性的modeId + ModelEntity model = modelBiz.getEntityByModelCode(com.mingsoft.base.constant.ModelCode.CMS_COLUMN_TYPE); + if(model!=null){ + mode.addAttribute("modelId", model.getModelId()); + } + mode.addAttribute("listColumn", JSONArray.toJSONString(list)); + return "/manager/cms/type/index"; + } + + /** + * 根据栏目id去查询该分类下的属性,主要是供ajax请求使用 + * @param categoryId 分类id + * @param request + * @param response + */ + @RequestMapping("/{categoryId}/{basicId}/queryByCategoryId") + public String queryByCategoryId(@PathVariable int categoryId,@PathVariable int basicId,HttpServletRequest request,HttpServletResponse response, ModelMap mode){ + //获取属性的modeId + ModelEntity model = modelBiz.getEntityByModelCode(com.mingsoft.base.constant.ModelCode.CMS_COLUMN_TYPE); + int appId = this.getAppId(request); + if(model!=null){ + List categoryList = this.categoryBiz.queryChildrenCategory(categoryId, appId, model.getModelId()); + mode.addAttribute("categoryList",JSONArray.toJSONString(categoryList)); + } + //获取basicid + if(basicId>0){ + //根据basicI + List basicCategoryList = basicCategoryBiz.queryByBasicId(basicId); + mode.addAttribute("basicCategoryList",JSONArray.toJSONString(basicCategoryList)); + } + + return "/manager/cms/type/type_fields"; + } +} diff --git a/src/main/java/com/mingsoft/cms/action/ContentModelAction.java b/src/main/java/com/mingsoft/cms/action/ContentModelAction.java new file mode 100644 index 00000000..9e0f7d75 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/ContentModelAction.java @@ -0,0 +1,231 @@ +package com.mingsoft.cms.action; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.entity.ManagerEntity; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:内容模型控制层,继承BasicAction + *

+ * + *

+ * Create Date:2014-9-12 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/cms/contentModel/") +public class ContentModelAction extends BaseAction{ + + /** + * 自定义表前缀 + */ + private static final String TABLE_NAME_PREFIX = "cms_"; + /** + * 表名分隔符 + */ + private static final String TABLE_NAME_SPLIT= "_"; + /** + * 表单管理业务层 + */ + @Autowired + private IContentModelBiz contentModelBiz; + + /** + * 表单列表路径 + */ + private final static String PAGE_URL="/manager/cms/contentModel/list.do"; + + /** + * 表单列表 + * @return 返回表单列表页面 + */ + @RequestMapping("/list") + public String list(HttpServletRequest request, ModelMap model, HttpServletResponse response) { + // 获取当前管理员实体 + ManagerEntity managerSession = (ManagerEntity) getSession(request, SessionConst.MANAGER_ESSION); + //获取当前管理员Id + int managerId = managerSession.getManagerId(); + String pageNo = request.getParameter("pageNo"); + if (!StringUtil.isInteger(pageNo)) { + pageNo = "1"; + } + int recordCount = contentModelBiz.getContentModelByManagerId(managerId); + PageUtil page = new PageUtil(StringUtil.string2Int(pageNo), recordCount, getUrl(request)+ PAGE_URL); + this.setCookie(request, response, CookieConst.PAGENO_COOKIE, pageNo); + List listContentModel = contentModelBiz.queryPageByManagerId(page, "CM_ID", false,managerId); + model.addAttribute("listContentModel", listContentModel); + model.addAttribute("page", page); + return "/manager/cms/form/form_list"; + } + + /** + * 删除表单类型 + * @param cmId 表单ID + * @param request 请求 + * @param response 响应 + */ + @RequestMapping("/{cmId}/delete") + @ResponseBody + public int delete(@PathVariable int cmId, HttpServletRequest request) { + int pageNo = 1; + if (cmId != 0) { + ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz.getEntity(cmId); + contentModelBiz.dropTable(contentModel.getCmTableName()); + contentModelBiz.deleteEntity(cmId); + //判断当前页码 + this.getHistoryPageNoByCookie(request); + } + return pageNo; + } + + /** + * 增加表单 + * @param request 请求 + * @return 增加表单页面 + */ + @RequestMapping("/add") + public String add(ModelMap model) { + model.addAttribute("cmId", 0); + model.addAttribute("flag", true); + return "/manager/cms/form/form"; + } + + /** + * 编辑表单 + * @param cmId 表单ID + * @return 编辑表单页面 + */ + @RequestMapping("/{cmId}/edit") + public String edit(@PathVariable int cmId, ModelMap model) { + //获取表单实体 + ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz.getEntity(cmId); + model.addAttribute("contentModel", contentModel); + model.addAttribute("cmId", cmId); + model.addAttribute("flag", false); + return "/manager/cms/form/form"; + } + + + + /** + * 保存内容模型实体 + * @param contentModel + * @param response + */ + @RequestMapping("/save") + @ResponseBody + public void save(@ModelAttribute ContentModelEntity contentModel,HttpServletRequest request, HttpServletResponse response){ + // 保存前判断数据是否合法 + if(!StringUtil.checkLength(contentModel.getCmTipsName(), 1,30)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("cmTipsName"),"1","30")); + return; + } + if(!StringUtil.checkLength(contentModel.getCmTableName(), 1,20)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("cmTableName"),"1","20")); + return; + } + // 获取当前管理员实体 + ManagerEntity managerSession = (ManagerEntity) getSession(request, SessionConst.MANAGER_ESSION); + //获取当前管理员Id + int managerId = managerSession.getManagerId(); + contentModel.setCmManagerId(managerId); + // 新增表名为"cms_"+用户填写的表名+"_"+站点id + contentModel.setCmTableName(TABLE_NAME_PREFIX+contentModel.getCmTableName()+TABLE_NAME_SPLIT+managerId); + // 新增表 + contentModelBiz.createTable(contentModel.getCmTableName(),null); + contentModelBiz.saveEntity(contentModel); + int cmId= contentModelBiz.getContentModelByTableName(contentModel.getCmTableName()).getCmId(); + + this.outJson(response, null, true,String.valueOf(cmId)); + } + + /** + * 更新内容模型实体 + * @param contentModel 内容模型实体 + * @param request + * @param response + */ + @RequestMapping("/update") + @ResponseBody + public void update(@ModelAttribute ContentModelEntity contentModel,HttpServletRequest request, HttpServletResponse response){ + // 保存前判断数据是否合法 + if(!StringUtil.checkLength(contentModel.getCmTipsName(), 1,30)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("cmTipsName"),"1","30")); + return; + } + // 获取当前管理员实体 + ManagerEntity managerSession = (ManagerEntity) getSession(request, SessionConst.MANAGER_ESSION); + //获取当前管理员Id + int managerId = managerSession.getManagerId(); + contentModel.setCmManagerId(managerId); + contentModelBiz.updateEntity(contentModel); + this.outJson(response, null, true,null); + } + + /** + * 判断字段名是否存在重复 + * @param fieldFieldName :字段名 + * @param request + * @return true:存在重复,false:不存在重复 + */ + @RequestMapping("/{cmTableName}/checkcmTableNameExist") + @ResponseBody + public boolean checkcmTableNameExist(@PathVariable String cmTableName, HttpServletRequest request) { + // 获取当前管理员实体 + ManagerEntity managerSession = (ManagerEntity) getSession(request, SessionConst.MANAGER_ESSION); + //获取当前管理员Id + int managerId = managerSession.getManagerId(); + cmTableName =TABLE_NAME_PREFIX+cmTableName+TABLE_NAME_SPLIT+managerId; + // 判断表名是否重复 + if(contentModelBiz.getContentModelByTableName(cmTableName)!=null){ + return true; + }else{ + return false; + } + + } +} diff --git a/src/main/java/com/mingsoft/cms/action/DedeAction.java b/src/main/java/com/mingsoft/cms/action/DedeAction.java new file mode 100644 index 00000000..a1edddc7 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/DedeAction.java @@ -0,0 +1,285 @@ +package com.mingsoft.cms.action; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.cms.biz.IArticleBiz; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.util.StringUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:数据导入控制层,继承BasicAction + *

+ * + *

+ * Create Date:2014-9-25 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/cms/dede") +public class DedeAction extends BaseAction { + + /** + * 栏目业务层 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 文章业务层 + */ + @Autowired + private IArticleBiz articleBiz; + + /** + * 数据库连接 + */ + private Connection conn = null; + + /** + * 接收SQL语句执行后的数据 + */ + private ResultSet rs = null; + + /** + * 发送SQL语句 + */ + private PreparedStatement pstmt = null; + + /** + * 跳转至数据导入页面 + * + * @param model + * @param request + * 请求 + * @return 返回页面 + */ + @RequestMapping("/dede") + public String dede(ModelMap model, HttpServletRequest request) { + ManagerSessionEntity managerSession = getManagerBySession(request); + // 获取本地栏目 + List localColumnList = columnBiz.queryColumnListByWebsiteId(managerSession.getBasicId()); + model.addAttribute("localColumnList", JSONArray.toJSONString(localColumnList)); + return "/manager/cms/dede/dede"; + } + + /** + * 链接数据库 + * + * @param request + * 请求 + */ + @RequestMapping("/connection") + public void connection(HttpServletRequest request, HttpServletResponse response) { + String prefixName = request.getParameter("prefixName"); + conn = this.getConnection(request); + if (conn == null) { + this.outJson(response, ModelCode.COM_DEDE_DATA_IMPORT, false, this.getResString("err")); + return; + } + ManagerSessionEntity managerSession = getManagerBySession(request); + List remoteColumnList = new ArrayList(); + // 获取表前缀 + + // 获取远程栏目 + String sql = "select id,typename,reid from " + prefixName + "arctype"; + try { + pstmt = conn.prepareStatement(sql); + rs = pstmt.executeQuery(); + while (rs.next()) { + Map map = new HashMap(); + map.put("id", rs.getInt("id")); + map.put("pId", rs.getInt("reid")); + map.put("name", rs.getString("typename")); + remoteColumnList.add(map); + } + conn.close(); + this.outJson(response, JSONObject.toJSONString(remoteColumnList)); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + /** + * 开始导入数据 + * + * @param request + */ + @RequestMapping("/importData") + @ResponseBody + public void importData(HttpServletRequest request, HttpServletResponse response) { + + // 获取表前缀 + String prefixName = request.getParameter("prefixName"); + // 获取选中的的远程和本地栏目ID + String remoteColumnId = request.getParameter("remoteColumnId"); + String localColumnId = request.getParameter("localColumnId"); + if (StringUtil.isBlank(remoteColumnId) || StringUtil.isBlank(localColumnId)) { + this.outJson(response, ModelCode.COM_DEDE_DATA_IMPORT, false); + return; + } + + conn = this.getConnection(request); + if (conn == null) { + this.outJson(response, ModelCode.COM_DEDE_DATA_IMPORT, false, this.getResString("err")); + return; + } + ManagerSessionEntity managerSession = getManagerBySession(request); + + try { + // 获取远程该栏目信息 + String queryColumnSql = "select * from " + prefixName + "arctype where id=" + remoteColumnId; + pstmt = conn.prepareStatement(queryColumnSql); + rs = pstmt.executeQuery(); + ColumnEntity column = null; + String columnContent = ""; + while (rs.next()) { + column = (ColumnEntity) columnBiz.getEntity(Integer.valueOf(localColumnId)); + column.setCategoryCategoryId(column.getCategoryCategoryId()); // 父栏目ID + column.setColumnKeyword(rs.getString("keywords")); // 栏目关键字 + column.setColumnDescrip(rs.getString("description")); // 栏目描述 + column.setColumnType(rs.getInt("ispart") + 1); // 栏目类型,本地系统的栏目类型均比远程的大1个数值 + // 获取栏目内容 + columnContent = rs.getString("content"); + } + // 修改本地栏目信息 + columnBiz.updateCategory(column); + // 判断栏目是否为封面模板,如果是则取出封面内容 + if (column.getColumnType() == ColumnEntity.COLUMN_TYPE_COVER) { + ArticleEntity article = new ArticleEntity(); + article.setArticleContent(columnContent);// 文章内容 + article.setBasicTitle(column.getCategoryTitle());// 文章标题 + article.setArticleKeyword(column.getColumnKeyword());// 文章关键字 + article.setBasicThumbnails(column.getColumnDescrip());// 文章描述 + article.setArticleType(""); + article.setBasicAppId(managerSession.getBasicId()); + article.setArticleWebId(managerSession.getBasicId());// 文章所属站点id + article.setBasicCategoryId(Integer.valueOf(localColumnId)); // 文章所属栏目ID + article.setColumn(column); + articleBiz.saveBasic(article); + } else { + // 获取远程该栏目下的文章信息 + String queryArticleSql = "select * from " + prefixName + "archives ar left join " + prefixName + + "addonarticle ad on ar.id = ad.aid where ar.typeid =" + remoteColumnId; + pstmt = conn.prepareStatement(queryArticleSql); + rs = pstmt.executeQuery(); + while (rs.next()) { + ArticleEntity article = new ArticleEntity(); + Long dates = Long.parseLong(rs.getInt("pubdate")+"")*1000; + Timestamp date = new Timestamp(dates); + article.setArticleAuthor(rs.getString("writer")); // 文章作者 + article.setArticleContent(rs.getString("body")); // 文章内容 + article.setArticleType(rs.getString("flag")); // 文章属性 + article.setArticleSource(rs.getString("source")); // 文章来源 + article.setArticleLinkURL(rs.getString("redirecturl")); // 文章跳转URL + article.setArticleKeyword(rs.getString("keywords")); // 文章关键词 + article.setArticleFreeOrder(rs.getInt("sortrank")); // 文章自定义排序 + article.setArticleWebId(managerSession.getBasicId()); // 文章站点ID + article.setBasicTitle(rs.getString("title")); // 文章标题 + article.setBasicThumbnails(rs.getString("litpic")); // 文章缩略图 + article.setBasicHit(rs.getInt("click")); // 文章点击量 + article.setColumn(column);// 文章所属栏目 + article.setBasicDateTime(date); // 文章发布日期 + article.setBasicCategoryId(Integer.valueOf(localColumnId)); // 文章所属栏目ID + article.setBasicUpdateTime(date); // 文章更新时间 + // 导入远程文章信息 + articleBiz.saveBasic(article); + } + } + this.outJson(response, ModelCode.COM_DEDE_DATA_IMPORT, true); + conn.close(); + return; + } catch (SQLException e) { + e.printStackTrace(); + this.outJson(response, ModelCode.COM_DEDE_DATA_IMPORT, false, this.getResString("err")); + } + } + + private Connection getConnection(HttpServletRequest request) { + String ipAddress = request.getParameter("ipAddress"); + String port = request.getParameter("port"); + String databaseName = request.getParameter("databaseName"); + String userName = request.getParameter("userName"); + String userPassword = request.getParameter("userPassword"); + + try { + // 加载数据库驱动 + Class.forName("com.mysql.jdbc.Driver").newInstance(); + // 建立链接 + conn = DriverManager.getConnection("jdbc:mysql://" + ipAddress + ":" + port + "/" + databaseName + + "?useUnicode=true&characterEncoding=utf8", userName, userPassword); + return conn; + } catch (Exception e) { + return null; + } + } + + /** + * 关闭数据库连接 + */ + @RequestMapping("/close") + @ResponseBody + public boolean close() { + try { + if (conn != null) { + conn.close(); + return true; + } else { + return false; + } + } catch (SQLException e) { + return false; + } + } +} diff --git a/src/main/java/com/mingsoft/cms/action/FieldAction.java b/src/main/java/com/mingsoft/cms/action/FieldAction.java new file mode 100644 index 00000000..7834045e --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/FieldAction.java @@ -0,0 +1,423 @@ +package com.mingsoft.cms.action; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.cms.entity.FieldEntity; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:字段管理控制层,继承BasicAction + *

+ * + *

+ * Create Date:2014-9-12 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/cms/field/") +public class FieldAction extends BaseAction{ + + /** + * 字段业务层 + */ + @Autowired + private IFieldBiz fieldBiz; + + /** + * 内容模型业务层 + */ + @Autowired + private IContentModelBiz contentModelBiz; + + /** + * option 选择框 + */ + private final static int OPTION=9; + + /** + * radio 选择按钮 + */ + private final static int RADIO=10; + + /** + * checkbox 多选框 + */ + private final static int CHECKBOX = 11; + + /** + * 栏目业务层 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 表单列表路径 + */ + private final static String PAGE_URL="/manager/cms/field/list.do"; + + /** + * 获取字段属性 + * @return + */ + public Map getfieldType(){ + Map maps = new LinkedHashMap(); + maps = getMapByProperties("com/mingsoft/cms/resources/field_type"); + Map fieldType= new LinkedHashMap(); + Map map= new LinkedHashMap(); + for(Entry entry : maps.entrySet()){ + map.put(Integer.valueOf(entry.getKey()), entry.getValue()); + } + for(int i=1; i<=maps.size(); i++){ + fieldType.put(i, map.get(i)); + } + return fieldType; + } + + + /** + * 查询指定表单所有的自定义字段 + * @param cmId 表单ID + * @param request 请求 + * @param model + * @param response 响应 + */ + @RequestMapping("/list") + @ResponseBody + public Map list(int cmId,HttpServletRequest request, HttpServletResponse response){ + Map model = new HashMap(); + String pageNo = request.getParameter("pageNo"); + if (!StringUtil.isInteger(pageNo)) { + pageNo = "1"; + } + int recordCount = fieldBiz.queryCountByCmid(cmId); + PageUtil page = new PageUtil(StringUtil.string2Int(pageNo),recordCount, recordCount, PAGE_URL); + this.setCookie(request, response, CookieConst.PAGENO_COOKIE, pageNo); + //当前表单的所有自定义字段 + List fieldList = fieldBiz.queryByPage(cmId, page, "FIELD_ID", false); + model.put("fieldList", fieldList); + //获取字段属性 + Map fieldType = this.getfieldType(); + model.put("fieldType",fieldType); + model.put("page",page); + model.put("fieldNum",fieldType.size()); + if(cmId == 0){ + model.put("flag", true); + } else { + model.put("flag", false); + } + model.put("cmId", cmId); + return model; + + } + + + + + /** + * 删除自定义字段 + * @param cmId 表单ID + * @param request 请求 + * @param response 响应 + */ + @RequestMapping("/{fieldId}/delete") + @ResponseBody + public int delete(@PathVariable int fieldId, HttpServletRequest request) { + int pageNo = 1; + if (fieldId != 0) { + //获取要删除的字段实体 + FieldEntity field = (FieldEntity) fieldBiz.getEntity(fieldId); + fieldBiz.deleteEntity(fieldId); + //获取内容模型实体 + ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz.getEntity(field.getFieldCmid()); + if(contentModel != null){ + Map fields = new HashMap(); + // 要删除的字段名 + fields.put("fieldName",field.getFieldFieldName()); + //删除列 + fieldBiz.alterTable(contentModel.getCmTableName(),fields,"drop"); + } + //判断当前页码 + this.getHistoryPageNoByCookie(request); + } + return pageNo; + } + + /** + * 保存字段数据到数据库 + * @param field 要保存的字段实体 + * @param request + * @param response + */ + @RequestMapping("/{cmTableName}/save") + @ResponseBody + public void save(@ModelAttribute FieldEntity field,@PathVariable String cmTableName, HttpServletResponse response) { + // 判断是否存在表单 + ContentModelEntity contentModel = contentModelBiz.getContentModelByTableName(cmTableName); + int cmId = contentModel.getCmId(); + field.setFieldCmid(cmId); + // 更新前判断数据是否合法 + if(!StringUtil.checkLength(field.getFieldTipsName(), 1,30)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldTipsName"),"1","30")); + return ; + } + if(!StringUtil.checkLength(field.getFieldFieldName(), 1,30)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldFieldName"),"1","30")); + return ; + } + fieldBiz.saveEntity(field); + //读取属性配置文件 + Map maps = new LinkedHashMap(); + maps = getMapByProperties("com/mingsoft/cms/resources/field_dataType"); + //动态的修改表结构 + //获取字段信息 + Map fileds = new HashMap(); + //压入字段名 + fileds.put("fieldName", field.getFieldFieldName()); + //字段的数据类型 + fileds.put("fieldType",maps.get(String.valueOf(field.getFieldType()))); + //字段的默认值 + //判断该字段是否为checkBox或option或为raido, + if(field.getFieldType()==OPTION||field.getFieldType()==RADIO||field.getFieldType()==CHECKBOX){ + fileds.put("default",0); + }else{ + fileds.put("default", field.getFieldDefault()); + } + + fieldBiz.alterTable(contentModel.getCmTableName(), fileds,"add"); + this.outJson(response, null, true, null); + } + + /** + * 获取编辑的字段实体的信息 + * @param mode + * @param fieldId :要获取的字段实体的id + * @param request + * @return + */ + @RequestMapping("/{fieldId}/edit") + @ResponseBody + public Map edit(@PathVariable int fieldId, HttpServletRequest request){ + Map model = new HashMap(); + FieldEntity field = (FieldEntity) fieldBiz.getEntity(fieldId); + model.put("field", field); + return model; + } + + /** + * 更新字段信息 + * @param field 要更新的字段信息的id + * @param response + */ + + @RequestMapping("/update") + @ResponseBody + public void update(@ModelAttribute FieldEntity field, HttpServletResponse response){ + + // 更新前判断数据是否合法 + if(!StringUtil.checkLength(field.getFieldTipsName(), 1,30)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("fieldTipsName"),"1","30")); + return ; + } + if(!StringUtil.checkLength(field.getFieldFieldName(), 1,30)){ + this.outJson(response,null, false,getResString("err.length",this.getResString("fieldFieldName"),"1","30")); + return ; + } + //获取内容模型实体 + ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz.getEntity(field.getFieldCmid()); + //读取属性配置文件 + Map maps = new LinkedHashMap(); + maps = getMapByProperties("com/mingsoft/cms/resources/field_dataType"); + // 获取更改前的字段实体 + FieldEntity oldField =(FieldEntity) fieldBiz.getEntity(field.getFieldId()); + fieldBiz.updateEntity(field); + Map fields = new HashMap(); + //更改前的字段名 + fields.put("fieldOldName", oldField.getFieldFieldName()); + //新字段名 + fields.put("fieldName", field.getFieldFieldName()); + //判断该字段是否为checkBox或option或为raido,如果是则默认值为0 + if(field.getFieldType()==OPTION||field.getFieldType()==RADIO||field.getFieldType()==CHECKBOX){ + fields.put("default",0); + }else{ + fields.put("default", field.getFieldDefault()); + } + //字段的数据类型 + fields.put("fieldType", maps.get(String.valueOf(field.getFieldType()))); + if(contentModel!=null){ + // 更新表的字段名 + fieldBiz.alterTable(contentModel.getCmTableName(), fields, "modify"); + } + this.outJson(response,null, true, null); + } + + /** + * 判断字段名是否存在重复 + * @param fieldFieldName :字段名 + * @param request + * @return true:存在重复,false:不存在重复 + */ + @RequestMapping("/{fieldFieldName}/checkFieldNameExist") + @ResponseBody + public boolean checkFieldNameExist(@PathVariable String fieldFieldName, HttpServletRequest request){ + int fieldCmId = 1; + if(request.getParameter("fieldCmId")!=null){ + fieldCmId =Integer.parseInt(request.getParameter("fieldCmId")); + } + if(fieldBiz.getCountFieldName(fieldFieldName, fieldCmId)>0){ + return true; + }else{ + return false; + } + } + + /** + * 返回自定义模型的html模板(适用于商城模块) + * @param columnId + * @param model + * @return + */ + @SuppressWarnings("rawtypes") + @RequestMapping("/{columnId}/queryFieldList") + public String queryFieldList(@PathVariable int columnId,ModelMap model, HttpServletRequest request){ + // 获取栏目信息 + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(columnId); + if(column!=null){ + //获取表单类型的id + int fieldCmid = column.getColumnContentModelId(); + // 根据表单类型id查找出所有的字段信息 + List listField = fieldBiz.queryListByCmid(fieldCmid); + int basicId = 0; + if(request.getParameter("basicId")!=null){ + basicId =StringUtil.string2Int( request.getParameter("basicId")); + } + + if(basicId != 0){ + //根据表单id查找内容模型 + ContentModelEntity contentModel= (ContentModelEntity) contentModelBiz.getEntity(fieldCmid); + // 判断内容模型是否存在 + if(contentModel != null){ + //遍历所有的字段实体,得到字段名列表信息 + List listFieldName = new ArrayList(); + + for(int i = 0;i where = new HashMap(); + where.put("basicId", basicId); + // 获取各字段的值 + List fieldLists = fieldBiz.queryBySQL(contentModel.getCmTableName(), listFieldName, where); + if (fieldLists != null && fieldLists.size()>0) { + Map filedValue = (Map)fieldLists.get(0); + model.addAttribute("filedValue",filedValue); + } + } + } + model.addAttribute("listField",listField); + model.addAttribute("appid",this.getAppId(request)); + } + return "manager/cms/article/article_fields"; + } + + /** + * 返回cms模块的自定义模型的html页面(适用于cms模块) + * @param columnId + * @param model + * @return + */ + @SuppressWarnings("rawtypes") + @RequestMapping("/{columnId}/queryField") + public String queryField(@PathVariable int columnId,ModelMap model, HttpServletRequest request){ + // 获取栏目信息 + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(columnId); + if(column!=null){ + //获取表单类型的id + int fieldCmid = column.getColumnContentModelId(); + // 根据表单类型id查找出所有的字段信息 + List listField = fieldBiz.queryListByCmid(fieldCmid); + int basicId = 0; + if(request.getParameter("basicId")!=null){ + basicId =StringUtil.string2Int( request.getParameter("basicId")); + } + + if(basicId != 0){ + //根据表单id查找内容模型 + ContentModelEntity contentModel= (ContentModelEntity) contentModelBiz.getEntity(fieldCmid); + // 判断内容模型是否存在 + if(contentModel != null){ + //遍历所有的字段实体,得到字段名列表信息 + List listFieldName = new ArrayList(); + + for(int i = 0;i where = new HashMap(); + where.put("basicId", basicId); + // 获取各字段的值 + List fieldLists = fieldBiz.queryBySQL(contentModel.getCmTableName(), listFieldName, where); + if (fieldLists != null && fieldLists.size()>0) { + Map filedValue = (Map)fieldLists.get(0); + model.addAttribute("filedValue",filedValue); + } + } + } + model.addAttribute("listField",listField); + model.addAttribute("appid",this.getAppId(request)); + } + return "manager/cms/article/article_cms_fields"; + } +} + diff --git a/src/main/java/com/mingsoft/cms/action/GeneraterAction.java b/src/main/java/com/mingsoft/cms/action/GeneraterAction.java new file mode 100644 index 00000000..1016b5e9 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/GeneraterAction.java @@ -0,0 +1,756 @@ +package com.mingsoft.cms.action; + +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.alibaba.fastjson.JSONArray; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.CategoryEntity; +import com.mingsoft.cms.biz.IArticleBiz; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.constant.e.ColumnTypeEnum; +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.parser.CmsParser; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.StringUtil; +import com.mingsoft.util.proxy.Header; +import com.mingsoft.util.proxy.Proxy; +import com.mingsoft.util.proxy.Result; + +/** + * + *

+ * mswx-铭飞微信酒店预订平台 + *

+ * + * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 成卫雄 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:应用静态生成,适用于静态信息的应用,例如网站、商城、,但是像论坛这些就不需要这些生成功能; + *

+ * + *

+ * Create Date:2014-8-6 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller("cmsGenerater") +@RequestMapping("/manager/cms/generate") +@Scope("request") +public class GeneraterAction extends BaseAction { + + /** + * 文章管理业务层 + */ + @Autowired + private IArticleBiz articleBiz; + + /** + * 栏目管理业务层 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 站点管理业务层 + */ + @Autowired + private IAppBiz appBiz; + + /** + * 模块管理业务层 + */ + @Autowired + private IModelBiz modelBiz; + + /** + * 文章解析器 + */ + @Autowired + private CmsParser cmsParser; + + /** + * 一键更新所有 + * + * @return + */ + @RequestMapping("/all") + public String all() { + return "/manager/cms/generate/generate_all"; + } + + /** + * 手机端模板前缀 + */ + public static final String MOBILE = "m"; + + /** + * 更新主页 + * + * @return + */ + @RequestMapping("/index") + public String index() { + return "/manager/cms/generate/generate_index"; + } + + /** + * 生成主页 + * + * @param request + * @param response + */ + @RequestMapping("/generateIndex") + @ResponseBody + public boolean generateIndex(HttpServletRequest request, HttpServletResponse response) { + String tmpFileName = request.getParameter("url"); // 模版文件名称 + String generateFileName = request.getParameter("position");// 生成后的文件名称 + + // 获取站点信息 + int websiteId = getManagerBySession(request).getBasicId(); + AppEntity app = (AppEntity) appBiz.getEntity(websiteId); + String tmpName = app.getAppStyle();// 获取模版名称 + String tmpPath = getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE); // 获取系统模版存放物理路径 + String webSiteTmpPath = tmpPath + File.separator + app.getAppId() + File.separator + tmpName;// 根据站点id组装站点信息路径 格式:templets/站点ID/模版风格 + // 模版路径加上(用户选择的主页的模版的路径)default/index.html + String tmpFilePath = webSiteTmpPath + File.separator + tmpFileName; + //读取手机端的模板 + String tmpMobileFilePath = webSiteTmpPath + File.separator + MOBILE + File.separator + tmpFileName;// 手机端 + + // 生成地址 + String generatePath = getRealPath(request, IParserRegexConstant.HTML_SAVE_PATH) + File.separator + websiteId + File.separator + generateFileName; + String generateMobilePath = getRealPath(request, IParserRegexConstant.HTML_SAVE_PATH) + File.separator + websiteId + File.separator + MOBILE + File.separator + generateFileName; + //生成保存htm页面的文件夹 + FileUtil.createFolder(getRealPath(request, IParserRegexConstant.HTML_SAVE_PATH) + File.separator + websiteId); + FileUtil.createFolder(getRealPath(request, IParserRegexConstant.HTML_SAVE_PATH) + File.separator + websiteId + File.separator + MOBILE); // 手机端 + // 获取文件所在路径 首先判断用户输入的模版文件是否存在 + File file = new File(tmpFilePath); + + // 判断文件是否存在,若不存在弹出返回信息 + if (!file.exists()) { + return false; + } else { + // 当前模版的物理路径 + String htmlContent = FileUtil.readFile(tmpFilePath); // 读取模版文件内容 + String mobileHtmlContent = FileUtil.readFile(tmpMobileFilePath); // 读取手机端模版文件内容 + if (!StringUtil.isBlank(htmlContent)) { + //进行html的解析 + htmlContent = cmsParser.parse(htmlContent,app); + Map map = new HashMap(); + map.put(CmsParser.MOBILE,this.MOBILE); + mobileHtmlContent = cmsParser.parse(mobileHtmlContent,app,map); + // 解析HTML上的标签 + FileUtil.writeFile(htmlContent, generatePath, FileUtil.URF8); + FileUtil.writeFile(mobileHtmlContent, generateMobilePath, FileUtil.URF8); + return true; + } else { + // 提示错误:未找到模版 + htmlContent = webSiteTmpPath + File.separator + tmpFileName ; + } + return false; + } + } + + /** + * 生成列表的静态页面 + * + * @param request + * @param response + * @param columnId + */ + @RequestMapping("/{columnId}/genernateColumn") + @ResponseBody + public boolean genernateColumn(HttpServletRequest request, HttpServletResponse response, @PathVariable int columnId) { + // 获取站点id + int appId = getManagerBySession(request).getBasicId(); + AppEntity app = (AppEntity) appBiz.getEntity(appId); + String mobileStyle = app.getAppMobileStyle(); // 手机端模版 + String url = app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId(); + // 站点生成后保存的html地址 + String generatePath = getRealPath(request, IParserRegexConstant.HTML_SAVE_PATH) + File.separator + appId + File.separator; + FileUtil.createFolder(generatePath); + // 网站风格物理路径 + String tmpPath = getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE) + File.separator + appId + File.separator + app.getAppStyle(); + List columns = new ArrayList(); + // 如果栏目id小于0则更新所有的栏目,否则只更新选中的栏目 + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + if (columnId > 0) { + List categorys = columnBiz.queryChildrenCategory(columnId, app.getAppId(),modelId); + for (CategoryEntity c : categorys) { + columns.add((ColumnEntity) columnBiz.getEntity(c.getCategoryId())); + } + } else { + + //获取所有的内容管理栏目 + columns = columnBiz.queryAll(app.getAppId(),modelId); + } + // 获取栏目列表模版 + for (ColumnEntity column : columns) { + String columnPath = null;// pc端 + String mobilePath = null;// 手机端 + + // 生成列表保存路径 + FileUtil.createFolder(generatePath + column.getColumnPath()); + // 判断是否为顶级栏目,进行栏目路径的组合 + if (column.getCategoryCategoryId() == 0) { + FileUtil.createFolder(generatePath + column.getCategoryId()); + columnPath = generatePath + File.separator + column.getCategoryId(); + if (!StringUtil.isBlank(mobileStyle)) { + FileUtil.createFolder(generatePath + mobileStyle + File.separator + column.getCategoryId()); + mobilePath = generatePath + mobileStyle + File.separator + column.getCategoryId(); + } + } else { + if (!StringUtil.isBlank(mobileStyle)) { + mobilePath = generatePath + mobileStyle + File.separator + column.getColumnPath(); + FileUtil.createFolder(mobilePath); + } + columnPath = generatePath + column.getColumnPath(); + } + // 判断列表类型 + switch (column.getColumnType()) { + case ColumnEntity.COLUMN_TYPE_LIST: // 列表 + // 手机列表模版 + if (!StringUtil.isBlank(mobileStyle)) { + FileUtil.createFolder(mobilePath); + String mobileListTtmpContent = FileUtil.readFile(tmpPath + File.separator + mobileStyle + File.separator + column.getColumnListUrl()); + // 如果模版不为空就进行标签替换 + if (!StringUtil.isBlank(mobileListTtmpContent)) { + // 生成手机端模版 + // 要生成手机的静态页面数 + int mobilePageSize = cmsParser.getPageSize(app, mobileListTtmpContent, column); + // 根据页面数,循环生成静态页面个数在 + Map map = new HashMap(); + for (int i = 0; i < mobilePageSize; i++) { + String writePath = mobilePath + File.separator + IParserRegexConstant.PAGE_LIST + (i + 1) + IParserRegexConstant.HTML_SUFFIX; + if (i == 0) { + writePath = mobilePath + File.separator + IParserRegexConstant.HTML_INDEX; + } + String pagePath = url + File.separator + mobileStyle + File.separator + column.getColumnPath() + File.separator + IParserRegexConstant.PAGE_LIST ; + map.put(CmsParser.LIST_LINK_PATH, pagePath); + map.put(CmsParser.CUR_PAGE_NO, i + 1); + map.put(CmsParser.MOBILE,this.MOBILE); + String pageContent = cmsParser.parse(mobileListTtmpContent,app,column,map); + FileUtil.writeFile(pageContent, writePath, FileUtil.URF8);// 写文件 + } + } + + } + + // 读取列表模版地址 + String listTtmpContent = FileUtil.readFile(tmpPath + File.separator + column.getColumnListUrl()); + // 要生成的静态页面数 + int pageSize = cmsParser.getPageSize(app, listTtmpContent, column);// generaterFactory.getPageSize(app, listTtmpContent, column); + // 根据页面数,循环生成静态页面个数在 + Map map = new HashMap(); + for (int i = 0; i < pageSize; i++) { + String writePath = columnPath + File.separator + IParserRegexConstant.PAGE_LIST + (i + 1) + IParserRegexConstant.HTML_SUFFIX; + if (i == 0) { + writePath = columnPath + File.separator + IParserRegexConstant.HTML_INDEX; + } + String pagePath = app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId() + File.separator + column.getColumnPath() + File.separator + "list"; + map.put(CmsParser.LIST_LINK_PATH, pagePath); + map.put(CmsParser.CUR_PAGE_NO, i + 1); + String pageContent = cmsParser.parse(listTtmpContent,app, column,map); + FileUtil.writeFile(pageContent, writePath, FileUtil.URF8);// 写文件 + } + break; + case ColumnEntity.COLUMN_TYPE_COVER:// 单页 + // 取该栏目的最后一篇新闻作为显示内容 + List list = articleBiz.queryListByColumnId(column.getCategoryId()); + // 手机端 + if (!StringUtil.isBlank(mobileStyle)) { + String writePath = ""; + // 读取封面模板内容 + String coverTtmpContent = FileUtil.readFile(tmpPath + File.separator + mobileStyle + File.separator + column.getColumnUrl()); + // 如果模版不为空就进行标签替换 + if (!StringUtil.isBlank(coverTtmpContent)) { + map = new HashMap(); + map.put(CmsParser.MOBILE,this.MOBILE); + // 文章地址前缀 + // 表示该栏目下面没有文章 + if (list == null || list.size() == 0) { + FileUtil.createFolder(mobilePath); + writePath = mobilePath + File.separator + IParserRegexConstant.HTML_INDEX; + + String coverContent = cmsParser.parse(coverTtmpContent,app,column,map); //generaterFactory.builder(app, column, coverTtmpContent, tmpPath, mobileStyle); // 解析标签 + // 取最后一篇文章作为栏目内容 + FileUtil.writeFile(coverContent, writePath, FileUtil.URF8);// 写文件 + break; + } + ArticleEntity article = list.get(0);// 取一篇文章作为封面栏目的内容 + // 判断是否为顶级栏目 + if (column.getCategoryCategoryId() == 0) { + String path = mobilePath + File.separator; + FileUtil.createFolder(path); + writePath = path + File.separator + IParserRegexConstant.HTML_INDEX; + // 设置文章连接地址 + article.setArticleLinkURL(url + File.separator + mobileStyle + File.separator + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + } else {// 子栏目,子栏目需要获取父级栏目的编号 + writePath = mobilePath + File.separator + IParserRegexConstant.HTML_INDEX; + article.setArticleLinkURL(url + File.separator + mobileStyle + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + } + String coverContent = cmsParser.parse(coverTtmpContent,app,column,article,map);//generaterFactory.builderArticle(app, column, article, coverTtmpContent, tmpPath, null, null, mobileStyle); // 解析标签 + // 取最后一篇文章作为栏目内容 + FileUtil.writeFile(coverContent, writePath, FileUtil.URF8);// 写文件 + } + + } + + String writePath = ""; + // 读取封面模板内容 + String coverTtmpContent = FileUtil.readFile(tmpPath + File.separator + column.getColumnUrl()); + // 文章地址前缀 + // 表示该栏目下面没有文章 + if (list == null || list.size() == 0) { + writePath = generatePath + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX; + String coverContent = cmsParser.parse(coverTtmpContent,app,column);//generaterFactory.builder(app, column, coverTtmpContent, tmpPath); // 解析标签 + // 取最后一篇文章作为栏目内容 + FileUtil.writeFile(coverContent, writePath, FileUtil.URF8);// 写文件 + break; + } + ArticleEntity article = list.get(0);// 取一篇文章作为封面栏目的内容 + // 判断是否为顶级栏目 + if (column.getCategoryCategoryId() == 0) { + FileUtil.createFolder(generatePath + column.getCategoryId()); + writePath = generatePath + String.valueOf(column.getCategoryId()) + File.separator + IParserRegexConstant.HTML_INDEX; + // 设置文章连接地址 + article.setArticleLinkURL(url + File.separator + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + } else {// 子栏目,子栏目需要获取父级栏目的编号 + writePath = generatePath + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX; + article.setArticleLinkURL(url + File.separator + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + } + String coverContent = cmsParser.parse(coverTtmpContent,app,column,article);//generaterFactory.builderArticle(app, column, article, coverTtmpContent, tmpPath, null, null); // 解析标签 + // 取最后一篇文章作为栏目内容 + FileUtil.writeFile(coverContent, writePath, FileUtil.URF8);// 写文件 + break; + } + } + return true; + } + + /** + * 更新文档 + * + * @return + */ + @RequestMapping("/article") + public String article(HttpServletRequest request,ModelMap model) { + + // 获取站点ID和模块ID + int websiteId = this.getAppId(request); + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); + + //获取所有的内容管理栏目 + List list = columnBiz.queryAll(websiteId,modelId); + + model.addAttribute("now", new Date()); + model.addAttribute("list", JSONArray.toJSONString(list)); + return "/manager/cms/generate/generate_article"; + } + + /** + * 更新商品 + * + * @return + */ + @RequestMapping("/product") + public String product(HttpServletRequest request) { + request.setAttribute("now", new Date()); + return "/manager/cms/generate/generate_product"; + } + + /** + * 根据栏目id更新所有的文章 + * + * @param request + * @param response + * @param columnId + */ + @RequestMapping("/{columnId}/generateArticle") + @ResponseBody + public boolean generateArticle(HttpServletRequest request, HttpServletResponse response, @PathVariable int columnId) { + String dateTime = request.getParameter("dateTime"); + AppEntity app = this.getApp(request); + String mobileStyle = null; + if (app != null) { + mobileStyle = app.getAppMobileStyle(); // 手机端模版 + } + + String generatePath = getRealPath(request, IParserRegexConstant.HTML_SAVE_PATH) + File.separator + app.getAppId() + File.separator;// 站点生成后保存的html地址 + FileUtil.createFolder(generatePath); + String tmpPath = getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE) + File.separator + app.getAppId() + File.separator + app.getAppStyle(); // 网站风格物理路径 + List articleList = null; + List columns = new ArrayList(); + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + if (columnId > 0) { + List categorys = columnBiz.queryChildrenCategory(columnId, app.getAppId(),modelId); + for (CategoryEntity c : categorys) { + columns.add((ColumnEntity) columnBiz.getEntity(c.getCategoryId())); + } + } else { + columns = columnBiz.queryColumnListByWebsiteId(app.getAppId()); // 读取所有栏目 + } + String url = app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId() + File.separator; // 文章地址前缀 + // 如果没有选择栏目,生成规则 + // 1先读取所有的栏目,从最低级的分类取 + for (ColumnEntity tempColumn : columns) {// 循环分类 + FileUtil.createFolder(generatePath + tempColumn.getColumnPath()); + String writePath = null; + articleList = articleBiz.query(tempColumn.getCategoryId(), dateTime, app.getAppId());// .queryListByColumnId(tempColumn.getCategoryId()); + // 有符合条件的新闻就更新 + if (articleList.size() > 0) { + // 生成文档 + switch (tempColumn.getColumnType()) { + case ColumnEntity.COLUMN_TYPE_LIST: // 列表 + String tmpContent = FileUtil.readFile(tmpPath + File.separator + tempColumn.getColumnUrl());// 读取文章模版地址 + String mobileTmpContent = null; + if (!StringUtil.isBlank(mobileStyle)) { + mobileTmpContent = FileUtil.readFile(tmpPath + File.separator + mobileStyle + File.separator + tempColumn.getColumnUrl());// 读取手机端文章模版地址 + } + for (int ai = 0; ai < articleList.size();) { + ArticleEntity article = articleList.get(ai); + if (tempColumn.getCategoryCategoryId() == 0) { // 如果是顶级下面有文章,那么文章的生成地址就是 分类id/文章编号 + FileUtil.createFolder(generatePath + tempColumn.getCategoryId()); + // 组合文章路径如:html/站点id/栏目id/文章id.html + writePath = generatePath + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX; + article.setArticleLinkURL(url + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } else { // 如果有父级别编号,需要组合路径。格式如:父ID/子id/文章id.html + String path = File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX; + writePath = generatePath + tempColumn.getColumnPath() + File.separator + path; + article.setArticleLinkURL(url + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + ArticleEntity previous = articleBiz.getPrevious(app.getAppId(), article.getArticleID(),article.getBasicCategoryId());// 上一篇文章 + ArticleEntity next = articleBiz.getNext(app.getAppId(), article.getArticleID(),article.getBasicCategoryId());// 下一篇文章 + if(article.getColumn()!=null){ + if (previous != null) { + previous.setArticleLinkURL(url + article.getColumn().getColumnPath() + File.separator + previous.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + if (next != null) { + next.setArticleLinkURL(url + article.getColumn().getColumnPath() + File.separator + next.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + } + + Map map = new HashMap(); + map.put(CmsParser.PREVIOUS, previous); + map.put(CmsParser.NEXT, next); + + String content = cmsParser.parse(tmpContent,app,tempColumn,article,map); + FileUtil.writeFile(content, writePath, FileUtil.URF8);// 写文件 + + // 手机端 + if (!StringUtil.isBlank(mobileTmpContent)) { + FileUtil.createFolder(generatePath + mobileStyle + File.separator + tempColumn.getColumnPath()); + if (tempColumn.getCategoryCategoryId() == 0) { // 如果是顶级下面有文章,那么文章的生成地址就是 分类id/文章编号 + + // 组合文章路径如:html/站点id/栏目id/文章id.html + writePath = generatePath + mobileStyle + File.separator + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX; + article.setArticleLinkURL(url + mobileStyle + File.separator + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } else { // 如果有父级别编号,需要组合路径。格式如:父ID/子id/文章id.html + String path = File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX; + writePath = generatePath + mobileStyle + File.separator + tempColumn.getColumnPath() + File.separator + path; + article.setArticleLinkURL(url + mobileStyle + File.separator + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + if(article.getColumn()!=null){ + if (previous != null) { + previous.setArticleLinkURL(url + mobileStyle + File.separator + article.getColumn().getColumnPath() + File.separator + previous.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + if (next != null) { + next.setArticleLinkURL(url + mobileStyle + File.separator + article.getColumn().getColumnPath() + File.separator + next.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + } + + map.put(CmsParser.MOBILE,this.MOBILE); + String tmp = cmsParser.parse(mobileTmpContent,app,tempColumn,article,map);//;generaterFactory.builderArticle(app, tempColumn, article, mobileTmpContent, tmpPath, previous, next, mobileStyle); // 解析标签 + FileUtil.writeFile(tmp, writePath, FileUtil.URF8);// 写文件 + } + + ai++; + + } + break; + // case ColumnEntity.COLUMN_TYPE_COVER:// 单页 + // writePath = null; + // // 取该栏目的最后一篇新闻作为显示内容 + // List list = + // articleBiz.queryListByColumnId(tempColumn.getCategoryId()); + // + // String coverTtmpContent = FileUtil.readFile(tmpPath + + // File.separator + tempColumn.getColumnUrl());// 读取文章模版地址 + // if (list == null || list.size() == 0) { // 表示该栏目下面没有文章 + // break; + // } + // ArticleEntity article = list.get(0);// 取一篇文章作为封面栏目的内容 + // // 判断是否 顶级栏目 + // if (tempColumn.getCategoryCategoryId() == 0) { + // FileUtil.createFolder(generatePath + + // tempColumn.getCategoryId()); + // writePath = generatePath + + // String.valueOf(tempColumn.getCategoryId()) + File.separator + + // RegexConstant.HTML_INDEX; + // // 设置文章连接地址 + // article.setArticleLinkURL(url + tempColumn.getColumnPath() + + // File.separator + RegexConstant.HTML_INDEX); + // } else {// 子栏目,子栏目需要获取父级栏目的编号 + // writePath = generatePath + tempColumn.getColumnPath() + + // File.separator + RegexConstant.HTML_INDEX; + // article.setArticleLinkURL(url + tempColumn.getColumnPath() + + // File.separator + RegexConstant.HTML_INDEX); + // } + // + // String coverContent = generaterFactory.builderArticle(app, + // tempColumn, article, coverTtmpContent, tmpPath, null, null); + // // 解析标签 + // + // FileUtil.writeFile(coverContent, writePath, FileUtil.URF8);// + // 写文件 + // + // //移动端 + // if (!StringUtil.isBlank(mobileStyle)) { + // String temContent = FileUtil.readFile(tmpPath + + // File.separator + mobileStyle + File.separator + + // tempColumn.getColumnUrl());// 读取文章模版地址 + // if (list == null || list.size() == 0) { // 表示该栏目下面没有文章 + // break; + // } + // // 判断是否 顶级栏目 + // if (tempColumn.getCategoryCategoryId() == 0) { + // FileUtil.createFolder(generatePath + mobileStyle + + // File.separator + tempColumn.getCategoryId()); + // writePath = generatePath +mobileStyle+ File.separator + + // String.valueOf(tempColumn.getCategoryId()) + File.separator + + // RegexConstant.HTML_INDEX; + // // 设置文章连接地址 + // article.setArticleLinkURL(url + File.separator + mobileStyle + // + tempColumn.getColumnPath() + File.separator + + // RegexConstant.HTML_INDEX); + // } else {// 子栏目,子栏目需要获取父级栏目的编号 + // writePath = generatePath +mobileStyle+ File.separator + + // tempColumn.getColumnPath() + File.separator + + // RegexConstant.HTML_INDEX; + // FileUtil.createFolder(generatePath + mobileStyle + + // File.separator + tempColumn.getColumnPath()); + // article.setArticleLinkURL(url + File.separator + mobileStyle + // + tempColumn.getColumnPath() + File.separator + + // RegexConstant.HTML_INDEX); + // } + // + // String temp = generaterFactory.builderArticle(app, + // tempColumn, article, coverTtmpContent, tmpPath, null, + // null,mobileStyle); // 解析标签 + // + // FileUtil.writeFile(temp, writePath, FileUtil.URF8);// 写文件 + // } + // + // + // break; + } + } + + /* + * else { switch (tempColumn.getColumnType()) { case + * ColumnEntity.COLUMN_TYPE_COVER: String coverTtmpContent = + * FileUtil.readFile(tmpPath + File.separator + + * tempColumn.getColumnUrl()); if + * (tempColumn.getCategoryCategoryId() == 0) { // 顶级栏目 + * FileUtil.createFolder(generatePath + tempColumn.getCategoryId()); + * } writePath = generatePath + tempColumn.getColumnPath() + + * File.separator + RegexConstant.HTML_INDEX; String coverContent = + * generaterFactory.builderIndex(app, tempColumn, coverTtmpContent, + * tmpPath); // 解析标签 // 取最后一篇文章作为栏目内容 + * FileUtil.writeFile(coverContent, writePath, FileUtil.URF8);// 写文件 + * break; } } + */ + } + return true; + } + + /** + * 提供给保存与编辑文章时使用 + * + * @param request + * @param response + * @param columnId + *  栏目编号 + */ + @RequestMapping("/{columnId}/genernateForArticle") + @ResponseBody + public void genernateForArticle(HttpServletResponse response, HttpServletRequest request, @PathVariable int columnId) { + // 生成html + // 1、更新文章 + Map parms = new HashMap(); + parms.put("dateTime", StringUtil.getSimpleDateStr(new Date(), "yyyy-MM-dd")); + Header header = new Header(this.getHost(request), Const.UTF8); + String cookie = ""; + for (Cookie c : request.getCookies()) { + cookie += c.getName() + "=" + c.getValue() + ";"; + } + header.setCookie(cookie); + Result re = Proxy.get(this.getUrl(request) + "/manager/cms/generate/" + columnId + "/generateArticle.do", header, parms, Const.UTF8); + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(columnId); + if (column != null && column.getColumnType() == ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()) { + Proxy.get(this.getUrl(request) + "/manager/cms/generate/" + columnId + "/genernateColumn.do", header, null, Const.UTF8); + } + // 2、更新栏目 + // Proxy.get(this.getUrl(request)+"/manager/cms/generate/"+columnId+"/genernateColumn.do", + // header, null, Const.UTF8); + + // 3主 + Map map = new HashMap(); + map.put("url", IParserRegexConstant.REGEX_INDEX_HTML); + map.put("position", IParserRegexConstant.HTML_INDEX); + Proxy.get(this.getUrl(request) + "/manager/cms/generate/generateIndex.do", header, map, Const.UTF8); + + this.outJson(response, ModelCode.CMS_GENERATE_ARTICLE, true); + } + + /** + * 根据栏目id更新所有的文章 + * + * @param request + * @param response + * @param columnId + */ + @RequestMapping("/{articleId}/generateArticleByArticleId") + @ResponseBody + public boolean generateArticleByArticleId(HttpServletRequest request, HttpServletResponse response, @PathVariable int articleId) { + AppEntity app = this.getApp(request); + String generatePath = getRealPath(request, IParserRegexConstant.HTML_SAVE_PATH) + File.separator + app.getAppId() + File.separator;// 站点生成后保存的html地址 + FileUtil.createFolder(generatePath); + String tmpPath = getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE) + File.separator + app.getAppId() + File.separator + app.getAppStyle(); // 网站风格物理路径 + String url = app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId() + File.separator; // 文章地址前缀 + ArticleEntity article = (ArticleEntity) articleBiz.getBasicEntity(articleId); + ColumnEntity tempColumn = article.getColumn(); + FileUtil.createFolder(generatePath + tempColumn.getColumnPath()); + String writePath = null; + + // // + // 根据栏目获取文章列表 + // 生成文档 + switch (tempColumn.getColumnType()) { + case ColumnEntity.COLUMN_TYPE_LIST: // 列表 + String tmpContent = FileUtil.readFile(tmpPath + File.separator + tempColumn.getColumnUrl());// 读取文章模版地址 + ArticleEntity previous = articleBiz.getPrevious(tempColumn.getCategoryAppId(), articleId,article.getBasicCategoryId()); + if (previous != null) { + previous.setArticleLinkURL(url + tempColumn.getColumnPath() + File.separator + previous.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + ArticleEntity next = articleBiz.getNext(tempColumn.getCategoryAppId(), articleId,article.getBasicCategoryId()); + if (next != null) { + next.setArticleLinkURL(url + tempColumn.getColumnPath() + File.separator + next.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + + //生成页面 + Map map = new HashMap(); + map.put(CmsParser.PREVIOUS, previous); + map.put(CmsParser.NEXT, next); + String content = cmsParser.parse(tmpContent,app,tempColumn,article,map); + + if (tempColumn.getCategoryCategoryId() == 0) { // 如果是顶级下面有文章,那么文章的生成地址就是 分类id/文章编号 + FileUtil.createFolder(generatePath + tempColumn.getCategoryId()); + // 组合文章路径如:html/站点id/栏目id/文章id.html + writePath = generatePath + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX; + article.setArticleLinkURL(url + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } else { // 如果有父级别编号,需要组合路径。格式如:父ID/子id/文章id.html + String path = File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX; + writePath = generatePath + tempColumn.getColumnPath() + File.separator + path; + article.setArticleLinkURL(url + tempColumn.getColumnPath() + File.separator + article.getArticleID() + IParserRegexConstant.HTML_SUFFIX); + } + FileUtil.writeFile(content, writePath, FileUtil.URF8);// 写文件 + break; + case ColumnEntity.COLUMN_TYPE_COVER:// 单页 + writePath = null; + // 取该栏目的最后一篇新闻作为显示内容 + List list = articleBiz.queryListByColumnId(tempColumn.getCategoryId()); + + String coverTtmpContent = FileUtil.readFile(tmpPath + File.separator + tempColumn.getColumnUrl());// 读取文章模版地址 + if (list == null || list.size() == 0) { // 表示该栏目下面没有文章 + break; + } + // 判断是否 顶级栏目 + if (tempColumn.getCategoryCategoryId() == 0) { + FileUtil.createFolder(generatePath + tempColumn.getCategoryId()); + writePath = generatePath + String.valueOf(tempColumn.getCategoryId()) + File.separator + IParserRegexConstant.HTML_INDEX; + // 设置文章连接地址 + article.setArticleLinkURL(url + tempColumn.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + } else {// 子栏目,子栏目需要获取父级栏目的编号 + writePath = generatePath + tempColumn.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX; + article.setArticleLinkURL(url + tempColumn.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + } + + //生成页面 + String coverContent = cmsParser.parse(coverTtmpContent,app,tempColumn,article); + // 取最后一篇文章作为栏目内容 + FileUtil.writeFile(coverContent, writePath, FileUtil.URF8);// 写文件 + break; + } + return true; + } + + /** + * 更新栏目 + * + * @return + */ + @RequestMapping("/column") + public String column(HttpServletRequest request,ModelMap model) { + // 该站点ID有session提供 + int websiteId = this.getAppId(request); + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + //获取所有的内容管理栏目 + List list = columnBiz.queryAll(websiteId,modelId); + model.addAttribute("list", JSONArray.toJSONString(list)); + return "/manager/cms/generate/generate_column"; + } + + /** + * 用户预览主页 + * @param request + * @return + */ + @RequestMapping("/{position}/viewIndex") + public String viewIndex(HttpServletRequest request, @PathVariable String position) { + //获取应用实体信息 + AppEntity app = this.getApp(request); + //组织主页预览地址 + String indexPosition = app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId() + File.separator + position; + return "redirect:" + indexPosition; + } + +} diff --git a/src/main/java/com/mingsoft/cms/action/SearchAction.java b/src/main/java/com/mingsoft/cms/action/SearchAction.java new file mode 100644 index 00000000..33fb5d9e --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/SearchAction.java @@ -0,0 +1,295 @@ +package com.mingsoft.cms.action; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.biz.ISearchBiz; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.FieldEntity; +import com.mingsoft.cms.entity.SearchEntity; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:搜索控制层,继承BasicAction + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/cms/search") +public class SearchAction extends BaseAction { + + /** + * 栏目业务层 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 字段业务层 + */ + @Autowired + private IFieldBiz fieldBiz; + + /** + * 搜索业务层 + */ + @Autowired + private ISearchBiz searchBiz; + + /** + * 搜索列表路径 + */ + private final static String PAGE_URL = "/manager/cms/search/list.do"; + + /** + * 跳转至创建搜索页面 + * @param model + * @param request 请求 + * @return 返回页面 + */ + @RequestMapping("/add") + public String add(ModelMap model ,HttpServletRequest request){ + List columnList = columnBiz.queryColumnListByWebsiteId(getManagerBySession(request).getBasicId()); + model.addAttribute("columnList", JSONObject.toJSON(columnList).toString()); + model.addAttribute("flag", true); + return "/manager/cms/search/search"; + } + + /** + * 查询栏目自定义的字段名 + * @param columnId 栏目ID + * @param model + * @param request 请求 + */ + @RequestMapping("/{columnId}/queryFieldName") + @ResponseBody + public Map queryFieldName(@PathVariable int columnId, HttpServletRequest request){ + Map model = new HashMap(); + // 获取栏目信息 + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(columnId); + if(column!=null){ + //获取表单类型的id + int fieldCmid = column.getColumnContentModelId(); + // 根据表单类型id查找出所有的字段信息 + List listField = fieldBiz.queryListByCmid(fieldCmid); + model.put("listField",listField); + } + return model; + } + + /** + * 验证表单提交数据 + * @param search 搜索 + * @param response + * @return 返回提示信息 + */ + private boolean validateForm(SearchEntity search,HttpServletResponse response){ + if(!StringUtil.checkLength(search.getSearchName(), 1,30)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("searchName"),"1","30")); + return false; + } + if(!StringUtil.checkLength(search.getSearchTemplets(), 1,30)){ + this.outJson(response, null, false,getResString("err.length",this.getResString("searchTemplets"),"1","30")); + return false; + } + return true; + } + + /** + * 保存搜索表单 + * @param search 搜索实体 + * @param request 请求 + * @param response 响应 + */ + @RequestMapping("/save") + public void save(@ModelAttribute SearchEntity search,HttpServletRequest request,HttpServletResponse response){ + if(this.validateForm(search, response)){ + ManagerSessionEntity managerSession = getManagerBySession(request); + search.setSearchWebsiteId(managerSession.getBasicId()); + searchBiz.saveEntity(search); + this.outJson(response, null, true, String.valueOf(search.getSearchId())); + } + } + + /** + * 生成搜索表单的html样式 + * @param model + * @param request 请求 + * @return 返回html样式 + */ + @RequestMapping("/generateSreachFormHtml") + public String generateSreachFormHtml(ModelMap model, HttpServletRequest request){ + ManagerSessionEntity managerSession = getManagerBySession(request); + int searchId = 0; + if(!StringUtil.isBlank(request.getParameter("searchId"))){ + searchId = Integer.valueOf(request.getParameter("searchId")); + } + //获取页面勾选的字段信息 + Map field = new HashMap(); + field = request.getParameterMap(); + int basicCategoryId = 0; + int cmId = 0; + Map articleField = getMapByProperties("com/mingsoft/cms/resources/article_field"); + Map articleType = getMapByProperties("com/mingsoft/cms/resources/article_attribute"); + List> listFieldName = new ArrayList>(); + for(Entry entry : field.entrySet()){ + String key = entry.getKey(); + String value = entry.getValue()[0]; + if(key.equals("columnId") && !StringUtil.isBlank(value) && !key.equals("searchId")){ + basicCategoryId = Integer.valueOf(value); + } + if(!key.equals("columnId") && !key.equals("searchId")){ + Map map = new HashMap(); + map.put("name", key); + map.put("type", value); + //若为文章字段则直接取配置文件;若为自定义字段,则取数据库值 + if(!StringUtil.isBlank(articleField.get(key))){ + map.put("ch", articleField.get(key)); + } else { + //若栏目ID不为0,则选择了栏目 + if(basicCategoryId != 0){ + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(Integer.valueOf(basicCategoryId)); + //获取表单类型的id + cmId = column.getColumnContentModelId(); + } + FieldEntity fieldEntity = (FieldEntity) fieldBiz.getEntityByCmId(cmId,key); + if(!StringUtil.isBlank(fieldEntity)){ + String fieldTipsName = fieldEntity.getFieldTipsName(); + map.put("ch", fieldTipsName); + } + } + if(key.equals("article_type")){ + map.put("default", articleType.toString()); + } else { + map.put("default", key.toString()); + } + listFieldName.add(map); + } + } + model.addAttribute("searchId", searchId); + model.addAttribute("websiteId", managerSession.getBasicId()); + model.addAttribute("listFieldName", listFieldName); + model.addAttribute("basicCategoryId",basicCategoryId); + return "manager/cms/search/search_field"; + } + + + + /** + * 搜索列表 + * @param model + * @param request 请求 + */ + @RequestMapping("/list") + public String list(ModelMap model, HttpServletRequest request){ + int appId = this.getAppId(request); + //当前页数 + Integer pageNo = this.getInt(request, "pageNo",1); + int recordCount = searchBiz.queryCount(appId); + PageUtil page = new PageUtil(pageNo,recordCount, getUrl(request) + PAGE_URL); + List searchList = searchBiz.query(appId, page); + model.addAttribute("searchList",searchList); + model.addAttribute("page", page); + return "manager/cms/search/search_list"; + } + + /** + * 删除搜索 + * @param roleId ID + * @param response 响应 + */ + @RequestMapping("/{searchId}/delete") + @ResponseBody + public int delete(@PathVariable int searchId, HttpServletRequest request){ + int pageNo = 1; + if(searchId != 0){ + searchBiz.deleteEntity(searchId); + //判断当前页码 + this.getHistoryPageNoByCookie(request); + } + return pageNo; + } + + /** + * 更新搜索 + * @param request 请求 + * @return 返回更新搜索页面 + */ + @RequestMapping("/{searchId}/edit") + public String edit(@PathVariable int searchId,ModelMap model,HttpServletRequest request){ + if(searchId == 0){ + return "/manager/searchId/list"; + } + List columnList = columnBiz.queryColumnListByWebsiteId(getManagerBySession(request).getBasicId()); + model.addAttribute("columnList", JSONObject.toJSON(columnList).toString()); + SearchEntity search = (SearchEntity)searchBiz.getEntity(searchId); + model.addAttribute("search",search); + model.addAttribute("flag", false); + return "/manager/cms/search/search"; + + } + + /** + * 保存搜索表单 + * @param search 搜索实体 + * @param request 请求 + * @param response 响应 + */ + @RequestMapping("/update") + public void update(@ModelAttribute SearchEntity search,HttpServletRequest request,HttpServletResponse response){ + if(this.validateForm(search, response)){ + searchBiz.updateEntity(search); + this.outJson(response, null, true,null); + } + } +} diff --git a/src/main/java/com/mingsoft/cms/action/TempletsAction.java b/src/main/java/com/mingsoft/cms/action/TempletsAction.java new file mode 100644 index 00000000..5daae327 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/TempletsAction.java @@ -0,0 +1,380 @@ +package com.mingsoft.cms.action; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.mingsoft.basic.action.BaseAction; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.ManagerSessionEntity; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:获取有关模版文件夹或模版文件信息 + *

+ * + *

+ * Create Date:2014-8-12 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/cms/templet") +public class TempletsAction extends BaseAction { + + /** + * 站点业务层 + */ + @Autowired + private IAppBiz appBiz; + + /** + * 模版列表分页路径 + */ + private final static String SKINLIST_PAGE_URL = "/manager/cms/templet/queryTempletSkin.do"; + + /** + * 查询模版风格供站点选择 + * @param model + * @param request 请求 + * @return 模版文件集合 + */ + @RequestMapping("/queryAppTempletSkin") + @ResponseBody + public Map queryAppTempletSkin(HttpServletRequest request){ + List folderNameList = (List) this.queryTempletsFile( request); + Map map = new HashMap(); + if(!StringUtil.isBlank(folderNameList)){ + map.put("fileName", folderNameList); + } + return map; + } + + /** + * 查询模版文件供栏目选择 + * @param request 请求 + * @return 返回列表集合 + */ + @RequestMapping("/queryTempletFileForColumn") + @ResponseBody + public List queryTempletFileForColumn(HttpServletRequest request){ + ManagerSessionEntity managerSession = getManagerBySession(request); + String path = this.getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE)+File.separator + managerSession.getBasicId(); + int websiteId = managerSession.getBasicId(); + AppEntity website = (AppEntity) appBiz.getEntity(websiteId); + path =path+File.separator+website.getAppStyle(); + LOG.debug("tempPath:"+ path); + List listName= new ArrayList(); + File fileDir=new File(path); + if(fileDir.isDirectory()){ + File files[]=fileDir.listFiles(); + for(int i=0;i folderNameList = this.queryTempletsFile( request); + model.addAttribute("folderNameList", folderNameList); + model.addAttribute("websiteId", managerSession.getBasicId()); + int recordCount = 0; + if(!StringUtil.isBlank(folderNameList)){ + recordCount = folderNameList.size(); + } + PageUtil page = new PageUtil(StringUtil.string2Int(pageNo),recordCount, getUrl(request) + SKINLIST_PAGE_URL); + this.setCookie(request, response, CookieConst.PAGENO_COOKIE, pageNo); + model.addAttribute("page", page); + return "/manager/cms/templets/templets_list"; + } + + /** + * 解压zip模版文件 + * @param fileUrl 文件路径 + * @throws ZipException + * @throws IOException + */ + @RequestMapping("/unZip") + @ResponseBody + public String unZip(ModelMap model, HttpServletRequest request) throws ZipException, IOException { + String entryName = ""; + String fileUrl = request.getParameter("fileUrl"); + // 创建文件对象 + File file = new File(this.getRealPath(request, fileUrl)); + // 创建zip文件对象 + ZipFile zipFile = new ZipFile(file); + // 创建本zip文件解压目录 + File unzipFile = new File(this.getRealPath(request, fileUrl.substring( 0, fileUrl.length() - file.getName().length()))); + // 得到zip文件条目枚举对象 + Enumeration zipEnum = zipFile.entries(); + // 定义输入输出流对象 + // 循环读取条目 + while (zipEnum.hasMoreElements()) { + // 得到当前条目 + ZipEntry entry = (ZipEntry) zipEnum.nextElement(); + entryName = new String(entry.getName().getBytes("utf-8")); + // 若当前条目为目录则创建 + if (entry.isDirectory()) { + new File(unzipFile.getAbsolutePath() + File.separator + entryName).mkdirs(); + } else { + // 若当前条目为文件则解压到相应目录 + InputStream input = zipFile.getInputStream(entry); + OutputStream output = new FileOutputStream(new File( unzipFile.getAbsolutePath() + File.separator + entryName)); + byte[] buffer = new byte[1024 * 8]; + int readLen = 0; + while ((readLen = input.read(buffer, 0, 1024 * 8)) != -1) { + output.write(buffer, 0, readLen); + } + output.flush(); + output.close(); + input.close(); + input =null; + output = null; + } + } + zipFile.close(); + return entryName; + } + + + /** + * 删除模版 + * @param name 模版名称 + * @param request 请求 + * @param response 响应 + */ + @RequestMapping("/{websiteId}/{name}/delete") + @ResponseBody + public boolean delete(@PathVariable int websiteId, @PathVariable String name, HttpServletRequest request) { + String path = this.getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + websiteId + File.separator + name + File.separator); + try { + FileUtil.delFolders(path); + FileUtil.delFile(path); + return true; + } catch (Exception e) { + // TODO: handle exception + return false; + } + } + + /** + * 获取模版路径 + * @param request 请求 + * @param fileNameUrl 文件路径 + * @return 返回路径 + */ + private String getTempletsUrl( HttpServletRequest request, String fileNameUrl){ + ManagerSessionEntity managerSession = getManagerBySession(request); + String templetsUrl = this.getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + managerSession.getBasicId() + File.separator + fileNameUrl); + return templetsUrl; + } + + /** + * 显示子文件和子文件夹 + * @param response 响应 + * @param model + * @param request 请求 + * @return 返回文件名集合 + */ + @RequestMapping("/showChildFileAndFolder") + public String showChildFileAndFolder(HttpServletResponse response, ModelMap model, HttpServletRequest request){ + ManagerSessionEntity managerSession = getManagerBySession(request); + List folderNameList = null; + String skinFolderName = request.getParameter("skinFolderName"); + String templetsUrl = this.getTempletsUrl(request, skinFolderName); + File files[] = new File(templetsUrl).listFiles(); + if(!StringUtil.isBlank(files)){ + folderNameList = new ArrayList(); + List fileNameList = new ArrayList(); + for (int i = 0; i < files.length; i++) { + File currFile = files[i]; + if(currFile.isDirectory()){ + folderNameList.add(currFile.toString().substring(currFile.toString().indexOf(skinFolderName))); + }else { + fileNameList.add(currFile.toString().substring(currFile.toString().indexOf(skinFolderName))); + } + } + folderNameList.addAll(fileNameList); + model.addAttribute("fileNameList", folderNameList); + } + String uploadFileUrl = managerSession.getBasicId() + File.separator + skinFolderName; + uploadFileUrl = uploadFileUrl.replace(File.separator + File.separator , File.separator ); + model.addAttribute("uploadFileUrl", uploadFileUrl); + return "/manager/cms/templets/templets_file_list"; + } + + /** + * 读取模版文件内容 + * @param model + * @param request 请求 + * @return 返回文件内容 + */ + @RequestMapping("/readFileContent") + public String readFileContent(ModelMap model, HttpServletRequest request){ + String fileName = request.getParameter("fileName"); + if (!StringUtil.isBlank(fileName)) { + String templets = this.getTempletsUrl(request, fileName); + model.addAttribute("fileContent", FileUtil.readFile(templets)); + } + model.addAttribute("fileName", fileName.substring(fileName.lastIndexOf(File.separator)+1)); + model.addAttribute("fileNamePrefix", fileName.substring(0,fileName.lastIndexOf(File.separator)+1)); + return "/manager/cms/templets/templets_edit_file"; + } + + /** + * 删除模版文件 + * @param styleName 文件名称 + * @param request 请求 + */ + @RequestMapping("/deleteTempletsFile") + @ResponseBody + public int deleteTempletsFile(HttpServletRequest request) { + int pageNo = 1; + ManagerSessionEntity managerSession = getManagerBySession(request); + String fileName = request.getParameter("fileName"); + FileUtil.delFile(this.getRealPath(request,IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + managerSession.getBasicId() + File.separator + fileName)); + // 判断当前页码 + this.getHistoryPageNoByCookie(request); + return pageNo; + } + + /** + * 写入模版文件内容 + * @param model + * @param request 请求 + * @param response 响应 + * @throws IOException + */ + @RequestMapping("/writeFileContent") + public void writeFileContent(ModelMap model, HttpServletRequest request,HttpServletResponse response) throws IOException { + String fileName = request.getParameter("fileName"); + String oldFileName = request.getParameter("oldFileName"); + String fileContent = request.getParameter("fileContent"); + String fileNamePrefix = request.getParameter("fileNamePrefix"); + ManagerSessionEntity managerSession = getManagerBySession(request); + if (!StringUtil.isBlank(fileName)) { + // 文件路径 + String templets = this.getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + managerSession.getBasicId() + File.separator + fileNamePrefix + fileName); + FileUtil.writeFile(fileContent, templets, "utf-8"); + if(!fileName.equals(oldFileName)){ + //得到一个待命名文件对象 + File newName = new File(templets); + //获取新名称文件的文件对象 + File oldName = new File(this.getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + managerSession.getBasicId() + File.separator + fileNamePrefix + oldFileName)); + //进行重命名 + oldName.renameTo(newName); + FileUtil.delFile(fileNamePrefix+oldFileName); + } + this.outJson(response, ModelCode.ROLE, true, null); + } + } + + + /** + * 查询模版文件集合 + * @param request 请求 + * @return 模版文件集合 + */ + private List queryTempletsFile(HttpServletRequest request){ + ManagerSessionEntity managerSession = getManagerBySession(request); + List folderNameList = null; + if (!isSystemManager(request)) { + String templets = this.getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + managerSession.getBasicId() + File.separator); + File file = new File(templets); + String[] str = file.list(); + if (!StringUtil.isBlank(str)) { + folderNameList = new ArrayList(); + for (int i = 0; i < str.length; i++) { + // 避免不为文件夹的文件显示 + if (str[i].indexOf(".") < 0) { + folderNameList.add(str[i]); + } + } + } + } + return folderNameList; + } + +} diff --git a/src/main/java/com/mingsoft/cms/action/api/ArticleAction.java b/src/main/java/com/mingsoft/cms/action/api/ArticleAction.java new file mode 100644 index 00000000..641d7758 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/api/ArticleAction.java @@ -0,0 +1,84 @@ +package com.mingsoft.cms.action.api; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.entity.ListJson; +import com.mingsoft.cms.biz.IArticleBiz; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 史爱华 + * + * + *

+ * Comments: 前段文章控制,如果标签不能满足可以使用这个控制来满足用户的查询文章需求,主要是通过ajax返回json数据格式 + *

+ * + *

+ * Create Date:2014-10-15 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller("api") +@RequestMapping("api/article") +public class ArticleAction extends BaseAction { + + + /** + * 文章管理业务处理层 + */ + @Autowired + private IArticleBiz articleBiz; + + + /** + * 查询文章列表信息,供前端ajax请求文章数据使用 + * @param request + * @param response + */ + @RequestMapping(value="/list",method=RequestMethod.POST) + @ResponseBody + public void list(HttpServletRequest request, HttpServletResponse response) { + String isHasChilds = request.getParameter("isHasChilds"); //是否取子类信息 + Integer pageNo = this.getInt(request, "pageNo",1);//分页 + Integer pageSize = this.getInt(request, "pageSize",10);//分页数量 + Integer categoryId = this.getInt(request, "categoryId");//分类 + int appId = getAppId(request); + boolean _isHasChilds = false; //true取子栏目,false取当前栏目 + if (!StringUtil.isBlank(isHasChilds) && isHasChilds.equals("true")) { + _isHasChilds = true; + } + int count =articleBiz. coutByCategoryAndChildsId(appId,categoryId,_isHasChilds); + PageUtil page=new PageUtil(pageNo,pageSize,count,getUrl(request)+"/list.do"); + List list = articleBiz.queryByCategoryForBean(appId,categoryId, page, _isHasChilds); + ListJson json = new ListJson(count,list); + this.outJson(response, JSONObject.toJSONStringWithDateFormat(json,"yyyy-MM-dd HH:mm:ss")); + } + +} diff --git a/src/main/java/com/mingsoft/cms/action/web/ArticleAction.java b/src/main/java/com/mingsoft/cms/action/web/ArticleAction.java new file mode 100644 index 00000000..f0693ded --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/web/ArticleAction.java @@ -0,0 +1,208 @@ +package com.mingsoft.cms.action.web; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.entity.ListJson; +import com.mingsoft.cms.biz.IArticleBiz; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 + * QQ:78750478 + * + *

+ * Comments: 前段文章控制,如果标签不能满足可以使用这个控制来满足用户的查询文章需求,主要是通过ajax返回json数据格式 + *

+ * + *

+ * Create Date:2014-10-15 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller("jsonApiArticle") +@RequestMapping("/article") +public class ArticleAction extends BaseAction{ + + /** + * 文章管理业务处理层 + */ + @Autowired + private IArticleBiz articleBiz; + + + /** + * 自定义字段管理业务处理层 + */ + @Autowired + private IFieldBiz fieldBiz; + + /** + * 栏目管理业务处理层 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 内容模型管理业务处理层 + */ + @Autowired + private IContentModelBiz contentModelBiz; + + @RequestMapping("/list") + @ResponseBody + public void list(HttpServletRequest request, HttpServletResponse response) { + String pageNo = request.getParameter("pageNo"); //分页 + String pageSize = request.getParameter("pageSize"); //分页数量 + String categoryId = request.getParameter("categoryId"); //分类 + String isHasChilds = request.getParameter("isHasChilds"); //是否取子类信息 + + if (!StringUtil.isInteger(pageNo)) { + pageNo = "1"; + } + int _pageSize = 10; + if (StringUtil.isInteger(pageSize)) { + _pageSize = Integer.parseInt(pageSize); + } + int _categoryId = Integer.parseInt(categoryId); + + boolean _isHasChilds = false; //true取子栏目,false取当前栏目 + if (!StringUtil.isBlank(isHasChilds) && isHasChilds.equals("true")) { + _isHasChilds = true; + } + + int count = articleBiz.countByCategoryId(_categoryId); + PageUtil page=new PageUtil(Integer.parseInt(pageNo),_pageSize,count,getUrl(request)+"/list.do"); +// categoryBiz.queryChilds(_categoryId); + List list = articleBiz.queryPageByCategoryId(_categoryId,this.getAppId(request), page,_isHasChilds); + ListJson json = new ListJson(count,list); + this.outJson(response, JSONObject.toJSONString(json)); + } + + + /** + * + * 显示文章 + * @param request + * @param response + */ + @RequestMapping("/{basicId}/detail") + @ResponseBody + public void detail(@PathVariable int basicId,HttpServletRequest request, HttpServletResponse response) { + if (basicId<=0) { + this.outJson(response, this.getResString("err")); + } + ArticleEntity map = articleBiz.getById(basicId); + + this.outJson(response, JSONObject.toJSONString(map)); + } + + /** + * + * 显示文章 + * @param request + * @param response + */ + @RequestMapping("/{basicId}/fieldDetail") + @ResponseBody + public void fieldDetail(@PathVariable int basicId,HttpServletRequest request, HttpServletResponse response){ + if (basicId<=0) { + this.outJson(response, this.getResString("err")); + } + //获取文章实体 + ArticleEntity article = articleBiz.getById(basicId); + //判断文章是否存在 + if(article==null){ + this.outJson(response, this.getResString("err")); + } + //获取文章栏目id获取栏目实体 + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId()); + //判断栏目是否存在 + if(column==null){ + this.outJson(response, this.getResString("err")); + } + //判断该栏目是否存在类型模型 + if(column.getColumnContentModelId()==0){ + this.outJson(response, this.getResString("err")); + } + ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz.getEntity(column.getColumnContentModelId()); + + //判断内容模型的值 + if(contentModel==null){ + this.outJson(response, this.getResString("err")); + } + Map where = new HashMap(); + // 压入basicId字段的值 + where.put("basicId", basicId); + // 遍历所有的字段实体,得到字段名列表信息 + List listFieldName = new ArrayList(); + listFieldName.add("basicId"); + // 查询新增字段的信息 + List fieldLists = fieldBiz.queryBySQL(contentModel.getCmTableName(), listFieldName, where); + if (fieldLists != null || fieldLists.size()>0) { + Map map = (Map)fieldLists.get(0); + //返回信息 + this.outJson(response, JSONObject.toJSONString(map)); + } + + } + + /** + * 点击量 + * @param basicId 数据编号 + * @param request + * @param response + */ + @RequestMapping("/{basicId}/hit") + @ResponseBody + public void hit(@PathVariable int basicId,HttpServletRequest request, HttpServletResponse response) { + if (basicId<=0) { + this.outJson(response, this.getResString("err")); + } + //获取文章实体 + ArticleEntity article = articleBiz.getById(basicId); + //判断文章是否存在 + if(article==null){ + this.outJson(response, this.getResString("err")); + } + if (article.getBasicAppId()!=this.getAppId(request)) { + this.outJson(response, this.getResString("err")); + } + article.setBasicHit(article.getBasicHit()+1); + articleBiz.updateEntity(article); + } +} diff --git a/src/main/java/com/mingsoft/cms/action/web/DynamicPageAction.java b/src/main/java/com/mingsoft/cms/action/web/DynamicPageAction.java new file mode 100644 index 00000000..97320838 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/web/DynamicPageAction.java @@ -0,0 +1,69 @@ +/** + * + */ +package com.mingsoft.cms.action.web; + + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.mingsoft.cms.parser.CmsParser; +import com.mingsoft.util.StringUtil; + +/** + * 动态生成页面,需要后台配置自定义页数据 + * @author killfen + * @version + * 版本号:100-000-000
+ * 创建日期:2015-4-20
+ * 历史修订:
+ */ +@Deprecated +@Controller("dynamicPageAction") +@RequestMapping("/") +public class DynamicPageAction extends com.mingsoft.base.action.BaseAction{ + + /** + * 替换时间的字符 + */ + private String date = "{date/}"; + /** + * 替换主机地址 + */ + private String host = "{host/}"; + /** + *文章解析器 + */ + @Autowired + private CmsParser cmsParser; + + + //该类作废,自定义页面路径请填写对应模块下面的DynamicPageAction的路径 + //如商城就为:/mall/{key}.do + /** + * 前段会员中心所有页面都可以使用该方法 请求地址例如: /{key}.do,例如登陆界面,与注册界面都可以使用 + * + * @param key + */ + @Deprecated + @RequestMapping("/{key}.do") + @ExceptionHandler(java.lang.NullPointerException.class) + public void model(@PathVariable(value = "key") String key, HttpServletRequest req, HttpServletResponse resp) { + String content = this.generaterPage(key,cmsParser,req); + if (StringUtil.isBlank(content)) { + this.outString(resp, this.getResString("err")); + return; + } + //增加时间 + content = content.replace(date, StringUtil.getDateSimpleStr()); + content = content.replace(host, this.getApp(req).getAppHostUrl()); + this.outString(resp, content); + } + +} diff --git a/src/main/java/com/mingsoft/cms/action/web/ErrorAction.java b/src/main/java/com/mingsoft/cms/action/web/ErrorAction.java new file mode 100644 index 00000000..399a2a1a --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/web/ErrorAction.java @@ -0,0 +1,98 @@ +/** + * + */ +package com.mingsoft.cms.action.web; + +import java.io.File; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.cms.parser.CmsParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.StringUtil; +import com.mingsoft.base.action.BaseAction; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments:错误页面定义 + *

+ * + *

+ * Create Date:2015-4-26 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller("errorAction") +@RequestMapping("/error") +public class ErrorAction extends BaseAction{ + + /** + * 404页面地址 + */ + private final static String ERR_404 = "/errors/404.html"; + + /** + * 500页面地址 + */ + private final static String ERR_500 = "/errors/500.html"; + + /** + *文章解析器 + */ + @Autowired + private CmsParser cmsParser; + + /** + * 返回404页面 + */ + @RequestMapping("/404") + @ResponseBody + public void _404(HttpServletRequest req, HttpServletResponse resp){ + String content = FileUtil.readFile(this.getRealPath(req,ERR_404)); + this.outString(resp, content); + } + + /** + * 返回500页面 + * @param req + * @param resp + */ + @RequestMapping("/500") + @ResponseBody + public void _500(HttpServletRequest req, HttpServletResponse resp){ + //先判断当前因为是否有设置错误页面,错误页面的文件名称必须为500.htm + // 模版路径加上(用户选择的主页的模版的路径)default/index.html + String tmpFilePath = this.getTemplatePath(req) + "/500.html"; + String content = FileUtil.readFile(tmpFilePath); + if (StringUtil.isBlank(content)) { + content = FileUtil.readFile(this.getRealPath(req,ERR_500)); + } else { + content = this.parserMsTag(content,cmsParser, req); + } + this.outString(resp, content); + } +} diff --git a/src/main/java/com/mingsoft/cms/action/web/FieldAction.java b/src/main/java/com/mingsoft/cms/action/web/FieldAction.java new file mode 100644 index 00000000..dcaae34c --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/web/FieldAction.java @@ -0,0 +1,102 @@ +package com.mingsoft.cms.action.web; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.cms.entity.FieldEntity; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 史爱华 + * + *

+ * Comments: 供前端页面获取自定义模型中字段实体信息 + *

+ * + *

+ * Create Date:2015-07-11 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller("webField") +@RequestMapping("/field") +public class FieldAction extends BaseAction{ + + /** + * 栏目业务层 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 内容模型业务层 + */ + @Autowired + private IContentModelBiz contentModelBiz; + + /** + * 字段管理业务层 + */ + @Autowired + private IFieldBiz fieldBiz; + + /** + * + * 根据当前栏目id和字段名称获取自定义模型中的字段实体信息 + * @param request + * @param response + */ + @RequestMapping("/{columId}/getEntity") + @ResponseBody + public void getEntity(@PathVariable int columId,HttpServletRequest request, HttpServletResponse response) { + //获取字段名称 + String fieldFieldName = request.getParameter("fieldFieldName"); + //根据栏目id获取栏目实体 + ColumnEntity column = (ColumnEntity) this.columnBiz.getEntity(columId); + if(column==null){ + this.outJson(response, this.getResString("err")); + return; + }else{ + //判断该栏目下是存在内容模型 + if(column.getColumnContentModelId()>0){ + //获取当前栏目对应的内容模型 + ContentModelEntity contentModel = (ContentModelEntity) this.contentModelBiz.getEntity(column.getColumnContentModelId()); + if(contentModel==null){ + this.outJson(response, this.getResString("err")); + return; + } + //获取字段实体 + FieldEntity field = fieldBiz.getEntityByCmId(column.getColumnContentModelId(), fieldFieldName); + //返回字段实体 + this.outJson(response, JSONObject.toJSONString(field)); + } + } + + } +} diff --git a/src/main/java/com/mingsoft/cms/action/web/SearchAction.java b/src/main/java/com/mingsoft/cms/action/web/SearchAction.java new file mode 100644 index 00000000..52e0a662 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/action/web/SearchAction.java @@ -0,0 +1,385 @@ +package com.mingsoft.cms.action.web; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.mingsoft.base.action.BaseAction; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.biz.ICategoryBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.cms.biz.IArticleBiz; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.biz.ISearchBiz; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.cms.entity.FieldEntity; +import com.mingsoft.cms.entity.SearchEntity; +import com.mingsoft.cms.parser.CmsParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.parser.impl.general.ListParser; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments: 搜索,根据搜索结果生成html页面 + *

+ * + *

+ * Create Date:2015-4-21 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller(value = "webSearchAction") +@RequestMapping("/html") +public class SearchAction extends BaseAction { + + /** + * 注入文章业务层 + */ + @Autowired + private IArticleBiz articleBiz; + + + + /** + * 内容模型业务层 + */ + @Autowired + private IContentModelBiz contentModelBiz; + + + /** + * 内容字段业务层 + */ + @Autowired + private IFieldBiz fieldBiz; + + /** + * 注入站点业务层 + */ + @Autowired + private IAppBiz appBiz; + + /** + * 注入搜索业务层 + */ + @Autowired + private ISearchBiz searchBiz; + + /** + * 注入栏目业务层 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 注入分类业务层 + */ + @Autowired + private ICategoryBiz categoryBiz; + + /** + * 文章解析器 + */ + @Autowired + private CmsParser cmsParser; + + /** + * 模块管理biz + */ + @Autowired + private IModelBiz modelBiz; + + /** + * 实现前端页面的文章搜索 + * @param request + * @param websiteId 应用id + * @param searchId 搜索id + * @param response + */ + @RequestMapping(value = "/{websiteId}/{searchId}/search") + @ResponseBody + public void search(HttpServletRequest request, @PathVariable int websiteId, @PathVariable int searchId, HttpServletResponse response) { + + + Map articleField = getMapByProperties("com/mingsoft/cms/resources/article_field"); + Map field = new HashMap(); + AppEntity app = (AppEntity) appBiz.getEntity(websiteId); + // 获取模版名称 + String tmpName = app.getAppStyle(); + // 获取系统模版存放物理路径 + String tmpPath = getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE); + //排序参数格式 字段名称-方式 + String sort = request.getParameter("sort"); + Map sortMap = null; + if(!StringUtil.isBlank(sort) && sort.indexOf("-")>0) { + sortMap = new HashMap(); + String[] tmp = sort.split("-"); + sortMap.put("order",tmp[0]); + sortMap.put("by",tmp[1]); + } + if (websiteId != app.getAppId()) { + this.outString(response, this.getResString("err")); + return; + } + field = request.getParameterMap(); // 读取请求字段 + //获取当前页码 + Integer pageNo = this.getInt(request, "pageNo",1); + // 获取栏目ID + String basicCategoryId = request.getParameter("categoryId"); + Integer [] categoryIds = null; + if (basicCategoryId!=null ) { + if (StringUtil.isIntegers(basicCategoryId.split(","))) { + categoryIds = StringUtil.stringsToIntegers( basicCategoryId.split(",")); + basicCategoryId = categoryIds[0]+""; + } + } + ColumnEntity column = null; //当前栏目 + ContentModelEntity contentModel = null; //栏目对应模型 + List fieldList = null; //栏目对应字段 + // 若栏目ID不为空,则选择了栏目 + if (StringUtil.isInteger(basicCategoryId)) { + column = (ColumnEntity) columnBiz.getEntity(Integer.valueOf(basicCategoryId)); + // 获取表单类型的id + if (column != null) { + contentModel = (ContentModelEntity) contentModelBiz.getEntity(column.getColumnContentModelId()); + if(contentModel!=null){ + fieldList = fieldBiz.queryByContentModelId(contentModel.getCmId()); + } + } + } + SearchEntity search = (SearchEntity) searchBiz.getByIdAndAppId(searchId,app.getAppId()); //获取对应搜索模型 + // 默认显示的数量为20条 + int size = 1; + if (search != null) { + String webSiteTmpPath = ""; + if (isMobileDevice(request) && !StringUtil.isBlank(app.getAppMobileStyle())) { + // 根据站点id组装站点信息路径 格式:templets/站点ID/模版风格 + webSiteTmpPath = tmpPath + File.separator + app.getAppId() +File.separator+ tmpName + File.separator +app.getAppMobileStyle(); + } else { + webSiteTmpPath = tmpPath + File.separator + app.getAppId() + File.separator + tmpName; + } + // 读取模板内容 + String htmlContent = FileUtil.readFile(webSiteTmpPath + File.separator + search.getSearchTemplets()); + // 文章字段集合 + Map articleFieldName = new HashMap(); + // 自定义字段集合 + Map diyFieldName = new HashMap(); + // 分页连接地址 + String pageUrl = app.getAppHostUrl() + File.separator + "html" + File.separator + websiteId + File.separator + searchId + File.separator + "search.do"; + // 遍历取字段集合 + for (Entry entry : field.entrySet()) { + if (entry != null) { + String value = entry.getValue()[0]; // 处理由get方法请求中文乱码问题 + if (StringUtil.isBlank(value)) { + continue; + } + if (request.getMethod().equals(RequestMethod.GET)) { // 如果是get方法需要将请求地址参数转吗 + value = StringUtil.isoToUTF8(value); + } + // 若为文章字段,则保存至文章字段集合;否则保存至自定义字段集合 + if (!StringUtil.isBlank(articleField.get(entry.getKey())) && !StringUtil.isBlank(value)) { + articleFieldName.put(entry.getKey(), value); + }else { + if (!StringUtil.isBlank(value)) { + diyFieldName.put(entry.getKey(), value); + } + + } + htmlContent = htmlContent.replaceAll("\\{ms:search." + entry.getKey() + "/\\}", value); // 将用户请求的值返回到页面上; + + } + } + + + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + diyFieldName.put("pageNo", null); + //组织链接地址 + pageUrl = StringUtil.buildUrl(pageUrl, articleFieldName); + pageUrl = StringUtil.buildUrl(pageUrl, diyFieldName); + + //保存栏目Id + List ids = null; + if (StringUtil.isInteger(basicCategoryId)) { + ids = categoryBiz.queryChildrenCategory(Integer.parseInt(basicCategoryId),this.getAppId(request),modelId); + if (categoryIds!=null && categoryIds.length>0) { + for(Integer id:categoryIds) { + ids.addAll(categoryBiz.queryChildrenCategory(id,this.getAppId(request),modelId)); + } + } + } + Map whereMap = this.searchMap(articleFieldName, diyFieldName, fieldList); + // 获取符合条件的文章总数 + int count = articleBiz.getSearchCount(contentModel,whereMap, websiteId,ids); + List articleList = new ArrayList(); + // 读取列表标签中中的 + Map property = ListParser.listProperty(htmlContent, true); + // 列表每页显示的数量 + if (StringUtil.string2Int(property.get(ListParser.LIST_SIZE)) > 0) { + size = StringUtil.string2Int(property.get(ListParser.LIST_SIZE)); + } + // 页面对象 + PageUtil page = new PageUtil(pageNo, size, count, pageUrl); + // 判断列表标签中是否存在 + String isPaging = property.get(ListParser.LIST_ISPAGING); + // 判断是否存在分页,不存在则分页对象不存在 + if (isPaging == null || !isPaging.equals("true")) { + page = null; + } + articleList = articleBiz.queryListForSearch(contentModel, whereMap, page, websiteId,ids,sortMap); + Map map = new HashMap(); + map.put(CmsParser.CUR_PAGE_NO, pageNo); + map.put(CmsParser.SEARCH_LIST_ARTICLE, articleList); + //移动端与pc端分离 + if (isMobileDevice(request) && !StringUtil.isBlank(app.getAppMobileStyle())) { + // 对模板内容进行解析 + htmlContent = cmsParser.parse(htmlContent,app,column,articleList,page,map);//generaterFactory.buildSearch(app, htmlContent, webSiteTmpPath, no, articleList,null, column, page,app.getAppMobileStyle()); + } else { + // 对模板内容进行解析 + htmlContent = cmsParser.parse(htmlContent,app,column,articleList,page,map);// generaterFactory.buildSearch(app, htmlContent, webSiteTmpPath, no, articleList, null,column, page); + } + this.outString(response, htmlContent); + } else { + this.outString(response, this.getResString("err")); + } + } + + + + + + +/** + * 动态组织查询where条件 + * 获取查询条件的Map key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段 list[1]:是否为整形 + * list[2]:是否是等值查询 list[3]:字段的值 + * @param articleField 文章字段 + * @param diyFieldName 动态字段 + * @param fields 模型对应的字段类型 + * @return + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + private Map searchMap(Map articleField, Map diyFieldName, List fields) { + Map map = new HashMap(); + + // 遍历文章中的字段 + for (Iterator iter = articleField.keySet().iterator(); iter.hasNext();) { + String key = iter.next().toString(); + String fieldValue = articleField.get(key).toString(); + List list = new ArrayList(); + List listValue = new ArrayList(); + // 是否为自定义字段 + list.add(false); + + // 是否是数字类型,true:不是 + list.add(true); + // 是否是模糊查询3 + list.add(true); + // 字段值 + listValue.add(articleField.get(key)); + list.add(listValue); + map.put(key, list); + } + + // 遍历字段自定义字段 + for (Iterator iter = diyFieldName.keySet().iterator(); iter.hasNext();) { + String key = iter.next().toString(); + String fieldValue = diyFieldName.get(key); + // 获取字段实体 + FieldEntity field = this.get(key, fields); + if (field != null) { + List list = new ArrayList(); + // 是否为自定义字段0 + list.add(0, true); + List listValue = new ArrayList(); + // 字段的值 + if (field.getFieldType() == IFieldBiz.INT || field.getFieldType() == IFieldBiz.FLOAT) { + // 判断是否为区间查询 + + if (diyFieldName.get(key).toString().indexOf("-") > 0) { + String[] values = fieldValue.toString().split("-"); + // 是否是数字类型,false:是 + list.add(false); + // 是否是区间比较 false:是 + list.add(false); + // 字段值1 + listValue.add(values[0]); + listValue.add(values[1]); + } else { + // 是否是数字类型,false:是2 + list.add(false); + // 是否是区间比较 true:不是3 + list.add(true); + // 字段值 1 + listValue.add(fieldValue); + } + } else { + // 是否是数字类型,true:不是2 + list.add(true); + list.add(false); + // 字段值 1 + listValue.add(fieldValue); + } + list.add(listValue); + map.put(key, list); + } + } + return map; + } + + /** + * 根据字段名称获取字段类型 + * @param columnName 字段名称 + * @return 字段实体 + */ + private FieldEntity get(String columnName,List fields) { + if (fields==null) { + return null; + } + for(FieldEntity field:fields) { + if (field.getFieldFieldName().equals(columnName)) { + return field; + } + } + return null; + } + +} diff --git a/src/main/java/com/mingsoft/cms/aop/ColumnAdvice.java b/src/main/java/com/mingsoft/cms/aop/ColumnAdvice.java new file mode 100644 index 00000000..54fb16ee --- /dev/null +++ b/src/main/java/com/mingsoft/cms/aop/ColumnAdvice.java @@ -0,0 +1,75 @@ +package com.mingsoft.cms.aop; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.mingsoft.cms.biz.IArticleBiz; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 史爱华 + * + *

+ * Comments:栏目管理切面 + *

+ * + *

+ * Create Date:2015-2-11 + *

+ * + *

+ * Modification history: + *

+ */ +// @Aspect : 标记为切面类 +// @Pointcut : 指定匹配切点集合 +// @Before : 指定前置通知,value中指定切入点匹配 +// @AfterReturning :后置通知,具有可以指定返回值 +// @AfterThrowing :异常通知 +// 注意:前置/后置/异常通知的函数都没有返回值,只有环绕通知有返回值 +@Component +// 首先初始化切面类 +@Aspect +// 声明为切面类,底层使用动态代理实现AOP +public class ColumnAdvice { + + @Autowired + private IArticleBiz articleBiz; + + // 指定切入点匹配表达式,注意它是以方法的形式进行声明的。 + // 即切点集合是:aop.annotation包下所有类所有方法 + // 第一个* 代表返回值类型 + // 如果要设置多个切点可以使用 || 拼接 + // and args(com.mingsoft.order.entity.OrderEntity + @Pointcut(" execution(* com.mingsoft.cms.biz.impl.ColumnBizImpl.deleteCategory(..) ) ") + public void deleteCategory() { + } + + /** + * + * @param jp + * @throws Throwable + */ + @After("deleteCategory()") + public void deleteArticle(JoinPoint jp)throws Throwable{ + Object[] obj = jp.getArgs(); + if (obj[0] instanceof Integer) { + //删除该栏目下的所有文章 + // + } + } +} diff --git a/src/main/java/com/mingsoft/cms/bean/ArticleBean.java b/src/main/java/com/mingsoft/cms/bean/ArticleBean.java new file mode 100644 index 00000000..5810000c --- /dev/null +++ b/src/main/java/com/mingsoft/cms/bean/ArticleBean.java @@ -0,0 +1,348 @@ +package com.mingsoft.cms.bean; + +import java.io.File; +import java.sql.Timestamp; +import java.util.Date; + +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.StringUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 史爱华 + * + * @version + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: ArticleEntity实体的bean用于给外部请求数据使用 + *

+ * + *

+ * Create Date:2015-06-15 + *

+ * + *

+ * Modification history: + *

+ */ +public class ArticleBean { + + /** + * 文章内容 + */ + private String articleContent; + + /** + * 文章作者 + */ + private String articleAuthor; + + /** + * 文章属性 + */ + private String articleType ; + + private int articleFreeOrder; + + + + /** + * 文章的来源 + */ + private String articleSource; + + /** + * 文章跳转链接地址 + */ + private String articleUrl; + + /** + * 文章关键字 + */ + private String articleKeyword; + + /** + * 文章标题 + */ + private String articleTitle; + + /** + * 文章描述 + */ + private String articleDescription; + + /** + * 文章所属的分类Id + */ + private int articleCategoryId; + + /** + * 文章url地址 主要是用户生成html使用 + */ + private String articleLinkURL; + + /** + * 文章分类url地址,主要是用户生成html使用 + */ + private String articleTypeLinkURL; + + /** + * 一对一管理栏目 + */ + private ColumnEntity column; + + /** + * 发布时间 + */ + private Timestamp articleDateTime; + + /** + * 更新时间 + */ + private Date articleUpdateTime; + + /** + * 缩略图 + */ + private String articleThumbnails; + + /** + * 点击次数 + */ + private int articleHit; + + + + + public int getArticleFreeOrder() { + return articleFreeOrder; + } + + public void setArticleFreeOrder(int articleFreeOrder) { + this.articleFreeOrder = articleFreeOrder; + } + + public String getArticleTitle() { + return articleTitle; + } + + public void setArticleTitle(String articleTitle) { + this.articleTitle = articleTitle; + } + + public String getArticleDescription() { + return articleDescription; + } + + public void setArticleDescription(String articleDescription) { + this.articleDescription = articleDescription; + } + + public int getArticleCategoryId() { + return articleCategoryId; + } + + public void setArticleCategoryId(int articleCategoryId) { + this.articleCategoryId = articleCategoryId; + } + + public int getArticleHit() { + return articleHit; + } + + public void setArticleHit(int articleHit) { + this.articleHit = articleHit; + } + + public Timestamp getArticleDateTime() { + return articleDateTime; + } + + public void setArticleDateTime(Timestamp articleDateTime) { + this.articleDateTime = articleDateTime; + } + + public Date getArticleUpdateTime() { + return articleUpdateTime; + } + + public void setArticleUpdateTime(Date articleUpdateTime) { + this.articleUpdateTime = articleUpdateTime; + } + + public String getArticleThumbnails() { + return articleThumbnails; + } + + public void setArticleThumbnails(String articleThumbnails) { + this.articleThumbnails = articleThumbnails; + } + + /** + * 获取文章实体所属的栏目实体 + * @return + */ + public ColumnEntity getColumn() { + return column; + } + + /** + * 设置文章所属的栏目实体 + * @param column + */ + public void setColumn(ColumnEntity column) { + this.column = column; + } + + public String getArticleTypeLinkURL() { + return articleTypeLinkURL; + } + + public void setArticleTypeLinkURL(String articleTypeLinkURL) { + this.articleTypeLinkURL = articleTypeLinkURL; + } + + public String getArticleLinkURL() { + return articleLinkURL; + } + + public void setArticleLinkURL(String articleLinkURL) { + this.articleLinkURL = articleLinkURL; + } + + /** + * 获取文章作者 + * @return 返回文章作者 + */ + public String getArticleAuthor() { + return articleAuthor; + } + + /** + * 获取文章内容 + * @return 返回文章内容 + */ + public String getArticleContent() { + return articleContent; + } + + + + + + /** + * 获取文章关键字 + * @return 返回文章关键字 + */ + public String getArticleKeyword() { + return articleKeyword; + } + + /** + * 获取文章的来源 + * @return 返回文章的来源 + */ + public String getArticleSource() { + return articleSource; + } + + /** + * 获取文章属性 + * @return 返回文章属性 + */ + public String getArticleType() { + return articleType; + } + + /** + * 获取文章跳转链接 + * @return 返回文章跳转链接 + */ + public String getArticleUrl() { + return articleUrl; + } + + + + /** + * 设置文章作者 + * @param articleAuthor 传入文章作者 + */ + public void setArticleAuthor(String articleAuthor) { + this.articleAuthor = articleAuthor; + } + + /** + * 设置文章内容 + * @param articleContent 传入文章内容 + */ + public void setArticleContent(String articleContent) { + this.articleContent = articleContent; + } + + + + + + /** + * 设置文章关键字 + * @param articleKeyword 传入文章关键字列表 + */ + public void setArticleKeyword(String articleKeyword) { + this.articleKeyword = articleKeyword; + } + + /** + * 设置文章的来源 + * @param articleSource 传入文章的来源 + */ + public void setArticleSource(String articleSource) { + this.articleSource = articleSource; + } + + /** + * 设置文章属性 + * @param articleType 传入文章属性 + */ + public void setArticleType(String articleType) { + this.articleType = articleType; + } + + /** + * 设置文章跳转链接 + * @param articleUrl 传入文章跳转链接地址 + */ + public void setArticleUrl(String articleUrl) { + this.articleUrl = articleUrl; + } + + + + + public String getArticleUrl(AppEntity app) { + if (!StringUtil.isBlank(app.getAppMobileStyle())) { + return app.getAppHostUrl()+IParserRegexConstant.HTML_SAVE_PATH+File.separator+"m"+File.separator+this.getArticleUrl(); + } + return app.getAppHostUrl()+File.separator+IParserRegexConstant.HTML_SAVE_PATH+File.separator+this.getArticleUrl(); + } + +} diff --git a/src/main/java/com/mingsoft/cms/biz/IArticleBiz.java b/src/main/java/com/mingsoft/cms/biz/IArticleBiz.java new file mode 100644 index 00000000..8f77bd0c --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/IArticleBiz.java @@ -0,0 +1,407 @@ +package com.mingsoft.cms.biz; + +import java.util.Date; +import java.util.List; +import java.util.Map; + + +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IBasicBiz; +import com.mingsoft.basic.entity.BasicCategoryEntity; +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 郭鹏辉 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:文章管理业务处理层 || 继承IBasicBiz业务处理层 + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IArticleBiz extends IBasicBiz { + + /** + * 按照关键字分页查询 + * + * @param entity + * 实体
+ * @param page + * PageUtil对象,主要封装分页的方法
+ * @param orderBy + * 排序字段
+ * @param order + * 排序方式true:asc false:desc
+ * @param keyword + * 搜索关键字 + * @param attribute + * 搜索文章属性 + * @param columnId + * 文章所属栏目 + * @return 返回所查询的文章集合 + */ + public List queryList(PageUtil page, String orderBy, boolean order, String keyword, String articleType, int basicCategoryId, int webId); + + /** + * 显示本网站下文章列表 + * + * @param webId网站id + * @param page + * PageUtil对象,主要封装分页的方法
+ * @param orderBy + * 排序字段
+ * @param order + * 排序方式true:asc false:desc
+ * @return 返回所查询的文章集合 + */ + public List queryPageListByWebsiteId(int webId, PageUtil page, String orderBy, boolean order); + + /** + * 文章查询 + * + * @para  webId 网站编号 + * @param basicCategoryId + *  栏目编号集合 + * @param flag + *  文章属性 + * @param noFlag + *  文章不存在的属性 + * @param start + *  开始位置 + * @param pageSize + *  一页显示数量 + * @param orderBy + *  排序字段 + * @param order + *  排序方式 + * @return 返回所查询的文章集合 + */ + public List queryList(int webId, List basicCategoryId, String flag, String noFlag, int start, int pageSize, String orderBy, boolean order); + + /** + * 文章查询 + * + * @para  webId 网站编号 + * @param basicCategoryId + *  栏目编号 + * @param flag + *  文章属性 + * @param noFlag + *  文章不存在的属性 + * @param start + *  开始位置 + * @param pageSize + *  一页显示数量 + * @param orderBy + *  排序字段 + * @param order + *  排序方式 + * @return 返回所查询的文章集合 + */ + public List queryList(int webId, int basicCategoryId, String flag, String noFlag, int start, int pageSize, String orderBy, boolean order); + + /** + * 根据页面栏目的id获取与其绑定的文章实体 + * + * @param basicCategoryId + * @return 文章实体 + */ + public List queryListByColumnId(int basicCategoryId); + + /** + * 根据站点id获取文章列表 + * + * @param basicCategoryId + * @return 文章集合 + */ + public List queryListByWebsiteId(int basicId); + + /** + * 根据站点id和文章更新时间获取文章列表 + * + * @param basicCategoryId + * @param UpdateArticleDate + * @return 文章集合 + */ + public List queryListByTime(int basicId, Date UpdateArticleDate); + + /** + * 根据文章ID集合查询文章实体集合 + * + * @param articleIds + * 文章ID集合 + * @return 文章实体集合 + */ + public List queryListByArticleIds(String articleIds); + + /** + * 根据文章字段条件查询文章集合 + * + * @param articleFieldName + * 文章字段 + * @return 文章ID集合 + */ + public List queryListByArticleField(Map articleFieldName); + + /** + * 根据文章列表ID,flag,等属性获取文章 + * + * @param webId + * 站点编号 + * @param ids + * 栏目ids + * @param flag + * 需要的文章属性 + * @param NoFlag + * 不需要的文章属性 + * @param begin光标开始位置 + * @param count + * 每页显示条数 + * @param orderBy + * 排序依据字段 + * @param order + * false,true + * @return 文章集合 + */ + public List queryListByListArticleId(int webId, List articleIds, String flag, String NoFlag, int begin, int count, String orderBy, String order); + + /** + * 高级查询接口,主要提供给有自定义模型的栏目, + * + * @param conntentModel + * 自定义模型 + * @param whereMap + * 條件 + * @param page + * 分頁 + * @param appId + * 應用編號 + * @param ids + * 子类id + * @return 记录集合 + */ + public List queryListForSearch(ContentModelEntity conntentModel, Map whereMap, PageUtil page, int appId, List ids, Map orders); + + /** + * 高级查询接口,主要提供给有自定义模型的栏目,返回總數 + * + * @param contentModel + * 自定义模型 + * @param whereMap + * 條件 + * @param appId + * appId 應用編號 + * @param ids + * 子类id + * @return 记录数量 + */ + public int getSearchCount(ContentModelEntity contentModel, Map whereMap, int appId, List ids); + + /** + * 通过视图表来查询文章列表 + * + * @param categoryId + * 分类编号 + * @param page + * 分頁 + * @param _isHasChilds + * ture:取categoryId下面的子栏目 false:只取categoryId栏目 + * @return 文章列表 + */ + public List queryPageByCategoryId(int categoryId, int appId,PageUtil page, boolean _isHasChilds); + + /** + * 根据文章id集合获取文章列表 + * + * @param basicId + *  文章id + * @param basicIds + *  id集合 + * @return 列表 + */ + public List queryByBasicIds(int basicId, Integer[] basicIds); + + /** + * 根据文章标题查询文章 + * + * @param articleTitle + * 文章标题 + * @param webId + * 应用Id + * @param modelCode + * 模块编号 + * @return 文章分类 + */ + public List queryListByArticleTitle(String articleTitle, int webId, ModelCode modelCode); + + /** + * @para  webId 网站编号 + * @param basicCategoryId + *  栏目编号 + * @param flag + *  文章属性 + * @param noFlag + *  文章不存在的属性 + * @param keyword 文章关键字 + * @return + */ + int count(int webId, int basicCategoryId, String flag, String noFlag,String keyword); + + /** + * 通过视图表来查询文章总数 + * + * @param categoryId + * 分类编号 + * @return 总数 + */ + public int countByCategoryId(int categoryId); + + /** + * 根据文章id查找文章的总数 + * + * @param webId + * @param articleIds + * :文章id + * @param flag + * 推荐属性 + * @param NoFlag + * 不推荐属性 + * @return + */ + public int getCountByArticleIds(int webId, List articleIds, String flag, String NoFlag); + + /** + * 根据站点Id,栏目列表Id,栏目属性,和栏目不推荐属性查找栏目下的文章总数 + * + * @param webId + * :站点id + * @param basicCategoryIds + * :栏目列表id + * @param flag + * :文章推荐属性 + * @param noFlag + * :文章不推荐属性 + * @return 文章总数 + */ + public int getCountByColumnId(int webId, List basicCategoryIds, String flag, String noFlag); + + /** + * 查询本网站下文章列表数目 + * + * @param webId网站id + * @return 文章条数 + */ + public int getCountByWebsiteId(int webId); + + /** + * 通过视图表来查询文章总数 + * + * @param basicId + * 文章编号 + */ + public ArticleEntity getById(int basicId); + + /** + * 根据分类与时间查询文章列表 + * + * @param categoryId + * 分类编号 + * @param dateTime + * 时间 + * @param appId + * 应用编号 + * @return 文章 + */ + public List query(int categoryId, String dateTime, int appId); + + /** + * 查找basicId下一篇文章 + * + * @param appId + *  应用编号 + * @param basicId + *  文章编号 + * @return + */ + public ArticleEntity getNext(int appId, int basicId,Integer categoryId); + + /** + * 查找basicId上一篇文章 + * + * @param appId + *  应用编号 + * @param basicId + *  文章编号 + * @return + */ + public ArticleEntity getPrevious(int appId, int basicId,Integer categoryId); + + /** + * 通过分类id获取文章内容 + * + * @param categoryId + *  分类编号 + * @return + */ + public ArticleEntity getByCategoryId(int categoryId); + + /** + * 根据栏目id查询文章bean + * @param categoryId 栏目id + * @param page 分页对象 + * @param _isHasChilds 是否查询子分类的文章,true则进行查询子分类的文章 + * @return 文章bean + */ + public List queryByCategoryForBean(int appId,Integer categoryId,PageUtil page, boolean _isHasChilds); + + /** + * 根据分类id查询文章总数 + * @param categoryId 分类id + * @param _isHasChilds 查询的总数是否包括子栏目文章数 + * @return + */ + public int coutByCategoryAndChildsId(int appId,int categoryId, boolean isHasChilds); + + /** + * 保存文章以及属性信息 + * @param article 文章实体 + * @param basicCategoryList 基础表和分类关联实体 + */ + public void saveArticle(ArticleEntity article,List basicCategoryList); + + /** + * 保存文章以及属性信息 + * @param article 文章实体 + * @param basicCategoryList 基础表和分类关联实体 + */ + public void updateArticle(ArticleEntity article,List basicCategoryList); +} diff --git a/src/main/java/com/mingsoft/cms/biz/IColumnBiz.java b/src/main/java/com/mingsoft/cms/biz/IColumnBiz.java new file mode 100644 index 00000000..883e4909 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/IColumnBiz.java @@ -0,0 +1,149 @@ +package com.mingsoft.cms.biz; +import java.util.List; + +import com.mingsoft.basic.biz.ICategoryBiz; +import com.mingsoft.basic.entity.BasicEntity; +import com.mingsoft.cms.entity.ColumnEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:栏目业务层接口,继承ICategoryBiz接口 + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IColumnBiz extends ICategoryBiz { + + + + /** + * 根据站点ID查询该站点下的栏目集合 + * @param columnWebsiteId 站点Id + * @return 栏目集合 + */ + public List queryColumnListByWebsiteId(int columnWebsiteId); + + + + /** + * 根据站点Id查询该站点下的栏目的父栏目Id为categoryCategoryId的子栏目集合 + * @param categoryCategoryId 父栏目ID + * @param columnWebsiteId 站点Id + * @param modelId 模块编号 + * @return 栏目集合 + */ + public List queryChild(int categoryCategoryId,int columnWebsiteId,Integer modelId); + + /** + * 获取当前应用下面对应模块的所以栏目分类 + * @param appId 站点信息 + * @param modelId 模块信息 + * @return 记录集合 + */ + public List queryAll(int appId,int modelId); + + /** + * 通过站点Id查询栏目的同级栏目和他的父级栏目(包括他的间接父栏目知道顶级栏目)的同级栏目集合 + * @param categoryId 栏目ID + * @param columnWebsiteId 站点Id + * @return 栏目集合 + */ + public List queryColumnChildListRecursionByWebsiteId(int categoryId,int columnWebsiteId ); + + /** + * 通过栏目ID查询该栏目同级栏目 + * @param columnId 栏目ID + * @return 同级栏目集合 + */ + public List querySibling(int columnId); + + /** + * 通过栏目ID查询顶级栏目的同级栏目 + * @param columnId 栏目ID + * @return 顶级同级栏目集合 + */ + public List queryTopSiblingListByColumnId(int columnId); + + /** + * 根据栏目Id查询栏目的子栏目集 + * @param columnId 栏目ID + * @return 子栏目集合 + */ + public List queryChildListByColumnId(int columnId); + + + /** + * 根据栏目ID查询其子栏目ID集合 + * @param columnId 栏目ID + * @param appId 应用ID + * @return 子栏目ID集合 + */ + public List queryChildIdsByColumnId(int columnId,int appId); + + /** + * 根据栏目属性查询栏目站点id为columnWebsiteId的栏目集合 + * @param columnType 栏目属性 + * @param columnWebsiteId 栏目所属站点ID + * @return 栏目集合 + */ + public List queryColumnListBycolumnType(int columnType,int columnWebsiteId); + + /** + * 通过栏目ID查询栏目对应节点路径上的父级栏目集合 + * @param columnId 栏目ID + * @return 栏目及其父级栏目集合 + */ + public List queryParentColumnByColumnId(int columnId); + + /** + * 根据站点Id查询该站点下的栏目的父栏目Id为categoryCategoryId的子栏目集合数目统计 + * @param categoryCategoryId 父栏目ID + * @param columnWebsiteId 站点ID + * @return 子栏目统计数目 + */ + public int queryColumnChildListCountByWebsiteId(int categoryCategoryId,int columnWebsiteId); + + /** + * 通过管理员ID和模块ID查询订单类型集合 + * @param categoryManagerId 管理员ID + * @param categoryModelId 模块ID + * @return 订单集合 + */ + public List queryCategoryByManagerIdAndModelId(int categoryManagerId, int categoryModelId); + + /** + * 查询同级栏目 + * @param columnId + * @return 订单集合 + */ + public List querSibListByColumnId(int columnId); + +} diff --git a/src/main/java/com/mingsoft/cms/biz/IContentModelBiz.java b/src/main/java/com/mingsoft/cms/biz/IContentModelBiz.java new file mode 100644 index 00000000..093fd3f5 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/IContentModelBiz.java @@ -0,0 +1,78 @@ +package com.mingsoft.cms.biz; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.util.PageUtil; +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 史爱华 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:表单内容管理业务处理层 || 继承IBasicBiz业务处理层 + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IContentModelBiz extends IBaseBiz{ + + /** + * 根据内容模型的表名查找实体 + * @param cmTableName 表名 + * @return 内容模型实体 + */ + public ContentModelEntity getContentModelByTableName(String cmTableName); + + /** + * 根据管理员Id查找内容模型的总数 + * @param cmManagerId 管理员id + * @return 记录总数 + */ + public int getContentModelByManagerId(int cmManagerId); + + /** + * 分页查询指定管理员的表单内容模型 + * @param entity 实体 + * @param page Map对象 + * @param order 排序方式,true:asc;fales:desc + * @param cmManagerId 管理员id + * @return 表单内容模型 + */ + List queryPageByManagerId(PageUtil page,String orderBy,boolean order, int cmManagerId); + + /** + * 根据管理员id查找内容模型实体 + * @param cmManagerId + * @return 表单内容模型 + */ + public List queryByManagerId(int cmManagerId); +} diff --git a/src/main/java/com/mingsoft/cms/biz/IFieldBiz.java b/src/main/java/com/mingsoft/cms/biz/IFieldBiz.java new file mode 100644 index 00000000..0f6a7f26 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/IFieldBiz.java @@ -0,0 +1,144 @@ +package com.mingsoft.cms.biz; +import java.util.List; +import java.util.Map; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IBasicBiz; +import com.mingsoft.cms.constant.e.FieldSearchEnum; +import com.mingsoft.cms.entity.FieldEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:字段业务层,继承IBasicBiz + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public interface IFieldBiz extends IBasicBiz{ + + /** + * checkbox类表单 + */ + int CHECKBOX = 11; + + /** + * radio类的表单 + */ + int RADIO = 10; + + /** + * option 类的表单 + */ + int OPTION = 9; + + /** + * 整数类的表单 + */ + int INT = 4; + + /** + * float类的表单 + */ + int FLOAT = 5; + + + + /** + * 查询指定表单的自定义字段列表 + * @param fieldCmid 表单ID + * @return + */ + public List queryListByCmid(int fieldCmid); + + /** + * 统计指定表单的字段数量 + * @param fieldCmid + * @return + */ + public int queryCountByCmid(int fieldCmid); + + /** + * 分页查询指定表单的字段 + * @param fieldCmid 表单ID + * @param pageNo 当前页 + * @param pageSize 每页显示数 + * @param orderBy 排序字段 + * @param order 排序方式 + * @return 返回字段集合 + */ + public List queryByPage(int fieldCmid,PageUtil page,String orderBy,boolean order); + + /** + * 根据字段名和表单模型id查找符合条件的记录个数 + * @param fieldName :字段名 + * @param fieldCmdId : 表单模型id + * @return 记录个数 + */ + public int getCountFieldName(String fieldFieldName,int fieldCmdId); + + /** + * 通过字段名获取字段实体 + * @param fieldFieldName 字段名 + * @return 字段实体 + */ + public FieldEntity getEntityByFieldName(String fieldFieldName); + + /** + * 根据内容模型id和字段名查找字段实体 + * @param cmId + * @param fieldFieldName + * @return 字段实体 + */ + public FieldEntity getEntityByCmId(int cmId,String fieldFieldName); + + /** + * 根据自定义字段信息动态查询表 + * @param table 表名 + * @param diyFieldName 自定义字段 + * @return 返回ID集合 + */ + public List queryListBySQL(String table,Map diyFieldName); + + /** + * 根据内容模型id获取到所有的字段 + * @param contentModelId 内容模型字段 + * @return 字段列表 + */ + public List queryByContentModelId(int contentModelId); + + /** + * 查询需要搜索的字段列表信息 + * @param contentMdoel 内容模型id + * @param fieldIsSearch 是否支持搜索 + * @return 字段列表信息 + */ + public List queryByIsSearch(int contentMdoelId,FieldSearchEnum fieldIsSearch); +} diff --git a/src/main/java/com/mingsoft/cms/biz/ISearchBiz.java b/src/main/java/com/mingsoft/cms/biz/ISearchBiz.java new file mode 100644 index 00000000..5fabb0fa --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/ISearchBiz.java @@ -0,0 +1,79 @@ +package com.mingsoft.cms.biz; +import java.util.List; +import java.util.Map; + +import com.mingsoft.basic.biz.IBasicBiz; +import com.mingsoft.cms.entity.SearchEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:搜索业务层,继承IBasicBiz + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public interface ISearchBiz extends IBasicBiz{ + + /** + * 通过数字区域来查询数据集合 + * @param cmTableName 表名 + * @param fieldFieldName 字段名 + * @param preNum 第一个数 + * @param nextNum 第二个数 + * @return 返回数据集合 + */ + @SuppressWarnings("rawtypes") + public Map queryMapByNumArea(String cmTableName,String fieldFieldName,int preNum,int nextNum); + + /** + * 查询列表 + * @param appId 应用编号 + * @param page 分页 + * @return 查询列表 + */ + public List query( int appId,PageUtil page); + + /** + * 通过id与应用id获取搜索 + * @param id 主键 + * @param appId 应用编号 + * @return 搜索实体 + */ + public SearchEntity getByIdAndAppId( int id, int appId); + + /** + * 根据appid查询总条数 + * @param appId 应用id + * @return 总数 + */ + public int queryCount(int appId); +} diff --git a/src/main/java/com/mingsoft/cms/biz/impl/ArticleBizImpl.java b/src/main/java/com/mingsoft/cms/biz/impl/ArticleBizImpl.java new file mode 100644 index 00000000..f68d12f1 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/impl/ArticleBizImpl.java @@ -0,0 +1,592 @@ +package com.mingsoft.cms.biz.impl; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IBasicCategoryBiz; +import com.mingsoft.basic.biz.ICategoryBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.biz.impl.BasicBizImpl; +import com.mingsoft.basic.entity.BasicCategoryEntity; +import com.mingsoft.cms.biz.IArticleBiz; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.dao.IArticleDao; +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 郭鹏辉 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:文章管理业务层实现类 || 继承BasicBizImpl || 实现IArticleBiz + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +@Service("ArticleBizImpl") +public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz { + + + /** + * 文章持久化处理 + */ + private IArticleDao articleDao; + + /** + * 栏目业务处理 + */ + @Autowired + private ICategoryBiz categoryBiz; + + /** + * 自定类型义业务处理 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 自定义模型 + */ + @Autowired + private IContentModelBiz contentModelBiz; + + /** + * 模块管理业务层 + */ + @Autowired + private IModelBiz modelBiz; + + /** + * + */ + @Autowired + private IBasicCategoryBiz basicCategoryBiz; + + /** + * 获取Article的持久化层 + * + * @return 返回持Article的久化对象 + */ + public IArticleDao getArticleDao() { + return articleDao; + } + + /** + * 设置Article的持久化层 + * + * @param articleDao + */ + @Autowired + public void setArticleDao(IArticleDao articleDao) { + this.articleDao = articleDao; + } + + /** + * 获取IBaseDao的持久化层 + * + * @return 返回持articleDao的久化对象 + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return articleDao; + } + + /** + * 按照关键字分页查询 + * + * @param entity + * 实体
+ * @param page + * PageUtil对象,主要封装分页的方法
+ * @param orderBy + * 排序字段
+ * @param order + * 排序方式true:asc false:desc
+ * @param keyword + * 搜索关键字 + * @param attribute + * 搜索文章属性 + * @param columnId + * 文章所属栏目 + * @param webId + * 网站id + * @return 返回所查询的文章集合 + */ + @Override + public List queryList(PageUtil page, String orderBy, boolean order, String keyword, String articleType, int basicCategoryId, int webId) { + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + List basicCategoryIds = categoryBiz.queryChildrenCategoryIds(basicCategoryId,webId,modelId); + if(basicCategoryIds == null || !(basicCategoryIds.size() > 0)){ + return articleDao.queryList(webId,null,articleType , null, page.getPageNo() * page.getPageSize(), page.getPageSize(), orderBy, order,keyword); + } + return articleDao.queryList(webId,basicCategoryIds, articleType, null, page.getPageNo() * page.getPageSize(), page.getPageSize(), orderBy, order,keyword); + } + + /** + * 查询本网站下文章列表数目 + * + * @param webId网站id + * @return 文章条数 + */ + @Override + public int getCountByWebsiteId(int webId) { + // TODO Auto-generated method stub + return articleDao.getCountByWebsiteId(webId); + } + + /** + * 显示本网站下文章列表 + * + * @param webId网站id + * @param page + * PageUtil对象,主要封装分页的方法
+ * @param orderBy + * 排序字段
+ * @param order + * 排序方式true:asc false:desc
+ * @return 返回所查询的文章集合 + */ + @Override + public List queryPageListByWebsiteId(int webId, PageUtil page, String orderBy, boolean order) { + // TODO Auto-generated method stub + return articleDao.queryPageListByWebsiteId(webId, page.getPageNo(), page.getPageSize(), orderBy, order); + } + + /** + * 根据站点Id,栏目列表Id,栏目属性,和栏目不推荐属性查找栏目下的文章总数 + * + * @param webId + * :站点id + * @param basicCategoryIds + * :栏目列表id + * @param flag + * :文章推荐属性 + * @param noFlag + * :文章不推荐属性 + * @return 文章总数 + */ + @Override + public int getCountByColumnId(int webId, List basicCategoryIds, String flag, String noFlag) { + return articleDao.getCountByColumnId(webId, basicCategoryIds.size() > 0 ? basicCategoryIds : null, flag, noFlag); + } + + /** + * 根据栏目ID,flag,等属性获取文章 + * + * @param basicCategoryIds + * 栏目id + * @param flag + * 需要的文章属性 + * @param NoFlag + * 不需要的文章属性 + * @param begin + * 光标开始位置 + * @param count + * 每页显示条数 + * @return 文章集合 + */ + @Override + public List queryList(int webId, List basicCategoryIds, String flag, String noFlag, int begin, int count, String orderBy, boolean order) { + + if (orderBy!=null) { + if (orderBy.equals("sort")) { + orderBy = "basic_sort"; + } else if (orderBy.equals("date")) { + orderBy = "basic_datetime"; + } else if (orderBy.equals("hit")) { + orderBy = "basic_hit"; + } else if (orderBy.equals("updatedate")) { + orderBy = "basic_updatedate"; + } else if (orderBy.equals("id")) { + orderBy = "basic_id"; + } + } + + + List articleList = articleDao.queryList(webId, basicCategoryIds.size() > 0 ? basicCategoryIds : null, flag, noFlag, begin, count, orderBy, order,null); + return articleList; + } + + /** + * 根据页面栏目的id获取与其绑定的文章实体 + * + * @param basicCategoryId + * @return 文章实体 + */ + @Override + public List queryListByColumnId(int basicCategoryId) { + // TODO Auto-generated method stub + return articleDao.queryListByColumnId(basicCategoryId); + } + + /** + * 根据站点id获取文章列表 + * + * @param basicId + * @return 文章集合 + */ + @Override + public List queryListByWebsiteId(int basicId) { + // TODO Auto-generated method stub + return articleDao.queryListByWebsiteId(basicId); + } + + /** + * 根据站点id和文章更新时间获取文章列表 + * + * @param basicCategoryId + * @param UpdateArticleDate + * @return 文章集合 + */ + @Override + public List queryListByTime(int basicId, Date UpdateArticleDate) { + // TODO Auto-generated method stub + List articleList = queryListByWebsiteId(basicId); + List newArticle = new ArrayList(); + for (int i = 0; i < articleList.size(); i++) { + // 如果UpdateArticleDate在文章时间之前 + if (articleList.get(i).getBasicUpdateTime().before(UpdateArticleDate)) { + newArticle.add(articleList.get(i)); + } + } + return newArticle; + } + + /** + * 根据文章ID集合查询文章实体集合 + * + * @param articleIds + * 文章ID集合 + * @return 文章实体集合 + */ + @SuppressWarnings("rawtypes") + public List queryListByArticleIds(@Param("articleIds") String articleIds) { + Integer[] articleIdsList = StringUtil.stringsToIntegers(articleIds.split(",")); + List list = Arrays.asList(articleIdsList); + return articleDao.queryListByArticleIds(list); + } + + /** + * 根据文章字段条件查询文章集合 + * + * @param articleFieldName + * 文章字段 + * @return 文章ID集合 + */ + public List queryListByArticleField(Map articleFieldName) { + List listArticle = articleDao.queryListByArticleField(articleFieldName); + List listArticleId = new ArrayList(); + for (int i = 0; i < listArticle.size(); i++) { + listArticleId.add(listArticle.get(i).getBasicId()); + } + return listArticleId; + } + + /** + * 根据文章id查找文章的总数 + * + * @param webId + * @param articleIds + * :文章id + * @param flag + * 推荐属性 + * @param NoFlag + * 不推荐属性 + * @return + */ + @Override + public int getCountByArticleIds(int webId, List articleIds, String flag, String NoFlag) { + // TODO Auto-generated method stub + return articleDao.getCountByArticleIds(webId, articleIds, flag, NoFlag); + } + + /** + * 根据文章id集合查找文章实体 + * + * @param webId + * :站点id + * @param articleIds + * :文章id集合 + * @param flag + * :推荐属性 + * @param NoFlag + * :不推荐属性 + * @param begin + * :开始处 + * @param count + * :查询总数 + * @param orderBy + * :排序方式 + * @param order + * : + * @return + */ + @Override + public List queryListByListArticleId(int webId, List articleIds, String flag, String NoFlag, int begin, int count, String orderBy, String order) { + // TODO Auto-generated method stub + List articleList = articleDao.queryListByListArticleId(webId, articleIds.size() > 0 ? articleIds : null, flag, NoFlag, begin, count, orderBy, + (order == null || order != "false") ? true : false); + return articleList; + } + + public List queryListForSearch(ContentModelEntity conntentModel, Map whereMap, PageUtil page, int websiteId,List ids,Map orders) { + List articleList = new ArrayList(); + String tableName = null; + if (conntentModel!=null) { + tableName = conntentModel.getCmTableName(); + } + // 查找所有符合条件的文章实体 + articleList = articleDao.queryListForSearch(tableName, whereMap, page, websiteId,ids,orders); + return articleList; + } + + public int getSearchCount(ContentModelEntity contentModel,Map wherMap, int websiteId,List ids) { + if (contentModel!=null) { + return articleDao.getSearchCount(contentModel.getCmTableName(),wherMap, websiteId,ids); + } + return articleDao.getSearchCount(null,wherMap, websiteId,ids); + } + + + + @Override + public List queryPageByCategoryId(int categoryId,int appId, PageUtil page, boolean _isHasChilds) { + // TODO Auto-generated method stub + // return articleDao.queryByView(categoryId, page); + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + List list = categoryBiz.queryChildrenCategory(categoryId,appId,modelId); + // 分类不存在直接返回 + if (list == null || list.size() == 0) { + return null; + } + + // 如果是最低级栏目需要查询该栏目是否存在自定义模型,如果存在需要再关联自定义模型查询 + if (list.size() == 1) { // 最低级栏目 + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(categoryId); + if (column.getColumnContentModelId() != 0) { // 存在自定义模型 + ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz.getEntity(column.getColumnContentModelId()); + return articleDao.queryPageByCategoryId(categoryId, null, page, contentModel.getCmTableName()); + } else { + return articleDao.queryPageByCategoryId(categoryId, null, page, null); + } + } else { + if (_isHasChilds) { + return articleDao.queryPageByCategoryId(categoryId, list, page, null); + } else { + return articleDao.queryPageByCategoryId(categoryId, null, page, null); + } + } + + } + + @Override + public int countByCategoryId(int categoryId) { + // TODO Auto-generated method stub + return articleDao.countByCategoryId(categoryId); + } + + @Override + public ArticleEntity getById(int basicId) { + // TODO Auto-generated method stub + ArticleEntity article = (ArticleEntity) articleDao.getEntity(basicId); + String contentModelTableName = null; + int ccmi = article.getColumn().getColumnContentModelId(); // 内容模型编号 + if (ccmi > 0) { + ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz.getEntity(ccmi); + contentModelTableName = contentModel.getCmTableName(); + } + List temp = articleDao.getById(basicId, contentModelTableName); + if (temp != null && temp.size() > 0) { + return (ArticleEntity) temp.get(0); + } + return null; + } + + @Override + public List queryByBasicIds(int basicId, Integer[] basicIds) { + return articleDao.queryByBasicIds(basicId, basicIds); + } + + @Override + public List queryList(int webId, int basicCategoryId, String flag, String noFlag, int start, int pageSize, String orderBy, boolean order) { + return articleDao.query(webId, basicCategoryId, flag, noFlag, start, pageSize, orderBy, order); + } + + @Override + public int count(int webId, int basicCategoryId, String flag, String noFlag,String keyword) { + return articleDao.count(webId, basicCategoryId, flag, noFlag,keyword); + } + + /** + * 根据文章标题查询文章 + * + * @param articleTitle + * 文章标题 + * @param webId + * 应用Id + * @param modelCode + * 模块编号 + * @return 文章集合 + */ + public List queryListByArticleTitle(String articleTitle, int webId, ModelCode modelCode) { + // 将文章标题截断 + String[] _articleTitle = articleTitle.split(","); + if (_articleTitle.length > 1) { + articleTitle = _articleTitle[1]; + } else { + articleTitle = _articleTitle[0]; + } + // 查询文章集合 + List articleList = this.articleDao.queryByArticleTitle(articleTitle, webId, modelCode.toString()); + return articleList; + } + + @Override + public List query(int categoryId, String dateTime,int appId) { + return articleDao.queryListByTime(categoryId, dateTime,appId); + } + + @Override + public ArticleEntity getNext(int appId, int basicId,Integer categoryId) { + // TODO Auto-generated method stub + return articleDao.getNextOrPrevious(appId, basicId, true,categoryId); + } + + @Override + public ArticleEntity getPrevious(int appId, int basicId,Integer categoryId) { + // TODO Auto-generated method stub + return articleDao.getNextOrPrevious(appId, basicId, false,categoryId); + } + + @Override + public ArticleEntity getByCategoryId(int categoryId) { + // TODO Auto-generated method stub + List list = articleDao.getByCategoryId(categoryId); + if (list != null && list.size() > 0) { + return (ArticleEntity) list.get(0); + } + return null; + } + + @Override + public List queryByCategoryForBean(int appId,Integer categoryId, + PageUtil page,boolean _isHasChilds) { + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + //查询该分类下的所有子分类 + List list = categoryBiz.queryChildrenCategory(categoryId,appId,modelId); + // 分类不存在直接返回 + if (list == null || list.size() == 0) { + return null; + } + //如果没有子分类 + if(list.size()==1){ + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(categoryId); + if (column.getColumnContentModelId() != 0) { // 存在自定义模型 + ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz.getEntity(column.getColumnContentModelId()); + return articleDao.queryByCategoryForBean(categoryId, null, page, contentModel.getCmTableName()); + } else { + return articleDao.queryByCategoryForBean(categoryId, null, page, null); + } + }else{ + if (_isHasChilds) { + return articleDao.queryByCategoryForBean(categoryId, list, page,null); + } else { + return articleDao.queryByCategoryForBean(categoryId, null, page,null); + } + } + } + + @Override + public int coutByCategoryAndChildsId(int appId,int categoryId, boolean isHasChilds) { + // TODO Auto-generated method stub + int count = 0; + Integer modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + //查询该分类下的所有子分类 + if(isHasChilds){ + List basicCategoryIds = categoryBiz.queryChildrenCategoryIds(categoryId, appId,modelId); + count=this.getCountByColumnId(appId, basicCategoryIds, null, null); + }else{ + count=this.countByCategoryId(categoryId); + } + return count; + } + + @Override + public void saveArticle(ArticleEntity article, List basicCategoryList) { + // TODO Auto-generated method stub + this.saveBasic(article); + List newBasicCategoryList = new ArrayList(); + for(int i=0;i0){ + this.basicCategoryBiz.deleteEntity(article.getBasicId()); + this.basicCategoryBiz.saveBatch(newBasicCategoryList); + } + + } + + @Override + public void updateArticle(ArticleEntity article, List basicCategoryList) { + // TODO Auto-generated method stub + this.updateBasic(article); + if(article!=null){ + + if(basicCategoryList!=null &&basicCategoryList.size()>0){ + this.basicCategoryBiz.deleteEntity(article.getBasicId()); + this.basicCategoryBiz.saveBatch(basicCategoryList); + } + + } + + } + + + + + +} diff --git a/src/main/java/com/mingsoft/cms/biz/impl/ColumnBizImpl.java b/src/main/java/com/mingsoft/cms/biz/impl/ColumnBizImpl.java new file mode 100644 index 00000000..08de1fe5 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/impl/ColumnBizImpl.java @@ -0,0 +1,271 @@ +package com.mingsoft.cms.biz.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.impl.CategoryBizImpl; +import com.mingsoft.basic.entity.BasicEntity; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.dao.IColumnDao; +import com.mingsoft.cms.entity.ColumnEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:栏目业务层实现类,继承CategoryBizImpl,实现接口IColumnBiz + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +@Service("columnBiz") +public class ColumnBizImpl extends CategoryBizImpl implements IColumnBiz { + + /** + * 栏目持久化层注入 + */ + private IColumnDao columnDao; + + /** + * 获取 columnDao + * @return columnDao + */ + public IColumnDao getColumnDao() { + return columnDao; + } + + /** + * 设置 columnDao + * @param columnDao + */ + @Autowired + public void setColumnDao(IColumnDao columnDao) { + this.columnDao = columnDao; + } + + @Override + protected IBaseDao getDao(){ + return columnDao; + } + + /** + * 根据站点ID查询该站点下的栏目集合 + * @param columnWebsiteId 站点Id + * @return 栏目集合 + */ + public List queryColumnListByWebsiteId(int columnWebsiteId){ + return columnDao.queryColumnListByWebsiteId(columnWebsiteId); + } + + public List queryChild(int categoryCategoryId,int columnWebsiteId,Integer modelId){ + return columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(categoryCategoryId, columnWebsiteId,modelId); + } + + public List queryAll(int appId,int modelId) { + return columnDao.queryByAppIdAndModelId(appId,modelId); + } + + /** + * 通过站点Id查询栏目的同级栏目和他的父级栏目(包括他的间接父栏目直到顶级栏目)的同级栏目集合 + * @param categoryId 栏目ID + * @param columnWebsiteId 站点Id + * @return 栏目集合 + */ + public List queryColumnChildListRecursionByWebsiteId(int categoryId,int columnWebsiteId ){ + + List list = new ArrayList(); + ColumnEntity columnEntity = (ColumnEntity)(columnDao.getEntity(categoryId)); + if(columnEntity != null){ + int categoryCategoryId = columnEntity.getCategoryCategoryId(); + queryExpansionColumnListByWebsiteId(categoryCategoryId,list,columnWebsiteId); + } + + return list; + } + + /** + * 通过栏目的站点ID查询该站点下的栏目的父栏目Id为categoryCategoryId子栏目 + * 通过递归查询将父栏目ID为categoryCategoryId的子栏目集合和他对应在同一节点树的父级栏目的集合全部查询装入List中 + * @param categoryCategoryId 栏目ID + * @param list 栏目集合 + * @param columnWebsiteId 站点ID + */ + private void queryExpansionColumnListByWebsiteId(int categoryCategoryId, List list,int columnWebsiteId){ + List queryChildList = new ArrayList(); + queryChildList = columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(categoryCategoryId,columnWebsiteId,null); + for(int i = 0; i < queryChildList.size(); i++){ + list.add(queryChildList.get(i)); + } + + if(categoryCategoryId!=0){ + ColumnEntity columnEntity = (ColumnEntity)(columnDao.getEntity(categoryCategoryId)); + queryExpansionColumnListByWebsiteId(columnEntity.getCategoryCategoryId(),list,columnWebsiteId); + } + } + + /** + * 通过栏目ID查询该栏目同级栏目 + * @param columnId 栏目ID + * @return 同级栏目集合 + */ + public List querySibling(int columnId){ + ColumnEntity columnEntity= (ColumnEntity)columnDao.getEntity(columnId); + List list = new ArrayList(); + if(columnEntity!=null){ + + list = columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(columnEntity.getCategoryCategoryId(),columnEntity.getColumnWebsiteId(),null); + } + return list; + } + + + + /** + * 通过栏目ID查询顶级栏目的同级栏目 + * @param columnId 栏目ID + * @return 顶级同级栏目集合 + */ + public List queryTopSiblingListByColumnId(int columnId){ + ColumnEntity columnEntity= (ColumnEntity)columnDao.getEntity(columnId); + List list = null; + if(columnEntity != null){ + list = querySibling(columnEntity.getCategoryCategoryId()) ; + } + return list; + } + + /** + * 根据栏目Id查询栏目的子栏目集 + * @param columnId 栏目ID + * @return 子栏目集合 + */ + public List queryChildListByColumnId(int columnId){ + ColumnEntity columnEntity= (ColumnEntity)columnDao.getEntity(columnId); + List list = null; + if(columnEntity!=null){ + list = columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(columnEntity.getCategoryId(),columnEntity.getColumnWebsiteId(),null); + } + return list; + } + + /** + * 根据栏目ID查询其子栏目ID集合 + * @param categoryId 栏目ID + * @return 子栏目ID集合 + */ + public List queryChildIdsByColumnId(int categoryId,int appId){ + List list = new ArrayList(); + list = columnDao.queryColumnChildIdList(categoryId,appId); + return list; + } + + /** + * 根据栏目属性查询栏目站点id为columnWebsiteId的栏目集合 + * @param columnType 栏目属性 + * @param columnWebsiteId 栏目所属站点ID + * @return 栏目集合 + */ + public List queryColumnListBycolumnType(int columnType,int columnWebsiteId){ + + return columnDao.queryColumnListBycolumnType(columnType, columnWebsiteId); + } + + /** + * 用递归通过栏目ID查询栏目的父级栏目,将查询结果装入List集合中 + * @param columnId 栏目ID + * @param list 父级栏目集合 + */ + private void queryColumnParent(ColumnEntity column,List list){ + if(column.getCategoryCategoryId() != 0){ + ColumnEntity columnEntity = (ColumnEntity)columnDao.getEntity(column.getCategoryCategoryId()); + list.add(columnEntity); + queryColumnParent(columnEntity,list); + } + } + + /** + * 通过栏目ID查询栏目对应节点路径上的父级栏目集合 + * @param columnId 栏目ID + * @return 栏目及其父级栏目集合 + */ + public List queryParentColumnByColumnId(int columnId){ + List list = null; + ColumnEntity columnEntity = (ColumnEntity)columnDao.getEntity(columnId); + if(columnEntity != null){ + list = new ArrayList(); + //递归的查询所有父节点 + queryColumnParent(columnEntity,list); + } + return list; + } + + /** + * 根据站点Id查询该站点下的栏目的父栏目Id为categoryCategoryId的子栏目集合数目统计 + * @param categoryCategoryId 父栏目ID + * @param columnWebsiteId 站点ID + * @return 子栏目统计数目 + */ + public int queryColumnChildListCountByWebsiteId(int categoryCategoryId,int columnWebsiteId){ + return columnDao.queryColumnChildListCountByWebsiteId(categoryCategoryId, columnWebsiteId); + } + + /** + * 通过管理员ID和模块ID查询订单类型集合 + * @param categoryManagerId 管理员ID + * @param categoryModelId 模块ID + * @return 返回订单集合 + */ + public List queryCategoryByManagerIdAndModelId(int categoryManagerId, int categoryModelId){ + return columnDao.queryCategoryByManagerIdAndModelId(categoryManagerId, categoryModelId); + } + + + + @Override + public List querSibListByColumnId(int columnId) { + // TODO Auto-generated method stub + ColumnEntity columnEntity= (ColumnEntity)columnDao.getEntity(columnId); + List list = null; + if(columnEntity!=null){ + if(columnEntity.getCategoryId()!=0){ + list = columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(columnEntity.getCategoryId(),columnEntity.getColumnWebsiteId(),null); + } + + } + return list; + } + + + +} diff --git a/src/main/java/com/mingsoft/cms/biz/impl/ContentModelBizImpl.java b/src/main/java/com/mingsoft/cms/biz/impl/ContentModelBizImpl.java new file mode 100644 index 00000000..d240794d --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/impl/ContentModelBizImpl.java @@ -0,0 +1,98 @@ +package com.mingsoft.cms.biz.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.dao.IContentModelDao; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.util.PageUtil; +@Service("contentModelBiz") +public class ContentModelBizImpl extends BaseBizImpl implements IContentModelBiz{ + + /** + * 内容模型管理业务层 + */ + private IContentModelDao contentModelDao; + + + /** + * 获取内容模型业务层 + * @return 内容模型业务层 + */ + public IContentModelDao getContentModelDao() { + return contentModelDao; + } + + /** + * 设置内容模型业务层 + * @param contentModelDao 内容模型业务层 + */ + @Autowired + public void setContentModelDao(IContentModelDao contentModelDao) { + this.contentModelDao = contentModelDao; + } + + + /** + * 根据内容模型的表名查找实体 + */ + @Override + public ContentModelEntity getContentModelByTableName(String cmTableName) { + // TODO Auto-generated method stub + return (ContentModelEntity) contentModelDao.getContentModelByTableName(cmTableName); + } + + /** + * 获取内容模型的dao + */ + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return contentModelDao; + } + + /** + * 根据管理员Id查找内容模型的总数 + * @param cmManagerId 管理员id + * @return 记录总数 + */ + @Override + public int getContentModelByManagerId(int cmManagerId) { + // TODO Auto-generated method stub + return contentModelDao.getContentModelByManagerId(cmManagerId); + } + + /** + * 分页查询指定管理员的表单内容模型 + * @param entity 实体 + * @param page Map对象 + * @param order 排序方式,true:asc;fales:desc + * @param cmManagerId 管理员id + * @return + */ + @Override + public List queryPageByManagerId(PageUtil page, + String orderBy, boolean order, int cmManagerId) { + // TODO Auto-generated method stub + return contentModelDao.queryPageByManagerId(page.getPageNo(), page.getPageSize(), orderBy, order, cmManagerId); + } + + /** + * 根据管理员id查找内容模型实体 + * @param cmManagerId + * @return + */ + @Override + public List queryByManagerId(int cmManagerId) { + // TODO Auto-generated method stub + return contentModelDao.queryByManagerId(cmManagerId); + } + + +} diff --git a/src/main/java/com/mingsoft/cms/biz/impl/FieldBizImpl.java b/src/main/java/com/mingsoft/cms/biz/impl/FieldBizImpl.java new file mode 100644 index 00000000..56dc51bc --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/impl/FieldBizImpl.java @@ -0,0 +1,201 @@ +package com.mingsoft.cms.biz.impl; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.impl.BasicBizImpl; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.constant.e.FieldSearchEnum; +import com.mingsoft.cms.dao.IFieldDao; +import com.mingsoft.cms.entity.FieldEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:字段业务层实现类,继承BasicBizImpl,实现IFieldBiz + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +@Service("fieldBiz") +public class FieldBizImpl extends BasicBizImpl implements IFieldBiz{ + + /** + * 字段持久化层 + */ + @Autowired + private IFieldDao fieldDao; + + /** + * 获取fieldDao + */ + @Override + protected IBaseDao getDao() { + return fieldDao; + } + + /** + * 查询指定表单的自定义字段列表 + * @param fieldCmid 表单ID + * @return + */ + public List queryListByCmid(int fieldCmid){ + return fieldDao.queryListByCmid(fieldCmid); + } + + /** + * 统计指定表单的字段数量 + * @param fieldCmid + * @return + */ + public int queryCountByCmid(int fieldCmid){ + return fieldDao.queryCountByCmid(fieldCmid); + } + + /** + * 分页查询指定表单的字段 + * @param fieldCmid 表单ID + * @param pageNo 当前页 + * @param pageSize 每页显示数 + * @param orderBy 排序字段 + * @param order 排序方式 + * @return 返回字段集合 + */ + public List queryByPage(int fieldCmid,PageUtil page,String orderBy,boolean order){ + return fieldDao.queryByPage(fieldCmid, page.getPageNo(), page.getPageSize(), orderBy, order); + } + + /** + * 根据字段名和表单模型id查找符合条件的记录个数 + * @param fieldName :字段名 + * @param fieldCmdId : 表单模型id + * @return 记录个数 + */ + @Override + public int getCountFieldName(String fieldFieldName, int fieldCmdId) { + // TODO Auto-generated method stub + return fieldDao.getCountFieldName(fieldFieldName, fieldCmdId); + } + + /** + * 通过字段名获取字段实体 + * @param fieldFieldName 字段名 + * @return 字段实体 + */ + public FieldEntity getEntityByFieldName(String fieldFieldName){ + return fieldDao.getEntityByFieldName(fieldFieldName); + } + + /** + * 根据内容模型id和字段名查找字段实体 + * @param cmId + * @param fieldFieldName + * @return 字段实体 + */ + @Override + public FieldEntity getEntityByCmId(int cmId, String fieldFieldName) { + return fieldDao.getEntityByCmId(cmId, fieldFieldName); + } + + /** + * 根据自定义字段信息动态查询表 + * @param table 表名 + * @param diyFieldName 自定义字段 + * @return 返回ID集合 + */ + public List queryListBySQL(String table,Map diyFieldName){ + + // 根据列名查找字段实体 + List listField = new ArrayList(); + Iterator it = diyFieldName.keySet().iterator(); + + for(Iterator iter = diyFieldName.keySet().iterator();iter.hasNext();){ + FieldEntity field = fieldDao.getEntityByFieldName(iter.next().toString()); + if(field!=null){ + listField.add(field); + } + } + + String where = "where 1=1"; + for(int i = 0;i0){ + //取出“-”的前一位数 + int preNum = 1; + //取出“-”的后一位数 + int nextNum = 12; + where +=" and "+ listField.get(i).getFieldFieldName()+" between " + preNum +" and " +nextNum; + }else{ + where +=" and "+listField.get(i).getFieldFieldName()+" = "+Integer.valueOf(diyFieldName.get(key)); + } + }else{ + where +=" and "+listField.get(i).getFieldFieldName()+" like "+"'%"+String.valueOf(diyFieldName.get(key))+"%'"; + } + + } + } + } + List listMap = fieldDao.queryListByListField(table,where); + List listIds= new ArrayList(); + for(int i = 0;i queryByContentModelId(int contentModelId) { + return this.fieldDao.queryByContentModelId(contentModelId); + } + + @Override + public List queryByIsSearch(int contentMdoelId, FieldSearchEnum fieldIsSearch) { + // TODO Auto-generated method stub + return this.fieldDao.queryByIsSearch(contentMdoelId, fieldIsSearch.toInt()); + } + + +} diff --git a/src/main/java/com/mingsoft/cms/biz/impl/SearchBizImpl.java b/src/main/java/com/mingsoft/cms/biz/impl/SearchBizImpl.java new file mode 100644 index 00000000..aedd6fe3 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/biz/impl/SearchBizImpl.java @@ -0,0 +1,102 @@ +package com.mingsoft.cms.biz.impl; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.biz.impl.BasicBizImpl; +import com.mingsoft.cms.biz.ISearchBiz; +import com.mingsoft.cms.dao.ISearchDao; +import com.mingsoft.cms.entity.SearchEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:搜索业务层实现类,继承BasicBizImpl,实现ISearchBiz + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +@Service("searchBiz") +public class SearchBizImpl extends BasicBizImpl implements ISearchBiz{ + + /** + * 搜索持久化层 + */ + @Autowired + private ISearchDao searchDao; + + /** + * 获取searchDao + */ + @Override + protected IBaseDao getDao() { + return searchDao; + } + + /** + * 通过数字区域来查询数据集合 + * @param cmTableName 表名 + * @param fieldFieldName 字段名 + * @param preNum 第一个数 + * @param nextNum 第二个数 + * @return 返回数据集合 + */ + @SuppressWarnings("rawtypes") + public Map queryMapByNumArea(String cmTableName,String fieldFieldName,int preNum,int nextNum){ + return searchDao.queryMapByNumArea(cmTableName, fieldFieldName, preNum, nextNum); + } + + /** + * 查询列表 + * @param appId 应用编号 + * @param page 分页 + */ + @Override + public List query( int appId,PageUtil page) { + return searchDao.query(appId,page.getPageNo()*page.getPageSize(),page.getPageSize()); + } + + + /** + * + */ + @Override + public SearchEntity getByIdAndAppId(int id, int appId) { + return searchDao.getByIdAndAppId(id, appId); + } + + @Override + public int queryCount(int appId) { + return searchDao.queryCount(appId); + } +} diff --git a/src/main/java/com/mingsoft/cms/constant/e/ArticleTypeConstant.java b/src/main/java/com/mingsoft/cms/constant/e/ArticleTypeConstant.java new file mode 100644 index 00000000..b127bb6a --- /dev/null +++ b/src/main/java/com/mingsoft/cms/constant/e/ArticleTypeConstant.java @@ -0,0 +1,22 @@ +package com.mingsoft.cms.constant.e; +/** + * 栏目模块中引入的静态常量 + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public interface ArticleTypeConstant { + /** + * 栏目属性 + * 最终栏目列表 + */ + final String ARTICLETYPE_QUALITY_ONE = "最终栏目列表"; + + /** + * 栏目属性 + * 频道栏目列表 + */ + final String ARTICLETYPE_QUALITY_TWO = "封面"; + +} diff --git a/src/main/java/com/mingsoft/cms/constant/e/ColumnTypeEnum.java b/src/main/java/com/mingsoft/cms/constant/e/ColumnTypeEnum.java new file mode 100644 index 00000000..98968e45 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/constant/e/ColumnTypeEnum.java @@ -0,0 +1,57 @@ +package com.mingsoft.cms.constant.e; + +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 + * QQ:78750478 + * + *

+ * Comments:文章栏目分类类型 + *

+ * + *

+ * Create Date:2015-1-18 + *

+ * + *

+ * Modification history: + *

+ */ +public enum ColumnTypeEnum implements BaseEnum { + /** + * 列表 + */ + COLUMN_TYPE_LIST(1), + /** + * 单页 + */ + COLUMN_TYPE_COVER(2), + /** + * 跳转地址 + */ + COLUMN_TYPE_URL(3); + + ColumnTypeEnum(Object code) { + this.code = code; + } + + private Object code; + @Override + public int toInt() { + // TODO Auto-generated method stub + return Integer.valueOf(code+""); + } + +} diff --git a/src/main/java/com/mingsoft/cms/constant/e/FieldSearchEnum.java b/src/main/java/com/mingsoft/cms/constant/e/FieldSearchEnum.java new file mode 100644 index 00000000..6f7e6319 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/constant/e/FieldSearchEnum.java @@ -0,0 +1,31 @@ +package com.mingsoft.cms.constant.e; + +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * 字段是否支持搜索 + * @author Administrator + * + */ +public enum FieldSearchEnum implements BaseEnum { + /** + * 不支持搜索 + */ + NOT("0"), + /** + * 支持搜索 + */ + IS("1"); + + FieldSearchEnum(Object code) { + this.code = code; + } + + private Object code; + @Override + public int toInt() { + // TODO Auto-generated method stub + return Integer.valueOf(code+""); + } + +} diff --git a/src/main/java/com/mingsoft/cms/dao/IArticleDao.java b/src/main/java/com/mingsoft/cms/dao/IArticleDao.java new file mode 100644 index 00000000..e47a8752 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/IArticleDao.java @@ -0,0 +1,371 @@ +package com.mingsoft.cms.dao; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Param; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 郭鹏辉 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:文章管理持久化层 || 继承IBaseDao持久化层 + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IArticleDao extends IBaseDao { + + + /** + * 获取站点下文章总条数 + * + * @param webId + * webId 站点id
+ * @return 返回查询总条数 + */ + public int getCountByWebsiteId(@Param("webId") int webId); + + /** + * 根据站点获取文章列表 + * + * @param webId + * 站点id + * @param pageNo + * @param pageSize + * @param orderBy + * 排序字段
+ * @param order + * 排序方式true:asc false:desc
+ * @return 文章集合 + */ + public List queryPageListByWebsiteId(@Param("webId") int webId, @Param("pageNo") int pageNo, @Param("pageSize") int pageSize, + @Param("orderBy") String orderBy, @Param("order") boolean order); + + /** + * 根据栏目id获取该栏目下所有文章 + * + * @param typeId + * 文章所属栏目 + * @param articleId + * 文章id + * @return Map集合 + */ + public List queryArticleMap(@Param("basicCategoryId") int basicCategoryId); + + /** + * 查询指定栏目下的需要的文章属性和不需要的文章属性 + * + * @param basicCategoryIds + * 栏目id
+ * @param flag + * 需要的文章属性
+ * @param noFlag + * 不需要的文章属性
+ * @return 返回查询总条数 + */ + @SuppressWarnings("rawtypes") + public int getCountByColumnId(@Param("webId") int webId, @Param("basicCategoryIds") List basicCategoryIds, @Param("flag") String flag, + @Param("noFlag") String noFlag); + + /** + * 根据栏目ID,flag,等属性获取文章 + * + * @param webId + * 站点编号 + * @param ids + * 栏目ids + * @param flag + * 需要的文章属性 + * @param noFlag + * 不需要的文章属性 + * @param begin光标开始位置 + * @param count + * 每页显示条数 + * @param orderBy + * 排序依据字段 + * @param order + * false,true + * @param keyword + * 关键字 + * @return 文章集合 + */ + public List queryList(@Param("webId") int webId, @Param("basicCategoryIds") List basicCategoryIds, + @Param("flag") String flag, @Param("noFlag") String noFlag, @Param("begin") int begin, @Param("count") int count, + @Param("orderBy") String orderBy, @Param("order") boolean order,@Param("keyword") String keyword); + + + /** + * 文章查询 + * + * @para  webId 网站编号 + * @param basicCategoryId + *  栏目编号集合 + * @param flag + *  文章属性 + * @param noFlag + *  文章不存在的属性 + * @param start + *  开始位置 + * @param pageSize + *  一页显示数量 + * @param orderBy + *  排序字段 + * @param order + *  排序方式 + * @return 文章集合 + */ + public List query(@Param("webId") int webId, @Param("basicCategoryId") int basicCategoryId, + @Param("flag") String flag, @Param("noFlag") String noFlag, @Param("begin") int begin, @Param("count") int count, + @Param("orderBy") String orderBy, @Param("order") boolean order); + + /** + * @para  webId 网站编号 + * @param basicCategoryId + *  栏目编号 + * @param flag + *  文章属性 + * @param noFlag + *  文章不存在的属性 + * @param keyword 文章关键字 + * @return 文章总数 + */ + int count(@Param("webId")int webId, @Param("basicCategoryId") int basicCategoryId, @Param("flag")String flag, @Param("noFlag")String noFlag,@Param("keyword")String keyword); + + + /** + * 根据页面栏目的id获取与其绑定的文章实体 + * + * @param basicCategoryId + * @return 文章实体 + */ + public List queryListByColumnId(@Param("basicCategoryId") int basicCategoryId); + + /** + * 根据站点获取的所有栏目 + * + * @param basicId + * @return 文章集合 + */ + public List queryListByWebsiteId(@Param("basicId") int basicId); + + /** + * 根据栏目id和文章更新时间获取文章 + * + * @param basicCategoryId 分类编号 + * @param dateTime 时间 + * @param appId 应用时间 + * @return 文章集合 + */ + public List queryListByTime(@Param("basicCategoryId") int basicCategoryId, @Param("dateTime") String dateTime,@Param("appId") int appId); + + /** + * 根据文章ID集合查询文章实体集合 + * + * @param articleIds + * 文章ID集合 + * @return 文章实体集合 + */ + @SuppressWarnings("rawtypes") + public List queryListByArticleIds(@Param("articleIds") List articleIds); + + /** + * 根据文章字段条件查询文章集合 + * + * @param articleFieldName + * 文章字段 + * @return 文章ID集合 + */ + public List queryListByArticleField(@Param("articleFieldName") Map articleFieldName); + + /** + * 根据文章id查找文章的总数 + * + * @param webId + * @param articleIds + * :文章id + * @param flag + * 推荐属性 + * @param noFlag + * 不推荐属性 + * @return 文章总数 + */ + public int getCountByArticleIds(@Param("webId") int webId, @Param("articleIds") List articleIds, @Param("flag") String flag, + @Param("noFlag") String noFlag); + + /** + * 根据文章列表ID,flag,等属性获取文章 + * + * @param webId + * 站点编号 + * @param ids + * 栏目ids + * @param flag + * 需要的文章属性 + * @param noFlag + * 不需要的文章属性 + * @param begin光标开始位置 + * @param count + * 每页显示条数 + * @param orderBy + * 排序依据字段 + * @param order + * false,true + * @return 文章集合 + */ + public List queryListByListArticleId(@Param("webId") int webId, @Param("articleIds") List articleIds, + @Param("flag") String flag, @Param("noFlag") String noFlag, @Param("begin") int begin, @Param("count") int count, + @Param("orderBy") String orderBy, @Param("order") boolean order); + + /** + * 根据查询文章实体 + * + * @param tableName + * :自定义生成的表名 + * @param map + * 获取查询条件的Map key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段 + * list[1]:是否为整形 list[2]:是否是等值查询 list[3]:字段的值 + * @return 文章实体 + */ + public List queryListForSearch(@Param("tableName") String tableName, @Param("map") Map map, + @Param("page") PageUtil page, @Param("websiteId") int websiteId,@Param("ids") List ids,@Param("sortMap") Map sortMap); + + /** + * 根据查询文章实体总数 + * + * @param tableName + * :自定义生成的表名 + * @param map + * key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段 list[1]:是否为整形 + * list[2]:是否是等值查询 list[3]:字段的值 + * @return 文章实体总数 + */ + public int getSearchCount(@Param("tableName") String tableName, @Param("map") Map map, @Param("websiteId") int websiteId,@Param("ids")List ids); + + /** + * 通过视图表来查询文章列表 + * + * @param categoryId + * 分类编号 + * + * @param categoryIds + * 分类编号集合 + * @param page + * 分頁 + * @param contentModelTableName + * 关联模型表,更具分类id自动绑定 + * @return + */ + public List queryPageByCategoryId(@Param("categoryId") int categoryId, @Param("categoryIds") List categoryIds, @Param("page") PageUtil page, + @Param("contentModelTableName") String contentModelTableName); + + /** + * 通过视图表来查询文章总数 + * + * @param categoryId + * 分类编号 + * @return 总数 + */ + public int countByCategoryId(@Param("categoryId") int categoryId); + + /** + * 通过分类id获取文章内容 + * @param categoryId 分类编号 + * @return 文章集合 + */ + public List getByCategoryId(@Param("categoryId") int categoryId); + + /** + * 通过视图表来查询文章总数 + * + * @param basicId + * 文章编号 + * @param contentModelTableName + * 对应模块表名称 + */ + public List getById(@Param("basicId") int basicId,@Param("contentModelTableName") String contentModelTableName); + + /** + * 根据文章id集合获取文章列表 + * @param basicId 文章编号,便于提供UNION使用 + * @param basicIds id集合 + * @return 列表 + */ + public List queryByBasicIds(@Param("basicId")int basicId,@Param("basicIds") Integer[] basicIds); + + /** + * 通过文章标题来查询文章集合 + * @param articleTitle 文章标题 + * @param webId 应用ID + * @param modelCode 模块编号 + * @return basicTitle,categoryId的map集合 + */ + public List queryByArticleTitle(@Param("articleTitle")String articleTitle,@Param("webId")int webId,@Param("modelCode")String modelCode); + + /** + * 根据分类与时间查询文章列表 + * @param categoryId 分类编号 + * @param dateTime 时间 + * @return 文章 + */ + public List query(@Param("categoryId")Integer categoryId,@Param("dateTime")String dateTime); + + /** + * 查找basicId上一篇文章 + * @param appId 应用编号 + * @param basicId 文章编号 + * @param flag true:上一条 false:下一条 + * @return + */ + public ArticleEntity getNextOrPrevious(@Param("appId")int appId, @Param("basicId")int basicId, @Param("flag")boolean flag,@Param("categoryId")Integer categoryId); + + /** + * 根据栏目id删除文章实体 + * @param columnId 栏目id + */ + public void deleteByColumnId(int columnId); + + + + /** + * 查询文章bean实体,只返回文章的基本信息 + * @param appId 应用id + * @param categoryId 分类id + * @param categoryIds 子分类集合 + * @return 文章集合 + */ + public List queryByCategoryForBean(@Param("categoryId")Integer categoryId,@Param("categoryIds") List categoryIds,@Param("page") PageUtil page,@Param("contentModelTableName") String contentModelTableName); + + +} diff --git a/src/main/java/com/mingsoft/cms/dao/IArticleDao.xml b/src/main/java/com/mingsoft/cms/dao/IArticleDao.xml new file mode 100644 index 00000000..c6dd06cf --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/IArticleDao.xml @@ -0,0 +1,742 @@ + + + + + + + a.ARTICLE_BASICID,a.ARTICLE_CONTENT,a.ARTICLE_AUTHOR,a.ARTICLE_TYPE,a.ARTICLE_SOURCE,a.ARTICLE_URL,a.ARTICLE_KEYWORD,a.ARTICLE_FREEORDER,a.ARTICLE_WEBID, + b.BASIC_ID,b.BASIC_TITLE,b.BASIC_DESCRIPTION,b.BASIC_THUMBNAILS,b.BASIC_HIT,b.BASIC_DATETIME,b.BASIC_UPDATETIME,b.BASIC_PEOPLEID,b.BASIC_CATEGORYID,b.BASIC_SORT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BASIC_ID,ARTICLE_AUTHOR,ARTICLE_TYPE,ARTICLE_SOURCE,ARTICLE_URL,ARTICLE_KEYWORD,ARTICLE_FREEORDER, + BASIC_TITLE,BASIC_DESCRIPTION,BASIC_THUMBNAILS,BASIC_HIT,BASIC_DATETIME,BASIC_UPDATETIME,BASIC_PEOPLEID,BASIC_CATEGORYID,BASIC_SORT + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into cms_article + + + ARTICLE_BASICID, + ARTICLE_CONTENT, + ARTICLE_AUTHOR, + ARTICLE_TYPE, + ARTICLE_SOURCE, + ARTICLE_URL, + ARTICLE_KEYWORD, + ARTICLE_FREEORDER, + ARTICLE_WEBID, + + + + #{basicId}, + #{articleContent}, + #{articleAuthor}, + #{articleType}, + #{articleSource}, + #{articleUrl}, + #{articleKeyword}, + #{articleFreeOrder}, + #{articleWebId}, + + + + + + + delete from cms_article + where ARTICLE_BASICID = #{basicId} + + + + + + update cms_article + + ARTICLE_CONTENT=#{articleContent}, + ARTICLE_AUTHOR=#{articleAuthor}, + ARTICLE_TYPE=#{articleType}, + ARTICLE_SOURCE=#{articleSource}, + ARTICLE_URL=#{articleUrl}, + ARTICLE_KEYWORD=#{articleKeyword}, + ARTICLE_FREEORDER=#{articleFreeOrder}, + ARTICLE_WEBID=#{articleWebId}, + + where ARTICLE_BASICID = #{basicId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from cms_article + where BASIC_CATEGORYID = #{columnId} + + + + + + + + delete from cms_article + + ARTICLE_BASICID in #{item} + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/cms/dao/IColumnDao.java b/src/main/java/com/mingsoft/cms/dao/IColumnDao.java new file mode 100644 index 00000000..2cd17632 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/IColumnDao.java @@ -0,0 +1,105 @@ +package com.mingsoft.cms.dao; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.basic.entity.BasicEntity; +import com.mingsoft.cms.entity.ColumnEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: 栏目持久化层接口,继承IBaseDao接口 + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IColumnDao extends IBaseDao { + + + /** + * 根据站点ID查询该站点下的栏目集合 + * @param columnWebsiteId 站点Id + * @return 栏目集合 + */ + public List queryColumnListByWebsiteId(@Param("columnWebsiteId")int columnWebsiteId); + + /** + * 根据站点Id查询该站点下的栏目的父栏目Id为categoryCategoryId的子栏目集合 + * @param categoryCategoryId 父栏目ID + * @param columnWebsiteId 站点Id + * @return 栏目集合 + */ + public List queryColumnByCategoryIdAndWebsiteIdAndModelId(@Param("categoryCategoryId")int categoryCategoryId,@Param("columnWebsiteId")int columnWebsiteId,@Param("modelId")Integer modelId); + + /** + * 根据栏目ID查询其子栏目ID集合 + * @param categoryId 栏目ID + * @param appId 栏目ID + * @return 子栏目ID集合 + */ + public List queryColumnChildIdList(@Param("categoryId")int categoryId,@Param("appId")int appId); + + /** + * 根据栏目属性和栏目模块编码查询栏目站点id为columnWebsiteId的栏目集合 + * @param columnType 栏目属性 + * @param columnWebsiteId 栏目所属站点ID + * @return 栏目对象 + */ + public List queryColumnListBycolumnType(@Param("columnType")int columnType,@Param("columnWebsiteId")int columnWebsiteId); + + /** + * 根据站点Id查询该站点下的栏目的父栏目Id为categoryCategoryId的子栏目集合数目统计 + * @param categoryCategoryId 父栏目ID + * @param columnWebsiteId 站点ID + * @return 子栏目统计数目 + */ + public int queryColumnChildListCountByWebsiteId(@Param("categoryCategoryId")int categoryCategoryId,@Param("columnWebsiteId")int columnWebsiteId); + + + /** + * 通过管理员ID和模块ID查询订单类型集合 + * @param categoryManagerId 管理员ID + * @param categoryModelId 模块ID + * @return 返回订单集合 + */ + public List queryCategoryByManagerIdAndModelId(@Param("categoryManagerId")int categoryManagerId, @Param("categoryModelId")int categoryModelId); + + /** + * 获取当前应用下面对应模块的所以栏目分类 + * @param columnWebsiteId 站点信息 + * @param modelId 模块信息 + * @return 记录集合 + */ + public List queryByAppIdAndModelId(@Param("appId")int appId, @Param("modelId")int modelId); + +} diff --git a/src/main/java/com/mingsoft/cms/dao/IColumnDao.xml b/src/main/java/com/mingsoft/cms/dao/IColumnDao.xml new file mode 100644 index 00000000..b6f0fb6c --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/IColumnDao.xml @@ -0,0 +1,169 @@ + + + + + co.column_categoryid,co.column_keyword,co.column_descrip,co.column_type,co.column_url,co.column_listurl,co.column_contentmodelid,co.column_websiteid,co.column_path, + ca.category_id,ca.category_title,ca.category_sort,ca.category_datetime,ca.category_managerid,ca.category_modelid,ca.category_categoryid,ca.category_smallimg + + + + category_id,category_title,category_sort,category_datetime,category_managerid,category_modelid,category_categoryid,category_smallimg + + + + and (ca.category_modelid=7 or ca.category_modelid=53) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into cms_column + + + column_categoryid, + column_keyword, + column_descrip, + column_type, + column_url, + column_listurl, + column_contentmodelid, + column_websiteid, + column_path, + + + + + #{categoryId}, + #{columnKeyword}, + #{columnDescrip}, + #{columnType}, + #{columnUrl}, + #{columnListUrl}, + #{columnContentModelId}, + #{columnWebsiteId}, + #{columnPath}, + + + + + + + update cms_column + + column_keyword=#{columnKeyword}, + column_descrip=#{columnDescrip}, + column_type=#{columnType}, + column_url=#{columnUrl}, + column_listurl=#{columnListUrl}, + column_contentmodelid=#{columnContentModelId}, + column_websiteid=#{columnWebsiteId}, + column_path=#{columnPath}, + + where column_categoryid = #{categoryId} + + + + + + delete from cms_column where + column_categoryid = #{categoryId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/cms/dao/IContentModelDao.java b/src/main/java/com/mingsoft/cms/dao/IContentModelDao.java new file mode 100644 index 00000000..b6b64d8a --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/IContentModelDao.java @@ -0,0 +1,76 @@ +package com.mingsoft.cms.dao; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 史爱华 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:字段管理持久化层 || 继承IBaseDao持久化层 + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IContentModelDao extends IBaseDao{ + + /** + * 根据内容模型的表名查找实体 + * @param cmTableName 内容模型表名 + */ + public BaseEntity getContentModelByTableName(String cmTableName); + + /** + * 根据管理员Id查找内容模型的总数 + * @param cmManagerId 管理员id + * @return 内容模型总数 + */ + public int getContentModelByManagerId(int cmManagerId); + + /** + * 根据管理员id查找内容模型实体 + * @param cmManagerId 管理员id + * @return 内容模型列表集合 + */ + public List queryByManagerId(int cmManagerId); + + /** + * 分页查询指定管理员的表单内容模型 + * @param entity 实体 + * @param page Map对象 + * @param order 排序方式,true:asc;fales:desc + * @param cmManagerId 管理员id + * @return 内容模型列表集合 + */ + List queryPageByManagerId(@Param("pageNo")int pageNo,@Param("pageSize")int pageSize,@Param("orderBy")String orderBy,@Param("order") boolean order,@Param("cmManagerId") int cmManagerId); +} diff --git a/src/main/java/com/mingsoft/cms/dao/IContentModelDao.xml b/src/main/java/com/mingsoft/cms/dao/IContentModelDao.xml new file mode 100644 index 00000000..8cd23f0e --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/IContentModelDao.xml @@ -0,0 +1,135 @@ + + + + + + + + CM_ID,CM_TIPSNAME,CM_TABLENAME,CM_MANAGERID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into cms_content_model + + + CM_ID, + CM_TIPSNAME, + CM_TABLENAME, + CM_MANAGERID, + + + + + #{cmId}, + #{cmTipsName}, + #{cmTableName}, + #{cmManagerId}, + + + + + + + update cms_content_model + + CM_TIPSNAME=#{cmTipsName}, + CM_TABLENAME=#{cmTableName}, + CM_MANAGERID=#{cmManagerId}, + + where CM_ID = #{cmId} + + + + + + delete from cms_content_model + where CM_ID = #{cmId} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/cms/dao/IFieldDao.java b/src/main/java/com/mingsoft/cms/dao/IFieldDao.java new file mode 100644 index 00000000..3c4770a4 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/IFieldDao.java @@ -0,0 +1,133 @@ +package com.mingsoft.cms.dao; +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Param; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.cms.entity.FieldEntity; +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 史爱华 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:字段管理持久化层 || 继承IBaseDao持久化层 + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IFieldDao extends IBaseDao{ + + /** + * 查询指定表单的自定义字段列表 + * @param fieldCmid 表单ID + * @return 表单的自定义字段列表 + */ + public List queryListByCmid(int fieldCmid); + + /** + * 统计指定表单的字段数量 + * @param fieldCmid 表单ID + * @return 表单的字段总数 + */ + public int queryCountByCmid(int fieldCmid); + + /** + * 分页查询指定表单的字段 + * @param fieldCmid 表单ID + * @param pageNo 当前页 + * @param pageSize 每页显示数 + * @param orderBy 排序字段 + * @param order 排序方式 + * @return 返回字段集合 + */ + public List queryByPage(@Param("fieldCmid")int fieldCmid,@Param("pageNo")int pageNo,@Param("pageSize")int pageSize,@Param("orderBy")String orderBy,@Param("order") boolean order); + + /** + * 根据字段名和表单模型id查找符合条件的记录个数 + * @param fieldName :字段名 + * @param fieldCmdId : 表单模型id + * @return 记录个数 + */ + public int getCountFieldName(@Param("fieldFieldName")String fieldFieldName,@Param("fieldCmdId")int fieldCmdId); + + /** + * 根据表单类型id查找字段列表 + * @param cmId 表单类型id + * @return 字段列表 + */ + public List queryListByCmId(@Param("fieldCmId")int fieldCmId); + + /** + * 通过字段名获取字段实体 + * @param fieldFieldName 字段名 + * @return 字段实体 + */ + public FieldEntity getEntityByFieldName(String fieldFieldName); + + /** + * 根据内容模型id和字段名查找字段实体 + * @param cmId + * @param fieldFieldName + * @return 字段实体 + */ + public FieldEntity getEntityByCmId(@Param("cmId") int cmId,@Param("fieldFieldName")String fieldFieldName); + + /** + * 根据自定义字段信息动态查询表 + * @param table 表名 + * @param diyFieldName 自定义字段 + * @return 返回ID集合 + */ + public List queryListBySQL(@Param("table") String table, @Param("diyFieldName")Map diyFieldName); + + + /** + * 根据表名和指定条件查询 + * @param table 自定义字段表名 + * @param where 指定的查询条件 + * @return 字段集合 + */ + public List queryListByListField(@Param("table") String table,@Param("where") String where); + + + /** + * 根据内容模型id获取到所有的字段 + * @param contentModelId 内容模型字段 + * @return 集合 + */ + public List queryByContentModelId(@Param("contentModelId") int contentModelId); + + /** + * 根据内容模型id和是否搜索查询字段实体列表 + * @param contentModelId 内容模型id + * @param isSearch 是否搜索 + * @return 字段实体列表 + */ + public List queryByIsSearch(@Param("contentModelId") Integer contentModelId,@Param("fieldIsSearch")Integer fieldIsSearch); +} diff --git a/src/main/java/com/mingsoft/cms/dao/IFieldDao.xml b/src/main/java/com/mingsoft/cms/dao/IFieldDao.xml new file mode 100644 index 00000000..4ce5743f --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/IFieldDao.xml @@ -0,0 +1,163 @@ + + + + + + FIELD_ID,FIELD_TIPSNAME,FIELD_FIELDNAME,FIELD_TYPE,FIELD_CMID,FIELD_DEFAULT,FIELD_ISNULL,FIELD_ISSEARCH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into cms_content_mode_field + + FIELD_TIPSNAME, + FIELD_FIELDNAME, + FIELD_TYPE, + FIELD_CMID, + FIELD_DEFAULT, + FIELD_ISNULL, + FIELD_ISSEARCH, + + + #{fieldTipsName}, + #{fieldFieldName}, + #{fieldType}, + #{fieldCmid}, + #{fieldDefault}, + #{fieldIsNull}, + #{fieldIsSearch} + + + + + + + delete from cms_content_mode_field where FIELD_ID = #{fieldId} + + + + + + + + + + + + + + + + + + update cms_content_mode_field + + FIELD_TIPSNAME=#{fieldTipsName}, + FIELD_FIELDNAME=#{fieldFieldName}, + FIELD_TYPE=#{fieldType}, + FIELD_CMID=#{fieldCmid}, + FIELD_DEFAULT=#{fieldDefault}, + FIELD_ISNULL=#{fieldIsNull}, + FIELD_ISSEARCH=#{fieldIsSearch} + + where FIELD_ID=#{fieldId}; + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/cms/dao/ISearchDao.java b/src/main/java/com/mingsoft/cms/dao/ISearchDao.java new file mode 100644 index 00000000..f9262c2a --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/ISearchDao.java @@ -0,0 +1,82 @@ +package com.mingsoft.cms.dao; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Param; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.cms.entity.SearchEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:搜索持久化层,继承IBaseDao持久化层 + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history: + *

+ */ +public interface ISearchDao extends IBaseDao{ + + /** + * 通过数字区域来查询数据集合 + * @param cmTableName 表名 + * @param fieldFieldName 字段名 + * @param preNum 第一个数 + * @param nextNum 第二个数 + * @return 返回数据集合 + */ + @SuppressWarnings("rawtypes") + public Map queryMapByNumArea(@Param("cmTableName") String cmTableName,@Param("fieldFieldName") String fieldFieldName,@Param("preNum") int preNum,@Param("nextNum") int nextNum); + + /** + * 通过id与应用id获取搜索 + * @param id 主键 + * @param appId 应用编号 + * @return 搜索实体 + */ + public SearchEntity getByIdAndAppId(@Param("id") int id,@Param("appId") int appId); + + + /** + * 查询列表 + * @param appId 应用编号 + * @param start 分页 + * @param pageSize 显示数量 + */ + public List query(@Param("appId")int appId, @Param("start")int start, @Param("pageSize")int pageSize); + + /** + * 根据站点id查询数据表中记录集合总数 + * @param appId 站点id + * @return + */ + int queryCount(@Param("appId")int appId); +} diff --git a/src/main/java/com/mingsoft/cms/dao/ISearchDao.xml b/src/main/java/com/mingsoft/cms/dao/ISearchDao.xml new file mode 100644 index 00000000..a0d38917 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/dao/ISearchDao.xml @@ -0,0 +1,116 @@ + + + + + + SEARCH_ID,SEARCH_NAME,SEARCH_TEMPLETS,SEARCH_WEBSITEID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into cms_search + + SEARCH_NAME, + SEARCH_TEMPLETS, + SEARCH_WEBSITEID, + + + #{searchName}, + #{searchTemplets}, + #{searchWebsiteId} + + + + + + + delete from cms_search + where SEARCH_ID = #{searchId} + + + + + + + + + + + + + + + + + + update cms_search + + SEARCH_NAME=#{searchName}, + SEARCH_TEMPLETS=#{searchTemplets}, + + where SEARCH_ID=#{searchId}; + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/cms/entity/ArticleEntity.java b/src/main/java/com/mingsoft/cms/entity/ArticleEntity.java new file mode 100644 index 00000000..7c377e55 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/entity/ArticleEntity.java @@ -0,0 +1,294 @@ +package com.mingsoft.cms.entity; + +import java.io.File; + +import com.mingsoft.basic.entity.AppEntity; + +import com.mingsoft.basic.entity.BasicEntity; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.StringUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名 郭鹏辉 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:文章模块实体类 || 继承BasicEntity实体 + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +public class ArticleEntity extends BasicEntity{ + + /** + * 文章Id + */ + private int articleID; + + /** + * 文章内容 + */ + private String articleContent; + + /** + * 文章作者 + */ + private String articleAuthor; + + /** + * 文章属性 + */ + private String articleType ; + + /** + * 文章的来源 + */ + private String articleSource; + + /** + * 文章跳转链接地址 + */ + private String articleUrl; + + /** + * 文章关键字 + */ + private String articleKeyword; + + /** + * 文章自定义显示顺序 + */ + @Deprecated + private int articleFreeOrder; + + + /** + * 站点d + */ + private int articleWebId; + + /** + * 文章url地址 主要是用户生成html使用 + */ + private String articleLinkURL; + + /** + * 文章分类url地址,主要是用户生成html使用 + */ + private String articleTypeLinkURL; + + /** + * 一对一管理栏目 + */ + private ColumnEntity column; + + + /** + * 获取文章实体所属的栏目实体 + * @return + */ + public ColumnEntity getColumn() { + return column; + } + + /** + * 设置文章所属的栏目实体 + * @param column + */ + public void setColumn(ColumnEntity column) { + this.column = column; + } + + public String getArticleTypeLinkURL() { + return articleTypeLinkURL; + } + + public void setArticleTypeLinkURL(String articleTypeLinkURL) { + this.articleTypeLinkURL = articleTypeLinkURL; + } + + public String getArticleLinkURL() { + return articleLinkURL; + } + + public void setArticleLinkURL(String articleLinkURL) { + this.articleLinkURL = articleLinkURL; + } + + /** + * 获取文章作者 + * @return 返回文章作者 + */ + public String getArticleAuthor() { + return articleAuthor; + } + + /** + * 获取文章内容 + * @return 返回文章内容 + */ + public String getArticleContent() { + return articleContent; + } + + /** + * 获取自定义显示顺序 + * @return + */ + public int getArticleFreeOrder() { + return articleFreeOrder; + } + + /** + * 获取文章Id + * @return 返回文章Id + */ + public int getArticleID() { + return articleID; + } + + /** + * 获取文章关键字 + * @return 返回文章关键字 + */ + public String getArticleKeyword() { + return articleKeyword; + } + + /** + * 获取文章的来源 + * @return 返回文章的来源 + */ + public String getArticleSource() { + return articleSource; + } + + /** + * 获取文章属性 + * @return 返回文章属性 + */ + public String getArticleType() { + return articleType; + } + + /** + * 获取文章跳转链接 + * @return 返回文章跳转链接 + */ + public String getArticleUrl() { + return articleUrl; + } + + /** + * 获取文章站点id + * @return + */ + public int getArticleWebId() { + return articleWebId; + } + + /** + * 设置文章作者 + * @param articleAuthor 传入文章作者 + */ + public void setArticleAuthor(String articleAuthor) { + this.articleAuthor = articleAuthor; + } + + /** + * 设置文章内容 + * @param articleContent 传入文章内容 + */ + public void setArticleContent(String articleContent) { + this.articleContent = articleContent; + } + + /** + * 设置文章自定义显示循序排序 + * @param articleFreeOrder + */ + public void setArticleFreeOrder(int articleFreeOrder) { + this.articleFreeOrder = articleFreeOrder; + } + + /** + * 设置文章Id + * @param articleID 传入文章Id + */ + public void setArticleID(int articleID) { + this.articleID = articleID; + } + + /** + * 设置文章关键字 + * @param articleKeyword 传入文章关键字列表 + */ + public void setArticleKeyword(String articleKeyword) { + this.articleKeyword = articleKeyword; + } + + /** + * 设置文章的来源 + * @param articleSource 传入文章的来源 + */ + public void setArticleSource(String articleSource) { + this.articleSource = articleSource; + } + + /** + * 设置文章属性 + * @param articleType 传入文章属性 + */ + public void setArticleType(String articleType) { + this.articleType = articleType; + } + + /** + * 设置文章跳转链接 + * @param articleUrl 传入文章跳转链接地址 + */ + public void setArticleUrl(String articleUrl) { + this.articleUrl = articleUrl; + } + + + /** + * 设置文章站点id + * @param articleWebId + */ + public void setArticleWebId(int articleWebId) { + this.articleWebId = articleWebId; + } + + public String getArticleUrl(AppEntity app) { + if (!StringUtil.isBlank(app.getAppMobileStyle())) { + return app.getAppHostUrl()+IParserRegexConstant.HTML_SAVE_PATH+File.separator+"m"+File.separator+this.getArticleUrl(); + } + return app.getAppHostUrl()+File.separator+IParserRegexConstant.HTML_SAVE_PATH+File.separator+this.getArticleUrl(); + } +} diff --git a/src/main/java/com/mingsoft/cms/entity/ColumnEntity.java b/src/main/java/com/mingsoft/cms/entity/ColumnEntity.java new file mode 100644 index 00000000..78ec9c0a --- /dev/null +++ b/src/main/java/com/mingsoft/cms/entity/ColumnEntity.java @@ -0,0 +1,236 @@ +package com.mingsoft.cms.entity; + +import com.mingsoft.basic.entity.CategoryEntity; +import com.mingsoft.cms.constant.e.ColumnTypeEnum; +import com.mingsoft.util.StringUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: 栏目管理实体类,继承CategoryEntity + *

+ * + *

+ * Create Date:2014-7-14 + *

+ * + *

+ * Modification history: + *

+ */ +public class ColumnEntity extends CategoryEntity { + + /** + * 最终栏目列表 + * 推荐使用:ColumnTypeEnum + */ + @Deprecated + public final static int COLUMN_TYPE_LIST=1; + + /** + * 单页 + * 推荐使用:ColumnTypeEnum + */ + @Deprecated + public final static int COLUMN_TYPE_COVER=2; + + /** + * 连接地址 + * 推荐使用:ColumnTypeEnum + */ + @Deprecated + public final static int COLUMN_TYPE_URL = 3; + + /** + * 栏目简介 + */ + private String columnKeyword; + + /** + * 栏目关键字的扩展 + */ + private String columnDescrip; + + /** + * 栏目属性 + * @see ColumnTypeEnum + */ + private int columnType; + + + + /** + * 如果为最终栏目列表,则保持栏目列表的地址 + * 如果为外部链接,则保存外部链接的地址 + */ + private String columnUrl; + + /** + * 最终列表栏目的列表模板地址 + */ + private String columnListUrl; + + /** + * 栏目类型,直接影响栏目发布的表单样式 + */ + private int columnContentModelId; + + /** + * 栏目所属站点ID + */ + private int columnWebsiteId; + + /** + * 栏目保存路径 + */ + private String columnPath; + + + /** + * 获取栏目简介的扩展 + * @return columnDescrip + */ + public String getColumnDescrip() { + return columnDescrip; + } + + /** + * 获取栏目简介 + * @return columnKeyword + */ + public String getColumnKeyword() { + return columnKeyword; + } + + /** + * 获取最终列表栏目的列表模板地址 + * @return columnListUrl + */ + public String getColumnListUrl() { + return columnListUrl; + } + + public String getColumnPath() { + if(StringUtil.isBlank(columnPath)){ + return columnPath; + } + return columnPath.replace("\\", "/"); + } + + /** + * 获取栏目下的文章所属表单的类型 + * @return + */ + public int getColumnContentModelId() { + return columnContentModelId; + } + + /** + * 获取栏目属性对应的值 + * 1,COLUMN_TYPE_LIST 代表最终栏目列表 + * 2, COLUMN_TYPE_COVER代表频道封面 + * @return columnType + */ + public int getColumnType() { + return columnType; + } + + /** + * 获取栏目对应连接 + * @return + */ + public String getColumnUrl() { + return columnUrl; + } + + public int getColumnWebsiteId() { + return columnWebsiteId; + } + + /** + * 设置栏目简介的扩展 + * @param columnDescrip + */ + public void setColumnDescrip(String columnDescrip) { + this.columnDescrip = columnDescrip; + } + + /** + * 设置栏目简介 + * @param columnKeyword + */ + public void setColumnKeyword(String columnKeyword) { + this.columnKeyword = columnKeyword; + } + + /** + * 设置最终列表栏目的列表模板地址 + * @param columnListUrl + */ + public void setColumnListUrl(String columnListUrl) { + this.columnListUrl = columnListUrl; + } + + public void setColumnPath(String columnPath) { + this.columnPath = columnPath; + } + + /** + * 设置栏目下的文章所属表单的类型 + * @return + */ + public void setColumnContentModelId(int columnContentModelId) { + this.columnContentModelId = columnContentModelId; + } + + /** + * 设置栏目属性对应的值 + * + * @param columnType + */ + @Deprecated + public void setColumnType(int columnType) { + this.columnType = columnType; + } + + public void setColumnType(ColumnTypeEnum columnType) { + this.columnType = columnType.toInt(); + } + + /** + * 设置栏目对应连接 + * @param columnUrl + */ + public void setColumnUrl(String columnUrl) { + this.columnUrl = columnUrl; + } + + public void setColumnWebsiteId(int columnWebsiteId) { + this.columnWebsiteId = columnWebsiteId; + } + + + + +} diff --git a/src/main/java/com/mingsoft/cms/entity/ContentModelEntity.java b/src/main/java/com/mingsoft/cms/entity/ContentModelEntity.java new file mode 100644 index 00000000..4ad24de1 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/entity/ContentModelEntity.java @@ -0,0 +1,127 @@ +package com.mingsoft.cms.entity; +import com.mingsoft.base.entity.BaseEntity; + + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:内容模型实体,指表单类型,继承BaseEntity + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public class ContentModelEntity extends BaseEntity{ + + /** + * 自增长ID + */ + private int cmId; + + /** + * 表名提示文字 + */ + private String cmTipsName; + + /** + * 表单名称 + */ + private String cmTableName; + + /** + * 表单所属的管理员id + */ + private int cmManagerId; + + /** + * 获取cmId + * @return cmId + */ + public int getCmId() { + return cmId; + } + + /** + * 设置cmId + * @param cmId + */ + public void setCmId(int cmId) { + this.cmId = cmId; + } + + /** + * 获取cmTipsName + * @return cmTipsName + */ + public String getCmTipsName() { + return cmTipsName; + } + + /** + * 设置cmTipsName + * @param cmTipsName + */ + public void setCmTipsName(String cmTipsName) { + this.cmTipsName = cmTipsName; + } + + /** + * 获取cmTableName + * @return cmTableName + */ + public String getCmTableName() { + return cmTableName; + } + + /** + * 设置cmTableName + * @param cmTableName + */ + public void setCmTableName(String cmTableName) { + this.cmTableName = cmTableName; + } + + /** + * 获取该表单所属的管理员id + * @return + */ + public int getCmManagerId() { + return cmManagerId; + } + + /** + * 设置该表单所属的管理员id + * @param cmManagerId + */ + public void setCmManagerId(int cmManagerId) { + this.cmManagerId = cmManagerId; + } + + +} diff --git a/src/main/java/com/mingsoft/cms/entity/FieldEntity.java b/src/main/java/com/mingsoft/cms/entity/FieldEntity.java new file mode 100644 index 00000000..33cf080d --- /dev/null +++ b/src/main/java/com/mingsoft/cms/entity/FieldEntity.java @@ -0,0 +1,220 @@ +package com.mingsoft.cms.entity; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.cms.constant.e.FieldSearchEnum; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:表单类型字段实体,继承BasicEntity + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public class FieldEntity extends BaseEntity{ + + /** + * 自增长ID + */ + private int fieldId; + + /** + * 字段提示文字 + */ + private String fieldTipsName; + + /** + * 字段名称 + */ + private String fieldFieldName; + + /** + * 字段类型(如:1单行文本 2多行文本...) + */ + private int fieldType; + + /** + * 字段的默认值 + */ + private String fieldDefault; + + /** + * 绑定内容模型表ID + */ + private int fieldCmid; + + /** + * 判断字段为必填还是可选 + * 0:必填 + * 1:可选 + */ + private int fieldIsNull; + + /** + * 判断字段是否支持搜索 + */ + private int fieldIsSearch; + + + + /** + * + * @return + */ + public int getFieldIsSearch() { + return fieldIsSearch; + } + + /** + * + * @param fieldIsSearch + */ + @Deprecated + public void setFieldIsSearch(int fieldIsSearch) { + this.fieldIsSearch = fieldIsSearch; + } + + public void setFieldIsSearch(FieldSearchEnum fieldIsSearch){ + this.fieldIsSearch = fieldIsSearch.toInt(); + } + + /** + * 获取fieldId + * @return fieldId + */ + public int getFieldId() { + return fieldId; + } + + /** + * 设置fieldId + * @param fieldId + */ + public void setFieldId(int fieldId) { + this.fieldId = fieldId; + } + + /** + * 获取fieldTipsName + * @return fieldTipsName + */ + public String getFieldTipsName() { + return fieldTipsName; + } + + /** + * 设置fieldTipsName + * @param fieldTipsName + */ + public void setFieldTipsName(String fieldTipsName) { + this.fieldTipsName = fieldTipsName; + } + + /** + * 获取fieldFieldName + * @return fieldFieldName + */ + public String getFieldFieldName() { + return fieldFieldName; + } + + /** + * 设置fieldFieldName + * @param fieldFieldName + */ + public void setFieldFieldName(String fieldFieldName) { + this.fieldFieldName = fieldFieldName; + } + + /** + * 获取fieldType + * @return fieldType + */ + public int getFieldType() { + return fieldType; + } + + /** + * 设置fieldType + * @param fieldType + */ + public void setFieldType(int fieldType) { + this.fieldType = fieldType; + } + + /** + * 获取fieldCmid + * @return fieldCmid + */ + public int getFieldCmid() { + return fieldCmid; + } + + /** + * 设置fieldCmid + * @param fieldCmid + */ + public void setFieldCmid(int fieldCmid) { + this.fieldCmid = fieldCmid; + } + + /** + * 设置字段的默认值 + * @return + */ + public String getFieldDefault() { + return fieldDefault; + } + + /** + * 获取字段的默认值 + * @param fieldDefault + */ + public void setFieldDefault(String fieldDefault) { + this.fieldDefault = fieldDefault; + } + + /** + * 获取字段是否是可选 + * @return + */ + public int getFieldIsNull() { + return fieldIsNull; + } + + /** + * 设置字段是否是可选 + * @return + */ + public void setFieldIsNull(int fieldIsNull) { + this.fieldIsNull = fieldIsNull; + } + + +} diff --git a/src/main/java/com/mingsoft/cms/entity/SearchEntity.java b/src/main/java/com/mingsoft/cms/entity/SearchEntity.java new file mode 100644 index 00000000..27b0dc5b --- /dev/null +++ b/src/main/java/com/mingsoft/cms/entity/SearchEntity.java @@ -0,0 +1,126 @@ +package com.mingsoft.cms.entity; +import com.mingsoft.base.entity.BaseEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:搜索实体,继承BasicEntity + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public class SearchEntity extends BaseEntity{ + + /** + * 自增长ID + */ + private int searchId; + + /** + * 搜索名称 + */ + private String searchName; + + /** + * 搜索结果模板 + */ + private String searchTemplets; + + /** + * 站点ID + */ + private int searchWebsiteId; + + /** + * 获取searchId + * @return searchId + */ + public int getSearchId() { + return searchId; + } + + /** + * 设置searchId + * @param searchId + */ + public void setSearchId(int searchId) { + this.searchId = searchId; + } + + /** + * 获取searchName + * @return searchName + */ + public String getSearchName() { + return searchName; + } + + /** + * 设置searchName + * @param searchName + */ + public void setSearchName(String searchName) { + this.searchName = searchName; + } + + /** + * 获取searchTemplets + * @return searchTemplets + */ + public String getSearchTemplets() { + return searchTemplets; + } + + /** + * 设置searchTemplets + * @param searchTemplets + */ + public void setSearchTemplets(String searchTemplets) { + this.searchTemplets = searchTemplets; + } + + /** + * 获取searchWebsiteId + * @return searchWebsiteId + */ + public int getSearchWebsiteId() { + return searchWebsiteId; + } + + /** + * 设置searchWebsiteId + * @param searchWebsiteId + */ + public void setSearchWebsiteId(int searchWebsiteId) { + this.searchWebsiteId = searchWebsiteId; + } + + +} diff --git a/src/main/java/com/mingsoft/cms/parser/CmsParser.java b/src/main/java/com/mingsoft/cms/parser/CmsParser.java new file mode 100644 index 00000000..01f3ad9e --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/CmsParser.java @@ -0,0 +1,695 @@ +package com.mingsoft.cms.parser; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.cms.biz.IArticleBiz; +import com.mingsoft.cms.biz.IColumnBiz; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.cms.entity.FieldEntity; +import com.mingsoft.cms.parser.impl.ArticleAuthorParser; +import com.mingsoft.cms.parser.impl.ArticleContentParser; +import com.mingsoft.cms.parser.impl.ArticleDateParser; +import com.mingsoft.cms.parser.impl.ArticleDescripParser; +import com.mingsoft.cms.parser.impl.ArticleHistoryParser; +import com.mingsoft.cms.parser.impl.ArticleIdParser; +import com.mingsoft.cms.parser.impl.ArticleKeywordParser; +import com.mingsoft.cms.parser.impl.ArticleLinkParser; +import com.mingsoft.cms.parser.impl.ArticleLitpicParser; +import com.mingsoft.cms.parser.impl.ArticleSourceParser; +import com.mingsoft.cms.parser.impl.ArticleTitleParser; +import com.mingsoft.cms.parser.impl.ArticleTypeIdParser; +import com.mingsoft.cms.parser.impl.ArticleTypeLinkParser; +import com.mingsoft.cms.parser.impl.ArticleTypeTitleParser; +import com.mingsoft.cms.parser.impl.NoParser; +import com.mingsoft.parser.IGeneralParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.parser.PageUtilHtml; +import com.mingsoft.parser.impl.general.ChannelContParser; +import com.mingsoft.parser.impl.general.ChannelParser; +import com.mingsoft.parser.impl.general.ListParser; +import com.mingsoft.parser.impl.general.PageNumParser; +import com.mingsoft.parser.impl.general.PageParser; +import com.mingsoft.parser.impl.general.TaglibParser; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 替换标签类 + * + * @author 成卫雄 QQ:330216230 技术支持:景德镇铭飞科技 官网:www.ming-soft.com + */ +@Component +@Scope("prototype") +public class CmsParser extends IGeneralParser { + + + /** + * 文章业务层 + */ + @Autowired + private IArticleBiz articleBiz; + + /** + * 栏目业务层 + */ + @Autowired + private IColumnBiz columnBiz; + + /** + * 新增字段业务层 + */ + @Autowired + private IFieldBiz fieldBiz; + + /** + * 内容模型业务层 + */ + @Autowired + private IContentModelBiz contentBiz; + + /** + * 当前页码 + */ + private int curPageNo; + + + + /** + * 列表连接地址 + */ + private String listLinkPath; + + private ArticleEntity article, previous, next; + + private ColumnEntity column; + + private List articleList = null; + + /** + * 新增模块业务层 + */ + @Autowired + private IModelBiz modelBiz; + + private List searchList = null; + + /** + * 当前栏目编号,根据栏目生成时候用到 + */ + private int curColumnId; + + public static final String CUR_COLUMNID="curColumnId",PREVIOUS="previous",NEXT="next",CUR_PAGE_NO="curPageNo",LIST_LINK_PATH="listLinkPath"; + + public static final String LIST_ARTICLE = "articleList",SEARCH_LIST_ARTICLE="searchList"; + + /** + * obj: + */ + @Override + public String parse(String html,Object... obj) { + super.htmlContent = html; + init(obj); + modelId = modelBiz.getEntityByModelCode(ModelCode.CMS_COLUMN).getModelId(); // 查询当前模块编号 + // TODO Auto-generated method stub + + htmlContent = parseArticle(); + NoParser noParser = new NoParser(htmlContent); + htmlContent = parseGeneral(); + htmlContent = parseChannel(); + htmlContent = parseSearchList(); + htmlContent = parseList(); + htmlContent = parseArclist(); + htmlContent = parsePage(); + htmlContent=noParser.parse(htmlContent); + return htmlContent; + } + + + public void init(Object... obj) { + super.init(obj); + mobilePath = ""; + column = null; + this.curColumnId = 0; + article = null; + searchList = null; + page = null; + curPageNo=1; + previous=null; + next=null; + for (Object o : obj) { + if (o != null) { + if (o instanceof Map) { + Map temp = (Map) o; + if (StringUtil.isInteger(temp.get(CUR_COLUMNID))) { + curColumnId = Integer.parseInt(temp.get(CUR_COLUMNID) + ""); + } + if (temp.get(PREVIOUS) instanceof ArticleEntity) { + previous =(ArticleEntity)temp.get(PREVIOUS); + } + if (temp.get(NEXT) instanceof ArticleEntity) { + next =(ArticleEntity)temp.get(NEXT); + } + if (StringUtil.isInteger(temp.get(CUR_PAGE_NO) )) { + curPageNo = Integer.parseInt(temp.get(CUR_PAGE_NO)+""); + } + if (!StringUtil.isBlank(temp.get(LIST_LINK_PATH) )) { + listLinkPath = temp.get(LIST_LINK_PATH)+""; + } + if (!StringUtil.isBlank(temp.get(MOBILE) )) { + mobilePath = temp.get(MOBILE)+""; + } + if (temp.get(SEARCH_LIST_ARTICLE) instanceof java.util.List) { + //搜索时候的文章列表数据 + searchList = (List)temp.get(SEARCH_LIST_ARTICLE); + } + } + if (o instanceof ColumnEntity) { + column = (ColumnEntity)o; + //直接影响ms:arclist的数据,根据栏目生成的时候需要必须要进行此操作 + this.curColumnId = column.getCategoryId(); + } + if (o instanceof ArticleEntity) { //显示文章内容的时候必须存在 + article = (ArticleEntity)o; + } + if (o instanceof PageUtil) { //显示 文章搜索的时候必须存在 + page = (PageUtil)o; + } + } + } + } + + /** + * 查找页面中分页标签中出现的size的值 + * + * @param htmlContent + * @param column + * @param curPageNo + * @return + */ + public int getPageSize(AppEntity website, String htmlContent, ColumnEntity column) { + this.app = website; + // 页面总数,默认为1 + int pageSize = 1; + // 当前列表标签中属性的集合------------------- + Map property = ListParser.listProperty(htmlContent, true); + // 没有找到分页标签标签 + if (property == null) { + return pageSize; + } + String isPaging = property.get(ListParser.LIST_ISPAGING); + if (!StringUtil.isBlank(isPaging) && isPaging.equals("true")) { + List columnIds = new ArrayList(); + if(column!=null){ + // 取出当前栏目下的子栏目Id + if (column.getCategoryId() != 0) { + columnIds = columnBiz.queryChildIdsByColumnId(column.getCategoryId(), app.getAppId()); + columnIds.add(column.getCategoryId()); + } + } + // 列表每页显示的数量 + int size = StringUtil.string2Int(property.get(ListParser.LIST_SIZE)); + // 显示文章的形式flag属性 + String flag = property.get(ListParser.LIST_FLAG); + // 显示文章的形式noflag属性 + String noFlag = property.get(ListParser.LIST_NOFLAG); + // 数据库中该栏目下文章的总数 + int articleCount = articleBiz.getCountByColumnId(website.getAppId(), columnIds, flag, noFlag); + // 当用户知道的显示数量小于0或大于文章实际总数时 + if (size <= 0 || size > articleCount) { + size = articleCount; + } + // 如果文章总数为0则分页数量为1 + if (size == 0) { + pageSize = 1; + return pageSize; + } + pageSize = articleCount % size >= 1 ? articleCount / size + 1 : articleCount / size; + } + return pageSize; + } + + /** + * 解析列表标签 + * + * @param htmlContent + * 模版内容 + * @param linkColumnId + * 栏目编号 + * @return 替换好的内容 + */ + private String parseArclist() { + // 查找当前模版页面拥有多少个列表标签 + int listNum = ListParser.countArcList(super.htmlContent); + // 替换完分页标签后的HTML代码 + for (int i = 0; i < listNum; i++) { + + // 当前列表标签中属性的集合------------------- + Map property = ListParser.listProperty(super.htmlContent, false); + // 取当前标签下的栏目ID + int columnId = StringUtil.string2Int(property.get(ListParser.LIST_TYPEID)); + List columnIds = new ArrayList(); + // 列表每页显示的数量 + int size = StringUtil.string2Int(property.get(ListParser.LIST_SIZE)); + // 显示文章的形式flag属性 + String flag = property.get(ListParser.LIST_FLAG); + // 显示文章的形式noflag属性 + String noFlag = property.get(ListParser.LIST_NOFLAG); + // 排序 + String orderBy = property.get(ListParser.LIST_ORDERBY); + String order = property.get(ListParser.LIST_ORDER); + // 取出当前栏目下的子栏目Id + if (columnId != 0) { + columnIds = columnBiz.queryChildIdsByColumnId(columnId, app.getAppId()); + columnIds.add(columnId); + } else { + columnId = this.curColumnId; + columnIds = columnBiz.queryChildrenCategoryIds(columnId, app.getAppId(),modelId); + } + // 数据库中该栏目下文章的总数 + int articleCount = articleBiz.getCountByColumnId(app.getAppId(), columnIds, flag, noFlag); + + // 如果没有指定文章每页显示数量则显示所有数量 + if (size <= 0 || size > articleCount) { + size = articleCount; + } + // 当数据库中该栏目下没有该文章时不取数据 + if (articleCount != 0) { + /** + * 判断文章列表的orderby属性 + */ + if (StringUtil.isBlank(order)) { + order = "desc"; + } + // 从数据库取出文章列表数组 + List listArticles = articleBiz.queryList(app.getAppId(), columnIds, flag, noFlag, 0, size, orderBy, order.equals("desc") ? true : false); + // 替换列表标签 + htmlContent = new com.mingsoft.cms.parser.impl.ListParser(htmlContent, listArticles, this.getWebsiteUrl(), property, false, fieldBiz, contentBiz).parse(); + }else{ + htmlContent = new com.mingsoft.cms.parser.impl.ListParser(htmlContent, null, this.getWebsiteUrl(), property, false, fieldBiz, contentBiz).parse(); + } + } + return htmlContent; + } + + /** + * 解析文章内容 + * + * @param article + * 当前文章 + * @param previous当前文章的上一篇 + * @param next当前文章的下一篇 + * @return + */ + private String parseArticle() { + if (article == null) { + return htmlContent; + } + // 获取文章所属的栏目实体 + ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId()); + if(column==null){ + return htmlContent; + } + // 替换文章作者标签:{ms:field.author/} + htmlContent = new ArticleAuthorParser(htmlContent, article.getArticleAuthor()).parse(); + + // 替换文章内容标签:{ms:field.content/} + htmlContent = new ArticleContentParser(htmlContent, article.getArticleContent()).parse(); + + // 替换文章时间标签:{ms:field.date fmt="yyyy-mm-dd"/} + htmlContent = new ArticleDateParser(htmlContent, article.getBasicDateTime()).parse(); + + // 替换文章发布来源标签:{ms:field.source/} + htmlContent = new ArticleSourceParser(htmlContent, article.getArticleSource()).parse(); + + // 替换文章标题标签: {ms:field.title/} + htmlContent = new ArticleTitleParser(htmlContent, article.getBasicTitle()).parse(); + + // 替换文章id标签: {ms:field.id/} + htmlContent = new ArticleIdParser(htmlContent, article.getBasicId() + "").parse(); + + // 替换文章描述: {ms:field.Descrip/} + htmlContent = new ArticleDescripParser(htmlContent, article.getBasicDescription()).parse(); + + // 替换文章关键字: {ms:field.keyword/} + htmlContent = new ArticleKeywordParser(htmlContent, article.getArticleKeyword()).parse(); + + // 替换文章缩略图标签 + htmlContent = new ArticleLitpicParser(htmlContent, article.getBasicThumbnails()).parse(); + + + // 替换文章栏目链接标签{ms:filed.typelink/} + ColumnEntity tmp = null; + htmlContent = new ArticleTypeIdParser(htmlContent, column.getCategoryId() + "").parse(); + ArticleTypeTitleParser attp = new ArticleTypeTitleParser(htmlContent, column.getCategoryTitle()); + if (attp.isTop()) { + if (column.getCategoryCategoryId() > 0) { + tmp = (ColumnEntity) columnBiz.getEntity(column.getCategoryCategoryId()); + attp.setNewCotent(tmp.getCategoryTitle()); + } + } else { + attp.setNewCotent(column.getCategoryTitle()); + } + htmlContent = attp.parse(); + + // 替换文章栏目链接标签{ms:filed.typelink/} + ArticleTypeLinkParser atlp = new ArticleTypeLinkParser(htmlContent, this.getWebsiteUrl() + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + if (atlp.isTop()) { + if (tmp == null && column.getCategoryCategoryId() > 0) { // 如果用户写分类名称标签的时候没有使用top属性,而在使用连接标签的时候使用就再次查询分类 + tmp = (ColumnEntity) columnBiz.getEntity(column.getCategoryCategoryId()); + } + atlp.setNewCotent(this.getWebsiteUrl() + tmp.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + } + htmlContent = atlp.parse(); + + // 替换当前文章内容链接标签:{ms:field.link} + htmlContent = new ArticleLinkParser(htmlContent, article.getArticleLinkURL()).parse(); + + // 替换上一篇文章、下一篇文章,链接、标题,标签 + htmlContent = new ArticleHistoryParser(htmlContent, previous, next).parse(); + + // 判断该文章是否有新增字段 + if (column.getColumnContentModelId() != 0) { + // 根据表单类型id查找出所有的字段信息 + List listField = fieldBiz.queryListByCmid(column.getColumnContentModelId()); + // 遍历所有的字段实体,得到字段名列表信息 + List listFieldName = new ArrayList(); + for (int i = 0; i < listField.size(); i++) { + FieldEntity field = (FieldEntity) listField.get(i); + listFieldName.add(field.getFieldFieldName()); + } + ContentModelEntity contentModel = (ContentModelEntity) contentBiz.getEntity(column.getColumnContentModelId()); + // 组织where条件 + Map where = new HashMap(); + where.put("basicId", article.getBasicId()); + // 获取各字段的值 + // 根据表单类型id查找出所有的字段信息 + List fieldLists = fieldBiz.queryBySQL(contentModel.getCmTableName(), listFieldName, where); + if(fieldLists.size()>0){ + Map filedValue = (Map) fieldLists.get(0); + if (filedValue != null) { + htmlContent = new TaglibParser(htmlContent, filedValue, column.getColumnContentModelId(), fieldBiz,listField).parse(); + } + } + + + // 读取并解析各标签内容 + } + return htmlContent; + } + + /** + * 解析分类标签 + * + * @param htmlContent + *  原始html内容 + * @param column + *   + * @param websiteUrl + * 网站连接地址 + * @return + */ + private String parseChannel() { + // 替换完文章标签后的HTML模版 + + // 当只存在栏目ID时,解析相关的文章中的栏目标签 + if (column != null) { + ColumnEntity tmp = null; + String columnTitle = column.getCategoryTitle(); + int columnId = column.getCategoryId(); + // 解析当前栏目id// 替换文章所在栏目标签:{ms:field.typeid/} + ArticleTypeIdParser atId = new ArticleTypeIdParser(htmlContent, columnId+ ""); + if (atId.isTop()) { + if (column.getCategoryCategoryId() > 0) { + tmp = (ColumnEntity) columnBiz.getEntity(column.getCategoryCategoryId()); + columnId = tmp.getCategoryId(); + } + } + htmlContent = new ArticleTypeIdParser(htmlContent, column.getCategoryId() + "").parse(); + // 替换文章所在栏目标签:{ms:field.typetitle/} + ArticleTypeTitleParser attp = new ArticleTypeTitleParser(htmlContent, columnTitle); + if (attp.isTop()) { + if (column.getCategoryCategoryId() > 0) { + tmp = (ColumnEntity) columnBiz.getEntity(column.getCategoryCategoryId()); + columnTitle = tmp.getCategoryTitle(); + } + } + attp.setNewCotent(columnTitle); + htmlContent = attp.parse(); + // 替换文章栏目链接标签{ms:filed.typelink/} + ArticleTypeLinkParser atlp = new ArticleTypeLinkParser(htmlContent, this.getWebsiteUrl() + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + if (atlp.isTop()) { + if (column.getCategoryCategoryId() > 0) { // 如果用户写分类名称标签的时候没有使用top属性,而在使用连接标签的时候使用就再次查询分类 + tmp = (ColumnEntity) columnBiz.getEntity(column.getCategoryCategoryId()); + atlp.setNewCotent(this.getWebsiteUrl() + tmp.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + }else{ + atlp.setNewCotent(this.getWebsiteUrl() + column.getColumnPath() + File.separator + IParserRegexConstant.HTML_INDEX); + } + + } + htmlContent = atlp.parse(); + } + // //----------------------------解析栏目标签---------------------------- + + // //替换完列表标签后的HTML文件 + String channel = htmlContent; + + // 查找当前模版页面拥有多少个栏目列表标签 + int strNumType = ChannelParser.channelNum(channel); + + for (int i = 0; i < strNumType; i++) { + // 当前列表栏目中属性的集合 + Map mapProperty = ChannelParser.channelProperty(channel); + + // 取当前标签下的栏目ID + int tempColumnId = StringUtil.string2Int(mapProperty.get(ChannelParser.CHANNEL_TYPEID)); + + if (tempColumnId == 0 && column != null) { + tempColumnId = column.getCategoryId(); + } + List categoryList = null; + if (tempColumnId != 0) { + // 取出栏目的取值范围 + String type = mapProperty.get(ChannelParser.CHANNEL_TYPE); + //同级栏目是否显示属性 + String childType = mapProperty.get(ChannelParser.CHANNEL_TYP_SIBLING); + // 根据范围在BIZ中取出不同的栏目信息 + + // 判断用户填写的栏目属性,如果未填写那么取当前栏目的下级栏目,如果但前栏目没有下级栏目那么晚取本级栏目 + // 如果填写:son,那么取下级栏目,没有下级栏目则取本级栏目 + // 如果为:top,那么取上级栏目,如果没有上级栏目则取本级栏目 + // 如果为:level,则取本级栏目 + if (type == null) { + categoryList = columnBiz.queryChildListByColumnId(tempColumnId); + //当值为true表示不存在子级分类时,显示他的同级分类 + if(childType!=null && childType.equals("true") && categoryList.size()<=0){ + categoryList = columnBiz.querySibling(tempColumnId); + } + } else if (type.equals(ChannelParser.CHANNEL_TYPE_SON)) { + categoryList = columnBiz.queryChildListByColumnId(tempColumnId); + } else if (type.equals(ChannelParser.CHANNEL_TYPE_TOP)) { + categoryList = columnBiz.queryTopSiblingListByColumnId(tempColumnId); + } else if (type.equals(ChannelParser.CHANNEL_TYPE_LEVEL)) { + categoryList = columnBiz.querySibling(tempColumnId); + } + // 替换栏目标签 + htmlContent = new ChannelParser(channel, categoryList, this.getWebsiteUrl(), column != null ? column.getCategoryId() : 0, mapProperty.get(ChannelParser.CHANNEL_CLASS)).parse(); + // 替换完栏目标签后的HTML代码 + channel = htmlContent; + } else { + categoryList = columnBiz.queryChild(tempColumnId, app.getAppId(), null); + // 替换栏目标签 + htmlContent = new ChannelParser(channel, categoryList, this.getWebsiteUrl()).parse(); + // 替换完栏目标签后的HTML代码 + channel = htmlContent; + } + } + + // 替换完封面标签后的TML文件 + String channelContHtml = channel; + // 查找当前模版页面拥有多少个封面列表标签 + int channelConNum = ChannelContParser.channelContNum(channelContHtml); + + for (int i = 0; i < channelConNum; i++) { + // 取出当前封面标签中的封面ID + int channelTypeId = ChannelContParser.channelContTypeId(channelContHtml); + if (channelTypeId == 0 && column != null) { + channelTypeId = column.getCategoryId(); + } + String channelCont = ""; + // 取出当前封面的内容 + // 取出当前封面的内容 + if (channelTypeId != 0) { + List arctile = articleBiz.queryListByColumnId(channelTypeId); + if (arctile != null) { + if (arctile.size() > 0) { + channelCont = arctile.get(arctile.size() - 1).getArticleContent(); + } else { + channelCont = arctile.get(arctile.size()).getArticleContent(); + } + + } + } + // 替换封面标签 + htmlContent = new ChannelContParser(channelContHtml, channelCont).parse(); + channelContHtml = htmlContent; + } + + return htmlContent; + } + + /** + * 解析分页列表标签 + * + * @param htmlContent + * 模版内容 + * @param column + * 栏目编号 + * @param curPageNo + * 当前页码 + * @return 替换好的内容 + */ + private String parseList() { + + // 替换完分页标签后的HTML代码 + // 当前列表标签中属性的集合------------------- + Map property = ListParser.listProperty(htmlContent, true); + if (property == null) { // 没有找到分页标签标签 + return htmlContent; + } + String isPaging = property.get(ListParser.LIST_ISPAGING); + if (isPaging != null && isPaging.equals("true")) { + List columnIds = new ArrayList(); + if (column!=null) { + this.curColumnId = column.getCategoryId(); + columnIds = columnBiz.queryChildrenCategoryIds(curColumnId, app.getAppId(),modelId); + // 取出当前栏目下的子栏目Id + // 列表每页显示的数量 + int size = StringUtil.string2Int(property.get(ListParser.LIST_SIZE)); + // 显示文章的形式flag属性 + String flag = property.get(ListParser.LIST_FLAG); + // 显示文章的形式noflag属性 + String noFlag = property.get(ListParser.LIST_NOFLAG); + // 排序 + String orderBy = property.get(ListParser.LIST_ORDERBY); + String order = property.get(ListParser.LIST_ORDER); + columnIds.add(curColumnId); + // 数据库中该栏目下文章的总数 + int articleCount = articleBiz.getCountByColumnId(app.getAppId(), columnIds, flag, noFlag); + // 如果没有指定文章每页显示数量则显示所有数量 + if (size <= 0 || size > articleCount) { + size = articleCount; + } + // 当数据库中该栏目下没有该文章时不取数据 + if (articleCount != 0) { + if (page==null) { + page = new PageUtilHtml(curPageNo, size, articleCount, listLinkPath); + } + /** + * 判断文章列表的orderby属性 + */ + if (StringUtil.isBlank(order)) { + order = "desc"; + } + // 从数据库取出文章列表数组 + List listArticles = articleBiz.queryList(this.app.getAppId(), columnIds, flag, noFlag, (page.getPageNo() * page.getPageSize()), page.getPageSize(), orderBy, order.equals("desc") ? true : false); + // 替换列表标签 + htmlContent = new com.mingsoft.cms.parser.impl.ListParser(htmlContent, listArticles, this.getWebsiteUrl(), property, true, fieldBiz, contentBiz).parse(); + }else{ + htmlContent = new com.mingsoft.cms.parser.impl.ListParser(htmlContent, null, this.getWebsiteUrl(), property, true, fieldBiz, contentBiz).parse(); + } + } + } + return htmlContent; + } + + + /** + * 解析分页标签 + * @return + */ + private String parsePage() { + // 替换分页标签 + htmlContent = new PageParser(htmlContent, page).parse(); + // 替换页面的总数,当前文章处于第几页,列表文章的总数标签 + htmlContent = new PageNumParser(htmlContent, page).parse(); + return htmlContent; + } + + + /** + * 搜索的分页查询 + * + * @param htmlContent + * 搜索模板内容 + * @param articleList + * 文章实体列表 + * @param page + * 分页 + * @return + */ + public String parseSearchList() { + // 当前列表标签中属性的集合------------------- + Map property = ListParser.listProperty(htmlContent, true); + if (property == null) { // 没有找到分页标签标签 + return htmlContent; + } + String isPaging = property.get(ListParser.LIST_ISPAGING); + if (isPaging != null && isPaging.equals("true")) { + // 排序 + String orderBy = property.get(ListParser.LIST_ORDERBY); + String order = property.get(ListParser.LIST_ORDER); + // 取当前标签下的栏目ID + int columnId = StringUtil.string2Int(property.get(ListParser.LIST_TYPEID)); + List columnIds = new ArrayList(); + // 从数据库取出文章列表数组 + List listArticles =searchList; + int articleCount=0; + // 列表每页显示的数量 + int size = StringUtil.string2Int(property.get(ListParser.LIST_SIZE)); + // 从数据库取出文章列表数组 + /* + * 判断栏目id是否指定 如果指定则取该栏目下的文章,否则取符合搜索条件的文章 + */ + if (columnId != 0) { + columnIds = columnBiz.queryChildIdsByColumnId(columnId, app.getAppId()); + columnIds.add(columnId); + // 显示文章的形式flag属性 + String flag = property.get(ListParser.LIST_FLAG); + // 显示文章的形式noflag属性 + String noFlag = property.get(ListParser.LIST_NOFLAG); + // 数据库中该栏目下文章的总数 + articleCount = articleBiz.getCountByColumnId(app.getAppId(), columnIds, flag, noFlag); + listArticles = articleBiz.queryList(app.getAppId(), columnIds, flag, noFlag, 0, size, orderBy, true); + if (page==null) { + page = new PageUtilHtml(curPageNo, size, articleCount, listLinkPath); + } + } + // 当数据库中该栏目下没有该文章时不取数据 + if(listArticles!=null){ + /** + * 判断文章列表的orderby属性 + */ + if (StringUtil.isBlank(order)) { + order = "desc"; + } + // 替换列表标签 + htmlContent = new com.mingsoft.cms.parser.impl.ListParser(htmlContent, listArticles, this.getWebsiteUrl(), property, true, fieldBiz, contentBiz).parse(); + } + } + return htmlContent; + } +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleAuthorParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleAuthorParser.java new file mode 100644 index 00000000..9acf3569 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleAuthorParser.java @@ -0,0 +1,36 @@ +package com.mingsoft.cms.parser.impl; + +import com.mingsoft.parser.IParser; +/** + * 内容发布作者(单标签) + * 文章作者标签 + * {ms:field.author/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleAuthorParser extends IParser { + + /** + * 文章作者标签 + */ + private final static String ARTICLE_AUTHOR_FIELD="\\{ms:field.author/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleAuthorParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_AUTHOR_FIELD); + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleContentParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleContentParser.java new file mode 100644 index 00000000..0e107ff1 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleContentParser.java @@ -0,0 +1,37 @@ +package com.mingsoft.cms.parser.impl; + +import com.mingsoft.parser.IParser; + +/** + * 文章内容(单标签) + * 文章内容标签 + * {ms:field.content/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleContentParser extends IParser { + + /** + * 文章内容标签 + */ + private final static String ARTICLE_CONTENT_FIELD="\\{ms:field.content/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleContentParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_CONTENT_FIELD); + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleDateParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleDateParser.java new file mode 100644 index 00000000..b1a98b05 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleDateParser.java @@ -0,0 +1,66 @@ +package com.mingsoft.cms.parser.impl; + +import java.util.Date; + +import com.mingsoft.parser.IParser; +import com.mingsoft.parser.IParserRegexConstant; +/** + * 内容发布时间(单标签) + * 文章内容标签 + * {ms:field.date fmt="yyyy-mm-dd"/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleDateParser extends IParser { + + /** + * 文章发布时间标签 + */ + private final static String ARTICLE_DATE_FIELD="\\{ms:field.date\\s{0,}(fmt=(.*?))?/}"; + + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleDateParser(String htmlContent,Date newContent){ + super.htmlCotent = htmlContent; + super.newCotent = date(newContent, htmlContent); + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_DATE_FIELD); + } + + /** + * 将时间格式转换成字符串型并改变时间的显示格式 + * @param date 数据库中的时间 + * @param htmlCotent 读取时间格式的HTML代码 + * @return 时间 + */ + private String date(Date date,String htmlCotent){ + //从HTML代码中取出时间的显示格式,默认为yyyy-MM-dd hh:mm:ss形式 + String typeDate = IParserRegexConstant.REGEX_DATE; + String fmt = parseFirst(htmlCotent,ARTICLE_DATE_FIELD, 2); + if(fmt!= null){ + typeDate = fmt; + } + //将时间转换成String型 + String srtDate = IParserRegexConstant.REGEX_DATE_ERRO; + if(date != null){ + try{ + java.text.SimpleDateFormat forDate = new java.text.SimpleDateFormat(typeDate); + srtDate = forDate.format(date); + }catch (Exception e) { + // TODO: handle exception + } + } + return srtDate; + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleDescripParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleDescripParser.java new file mode 100644 index 00000000..0b0103b2 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleDescripParser.java @@ -0,0 +1,40 @@ +package com.mingsoft.cms.parser.impl; + +import com.mingsoft.parser.IParser; + +/** + * 文章描述(单标签) + * 文章描述 + * {ms:field.descrip/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleDescripParser extends IParser{ + + + /** + * 文章描述标签 + */ + private final static String ARTICLE_DESCRIP_FIELD="\\{ms:field.descrip/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleDescripParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_DESCRIP_FIELD); + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleHistoryParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleHistoryParser.java new file mode 100644 index 00000000..091c2033 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleHistoryParser.java @@ -0,0 +1,110 @@ +package com.mingsoft.cms.parser.impl; + + + +import com.mingsoft.cms.entity.ArticleEntity; +import com.mingsoft.parser.IParser; + + +/** + * 当前文章的上一篇文章,下一篇文章的链接标题解析(单标签) 上一篇文章链接:{ms:field.prelink/} 上一篇文章标题:{ms:field.pretitle/} 下一篇文章链接:{ms:field.nextlink/} 下一篇文章标题:{ms:field.nexttitle/} 文章内容标签 + * + * @author 成卫雄 QQ:330216230 技术支持:景德镇铭飞科技 官网:www.ming-soft.com + */ +public class ArticleHistoryParser extends IParser { + + + /** + * 文章上一篇连接标签 + */ + private final static String ARTICLE_PRELINK_FIELD="\\{ms:field.prelink/\\}"; + + /** + * 上一篇文章标题 标签 + */ + private final static String ARTICLE_PRETITLE_FIELD="\\{ms:field.pretitle/\\}"; + + /** + * 文章下一篇连接标签 + */ + private final static String ARTICLE_NEXTLINK_FIELD="\\{ms:field.nextlink/\\}"; + + /** + * 文章下一篇标题标签 + */ + private final static String ARTICLE_NEXTTITLE_FIELD="\\{ms:field.nexttitle/\\}"; + + + /** + * 上一篇文章 + */ + private ArticleEntity previous; + + /** + * 下一篇文章 + */ + private ArticleEntity next; + + /** + * 构造必须的参数 + * + * @param htmlContent + * 原HTML代码 + * @param newContent + * 标签内容 + * @param urlPage + * 当前项目的相对地址 + */ + public ArticleHistoryParser(String htmlContent, ArticleEntity previous, ArticleEntity next) { + super.htmlCotent = htmlContent; + this.previous = previous; + this.next = next; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + if (this.previous != null) { + // 替换上一篇文章链接 + super.htmlCotent = replaceRegex(this.previous.getArticleLinkURL(),ARTICLE_PRELINK_FIELD); + // 替换上一篇文章标题 + super.htmlCotent = replaceRegex(this.previous.getBasicTitle(),ARTICLE_PRETITLE_FIELD); + } else { + // 替换上一篇文章链接 + super.htmlCotent = replaceRegex("#",ARTICLE_PRELINK_FIELD); + // 替换上一篇文章标题 + super.htmlCotent = replaceRegex("",ARTICLE_PRETITLE_FIELD); + } + if (this.next != null) { + // 替换上一篇文章链接 + super.htmlCotent = replaceRegex(this.next.getArticleLinkURL(),ARTICLE_NEXTLINK_FIELD); + // 替换上一篇文章标题 + super.htmlCotent = replaceRegex(this.next.getBasicTitle(),ARTICLE_NEXTTITLE_FIELD); + } else { + // 替换上一篇文章链接 + super.htmlCotent = replaceRegex("#", ARTICLE_NEXTLINK_FIELD); + // 替换上一篇文章标题 + super.htmlCotent = replaceRegex("", ARTICLE_NEXTTITLE_FIELD); + } + return super.htmlCotent; + } + + /** + * 替换不同的标签 + * + * @param htmlContent + * HTML代码 + * @param newContent + * 替换内容 + * @param regex + * 正则表达式 + * @return 替换完成后的HTML代码 + */ + private String replaceRegex(String newContent, String regex) { + // 判断用户是否在HTML代码中写入了该标签 + super.newCotent = newContent; + String overHtml = super.replaceAll(regex); + return overHtml; + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleIdParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleIdParser.java new file mode 100644 index 00000000..a77446b5 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleIdParser.java @@ -0,0 +1,37 @@ +package com.mingsoft.cms.parser.impl; + +import com.mingsoft.parser.IParser; + +/** + * 内容标题(单标签) + * 文章内容标签 + * {ms:field.title/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleIdParser extends IParser { + + /** + * 文章标题标签 + */ + private final static String ARTICLE_TITLE_FIELD="\\{ms:field.id/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleIdParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_TITLE_FIELD); + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleIdTitleParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleIdTitleParser.java new file mode 100644 index 00000000..5382170e --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleIdTitleParser.java @@ -0,0 +1,57 @@ +package com.mingsoft.cms.parser.impl; + +import java.util.Map; + + +import com.mingsoft.parser.IParser; +import com.mingsoft.util.StringUtil; +/** + * 文章所在的栏目名称(单标签) + * 文章内容标签 + * {ms:field.typetitle/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleIdTitleParser extends IParser{ + + /** + * 文章所属栏目标题标签 + */ + private final static String ARTICLE_TYPETITLE ="\\{ms:field.typetitle(.*)?/\\}"; + + private final static String TYPE = "type"; + + private final static String TYPE_TOP = "top"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleIdTitleParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_TYPETITLE); + } + + /** + * 是否存在type=top的属性 + * @return true:存在 false:不存在 + */ + public boolean isTop() { + String temp = super.getProperty(ARTICLE_TYPETITLE).get(TYPE); + if (StringUtil.isBlank(temp)) { + return false; + } else { + return temp.equalsIgnoreCase(TYPE_TOP) ; + } + } + + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleKeywordParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleKeywordParser.java new file mode 100644 index 00000000..ab8c4c2e --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleKeywordParser.java @@ -0,0 +1,42 @@ +package com.mingsoft.cms.parser.impl; + +import com.mingsoft.parser.IParser; + +/** + + * 解析文章关键字标签{ms:field.keyword/} + + * @author 史爱华 QQ:924690193 + + * @version + + * 版本号:100-000-000
+ + * 创建日期:2015-08-26
+ + * 历史修订:
+ + */ +public class ArticleKeywordParser extends IParser{ + + /** + * 文章关键字标签 + */ + private final static String ARTICLE_KEYWORD_FIELD="\\{ms:field.keyword/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleKeywordParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_KEYWORD_FIELD); + } +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleLinkParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleLinkParser.java new file mode 100644 index 00000000..8bbadf2a --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleLinkParser.java @@ -0,0 +1,38 @@ +package com.mingsoft.cms.parser.impl; + + +import com.mingsoft.parser.IParser; +/** + * 当前文章内容标签(但标签) + * 文章内容标签 + * {ms:field.link/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleLinkParser extends IParser{ + + /** + * 文章内容连接标签 + */ + private final static String ARTICLE_LINK_FIELD="\\{ms:field.link/\\}"; + + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleLinkParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_LINK_FIELD); + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleLitpicParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleLitpicParser.java new file mode 100644 index 00000000..9fc64a56 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleLitpicParser.java @@ -0,0 +1,26 @@ +package com.mingsoft.cms.parser.impl; + +import com.mingsoft.parser.IParser; + +public class ArticleLitpicParser extends IParser { + /** + * 文章缩略标签 + */ + private final static String ARTICLE_LITPIC_FIELD="\\{ms:field.litpic/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleLitpicParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_LITPIC_FIELD); + } +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleSourceParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleSourceParser.java new file mode 100644 index 00000000..170b166e --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleSourceParser.java @@ -0,0 +1,36 @@ +package com.mingsoft.cms.parser.impl; + +import com.mingsoft.parser.IParser; +/** + * 内容发布来源(单标签) + * 文章来源标签 + * {ms:field.source/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleSourceParser extends IParser { + + /** + * 文章来源标签 + */ + private final static String ARTICLE_SOURCE_FIELD="\\{ms:field.source/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleSourceParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_SOURCE_FIELD); + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleTitleParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleTitleParser.java new file mode 100644 index 00000000..ef448c08 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleTitleParser.java @@ -0,0 +1,37 @@ +package com.mingsoft.cms.parser.impl; + +import com.mingsoft.parser.IParser; + +/** + * 内容标题(单标签) + * 文章内容标签 + * {ms:field.title/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleTitleParser extends IParser { + + /** + * 文章标题标签 + */ + private final static String ARTICLE_TITLE_FIELD="\\{ms:field.title/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleTitleParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_TITLE_FIELD); + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeIdParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeIdParser.java new file mode 100644 index 00000000..35e62b7b --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeIdParser.java @@ -0,0 +1,57 @@ +package com.mingsoft.cms.parser.impl; + +import java.util.Map; + + +import com.mingsoft.parser.IParser; +import com.mingsoft.util.StringUtil; +/** + * 文章所在的栏目名称(单标签) + * 文章内容标签 + * {ms:field.typetitle/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleTypeIdParser extends IParser{ + + /** + * 文章所属栏目标题标签 + */ + private final static String ARTICLE_TYPEID ="\\{ms:field.typeid(.*)?/\\}"; + + private final static String TYPE = "type"; + + private final static String TYPE_TOP = "top"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleTypeIdParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_TYPEID); + } + + /** + * 是否存在type=top的属性 + * @return true:存在 false:不存在 + */ + public boolean isTop() { + String temp = super.getProperty(ARTICLE_TYPEID).get(TYPE); + if (StringUtil.isBlank(temp)) { + return false; + } else { + return temp.equalsIgnoreCase(TYPE_TOP) ; + } + } + + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeLinkParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeLinkParser.java new file mode 100644 index 00000000..a9c670e1 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeLinkParser.java @@ -0,0 +1,58 @@ +package com.mingsoft.cms.parser.impl; + +import java.io.File; + + +import com.mingsoft.parser.IParser; +import com.mingsoft.util.StringUtil; + +/** + * 文章所在栏目链接(单标签) + * 文章内容标签 + * {ms:field.typelink/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleTypeLinkParser extends IParser { + + /** + * 文章作者标签 + */ + private final static String ARTICLE_TYPELINK="\\{ms:field.typelink(.*)?/\\}"; + + private final static String TYPE = "type"; + + private final static String TYPE_TOP = "top"; + + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleTypeLinkParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_TYPELINK); + } + + /** + * 是否存在type=top的属性 + * @return true:存在 false:不存在 + */ + public boolean isTop() { + String temp = super.getProperty(ARTICLE_TYPELINK).get(TYPE); + if (StringUtil.isBlank(temp)) { + return false; + } else { + return temp.equalsIgnoreCase(TYPE_TOP) ; + } + } + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeTitleParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeTitleParser.java new file mode 100644 index 00000000..2a052878 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ArticleTypeTitleParser.java @@ -0,0 +1,57 @@ +package com.mingsoft.cms.parser.impl; + +import java.util.Map; + + +import com.mingsoft.parser.IParser; +import com.mingsoft.util.StringUtil; +/** + * 文章所在的栏目名称(单标签) + * 文章内容标签 + * {ms:field.typetitle/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ArticleTypeTitleParser extends IParser{ + + /** + * 文章所属栏目标题标签 + */ + private final static String ARTICLE_TYPETITLE ="\\{ms:field.typetitle(.*)?/\\}"; + + private final static String TYPE = "type"; + + private final static String TYPE_TOP = "top"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ArticleTypeTitleParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(ARTICLE_TYPETITLE); + } + + /** + * 是否存在type=top的属性 + * @return true:存在 false:不存在 + */ + public boolean isTop() { + String temp = super.getProperty(ARTICLE_TYPETITLE).get(TYPE); + if (StringUtil.isBlank(temp)) { + return false; + } else { + return temp.equalsIgnoreCase(TYPE_TOP) ; + } + } + + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/ListParser.java b/src/main/java/com/mingsoft/cms/parser/impl/ListParser.java new file mode 100644 index 00000000..7e7ad93d --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/ListParser.java @@ -0,0 +1,153 @@ +package com.mingsoft.cms.parser.impl; + + +import java.io.File; +import java.util.List; +import java.util.Map; + + +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.constant.e.ColumnTypeEnum; +import com.mingsoft.cms.entity.ArticleEntity; + +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.parser.impl.general.DateParser; +import com.mingsoft.util.StringUtil; + +/** + * 解析列表标签, {ms:arclist typeid= size= titlelen= flag = }:列表头标签,
+ * {/ms:arclist}:列表尾标签,
+ * 列表中的属性:
+ * typeid 类型 int栏目ID,在列表模板和档案模板中一般不需要指定,在首页模板中允许用","分开表示多个栏目,
+ * size 类型 int 返回文档列表总数,默认为20条全部返回,也可以配合分页使用,
+ * titlelen 类型 int 标题长度,等同于titlelength。默认40个汉字,
+ * flag 类型 String flag = c 自定义属性值:推荐[c]幻灯[f],
+ * [field.index/]:序号,根据显示条数显示的序号1 2 …..10,
+ * [field.id/]:编号,对应文章在数据库里的自动编号,
+ * [field.title/]:标题,标题长度根据titlelen的属性值指定,默认40个汉字,
+ * [field.fulltitle/]:全部标题,显示完整的标题,
+ * [field.author/]:作者,
+ * [field.source/]:来源,
+ * [field.date fmt=”yyyy-mm-dd”/]:时间(非必填),
+ * [field.content length=/]:内容,length=:内容的长度,指定获取文章长度(非必填),
+ * [field.typename/]:分类名称,文章所属分类的名称,
+ * [field.typeid/]:分类编号,文章所属分类的编号,
+ * [field.typelink/]:分类连接,点击连接连接到当前分类的列表,
+ * [field.link/]:内容链接,点击显示文章具体的内容地址,
+ * + * @author 成卫雄 QQ:330216230 技术支持:景德镇铭飞科技 官网:www.ming-soft.com + */ +public class ListParser extends com.mingsoft.parser.impl.general.ListParser { + + + /** + * 列表解析构造, + * + * @param htmlCotent + *  原始内容 + * @param articles + *  文章列表 + * @param websiteUrl + *  网站地址 + * @param isPaging + * ture:分页 + * @param listProperty + *  当前标签属性 + */ + public ListParser(String htmlCotent, List articles,String websiteUrl, Map listProperty, boolean isPaging,IFieldBiz fieldBiz,IContentModelBiz contentBiz) { + String tabTmpContent = ""; + if (isPaging) { + // 在HTML模版中标记出要用内容替换的标签 + tabTmpContent = replaceStartAndEnd(htmlCotent,LIST_PAGING); + } else { + tabTmpContent = replaceStartAndEnd(htmlCotent,LIST_NOPAGING); + } + this.listProperty = listProperty; + this.fieldBiz = fieldBiz; + this.contentBiz = contentBiz; + // 经过遍历后的数组标签 + super.newCotent = list(tabTmpContent, htmlCotent, articles, websiteUrl); + super.htmlCotent = tabTmpContent; + + } + + + /** + * 遍历文章数组,将取出的内容替换标签 + * + * @param tabHtmlContent + * 替换过的html模版 + * @param htmlContent + * 原始htlm模版内容 + * @param articleList + * 文章数组 + * @param path + * 项目路径 + * @return 用内容替换标签后的HTML代码 + */ + @Override + protected String list(String tabHtmlContent, String htmlContent, List articleList, String path) { + String htmlList = ""; + String tabHtml = ""; + tabHtml = tabHtml(tabHtmlContent); + if (articleList != null && tabHtml != null && articleList.size() != 0 && tabHtml != "") { + for (int i = 0; i < articleList.size(); i++) { + + ArticleEntity article = (ArticleEntity)articleList.get(i); + if(article.getColumn()!=null){ + // 序号,根据显示条数显示的序号1 2 …..10。 + htmlList += tabContent(tabHtml, StringUtil.int2String((i + 1)),INDEX_FIELD_LIST); + // 编号,对应文章在数据库里的自动编号。 + htmlList = tabContent(htmlList, StringUtil.int2String(article.getBasicId()),ID_FIELD_LIST); + // 标题,标题长度根据titlelen的属性值指定,默认40个汉字, + htmlList = tabContent(htmlList, titleLength(article.getBasicTitle(), htmlContent),TITLE_FIELD_LIST); + // 全部标题,显示完整的标题。 + htmlList = tabContent(htmlList, StringUtil.null2String(article.getBasicTitle()),FULLTITLE_FIELD_LIST); + // 文章作者。 + htmlList = tabContent(htmlList, StringUtil.null2String(article.getArticleAuthor()),AUTHOR_FIELD_LIST); + // 文章来源。 + htmlList = tabContent(htmlList, StringUtil.null2String(article.getArticleSource()),SOURCE_FIELD_LIST); + // 文章发布时间(非必填), + htmlList = new DateParser(htmlList,article.getBasicDateTime()).parse();//tabContent(htmlList, date(article.getBasicUpdateTime(), htmlList),DATE_FIELD_LIST); + + // 分类名称,文章所属分类的名称, + htmlList = tabContent(htmlList, StringUtil.null2String(article.getColumn().getCategoryTitle()),TYPENAME_FIELD_LIST); + // 文章链接 :[field.link/] + String link = path + StringUtil.null2String(article.getColumn().getColumnPath()) + File.separator + article.getBasicId() + IParserRegexConstant.HTML_SUFFIX; + //判断文章的类型是单页还是列表 + if(article.getColumn().getColumnType()==ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()){ + link =path + StringUtil.null2String(article.getColumn().getColumnPath()) + File.separator + IParserRegexConstant.HTML_INDEX; + } + + link = StringUtil.removeRepeatStr(link, File.separator).replace(":/", "://"); + htmlList = tabContent(htmlList, link,LINK_FIELD_LIST); + // 分类编号,文章所属分类的编号, + htmlList = tabContent(htmlList, article.getBasicCategoryId(),TYPEID_FIELD_LIST); + // 文章略图[field.litpic/] + htmlList = tabContent(htmlList, StringUtil.null2String(article.getBasicThumbnails()),LITPIC_FIELD_LIST); + // 文章描述标签[field.descrip/] + htmlList = tabContent(htmlList, StringUtil.null2String(article.getBasicDescription()),DESCIRIP_FIELD_LIST); + // 当前页面文章的数量[field.num] + String numArticle = Integer.toString(articleList.size()); + htmlList = tabContent(htmlList, numArticle,NUM_ARTICLE_LIST); + //分类连接:[field.typelink/] 点击连接连接到当前分类的列表 + String channelLink = path+File.separator+StringUtil.null2String(article.getColumn().getColumnPath())+File.separator+ IParserRegexConstant.HTML_INDEX; + channelLink = StringUtil.removeRepeatStr(channelLink, File.separator); + htmlList = tabContent(htmlList, channelLink,TTYPELINK_FIELD_LIST); + + //对自定义字段进行替换 + htmlList = replaceField(htmlList,article.getColumn(),article.getBasicId()); + + // 文章内容, + htmlList = tabContent(htmlList, contentLength(article.getArticleContent(), htmlList),CONTENT_FIELD_LIST); + } + + } + } + return htmlList; + } + + + +} diff --git a/src/main/java/com/mingsoft/cms/parser/impl/NoParser.java b/src/main/java/com/mingsoft/cms/parser/impl/NoParser.java new file mode 100644 index 00000000..11391248 --- /dev/null +++ b/src/main/java/com/mingsoft/cms/parser/impl/NoParser.java @@ -0,0 +1,185 @@ +package com.mingsoft.cms.parser.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import com.mingsoft.parser.IParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.RegexUtil; +import com.mingsoft.util.StringUtil; +/** + * 不解析标签类,当前端使用该标签后。被该标签包裹的内容的标签将不会被解析 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2015-11-19
+ * 历史修订:
+ */ +public class NoParser extends IParser{ + + /** + * 不解析标签开始正则表达式 + */ + protected final static String LIST_NOPARSER="\\{ms:noparser\\}"; + + + /** + * 不解析标签临时标记标签 + */ + protected final static String TAB_BODY="\\{MS:NOTAB\\}([\\s\\S]*?)\\{/MS:NOTAB}"; + + /** + * 临时标签开始标记 + */ + protected final static String TAB_BEGIN_LIST="{MS:NOTAB}"; + + /** + * 临时标签结束标签 + */ + protected final static String LIST_TEMP_TAB_END="\\{MS:NOTAB}([\\s\\S]*?)(\\{\\/ms:noparser})"; + + /** + * 不解析标签结束正则表达式 + */ + protected final static String LIST_END="\\{/ms:noparser\\}"; + + /** + * 不解析标签结束标签的临时结束标签 + */ + protected final static String TAB_END_LIST="\\{/MS:NOTAB\\}"; + + /** + *标记标签 + */ + protected final static String TAB_CONTENT="{MS:NOPARSER}"; + + /** + * 标记标签对应的正则表达式 + */ + protected final static String TAB_REG_CONTENT="\\{MS:NOPARSER\\}"; + + /** + * 用来暂时存放不解析标签包着的htm代码 + */ + private List noParserHtml = new ArrayList(); + + /** + * 不解析标签的个数 + */ + int noParserCount ; + /** + * + * @param htmlCotent html模版内容 + */ + public NoParser(String htmlCotent) { + this.htmlCotent = htmlCotent; + } + + + + /** + * 计算不解析标签的个数 + * @param html htm模版 + * @return 个数 + */ + public static int countParser(String html) { + int listNumBegin = count(html,LIST_NOPARSER); + return listNumBegin; + } + + /** + * 将不解析的标签替换成中间标签 + */ + @Override + public String parse() { + //获取模版中不解析标签的个数 + this.noParserCount = countParser(htmlCotent); + for(int i=0;i getNoParserHtml(int count){ + List noParserHtml = new ArrayList(); + for(int i=0;i + * 铭飞基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author wangtp + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: + *

+ * + *

+ * Create Date:2014-1-4 + *

+ * + *

+ * Modification history: + *

+ */ +public final class Const { + + /** + * 当前请求路径,BaseFilter赋值 + */ + public static String BASE_URL; + + /** + * 项目名称,BaseFilter赋值 + */ + public static String BASE; + + /** + * 项目物理路径,BaseFilter赋值 + */ + public static String PROJECT_PATH; + + /** + * spring资源文件加载上下文对象 + */ + public static ApplicationContext CONTEXT; + + /** + * action层对应的国际化资源文件 + */ + public final static ResourceBundle RESOURCES = ResourceBundle + .getBundle("com.mingsoft.base.action.resources"); + + /** + * 默认系统管理员所对应的角色ID为1 + */ + public final static int DEFAULT_SYSTEM_MANGER_ROLE_ID = 1; + + /** + * 默认站点管理员所对应的角色ID为2 + */ + public final static int DEFAULT_WEBSITE_MANGER_ROLE_ID = 2; + + /** + * 默认CMS所对应的模块ID为1 + */ + public final static int DEFAULT_CMS_MODEL_ID = 1; + + /** + * 顶级栏目的父栏目ID为0 + */ + public final static int COLUMN_TOP_CATEGORY_ID = 0; + + /** 微信相关开始 */ + + /** + * 服务器发布地址,带有http:// 在StrutsFilter类里面设置 + */ + public static String HOST_URL = ""; + + + /** 微信相关结束 */ + + public final static String UTF8 = "utf-8"; + + +} diff --git a/src/main/java/com/mingsoft/constant/CookieConst.java b/src/main/java/com/mingsoft/constant/CookieConst.java new file mode 100644 index 00000000..58600417 --- /dev/null +++ b/src/main/java/com/mingsoft/constant/CookieConst.java @@ -0,0 +1,85 @@ +package com.mingsoft.constant; + +/** + * + * + * + * + *

+ * 铭飞科技MS-MMS + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author killfen + * + * @version 100-000-000 + * + *

+ * 版权所有 + *

+ * + *

+ * Comments:cookie枚举类 + *

+ * + *

+ * Create Date:2014-6-15 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public enum CookieConst{ + /** + * 用户的cookie + */ + PEOPLE_COOKIE("people_cookie"), + + /** + * 分页cookie + */ + PAGENO_COOKIE("pageno_cookie"), + + /** + *上次访问地址 + */ + BACK_COOKIE("back_cookie"), + + + /** + * 保存用户QQ登录cookie
+ * cookie为openId + */ + API_LOGIN_QQ_COOKIE("api_login_qq_cookie"), + + /** + * 课表cookie + * 保存用户所在的班级 + */ + CURRICULUM_COOKIE("curriculum_cookie"), + + /** + * QQ登录保存当前用户点击地址的session + */ + API_LOGIN_QQ_URL("api_login_qq_url"); + + CookieConst(String attr) { + this.attr = attr; + } + + private String attr; + + @Override + public String toString() { + // TODO Auto-generated method stub + return attr; + } +} diff --git a/src/main/java/com/mingsoft/constant/ModelCode.java b/src/main/java/com/mingsoft/constant/ModelCode.java new file mode 100644 index 00000000..047e47d9 --- /dev/null +++ b/src/main/java/com/mingsoft/constant/ModelCode.java @@ -0,0 +1,251 @@ +package com.mingsoft.constant; + +import com.mingsoft.basic.constant.e.BaseEnum; + +/** + * + * + * + *

+ * 铭飞科技J2EE基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2013 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author killfen + * + * @version 100-000-000 + * + *

+ * 版权所有 + *

+ * + *

+ * Comments: 模块编号说明:八位整型数据
+ * 项目编号(2位)+模块编号(2位)+功能编号(2位)+子功能编号(2位)
+ * 如:01(微信项目编号)01(微页面模块编号)01(模版管理编号)01(添加模版)
+ * 若为:01010100则代表整个模块管理功能模块
+ *

+ * + *

+ * Create Date:2013-9-4 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public enum ModelCode implements BaseEnum{ + + /** + * 登录模块编号 + */ + ADMIN_LOGIN("00000000"), + /** + * 权限管理:角色权限模块编号 + */ + ROLE("01010000"), + + /** + * 管理员管理 + */ + ROLE_MANAGER("01020000"), + + /** + * 内容:站点模块编号 + */ + APP("02010000"), + /** + * 内容:栏目模块编号 + */ + CMS_COLUMN("02990000"), + + /** + * 内容:文章模块编号 + */ + CMS_ARTICLE("02980100"), + /** + * 内容:文章列表 + */ + CMS_ARTICLE_BASIC("02980000"), + /** + * 内容:自定义搜索 + */ + CMS_SEARCH("02050000"), + + /** + * 内容:自定义模型 + */ + CMS_CONTENT_MODEL("02060000"), + + /** + * 内容:一键更新 + */ + CMS_GENERATE_ALL("02070100"), + + /** + * 内容:更新主页 + */ + CMS_GENERATE_INDEX("02070200"), + + /** + * 内容:更新文档 + */ + CMS_GENERATE_ARTICLE("02070300"), + + /** + * 内容: 更新栏目 + */ + CMS_GENERATE_COLUMN("02070400"), + + /** + * 内容:模版 + */ + CMS_TEMPLETSKIN("02080000"), + + /** + * 内容:织梦数据导入 + */ + COM_DEDE_DATA_IMPORT("02090100"), + + /** + * 评论系统:评论模块编号 + */ + COMMENT("05010000"), + + + + /** + * 学校管理 + */ + CURRICULUM_SCHOOL("03010100"), + + /** + * 系管理 + */ + CURRICULUM_FACULTY("03010200"), + + /** + * 教室管理 + */ + CURRICULUM_CLASS_ROOM("03010300"), + + /** + * 老师管理 + */ + CURRICULUM_TEACHER("03010400"), + + /** + * 课程管理编号 + */ + CURRICULUM_COURSE("03010500"), + + /** + * 初始化课表管理 + */ + CURRICULUM("03020100"), + + /** + * 自定义课表管理 + */ + CURRICULUM_CUSTOM("03020200"), + + /** + * 课表用户管理 + */ + CURRICULUM_PEOPLE("03020300"), + + /** + * 微信图文素材 + */ + WEIXIN_NEWS("05030100"), + + /** + * 微信图片素材 + */ + WEIXIN_NEWS_IMAGE("05030200"), + + /** + * 微信文本素材 + */ + WEIXIN_NEWS_TEXT("05030300"), + + /** + * 微信消息模块 + */ + WEIXIN_MESSAGE("05050000"), + + /** + * 微信网页2.0授权管理 + */ + WEIXIN_OAUTH("05070000"), + + /** + * 用户信息模块 + */ + PEOPLE("07000000"), + + /** + * 用户注册 + */ + PEOPLE_REGISTER("07010100"), + + /** + * 用户登录 + */ + PEOPLE_LOGIN("07010200"), + + /** + * 普通用户管理 + */ + PEOPLE_USER("07020100"), + + + + /** + * 关注 + */ + ATTENTION("09000000"), + + + + /** + * 快递单号 + */ + EXPRESS_NO("03980000"), + /** + * 城市 + */ + CITY("10990000"), + + /** + * 学校 + */ + SCHOOL("10980000"); + + + + + ModelCode(String code) { + this.code = code; + } + + private String code; + + @Override + public String toString() { + // TODO Auto-generated method stub + return code; + } + + public int toInt() { + // TODO Auto-generated method stub + return Integer.parseInt(code); + } +} diff --git a/src/main/java/com/mingsoft/constant/SessionConst.java b/src/main/java/com/mingsoft/constant/SessionConst.java new file mode 100644 index 00000000..c2089c24 --- /dev/null +++ b/src/main/java/com/mingsoft/constant/SessionConst.java @@ -0,0 +1,81 @@ +package com.mingsoft.constant; + +public enum SessionConst { + + + /** + * 用户的session + */ + PEOPLE_SESSION("people_session"), + + /** + *用户取回密码的session + */ + PEOPLE_GET_PASSWORD_SESSION("people_get_password_session"), + + /** + * 用户更改手机号码的session + */ + PEOPEL_SET_PHONE_SESSION("people_set_phone_seesion"), + + /** + * 模块idsession + */ + MODEL_ID_SESSION("model_id_session"), + + /** + * 模块名称 + */ + MODEL_TITLE_SESSION("model_title_session"), + + /** + * 普通管理员的sesison + */ + MANAGER_ESSION("manager_session"), + + /** + * 验证码session + */ + CODE_SESSION("rand_code"), + + /** + * 普通管理员角色菜单的sesison + */ + MANAGER_ROLE_MODEL_ESSION("manager_role_model_session"), + + + /** + * 模块编号 + */ + MANAGER_MODEL_CODE("manager_model_code"), + + /** + * QQ登录保存当前用户点击地址的session + */ + API_LOGIN_QQ_URL("api_login_qq_url"); + +/**微信相关开始*/ + +/**微信相关结束*/ + + + SessionConst(String attr) { + this.attr = attr; + } + + + + private String attr; + + + + /* (non-Javadoc) + * @see java.lang.Enum#toString() + */ + @Override + public String toString() { + // TODO Auto-generated method stub + return attr; + } + +} diff --git a/src/main/java/com/mingsoft/parser/IGeneralParser.java b/src/main/java/com/mingsoft/parser/IGeneralParser.java new file mode 100644 index 00000000..ec14efb9 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/IGeneralParser.java @@ -0,0 +1,194 @@ +/** + * + */ +package com.mingsoft.parser; + +import java.io.File; + +import org.apache.log4j.Logger; + +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.base.constant.Const; +import com.mingsoft.parser.impl.general.GlobalCopyrightParser; +import com.mingsoft.parser.impl.general.GlobalDescripParser; +import com.mingsoft.parser.impl.general.GlobalHostParser; +import com.mingsoft.parser.impl.general.GlobalKeywordParser; +import com.mingsoft.parser.impl.general.GlobalLogoParser; +import com.mingsoft.parser.impl.general.GlobalNameParser; +import com.mingsoft.parser.impl.general.GlobalSkinUrlParser; +import com.mingsoft.parser.impl.general.GlobalUrlParser; +import com.mingsoft.parser.impl.general.IncludeParser; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments: ms平台通用标签解析 + *

+ * + *

+ * Create Date:2015-4-19 + *

+ * + *

+ * Modification history: + *

+ */ +public abstract class IGeneralParser extends IParser { + + /** + * 移动端生成路径 + */ + public static final Object MOBILE = "mobilePath"; + + + + protected AppEntity app; + + protected String mobilePath = ""; + + protected String htmlContent; + + protected PageUtil page; + + /** + * 模块模板路径,例如论坛、商城等 + */ + protected String modelPath = ""; + + /** + * 模块编号 + */ + protected int modelId; + + public static final String MODEL_ID = "modelId", CUR_COLUMNID = "curColumnId", PREVIOUS = "previous", NEXT = "next", CUR_PAGE_NO = "curPageNo", LIST_LINK_PATH = "listLinkPath"; + + /** + * 通用的标签解析方法,其他扩展方法务必要调用该方法,否则导致模板页面取不出基本数据,如:网站名称,网站的地址,关键字等待 + * + * @return 解析好的内容,一般不会出现什么问题,如果出现问题会返回注释格式的提示信息 + */ + protected String parseGeneral() { + htmlContent = new IncludeParser(htmlContent, Const.PROJECT_PATH + File.separator + IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + app.getAppId() + File.separator + app.getAppStyle() + File.separator + modelPath + File.separator, mobilePath).parse(); + // 替换网站版权信息标签:{ms: global.copyright/} + htmlContent = new GlobalCopyrightParser(htmlContent, app.getAppCopyright()).parse(); + + // 替换网站关键字标签:{ms: global.keyword/} + htmlContent = new GlobalKeywordParser(htmlContent, app.getAppKeyword()).parse(); + + // 替换网站LOGO标签:{ms: global.logo/} + htmlContent = new GlobalLogoParser(htmlContent, app.getAppLogo()).parse(); + + // 替换网站名称标签:{ms:global.name /} + htmlContent = new GlobalNameParser(htmlContent, app.getAppName()).parse(); + + // 替换模版链接地址标签:{ms: globalskin.url/} + String tmpSkinUrl = app.getAppHostUrl() + StringUtil.removeRepeatStr(File.separator + IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + app.getAppId() + File.separator + app.getAppStyle(), File.separator)+File.separator; + // 替换网站链接地址标签:{ms:global.url/} + String linkUrl = app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId()+File.separator; + //如果论坛模板不为空,模板连接地址=原有地址+"/"+论坛模板 + if(!StringUtil.isBlank(modelPath)){ + tmpSkinUrl=tmpSkinUrl+ File.separator +modelPath; + linkUrl=linkUrl+File.separator +modelPath; + } + //如果手机端模板不为空,模板连接地址=原有地址+"/"+手机模板 + if(!StringUtil.isBlank(this.mobilePath)){ + tmpSkinUrl=tmpSkinUrl+File.separator + this.mobilePath; + linkUrl=linkUrl+File.separator +this.mobilePath; + } + //去掉重复的"/" + //tmpSkinUrl = StringUtil.removeRepeatStr(tmpSkinUrl, File.separator); + //linkUrl = StringUtil.removeRepeatStr(linkUrl, File.separator); + htmlContent = new GlobalSkinUrlParser(htmlContent, tmpSkinUrl).parse(); + + htmlContent = new GlobalUrlParser(htmlContent, linkUrl).parse(); + + // 替换网站链接地址标签:{ms:global.host/} + htmlContent = new GlobalHostParser(htmlContent, app.getAppHostUrl()).parse(); + + // 替换网站描述标签:{ms: global.descrip/} + htmlContent = new GlobalDescripParser(htmlContent, app.getAppDescription()).parse(); + return htmlContent; + } + + /** + * 生成通用标签, + * + * @param modelPath + * 对用模块模板路径 + * @return 解析后的结果 + */ + protected String parseGeneral(String modelPath) { + this.modelPath = modelPath; + return parseGeneral(); + } + + /** + * 会根据用户的请求客户端返回pc页面\手机页面主机地址 + * + * @return 应用的主机地址 + */ + protected String getWebsiteUrl() { + if (!StringUtil.isBlank(mobilePath)) { + return StringUtil.removeRepeatStr(app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId() + File.separator + mobilePath,File.separator); + } + return app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId(); + } + + /** + * 解析方法模板,最后调用该方法返回生成后的数据 + * + * @param html + * 模板源代码 + * @param obj + *  可选:便于子模块调用的时候进行参数扩展,具体的参数由子模块控制,例如解析分页模板的时候就需要外部传入地址, + * @return 生成好的html内容 + */ + public abstract String parse(String html, Object... obj); + + @Override + public String parse() { + // TODO Auto-generated method stub + return this.parse(); + } + + /** + * 解析器入口,通常第一个参数未appEntity,如果存在map类型,那么map的的键值为IGeneralParser常量 + * 1、内容数据显示、列表数据、 a、cms 下的文章显示,当前文章的上一篇、下一篇、当前文章栏目 MsTagParser mtp = new + * MsTagParser(模块代码,ServletConext); Map map = new HashMap(); + * map.put(CmsParser.PREVIOUS,preArticle); + * map.put(CmsParser.NEXT,preArticle); mtp.parse(app,article,); + * + * b、cms列表,必须知道当前栏目信息 mtp.parse(app,article,column); 2、自动定义页面 + * + * @param obj + * ,可以存在多个,对于基础数据类型可以使用map存储,对象直接传入 + * @return + */ + public void init(Object... obj) { + for (Object o : obj) { + if (o != null) { + if (o instanceof AppEntity) { + this.app = (AppEntity) o; + } + if (o instanceof PageUtil) { + this.page = (PageUtil) o; + } + } + } + } + +} diff --git a/src/main/java/com/mingsoft/parser/IParser.java b/src/main/java/com/mingsoft/parser/IParser.java new file mode 100644 index 00000000..88515bb7 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/IParser.java @@ -0,0 +1,185 @@ +package com.mingsoft.parser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.mingsoft.util.RegexUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments:基于模板方法模式,抽出通用标签解析父类, + *

+ * + *

+ * Create Date:2015-4-18 + *

+ * + *

+ * Modification history: + *

+ */ +public abstract class IParser { + + /** + * 定位标签中属性的值 + */ + protected final static String PROPERTY_VALUE = "=\\s*(\\w*)"; + + /** + * 定位标签中属性的名称 + */ + protected final static String PRORETY_NAME = "(\\w*)\\s*="; + + /** + * 查询规则匹配次数 + * + * @param source + * 模版 + * @param regex + * 标签 + * @return 标签的数量 + */ + protected static int count(String source, String regex) { + return RegexUtil.count(source, regex); + } + + /** + * 返回所有匹配的结果,并且是find组 + * + * @return 标签的数量 + * @param source + *  模版 + * @param regex + *  规则 + * @param find + *  第几组 + * @return + */ + protected static List parseAll(String source, String regex, int find) { + return RegexUtil.parseAll(source, regex, find); + } + + /** + * 返回第一次匹配的结果,并且是find组 + * + * @param source + *  模版 + * @param regex + *  标签 + * @param find + * @return 匹配一次的值 + */ + protected static String parseFirst(String source, String regex, int find) { + return RegexUtil.parseFirst(source, regex, find); + } + + /** + * 原始html内容 + */ + protected String htmlCotent = null; + + protected String mobilePath = ""; + + /** + * 替换后的html内容 + */ + protected String newCotent = null; + + public String getNewCotent() { + return newCotent; + } + + /** + * 取出栏目标签中的属性 + * + * @param html + * HTML模版 + * @return 属性集合 + */ + public Map getProperty(String regex) { + Map listPropertyMap = new HashMap(); + String listProperty = parseFirst(this.htmlCotent, regex, 1); + if (listProperty == null) { + return listPropertyMap; + } + List listPropertyName = parseAll(listProperty, PRORETY_NAME, 1); + List listPropertyValue = parseAll(listProperty, PROPERTY_VALUE, 1); + for (int i = 0; i < listPropertyName.size(); i++) { + listPropertyMap.put(listPropertyName.get(i).toString(), listPropertyValue.get(i).toString()); + } + return listPropertyMap; + } + + /** + * 标签替换的抽象方法 + * + * @return 替换完成的HTML模版 + */ + public abstract String parse(); + + /** + * 用该内容替换所有当前标签 + * + * @param regex + * 正则 + * @return 替换后的内容 + */ + public String replaceAll(String regex) { + if (StringUtil.isBlank(newCotent)) { + newCotent = IParserRegexConstant.REGEX_ERRO; + } + return RegexUtil.replaceAll(htmlCotent, regex, newCotent); + } + + /** + * 用该内容替换所有当前标签 + * + * @param content + * 新内容 + * @param regex + * 正则 + * @return 替换后的内容 + */ + public String replaceAll(String content, String regex) { + return RegexUtil.replaceAll(htmlCotent, regex, content); + } + + /** + * 用该内容替换第一个当前找到的第一个标签 + * + * @param htmlCotent + * 源内容 + * @param newCotent + * 替换内容 + * @param regex + * 替换规则,更具RegexEnum + * @return 替换完成的HTML模版 + */ + public String replaceFirst(String regex) { + if (StringUtil.isBlank(newCotent)) { + newCotent = IParserRegexConstant.REGEX_ERRO; + } + return RegexUtil.replaceFirst(htmlCotent, regex, newCotent); + } + + public void setNewCotent(String newCotent) { + this.newCotent = newCotent; + } + +} diff --git a/src/main/java/com/mingsoft/parser/IParserRegexConstant.java b/src/main/java/com/mingsoft/parser/IParserRegexConstant.java new file mode 100644 index 00000000..a9e2517e --- /dev/null +++ b/src/main/java/com/mingsoft/parser/IParserRegexConstant.java @@ -0,0 +1,83 @@ +package com.mingsoft.parser; + + +/** + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments:解析器的通用提示信息,通用命名声明 + *

+ * + *

+ * Create Date:2015-4-18 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IParserRegexConstant { + + /** + * 存放模版的文件夹 + */ + final String REGEX_SAVE_TEMPLATE = "templets"; + + /** + * 模版主页 + */ + final String REGEX_INDEX_HTML = "index.htm"; + + + /** + * 没有找到相应的栏目后报错 + */ + final String REGEX_CHANNEL_ERRO = ""; + + /** + * 时间读取错误后报错 + */ + final String REGEX_DATE_ERRO = "时间读取失败"; + + /** + * 时间的默认格式 + */ + final String REGEX_DATE = "yyyy-MM-dd hh:mm:ss"; + + /** + * 移动端生成的目录 + */ + String MOBILE = "m"; + + /** + * 提示用户:标签错误 + */ + final String REGEX_ERRO = ""; + + /** + * 生成的静态列表页面名 + */ + final String PAGE_LIST = "list"; + /** + * 文件夹路径名 + */ + final String HTML_SUFFIX = ".html"; + + /** + * 默认页 + */ + String HTML_INDEX = "index.html"; + + /** + * 静态文件生成路径 + */ + final String HTML_SAVE_PATH = "html"; +} diff --git a/src/main/java/com/mingsoft/parser/PageUtilHtml.java b/src/main/java/com/mingsoft/parser/PageUtilHtml.java new file mode 100644 index 00000000..2a583468 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/PageUtilHtml.java @@ -0,0 +1,82 @@ +package com.mingsoft.parser; + +import com.mingsoft.util.PageUtil; + +public class PageUtilHtml extends PageUtil{ + + public PageUtilHtml(int pageNo, int pageSize, int recordCount, + String linkUrl) { + super(pageNo, pageSize, recordCount, linkUrl); + } + + + /** + * 获取首页链接地址 + * @return + */ + public String getIndexUrl() { + if (pageNo == 0) { + indexUrl = "#"; + } else { + indexUrl = this.linkUrl.replace("list", "") + IParserRegexConstant.HTML_INDEX; + } + return indexUrl; + } + + + /** + * 获取列表的上一页连接地址 + */ + public String getPreviousUrl(){ + if (pageNo == 0) { + previousUrl = "#"; + } else { + if(pageNo==1){ + previousUrl = this.linkUrl.replace("list", "") + IParserRegexConstant.HTML_INDEX; + }else{ + previousUrl = this.linkUrl + (pageNo)+IParserRegexConstant.HTML_SUFFIX; + } + + } + return previousUrl; + } + + /** + * 获取下一页连接地址 + */ + public String getNextUrl(){ + if (pageNo == pageCount) { + nextUrl = "#"; + } else { + if (pageNo+2>pageCount) { + if(pageCount==1){ + nextUrl = this.linkUrl.replace("list", "") + IParserRegexConstant.HTML_INDEX; + }else{ + nextUrl = this.linkUrl + pageCount+IParserRegexConstant.HTML_SUFFIX; + } + + } else { + nextUrl = this.linkUrl + (pageNo+2)+IParserRegexConstant.HTML_SUFFIX; + } + } + return nextUrl; + + } + + /** + * 获取末页的连接地址 + */ + public String getLastUrl(){ + if (pageNo == pageCount) { + lastUrl = "#"; + } else { + if(pageCount==1){ + lastUrl = this.linkUrl.replace("list", "") + IParserRegexConstant.HTML_INDEX; + }else{ + lastUrl = this.linkUrl + pageCount+IParserRegexConstant.HTML_SUFFIX; + } + } + return lastUrl; + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/ChannelContParser.java b/src/main/java/com/mingsoft/parser/impl/general/ChannelContParser.java new file mode 100644 index 00000000..74a16646 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/ChannelContParser.java @@ -0,0 +1,98 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.StringUtil; +/** + * 封面内容 + * 封面标签(单标签) + * {ms:channelcont titlelen= typeid=/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class ChannelContParser extends IParser{ + + /** + * 封面标签 + */ + private final static String CHANNELCONT="\\{ms:contchannel.*?/}"; + + /** + * 封面标签的Id属性 类型int 默认当前页面的封面(非必填) {ms:channelcont titlelen= typeid=/} + */ + private final static String TYPEID_CHANNELCONT="\\{ms:contchannel.*?(typeid\\=(\\d*).{0,})?/}"; + + /** + * 封面标签的内容长度属性 类型int 默认当前的所有内容(非必填) {ms:channelcont titlelen= typeid=/} + */ + private final static String TITLELEN_CHANNELCONT="\\{ms:contchannel.*?(titlelen\\=(\\d*).{0,})?/}"; + + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public ChannelContParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = channelContTitleLen(newContent,htmlContent); + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(CHANNELCONT); + } + + /** + *获取模版文件中封面标签的个数 + * @param html 文件模版 + * @return 返回该字符串的个数 + */ + public static int channelContNum(String html){ + int channelNum = count(html,CHANNELCONT); + return channelNum; + } + + + //------------------------解析标签中的属性------------------------ + /** + * 解析封面标签中的ID属性 + * @param htmlContent 原HTML代码 + */ + public static int channelContTypeId(String htmlContent){ + int channelContTypeId = 0; + String typeIdStr = parseFirst(htmlContent,TYPEID_CHANNELCONT,2); + if(!StringUtil.isBlank(typeIdStr)){ + channelContTypeId = Integer.parseInt(typeIdStr); + } + return channelContTypeId; + } + + /** + * 判断封面标签中内容的长度 + * @param content 标题的内容 + * @param htmlContent HTML模版 + * @return 截取后的内容长度 + */ + public static String channelContTitleLen(String content,String htmlContent){ + //从HTML代码中内容的长度,默认为全部显示 + int lengthCon = 0; + String length = parseFirst(htmlContent,TITLELEN_CHANNELCONT, 2); + if(!StringUtil.isBlank(length) && !StringUtil.isBlank(content)){ + lengthCon = Integer.parseInt(length); + } + //根据长度取出内容 + String contentNew = content; + if(StringUtil.isBlank(content)){ + contentNew = IParserRegexConstant.REGEX_ERRO+",请检封面查ID"; + } + if(lengthCon != 0 && !(lengthCon > contentNew.length())){ + StringBuffer strBuff = new StringBuffer(contentNew); + contentNew = strBuff.substring(0,lengthCon); + } + return contentNew; + } +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/ChannelParser.java b/src/main/java/com/mingsoft/parser/impl/general/ChannelParser.java new file mode 100644 index 00000000..7c61bc17 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/ChannelParser.java @@ -0,0 +1,333 @@ +package com.mingsoft.parser.impl.general; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.mingsoft.cms.entity.ColumnEntity; + +import com.mingsoft.parser.IParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.RegexUtil; +import com.mingsoft.util.StringUtil; + +/** + * 栏目标签 (列表标签) {ms:channel type=son typeid=}:栏目父标标签 {/ms:channel}:栏目父标签 + * [field.typeindex/]:栏目序号标签 [field.typetitle/]:栏目名称标签 [field.typelink/]:栏目链接标签 + * [field.typekeyword/]:栏目关键字 [field.typedescrip/]:栏目描述 + * + * @author 成卫雄 QQ:330216230 技术支持:景德镇铭飞科技 官网:www.ming-soft.com + */ +public class ChannelParser extends IParser { + + /** + * 列表临时标签,开始标签 + */ + private final static String TAB_BEGIN_LIST = "{MS:TAB}"; + + /** + * 查找HTML中栏目列表的正则表达式的开始位置标签 栏目父标签 {ms:channel type=”sun” typeid=””} + */ + private final static String CHANNEL_BEGIN = "\\{ms:channel.*?\\}"; + + /** + * 列表临时标签,结束标签 + */ + private final static String TAB_END_LIST = "{/MS:TAB}"; + + /** + * 查找HTML中栏目列表的正则表达式的结束位置标签 栏目父标签 {/ms:channel} + */ + private final static String CHANNEL_END = "\\{/ms:channel\\}"; + + /** + * 列表临时标签,内容规则 + */ + private final static String TAB_BODY = "\\{MS:TAB\\}([\\s\\S]*?)\\{/MS:TAB}"; + + /** + * 栏目序号 根据显示条数显示的序号1 2 …..10 栏目子标签 [field.typeindex/] + */ + private final static String CHANNEL_INDEX = "\\[field.typeindex/\\]"; + + /** + * 标题 栏目名称 栏目子标签 [field.typetitle/] + */ + private final static String CHANNEL_TITLE = "\\[field.typetitle/\\]"; + + /** + * 栏目连接 栏目子标签 [field.typelink/] + */ + private final static String CHANNEL_LINK = "\\[field.typelink/\\]"; + + /** + * 栏目关键字 栏目子标签 [field.typekeyword/] + */ + private final static String CHANNEL_KEYWORD = "\\[field.typekeyword/\\]"; + + /** + * 栏目关键字 栏目子标签 [field.typekeyword/] + */ + private final static String CHANNEL_DESCRIP = "\\[field.typedescrip/\\]"; + + /** + * 获取栏目id + */ + private final static String CHANNEL_FIELE_ID="\\[field.typeid/\\]"; + + /** + * 分类选中样式 + */ + public static final String CHANNEL_CLASS = "class"; + + /** + * 栏目列表的属性 类型String 取值范围:son|top son表示下级栏目(默认值) top顶级栏目(非必填) 栏目父标签 + * {ms:channel type=”sun” typeid=””} + */ + public static final String CHANNEL_TYPE = "type"; + + /** + * 栏目列表的属性 类型String 取值范围:son|top son表示下级栏目(默认值) top顶级栏目(非必填) 栏目父标签 + * {ms:channel type=”sun” typeid=””} + */ + public static final String CHANNEL_TYPE_SON = "son"; + + /** + * 栏目列表的属性 类型String 取值范围:son|top son表示下级栏目(默认值) top顶级栏目(非必填) 栏目父标签 + * {ms:channel type=”sun” typeid=””} + */ + public static final String CHANNEL_TYPE_TOP = "top"; + + /** + * 栏目列表的属性 类型String 取值范围:son|top|level son表示下级栏目(默认值) top顶级栏目(非必填) level取同一级 + * 栏目父标签 {ms:channel type=”sun” typeid=””} + */ + public static final String CHANNEL_TYPE_LEVEL = "level"; + + /** + * 栏目列表的属性 类型int 默认当前页面的栏目编号(非必填) 栏目父标签 {ms:channel type=”sun” typeid=} + */ + public static final String CHANNEL_TYPEID = "typeid"; + + /** + * 当前选中类别样式 + */ + public static final String CHANNEL_FIELD_CLASS = "\\[field.class/\\]"; + + /** + * 分类是否显示子分类的属性名 + * sibling=true:当该分类下没有子分类时显示其同级栏目 + * sibling=false:当该分类下没有子分类时则不显示 + */ + public static final String CHANNEL_TYP_SIBLING="sibling"; + + /** + * 当前栏目 + */ + private int curColumnId; + + /** + * 选中样式 + */ + private String className; + + /** + * 构造替换栏目标签的必须参数 + * + * @param htmlCotent + * HTML模版 + * @param newContent + * 替换内容 + */ + public ChannelParser(String htmlCotent, List newContent, String page) { + // 在HTML模版中标记出要用内容替换的标签 + String htmlCotents = channelPrplace(htmlCotent, TAB_BEGIN_LIST, CHANNEL_BEGIN); + htmlCotents = channelPrplace(htmlCotents, TAB_END_LIST, CHANNEL_END); + // 经过遍历后的数组标签 + super.newCotent = articleTypeList(htmlCotents, newContent, page); + super.htmlCotent = htmlCotents; + } + + /** + * 构造替换栏目标签的必须参数 + * + * @param htmlCotent + * HTML模版 + * @param newContent + * 替换内容 + * @param page + * @param curColumnId + * 当前分类id + * @param className + * 选中分类样式 + */ + public ChannelParser(String htmlCotent, List newContent, String page, int curColumnId, String className) { + this.curColumnId = curColumnId; + this.className = className; + // 在HTML模版中标记出要用内容替换的标签 + String htmlCotents = channelPrplace(htmlCotent, TAB_BEGIN_LIST, CHANNEL_BEGIN); + htmlCotents = channelPrplace(htmlCotents, TAB_END_LIST, CHANNEL_END); + // 经过遍历后的数组标签 + super.newCotent = articleTypeList(htmlCotents, newContent, page); + super.htmlCotent = htmlCotents; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + String channelHtml = this.replaceFirst(TAB_BODY); + return channelHtml; + } + + /** + * 将用需要用内容替换的标签换成标记标签 + * + * @param htmlCotent + * 原HTML文件 + * @return 替换好标签后的HTNL文件 + */ + private String channelPrplace(String htmlCotent, String regexTab, String regex) { + String htmlCotents = ""; + super.htmlCotent = htmlCotent; + super.newCotent = regexTab; + htmlCotents = this.replaceFirst(regex); + if (htmlCotents.equals("")) { + htmlCotents = "标签格式错误"; + } + return htmlCotents; + } + + @Override + public String replaceFirst(String regex) { + return RegexUtil.replaceFirst(htmlCotent, regex, newCotent); + } + + /** + * 替换的数组内容 + * + * @param htmlCotent + * 用标记标签替换好的HTML模版代码 + * @param newContent + * 需要插入数组的内容 + * @return 如果存在该标签返回替换后的标签和内容,如果不存在则返回空 + */ + private String tabContent(String htmlCotent, String newContent, String regex) { + if (StringUtil.isBlank(newCotent)) { + newCotent = regex; + } + String htmlCotents = htmlCotent; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(htmlCotent); + if (matcher.find()) { + htmlCotents = matcher.replaceAll(newContent.toString().replace("\\", "/")); + } + return htmlCotents; + } + + /** + * 在替换好标签的HTML代码中将用标签替换的那段HTML代码截取出来 + * + * @param htmlCotent + * 替换好标签后的HTML代码 + * @return 标签替换的那段HTML代码截取出来 + */ + private String tabHtml(String htmlCotent) { + Pattern patternList = Pattern.compile(TAB_BODY); + Matcher matcherList = patternList.matcher(htmlCotent); + if (matcherList.find()) { + htmlCotent = matcherList.group(1); + } + return htmlCotent; + } + + /** + * 遍历文章数组,将取出的内容替换标签 [field.typeindex/]:栏目序号标签 [field.typetitle/]:栏目名称标签 + * [field.typelink/]:栏目链接标签 + * + * @param htmlCotent + * 原HTML代码 + * @param articleList + * 文章数组 + * @param webUrl + * 网站连接地址 + * @return 用内容替换标签后的HTML代码 + */ + private String articleTypeList(String htmlCotent, List articleTypeList, String webUrl) { + String tabHtml = tabHtml(htmlCotent); + String htmlList = ""; + if (articleTypeList != null && articleTypeList.size() != 0) { + for (int i = 0; i < articleTypeList.size(); i++) { + ColumnEntity articleType = articleTypeList.get(i); + // if (articleType.getCategoryCategoryId()==0) { //排除父节点 + // continue; + // } + // 替换栏目序号标签 + htmlList += tabContent(tabHtml, StringUtil.int2String((i + 1)), CHANNEL_INDEX); + // 替换栏目标题标签 + htmlList = tabContent(htmlList, articleType.getCategoryTitle(), CHANNEL_TITLE); + // 替换栏目链接标签 + + String linkUrl = webUrl + File.separator + StringUtil.null2String(articleType.getColumnPath()) + File.separator + IParserRegexConstant.HTML_INDEX; + linkUrl = StringUtil.removeRepeatStr(linkUrl, File.separator).replace(":/", "://"); + htmlList = tabContent(htmlList, linkUrl, CHANNEL_LINK); + // 替换栏目关键字标签 + htmlList = tabContent(htmlList, articleType.getColumnKeyword(), CHANNEL_KEYWORD); + // 替换栏目描述标签 + htmlList = tabContent(htmlList, articleType.getColumnDescrip(), CHANNEL_DESCRIP); + //替换栏目id标签 + htmlList = tabContent(htmlList, articleType.getCategoryId()+"", CHANNEL_FIELE_ID); + if (this.curColumnId == articleType.getCategoryId() && !StringUtil.isBlank(className)) { + htmlList = tabContent(htmlList, className, CHANNEL_FIELD_CLASS); + } else { + htmlList = tabContent(htmlList, "", CHANNEL_FIELD_CLASS); + } + } + } + + else { + htmlList = IParserRegexConstant.REGEX_CHANNEL_ERRO; + } + return htmlList; + } + + // ——————————————————————————————————解析父标签中的属性开始—————————————————————————————————— + /** + * 获取模版文件中栏目列表的个数 + * + * @param html + * 文件模版 + * @return 返回该字符串的个数 + */ + public static int channelNum(String html) { + int channelNumBegin = count(html, CHANNEL_BEGIN); + return channelNumBegin; + } + + /** + * 定位栏目标签中所有的属性 + */ + private final static String CHANNEL_PROPERTY = "\\{ms:channel(.*)?\\}"; + + /** + * 取出栏目标签中的属性 + * + * @param html + * HTML模版 + * @return 属性集合 + */ + public static Map channelProperty(String html) { + Map listPropertyMap = new HashMap(); + String listProperty = parseFirst(html, CHANNEL_PROPERTY, 1); + + List listPropertyName = parseAll(listProperty, PRORETY_NAME, 1); + List listPropertyValue = parseAll(listProperty, PROPERTY_VALUE, 1); + for (int i = 0; i < listPropertyName.size(); i++) { + listPropertyMap.put(listPropertyName.get(i).toString(), listPropertyValue.get(i).toString()); + } + return listPropertyMap; + } + // ——————————————————————————————————解析父标签中的属性结束—————————————————————————————————— +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/DateParser.java b/src/main/java/com/mingsoft/parser/impl/general/DateParser.java new file mode 100644 index 00000000..fe7c53ef --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/DateParser.java @@ -0,0 +1,122 @@ +package com.mingsoft.parser.impl.general; + +import java.util.Date; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.mingsoft.parser.IParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.StringUtil; + +/** + * + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments:时间解析规则 + *

+ * + *

+ * Create Date:2015-4-27 + *

+ * + *

+ * Modification history: + *

+ */ +public class DateParser extends IParser { + + /** + * 网站路径标签,单标签,主要用于提交列表等HTML的路径到相应的action中 网站全局标签 {ms:global.url/} + */ + private String dateReg = "\\[field.date\\s{0,}(fmt=(.*?))?/]"; + + private Date date; + + /** + * 构造标签的属性 + * + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public DateParser(String htmlContent,Date date) { + super.htmlCotent = htmlContent; + this.date = date; + } + + /** + * 构造标签的属性 + * + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + * @param dateReg标签规则 + */ + public DateParser(String htmlContent,Date date,String dateReg) { + super.htmlCotent = htmlContent; + this.date = date; + this.dateReg = dateReg; + } + + + /** + * 构造标签的属性 + * + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public DateParser(String htmlContent, String newContent) { + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + Pattern pattern = Pattern.compile(dateReg); + Matcher matcher = pattern.matcher(htmlCotent); + while (matcher.find()) { + String date = matcher.group(); + htmlCotent = htmlCotent.replace(date, date(date)); + } + return htmlCotent; + } + + /** + * 将时间格式转换成字符串型并改变时间的显示格式 + * + * @param date + * 数据库中的时间 + * @param htmlCotent + * 读取时间格式的HTML代码 + * @return 时间 + */ + private String date(String reg) { + // 从HTML代码中取出时间的显示格式,默认为yyyy-MM-dd hh:mm:ss形式 + String typeDate = IParserRegexConstant.REGEX_DATE; + String fmt = parseFirst(htmlCotent,dateReg, 2); + if (!StringUtil.isBlank(fmt)) { + typeDate = fmt; + } + // 将时间转换成String型 + String srtDate = IParserRegexConstant.REGEX_DATE_ERRO; + if (date != null) { + try { + java.text.SimpleDateFormat forDate = new java.text.SimpleDateFormat(typeDate); + srtDate = forDate.format(date); + } catch (Exception e) { + // TODO: handle exception + } + } + return srtDate; + } +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/GlobalCopyrightParser.java b/src/main/java/com/mingsoft/parser/impl/general/GlobalCopyrightParser.java new file mode 100644 index 00000000..f4d7b608 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/GlobalCopyrightParser.java @@ -0,0 +1,36 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; +/** + * 网站版权信息,网站标签(单标签) + * 网站全局标签 + * {ms: global.copyright/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class GlobalCopyrightParser extends IParser { + + /** + * 网站版权信息,网站标签 网站全局标签 {ms: global.copyright/} + */ + private final static String GLOBAL_COPYRIGHT="\\{ms:global.copyright/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public GlobalCopyrightParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(GLOBAL_COPYRIGHT); + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/GlobalDescripParser.java b/src/main/java/com/mingsoft/parser/impl/general/GlobalDescripParser.java new file mode 100644 index 00000000..d8963eb5 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/GlobalDescripParser.java @@ -0,0 +1,36 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; +/** + * 网站描述,网站标签(单标签) + * 网站全局标签 + * {ms: global.descrip/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class GlobalDescripParser extends IParser { + + /** + * 网站描述,网站标签 网站全局标签 {ms: global.descrip/} + */ + private final static String GLOBAL_DESCRIP="\\{ms:global.descrip/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public GlobalDescripParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(GLOBAL_DESCRIP); + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/GlobalHostParser.java b/src/main/java/com/mingsoft/parser/impl/general/GlobalHostParser.java new file mode 100644 index 00000000..c1ef0952 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/GlobalHostParser.java @@ -0,0 +1,54 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 + * QQ:78750478 + * + *

+ * Comments:网站主机地址 + *

+ * + *

+ * Create Date:2014-10-22 + *

+ * + *

+ * Modification history: + *

+ */ +public class GlobalHostParser extends IParser { + + /** + * 网站路径标签,单标签,主要用于提交列表等HTML的路径到相应的action中 网站全局标签 {ms:global.url/} + */ + private final static String GLOBAL_HOST="\\{ms:global.host/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public GlobalHostParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + return super.replaceAll(GLOBAL_HOST); + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/GlobalKeywordParser.java b/src/main/java/com/mingsoft/parser/impl/general/GlobalKeywordParser.java new file mode 100644 index 00000000..e843d98b --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/GlobalKeywordParser.java @@ -0,0 +1,37 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; + +/** + * 网站关键字,网站标签(单标签) + * 网站全局标签 + * {ms: global.keyword/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class GlobalKeywordParser extends IParser { + + /** + * 网站关键字,网站标签 网站全局标签 {ms: global.keyword/} + */ + private final static String GLOBAL_KEYWORD="\\{ms:global.keyword/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public GlobalKeywordParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(GLOBAL_KEYWORD); + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/GlobalLogoParser.java b/src/main/java/com/mingsoft/parser/impl/general/GlobalLogoParser.java new file mode 100644 index 00000000..2a286044 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/GlobalLogoParser.java @@ -0,0 +1,36 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; +/** + * 网站Logo,返回logo的图片地址(单标签) + * 网站全局标签 + * {ms: global.logo/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class GlobalLogoParser extends IParser { + + /** + * 网站Logo,返回logo的图片地址 网站全局标签 {ms: global.logo/} + */ + private final static String GLOBAL_LOGO="\\{ms:global.logo/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public GlobalLogoParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(GLOBAL_LOGO); + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/GlobalNameParser.java b/src/main/java/com/mingsoft/parser/impl/general/GlobalNameParser.java new file mode 100644 index 00000000..8c9046f6 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/GlobalNameParser.java @@ -0,0 +1,36 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; +/** + * 解析网站名称标签(单标签) + * 网站全局标签 + * {ms:global.name /} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class GlobalNameParser extends IParser { + + /** + * 网站名称 网站全局标签 {ms:global.name /} + */ + private final static String GLOBAL_NAME="\\{ms:global.name/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public GlobalNameParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(GLOBAL_NAME); + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/GlobalSkinUrlParser.java b/src/main/java/com/mingsoft/parser/impl/general/GlobalSkinUrlParser.java new file mode 100644 index 00000000..0bc8494b --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/GlobalSkinUrlParser.java @@ -0,0 +1,37 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; + +/** + * 模版路径标签 ,单标签,主要用语引入CSS,js等文件(单标签) + * 网站全局标签 + * {ms: globalskin.url /} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class GlobalSkinUrlParser extends IParser { + + /** + * 模版路径标签 ,单标签,主要用语引入CSS,js等文件4 网站全局标签 {ms:globalskin.url /} + */ + private final static String GLOBAL_SKIN="\\{ms:globalskin.url/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public GlobalSkinUrlParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(GLOBAL_SKIN); + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/GlobalUrlParser.java b/src/main/java/com/mingsoft/parser/impl/general/GlobalUrlParser.java new file mode 100644 index 00000000..2f80d3b4 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/GlobalUrlParser.java @@ -0,0 +1,37 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; + +/** + * 网站路径标签,单标签,主要用于提交列表等HTML的路径到相应的Servlet中 + * 网站全局标签 + * {ms: global.url /} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class GlobalUrlParser extends IParser { + + /** + * 网站路径标签,单标签,主要用于提交列表等HTML的路径到相应的action中 网站全局标签 {ms:global.url/} + */ + private final static String GLOBAL_URL="\\{ms:global.url/\\}"; + + /** + * 构造标签的属性 + * @param htmlContent原HTML代码 + * @param newContent替换的内容 + */ + public GlobalUrlParser(String htmlContent,String newContent){ + super.htmlCotent = htmlContent; + super.newCotent = newContent; + } + + @Override + public String parse() { + // TODO Auto-generated method stub + return super.replaceAll(GLOBAL_URL); + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/IncludeParser.java b/src/main/java/com/mingsoft/parser/impl/general/IncludeParser.java new file mode 100644 index 00000000..41866a7d --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/IncludeParser.java @@ -0,0 +1,104 @@ +package com.mingsoft.parser.impl.general; + +import java.io.File; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.mingsoft.parser.IParser; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.StringUtil; + + +/** + * 引入文件标签 ,主要用于引入公用的HTML等文件 .filename 是相对ms:global.skin下面的文件名称(单标签) 网站全局标签 {ms:include filename="url"/} + * + * @author 成卫雄 QQ:330216230 技术支持:景德镇铭飞科技 官网:www.ming-soft.com + */ +public class IncludeParser extends IParser { + /** + * 文件的路径 + */ + String path; + + + /** + * 引入文件标签 ,主要用于引入公用的HTML等文件 .filename 是相对ms:global.skin下面的文件名称 网站全局标签 {ms:include filename="url"/} + */ + private final static String INCLUDE="\\{ms:include filename\\=(.*?)\\s*/}"; + + /** + * include标签, + * @param htmlContent 原始html内容 + * @param path 引入文件 + * @param mobilePath 移动端模版目录名称,推荐mu + */ + public IncludeParser(String htmlContent, String path,String mobilePath) { + super.mobilePath = mobilePath; + super.htmlCotent = htmlContent; + this.path = path; + if (!StringUtil.isBlank(mobilePath)) { + this.path = path+File.separator+super.mobilePath; + } + + } + + public IncludeParser(String htmlContent, String path) { + super.htmlCotent = htmlContent; + this.path = path; + } + + @Override + public String parse() { + String html = super.htmlCotent; //原始内容 + int strNum = includeNum(super.htmlCotent);//检查个数 + while (strNum != 0) { //迭代 + // 取出模版内容 + String htmlInclude = includeContentPrase(super.htmlCotent, this.path); + super.newCotent = htmlInclude; + // 将取出的内容替换标签 + super.htmlCotent = super.replaceFirst(INCLUDE); + html = super.htmlCotent; + strNum = includeNum(super.htmlCotent); + } + + return html; + } + + /** + * 获取模中的要替换的引入文件的名字并读取出该文件 + * + * @param html + * html模版 + * @param path + * 文件的项目路径 + * @return 返回读取出来的文件HTML + */ + private static String includeContentPrase(String html, String path) { + String includeContent = ""; + Pattern patternL = Pattern.compile(INCLUDE); + Matcher matcherL = patternL.matcher(html); + if (matcherL.find()) { + String includeName = matcherL.group(1); + // 判断include文件是否存在 + File file = new File(path + File.separator + includeName); + if (!file.exists()) { + includeContent = includeName + "不存在,请仔细检查该模版的文件!"; + } else { + includeContent = FileUtil.readFile(path + File.separator + includeName); + } + } + return includeContent; + } + + /** + * 获取模版文件中引入标签的个数 + * + * @param html + * 文件模版 + * @return 返回该字符串的个数 + */ + private int includeNum(String html) { + int includeNum = count(html,INCLUDE); + return includeNum; + } +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/ListParser.java b/src/main/java/com/mingsoft/parser/impl/general/ListParser.java new file mode 100644 index 00000000..eaecf8f5 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/ListParser.java @@ -0,0 +1,548 @@ +package com.mingsoft.parser.impl.general; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.cms.biz.IContentModelBiz; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.entity.ColumnEntity; +import com.mingsoft.cms.entity.ContentModelEntity; +import com.mingsoft.cms.entity.FieldEntity; + +import com.mingsoft.parser.IParser; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.RegexUtil; +import com.mingsoft.util.StringUtil; + +/** + * 解析列表标签, {ms:arclist typeid= size= titlelen= flag = }:列表头标签,
+ * {/ms:arclist}:列表尾标签,
+ * 列表中的属性:
+ * typeid 类型 int栏目ID,在列表模板和档案模板中一般不需要指定,在首页模板中允许用","分开表示多个栏目,
+ * size 类型 int 返回文档列表总数,默认为20条全部返回,也可以配合分页使用,
+ * titlelen 类型 int 标题长度,等同于titlelength。默认40个汉字,
+ * flag 类型 String flag = c 自定义属性值:推荐[c]幻灯[f],
+ * [field.index/]:序号,根据显示条数显示的序号1 2 …..10,
+ * [field.id/]:编号,对应文章在数据库里的自动编号,
+ * [field.title/]:标题,标题长度根据titlelen的属性值指定,默认40个汉字,
+ * [field.fulltitle/]:全部标题,显示完整的标题,
+ * [field.author/]:作者,
+ * [field.source/]:来源,
+ * [field.date fmt=”yyyy-mm-dd”/]:时间(非必填),
+ * [field.content length=/]:内容,length=:内容的长度,指定获取文章长度(非必填),
+ * [field.typename/]:分类名称,文章所属分类的名称,
+ * [field.typeid/]:分类编号,文章所属分类的编号,
+ * [field.typelink/]:分类连接,点击连接连接到当前分类的列表,
+ * [field.link/]:内容链接,点击显示文章具体的内容地址,
+ * + * @author 成卫雄 QQ:330216230 技术支持:景德镇铭飞科技 官网:www.ming-soft.com + */ +public abstract class ListParser extends IParser { + + /** + * 列表中的属性,noflag 类型 int noflag = 1 自定义属性值:不推荐[1]不幻灯[2] 文章列表属性标签 非必填 + */ + public static final String LIST_NOFLAG = "noflag"; + /** + * 列表中的属性, typeid 类型 int栏目ID,在列表模板和档案模板中一般不需要指定,在首页模板中允许用","分开表示多个栏目 + * 文章列表属性标签 必填 + */ + public static final String LIST_TYPEID = "typeid"; + + /** + * 列表中的属性,size 类型 int 返回文档列表总数,默认为20条全部返回,也可以配合分页使用 文章列表属性标签 非必填 + */ + public static final String LIST_SIZE = "size"; + + /** + * 列表中的属性,titlelen 类型 int 标题长度,等同于titlelength。默认40个汉字 文章列表属性标签 非必填 + */ + public static final String LIST_TITLELENGTH = "titlelen"; + + /** + * 列表中的属性,flag 类型 int flag = 1 自定义属性值:推荐[1]幻灯[2] 文章列表属性标签 非必填 + */ + public static final String LIST_FLAG = "flag"; + + /** + * 分页标签,true表示有分页 + */ + public static final String LIST_ISPAGING = "ispaging"; + + /** + * 文章列表中的属性, orderby 要进行排序的字段 + */ + public static final String LIST_ORDERBY = "orderby"; + + /** + * 文章列表中的属性, 默认(desc)升序,asc降序 + */ + public static final String LIST_ORDER = "order"; + + /** + * 列表属性 + */ + protected Map listProperty; + + /** + * 新增字段业务层 + */ + + protected IFieldBiz fieldBiz; + + /** + * 内容模型业务层 + */ + + protected IContentModelBiz contentBiz; + + /** + * option 选择框 + */ + protected final static int OPTION=9; + + /** + * radio 选择按钮 + */ + protected final static int RADIO=10; + + /** + * 图片路径分割符 + */ + protected final static String OPREATE="\\|"; + + /** + * 基础类中的基础id属性名 + */ + protected final static String BasicID="basicId"; + + /** + * checkbox 多选框 + */ + protected final static int CHECKBOX = 11; + + /** + * 带分页列表头标签, 文章列表标签 {ms:arclist typeid= size= titlelen= flag = ispaging=} + */ + protected final static String LIST_PAGING="\\{ms:arclist.*.(ispaging=true){1}.*\\}"; + + /** + *不带分页列表头标签, 文章列表标签 {ms:arclist typeid= size= titlelen= flag = } + */ + protected final static String LIST_NOPAGING="\\{ms:arclist(?![^\\{\\}]*? ispaging=true[^\\{\\}]*?}).*?\\}"; + + /** + * 列表临时标签,内容规则 + */ + protected final static String TAB_BODY="\\{MS:TAB\\}([\\s\\S]*?)\\{/MS:TAB}"; + + /** + * 列表临时标签,开始标签 + */ + protected final static String TAB_BEGIN_LIST="{MS:TAB}"; + + /** + * 临时列表结束标签 + */ + protected final static String LIST_TEMP_TAB_END="\\{MS:TAB}([\\s\\S]*?)(\\{\\/ms:arclist})"; + + /** + * 列表尾标签 文章列表标签 {/ms:arclist} + */ + protected final static String LIST_END="\\{/ms:arclist\\}"; + + /** + * 列表临时标签,结束标签 + */ + protected final static String TAB_END_LIST="\\{/MS:TAB\\}"; + + /** + * 文章列表子标签:序号,根据显示条数显示的序号1 2 …..10 文章列表子标签 [field.index/] + */ + protected final static String INDEX_FIELD_LIST="\\[field.index/\\]"; + + /** + * 文章列表子标签:编号,对应文章在数据库里的自动编号 文章列表子标签 [field.id/] + */ + protected final static String ID_FIELD_LIST="\\[field.id/\\]"; + + /** + * 标题,标题长度根据titlelen的属性值指定,默认40个汉字 文章列表子标签 [field.title/] + */ + protected final static String TITLE_FIELD_LIST="\\[field.title/\\]"; + + /** + * 全部标题,显示完整的标题 文章列表子标签 [field.fulltitle/] + */ + protected final static String FULLTITLE_FIELD_LIST="\\[field.fulltitle/\\]"; + + /** + * 作者 文章列表子标签 [field.author/] + */ + protected final static String AUTHOR_FIELD_LIST="\\[field.author/\\]"; + + /** + * 来源 文章列表子标签 [field.source/] + */ + protected final static String SOURCE_FIELD_LIST="\\[field.source/\\]"; + + /** + * 时间 文章列表子标签 fmt:时间的显示格式(非必填项) [field.date fmt="yyyy-mm-dd"/] + */ + protected final static String DATE_FIELD_LIST="\\[field.date\\s{0,}(fmt=(.*?))?/]"; + + /** + * 内容 文章列表子标签 length:内容的长度,指定获取文章长度)(非必填) [field.content length=/] + */ + protected final static String CONTENT_FIELD_LIST="\\[field.content\\s{0,}(length=(\\d*).{0,})?/]"; + + /** + * 分类名称,文章所属分类的名称 文章列表子标签 [field.typename/] + */ + protected final static String TYPENAME_FIELD_LIST="\\[field.typename/\\]"; + + /** + * 内容链接 ,点击显示文章具体的内容地址 文章列表子标签 [field.link/] + */ + protected final static String LINK_FIELD_LIST="\\[field.link/\\]"; + + /** + * 分类编号,文章所属分类的编号 文章列表子标签 [field.typeid/] + */ + protected final static String TYPEID_FIELD_LIST="\\[field.typeid/\\]"; + + /** + * 文章缩略图 文章列表子标签 [field.litpic/] + */ + protected final static String LITPIC_FIELD_LIST="\\[field.litpic/\\]"; + + /** + * 文章描述标签文章列表子标签[field.descrip/] + */ + protected final static String DESCIRIP_FIELD_LIST="\\[field.descrip/\\]"; + + /** + * 当前页面文章的数量 文章列表子标签 [field.num/] + */ + protected final static String NUM_ARTICLE_LIST="\\[field.num/\\]"; + + /** + * 分类连接, 点击连接连接到当前分类的列表 文章列表子标签 [field.typelink/] + */ + protected final static String TTYPELINK_FIELD_LIST="\\[field.typelink/\\]"; + + + /** + * 当前文章中的自定义标签[cfield.] + */ + protected final static String TAGLIB_ARTICLE_LIST="\\[cfield.(.*?)\\s*/\\]"; + + /** + * 定位有分页列表标签属性 + */ + protected final static String LIST_PAGING_PROPERTY="\\{ms:arclist(.*.(ispaging=true){1}.*)\\}"; + + /** + * 定位没有分页列表标签中所有的属性 + */ + protected final static String LIST_PROPERTY="\\{ms:arclist((?![^\\{\\}]*?ispaging=true[^{}]*?}).*?)\\}"; + + /** + * 定位标签中属性的名称 + */ + protected final static String PRORETY_NAME="(\\w*)\\s*="; + + /** + * 定位标签中属性的值 + */ + protected final static String PROPERTY_VALUE="=\\s*((\\w.*?)[(?\\s)|}]|(\\w*)|)";// =\\s*(\\w.*?)[(?\\s)|}] + + + @Override + public String parse() { + String listHtml = super.replaceAll(TAB_BODY); + return listHtml; + } + + protected abstract String list(String tabHtmlContent, String htmlContent, List articleList, String path) ; + /** + * 临时将arclist替换成ms:tab + * + * @param htmlCotent + * 原始内容 + * @param regex + *  规则,主要是两种,一种有分页,一种没有分页 + * @return 替换好的内容 + */ + protected String replaceStartAndEnd(String htmlCotent,String regex) { + super.htmlCotent = htmlCotent; + super.newCotent = TAB_BEGIN_LIST; + htmlCotent = super.replaceFirst(regex); + if (htmlCotent.equals("")) { + htmlCotent = IParserRegexConstant.REGEX_ERRO; + } + Pattern pattern = Pattern.compile(LIST_TEMP_TAB_END); + Matcher matcher = pattern.matcher(htmlCotent); + if (matcher.find()) { + String tmp = matcher.group(); + String tmp2 = tmp; + tmp = tmp.replaceAll(LIST_END,TAB_END_LIST); + htmlCotent = htmlCotent.replace(tmp2, tmp); + } + if (htmlCotent.equals("")) { + htmlCotent = IParserRegexConstant.REGEX_ERRO; + } + return htmlCotent; + } + + + /** + * 替换自定义字段 + * @param column 栏目id + * @param basicId 实体id + * @return + */ + protected String replaceField(String htmlList,ColumnEntity column,int basicId){ + + //判断该文章是否有扩展字段 + if(column.getColumnContentModelId()!=0){ + // 根据表单类型id查找出所有的字段信息 + List listField = fieldBiz.queryListByCmid(column.getColumnContentModelId()); + //遍历所有的字段实体,得到字段名列表信息 + List listFieldName = new ArrayList(); + for(int j = 0;j where = new HashMap(); + where.put(BasicID,basicId); + // 获取各字段的值 + List fieldLists = fieldBiz.queryBySQL(contentModel.getCmTableName(), listFieldName, where); + + if(fieldLists!=null && fieldLists.size()>0){ + Map fields = (Map)fieldLists.get(0); + //计算标签的个数 + int taglibNum = count(htmlList,TAGLIB_ARTICLE_LIST); + while(taglibNum!=0){ + //String newCotent=taglibContentParser(htmlList,fields,contentModel.getCmId()); + String newCotent= taglibContentParser(listField,htmlList,fields,contentModel.getCmId()); + // 将取出的内容替换标签 + htmlList = replaceFirst(newCotent,TAGLIB_ARTICLE_LIST,htmlList); + taglibNum = count(htmlList,TAGLIB_ARTICLE_LIST); + } + } + }else{ + Pattern patternL = Pattern.compile(TAGLIB_ARTICLE_LIST); + Matcher matcherL = patternL.matcher(htmlList); + if (matcherL.find()){ + //查找出用户填写的自定义标签字段名 + htmlList = tabContent(htmlList, "",TAGLIB_ARTICLE_LIST); + } + } + return htmlList; + } + + /** + * 用该内容替换第一个当前找到的第一个标签 + * + * @param htmlCotent + * 源内容 + * @param newCotent + * 替换内容 + * @param regex + * 替换规则, + * @return 替换完成的HTML模版 + */ + public String replaceFirst(String newContent ,String regex,String htmlList) { + if (StringUtil.isBlank(newContent)) { + newContent = IParserRegexConstant.REGEX_ERRO; + } + return RegexUtil.replaceFirst(htmlList, regex, newContent); + } + + /** + * 替换的数组内容 + * + * @param htmlCotent + * 用标记标签替换好的HTML模版代码 + * @param newContent + * 需要插入数组的内容 + * @return 如果存在该标签返回替换后的标签和内容,如果不存在则返回空 + */ + protected String tabContent(String htmlCotent, Object newContent, String regex) { + if (StringUtil.isBlank(newContent)) { + newContent = IParserRegexConstant.REGEX_ERRO; + } + return RegexUtil.replaceAll(htmlCotent, regex, newContent.toString()); + } + + /** + * 获取字段名并获取相应的值 + * @param html 原html代码 + * @param field 各字段对应的值Map + * @param contentModelId 内容模型id + * @return + */ + protected String taglibContentParser(List listField,String html,Map field,int contentModelId){ + String taglibContent = ""; + Pattern patternL = Pattern.compile(TAGLIB_ARTICLE_LIST); + Matcher matcherL = patternL.matcher(html); + if (matcherL.find()) { + //查找出用户填写的自定义标签字段名 + String fieldName = matcherL.group(1); + Iterator iter = field.keySet().iterator(); + FieldEntity fieldEntity =null; + //判断该字段是否存在 + while (iter.hasNext()) { + String key = iter.next(); + if(fieldName.equals(key)){ + for(int j = 0;j contentNew.length())) { + StringBuffer strBuff = new StringBuffer(contentNew); + contentNew = strBuff.substring(0, lengthCon); + } + return contentNew; + } + + /** + * 获取模版文件中文章列表的个数 + * + * @param html + * 文件模版 + * @return 返回该字符串的个数 + */ + public static int countArcList(String html) { + int listNumBegin = count(html,LIST_NOPAGING); + return listNumBegin; + } + + + + /** + * 取出列表标签中的属性 + * + * @param html + * HTML模版 + * @param isPaging + * true;为分页属性,false:为普通列表属性 + * @return 属性集合Map(属性名称,属性值) + */ + public static Map listProperty(String html, boolean isPaging) { + Map listPropertyMap = new HashMap(); + String listProperty = ""; + if (isPaging) { + listProperty = parseFirst(html,LIST_PAGING_PROPERTY, 1); + } else { + listProperty = parseFirst(html,LIST_PROPERTY, 1); + } + if (listProperty == null) { + return listPropertyMap; + } + List listPropertyName = parseAll(listProperty,PRORETY_NAME, 1); + List listPropertyValue = parseAll(listProperty,PROPERTY_VALUE, 1); + for (int i = 0; i < listPropertyName.size(); i++) { + listPropertyMap.put(listPropertyName.get(i).trim(), listPropertyValue.get(i).trim()); + } + return listPropertyMap; + } + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/PageNumParser.java b/src/main/java/com/mingsoft/parser/impl/general/PageNumParser.java new file mode 100644 index 00000000..e5a942cf --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/PageNumParser.java @@ -0,0 +1,67 @@ +package com.mingsoft.parser.impl.general; + +import com.mingsoft.parser.IParser; +import com.mingsoft.util.PageUtil; + +/** + * 解析分页标签中的,页面总数,当前第几页,列表文章总数标签 分页标签 页面总数:{ms:page.total/} 当前第几页:{ms:page.cur/} 列表文章总数:{ms:page.articletotal/} + * + * @author 成卫雄 QQ:330216230 技术支持:景德镇铭飞科技 官网:www.ming-soft.com + */ +public class PageNumParser extends IParser { + + private PageUtil page; + + /** + * 页面总数 列表分页标签 {ms:page.total/} + */ + private final static String PAGE_TOTAL="\\{ms:page.total/\\}"; + + /** + * 当前处于第几页 列表分页标签 {ms:page.cur/} + */ + private final static String PAGE_CUR="\\{ms:page.cur/\\}"; + + /** + * 列表文章的总数 列表分页标签 {ms:page.rcount} + */ + private final static String PAGE_RCOUNT="\\{ms:page.rcount/\\}"; + /** + * 构造替换标签必须的参数 + * + * @param htmlContent + * 原HTML代码 + * @param pageSize + * 每页显示文章的数量 + * @param cur + * 当前文章处于第几页 + * @param articletotal + * 列表文章的总数 + */ + public PageNumParser(String htmlContent, PageUtil page) { + super.htmlCotent = htmlContent; + this.page = page; + } + + @Override + public String parse() { + if (this.page != null) { + // TODO Auto-generated method stub + // 替换页面总数标签 + super.htmlCotent = replaceRegex(PAGE_TOTAL, page.getPageCount()); + // 替换当前处于第几页标签 + super.htmlCotent = replaceRegex(PAGE_CUR, page.getPageNo()+1); + // 替换当前列表下文章的总数 + super.htmlCotent = replaceRegex(PAGE_RCOUNT, page.getRecordCound()); + return super.htmlCotent; + } else { + return super.htmlCotent; + } + } + + public String replaceRegex(String regex, int num) { + super.newCotent = Integer.toString(num); + String html = super.replaceAll(regex); + return html; + } +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/PageParser.java b/src/main/java/com/mingsoft/parser/impl/general/PageParser.java new file mode 100644 index 00000000..e571b4e3 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/PageParser.java @@ -0,0 +1,93 @@ +package com.mingsoft.parser.impl.general; + +import java.io.File; + +import com.mingsoft.parser.IParser; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * 实现分页功能并进行标签的替换 + * 分页标签 + * 首页:{ms:page.index} + * 上一页:{ms:page.pre/} + * 下一页:{ms:page.next/} + * 尾页:{ms:page.over/} + * @author 成卫雄 + * QQ:330216230 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class PageParser extends IParser{ + + + + /** + * 首页 列表分页标签 {ms:page.index} + */ + private final String PAGE_INDEX="\\{ms:page.index/\\}"; + + /** + * 上一页 列表分页标签 {ms:page.pre/} + */ + private final String PAGE_PRE="\\{ms:page.pre/\\}"; + + /** + * 下一页 列表分页标签 {ms:page.next/} + */ + private final String PAGE_NEXT="\\{ms:page.next/\\}"; + + /** + * 尾页 列表分页标签 {ms:page.last/} + */ + private final String PAGE_OVER="\\{ms:page.last/\\}"; + + private PageUtil page; + /** + * 构造替换标签的必须属性 + * @param urlPage + * 当前页面的链接 链接地址 http://www.***.com/servlet + * @param countPage + * 需要显示数据的总数量 + * @param sizePage + * 每页显示的信息数量 + * @param currentPage + * 当前页面在数据库中的光标位置 + * @param htmlContent + * 原HTML代码 + */ + public PageParser(String htmlContent,PageUtil page){ + super.htmlCotent = htmlContent; + this.page = page; + } + + @Override + public String parse() { + if (this.page!=null) { + // TODO Auto-generated method stub + //替换首页标签:{ms:page.index} + super.newCotent = StringUtil.removeRepeatStr(this.page.getIndexUrl(), File.separator).replace(":/", "://");//this.page.getIndexUrl().replace("\\", "/"); + String indexHtml = super.replaceAll(PAGE_INDEX); + //替换上一页标签:{ms:page.pre/} + super.htmlCotent = indexHtml; + super.newCotent = StringUtil.removeRepeatStr(this.page.getPreviousUrl(), File.separator).replace(":/", "://");// this.page.getPreviousUrl().replace("\\", "/"); + String preHtml = super.replaceAll(PAGE_PRE); + //替换下一页标签:{ms:page.next/} + super.htmlCotent = preHtml; + super.newCotent = StringUtil.removeRepeatStr(this.page.getNextUrl(), File.separator).replace(":/", "://");//this.page.getNextUrl().replace("\\", "/"); + String nextHtml = super.replaceAll(PAGE_NEXT); + //替换尾页标签:{ms:page.over/} + super.htmlCotent = nextHtml; + super.newCotent = StringUtil.removeRepeatStr(this.page.getLastUrl(), File.separator).replace(":/", "://");// this.page.getLastUrl().replace("\\", "/"); + String traileHtml = super.replaceAll(PAGE_OVER); + return traileHtml; + } else { + return htmlCotent; + } + + + } + + + +} diff --git a/src/main/java/com/mingsoft/parser/impl/general/TaglibParser.java b/src/main/java/com/mingsoft/parser/impl/general/TaglibParser.java new file mode 100644 index 00000000..197afbe6 --- /dev/null +++ b/src/main/java/com/mingsoft/parser/impl/general/TaglibParser.java @@ -0,0 +1,173 @@ +package com.mingsoft.parser.impl.general; + + +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.mingsoft.base.entity.BaseEntity; +import com.mingsoft.cms.biz.IFieldBiz; +import com.mingsoft.cms.entity.FieldEntity; +import com.mingsoft.parser.IParser; +import com.mingsoft.util.StringUtil; + + +/** + * 文章自定义标签(新增字段) + * 文章内容标签 + * {ms:cfield./} + * @author 史爱华 + * 技术支持:景德镇铭飞科技 + * 官网:www.ming-soft.com + */ +public class TaglibParser extends IParser{ + /** + * 各新增字段的值 + */ + private Map fields; + + /** + * 新增表单的id + */ + private int contentModelId; + + + private List listFieldEntity; + + /** + * 字段业务层 + */ + private IFieldBiz fieldBiz; + + /** + * option 选择框 + */ + private final static int OPTION=9; + + /** + * radio 选择按钮 + */ + private final static int RADIO=10; + + /** + * checkbox 多选框 + */ + private final static int CHECKBOX = 11; + + /** + *字定义标签{ms.cfield./} + */ + private final static String ARTICLE_TAGLIB_FIELD="\\{ms:cfield.(.*)?\\s*/}"; + + /** + * + * @param htmlContent + * @param newContent + * + * @param fields + * 新增字段的信息 + */ + public TaglibParser(String htmlContent,Map fields,int contentModelId,IFieldBiz fieldBiz,List listFieldEntity){ + super.htmlCotent = htmlContent; + this.fields = fields; + this.contentModelId = contentModelId; + this.fieldBiz = fieldBiz; + this.listFieldEntity = listFieldEntity; + } + + /** + * 检查自定义标签的个数 + */ + public int taglibNum(String html){ + int taglibNum = count(html,ARTICLE_TAGLIB_FIELD); + return taglibNum; + } + + /** + * 获取字段名并获取相应的值 + * @param html 原html代码 + * @param field 各字段对应的值Map + * @param contentModelId 内容模型id + * @return + */ + protected String taglibContentParser(List listField,String html,Map field){ + String taglibContent = ""; + Pattern patternL = Pattern.compile(ARTICLE_TAGLIB_FIELD); + Matcher matcherL = patternL.matcher(html); + if (matcherL.find()) { + //查找出用户填写的自定义标签字段名 + String fieldName = matcherL.group(1); + Iterator iter = field.keySet().iterator(); + FieldEntity fieldEntity =null; + //判断该字段是否存在 + while (iter.hasNext()) { + String key = iter.next(); + if(fieldName.equals(key)){ + for(int j = 0;j=filedNew.length){ + fieldValue = filedNew[filedNew.length-1]; + }else{ + fieldValue+=filedNew[Integer.valueOf(checkBox[i].toString())-1]; + } + } + }else{ + if(Integer.valueOf(field.get(key).toString())>=filedNew.length){ + fieldValue = filedNew[filedNew.length-1]; + }else{ + fieldValue = filedNew[Integer.valueOf(field.get(key).toString())-1]; + } + + } + } + } + taglibContent=fieldValue; + break; + } + } + } + return taglibContent; + } + + + @Override + public String parse() { + //原始内容 + String html = super.htmlCotent; + //检查自定义标签{ms:cfield.*/}的个数 + int taglibNum = taglibNum(super.htmlCotent); + while(taglibNum!=0){ + super.newCotent=taglibContentParser(listFieldEntity,super.htmlCotent,fields); + // 将取出的内容替换标签 + super.htmlCotent = super.replaceFirst(ARTICLE_TAGLIB_FIELD); + html = super.htmlCotent; + taglibNum = taglibNum(super.htmlCotent); + } + // TODO Auto-generated method stub + return html; + } +} diff --git a/src/main/java/com/mingsoft/people/action/BaseAction.java b/src/main/java/com/mingsoft/people/action/BaseAction.java new file mode 100644 index 00000000..7f4d51a7 --- /dev/null +++ b/src/main/java/com/mingsoft/people/action/BaseAction.java @@ -0,0 +1,49 @@ +package com.mingsoft.people.action; + +import javax.servlet.http.HttpServletRequest; + +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.people.entity.PeopleEntity; + +/*** + * + * 用户模块基础控制层 + * @author 史爱华 + * @version + * 版本号:100-000-000
+ * 创建日期:2015-1-31
+ * 历史修订:
+ */ +public class BaseAction extends com.mingsoft.basic.action.BaseAction{ + /** + * 读取国际化资源文件 + * + * @param key 键值 + * @return字符串 + */ + protected String getResString(String key) { + return super.getResString(key, com.mingsoft.people.constant.Const.RESOURCES); + } + + /** + * 读取国际化资源文件 + * + * @param key 键值 + * @param fullStrs 需填充的值 + * @return 字符串 + */ + protected String getResString(String key, String... fullStrs) { + return super.getResString(key, com.mingsoft.people.constant.Const.RESOURCES,fullStrs); + } + + /** + * 获取用户session.没有返回null + */ + protected PeopleEntity getPeopleBySession(HttpServletRequest request) { + Object obj = this.getSession(request, SessionConst.PEOPLE_SESSION); + if (obj!=null) { + return (PeopleEntity)obj; + } + return null; + } +} diff --git a/src/main/java/com/mingsoft/people/action/PeopleAction.java b/src/main/java/com/mingsoft/people/action/PeopleAction.java new file mode 100644 index 00000000..b67c30b0 --- /dev/null +++ b/src/main/java/com/mingsoft/people/action/PeopleAction.java @@ -0,0 +1,75 @@ +/** + * + */ +package com.mingsoft.people.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.people.biz.IPeopleBiz; +import com.mingsoft.people.constant.e.PeopleEnum; +import com.mingsoft.people.entity.PeopleEntity; + +/** + * + *

+ * 铭飞科技-会员系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 成卫雄 + * QQ:330216230 + * + *

+ * Comments:会员基础信息控制层 + *

+ * + *

+ * Create Date:2014-10-31 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller +@RequestMapping("/manager/people") +public class PeopleAction extends BaseAction{ + + /** + * 注入用户控制层 + */ + @Autowired + private IPeopleBiz peopleBiz; + + /** + * 更新用户状态 + * @param people 用户信息 + * @param request + * @param response + */ + @RequestMapping("/updateState") + public void updateState(@ModelAttribute PeopleEntity people,HttpServletRequest request,HttpServletResponse response){ + if(people == null){ + this.outJson(response, ModelCode.PEOPLE,false); + return ; + } + + if(people.getPeopleState() == PeopleEnum.STATE_CHECK.toInt()){ + people.setPeopleState(PeopleEnum.STATE_NOT_CHECK); + }else{ + people.setPeopleState(PeopleEnum.STATE_CHECK); + } + this.peopleBiz.updateEntity(people); + this.outJson(response, ModelCode.PEOPLE,true,Integer.toString(people.getPeopleState())); + } +} diff --git a/src/main/java/com/mingsoft/people/action/PeopleUserAction.java b/src/main/java/com/mingsoft/people/action/PeopleUserAction.java new file mode 100644 index 00000000..e9241ab0 --- /dev/null +++ b/src/main/java/com/mingsoft/people/action/PeopleUserAction.java @@ -0,0 +1,395 @@ +/** + * + */ +package com.mingsoft.people.action; + +import java.util.Date; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.people.biz.IPeopleBiz; +import com.mingsoft.people.biz.IPeopleUserBiz; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.people.entity.PeopleUserEntity; +import com.mingsoft.util.PageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + *

+ * 铭飞科技-会员系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 成卫雄 + * QQ:330216230 + * + *

+ * Comments: 普通用户信息 + *

+ * + *

+ * Create Date:2014-10-31 + *

+ * + *

+ * Modification history: + *

+ */ + +@Controller +@RequestMapping("/manager/people/user") +public class PeopleUserAction extends BaseAction{ + + /** + * 注入普通用户控制层 + */ + @Autowired + private IPeopleUserBiz peopleUserBiz; + + /** + * 注入用户基础信息控制层 + */ + @Autowired + private IPeopleBiz peopleBiz; + + /** + * 用户列表 + * @param mode + * @param request + * @param response + * @return + */ + @RequestMapping("/list") + public String list(ModelMap mode,HttpServletRequest request,HttpServletResponse response){ + //获取应用ID + int appId = this.getAppId(request); + //查询用户总数 + int peopleCount = this.peopleBiz.queryCountByAppId(appId); + int pageNo = this.getInt(request, "pageNo", 1); + //页面链接地址 + String pageUrl = getUrl(request)+"/manager/people/user/list.do"; + //分页通用类 + PageUtil page=new PageUtil(pageNo,peopleCount,pageUrl); + //获取用户列表 + List listPeople = this.peopleBiz.queryPageListByAppId(appId,page); + mode.addAttribute("listPeople", listPeople); + mode.addAttribute("page", page); + this.setCookie(request, response,CookieConst.BACK_COOKIE, pageUrl+"?pageNo="+pageNo); + return "/manager/people/user/people_user_list"; + } + + /** + * 新增用户信息 + * @return 新增用户页面 + */ + @RequestMapping("/add") + public String add(ModelMap mode,HttpServletRequest request){ + int appId = this.getAppId(request); + mode.addAttribute("appId", appId); + return "/manager/people/user/people_user"; + } + + + + /** + * 获取用户详细信息 + * @param peopleId 用户ID + * @param request + * @param response + */ + @RequestMapping("/getEntity") + public void getEntity(String peopleId,HttpServletRequest request,HttpServletResponse response){ + if(StringUtil.isBlank(peopleId) || !StringUtil.isInteger(peopleId)){ + this.outJson(response, ModelCode.PEOPLE_USER,false); + return ; + } + PeopleUserEntity peopleUser = (PeopleUserEntity) this.peopleUserBiz.getEntity(Integer.parseInt(peopleId)); + if(peopleUser == null){ + this.outJson(response, ModelCode.PEOPLE_USER,false); + return ; + } + this.outJson(response, ModelCode.PEOPLE_USER,true,null,JSONObject.toJSONString(peopleUser)); + } + + + /** + * 用户更新详细信息 + * @param peopleUser 用户信息 + * @param request + * @param response + */ + @RequestMapping("/update") + @ResponseBody + public void update(@ModelAttribute PeopleUserEntity peopleUser,HttpServletRequest request,HttpServletResponse response){ + //判断用户信息是否存在 + if(peopleUser == null){ + //未填写信息返回错误信息 + this.outJson(response, ModelCode.PEOPLE_USER,false,this.getResString("people.user.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + //获取用户实体 + PeopleEntity people =(PeopleEntity) peopleBiz.getEntity(peopleUser.getPeopleId()); + peopleUser.setPeopleId(peopleUser.getPeopleId()); + //验证用户信息,如果验证不通过则不进行更新或保存操作 + if(!this.checkUpdatePeople(peopleUser, request, response)){ + return; + } + //判断peopleUser是否存在是否存在 + PeopleUserEntity oldPeopleUser = (PeopleUserEntity) peopleUserBiz.getEntity(people.getPeopleId()); + // 获取cookie + String cookieUrl =this.getCookie(request, CookieConst.BACK_COOKIE); + //如果不存在则进行保存操作 + if(oldPeopleUser!=null && oldPeopleUser.getPeopleUserPeopleId()==0){ + this.peopleUserBiz.saveEntity(peopleUser); + this.outJson(response, ModelCode.PEOPLE_USER,true,cookieUrl); + return; + } + //判断用户密码是否为空,如果不为空则进行密码的更新 + if(!StringUtil.isBlank(StringUtil.Md5(peopleUser.getPeoplePassword()))){ + //设置用户密码 + peopleUser.setPeoplePassword(StringUtil.Md5(peopleUser.getPeoplePassword())); + } + //存在则进行更新操作 + this.peopleUserBiz.updatePeopleUser(peopleUser);; + //返回更新成功 + this.outJson(response, ModelCode.PEOPLE_USER,true,cookieUrl); + } + + + + + + + /** + * 批量删除用户信息 + * @param request + * @param response + */ + @RequestMapping("/delete") + @ResponseBody + public void delete(HttpServletRequest request, HttpServletResponse response){ + //获取要删除的用户id集合 + String [] ids = request.getParameterValues("ids"); + // 获取cookie + String cookieUrl =this.getCookie(request, CookieConst.BACK_COOKIE); + //如果用户id不为空且传入的用户集合是数字集合 + if(!StringUtil.isBlank(ids) && StringUtil.isIntegers(ids)){ + int[] _ids = StringUtil.stringsToInts(ids); + //批量删除用户信息 + this.peopleUserBiz.deletePeopleUsers(_ids); + } + this.outJson(response, ModelCode.PEOPLE_USER, true,cookieUrl); + } + + /** + * 新增用户信息 + * @return 新增用户页面 + */ + @RequestMapping("/{peopleId}/edit") + public String edit(@PathVariable int peopleId,ModelMap mode,HttpServletRequest request,HttpServletResponse response){ + PeopleUserEntity peopleUser = (PeopleUserEntity) this.peopleUserBiz.getEntity(peopleId); + int appId = this.getAppId(request); + mode.addAttribute("appId", appId); + mode.addAttribute("peopleUser", peopleUser); + return "/manager/people/user/people_user"; + } + + /** + * 保存用户信息 + * @param peopleUser 用户信息 + * @param request + * @param response + */ + @RequestMapping("/save") + @ResponseBody + public void save(@ModelAttribute PeopleUserEntity peopleUser,HttpServletRequest request,HttpServletResponse response){ + //判断用户信息是否存在 + if(peopleUser == null){ + //未填写信息返回错误信息 + this.outJson(response, ModelCode.PEOPLE_USER,false,this.getResString("people.user.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + //验证用户输入的信息是否合法 + if(!this.checkPeople(peopleUser, request, response)){ + return; + } + //判断用户密码是否为空,如果不为空则进行密码的保存 + if(!StringUtil.isBlank(StringUtil.Md5(peopleUser.getPeoplePassword()))){ + //设置用户密码 + peopleUser.setPeoplePassword(StringUtil.Md5(peopleUser.getPeoplePassword())); + } + + peopleUser.setPeopleAppId(this.getAppId(request)); + peopleUser.setPeopleDateTime(new Date()); + //保存用户信息 + this.peopleUserBiz.savePeople(peopleUser); + // 获取cookie + String cookieUrl =this.getCookie(request, CookieConst.BACK_COOKIE); + //返回更新成功 + this.outJson(response, ModelCode.PEOPLE_USER,true,cookieUrl); + } + + /** + * 验证更新用户信息是判断用户输入的信息是否合法 + * @param peopleUser 用户实体 + * @param request http请求对象 + * @param response http响应对象 + */ + public boolean checkUpdatePeople(PeopleUserEntity peopleUser,HttpServletRequest request,HttpServletResponse response){ + + //获取更改前的用户 + PeopleUserEntity oldPeopleUser = (PeopleUserEntity) peopleUserBiz.getEntity(peopleUser.getPeopleId()); + //获取应用id + int appId = this.getAppId(request); + //如果填写了邮箱,则验证邮箱格式是否正确 + if (!StringUtil.isBlank(peopleUser.getPeopleMail()) && !StringUtil.isEmail(peopleUser.getPeopleMail())) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.msg.mail.format.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + //验证用户名不能为空 + if(StringUtil.isBlank(peopleUser.getPeopleName())){ + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.msg.name.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + + //如果填写了手机号码,则验证手机号码填写是否正确 + if (!StringUtil.isBlank(peopleUser.getPeoplePhone()) && !StringUtil.isMobile(peopleUser.getPeoplePhone())) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.msg.phone.format.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + + + //当用户名进行修改时验证用户名是否是唯一的 + if (!StringUtil.isBlank(peopleUser.getPeopleName())) { + // 验证手机号是否唯一 + PeopleEntity peoplePhone = this.peopleBiz.getEntityByUserName(peopleUser.getPeopleName(), appId); + //判断之前是否已经存在用户名,如果不存在,则判断是否存在重名,如果存在,判断用户是否更改用户名如果更改则判断新更改的用户名是否已经存在 + //判断填写的用户名和之前用户名是否相同,如果不相同 + if(StringUtil.isBlank(oldPeopleUser.getPeopleName())){ + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + }else{ + if(!oldPeopleUser.getPeopleName().equals(peopleUser.getPeopleName())){ + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + } + } + + } + if(!StringUtil.isBlank(peopleUser.getPeoplePhone())){ + PeopleEntity peoplePhone = this.peopleBiz.getEntityByUserName(peopleUser.getPeoplePhone(), appId); + //判断之前是否已经存在手机号,如果不存在,则判断是否存在重名,如果存在,判断用户是否更改手机号如果更改则判断新更改的手机号是否已经存在 + //判断填写的手机号和之前手机号是否相同,如果不相同 + if(StringUtil.isBlank(oldPeopleUser.getPeoplePhone())){ + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + }else{ + if(!oldPeopleUser.getPeoplePhone().equals(peopleUser.getPeoplePhone())){ + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + } + } + } + //验证邮箱的唯一性 + if(!StringUtil.isBlank(peopleUser.getPeopleMail())){ + PeopleEntity peoplePhone = this.peopleBiz.getEntityByUserName(peopleUser.getPeopleMail(), appId); + //判断之前是否已经存在手机号,如果不存在,则判断是否存在重名,如果存在,判断用户是否更改手机号如果更改则判断新更改的手机号是否已经存在 + //判断填写的手机号和之前手机号是否相同,如果不相同 + if(StringUtil.isBlank(oldPeopleUser.getPeopleMail())){ + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + }else{ + if(!oldPeopleUser.getPeopleMail().equals(peopleUser.getPeopleMail())){ + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + } + } + } + //验证用户身份证号码 + return true; + } + + /** + * 验证保存用户时输入的信息是否合法 + * @param peopleUser 用户实体 + * @param request http请求对象 + * @param response http响应对象 + */ + public boolean checkPeople(PeopleUserEntity peopleUser,HttpServletRequest request,HttpServletResponse response){ + //获取应用id + int appId = this.getAppId(request); + //如果填写了邮箱,则验证邮箱格式是否正确 + if (!StringUtil.isBlank(peopleUser.getPeopleMail()) && !StringUtil.isEmail(peopleUser.getPeopleMail())) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.msg.mail.format.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + //验证用户名不能为空 + if(StringUtil.isBlank(peopleUser.getPeopleName())){ + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.msg.name.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + //如果填写了手机号码,则验证手机号码填写是否正确 + if (!StringUtil.isBlank(peopleUser.getPeoplePhone()) && !StringUtil.isMobile(peopleUser.getPeoplePhone())) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.msg.phone.format.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + + + //验证用户名是否是唯一的 + if (!StringUtil.isBlank(peopleUser.getPeopleName())) { + // 验证手机号是否唯一 + PeopleEntity peoplePhone = this.peopleBiz.getEntityByUserName(peopleUser.getPeopleName(), appId); + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + } + if (!StringUtil.isBlank(peopleUser.getPeoplePhone())) { + // 验证手机号是否唯一 + PeopleEntity peoplePhone = this.peopleBiz.getEntityByUserName(peopleUser.getPeoplePhone(), appId); + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.phone.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + } + if (!StringUtil.isBlank(peopleUser.getPeopleMail())) { + // 验证邮箱是否唯一 + PeopleEntity peopleMail = this.peopleBiz.getEntityByUserName(peopleUser.getPeopleMail(), appId); + if (peopleMail != null) { + this.outJson(response, ModelCode.PEOPLE_USER, false, this.getResString("people.register.msg.mail.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return false; + } + } + + return true; + } +} diff --git a/src/main/java/com/mingsoft/people/action/people/PeopleAction.java b/src/main/java/com/mingsoft/people/action/people/PeopleAction.java new file mode 100644 index 00000000..619c1a69 --- /dev/null +++ b/src/main/java/com/mingsoft/people/action/people/PeopleAction.java @@ -0,0 +1,514 @@ +package com.mingsoft.people.action.people; + + +import java.util.Date; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.alibaba.fastjson.JSON; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.cms.parser.CmsParser; +import com.mingsoft.people.action.BaseAction; +import com.mingsoft.people.biz.IPeopleBiz; +import com.mingsoft.people.constant.e.PeopleEnum; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.util.DateUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * 后台会员控制层 + * @author 王天培(qq:78750478) + * @version + * 版本号:100-000-000
+ * 创建日期:2014-11-10
+ * 历史修订:
+ */ +@Controller("webPeopleMain") +@RequestMapping("/people") +public class PeopleAction extends BaseAction{ + /** + * 注入用户基础业务层 + */ + @Autowired + private IPeopleBiz peopleBiz; + + /** + * 便于页面随机与时间控制 + */ + private String date = "{date/}"; + + /** + * 用户编号 + */ + private static final String PEOPLEID = "{peopleId/}"; + private static final String HOST = "{host/}"; + + /** + *文章解析器 + */ + @Autowired + private CmsParser cmsParser; + /** + * 前段会员中心所有页面都可以使用该方法 + * 支持参数传递与解析,例如页面中有参数id=10 传递过来,调整页面可以使用{id/}获取该参数 + * 请求地址例如: /people/info.do;people/password.do + * @param key + */ + @RequestMapping("/{key}") + public void model(@PathVariable(value="key")String key,HttpServletRequest req,HttpServletResponse resp) { + String content= this.generaterPage("people/"+key, cmsParser,req); + //增加时间 + content = content.replace(date, StringUtil.getDateSimpleStr()); + try { + if(this.getPeopleBySession(req)!=null){ + content = content.replace(PEOPLEID,this.getPeopleBySession(req).getPeopleId()+""); + } + + } catch(NullPointerException e) { + LOG.error("user is not login", e); + } + content = content.replace(HOST, this.getApp(req).getAppHostUrl()); + this.outString(resp, content); + } + + + +// /** +// * 获取手机验证码 +// * @param request +// * @param response +// */ +// @RequestMapping("/getPhoneCode") +// public void getPhoneCode(HttpServletRequest request, HttpServletResponse response){ +// // 获取appID +// int appId = this.getAppId(request); +// //获取用户session +// PeopleEntity people =this.getPeopleBySession(request); +// //如果用户还没有登录 +// if(people==null){ +// this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); +// return; +// } +// //获取手机6位验证码 +// String peopelCode = StringUtil.randomNumber(6); +// people.setPeopleCode(peopelCode); +// people.setPeoplePhoneCheck(PeopleEnum.PHONE_NO_CHECK); +// peopleBiz.updateEntity(people); +// //给手机发送验证码 +// smsBiz.sendSms(appId,SmsModelEnum.PHONE_BIND, people.getPeoplePhone(), peopelCode); +// this.outJson(response, ModelCode.PEOPLE,true); +// } + + + /** + * 发送邮箱验证码 + * @param request + * @param response + * @param peopleMail 用户的邮箱号 + * @param modelCode 模块编码(加密) + */ + @RequestMapping("/sendMailCode") + public void sendMailCode(String peopleMail,String modelCode,HttpServletRequest request,HttpServletResponse response){ + //后台验证传来的用户邮箱地址是否合法 + if(!StringUtil.isEmail(peopleMail)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.msg.mail.error")); + return; + } + if(StringUtil.isBlank(modelCode)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.dataType")); + return; + } + //获取session中的用户实体 + PeopleEntity entity = this.getPeopleBySession(request) ; + if(entity==null){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.session.msg.null.error")); + return; + } + //获取站点id + int appId = this.getAppId(request); + + //根据邮箱获取用户实体 + PeopleEntity people = this.peopleBiz.getEntityByUserName(peopleMail, appId); + if(people==null){ + //获取验证码 + String peopleCode= StringUtil.randomNumber(6); + // 将生成的验证码加入用户实体 + entity.setPeopleCode(peopleCode); + + //将当前时间转换为时间戳格式保存进people表 + entity.setPeopleCodeSendDate(DateUtil.dateToTimestamp(new Date())); + //更新该实体 + this.peopleBiz.updateEntity(entity); + //解密 + String _modelCode = this.decryptByAES(request, modelCode); + //发送邮箱 + this.sendMailCode(peopleMail, _modelCode, request, response); + + this.outJson(response, ModelCode.PEOPLE,true); + }else{ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.register.msg.mail.repeat.error")); + } + } + + + + /** + * 验证用户填写的验证码是否和邮箱发送的验证码相同 + * @param peopleMail 用户的邮箱地址 + * @param mailCode 页面上用户所填写的邮箱验证码 + * @param request + * @param response + */ + @RequestMapping("/checkMailCode") + public void checkMailCode(String peopleMail, String mailCode,HttpServletRequest request,HttpServletResponse response){ + + //后台验证传来的用户邮箱地址是否合法 + if(!StringUtil.isEmail(peopleMail)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.msg.mail.error")); + return; + } + if(StringUtil.isBlank(mailCode)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.empty",this.getResString("peopleCode"))); + return; + } + //获取session中的用户实体 + PeopleEntity entity = this.getPeopleBySession(request) ; + if(entity==null){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.session.msg.null.error")); + return; + } + + //得到发送验证码时间,并转换为String类型 + String date = entity.getPeopleCodeSendDate().toString(); + //如果发送时间和当前时间只差大于30分钟,则返回false + if(DateUtil.secondBetween(date)>60*30){ + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.code.error")); + return; + } + + if(entity.getPeopleCode().equals(mailCode)){ + + entity.setPeopleMail(peopleMail); + //清空随机码 + entity.setPeopleCode(""); + entity.setPeopleMailCheck(PeopleEnum.MAIL_CHECK); + this.peopleBiz.updateEntity(entity); + this.outJson(response,ModelCode.PEOPLE,true); + }else{ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.error",this.getResString("peopleCode"))); + } + } + + + /** + * 绑定手机时判断用户手机是否存在且验证码输入正确 + * @param request + * @param response + */ + @RequestMapping("/getPeopleByCode") + public void getPeopleByCode(HttpServletRequest request, HttpServletResponse response) { + //获取用户session并判断 + PeopleEntity peopleEntity =this.getPeopleBySession(request); + //如果用户还没有登录 + if(peopleEntity==null){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + //获得用户填写的验证码 + String peopleCode = request.getParameter("peopleCode"); + if(StringUtil.isBlank(peopleCode)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.error",this.getResString("peopleCode"))); + return; + } + //获取用户填写的手机号 + String peoplePhone = request.getParameter("peoplePhone"); + if(!StringUtil.isMobile(peoplePhone)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.error",this.getResString("orderPhone"))); + return; + } + int appId = this.getAppId(request); + PeopleEntity people = this.peopleBiz.getEntityByUserName(peoplePhone, appId); + + //判断用户输入的随机码是否正确 + if(!people.getPeopleCode().equals(peopleCode)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.error",this.getResString("peopleCode"))); + return; + } + this.outJson(response, ModelCode.PEOPLE, true); + } + + + /** + * 更改密码 + * @param request + * @param response + */ + @RequestMapping("/changePassWord") + public void changePassword( HttpServletRequest request, HttpServletResponse response) { + String passWord = request.getParameter("passWord"); + String newPassWord = request.getParameter("newPassWord"); + if (StringUtil.isBlank(passWord) || StringUtil.isBlank(newPassWord)) { + // 用户或密码不能为空 + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 验证新密码的长度 + if (newPassWord.length() < 6 || newPassWord.length() > 30) { + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.password.error",com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + //获取用户session + PeopleEntity people =this.getPeopleBySession(request); + if (people == null) { + // 用户名或密码错误 + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + // 将用户输入的原始密码用MD5加密再和数据库中的进行比对 + String peoplePassWord = StringUtil.Md5(passWord); + if (people.getPeoplePassword().equals(peoplePassWord)) {// 验证通过执行修改 + // 将新密码用MD5加密 + newPassWord = StringUtil.Md5(newPassWord); + // 执行修改 + people.setPeoplePassword(newPassWord); + this.peopleBiz.updateEntity(people); + this.outJson(response, ModelCode.PEOPLE, true, this.getResString("people.change.password.msg.success",com.mingsoft.people.constant.Const.RESOURCES)); + } else { + // 提示当前密码输入错误 + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.current.password.error",com.mingsoft.people.constant.Const.RESOURCES)); + } + } + + /** + * 通过用户输入的验证码和手机号码判断是否绑定当前输入手机号 + * + * @param request + * @param response + */ + @RequestMapping("/validatePhoneByCode") + public void validatePhoneByCode(HttpServletRequest request, HttpServletResponse response) { + //获得用户填写的验证码 + String peopleCode = request.getParameter("peopleCode"); + if(StringUtil.isBlank(peopleCode)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.error",this.getResString("peopleCode"))); + return; + } + //获取用户填写的手机号 + String peoplePhone = request.getParameter("peoplePhone"); + if(!StringUtil.isMobile(peoplePhone)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.error",this.getResString("orderPhone"))); + return; + } + //获取用户session并判断 + PeopleEntity peopleEntity =this.getPeopleBySession(request); + //如果用户还没有登录 + if(peopleEntity==null){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + int appId = this.getAppId(request); + PeopleEntity people = this.peopleBiz.getEntityByUserName(peoplePhone, appId); + //判断手机号是否被绑定过,如果绑定过,弹出报错返回 + if (people != null) { + this.outJson(response, ModelCode.PEOPLE, false,this.getResString("err.exist",this.getResString("people"))); + return; + } + + //得到发送验证码时间,并转换为String类型 + String date = peopleEntity.getPeopleCodeSendDate().toString(); + //如果发送时间和当前时间只差大于30分钟,则返回false + if(DateUtil.secondBetween(date)>60*30){ + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.code.error")); + return; + } + + //判断用户输入的随机码是否正确 + if(!peopleEntity.getPeopleCode().equals(peopleCode)){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("err.error",this.getResString("peopleCode"))); + return; + } + //手机验证通过 + peopleEntity.setPeoplePhoneCheck(PeopleEnum.PHONE_CHECK); + peopleEntity.setPeoplePhone(peoplePhone); + //将随机码在数据库中清空 + peopleEntity.setPeopleCode(""); + peopleBiz.updateEntity(peopleEntity); + this.outJson(response, ModelCode.PEOPLE, true); + } + + + /** + * 添加手机号码 + * @param request + * @param response + */ + @RequestMapping("/changePhone") + public void changePhone(HttpServletRequest request,HttpServletResponse response){ + String newPhone = request.getParameter("newPhone"); + String peopleCode = request.getParameter("peopleCode"); + //验证原始帐号密码 + int appId = this.getAppId(request); + //获取用户session + PeopleEntity people =this.getPeopleBySession(request); + //如果用户还没有登录 + if(people==null){ + this.outJson(response, ModelCode.PEOPLE,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + //验证用户输入的验证码是否正确 + String imgCode = request.getParameter("imgCode"); + if(!imgCode.equalsIgnoreCase(this.getCodeBySession(request))){ + this.outJson(response, ModelCode.PEOPLE_REGISTER,false,this.getResString("err.error",getResString("peopleImageCode"))); + return; + } + //判断手机是否已经存在 + if(!StringUtil.isBlank(people.getPeoplePhone()) && !people.getPeoplePhone().equals(newPhone)){ + //根据手机号码查找实体 + PeopleEntity newPeople = this.peopleBiz.getEntityByUserName(newPhone,appId); + if(newPeople != null){ + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.phone.repeat.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + } + //判断用户输入的验证是否正确 + if(!people.getPeopleCode().equals(peopleCode)){ + //返回错误信息 + this.outJson(response, ModelCode.PEOPLE_REGISTER, false,this.getResString("err.error", this.getResString("peopleCode"))); + return ; + } + people.setPeoplePhone(newPhone); + peopleBiz.updateEntity(people); + this.outJson(response, ModelCode.PEOPLE,true); + } + + + /** + * 通过session中的用户名得到用户实体 + * @param request + * @param response + */ + @RequestMapping("/getPeopleEntity") + public void getPeopleEntity(HttpServletRequest request,HttpServletResponse response){ + //得到登录后session中的用户实体值 + PeopleEntity peopleEntity = (PeopleEntity) this.getSession(request, SessionConst.PEOPLE_SESSION); + if(peopleEntity == null){ + this.outJson(response, null,false,this.getResString("people.session.msg.null.error")); + return; + } + //用户帐号 + String peopleName = peopleEntity.getPeopleName(); + //应用id + int appId = this.getAppId(request); + + // 验证用户名 + if(StringUtil.isBlank(peopleName) || peopleName.length()<3 || peopleName.length() >12){ + this.outJson(response, null,false,this.getResString("people.msg.name.error",com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + //根据帐号查找实体 + PeopleEntity people = this.peopleBiz.getEntityByUserName(peopleName,appId); + //如果用户不存在 + if(people == null){ + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("err.not.exist",this.getResString("people"))); + }else{ + //返回用户信息 + this.outJson(response, null, true,JSON.toJSONString(people)); + } + } + + + /** + * 判断用户的验证码和填写用户名是否正确 + * @param request + * @param response + */ + @RequestMapping("/validatePeopleByName") + public void validatePeopleByName(HttpServletRequest request,HttpServletResponse response){ + //用户帐号 + String peopleName = request.getParameter("peopleName"); + String imgCode = request.getParameter("imgCode"); + + // 验证用户名 + if(StringUtil.isBlank(peopleName) || peopleName.length()<3 || peopleName.length() >12){ + this.outJson(response, null,false,this.getResString("people.msg.name.error",com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + //获取session中的用户实体 + PeopleEntity peopleEntity =this.getPeopleBySession(request); + + //根据帐号查找实体 + if(!peopleEntity.getPeopleName().equals(peopleName)){ + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.session.name.mismatch.error")); + return; + } + + //验证用户输入的验证码是否正确 + if(StringUtil.isBlank(imgCode) || !imgCode.equalsIgnoreCase(this.getCodeBySession(request))){ + this.outJson(response, null,false,this.getResString("err.error",getResString("peopleImageCode"))); + return; + } + //返回用户信息 + this.outJson(response, null, true); + } + + + /** + * 自动登录 + * @param request + * @param response + */ + @RequestMapping("/checkAutoLogin") + public void checkAutoLogin(HttpServletRequest request,HttpServletResponse response){ + // 获取用户名 + String userName = request.getParameter("userName"); + // 获取密码(MD5加密过的密码) + String peoplePassWord = request.getParameter("peoplePassWord"); + + if (StringUtil.isBlank(userName) || StringUtil.isBlank(peoplePassWord)) { + this.outJson(response, ModelCode.PEOPLE_LOGIN, false, this.getResString("people.msg.null.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + //获取页面上标记为PEOPLE_COOKIE的cookies值 + String peopleCookies = this.getCookie(request, CookieConst.PEOPLE_COOKIE) ; + //默认不存在 + int exsit = -1; + if(peopleCookies!=null){ + //cookies中存在autoLoginInCookies字段的话exsit!= -1 + exsit = peopleCookies.indexOf("autoLoginInCookies"); + } + //查找到cookies里用户名对应的用户实体 + PeopleEntity peopleEntity = this.peopleBiz.getEntityByUserName(userName, this.getAppId(request)); + //判断自动登录字段是否存在,密码是否正确 + if(exsit != -1 && peoplePassWord.equals(peopleEntity.getPeoplePassword())){ + // 登录成功,压入用户session + this.setSession(request, SessionConst.PEOPLE_SESSION, peopleEntity); + this.outJson(response, ModelCode.PEOPLE_LOGIN, true); + }else{ + this.outJson(response, ModelCode.PEOPLE_LOGIN, false); + } + + } +} + + + + + + + + + + diff --git a/src/main/java/com/mingsoft/people/action/people/PeopleUserAction.java b/src/main/java/com/mingsoft/people/action/people/PeopleUserAction.java new file mode 100644 index 00000000..b2388c81 --- /dev/null +++ b/src/main/java/com/mingsoft/people/action/people/PeopleUserAction.java @@ -0,0 +1,284 @@ +/** + * + */ +package com.mingsoft.people.action.people; + + +import java.io.File; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.people.biz.IPeopleBiz; +import com.mingsoft.people.biz.IPeopleUserBiz; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.people.entity.PeopleUserEntity; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.people.action.BaseAction; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.ImageUtil; +import com.mingsoft.util.StringUtil; + +/** + * + *

+ * 铭飞科技-会员系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 成卫雄 + * QQ:330216230 + * + *

+ * Comments:普通用户详细信息控制层(外部请求接口) + *

+ * + *

+ * Create Date:2014-11-1 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller("webPeopleUser") +@RequestMapping("/people/user") +public class PeopleUserAction extends BaseAction{ + + /** + * 注入用户详细信息业务层 + */ + @Autowired + private IPeopleUserBiz peopleUserBiz; + + /** + * 注入用户业务层 + */ + @Autowired + private IPeopleBiz peopleBiz; + + /** + * 新增用户详细信息 + * @param peopleUser 用户信息实体 + * @param request + * @param response + */ + @RequestMapping("/save") + public void save(@ModelAttribute PeopleUserEntity peopleUser,HttpServletRequest request,HttpServletResponse response){ + //获取用户session + PeopleEntity people = this.getPeopleBySession(request); + + if(people == null){ + //当session不存在返回错误信息 + this.outJson(response,ModelCode.PEOPLE_USER,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + + if(peopleUser == null){ + //未填写信息返回错误信息 + this.outJson(response, ModelCode.PEOPLE_USER,false,this.getResString("people.user.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + peopleUser.setPeopleAppId(people.getPeopleAppId()); + peopleUser.setPeopleId(people.getPeopleId()); + this.peopleUserBiz.saveEntity(peopleUser); + //更新手机和电子邮件 + if(!StringUtil.isBlank(peopleUser.getPeopleMail())){ + people.setPeopleMail(peopleUser.getPeopleMail()); + } + if(!StringUtil.isBlank(peopleUser.getPeoplePhone())){ + people.setPeoplePhone(peopleUser.getPeoplePhone()); + } + this.peopleBiz.updateEntity(people); + //返回用户添加成功 + this.outJson(response, ModelCode.PEOPLE_USER,true,this.getResString("people.user.save.msg.success",com.mingsoft.people.constant.Const.RESOURCES)); + } + + /** + * 获取用户详细信息 + * @param request + * @param response + */ + @RequestMapping("/getEntity") + public void getEntity(HttpServletRequest request,HttpServletResponse response){ + //获取用户session + PeopleEntity people = this.getPeopleBySession(request); + if(people == null){ + //当session不存在返回错误信息 + this.outJson(response,ModelCode.PEOPLE_USER,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + + PeopleUserEntity peopleUser = (PeopleUserEntity) this.peopleUserBiz.getEntity(people.getPeopleId()); + if(peopleUser == null){ + //没用用户详细信息 + this.outJson(response, ModelCode.PEOPLE_USER,false,this.getResString("people.user.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + //返回用户详细信息 + this.outJson(response, ModelCode.PEOPLE_USER,true,null,JSONObject.toJSONStringWithDateFormat(peopleUser,"yyyy-MM-dd HH:mm:ss")); + } + + /** + * 用户更新详细信息 + * @param peopleUser 用户信息 + * @param request + * @param response + */ + @RequestMapping("/update") + public void update(@ModelAttribute PeopleUserEntity peopleUser,HttpServletRequest request,HttpServletResponse response){ + //获取用户session + PeopleEntity people = this.getPeopleBySession(request); + + if(people == null){ + //当session不存在返回错误信息 + this.outJson(response,ModelCode.PEOPLE_USER,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + + if(peopleUser == null){ + //未填写信息返回错误信息 + this.outJson(response, ModelCode.PEOPLE_USER,false,this.getResString("people.user.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + + peopleUser.setPeopleId(people.getPeopleId()); + this.peopleUserBiz.updatePeople(peopleUser); + //返回更新成功 + this.outJson(response, ModelCode.PEOPLE_USER,true,this.getResString("people.user.update.msg.success",com.mingsoft.people.constant.Const.RESOURCES)); + } + + + /** + * 保存用户头像(包含头像) + * @param peopleUser 用户信息实体 + * @param request + * @param response + */ + @RequestMapping("/saveUserIcon") + public void saveUserIcon(@ModelAttribute PeopleUserEntity peopleUser,HttpServletRequest request,HttpServletResponse response){ + //获取用户session + PeopleEntity people = this.getPeopleBySession(request); + + + if(people == null){ + //当session不存在返回错误信息 + this.outJson(response,ModelCode.PEOPLE_USER,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + + if(peopleUser == null){ + //未填写信息返回错误信息 + this.outJson(response, ModelCode.PEOPLE_USER,false,this.getResString("people.user.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + + String imgPath =getUserIcon(people.getPeopleId(), peopleUser.getPeopleUserIcon().trim(),request); //新图片路径 + if(!StringUtil.isBlank(imgPath)){ + peopleUser.setPeopleUserIcon(imgPath); + } + + + peopleUser.setPeopleAppId(people.getPeopleAppId()); + peopleUser.setPeopleId(people.getPeopleId()); + this.peopleUserBiz.saveEntity(peopleUser); + //更新手机和电子邮件 + if(!StringUtil.isBlank(peopleUser.getPeopleMail())){ + people.setPeopleMail(peopleUser.getPeopleMail()); + } + if(!StringUtil.isBlank(peopleUser.getPeoplePhone())){ + people.setPeoplePhone(peopleUser.getPeoplePhone()); + } + this.peopleBiz.updateEntity(people); + //返回用户添加成功 + this.outJson(response, ModelCode.PEOPLE_USER,true,this.getResString("people.user.save.msg.success",com.mingsoft.people.constant.Const.RESOURCES)); + } + + /** + * 更新用户信息(包含头像) + * @param peopleUser 用户信息 + * @param request + * @param response + */ + @RequestMapping("/updateUserIcon") + public void updateUserIcon(@ModelAttribute PeopleUserEntity peopleUser,HttpServletRequest request,HttpServletResponse response){ + //获取用户session + PeopleEntity people = this.getPeopleBySession(request); + + + + if(people == null){ + //当session不存在返回错误信息 + this.outJson(response,ModelCode.PEOPLE_USER,false,this.getResString("people.session.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + + PeopleUserEntity oldPeopleUser = (PeopleUserEntity) peopleUserBiz.getEntity(people.getPeopleId()); + + if(peopleUser == null){ + //未填写信息返回错误信息 + this.outJson(response, ModelCode.PEOPLE_USER,false,this.getResString("people.user.msg.null.error",com.mingsoft.people.constant.Const.RESOURCES)); + return ; + } + + + String imgPath =getUserIcon(people.getPeopleId(), peopleUser.getPeopleUserIcon().trim(),request); //新图片路径 + if(!StringUtil.isBlank(imgPath)){ + oldPeopleUser.setPeopleUserIcon(imgPath); + } + + this.peopleUserBiz.updatePeople(oldPeopleUser); + //返回更新成功 + this.outJson(response, ModelCode.PEOPLE_USER,true,this.getResString("people.user.update.msg.success",com.mingsoft.people.constant.Const.RESOURCES)); + } + + /** + * 上传头像 + * @param peopleId 用户id + * @param imgPath 原图片路径 + * @param request + * @return 新图片路径 + */ + private String getUserIcon(int peopleId,String imgPath,HttpServletRequest request){ + if(!StringUtil.isBlank(imgPath)){ + int x1= this.getInt(request, "x1", 0); + int y1 = this.getInt(request, "y1", 0); + int x2 = this.getInt(request, "x2", 0); + int y2 = this.getInt(request, "y2", 0); + Integer imgWidth = this.getInt(request, "imgWidth"); + if(StringUtil.isBlank(imgWidth)){ + return null; + } + String sufix = StringUtil.getFileFix(imgPath); //获取图片后缀 + //新的图片路径 + String savePath = StringUtil.buildPath("upload","people",this.getAppId(request),StringUtil.getDateSimpleStr()+"_"+peopleId+sufix); + //原图片的物理路径 + String imgWidthStr = StringUtil.buildPath(this.getRealPath(request,File.separator),imgPath); + //保存的物理路径 + String savePathStr = StringUtil.buildPath(this.getRealPath(request,File.separator),savePath); + FileUtil.createFolder(savePathStr); + int[] imgSiz = ImageUtil.getImageWidthHeight(imgWidthStr.trim()); + int saveImgWidth=imgSiz[0]; //获取图片的实际宽度 + int newX1 = x1*saveImgWidth/imgWidth; + int newY1 = y1*saveImgWidth/imgWidth; + + ImageUtil.cut(newX1, newY1,(x2-x1)*saveImgWidth/imgWidth, (y2-y1)*saveImgWidth/imgWidth, imgWidthStr, savePathStr.toString()); + new File(imgWidthStr).delete(); //删除旧的路径下的图片 + return savePath; + } + + return null; + } + + + +} diff --git a/src/main/java/com/mingsoft/people/action/web/MailAction.java b/src/main/java/com/mingsoft/people/action/web/MailAction.java new file mode 100644 index 00000000..e0d330e5 --- /dev/null +++ b/src/main/java/com/mingsoft/people/action/web/MailAction.java @@ -0,0 +1,128 @@ +package com.mingsoft.people.action.web; + +import java.util.Date; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.mingsoft.people.biz.IPeopleBiz; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.people.constant.e.PeopleEnum; +import com.mingsoft.people.action.BaseAction; +import com.mingsoft.util.DateUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 杨新远 + * + *

+ * Comments:用户模块的邮件调用模块 + *

+ * + *

+ * Create Date:2015-6-15 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller("webPeopleMail") +@RequestMapping("/people/mail") +public class MailAction extends BaseAction{ + + //注入用户业务层 + @Autowired + private IPeopleBiz peopleBiz; + + /** + * 用户发送邮箱验证码 + * 需要根据modelCode获取相应的邮件模板,同时该modelCode经过AES加密 + * @param peopleMail 邮箱地址 + * @param modelCode 模块编码 + * @param request + * @param response + */ + @RequestMapping("/peopleSendCode") + public void peopleSendCode(String peopleMail,String modelCode,HttpServletRequest request, HttpServletResponse response) { + //通过邮箱地址和应用id得到用户实体 + PeopleEntity people = peopleBiz.getEntityByUserName(peopleMail, this.getAppId(request)); + if (people == null) { + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("err.not.exist", this.getResString("people.mail"))); + return; + } + + String peopleCode = StringUtil.randomNumber(6); + // 将生成的验证码加入用户实体 + people.setPeopleCode(peopleCode); + + //将当前时间转换为时间戳格式保存进people表 + people.setPeopleCodeSendDate(DateUtil.dateToTimestamp(new Date())); + // 更新该实体 + this.peopleBiz.updateEntity(people); + + //解密得到的模块编码 + String _modelCode = this.decryptByAES(request, modelCode); + String[] user = { peopleMail }; + //先随机6位编码 + //保存对应的用户表里面 + //将短信的content赋值为6位对应编码 + this.sendMail(request, _modelCode, user,peopleCode); + + this.outJson(response, ModelCode.PEOPLE, true); + } + + /** + * 对比邮箱验证码和数据库中的验证码是否相同 + * @param peopleCode 验证码 + * @param peopleMail 邮箱地址 + * @param request + * @param response + */ + @RequestMapping("/peopleCheckCode") + public void peopleCheckCode(String peopleCode,String peopleMail,HttpServletRequest request, HttpServletResponse response) { + //验证码 + if(StringUtil.isBlank(peopleCode)){ + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("err.error", this.getResString("peopleCode"))); + return; + } + + //根据邮箱地址查找用户实体 + PeopleEntity peopleEntity = this.peopleBiz.getEntityByUserName(peopleMail, this.getAppId(request)); + + //得到发送验证码时间,并转换为String类型 + String date = peopleEntity.getPeopleCodeSendDate().toString(); + + //如果发送时间和当前时间只差大于30分钟,则返回false + if(DateUtil.secondBetween(date)>60*60*24){ + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.code.error")); + return; + } + // 判断用户输入的随机码是否正确 + if (!peopleEntity.getPeopleCode().equals(peopleCode)) { + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("err.error", this.getResString("peopleCode"))); + return; + } + // 将随机码在数据库中清空 + peopleEntity.setPeopleCode(""); + peopleEntity.setPeopleMailCheck(PeopleEnum.MAIL_CHECK); + peopleBiz.updateEntity(peopleEntity); + this.outJson(response, ModelCode.PEOPLE, true); + } +} diff --git a/src/main/java/com/mingsoft/people/action/web/PeopleAction.java b/src/main/java/com/mingsoft/people/action/web/PeopleAction.java new file mode 100644 index 00000000..324d6594 --- /dev/null +++ b/src/main/java/com/mingsoft/people/action/web/PeopleAction.java @@ -0,0 +1,529 @@ +/** + * + */ +package com.mingsoft.people.action.web; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.people.biz.IPeopleBiz; +import com.mingsoft.basic.constant.e.MailEnum; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.people.action.BaseAction; +import com.mingsoft.people.constant.e.PeopleEnum; +import com.mingsoft.util.StringUtil; +/** + * + *

+ * 铭飞科技-会员系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 成卫雄 QQ:330216230 + * + *

+ * Comments:外部会员接口控制层 + *

+ * + *

+ * Create Date:2014-10-31 + *

+ * + *

+ * Modification history: + *

+ */ +@Controller("webPeople") +@RequestMapping("/") +public class PeopleAction extends BaseAction { + + /** + * 注入用户基础业务层 + */ + @Autowired + private IPeopleBiz peopleBiz; + + /** + * 用户注册 + * + * @param people + * 用户信息 + * @param type + * 注册类型:
1:根据用户名注册
2:根据手机号注册
3:根据邮箱注册
+ * @seee PeopleEnum + * @param request + * @param response + */ + @RequestMapping("/{type}/register") + public void register(@ModelAttribute PeopleEntity people, @PathVariable int type, HttpServletRequest request, HttpServletResponse response) { + + // 判断注册类型是否正确 + if (type < PeopleEnum.REGISTER_NAME.toInt() || type > PeopleEnum.REGISTER_EMAIL.toInt()) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.type.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 验证码验证 验证码不为null 或 验证码不相等 + if (StringUtil.isBlank(this.getRandCode(request)) || !this.checkRandCode(request)) { + this.outJson(response, null, false, this.getResString("err.error", this.getResString("rand.code"))); + return; + } + + // 判断用户信息是否为空 + if (people == null) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.msg.null.error"), this.getResString("people.msg.null.error")); + return; + } + + if (type == PeopleEnum.REGISTER_NAME.toInt()) {// 用户根据用户名注册 + // 验证用户名 + if (StringUtil.isBlank(people.getPeopleName()) || people.getPeopleName().length() < 3 || people.getPeopleName().length() > 12) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.msg.name.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + } else if (type == PeopleEnum.REGISTER_PHONE.toInt()) {// 用户根据手机号注册 + // 验证手机号 + if (StringUtil.isBlank(people.getPeoplePhone()) || !StringUtil.isMobile(people.getPeoplePhone())) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.msg.phone.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + } else if (type == PeopleEnum.REGISTER_EMAIL.toInt()) {// 用户根据邮箱注册 + // 验证邮箱 + if (StringUtil.isBlank(people.getPeopleMail()) || !StringUtil.isEmail(people.getPeopleMail())) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.msg.mail.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + } + + // 获取应用ID + int appId = this.getAppId(request); + + // 验证用户信息,用户可使用:用户名,邮箱,手机号登录则必须保证这三个值在数据库中的唯一性 + if (!StringUtil.isBlank(people.getPeopleName())) {// 验证用户名 + PeopleEntity peopleName = this.peopleBiz.getEntityByUserName(people.getPeopleName(), appId); + if (peopleName != null) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + } + if (!StringUtil.isBlank(people.getPeoplePhone())) {// 验证手机号 + PeopleEntity peoplePhone = this.peopleBiz.getEntityByUserName(people.getPeoplePhone(), appId); + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.phone.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + } + if (!StringUtil.isBlank(people.getPeopleMail())) {// 验证邮箱 + PeopleEntity peopleMail = this.peopleBiz.getEntityByUserName(people.getPeopleMail(), appId); + if (peopleMail != null) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.mail.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + } + + // 验证密码 + if (StringUtil.isBlank(people.getPeoplePassword()) || people.getPeoplePassword().length() < 6 || people.getPeoplePassword().length() > 30) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.msg.password.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 将密码使用MD5加密 + people.setPeoplePassword(StringUtil.Md5(people.getPeoplePassword())); + people.setPeopleAppId(appId); + people.setPeopleDateTime(new Date()); + this.peopleBiz.saveEntity(people); + this.outJson(response, ModelCode.PEOPLE_REGISTER, true, this.getResString("people.register.msg.success", com.mingsoft.people.constant.Const.RESOURCES)); + } + + /** + * 功能:通过用户注册类型,验证用户名是否可用 + * + * @param userName + * 用户名(可为:用户名称,手机,邮箱) + * + * @param type + * 注册类型:
1:根据用户名注册
2:根据手机号注册
3:根据邮箱注册
+ * + * @param request + * @param response + */ + @RequestMapping("/{type}/checkPeopleName") + public void checkPeopleName(String userName, @PathVariable int type, HttpServletRequest request, HttpServletResponse response) { + + // 判断注册类型是否正确 + if (type < PeopleEnum.REGISTER_NAME.toInt() || type > PeopleEnum.REGISTER_EMAIL.toInt()) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.type.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + if (type == PeopleEnum.REGISTER_NAME.toInt()) {// 用户根据用户名注册 + // 验证用户名 + if (StringUtil.isBlank(userName) || userName.length() < 3 || userName.length() > 12) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.msg.name.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + } else if (type == PeopleEnum.REGISTER_PHONE.toInt()) {// 用户根据手机号注册 + // 验证手机号 + if (StringUtil.isBlank(userName) || !StringUtil.isMobile(userName)) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.msg.phone.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + } else if (type == PeopleEnum.REGISTER_EMAIL.toInt()) {// 用户根据邮箱注册 + // 验证邮箱 + if (StringUtil.isBlank(userName) || !StringUtil.isEmail(userName)) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.msg.mail.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + } + + // 获取应用ID + int appId = this.getAppId(request); + + // 验证用户信息,用户可使用:用户名,邮箱,手机号登录则必须保证这三个值在数据库中的唯一性 + if (!StringUtil.isBlank(userName)) {// 验证用户名 + PeopleEntity peopleName = this.peopleBiz.getEntityByUserName(userName, appId); + if (peopleName != null) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.name.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + } + if (!StringUtil.isBlank(userName)) {// 验证手机号 + PeopleEntity peoplePhone = this.peopleBiz.getEntityByUserName(userName, appId); + if (peoplePhone != null) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.phone.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + } + if (!StringUtil.isBlank(userName)) {// 验证邮箱 + PeopleEntity peopleMail = this.peopleBiz.getEntityByUserName(userName, appId); + if (peopleMail != null) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("people.register.msg.mail.repeat.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + } + this.outJson(response, ModelCode.PEOPLE_REGISTER, true); + } + + /** + * 验证用户的登录信息 + * + * @param userName + * 用户名(可为:用户名称,手机,邮箱) + * @param passWord + * 密码 + * + * @param request + * @param response + */ + @RequestMapping("/checkLogin") + public void checkLogin(HttpServletRequest request, HttpServletResponse response) { + // 获取用户名 + String userName = request.getParameter("userName"); + // 获取密码 + String passWord = request.getParameter("passWord"); + // 获取是否自动登录 + String autoLogin = request.getParameter("autoLogin"); + //判断登录时是否要进行图片验证码的验证,true表示需要 + String isImgCode = request.getParameter("isImgCode"); + + if(!StringUtil.isBlank(isImgCode) && isImgCode.equals("true")){ + // 验证码验证 验证码不为null 或 验证码不相等 + if (StringUtil.isBlank(this.getRandCode(request)) || !this.checkRandCode(request)) { + this.outJson(response, null, false, this.getResString("err.error", this.getResString("rand.code"))); + return; + } + } + // 用户名和密码不能为空 + if (StringUtil.isBlank(userName) || StringUtil.isBlank(passWord)) { + this.outJson(response, ModelCode.PEOPLE_LOGIN, false, this.getResString("people.msg.null.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 根据应用ID和用户名查询用户密码 + int appId = this.getAppId(request); + PeopleEntity peopleEntity = this.peopleBiz.getEntityByUserName(userName, appId); + if (peopleEntity == null) { + // 用户名或密码错误 + this.outJson(response, ModelCode.PEOPLE_LOGIN, false, this.getResString("people.msg.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 将用户输入的密码用MD5加密再和数据库中的进行比对 + String peoplePassWord = StringUtil.Md5(passWord); + if (peoplePassWord.equals(peopleEntity.getPeoplePassword())) { + // 登录成功,压入用户session + this.setSession(request, SessionConst.PEOPLE_SESSION, peopleEntity); + // 构建返回给页面的json + Map mapJson = new HashMap(); + + //判断用户是否点击了自动登录 + if (autoLogin != null) { + mapJson.put("peoplePassWord", peoplePassWord); + mapJson.put("autoLoginInCookies", autoLogin); + } + mapJson.put("userName", StringUtil.encodeStringByUTF8(peopleEntity.getPeopleName())); + mapJson.put("phone", peopleEntity.getPeoplePhone()); + mapJson.put("mail", peopleEntity.getPeopleMail()); + //将用户审核状态压入 + mapJson.put("peopleState", peopleEntity.getPeopleState()+""); + // 将用户信息压入到cookie中 + + this.setCookie(request, response, CookieConst.PEOPLE_COOKIE, JSONObject.toJSONString(mapJson),60*60*24*7); + this.outJson(response, ModelCode.PEOPLE_LOGIN, true, JSONObject.toJSONString(mapJson)); + + } else { + // 用户名或密码错误 + this.outJson(response, ModelCode.PEOPLE_LOGIN, false, this.getResString("people.msg.error", com.mingsoft.people.constant.Const.RESOURCES)); + } + + + } + + /** + * 退出登录 + * + * @param request + * @param response + */ + @RequestMapping("/quit") + public void quit(HttpServletRequest request, HttpServletResponse response) { + // 移除当前用户session + this.removeSession(request, SessionConst.PEOPLE_SESSION); + this.setCookie(request, response, CookieConst.PEOPLE_COOKIE, null); + this.outJson(response, ModelCode.PEOPLE, true, this.getResString("people.quit.msg.success", com.mingsoft.people.constant.Const.RESOURCES)); + } + + /** + * 用户通过手机找回密码时,修改密码 + * + * @param request + * @param response + */ + @RequestMapping("/setPasswordByPhone") + @ResponseBody + public void setPasswordByPhone(HttpServletRequest request, HttpServletResponse response) { + // 手机 + String peoplePhone = request.getParameter("peoplePhone"); + // 新密码 + String passWord = request.getParameter("password"); + + // 根据邮箱获取用户实体 + int appId = this.getAppId(request); + PeopleEntity people = this.peopleBiz.getEntityByUserName(peoplePhone, appId); + // 验证新密码的长度 + if (passWord.length() < 6 || passWord.length() > 30) { + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.password.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 将新密码用MD5加密 + passWord = StringUtil.Md5(passWord); + // 判断用户名不为null + if (people != null) { + // 判断用户验证是否通过 + if (people.getPeoplePhoneCheck() != PeopleEnum.PHONE_CHECK.toInt()) { + // 用户验证未通过 + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.reset.msg.name.phone.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 设置用户新密码 + people.setPeoplePassword(passWord); + peopleBiz.updateEntity(people); + this.outJson(response, ModelCode.PEOPLE, true, this.getResString("people.change.password.msg.success", com.mingsoft.people.constant.Const.RESOURCES)); + } else { + // 用户不存在 + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("err.not.exist", this.getResString("people"))); + return; + } + } + + /** + * 通过邮箱设置新密码 + * @param request + * @param response + */ + @RequestMapping("/setPasswordByMail") + @ResponseBody + public void setPasswordByMail(HttpServletRequest request, HttpServletResponse response) { + // 邮箱 + String peopleMail = request.getParameter("peopleMail"); + // 新密码 + String passWord = request.getParameter("passWord"); + + // 根据邮箱获取用户实体 + int appId = this.getAppId(request); + PeopleEntity people = this.peopleBiz.getEntityByUserName(peopleMail, appId); + // 验证新密码的长度 + if (passWord.length() < 6 || passWord.length() > 30) { + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.password.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 将新密码用MD5加密 + passWord = StringUtil.Md5(passWord); + // 判断用户名不为null + if (people != null) { + // 判断用户验证是否通过 + if (people.getPeopleMailCheck() != PeopleEnum.MAIL_CHECK.toInt()) { + // 用户验证未通过 + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.reset.msg.name.mail.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 设置用户新密码 + people.setPeoplePassword(passWord); + peopleBiz.updateEntity(people); + this.outJson(response, ModelCode.PEOPLE, true, this.getResString("people.change.password.msg.success", com.mingsoft.people.constant.Const.RESOURCES)); + } else { + // 用户不存在 + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("err.not.exist", this.getResString("people"))); + return; + } + } + + /** + * 根据用户名和验证码判断是否存在用户实体, + * 可应用场景:用户忘记了密码,用户可以输入用户名称与验证码,进行下一步操作 + * 流程:如果用户存在->取出用户的手机(邮箱)->发送验证->用户输入验证信息->正确->输入新密码->成功 + * @param peopleName 用户名 + * @param request + * @param response + */ + @RequestMapping("/getPeopleByName") + public void getPeopleByName(String peopleName,HttpServletRequest request, HttpServletResponse response) { + + // 应用id + int appId = this.getAppId(request); + // 验证用户输入的验证码是否正确 + String imgCode = request.getParameter("imgCode"); + if (StringUtil.isBlank(imgCode) || !imgCode.equalsIgnoreCase(this.getCodeBySession(request))) { + this.outJson(response, null, false, this.getResString("err.error", getResString("peopleImageCode"))); + return; + } + + // 验证用户名 + if (StringUtil.isBlank(peopleName) || peopleName.length() < 3 || peopleName.length() > 12) { + this.outJson(response, null, false, this.getResString("people.msg.name.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 根据帐号查找实体 + PeopleEntity people = this.peopleBiz.getEntityByUserName(peopleName, appId); + if (people == null) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("err.not.exist", this.getResString("people"))); + } else { + // 返回用户信息 + this.outJson(response, null, true, JSON.toJSONString(people)); + } + } + + + + /** + * 发送取回密码的连接地址(已过时不能使用) + * + * @param request + * @param peopleMail + * 用户接收邮箱地址 + * @param url + * 取回密码的页面连接地址, + * @deprecated + */ + @RequestMapping("/sendGetPasswordUrl") + public void sendGetPasswordUrl(HttpServletRequest request, HttpServletResponse response) { + String peopleMail = request.getParameter("peopleMail"); + String url = request.getParameter("url"); + String imgCode = request.getParameter("imgCode"); + // 根据appId + int appId = this.getAppId(request); + // 验证用户输入的验证码是否正确 + + if (StringUtil.isBlank(imgCode) && !imgCode.equalsIgnoreCase(this.getCodeBySession(request))) { + this.outJson(response, ModelCode.PEOPLE_REGISTER, false, this.getResString("err.error", getResString("peopleImageCode"))); + return; + } + // 判断该邮箱是否注册过 + PeopleEntity people = peopleBiz.getEntityByUserName(peopleMail, appId); + if (people == null) { + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("err.not.exist", this.getResString("people"))); + return; + } + + // 1生成session 值, + String code = StringUtil.getDateSimpleStr(); + this.setSession(request, SessionConst.PEOPLE_GET_PASSWORD_SESSION, code); + String content = StringUtil.buildUrl(url, "code=" + code); + this.sendMail(request, MailEnum.TEXT, this.getResString("people.get.password"), StringUtil.buildUrl(content, "mail=" + peopleMail), new String[] { peopleMail }); + this.outJson(response, ModelCode.PEOPLE, true); + } + + /** + * 用户通过邮箱找回密码时,修改密码,与sendGetPasswordUrl配合使用(已过时不能使用) + * + * @param request + * @param response + * @deprecated + */ + @RequestMapping("/setPassword") + @ResponseBody + public void setPassword(HttpServletRequest request, HttpServletResponse response) { + // 邮箱 + String peopleMail = request.getParameter("peopleMail"); + String passWord = request.getParameter("passWord"); + // 验证码 + String code = request.getParameter("code"); + String errUrl = request.getParameter("errUrl"); // 错误返回地址 + Object scode = this.getSession(request, SessionConst.PEOPLE_GET_PASSWORD_SESSION); + if (scode == null || !code.equals(scode.toString())) { + this.outJson(response, ModelCode.PEOPLE, false, null, errUrl); + return; + } + // 根据邮箱获取用户实体 + int appId = this.getAppId(request); + PeopleEntity people = this.peopleBiz.getEntityByUserName(peopleMail, appId); + // 验证新密码的长度 + if (passWord.length() < 6 || passWord.length() > 30) { + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("people.msg.password.error", com.mingsoft.people.constant.Const.RESOURCES)); + return; + } + + // 将新密码用MD5加密 + passWord = StringUtil.Md5(passWord); + if (people != null) { + // 设置用户新密码 + people.setPeoplePassword(passWord); + peopleBiz.updateEntity(people); + this.outJson(response, ModelCode.PEOPLE, true, this.getResString("people.change.password.msg.success", com.mingsoft.people.constant.Const.RESOURCES)); + } else { + // 用户不存在 + this.outJson(response, ModelCode.PEOPLE, false, this.getResString("err.not.exist", this.getResString("people"))); + return; + } + } + + +} diff --git a/src/main/java/com/mingsoft/people/biz/.DS_Store b/src/main/java/com/mingsoft/people/biz/.DS_Store new file mode 100644 index 00000000..440c9540 Binary files /dev/null and b/src/main/java/com/mingsoft/people/biz/.DS_Store differ diff --git a/src/main/java/com/mingsoft/people/biz/IPeopleBiz.java b/src/main/java/com/mingsoft/people/biz/IPeopleBiz.java new file mode 100644 index 00000000..bda9e640 --- /dev/null +++ b/src/main/java/com/mingsoft/people/biz/IPeopleBiz.java @@ -0,0 +1,111 @@ +package com.mingsoft.people.biz; + +import java.util.List; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:用户业务层,继承IBaseBiz + *

+ * + *

+ * Create Date:2014-7-29 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IPeopleBiz extends IBaseBiz{ + + /** + * 用户有子类添加 + * @param entity 用户实体 + * @return 用户ID + */ + public int savePeople(PeopleEntity people); + + + /** + * 根据用户ID进行用户实体的更新,用于有子类的更新操作 + * @param entity 用户实体 + */ + public void updatePeople(PeopleEntity people); + + /** + * 根据用户ID删除用户实体,用于有子类的删除操作 + * @param id 用户ID + */ + public void deletePeople(int id); + + /** + * 根据用户用户名查询用户实体
+ * @param userName 用户名(注:手机号,邮箱,用户名称都可作为用户名登录) + * @param appId 应用Id + * @return 查询到的用户实体 + */ + public PeopleEntity getEntityByUserName(String userName,int appId); + + /** + * 根据AppId查询用户列表并进行分页 + * @param appId 应用Id + * @param page 分页 + * @return 用户集合 + */ + public List queryPageListByAppId(int appId,PageUtil page); + + /** + * 根据应用ID查询用户总数 + * @param appId 应用ID + * @return 用户总数 + */ + public int queryCountByAppId(int appId); + + /** + * 根据用户名(帐号,手机,邮箱)和验证码查询用户信息开始 + * @param userName 用户名 + * @param peopleCode 验证码 + * @param appId 应用id + * @return 用户实体 + */ + public PeopleEntity getEntityByCode(String userName,String peopleCode,int appId); + + /** + * 根据注册时间和应用id查询总数 + * @param peopleDateTime + * @param appId 应用id + * @return 用户总数 + */ + public int getCountByDate(String peopleDateTime,Integer appId); + + /** + * 批量删除用户 + * @param peopleIds 用户id集合 + */ + public void deletePeople(int[] peopleIds); +} diff --git a/src/main/java/com/mingsoft/people/biz/IPeopleUserBiz.java b/src/main/java/com/mingsoft/people/biz/IPeopleUserBiz.java new file mode 100644 index 00000000..9b7ee50b --- /dev/null +++ b/src/main/java/com/mingsoft/people/biz/IPeopleUserBiz.java @@ -0,0 +1,70 @@ +package com.mingsoft.people.biz; + +import com.mingsoft.people.entity.PeopleUserEntity; + + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: 用户信息业务层接口,继承IPeopleBiz接口 + *

+ * + *

+ * Create Date:2014-9-4 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IPeopleUserBiz extends IPeopleBiz { + + /** + * 用户信息实体保存
+ * 只能有子类继承时调用的
+ * @param peopleEntity 用户信息 + * @return 新增成功后用户ID + */ + public int savePeopleUser(PeopleUserEntity peopleEntity); + + /** + * 更新用户信息
+ * 只能在有子类时调用
+ * @param peopleEntity 用户信息 + */ + public void updatePeopleUser(PeopleUserEntity peopleEntity); + + /** + * 删除用户信息
+ * 只能在有子类时调用
+ * @param peopleId 用户ID + */ + public void deletePeopleUser(int peopleId); + + /** + * 批量删除用户 + * @param peopleIds 用户id集合 + */ + public void deletePeopleUsers(int[] peopleIds); +} diff --git a/src/main/java/com/mingsoft/people/biz/IPeopleWebsiteModelBiz.java b/src/main/java/com/mingsoft/people/biz/IPeopleWebsiteModelBiz.java new file mode 100644 index 00000000..83b22f48 --- /dev/null +++ b/src/main/java/com/mingsoft/people/biz/IPeopleWebsiteModelBiz.java @@ -0,0 +1,49 @@ +package com.mingsoft.people.biz; + +import com.mingsoft.base.biz.IBaseBiz; +import com.mingsoft.people.entity.PeopleWebsiteModelEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: 用户站点模块业务层接口,继承IBaseBiz接口 + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IPeopleWebsiteModelBiz extends IBaseBiz { + + /** + * 根据用户站点模块实体删除据用户站点模块字段 + * @param peopleWebsiteModel + */ + public void deleteEntity(PeopleWebsiteModelEntity peopleWebsiteModel ); + +} diff --git a/src/main/java/com/mingsoft/people/biz/impl/PeopleBizImpl.java b/src/main/java/com/mingsoft/people/biz/impl/PeopleBizImpl.java new file mode 100644 index 00000000..529a55ce --- /dev/null +++ b/src/main/java/com/mingsoft/people/biz/impl/PeopleBizImpl.java @@ -0,0 +1,149 @@ +package com.mingsoft.people.biz.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.people.biz.IPeopleBiz; +import com.mingsoft.people.dao.IPeopleDao; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:用户业务层实现类,继承BaseBizImpl,实现IPeopleBiz + *

+ * + *

+ * Create Date:2014-7-29 + *

+ * + *

+ * Modification history: + *

+ */ +@Service("peopleBiz") +public class PeopleBizImpl extends BaseBizImpl implements IPeopleBiz{ + + /** + * 用户持久化层 + */ + @Autowired + private IPeopleDao peopleDao; + + /** + * 获取peopleDao + */ + @Override + protected IBaseDao getDao() { + return peopleDao; + } + + /** + * 用户有子类增加 + */ + @Override + public int savePeople(PeopleEntity people) { + peopleDao.saveEntity(people); + return saveEntity(people); + } + + /** + * 根据用户ID进行用户实体的更新,用于有子类的更新操作 + * @param entity + */ + @Override + public void updatePeople(PeopleEntity people) { + peopleDao.updateEntity(people); + updateEntity(people); + } + + /** + * 用户删除 + */ + @Override + public void deletePeople(int id) { + peopleDao.deleteEntity(id); + deleteEntity(id); + } + + /** + * 根据用户用户名查询用户实体
+ * @param userName 用户名(注:手机号,邮箱,用户名称都可作为用户名登录) + * @param appId 应用Id + * @return 查询到的用户实体 + */ + public PeopleEntity getEntityByUserName(String userName,int appId){ + return this.peopleDao.getEntityByUserName(userName,appId); + } + + /** + * 根据AppId查询用户列表并进行分页 + * @param appId 应用Id + * @param page 分页 + * @return 用户集合 + */ + public List queryPageListByAppId(int appId,PageUtil page){ + return this.peopleDao.queryPageListByAppId(appId,page); + } + + /** + * 根据应用ID查询用户总数 + * @param appId 应用ID + * @return 用户总数 + */ + public int queryCountByAppId(int appId){ + return this.peopleDao.getCount(appId,null); + } + + @Override + public PeopleEntity getEntityByCode(String userName, String peopleCode,int appId) { + // TODO Auto-generated method stub + return this.peopleDao.getEntityByCode(userName, peopleCode, appId); + } + + @Override + public int getCountByDate(String peopleDateTime, Integer appId) { + // TODO Auto-generated method stub + Map where = new HashMap(); + where.put("peopleDateTime", peopleDateTime); + return this.peopleDao.getCount(appId, where); + } + + @Override + public void deletePeople(int[] peopleIds) { + if(peopleIds==null){ + return; + } + this.peopleDao.deletePeoples(peopleIds); + } + + +} diff --git a/src/main/java/com/mingsoft/people/biz/impl/PeopleUserBizImpl.java b/src/main/java/com/mingsoft/people/biz/impl/PeopleUserBizImpl.java new file mode 100644 index 00000000..1e46ae1b --- /dev/null +++ b/src/main/java/com/mingsoft/people/biz/impl/PeopleUserBizImpl.java @@ -0,0 +1,108 @@ +package com.mingsoft.people.biz.impl; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.people.biz.IPeopleUserBiz; +import com.mingsoft.people.dao.IPeopleUserDao; +import com.mingsoft.people.entity.PeopleUserEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: 用户信息业务层层实现类,继承PeopleBizImpl,实现IPeoplePrivateBiz接口 + *

+ * + *

+ * Create Date:2014-9-4 + *

+ * + *

+ * Modification history: + *

+ */ +@Service("peopleUserBiz") +public class PeopleUserBizImpl extends PeopleBizImpl implements IPeopleUserBiz { + + /** + * 用户信息持久化层注入 + */ + @Autowired + private IPeopleUserDao peopleUserDao; + + @Override + protected IBaseDao getDao() { + return peopleUserDao; + } + + /** + * 用户信息实体保存
+ * 只能在有子类继承时调用的
+ */ + public int savePeopleUser(PeopleUserEntity peopleEntity){ + savePeople(peopleEntity); + return peopleUserDao.saveEntity(peopleEntity); + } + + /** + * 更新用户信息
+ * 只能在有子类时调用
+ * @param peopleEntity 用户信息 + */ + public void updatePeopleUser(PeopleUserEntity peopleEntity){ + updatePeople(peopleEntity); + this.peopleUserDao.updateEntity(peopleEntity); + } + + /** + * 删除用户信息
+ * 只能在有子类时调用
+ * @param peopleId 用户ID + */ + public void deletePeopleUser(int peopleId){ + deletePeople(peopleId); + this.peopleUserDao.deleteEntity(peopleId); + } + + @Override + public void deletePeopleUsers(int[] peopleIds) { + if(peopleIds==null){ + return; + } + this.deletePeople(peopleIds); + this.peopleUserDao.deletePeopleUsers(peopleIds); + } + +// /** +// * 根据站点Id查询用户集合 +// * @param websiteId +// * @return 用户集合 +// */ +// public List queryPeoplePrivatesByWebsiteId(int websiteId){ +// return peoplePrivateDao.queryPeoplePrivatesByWebsiteId(websiteId); +// } + +} diff --git a/src/main/java/com/mingsoft/people/biz/impl/PeopleWebsiteModelBizImpl.java b/src/main/java/com/mingsoft/people/biz/impl/PeopleWebsiteModelBizImpl.java new file mode 100644 index 00000000..c37fa18e --- /dev/null +++ b/src/main/java/com/mingsoft/people/biz/impl/PeopleWebsiteModelBizImpl.java @@ -0,0 +1,35 @@ +package com.mingsoft.people.biz.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.mingsoft.base.biz.impl.BaseBizImpl; +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.people.biz.IPeopleWebsiteModelBiz; +import com.mingsoft.people.dao.IPeopleWebsiteModelDao; +import com.mingsoft.people.entity.PeopleWebsiteModelEntity; + +@Service("peopleWebsiteModelBiz") +public class PeopleWebsiteModelBizImpl extends BaseBizImpl implements IPeopleWebsiteModelBiz { + + /** + * 用户站点模块持久化层注入 + */ + @Autowired + private IPeopleWebsiteModelDao peopleWebsiteModelDao; + + @Override + protected IBaseDao getDao() { + // TODO Auto-generated method stub + return peopleWebsiteModelDao; + } + + /** + * 根据用户站点模块实体删除据用户站点模块字段 + * @param peopleWebsiteModel + */ + public void deleteEntity(PeopleWebsiteModelEntity peopleWebsiteModel ){ + peopleWebsiteModelDao.deleteEntity(peopleWebsiteModel); + } + +} diff --git a/src/main/java/com/mingsoft/people/constant/Const.java b/src/main/java/com/mingsoft/people/constant/Const.java new file mode 100644 index 00000000..d92823c9 --- /dev/null +++ b/src/main/java/com/mingsoft/people/constant/Const.java @@ -0,0 +1,35 @@ +package com.mingsoft.people.constant; + + +import java.util.ResourceBundle; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 + * QQ:78750478 + * + *

+ * Comments: 用户模块资源文件 + *

+ * + *

+ * Create Date:2015-1-31 + *

+ * + *

+ * Modification history: + *

+ */ +public class Const { + public final static ResourceBundle RESOURCES = ResourceBundle.getBundle("com.mingsoft.people.resources.resources"); +} diff --git a/src/main/java/com/mingsoft/people/constant/e/PeopleAddressEnum.java b/src/main/java/com/mingsoft/people/constant/e/PeopleAddressEnum.java new file mode 100644 index 00000000..2a4eb0de --- /dev/null +++ b/src/main/java/com/mingsoft/people/constant/e/PeopleAddressEnum.java @@ -0,0 +1,38 @@ +package com.mingsoft.people.constant.e; + +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * 用户收货地址状态枚举类 + * @author yangxy + * @version + * 版本号:【100-000-000】 + * 创建日期:2015年8月24日 + * 历史修订: + */ +public enum PeopleAddressEnum implements BaseEnum{ + /** + * 默认收货地址 + */ + ADDRESS_DEFAULT(0), + + /** + * 非默认收货地址 + */ + ADDRESS_NOT_DEFAULT(1); + + PeopleAddressEnum(Object code) { + this.code = code; + } + + private Object code; + + @Override + public String toString() { + return code.toString(); + } + + public int toInt() { + return Integer.parseInt(code.toString()); + } +} diff --git a/src/main/java/com/mingsoft/people/constant/e/PeopleEnum.java b/src/main/java/com/mingsoft/people/constant/e/PeopleEnum.java new file mode 100644 index 00000000..0f82d917 --- /dev/null +++ b/src/main/java/com/mingsoft/people/constant/e/PeopleEnum.java @@ -0,0 +1,59 @@ +package com.mingsoft.people.constant.e; + +import com.mingsoft.base.constant.e.BaseEnum; + +public enum PeopleEnum implements BaseEnum { + /** + * 用户为已审核状态 + */ + STATE_CHECK(1), + /** + *根据用户名注册 + */ + REGISTER_NAME(1), + /** + *根据手机号注册 + */ + REGISTER_PHONE(2), + /** + *根据邮箱注册 + */ + REGISTER_EMAIL(3), + + /** + * 手机验证通过 + */ + PHONE_CHECK(1), + + /** + * 手机验证不通过 + */ + PHONE_NO_CHECK(0), + /** + * 邮箱验证通过 + */ + MAIL_CHECK(1), + /** + * 邮箱验证不通过 + */ + MAIL_NO_CHECK(0), + /** + * 用户为未审核状态 + */ + STATE_NOT_CHECK(0); + + PeopleEnum(Object code) { + this.code = code; + } + + private Object code; + + @Override + public String toString() { + return code.toString(); + } + + public int toInt() { + return Integer.parseInt(code.toString()); + } +} diff --git a/src/main/java/com/mingsoft/people/dao/IPeopleAddressDao.xml b/src/main/java/com/mingsoft/people/dao/IPeopleAddressDao.xml new file mode 100644 index 00000000..2071893d --- /dev/null +++ b/src/main/java/com/mingsoft/people/dao/IPeopleAddressDao.xml @@ -0,0 +1,104 @@ + + + + + + + PA_ID,PA_PEOPLE_ID,PA_CONSIGNEE_NAME,PA_PROVINCE,PA_CITY,PA_DISTRICT, + PA_ADDRESS,PA_MAIL,PA_PHONE,PA_DEFAULT,PA_APP_ID + + + + + + + + + + + + + + + + + + + + + + + insert into people_address + + pa_people_id, + pa_consignee_name, + pa_province, + pa_city, + pa_district, + pa_address, + pa_mail, + pa_phone, + pa_default, + pa_app_id + + + #{peopleAddressPeopleId}, + #{peopleAddressConsigneeName}, + #{peopleAddressProvince}, + #{peopleAddressCity}, + #{peopleAddressDistrict}, + #{peopleAddressAddress}, + #{peopleAddressMail}, + #{peopleAddressPhone}, + #{peopleAddressDefault}, + #{peopleAddressAppId} + + + + + + + update people_address + + pa_consignee_name=#{peopleAddressConsigneeName}, + pa_province=#{peopleAddressProvince}, + pa_city=#{peopleAddressCity}, + pa_district=#{peopleAddressDistrict}, + pa_address=#{peopleAddressAddress}, + pa_mail=#{peopleAddressMail}, + pa_phone=#{peopleAddressPhone}, + pa_default=#{peopleAddressDefault}, + + where pa_id = #{peopleAddressId} + + + + + + + + + + + + + + delete from people_address where pa_app_id = #{peopleAddressAppId} and pa_id = #{peopleAddressId} + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/people/dao/IPeopleDao.java b/src/main/java/com/mingsoft/people/dao/IPeopleDao.java new file mode 100644 index 00000000..10a5c252 --- /dev/null +++ b/src/main/java/com/mingsoft/people/dao/IPeopleDao.java @@ -0,0 +1,95 @@ +package com.mingsoft.people.dao; + + + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Param; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.util.PageUtil; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:用户持久化层,接口,继承IBaseDao + *

+ * + *

+ * Create Date:2014-7-29 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IPeopleDao extends IBaseDao { + + /** + * 根据用户用户名查询用户实体
+ * @param userName 用户名(注:手机号,邮箱,用户名称都可作为用户名登录) + * @param appId 应用Id + * @return 查询到的用户实体 + */ + public PeopleEntity getEntityByUserName(@Param("userName")String userName,@Param("appId")int appId); + + /** + * 根据AppId查询用户列表并进行分页 + * @param appId 应用Id + * @param page 分页 + * @return 用户集合 + */ + public List queryPageListByAppId(@Param("appId") int appId,@Param("page")PageUtil page); + + /** + * 根据应用ID查询用户总数 + * @param appId 应用ID + * @return 用户总数 + */ + public int queryCountByAppId(@Param("appId") int appId); + + /** + * 根据用户的验证码和用户名(:手机号,邮箱,用户名称都可作为用户名登录) + * @param userName + * @param peopleCode + * @param appId + * @return + */ + public PeopleEntity getEntityByCode(@Param("userName")String userName,@Param("peopleCode")String peopleCode,@Param("appId")int appId); + + /** + * 查找总数 + * @param appId :应用id + * @param where :查询条件 + */ + public int getCount(@Param("appId") Integer appId,@Param("where") Map where); + + /** + * 根据用户id集合批量删除用户 + * @param peopleIds 用户id集合 + */ + public void deletePeoples(@Param("peopleIds")int[] peopleIds); +} diff --git a/src/main/java/com/mingsoft/people/dao/IPeopleDao.xml b/src/main/java/com/mingsoft/people/dao/IPeopleDao.xml new file mode 100644 index 00000000..e90c57f7 --- /dev/null +++ b/src/main/java/com/mingsoft/people/dao/IPeopleDao.xml @@ -0,0 +1,165 @@ + + + + + + + P.PEOPLE_ID,P.PEOPLE_PHONE,P.PEOPLE_NAME,P.PEOPLE_PASSWORD,P.PEOPLE_CODE, + P.PEOPLE_DATETIME,P.PEOPLE_APP_ID,P.PEOPLE_MAIL,P.PEOPLE_STATE,P.PEOPLE_CODESENDDATE, + P.PEOPLE_PHONECHECK,P.PEOPLE_MAILLCHECK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into people + + PEOPLE_PHONE, + PEOPLE_NAME, + PEOPLE_PASSWORD, + PEOPLE_DATETIME, + PEOPLE_APP_ID, + PEOPLE_MAIL, + PEOPLE_STATE, + PEOPLE_CODE, + PEOPLE_CODESENDDATE, + PEOPLE_MAILLCHECK, + PEOPLE_PHONECHECK, + + + #{peoplePhone}, + #{peopleName}, + #{peoplePassword}, + #{peopleDateTime}, + #{peopleAppId}, + #{peopleMail}, + #{peopleState}, + #{peopleCode}, + #{peopleCodeSendDate}, + #{peopleMailCheck}, + #{peoplePhoneCheck}, + + + + + + + + + + + update people + + PEOPLE_PHONE=#{peoplePhone}, + PEOPLE_NAME=#{peopleName}, + PEOPLE_PASSWORD=#{peoplePassword}, + PEOPLE_DATETIME=#{peopleDateTime}, + PEOPLE_MAIL=#{peopleMail}, + PEOPLE_STATE=#{peopleState}, + PEOPLE_CODE=#{peopleCode}, + PEOPLE_CODESENDDATE=#{peopleCodeSendDate}, + PEOPLE_MAILLCHECK=#{peopleMailCheck}, + PEOPLE_PHONECHECK=#{peoplePhoneCheck}, + + where PEOPLE_ID = #{peopleId} + + + + + + delete from people where PEOPLE_ID = #{peopleId} + + + + + + + + + + + + + + + + + + + + + + + + + + delete from people + + people_id in #{item} + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/people/dao/IPeopleUserDao.java b/src/main/java/com/mingsoft/people/dao/IPeopleUserDao.java new file mode 100644 index 00000000..e3f0166e --- /dev/null +++ b/src/main/java/com/mingsoft/people/dao/IPeopleUserDao.java @@ -0,0 +1,50 @@ +package com.mingsoft.people.dao; + + +import org.apache.ibatis.annotations.Param; + +import com.mingsoft.base.dao.IBaseDao; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:用户信息持久化层接口,继承IBaseDao + *

+ * + *

+ * Create Date:2014-9-4 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IPeopleUserDao extends IBaseDao { + + /** + * 根据用户id集合批量删除用户 + * @param peopleIds 用户id集合 + */ + public void deletePeopleUsers(@Param("peopleIds")int[] peopleIds); +} diff --git a/src/main/java/com/mingsoft/people/dao/IPeopleUserDao.xml b/src/main/java/com/mingsoft/people/dao/IPeopleUserDao.xml new file mode 100644 index 00000000..6d13d81e --- /dev/null +++ b/src/main/java/com/mingsoft/people/dao/IPeopleUserDao.xml @@ -0,0 +1,109 @@ + + + + + + + PU.PU_PEOPLE_ID,PU.PU_REAL_NAME,PU.PU_ADDRESS,PU.PU_ICON,PU.PU_CARD, + PU.PU_NICKNAME,PU.PU_SEX,PU.PU_BIRTHDAY,PU.PU_APP_ID + + + + PU.PU_PEOPLE_ID,PU.PU_REAL_NAME,PU.PU_ADDRESS,PU.PU_ICON,PU.PU_NICKNAME,PU.PU_SEX,PU.PU_BIRTHDAY,PU.PU_APP_ID,PU.PU_CARD, + P.PEOPLE_ID,P.PEOPLE_PHONE,P.PEOPLE_NAME,P.PEOPLE_PASSWORD,P.PEOPLE_DATETIME,P.PEOPLE_APP_ID,P.PEOPLE_MAIL + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into people_user + + PU_PEOPLE_ID, + PU_REAL_NAME, + PU_ADDRESS, + PU_ICON, + PU_NICKNAME, + PU_SEX, + PU_BIRTHDAY, + PU_APP_ID, + PU_CARD, + + + #{peopleId}, + #{peopleUserRealName}, + #{peopleUserAddress}, + #{peopleUserIcon}, + #{peopleUserNickName}, + #{peopleUserSex}, + #{peopleUserBirthday}, + #{peopleUserAppId}, + #{peopleUserCard}, + + + + + + + update people_user + + PU_PEOPLE_ID=#{peopleId}, + PU_REAL_NAME=#{peopleUserRealName}, + PU_ADDRESS=#{peopleUserAddress}, + PU_ICON=#{peopleUserIcon}, + PU_NICKNAME=#{peopleUserNickName}, + PU_SEX=#{peopleUserSex}, + PU_BIRTHDAY=#{peopleUserBirthday}, + PU_CARD=#{peopleUserCard}, + + where PU_PEOPLE_ID = #{peopleId} + + + + + + + + + + + delete from people_user where pu_people_id = #{id} + + + + + + delete from people_user + + pu_people_id in #{item} + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/people/dao/IPeopleWebsiteModelDao.java b/src/main/java/com/mingsoft/people/dao/IPeopleWebsiteModelDao.java new file mode 100644 index 00000000..a77cfe52 --- /dev/null +++ b/src/main/java/com/mingsoft/people/dao/IPeopleWebsiteModelDao.java @@ -0,0 +1,55 @@ +package com.mingsoft.people.dao; + +import com.mingsoft.base.dao.IBaseDao; +import com.mingsoft.people.entity.PeopleWebsiteModelEntity; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments: 用户站点模块持久化层接口,继承IBaseDao接口 + *

+ * + *

+ * Create Date:2014-9-11 + *

+ * + *

+ * Modification history: + *

+ */ +public interface IPeopleWebsiteModelDao extends IBaseDao { + + /** + * 根据用户站点模块实体删除据用户站点模块字段 + * @param peopleWebsiteModel + */ + public void deleteEntity(PeopleWebsiteModelEntity peopleWebsiteModel ); + + /** + * 根据用户Id删除用户站点模块中间表数据集合 + * @param peopleId + */ + public void deleteByPeopleId(int peopleId); + +} diff --git a/src/main/java/com/mingsoft/people/dao/IPeopleWebsiteModelDao.xml b/src/main/java/com/mingsoft/people/dao/IPeopleWebsiteModelDao.xml new file mode 100644 index 00000000..89a3899f --- /dev/null +++ b/src/main/java/com/mingsoft/people/dao/IPeopleWebsiteModelDao.xml @@ -0,0 +1,58 @@ + + + + + + + pwm_peopleid,pwm_websiteid,pwm_modelid + + + + + + + + + + + + + insert into people_website_model + + pwm_peopleid, + pwm_websiteid, + pwm_modelid, + + + #{peopleWebsiteModelPeopleId}, + #{peopleWebsiteModelWebsiteId}, + #{peopleWebsiteModelModelId}, + + + + + + delete from people_website_model where pwm_peopleid = #{peopleWebsiteModelPeopleId} and pwm_websiteid=#{peopleWebsiteModelWebsiteId} and + pwm_modelid=#{peopleWebsiteModelModelId} + + + + + + + delete from people_website_model where pwm_peopleid = #{peopleWebsiteModelPeopleId} + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mingsoft/people/entity/PeopleEntity.java b/src/main/java/com/mingsoft/people/entity/PeopleEntity.java new file mode 100644 index 00000000..91db7d1f --- /dev/null +++ b/src/main/java/com/mingsoft/people/entity/PeopleEntity.java @@ -0,0 +1,325 @@ +package com.mingsoft.people.entity; + +import java.sql.Timestamp; +import java.util.Date; + +import com.mingsoft.base.entity.SessionEntity; +import com.mingsoft.base.constant.e.BaseEnum; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 姓名:张敏 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:用户基础表 + *

+ * + *

+ * Create Date:2014-7-29 + *

+ * + *

+ * Modification history: + *

+ */ +public class PeopleEntity extends SessionEntity { + + /** + * 自增长ID + */ + private int peopleId; + + /** + * 用户电话
+ * 可用作登录
+ */ + private String peoplePhone; + + /** + * 用户邮箱
+ * 可用作登录
+ */ + private String peopleMail; + + /** + * 登录帐号 + */ + private String peopleName; + + /** + * 登录密码 + */ + private String peoplePassword; + + /** + * 用户所属的应用ID + */ + private int peopleAppId; + + /** + * 注册时间 + */ + private Date peopleDateTime; + + /** + * 用户状态 + * 1.已审核 + * 0.未审核 + */ + private int peopleState; + + /** + * 用户随机验证码 + */ + private String peopleCode; + + /** + * 发送验证码的时间 + */ + private Timestamp peopleCodeSendDate; + + /** + * 是否通过邮箱验证 + */ + private int peopleMailCheck; + + /** + * 是否通过手机验证 + */ + private int peoplePhoneCheck; + + /** + * 用户真信息 + */ + private PeopleUserEntity peopleUser; + + public PeopleUserEntity getPeopleUser() { + return peopleUser; + } + + + public void setPeopleUser(PeopleUserEntity peopleUser) { + this.peopleUser = peopleUser; + } + + + /** + * 获取peopleState + * @return peopleState + */ + public int getPeopleState() { + return peopleState; + } + + + /** + * 设置peopleState,控制层推荐使用setPeopleState(BaseEnum e) 方法 + * @see setPeopleState(BaseEnum e) + * @param peopleState + */ + public void setPeopleState(int peopleState) { + this.peopleState = peopleState; + } + /** + * 设置peopleState + * @param peopleState + */ + public void setPeopleState(BaseEnum e) { + this.peopleState = e.toInt(); + } + + + /** + * 获取peopleId + * @return peopleId + */ + public int getPeopleId() { + return peopleId; + } + + /** + * 设置peopleId + * @param peopleId + */ + public void setPeopleId(int peopleId) { + this.peopleId = peopleId; + } + + /** + * 获取peoplePhone + * @return peoplePhone + */ + public String getPeoplePhone() { + return peoplePhone; + } + + /** + * 设置peoplePhone + * @param peoplePhone + */ + public void setPeoplePhone(String peoplePhone) { + this.peoplePhone = peoplePhone; + } + + /** + * 获取peopleMail + * @return peopleMail + */ + public String getPeopleMail() { + return peopleMail; + } + + /** + * 设置peopleMail + * @param peopleMail + */ + public void setPeopleMail(String peopleMail) { + this.peopleMail = peopleMail; + } + + /** + * 获取peopleName + * @return peopleName + */ + public String getPeopleName() { + return peopleName; + } + + /** + * 设置peopleName + * @param peopleName + */ + public void setPeopleName(String peopleName) { + this.peopleName = peopleName; + } + + /** + * 获取peoplePassword + * @return peoplePassword + */ + public String getPeoplePassword() { + return peoplePassword; + } + + /** + * 设置peoplePwd + * @param peoplePassword + */ + public void setPeoplePassword(String peoplePassword) { + this.peoplePassword = peoplePassword; + } + + /** + * 获取peopleAppId + * @return peopleAppId + */ + public int getPeopleAppId() { + return peopleAppId; + } + + /** + * 设置peopleAppId + * @param peopleAppId + */ + public void setPeopleAppId(int peopleAppId) { + this.peopleAppId = peopleAppId; + } + + /** + * 获取peopleDateTime + * @return peopleDateTime + */ + public Date getPeopleDateTime() { + return peopleDateTime; + } + + /** + * 设置peopleDateTime + * @param peopleDateTime + */ + public void setPeopleDateTime(Date peopleDateTime) { + this.peopleDateTime = peopleDateTime; + } + + /** + * 获取用户随机码 + * @return + */ + public String getPeopleCode() { + return peopleCode; + } + + /** + * 设置用户随机码 + * @param peopleCode + */ + public void setPeopleCode(String peopleCode) { + this.peopleCode = peopleCode; + } + + + public Timestamp getPeopleCodeSendDate() { + return peopleCodeSendDate; + } + + + public void setPeopleCodeSendDate(Timestamp peopleCodeSendDate) { + this.peopleCodeSendDate = peopleCodeSendDate; + } + + + public int getPeopleMailCheck() { + return peopleMailCheck; + } + + + /** + * 推荐使用枚举类形参方法 + * @param peopleMailCheck + */ + @Deprecated + public void setPeopleMailCheck(int peopleMailCheck) { + this.peopleMailCheck = peopleMailCheck; + } + public void setPeopleMailCheck(BaseEnum check) { + this.peopleMailCheck = check.toInt(); + } + + public int getPeoplePhoneCheck() { + return peoplePhoneCheck; + } + + /** + * 推荐使用枚举类形参方法 + * @param peoplePhoneCheck + */ + @Deprecated + public void setPeoplePhoneCheck(int peoplePhoneCheck) { + this.peoplePhoneCheck = peoplePhoneCheck; + } + + public void setPeoplePhoneCheck(BaseEnum check) { + this.peoplePhoneCheck = check.toInt(); + } + + +} diff --git a/src/main/java/com/mingsoft/people/entity/PeopleUserEntity.java b/src/main/java/com/mingsoft/people/entity/PeopleUserEntity.java new file mode 100644 index 00000000..a07951d2 --- /dev/null +++ b/src/main/java/com/mingsoft/people/entity/PeopleUserEntity.java @@ -0,0 +1,239 @@ +package com.mingsoft.people.entity; + +import java.util.Date; + +/** + * + * + *

+ * 铭飞CMS-铭飞内容管理系统 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 刘继平 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:用户基础信息 + *

+ * + *

+ * Create Date:2014-9-4 + *

+ * + *

+ * Modification history: + *

+ */ +public class PeopleUserEntity extends PeopleEntity { + + /** + * 关联用户编号 + */ + private int peopleUserPeopleId; + + /** + * 用户的真实名称 + */ + private String peopleUserRealName; + + /** + * 用户地址 + */ + private String peopleUserAddress; + + /** + * 用户头像 + */ + private String peopleUserIcon; + + /** + * 用户昵称 + */ + private String peopleUserNickName; + + /** + * 用户性别
+ * 0.未知
+ * 1.男
+ * 2.女
+ */ + private int peopleUserSex = 1; + + /** + * 用户生日 + */ + private Date peopleUserBirthday; + + /** + * 用户身份证号码 + */ + private String peopleUserCard; + + + + /** + * 用户所属应用ID + */ + private int peopleUserAppId; + + /** + * 获取peopleUserRealName + * @return peopleUserRealName + */ + public String getPeopleUserRealName() { + return peopleUserRealName; + } + + /** + * 设置peopleUserRealName + * @param peopleUserRealName + */ + public void setPeopleUserRealName(String peopleUserRealName) { + this.peopleUserRealName = peopleUserRealName; + } + + /** + * 获取peopleUserAddress + * @return peopleUserAddress + */ + public String getPeopleUserAddress() { + return peopleUserAddress; + } + + /** + * 设置peopleUserAddress + * @param peopleUserAddress + */ + public void setPeopleUserAddress(String peopleUserAddress) { + this.peopleUserAddress = peopleUserAddress; + } + + /** + * 获取peopleUserIcon + * @return peopleUserIcon + */ + public String getPeopleUserIcon() { + return peopleUserIcon; + } + + /** + * 设置peopleUserIcon + * @param peopleUserIcon + */ + public void setPeopleUserIcon(String peopleUserIcon) { + this.peopleUserIcon = peopleUserIcon; + } + + /** + * 获取peopleUserNickName + * @return peopleUserNickName + */ + public String getPeopleUserNickName() { + return peopleUserNickName; + } + + /** + * 设置peopleUserNickName + * @param peopleUserNickName + */ + public void setPeopleUserNickName(String peopleUserNickName) { + this.peopleUserNickName = peopleUserNickName; + } + + /** + * 获取peopleUserSex + * @return peopleUserSex + */ + public int getPeopleUserSex() { + return peopleUserSex; + } + + /** + * 设置peopleUserSex + * @param peopleUserSex + */ + public void setPeopleUserSex(int peopleUserSex) { + if (peopleUserSex%2==0) { + this.peopleUserSex = 2; + } else { + this.peopleUserSex = 1; + } + + } + + /** + * 获取peopleUserBirthday + * @return peopleUserBirthday + */ + public Date getPeopleUserBirthday() { + return peopleUserBirthday; + } + + /** + * 设置peopleUserBirthday + * @param peopleUserBirthday + */ + public void setPeopleUserBirthday(Date peopleUserBirthday) { + this.peopleUserBirthday = peopleUserBirthday; + } + + /** + * 获取peopleUserAppId + * @return peopleUserAppId + */ + public int getPeopleUserAppId() { + return peopleUserAppId; + } + + /** + * 设置peopleUserAppId + * @param peopleUserAppId + */ + public void setPeopleUserAppId(int peopleUserAppId) { + this.peopleUserAppId = peopleUserAppId; + } + + /** + * 设置xu + * @return + */ + public int getPeopleUserPeopleId() { + return peopleUserPeopleId; + } + + public void setPeopleUserPeopleId(int peopleUserPeopleId) { + this.peopleUserPeopleId = peopleUserPeopleId; + } + + /** + * 获取用户身份证号码 + * @return + */ + public String getPeopleUserCard() { + return peopleUserCard; + } + + /** + *设置用户身份证号码 + * @param peopleUserCard + */ + public void setPeopleUserCard(String peopleUserCard) { + this.peopleUserCard = peopleUserCard; + } + + + +} diff --git a/src/main/java/com/mingsoft/people/entity/PeopleWebsiteModelEntity.java b/src/main/java/com/mingsoft/people/entity/PeopleWebsiteModelEntity.java new file mode 100644 index 00000000..e6d8ab39 --- /dev/null +++ b/src/main/java/com/mingsoft/people/entity/PeopleWebsiteModelEntity.java @@ -0,0 +1,56 @@ +package com.mingsoft.people.entity; + +import com.mingsoft.base.entity.BaseEntity; + +/** + * + * 用户站点模块实体类,继承BaseEntity实体 + * @author 刘继平 + * @version + * 版本号:100-000-000
+ * 创建日期:2014-9-11
+ * 历史修订:
+ */ +public class PeopleWebsiteModelEntity extends BaseEntity { + + /** + * 用户站点模块的用户ID + */ + private int peopleWebsiteModelPeopleId; + + /** + * 用户站点模块的站点ID + */ + private int peopleWebsiteModelWebsiteId; + + /** + * 用户站点模块的模块ID + */ + private int peopleWebsiteModelModelId; + + public int getPeopleWebsiteModelPeopleId() { + return peopleWebsiteModelPeopleId; + } + + public void setPeopleWebsiteModelPeopleId(int peopleWebsiteModelPeopleId) { + this.peopleWebsiteModelPeopleId = peopleWebsiteModelPeopleId; + } + + public int getPeopleWebsiteModelWebsiteId() { + return peopleWebsiteModelWebsiteId; + } + + public void setPeopleWebsiteModelWebsiteId(int peopleWebsiteModelWebsiteId) { + this.peopleWebsiteModelWebsiteId = peopleWebsiteModelWebsiteId; + } + + public int getPeopleWebsiteModelModelId() { + return peopleWebsiteModelModelId; + } + + public void setPeopleWebsiteModelModelId(int peopleWebsiteModelModelId) { + this.peopleWebsiteModelModelId = peopleWebsiteModelModelId; + } + + +} diff --git a/src/main/java/com/mingsoft/people/resources/resources.properties b/src/main/java/com/mingsoft/people/resources/resources.properties new file mode 100644 index 00000000..51786de9 --- /dev/null +++ b/src/main/java/com/mingsoft/people/resources/resources.properties @@ -0,0 +1,52 @@ +#----------\u7528\u6237\u6a21\u5757------- +people = \u7528\u6237 +people.username = \u7528\u6237\u540d +people.password = \u5bc6\u7801 +people.phone = \u624b\u673a\u53f7 +people.mail = \u90ae\u7bb1 +people.login = \u767b\u9646 +people.register= \u6ce8\u518c +people.get.password=\u53d6\u56de\u5bc6\u7801 +people.set.phone=\u66f4\u6539\u624b\u673a\u53f7\u7801 +peopleCode=\u968f\u673a\u7801 +people.card=\u8eab\u4efd\u8bc1\u53f7\u7801 + +#---------------\u6ce8\u518c\u7528\u6237\u65f6\u90ae\u7bb1\u53d1\u9001\u5185\u5bb9----- +people.register.title=\u6ce8\u518c\u9a8c\u8bc1 +people.register.content=\u6ce8\u518c\u9a8c\u8bc1\u7801 +peopleImageCode=\u9a8c\u8bc1\u7801 + +#\u4ee5\u4e0b\u53ef\u4ee5\u4f18\u5316 +people.msg.null.error=\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\! +people.msg.error=\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\! +people.msg.name.error=\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a,\u5e76\u4e14\u957f\u5ea6\u57283-12\u4e2a\u5b57\u7b26\u4e4b\u95f4\! +people.msg.phone.error=\u624b\u673a\u53f7\u4e3a\u7a7a\u6216\u683c\u5f0f\u9519\u8bef\! +people.msg.mail.error=\u90ae\u7bb1\u4e3a\u7a7a\u6216\u8005\u683c\u5f0f\u9519\u8bef\! +people.msg.code.error=\u60a8\u7684\u9a8c\u8bc1\u7801\u5df2\u8fc7\u671f\uff01 +people.msg.password.error=\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a,\u5e76\u4e14\u957f\u5ea6\u57286-30\u4e2a\u5b57\u7b26\u4e4b\u95f4\! +people.msg.current.password.error=\u5f53\u524d\u5bc6\u7801\u9519\u8bef + +people.register.msg.name.repeat.error=\u7528\u6237\u540d\u5df2\u7ecf\u5b58\u5728,\u8bf7\u91cd\u65b0\u8f93\u5165\! +people.reset.msg.name.phone.null.error=\u7528\u6237\u540d\u548c\u624b\u673a\u53f7\u4e0d\u5339\u914d\! +people.reset.msg.name.phone.error=\u624b\u673a\u9a8c\u8bc1\u672a\u901a\u8fc7 +people.reset.msg.name.mail.error=\u90ae\u7bb1\u9a8c\u8bc1\u672a\u901a\u8fc7 +people.register.msg.phone.repeat.error=\u624b\u673a\u53f7\u5df2\u7ecf\u5b58\u5728,\u8bf7\u91cd\u65b0\u8f93\u5165\! +people.register.msg.mail.repeat.error=\u8be5\u90ae\u7bb1\u5df2\u7ecf\u5b58\u5728,\u8bf7\u91cd\u65b0\u8f93\u5165\! +people.register.msg.type.error=\u6ce8\u518c\u7c7b\u578b\u9519\u8bef\! +people.register.msg.success=\u6ce8\u518c\u6210\u529f\! + +people.check.login.msg.success=\u767b\u5f55\u6210\u529f\! + +people.change.password.msg.success=\u5bc6\u7801\u4fee\u6539\u6210\u529f\! + +people.quit.msg.success=\u9000\u51fa\u6210\u529f\! + +people.session.msg.null.error=\u8be5\u7528\u6237\u8fd8\u672a\u767b\u5f55,\u8bf7\u5148\u767b\u5f55\! + +people.user.msg.null.error=\u8bf7\u586b\u5199\u4fe1\u606f\! +people.user.save.msg.success=\u65b0\u589e\u7528\u6237\u8be6\u7ec6\u4fe1\u606f\u6210\u529f\! +people.user.update.msg.success=\u66f4\u65b0\u7528\u6237\u8be6\u7ec6\u4fe1\u606f\u6210\u529f\! +people.session.name.mismatch.error=\u8bf7\u8f93\u5165\u5f53\u524d\u767b\u5f55\u7684\u7528\u6237\u540d\uff01 + +people.msg.mail.format.error=\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef +people.msg.phone.format.error=\u624b\u673a\u53f7\u7801\u683c\u5f0f\u9519\u8bef \ No newline at end of file diff --git a/src/main/java/com/mingsoft/people/servlet/LoginServlet.java b/src/main/java/com/mingsoft/people/servlet/LoginServlet.java new file mode 100644 index 00000000..bb519028 --- /dev/null +++ b/src/main/java/com/mingsoft/people/servlet/LoginServlet.java @@ -0,0 +1,159 @@ +package com.mingsoft.people.servlet; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +import com.mingsoft.people.biz.IPeopleBiz; + +import com.alibaba.fastjson.JSONObject; +import com.mingsoft.basic.biz.IAppBiz; +import com.mingsoft.basic.biz.IModelBiz; +import com.mingsoft.basic.biz.IModelTemplateBiz; +import com.mingsoft.basic.entity.AppEntity; +import com.mingsoft.basic.entity.ModelTemplateEntity; +import com.mingsoft.people.entity.PeopleEntity; +import com.mingsoft.basic.servlet.BaseServlet; +import com.mingsoft.cms.parser.CmsParser; +import com.mingsoft.base.constant.Const; +import com.mingsoft.base.constant.CookieConst; +import com.mingsoft.base.constant.ModelCode; +import com.mingsoft.base.constant.SessionConst; +import com.mingsoft.parser.IParserRegexConstant; +import com.mingsoft.util.FileUtil; +import com.mingsoft.util.StringUtil; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 QQ:78750478 + * + *

+ * Comments:用户登陆servlet + *

+ * + *

+ * Create Date:2014-11-10 + *

+ * + *

+ * Modification history: + *

+ */ +@WebServlet(urlPatterns = "/servlet/login") +public class LoginServlet extends BaseServlet { + + /** + * 应用 + */ + private IAppBiz appBiz; + + /** + * 模块模版 + */ + private IModelTemplateBiz modelTemplateBiz; + + /** + * 模块R + */ + private IModelBiz modelBiz; + + /** + * 用户 + */ + private IPeopleBiz peopleBiz; + + /** + * 文章解析器 + */ + private CmsParser cmsParser; + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + resp.setCharacterEncoding(Const.UTF8); + appBiz = (IAppBiz) this.getBean(req.getServletContext(), "appBiz"); + modelTemplateBiz = (IModelTemplateBiz) this.getBean(req.getServletContext(), "modelTemplateBiz"); + modelBiz = (IModelBiz) this.getBean(req.getServletContext(), "modelBiz"); + + AppEntity app = this.getApp(req, appBiz); + if (app == null) { + this.outString(resp, this.getResString("err")); + return; + } + ModelTemplateEntity mte = modelTemplateBiz.getEntity(app.getAppId(), modelBiz.getEntityByModelCode(ModelCode.PEOPLE_LOGIN).getModelId(),"login"); + if (mte == null) { + return; + } + String templatePath = mte.getModelTemplatePath(); + String path = getRealPath(req, IParserRegexConstant.REGEX_SAVE_TEMPLATE) + File.separator + app.getAppId() + File.separator + app.getAppStyle() + File.separator; + String content = ""; + if (this.isMobileDevice(req)) { // 移动端 + path = path + app.getAppMobileStyle() + File.separator; + } + String htmlContent = FileUtil.readFile(path + templatePath); // 读取模版文件内容 + content = cmsParser.parse(htmlContent,app); + this.outString(resp, content); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + appBiz = (IAppBiz) this.getBean(request.getServletContext(), "appBiz"); + String userName = request.getParameter("userName"); + String passWord = request.getParameter("passWord"); + + // 根据应用ID和用户名查询用户密码 + AppEntity app = this.getApp(request, appBiz); + if (app==null) { + this.outString(response,this.getResString("err")); + } + // 用户名和密码不能为空 + if (StringUtil.isBlank(userName)) { + this.outJson(response,ModelCode.PEOPLE_LOGIN, false, this.getResString("err.empty",this.getResString("people.username"))); + return; + } + if (StringUtil.isBlank(passWord)) { + this.outJson(response,ModelCode.PEOPLE_LOGIN, false, this.getResString("err.empty",this.getResString("people.password"))); + } + + PeopleEntity peopleEntity = this.peopleBiz.getEntityByUserName(userName, app.getAppId()); + if (peopleEntity == null) { + // 用户名或密码错误 + this.outJson(response,ModelCode.PEOPLE_LOGIN, false, this.getResString("err.not.exist","people")); + return; + } + // 将用户输入的密码用MD5加密再和数据库中的进行比对 + String peoplePassWord = StringUtil.Md5(passWord); + if (peoplePassWord.equals(peopleEntity.getPeoplePassword())) { + // 登录成功,压入用户session + this.setSession(request, SessionConst.PEOPLE_SESSION, peopleEntity); + // 构建返回给页面的json + Map mapJson = new HashMap(); + mapJson.put("userName", peopleEntity.getPeopleName()); + mapJson.put("phone", peopleEntity.getPeoplePhone()); + mapJson.put("mail", peopleEntity.getPeopleMail()); + // 将用户信息压入到cookie中 + this.setCookie(request, response, CookieConst.PEOPLE_COOKIE, JSONObject.toJSONString(mapJson)); + this.outJson(response, ModelCode.PEOPLE_LOGIN, true, JSONObject.toJSONString(mapJson), this.getResString("people.check.login.data.success")); + } else { + // 用户名或密码错误 + this.outJson(response, ModelCode.PEOPLE_LOGIN, false, this.getResString("people.msg.error"), this.getResString("people.data.error")); + } + } +} diff --git a/src/main/java/com/mingsoft/util/AESUtil.java b/src/main/java/com/mingsoft/util/AESUtil.java new file mode 100644 index 00000000..2a786c49 --- /dev/null +++ b/src/main/java/com/mingsoft/util/AESUtil.java @@ -0,0 +1,140 @@ +package com.mingsoft.util; + +import java.io.UnsupportedEncodingException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.SecretKeySpec; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 QQ:78750478 + * + *

+ * Comments: aes加密 + *

+ * + *

+ * Create Date:2015-1-20 + *

+ * + *

+ * Modification history: + *

+ */ +public class AESUtil { + public static String decrypt(String sSrc, String sKey) { + try { + // 判断Key是否正确 + if (sKey == null) { + System.out.print("Key为空null"); + return null; + } + // 判断Key是否为16位 + if (sKey.length() != 16) { + System.out.print("Key长度不是16位"); + return null; + } + byte[] raw = sKey.getBytes("ASCII"); + SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); + Cipher cipher = Cipher.getInstance("AES"); + cipher.init(Cipher.DECRYPT_MODE, skeySpec); + byte[] encrypted1 = hex2byte(sSrc); + try { + byte[] original = cipher.doFinal(encrypted1); + String originalString = new String(original); + return originalString; + } catch (Exception e) { + System.out.println(e.toString()); + return null; + } + } catch (Exception ex) { + System.out.println(ex.toString()); + return null; + } + } + + // 判断Key是否正确 + public static String encrypt(String sSrc, String sKey) { + if (sKey == null) { + System.out.print("Key为空null"); + return null; + } + // 判断Key是否为16位 + if (sKey.length() != 16) { + System.out.print("Key长度不是16位"); + return null; + } + byte[] encrypted = null; + try { + byte[] raw = sKey.getBytes("ASCII"); + SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); + Cipher cipher = Cipher.getInstance("AES"); + cipher.init(Cipher.ENCRYPT_MODE, skeySpec); + encrypted = cipher.doFinal(sSrc.getBytes()); + } catch (UnsupportedEncodingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchPaddingException e) { + e.printStackTrace(); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (InvalidKeyException e) { + e.printStackTrace(); + } catch (IllegalBlockSizeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (BadPaddingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return byte2hex(encrypted).toLowerCase(); + } + + public static byte[] hex2byte(String strhex) { + if (strhex == null) { + return null; + } + int l = strhex.length(); + if (l % 2 == 1) { + return null; + } + byte[] b = new byte[l / 2]; + for (int i = 0; i != l / 2; i++) { + b[i] = (byte) Integer.parseInt(strhex.substring(i * 2, i * 2 + 2), 16); + } + return b; + } + + public static String byte2hex(byte[] b) { + if (b == null) { + return ""; + } + String hs = ""; + String stmp = ""; + for (int n = 0; n < b.length; n++) { + stmp = (java.lang.Integer.toHexString(b[n] & 0XFF)); + if (stmp.length() == 1) { + hs = hs + "0" + stmp; + } else { + hs = hs + stmp; + } + } + return hs.toUpperCase(); + } +} diff --git a/src/main/java/com/mingsoft/util/Base64Util.java b/src/main/java/com/mingsoft/util/Base64Util.java new file mode 100644 index 00000000..1d14f9fb --- /dev/null +++ b/src/main/java/com/mingsoft/util/Base64Util.java @@ -0,0 +1,386 @@ +package com.mingsoft.util; + +import org.apache.commons.codec.binary.Base64; + +/** + * + * + * + *

+ * 铭飞科技流量推广软件 + *

+ * + *

+ * Copyright: Copyright (c) 2013 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author killfen + * + * @version 100-000-000 + * + *

+ * 版权所有 + *

+ * + *

+ * Comments:java base64加密&解密通用方法 + *

+ * + *

+ * Create Date:2013-9-11 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public class Base64Util { + + static private final int BASELENGTH = 255; + static final private byte[] base64Alphabet = new byte[BASELENGTH]; + + static private final int EIGHTBIT = 8; + static private final boolean fDebug = false; + static private final int FOURBYTE = 4; + static private final int LOOKUPLENGTH = 64; + static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH]; + static private final char PAD = '='; + static private final int SIGN = -128; + static private final int SIXBIT = 6; + static private final int SIXTEENBIT = 16; + static private final int TWENTYFOURBITGROUP = 24; + static { + + for (int i = 0; i < BASELENGTH; i++) { + base64Alphabet[i] = -1; + } + for (int i = 'Z'; i >= 'A'; i--) { + base64Alphabet[i] = (byte) (i - 'A'); + } + for (int i = 'z'; i >= 'a'; i--) { + base64Alphabet[i] = (byte) (i - 'a' + 26); + } + + for (int i = '9'; i >= '0'; i--) { + base64Alphabet[i] = (byte) (i - '0' + 52); + } + + base64Alphabet['+'] = 62; + base64Alphabet['/'] = 63; + + for (int i = 0; i <= 25; i++) + lookUpBase64Alphabet[i] = (char) ('A' + i); + + for (int i = 26, j = 0; i <= 51; i++, j++) + lookUpBase64Alphabet[i] = (char) ('a' + j); + + for (int i = 52, j = 0; i <= 61; i++, j++) + lookUpBase64Alphabet[i] = (char) ('0' + j); + lookUpBase64Alphabet[62] = (char) '+'; + lookUpBase64Alphabet[63] = (char) '/'; + + } + + /** + * Decodes Base64 data into octects + * + * @param binaryData + * Byte array containing Base64 data + * @return Array containind decoded data. + */ + public static byte[] decode(String encoded) { + + if (encoded == null) + return null; + + char[] base64Data = encoded.toCharArray(); + // remove white spaces + int len = removeWhiteSpace(base64Data); + + if (len % FOURBYTE != 0) { + return null;// should be divisible by four + } + + int numberQuadruple = (len / FOURBYTE); + + if (numberQuadruple == 0) + return new byte[0]; + + byte decodedData[] = null; + byte b1 = 0, b2 = 0, b3 = 0, b4 = 0, marker0 = 0, marker1 = 0; + char d1 = 0, d2 = 0, d3 = 0, d4 = 0; + + int i = 0; + int encodedIndex = 0; + int dataIndex = 0; + decodedData = new byte[(numberQuadruple) * 3]; + + for (; i < numberQuadruple - 1; i++) { + + if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++])) || !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++]))) + return null;// if found "no data" just return null + + b1 = base64Alphabet[d1]; + b2 = base64Alphabet[d2]; + b3 = base64Alphabet[d3]; + b4 = base64Alphabet[d4]; + + decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); + } + + if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) { + return null;// if found "no data" just return null + } + + b1 = base64Alphabet[d1]; + b2 = base64Alphabet[d2]; + + d3 = base64Data[dataIndex++]; + d4 = base64Data[dataIndex++]; + if (!isData((d3)) || !isData((d4))) {// Check if they are PAD characters + if (isPad(d3) && isPad(d4)) { // Two PAD e.g. 3c[Pad][Pad] + if ((b2 & 0xf) != 0)// last 4 bits should be zero + return null; + byte[] tmp = new byte[i * 3 + 1]; + System.arraycopy(decodedData, 0, tmp, 0, i * 3); + tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4); + return tmp; + } else if (!isPad(d3) && isPad(d4)) { // One PAD e.g. 3cQ[Pad] + b3 = base64Alphabet[d3]; + if ((b3 & 0x3) != 0)// last 2 bits should be zero + return null; + byte[] tmp = new byte[i * 3 + 2]; + System.arraycopy(decodedData, 0, tmp, 0, i * 3); + tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + return tmp; + } else { + return null;// an error like "3c[Pad]r", "3cdX", "3cXd", "3cXX" + // where X is non data + } + } else { // No PAD e.g 3cQl + b3 = base64Alphabet[d3]; + b4 = base64Alphabet[d4]; + decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); + + } + + return decodedData; + } + + /** + * Encodes hex octects into Base64 + * + * @param binaryData + * Array containing binaryData + * @return Encoded Base64 array + */ + public static String encode(byte[] binaryData) { + + if (binaryData == null) + return null; + + int lengthDataBits = binaryData.length * EIGHTBIT; + if (lengthDataBits == 0) { + return ""; + } + + int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP; + int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP; + int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets; + int numberLines = (numberQuartet - 1) / 19 + 1; + char encodedData[] = null; + + encodedData = new char[numberQuartet * 4 + numberLines]; + + byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0; + + int encodedIndex = 0; + int dataIndex = 0; + int i = 0; + if (fDebug) { + System.out.println("number of triplets = " + numberTriplets); + } + + for (int line = 0; line < numberLines - 1; line++) { + for (int quartet = 0; quartet < 19; quartet++) { + b1 = binaryData[dataIndex++]; + b2 = binaryData[dataIndex++]; + b3 = binaryData[dataIndex++]; + + if (fDebug) { + System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3); + } + + l = (byte) (b2 & 0x0f); + k = (byte) (b1 & 0x03); + + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + + byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0); + byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc); + + if (fDebug) { + System.out.println("val2 = " + val2); + System.out.println("k4 = " + (k << 4)); + System.out.println("vak = " + (val2 | (k << 4))); + } + + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f]; + + i++; + } + encodedData[encodedIndex++] = 0xa; + } + + for (; i < numberTriplets; i++) { + b1 = binaryData[dataIndex++]; + b2 = binaryData[dataIndex++]; + b3 = binaryData[dataIndex++]; + + if (fDebug) { + System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3); + } + + l = (byte) (b2 & 0x0f); + k = (byte) (b1 & 0x03); + + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + + byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0); + byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc); + + if (fDebug) { + System.out.println("val2 = " + val2); + System.out.println("k4 = " + (k << 4)); + System.out.println("vak = " + (val2 | (k << 4))); + } + + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f]; + } + + // form integral number of 6-bit groups + if (fewerThan24bits == EIGHTBIT) { + b1 = binaryData[dataIndex]; + k = (byte) (b1 & 0x03); + if (fDebug) { + System.out.println("b1=" + b1); + System.out.println("b1<<2 = " + (b1 >> 2)); + } + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4]; + encodedData[encodedIndex++] = PAD; + encodedData[encodedIndex++] = PAD; + } else if (fewerThan24bits == SIXTEENBIT) { + b1 = binaryData[dataIndex]; + b2 = binaryData[dataIndex + 1]; + l = (byte) (b2 & 0x0f); + k = (byte) (b1 & 0x03); + + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0); + + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2]; + encodedData[encodedIndex++] = PAD; + } + + encodedData[encodedIndex] = 0xa; + + return new String(encodedData); + } + + /** + * 用base64位加密 + * + * @param bytes + * 字符串子节数组 + * @return 加密后的字符串 + */ + public static String getBASE64(byte[] bytes) { + byte[] s = null; + if (bytes != null) { + s = Base64.encodeBase64(bytes); + } + return new String(s); + } + + /** + * 解密 + * + * @param str + * 需要解密的base64为字符串 + * @return 解密后的字符串字节数组 + */ + public static byte[] getFromBASE64(String str) { + byte[] b = null; + if (str != null) { + try { + b = Base64.encodeBase64(str.getBytes()); + return b; + } catch (Exception e) { + e.printStackTrace(); + } + } + return b; + } + + protected static boolean isBase64(char octect) { + return (isWhiteSpace(octect) || isPad(octect) || isData(octect)); + } + + protected static boolean isData(char octect) { + return (base64Alphabet[octect] != -1); + } + + protected static boolean isPad(char octect) { + return (octect == PAD); + } + + protected static boolean isWhiteSpace(char octect) { + return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9); + } + + public static void main(String[] args) { + String str = "asfd"; + System.out.println(Base64Util.getBASE64(str.getBytes())); + } + + /** + * remove WhiteSpace from MIME containing encoded Base64 data. + * + * @param data + * the byte array of base64 data (with WS) + * @return the new length + */ + protected static int removeWhiteSpace(char[] data) { + if (data == null) + return 0; + + // count characters that's not whitespace + int newSize = 0; + int len = data.length; + for (int i = 0; i < len; i++) { + if (!isWhiteSpace(data[i])) + data[newSize++] = data[i]; + } + return newSize; + } + +} diff --git a/src/main/java/com/mingsoft/util/DateUtil.java b/src/main/java/com/mingsoft/util/DateUtil.java new file mode 100644 index 00000000..71ef91c8 --- /dev/null +++ b/src/main/java/com/mingsoft/util/DateUtil.java @@ -0,0 +1,1015 @@ +package com.mingsoft.util; + + +import java.sql.Timestamp; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + + +/** + * + * + * + *

+ * 铭飞科技J2EE基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2013 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author killfen + * + * @version 100-000-000 + * + *

+ * 版权所有 + *

+ * + *

+ * Comments:日期通用处理类 + *

+ * + *

+ * Create Date:2013-9-2 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public class DateUtil { + + private int year; + + private int month; + + private int day; + + private int hour; + + private int minute; + + private int second; + + private static final int[] dayArray = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };// 每月的天数 + + /** + * 标准日期格式 MM/dd/yyyy + */ + public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("MM/dd/yyyy"); + + /** + * 标准时间格式 MM/dd/yyyy HH:mm + */ + public static final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("MM/dd/yyyy HH:mm"); + + /** + * 带时分秒的标准时间格式 MM/dd/yyyy HH:mm:ss + */ + public static final SimpleDateFormat DATE_TIME_EXTENDED_FORMAT = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); + + /** + * ORA标准日期格式 yyyyMMdd + */ + public static final SimpleDateFormat ORA_DATE_FORMAT = new SimpleDateFormat("yyyyMMdd"); + + /** + * ORA标准时间格式 yyyyMMddHHmm + */ + public static final SimpleDateFormat ORA_DATE_TIME_FORMAT = new SimpleDateFormat("yyyyMMddHHmm"); + + /** + * 带时分秒的ORA标准时间格式 yyyyMMddHHmmss + */ + public static final SimpleDateFormat ORA_DATE_TIME_EXTENDED_FORMAT = new SimpleDateFormat("yyyyMMddHHmmss"); + + /** + * yyyy-MM-dd + */ + public static final SimpleDateFormat CHN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + /** + * yyyy-MM-dd HH:mm + */ + public static final SimpleDateFormat CHN_DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + + /** + * yyyy-MM-dd HH:mm:ss + */ + public static final SimpleDateFormat CHN_DATE_TIME_EXTENDED_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + /** 年月日时分秒(无下划线) yyyyMMddHHmmss */ + public static final String dtLong = "yyyyMMddHHmmss"; + + /** 完整时间 yyyy-MM-dd HH:mm:ss */ + public static final String simple = "yyyy-MM-dd HH:mm:ss"; + + /** 年月日(无下划线) yyyyMMdd */ + public static final String dtShort = "yyyyMMdd"; + + + /** + * 返回系统当前时间(精确到毫秒)
+ * @return + * 以yyyyMMddHHmmss为格式的当前系统时间 + */ + public static String getOrderNum(){ + Date date=new Date(); + DateFormat df=new SimpleDateFormat(dtLong); + return df.format(date); + } + + /** + * 无参构造函数,默认的日期为系统时间 + */ + public DateUtil() { + today(); + } + + /** + * 有参构造函数 + * + * @param String + * inValue 14位日期格式的字符串,不满14位的,后面补0处理
+ * 列:new DataUtil("yyyyMMddHHmmss"); + */ + DateUtil(String inValue) { + SetDate(inValue); + } + + /** + * 有参构造函数 + * + * @param long + * mills 毫秒数
+ */ + public DateUtil(long mills) { + setTimeInMillis(mills); + } + + /** + * 有参构造函数 + * + * @param int + * year 年
+ * @param int + * month 月
+ * @param int + * day 日
+ * @param int + * hour 时
+ * @param int + * minute 分
+ * @param int + * second 秒
+ */ + public DateUtil(int year, int month, int day, int hour, int minute, int second) { + Calendar calendar = Calendar.getInstance(); + calendar.set(year, month - 1, day, hour, minute, second); + this.year = calendar.get(Calendar.YEAR); + this.month = calendar.get(Calendar.MONTH) + 1; + this.day = calendar.get(Calendar.DAY_OF_MONTH); + this.hour = calendar.get(Calendar.HOUR_OF_DAY); + this.minute = calendar.get(Calendar.MINUTE); + this.second = calendar.get(Calendar.SECOND); + + } + + /** + * 设置日期函数 + * + * @param inValue + */ + private void SetDate(String inValue) { + if (inValue.length() != 14) {// 不够14位日期格式的,后面都补0处理 + for (int i = inValue.length(); i < 14; i++) { + inValue = inValue + "0"; + } + System.out.println(inValue); + } + try { + + int year = Integer.parseInt(inValue.substring(0, 4)); + int month = Integer.parseInt(inValue.substring(4, 6)); + int day = Integer.parseInt(inValue.substring(6, 8)); + int hour = Integer.parseInt(inValue.substring(8, 10)); + int minute = Integer.parseInt(inValue.substring(10, 12)); + int second = Integer.parseInt(inValue.substring(12)); + + Calendar calendar = Calendar.getInstance(); + calendar.set(year, month - 1, day, hour, minute, second); + this.year = calendar.get(Calendar.YEAR); + this.month = calendar.get(Calendar.MONTH) + 1; + this.day = calendar.get(Calendar.DAY_OF_MONTH); + this.hour = calendar.get(Calendar.HOUR_OF_DAY); + this.minute = calendar.get(Calendar.MINUTE); + this.second = calendar.get(Calendar.SECOND); + + } catch (Exception e) { + System.out.println(e.getMessage()); + } + } + + /** + * 取得当前时间 + */ + private void today() { + Calendar calendar = Calendar.getInstance(); + this.year = calendar.get(Calendar.YEAR); + this.month = calendar.get(Calendar.MONTH) + 1; + this.day = calendar.get(Calendar.DAY_OF_MONTH); + this.hour = calendar.get(Calendar.HOUR_OF_DAY); + this.minute = calendar.get(Calendar.MINUTE); + this.second = calendar.get(Calendar.SECOND); + } + + /** + * + * 格式化日期 + * + * @param SimpleDateFormat + * df 日期的格式
+ * @return String 字符串日期 + */ + public String format(SimpleDateFormat df) { + Calendar calendar = Calendar.getInstance(); + calendar.set(this.year, this.month - 1, this.day, this.hour, this.minute, this.second); + return df.format(calendar.getTime()); + } + + /** + * toString方法 用yyyy-MM-dd HH:mm:ss格式 + */ + public String toString() { + return this.format(DateUtil.CHN_DATE_TIME_EXTENDED_FORMAT); + } + + public Date getDate() { + + Calendar date = Calendar.getInstance(); + date.set(Calendar.DAY_OF_MONTH, this.getDay()); + date.set(Calendar.MONTH,this.getMonth()-1); + date.set(Calendar.YEAR,this.getYear()); + date.set(Calendar.HOUR_OF_DAY,this.getHour()); + date.set(Calendar.MINUTE,this.getMinute()); + date.set(Calendar.SECOND,this.getSecond()); + return date.getTime(); + + } + + /** + * + * 得到毫秒数 长整型 + * + * @return long + */ + public long getTimeInMillis() { + Calendar calendar = Calendar.getInstance(); + calendar.set(this.year, this.month - 1, this.day, this.hour, this.minute, this.second); + return calendar.getTime().getTime(); + } + + /** + * 根据毫秒数来设置日期 + * + * @param long mills 毫秒数 + */ + public void setTimeInMillis(long mills) { + Date dd = new Date(mills); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(dd); + this.year = calendar.get(Calendar.YEAR); + this.month = calendar.get(Calendar.MONTH) + 1; + this.day = calendar.get(Calendar.DAY_OF_MONTH); + this.hour = calendar.get(Calendar.HOUR_OF_DAY); + this.minute = calendar.get(Calendar.MINUTE); + this.second = calendar.get(Calendar.SECOND); + + } + + /** + * 判断当前年是否是闰年 + * + * @return boolean true:闰年 + */ + public boolean isLeapYear() { + return this.isLeapYear(year); + } + + /** + * 判断是否是闰年 + * + * @param int + * year 年
+ * @return boolean true:闰年 + */ + public boolean isLeapYear(int year) { + if ((year % 400) == 0) + return true; + else if ((year % 4) == 0) { + if ((year % 100) == 0) + return false; + else + return true; + } else + return false; + } + + /** + * 日期增减操作 + * + * @param int + * years 年数
+ * @param int + * months 月数
+ * @param int + * days 日数
+ * @param int + * hours 小时数
+ * @param int + * minutes 分数
+ * @param int + * seconds 秒数
+ */ + public void setDateTime(int years, int months, int days, int hours, int minutes, int seconds) { + Calendar calendar = Calendar.getInstance(); + calendar.set(this.year + years, this.month - 1 + months, this.day + days, this.hour + hours, this.minute + minutes, this.second + seconds); + setTimeInMillis(calendar.getTime().getTime()); + } + + /** + * 年增减操作 + * + * @param int + * years 年数
+ */ + public void addYear(int years) { + if (month == 2 && day == 29)// 当前时间是闰年并且日期是2月29号 + { + if (this.isLeapYear(year + years) == true)// 目标年是闰年时 + this.setDateTime(years, 0, 0, 0, 0, 0); + else + this.setDateTime(years, 0, -1, 0, 0, 0);// 目标年不是闰年,则2月只有28天,天数减去1 + } else + this.setDateTime(years, 0, 0, 0, 0, 0); + } + + /** + * 月增减操作(与oracle对月份增减的操作一样) + * + * @param months + * 月数
+ */ + public void addMonth(int months) { + int this_day_end = daysOfMonth();// 本月的天数 + int that_day_end = dayOfMonth(months);// 离现在n个月的天数 + if (this.day == this_day_end) + this.day = that_day_end;// 如果现在是本月的最后一天,则day设置成that_day_end + else if (this.day > that_day_end) + this.day = that_day_end; // 如果离现在n个月的天数that_day_end比现在的day小,则现在的day设置成that_day_end + + this.setDateTime(0, months, 0, 0, 0, 0); + } + + /** + * 天数增减操作 + * + * @param days + * 天数 + */ + public void addDay(int days) { + this.setDateTime(0, 0, days, 0, 0, 0); + } + + /** + * 小时增减操作 + * + * @param hours + * 小时数 + */ + public void addHour(int hours) { + this.setDateTime(0, 0, 0, hours, 0, 0); + } + + /** + * 分钟增减操作 + * + * @param minutes + * 分钟数 + */ + public void addMinute(int minutes) { + this.setDateTime(0, 0, 0, 0, minutes, 0); + } + + /** + * 秒增减操作 + * + * @param seconds + * 秒数 + */ + public void addSecond(int seconds) { + this.setDateTime(0, 0, 0, 0, 0, seconds); + } + + /** + * 取本月中有多少天 + * + * @return int 本月的实际天数 + */ + public int daysOfMonth() { + if (month > 12 || month < 0) + return 0; + if (month == 2 && this.isLeapYear()) + return 29; + else + return dayArray[month - 1]; + } + + /** + * 获取离当前时间ms个月的月份的天数 + * + * @param ms + * 月份
+ * @return + */ + public int dayOfMonth(int ms) { + int yy = ms / 12; + int mm = ms % 12; + int year = this.year + yy; + int month = this.month + mm; + + if (month > 12) { + month = month - 12; + year = year + 1; + } + if (month < 1) { + month = month + 12; + year = year - 1; + } + + if (month == 2 && isLeapYear(year)) + return 29; + else + return dayArray[month - 1]; + } + + /** + * 两个日期之间的秒数,静态方法 + * + * @param DateUtil + * mydate1
+ * @param DateUtil + * mydate2
+ * @return long + */ + public static long diffSec(DateUtil mydate1, DateUtil mydate2) { + return (mydate1.getTimeInMillis() - mydate2.getTimeInMillis()) / 1000; + } + + /** + * 两个日期之间之间的天数 + * + * @param Date + * start开始时间
+ * @param Date + * end结束时间
+ * @return int + */ + public static int diffMonth(Date start, Date end) { + if (start.after(end)) { + Date t = start; + start = end; + end = t; + } + Calendar startCalendar = Calendar.getInstance(); + startCalendar.setTime(start); + Calendar endCalendar = Calendar.getInstance(); + endCalendar.setTime(end); + Calendar temp = Calendar.getInstance(); + temp.setTime(end); + temp.add(Calendar.DATE, 1); + + int year = endCalendar.get(Calendar.YEAR) - startCalendar.get(Calendar.YEAR); + int month = endCalendar.get(Calendar.MONTH) - startCalendar.get(Calendar.MONTH); + + if ((startCalendar.get(Calendar.DATE) == 1) && (temp.get(Calendar.DATE) == 1)) { + return year * 12 + month + 1; + } else if ((startCalendar.get(Calendar.DATE) != 1) && (temp.get(Calendar.DATE) == 1)) { + return year * 12 + month; + } else if ((startCalendar.get(Calendar.DATE) == 1) && (temp.get(Calendar.DATE) != 1)) { + return year * 12 + month; + } else { + return (year * 12 + month - 1) < 0 ? 0 : (year * 12 + month); + } + } + + /** + * 两个日期之间之间的天数 + * + * @param DateUtil + * mydate1
+ * @param DateUtil + * mydate2
+ * @return int + */ + public static int diffDay(DateUtil mydate1, DateUtil mydate2) { + return (int) (mydate1.getTimeInMillis() - mydate2.getTimeInMillis()) / 1000 / (3600 * 24); + } + /** + * 两个日期之间之间的天数 mydate1-mydate2的天数 + * + * @param Date + * mydate1
+ * @param Date + * mydate2
+ * @return int + */ + public static int diffDay(Date mydate1, Date mydate2) { + mydate1 = DateUtil.stringToDate(DateUtil.dateFmtToString(mydate1, "yyyy-MM-dd"),"yyyy-MM-dd"); + mydate2 = DateUtil.stringToDate(DateUtil.dateFmtToString(mydate2, "yyyy-MM-dd"),"yyyy-MM-dd"); + int _day = (int) ((mydate1.getTime()- mydate2.getTime()) / 1000 / (3600 * 24)); + return _day; + } + + /** + * 计算两个时间间隔天数 + * + * @param startday + * @param endday + * @return + */ + public static int diffDays(Calendar d1, Calendar d2) { + if (d1.after(d2)) { + java.util.Calendar swap = d1; + d1 = d2; + d2 = swap; + } + int days = d2.get(Calendar.DAY_OF_YEAR) - d1.get(Calendar.DAY_OF_YEAR); + int y2 = d2.get(Calendar.YEAR); + if (d1.get(Calendar.YEAR) != y2) { + d1 = (Calendar) d1.clone(); + do { + days += d1.getActualMaximum(Calendar.DAY_OF_YEAR);// 得到当年的实际天数 + d1.add(Calendar.YEAR, 1); + } while (d1.get(Calendar.YEAR) != y2); + } + return days; + } + + /** + * 增加天数 + * + * @param Date + * date 时间
+ * @param int + * day 天数
+ * @return Date,增加过后的日期 + */ + public static Date addDays(Date date, int day) { + if (date == null) + return null; + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.set(Calendar.DAY_OF_MONTH, c.get(Calendar.DAY_OF_MONTH) + day); + return c.getTime(); + } + + /** + * 减少天数 + * + * @param Date + * date 时间
+ * @param int + * day 天数
+ * @return Date,减少过后的日期 + */ + public static Date removeDays(Date date, int day) { + if (date == null) + return null; + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.set(Calendar.DAY_OF_MONTH, c.get(Calendar.DAY_OF_MONTH) - day); + return c.getTime(); + } + + /** + * 增加月份 + * + * @param Date + * date 时间
+ * @param int + * month 天数
+ * @return Date,增加过后的日期 + */ + public static Date addMonths(Date date, int month) { + if (date == null) + return null; + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.set(Calendar.MONTH, c.get(Calendar.MONTH) + month); + return c.getTime(); + } + + /** + * 减少月份 + * + * @param Date + * date 时间
+ * @param int + * month 月数
+ * @return Date,减少过后的日期 + */ + public static Date removeMonths(Date date, int month) { + if (date == null) + return null; + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.set(Calendar.MONTH, c.get(Calendar.MONTH) - month); + return c.getTime(); + } + + /** + * 格式化时间 + * + * @param Date + * date Date类型日期
+ * @param SimpleDateFormat + * fmt 格式化格式
+ * @return String + */ + public static String dateFmtToString(Date date, SimpleDateFormat fmt) { + return fmt.format(date); + } + + /** + * 格式化时间,默认格式yyyy-MM-dd hh:mm:ss + * + * @param Date + * date Date类型日期
+ * @param SimpleDateFormat + * fmt 格式化格式
+ * @return String + */ + public static String dateFmtToString(Date date) { + return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(date); + } + + + /** + * 格式化时间 + * + * @param Date + * date Date类型日期
+ * @param SimpleDateFormat + * fmt 格式化格式
+ * @return String + */ + public static String dateFmtToString(Date date, String fmt) { + return new SimpleDateFormat(fmt).format(date); + } + + /** + * 字符串转日期 + * + * @param String + * date 日期字符串类
+ * @return java.sql.Date + */ + public static Date stringToDate(String date) { + return java.sql.Date.valueOf(date); + } + + + /** + * 字符串转时间 + * @param date 日期字符串 + * @param ftm 格式 + * @return 转换失败返回null + */ + public static Date stringToDate(String date,String ftm) { + SimpleDateFormat sdf = new SimpleDateFormat(ftm); + try { + return sdf.parse(date); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + /** + * 字符串转日期,可以按一定格式 + * + * @param String + * date 日期字符串
+ * @param String + * dataFmt 格式化后的日期
+ * @return Date + */ + public static Date stringFmtToDate(String date, String dataFmt) { + SimpleDateFormat df = new SimpleDateFormat(dataFmt); + return java.sql.Date.valueOf(df.format(java.sql.Date.valueOf(date))); + } + + /** + * Data类型转换成Timestamp类型 + * + * @param Date + * date日期 + * @return Timestamp + */ + public static Timestamp dateToTimestamp(Date date) { + String temp = CHN_DATE_TIME_EXTENDED_FORMAT.format(date); + return Timestamp.valueOf(temp); + } + + /** + * 获取当前日 + * + * @return int + */ + public int getDay() { + return day; + } + + /** + * 设置当前日 + * + * @param int + * day + */ + public void setDay(int day) { + this.day = day; + } + + /** + * 获取当前时 + * + * @return int + */ + public int getHour() { + return hour; + } + + /** + * 设置当前时 + * + * @param int + * hour + */ + public void setHour(int hour) { + this.hour = hour; + } + + /** + * 获取当前分 + * + * @return int + */ + public int getMinute() { + return minute; + } + + /** + * 设置当前分 + * + * @param int + * minute + */ + public void setMinute(int minute) { + this.minute = minute; + } + + /** + * 获取当前月 + * + * @return int + */ + public int getMonth() { + return month; + } + + /** + * 设置当前月 + * + * @param int + * month + */ + public void setMonth(int month) { + this.month = month; + } + + /** + * 获取当前秒 + * + * @return int + */ + public int getSecond() { + return second; + } + + /** + * 设置当前秒 + * + * @param int + * second + */ + public void setSecond(int second) { + this.second = second; + } + + /** + * 获取当前年 + * + * @return int + */ + public int getYear() { + return year; + } + + /** + * 设置当前年 + * + * @param int + * year + */ + public void setYear(int year) { + this.year = year; + } + + /** + * 判断两时间段是否有交集 + * @param Date start1 + * @param Date end1 + * @param Date start2 + * @param Date end2 + * @return boolean true:有交集 false:没有交集 + */ + public boolean hasCommon(Date start1 , Date end1 ,Date start2 , Date end2){ + if(end1.before(start2)||end2.before(start1)) + return false; + else + return true; + } + + /** + * 判断日期格式 是否有字母等 不合法的 + * @param date 字符串的日期 + * @return true:正确 false:失败 + */ + public static boolean judgeDateMsg(String date){ + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");// 日期格式化 + try{ + java.sql.Date.valueOf(df.format(java.sql.Date.valueOf(date))); + }catch (NumberFormatException e){ + return false; + } + return true; + } + + /** + * 计算两个日期之间的间隔的天数 + * @param beginDate 开始日期 + * @param endDate 结束日期 + * @return 间隔的天数 + */ + public static int daysBetween(String beginDate,String endDate){ + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + Calendar cal = Calendar.getInstance(); + Calendar cal2 = Calendar.getInstance(); + try { + cal.setTime(sdf.parse(beginDate)); + cal2.setTime(sdf.parse(endDate)); + long time1 = cal.getTimeInMillis(); + long time2 = cal2.getTimeInMillis(); + long between_days=(time2-time1)/(1000*3600*24); + return (int) between_days; + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return 1; + } + + /** + * 计算系统当前时间和传入时间相差的时间(精确到秒) + * 如果结果大于零则当前系统时间大于传入的时间,小于零则相反 + * @param date 传入的时间 + * @return 相差的时间 + */ + public static int secondBetween(String date){ + SimpleDateFormat sdfSecond = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + long presentDate = sdfSecond.parse(sdfSecond.format(new Date())).getTime(); + long enterDate = sdfSecond.parse(date).getTime(); + return (int) ((presentDate-enterDate)/1000); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return 1; + } + + /** + * 计算系统当前时间和传入时间相差的时间(精确到秒) + * 如果结果大于零则当前系统时间大于传入的时间,小于零则相反 + * @param date 传入的时间 + * @return 相差的时间 + */ + public static int secondBetween(Date date){ + if (date==null) { + return 0; + } + SimpleDateFormat sdfSecond = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + long presentDate = sdfSecond.parse(sdfSecond.format(new Date())).getTime(); + long enterDate = date.getTime(); + return (int) ((presentDate-enterDate)/1000); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return 1; + } + + /** + * 计算过去时间,将date与当前系统时间进行对比 + * @param date 要进行比较的时间, + * @return 字符串 + */ + public static String pastTime(Date date) { + int second = secondBetween(date); + if (second<60) { + return second+"秒前"; + } else if (second>60 && second < 30*60) { + return (second/60)+"分钟前"; + } else if (second>30*60 && second < 60*60) { + return "半小时前"; + } else if (second>60*60 && second < 24*60*60) { + return (second/60/60)+"小时前"; + } else { + return DateUtil.dateFmtToString(date,"yyyy-MM-dd HH:mm:ss"); + } + + + } + + /** + * 计算两个传入时间相差的时间(精确到秒) + * 如果结果大于零则传入的开始时间大于结束时间,小于零则相反 + * @param beginDate 开始的时间 + * @param endDate 结束时间 + * @return 相差的时间 + */ + public static int secondBetween(String beginDate,String endDate){ + SimpleDateFormat sdfSecond = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + long _enginDate = sdfSecond.parse(beginDate).getTime(); + long _endDate = sdfSecond.parse(endDate).getTime(); + return (int) ((_enginDate-_endDate)/1000); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return 1; + } + + /** + * 将开始时间与结束时间转换成时间格式,eg:2015-4-5至2015-3-2 + * @param date 2015-4-5至2015-3-2 + * @param split 至 + * @param fmt 格式 + * @return 转换失败null + */ + public static Date[] beginEndStringToDate(String date,String split,String fmt) { + if (StringUtil.isBlank(date) || StringUtil.isBlank(split)) { + return null; + } + String[] _date = date.split(split); + if (_date.length==2) { + Date[] d = new Date[2]; + d[0] = DateUtil.stringFmtToDate(_date[0], fmt); + d[1] = DateUtil.stringFmtToDate(_date[1], fmt); + return d; + } + return null; + } + + /** + * 将date转换为日历 + * @param date 时间 + * @return Calendarl类型 + */ + public static Calendar date2Calendar(Date date) { + Calendar calendar = Calendar.getInstance(); //得到日历 + calendar.setTime(date); + return calendar; + } +} diff --git a/src/main/java/com/mingsoft/util/ExcelUtil.java b/src/main/java/com/mingsoft/util/ExcelUtil.java new file mode 100644 index 00000000..c517bc00 --- /dev/null +++ b/src/main/java/com/mingsoft/util/ExcelUtil.java @@ -0,0 +1,118 @@ +package com.mingsoft.util; + +import java.io.OutputStream; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; + +import jxl.Workbook; +import jxl.format.Alignment; +import jxl.format.Border; +import jxl.format.BorderLineStyle; +import jxl.format.VerticalAlignment; +import jxl.write.Label; +import jxl.write.WritableCellFormat; +import jxl.write.WritableFont; +import jxl.write.WritableSheet; +import jxl.write.WritableWorkbook; + +/*** + * @author lsf + */ +public class ExcelUtil { + /*************************************************************************** + * @param fileName + * EXCEL文件名称 + * @param listTitle + * EXCEL文件第一行列标题集合 + * @param listContent + * EXCEL文件正文数据集合 + * @return + */ + public final static String exportExcel(String fileName, String[] titles, + List listContent,HttpServletResponse response ) { + String result = "系统提示:Excel文件导出成功!"; + // 以下开始输出到EXCEL + try { + // 定义输出流,以便打开保存对话框______________________begin + OutputStream os = response.getOutputStream();// 取得输出流 + response.reset();// 清空输出流 + response.setHeader("Content-disposition", "attachment; filename="+ new String(fileName.getBytes("GB2312"), "ISO8859-1")); + // 设定输出文件头 + response.setContentType("application/msexcel");// 定义输出类型 + // 定义输出流,以便打开保存对话框_______________________end + + /** **********创建工作簿************ */ + WritableWorkbook workbook = Workbook.createWorkbook(os); + + /** **********创建工作表************ */ + + WritableSheet sheet = workbook.createSheet("Sheet1", 0); + + /** **********设置纵横打印(默认为纵打)、打印纸***************** */ + jxl.SheetSettings sheetset = sheet.getSettings(); + sheetset.setProtected(false); + + /** ************设置单元格字体************** */ + WritableFont NormalFont = new WritableFont(WritableFont.ARIAL, 10); + WritableFont BoldFont = new WritableFont(WritableFont.ARIAL, 10, + WritableFont.BOLD); + + /** ************以下设置三种单元格样式,灵活备用************ */ + // 用于标题居中 + WritableCellFormat wcf_center = new WritableCellFormat(BoldFont); + wcf_center.setBorder(Border.ALL, BorderLineStyle.THIN); // 线条 + wcf_center.setVerticalAlignment(VerticalAlignment.CENTRE); // 文字垂直对齐 + wcf_center.setAlignment(Alignment.CENTRE); // 文字水平对齐 + wcf_center.setWrap(false); // 文字是否换行 + + // 用于正文居左 + WritableCellFormat wcf_left = new WritableCellFormat(NormalFont); + wcf_left.setBorder(Border.NONE, BorderLineStyle.THIN); // 线条 + wcf_left.setVerticalAlignment(VerticalAlignment.CENTRE); // 文字垂直对齐 + wcf_left.setAlignment(Alignment.LEFT); // 文字水平对齐 + wcf_left.setWrap(false); // 文字是否换行 + + /** ***************以下是EXCEL开头大标题,暂时省略********************* */ + // sheet.mergeCells(0, 0, colWidth, 0); + // sheet.addCell(new Label(0, 0, "XX报表", wcf_center)); + /** ***************以下是EXCEL第一行列标题********************* */ + for (int i = 0; i < titles.length; i++) { + sheet.addCell(new Label(i, 0, titles[i], wcf_center)); + } + /** ***************以下是EXCEL正文数据********************* */ + int i = 1; + for (Object obj : listContent) { + int j = 0; + for (Object field:(Object[])obj) { + if (field instanceof Map) { + if(field!=null) { + Map temp = (Map)field; + if (temp.get("format")!=null && temp.get("format") instanceof WritableCellFormat) { + sheet.addCell(new Label(j, i, field!=null?String.valueOf(temp.get("value")):"", (WritableCellFormat)temp.get("format"))); + } else { + sheet.addCell(new Label(j, i, field!=null?String.valueOf(field):"", wcf_left)); + } + } + } else { + sheet.addCell(new Label(j, i, field!=null?String.valueOf(field):"", wcf_left)); + } + + j++; + } + i++; + } + /** **********将以上缓存中的内容写到EXCEL文件中******** */ + workbook.write(); + /** *********关闭文件************* */ + workbook.close(); + + } catch (Exception e) { + result = "系统提示:Excel文件导出失败,原因:" + e.toString(); + System.out.println(result); + e.printStackTrace(); + } + return result; + } +} \ No newline at end of file diff --git a/src/main/java/com/mingsoft/util/FileUtil.java b/src/main/java/com/mingsoft/util/FileUtil.java new file mode 100644 index 00000000..a63c5baa --- /dev/null +++ b/src/main/java/com/mingsoft/util/FileUtil.java @@ -0,0 +1,215 @@ +/** + * + */ +package com.mingsoft.util; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.mingsoft.constant.Const; + +/** + * + *

+ * mswx-铭飞微信酒店预订平台 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author 成卫雄 + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科技 + *

+ * + *

+ * Comments:io流读取文件;写出文件 + *

+ * + *

+ * Create Date:2014-8-3 + *

+ * + *

+ * Modification history: + *

+ */ + +public class FileUtil { + + public static final String URF8 = "UTF-8"; + + /** + * i/o进行读取htm模版 + * + * @return fileContent读出的内容 + */ + public static String readFile(String filePath) { + String fileContent = ""; + try { + File f = new File(filePath); + if (f.isFile() && f.exists()) { + InputStreamReader read = new InputStreamReader( + new FileInputStream(f), "UTF-8"); + BufferedReader reader = new BufferedReader(read); + String line; + while ((line = reader.readLine()) != null) { + fileContent += line + "\n"; + } + reader.close(); + read.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + return fileContent; + } + + /** + * 读取文件夹 + * + * @param folderPath + *  文件夹路径  + * @param list + * 返回包括文件名称与文件路径 Map返回结构 name:文件名称 path;文件路径 + * @return + */ + public static List readFolder(List> list, + String folderPath) { + if (list == null) { + return null; + } + File file = new File(folderPath); + File[] tempList = file.listFiles(); + if (tempList != null && tempList.length > 0) { + for (File tmpFile : tempList) { + Map map = new HashMap(); + map.put("name", file.getName()); + map.put("path", file.getPath()); + list.add(map); + if (tmpFile.isDirectory()) { + readFolder(list, tmpFile.getPath()); // 递归删除 + } + } + } + return list; + } + + /** + * i/o写入文件 + * + * @param content + * 写入文件内容 + * @param writePath + * 要写入的文件名路径 + */ + public static void writeFile(String content, String writePath, + String charCoder) { + try { + File file = new File(writePath); + OutputStreamWriter osw = new OutputStreamWriter( + new FileOutputStream(file), charCoder); + BufferedWriter reader = new BufferedWriter(osw); + reader.write(content); + osw.flush(); + reader.close(); + osw.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 创建文件夹 + * + * @param path + *  路径 + */ + public static void createFolder(String path) { + File file = new File(path); + if (!file.exists()) { + file.mkdirs(); + } + } + + /** + * 删除指定文件夹 如果文件夹里面存在文件夹就进行递归,删除规则是从里面开始先删除 + * + * @param folderPath + * 文件夹路径 + */ + public static void delFolders(String folderPath) { + // 删除完里面所有内容 + File file = new File(folderPath); + // 如果路径本身就是一个文件就直接删除 + if (!file.isDirectory()) { + file.delete(); + return; + } + // 检查文件夹里面是否存在文件夹 + File[] tempList = file.listFiles(); + if (tempList != null && tempList.length > 0) { + for (File tmpFile : tempList) { + if (tmpFile.isDirectory()) { + delFolders(tmpFile.getPath()); // 递归删除 + } else { + tmpFile.delete(); + } + } + } else { + file.delete(); + } + delFolders(file.getPath()); + } + + /** + * 删除文件 + * + * @param path + * 文件路径 + * @return + */ + public static void delFile(String path) { + File file = new File(path); + if (file.exists()) { + file.delete(); + } + } + + public static void writeTmpFile(String fileName, String content) { + // 获取程序当前路径 + String strDir = System.getProperty("user.dir"); + // 将路径分隔符更换 + String folderpath = strDir;// .replace("/", File.separatorChar); + String filepath = folderpath + File.separatorChar + fileName + ".tmp"; + FileUtil.writeFile(content, filepath, Const.UTF8); + } + + public static String readTmpFile(String fileName) { + // 获取程序当前路径 + String strDir = System.getProperty("user.dir"); + // 将路径分隔符更换 + String folderpath = strDir;// .replace("/", File.separatorChar); + String filepath = folderpath + File.separatorChar + fileName + ".tmp"; + return FileUtil.readFile(filepath); + } +} diff --git a/src/main/java/com/mingsoft/util/ImageUtil.java b/src/main/java/com/mingsoft/util/ImageUtil.java new file mode 100644 index 00000000..03030f3b --- /dev/null +++ b/src/main/java/com/mingsoft/util/ImageUtil.java @@ -0,0 +1,948 @@ +package com.mingsoft.util; + +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.color.ColorSpace; +import java.awt.geom.AffineTransform; +import java.awt.image.AffineTransformOp; +import java.awt.image.BufferedImage; +import java.awt.image.ColorConvertOp; +import java.awt.image.CropImageFilter; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageFilter; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Iterator; + +import javax.imageio.ImageIO; +import javax.imageio.ImageReadParam; +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; +import javax.imageio.stream.MemoryCacheImageInputStream; + +import org.apache.log4j.Logger; + +import com.mortennobel.imagescaling.ResampleOp; +import com.sun.image.codec.jpeg.JPEGCodec; +import com.sun.image.codec.jpeg.JPEGImageEncoder; + + +/** + * 通用批量处理图片类 + * @author 王天培QQ:78750478 + * @version + * 版本号:100-000-000
+ * 创建日期:2012-03-15
+ * 历史修订:
+ */ +public class ImageUtil { + + protected static Logger LOGGER = Logger.getLogger(ImageUtil.class); + + /** + * 批处理图片 + * + * @param directoryPath 批处理文件目录 + * @param sSize 源尺寸 + * @param tSize 处理后尺寸 + */ + public static void batchImageWidthHeight(String directoryPath, int sSize, int tSize) { + // 设置批处理文件目录 + File dir = new File(directoryPath); + // 获取目录文件列表 + File[] files = dir.listFiles(); + + // 判断是否是空目录 + if (files == null) { + return; + } else { + int count = 0; + // 遍历文件列表 + for (int i = 0; i < files.length; i++) { + // 如果是目录,进行递归 + if (files[i].isDirectory()) { + batchImageWidthHeight(files[i].getAbsolutePath(), sSize, tSize); + } else { + + BufferedImage srcImage; + try { + String filePath = files[i].getPath(); + if (isPic(files[i].getPath())) { + // 读取图片文件 + srcImage = ImageIO.read(files[i]); + int[] wh = getImageWidthHeight(srcImage, sSize, tSize); + // ImageHelper.resizeImage(files[i], + // files[i].getPath(), wh[0], wh[1], + // filePath.substring(filePath.indexOf("."), + // filePath.length()).replace(".", "")); + } + + } catch (IOException e) { + e.printStackTrace(); + } + } + count++; + } + } + + } + + + /** + * 缩放图像透明背景,捕捉到IOException异常后会抛出。 + * @param root 文件路径 + * @param scale 规模 + * @throws IOException IO流异常 + */ + public static void ChangeImage(String root, double scale) throws IOException { + File file = new File(root); + File[] subFile = file.listFiles(); + for (int i = 0; i < subFile.length; i++) { + //文件或目录名称 + String name = subFile[i].getName(); + //如果该文件是目录 + if (subFile[i].isDirectory()) { + ChangeImage(subFile[i].getAbsolutePath() + "\\", scale); + } + String[] names = name.split("//."); + if (StringUtil.isBlank(names[0])) + break; + ImageUtil.scaleHyaline(root + subFile[i].getName(), root + subFile[i].getName(), scale, true); + } + } + + /** + * 图像类型转换 GIF->JPG GIF->PNG PNG->JPG PNG->GIF(X) + * + * @param source 源图片路径
+ * @param result 输出图片路径 + */ + public static void convert(String source, String result) { + try { + File f = new File(source); + f.canRead(); + f.canWrite(); + BufferedImage src = ImageIO.read(f); + ImageIO.write(src, "JPG", new File(result)); + } catch (Exception e) { + LOGGER.error(e); + } + } + + /** + * 创建图片,根据BufferedImage流 + * + * @param path 图片路径
+ * @param bi 图片对象流 + */ + public static void createImage(String path, BufferedImage bi) { + try { + ImageIO.write(bi, path.substring(path.lastIndexOf("."), path.length()).replace(".", ""), new File(path)); + } catch (IOException e) { + LOGGER.error(e); + } + } + + /** + * 创建图片,根据字节数组 + * + * @param path 图片路径
+ * @param bt 图片字节数 + */ + public static void createImage(String path, byte[] bt) { + // FileUtil.creaetFileByBytes(bt, path); + } + + /** + * 图像切割 + * + * @param sourceImagePath 源图像地址
+ * @param descDir 输出图像地址
+ * @param width 目标切片宽度
+ * @param height 目标切片高度
+ */ + public static void cut(String sourceImagePath, String descDir, int width, int height) { + try { + Image img; + ImageFilter cropFilter; + // 读取源图像 + BufferedImage bi = ImageIO.read(new File(sourceImagePath)); + int srcWidth = bi.getHeight(); // 源图宽度 + int srcHeight = bi.getWidth(); // 源图高度 + if (srcWidth > width && srcHeight > height) { + Image image = bi.getScaledInstance(srcWidth, srcHeight, Image.SCALE_DEFAULT); + width = 200; // 切片宽度 + height = 150; // 切片高度 + int cols = 0; // 切片横向数量 + int rows = 0; // 切片纵向数量 + // 计算切片的横向和纵向数量 + if (srcWidth % width == 0) { + cols = srcWidth / width; + } else { + cols = (int) Math.floor(srcWidth / width) + 1; + } + if (srcHeight % height == 0) { + rows = srcHeight / height; + } else { + rows = (int) Math.floor(srcHeight / height) + 1; + } + // 循环建立切片 + // 改进的想法:是否可用多线程加快切割速度 + for (int i = 0; i < rows; i++) { + for (int j = 0; j < cols; j++) { + // 四个参数分别为图像起点坐标和宽高 + // 即: CropImageFilter(int x,int y,int width,int height) + cropFilter = new CropImageFilter(j * 200, i * 150, width, height); + img = Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(image.getSource(), cropFilter)); + BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + Graphics g = tag.getGraphics(); + g.drawImage(img, 0, 0, null); // 绘制缩小后的图 + g.dispose(); + // 输出为文件 + ImageIO.write(tag, "JPEG", new File(descDir + "pre_map_" + i + "_" + j + ".jpg")); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 图片解密 + * @param sourceImagePath 图片路径 + */ + public static void decodeImage(String sourceImagePath) { + File file = new File(sourceImagePath); + if (file.exists()) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int length = -1; + InputStream is; + try { + is = new FileInputStream(file); + try { + while ((length = is.read(buffer)) != -1) { + baos.write(buffer, 0, length); + } + baos.flush(); + } catch (IOException e) { + e.printStackTrace(); + } + byte[] data = baos.toByteArray(); + data[0] = (byte)0xff; + + OutputStream os = new FileOutputStream(file); + try { + os.write(data); + os.flush(); + os.close(); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + try { + is.close(); + baos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } catch (FileNotFoundException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + } + + /** + * 图片加密 + * @param sourceImagePath 图片路径 + */ + public static void encodeImage(String sourceImagePath) { + File file = new File(sourceImagePath); + if (file.exists()) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int length = -1; + InputStream is; + try { + is = new FileInputStream(file); + try { + while ((length = is.read(buffer)) != -1) { + baos.write(buffer, 0, length); + } + baos.flush(); + } catch (IOException e) { + e.printStackTrace(); + } + byte[] data = baos.toByteArray(); + data[0] = (byte)0x00; + + OutputStream os = new FileOutputStream(file); + try { + os.write(data); + os.flush(); + os.close(); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + try { + is.close(); + baos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } catch (FileNotFoundException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + } + + /** + * 根据字节流获取图片类型,jpeg,jpg,png + * + * @param imageBytes 图像字节流
+ * @return 返回jpeg,jpg,png类型 + */ + public static String getImageType(byte[] imageBytes) { + ByteArrayInputStream bais = null; + MemoryCacheImageInputStream mcis = null; + try { + bais = new ByteArrayInputStream(imageBytes); + mcis = new MemoryCacheImageInputStream(bais); + Iterator itr = ImageIO.getImageReaders(mcis); + while (itr.hasNext()) { + ImageReader reader = (ImageReader) itr.next(); + String imageName = reader.getClass().getSimpleName(); + if (imageName != null && ("JPEGImageReader".equalsIgnoreCase(imageName))) { + return "jpeg"; + } else if (imageName != null && ("JPGImageReader".equalsIgnoreCase(imageName))) { + return "jpg"; + } else if (imageName != null && ("pngImageReader".equalsIgnoreCase(imageName))) { + return "png"; + } + } + } catch (Exception e) { + LOGGER.error(e); + } + return null; + } + + /** + * 获取新图片宽度和高度 根据sourceWidth与targetWidth的比例,重新生成图片大小 + * + * @param source + * 源图片 + * @param sourceWidth + * 源图片宽度 + * @param targetWidth + * 新图片宽度 + * @return 返回整型数组,[0]宽度,[1]高度 + */ + private static int[] getImageWidthHeight(BufferedImage source, int sourceWidth, int targetWidth) { + double ts = (double) targetWidth / sourceWidth; + int newWidth = (int) (source.getWidth() * ts); + int newHeight = (int) (source.getHeight() * ts); + if (newWidth < 3) + newWidth = 3; + if (newHeight < 3) + newHeight = 3; + int[] wh = new int[2]; + wh[0] = newWidth; + wh[1] = newHeight; + return wh; + } + + /** + * 获取新图片宽度和高度 + * + * @param sourceImagePath 源图片 + * @return 返回整型数组,[0]宽度 [1]高度 + */ + public static int[] getImageWidthHeight(String sourceImagePath) { + BufferedImage bi; + try { + bi = ImageIO.read(new File(sourceImagePath)); + + int[] wh = new int[2]; + wh[0] = bi.getWidth(); + wh[1] = bi.getHeight(); + return wh; + } catch (IOException e) { + LOGGER.error(e); + } + return null; + } + + /** + * 彩色转为黑白 + * + * @param sourceImagePath 源图片路径
+ * @param savePath 输出图片路径 + */ + public static void gray(String sourceImagePath, String savePath) { + try { + BufferedImage src = ImageIO.read(new File(sourceImagePath)); + ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY); + ColorConvertOp op = new ColorConvertOp(cs, null); + src = op.filter(src, null); + ImageIO.write(src, "JPEG", new File(savePath)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 检查文件是否是图片 + * + * @param String + * sourceImagePath 文件路劲
+ * @return 如果是图片,则返回true,否则返回false + */ + private static boolean isPic(String sourceImagePath) { + // 图片后缀 + String picSfix = "jpg|png|gif"; + String[] temp = picSfix.split("\\|"); + if (sourceImagePath.indexOf(".") > 0) { + String fileSfix = sourceImagePath.substring(sourceImagePath.indexOf("."), sourceImagePath.length()).replace(".", ""); + for (int i = 0; i < temp.length; i++) { + if (fileSfix.equals(temp[i])) + return true; + } + } + return false; + } + + /** + * 测试用主方法 + * @param args 主方法形参 + * @throws IOException io异常 + */ + public static void main(String[] args) throws IOException { + // String root = + // "C:\\Documents and Settings\\Administrator\\桌面\\images\\"; + // ChangeImage(root, 0.5625); +// ImageUtil.rotate("f:/b.jpg"); +// File file = new File("F:\\陶研所"); +// File[] subFile = file.listFiles(); +// for (int i = 0; i < subFile.length; i++) { +// ImageUtil.createImage(subFile[i].getAbsolutePath(), ImageUtil.resize(subFile[i].getAbsolutePath(), 150, 100)); +// } + } + + /** + * 重新设置图片的宽度高度 + * + * @param sourceImagePath 图像位置
+ * @param width 新的宽度
+ * @param height 新的高度
+ * @return 返回BufferedImage图像流 + */ + public static BufferedImage resize(String sourceImagePath, int width, int height) { + + BufferedImage inputBufImage; + try { + inputBufImage = ImageIO.read(new File(sourceImagePath)); + ResampleOp resampleOp = new ResampleOp(Math.min(width, inputBufImage.getWidth()), Math.min(height, inputBufImage.getHeight())); + BufferedImage rescaledTomato = resampleOp.filter(inputBufImage, null); + return rescaledTomato; + } catch (IOException e1) { + e1.printStackTrace(); + } + + return null; + } + + /** + * 获取新图片宽度和高度 根据sourceWidth与targetWidth的比例,重新生成图片大小 + * + * @param sourceImagePath + * 源文件 + * @param savePath + * 输出路径 + * @param width + * 源图片宽度 + * @param height + * 新图片宽度 + * @param sufix + * 图片后缀 + * @return 如果获取成功,则返回true,否则返回false + */ + public static boolean resizeImage(File sourceImagePath, String savePath, int width, int height, String sufix) { + try { + BufferedImage inputBufImage = ImageIO.read(sourceImagePath); + ResampleOp resampleOp = new ResampleOp(Math.min(width, inputBufImage.getWidth()), Math.min(height, inputBufImage.getHeight())); + BufferedImage rescaledTomato = resampleOp.filter(inputBufImage, null); + ImageIO.write(rescaledTomato, sufix, new File(savePath)); + return true; + } catch (Exception e) { + LOGGER.error(e); + return false; + } + + } + + /** + * 重置图片大小,输出字节流 + * + * @param sourceImagePath 源图片路径
+ * @param targetW 新图片宽度
+ * @param targetH 新图片高度
+ * @param type 图片类型jpg,png,bmp,gif + * @return 返回byte数组图片流 + */ + public static byte[] resizeImageForBytes(String sourceImagePath, int targetW, int targetH, String type) { + try { + BufferedImage image = resize(sourceImagePath, targetW, targetH); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + + // JPEGImageEncoder encoder = + // JPEGCodec.createJPEGEncoder(outStream); + // encoder.encode(image); + ImageIO.write(image, type, outStream); + outStream.flush(); + byte[] result = outStream.toByteArray(); + outStream.close(); + return result; + } catch (Exception ex) { + LOGGER.error(ex); + return null; + } + } + + /** + * 获取新图片宽度和高度 根据sourceWidth与targetWidth的比例,重新生成图片大小 + * + * @param sourceImageFile + * 源文件 + * @param savePath + * 输出路径 + * @param width + * 源图片宽度 + * @param height + * 新图片宽度 + * @param sufix + * 图片后缀 + * @return 如果是获取成功,则返回true,否则返回false + */ + public static boolean resizeImageForEncode(File sourceImageFile, String savePath, Integer width, Integer height, String sufix) { + try { + + BufferedImage inputBufImage = ImageIO.read(sourceImageFile); + ResampleOp resampleOp = new ResampleOp(Math.min(width, inputBufImage.getWidth()), Math.min(height, inputBufImage.getHeight())); + BufferedImage rescaledTomato = resampleOp.filter(inputBufImage, null); + ImageIO.write(rescaledTomato, sufix, new File(savePath)); + return true; + } catch (Exception e) { + LOGGER.error(e); + return false; + } + + } + + /*** + * 图片旋转 + * + * @param sourceImagePath + * 图片文件路径 + * @param direction + * 旋转方向 0:顺时针90度 1逆时针90度 + * + */ + public static void rotate(String sourceImagePath, int direction) { + File file = null; + BufferedImage original = null; + BufferedImage bufOut = null; + int width, height; + + file = new File(sourceImagePath); + try { + original = ImageIO.read(file); + } catch (Exception e) { + return; + } + + width = original.getWidth(); + height = original.getHeight(); + bufOut = new BufferedImage(width, height, original.getType()); + // AffineTransform atx = AffineTransform.getScaleInstance(scale, scale); + AffineTransform atx = new AffineTransform(); + switch (direction) { + case 0: + atx.rotate(-Math.PI / 2, width / 2, height / 2); + break; + case 1: + atx.rotate(Math.PI / 2, width / 2, height / 2); + break; + } + AffineTransformOp atop = new AffineTransformOp(atx, AffineTransformOp.TYPE_BICUBIC); + atop.filter(original, bufOut); + bufOut = bufOut.getSubimage(0, 0, width, height); + try { + ImageIO.write(bufOut, "JPG", new File(sourceImagePath)); + } catch (IOException e) { + LOGGER.debug(e); + } + } + + /** + * 保存jpg图片 + * + * @param sourceImagePath 原始图片地址
+ * @param savePath 保存后的图片地址
+ * @param width 新的图片宽度 0:不改变图片宽度
+ * @param hight 新的图片高度 0:不改变图片高度
+ */ + public static void saveImageAsJpg(String sourceImagePath, String savePath, int width, int hight) { + BufferedImage srcImage = null; + String imgType = "JPEG"; + if (sourceImagePath.toLowerCase().endsWith(".png")) { + imgType = "PNG"; + } + File saveFile = new File(savePath); + File fromFile = new File(sourceImagePath); + try { + srcImage = ImageIO.read(fromFile); + } catch (IOException e) { + LOGGER.error(e); + } + if (width > 0 || hight > 0) { + srcImage = resize(sourceImagePath, width, hight); + } + try { + ImageIO.write(srcImage, imgType, saveFile); + } catch (IOException e) { + LOGGER.error(e); + } + } + + /** + * 缩放图像 + * + * @param sourceImagePath + * 源图像文件地址 + * @param savePath + * 缩放后的图像地址 + * @param scale + * 缩放比例 + * @param flag + * 缩放选择:true 放大; false 缩小; + */ + public static void scale(String sourceImagePath, String savePath, double scale, boolean flag) { + try { + BufferedImage src = ImageIO.read(new File(sourceImagePath)); // 读入文件 + int width = src.getWidth(); // 得到源图宽 + int height = src.getHeight(); // 得到源图长 + if (flag) { + // 放大 + width = (int) (width * scale); + height = (int) (height * scale); + } else { + // 缩小 + width = (int) (width / scale); + height = (int) (height / scale); + } + Image image = src.getScaledInstance(width, height, Image.SCALE_DEFAULT); + BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + Graphics g = tag.getGraphics(); + g.drawImage(image, 0, 0, null); // 绘制缩小后的图 + g.dispose(); + ImageIO.write(tag, "JPEG", new File(savePath));// 输出到文件流 + } catch (IOException e) { + LOGGER.equals(e); + } + } + + /** + * 缩放图像透明背景 + * + * @param sourceImagePath + * 源图像文件地址 + * @param savePath + * 缩放后的图像地址 + * @param scale + * 缩放比例 + * @param flag + * 缩放选择:true 放大; false 缩小; + */ + public static void scaleHyaline(String sourceImagePath, String savePath, double scale, boolean flag) { + if (ImageUtil.isPic(sourceImagePath)) { + + try { + BufferedImage src = ImageIO.read(new File(sourceImagePath)); + BufferedImage dstImage = null; + AffineTransform transform = AffineTransform.getScaleInstance(scale, scale);// 返回表示缩放变换的变换 + AffineTransformOp op = new AffineTransformOp(transform, AffineTransformOp.TYPE_BILINEAR); + dstImage = op.filter(src, null); + + /********** save到本地 *****************/ + try { + ImageIO.write(dstImage, "png", new File(savePath)); + } catch (IOException e) { + e.printStackTrace(); + } + /********** save end *****************/ + + } catch (IOException e) { + LOGGER.equals(e); + } + + } + + } + + +/** + * 图片剪切 + * @param x 剪切的起点x轴 + * @param y 剪切的起点y轴 + * @param width 剪切后的宽度 + * @param height 剪切后的高度 + * @param sourceImagePath 原始图片路径 + * @param savePath 剪切后保存的路径 + */ + public static void cut(int x ,int y,int width,int height,String sourceImagePath,String savePath) { + + FileInputStream is = null; + ImageInputStream iis = null; + + try { + // 读取图片文件 + try { + is = new FileInputStream(sourceImagePath); + } catch (FileNotFoundException e) { + LOGGER.error("图片未找到:" + sourceImagePath); + LOGGER.error(e); + } + /* + * + * 返回包含所有当前已注册 ImageReader 的 Iterator,这些 ImageReader 声称能够解码指定格式。 + * 参数:formatName - 包含非正式格式名称 . (例如 "jpeg" 或 "tiff")等 。 + */ + Iterator it = ImageIO.getImageReadersByFormatName("jpg"); + ImageReader reader = it.next(); + + // 获取图片流 + try { + iis = ImageIO.createImageInputStream(is); + } catch (IOException e) { + e.printStackTrace(); + LOGGER.error("图片未找到:" + sourceImagePath); + LOGGER.error(e); + } + + /* + *

iis:读取源.true:只向前搜索

.将它标记为 ‘只向前搜索’。 + * 此设置意味着包含在输入源中的图像将只按顺序读取,可能允许 reader 避免缓存包含与以前已经读取的图像关联的数据的那些输入部分。 + */ + reader.setInput(iis, true); + + /* + * + *

描述如何对流进行解码的类

.用于指定如何在输入时从 Java Image I/O + * + * 框架的上下文中的流转换一幅图像或一组图像。用于特定图像格式的插件 + * + * 将从其 ImageReader 实现的 getDefaultReadParam 方法中返回 + * + * ImageReadParam 的实例。 + */ + ImageReadParam param = reader.getDefaultReadParam(); + BufferedImage bid = null; + try { + bid = reader.read(0); + } catch (IOException e) { + LOGGER.error("图片未找到:" + sourceImagePath); + LOGGER.error(e); + } + int _h = bid.getHeight(); + int _w = bid.getWidth(); + + /* + * 图片裁剪区域。Rectangle 指定了坐标空间中的一个区域,通过 Rectangle 对象 + * 的左上顶点的坐标(x,y)、宽度和高度可以定义这个区域。 + */ + Rectangle rect = new Rectangle(x, y, width, height); + +// // 如果图片很小,就不进行图片剪切处理 +// if (_h < height && _w < width) { +// rect = new Rectangle(0, 0, _h, _w); +// } +// +// if (_h < height && _w > width) { +// rect = new Rectangle((_w - width) / 2, 0, width, _h); +// } +// +// if (_w < width && _h > height) { +// rect = new Rectangle(0, (_h - height) / 2, _w, height); +// } +// +// if (_w > width && _h > height) { +// rect = new Rectangle(x, y, width, height); +// //rect = new Rectangle((_w - width) / 2, (_h - height) / 2, width, height); +// } + + // 提供一个 BufferedImage,将其用作解码像素数据的目标。 + param.setSourceRegion(rect); + + /* + * 使用所提供的 ImageReadParam 读取通过索引 imageIndex 指定的对象,并将 它作为一个完整的 + * BufferedImage 返回。 + */ + BufferedImage bi = null; + try { + bi = reader.read(0, param); + } catch (IOException e) { + LOGGER.error("图片未找到:" + sourceImagePath); + LOGGER.error(e); + } + + // 保存新图片 + try { + ImageIO.write(bi, "jpg", new File(savePath)); + } catch (IOException e) { + LOGGER.error("输出路径不正确:" + savePath); + LOGGER.error(e); + } + + } + + finally { + + if (is != null) + try { + is.close(); + } catch (IOException e) { + LOGGER.error(e); + } + if (iis != null) + try { + iis.close(); + } catch (IOException e) { + LOGGER.error(e); + } + + } + + } + + /** + * 图片格式转换 + * + * @param path 图片路径
+ * @param fix 要转换成的文件格式,文件名后缀 + */ + public static void formatImage(String path, String fix) { + String _path = path; + try { + File file = new File(_path); + InputStream is = new FileInputStream(file); + BufferedImage image = ImageIO.read(is); + BufferedImage tag = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB); + tag.getGraphics().drawImage(image, 0, 0, image.getWidth(), image.getHeight(), null); // 绘制缩小后的图 + FileOutputStream newimage = new FileOutputStream(path.substring(0, path.lastIndexOf(".")) + fix); // 输出到文件流 + JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(newimage); + encoder.encode(tag); + newimage.close(); + } catch (Exception ex) { + LOGGER.equals(ex); + } + + } + + + /** + * 缩放图片 + * @param sourceImagePath 被处理的图片文件路径 + * @param savePath 处理后保存路径 + * @param targetWidth 放大(缩小)后的宽度 + * @param targetHeight 放大(缩小)后的高度 + * @param more 是否多张图片 + * @param exp 多张图片的规则,例如1.jpg|2.jpg|3.jpg 那么exp=| + */ + public static void zoom(String sourceImagePath, String savePath,int targetWidth,int targetHeight,boolean more, String exp) { + File file = null; + BufferedImage original = null; + BufferedImage bufOut = null; + int width, height; + if (more) { + file = new File(sourceImagePath); + try { + original = ImageIO.read(file); + } catch (IOException e) { + LOGGER.debug(e); + } + width = original.getWidth(); + height = original.getHeight(); + if ((targetWidth>= width) && (targetHeight >= height)) { + targetWidth = width; + targetHeight = height; + } + bufOut = new BufferedImage(width, height, original.getType()); + double xScale = new Integer(targetWidth).doubleValue() / width; + double yScale = new Integer(targetHeight).doubleValue() / height; + double scale = java.lang.Math.min(xScale, yScale); + int newWidth = new Double(original.getWidth() * scale).intValue(); + int newHeight = new Double(original.getHeight() * scale).intValue(); + AffineTransform atx = AffineTransform.getScaleInstance(scale, scale); + AffineTransformOp atop = new AffineTransformOp(atx, AffineTransformOp.TYPE_BILINEAR); + atop.filter(original, bufOut); + bufOut = bufOut.getSubimage(0, 0, newWidth, newHeight); + try { + ImageIO.write(bufOut, "JPG", file); + } catch (IOException e) { + LOGGER.debug(e); + } + + } else { + + if (sourceImagePath == null && sourceImagePath.length() > 0) + return; + String[] filePath = sourceImagePath.split(exp); + if (filePath.length > 0) { + for (int i = 0; i < filePath.length; i++) { + + file = new File(savePath); + try { + original = ImageIO.read(file); + } catch (Exception e) { + return; + } + + width = original.getWidth(); + height = original.getHeight(); + if ((targetWidth >= width) && (targetHeight >= height)) { + targetWidth = width; + targetHeight = height; + } + bufOut = new BufferedImage(width, height, original.getType()); + double xScale = new Integer(targetWidth).doubleValue() / width; + double yScale = new Integer(targetHeight).doubleValue() / height; + double scale = java.lang.Math.min(xScale, yScale); + int newWidth = new Double(original.getWidth() * scale).intValue(); + int newHeight = new Double(original.getHeight() * scale).intValue(); + AffineTransform atx = AffineTransform.getScaleInstance(scale, scale); + AffineTransformOp atop = new AffineTransformOp(atx, AffineTransformOp.TYPE_BILINEAR); + atop.filter(original, bufOut); + bufOut = bufOut.getSubimage(0, 0, newWidth, newHeight); + try { + ImageIO.write(bufOut, "JPG", new File(savePath)); + } catch (IOException e) { + LOGGER.debug(e); + } + } + } + } + } +} diff --git a/src/main/java/com/mingsoft/util/JsonUtil.java b/src/main/java/com/mingsoft/util/JsonUtil.java new file mode 100644 index 00000000..18557121 --- /dev/null +++ b/src/main/java/com/mingsoft/util/JsonUtil.java @@ -0,0 +1,319 @@ +package com.mingsoft.util; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + + +public class JsonUtil { + + /** + * 从一个JSON 对象字符格式中得到一个java对象 + * + * @param jsonString + * @param pojoCalss + * @return + */ + public static Object getObject4JsonString(String jsonString, Class pojoCalss) { + Object pojo; +// JSONObject jsonObject = JSONObject.fromObject(jsonString); +// pojo = JSONObject.toBean(jsonObject, pojoCalss); + JSONObject jsonObject = JSONObject.parseObject(jsonString); + pojo = JSONObject.toJavaObject(jsonObject, pojoCalss); + return pojo; + } + + /** + * 从json HASH表达式中获取一个map,改map支持嵌套功能 + * + * @param jsonString + * @return + */ + public static Map getMap4Json(String jsonString) { +// JSONObject jsonObject = JSONObject.fromObject(jsonString); + JSONObject jsonObject = JSONObject.parseObject(jsonString); +// Iterator keyIter = jsonObject.keys(); + Iterator keyIter = jsonObject.keySet().iterator(); + String key; + Object value; + Map valueMap = new HashMap(); + + while (keyIter.hasNext()) { + key = (String) keyIter.next(); + value = jsonObject.get(key); + valueMap.put(key, value); + } + + return valueMap; + } + + /** + * 从json数组中得到相应java数组 + * + * @param jsonString + * @return + */ + public static Object[] getObjectArray4Json(String jsonString) { +// JSONArray jsonArray = JSONArray.fromObject(jsonString); + JSONArray jsonArray = JSONArray.parseArray(jsonString); + return jsonArray.toArray(); + } + + /** + * 将一个对象转换为JSON字符串 + * @param obj + * @return + */ + public static String getObjectToJsonObject(Object obj){ + return JSON.toJSON(obj).toString(); + } + +// /** +// * 从json对象集合表达式中得到一个java对象列表 +// * +// * @param jsonString +// * @param pojoClass +// * @return +// */ +// @SuppressWarnings("unchecked") +// public static List getList4Json(String jsonString, Class pojoClass) { +// +//// JSONArray jsonArray = JSONArray.fromObject(jsonString); +// JSONObject jsonArray = JSONObject.parseObject(jsonString); +// JSONObject jsonObject; +// Object pojoValue; +// +// List list = new ArrayList(); +// for (int i = 0; i < jsonArray.size(); i++) { +// +//// jsonObject = jsonArray.getJSONObject(i); +//// pojoValue = JSONObject.toBean(jsonObject, pojoClass); +// jsonObject = jsonArray.get(i); +// list.add(pojoValue); +// +// } +// return list; +// +// } + + /** + * 从json数组中解析出java字符串数组 + * + * @param jsonString + * @return + */ + public static String[] getStringArray4Json(String jsonString) { + +// JSONArray jsonArray = JSONArray.fromObject(jsonString); + JSONArray jsonArray = JSONArray.parseArray(jsonString); + + String[] stringArray = new String[jsonArray.size()]; + + for (int i = 0; i < jsonArray.size(); i++) { + stringArray[i] = jsonArray.get(i).toString(); + } + + return stringArray; + } + +// /** +// * 从json数组中解析出javaLong型对象数组 +// * +// * @param jsonString +// * @return +// */ +// public static Long[] getLongArray4Json(String jsonString) { +// +// JSONArray jsonArray = JSONArray.fromObject(jsonString); +// Long[] longArray = new Long[jsonArray.size()]; +// for (int i = 0; i < jsonArray.size(); i++) { +// longArray[i] = jsonArray.getLong(i); +// +// } +// return longArray; +// } +// +// /** +// * 从json数组中解析出java Integer型对象数组 +// * +// * @param jsonString +// * @return +// */ +// public static Integer[] getIntegerArray4Json(String jsonString) { +// +// JSONArray jsonArray = JSONArray.fromObject(jsonString); +// Integer[] integerArray = new Integer[jsonArray.size()]; +// for (int i = 0; i < jsonArray.size(); i++) { +// integerArray[i] = jsonArray.getInt(i); +// +// } +// return integerArray; +// } +// +// /** +// * 从json数组中解析出java Date 型对象数组,使用本方法必须保证 +// * +// * @param jsonString +// * @return +// */ +// public static Date[] getDateArray4Json(String jsonString, String DataFormat) { +// +// JSONArray jsonArray = JSONArray.fromObject(jsonString); +// Date[] dateArray = new Date[jsonArray.size()]; +// @SuppressWarnings("unused") +// String dateString; +// Date date = null; +// for (int i = 0; i < jsonArray.size(); i++) { +// dateString = jsonArray.getString(i); +// // date = DateUtil.stringToDate(dateString, DataFormat); +// dateArray[i] = date; +// +// } +// return dateArray; +// } +// +// /** +// * 从json数组中解析出java Integer型对象数组 +// * +// * @param jsonString +// * @return +// */ +// public static Double[] getDoubleArray4Json(String jsonString) { +// +// JSONArray jsonArray = JSONArray.fromObject(jsonString); +// Double[] doubleArray = new Double[jsonArray.size()]; +// for (int i = 0; i < jsonArray.size(); i++) { +// doubleArray[i] = jsonArray.getDouble(i); +// +// } +// return doubleArray; +// } +// +// /** +// * 将java对象转换成json字符串 +// * +// * @param javaObj +// * @return +// */ +// public static String getJsonString4JavaPOJO(Object javaObj) { +// +// JSONObject json; +// json = JSONObject.fromObject(javaObj); +// return json.toString(); +// +// } +// +// /** +// * 将java对象转换成json字符串,并设定日期格式 +// * +// * @param javaObj +// * @param dataFormat +// * @return +// */ +// public static String getJsonString4JavaPOJO(Object javaObj, String dataFormat) { +// +// JSONObject json; +// JsonConfig jsonConfig = configJson(dataFormat); +// json = JSONObject.fromObject(javaObj, jsonConfig); +// return json.toString(); +// +// } +// +// /** +// * JSON 时间解析器具 +// * +// * @param datePattern +// * @return +// */ +// public static JsonConfig configJson(String datePattern) { +// JsonConfig jsonConfig = new JsonConfig(); +// jsonConfig.setExcludes(new String[] { "" }); +// jsonConfig.setIgnoreDefaultExcludes(false); +// jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); +// jsonConfig.registerJsonValueProcessor(Date.class, new DateJsonValueProcessor(datePattern)); +// +// return jsonConfig; +// } +// +// /** +// * @param object +// * 任意对象 +// * @return java.lang.String +// */ +// public static String objectToJson(Object object) { +// StringBuilder json = new StringBuilder(); +// if (object == null) { +// json.append("\"\""); +// } else if (object instanceof String || object instanceof Integer) { +// json.append("\"").append(object.toString()).append("\""); +// } else { +// json.append(beanToJson(object)); +// } +// return json.toString(); +// } +// +// /** +// * 功能描述:传入任意一个 javabean 对象生成一个指定规格的字符串 +// * +// * @param bean +// * bean对象 +// * @return String +// */ +// public static String beanToJson(Object bean) { +// StringBuilder json = new StringBuilder(); +// json.append("{"); +// PropertyDescriptor[] props = null; +// try { +// props = Introspector.getBeanInfo(bean.getClass(), Object.class).getPropertyDescriptors(); +// } catch (IntrospectionException e) { +// } +// if (props != null) { +// for (int i = 0; i < props.length; i++) { +// try { +// String name = objectToJson(props[i].getName()); +// String value = objectToJson(props[i].getReadMethod().invoke(bean)); +// json.append(name); +// json.append(":"); +// json.append(value); +// json.append(","); +// } catch (Exception e) { +// } +// } +// json.setCharAt(json.length() - 1, '}'); +// } else { +// json.append("}"); +// } +// return json.toString(); +// } +// +// +// +// +// /** +// * 数组转换成json格式 +// * @param list list集合 +// * @return +// */ +// public static String listToJson(List list) { +// return JSONArray.fromObject(list).toString(); +// } +// /** +// * +// * @param excludes +// * @param datePattern +// * @return +// */ +// public static JsonConfig configJson(String[] excludes, String datePattern) { +// JsonConfig jsonConfig = new JsonConfig(); +// jsonConfig.setExcludes(excludes); +// jsonConfig.setIgnoreDefaultExcludes(false); +// jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); +// jsonConfig.registerJsonValueProcessor(Date.class, new DateJsonValueProcessor(datePattern)); +// +// return jsonConfig; +// } +} \ No newline at end of file diff --git a/src/main/java/com/mingsoft/util/MD5Util.java b/src/main/java/com/mingsoft/util/MD5Util.java new file mode 100644 index 00000000..4bbca3fa --- /dev/null +++ b/src/main/java/com/mingsoft/util/MD5Util.java @@ -0,0 +1,38 @@ +package com.mingsoft.util; + +import java.security.MessageDigest; + +public class MD5Util { + private static String byteArrayToHexString(byte b[]) { + StringBuffer resultSb = new StringBuffer(); + for (int i = 0; i < b.length; i++) + resultSb.append(byteToHexString(b[i])); + return resultSb.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n += 256; + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + hexDigits[d2]; + } + + + public static String MD5Encode(String origin, String charsetname) { + String resultString = null; + try { + resultString = new String(origin); + MessageDigest md = MessageDigest.getInstance("MD5"); + if (charsetname == null || "".equals(charsetname)) + resultString = byteArrayToHexString(md.digest(resultString.getBytes())); + else + resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname))); + } catch (Exception exception) { + } + return resultString; + } + + private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; +} diff --git a/src/main/java/com/mingsoft/util/MailUtil.java b/src/main/java/com/mingsoft/util/MailUtil.java new file mode 100644 index 00000000..70a7d57a --- /dev/null +++ b/src/main/java/com/mingsoft/util/MailUtil.java @@ -0,0 +1,235 @@ +package com.mingsoft.util; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.mail.internet.MimeMessage; + +import org.springframework.core.io.FileSystemResource; +import org.springframework.mail.SimpleMailMessage; +import org.springframework.mail.javamail.JavaMailSenderImpl; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.messaging.MessagingException; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author 王天培 QQ:78750478 + * + *

+ * Comments:邮件发送通用,依赖spring的mail, + *

+ * + *

+ * Create Date:2014-11-4 + *

+ * + *

+ * Modification history: + *

+ */ +public class MailUtil { + + /** + * 发送简单的文字邮件 + * + * @param host 主机 + * @param port 端口 + * @param userName 账号 + * @param password 密码 + * @param title 标题 + * @param content 内容 + * @param toUser 接收人 + */ + public static void sendText(String host, int port, String userName, String password, String title, String content, String[] toUser) { + JavaMailSenderImpl senderImpl = new JavaMailSenderImpl(); + // 设定mail server + senderImpl.setHost(host); + senderImpl.setPort(port); + // 建立邮件消息 + SimpleMailMessage mailMessage = new SimpleMailMessage(); + // 设置收件人,寄件人 用数组发送多个邮件 + // String[] array = new String[] {"sun111@163.com","sun222@sohu.com"}; + // mailMessage.setTo(array); + mailMessage.setTo(toUser); + mailMessage.setFrom(userName); + mailMessage.setSubject(title); + mailMessage.setText(content); + + senderImpl.setUsername(userName); // 根据自己的情况,设置username + senderImpl.setPassword(password); // 根据自己的情况, 设置password + + Properties prop = new Properties(); + prop.put(" mail.smtp.auth ", " true "); // 将这个参数设为true,让服务器进行认证,认证用户名和密码是否正确 + prop.put(" mail.smtp.timeout ", " 25000 "); + senderImpl.setJavaMailProperties(prop); + // 发送邮件 + senderImpl.send(mailMessage); + } + + /** + * 发送简html内容的邮件 + * + * @param host 主机 + * @param port 端口 + * @param userName 账号 + * @param password 密码 + * @param title 标题 + * @param content html内容 + * @param toUser 接收人 + * @throws javax.mail.MessagingException + */ + public static void sendHtml(String host, int port, String userName, String password, String title, String content, String[] toUser){ + JavaMailSenderImpl senderImpl = new JavaMailSenderImpl(); + // 设定mail server + senderImpl.setHost(host); + senderImpl.setPort(port); + // 建立邮件消息,发送简单邮件和html邮件的区别 + MimeMessage mailMessage = senderImpl.createMimeMessage(); + + try { + MimeMessageHelper messageHelper = new MimeMessageHelper(mailMessage,true,"UTF-8"); + + try { + // 设置收件人,寄件人 + messageHelper.setTo(toUser); + messageHelper.setFrom(userName); + messageHelper.setSubject(title); + // true 表示启动HTML格式的邮件 + messageHelper.setText(content, true); + } catch (javax.mail.MessagingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + senderImpl.setUsername(userName); // 根据自己的情况,设置username + senderImpl.setPassword(password); // 根据自己的情况, 设置password + Properties prop = new Properties(); + prop.put("mail.smtp.auth", "true"); // 将这个参数设为true,让服务器进行认证,认证用户名和密码是否正确 + prop.put("mail.smtp.timeout", "25000"); + senderImpl.setJavaMailProperties(prop); + // 发送邮件 + senderImpl.send(mailMessage); + } catch (javax.mail.MessagingException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + + } + + /** + * 发送带图片的html邮件, + * + * @param host 主机 + * @param port 端口 + * @param userName 账号 + * @param password 密码 + * @param title 标题 + * @param content 带图片的html内容 + * @param imgs 图片地址, + * @param toUser 接收人 + * @throws javax.mail.MessagingException + */ + public static void sendNews(String host, int port, String userName, String password, String title, String content, List imgs, + String[] toUser) throws MessagingException, javax.mail.MessagingException { + JavaMailSenderImpl senderImpl = new JavaMailSenderImpl(); + // 设定mail server + senderImpl.setHost(host); + + // 建立邮件消息,发送简单邮件和html邮件的区别 + MimeMessage mailMessage = senderImpl.createMimeMessage(); + // 注意这里的boolean,等于真的时候才能嵌套图片,在构建MimeMessageHelper时候,所给定的值是true表示启用, + // multipart模式 + MimeMessageHelper messageHelper = new MimeMessageHelper(mailMessage, true); + + // 设置收件人,寄件人 + messageHelper.setTo(toUser); + messageHelper.setFrom(userName); + messageHelper.setSubject(title); + // true 表示启动HTML格式的邮件 + messageHelper.setText(content, true); + + int i = 0; + for (String imagePath : imgs) { + FileSystemResource img = new FileSystemResource(new File(imagePath)); + messageHelper.addInline(i + "", img); + i++; + } + + senderImpl.setUsername(userName); // 根据自己的情况,设置username + senderImpl.setPassword(password); // 根据自己的情况, 设置password + Properties prop = new Properties(); + prop.put("mail.smtp.auth", "true"); // 将这个参数设为true,让服务器进行认证,认证用户名和密码是否正确 + prop.put("mail.smtp.timeout", "25000"); + senderImpl.setJavaMailProperties(prop); + // 发送邮件 + senderImpl.send(mailMessage); + + // 发送邮件 + senderImpl.send(mailMessage); + } + + /** + * 发送带附件的html邮件, + * + * @param host 主机 + * @param port 端口 + * @param userName 账号 + * @param password 密码 + * @param title 标题 + * @param content 带图片的html内容 + * @param files 附件list> + * @param toUser 接收人 + * @throws javax.mail.MessagingException + */ + public static void sendAttached(String host, int port, String userName, String password, String title, String content, + List> files, String[] toUser) throws MessagingException, javax.mail.MessagingException { + JavaMailSenderImpl senderImpl = new JavaMailSenderImpl(); + + // 设定mail server + senderImpl.setHost(host); + // 建立邮件消息,发送简单邮件和html邮件的区别 + MimeMessage mailMessage = senderImpl.createMimeMessage(); + // 注意这里的boolean,等于真的时候才能嵌套图片,在构建MimeMessageHelper时候,所给定的值是true表示启用, + // multipart模式 为true时发送附件 可以设置html格式 + MimeMessageHelper messageHelper = new MimeMessageHelper(mailMessage, true, "utf-8"); + + // 设置收件人,寄件人 + messageHelper.setTo(toUser); + messageHelper.setFrom(userName); + messageHelper.setSubject(title); + // true 表示启动HTML格式的邮件 + messageHelper.setText(content, true); + + for (Map filePath : files) { + Iterator it = filePath.keySet().iterator(); + String fileName = it.next(); + FileSystemResource file = new FileSystemResource(new File(filePath.get(fileName))); + // 这里的方法调用和插入图片是不同的。 + messageHelper.addAttachment(fileName, file); + } + + senderImpl.setUsername(userName); // 根据自己的情况,设置username + senderImpl.setPassword(password); // 根据自己的情况, 设置password + Properties prop = new Properties(); + prop.put("mail.smtp.auth", "true"); // 将这个参数设为true,让服务器进行认证,认证用户名和密码是否正确 + prop.put("mail.smtp.timeout", "25000"); + senderImpl.setJavaMailProperties(prop); + // 发送邮件 + senderImpl.send(mailMessage); + } +} diff --git a/src/main/java/com/mingsoft/util/MatrixImageUtil.java b/src/main/java/com/mingsoft/util/MatrixImageUtil.java new file mode 100644 index 00000000..70307aa9 --- /dev/null +++ b/src/main/java/com/mingsoft/util/MatrixImageUtil.java @@ -0,0 +1,126 @@ +package com.mingsoft.util; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.Hashtable; + +import javax.imageio.ImageIO; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.BinaryBitmap; +import com.google.zxing.DecodeHintType; +import com.google.zxing.LuminanceSource; +import com.google.zxing.MultiFormatReader; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.ReaderException; +import com.google.zxing.Result; +import com.google.zxing.client.j2se.BufferedImageLuminanceSource; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.common.HybridBinarizer; + +/** + * + *

+ * 铭飞基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author wangtp + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科 + *

+ * + *

+ * Comments: 二维码生成与解析通用类 + *

+ * + *

+ * Create Date:2014-1-3 + *

+ * + *

+ * Modification history: + *

+ */ +public class MatrixImageUtil { + + /** + * 生成二维码 + * + * @param content + * 需要生成的内容 + * @param imgPath + * 生成后保存的地址 + * @param width + * 宽度 + * @param height + * 高度 + */ + @SuppressWarnings("deprecation") + public static void encode(String content, String imgPath, int width, int height) { + try { + if (StringUtil.isBlank(content) || StringUtil.isBlank(imgPath)) { + return; + } + BitMatrix byteMatrix; + byteMatrix = new MultiFormatWriter().encode(new String(content + .getBytes("utf-8"), "iso-8859-1"), BarcodeFormat.QR_CODE, + width, height); + File file = new File(imgPath); + MatrixToImageWriter.writeToFile(byteMatrix, "png", file); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 解析二维码 + * + * @param imgPath + * 二维码路径 + * @return 返回解析后的内容 + */ + @SuppressWarnings("unchecked") + public static String decode(String imgPath) { + try { + File file = new File(imgPath); + BufferedImage image; + try { + image = ImageIO.read(file); + if (image == null) { + System.out.println("Could not decode image"); + } + LuminanceSource source = new BufferedImageLuminanceSource(image); + BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer( + source)); + Result result; + @SuppressWarnings("rawtypes") + Hashtable hints = new Hashtable(); + hints.put(DecodeHintType.CHARACTER_SET, "GBK"); + result = new MultiFormatReader().decode(bitmap, hints); + String resultStr = result.getText(); + return resultStr; + } catch (IOException ioe) { + System.out.println(ioe.toString()); + } catch (ReaderException re) { + System.out.println(re.toString()); + } + + } catch (Exception ex) { + + } + return ""; + } +} diff --git a/src/main/java/com/mingsoft/util/PageUtil.java b/src/main/java/com/mingsoft/util/PageUtil.java new file mode 100644 index 00000000..f5c3e62b --- /dev/null +++ b/src/main/java/com/mingsoft/util/PageUtil.java @@ -0,0 +1,321 @@ +package com.mingsoft.util; + +/** + * + *

+ * 铭飞基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author wangtp + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科 + *

+ * + *

+ * Comments: 分页通用模块
+ * 提供两个构造方式: + * PageUtil(int pageNo, int recordCount, String linkUrl) 不需要设置一页显示数量 默认每页10条 + * public PageUtil(int pageNo, int pageSize, int recordCount, String linkUrl) 可以手动设置分页数量 + * + * + *

+ * + *

+ * Create Date:2013-12-29 + *

+ * + *

+ * Modification history: + *

+ */ +public class PageUtil { + + /** + * 首页 + */ + protected int index; + + /** + * 首页连接地址 + */ + protected String indexUrl; + + /** + * 上一页 + */ + protected int previous; + + /** + * 上一页连接地址 + */ + protected String previousUrl; + + /** + * 下一页 + */ + protected int next; + + /** + * 下一页连接地址 + */ + protected String nextUrl; + + /** + * 最后一页 + */ + protected int last; + + /** + * 最后一页连接地址 + */ + protected String lastUrl; + /** + * 总记录数 + */ + protected int recordCount; + + /** + * 连接地址,带http格式 + */ + protected String linkUrl; + + /** + * 当前页码 + */ + protected int pageNo; + + public void setPageNo(int pageNo) { + this.pageNo = pageNo; + } + + /** + * 总页数 + */ + protected int pageCount; + + /** + * 一页显示数量 + */ + protected int pageSize = 10; + + /** + * 连接地址是否有参数 false:没有 true:有 + */ + private boolean hasParams; + + + /** + * 获取总页数 + * @return + */ + public int getPageCount() { + return pageCount; + } + + public void setPageCount(int pageCount) { + this.pageCount = pageCount; + } + + /** + * 只提供给数据查询用。例如导出数据的记录现在,pageSize=9999,表示查询9999条记录,没有分页效果 + * @param pageSize + */ + public PageUtil(int pageSize) { + this.pageSize = pageSize; + this.pageNo =0; + } + /** + * 初始化分页实体类,默认每页10条 + * + * @param pageNo + * 当前页码默认调用BaseAction的getPageNo()方法 + * @param recordCount + * 总记录数 + * @param linkUrl + * 分页连接地址 + */ + public PageUtil(int pageNo, int recordCount, String linkUrl) { + this.pageNo = pageNo-1; + this.recordCount = recordCount; + this.linkUrl = linkUrl==null?"":linkUrl; + + calculatePageCount(); + + } + + /** + * 初始化分页实体类 + * + * @param pageNo + * 当前页码 + * @param pageSize + * 一页显示的数量 + * @param recordCount + * 总记录数 + * @param linkUrl + * 分页连接地址 + */ + public PageUtil(int pageNo, int pageSize, int recordCount, String linkUrl) { + this(pageNo,recordCount,linkUrl); + this.pageSize = pageSize; + calculatePageCount(); + + if (this.pageNo+1>this.pageCount && this.pageCount>1) { + this.pageNo = this.pageCount-1; + } + } + + /** + * 计算总页数 + */ + private void calculatePageCount() { + //判读连接地址是否有参数 + if (linkUrl.indexOf("?")>0) { + hasParams = true; + } + //计算总页数 + if (this.recordCount==0) { + pageCount = 0; + } else { + //判断是否有余数 + if(recordCount % pageSize==0){ + pageCount = recordCount / pageSize; + } else { + pageCount = recordCount / pageSize + 1; + } + } + + + } + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public int getPrevious() { + return previous; + } + + public void setPrevious(int previous) { + this.previous = previous; + } + + public int getNext() { + return next; + } + + public void setNext(int next) { + this.next = next; + } + + public int getLast() { + return last; + } + + public void setLast(int last) { + this.last = last; + } + + public int getRecordCound() { + return recordCount; + } + + /** + * 获取当前页码 + * @return + */ + public int getPageNo() { + return pageNo; + } + + /** + * 获取首页链接地址 + * @return + */ + public String getIndexUrl() { + if (pageNo == 0) { + indexUrl = "#"; + } else { + indexUrl = this.linkUrl + (hasParams?"&":"?") +"pageNo=1"; + } + return indexUrl; + } + + /** + * 获取上一页的连接地址 + * @return + */ + public String getPreviousUrl() { + if (pageNo == 0) { + previousUrl = "#"; + } else { + previousUrl = this.linkUrl + (hasParams?"&":"?")+"pageNo=" + (pageNo); + } + return previousUrl; + } + + /** + * 获取下也页的连接地址 + * @return + */ + public String getNextUrl() { + if (pageNo == pageCount) { + nextUrl = "#"; + } else { + if (pageNo+2>pageCount) { + nextUrl = this.linkUrl + (hasParams?"&":"?") +"pageNo=" + pageCount; + } else { + nextUrl = this.linkUrl + (hasParams?"&":"?") +"pageNo=" + (pageNo+2); + } + } + return nextUrl; + } + + + /** + * 获取最后一页 + * @return http://weburl/?pageNo + */ + public String getLastUrl() { + if (pageNo == pageCount) { + lastUrl = "#"; + } else { + lastUrl = this.linkUrl + (hasParams?"&":"?") +"pageNo=" + pageCount; + } + return lastUrl; + } + + public int getPageSize() { + return pageSize; + } + + public String getLinkUrl() { + return linkUrl+(hasParams?"&":"?"); + } + + public void setLinkUrl(String linkUrl) { + + this.linkUrl = linkUrl; + } + + + public static void main(String[] args) { + String url = "http://localhost/mswx/admin/hotel/listHotel.do?1=1"; + System.out.println(url.indexOf("?")); + } +} diff --git a/src/main/java/com/mingsoft/util/ProxyUtil.java b/src/main/java/com/mingsoft/util/ProxyUtil.java new file mode 100644 index 00000000..ce529609 --- /dev/null +++ b/src/main/java/com/mingsoft/util/ProxyUtil.java @@ -0,0 +1,66 @@ +package com.mingsoft.util; + +import java.util.Map; + +import com.mingsoft.util.proxy.Proxy; +import com.mingsoft.util.proxy.Result; +/** + * + * + *

+ * 铭飞基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2015-2016 + *

+ * + * @author 成卫雄 (qq:330216230) + * + *

+ * Comments:代理请求工具类 + *

+ * + *

+ * Create Date:2015-5-11 下午7:42:09 + *

+ * + *

+ * Modification history: + *

+ * + */ +public class ProxyUtil { + + /** + * 发送不带头部参数的post请求
+ * @param url 发送请求的地址 + * @param encode 请求编码 + * @param params 发送参数 + * @return 请求返回内容 + */ + public static String postToContent(String url,String encode,Map params){ + //实例化请求代理 + Proxy proxy = new Proxy(); + //通过代理发送请求 + Result result = proxy.post(url,null, params, encode); + if(result == null){ + return null; + } + return result.getContent(encode); + } + + + public static String getToContent(String url,String encode,Map params){ + //实例化请求代理 + Proxy proxy = new Proxy(); + //通过代理发送请求 + Result result = proxy.get(url,null, params,encode); + if(result == null){ + return null; + } + return result.getContent(encode); + } + + +} diff --git a/src/main/java/com/mingsoft/util/QrcodeUtil.java b/src/main/java/com/mingsoft/util/QrcodeUtil.java new file mode 100644 index 00000000..b69e43b0 --- /dev/null +++ b/src/main/java/com/mingsoft/util/QrcodeUtil.java @@ -0,0 +1,150 @@ +/** + * + */ +package com.mingsoft.util; + +/** + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments:二维码生成 + *

+ * + *

+ * Create Date:2015-3-24 + *

+ * + *

+ * Modification history: + *

+ */ +/** + * + */ + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.Hashtable; +import java.util.Map; + +import javax.imageio.ImageIO; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.BinaryBitmap; +import com.google.zxing.DecodeHintType; +import com.google.zxing.EncodeHintType; +import com.google.zxing.LuminanceSource; +import com.google.zxing.MultiFormatReader; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.ReaderException; +import com.google.zxing.Result; +import com.google.zxing.Writer; +import com.google.zxing.WriterException; +import com.google.zxing.client.j2se.BufferedImageLuminanceSource; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.common.HybridBinarizer; +import com.google.zxing.oned.CodaBarWriter; +import com.google.zxing.oned.Code128Writer; +import com.google.zxing.oned.Code39Writer; +import com.google.zxing.oned.EAN13Writer; +import com.google.zxing.oned.EAN8Writer; +import com.google.zxing.oned.ITFWriter; +import com.google.zxing.oned.UPCAWriter; +import com.google.zxing.qrcode.QRCodeWriter; + +/** + * + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments: 利用zxing开源工具生成二维码QRCode + *

+ * + *

+ * Create Date:2015-3-24 + *

+ * + *

+ * Modification history: + *

+ */ +public class QrcodeUtil { + private static final int BLACK = 0xff000000; + private static final int WHITE = 0xFFFFFFFF; + + /** + * 生成QRCode二维码
+ * 在编码时需要将com.google.zxing.qrcode.encoder.Encoder.java中的
+ * static final String DEFAULT_BYTE_MODE_ENCODING = "ISO8859-1";
+ * 修改为UTF-8,否则中文编译后解析不了
+ */ + public static void encode(String contents, File file, BarcodeFormat format, int width, int height, Map hints) { + try { + BitMatrix bitMatrix = new MultiFormatWriter().encode(contents, format, width, height); + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + image.setRGB(x, y, bitMatrix.get(x, y) == true ? BLACK : WHITE); + } + } + ImageIO.write(image, "png", file); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 解析QRCode二维码 + */ + @SuppressWarnings("unchecked") + public void decode(File file) { + try { + BufferedImage image; + try { + image = ImageIO.read(file); + if (image == null) { + System.out.println("Could not decode image"); + } + LuminanceSource source = new BufferedImageLuminanceSource(image); + BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); + Result result; + @SuppressWarnings("rawtypes") + Hashtable hints = new Hashtable(); + // 解码设置编码方式为:utf-8 + hints.put(DecodeHintType.CHARACTER_SET, "utf-8"); + result = new MultiFormatReader().decode(bitmap, hints); + String resultStr = result.getText(); + System.out.println("解析后内容:" + resultStr); + } catch (IOException ioe) { + System.out.println(ioe.toString()); + } catch (ReaderException re) { + System.out.println(re.toString()); + } + } catch (Exception ex) { + System.out.println(ex.toString()); + } + } +} diff --git a/src/main/java/com/mingsoft/util/QuartzUtil.java b/src/main/java/com/mingsoft/util/QuartzUtil.java new file mode 100644 index 00000000..a38092cd --- /dev/null +++ b/src/main/java/com/mingsoft/util/QuartzUtil.java @@ -0,0 +1,279 @@ +package com.mingsoft.util; + +import org.quartz.CronScheduleBuilder; +import org.quartz.CronTrigger; +import org.quartz.JobBuilder; +import org.quartz.JobDetail; +import org.quartz.JobKey; +import org.quartz.Scheduler; +import org.quartz.SchedulerFactory; +import org.quartz.Trigger; +import org.quartz.TriggerBuilder; +import org.quartz.TriggerKey; +import org.quartz.impl.StdSchedulerFactory; + +/** + * + * + * + * + *

+ * 铭飞科技 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + * @author killfen + * + *

+ * Comments:定时任务管理类 + *

+ * + *

+ * Create Date:2015-5-26 + *

+ * + *

+ * Modification history: + *

+ */ +public class QuartzUtil { + private static SchedulerFactory gSchedulerFactory = new StdSchedulerFactory(); + + + private static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME"; + private static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME"; + + /** + * @Description: 添加一个定时任务,使用默认的任务组名,触发器名,触发器组名 + * + * @param jobName + * 任务名 + * @param cls + * 任务 + * @param time + * 时间设置,参考quartz说明文档 + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:47:44 + * @version V2.0 + */ + @SuppressWarnings("unchecked") + public static void addJob(String jobName, Class cls, String time) { + try { + Scheduler sched = gSchedulerFactory.getScheduler(); + JobDetail jobDetail = JobBuilder.newJob(cls).withIdentity(jobName, JOB_GROUP_NAME).build();// 任务名,任务组,任务执行类 + Trigger trigger = TriggerBuilder.newTrigger().withIdentity(new TriggerKey(jobName, TRIGGER_GROUP_NAME)).startNow().withSchedule(CronScheduleBuilder.cronSchedule(time)).build(); + sched.scheduleJob(jobDetail, trigger); + // 启动 + if (!sched.isShutdown()) { + sched.start(); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 添加一个定时任务 + * + * @param jobName + * 任务名 + * @param jobGroupName + * 任务组名 + * @param triggerName + * 触发器名 + * @param triggerGroupName + * 触发器组名 + * @param jobClass + * 任务 + * @param time + * 时间设置,参考quartz说明文档 + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:48:15 + * @version V2.0 + */ + @SuppressWarnings("unchecked") + public static void addJob(String jobName, String jobGroupName, String triggerName, String triggerGroupName, Class jobClass, String time) { + try { + Scheduler sched = gSchedulerFactory.getScheduler(); + JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(jobName, jobGroupName).build();// 任务名,任务组,任务执行类 + Trigger trigger = TriggerBuilder.newTrigger().withIdentity(new TriggerKey(triggerName, triggerGroupName)).startNow().withSchedule(CronScheduleBuilder.cronSchedule(time)).build(); + sched.scheduleJob(jobDetail, trigger); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 修改一个任务的触发时间(使用默认的任务组名,触发器名,触发器组名) + * + * @param jobName + * @param time + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:49:21 + * @version V2.0 + */ + @SuppressWarnings("unchecked") + public static void modifyJobTime(String jobName, String time) { + try { + Scheduler sched = gSchedulerFactory.getScheduler(); + TriggerKey triggerKey = TriggerKey.triggerKey(jobName,TRIGGER_GROUP_NAME); + CronTrigger trigger = (CronTrigger) sched.getTrigger(triggerKey); + if (trigger == null) { + return; + } + String oldTime = trigger.getCronExpression(); + if (!oldTime.equalsIgnoreCase(time)) { + JobKey job = JobKey.jobKey(jobName); + JobDetail jobDetail = sched.getJobDetail(job); + Class objJobClass = jobDetail.getJobClass(); + removeJob(jobName); + addJob(jobName, objJobClass, time); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 修改一个任务的触发时间 + * + * @param triggerName + * @param triggerGroupName + * @param time + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:49:37 + * @version V2.0 + */ + public static void modifyJobTime(String triggerName, String triggerGroupName, String time) { + try { + Scheduler sched = gSchedulerFactory.getScheduler(); + TriggerKey triggerKey = TriggerKey.triggerKey(triggerName); + CronTrigger trigger = (CronTrigger) sched.getTrigger(triggerKey); + if (trigger == null) { + return; + } + String oldTime = trigger.getCronExpression(); + if (!oldTime.equalsIgnoreCase(time)) { + trigger.getTriggerBuilder().startNow().withSchedule(CronScheduleBuilder.cronSchedule(time)); + // 重启触发器 + sched.resumeTrigger(triggerKey); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 移除一个任务(使用默认的任务组名,触发器名,触发器组名) + * + * @param jobName + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:49:51 + * @version V2.0 + */ + public static void removeJob(String jobName) { + try { + Scheduler sched = gSchedulerFactory.getScheduler(); + JobKey job = JobKey.jobKey(jobName,JOB_GROUP_NAME); + TriggerKey triggerKey = TriggerKey.triggerKey(jobName,TRIGGER_GROUP_NAME); + sched.pauseTrigger(triggerKey);// 停止触发器 + sched.unscheduleJob(triggerKey);// 移除触发器 + sched.deleteJob(job);// 删除任务 + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 移除一个任务 + * + * @param jobName + * @param jobGroupName + * @param triggerName + * @param triggerGroupName + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:50:01 + * @version V2.0 + */ + public static void removeJob(String jobName, String jobGroupName, String triggerName, String triggerGroupName) { + try { + Scheduler sched = gSchedulerFactory.getScheduler(); + JobKey job = JobKey.jobKey(jobName, jobGroupName); + TriggerKey triggerKey = TriggerKey.triggerKey(jobName, jobGroupName); + sched.pauseTrigger(triggerKey);// 停止触发器 + sched.unscheduleJob(triggerKey);// 移除触发器 + sched.deleteJob(job);// 删除任务 + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description:启动所有定时任务 + * + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:50:18 + * @version V2.0 + */ + public static void startJobs() { + try { + Scheduler sched = gSchedulerFactory.getScheduler(); + sched.start(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description:关闭所有定时任务 + * + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:50:26 + * @version V2.0 + */ + public static void shutdownJobs() { + try { + Scheduler sched = gSchedulerFactory.getScheduler(); + if (!sched.isShutdown()) { + sched.shutdown(); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/src/main/java/com/mingsoft/util/RandomUtil.java b/src/main/java/com/mingsoft/util/RandomUtil.java new file mode 100644 index 00000000..30b4b031 --- /dev/null +++ b/src/main/java/com/mingsoft/util/RandomUtil.java @@ -0,0 +1,181 @@ +package com.mingsoft.util; + +import java.util.Random; + +/** + * 随机数、随即字符串工具 + *

+ * 铭飞基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2014 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author wangtp + * + * @version 300-001-001 + * + *

+ * 版权所有 铭飞科 + *

+ * + *

+ * Comments: + *

+ * + *

+ * Create Date:2014-1-2 + *

+ * + *

+ * Modification history: + *

+ */ +public class RandomUtil { + public static final String allChar = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static final String letterChar = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static final String numberChar = "0123456789"; + + + /** + * 返回一个定长的随机数字(数字) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateNumber(int length) { + StringBuffer sb = new StringBuffer(); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(numberChar.charAt(random.nextInt(numberChar.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机字符串(只包含大小写字母、数字) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateString(int length) { + StringBuffer sb = new StringBuffer(); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(allChar.charAt(random.nextInt(allChar.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateMixString(int length) { + StringBuffer sb = new StringBuffer(); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(allChar.charAt(random.nextInt(letterChar.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯大写字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateLowerString(int length) { + return generateMixString(length).toLowerCase(); + } + + /** + * 返回一个定长的随机纯小写字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateUpperString(int length) { + return generateMixString(length).toUpperCase(); + } + + /** + * 生成一个定长的纯0字符串 + * + * @param length + * 字符串长度 + * @return 纯0字符串 + */ + public static String generateZeroString(int length) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < length; i++) { + sb.append('0'); + } + return sb.toString(); + } + + /** + * 根据数字生成一个定长的字符串,长度不够前面补0 + * + * @param num + * 数字 + * @param fixdlenth + * 字符串长度 + * @return 定长的字符串 + */ + public static String toFixdLengthString(long num, int fixdlenth) { + StringBuffer sb = new StringBuffer(); + String strNum = String.valueOf(num); + if (fixdlenth - strNum.length() >= 0) { + sb.append(generateZeroString(fixdlenth - strNum.length())); + } else { + throw new RuntimeException("将数字" + num + "转化为长度为" + fixdlenth+ "的字符串发生异常!"); + } + sb.append(strNum); + return sb.toString(); + } + + /** + * 根据数字生成一个定长的字符串,长度不够前面补0 + * + * @param num + * 数字 + * @param fixdlenth + * 字符串长度 + * @return 定长的字符串 + */ + public static String toFixdLengthString(int num, int fixdlenth) { + StringBuffer sb = new StringBuffer(); + String strNum = String.valueOf(num); + if (fixdlenth - strNum.length() >= 0) { + sb.append(generateZeroString(fixdlenth - strNum.length())); + } else { + throw new RuntimeException("将数字" + num + "转化为长度为" + fixdlenth + "的字符串发生异常!"); + } + sb.append(strNum); + return sb.toString(); + } + + /** + * 随机生成一个大于零的整数 + * @param numLength 这个小于多少,如:0~100之间填写100即可 + * @return 生成的随机数 + */ + public static int rondomOneNum(int numLength){ + Random random = new Random(); + return random.nextInt(numLength); + } +} \ No newline at end of file diff --git a/src/main/java/com/mingsoft/util/RegexUtil.java b/src/main/java/com/mingsoft/util/RegexUtil.java new file mode 100644 index 00000000..673fa078 --- /dev/null +++ b/src/main/java/com/mingsoft/util/RegexUtil.java @@ -0,0 +1,193 @@ +package com.mingsoft.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +/** + * 解析模版中正则表达式的工具类 + * + * @author 成卫雄 QQ:330216230 技术支持:景德镇铭飞科技 官网:www.ming-soft.com + */ +public class RegexUtil { + /** + * 返回所有匹配的结果,并且是第find组 + * + * @param source + *  模版 + * @param regex + *  标签 + * @param find + *  第几组 0:返回所有 + * @return 匹配一次的值 + */ + public static String parseFirst(String source, String regex, int find) { + String content = null; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(source); + if (matcher.find()) { + content = matcher.group(find); + } + return content; + } + + /** + * 从find位置开始匹配所有返回 + * + * @param source + *  模版 + * @param regex + *  标签 + * @param find + *  第几组 0:返回所有 + * @return 匹配一次的值 + */ + public static List parseAll(String source, String regex, int find) { + List content = new ArrayList(); + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(source); + while (matcher.find()) { + content.add(matcher.group(find)); + } + return content; + } + + /** + * 从find位置开始匹配提供返回 + * + * @param source + *  模版 + * @param regex + *  标签 + * @param newContent + *  新的内容 + * @return 替换好的内容 + */ + public static String replaceAll(String source, String regex, String newContent) { + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(source); + while (matcher.find()) { + source = matcher.replaceAll(Matcher.quoteReplacement(newContent.toString().replace("\\", "/"))); + } + return source; + } + + /** + * 替换第一个 + * + * @param source + * 原始内容 + * @param regex + *  正则 + * @param newContent + *  新内容 + * @return 替换后的内容 + */ + public static String replaceFirst(String source, String regex, String newContent) { + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(source); + if (matcher.find()) { + source = matcher.replaceFirst(Matcher.quoteReplacement(newContent)); + } + return source; + } + + /** + * 查询规则匹配次数 + * + * @param source + * 模版 + * @param regex + * 标签 + * @return 标签的数量 + */ + public static int count(String source, String regex) { + Pattern patternList = Pattern.compile(regex); + Matcher matcherList = patternList.matcher(source); + int i = 0; + while (matcherList.find()) { + i++; + } + return i; + } + + /** + * 双重匹配(采集使用) + * @param globalRegex 第一层匹配正则表达式 + * @param singleRegex 内层匹配正则表达式 + * @param context 需要截取的内容 + * @return Map key:在系统中的数据编号 value:名称 + */ + public static Map doubleRegex(String globalRegex,String singleRegex,String content){ + Map map = new HashMap(); + Pattern patternList = Pattern.compile(globalRegex); + Matcher matcherList = patternList.matcher(content); + + while (matcherList.find()) { + Pattern _patternList = Pattern.compile(singleRegex); + Matcher _matcherList = _patternList.matcher(matcherList.group()); + + while (_matcherList.find()) { + if(!StringUtil.isBlank(_matcherList.group(1)) && !StringUtil.isBlank(_matcherList.group(2))){ + map.put(_matcherList.group(1), _matcherList.group(2)); + } + } + + } + return map; + } + + /** + * 双重匹配;自定义map数据的数量(采集使用) + * @param globalRegex 第一层匹配正则表达式 + * @param singleRegex 内层匹配正则表达式 + * @param context 需要截取的内容 + * @return Map key:i value:名称 + */ + public static List> doubleRegexToMap(String globalRegex,String singleRegex,String content,int find){ + List> listAll = new ArrayList>(); + Pattern patternList = Pattern.compile(globalRegex); + Matcher matcherList = patternList.matcher(content); + + while (matcherList.find()) { + Pattern _patternList = Pattern.compile(singleRegex); + Matcher _matcherList = _patternList.matcher(matcherList.group()); + Map map = new HashMap(); + while (_matcherList.find()) { + + for(int i=0;i parseAllToList(String content, String regex, int find) { + List list = new ArrayList(); + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(content); + if (matcher.find()) { + for(int i=0;i + * 创建日期:2015年12月26日
+ * 历史修订:
+ */ +import java.net.InetAddress; +import java.net.UnknownHostException; +import org.hyperic.sigar.CpuInfo; +import org.hyperic.sigar.CpuPerc; +import org.hyperic.sigar.FileSystem; +import org.hyperic.sigar.FileSystemUsage; +import org.hyperic.sigar.Mem; +import org.hyperic.sigar.NetFlags; +import org.hyperic.sigar.NetInterfaceConfig; +import org.hyperic.sigar.NetInterfaceStat; +import org.hyperic.sigar.OperatingSystem; +import org.hyperic.sigar.Sigar; +import org.hyperic.sigar.SigarException; +import org.hyperic.sigar.SigarNotImplementedException; +import org.hyperic.sigar.Swap; + +public class ServerUtil { + // 1.CPU资源信息 // a)CPU数量(单位:个) + public static int getCpuCount() throws SigarException { + Sigar sigar = new Sigar(); + try { + return sigar.getCpuInfoList().length; + } finally { + sigar.close(); + } + } // b)CPU的总量(单位:HZ)及CPU的相关信息 + + public static void getCpuTotal() { + Sigar sigar = new Sigar(); + CpuInfo[] infos; + try { + infos = sigar.getCpuInfoList(); + for (int i = 0; i < infos.length; i++) {// 不管是单块CPU还是多CPU都适用 + CpuInfo info = infos[i]; + System.out.println("mhz=" + info.getMhz());// CPU的总量MHz + System.out.println("vendor=" + info.getVendor());// 获得CPU的卖主,如:Intel + System.out.println("model=" + info.getModel());// 获得CPU的类别,如:Celeron + System.out.println("cache size=" + info.getCacheSize());// 缓冲存储器数量 + } + } catch (SigarException e) { + e.printStackTrace(); + } + } // c)CPU的用户使用量、系统使用剩余量、总的剩余量、总的使用占用量等(单位:100%) + + public static void testCpuPerc() { + Sigar sigar = new Sigar(); + // 方式一,主要是针对一块CPU的情况 + CpuPerc cpu; + try { + cpu = sigar.getCpuPerc(); + printCpuPerc(cpu); + } catch (SigarException e) { + e.printStackTrace(); + } + // 方式二,不管是单块CPU还是多CPU都适用 + CpuPerc cpuList[] = null; + try { + cpuList = sigar.getCpuPercList(); + } catch (SigarException e) { + e.printStackTrace(); + return; + } + for (int i = 0; i < cpuList.length; i++) { + printCpuPerc(cpuList[i]); + } + } + + private static void printCpuPerc(CpuPerc cpu) { + System.out.println("User :" + CpuPerc.format(cpu.getUser()));// 用户使用率 + System.out.println("Sys :" + CpuPerc.format(cpu.getSys()));// 系统使用率 + System.out.println("Wait :" + CpuPerc.format(cpu.getWait()));// 当前等待率 + System.out.println("Nice :" + CpuPerc.format(cpu.getNice()));// + System.out.println("Idle :" + CpuPerc.format(cpu.getIdle()));// 当前空闲率 + System.out.println("Total :" + CpuPerc.format(cpu.getCombined()));// 总的使用率 + } // 2.内存资源信息 + + public static void getPhysicalMemory() { + // a)物理内存信息 + Sigar sigar = new Sigar(); + Mem mem; + try { + mem = sigar.getMem(); + // 内存总量 + System.out.println("Total = " + mem.getTotal() / 1024L + "K av"); + // 当前内存使用量 + System.out.println("Used = " + mem.getUsed() / 1024L + "K used"); + // 当前内存剩余量 + System.out.println("Free = " + mem.getFree() / 1024L + "K free"); // b)系统页面文件交换区信息 + Swap swap = sigar.getSwap(); + // 交换区总量 + System.out.println("Total = " + swap.getTotal() / 1024L + "K av"); + // 当前交换区使用量 + System.out.println("Used = " + swap.getUsed() / 1024L + "K used"); + // 当前交换区剩余量 + System.out.println("Free = " + swap.getFree() / 1024L + "K free"); + } catch (SigarException e) { + e.printStackTrace(); + } + } // 3.操作系统信息 // a)取到当前操作系统的名称: + + public static String getPlatformName() { + String hostname = ""; + try { + hostname = InetAddress.getLocalHost().getHostName(); + } catch (Exception exc) { + Sigar sigar = new Sigar(); + try { + hostname = sigar.getNetInfo().getHostName(); + } catch (SigarException e) { + hostname = "localhost.unknown"; + } finally { + sigar.close(); + } + } + return hostname; + } // b)取当前操作系统的信息 + + public static void testGetOSInfo() { + OperatingSystem OS = OperatingSystem.getInstance(); + // 操作系统内核类型如: 386、486、586等x86 + System.out.println("OS.getArch() = " + OS.getArch()); + System.out.println("OS.getCpuEndian() = " + OS.getCpuEndian());// + System.out.println("OS.getDataModel() = " + OS.getDataModel());// + // 系统描述 + System.out.println("OS.getDescription() = " + OS.getDescription()); + System.out.println("OS.getMachine() = " + OS.getMachine());// + // 操作系统类型 + System.out.println("OS.getName() = " + OS.getName()); + System.out.println("OS.getPatchLevel() = " + OS.getPatchLevel());// + // 操作系统的卖主 + System.out.println("OS.getVendor() = " + OS.getVendor()); + // 卖主名称 + System.out.println("OS.getVendorCodeName() = " + OS.getVendorCodeName()); + // 操作系统名称 + System.out.println("OS.getVendorName() = " + OS.getVendorName()); + // 操作系统卖主类型 + System.out.println("OS.getVendorVersion() = " + OS.getVendorVersion()); + // 操作系统的版本号 + System.out.println("OS.getVersion() = " + OS.getVersion()); + } // c)取当前系统进程表中的用户信息 + + public static void testWho() { + try { + Sigar sigar = new Sigar(); + org.hyperic.sigar.Who[] who = sigar.getWhoList(); + if (who != null && who.length > 0) { + for (int i = 0; i < who.length; i++) { + System.out.println("\n~~~~~~~~~" + String.valueOf(i) + "~~~~~~~~~"); + org.hyperic.sigar.Who _who = who[i]; + System.out.println("getDevice() = " + _who.getDevice()); + System.out.println("getHost() = " + _who.getHost()); + System.out.println("getTime() = " + _who.getTime()); + // 当前系统进程表中的用户名 + System.out.println("getUser() = " + _who.getUser()); + } + } + } catch (SigarException e) { + e.printStackTrace(); + } + } // 4.资源信息(主要是硬盘) // + // a)取硬盘已有的分区及其详细信息(通过sigar.getFileSystemList()来获得FileSystem列表对象,然后对其进行编历): + + public static void testFileSystemInfo() throws Exception { + Sigar sigar = new Sigar(); + FileSystem fslist[] = sigar.getFileSystemList(); + // String dir = System.getProperty("user.home");// 当前用户文件夹路径 + for (int i = 0; i < fslist.length; i++) { + System.out.println("\n~~~~~~~~~~" + i + "~~~~~~~~~~"); + FileSystem fs = fslist[i]; + // 分区的盘符名称 + System.out.println("fs.getDevName() = " + fs.getDevName()); + // 分区的盘符名称 + System.out.println("fs.getDirName() = " + fs.getDirName()); + System.out.println("fs.getFlags() = " + fs.getFlags());// + // 文件系统类型,比如 FAT32、NTFS + System.out.println("fs.getSysTypeName() = " + fs.getSysTypeName()); + // 文件系统类型名,比如本地硬盘、光驱、网络文件系统等 + System.out.println("fs.getTypeName() = " + fs.getTypeName()); + // 文件系统类型 + System.out.println("fs.getType() = " + fs.getType()); + FileSystemUsage usage = null; + try { + usage = sigar.getFileSystemUsage(fs.getDirName()); + } catch (SigarException e) { + if (fs.getType() == 2) + throw e; + continue; + } + switch (fs.getType()) { + case 0: // TYPE_UNKNOWN :未知 + break; + case 1: // TYPE_NONE + break; + case 2: // TYPE_LOCAL_DISK : 本地硬盘 + // 文件系统总大小 + System.out.println(" Total = " + usage.getTotal() + "KB"); + // 文件系统剩余大小 + System.out.println(" Free = " + usage.getFree() + "KB"); + // 文件系统可用大小 + System.out.println(" Avail = " + usage.getAvail() + "KB"); + // 文件系统已经使用量 + System.out.println(" Used = " + usage.getUsed() + "KB"); + double usePercent = usage.getUsePercent() * 100D; + // 文件系统资源的利用率 + System.out.println(" Usage = " + usePercent + "%"); + break; + case 3:// TYPE_NETWORK :网络 + break; + case 4:// TYPE_RAM_DISK :闪存 + break; + case 5:// TYPE_CDROM :光驱 + break; + case 6:// TYPE_SWAP :页面交换 + break; + } + System.out.println(" DiskReads = " + usage.getDiskReads()); + System.out.println(" DiskWrites = " + usage.getDiskWrites()); + } + return; + } // 5.网络信息 // a)当前机器的正式域名 + + public String getFQDN() { + Sigar sigar = null; + try { + return InetAddress.getLocalHost().getCanonicalHostName(); + } catch (UnknownHostException e) { + try { + sigar = new Sigar(); + return sigar.getFQDN(); + } catch (SigarException ex) { + return null; + } finally { + sigar.close(); + } + } + } // b)取到当前机器的IP地址 + + public static String getDefaultIpAddress() { + String address = null; + try { + address = InetAddress.getLocalHost().getHostAddress(); + // 没有出现异常而正常当取到的IP时,如果取到的不是网卡循回地址时就返回 + // 否则再通过Sigar工具包中的方法来获取 + if (!NetFlags.LOOPBACK_ADDRESS.equals(address)) { + return address; + } + } catch (UnknownHostException e) { + // hostname not in DNS or /etc/hosts + } + Sigar sigar = new Sigar(); + try { + address = sigar.getNetInterfaceConfig().getAddress(); + } catch (SigarException e) { + address = NetFlags.LOOPBACK_ADDRESS; + } finally { + sigar.close(); + } + return address; + } // c)取到当前机器的MAC地址 + + public static String getMAC() { + Sigar sigar = null; + try { + sigar = new Sigar(); + String[] ifaces = sigar.getNetInterfaceList(); + String hwaddr = null; + for (int i = 0; i < ifaces.length; i++) { + NetInterfaceConfig cfg = sigar.getNetInterfaceConfig(ifaces[i]); + if (NetFlags.LOOPBACK_ADDRESS.equals(cfg.getAddress()) || (cfg.getFlags() & NetFlags.IFF_LOOPBACK) != 0 + || NetFlags.NULL_HWADDR.equals(cfg.getHwaddr())) { + continue; + } + /* + * 如果存在多张网卡包括虚拟机的网卡,默认只取第一张网卡的MAC地址,如果要返回所有的网卡(包括物理的和虚拟的) + * 则可以修改方法的返回类型为数组或Collection ,通过在for循环里取到的多个MAC地址。 + */ + hwaddr = cfg.getHwaddr(); + break; + } + return hwaddr != null ? hwaddr : null; + } catch (Exception e) { + return null; + } finally { + if (sigar != null) + sigar.close(); + } + } // d)获取网络流量等信息 + + public static void testNetIfList() throws Exception { + Sigar sigar = new Sigar(); + String ifNames[] = sigar.getNetInterfaceList(); + for (int i = 0; i < ifNames.length; i++) { + String name = ifNames[i]; + NetInterfaceConfig ifconfig = sigar.getNetInterfaceConfig(name); + print("\nname = " + name);// 网络设备名 + print("Address = " + ifconfig.getAddress());// IP地址 + print("Netmask = " + ifconfig.getNetmask());// 子网掩码 + if ((ifconfig.getFlags() & 1L) <= 0L) { + print("!IFF_UP...skipping getNetInterfaceStat"); + continue; + } + try { + NetInterfaceStat ifstat = sigar.getNetInterfaceStat(name); + print("RxPackets = " + ifstat.getRxPackets());// 接收的总包裹数 + print("TxPackets = " + ifstat.getTxPackets());// 发送的总包裹数 + print("RxBytes = " + ifstat.getRxBytes());// 接收到的总字节数 + print("TxBytes = " + ifstat.getTxBytes());// 发送的总字节数 + print("RxErrors = " + ifstat.getRxErrors());// 接收到的错误包数 + print("TxErrors = " + ifstat.getTxErrors());// 发送数据包时的错误数 + print("RxDropped = " + ifstat.getRxDropped());// 接收时丢弃的包数 + print("TxDropped = " + ifstat.getTxDropped());// 发送时丢弃的包数 + } catch (SigarNotImplementedException e) { + } catch (SigarException e) { + print(e.getMessage()); + } + } + } + + private static void print(String msg) { + System.out.println(msg); + } // e)一些其他的信息 + + public void getEthernetInfo() { + Sigar sigar = null; + try { + sigar = new Sigar(); + String[] ifaces = sigar.getNetInterfaceList(); + for (int i = 0; i < ifaces.length; i++) { + NetInterfaceConfig cfg = sigar.getNetInterfaceConfig(ifaces[i]); + if (NetFlags.LOOPBACK_ADDRESS.equals(cfg.getAddress()) || (cfg.getFlags() & NetFlags.IFF_LOOPBACK) != 0 + || NetFlags.NULL_HWADDR.equals(cfg.getHwaddr())) { + continue; + } + System.out.println("cfg.getAddress() = " + cfg.getAddress());// IP地址 + System.out.println("cfg.getBroadcast() = " + cfg.getBroadcast());// 网关广播地址 + System.out.println("cfg.getHwaddr() = " + cfg.getHwaddr());// 网卡MAC地址 + System.out.println("cfg.getNetmask() = " + cfg.getNetmask());// 子网掩码 + System.out.println("cfg.getDescription() = " + cfg.getDescription());// 网卡描述信息 + System.out.println("cfg.getType() = " + cfg.getType());// + System.out.println("cfg.getDestination() = " + cfg.getDestination()); + System.out.println("cfg.getFlags() = " + cfg.getFlags());// + System.out.println("cfg.getMetric() = " + cfg.getMetric()); + System.out.println("cfg.getMtu() = " + cfg.getMtu()); + System.out.println("cfg.getName() = " + cfg.getName()); + System.out.println(); + } + } catch (Exception e) { + System.out.println("Error while creating GUID" + e); + } finally { + if (sigar != null) + sigar.close(); + } + } +} diff --git a/src/main/java/com/mingsoft/util/StringUtil.java b/src/main/java/com/mingsoft/util/StringUtil.java new file mode 100644 index 00000000..7b91bcc2 --- /dev/null +++ b/src/main/java/com/mingsoft/util/StringUtil.java @@ -0,0 +1,1115 @@ +package com.mingsoft.util; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.security.MessageDigest; +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; +import java.util.TreeMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * + *

+ * 铭飞科技J2EE基础框架 + *

+ * + *

+ * Copyright: Copyright (c) 2013 - 2015 + *

+ * + *

+ * Company:景德镇铭飞科技有限公司 + *

+ * + * @author killfen + * + * @version 100-000-000 + * + *

+ * 版权所有 + *

+ * + *

+ * Comments:字符串解析 + *

+ * + *

+ * Create Date:2013-3-26 + *

+ * + *

+ * Modification history:暂无 + *

+ */ +public class StringUtil { + + private static StringBuilder sb = new StringBuilder(); + + public static boolean checkEmail(String email) { + String regex = "^[a-zA-Z][a-zA-Z0-9._-]*\\@\\w+(\\.)*\\w+\\.\\w+$"; + Pattern p = Pattern.compile(regex); + Matcher matcher = p.matcher(email); + return matcher.matches(); + } + + /** + * 过滤html + * + * @param html + * @return + */ + public static String formatHTMLIn(String html) { + html = html.replaceAll("&", "&"); + html = html.replaceAll("<", "<"); + html = html.replaceAll(">", ">"); + html = html.replaceAll("\"", """); + return html; + } + + /** + * 解析html + * + * @param html + * @return + */ + public static String formatHTMLOut(String html) { + html = html.replaceAll("&", "&"); + html = html.replaceAll("<", "<"); + html = html.replaceAll(">", ">"); + html = html.replaceAll(""", "\""); + return html; + } + + /** + * 截取字符长度 + * + * @param s + * @param length + * @return + */ + public static String subString(String s, int length) { + if (isBlank(s)) + return ""; + if (s.getBytes().length <= length) + return s; + char ch[] = null; + if (s.length() >= length) + ch = s.substring(0, length).toCharArray(); + else + ch = s.toCharArray(); + int readLen = 0; + StringBuffer sb = new StringBuffer(""); + for (int i = 0; i < ch.length; i++) { + String c = String.valueOf(ch[i]); + readLen += c.getBytes().length; + if (readLen > length) + return sb.toString(); + sb.append(c); + } + return sb.toString(); + } + + /** + * 验证长度 + * + * @param str + * @param minLength + * @param maxLength + * @return + */ + public static boolean checkLength(String str, int minLength, int maxLength) { + if (str != null) { + int len = str.length(); + if (minLength == 0) + return len <= maxLength; + else if (maxLength == 0) + return len >= minLength; + else + return (len >= minLength && len <= maxLength); + } + return false; + } + + /** + * 解码 + * + * @param str + * @return + */ + public static String decodeStringByUTF8(String str) { + if (isBlank(str)) + return ""; + try { + return URLDecoder.decode(str, "utf-8"); + } catch (UnsupportedEncodingException e) { + } + return ""; + } + + /** + * 转码 + * + * @param str + * @return + */ + public static String encodeStringByUTF8(String str) { + if (isBlank(str)) + return ""; + try { + return URLEncoder.encode(str,"utf-8"); + } catch (UnsupportedEncodingException e) { + } + return ""; + } + + /** + * 程序内部字符串转码 + * + * @param str + * @return utf8编码字符串 + */ + public static String isoToUTF8(String str) { + if (isBlank(str)) + return ""; + try { + return new String(str.getBytes("ISO-8859-1"), "UTF-8"); + } catch (UnsupportedEncodingException e) { + } + return ""; + } + + /** + * 程序内部字符串转码 + * + * @param str + * @return utf8编码字符串 + */ + public static String utf8ToISO(String str) { + if (isBlank(str)) + return ""; + try { + return new String(str.getBytes("UTF-8"), "ISO-8859-1"); + } catch (UnsupportedEncodingException e) { + } + return ""; + } + + public static String utf8Togb2312(String str) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < str.length(); i++) { + char c = str.charAt(i); + switch (c) { + case '+': + sb.append(' '); + break; + case '%': + try { + sb.append((char) Integer.parseInt(str.substring(i + 1, i + 3), 16)); + } catch (NumberFormatException e) { + throw new IllegalArgumentException(); + } + i += 2; + break; + default: + sb.append(c); + break; + } + } + // Undo conversion to external encoding + String result = sb.toString(); + String res = null; + try { + byte[] inputBytes = result.getBytes("8859_1"); + res = new String(inputBytes, "UTF-8"); + } catch (Exception e) { + } + return res; + } + + /** + * 格式化时间 + * + * @param d + * @param pattern + * @return + */ + public static String getFormatDateStr(Date d, String pattern) { + SimpleDateFormat format = new SimpleDateFormat(pattern); + return format.format(d); + } + + /** + * 字段串是否为空 + * + * @param str + * @return + */ + public static boolean isBlank(String str) { + return (str == null || str.trim().equals("") || str.length() < 0); + } + + /** + * 字段串是否为空 + * + * @param str + * object对象 + * @return + */ + public static boolean isBlank(Object str) { + return (str == null || str.toString().trim().equals("") || str.toString().length() < 0); + } + + /** + * 是否为数组 + * + * @param args + * @return + */ + public static boolean isBlank(String[] args) { + return args == null || args.length == 0 ? true : false; + } + + + /** + * 判断数字类型 + * + * @param str + * @return + */ + public static boolean isInteger(String str) { + if (isBlank(str)) + return false; + try { + Integer.parseInt(str); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 判断数字类型 + * + * @param str + * @return + */ + public static boolean isInteger(Object str) { + String temp = str + ""; + if (isBlank(str)) + return false; + try { + Integer.parseInt(temp); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 当传入的值为NULL是将其转化为String + * + * @param str + * @return"" + */ + public static String null2String(String str) { + if (str == null || str.equals("") || str.trim().length() == 0) { + return str = ""; + } + return str; + } + + /** + * 将String型转换成Int型并判断String是否是NULL + * + * @param str + * @return int + */ + public static int string2Int(String str) { + int valueInt = 0; + if (!StringUtil.isBlank(str)) { + valueInt = Integer.parseInt(str); + } + return valueInt; + } + + /** + * 变量形态转换 int型转为String型 + * + * @param comment + * @return + */ + public static String int2String(int comment) { + String srt = ""; + srt = Integer.toString(comment); + return srt; + } + + /** + * 判断是否是大于0的参数 + * + * @param str + * 字符串参数 + * @return true:大于0 false:非0 或小于0 + */ + public static boolean isMaxZeroInteger(Object str) { + if (isBlank(str)) + return false; + try { + int temp = Integer.parseInt(str.toString()); + return temp > 0; + } catch (Exception e) { + return false; + } + } + + /** + * 判断长整型 + * + * @param str + * @return + */ + public static boolean isLong(String str) { + if (isBlank(str)) + return false; + try { + Long.parseLong(str); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 判断长整型数组 + * + * @param str + * @return + */ + public static boolean isLongs(String str[]) { + try { + for (int i = 0; i < str.length; i++) + Long.parseLong(str[i]); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 判断数字数组 + * + * @param str + * @return + */ + public static boolean isIntegers(String str[]) { + try { + for (int i = 0; i < str.length; i++) + Integer.parseInt(str[i]); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 判断数字数组 + * + * @param str + * @return + */ + public static boolean isDoubles(String str[]) { + try { + for (int i = 0; i < str.length; i++) + Double.parseDouble(str[i]); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * md5 + * + * @param plainText + * @return + */ + public static String Md5(String plainText) { + StringBuffer buf = new StringBuffer(""); + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(plainText.getBytes()); + byte b[] = md.digest(); + int i = 0; + for (int offset = 0; offset < b.length; offset++) { + i = b[offset]; + if (i < 0) + i += 256; + if (i < 16) + buf.append("0"); + buf.append(Integer.toHexString(i)); + } + } catch (Exception e) { + e.printStackTrace(); + } + return buf.toString(); + } + + /** + * 字符串转长整型数组 + * + * @param str + * @return + */ + public static long[] stringsToLongs(String str[]) { + long lon[] = new long[str.length]; + for (int i = 0; i < lon.length; i++) + lon[i] = Long.parseLong(str[i]); + return lon; + } + + /** + * 字符串转数字型数组 + * + * @param str + * @return + */ + public static Integer[] stringsToIntegers(String str[]) { + Integer array[] = new Integer[str.length]; + for (int i = 0; i < array.length; i++) + array[i] = Integer.parseInt(str[i]); + return array; + } + + /** + * 除去字符串数组中相同的值 + * + * @param str + * @return + */ + @SuppressWarnings("unchecked") + public static String[] delLopStrings(String str[]) { + @SuppressWarnings("rawtypes") + ArrayList list = new ArrayList(); + for (int i = 0; i < str.length; i++) { + if (!list.contains(str[i])) + list.add(str[i]); + } + String array[] = new String[list.size()]; + for (int i = 0; i < list.size(); i++) { + array[i] = (String) list.get(i); + } + return array; + } + + /** + * 字符串转布尔型数组 + * + * @param str + * @return + */ + public static boolean[] stringsToBooleans(String str[]) { + boolean array[] = new boolean[str.length]; + for (int i = 0; i < array.length; i++) + array[i] = Boolean.parseBoolean(str[i]); + return array; + } + + /** + * 判断日期 + * + * @param str + * @return + */ + public static boolean isTimestamp(String str) { + try { + @SuppressWarnings("unused") + Date d = java.sql.Date.valueOf(str); + return true; + } catch (Exception e) { + } + return false; + } + + /** + * 当前页 + * + * @param start + * @return + */ + public static int getPageStart(String start) { + int istart = 1; + if (isBlank(start)) { + return istart; + } + try { + istart = Integer.parseInt(start) < 0 ? istart : Integer.parseInt(start); + } catch (NumberFormatException e) { + } + return istart; + } + + /** + * 获取时间戳 + * + * @return + */ + public static String getDateSimpleStr() { + return String.valueOf(System.currentTimeMillis()); + } + + /** + * 字符串TO长整型 + * + * @param args + * @return + */ + public static Long[] StrToLong(String[] args) { + if (args == null) + return null; + Long[] _ref = new Long[args.length]; + for (int i = 0; i < args.length; i++) { + _ref[i] = new Long(args[i]); + } + return _ref; + } + + /** + * 字符串TO整型 + * + * @param args + * @return + */ + public static Integer[] StrToInteger(String[] args) { + if (args == null) + return null; + Integer[] _ref = new Integer[args.length]; + for (int i = 0; i < args.length; i++) { + _ref[i] = new Integer(args[i]); + } + return _ref; + } + + /** + * 获取日期字符串 + * + * @param d + * @param fomStr + * @return + */ + public static String getSimpleDateStr(Date d, String fomStr) { + SimpleDateFormat format = new SimpleDateFormat(fomStr); + return format.format(d); + } + + /** + * 字符串返回时间 + * + * @param str + * @return + */ + public static Date getDateForStr(String str) { + java.sql.Date sqlDate = java.sql.Date.valueOf(str); + return sqlDate; + } + + + /** + * 指定时间增加天数 + * + * @param t + * 时间 + * @param day + * 天数 + * @return + */ + public static Date addDays(Date t, int day) { + if (t == null) + return null; + Calendar c = Calendar.getInstance(); + c.setTime(t); + c.set(Calendar.DAY_OF_MONTH, c.get(Calendar.DAY_OF_MONTH) + day); + return c.getTime(); + } + + /** + * 指定时间增加月份 + * + * @param t + * 时间 + * @param month + * 月份 + * @return + */ + public static Date addMonths(Date t, int month) { + if (t == null) + return null; + Calendar c = Calendar.getInstance(); + c.setTime(t); + c.set(Calendar.MONTH, c.get(Calendar.MONTH) + month); + return c.getTime(); + } + + /** + * 组合ip + * + * @param ip + * ip的字节数组形式 + * @return 字符串形式的ip + */ + public static String getIpStringFromBytes(byte[] ip) { + sb.delete(0, sb.length()); + sb.append(ip[0] & 0xFF); + sb.append('.'); + sb.append(ip[1] & 0xFF); + sb.append('.'); + sb.append(ip[2] & 0xFF); + sb.append('.'); + sb.append(ip[3] & 0xFF); + return sb.toString(); + } + + /** + * 判断IP是否相等 + * + * @param ip1 + * IP的字节数组形式 + * @param ip2 + * IP的字节数组形式 + * @return true如果两个IP相等 + */ + public static boolean isIpEquals(byte[] ip1, byte[] ip2) { + return (ip1[0] == ip2[0] && ip1[1] == ip2[1] && ip1[2] == ip2[2] && ip1[3] == ip2[3]); + } + + /** + * 根据某种编码方式将字节数组转换成字符串 + * + * @param b + * 字节数组 + * @param offset + * 要转换的起始位置 + * @param len + * 要转换的长度 + * @param encoding + * 编码方式 + * @return 如果encoding不支持,返回一个缺省编码的字符串 + */ + public static String getString(byte[] b, int offset, int len, String encoding) { + try { + return new String(b, offset, len, encoding); + } catch (UnsupportedEncodingException e) { + return new String(b, offset, len); + } + } + + /** + * 字符转换二进制数据 + * + * @param src + * 字节数组 + * @return 字符串 + */ + public static String stringToBinary(byte[] src) { + StringBuffer sb = new StringBuffer(); + byte[][] des = new byte[src.length][16]; + for (int i = 0; i < src.length; i++) + for (int j = 0; j < 16; j++) + des[i][j] = (byte) ((src[i] >> j) & 0x1); + + for (int i = 0; i < src.length; i++) { + for (int j = 0; j < 16; j++) + sb.append(des[i][j]); + } + return sb.toString(); + } + + /** + * 生成随机数 + * + * @param len + * 随机数长度 + * @return + */ + public static String randomNumber(int len) { + StringBuffer sb = new StringBuffer(); + Random random = new Random(); + for (int i = 0; i < len; i++) { + sb.append(Math.abs(random.nextInt()) % 10); + } + return sb.toString(); + } + + /** + * 系统时间秒 + * + * @return + */ + public static String timeForString() { + Long l = System.currentTimeMillis(); + return String.valueOf(Math.abs(l.intValue())); + } + + /** + * 获取参数 + * + * @param str + * 字符串 + * @return 如果字符串为null 则返回一个空字符串 + */ + public static String getParString(String str) { + if (StringUtil.isBlank(str)) + return ""; + return str; + } + + /** + * 判断是否是中文字符 + * + * @param c + * @return + */ + public static boolean isChinese(char c) { + Character.UnicodeBlock ub = Character.UnicodeBlock.of(c); + if (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || ub == Character.UnicodeBlock.GENERAL_PUNCTUATION || ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION || ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) { + return true; + } + return false; + } + + /** + * 验证手机号码 + * + * @param str + * 手机号码 + * @return true:正确 + */ + public static boolean isMobile(String str) { + str = str.trim(); + String pattern = "^[1][1-8][0-9]{9}"; + return str.matches(pattern); + } + + public static String formatResource(Object[] info, String require) { + require = require.replaceAll("\'", "\""); + String result = MessageFormat.format(require, info); + return result.replaceAll("\"", "\'"); + } + + /** + * 计算两个时间间隔天数 + * + * @param startday + * @param endday + * @return + */ + public static int getDaysBetween(Calendar d1, Calendar d2) { + if (d1.after(d2)) { + java.util.Calendar swap = d1; + d1 = d2; + d2 = swap; + } + int days = d2.get(Calendar.DAY_OF_YEAR) - d1.get(Calendar.DAY_OF_YEAR); + int y2 = d2.get(Calendar.YEAR); + if (d1.get(Calendar.YEAR) != y2) { + d1 = (Calendar) d1.clone(); + do { + days += d1.getActualMaximum(Calendar.DAY_OF_YEAR);// 得到当年的实际天数 + d1.add(Calendar.YEAR, 1); + } while (d1.get(Calendar.YEAR) != y2); + } + return days; + } + + /** + * 读取文件后缀名称 + * + * @param filePath + * 文件路径 格式如:/../a.txt + * @return + */ + public static String getFileFix(String filePath) { + String temp = ""; + if (filePath != null) { + temp = filePath.substring(filePath.indexOf("."), filePath.length()); + } + return temp; + } + + /** + * 将数据流转换成字符串 + * + * @param is + * 数据流 + * @return + */ + public static String convertStreamToString(InputStream is) { + + BufferedReader reader = new BufferedReader(new InputStreamReader(is)); + StringBuilder sb = new StringBuilder(); + String line = null; + + try { + + while ((line = reader.readLine()) != null) { + sb.append(line); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return sb.toString(); + + } + + /** + * 检测字符串,处理utf-8的4个字节的问题 + */ + public static String checkStr(String str) { + String s = null; + char[] cc = str.toCharArray(); + for (int i = 0; i < cc.length; i++) { + boolean b = isValidChar(cc[i]); + if (!b) + cc[i] = ' '; + } + s = String.valueOf(cc); + return s; + } + + /** + * 判断是否是有效的中文字 + */ + private static boolean isValidChar(char ch) { + if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) + return true; + if ((ch >= 0x4e00 && ch <= 0x7fff) || (ch >= 0x8000 && ch <= 0x952f)) + return true;// 简体中文汉字编码 + return false; + } + + /** + * 除去字符窜中重复的字符 + * + * @param content + *  原始内容 + * @param target + *  重复内容 + * @return 除去后的字符串 + */ + public static String removeRepeatStr(String content, String target) { + // int index = content.indexOf(target); + // content = checkRepeatStr( content,target,index); + String newString = ""; + StringBuffer sb = new StringBuffer(content); + for (int i = 0; i < sb.length()-1; i++) { + + if (sb.substring(i, i + target.length()).equals(target) && sb.substring(i, i + target.length()).equals(sb.substring(i + 1, i + target.length() + 1))) { + sb.delete(i, i + target.length()); + if (i + target.length() + 1 > sb.length()) { + break; + } else { + i--; + } + } + + } + return sb.toString(); + } + + /** + * 验证邮箱格式 + * + * @param email + * 邮箱 + * @return true:正确 + */ + public static Boolean isEmail(String email) { + boolean tag = true; + final String pattern1 = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; + final Pattern pattern = Pattern.compile(pattern1); + final Matcher mat = pattern.matcher(email); + if (!mat.find()) { + tag = false; + } + return tag; + } + + /** + * 组织url 的get请求地址 + * + * @param url + * 原地址 + * @param parm + * 参数 推荐格式:参数=值 + * @return 新的地址 + */ + public static String buildUrl(String url, String parm) { + if (url.indexOf("?") > 0) { + return url += "&" + parm; + } else { + return url += "?" + parm; + } + } + + /** + * 组织path路径, 例如:buildPath(a,b,c); 返回:a/b/c + * @param params 所有对象 + * @return 新的路径地址 + */ + public static String buildPath(Object... params) { + String temp = ""; + for(Object o:params) { + temp+=File.separator+o; + } + return temp; + } + + /** + * 组织url 的get请求地址 + * + * @param url + * 原地址 + * @param parm + * 参数集合 格式:key参数=值value + * @return 新的地址 + */ + public static String buildUrl(String url, Map parms) { + Iterator key = parms.keySet().iterator(); + String paramsStr = ""; + while (key.hasNext()) { + Object temp = key.next(); + if (isBlank(parms.get(temp))) { + continue; + } + if (paramsStr != "") { + paramsStr += "&"; + } + paramsStr += (temp + "=" + parms.get(temp)); + } + + if (paramsStr != "") { + if (url.indexOf("?") > 0) { + return url += "&" + paramsStr; + } else { + return url += "?" + paramsStr; + } + } + return url; + } + + /** + * 使用 Map按key进行排序 + * + * @param map + * @return + */ + public static Map sortMapByKey(Map map) { + if (map == null || map.isEmpty()) { + return null; + } + Map sortMap = new TreeMap(new MapKeyComparator()); + sortMap.putAll(map); + return sortMap; + } + + /** + * 使用 Map按value进行排序 + * @param map + * @return + */ + public static Map sortMapByValue(Map map) { + if (map == null || map.isEmpty()) { + return null; + } + Map sortedMap = new LinkedHashMap(); + List> entryList = new ArrayList>(map.entrySet()); + Collections.sort(entryList, new MapValueComparator()); + Iterator> iter = entryList.iterator(); + Map.Entry tmpEntry = null; + while (iter.hasNext()) { + tmpEntry = iter.next(); + sortedMap.put(tmpEntry.getKey(), tmpEntry.getValue()); + } + return sortedMap; + } + + /** + * 字符串转数字型数组 + * + * @param str String字符串 + * @return 返回数字型数组 + */ + public static int[] stringsToInts(String str[]) { + int array[] = new int[str.length]; + for (int i = 0; i < array.length; i++) + array[i] = Integer.parseInt(str[i]); + return array; + } + + + /** + * 验证字符串是否符合单号规则, + * 申通单号由12位数字组成,常见以268**、368**、58**等开头 + * EMS单号由13位字母和数字组成,开头和结尾二位是字母,中间是数字 + * 顺丰单号由12位数字组成,常见以电话区号后三位开头 + * 圆通单号由10位字母数字组成,常见以1*、2*、6*、8*、D*及V*等开头 + * 中通单号由12位数字组成,常见以2008**、6**、010等开头 + * 韵达单号由13位数字组成,常见以10*、12*、19*等开头 + * 天天单号由14位数字组成,常见以6**、5*、00*等开头 + * 汇通快递查询单号由13位数字编码组成,常见以0*或者B*、H*开头 + * 速尔的快递单号由12位数字组成的 + * 德邦的货运单号现在是以1或2开头的8位数字组成 + * 宅急送单号由10位数字组成,常见以7**、6**、5**等开头 + * @param no 需要验证的字符串 + * @return true是单号 false:不是单号 + */ + public static boolean isExpressNo(String no) { + if (StringUtil.isBlank(no)) { + return false; + } + //根据长度来判断 + if (no.length()==13) { //邮政EMS + return true; + } else if (no.length()==12) { //中通 + return true; + } + return true; + } +} + +class MapKeyComparator implements Comparator { + public int compare(String str1, String str2) { + return str1.compareTo(str2); + } +} + +class MapValueComparator implements Comparator> { + public int compare(Entry me1, Entry me2) { + return me1.getValue().compareTo(me2.getValue()); + } +} diff --git a/src/main/resources/config.properties b/src/main/resources/config.properties new file mode 100644 index 00000000..e971c735 --- /dev/null +++ b/src/main/resources/config.properties @@ -0,0 +1,12 @@ +driverClassName=com.mysql.jdbc.Driver +validationQuery=SELECT 1 +jdbc_url=jdbc\:mysql\://localhost\:3306/db-mcms-open?useUnicode\=true&characterEncoding\=UTF-8&zeroDateTimeBehavior\=convertToNull +jdbc_username=root +jdbc_password=root + +sessionInfoName=sessionInfo + +uploadFieldName=filedata +uploadFileMaxSize=20971520 +uploadFileExts=txt,rar,zip,doc,docx,xls,xlsx,jpg,jpeg,gif,png,swf,wmv,avi,wma,mp3,mid +uploadDirectory=attached \ No newline at end of file diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties new file mode 100644 index 00000000..cf2d1989 --- /dev/null +++ b/src/main/resources/log4j.properties @@ -0,0 +1,35 @@ +log4j.rootLogger=INFO,CONSOLE,FILE,ROLLING_FILE +log4j.logger.com.mingsoft=DEBUG +log4j.logger.org.apache=ERROR +log4j.logger.org.springframework=ERROR + +################### +# Console Appender# +################### +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.Threshold=INFO +log4j.appender.CONSOLE.Target=System.out +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=[%d] %t %c %-5p - %m%n + +##################### +# File Appender # +##################### +log4j.appender.FILE=org.apache.log4j.FileAppender +log4j.appender.FILE.File=ms.log +log4j.appender.FILE.Append=false +log4j.appender.FILE.layout=org.apache.log4j.PatternLayout +log4j.appender.FILE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n +# Use this layout for LogFactor 5 analysis + +######################## +# Rolling File # +######################## +log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppender +log4j.appender.ROLLING_FILE.Threshold=DEBUG +log4j.appender.ROLLING_FILE.File=ms-rolling.log +log4j.appender.ROLLING_FILE.Append=true +log4j.appender.ROLLING_FILE.MaxFileSize=10KB +log4j.appender.ROLLING_FILE.MaxBackupIndex=5 +log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout +log4j.appender.ROLLING_FILE.layout.ConversionPattern=[%d] %t %c %-5p - %m%n \ No newline at end of file diff --git a/src/main/resources/mybatis-config.xml b/src/main/resources/mybatis-config.xml new file mode 100644 index 00000000..b8a56c13 --- /dev/null +++ b/src/main/resources/mybatis-config.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring-mvc.xml b/src/main/resources/spring-mvc.xml new file mode 100644 index 00000000..ffdd4bfd --- /dev/null +++ b/src/main/resources/spring-mvc.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + text/html;charset=UTF-8 + + + + + + + + + + + + + + + + + + + + + + + 1 + zh_CN + yyyy-MM-dd + yyyy-MM-dd + #.## + /manager/include/macro.ftl as ms + + + + + + + + + + + + + + + + + + + + + UTF-8 + + + 32505856 + + + 4096 + + + + + + + + + + 500 + 404 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring-mybatis.xml b/src/main/resources/spring-mybatis.xml new file mode 100644 index 00000000..20783a9f --- /dev/null +++ b/src/main/resources/spring-mybatis.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + com.mingsoft.*.biz.* + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring-shiro.xml b/src/main/resources/spring-shiro.xml new file mode 100644 index 00000000..16f058f8 --- /dev/null +++ b/src/main/resources/spring-shiro.xml @@ -0,0 +1,66 @@ + + + + Shiro Configuration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /manager/**=authc,perms + + + + + \ No newline at end of file diff --git a/src/main/resources/spring.xml b/src/main/resources/spring.xml new file mode 100644 index 00000000..abd0b1b6 --- /dev/null +++ b/src/main/resources/spring.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/META-INF/MANIFEST.MF b/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/src/main/webapp/WEB-INF/lib/libsigar-amd64-freebsd-6.so b/src/main/webapp/WEB-INF/lib/libsigar-amd64-freebsd-6.so new file mode 100644 index 00000000..3e94f0d2 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-amd64-freebsd-6.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-amd64-linux.so b/src/main/webapp/WEB-INF/lib/libsigar-amd64-linux.so new file mode 100644 index 00000000..5a2e4c24 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-amd64-linux.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-amd64-solaris.so b/src/main/webapp/WEB-INF/lib/libsigar-amd64-solaris.so new file mode 100644 index 00000000..6396482a Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-amd64-solaris.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-ia64-hpux-11.sl b/src/main/webapp/WEB-INF/lib/libsigar-ia64-hpux-11.sl new file mode 100644 index 00000000..d92ea4a9 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-ia64-hpux-11.sl differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-ia64-linux.so b/src/main/webapp/WEB-INF/lib/libsigar-ia64-linux.so new file mode 100644 index 00000000..2bd2fc8e Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-ia64-linux.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-pa-hpux-11.sl b/src/main/webapp/WEB-INF/lib/libsigar-pa-hpux-11.sl new file mode 100644 index 00000000..0dfd8a11 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-pa-hpux-11.sl differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-ppc-aix-5.so b/src/main/webapp/WEB-INF/lib/libsigar-ppc-aix-5.so new file mode 100644 index 00000000..7d4b5199 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-ppc-aix-5.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-ppc-linux.so b/src/main/webapp/WEB-INF/lib/libsigar-ppc-linux.so new file mode 100644 index 00000000..4394b1b0 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-ppc-linux.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-ppc64-aix-5.so b/src/main/webapp/WEB-INF/lib/libsigar-ppc64-aix-5.so new file mode 100644 index 00000000..35fd8288 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-ppc64-aix-5.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-ppc64-linux.so b/src/main/webapp/WEB-INF/lib/libsigar-ppc64-linux.so new file mode 100644 index 00000000..a1ba2529 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-ppc64-linux.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-s390x-linux.so b/src/main/webapp/WEB-INF/lib/libsigar-s390x-linux.so new file mode 100644 index 00000000..c275f4ac Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-s390x-linux.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-sparc-solaris.so b/src/main/webapp/WEB-INF/lib/libsigar-sparc-solaris.so new file mode 100644 index 00000000..aa847d2b Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-sparc-solaris.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-sparc64-solaris.so b/src/main/webapp/WEB-INF/lib/libsigar-sparc64-solaris.so new file mode 100644 index 00000000..6c4fe809 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-sparc64-solaris.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-universal-macosx.dylib b/src/main/webapp/WEB-INF/lib/libsigar-universal-macosx.dylib new file mode 100644 index 00000000..27ab1071 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-universal-macosx.dylib differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-universal64-macosx.dylib b/src/main/webapp/WEB-INF/lib/libsigar-universal64-macosx.dylib new file mode 100644 index 00000000..0c721fec Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-universal64-macosx.dylib differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-x86-freebsd-5.so b/src/main/webapp/WEB-INF/lib/libsigar-x86-freebsd-5.so new file mode 100644 index 00000000..8c50c611 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-x86-freebsd-5.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-x86-freebsd-6.so b/src/main/webapp/WEB-INF/lib/libsigar-x86-freebsd-6.so new file mode 100644 index 00000000..f0800274 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-x86-freebsd-6.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-x86-linux.so b/src/main/webapp/WEB-INF/lib/libsigar-x86-linux.so new file mode 100644 index 00000000..a0b64edd Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-x86-linux.so differ diff --git a/src/main/webapp/WEB-INF/lib/libsigar-x86-solaris.so b/src/main/webapp/WEB-INF/lib/libsigar-x86-solaris.so new file mode 100644 index 00000000..c6452e56 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/libsigar-x86-solaris.so differ diff --git a/src/main/webapp/WEB-INF/lib/log4j.jar b/src/main/webapp/WEB-INF/lib/log4j.jar new file mode 100644 index 00000000..c7111d8b Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/log4j.jar differ diff --git a/src/main/webapp/WEB-INF/lib/ms-proxy-1.0.0.jar b/src/main/webapp/WEB-INF/lib/ms-proxy-1.0.0.jar new file mode 100644 index 00000000..8ffc4176 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/ms-proxy-1.0.0.jar differ diff --git a/src/main/webapp/WEB-INF/lib/ms-upgrader.jar b/src/main/webapp/WEB-INF/lib/ms-upgrader.jar new file mode 100644 index 00000000..c6b25e80 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/ms-upgrader.jar differ diff --git a/src/main/webapp/WEB-INF/lib/sigar-amd64-winnt.dll b/src/main/webapp/WEB-INF/lib/sigar-amd64-winnt.dll new file mode 100644 index 00000000..1ec8a035 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/sigar-amd64-winnt.dll differ diff --git a/src/main/webapp/WEB-INF/lib/sigar-x86-winnt.dll b/src/main/webapp/WEB-INF/lib/sigar-x86-winnt.dll new file mode 100644 index 00000000..6afdc016 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/sigar-x86-winnt.dll differ diff --git a/src/main/webapp/WEB-INF/lib/sigar-x86-winnt.lib b/src/main/webapp/WEB-INF/lib/sigar-x86-winnt.lib new file mode 100644 index 00000000..04924a1f Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/sigar-x86-winnt.lib differ diff --git a/src/main/webapp/WEB-INF/lib/sigar.jar b/src/main/webapp/WEB-INF/lib/sigar.jar new file mode 100644 index 00000000..58c733c6 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/sigar.jar differ diff --git a/src/main/webapp/WEB-INF/lib/ueditor.jar b/src/main/webapp/WEB-INF/lib/ueditor.jar new file mode 100644 index 00000000..e8a1d992 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/ueditor.jar differ diff --git a/src/main/webapp/WEB-INF/ms.install b/src/main/webapp/WEB-INF/ms.install new file mode 100644 index 00000000..d10f97d9 --- /dev/null +++ b/src/main/webapp/WEB-INF/ms.install @@ -0,0 +1 @@ +1549 \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..261699e4 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,67 @@ + + + mcms + + contextConfigLocation + classpath:spring.xml,classpath:spring-mybatis.xml,classpath:spring-shiro.xml + + + + 字符集过滤器 + encodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + 字符集编码 + encoding + UTF-8 + + + + encodingFilter + /* + + + spring监听器 + org.springframework.web.context.ContextLoaderListener + + + org.springframework.web.util.IntrospectorCleanupListener + + + spring mvc servlet + springMvc + org.springframework.web.servlet.DispatcherServlet + + spring mvc 配置文件 + contextConfigLocation + classpath:spring-mvc.xml + + 1 + + + springMvc + *.do + + + index + default.html + default.htm + index.htm + index.html + login.do + + + 404 + /error/404.do + + + 500 + /error/500.do + + + 15 + + \ No newline at end of file diff --git a/src/main/webapp/bootstrap3.0.3/css/bootstrap.css b/src/main/webapp/bootstrap3.0.3/css/bootstrap.css new file mode 100644 index 00000000..3515a6dd --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/css/bootstrap.css @@ -0,0 +1,5967 @@ +/*! + * Bootstrap v3.0.3 + * + * Copyright 2013 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ + +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} +audio, +canvas, +video { + display: inline-block; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + margin: 0; +} +a { + background: transparent; +} +a:focus { + outline: thin dotted; +} +a:active, +a:hover { + outline: 0; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} +mark { + background: #ff0; + color: #000; +} +code, +kbd, +pre, +samp { + font-family: monospace, serif; + font-size: 1em; +} +pre { + white-space: pre-wrap; +} +q { + quotes: "\201C" "\201D" "\2018" "\2019"; +} +small { + font-size: 80%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 0; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; +} +button, +input, +select, +textarea { + font-family: inherit; + font-size: 100%; + margin: 0; +} +button, +input { + line-height: normal; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; +} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +textarea { + overflow: auto; + vertical-align: top; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +@media print { + * { + text-shadow: none !important; + color: #000 !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + @page { + margin: 2cm .5cm; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + select { + background: #fff !important; + } + .navbar { + display: none; + } + .table td, + .table th { + background-color: #fff !important; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +*, +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 62.5%; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.428571429; + color: #333333; + background-color: #ffffff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #428bca; + text-decoration: none; +} +a:hover, +a:focus { + color: #2a6496; + text-decoration: underline; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +img { + vertical-align: middle; +} +.img-responsive { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + padding: 4px; + line-height: 1.428571429; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: inline-block; + max-width: 100%; + height: auto; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eeeeee; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 500; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #999999; +} +h1, +h2, +h3 { + margin-top: 20px; + margin-bottom: 10px; +} +h1 small, +h2 small, +h3 small, +h1 .small, +h2 .small, +h3 .small { + font-size: 65%; +} +h4, +h5, +h6 { + margin-top: 10px; + margin-bottom: 10px; +} +h4 small, +h5 small, +h6 small, +h4 .small, +h5 .small, +h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 36px; +} +h2, +.h2 { + font-size: 30px; +} +h3, +.h3 { + font-size: 24px; +} +h4, +.h4 { + font-size: 18px; +} +h5, +.h5 { + font-size: 14px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 200; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} +small, +.small { + font-size: 85%; +} +cite { + font-style: normal; +} +.text-muted { + color: #999999; +} +.text-primary { + color: #428bca; +} +.text-primary:hover { + color: #3071a9; +} +.text-warning { + color: #8a6d3b; +} +.text-warning:hover { + color: #66512c; +} +.text-danger { + color: #a94442; +} +.text-danger:hover { + color: #843534; +} +.text-success { + color: #3c763d; +} +.text-success:hover { + color: #2b542c; +} +.text-info { + color: #31708f; +} +.text-info:hover { + color: #245269; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eeeeee; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + list-style: none; +} +.list-inline > li { + display: inline-block; + padding-left: 5px; + padding-right: 5px; +} +.list-inline > li:first-child { + padding-left: 0; +} +dl { + margin-top: 0; + margin-bottom: 20px; +} +dt, +dd { + line-height: 1.428571429; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + clear: left; + text-align: right; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } + .dl-horizontal dd:before, + .dl-horizontal dd:after { + content: " "; + display: table; + } + .dl-horizontal dd:after { + clear: both; + } + .dl-horizontal dd:before, + .dl-horizontal dd:after { + content: " "; + display: table; + } + .dl-horizontal dd:after { + clear: both; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #999999; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + border-left: 5px solid #eeeeee; +} +blockquote p { + font-size: 17.5px; + font-weight: 300; + line-height: 1.25; +} +blockquote p:last-child { + margin-bottom: 0; +} +blockquote small, +blockquote .small { + display: block; + line-height: 1.428571429; + color: #999999; +} +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; +} +blockquote.pull-right p, +blockquote.pull-right small, +blockquote.pull-right .small { + text-align: right; +} +blockquote.pull-right small:before, +blockquote.pull-right .small:before { + content: ''; +} +blockquote.pull-right small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +blockquote:before, +blockquote:after { + content: ""; +} +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.428571429; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + white-space: nowrap; + border-radius: 4px; +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.428571429; + word-break: break-all; + word-wrap: break-word; + color: #333333; + background-color: #f5f5f5; + border: 1px solid #cccccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +.container:before, +.container:after { + content: " "; + display: table; +} +.container:after { + clear: both; +} +.container:before, +.container:after { + content: " "; + display: table; +} +.container:after { + clear: both; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.row { + margin-left: -15px; + margin-right: -15px; +} +.row:before, +.row:after { + content: " "; + display: table; +} +.row:after { + clear: both; +} +.row:before, +.row:after { + content: " "; + display: table; +} +.row:after { + clear: both; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666666666666%; +} +.col-xs-10 { + width: 83.33333333333334%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666666666666%; +} +.col-xs-7 { + width: 58.333333333333336%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666666666667%; +} +.col-xs-4 { + width: 33.33333333333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.666666666666664%; +} +.col-xs-1 { + width: 8.333333333333332%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666666666666%; +} +.col-xs-pull-10 { + right: 83.33333333333334%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666666666666%; +} +.col-xs-pull-7 { + right: 58.333333333333336%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666666666667%; +} +.col-xs-pull-4 { + right: 33.33333333333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.666666666666664%; +} +.col-xs-pull-1 { + right: 8.333333333333332%; +} +.col-xs-pull-0 { + right: 0%; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666666666666%; +} +.col-xs-push-10 { + left: 83.33333333333334%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666666666666%; +} +.col-xs-push-7 { + left: 58.333333333333336%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666666666667%; +} +.col-xs-push-4 { + left: 33.33333333333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.666666666666664%; +} +.col-xs-push-1 { + left: 8.333333333333332%; +} +.col-xs-push-0 { + left: 0%; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666666666666%; +} +.col-xs-offset-10 { + margin-left: 83.33333333333334%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666666666666%; +} +.col-xs-offset-7 { + margin-left: 58.333333333333336%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666666666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.666666666666664%; +} +.col-xs-offset-1 { + margin-left: 8.333333333333332%; +} +.col-xs-offset-0 { + margin-left: 0%; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666666666666%; + } + .col-sm-10 { + width: 83.33333333333334%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666666666666%; + } + .col-sm-7 { + width: 58.333333333333336%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666666666667%; + } + .col-sm-4 { + width: 33.33333333333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.666666666666664%; + } + .col-sm-1 { + width: 8.333333333333332%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666666666666%; + } + .col-sm-pull-10 { + right: 83.33333333333334%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666666666666%; + } + .col-sm-pull-7 { + right: 58.333333333333336%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666666666667%; + } + .col-sm-pull-4 { + right: 33.33333333333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.666666666666664%; + } + .col-sm-pull-1 { + right: 8.333333333333332%; + } + .col-sm-pull-0 { + right: 0%; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666666666666%; + } + .col-sm-push-10 { + left: 83.33333333333334%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666666666666%; + } + .col-sm-push-7 { + left: 58.333333333333336%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666666666667%; + } + .col-sm-push-4 { + left: 33.33333333333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.666666666666664%; + } + .col-sm-push-1 { + left: 8.333333333333332%; + } + .col-sm-push-0 { + left: 0%; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666666666666%; + } + .col-sm-offset-10 { + margin-left: 83.33333333333334%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666666666666%; + } + .col-sm-offset-7 { + margin-left: 58.333333333333336%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666666666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.666666666666664%; + } + .col-sm-offset-1 { + margin-left: 8.333333333333332%; + } + .col-sm-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666666666666%; + } + .col-md-10 { + width: 83.33333333333334%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666666666666%; + } + .col-md-7 { + width: 58.333333333333336%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666666666667%; + } + .col-md-4 { + width: 33.33333333333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.666666666666664%; + } + .col-md-1 { + width: 8.333333333333332%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666666666666%; + } + .col-md-pull-10 { + right: 83.33333333333334%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666666666666%; + } + .col-md-pull-7 { + right: 58.333333333333336%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666666666667%; + } + .col-md-pull-4 { + right: 33.33333333333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.666666666666664%; + } + .col-md-pull-1 { + right: 8.333333333333332%; + } + .col-md-pull-0 { + right: 0%; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666666666666%; + } + .col-md-push-10 { + left: 83.33333333333334%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666666666666%; + } + .col-md-push-7 { + left: 58.333333333333336%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666666666667%; + } + .col-md-push-4 { + left: 33.33333333333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.666666666666664%; + } + .col-md-push-1 { + left: 8.333333333333332%; + } + .col-md-push-0 { + left: 0%; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666666666666%; + } + .col-md-offset-10 { + margin-left: 83.33333333333334%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666666666666%; + } + .col-md-offset-7 { + margin-left: 58.333333333333336%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666666666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.666666666666664%; + } + .col-md-offset-1 { + margin-left: 8.333333333333332%; + } + .col-md-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666666666666%; + } + .col-lg-10 { + width: 83.33333333333334%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666666666666%; + } + .col-lg-7 { + width: 58.333333333333336%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666666666667%; + } + .col-lg-4 { + width: 33.33333333333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.666666666666664%; + } + .col-lg-1 { + width: 8.333333333333332%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666666666666%; + } + .col-lg-pull-10 { + right: 83.33333333333334%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666666666666%; + } + .col-lg-pull-7 { + right: 58.333333333333336%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666666666667%; + } + .col-lg-pull-4 { + right: 33.33333333333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.666666666666664%; + } + .col-lg-pull-1 { + right: 8.333333333333332%; + } + .col-lg-pull-0 { + right: 0%; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666666666666%; + } + .col-lg-push-10 { + left: 83.33333333333334%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666666666666%; + } + .col-lg-push-7 { + left: 58.333333333333336%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666666666667%; + } + .col-lg-push-4 { + left: 33.33333333333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.666666666666664%; + } + .col-lg-push-1 { + left: 8.333333333333332%; + } + .col-lg-push-0 { + left: 0%; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666666666666%; + } + .col-lg-offset-10 { + margin-left: 83.33333333333334%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666666666666%; + } + .col-lg-offset-7 { + margin-left: 58.333333333333336%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666666666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.666666666666664%; + } + .col-lg-offset-1 { + margin-left: 8.333333333333332%; + } + .col-lg-offset-0 { + margin-left: 0%; + } +} +table { + max-width: 100%; + background-color: transparent; +} +th { + text-align: left; +} +.table { + width: 100%; + margin-bottom: 20px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.428571429; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #dddddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #dddddd; +} +.table .table { + background-color: #ffffff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-child(odd) > td, +.table-striped > tbody > tr:nth-child(odd) > th { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover > td, +.table-hover > tbody > tr:hover > th { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + float: none; + display: table-column; +} +table td[class*="col-"], +table th[class*="col-"] { + float: none; + display: table-cell; +} +.table > thead > tr > .active, +.table > tbody > tr > .active, +.table > tfoot > tr > .active, +.table > thead > .active > td, +.table > tbody > .active > td, +.table > tfoot > .active > td, +.table > thead > .active > th, +.table > tbody > .active > th, +.table > tfoot > .active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > .active:hover, +.table-hover > tbody > .active:hover > td, +.table-hover > tbody > .active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > .success, +.table > tbody > tr > .success, +.table > tfoot > tr > .success, +.table > thead > .success > td, +.table > tbody > .success > td, +.table > tfoot > .success > td, +.table > thead > .success > th, +.table > tbody > .success > th, +.table > tfoot > .success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > .success:hover, +.table-hover > tbody > .success:hover > td, +.table-hover > tbody > .success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > .danger, +.table > tbody > tr > .danger, +.table > tfoot > tr > .danger, +.table > thead > .danger > td, +.table > tbody > .danger > td, +.table > tfoot > .danger > td, +.table > thead > .danger > th, +.table > tbody > .danger > th, +.table > tfoot > .danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > .danger:hover, +.table-hover > tbody > .danger:hover > td, +.table-hover > tbody > .danger:hover > th { + background-color: #ebcccc; +} +.table > thead > tr > .warning, +.table > tbody > tr > .warning, +.table > tfoot > tr > .warning, +.table > thead > .warning > td, +.table > tbody > .warning > td, +.table > tfoot > .warning > td, +.table > thead > .warning > th, +.table > tbody > .warning > th, +.table > tfoot > .warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > .warning:hover, +.table-hover > tbody > .warning:hover > td, +.table-hover > tbody > .warning:hover > th { + background-color: #faf2cc; +} +@media (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-y: hidden; + overflow-x: scroll; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #dddddd; + -webkit-overflow-scrolling: touch; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: inherit; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + /* IE8-9 */ + + line-height: normal; +} +input[type="file"] { + display: block; +} +select[multiple], +select[size] { + height: auto; +} +select optgroup { + font-size: inherit; + font-style: inherit; + font-family: inherit; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +input[type="number"]::-webkit-outer-spin-button, +input[type="number"]::-webkit-inner-spin-button { + height: auto; +} +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.428571429; + color: #555555; + vertical-align: middle; +} +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.428571429; + color: #555555; + vertical-align: middle; + background-color: #ffffff; + background-image: none; + border: 1px solid #cccccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.form-control:-moz-placeholder { + color: #999999; +} +.form-control::-moz-placeholder { + color: #999999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999999; +} +.form-control::-webkit-input-placeholder { + color: #999999; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + cursor: not-allowed; + background-color: #eeeeee; +} +textarea.form-control { + height: auto; +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + display: block; + min-height: 20px; + margin-top: 10px; + margin-bottom: 10px; + padding-left: 20px; + vertical-align: middle; +} +.radio label, +.checkbox label { + display: inline; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + float: left; + margin-left: -20px; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +.radio[disabled], +.radio-inline[disabled], +.checkbox[disabled], +.checkbox-inline[disabled], +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"], +fieldset[disabled] .radio, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +textarea.input-sm { + height: auto; +} +.input-lg { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-lg { + height: 46px; + line-height: 46px; +} +textarea.input-lg { + height: auto; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + border-color: #8a6d3b; + background-color: #fcf8e3; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + border-color: #a94442; + background-color: #f2dede; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + border-color: #3c763d; + background-color: #dff0d8; +} +.form-control-static { + margin-bottom: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + } + .form-inline select.form-control { + width: auto; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + float: none; + margin-left: 0; + } +} +.form-horizontal .control-label, +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 7px; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-left: -15px; + margin-right: -15px; +} +.form-horizontal .form-group:before, +.form-horizontal .form-group:after { + content: " "; + display: table; +} +.form-horizontal .form-group:after { + clear: both; +} +.form-horizontal .form-group:before, +.form-horizontal .form-group:after { + content: " "; + display: table; +} +.form-horizontal .form-group:after { + clear: both; +} +.form-horizontal .form-control-static { + padding-top: 7px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + } +} +.btn { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 6px 12px; + font-size: 14px; + line-height: 1.428571429; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} +.btn:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus { + color: #333333; + text-decoration: none; +} +.btn:active, +.btn.active { + outline: 0; + background-image: none; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + pointer-events: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-default { + color: #333333; + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default:hover, +.btn-default:focus, +.btn-default:active, +.btn-default.active, +.open .dropdown-toggle.btn-default { + color: #333333; + background-color: #ebebeb; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default .badge { + color: #ffffff; + background-color: #fff; +} +.btn-primary { + color: #ffffff; + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary:active, +.btn-primary.active, +.open .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #3276b1; + border-color: #285e8e; +} +.btn-primary:active, +.btn-primary.active, +.open .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary .badge { + color: #428bca; + background-color: #fff; +} +.btn-warning { + color: #ffffff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning:active, +.btn-warning.active, +.open .dropdown-toggle.btn-warning { + color: #ffffff; + background-color: #ed9c28; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #fff; +} +.btn-danger { + color: #ffffff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger:active, +.btn-danger.active, +.open .dropdown-toggle.btn-danger { + color: #ffffff; + background-color: #d2322d; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #fff; +} +.btn-success { + color: #ffffff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:hover, +.btn-success:focus, +.btn-success:active, +.btn-success.active, +.open .dropdown-toggle.btn-success { + color: #ffffff; + background-color: #47a447; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #fff; +} +.btn-info { + color: #ffffff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:hover, +.btn-info:focus, +.btn-info:active, +.btn-info.active, +.open .dropdown-toggle.btn-info { + color: #ffffff; + background-color: #39b3d7; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #fff; +} +.btn-link { + color: #428bca; + font-weight: normal; + cursor: pointer; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #2a6496; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #999999; + text-decoration: none; +} +.btn-lg { + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +.btn-sm { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; + padding-left: 0; + padding-right: 0; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + transition: height 0.35s ease; +} +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon:empty { + width: 1em; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + font-size: 14px; + background-color: #ffffff; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + background-clip: padding-box; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.428571429; + color: #333333; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + text-decoration: none; + color: #262626; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #428bca; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #999999; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.428571429; + color: #999999; +} +.dropdown-backdrop { + position: fixed; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid; + content: ""; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + right: 0; + left: auto; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus { + outline: none; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar:before, +.btn-toolbar:after { + content: " "; + display: table; +} +.btn-toolbar:after { + clear: both; +} +.btn-toolbar:before, +.btn-toolbar:after { + content: " "; + display: table; +} +.btn-toolbar:after { + clear: both; +} +.btn-toolbar .btn-group { + float: left; +} +.btn-toolbar > .btn + .btn, +.btn-toolbar > .btn-group + .btn, +.btn-toolbar > .btn + .btn-group, +.btn-toolbar > .btn-group + .btn-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child > .btn:last-child, +.btn-group > .btn-group:first-child > .dropdown-toggle { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn-group:last-child > .btn:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-group-lg > .btn { + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after { + content: " "; + display: table; +} +.btn-group-vertical > .btn-group:after { + clear: both; +} +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after { + content: " "; + display: table; +} +.btn-group-vertical > .btn-group:after { + clear: both; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-bottom-left-radius: 4px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child > .btn:last-child, +.btn-group-vertical > .btn-group:first-child > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child > .btn:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + float: none; + display: table-cell; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +[data-toggle="buttons"] > .btn > input[type="radio"], +[data-toggle="buttons"] > .btn > input[type="checkbox"] { + display: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; +} +.input-group .form-control { + width: 100%; + margin-bottom: 0; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555555; + text-align: center; + background-color: #eeeeee; + border: 1px solid #cccccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + white-space: nowrap; +} +.input-group-btn:first-child > .btn { + margin-right: -1px; +} +.input-group-btn:last-child > .btn { + margin-left: -1px; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -4px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:active { + z-index: 2; +} +.nav { + margin-bottom: 0; + padding-left: 0; + list-style: none; +} +.nav:before, +.nav:after { + content: " "; + display: table; +} +.nav:after { + clear: both; +} +.nav:before, +.nav:after { + content: " "; + display: table; +} +.nav:after { + clear: both; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.nav > li.disabled > a { + color: #999999; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #999999; + text-decoration: none; + background-color: transparent; + cursor: not-allowed; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eeeeee; + border-color: #428bca; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #dddddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.428571429; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #555555; + background-color: #ffffff; + border: 1px solid #dddddd; + border-bottom-color: transparent; + cursor: default; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #ffffff; + background-color: #428bca; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +.navbar:before, +.navbar:after { + content: " "; + display: table; +} +.navbar:after { + clear: both; +} +.navbar:before, +.navbar:after { + content: " "; + display: table; +} +.navbar:after { + clear: both; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +.navbar-header:before, +.navbar-header:after { + content: " "; + display: table; +} +.navbar-header:after { + clear: both; +} +.navbar-header:before, +.navbar-header:after { + content: " "; + display: table; +} +.navbar-header:after { + clear: both; +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + max-height: 340px; + overflow-x: visible; + padding-right: 15px; + padding-left: 15px; + border-top: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-overflow-scrolling: touch; +} +.navbar-collapse:before, +.navbar-collapse:after { + content: " "; + display: table; +} +.navbar-collapse:after { + clear: both; +} +.navbar-collapse:before, +.navbar-collapse:after { + content: " "; + display: table; +} +.navbar-collapse:after { + clear: both; +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-left: 0; + padding-right: 0; + } +} +.container > .navbar-header, +.container > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + margin-right: 15px; + padding: 9px 10px; + margin-top: 8px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } + .navbar-nav.navbar-right:last-child { + margin-right: -15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + } +} +.navbar-form { + margin-left: -15px; + margin-right: -15px; + padding: 10px 15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + margin-top: 8px; + margin-bottom: 8px; +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + } + .navbar-form select.form-control { + width: auto; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + float: none; + margin-left: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + border: 0; + margin-left: 0; + margin-right: 0; + padding-top: 0; + padding-bottom: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-form.navbar-right:last-child { + margin-right: -15px; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-nav.pull-right > li > .dropdown-menu, +.navbar-nav > li > .dropdown-menu.pull-right { + left: auto; + right: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-left: 15px; + margin-right: 15px; + } + .navbar-text.navbar-right:last-child { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777777; +} +.navbar-default .navbar-nav > li > a { + color: #777777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #555555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #cccccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #dddddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #dddddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #cccccc; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + background-color: #e7e7e7; + color: #555555; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #cccccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777777; +} +.navbar-default .navbar-link:hover { + color: #333333; +} +.navbar-inverse { + background-color: #222222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #999999; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #999999; +} +.navbar-inverse .navbar-nav > li > a { + color: #999999; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333333; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #333333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + background-color: #080808; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #999999; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #999999; +} +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + content: "/\00a0"; + padding: 0 5px; + color: #cccccc; +} +.breadcrumb > .active { + color: #999999; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + line-height: 1.428571429; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #dddddd; + margin-left: -1px; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + background-color: #eeeeee; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 2; + color: #ffffff; + background-color: #428bca; + border-color: #428bca; + cursor: default; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #999999; + background-color: #ffffff; + border-color: #dddddd; + cursor: not-allowed; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + list-style: none; + text-align: center; +} +.pager:before, +.pager:after { + content: " "; + display: table; +} +.pager:after { + clear: both; +} +.pager:before, +.pager:after { + content: " "; + display: table; +} +.pager:after { + clear: both; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #999999; + background-color: #ffffff; + cursor: not-allowed; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #ffffff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +.label[href]:hover, +.label[href]:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #999999; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #808080; +} +.label-primary { + background-color: #428bca; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #3071a9; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + color: #ffffff; + line-height: 1; + vertical-align: baseline; + white-space: nowrap; + text-align: center; + background-color: #999999; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +a.badge:hover, +a.badge:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +a.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #428bca; + background-color: #ffffff; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding: 30px; + margin-bottom: 30px; + font-size: 21px; + font-weight: 200; + line-height: 2.1428571435; + color: inherit; + background-color: #eeeeee; +} +.jumbotron h1, +.jumbotron .h1 { + line-height: 1; + color: inherit; +} +.jumbotron p { + line-height: 1.4; +} +.container .jumbotron { + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron { + padding-left: 60px; + padding-right: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.428571429; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + display: block; + max-width: 100%; + height: auto; + margin-left: auto; + margin-right: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #428bca; +} +.thumbnail .caption { + padding: 9px; + color: #333333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable { + padding-right: 35px; +} +.alert-dismissable .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; + color: #3c763d; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; + color: #31708f; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + background-color: #fcf8e3; + border-color: #faebcc; + color: #8a6d3b; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + background-color: #f2dede; + border-color: #ebccd1; + color: #a94442; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + overflow: hidden; + height: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} +.progress-bar { + float: left; + width: 0%; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #ffffff; + text-align: center; + background-color: #428bca; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-striped .progress-bar { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-size: 40px 40px; +} +.progress.active .progress-bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.media, +.media-body { + overflow: hidden; + zoom: 1; +} +.media, +.media .media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media-object { + display: block; +} +.media-heading { + margin: 0 0 5px; +} +.media > .pull-left { + margin-right: 10px; +} +.media > .pull-right { + margin-left: 10px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + margin-bottom: 20px; + padding-left: 0; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #ffffff; + border: 1px solid #dddddd; +} +.list-group-item:first-child { + border-top-right-radius: 4px; + border-top-left-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +a.list-group-item { + color: #555555; +} +a.list-group-item .list-group-item-heading { + color: #333333; +} +a.list-group-item:hover, +a.list-group-item:focus { + text-decoration: none; + background-color: #f5f5f5; +} +a.list-group-item.active, +a.list-group-item.active:hover, +a.list-group-item.active:focus { + z-index: 2; + color: #ffffff; + background-color: #428bca; + border-color: #428bca; +} +a.list-group-item.active .list-group-item-heading, +a.list-group-item.active:hover .list-group-item-heading, +a.list-group-item.active:focus .list-group-item-heading { + color: inherit; +} +a.list-group-item.active .list-group-item-text, +a.list-group-item.active:hover .list-group-item-text, +a.list-group-item.active:focus .list-group-item-text { + color: #e1edf7; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 20px; + background-color: #ffffff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-body:before, +.panel-body:after { + content: " "; + display: table; +} +.panel-body:after { + clear: both; +} +.panel-body:before, +.panel-body:after { + content: " "; + display: table; +} +.panel-body:after { + clear: both; +} +.panel > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item { + border-width: 1px 0; +} +.panel > .list-group .list-group-item:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.panel > .list-group .list-group-item:last-child { + border-bottom: 0; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table { + margin-bottom: 0; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive { + border-top: 1px solid #dddddd; +} +.panel > .table > tbody:first-child th, +.panel > .table > tbody:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:last-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:last-child > th, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-bordered > thead > tr:last-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; +} +.panel > .table-responsive { + border: 0; + margin-bottom: 0; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; + overflow: hidden; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse .panel-body { + border-top: 1px solid #dddddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #dddddd; +} +.panel-default { + border-color: #dddddd; +} +.panel-default > .panel-heading { + color: #333333; + background-color: #f5f5f5; + border-color: #dddddd; +} +.panel-default > .panel-heading + .panel-collapse .panel-body { + border-top-color: #dddddd; +} +.panel-default > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #dddddd; +} +.panel-primary { + border-color: #428bca; +} +.panel-primary > .panel-heading { + color: #ffffff; + background-color: #428bca; + border-color: #428bca; +} +.panel-primary > .panel-heading + .panel-collapse .panel-body { + border-top-color: #428bca; +} +.panel-primary > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #428bca; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #ebccd1; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #bce8f1; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.modal-open { + overflow: hidden; +} +.modal { + display: none; + overflow: auto; + overflow-y: scroll; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; +} +.modal.fade .modal-dialog { + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + transform: translate(0, -25%); + -webkit-transition: -webkit-transform 0.3s ease-out; + -moz-transition: -moz-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; + z-index: 1050; +} +.modal-content { + position: relative; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-clip: padding-box; + outline: none; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1030; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; + filter: alpha(opacity=0); +} +.modal-backdrop.in { + opacity: 0.5; + filter: alpha(opacity=50); +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; + min-height: 16.428571429px; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.428571429; +} +.modal-body { + position: relative; + padding: 20px; +} +.modal-footer { + margin-top: 15px; + padding: 19px 20px 20px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.modal-footer:after { + clear: both; +} +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.modal-footer:after { + clear: both; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +@media screen and (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } +} +.tooltip { + position: absolute; + z-index: 1030; + display: block; + visibility: visible; + font-size: 12px; + line-height: 1.4; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + left: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + right: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + left: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + right: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + max-width: 276px; + padding: 1px; + text-align: left; + background-color: #ffffff; + background-clip: padding-box; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + white-space: normal; +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + margin: 0; + padding: 8px 14px; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover .arrow, +.popover .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover .arrow { + border-width: 11px; +} +.popover .arrow:after { + border-width: 10px; + content: ""; +} +.popover.top .arrow { + left: 50%; + margin-left: -11px; + border-bottom-width: 0; + border-top-color: #999999; + border-top-color: rgba(0, 0, 0, 0.25); + bottom: -11px; +} +.popover.top .arrow:after { + content: " "; + bottom: 1px; + margin-left: -10px; + border-bottom-width: 0; + border-top-color: #ffffff; +} +.popover.right .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-left-width: 0; + border-right-color: #999999; + border-right-color: rgba(0, 0, 0, 0.25); +} +.popover.right .arrow:after { + content: " "; + left: 1px; + bottom: -10px; + border-left-width: 0; + border-right-color: #ffffff; +} +.popover.bottom .arrow { + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999999; + border-bottom-color: rgba(0, 0, 0, 0.25); + top: -11px; +} +.popover.bottom .arrow:after { + content: " "; + top: 1px; + margin-left: -10px; + border-top-width: 0; + border-bottom-color: #ffffff; +} +.popover.left .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999999; + border-left-color: rgba(0, 0, 0, 0.25); +} +.popover.left .arrow:after { + content: " "; + right: 1px; + border-right-width: 0; + border-left-color: #ffffff; + bottom: -10px; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + overflow: hidden; + width: 100%; +} +.carousel-inner > .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; + line-height: 1; +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 15%; + opacity: 0.5; + filter: alpha(opacity=50); + font-size: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%)); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); +} +.carousel-control.right { + left: auto; + right: 0; + background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%)); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); +} +.carousel-control:hover, +.carousel-control:focus { + outline: none; + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + margin-top: -10px; + margin-left: -10px; + font-family: serif; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + margin-left: -30%; + padding-left: 0; + list-style: none; + text-align: center; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + border: 1px solid #ffffff; + border-radius: 10px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); +} +.carousel-indicators .active { + margin: 0; + width: 12px; + height: 12px; + background-color: #ffffff; +} +.carousel-caption { + position: absolute; + left: 15%; + right: 15%; + bottom: 20px; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicons-chevron-left, + .carousel-control .glyphicons-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + margin-left: -15px; + font-size: 30px; + } + .carousel-caption { + left: 20%; + right: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after { + content: " "; + display: table; +} +.clearfix:after { + clear: both; +} +.center-block { + display: block; + margin-left: auto; + margin-right: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; + visibility: hidden !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +tr.visible-xs, +th.visible-xs, +td.visible-xs { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-xs.visible-sm { + display: block !important; + } + table.visible-xs.visible-sm { + display: table; + } + tr.visible-xs.visible-sm { + display: table-row !important; + } + th.visible-xs.visible-sm, + td.visible-xs.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-xs.visible-md { + display: block !important; + } + table.visible-xs.visible-md { + display: table; + } + tr.visible-xs.visible-md { + display: table-row !important; + } + th.visible-xs.visible-md, + td.visible-xs.visible-md { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-xs.visible-lg { + display: block !important; + } + table.visible-xs.visible-lg { + display: table; + } + tr.visible-xs.visible-lg { + display: table-row !important; + } + th.visible-xs.visible-lg, + td.visible-xs.visible-lg { + display: table-cell !important; + } +} +.visible-sm, +tr.visible-sm, +th.visible-sm, +td.visible-sm { + display: none !important; +} +@media (max-width: 767px) { + .visible-sm.visible-xs { + display: block !important; + } + table.visible-sm.visible-xs { + display: table; + } + tr.visible-sm.visible-xs { + display: table-row !important; + } + th.visible-sm.visible-xs, + td.visible-sm.visible-xs { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-sm.visible-md { + display: block !important; + } + table.visible-sm.visible-md { + display: table; + } + tr.visible-sm.visible-md { + display: table-row !important; + } + th.visible-sm.visible-md, + td.visible-sm.visible-md { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-sm.visible-lg { + display: block !important; + } + table.visible-sm.visible-lg { + display: table; + } + tr.visible-sm.visible-lg { + display: table-row !important; + } + th.visible-sm.visible-lg, + td.visible-sm.visible-lg { + display: table-cell !important; + } +} +.visible-md, +tr.visible-md, +th.visible-md, +td.visible-md { + display: none !important; +} +@media (max-width: 767px) { + .visible-md.visible-xs { + display: block !important; + } + table.visible-md.visible-xs { + display: table; + } + tr.visible-md.visible-xs { + display: table-row !important; + } + th.visible-md.visible-xs, + td.visible-md.visible-xs { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-md.visible-sm { + display: block !important; + } + table.visible-md.visible-sm { + display: table; + } + tr.visible-md.visible-sm { + display: table-row !important; + } + th.visible-md.visible-sm, + td.visible-md.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-md.visible-lg { + display: block !important; + } + table.visible-md.visible-lg { + display: table; + } + tr.visible-md.visible-lg { + display: table-row !important; + } + th.visible-md.visible-lg, + td.visible-md.visible-lg { + display: table-cell !important; + } +} +.visible-lg, +tr.visible-lg, +th.visible-lg, +td.visible-lg { + display: none !important; +} +@media (max-width: 767px) { + .visible-lg.visible-xs { + display: block !important; + } + table.visible-lg.visible-xs { + display: table; + } + tr.visible-lg.visible-xs { + display: table-row !important; + } + th.visible-lg.visible-xs, + td.visible-lg.visible-xs { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-lg.visible-sm { + display: block !important; + } + table.visible-lg.visible-sm { + display: table; + } + tr.visible-lg.visible-sm { + display: table-row !important; + } + th.visible-lg.visible-sm, + td.visible-lg.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-lg.visible-md { + display: block !important; + } + table.visible-lg.visible-md { + display: table; + } + tr.visible-lg.visible-md { + display: table-row !important; + } + th.visible-lg.visible-md, + td.visible-lg.visible-md { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +.hidden-xs { + display: block !important; +} +table.hidden-xs { + display: table; +} +tr.hidden-xs { + display: table-row !important; +} +th.hidden-xs, +td.hidden-xs { + display: table-cell !important; +} +@media (max-width: 767px) { + .hidden-xs, + tr.hidden-xs, + th.hidden-xs, + td.hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-xs.hidden-sm, + tr.hidden-xs.hidden-sm, + th.hidden-xs.hidden-sm, + td.hidden-xs.hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-xs.hidden-md, + tr.hidden-xs.hidden-md, + th.hidden-xs.hidden-md, + td.hidden-xs.hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-xs.hidden-lg, + tr.hidden-xs.hidden-lg, + th.hidden-xs.hidden-lg, + td.hidden-xs.hidden-lg { + display: none !important; + } +} +.hidden-sm { + display: block !important; +} +table.hidden-sm { + display: table; +} +tr.hidden-sm { + display: table-row !important; +} +th.hidden-sm, +td.hidden-sm { + display: table-cell !important; +} +@media (max-width: 767px) { + .hidden-sm.hidden-xs, + tr.hidden-sm.hidden-xs, + th.hidden-sm.hidden-xs, + td.hidden-sm.hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm, + tr.hidden-sm, + th.hidden-sm, + td.hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-sm.hidden-md, + tr.hidden-sm.hidden-md, + th.hidden-sm.hidden-md, + td.hidden-sm.hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-sm.hidden-lg, + tr.hidden-sm.hidden-lg, + th.hidden-sm.hidden-lg, + td.hidden-sm.hidden-lg { + display: none !important; + } +} +.hidden-md { + display: block !important; +} +table.hidden-md { + display: table; +} +tr.hidden-md { + display: table-row !important; +} +th.hidden-md, +td.hidden-md { + display: table-cell !important; +} +@media (max-width: 767px) { + .hidden-md.hidden-xs, + tr.hidden-md.hidden-xs, + th.hidden-md.hidden-xs, + td.hidden-md.hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-md.hidden-sm, + tr.hidden-md.hidden-sm, + th.hidden-md.hidden-sm, + td.hidden-md.hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md, + tr.hidden-md, + th.hidden-md, + td.hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-md.hidden-lg, + tr.hidden-md.hidden-lg, + th.hidden-md.hidden-lg, + td.hidden-md.hidden-lg { + display: none !important; + } +} +.hidden-lg { + display: block !important; +} +table.hidden-lg { + display: table; +} +tr.hidden-lg { + display: table-row !important; +} +th.hidden-lg, +td.hidden-lg { + display: table-cell !important; +} +@media (max-width: 767px) { + .hidden-lg.hidden-xs, + tr.hidden-lg.hidden-xs, + th.hidden-lg.hidden-xs, + td.hidden-lg.hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-lg.hidden-sm, + tr.hidden-lg.hidden-sm, + th.hidden-lg.hidden-sm, + td.hidden-lg.hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-lg.hidden-md, + tr.hidden-lg.hidden-md, + th.hidden-lg.hidden-md, + td.hidden-lg.hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg, + tr.hidden-lg, + th.hidden-lg, + td.hidden-lg { + display: none !important; + } +} +.visible-print, +tr.visible-print, +th.visible-print, +td.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } + .hidden-print, + tr.hidden-print, + th.hidden-print, + td.hidden-print { + display: none !important; + } +} diff --git a/src/main/webapp/bootstrap3.0.3/css/bootstrap.min.css b/src/main/webapp/bootstrap3.0.3/css/bootstrap.min.css new file mode 100644 index 00000000..01559d4e --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/css/bootstrap.min.css @@ -0,0 +1,11 @@ +/*! + * Bootstrap v3.0.3 + * + * Copyright 2013 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ + +article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden],template{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a{background:transparent;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace, serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;}@media print{*{text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important;} a,a:visited{text-decoration:underline;} a[href]:after{content:" (" attr(href) ")";} abbr[title]:after{content:" (" attr(title) ")";} a[href^="javascript:"]:after,a[href^="#"]:after{content:"";} pre,blockquote{border:1px solid #999;page-break-inside:avoid;} thead{display:table-header-group;} tr,img{page-break-inside:avoid;} img{max-width:100% !important;} @page {margin:2cm .5cm;}p,h2,h3{orphans:3;widows:3;} h2,h3{page-break-after:avoid;} select{background:#fff !important;} .navbar{display:none;} .table td,.table th{background-color:#fff !important;} .btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important;} .label{border:1px solid #000;} .table{border-collapse:collapse !important;} .table-bordered th,.table-bordered td{border:1px solid #ddd !important;}}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333333;background-color:#ffffff;}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;}a{color:#428bca;text-decoration:none;}a:hover,a:focus{color:#2a6496;text-decoration:underline;}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}img{vertical-align:middle;}.img-responsive{display:block;max-width:100%;height:auto;}.img-rounded{border-radius:6px;}.img-thumbnail{padding:4px;line-height:1.428571429;background-color:#ffffff;border:1px solid #dddddd;border-radius:4px;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;display:inline-block;max-width:100%;height:auto;}.img-circle{border-radius:50%;}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eeeeee;}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;line-height:1.1;color:inherit;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#999999;}h1,h2,h3{margin-top:20px;margin-bottom:10px;}h1 small,h2 small,h3 small,h1 .small,h2 .small,h3 .small{font-size:65%;}h4,h5,h6{margin-top:10px;margin-bottom:10px;}h4 small,h5 small,h6 small,h4 .small,h5 .small,h6 .small{font-size:75%;}h1,.h1{font-size:36px;}h2,.h2{font-size:30px;}h3,.h3{font-size:24px;}h4,.h4{font-size:18px;}h5,.h5{font-size:14px;}h6,.h6{font-size:12px;}p{margin:0 0 10px;}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4;}@media (min-width:768px){.lead{font-size:21px;}}small,.small{font-size:85%;}cite{font-style:normal;}.text-muted{color:#999999;}.text-primary{color:#428bca;}.text-primary:hover{color:#3071a9;}.text-warning{color:#8a6d3b;}.text-warning:hover{color:#66512c;}.text-danger{color:#a94442;}.text-danger:hover{color:#843534;}.text-success{color:#3c763d;}.text-success:hover{color:#2b542c;}.text-info{color:#31708f;}.text-info:hover{color:#245269;}.text-left{text-align:left;}.text-right{text-align:right;}.text-center{text-align:center;}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eeeeee;}ul,ol{margin-top:0;margin-bottom:10px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:0;}.list-unstyled{padding-left:0;list-style:none;}.list-inline{padding-left:0;list-style:none;}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px;}.list-inline>li:first-child{padding-left:0;}dl{margin-top:0;margin-bottom:20px;}dt,dd{line-height:1.428571429;}dt{font-weight:bold;}dd{margin-left:0;}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} .dl-horizontal dd{margin-left:180px;}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table;} .dl-horizontal dd:after{clear:both;} .dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table;} .dl-horizontal dd:after{clear:both;}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999999;}.initialism{font-size:90%;text-transform:uppercase;}blockquote{padding:10px 20px;margin:0 0 20px;border-left:5px solid #eeeeee;}blockquote p{font-size:17.5px;font-weight:300;line-height:1.25;}blockquote p:last-child{margin-bottom:0;}blockquote small,blockquote .small{display:block;line-height:1.428571429;color:#999999;}blockquote small:before,blockquote .small:before{content:'\2014 \00A0';}blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right small,blockquote.pull-right .small{text-align:right;}blockquote.pull-right small:before,blockquote.pull-right .small:before{content:'';}blockquote.pull-right small:after,blockquote.pull-right .small:after{content:'\00A0 \2014';}blockquote:before,blockquote:after{content:"";}address{margin-bottom:20px;font-style:normal;line-height:1.428571429;}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:4px;}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;word-break:break-all;word-wrap:break-word;color:#333333;background-color:#f5f5f5;border:1px solid #cccccc;border-radius:4px;}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0;}.pre-scrollable{max-height:340px;overflow-y:scroll;}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px;}.container:before,.container:after{content:" ";display:table;}.container:after{clear:both;}.container:before,.container:after{content:" ";display:table;}.container:after{clear:both;}@media (min-width:768px){.container{width:750px;}}@media (min-width:992px){.container{width:970px;}}@media (min-width:1200px){.container{width:1170px;}}.row{margin-left:-15px;margin-right:-15px;}.row:before,.row:after{content:" ";display:table;}.row:after{clear:both;}.row:before,.row:after{content:" ";display:table;}.row:after{clear:both;}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px;}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left;}.col-xs-12{width:100%;}.col-xs-11{width:91.66666666666666%;}.col-xs-10{width:83.33333333333334%;}.col-xs-9{width:75%;}.col-xs-8{width:66.66666666666666%;}.col-xs-7{width:58.333333333333336%;}.col-xs-6{width:50%;}.col-xs-5{width:41.66666666666667%;}.col-xs-4{width:33.33333333333333%;}.col-xs-3{width:25%;}.col-xs-2{width:16.666666666666664%;}.col-xs-1{width:8.333333333333332%;}.col-xs-pull-12{right:100%;}.col-xs-pull-11{right:91.66666666666666%;}.col-xs-pull-10{right:83.33333333333334%;}.col-xs-pull-9{right:75%;}.col-xs-pull-8{right:66.66666666666666%;}.col-xs-pull-7{right:58.333333333333336%;}.col-xs-pull-6{right:50%;}.col-xs-pull-5{right:41.66666666666667%;}.col-xs-pull-4{right:33.33333333333333%;}.col-xs-pull-3{right:25%;}.col-xs-pull-2{right:16.666666666666664%;}.col-xs-pull-1{right:8.333333333333332%;}.col-xs-pull-0{right:0%;}.col-xs-push-12{left:100%;}.col-xs-push-11{left:91.66666666666666%;}.col-xs-push-10{left:83.33333333333334%;}.col-xs-push-9{left:75%;}.col-xs-push-8{left:66.66666666666666%;}.col-xs-push-7{left:58.333333333333336%;}.col-xs-push-6{left:50%;}.col-xs-push-5{left:41.66666666666667%;}.col-xs-push-4{left:33.33333333333333%;}.col-xs-push-3{left:25%;}.col-xs-push-2{left:16.666666666666664%;}.col-xs-push-1{left:8.333333333333332%;}.col-xs-push-0{left:0%;}.col-xs-offset-12{margin-left:100%;}.col-xs-offset-11{margin-left:91.66666666666666%;}.col-xs-offset-10{margin-left:83.33333333333334%;}.col-xs-offset-9{margin-left:75%;}.col-xs-offset-8{margin-left:66.66666666666666%;}.col-xs-offset-7{margin-left:58.333333333333336%;}.col-xs-offset-6{margin-left:50%;}.col-xs-offset-5{margin-left:41.66666666666667%;}.col-xs-offset-4{margin-left:33.33333333333333%;}.col-xs-offset-3{margin-left:25%;}.col-xs-offset-2{margin-left:16.666666666666664%;}.col-xs-offset-1{margin-left:8.333333333333332%;}.col-xs-offset-0{margin-left:0%;}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left;} .col-sm-12{width:100%;} .col-sm-11{width:91.66666666666666%;} .col-sm-10{width:83.33333333333334%;} .col-sm-9{width:75%;} .col-sm-8{width:66.66666666666666%;} .col-sm-7{width:58.333333333333336%;} .col-sm-6{width:50%;} .col-sm-5{width:41.66666666666667%;} .col-sm-4{width:33.33333333333333%;} .col-sm-3{width:25%;} .col-sm-2{width:16.666666666666664%;} .col-sm-1{width:8.333333333333332%;} .col-sm-pull-12{right:100%;} .col-sm-pull-11{right:91.66666666666666%;} .col-sm-pull-10{right:83.33333333333334%;} .col-sm-pull-9{right:75%;} .col-sm-pull-8{right:66.66666666666666%;} .col-sm-pull-7{right:58.333333333333336%;} .col-sm-pull-6{right:50%;} .col-sm-pull-5{right:41.66666666666667%;} .col-sm-pull-4{right:33.33333333333333%;} .col-sm-pull-3{right:25%;} .col-sm-pull-2{right:16.666666666666664%;} .col-sm-pull-1{right:8.333333333333332%;} .col-sm-pull-0{right:0%;} .col-sm-push-12{left:100%;} .col-sm-push-11{left:91.66666666666666%;} .col-sm-push-10{left:83.33333333333334%;} .col-sm-push-9{left:75%;} .col-sm-push-8{left:66.66666666666666%;} .col-sm-push-7{left:58.333333333333336%;} .col-sm-push-6{left:50%;} .col-sm-push-5{left:41.66666666666667%;} .col-sm-push-4{left:33.33333333333333%;} .col-sm-push-3{left:25%;} .col-sm-push-2{left:16.666666666666664%;} .col-sm-push-1{left:8.333333333333332%;} .col-sm-push-0{left:0%;} .col-sm-offset-12{margin-left:100%;} .col-sm-offset-11{margin-left:91.66666666666666%;} .col-sm-offset-10{margin-left:83.33333333333334%;} .col-sm-offset-9{margin-left:75%;} .col-sm-offset-8{margin-left:66.66666666666666%;} .col-sm-offset-7{margin-left:58.333333333333336%;} .col-sm-offset-6{margin-left:50%;} .col-sm-offset-5{margin-left:41.66666666666667%;} .col-sm-offset-4{margin-left:33.33333333333333%;} .col-sm-offset-3{margin-left:25%;} .col-sm-offset-2{margin-left:16.666666666666664%;} .col-sm-offset-1{margin-left:8.333333333333332%;} .col-sm-offset-0{margin-left:0%;}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left;} .col-md-12{width:100%;} .col-md-11{width:91.66666666666666%;} .col-md-10{width:83.33333333333334%;} .col-md-9{width:75%;} .col-md-8{width:66.66666666666666%;} .col-md-7{width:58.333333333333336%;} .col-md-6{width:50%;} .col-md-5{width:41.66666666666667%;} .col-md-4{width:33.33333333333333%;} .col-md-3{width:25%;} .col-md-2{width:16.666666666666664%;} .col-md-1{width:8.333333333333332%;} .col-md-pull-12{right:100%;} .col-md-pull-11{right:91.66666666666666%;} .col-md-pull-10{right:83.33333333333334%;} .col-md-pull-9{right:75%;} .col-md-pull-8{right:66.66666666666666%;} .col-md-pull-7{right:58.333333333333336%;} .col-md-pull-6{right:50%;} .col-md-pull-5{right:41.66666666666667%;} .col-md-pull-4{right:33.33333333333333%;} .col-md-pull-3{right:25%;} .col-md-pull-2{right:16.666666666666664%;} .col-md-pull-1{right:8.333333333333332%;} .col-md-pull-0{right:0%;} .col-md-push-12{left:100%;} .col-md-push-11{left:91.66666666666666%;} .col-md-push-10{left:83.33333333333334%;} .col-md-push-9{left:75%;} .col-md-push-8{left:66.66666666666666%;} .col-md-push-7{left:58.333333333333336%;} .col-md-push-6{left:50%;} .col-md-push-5{left:41.66666666666667%;} .col-md-push-4{left:33.33333333333333%;} .col-md-push-3{left:25%;} .col-md-push-2{left:16.666666666666664%;} .col-md-push-1{left:8.333333333333332%;} .col-md-push-0{left:0%;} .col-md-offset-12{margin-left:100%;} .col-md-offset-11{margin-left:91.66666666666666%;} .col-md-offset-10{margin-left:83.33333333333334%;} .col-md-offset-9{margin-left:75%;} .col-md-offset-8{margin-left:66.66666666666666%;} .col-md-offset-7{margin-left:58.333333333333336%;} .col-md-offset-6{margin-left:50%;} .col-md-offset-5{margin-left:41.66666666666667%;} .col-md-offset-4{margin-left:33.33333333333333%;} .col-md-offset-3{margin-left:25%;} .col-md-offset-2{margin-left:16.666666666666664%;} .col-md-offset-1{margin-left:8.333333333333332%;} .col-md-offset-0{margin-left:0%;}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left;} .col-lg-12{width:100%;} .col-lg-11{width:91.66666666666666%;} .col-lg-10{width:83.33333333333334%;} .col-lg-9{width:75%;} .col-lg-8{width:66.66666666666666%;} .col-lg-7{width:58.333333333333336%;} .col-lg-6{width:50%;} .col-lg-5{width:41.66666666666667%;} .col-lg-4{width:33.33333333333333%;} .col-lg-3{width:25%;} .col-lg-2{width:16.666666666666664%;} .col-lg-1{width:8.333333333333332%;} .col-lg-pull-12{right:100%;} .col-lg-pull-11{right:91.66666666666666%;} .col-lg-pull-10{right:83.33333333333334%;} .col-lg-pull-9{right:75%;} .col-lg-pull-8{right:66.66666666666666%;} .col-lg-pull-7{right:58.333333333333336%;} .col-lg-pull-6{right:50%;} .col-lg-pull-5{right:41.66666666666667%;} .col-lg-pull-4{right:33.33333333333333%;} .col-lg-pull-3{right:25%;} .col-lg-pull-2{right:16.666666666666664%;} .col-lg-pull-1{right:8.333333333333332%;} .col-lg-pull-0{right:0%;} .col-lg-push-12{left:100%;} .col-lg-push-11{left:91.66666666666666%;} .col-lg-push-10{left:83.33333333333334%;} .col-lg-push-9{left:75%;} .col-lg-push-8{left:66.66666666666666%;} .col-lg-push-7{left:58.333333333333336%;} .col-lg-push-6{left:50%;} .col-lg-push-5{left:41.66666666666667%;} .col-lg-push-4{left:33.33333333333333%;} .col-lg-push-3{left:25%;} .col-lg-push-2{left:16.666666666666664%;} .col-lg-push-1{left:8.333333333333332%;} .col-lg-push-0{left:0%;} .col-lg-offset-12{margin-left:100%;} .col-lg-offset-11{margin-left:91.66666666666666%;} .col-lg-offset-10{margin-left:83.33333333333334%;} .col-lg-offset-9{margin-left:75%;} .col-lg-offset-8{margin-left:66.66666666666666%;} .col-lg-offset-7{margin-left:58.333333333333336%;} .col-lg-offset-6{margin-left:50%;} .col-lg-offset-5{margin-left:41.66666666666667%;} .col-lg-offset-4{margin-left:33.33333333333333%;} .col-lg-offset-3{margin-left:25%;} .col-lg-offset-2{margin-left:16.666666666666664%;} .col-lg-offset-1{margin-left:8.333333333333332%;} .col-lg-offset-0{margin-left:0%;}}table{max-width:100%;background-color:transparent;}th{text-align:left;}.table{width:100%;margin-bottom:20px;}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #dddddd;}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #dddddd;}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0;}.table>tbody+tbody{border-top:2px solid #dddddd;}.table .table{background-color:#ffffff;}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px;}.table-bordered{border:1px solid #dddddd;}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #dddddd;}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px;}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9;}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5;}table col[class*="col-"]{position:static;float:none;display:table-column;}table td[class*="col-"],table th[class*="col-"]{float:none;display:table-cell;}.table>thead>tr>.active,.table>tbody>tr>.active,.table>tfoot>tr>.active,.table>thead>.active>td,.table>tbody>.active>td,.table>tfoot>.active>td,.table>thead>.active>th,.table>tbody>.active>th,.table>tfoot>.active>th{background-color:#f5f5f5;}.table-hover>tbody>tr>.active:hover,.table-hover>tbody>.active:hover>td,.table-hover>tbody>.active:hover>th{background-color:#e8e8e8;}.table>thead>tr>.success,.table>tbody>tr>.success,.table>tfoot>tr>.success,.table>thead>.success>td,.table>tbody>.success>td,.table>tfoot>.success>td,.table>thead>.success>th,.table>tbody>.success>th,.table>tfoot>.success>th{background-color:#dff0d8;}.table-hover>tbody>tr>.success:hover,.table-hover>tbody>.success:hover>td,.table-hover>tbody>.success:hover>th{background-color:#d0e9c6;}.table>thead>tr>.danger,.table>tbody>tr>.danger,.table>tfoot>tr>.danger,.table>thead>.danger>td,.table>tbody>.danger>td,.table>tfoot>.danger>td,.table>thead>.danger>th,.table>tbody>.danger>th,.table>tfoot>.danger>th{background-color:#f2dede;}.table-hover>tbody>tr>.danger:hover,.table-hover>tbody>.danger:hover>td,.table-hover>tbody>.danger:hover>th{background-color:#ebcccc;}.table>thead>tr>.warning,.table>tbody>tr>.warning,.table>tfoot>tr>.warning,.table>thead>.warning>td,.table>tbody>.warning>td,.table>tfoot>.warning>td,.table>thead>.warning>th,.table>tbody>.warning>th,.table>tfoot>.warning>th{background-color:#fcf8e3;}.table-hover>tbody>tr>.warning:hover,.table-hover>tbody>.warning:hover>td,.table-hover>tbody>.warning:hover>th{background-color:#faf2cc;}@media (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #dddddd;-webkit-overflow-scrolling:touch;}.table-responsive>.table{margin-bottom:0;}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap;} .table-responsive>.table-bordered{border:0;}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0;} .table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0;} .table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0;}}fieldset{padding:0;margin:0;border:0;}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}label{display:inline-block;margin-bottom:5px;font-weight:bold;}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal;}input[type="file"]{display:block;}select[multiple],select[size]{height:auto;}select optgroup{font-size:inherit;font-style:inherit;font-family:inherit;}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{height:auto;}output{display:block;padding-top:7px;font-size:14px;line-height:1.428571429;color:#555555;vertical-align:middle;}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;color:#555555;vertical-align:middle;background-color:#ffffff;background-image:none;border:1px solid #cccccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);}.form-control:-moz-placeholder{color:#999999;}.form-control::-moz-placeholder{color:#999999;opacity:1;}.form-control:-ms-input-placeholder{color:#999999;}.form-control::-webkit-input-placeholder{color:#999999;}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eeeeee;}textarea.form-control{height:auto;}.form-group{margin-bottom:15px;}.radio,.checkbox{display:block;min-height:20px;margin-top:10px;margin-bottom:10px;padding-left:20px;vertical-align:middle;}.radio label,.checkbox label{display:inline;margin-bottom:0;font-weight:normal;cursor:pointer;}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px;}.radio+.radio,.checkbox+.checkbox{margin-top:-5px;}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer;}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px;}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed;}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px;}select.input-sm{height:30px;line-height:30px;}textarea.input-sm{height:auto;}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px;}select.input-lg{height:46px;line-height:46px;}textarea.input-lg{height:auto;}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b;}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #c0a16b;}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3;}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442;}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #ce8483;}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede;}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d;}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #67b168;}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8;}.form-control-static{margin-bottom:0;}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373;}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle;} .form-inline .form-control{display:inline-block;} .form-inline select.form-control{width:auto;} .form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;} .form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0;}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px;}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px;}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px;}.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table;}.form-horizontal .form-group:after{clear:both;}.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table;}.form-horizontal .form-group:after{clear:both;}.form-horizontal .form-control-static{padding-top:7px;}@media (min-width:768px){.form-horizontal .control-label{text-align:right;}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.428571429;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;}.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}.btn:hover,.btn:focus{color:#333333;text-decoration:none;}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);box-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;}.btn-default{color:#333333;background-color:#ffffff;border-color:#cccccc;}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333333;background-color:#ebebeb;border-color:#adadad;}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none;}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#ffffff;border-color:#cccccc;}.btn-default .badge{color:#ffffff;background-color:#fff;}.btn-primary{color:#ffffff;background-color:#428bca;border-color:#357ebd;}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#ffffff;background-color:#3276b1;border-color:#285e8e;}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none;}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd;}.btn-primary .badge{color:#428bca;background-color:#fff;}.btn-warning{color:#ffffff;background-color:#f0ad4e;border-color:#eea236;}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#ffffff;background-color:#ed9c28;border-color:#d58512;}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none;}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236;}.btn-warning .badge{color:#f0ad4e;background-color:#fff;}.btn-danger{color:#ffffff;background-color:#d9534f;border-color:#d43f3a;}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#ffffff;background-color:#d2322d;border-color:#ac2925;}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none;}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a;}.btn-danger .badge{color:#d9534f;background-color:#fff;}.btn-success{color:#ffffff;background-color:#5cb85c;border-color:#4cae4c;}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#ffffff;background-color:#47a447;border-color:#398439;}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none;}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c;}.btn-success .badge{color:#5cb85c;background-color:#fff;}.btn-info{color:#ffffff;background-color:#5bc0de;border-color:#46b8da;}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#ffffff;background-color:#39b3d7;border-color:#269abc;}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none;}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da;}.btn-info .badge{color:#5bc0de;background-color:#fff;}.btn-link{color:#428bca;font-weight:normal;cursor:pointer;border-radius:0;}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent;}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent;}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999999;text-decoration:none;}.btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px;}.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px;}.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;}.btn-block+.btn-block{margin-top:5px;}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%;}.fade{opacity:0;-webkit-transition:opacity 0.15s linear;transition:opacity 0.15s linear;}.fade.in{opacity:1;}.collapse{display:none;}.collapse.in{display:block;}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;transition:height 0.35s ease;}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}.glyphicon:empty{width:1em;}.glyphicon-asterisk:before{content:"\2a";}.glyphicon-plus:before{content:"\2b";}.glyphicon-euro:before{content:"\20ac";}.glyphicon-minus:before{content:"\2212";}.glyphicon-cloud:before{content:"\2601";}.glyphicon-envelope:before{content:"\2709";}.glyphicon-pencil:before{content:"\270f";}.glyphicon-glass:before{content:"\e001";}.glyphicon-music:before{content:"\e002";}.glyphicon-search:before{content:"\e003";}.glyphicon-heart:before{content:"\e005";}.glyphicon-star:before{content:"\e006";}.glyphicon-star-empty:before{content:"\e007";}.glyphicon-user:before{content:"\e008";}.glyphicon-film:before{content:"\e009";}.glyphicon-th-large:before{content:"\e010";}.glyphicon-th:before{content:"\e011";}.glyphicon-th-list:before{content:"\e012";}.glyphicon-ok:before{content:"\e013";}.glyphicon-remove:before{content:"\e014";}.glyphicon-zoom-in:before{content:"\e015";}.glyphicon-zoom-out:before{content:"\e016";}.glyphicon-off:before{content:"\e017";}.glyphicon-signal:before{content:"\e018";}.glyphicon-cog:before{content:"\e019";}.glyphicon-trash:before{content:"\e020";}.glyphicon-home:before{content:"\e021";}.glyphicon-file:before{content:"\e022";}.glyphicon-time:before{content:"\e023";}.glyphicon-road:before{content:"\e024";}.glyphicon-download-alt:before{content:"\e025";}.glyphicon-download:before{content:"\e026";}.glyphicon-upload:before{content:"\e027";}.glyphicon-inbox:before{content:"\e028";}.glyphicon-play-circle:before{content:"\e029";}.glyphicon-repeat:before{content:"\e030";}.glyphicon-refresh:before{content:"\e031";}.glyphicon-list-alt:before{content:"\e032";}.glyphicon-lock:before{content:"\e033";}.glyphicon-flag:before{content:"\e034";}.glyphicon-headphones:before{content:"\e035";}.glyphicon-volume-off:before{content:"\e036";}.glyphicon-volume-down:before{content:"\e037";}.glyphicon-volume-up:before{content:"\e038";}.glyphicon-qrcode:before{content:"\e039";}.glyphicon-barcode:before{content:"\e040";}.glyphicon-tag:before{content:"\e041";}.glyphicon-tags:before{content:"\e042";}.glyphicon-book:before{content:"\e043";}.glyphicon-bookmark:before{content:"\e044";}.glyphicon-print:before{content:"\e045";}.glyphicon-camera:before{content:"\e046";}.glyphicon-font:before{content:"\e047";}.glyphicon-bold:before{content:"\e048";}.glyphicon-italic:before{content:"\e049";}.glyphicon-text-height:before{content:"\e050";}.glyphicon-text-width:before{content:"\e051";}.glyphicon-align-left:before{content:"\e052";}.glyphicon-align-center:before{content:"\e053";}.glyphicon-align-right:before{content:"\e054";}.glyphicon-align-justify:before{content:"\e055";}.glyphicon-list:before{content:"\e056";}.glyphicon-indent-left:before{content:"\e057";}.glyphicon-indent-right:before{content:"\e058";}.glyphicon-facetime-video:before{content:"\e059";}.glyphicon-picture:before{content:"\e060";}.glyphicon-map-marker:before{content:"\e062";}.glyphicon-adjust:before{content:"\e063";}.glyphicon-tint:before{content:"\e064";}.glyphicon-edit:before{content:"\e065";}.glyphicon-share:before{content:"\e066";}.glyphicon-check:before{content:"\e067";}.glyphicon-move:before{content:"\e068";}.glyphicon-step-backward:before{content:"\e069";}.glyphicon-fast-backward:before{content:"\e070";}.glyphicon-backward:before{content:"\e071";}.glyphicon-play:before{content:"\e072";}.glyphicon-pause:before{content:"\e073";}.glyphicon-stop:before{content:"\e074";}.glyphicon-forward:before{content:"\e075";}.glyphicon-fast-forward:before{content:"\e076";}.glyphicon-step-forward:before{content:"\e077";}.glyphicon-eject:before{content:"\e078";}.glyphicon-chevron-left:before{content:"\e079";}.glyphicon-chevron-right:before{content:"\e080";}.glyphicon-plus-sign:before{content:"\e081";}.glyphicon-minus-sign:before{content:"\e082";}.glyphicon-remove-sign:before{content:"\e083";}.glyphicon-ok-sign:before{content:"\e084";}.glyphicon-question-sign:before{content:"\e085";}.glyphicon-info-sign:before{content:"\e086";}.glyphicon-screenshot:before{content:"\e087";}.glyphicon-remove-circle:before{content:"\e088";}.glyphicon-ok-circle:before{content:"\e089";}.glyphicon-ban-circle:before{content:"\e090";}.glyphicon-arrow-left:before{content:"\e091";}.glyphicon-arrow-right:before{content:"\e092";}.glyphicon-arrow-up:before{content:"\e093";}.glyphicon-arrow-down:before{content:"\e094";}.glyphicon-share-alt:before{content:"\e095";}.glyphicon-resize-full:before{content:"\e096";}.glyphicon-resize-small:before{content:"\e097";}.glyphicon-exclamation-sign:before{content:"\e101";}.glyphicon-gift:before{content:"\e102";}.glyphicon-leaf:before{content:"\e103";}.glyphicon-fire:before{content:"\e104";}.glyphicon-eye-open:before{content:"\e105";}.glyphicon-eye-close:before{content:"\e106";}.glyphicon-warning-sign:before{content:"\e107";}.glyphicon-plane:before{content:"\e108";}.glyphicon-calendar:before{content:"\e109";}.glyphicon-random:before{content:"\e110";}.glyphicon-comment:before{content:"\e111";}.glyphicon-magnet:before{content:"\e112";}.glyphicon-chevron-up:before{content:"\e113";}.glyphicon-chevron-down:before{content:"\e114";}.glyphicon-retweet:before{content:"\e115";}.glyphicon-shopping-cart:before{content:"\e116";}.glyphicon-folder-close:before{content:"\e117";}.glyphicon-folder-open:before{content:"\e118";}.glyphicon-resize-vertical:before{content:"\e119";}.glyphicon-resize-horizontal:before{content:"\e120";}.glyphicon-hdd:before{content:"\e121";}.glyphicon-bullhorn:before{content:"\e122";}.glyphicon-bell:before{content:"\e123";}.glyphicon-certificate:before{content:"\e124";}.glyphicon-thumbs-up:before{content:"\e125";}.glyphicon-thumbs-down:before{content:"\e126";}.glyphicon-hand-right:before{content:"\e127";}.glyphicon-hand-left:before{content:"\e128";}.glyphicon-hand-up:before{content:"\e129";}.glyphicon-hand-down:before{content:"\e130";}.glyphicon-circle-arrow-right:before{content:"\e131";}.glyphicon-circle-arrow-left:before{content:"\e132";}.glyphicon-circle-arrow-up:before{content:"\e133";}.glyphicon-circle-arrow-down:before{content:"\e134";}.glyphicon-globe:before{content:"\e135";}.glyphicon-wrench:before{content:"\e136";}.glyphicon-tasks:before{content:"\e137";}.glyphicon-filter:before{content:"\e138";}.glyphicon-briefcase:before{content:"\e139";}.glyphicon-fullscreen:before{content:"\e140";}.glyphicon-dashboard:before{content:"\e141";}.glyphicon-paperclip:before{content:"\e142";}.glyphicon-heart-empty:before{content:"\e143";}.glyphicon-link:before{content:"\e144";}.glyphicon-phone:before{content:"\e145";}.glyphicon-pushpin:before{content:"\e146";}.glyphicon-usd:before{content:"\e148";}.glyphicon-gbp:before{content:"\e149";}.glyphicon-sort:before{content:"\e150";}.glyphicon-sort-by-alphabet:before{content:"\e151";}.glyphicon-sort-by-alphabet-alt:before{content:"\e152";}.glyphicon-sort-by-order:before{content:"\e153";}.glyphicon-sort-by-order-alt:before{content:"\e154";}.glyphicon-sort-by-attributes:before{content:"\e155";}.glyphicon-sort-by-attributes-alt:before{content:"\e156";}.glyphicon-unchecked:before{content:"\e157";}.glyphicon-expand:before{content:"\e158";}.glyphicon-collapse-down:before{content:"\e159";}.glyphicon-collapse-up:before{content:"\e160";}.glyphicon-log-in:before{content:"\e161";}.glyphicon-flash:before{content:"\e162";}.glyphicon-log-out:before{content:"\e163";}.glyphicon-new-window:before{content:"\e164";}.glyphicon-record:before{content:"\e165";}.glyphicon-save:before{content:"\e166";}.glyphicon-open:before{content:"\e167";}.glyphicon-saved:before{content:"\e168";}.glyphicon-import:before{content:"\e169";}.glyphicon-export:before{content:"\e170";}.glyphicon-send:before{content:"\e171";}.glyphicon-floppy-disk:before{content:"\e172";}.glyphicon-floppy-saved:before{content:"\e173";}.glyphicon-floppy-remove:before{content:"\e174";}.glyphicon-floppy-save:before{content:"\e175";}.glyphicon-floppy-open:before{content:"\e176";}.glyphicon-credit-card:before{content:"\e177";}.glyphicon-transfer:before{content:"\e178";}.glyphicon-cutlery:before{content:"\e179";}.glyphicon-header:before{content:"\e180";}.glyphicon-compressed:before{content:"\e181";}.glyphicon-earphone:before{content:"\e182";}.glyphicon-phone-alt:before{content:"\e183";}.glyphicon-tower:before{content:"\e184";}.glyphicon-stats:before{content:"\e185";}.glyphicon-sd-video:before{content:"\e186";}.glyphicon-hd-video:before{content:"\e187";}.glyphicon-subtitles:before{content:"\e188";}.glyphicon-sound-stereo:before{content:"\e189";}.glyphicon-sound-dolby:before{content:"\e190";}.glyphicon-sound-5-1:before{content:"\e191";}.glyphicon-sound-6-1:before{content:"\e192";}.glyphicon-sound-7-1:before{content:"\e193";}.glyphicon-copyright-mark:before{content:"\e194";}.glyphicon-registration-mark:before{content:"\e195";}.glyphicon-cloud-download:before{content:"\e197";}.glyphicon-cloud-upload:before{content:"\e198";}.glyphicon-tree-conifer:before{content:"\e199";}.glyphicon-tree-deciduous:before{content:"\e200";}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent;}.dropdown{position:relative;}.dropdown-toggle:focus{outline:0;}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#ffffff;border:1px solid #cccccc;border:1px solid rgba(0, 0, 0, 0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);background-clip:padding-box;}.dropdown-menu.pull-right{right:0;left:auto;}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5;}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.428571429;color:#333333;white-space:nowrap;}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5;}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#ffffff;text-decoration:none;outline:0;background-color:#428bca;}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999999;}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed;}.open>.dropdown-menu{display:block;}.open>a{outline:0;}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999999;}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990;}.pull-right>.dropdown-menu{right:0;left:auto;}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:"";}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto;}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle;}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left;}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2;}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:none;}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px;}.btn-toolbar:before,.btn-toolbar:after{content:" ";display:table;}.btn-toolbar:after{clear:both;}.btn-toolbar:before,.btn-toolbar:after{content:" ";display:table;}.btn-toolbar:after{clear:both;}.btn-toolbar .btn-group{float:left;}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-group+.btn-group{margin-left:5px;}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0;}.btn-group>.btn:first-child{margin-left:0;}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0;}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;}.btn-group>.btn-group{float:left;}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0;}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0;}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0;}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;}.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;}.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px;}.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px;}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px;}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px;}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);box-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none;}.btn .caret{margin-left:0;}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0;}.dropup .btn-lg .caret{border-width:0 5px 5px;}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%;}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{content:" ";display:table;}.btn-group-vertical>.btn-group:after{clear:both;}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{content:" ";display:table;}.btn-group-vertical>.btn-group:after{clear:both;}.btn-group-vertical>.btn-group>.btn{float:none;}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0;}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0;}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0;}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:4px;border-top-right-radius:0;border-top-left-radius:0;}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0;}.btn-group-vertical>.btn-group:first-child>.btn:last-child,.btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0;}.btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0;}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate;}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%;}.btn-group-justified>.btn-group .btn{width:100%;}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none;}.input-group{position:relative;display:table;border-collapse:separate;}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0;}.input-group .form-control{width:100%;margin-bottom:0;}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px;}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px;}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto;}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px;}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px;}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto;}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell;}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0;}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle;}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;color:#555555;text-align:center;background-color:#eeeeee;border:1px solid #cccccc;border-radius:4px;}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px;}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px;}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0;}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0;}.input-group-addon:first-child{border-right:0;}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;}.input-group-addon:last-child{border-left:0;}.input-group-btn{position:relative;white-space:nowrap;}.input-group-btn:first-child>.btn{margin-right:-1px;}.input-group-btn:last-child>.btn{margin-left:-1px;}.input-group-btn>.btn{position:relative;}.input-group-btn>.btn+.btn{margin-left:-4px;}.input-group-btn>.btn:hover,.input-group-btn>.btn:active{z-index:2;}.nav{margin-bottom:0;padding-left:0;list-style:none;}.nav:before,.nav:after{content:" ";display:table;}.nav:after{clear:both;}.nav:before,.nav:after{content:" ";display:table;}.nav:after{clear:both;}.nav>li{position:relative;display:block;}.nav>li>a{position:relative;display:block;padding:10px 15px;}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eeeeee;}.nav>li.disabled>a{color:#999999;}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999999;text-decoration:none;background-color:transparent;cursor:not-allowed;}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eeeeee;border-color:#428bca;}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5;}.nav>li>a>img{max-width:none;}.nav-tabs{border-bottom:1px solid #dddddd;}.nav-tabs>li{float:left;margin-bottom:-1px;}.nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:4px 4px 0 0;}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555555;background-color:#ffffff;border:1px solid #dddddd;border-bottom-color:transparent;cursor:default;}.nav-tabs.nav-justified{width:100%;border-bottom:0;}.nav-tabs.nav-justified>li{float:none;}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px;}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto;}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%;}.nav-tabs.nav-justified>li>a{margin-bottom:0;}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px;}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #dddddd;}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #dddddd;border-radius:4px 4px 0 0;} .nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#ffffff;}}.nav-pills>li{float:left;}.nav-pills>li>a{border-radius:4px;}.nav-pills>li+li{margin-left:2px;}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#ffffff;background-color:#428bca;}.nav-stacked>li{float:none;}.nav-stacked>li+li{margin-top:2px;margin-left:0;}.nav-justified{width:100%;}.nav-justified>li{float:none;}.nav-justified>li>a{text-align:center;margin-bottom:5px;}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto;}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%;}.nav-justified>li>a{margin-bottom:0;}}.nav-tabs-justified{border-bottom:0;}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px;}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #dddddd;}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #dddddd;border-radius:4px 4px 0 0;} .nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#ffffff;}}.tab-content>.tab-pane{display:none;}.tab-content>.active{display:block;}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0;}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent;}.navbar:before,.navbar:after{content:" ";display:table;}.navbar:after{clear:both;}.navbar:before,.navbar:after{content:" ";display:table;}.navbar:after{clear:both;}@media (min-width:768px){.navbar{border-radius:4px;}}.navbar-header:before,.navbar-header:after{content:" ";display:table;}.navbar-header:after{clear:both;}.navbar-header:before,.navbar-header:after{content:" ";display:table;}.navbar-header:after{clear:both;}@media (min-width:768px){.navbar-header{float:left;}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1);-webkit-overflow-scrolling:touch;}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table;}.navbar-collapse:after{clear:both;}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table;}.navbar-collapse:after{clear:both;}.navbar-collapse.in{overflow-y:auto;}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none;}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important;} .navbar-collapse.in{overflow-y:visible;} .navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0;}}.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px;}@media (min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0;}}.navbar-static-top{z-index:1000;border-width:0 0 1px;}@media (min-width:768px){.navbar-static-top{border-radius:0;}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0;}}.navbar-fixed-top{top:0;border-width:0 0 1px;}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0;}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px;}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none;}@media (min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px;}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px;}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px;}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px;}@media (min-width:768px){.navbar-toggle{display:none;}}.navbar-nav{margin:7.5px -15px;}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px;}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none;}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px;} .navbar-nav .open .dropdown-menu>li>a{line-height:20px;}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none;}}@media (min-width:768px){.navbar-nav{float:left;margin:0;}.navbar-nav>li{float:left;}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px;} .navbar-nav.navbar-right:last-child{margin-right:-15px;}}@media (min-width:768px){.navbar-left{float:left !important;} .navbar-right{float:right !important;}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.1);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.1);margin-top:8px;margin-bottom:8px;}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle;} .navbar-form .form-control{display:inline-block;} .navbar-form select.form-control{width:auto;} .navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;} .navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0;}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px;}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none;}.navbar-form.navbar-right:last-child{margin-right:-15px;}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0;}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0;}.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{left:auto;right:0;}.navbar-btn{margin-top:8px;margin-bottom:8px;}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px;}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px;}.navbar-text{margin-top:15px;margin-bottom:15px;}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px;}.navbar-text.navbar-right:last-child{margin-right:0;}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7;}.navbar-default .navbar-brand{color:#777777;}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent;}.navbar-default .navbar-text{color:#777777;}.navbar-default .navbar-nav>li>a{color:#777777;}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333333;background-color:transparent;}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555555;background-color:#e7e7e7;}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent;}.navbar-default .navbar-toggle{border-color:#dddddd;}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#dddddd;}.navbar-default .navbar-toggle .icon-bar{background-color:#cccccc;}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7;}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555555;}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777777;}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333333;background-color:transparent;} .navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555555;background-color:#e7e7e7;} .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent;}}.navbar-default .navbar-link{color:#777777;}.navbar-default .navbar-link:hover{color:#333333;}.navbar-inverse{background-color:#222222;border-color:#080808;}.navbar-inverse .navbar-brand{color:#999999;}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#ffffff;background-color:transparent;}.navbar-inverse .navbar-text{color:#999999;}.navbar-inverse .navbar-nav>li>a{color:#999999;}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#ffffff;background-color:transparent;}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#ffffff;background-color:#080808;}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444444;background-color:transparent;}.navbar-inverse .navbar-toggle{border-color:#333333;}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333333;}.navbar-inverse .navbar-toggle .icon-bar{background-color:#ffffff;}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010;}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#ffffff;}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808;} .navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808;} .navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999999;}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#ffffff;background-color:transparent;} .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#080808;} .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444444;background-color:transparent;}}.navbar-inverse .navbar-link{color:#999999;}.navbar-inverse .navbar-link:hover{color:#ffffff;}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px;}.breadcrumb>li{display:inline-block;}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#cccccc;}.breadcrumb>.active{color:#999999;}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px;}.pagination>li{display:inline;}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.428571429;text-decoration:none;background-color:#ffffff;border:1px solid #dddddd;margin-left:-1px;}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px;}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px;}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#eeeeee;}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#ffffff;background-color:#428bca;border-color:#428bca;cursor:default;}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999999;background-color:#ffffff;border-color:#dddddd;cursor:not-allowed;}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px;}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px;}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px;}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px;}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center;}.pager:before,.pager:after{content:" ";display:table;}.pager:after{clear:both;}.pager:before,.pager:after{content:" ";display:table;}.pager:after{clear:both;}.pager li{display:inline;}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#ffffff;border:1px solid #dddddd;border-radius:15px;}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eeeeee;}.pager .next>a,.pager .next>span{float:right;}.pager .previous>a,.pager .previous>span{float:left;}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999999;background-color:#ffffff;cursor:not-allowed;}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;}.label[href]:hover,.label[href]:focus{color:#ffffff;text-decoration:none;cursor:pointer;}.label:empty{display:none;}.btn .label{position:relative;top:-1px;}.label-default{background-color:#999999;}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080;}.label-primary{background-color:#428bca;}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9;}.label-success{background-color:#5cb85c;}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44;}.label-info{background-color:#5bc0de;}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5;}.label-warning{background-color:#f0ad4e;}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f;}.label-danger{background-color:#d9534f;}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c;}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#ffffff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999999;border-radius:10px;}.badge:empty{display:none;}.btn .badge{position:relative;top:-1px;}a.badge:hover,a.badge:focus{color:#ffffff;text-decoration:none;cursor:pointer;}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#ffffff;}.nav-pills>li>a>.badge{margin-left:3px;}.jumbotron{padding:30px;margin-bottom:30px;font-size:21px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eeeeee;}.jumbotron h1,.jumbotron .h1{line-height:1;color:inherit;}.jumbotron p{line-height:1.4;}.container .jumbotron{border-radius:6px;}.jumbotron .container{max-width:100%;}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px;}.container .jumbotron{padding-left:60px;padding-right:60px;} .jumbotron h1,.jumbotron .h1{font-size:63px;}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.428571429;background-color:#ffffff;border:1px solid #dddddd;border-radius:4px;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;}.thumbnail>img,.thumbnail a>img{display:block;max-width:100%;height:auto;margin-left:auto;margin-right:auto;}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca;}.thumbnail .caption{padding:9px;color:#333333;}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px;}.alert h4{margin-top:0;color:inherit;}.alert .alert-link{font-weight:bold;}.alert>p,.alert>ul{margin-bottom:0;}.alert>p+p{margin-top:5px;}.alert-dismissable{padding-right:35px;}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit;}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d;}.alert-success hr{border-top-color:#c9e2b3;}.alert-success .alert-link{color:#2b542c;}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f;}.alert-info hr{border-top-color:#a6e1ec;}.alert-info .alert-link{color:#245269;}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b;}.alert-warning hr{border-top-color:#f7e1b5;}.alert-warning .alert-link{color:#66512c;}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442;}.alert-danger hr{border-top-color:#e4b9c0;}.alert-danger .alert-link{color:#843534;}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#ffffff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-transition:width 0.6s ease;transition:width 0.6s ease;}.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-size:40px 40px;}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;}.progress-bar-success{background-color:#5cb85c;}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-bar-info{background-color:#5bc0de;}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-bar-warning{background-color:#f0ad4e;}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-bar-danger{background-color:#d9534f;}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.media,.media-body{overflow:hidden;zoom:1;}.media,.media .media{margin-top:15px;}.media:first-child{margin-top:0;}.media-object{display:block;}.media-heading{margin:0 0 5px;}.media>.pull-left{margin-right:10px;}.media>.pull-right{margin-left:10px;}.media-list{padding-left:0;list-style:none;}.list-group{margin-bottom:20px;padding-left:0;}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#ffffff;border:1px solid #dddddd;}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px;}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px;}.list-group-item>.badge{float:right;}.list-group-item>.badge+.badge{margin-right:5px;}a.list-group-item{color:#555555;}a.list-group-item .list-group-item-heading{color:#333333;}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5;}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#ffffff;background-color:#428bca;border-color:#428bca;}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit;}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#e1edf7;}.list-group-item-heading{margin-top:0;margin-bottom:5px;}.list-group-item-text{margin-bottom:0;line-height:1.3;}.panel{margin-bottom:20px;background-color:#ffffff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:0 1px 1px rgba(0, 0, 0, 0.05);}.panel-body{padding:15px;}.panel-body:before,.panel-body:after{content:" ";display:table;}.panel-body:after{clear:both;}.panel-body:before,.panel-body:after{content:" ";display:table;}.panel-body:after{clear:both;}.panel>.list-group{margin-bottom:0;}.panel>.list-group .list-group-item{border-width:1px 0;}.panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0;}.panel>.list-group .list-group-item:last-child{border-bottom:0;}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0;}.panel>.table,.panel>.table-responsive>.table{margin-bottom:0;}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #dddddd;}.panel>.table>tbody:first-child th,.panel>.table>tbody:first-child td{border-top:0;}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0;}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0;}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0;}.panel>.table-bordered>thead>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:last-child>th,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:last-child>td,.panel>.table-responsive>.table-bordered>thead>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0;}.panel>.table-responsive{border:0;margin-bottom:0;}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px;}.panel-heading>.dropdown .dropdown-toggle{color:inherit;}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit;}.panel-title>a{color:inherit;}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #dddddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px;}.panel-group .panel{margin-bottom:0;border-radius:4px;overflow:hidden;}.panel-group .panel+.panel{margin-top:5px;}.panel-group .panel-heading{border-bottom:0;}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #dddddd;}.panel-group .panel-footer{border-top:0;}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #dddddd;}.panel-default{border-color:#dddddd;}.panel-default>.panel-heading{color:#333333;background-color:#f5f5f5;border-color:#dddddd;}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#dddddd;}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#dddddd;}.panel-primary{border-color:#428bca;}.panel-primary>.panel-heading{color:#ffffff;background-color:#428bca;border-color:#428bca;}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca;}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca;}.panel-success{border-color:#d6e9c6;}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6;}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6;}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6;}.panel-warning{border-color:#faebcc;}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc;}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#faebcc;}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#faebcc;}.panel-danger{border-color:#ebccd1;}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1;}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ebccd1;}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ebccd1;}.panel-info{border-color:#bce8f1;}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1;}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1;}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1;}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);}.well-lg{padding:24px;border-radius:6px;}.well-sm{padding:9px;border-radius:3px;}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover,.close:focus{color:#000000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50);}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;}.modal-open{overflow:hidden;}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-moz-transition:-moz-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out;}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);transform:translate(0, 0);}.modal-dialog{position:relative;width:auto;margin:10px;z-index:1050;}.modal-content{position:relative;background-color:#ffffff;border:1px solid #999999;border:1px solid rgba(0, 0, 0, 0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0, 0, 0, 0.5);box-shadow:0 3px 9px rgba(0, 0, 0, 0.5);background-clip:padding-box;outline:none;}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000000;}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0);}.modal-backdrop.in{opacity:0.5;filter:alpha(opacity=50);}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.428571429px;}.modal-header .close{margin-top:-2px;}.modal-title{margin:0;line-height:1.428571429;}.modal-body{position:relative;padding:20px;}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5;}.modal-footer:before,.modal-footer:after{content:" ";display:table;}.modal-footer:after{clear:both;}.modal-footer:before,.modal-footer:after{content:" ";display:table;}.modal-footer:after{clear:both;}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;}.modal-footer .btn-group .btn+.btn{margin-left:-1px;}.modal-footer .btn-block+.btn-block{margin-left:0;}@media screen and (min-width:768px){.modal-dialog{width:600px;margin:30px auto;} .modal-content{-webkit-box-shadow:0 5px 15px rgba(0, 0, 0, 0.5);box-shadow:0 5px 15px rgba(0, 0, 0, 0.5);}}.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.9;filter:alpha(opacity=90);}.tooltip.top{margin-top:-3px;padding:5px 0;}.tooltip.right{margin-left:3px;padding:0 5px;}.tooltip.bottom{margin-top:3px;padding:5px 0;}.tooltip.left{margin-left:-3px;padding:0 5px;}.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;border-radius:4px;}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid;}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000000;}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000000;}.tooltip.top-right .tooltip-arrow{bottom:0;right:5px;border-width:5px 5px 0;border-top-color:#000000;}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000000;}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000000;}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000000;}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000000;}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000000;}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;background-color:#ffffff;background-clip:padding-box;border:1px solid #cccccc;border:1px solid rgba(0, 0, 0, 0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);white-space:normal;}.popover.top{margin-top:-10px;}.popover.right{margin-left:10px;}.popover.bottom{margin-top:10px;}.popover.left{margin-left:-10px;}.popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0;}.popover-content{padding:9px 14px;}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid;}.popover .arrow{border-width:11px;}.popover .arrow:after{border-width:10px;content:"";}.popover.top .arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999999;border-top-color:rgba(0, 0, 0, 0.25);bottom:-11px;}.popover.top .arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff;}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999999;border-right-color:rgba(0, 0, 0, 0.25);}.popover.right .arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff;}.popover.bottom .arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999999;border-bottom-color:rgba(0, 0, 0, 0.25);top:-11px;}.popover.bottom .arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#ffffff;}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999999;border-left-color:rgba(0, 0, 0, 0.25);}.popover.left .arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px;}.carousel{position:relative;}.carousel-inner{position:relative;overflow:hidden;width:100%;}.carousel-inner>.item{display:none;position:relative;-webkit-transition:0.6s ease-in-out left;transition:0.6s ease-in-out left;}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto;line-height:1;}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block;}.carousel-inner>.active{left:0;}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%;}.carousel-inner>.next{left:100%;}.carousel-inner>.prev{left:-100%;}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0;}.carousel-inner>.active.left{left:-100%;}.carousel-inner>.active.right{left:100%;}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:0.5;filter:alpha(opacity=50);font-size:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0, 0, 0, 0.6);}.carousel-control.left{background-image:-webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);}.carousel-control:hover,.carousel-control:focus{outline:none;color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block;}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif;}.carousel-control .icon-prev:before{content:'\2039';}.carousel-control .icon-next:before{content:'\203a';}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center;}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #ffffff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0, 0, 0, 0);}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#ffffff;}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0, 0, 0, 0.6);}.carousel-caption .btn{text-shadow:none;}@media screen and (min-width:768px){.carousel-control .glyphicons-chevron-left,.carousel-control .glyphicons-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px;} .carousel-caption{left:20%;right:20%;padding-bottom:30px;} .carousel-indicators{bottom:20px;}}.clearfix:before,.clearfix:after{content:" ";display:table;}.clearfix:after{clear:both;}.center-block{display:block;margin-left:auto;margin-right:auto;}.pull-right{float:right !important;}.pull-left{float:left !important;}.hide{display:none !important;}.show{display:block !important;}.invisible{visibility:hidden;}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}.hidden{display:none !important;visibility:hidden !important;}.affix{position:fixed;}@-ms-viewport{width:device-width;}.visible-xs,tr.visible-xs,th.visible-xs,td.visible-xs{display:none !important;}@media (max-width:767px){.visible-xs{display:block !important;}table.visible-xs{display:table;} tr.visible-xs{display:table-row !important;} th.visible-xs,td.visible-xs{display:table-cell !important;}}@media (min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block !important;}table.visible-xs.visible-sm{display:table;} tr.visible-xs.visible-sm{display:table-row !important;} th.visible-xs.visible-sm,td.visible-xs.visible-sm{display:table-cell !important;}}@media (min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block !important;}table.visible-xs.visible-md{display:table;} tr.visible-xs.visible-md{display:table-row !important;} th.visible-xs.visible-md,td.visible-xs.visible-md{display:table-cell !important;}}@media (min-width:1200px){.visible-xs.visible-lg{display:block !important;}table.visible-xs.visible-lg{display:table;} tr.visible-xs.visible-lg{display:table-row !important;} th.visible-xs.visible-lg,td.visible-xs.visible-lg{display:table-cell !important;}}.visible-sm,tr.visible-sm,th.visible-sm,td.visible-sm{display:none !important;}@media (max-width:767px){.visible-sm.visible-xs{display:block !important;}table.visible-sm.visible-xs{display:table;} tr.visible-sm.visible-xs{display:table-row !important;} th.visible-sm.visible-xs,td.visible-sm.visible-xs{display:table-cell !important;}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important;}table.visible-sm{display:table;} tr.visible-sm{display:table-row !important;} th.visible-sm,td.visible-sm{display:table-cell !important;}}@media (min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block !important;}table.visible-sm.visible-md{display:table;} tr.visible-sm.visible-md{display:table-row !important;} th.visible-sm.visible-md,td.visible-sm.visible-md{display:table-cell !important;}}@media (min-width:1200px){.visible-sm.visible-lg{display:block !important;}table.visible-sm.visible-lg{display:table;} tr.visible-sm.visible-lg{display:table-row !important;} th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell !important;}}.visible-md,tr.visible-md,th.visible-md,td.visible-md{display:none !important;}@media (max-width:767px){.visible-md.visible-xs{display:block !important;}table.visible-md.visible-xs{display:table;} tr.visible-md.visible-xs{display:table-row !important;} th.visible-md.visible-xs,td.visible-md.visible-xs{display:table-cell !important;}}@media (min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block !important;}table.visible-md.visible-sm{display:table;} tr.visible-md.visible-sm{display:table-row !important;} th.visible-md.visible-sm,td.visible-md.visible-sm{display:table-cell !important;}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important;}table.visible-md{display:table;} tr.visible-md{display:table-row !important;} th.visible-md,td.visible-md{display:table-cell !important;}}@media (min-width:1200px){.visible-md.visible-lg{display:block !important;}table.visible-md.visible-lg{display:table;} tr.visible-md.visible-lg{display:table-row !important;} th.visible-md.visible-lg,td.visible-md.visible-lg{display:table-cell !important;}}.visible-lg,tr.visible-lg,th.visible-lg,td.visible-lg{display:none !important;}@media (max-width:767px){.visible-lg.visible-xs{display:block !important;}table.visible-lg.visible-xs{display:table;} tr.visible-lg.visible-xs{display:table-row !important;} th.visible-lg.visible-xs,td.visible-lg.visible-xs{display:table-cell !important;}}@media (min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block !important;}table.visible-lg.visible-sm{display:table;} tr.visible-lg.visible-sm{display:table-row !important;} th.visible-lg.visible-sm,td.visible-lg.visible-sm{display:table-cell !important;}}@media (min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block !important;}table.visible-lg.visible-md{display:table;} tr.visible-lg.visible-md{display:table-row !important;} th.visible-lg.visible-md,td.visible-lg.visible-md{display:table-cell !important;}}@media (min-width:1200px){.visible-lg{display:block !important;}table.visible-lg{display:table;} tr.visible-lg{display:table-row !important;} th.visible-lg,td.visible-lg{display:table-cell !important;}}.hidden-xs{display:block !important;}table.hidden-xs{display:table;}tr.hidden-xs{display:table-row !important;}th.hidden-xs,td.hidden-xs{display:table-cell !important;}@media (max-width:767px){.hidden-xs,tr.hidden-xs,th.hidden-xs,td.hidden-xs{display:none !important;}}@media (min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm,tr.hidden-xs.hidden-sm,th.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm{display:none !important;}}@media (min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md,tr.hidden-xs.hidden-md,th.hidden-xs.hidden-md,td.hidden-xs.hidden-md{display:none !important;}}@media (min-width:1200px){.hidden-xs.hidden-lg,tr.hidden-xs.hidden-lg,th.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg{display:none !important;}}.hidden-sm{display:block !important;}table.hidden-sm{display:table;}tr.hidden-sm{display:table-row !important;}th.hidden-sm,td.hidden-sm{display:table-cell !important;}@media (max-width:767px){.hidden-sm.hidden-xs,tr.hidden-sm.hidden-xs,th.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs{display:none !important;}}@media (min-width:768px) and (max-width:991px){.hidden-sm,tr.hidden-sm,th.hidden-sm,td.hidden-sm{display:none !important;}}@media (min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md,tr.hidden-sm.hidden-md,th.hidden-sm.hidden-md,td.hidden-sm.hidden-md{display:none !important;}}@media (min-width:1200px){.hidden-sm.hidden-lg,tr.hidden-sm.hidden-lg,th.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg{display:none !important;}}.hidden-md{display:block !important;}table.hidden-md{display:table;}tr.hidden-md{display:table-row !important;}th.hidden-md,td.hidden-md{display:table-cell !important;}@media (max-width:767px){.hidden-md.hidden-xs,tr.hidden-md.hidden-xs,th.hidden-md.hidden-xs,td.hidden-md.hidden-xs{display:none !important;}}@media (min-width:768px) and (max-width:991px){.hidden-md.hidden-sm,tr.hidden-md.hidden-sm,th.hidden-md.hidden-sm,td.hidden-md.hidden-sm{display:none !important;}}@media (min-width:992px) and (max-width:1199px){.hidden-md,tr.hidden-md,th.hidden-md,td.hidden-md{display:none !important;}}@media (min-width:1200px){.hidden-md.hidden-lg,tr.hidden-md.hidden-lg,th.hidden-md.hidden-lg,td.hidden-md.hidden-lg{display:none !important;}}.hidden-lg{display:block !important;}table.hidden-lg{display:table;}tr.hidden-lg{display:table-row !important;}th.hidden-lg,td.hidden-lg{display:table-cell !important;}@media (max-width:767px){.hidden-lg.hidden-xs,tr.hidden-lg.hidden-xs,th.hidden-lg.hidden-xs,td.hidden-lg.hidden-xs{display:none !important;}}@media (min-width:768px) and (max-width:991px){.hidden-lg.hidden-sm,tr.hidden-lg.hidden-sm,th.hidden-lg.hidden-sm,td.hidden-lg.hidden-sm{display:none !important;}}@media (min-width:992px) and (max-width:1199px){.hidden-lg.hidden-md,tr.hidden-lg.hidden-md,th.hidden-lg.hidden-md,td.hidden-lg.hidden-md{display:none !important;}}@media (min-width:1200px){.hidden-lg,tr.hidden-lg,th.hidden-lg,td.hidden-lg{display:none !important;}}.visible-print,tr.visible-print,th.visible-print,td.visible-print{display:none !important;}@media print{.visible-print{display:block !important;}table.visible-print{display:table;} tr.visible-print{display:table-row !important;} th.visible-print,td.visible-print{display:table-cell !important;} .hidden-print,tr.hidden-print,th.hidden-print,td.hidden-print{display:none !important;}} \ No newline at end of file diff --git a/src/main/webapp/bootstrap3.0.3/css/bootstrapValidator.css b/src/main/webapp/bootstrap3.0.3/css/bootstrapValidator.css new file mode 100644 index 00000000..ebe9522f --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/css/bootstrapValidator.css @@ -0,0 +1,21 @@ +/** + * BootstrapValidator (http://bootstrapvalidator.com) + * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3 + * + * @author http://twitter.com/nghuuphuoc + * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc + * @license MIT + */ + +.bv-form .help-block { + margin-bottom: 0; +} +.bv-form .tooltip-inner { + text-align: left; +} +.nav-tabs li.bv-tab-success > a { + color: #3c763d; +} +.nav-tabs li.bv-tab-error > a { + color: #a94442; +} diff --git a/src/main/webapp/bootstrap3.0.3/css/font-awesome.min.css b/src/main/webapp/bootstrap3.0.3/css/font-awesome.min.css new file mode 100644 index 00000000..449d6ac5 --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.0.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857142858em;text-align:center}.fa-ul{padding-left:0;margin-left:2.142857142857143em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;top:.14285714285714285em;text-align:center}.fa-li.fa-lg{left:-1.8571428571428572em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-asc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-desc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-reply-all:before{content:"\f122"}.fa-mail-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"} \ No newline at end of file diff --git a/src/main/webapp/bootstrap3.0.3/css/formValidation.css b/src/main/webapp/bootstrap3.0.3/css/formValidation.css new file mode 100644 index 00000000..18236846 --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/css/formValidation.css @@ -0,0 +1,164 @@ +/** + * FormValidation (http://formvalidation.io) + * The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks + * + * @author http://twitter.com/nghuuphuoc + * @copyright (c) 2013 - 2015 Nguyen Huu Phuoc + * @license http://formvalidation.io/license/ + */ + +.fv-has-feedback { + position: relative; +} +.fv-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; +} +.fv-has-feedback .fv-control-feedback { + /*right: 15px;*/ +} +.fv-help-block { + display: block; +} + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* ~~~ For Bootstrap form ~~~ */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.fv-form-bootstrap .help-block { + margin-bottom: 0; +} +.fv-form-bootstrap .tooltip-inner { + text-align: left; +} +/* Bootstrap stacked form without label */ +.fv-form-bootstrap .fv-icon-no-label { + top: 0; +} +.fv-form-bootstrap .fv-bootstrap-icon-input-group { + z-index: 100; +} +/* Bootstrap inline form */ +.form-inline.fv-form-bootstrap .form-group { + vertical-align: top; +} + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* ~~~ For Foundation form ~~~ */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.fv-form-foundation .fv-control-feedback { + top: 21px; /* The height of Foundation label */ + right: 15px; /* The padding-right of .columns */ + width: 37px; + height: 37px; + line-height: 37px; +} +.fv-form-foundation .collapse .fv-control-feedback { + top: 0; + right: 0; +} +/* Foundation horizontal form */ +.fv-form-horizontal.fv-form-foundation .fv-control-feedback { + top: 0; +} +/* Foundation stacked form without label */ +.fv-form-foundation .fv-icon-no-label { + top: 0; +} +.fv-form-foundation .error .fv-control-feedback { + color: #f04124; +} +/** + * Foundation reset the bottom marin to 0 when the row has '.error' class + * I need to adjust it when using tooltip to show the error + */ +.fv-form-foundation .error.fv-has-tooltip input, .error.fv-has-tooltip textarea, .error.fv-has-tooltip select { + margin-bottom: 1rem; +} + +/* ~~~~~~~~~~~~~~~~~~~~~ */ +/* ~~~ For Pure form ~~~ */ +/* ~~~~~~~~~~~~~~~~~~~~~ */ + +.fv-form-pure .fv-control-feedback { + top: 22px; /* Height of Pure label */ + width: 36px; /* Height of Pure input */ + height: 36px; + line-height: 36px; +} +.pure-form-stacked.fv-form-pure .fv-control-feedback { + top: 4px; +} +.pure-form-aligned .pure-control-group .fv-help-block { + margin-top: 5px; + margin-left: 180px; +} +.pure-form-aligned.fv-form-pure .fv-control-feedback, /* Pure horizontal form */ +.fv-form-pure .fv-icon-no-label { /* Pure stacked form without label */ + top: 0; +} +.fv-form-pure .fv-has-error label, +.fv-form-pure .fv-has-error .fv-help-block, +.fv-form-pure .fv-has-error .fv-control-feedback { + color: #CA3C3C; /* Same as .button-error */ +} +.fv-form-pure .fv-has-success label, +.fv-form-pure .fv-has-success .fv-control-feedback { + /*color: #1CB841;*/ /* Same as .button-success */ +} + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* ~~~ For Semantic form ~~~ */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.fv-form-semantic .fv-control-feedback.icon { + right: 7px; +} +.fv-form-semantic .error .icon { + color: #d95c5c; +} +/* Semantic horizontal form */ +.fv-form-horizontal.fv-form-semantic .row { + padding-bottom: 0; +} + +/* ~~~~~~~~~~~~~~~~~~~~~~ */ +/* ~~~ For UIKit form ~~~ */ +/* ~~~~~~~~~~~~~~~~~~~~~~ */ + +.fv-form-uikit .fv-control-feedback { + top: 25px; /* Height of UIKit label */ + width: 30px; /* Height of UIKit input */ + height: 30px; + line-height: 30px; +} +.fv-form-uikit .uk-text-danger { + display: block; +} +/* UIKit horizontal form */ +.uk-form-horizontal.fv-form-uikit .fv-control-feedback { + /*line-height: normal;*/ + top: 0; +} +.fv-form-uikit .fv-has-error label, +.fv-form-uikit .fv-has-error .uk-form-label, +.fv-form-uikit .fv-has-error .fv-control-feedback { + color: #D85030; /* Same as .uk-form-danger */ +} +.fv-form-uikit .fv-has-success label, +.fv-form-uikit .fv-has-success .uk-form-label, +.fv-form-uikit .fv-has-success .fv-control-feedback { + /*color: #659F13;*/ /* Same as .uk-form-success */ +} +/* UIKit stacked form without label */ +.fv-form-uikit .fv-icon-no-label { + top: 0; +} diff --git a/src/main/webapp/bootstrap3.0.3/css/formValidation.min.css b/src/main/webapp/bootstrap3.0.3/css/formValidation.min.css new file mode 100644 index 00000000..62f23d7e --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/css/formValidation.min.css @@ -0,0 +1 @@ +.fv-has-feedback{position:relative}.fv-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center}.fv-help-block{display:block}.fv-form-bootstrap .help-block{margin-bottom:0}.fv-form-bootstrap .tooltip-inner{text-align:left}.fv-form-bootstrap .fv-icon-no-label{top:0}.fv-form-bootstrap .fv-bootstrap-icon-input-group{z-index:100}.form-inline.fv-form-bootstrap .form-group{vertical-align:top}.fv-form-foundation .fv-control-feedback{top:21px;right:15px;width:37px;height:37px;line-height:37px}.fv-form-foundation .collapse .fv-control-feedback{top:0;right:0}.fv-form-foundation .fv-icon-no-label,.fv-form-horizontal.fv-form-foundation .fv-control-feedback{top:0}.fv-form-foundation .error .fv-control-feedback{color:#f04124}.error.fv-has-tooltip select,.error.fv-has-tooltip textarea,.fv-form-foundation .error.fv-has-tooltip input{margin-bottom:1rem}.fv-form-pure .fv-control-feedback{top:22px;width:36px;height:36px;line-height:36px}.pure-form-stacked.fv-form-pure .fv-control-feedback{top:4px}.pure-form-aligned .pure-control-group .fv-help-block{margin-top:5px;margin-left:180px}.fv-form-pure .fv-icon-no-label,.pure-form-aligned.fv-form-pure .fv-control-feedback{top:0}.fv-form-pure .fv-has-error .fv-control-feedback,.fv-form-pure .fv-has-error .fv-help-block,.fv-form-pure .fv-has-error label{color:#CA3C3C}.fv-form-semantic .fv-control-feedback.icon{right:7px}.fv-form-semantic .error .icon{color:#d95c5c}.fv-form-horizontal.fv-form-semantic .row{padding-bottom:0}.fv-form-uikit .fv-control-feedback{top:25px;width:30px;height:30px;line-height:30px}.fv-form-uikit .uk-text-danger{display:block}.uk-form-horizontal.fv-form-uikit .fv-control-feedback{top:0}.fv-form-uikit .fv-has-error .fv-control-feedback,.fv-form-uikit .fv-has-error .uk-form-label,.fv-form-uikit .fv-has-error label{color:#D85030}.fv-form-uikit .fv-icon-no-label{top:0} \ No newline at end of file diff --git a/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.eot b/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 00000000..423bd5d3 Binary files /dev/null and b/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.eot differ diff --git a/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.svg b/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 00000000..44694887 --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.ttf b/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 00000000..a498ef4e Binary files /dev/null and b/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.ttf differ diff --git a/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.woff b/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 00000000..d83c539b Binary files /dev/null and b/src/main/webapp/bootstrap3.0.3/fonts/glyphicons-halflings-regular.woff differ diff --git a/src/main/webapp/bootstrap3.0.3/ie-emulation-modes-warning.js b/src/main/webapp/bootstrap3.0.3/ie-emulation-modes-warning.js new file mode 100644 index 00000000..896ed622 --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/ie-emulation-modes-warning.js @@ -0,0 +1,51 @@ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ +/*! + * Copyright 2014 Twitter, Inc. + * + * Licensed under the Creative Commons Attribution 3.0 Unported License. For + * details, see http://creativecommons.org/licenses/by/3.0/. + */ +// Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. +(function () { + 'use strict'; + + function emulatedIEMajorVersion() { + var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) + if (groups === null) { + return null + } + var ieVersionNum = parseInt(groups[1], 10) + var ieMajorVersion = Math.floor(ieVersionNum) + return ieMajorVersion + } + + function actualNonEmulatedIEMajorVersion() { + // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. + // IE JavaScript conditional compilation docs: http://msdn.microsoft.com/en-us/library/ie/121hztk3(v=vs.94).aspx + // @cc_on docs: http://msdn.microsoft.com/en-us/library/ie/8ka90k2e(v=vs.94).aspx + var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line + if (jscriptVersion === undefined) { + return 11 // IE11+ not in emulation mode + } + if (jscriptVersion < 9) { + return 8 // IE8 (or lower; haven't tested on IE<8) + } + return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode + } + + var ua = window.navigator.userAgent + if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { + return // Opera, which might pretend to be IE + } + var emulated = emulatedIEMajorVersion() + if (emulated === null) { + return // Not IE + } + var nonEmulated = actualNonEmulatedIEMajorVersion() + + if (emulated !== nonEmulated) { + window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') + } +})(); diff --git a/src/main/webapp/bootstrap3.0.3/ie10-viewport-bug-workaround.js b/src/main/webapp/bootstrap3.0.3/ie10-viewport-bug-workaround.js new file mode 100644 index 00000000..7f53b614 --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/ie10-viewport-bug-workaround.js @@ -0,0 +1,22 @@ +/*! + * IE10 viewport hack for Surface/desktop Windows 8 bug + * Copyright 2014 Twitter, Inc. + * Licensed under the Creative Commons Attribution 3.0 Unported License. For + * details, see http://creativecommons.org/licenses/by/3.0/. + */ + +// See the Getting Started docs for more information: +// http://getbootstrap.com/getting-started/#support-ie10-width + +(function () { + 'use strict'; + if (navigator.userAgent.match(/IEMobile\/10\.0/)) { + var msViewportStyle = document.createElement('style') + msViewportStyle.appendChild( + document.createTextNode( + '@-ms-viewport{width:auto!important}' + ) + ) + document.querySelector('head').appendChild(msViewportStyle) + } +})(); diff --git a/src/main/webapp/bootstrap3.0.3/ie8-responsive-file-warning.js b/src/main/webapp/bootstrap3.0.3/ie8-responsive-file-warning.js new file mode 100644 index 00000000..280a73f4 --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/ie8-responsive-file-warning.js @@ -0,0 +1,13 @@ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ +/*! + * Copyright 2011-2014 Twitter, Inc. + * + * Licensed under the Creative Commons Attribution 3.0 Unported License. For + * details, see http://creativecommons.org/licenses/by/3.0/. + */ +// Intended to prevent false-positive bug reports about responsive styling supposedly not working in IE8. +if (window.location.protocol == 'file:') { + window.alert('ERROR: Bootstrap\'s responsive CSS is disabled!\nSee getbootstrap.com/getting-started/#respond-file-proto for details.') +} diff --git a/src/main/webapp/bootstrap3.0.3/js/bootstrap.js b/src/main/webapp/bootstrap3.0.3/js/bootstrap.js new file mode 100644 index 00000000..d83e5f85 --- /dev/null +++ b/src/main/webapp/bootstrap3.0.3/js/bootstrap.js @@ -0,0 +1,1943 @@ +/* ======================================================================== + * Bootstrap: alert.js v3.1.1 + * http://getbootstrap.com/javascript/#alerts + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // ALERT CLASS DEFINITION + // ====================== + + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = $(selector) + + if (e) e.preventDefault() + + if (!$parent.length) { + $parent = $this.hasClass('alert') ? $this : $this.parent() + } + + $parent.trigger(e = $.Event('close.bs.alert')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent.trigger('closed.bs.alert').remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent + .one($.support.transition.end, removeElement) + .emulateTransitionEnd(150) : + removeElement() + } + + + // ALERT PLUGIN DEFINITION + // ======================= + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + // ALERT NO CONFLICT + // ================= + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + // ALERT DATA-API + // ============== + + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: button.js v3.1.1 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false + } + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state = state + 'Text' + + if (!data.resetText) $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout($.proxy(function () { + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) + } + + Button.prototype.toggle = function () { + var changed = true + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked') && this.$element.hasClass('active')) changed = false + else $parent.find('.active').removeClass('active') + } + if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + } + + if (changed) this.$element.toggleClass('active') + } + + + // BUTTON PLUGIN DEFINITION + // ======================== + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + // BUTTON DATA-API + // =============== + + $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + e.preventDefault() + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: carousel.js v3.1.1 + * http://getbootstrap.com/javascript/#carousel + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CAROUSEL CLASS DEFINITION + // ========================= + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = + this.sliding = + this.interval = + this.$active = + this.$items = null + + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.DEFAULTS = { + interval: 5000, + pause: 'hover', + wrap: true + } + + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) + + this.interval && clearInterval(this.interval) + + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + + return this + } + + Carousel.prototype.getActiveIndex = function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + + return this.$items.index(this.$active) + } + + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getActiveIndex() + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) + if (activeIndex == pos) return this.pause().cycle() + + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + } + + Carousel.prototype.pause = function (e) { + e || (this.paused = true) + + if (this.$element.find('.next, .prev').length && $.support.transition) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + + this.interval = clearInterval(this.interval) + + return this + } + + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') + } + + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } + + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || $active[type]() + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var fallback = type == 'next' ? 'first' : 'last' + var that = this + + if (!$next.length) { + if (!this.options.wrap) return + $next = this.$element.find('.item')[fallback]() + } + + if ($next.hasClass('active')) return this.sliding = false + + var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + + this.sliding = true + + isCycling && this.pause() + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid.bs.carousel', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) + }) + .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) + } else { + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid.bs.carousel') + } + + isCycling && this.cycle() + + return this + } + + + // CAROUSEL PLUGIN DEFINITION + // ========================== + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide + + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + $.fn.carousel.Constructor = Carousel + + + // CAROUSEL NO CONFLICT + // ==================== + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + + // CAROUSEL DATA-API + // ================= + + $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false + + $target.carousel(options) + + if (slideIndex = $this.attr('data-slide-to')) { + $target.data('bs.carousel').to(slideIndex) + } + + e.preventDefault() + }) + + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + $carousel.carousel($carousel.data()) + }) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.1.1 + * http://getbootstrap.com/javascript/#dropdowns + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle=dropdown]' + var Dropdown = function (element) { + $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we use a backdrop because click events don't delegate + $('' + + ''; + + //custom options + if (typeof options !== 'object' || options === null) + options = {}; + + this.parentEl = (typeof options === 'object' && options.parentEl && $(options.parentEl).length) || $(this.parentEl); + this.container = $(DRPTemplate).appendTo(this.parentEl); + + this.setOptions(options, cb); + + //apply CSS classes and labels to buttons + var c = this.container; + $.each(this.buttonClasses, function (idx, val) { + c.find('button').addClass(val); + }); + this.container.find('.daterangepicker_start_input label').html(this.locale.fromLabel); + this.container.find('.daterangepicker_end_input label').html(this.locale.toLabel); + if (this.applyClass.length) + this.container.find('.applyBtn').addClass(this.applyClass); + if (this.cancelClass.length) + this.container.find('.cancelBtn').addClass(this.cancelClass); + this.container.find('.applyBtn').html(this.locale.applyLabel); + this.container.find('.cancelBtn').html(this.locale.cancelLabel); + + //event listeners + + this.container.find('.calendar') + .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this)) + .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this)) + .on('click.daterangepicker', 'td.available', $.proxy(this.clickDate, this)) + .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.enterDate, this)) + .on('mouseleave.daterangepicker', 'td.available', $.proxy(this.updateFormInputs, this)) + .on('change.daterangepicker', 'select.yearselect', $.proxy(this.updateMonthYear, this)) + .on('change.daterangepicker', 'select.monthselect', $.proxy(this.updateMonthYear, this)) + .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.ampmselect', $.proxy(this.updateTime, this)); + + this.container.find('.ranges') + .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this)) + .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this)) + .on('click.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.showCalendars, this)) + .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this)) + .on('mouseenter.daterangepicker', 'li', $.proxy(this.enterRange, this)) + .on('mouseleave.daterangepicker', 'li', $.proxy(this.updateFormInputs, this)); + + if (this.element.is('input')) { + this.element.on({ + 'click.daterangepicker': $.proxy(this.show, this), + 'focus.daterangepicker': $.proxy(this.show, this), + 'keyup.daterangepicker': $.proxy(this.updateFromControl, this) + }); + } else { + this.element.on('click.daterangepicker', $.proxy(this.toggle, this)); + } + + }; + + DateRangePicker.prototype = { + + constructor: DateRangePicker, + + setOptions: function(options, callback) { + + this.startDate = moment().startOf('day'); + this.endDate = moment().endOf('day'); + this.minDate = false; + this.maxDate = false; + this.dateLimit = false; + + this.showDropdowns = false; + this.showWeekNumbers = false; + this.timePicker = false; + this.timePickerIncrement = 30; + this.timePicker12Hour = true; + this.singleDatePicker = false; + this.ranges = {}; + + this.opens = 'right'; + if (this.element.hasClass('pull-right')) + this.opens = 'left'; + + this.buttonClasses = ['btn', 'btn-small']; + this.applyClass = 'btn-success'; + this.cancelClass = 'btn-default'; + + this.format = 'YYYY-MM-DD'; + this.separator = '-'; + + this.locale = { + applyLabel: '确定', + cancelLabel: '取消', + fromLabel: '起始时间', + toLabel: '结束时间', + weekLabel: 'W', + customRangeLabel: 'Custom Range', + daysOfWeek: moment()._lang._weekdaysMin.slice(), + monthNames: moment()._lang._monthsShort.slice(), + firstDay: 0 + }; + + this.cb = function () { }; + + if (typeof options.format === 'string') + this.format = options.format; + + if (typeof options.separator === 'string') + this.separator = options.separator; + + if (typeof options.startDate === 'string') + this.startDate = moment(options.startDate, this.format); + + if (typeof options.endDate === 'string') + this.endDate = moment(options.endDate, this.format); + + if (typeof options.minDate === 'string') + this.minDate = moment(options.minDate, this.format); + + if (typeof options.maxDate === 'string') + this.maxDate = moment(options.maxDate, this.format); + + if (typeof options.startDate === 'object') + this.startDate = moment(options.startDate); + + if (typeof options.endDate === 'object') + this.endDate = moment(options.endDate); + + if (typeof options.minDate === 'object') + this.minDate = moment(options.minDate); + + if (typeof options.maxDate === 'object') + this.maxDate = moment(options.maxDate); + + if (typeof options.applyClass === 'string') + this.applyClass = options.applyClass; + + if (typeof options.cancelClass === 'string') + this.cancelClass = options.cancelClass; + + if (typeof options.dateLimit === 'object') + this.dateLimit = options.dateLimit; + + // update day names order to firstDay + if (typeof options.locale === 'object') { + + if (typeof options.locale.daysOfWeek === 'object') { + // Create a copy of daysOfWeek to avoid modification of original + // options object for reusability in multiple daterangepicker instances + this.locale.daysOfWeek = options.locale.daysOfWeek.slice(); + } + + if (typeof options.locale.monthNames === 'object') { + this.locale.monthNames = options.locale.monthNames.slice(); + } + + if (typeof options.locale.firstDay === 'number') { + this.locale.firstDay = options.locale.firstDay; + var iterator = options.locale.firstDay; + while (iterator > 0) { + this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()); + iterator--; + } + } + + if (typeof options.locale.applyLabel === 'string') { + this.locale.applyLabel = options.locale.applyLabel; + } + + if (typeof options.locale.cancelLabel === 'string') { + this.locale.cancelLabel = options.locale.cancelLabel; + } + + if (typeof options.locale.fromLabel === 'string') { + this.locale.fromLabel = options.locale.fromLabel; + } + + if (typeof options.locale.toLabel === 'string') { + this.locale.toLabel = options.locale.toLabel; + } + + if (typeof options.locale.weekLabel === 'string') { + this.locale.weekLabel = options.locale.weekLabel; + } + + if (typeof options.locale.customRangeLabel === 'string') { + this.locale.customRangeLabel = options.locale.customRangeLabel; + } + } + + if (typeof options.opens === 'string') + this.opens = options.opens; + + if (typeof options.showWeekNumbers === 'boolean') { + this.showWeekNumbers = options.showWeekNumbers; + } + + if (typeof options.buttonClasses === 'string') { + this.buttonClasses = [options.buttonClasses]; + } + + if (typeof options.buttonClasses === 'object') { + this.buttonClasses = options.buttonClasses; + } + + if (typeof options.showDropdowns === 'boolean') { + this.showDropdowns = options.showDropdowns; + } + + if (typeof options.singleDatePicker === 'boolean') { + this.singleDatePicker = options.singleDatePicker; + } + + if (typeof options.timePicker === 'boolean') { + this.timePicker = options.timePicker; + } + + if (typeof options.timePickerIncrement === 'number') { + this.timePickerIncrement = options.timePickerIncrement; + } + + if (typeof options.timePicker12Hour === 'boolean') { + this.timePicker12Hour = options.timePicker12Hour; + } + + var start, end, range; + + //if no start/end dates set, check if an input element contains initial values + if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') { + if ($(this.element).is('input[type=text]')) { + var val = $(this.element).val(); + var split = val.split(this.separator); + start = end = null; + if (split.length == 2) { + start = moment(split[0], this.format); + end = moment(split[1], this.format); + } else if (this.singleDatePicker) { + start = moment(val, this.format); + end = moment(val, this.format); + } + if (start !== null && end !== null) { + this.startDate = start; + this.endDate = end; + } + } + } + + if (typeof options.ranges === 'object') { + for (range in options.ranges) { + + start = moment(options.ranges[range][0]); + end = moment(options.ranges[range][1]); + + // If we have a min/max date set, bound this range + // to it, but only if it would otherwise fall + // outside of the min/max. + if (this.minDate && start.isBefore(this.minDate)) + start = moment(this.minDate); + + if (this.maxDate && end.isAfter(this.maxDate)) + end = moment(this.maxDate); + + // If the end of the range is before the minimum (if min is set) OR + // the start of the range is after the max (also if set) don't display this + // range option. + if ((this.minDate && end.isBefore(this.minDate)) || (this.maxDate && start.isAfter(this.maxDate))) { + continue; + } + + this.ranges[range] = [start, end]; + } + + var list = '
    '; + for (range in this.ranges) { + list += '
  • ' + range + '
  • '; + } + list += '
  • ' + this.locale.customRangeLabel + '
  • '; + list += '
'; + this.container.find('.ranges ul').remove(); + this.container.find('.ranges').prepend(list); + } + + if (typeof callback === 'function') { + this.cb = callback; + } + + if (!this.timePicker) { + this.startDate = this.startDate.startOf('day'); + this.endDate = this.endDate.endOf('day'); + } + + if (this.singleDatePicker) { + this.opens = 'right'; + this.container.find('.calendar.right').show(); + this.container.find('.calendar.left').hide(); + this.container.find('.ranges').hide(); + if (!this.container.find('.calendar.right').hasClass('single')) + this.container.find('.calendar.right').addClass('single'); + } else { + this.container.find('.calendar.right').removeClass('single'); + this.container.find('.ranges').show(); + } + + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + this.oldChosenLabel = this.chosenLabel; + + this.leftCalendar = { + month: moment([this.startDate.year(), this.startDate.month(), 1, this.startDate.hour(), this.startDate.minute()]), + calendar: [] + }; + + this.rightCalendar = { + month: moment([this.endDate.year(), this.endDate.month(), 1, this.endDate.hour(), this.endDate.minute()]), + calendar: [] + }; + + if (this.opens == 'right') { + //swap calendar positions + var left = this.container.find('.calendar.left'); + var right = this.container.find('.calendar.right'); + left.removeClass('left').addClass('right'); + right.removeClass('right').addClass('left'); + } + + if (typeof options.ranges === 'undefined' && !this.singleDatePicker) { + this.container.addClass('show-calendar'); + } + + this.container.addClass('opens' + this.opens); + + this.updateView(); + this.updateCalendars(); + + }, + + setStartDate: function(startDate) { + if (typeof startDate === 'string') + this.startDate = moment(startDate, this.format); + + if (typeof startDate === 'object') + this.startDate = moment(startDate); + + if (!this.timePicker) + this.startDate = this.startDate.startOf('day'); + + this.oldStartDate = this.startDate.clone(); + + this.updateView(); + this.updateCalendars(); + }, + + setEndDate: function(endDate) { + if (typeof endDate === 'string') + this.endDate = moment(endDate, this.format); + + if (typeof endDate === 'object') + this.endDate = moment(endDate); + + if (!this.timePicker) + this.endDate = this.endDate.endOf('day'); + + this.oldEndDate = this.endDate.clone(); + + this.updateView(); + this.updateCalendars(); + }, + + updateView: function () { + this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()); + this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()); + this.updateFormInputs(); + }, + + updateFormInputs: function () { + this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.format)); + this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.format)); + + if (this.startDate.isSame(this.endDate) || this.startDate.isBefore(this.endDate)) { + this.container.find('button.applyBtn').removeAttr('disabled'); + } else { + this.container.find('button.applyBtn').attr('disabled', 'disabled'); + } + }, + + updateFromControl: function () { + if (!this.element.is('input')) return; + if (!this.element.val().length) return; + + var dateString = this.element.val().split(this.separator); + var start = moment(dateString[0], this.format); + var end = moment(dateString[1], this.format); + + if (this.singleDatePicker) { + start = moment(this.element.val(), this.format); + end = start; + } + + if (end.isBefore(start)) return; + + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + + this.startDate = start; + this.endDate = end; + + if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) + this.notify(); + + this.updateCalendars(); + }, + + notify: function () { + this.updateView(); + this.cb(this.startDate, this.endDate, this.chosenLabel); + }, + + move: function () { + var parentOffset = { top: 0, left: 0 }; + if (!this.parentEl.is('body')) { + parentOffset = { + top: this.parentEl.offset().top - this.parentEl.scrollTop(), + left: this.parentEl.offset().left - this.parentEl.scrollLeft() + }; + } + + if (this.opens == 'left') { + this.container.css({ + top: this.element.offset().top + this.element.outerHeight() - parentOffset.top, + right: $(window).width() - this.element.offset().left - this.element.outerWidth() - parentOffset.left, + left: 'auto' + }); + if (this.container.offset().left < 0) { + this.container.css({ + right: 'auto', + left: 9 + }); + } + } else { + this.container.css({ + top: this.element.offset().top + this.element.outerHeight() - parentOffset.top, + left: this.element.offset().left - parentOffset.left, + right: 'auto' + }); + if (this.container.offset().left + this.container.outerWidth() > $(window).width()) { + this.container.css({ + left: 'auto', + right: 0 + }); + } + } + }, + + toggle: function (e) { + if (this.element.hasClass('active')) { + this.hide(); + } else { + this.show(); + } + }, + + show: function (e) { + this.element.addClass('active'); + this.container.show(); + this.move(); + + $(document).on('click.daterangepicker', $.proxy(this.outsideClick, this)); + // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them + $(document).on('click.daterangepicker', '[data-toggle=dropdown]', $.proxy(this.outsideClick, this)); + + this.element.trigger('show.daterangepicker', this); + }, + + outsideClick: function (e) { + var target = $(e.target); + // if the page is clicked anywhere except within the daterangerpicker/button + // itself then call this.hide() + if ( + target.closest(this.element).length || + target.closest(this.container).length || + target.closest('.calendar-date').length + ) return; + this.hide(); + }, + + hide: function (e) { + this.element.removeClass('active'); + this.container.hide(); + + if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) + this.notify(); + + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + + $(document).off('click.daterangepicker', this.outsideClick); + this.element.trigger('hide.daterangepicker', this); + }, + + enterRange: function (e) { + // mouse pointer has entered a range label + var label = e.target.innerHTML; + if (label == this.locale.customRangeLabel) { + this.updateView(); + } else { + var dates = this.ranges[label]; + this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.format)); + this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.format)); + } + }, + + showCalendars: function() { + this.container.addClass('show-calendar'); + this.move(); + }, + + hideCalendars: function() { + this.container.removeClass('show-calendar'); + }, + + updateInputText: function() { + if (this.element.is('input') && !this.singleDatePicker) { + this.element.val(this.startDate.format(this.format) + this.separator + this.endDate.format(this.format)); + } else if (this.element.is('input')) { + this.element.val(this.startDate.format(this.format)); + } + }, + + clickRange: function (e) { + var label = e.target.innerHTML; + this.chosenLabel = label; + if (label == this.locale.customRangeLabel) { + this.showCalendars(); + } else { + var dates = this.ranges[label]; + + this.startDate = dates[0]; + this.endDate = dates[1]; + + if (!this.timePicker) { + this.startDate.startOf('day'); + this.endDate.endOf('day'); + } + + this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()).hour(this.startDate.hour()).minute(this.startDate.minute()); + this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()).hour(this.endDate.hour()).minute(this.endDate.minute()); + this.updateCalendars(); + + this.updateInputText(); + + this.hideCalendars(); + this.hide(); + this.element.trigger('apply.daterangepicker', this); + } + }, + + clickPrev: function (e) { + var cal = $(e.target).parents('.calendar'); + if (cal.hasClass('left')) { + this.leftCalendar.month.subtract('month', 1); + } else { + this.rightCalendar.month.subtract('month', 1); + } + this.updateCalendars(); + }, + + clickNext: function (e) { + var cal = $(e.target).parents('.calendar'); + if (cal.hasClass('left')) { + this.leftCalendar.month.add('month', 1); + } else { + this.rightCalendar.month.add('month', 1); + } + this.updateCalendars(); + }, + + enterDate: function (e) { + + var title = $(e.target).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(e.target).parents('.calendar'); + + if (cal.hasClass('left')) { + this.container.find('input[name=daterangepicker_start]').val(this.leftCalendar.calendar[row][col].format(this.format)); + } else { + this.container.find('input[name=daterangepicker_end]').val(this.rightCalendar.calendar[row][col].format(this.format)); + } + + }, + + clickDate: function (e) { + var title = $(e.target).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(e.target).parents('.calendar'); + + var startDate, endDate; + if (cal.hasClass('left')) { + startDate = this.leftCalendar.calendar[row][col]; + endDate = this.endDate; + if (typeof this.dateLimit === 'object') { + var maxDate = moment(startDate).add(this.dateLimit).startOf('day'); + if (endDate.isAfter(maxDate)) { + endDate = maxDate; + } + } + } else { + startDate = this.startDate; + endDate = this.rightCalendar.calendar[row][col]; + if (typeof this.dateLimit === 'object') { + var minDate = moment(endDate).subtract(this.dateLimit).startOf('day'); + if (startDate.isBefore(minDate)) { + startDate = minDate; + } + } + } + + if (this.singleDatePicker && cal.hasClass('left')) { + endDate = startDate.clone(); + } else if (this.singleDatePicker && cal.hasClass('right')) { + startDate = endDate.clone(); + } + + cal.find('td').removeClass('active'); + + if (startDate.isSame(endDate) || startDate.isBefore(endDate)) { + $(e.target).addClass('active'); + this.startDate = startDate; + this.endDate = endDate; + this.chosenLabel = this.locale.customRangeLabel; + } else if (startDate.isAfter(endDate)) { + $(e.target).addClass('active'); + var difference = this.endDate.diff(this.startDate); + this.startDate = startDate; + this.endDate = moment(startDate).add('ms', difference); + this.chosenLabel = this.locale.customRangeLabel; + } + + this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()); + this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()); + this.updateCalendars(); + + endDate.endOf('day'); + + if (this.singleDatePicker) + this.clickApply(); + }, + + clickApply: function (e) { + this.updateInputText(); + this.hide(); + this.element.trigger('apply.daterangepicker', this); + }, + + clickCancel: function (e) { + this.startDate = this.oldStartDate; + this.endDate = this.oldEndDate; + this.chosenLabel = this.oldChosenLabel; + this.updateView(); + this.updateCalendars(); + this.hide(); + this.element.trigger('cancel.daterangepicker', this); + }, + + updateMonthYear: function (e) { + var isLeft = $(e.target).closest('.calendar').hasClass('left'), + leftOrRight = isLeft ? 'left' : 'right', + cal = this.container.find('.calendar.'+leftOrRight); + + // Month must be Number for new moment versions + var month = parseInt(cal.find('.monthselect').val(), 10); + var year = cal.find('.yearselect').val(); + + this[leftOrRight+'Calendar'].month.month(month).year(year); + this.updateCalendars(); + }, + + updateTime: function(e) { + var isLeft = $(e.target).closest('.calendar').hasClass('left'), + leftOrRight = isLeft ? 'left' : 'right', + cal = this.container.find('.calendar.'+leftOrRight); + + var hour = parseInt(cal.find('.hourselect').val(), 10); + var minute = parseInt(cal.find('.minuteselect').val(), 10); + + if (this.timePicker12Hour) { + var ampm = cal.find('.ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + + if (isLeft) { + var start = this.startDate.clone(); + start.hour(hour); + start.minute(minute); + this.startDate = start; + this.leftCalendar.month.hour(hour).minute(minute); + } else { + var end = this.endDate.clone(); + end.hour(hour); + end.minute(minute); + this.endDate = end; + this.rightCalendar.month.hour(hour).minute(minute); + } + + this.updateCalendars(); + }, + + updateCalendars: function () { + this.leftCalendar.calendar = this.buildCalendar(this.leftCalendar.month.month(), this.leftCalendar.month.year(), this.leftCalendar.month.hour(), this.leftCalendar.month.minute(), 'left'); + this.rightCalendar.calendar = this.buildCalendar(this.rightCalendar.month.month(), this.rightCalendar.month.year(), this.rightCalendar.month.hour(), this.rightCalendar.month.minute(), 'right'); + this.container.find('.calendar.left').html(this.renderCalendar(this.leftCalendar.calendar, this.startDate, this.minDate, this.maxDate)); + this.container.find('.calendar.right').html(this.renderCalendar(this.rightCalendar.calendar, this.endDate, this.startDate, this.maxDate)); + + this.container.find('.ranges li').removeClass('active'); + var customRange = true; + var i = 0; + for (var range in this.ranges) { + if (this.timePicker) { + if (this.startDate.isSame(this.ranges[range][0]) && this.endDate.isSame(this.ranges[range][1])) { + customRange = false; + this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')') + .addClass('active').html(); + } + } else { + //ignore times when comparing dates if time picker is not enabled + if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) { + customRange = false; + this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')') + .addClass('active').html(); + } + } + i++; + } + if (customRange) { + this.chosenLabel = this.container.find('.ranges li:last') + .addClass('active').html(); + } + }, + + buildCalendar: function (month, year, hour, minute, side) { + var firstDay = moment([year, month, 1]); + var lastMonth = moment(firstDay).subtract('month', 1).month(); + var lastYear = moment(firstDay).subtract('month', 1).year(); + + var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth(); + + var dayOfWeek = firstDay.day(); + + var i; + + //initialize a 6 rows x 7 columns array for the calendar + var calendar = []; + for (i = 0; i < 6; i++) { + calendar[i] = []; + } + + //populate the calendar with date objects + var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1; + if (startDay > daysInLastMonth) + startDay -= 7; + + if (dayOfWeek == this.locale.firstDay) + startDay = daysInLastMonth - 6; + + var curDate = moment([lastYear, lastMonth, startDay, 12, minute]); + var col, row; + for (i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add('hour', 24)) { + if (i > 0 && col % 7 === 0) { + col = 0; + row++; + } + calendar[row][col] = curDate.clone().hour(hour); + curDate.hour(12); + } + + return calendar; + }, + + renderDropdowns: function (selected, minDate, maxDate) { + var currentMonth = selected.month(); + var monthHtml = '"; + + var currentYear = selected.year(); + var maxYear = (maxDate && maxDate.year()) || (currentYear + 5); + var minYear = (minDate && minDate.year()) || (currentYear - 50); + var yearHtml = ''; + + return monthHtml + yearHtml; + }, + + renderCalendar: function (calendar, selected, minDate, maxDate) { + + var html = '
'; + html += ''; + html += ''; + html += ''; + + // add empty cell for week number + if (this.showWeekNumbers) + html += ''; + + if (!minDate || minDate.isBefore(calendar[1][1])) { + html += ''; + } else { + html += ''; + } + + var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY"); + + if (this.showDropdowns) { + dateHtml = this.renderDropdowns(calendar[1][1], minDate, maxDate); + } + + html += ''; + if (!maxDate || maxDate.isAfter(calendar[1][1])) { + html += ''; + } else { + html += ''; + } + + html += ''; + html += ''; + + // add week number label + if (this.showWeekNumbers) + html += ''; + + $.each(this.locale.daysOfWeek, function (index, dayOfWeek) { + html += ''; + }); + + html += ''; + html += ''; + html += ''; + + for (var row = 0; row < 6; row++) { + html += ''; + + // add week number + if (this.showWeekNumbers) + html += ''; + + for (var col = 0; col < 7; col++) { + var cname = 'available '; + cname += (calendar[row][col].month() == calendar[1][1].month()) ? '' : 'off'; + + if ((minDate && calendar[row][col].isBefore(minDate)) || (maxDate && calendar[row][col].isAfter(maxDate))) { + cname = ' off disabled '; + } else if (calendar[row][col].format('YYYY-MM-DD') == selected.format('YYYY-MM-DD')) { + cname += ' active '; + if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) { + cname += ' start-date '; + } + if (calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) { + cname += ' end-date '; + } + } else if (calendar[row][col] >= this.startDate && calendar[row][col] <= this.endDate) { + cname += ' in-range '; + if (calendar[row][col].isSame(this.startDate)) { cname += ' start-date '; } + if (calendar[row][col].isSame(this.endDate)) { cname += ' end-date '; } + } + + var title = 'r' + row + 'c' + col; + html += ''; + } + html += ''; + } + + html += ''; + html += '
' + dateHtml + '
' + this.locale.weekLabel + '' + dayOfWeek + '
' + calendar[row][0].week() + '' + calendar[row][col].date() + '
'; + html += '
'; + + var i; + if (this.timePicker) { + + html += '
'; + html += ' : '; + + html += ' '; + + if (this.timePicker12Hour) { + html += ''; + } + + html += '
'; + + } + + return html; + + }, + + remove: function() { + + this.container.remove(); + this.element.off('.daterangepicker'); + this.element.removeData('daterangepicker'); + + } + + }; + + $.fn.daterangepicker = function (options, cb) { + this.each(function () { + var el = $(this); + if (el.data('daterangepicker')) + el.data('daterangepicker').remove(); + el.data('daterangepicker', new DateRangePicker(el, options, cb)); + }); + return this; + }; + +}(window.jQuery, window.moment); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/.gitignore b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/.gitignore new file mode 100644 index 00000000..26b38387 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/.gitignore @@ -0,0 +1,3 @@ +/node_modules/ +*.iml +.idea diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/.jshintrc b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/.jshintrc new file mode 100644 index 00000000..97b25f13 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/.jshintrc @@ -0,0 +1,14 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "sub": true, + "undef": true, + "unused": true, + "boss": true, + "eqnull": true, + "node": true +} diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/CONTRIBUTING.md b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/CONTRIBUTING.md new file mode 100644 index 00000000..260644f4 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing + +## Important notes +Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory! + +### Code style +Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already (tabs).** + +### PhantomJS +While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers. + +## Modifying the code +First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed. + +Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started). + +1. Fork and clone the repo. +1. Run `npm install` to install all dependencies (including Grunt). +1. Run `grunt` to grunt this project. + +Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken. + +## Submitting pull requests + +1. Create a new branch, please don't work in your `master` branch directly. Please pull from the `dev` branch. +1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail. +1. Fix stuff. +1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done. +1. Open `test/*.html` unit test file(s) in actual browser to ensure tests pass everywhere. +1. Update the documentation to reflect any changes. +1. Push to your fork and submit a pull request (back to the `dev` branch). diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/Gruntfile.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/Gruntfile.js new file mode 100644 index 00000000..5431c87f --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/Gruntfile.js @@ -0,0 +1,167 @@ +'use strict'; + +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + // Metadata. + pkg: grunt.file.readJSON('jquery-ui-timepicker-addon.json'), + banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + + //'<%= grunt.template.today("yyyy-mm-dd") %>\n' + + '<%= pkg.modified %>\n' + + '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n', + // Task configuration. + clean: { + files: ['dist'] + }, + copy: { + dist: { + files: [ + //{ src: 'src/index.html', dest: 'dist/index.html' }, + { src: 'src/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.css' }, + { src: 'src/jquery-ui-sliderAccess.js', dest: 'dist/jquery-ui-sliderAccess.js' }, + { src: 'src/i18n/jquery-ui-timepicker-*.js', dest: 'dist/i18n/', expand:true, flatten: true } + ] + } + }, + concat: { + dist: { + options: { + banner: '<%= banner %>', + stripBanners: true + }, + src: ['src/<%= pkg.name %>.js'], + dest: 'dist/<%= pkg.name %>.js' + }, + docs: { + src: [ + 'src/docs/header.html', + 'src/docs/intro.html', + 'src/docs/options.html', + 'src/docs/formatting.html', + 'src/docs/i18n.html', + 'src/docs/examples.html', + 'src/docs/footer.html' + ], + dest: 'dist/index.html' + }, + i18n: { + options: { + //stripBanners: true, + banner: '<%=banner %>\n(function($){\n\n', + footer: '\n})(jQuery);\n', + process: function(src, filepath){ + return '// source: '+ filepath + '\n' + + src.replace(/\(function\s*\(\$\)\s*\{/g, '') + .replace(/\}\)\(jQuery\)\;/g, '') + .replace(/\$\.timepicker\.setDefaults\(\$\.timepicker\.regional\[[a-z\-\'\"]+\]\)\;/gi, '') + .trim() +'\n'; + } + }, + src: [ 'src/i18n/jquery-ui-timepicker-*.js' ], + dest: 'dist/i18n/<%=pkg.name %>-i18n.js' + } + }, + uglify: { + options: { + banner: '<%= banner %>' + }, + dist: { + src: '<%= concat.dist.dest %>', + dest: 'dist/<%= pkg.name %>.min.js' + }, + i18n: { + src: 'dist/i18n/<%=pkg.name %>-i18n.js', + dest: 'dist/i18n/<%=pkg.name %>-i18n.min.js' + } + }, + cssmin: { + options: { + banner: '<%= banner %>' + }, + dist: { + src: 'dist/<%= pkg.name %>.css', + dest: 'dist/<%= pkg.name %>.min.css' + } + }, + replace: { + dist: { + options: { + variables: { + version: '<%= pkg.version %>', + timestamp: '<%= pkg.modified %>' + }, + prefix: '@@' + }, + files: [ + { src: 'dist/<%= pkg.name %>.js', dest: 'dist/<%= pkg.name %>.js' }, + { src: 'dist/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.css' }, + { src: 'dist/index.html', dest: 'dist/index.html' } + ] + } + }, + jasmine: { + src: 'src/<%= pkg.name %>.js', + options: { + specs: 'test/*_spec.js', + vendor: [ + 'http://code.jquery.com/jquery-1.11.1.min.js', + 'http://code.jquery.com/ui/1.11.1/jquery-ui.min.js', + 'http://github.com/searls/jasmine-fixture/releases/1.0.5/1737/jasmine-fixture.js' + ] + } + }, + jshint: { + gruntfile: { + options: { + jshintrc: '.jshintrc' + }, + src: 'Gruntfile.js' + }, + src: { + options: { + jshintrc: 'src/.jshintrc' + }, + src: ['src/**/*.js'] + }, + test: { + options: { + jshintrc: 'test/.jshintrc' + }, + src: ['test/**/*.js'] + } + }, + watch: { + gruntfile: { + files: '<%= jshint.gruntfile.src %>', + tasks: ['jshint:gruntfile'] + }, + src: { + files: 'src/**',//'<%= jshint.src.src %>', + tasks: ['jshint:src', 'jasmine', 'clean', 'copy', 'concat', 'replace', 'uglify', 'cssmin'] + //tasks: ['jshint:src', 'jasmine'] + }, + test: { + files: '<%= jshint.test.src %>', + tasks: ['jshint:test', 'jasmine'] + } + } + }); + + // These plugins provide necessary tasks. + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-replace'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-jasmine'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + // Default task. + grunt.registerTask('default', ['jshint', 'jasmine', 'clean', 'copy', 'concat', 'replace', 'uglify', 'cssmin']); + +}; diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/LICENSE-MIT b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/LICENSE-MIT new file mode 100644 index 00000000..957a11c7 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Trent Richardson + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/README.md b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/README.md new file mode 100644 index 00000000..a15ecb7d --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/README.md @@ -0,0 +1,29 @@ +jQuery Timepicker Addon +======================= + +About +----- +- Author: [Trent Richardson](http://trentrichardson.com) +- Documentation: [http://trentrichardson.com/examples/timepicker/](http://trentrichardson.com/examples/timepicker/) +- Twitter: [@practicalweb](http://twitter.com/practicalweb) + +Use +--- +I recommend getting the eBook [Handling Time](https://sellfy.com/p/8gxZ) as it has a lot of example code to get started. The quick and dirty: + +- To use this plugin you must include jQuery (1.6+) and jQuery UI with datepicker (and optionally slider). +- Include timepicker-addon script and css located in the `dist` directory or from a CDN: + * [http://cdnjs.com/libraries/jquery-ui-timepicker-addon](http://cdnjs.com/libraries/jquery-ui-timepicker-addon) + * [http://www.jsdelivr.com/#!jquery.ui.timepicker.addon](http://www.jsdelivr.com/#!jquery.ui.timepicker.addon) +- now use timepicker with `$('#selector').datetimepicker()` or `$('#selector').timepicker()`. + +There is also a [Bower](http://bower.io/) package named `jqueryui-timepicker-addon`. Beware there are other similar package names that point to forks which may not be current. + +Contributing Code - Please Read! +-------------------------------- +- All code contributions and bug reports are much appreciated. +- Please be sure to apply your fixes to the "dev" branch. +- Also note tabs are appreciated over spaces. +- Please read the [CONTRIBUTING.md][contributingmd] for more on using Grunt to produce builds. + +[contributingmd]: CONTRIBUTING.md \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/bower.json b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/bower.json new file mode 100644 index 00000000..169e2aaf --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/bower.json @@ -0,0 +1,10 @@ +{ + "name": "jqueryui-timepicker-addon", + "version": "1.5.0", + "repository": { + "type": "git", + "url": "git://github.com/trentrichardson/jQuery-Timepicker-Addon.git" + }, + "dependencies": { + } +} \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/composer.json b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/composer.json new file mode 100644 index 00000000..150661e4 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/composer.json @@ -0,0 +1,26 @@ +{ + "name": "trentrichardson/jquery-timepicker-addon", + "description": "Adds a timepicker to jQueryUI Datepicker.", + "type": "component", + "homepage": "http://trentrichardson.com/examples/timepicker/", + "license": [ + "MIT" + ], + "require": { + "robloach/component-installer": "*", + "components/jqueryui": "~1.10.2" + }, + "extra": { + "component": { + "name": "jquery-timepicker-addon", + "scripts": [ + "dist/jquery-ui-sliderAccess.js", + "dist/jquery-ui-timepicker-addon.js", + "dist/i18n/**" + ], + "styles": [ + "dist/jquery-ui-timepicker-addon.css" + ] + } + } +} \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-addon-i18n.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-addon-i18n.js new file mode 100644 index 00000000..1f351268 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-addon-i18n.js @@ -0,0 +1,846 @@ +/*! jQuery Timepicker Addon - v1.5.0 - 2014-09-01 +* http://trentrichardson.com/examples/timepicker +* Copyright (c) 2014 Trent Richardson; Licensed MIT */ + +(function($){ + +// source: src/i18n/jquery-ui-timepicker-af.js +/* Afrikaans translation for the jQuery Timepicker Addon */ +/* Written by Deon Heyns */ + + $.timepicker.regional['af'] = { + timeOnlyTitle: 'Kies Tyd', + timeText: 'Tyd ', + hourText: 'Ure ', + minuteText: 'Minute', + secondText: 'Sekondes', + millisecText: 'Millisekondes', + microsecText: 'Mikrosekondes', + timezoneText: 'Tydsone', + currentText: 'Huidige Tyd', + closeText: 'Klaar', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-am.js +/* Armenian translation for the jQuery Timepicker Addon */ +/* Written by Artavazd Avetisyan artavazda@hotmail.com */ + + $.timepicker.regional['am'] = { + timeOnlyTitle: 'Ընտրեք ժամանակը', + timeText: 'Ժամանակը', + hourText: 'Ժամ', + minuteText: 'Րոպե', + secondText: 'Վարկյան', + millisecText: 'Միլիվարկյան', + microsecText: 'Միկրովարկյան', + timezoneText: 'Ժամային գոտին', + currentText: 'Այժմ', + closeText: 'Փակել', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-bg.js +/* Bulgarian translation for the jQuery Timepicker Addon */ +/* Written by Plamen Kovandjiev */ + + $.timepicker.regional['bg'] = { + timeOnlyTitle: 'Изберете време', + timeText: 'Време', + hourText: 'Час', + minuteText: 'Минути', + secondText: 'Секунди', + millisecText: 'Милисекунди', + microsecText: 'Микросекунди', + timezoneText: 'Часови пояс', + currentText: 'Сега', + closeText: 'Затвори', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-ca.js +/* Catalan translation for the jQuery Timepicker Addon */ +/* Written by Sergi Faber */ + + $.timepicker.regional['ca'] = { + timeOnlyTitle: 'Escollir una hora', + timeText: 'Hora', + hourText: 'Hores', + minuteText: 'Minuts', + secondText: 'Segons', + millisecText: 'Milisegons', + microsecText: 'Microsegons', + timezoneText: 'Fus horari', + currentText: 'Ara', + closeText: 'Tancar', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-cs.js +/* Czech translation for the jQuery Timepicker Addon */ +/* Written by Ondřej Vodáček */ + + $.timepicker.regional['cs'] = { + timeOnlyTitle: 'Vyberte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minuty', + secondText: 'Vteřiny', + millisecText: 'Milisekundy', + microsecText: 'Mikrosekundy', + timezoneText: 'Časové pásmo', + currentText: 'Nyní', + closeText: 'Zavřít', + timeFormat: 'HH:mm', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['odp.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-da.js +/* Danish translation for the jQuery Timepicker Addon */ +/* Written by Lars H. Jensen (http://www.larshj.dk) */ + + $.timepicker.regional['da'] = { + timeOnlyTitle: 'Vælg tid', + timeText: 'Tid', + hourText: 'Time', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'Mikrosekund', + timezoneText: 'Tidszone', + currentText: 'Nu', + closeText: 'Luk', + timeFormat: 'HH:mm', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-de.js +/* German translation for the jQuery Timepicker Addon */ +/* Written by Marvin */ + + $.timepicker.regional['de'] = { + timeOnlyTitle: 'Zeit wählen', + timeText: 'Zeit', + hourText: 'Stunde', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Millisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Zeitzone', + currentText: 'Jetzt', + closeText: 'Fertig', + timeFormat: 'HH:mm', + amNames: ['vorm.', 'AM', 'A'], + pmNames: ['nachm.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-el.js +/* Hellenic translation for the jQuery Timepicker Addon */ +/* Written by Christos Pontikis */ + + $.timepicker.regional['el'] = { + timeOnlyTitle: 'Επιλογή ώρας', + timeText: 'Ώρα', + hourText: 'Ώρες', + minuteText: 'Λεπτά', + secondText: 'Δευτερόλεπτα', + millisecText: 'μιλιδευτερόλεπτο', + microsecText: 'Microseconds', + timezoneText: 'Ζώνη ώρας', + currentText: 'Τώρα', + closeText: 'Κλείσιμο', + timeFormat: 'HH:mm', + amNames: ['π.μ.', 'AM', 'A'], + pmNames: ['μ.μ.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-es.js +/* Spanish translation for the jQuery Timepicker Addon */ +/* Written by Ianaré Sévi */ +/* Modified by Carlos Martínez */ + + $.timepicker.regional['es'] = { + timeOnlyTitle: 'Elegir una hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milisegundos', + microsecText: 'Microsegundos', + timezoneText: 'Uso horario', + currentText: 'Hoy', + closeText: 'Cerrar', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-et.js +/* Estonian translation for the jQuery Timepicker Addon */ +/* Written by Karl Sutt (karl@sutt.ee) */ + + $.timepicker.regional['et'] = { + timeOnlyTitle: 'Vali aeg', + timeText: 'Aeg', + hourText: 'Tund', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekundis', + microsecText: 'Mikrosekundis', + timezoneText: 'Ajavöönd', + currentText: 'Praegu', + closeText: 'Valmis', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-eu.js +/* Basque trannslation for JQuery Timepicker Addon */ +/* Translated by Xabi Fer */ +/* Fixed by Asier Iturralde Sarasola - iametza interaktiboa */ + + $.timepicker.regional['eu'] = { + timeOnlyTitle: 'Aukeratu ordua', + timeText: 'Ordua', + hourText: 'Orduak', + minuteText: 'Minutuak', + secondText: 'Segundoak', + millisecText: 'Milisegundoak', + microsecText: 'Mikrosegundoak', + timezoneText: 'Ordu-eremua', + currentText: 'Orain', + closeText: 'Itxi', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-fi.js +/* Finnish translation for the jQuery Timepicker Addon */ +/* Written by Juga Paazmaya (http://github.com/paazmaya) */ + + $.timepicker.regional['fi'] = { + timeOnlyTitle: 'Valitse aika', + timeText: 'Aika', + hourText: 'Tunti', + minuteText: 'Minuutti', + secondText: 'Sekunti', + millisecText: 'Millisekunnin', + microsecText: 'Mikrosekuntia', + timezoneText: 'Aikavyöhyke', + currentText: 'Nyt', + closeText: 'Sulje', + timeFormat: 'HH:mm', + amNames: ['ap.', 'AM', 'A'], + pmNames: ['ip.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-fr.js +/* French translation for the jQuery Timepicker Addon */ +/* Written by Thomas Lété */ + + $.timepicker.regional['fr'] = { + timeOnlyTitle: 'Choisir une heure', + timeText: 'Heure', + hourText: 'Heures', + minuteText: 'Minutes', + secondText: 'Secondes', + millisecText: 'Millisecondes', + microsecText: 'Microsecondes', + timezoneText: 'Fuseau horaire', + currentText: 'Maintenant', + closeText: 'Terminé', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-gl.js +/* Galician translation for the jQuery Timepicker Addon */ +/* Written by David Barral */ + + $.timepicker.regional['gl'] = { + timeOnlyTitle: 'Elixir unha hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milisegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horario', + currentText: 'Agora', + closeText: 'Pechar', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-he.js +/* Hebrew translation for the jQuery Timepicker Addon */ +/* Written by Lior Lapid */ + + $.timepicker.regional["he"] = { + timeOnlyTitle: "בחירת זמן", + timeText: "שעה", + hourText: "שעות", + minuteText: "דקות", + secondText: "שניות", + millisecText: "אלפית השנייה", + microsecText: "מיקרו", + timezoneText: "אזור זמן", + currentText: "עכשיו", + closeText:"סגור", + timeFormat: "HH:mm", + amNames: ['לפנה"צ', 'AM', 'A'], + pmNames: ['אחה"צ', 'PM', 'P'], + isRTL: true + }; + +// source: src/i18n/jquery-ui-timepicker-hr.js +/* Croatian translation for the jQuery Timepicker Addon */ +/* Written by Mladen */ + + $.timepicker.regional['hr'] = { + timeOnlyTitle: 'Odaberi vrijeme', + timeText: 'Vrijeme', + hourText: 'Sati', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Vremenska zona', + currentText: 'Sada', + closeText: 'Gotovo', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-hu.js +/* Hungarian translation for the jQuery Timepicker Addon */ +/* Written by Vas Gábor */ + + $.timepicker.regional['hu'] = { + timeOnlyTitle: 'Válasszon időpontot', + timeText: 'Idő', + hourText: 'Óra', + minuteText: 'Perc', + secondText: 'Másodperc', + millisecText: 'Milliszekundumos', + microsecText: 'Ezredmásodperc', + timezoneText: 'Időzóna', + currentText: 'Most', + closeText: 'Kész', + timeFormat: 'HH:mm', + amNames: ['de.', 'AM', 'A'], + pmNames: ['du.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-id.js +/* Indonesian translation for the jQuery Timepicker Addon */ +/* Written by Nia */ + + $.timepicker.regional['id'] = { + timeOnlyTitle: 'Pilih Waktu', + timeText: 'Waktu', + hourText: 'Pukul', + minuteText: 'Menit', + secondText: 'Detik', + millisecText: 'Milidetik', + microsecText: 'Mikrodetik', + timezoneText: 'Zona Waktu', + currentText: 'Sekarang', + closeText: 'OK', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-it.js +/* Italian translation for the jQuery Timepicker Addon */ +/* Written by Marco "logicoder" Del Tongo */ + + $.timepicker.regional['it'] = { + timeOnlyTitle: 'Scegli orario', + timeText: 'Orario', + hourText: 'Ora', + minuteText: 'Minuti', + secondText: 'Secondi', + millisecText: 'Millisecondi', + microsecText: 'Microsecondi', + timezoneText: 'Fuso orario', + currentText: 'Adesso', + closeText: 'Chiudi', + timeFormat: 'HH:mm', + amNames: ['m.', 'AM', 'A'], + pmNames: ['p.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-ja.js +/* Japanese translation for the jQuery Timepicker Addon */ +/* Written by Jun Omae */ + + $.timepicker.regional['ja'] = { + timeOnlyTitle: '時間を選択', + timeText: '時間', + hourText: '時', + minuteText: '分', + secondText: '秒', + millisecText: 'ミリ秒', + microsecText: 'マイクロ秒', + timezoneText: 'タイムゾーン', + currentText: '現時刻', + closeText: '閉じる', + timeFormat: 'HH:mm', + amNames: ['午前', 'AM', 'A'], + pmNames: ['午後', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-ko.js +/* Korean translation for the jQuery Timepicker Addon */ +/* Written by Genie */ + + $.timepicker.regional['ko'] = { + timeOnlyTitle: '시간 선택', + timeText: '시간', + hourText: '시', + minuteText: '분', + secondText: '초', + millisecText: '밀리초', + microsecText: '마이크로', + timezoneText: '표준 시간대', + currentText: '현재 시각', + closeText: '닫기', + timeFormat: 'tt h:mm', + amNames: ['오전', 'AM', 'A'], + pmNames: ['오후', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-lt.js +/* Lithuanian translation for the jQuery Timepicker Addon */ +/* Written by Irmantas Šiupšinskas */ + + $.timepicker.regional['lt'] = { + timeOnlyTitle: 'Pasirinkite laiką', + timeText: 'Laikas', + hourText: 'Valandos', + minuteText: 'Minutės', + secondText: 'Sekundės', + millisecText: 'Milisekundės', + microsecText: 'Mikrosekundės', + timezoneText: 'Laiko zona', + currentText: 'Dabar', + closeText: 'Uždaryti', + timeFormat: 'HH:mm', + amNames: ['priešpiet', 'AM', 'A'], + pmNames: ['popiet', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-nl.js +/* Dutch translation for the jQuery Timepicker Addon */ +/* Written by Martijn van der Lee */ + + $.timepicker.regional['nl'] = { + timeOnlyTitle: 'Tijdstip', + timeText: 'Tijd', + hourText: 'Uur', + minuteText: 'Minuut', + secondText: 'Seconde', + millisecText: 'Milliseconde', + microsecText: 'Microseconde', + timezoneText: 'Tijdzone', + currentText: 'Vandaag', + closeText: 'Sluiten', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-no.js +/* Norwegian translation for the jQuery Timepicker Addon */ +/* Written by Morten Hauan (http://hauan.me) */ + + $.timepicker.regional['no'] = { + timeOnlyTitle: 'Velg tid', + timeText: 'Tid', + hourText: 'Time', + minuteText: 'Minutt', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'mikrosekund', + timezoneText: 'Tidssone', + currentText: 'Nå', + closeText: 'Lukk', + timeFormat: 'HH:mm', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-pl.js +/* Polish translation for the jQuery Timepicker Addon */ +/* Written by Michał Pena */ + + $.timepicker.regional['pl'] = { + timeOnlyTitle: 'Wybierz godzinę', + timeText: 'Czas', + hourText: 'Godzina', + minuteText: 'Minuta', + secondText: 'Sekunda', + millisecText: 'Milisekunda', + microsecText: 'Mikrosekunda', + timezoneText: 'Strefa czasowa', + currentText: 'Teraz', + closeText: 'Gotowe', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-pt-BR.js +/* Brazilian Portuguese translation for the jQuery Timepicker Addon */ +/* Written by Diogo Damiani (diogodamiani@gmail.com) */ + + $.timepicker.regional['pt-BR'] = { + timeOnlyTitle: 'Escolha o horário', + timeText: 'Horário', + hourText: 'Hora', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milissegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horário', + currentText: 'Agora', + closeText: 'Fechar', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-pt.js +/* Portuguese translation for the jQuery Timepicker Addon */ +/* Written by Luan Almeida */ + + $.timepicker.regional['pt'] = { + timeOnlyTitle: 'Escolha uma hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milissegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horário', + currentText: 'Agora', + closeText: 'Fechar', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-ro.js +/* Romanian translation for the jQuery Timepicker Addon */ +/* Written by Romeo Adrian Cioaba */ + + $.timepicker.regional['ro'] = { + timeOnlyTitle: 'Alegeţi o oră', + timeText: 'Timp', + hourText: 'Ore', + minuteText: 'Minute', + secondText: 'Secunde', + millisecText: 'Milisecunde', + microsecText: 'Microsecunde', + timezoneText: 'Fus orar', + currentText: 'Acum', + closeText: 'Închide', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-ru.js +/* Russian translation for the jQuery Timepicker Addon */ +/* Written by Trent Richardson */ + + $.timepicker.regional['ru'] = { + timeOnlyTitle: 'Выберите время', + timeText: 'Время', + hourText: 'Часы', + minuteText: 'Минуты', + secondText: 'Секунды', + millisecText: 'Миллисекунды', + microsecText: 'Микросекунды', + timezoneText: 'Часовой пояс', + currentText: 'Сейчас', + closeText: 'Закрыть', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-sk.js +/* Slovak translation for the jQuery Timepicker Addon */ +/* Written by David Vallner */ + + $.timepicker.regional['sk'] = { + timeOnlyTitle: 'Zvoľte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minúty', + secondText: 'Sekundy', + millisecText: 'Milisekundy', + microsecText: 'Mikrosekundy', + timezoneText: 'Časové pásmo', + currentText: 'Teraz', + closeText: 'Zavrieť', + timeFormat: 'H:m', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['pop.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-sl.js +/* Slovenian translation for the jQuery Timepicker Addon */ +/* Written by Hadalin (https://github.com/hadalin) */ + + $.timepicker.regional['sl'] = { + timeOnlyTitle: 'Izberite čas', + timeText: 'Čas', + hourText: 'Ura', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Časovni pas', + currentText: 'Sedaj', + closeText: 'Zapri', + timeFormat: 'HH:mm', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['pop.', 'PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-sr-RS.js +/* Serbian cyrilic translation for the jQuery Timepicker Addon */ +/* Written by Vladimir Jelovac */ + + $.timepicker.regional['sr-RS'] = { + timeOnlyTitle: 'Одаберите време', + timeText: 'Време', + hourText: 'Сати', + minuteText: 'Минути', + secondText: 'Секунде', + millisecText: 'Милисекунде', + microsecText: 'Микросекунде', + timezoneText: 'Временска зона', + currentText: 'Сада', + closeText: 'Затвори', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-sr-YU.js +/* Serbian latin translation for the jQuery Timepicker Addon */ +/* Written by Vladimir Jelovac */ + + $.timepicker.regional['sr-YU'] = { + timeOnlyTitle: 'Odaberite vreme', + timeText: 'Vreme', + hourText: 'Sati', + minuteText: 'Minuti', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Vremenska zona', + currentText: 'Sada', + closeText: 'Zatvori', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-sv.js +/* Swedish translation for the jQuery Timepicker Addon */ +/* Written by Nevon */ + + $.timepicker.regional['sv'] = { + timeOnlyTitle: 'Välj en tid', + timeText: 'Tid', + hourText: 'Timme', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'Mikrosekund', + timezoneText: 'Tidszon', + currentText: 'Nu', + closeText: 'Stäng', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-th.js +/* Thai translation for the jQuery Timepicker Addon */ +/* Written by Yote Wachirapornpongsa */ + + $.timepicker.regional['th'] = { + timeOnlyTitle: 'เลือกเวลา', + timeText: 'เวลา ', + hourText: 'ชั่วโมง ', + minuteText: 'นาที', + secondText: 'วินาที', + millisecText: 'มิลลิวินาที', + microsecText: 'ไมโคริวินาที', + timezoneText: 'เขตเวลา', + currentText: 'เวลาปัจจุบัน', + closeText: 'ปิด', + timeFormat: 'hh:mm tt' + }; + +// source: src/i18n/jquery-ui-timepicker-tr.js +/* Turkish translation for the jQuery Timepicker Addon */ +/* Written by Fehmi Can Saglam, Edited by Goktug Ozturk */ + + $.timepicker.regional['tr'] = { + timeOnlyTitle: 'Zaman Seçiniz', + timeText: 'Zaman', + hourText: 'Saat', + minuteText: 'Dakika', + secondText: 'Saniye', + millisecText: 'Milisaniye', + microsecText: 'Mikrosaniye', + timezoneText: 'Zaman Dilimi', + currentText: 'Şu an', + closeText: 'Tamam', + timeFormat: 'HH:mm', + amNames: ['ÖÖ', 'Ö'], + pmNames: ['ÖS', 'S'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-uk.js +/* Ukrainian translation for the jQuery Timepicker Addon */ +/* Written by Sergey Noskov */ + + $.timepicker.regional['uk'] = { + timeOnlyTitle: 'Виберіть час', + timeText: 'Час', + hourText: 'Години', + minuteText: 'Хвилини', + secondText: 'Секунди', + millisecText: 'Мілісекунди', + microsecText: 'Мікросекунди', + timezoneText: 'Часовий пояс', + currentText: 'Зараз', + closeText: 'Закрити', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-vi.js +/* Vietnamese translation for the jQuery Timepicker Addon */ +/* Written by Nguyen Dinh Trung */ + + $.timepicker.regional['vi'] = { + timeOnlyTitle: 'Chọn giờ', + timeText: 'Thời gian', + hourText: 'Giờ', + minuteText: 'Phút', + secondText: 'Giây', + millisecText: 'Mili giây', + microsecText: 'Micrô giây', + timezoneText: 'Múi giờ', + currentText: 'Hiện thời', + closeText: 'Đóng', + timeFormat: 'HH:mm', + amNames: ['SA', 'S'], + pmNames: ['CH', 'C'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-zh-CN.js +/* Simplified Chinese translation for the jQuery Timepicker Addon / +/ Written by Will Lu */ + + $.timepicker.regional['zh-CN'] = { + timeOnlyTitle: '选择时间', + timeText: '时间', + hourText: '小时', + minuteText: '分钟', + secondText: '秒钟', + millisecText: '毫秒', + microsecText: '微秒', + timezoneText: '时区', + currentText: '现在时间', + closeText: '关闭', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-zh-TW.js +/* Chinese translation for the jQuery Timepicker Addon */ +/* Written by Alang.lin */ + + $.timepicker.regional['zh-TW'] = { + timeOnlyTitle: '選擇時分秒', + timeText: '時間', + hourText: '時', + minuteText: '分', + secondText: '秒', + millisecText: '毫秒', + microsecText: '微秒', + timezoneText: '時區', + currentText: '現在時間', + closeText: '確定', + timeFormat: 'HH:mm', + amNames: ['上午', 'AM', 'A'], + pmNames: ['下午', 'PM', 'P'], + isRTL: false + }; + +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-addon-i18n.min.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-addon-i18n.min.js new file mode 100644 index 00000000..07e4a963 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-addon-i18n.min.js @@ -0,0 +1,4 @@ +/*! jQuery Timepicker Addon - v1.5.0 - 2014-09-01 +* http://trentrichardson.com/examples/timepicker +* Copyright (c) 2014 Trent Richardson; Licensed MIT */ +(function(e){e.timepicker.regional.af={timeOnlyTitle:"Kies Tyd",timeText:"Tyd ",hourText:"Ure ",minuteText:"Minute",secondText:"Sekondes",millisecText:"Millisekondes",microsecText:"Mikrosekondes",timezoneText:"Tydsone",currentText:"Huidige Tyd",closeText:"Klaar",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.am={timeOnlyTitle:"Ընտրեք ժամանակը",timeText:"Ժամանակը",hourText:"Ժամ",minuteText:"Րոպե",secondText:"Վարկյան",millisecText:"Միլիվարկյան",microsecText:"Միկրովարկյան",timezoneText:"Ժամային գոտին",currentText:"Այժմ",closeText:"Փակել",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.bg={timeOnlyTitle:"Изберете време",timeText:"Време",hourText:"Час",minuteText:"Минути",secondText:"Секунди",millisecText:"Милисекунди",microsecText:"Микросекунди",timezoneText:"Часови пояс",currentText:"Сега",closeText:"Затвори",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.ca={timeOnlyTitle:"Escollir una hora",timeText:"Hora",hourText:"Hores",minuteText:"Minuts",secondText:"Segons",millisecText:"Milisegons",microsecText:"Microsegons",timezoneText:"Fus horari",currentText:"Ara",closeText:"Tancar",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.cs={timeOnlyTitle:"Vyberte čas",timeText:"Čas",hourText:"Hodiny",minuteText:"Minuty",secondText:"Vteřiny",millisecText:"Milisekundy",microsecText:"Mikrosekundy",timezoneText:"Časové pásmo",currentText:"Nyní",closeText:"Zavřít",timeFormat:"HH:mm",amNames:["dop.","AM","A"],pmNames:["odp.","PM","P"],isRTL:!1},e.timepicker.regional.da={timeOnlyTitle:"Vælg tid",timeText:"Tid",hourText:"Time",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tidszone",currentText:"Nu",closeText:"Luk",timeFormat:"HH:mm",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},e.timepicker.regional.de={timeOnlyTitle:"Zeit wählen",timeText:"Zeit",hourText:"Stunde",minuteText:"Minute",secondText:"Sekunde",millisecText:"Millisekunde",microsecText:"Mikrosekunde",timezoneText:"Zeitzone",currentText:"Jetzt",closeText:"Fertig",timeFormat:"HH:mm",amNames:["vorm.","AM","A"],pmNames:["nachm.","PM","P"],isRTL:!1},e.timepicker.regional.el={timeOnlyTitle:"Επιλογή ώρας",timeText:"Ώρα",hourText:"Ώρες",minuteText:"Λεπτά",secondText:"Δευτερόλεπτα",millisecText:"μιλιδευτερόλεπτο",microsecText:"Microseconds",timezoneText:"Ζώνη ώρας",currentText:"Τώρα",closeText:"Κλείσιμο",timeFormat:"HH:mm",amNames:["π.μ.","AM","A"],pmNames:["μ.μ.","PM","P"],isRTL:!1},e.timepicker.regional.es={timeOnlyTitle:"Elegir una hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milisegundos",microsecText:"Microsegundos",timezoneText:"Uso horario",currentText:"Hoy",closeText:"Cerrar",timeFormat:"HH:mm",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},e.timepicker.regional.et={timeOnlyTitle:"Vali aeg",timeText:"Aeg",hourText:"Tund",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekundis",microsecText:"Mikrosekundis",timezoneText:"Ajavöönd",currentText:"Praegu",closeText:"Valmis",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.eu={timeOnlyTitle:"Aukeratu ordua",timeText:"Ordua",hourText:"Orduak",minuteText:"Minutuak",secondText:"Segundoak",millisecText:"Milisegundoak",microsecText:"Mikrosegundoak",timezoneText:"Ordu-eremua",currentText:"Orain",closeText:"Itxi",timeFormat:"HH:mm",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},e.timepicker.regional.fi={timeOnlyTitle:"Valitse aika",timeText:"Aika",hourText:"Tunti",minuteText:"Minuutti",secondText:"Sekunti",millisecText:"Millisekunnin",microsecText:"Mikrosekuntia",timezoneText:"Aikavyöhyke",currentText:"Nyt",closeText:"Sulje",timeFormat:"HH:mm",amNames:["ap.","AM","A"],pmNames:["ip.","PM","P"],isRTL:!1},e.timepicker.regional.fr={timeOnlyTitle:"Choisir une heure",timeText:"Heure",hourText:"Heures",minuteText:"Minutes",secondText:"Secondes",millisecText:"Millisecondes",microsecText:"Microsecondes",timezoneText:"Fuseau horaire",currentText:"Maintenant",closeText:"Terminé",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.gl={timeOnlyTitle:"Elixir unha hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milisegundos",microsecText:"Microssegundos",timezoneText:"Fuso horario",currentText:"Agora",closeText:"Pechar",timeFormat:"HH:mm",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},e.timepicker.regional.he={timeOnlyTitle:"בחירת זמן",timeText:"שעה",hourText:"שעות",minuteText:"דקות",secondText:"שניות",millisecText:"אלפית השנייה",microsecText:"מיקרו",timezoneText:"אזור זמן",currentText:"עכשיו",closeText:"סגור",timeFormat:"HH:mm",amNames:['לפנה"צ',"AM","A"],pmNames:['אחה"צ',"PM","P"],isRTL:!0},e.timepicker.regional.hr={timeOnlyTitle:"Odaberi vrijeme",timeText:"Vrijeme",hourText:"Sati",minuteText:"Minute",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Vremenska zona",currentText:"Sada",closeText:"Gotovo",timeFormat:"HH:mm",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},e.timepicker.regional.hu={timeOnlyTitle:"Válasszon időpontot",timeText:"Idő",hourText:"Óra",minuteText:"Perc",secondText:"Másodperc",millisecText:"Milliszekundumos",microsecText:"Ezredmásodperc",timezoneText:"Időzóna",currentText:"Most",closeText:"Kész",timeFormat:"HH:mm",amNames:["de.","AM","A"],pmNames:["du.","PM","P"],isRTL:!1},e.timepicker.regional.id={timeOnlyTitle:"Pilih Waktu",timeText:"Waktu",hourText:"Pukul",minuteText:"Menit",secondText:"Detik",millisecText:"Milidetik",microsecText:"Mikrodetik",timezoneText:"Zona Waktu",currentText:"Sekarang",closeText:"OK",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.it={timeOnlyTitle:"Scegli orario",timeText:"Orario",hourText:"Ora",minuteText:"Minuti",secondText:"Secondi",millisecText:"Millisecondi",microsecText:"Microsecondi",timezoneText:"Fuso orario",currentText:"Adesso",closeText:"Chiudi",timeFormat:"HH:mm",amNames:["m.","AM","A"],pmNames:["p.","PM","P"],isRTL:!1},e.timepicker.regional.ja={timeOnlyTitle:"時間を選択",timeText:"時間",hourText:"時",minuteText:"分",secondText:"秒",millisecText:"ミリ秒",microsecText:"マイクロ秒",timezoneText:"タイムゾーン",currentText:"現時刻",closeText:"閉じる",timeFormat:"HH:mm",amNames:["午前","AM","A"],pmNames:["午後","PM","P"],isRTL:!1},e.timepicker.regional.ko={timeOnlyTitle:"시간 선택",timeText:"시간",hourText:"시",minuteText:"분",secondText:"초",millisecText:"밀리초",microsecText:"마이크로",timezoneText:"표준 시간대",currentText:"현재 시각",closeText:"닫기",timeFormat:"tt h:mm",amNames:["오전","AM","A"],pmNames:["오후","PM","P"],isRTL:!1},e.timepicker.regional.lt={timeOnlyTitle:"Pasirinkite laiką",timeText:"Laikas",hourText:"Valandos",minuteText:"Minutės",secondText:"Sekundės",millisecText:"Milisekundės",microsecText:"Mikrosekundės",timezoneText:"Laiko zona",currentText:"Dabar",closeText:"Uždaryti",timeFormat:"HH:mm",amNames:["priešpiet","AM","A"],pmNames:["popiet","PM","P"],isRTL:!1},e.timepicker.regional.nl={timeOnlyTitle:"Tijdstip",timeText:"Tijd",hourText:"Uur",minuteText:"Minuut",secondText:"Seconde",millisecText:"Milliseconde",microsecText:"Microseconde",timezoneText:"Tijdzone",currentText:"Vandaag",closeText:"Sluiten",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.no={timeOnlyTitle:"Velg tid",timeText:"Tid",hourText:"Time",minuteText:"Minutt",secondText:"Sekund",millisecText:"Millisekund",microsecText:"mikrosekund",timezoneText:"Tidssone",currentText:"Nå",closeText:"Lukk",timeFormat:"HH:mm",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},e.timepicker.regional.pl={timeOnlyTitle:"Wybierz godzinę",timeText:"Czas",hourText:"Godzina",minuteText:"Minuta",secondText:"Sekunda",millisecText:"Milisekunda",microsecText:"Mikrosekunda",timezoneText:"Strefa czasowa",currentText:"Teraz",closeText:"Gotowe",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional["pt-BR"]={timeOnlyTitle:"Escolha o horário",timeText:"Horário",hourText:"Hora",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milissegundos",microsecText:"Microssegundos",timezoneText:"Fuso horário",currentText:"Agora",closeText:"Fechar",timeFormat:"HH:mm",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},e.timepicker.regional.pt={timeOnlyTitle:"Escolha uma hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milissegundos",microsecText:"Microssegundos",timezoneText:"Fuso horário",currentText:"Agora",closeText:"Fechar",timeFormat:"HH:mm",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},e.timepicker.regional.ro={timeOnlyTitle:"Alegeţi o oră",timeText:"Timp",hourText:"Ore",minuteText:"Minute",secondText:"Secunde",millisecText:"Milisecunde",microsecText:"Microsecunde",timezoneText:"Fus orar",currentText:"Acum",closeText:"Închide",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.ru={timeOnlyTitle:"Выберите время",timeText:"Время",hourText:"Часы",minuteText:"Минуты",secondText:"Секунды",millisecText:"Миллисекунды",microsecText:"Микросекунды",timezoneText:"Часовой пояс",currentText:"Сейчас",closeText:"Закрыть",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.sk={timeOnlyTitle:"Zvoľte čas",timeText:"Čas",hourText:"Hodiny",minuteText:"Minúty",secondText:"Sekundy",millisecText:"Milisekundy",microsecText:"Mikrosekundy",timezoneText:"Časové pásmo",currentText:"Teraz",closeText:"Zavrieť",timeFormat:"H:m",amNames:["dop.","AM","A"],pmNames:["pop.","PM","P"],isRTL:!1},e.timepicker.regional.sl={timeOnlyTitle:"Izberite čas",timeText:"Čas",hourText:"Ura",minuteText:"Minute",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Časovni pas",currentText:"Sedaj",closeText:"Zapri",timeFormat:"HH:mm",amNames:["dop.","AM","A"],pmNames:["pop.","PM","P"],isRTL:!1},e.timepicker.regional["sr-RS"]={timeOnlyTitle:"Одаберите време",timeText:"Време",hourText:"Сати",minuteText:"Минути",secondText:"Секунде",millisecText:"Милисекунде",microsecText:"Микросекунде",timezoneText:"Временска зона",currentText:"Сада",closeText:"Затвори",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional["sr-YU"]={timeOnlyTitle:"Odaberite vreme",timeText:"Vreme",hourText:"Sati",minuteText:"Minuti",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Vremenska zona",currentText:"Sada",closeText:"Zatvori",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.sv={timeOnlyTitle:"Välj en tid",timeText:"Tid",hourText:"Timme",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tidszon",currentText:"Nu",closeText:"Stäng",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.th={timeOnlyTitle:"เลือกเวลา",timeText:"เวลา ",hourText:"ชั่วโมง ",minuteText:"นาที",secondText:"วินาที",millisecText:"มิลลิวินาที",microsecText:"ไมโคริวินาที",timezoneText:"เขตเวลา",currentText:"เวลาปัจจุบัน",closeText:"ปิด",timeFormat:"hh:mm tt"},e.timepicker.regional.tr={timeOnlyTitle:"Zaman Seçiniz",timeText:"Zaman",hourText:"Saat",minuteText:"Dakika",secondText:"Saniye",millisecText:"Milisaniye",microsecText:"Mikrosaniye",timezoneText:"Zaman Dilimi",currentText:"Şu an",closeText:"Tamam",timeFormat:"HH:mm",amNames:["ÖÖ","Ö"],pmNames:["ÖS","S"],isRTL:!1},e.timepicker.regional.uk={timeOnlyTitle:"Виберіть час",timeText:"Час",hourText:"Години",minuteText:"Хвилини",secondText:"Секунди",millisecText:"Мілісекунди",microsecText:"Мікросекунди",timezoneText:"Часовий пояс",currentText:"Зараз",closeText:"Закрити",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional.vi={timeOnlyTitle:"Chọn giờ",timeText:"Thời gian",hourText:"Giờ",minuteText:"Phút",secondText:"Giây",millisecText:"Mili giây",microsecText:"Micrô giây",timezoneText:"Múi giờ",currentText:"Hiện thời",closeText:"Đóng",timeFormat:"HH:mm",amNames:["SA","S"],pmNames:["CH","C"],isRTL:!1},e.timepicker.regional["zh-CN"]={timeOnlyTitle:"选择时间",timeText:"时间",hourText:"小时",minuteText:"分钟",secondText:"秒钟",millisecText:"毫秒",microsecText:"微秒",timezoneText:"时区",currentText:"现在时间",closeText:"关闭",timeFormat:"HH:mm",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},e.timepicker.regional["zh-TW"]={timeOnlyTitle:"選擇時分秒",timeText:"時間",hourText:"時",minuteText:"分",secondText:"秒",millisecText:"毫秒",microsecText:"微秒",timezoneText:"時區",currentText:"現在時間",closeText:"確定",timeFormat:"HH:mm",amNames:["上午","AM","A"],pmNames:["下午","PM","P"],isRTL:!1}})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-af.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-af.js new file mode 100644 index 00000000..fe9f8c58 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-af.js @@ -0,0 +1,21 @@ +/* Afrikaans translation for the jQuery Timepicker Addon */ +/* Written by Deon Heyns */ +(function($) { + $.timepicker.regional['af'] = { + timeOnlyTitle: 'Kies Tyd', + timeText: 'Tyd ', + hourText: 'Ure ', + minuteText: 'Minute', + secondText: 'Sekondes', + millisecText: 'Millisekondes', + microsecText: 'Mikrosekondes', + timezoneText: 'Tydsone', + currentText: 'Huidige Tyd', + closeText: 'Klaar', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['af']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-am.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-am.js new file mode 100644 index 00000000..69cce8aa --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-am.js @@ -0,0 +1,21 @@ +/* Armenian translation for the jQuery Timepicker Addon */ +/* Written by Artavazd Avetisyan artavazda@hotmail.com */ +(function($) { + $.timepicker.regional['am'] = { + timeOnlyTitle: 'Ընտրեք ժամանակը', + timeText: 'Ժամանակը', + hourText: 'Ժամ', + minuteText: 'Րոպե', + secondText: 'Վարկյան', + millisecText: 'Միլիվարկյան', + microsecText: 'Միկրովարկյան', + timezoneText: 'Ժամային գոտին', + currentText: 'Այժմ', + closeText: 'Փակել', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['am']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-bg.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-bg.js new file mode 100644 index 00000000..1efb439a --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-bg.js @@ -0,0 +1,21 @@ +/* Bulgarian translation for the jQuery Timepicker Addon */ +/* Written by Plamen Kovandjiev */ +(function($) { + $.timepicker.regional['bg'] = { + timeOnlyTitle: 'Изберете време', + timeText: 'Време', + hourText: 'Час', + minuteText: 'Минути', + secondText: 'Секунди', + millisecText: 'Милисекунди', + microsecText: 'Микросекунди', + timezoneText: 'Часови пояс', + currentText: 'Сега', + closeText: 'Затвори', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['bg']); +})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ca.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ca.js new file mode 100644 index 00000000..25b4eed9 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ca.js @@ -0,0 +1,21 @@ +/* Catalan translation for the jQuery Timepicker Addon */ +/* Written by Sergi Faber */ +(function($) { + $.timepicker.regional['ca'] = { + timeOnlyTitle: 'Escollir una hora', + timeText: 'Hora', + hourText: 'Hores', + minuteText: 'Minuts', + secondText: 'Segons', + millisecText: 'Milisegons', + microsecText: 'Microsegons', + timezoneText: 'Fus horari', + currentText: 'Ara', + closeText: 'Tancar', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ca']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-cs.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-cs.js new file mode 100644 index 00000000..9d358faf --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-cs.js @@ -0,0 +1,21 @@ +/* Czech translation for the jQuery Timepicker Addon */ +/* Written by Ondřej Vodáček */ +(function($) { + $.timepicker.regional['cs'] = { + timeOnlyTitle: 'Vyberte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minuty', + secondText: 'Vteřiny', + millisecText: 'Milisekundy', + microsecText: 'Mikrosekundy', + timezoneText: 'Časové pásmo', + currentText: 'Nyní', + closeText: 'Zavřít', + timeFormat: 'HH:mm', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['odp.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['cs']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-da.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-da.js new file mode 100644 index 00000000..7afb1893 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-da.js @@ -0,0 +1,21 @@ +/* Danish translation for the jQuery Timepicker Addon */ +/* Written by Lars H. Jensen (http://www.larshj.dk) */ +(function ($) { + $.timepicker.regional['da'] = { + timeOnlyTitle: 'Vælg tid', + timeText: 'Tid', + hourText: 'Time', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'Mikrosekund', + timezoneText: 'Tidszone', + currentText: 'Nu', + closeText: 'Luk', + timeFormat: 'HH:mm', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['da']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-de.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-de.js new file mode 100644 index 00000000..a0ddf9f2 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-de.js @@ -0,0 +1,21 @@ +/* German translation for the jQuery Timepicker Addon */ +/* Written by Marvin */ +(function($) { + $.timepicker.regional['de'] = { + timeOnlyTitle: 'Zeit wählen', + timeText: 'Zeit', + hourText: 'Stunde', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Millisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Zeitzone', + currentText: 'Jetzt', + closeText: 'Fertig', + timeFormat: 'HH:mm', + amNames: ['vorm.', 'AM', 'A'], + pmNames: ['nachm.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['de']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-el.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-el.js new file mode 100644 index 00000000..6b7e827a --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-el.js @@ -0,0 +1,21 @@ +/* Hellenic translation for the jQuery Timepicker Addon */ +/* Written by Christos Pontikis */ +(function($) { + $.timepicker.regional['el'] = { + timeOnlyTitle: 'Επιλογή ώρας', + timeText: 'Ώρα', + hourText: 'Ώρες', + minuteText: 'Λεπτά', + secondText: 'Δευτερόλεπτα', + millisecText: 'μιλιδευτερόλεπτο', + microsecText: 'Microseconds', + timezoneText: 'Ζώνη ώρας', + currentText: 'Τώρα', + closeText: 'Κλείσιμο', + timeFormat: 'HH:mm', + amNames: ['π.μ.', 'AM', 'A'], + pmNames: ['μ.μ.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['el']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-es.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-es.js new file mode 100644 index 00000000..3e3b1005 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-es.js @@ -0,0 +1,22 @@ +/* Spanish translation for the jQuery Timepicker Addon */ +/* Written by Ianaré Sévi */ +/* Modified by Carlos Martínez */ +(function($) { + $.timepicker.regional['es'] = { + timeOnlyTitle: 'Elegir una hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milisegundos', + microsecText: 'Microsegundos', + timezoneText: 'Uso horario', + currentText: 'Hoy', + closeText: 'Cerrar', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['es']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-et.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-et.js new file mode 100644 index 00000000..2e64cc82 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-et.js @@ -0,0 +1,21 @@ +/* Estonian translation for the jQuery Timepicker Addon */ +/* Written by Karl Sutt (karl@sutt.ee) */ +(function($) { + $.timepicker.regional['et'] = { + timeOnlyTitle: 'Vali aeg', + timeText: 'Aeg', + hourText: 'Tund', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekundis', + microsecText: 'Mikrosekundis', + timezoneText: 'Ajavöönd', + currentText: 'Praegu', + closeText: 'Valmis', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['et']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-eu.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-eu.js new file mode 100644 index 00000000..8884e4a0 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-eu.js @@ -0,0 +1,22 @@ +/* Basque trannslation for JQuery Timepicker Addon */ +/* Translated by Xabi Fer */ +/* Fixed by Asier Iturralde Sarasola - iametza interaktiboa */ +(function($) { + $.timepicker.regional['eu'] = { + timeOnlyTitle: 'Aukeratu ordua', + timeText: 'Ordua', + hourText: 'Orduak', + minuteText: 'Minutuak', + secondText: 'Segundoak', + millisecText: 'Milisegundoak', + microsecText: 'Mikrosegundoak', + timezoneText: 'Ordu-eremua', + currentText: 'Orain', + closeText: 'Itxi', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['eu']); +})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-fi.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-fi.js new file mode 100644 index 00000000..3f1d95e5 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-fi.js @@ -0,0 +1,21 @@ +/* Finnish translation for the jQuery Timepicker Addon */ +/* Written by Juga Paazmaya (http://github.com/paazmaya) */ +(function($) { + $.timepicker.regional['fi'] = { + timeOnlyTitle: 'Valitse aika', + timeText: 'Aika', + hourText: 'Tunti', + minuteText: 'Minuutti', + secondText: 'Sekunti', + millisecText: 'Millisekunnin', + microsecText: 'Mikrosekuntia', + timezoneText: 'Aikavyöhyke', + currentText: 'Nyt', + closeText: 'Sulje', + timeFormat: 'HH:mm', + amNames: ['ap.', 'AM', 'A'], + pmNames: ['ip.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['fi']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-fr.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-fr.js new file mode 100644 index 00000000..a8a46fe6 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-fr.js @@ -0,0 +1,21 @@ +/* French translation for the jQuery Timepicker Addon */ +/* Written by Thomas Lété */ +(function($) { + $.timepicker.regional['fr'] = { + timeOnlyTitle: 'Choisir une heure', + timeText: 'Heure', + hourText: 'Heures', + minuteText: 'Minutes', + secondText: 'Secondes', + millisecText: 'Millisecondes', + microsecText: 'Microsecondes', + timezoneText: 'Fuseau horaire', + currentText: 'Maintenant', + closeText: 'Terminé', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['fr']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-gl.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-gl.js new file mode 100644 index 00000000..900e3778 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-gl.js @@ -0,0 +1,21 @@ +/* Galician translation for the jQuery Timepicker Addon */ +/* Written by David Barral */ +(function($) { + $.timepicker.regional['gl'] = { + timeOnlyTitle: 'Elixir unha hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milisegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horario', + currentText: 'Agora', + closeText: 'Pechar', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['gl']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-he.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-he.js new file mode 100644 index 00000000..eb71018f --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-he.js @@ -0,0 +1,21 @@ +/* Hebrew translation for the jQuery Timepicker Addon */ +/* Written by Lior Lapid */ +(function($) { + $.timepicker.regional["he"] = { + timeOnlyTitle: "בחירת זמן", + timeText: "שעה", + hourText: "שעות", + minuteText: "דקות", + secondText: "שניות", + millisecText: "אלפית השנייה", + microsecText: "מיקרו", + timezoneText: "אזור זמן", + currentText: "עכשיו", + closeText:"סגור", + timeFormat: "HH:mm", + amNames: ['לפנה"צ', 'AM', 'A'], + pmNames: ['אחה"צ', 'PM', 'P'], + isRTL: true + }; + $.timepicker.setDefaults($.timepicker.regional["he"]); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-hr.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-hr.js new file mode 100644 index 00000000..c314b8e1 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-hr.js @@ -0,0 +1,21 @@ +/* Croatian translation for the jQuery Timepicker Addon */ +/* Written by Mladen */ +(function($) { + $.timepicker.regional['hr'] = { + timeOnlyTitle: 'Odaberi vrijeme', + timeText: 'Vrijeme', + hourText: 'Sati', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Vremenska zona', + currentText: 'Sada', + closeText: 'Gotovo', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['hr']); +})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-hu.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-hu.js new file mode 100644 index 00000000..fd1f5e19 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-hu.js @@ -0,0 +1,21 @@ +/* Hungarian translation for the jQuery Timepicker Addon */ +/* Written by Vas Gábor */ +(function($) { + $.timepicker.regional['hu'] = { + timeOnlyTitle: 'Válasszon időpontot', + timeText: 'Idő', + hourText: 'Óra', + minuteText: 'Perc', + secondText: 'Másodperc', + millisecText: 'Milliszekundumos', + microsecText: 'Ezredmásodperc', + timezoneText: 'Időzóna', + currentText: 'Most', + closeText: 'Kész', + timeFormat: 'HH:mm', + amNames: ['de.', 'AM', 'A'], + pmNames: ['du.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['hu']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-id.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-id.js new file mode 100644 index 00000000..50a976b1 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-id.js @@ -0,0 +1,21 @@ +/* Indonesian translation for the jQuery Timepicker Addon */ +/* Written by Nia */ +(function($) { + $.timepicker.regional['id'] = { + timeOnlyTitle: 'Pilih Waktu', + timeText: 'Waktu', + hourText: 'Pukul', + minuteText: 'Menit', + secondText: 'Detik', + millisecText: 'Milidetik', + microsecText: 'Mikrodetik', + timezoneText: 'Zona Waktu', + currentText: 'Sekarang', + closeText: 'OK', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['id']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-it.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-it.js new file mode 100644 index 00000000..ea976fdf --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-it.js @@ -0,0 +1,21 @@ +/* Italian translation for the jQuery Timepicker Addon */ +/* Written by Marco "logicoder" Del Tongo */ +(function($) { + $.timepicker.regional['it'] = { + timeOnlyTitle: 'Scegli orario', + timeText: 'Orario', + hourText: 'Ora', + minuteText: 'Minuti', + secondText: 'Secondi', + millisecText: 'Millisecondi', + microsecText: 'Microsecondi', + timezoneText: 'Fuso orario', + currentText: 'Adesso', + closeText: 'Chiudi', + timeFormat: 'HH:mm', + amNames: ['m.', 'AM', 'A'], + pmNames: ['p.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['it']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ja.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ja.js new file mode 100644 index 00000000..15c7b79f --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ja.js @@ -0,0 +1,21 @@ +/* Japanese translation for the jQuery Timepicker Addon */ +/* Written by Jun Omae */ +(function($) { + $.timepicker.regional['ja'] = { + timeOnlyTitle: '時間を選択', + timeText: '時間', + hourText: '時', + minuteText: '分', + secondText: '秒', + millisecText: 'ミリ秒', + microsecText: 'マイクロ秒', + timezoneText: 'タイムゾーン', + currentText: '現時刻', + closeText: '閉じる', + timeFormat: 'HH:mm', + amNames: ['午前', 'AM', 'A'], + pmNames: ['午後', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ja']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ko.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ko.js new file mode 100644 index 00000000..0a41c5bb --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ko.js @@ -0,0 +1,21 @@ +/* Korean translation for the jQuery Timepicker Addon */ +/* Written by Genie */ +(function($) { + $.timepicker.regional['ko'] = { + timeOnlyTitle: '시간 선택', + timeText: '시간', + hourText: '시', + minuteText: '분', + secondText: '초', + millisecText: '밀리초', + microsecText: '마이크로', + timezoneText: '표준 시간대', + currentText: '현재 시각', + closeText: '닫기', + timeFormat: 'tt h:mm', + amNames: ['오전', 'AM', 'A'], + pmNames: ['오후', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ko']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-lt.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-lt.js new file mode 100644 index 00000000..eb7b3c7b --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-lt.js @@ -0,0 +1,21 @@ +/* Lithuanian translation for the jQuery Timepicker Addon */ +/* Written by Irmantas Šiupšinskas */ +(function($) { + $.timepicker.regional['lt'] = { + timeOnlyTitle: 'Pasirinkite laiką', + timeText: 'Laikas', + hourText: 'Valandos', + minuteText: 'Minutės', + secondText: 'Sekundės', + millisecText: 'Milisekundės', + microsecText: 'Mikrosekundės', + timezoneText: 'Laiko zona', + currentText: 'Dabar', + closeText: 'Uždaryti', + timeFormat: 'HH:mm', + amNames: ['priešpiet', 'AM', 'A'], + pmNames: ['popiet', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['lt']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-nl.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-nl.js new file mode 100644 index 00000000..8189cc4a --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-nl.js @@ -0,0 +1,21 @@ +/* Dutch translation for the jQuery Timepicker Addon */ +/* Written by Martijn van der Lee */ +(function($) { + $.timepicker.regional['nl'] = { + timeOnlyTitle: 'Tijdstip', + timeText: 'Tijd', + hourText: 'Uur', + minuteText: 'Minuut', + secondText: 'Seconde', + millisecText: 'Milliseconde', + microsecText: 'Microseconde', + timezoneText: 'Tijdzone', + currentText: 'Vandaag', + closeText: 'Sluiten', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['nl']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-no.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-no.js new file mode 100644 index 00000000..1eeee6d3 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-no.js @@ -0,0 +1,21 @@ +/* Norwegian translation for the jQuery Timepicker Addon */ +/* Written by Morten Hauan (http://hauan.me) */ +(function($) { + $.timepicker.regional['no'] = { + timeOnlyTitle: 'Velg tid', + timeText: 'Tid', + hourText: 'Time', + minuteText: 'Minutt', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'mikrosekund', + timezoneText: 'Tidssone', + currentText: 'Nå', + closeText: 'Lukk', + timeFormat: 'HH:mm', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['no']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pl.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pl.js new file mode 100644 index 00000000..5b7d4a99 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pl.js @@ -0,0 +1,21 @@ +/* Polish translation for the jQuery Timepicker Addon */ +/* Written by Michał Pena */ +(function($) { + $.timepicker.regional['pl'] = { + timeOnlyTitle: 'Wybierz godzinę', + timeText: 'Czas', + hourText: 'Godzina', + minuteText: 'Minuta', + secondText: 'Sekunda', + millisecText: 'Milisekunda', + microsecText: 'Mikrosekunda', + timezoneText: 'Strefa czasowa', + currentText: 'Teraz', + closeText: 'Gotowe', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['pl']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pt-BR.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pt-BR.js new file mode 100644 index 00000000..2c1b02fc --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pt-BR.js @@ -0,0 +1,21 @@ +/* Brazilian Portuguese translation for the jQuery Timepicker Addon */ +/* Written by Diogo Damiani (diogodamiani@gmail.com) */ +(function ($) { + $.timepicker.regional['pt-BR'] = { + timeOnlyTitle: 'Escolha o horário', + timeText: 'Horário', + hourText: 'Hora', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milissegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horário', + currentText: 'Agora', + closeText: 'Fechar', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['pt-BR']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pt.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pt.js new file mode 100644 index 00000000..bc549e06 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-pt.js @@ -0,0 +1,21 @@ +/* Portuguese translation for the jQuery Timepicker Addon */ +/* Written by Luan Almeida */ +(function($) { + $.timepicker.regional['pt'] = { + timeOnlyTitle: 'Escolha uma hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milissegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horário', + currentText: 'Agora', + closeText: 'Fechar', + timeFormat: 'HH:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['pt']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ro.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ro.js new file mode 100644 index 00000000..01acce77 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ro.js @@ -0,0 +1,21 @@ +/* Romanian translation for the jQuery Timepicker Addon */ +/* Written by Romeo Adrian Cioaba */ +(function($) { + $.timepicker.regional['ro'] = { + timeOnlyTitle: 'Alegeţi o oră', + timeText: 'Timp', + hourText: 'Ore', + minuteText: 'Minute', + secondText: 'Secunde', + millisecText: 'Milisecunde', + microsecText: 'Microsecunde', + timezoneText: 'Fus orar', + currentText: 'Acum', + closeText: 'Închide', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ro']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ru.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ru.js new file mode 100644 index 00000000..d7169fa2 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-ru.js @@ -0,0 +1,21 @@ +/* Russian translation for the jQuery Timepicker Addon */ +/* Written by Trent Richardson */ +(function($) { + $.timepicker.regional['ru'] = { + timeOnlyTitle: 'Выберите время', + timeText: 'Время', + hourText: 'Часы', + minuteText: 'Минуты', + secondText: 'Секунды', + millisecText: 'Миллисекунды', + microsecText: 'Микросекунды', + timezoneText: 'Часовой пояс', + currentText: 'Сейчас', + closeText: 'Закрыть', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ru']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sk.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sk.js new file mode 100644 index 00000000..15700e07 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sk.js @@ -0,0 +1,21 @@ +/* Slovak translation for the jQuery Timepicker Addon */ +/* Written by David Vallner */ +(function($) { + $.timepicker.regional['sk'] = { + timeOnlyTitle: 'Zvoľte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minúty', + secondText: 'Sekundy', + millisecText: 'Milisekundy', + microsecText: 'Mikrosekundy', + timezoneText: 'Časové pásmo', + currentText: 'Teraz', + closeText: 'Zavrieť', + timeFormat: 'H:m', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['pop.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['sk']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sl.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sl.js new file mode 100644 index 00000000..b100fa32 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sl.js @@ -0,0 +1,21 @@ +/* Slovenian translation for the jQuery Timepicker Addon */ +/* Written by Hadalin (https://github.com/hadalin) */ +(function($) { + $.timepicker.regional['sl'] = { + timeOnlyTitle: 'Izberite čas', + timeText: 'Čas', + hourText: 'Ura', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Časovni pas', + currentText: 'Sedaj', + closeText: 'Zapri', + timeFormat: 'HH:mm', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['pop.', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['sl']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sr-RS.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sr-RS.js new file mode 100644 index 00000000..1ee4aae9 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sr-RS.js @@ -0,0 +1,21 @@ +/* Serbian cyrilic translation for the jQuery Timepicker Addon */ +/* Written by Vladimir Jelovac */ +(function($) { + $.timepicker.regional['sr-RS'] = { + timeOnlyTitle: 'Одаберите време', + timeText: 'Време', + hourText: 'Сати', + minuteText: 'Минути', + secondText: 'Секунде', + millisecText: 'Милисекунде', + microsecText: 'Микросекунде', + timezoneText: 'Временска зона', + currentText: 'Сада', + closeText: 'Затвори', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['sr-RS']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sr-YU.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sr-YU.js new file mode 100644 index 00000000..cb99fb82 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sr-YU.js @@ -0,0 +1,21 @@ +/* Serbian latin translation for the jQuery Timepicker Addon */ +/* Written by Vladimir Jelovac */ +(function($) { + $.timepicker.regional['sr-YU'] = { + timeOnlyTitle: 'Odaberite vreme', + timeText: 'Vreme', + hourText: 'Sati', + minuteText: 'Minuti', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Vremenska zona', + currentText: 'Sada', + closeText: 'Zatvori', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['sr-YU']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sv.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sv.js new file mode 100644 index 00000000..4540ac6d --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-sv.js @@ -0,0 +1,21 @@ +/* Swedish translation for the jQuery Timepicker Addon */ +/* Written by Nevon */ +(function($) { + $.timepicker.regional['sv'] = { + timeOnlyTitle: 'Välj en tid', + timeText: 'Tid', + hourText: 'Timme', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'Mikrosekund', + timezoneText: 'Tidszon', + currentText: 'Nu', + closeText: 'Stäng', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['sv']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-th.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-th.js new file mode 100644 index 00000000..7042e8c8 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-th.js @@ -0,0 +1,18 @@ +/* Thai translation for the jQuery Timepicker Addon */ +/* Written by Yote Wachirapornpongsa */ +(function($) { + $.timepicker.regional['th'] = { + timeOnlyTitle: 'เลือกเวลา', + timeText: 'เวลา ', + hourText: 'ชั่วโมง ', + minuteText: 'นาที', + secondText: 'วินาที', + millisecText: 'มิลลิวินาที', + microsecText: 'ไมโคริวินาที', + timezoneText: 'เขตเวลา', + currentText: 'เวลาปัจจุบัน', + closeText: 'ปิด', + timeFormat: 'hh:mm tt' + }; + $.timepicker.setDefaults($.timepicker.regional['th']); +})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-tr.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-tr.js new file mode 100644 index 00000000..51f89d62 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-tr.js @@ -0,0 +1,21 @@ +/* Turkish translation for the jQuery Timepicker Addon */ +/* Written by Fehmi Can Saglam, Edited by Goktug Ozturk */ +(function($) { + $.timepicker.regional['tr'] = { + timeOnlyTitle: 'Zaman Seçiniz', + timeText: 'Zaman', + hourText: 'Saat', + minuteText: 'Dakika', + secondText: 'Saniye', + millisecText: 'Milisaniye', + microsecText: 'Mikrosaniye', + timezoneText: 'Zaman Dilimi', + currentText: 'Şu an', + closeText: 'Tamam', + timeFormat: 'HH:mm', + amNames: ['ÖÖ', 'Ö'], + pmNames: ['ÖS', 'S'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['tr']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-uk.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-uk.js new file mode 100644 index 00000000..a239fe28 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-uk.js @@ -0,0 +1,21 @@ +/* Ukrainian translation for the jQuery Timepicker Addon */ +/* Written by Sergey Noskov */ +(function($) { + $.timepicker.regional['uk'] = { + timeOnlyTitle: 'Виберіть час', + timeText: 'Час', + hourText: 'Години', + minuteText: 'Хвилини', + secondText: 'Секунди', + millisecText: 'Мілісекунди', + microsecText: 'Мікросекунди', + timezoneText: 'Часовий пояс', + currentText: 'Зараз', + closeText: 'Закрити', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['uk']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-vi.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-vi.js new file mode 100644 index 00000000..60d712a2 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-vi.js @@ -0,0 +1,21 @@ +/* Vietnamese translation for the jQuery Timepicker Addon */ +/* Written by Nguyen Dinh Trung */ +(function($) { + $.timepicker.regional['vi'] = { + timeOnlyTitle: 'Chọn giờ', + timeText: 'Thời gian', + hourText: 'Giờ', + minuteText: 'Phút', + secondText: 'Giây', + millisecText: 'Mili giây', + microsecText: 'Micrô giây', + timezoneText: 'Múi giờ', + currentText: 'Hiện thời', + closeText: 'Đóng', + timeFormat: 'HH:mm', + amNames: ['SA', 'S'], + pmNames: ['CH', 'C'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['vi']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-zh-CN.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-zh-CN.js new file mode 100644 index 00000000..e73ac3bc --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-zh-CN.js @@ -0,0 +1,21 @@ +/* Simplified Chinese translation for the jQuery Timepicker Addon / +/ Written by Will Lu */ +(function($) { + $.timepicker.regional['zh-CN'] = { + timeOnlyTitle: '选择时间', + timeText: '时间', + hourText: '小时', + minuteText: '分钟', + secondText: '秒钟', + millisecText: '毫秒', + microsecText: '微秒', + timezoneText: '时区', + currentText: '现在时间', + closeText: '关闭', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['zh-CN']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-zh-TW.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-zh-TW.js new file mode 100644 index 00000000..9cbeabf4 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/i18n/jquery-ui-timepicker-zh-TW.js @@ -0,0 +1,21 @@ +/* Chinese translation for the jQuery Timepicker Addon */ +/* Written by Alang.lin */ +(function($) { + $.timepicker.regional['zh-TW'] = { + timeOnlyTitle: '選擇時分秒', + timeText: '時間', + hourText: '時', + minuteText: '分', + secondText: '秒', + millisecText: '毫秒', + microsecText: '微秒', + timezoneText: '時區', + currentText: '現在時間', + closeText: '確定', + timeFormat: 'HH:mm', + amNames: ['上午', 'AM', 'A'], + pmNames: ['下午', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['zh-TW']); +})(jQuery); diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/index.html b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/index.html new file mode 100644 index 00000000..ff64a7d4 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/index.html @@ -0,0 +1,1084 @@ + + + + + Adding a Timepicker to jQuery UI Datepicker + + + + + + + + + + +
+

Adding a Timepicker to jQuery UI Datepicker

+ +

The timepicker addon adds a timepicker to jQuery UI Datepicker, thus the datepicker and slider components (jQueryUI) are required for using any of these. In addition all datepicker options are still available through the timepicker addon.

+ +

If you are interested in contributing to Timepicker Addon please check it out on GitHub. If you do make additions please keep in mind I enjoy tabs over spaces,.. But contributions are welcome in any form.

+ +

Back to Blog or Follow on Twitter

+ + Car BounceTry my new app to keep you informed of your car's financing status and value. + +

Donation

+

Has this Timepicker Addon been helpful to you?

+
+
+ + + + +
+
+ +
+ + + +
+

Getting Started

+ +

Highly Recommended

+ +

Handling Time eBook

+
+

Check out the Handling Time eBook to learn from the basic setup to advanced i18n usage, and from client's javascript to the server's database.

+ Handling Time eBook +

buy eBook + Example code

+

buy eBook

+
+
+ +

Subscribe to Blog and Twitter

+

Subscribe to my blog via email and follow @PracticalWeb on Twitter. I post for nearly every new version, so you know about updates.

+
+
+ +

Download

+

Download Timepicker Addon

+

Download/Contribute on GitHub (Need the entire repo? Find a bug? See if its fixed here)

+

There is a small bit of required CSS (Download):

+
/* css for timepicker */
+.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
+.ui-timepicker-div dl { text-align: left; }
+.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
+.ui-timepicker-div dl dd { margin: 0 10px 10px 45%; }
+.ui-timepicker-div td { font-size: 90%; }
+.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
+
+.ui-timepicker-rtl{ direction: rtl; }
+.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
+.ui-timepicker-rtl dl dt{ float: right; clear: right; }
+.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
+
+ +

If you prefer a hosted CDN there are a couple available: CDNJS, jsDelivr.

+
+ +

Requirements

+

You also need to include jQuery and jQuery UI with datepicker and slider wigits. You should include them in your page in the following order:

+
    +
  1. jQuery
  2. +
  3. jQueryUI (with datepicker and slider wigits)
  4. +
  5. Timepicker
  6. +
+ +
+

Version

+

Version 1.5.0

+ +

Last updated on 2014-09-01

+

jQuery Timepicker Addon is currently available for use in all personal or commercial projects under the MIT license.

+

MIT License

+ +
+ + + +
+

Options

+ +

The timepicker does inherit all options from datepicker. However, there are many options that are shared by them both, and many timepicker only options:

+ +

Localization Options

+
+
currentText
+
Default: "Now", A Localization Setting - Text for the Now button.
+ +
closeText
+
Default: "Done", A Localization Setting - Text for the Close button.
+ +
amNames
+
Default: ['AM', 'A'], A Localization Setting - Array of strings to try and parse against to determine AM.
+ +
pmNames
+
Default: ['PM', 'P'], A Localization Setting - Array of strings to try and parse against to determine PM.
+ +
timeFormat
+
Default: "HH:mm", A Localization Setting - String of format tokens to be replaced with the time. See Formatting.
+ +
timeSuffix
+
Default: "", A Localization Setting - String to place after the formatted time.
+ +
timeOnlyTitle
+
Default: "Choose Time", A Localization Setting - Title of the wigit when using only timepicker.
+ +
timeText
+
Default: "Time", A Localization Setting - Label used within timepicker for the formatted time.
+ +
hourText
+
Default: "Hour", A Localization Setting - Label used to identify the hour slider.
+ +
minuteText
+
Default: "Minute", A Localization Setting - Label used to identify the minute slider.
+ +
secondText
+
Default: "Second", A Localization Setting - Label used to identify the second slider.
+ +
millisecText
+
Default: "Millisecond", A Localization Setting - Label used to identify the millisecond slider.
+ +
microsecText
+
Default: "Microsecond", A Localization Setting - Label used to identify the microsecond slider.
+ +
timezoneText
+
Default: "Timezone", A Localization Setting - Label used to identify the timezone slider.
+ +
isRTL
+
Default: false, A Localization Setting - Right to Left support.
+
+ +

Alt Field Options

+
+ +
altFieldTimeOnly
+
Default: true - When altField is used from datepicker altField will only receive the formatted time and the original field only receives date.
+ +
altSeparator
+
Default: (separator option) - String placed between formatted date and formatted time in the altField.
+ +
altTimeSuffix
+
Default: (timeSuffix option) - String always placed after the formatted time in the altField.
+ +
altTimeFormat
+
Default: (timeFormat option) - The time format to use with the altField.
+ +
altRedirectFocus
+
Default: true - Whether to immediately focus the main field whenever the altField receives focus. Effective at construction time only, changing it later has no effect.
+
+ +

Timezone Options

+
+ +
timezoneList
+
Default: [generated timezones] - An array of timezones used to populate the timezone select. Can be an array of values or an array of objects: { label: "EDT", value: -240 }. The value should be the offset number in minutes. So "-0400" which is the format "-hhmm", would equate to -240 minutes.
+
+ +

Time Field Options

+
+ +
controlType
+
Default: 'slider' - Whether to use 'slider' or 'select'. If 'slider' is unavailable through jQueryUI, 'select' will be used. For advanced usage you may pass an object which implements "create", "options", "value" methods to use controls other than sliders or selects. See the _controls property in the source code for more details. +
{
+	create: function(tp_inst, obj, unit, val, min, max, step){	
+		// generate whatever controls you want here, just return obj
+	},
+	options: function(tp_inst, obj, unit, opts, val){
+		// if val==undefined return the value, else return obj
+	},
+	value: function(tp_inst, obj, unit, val){
+		// if val==undefined return the value, else return obj
+	}
+}
+
+ +
showHour
+
Default: null - Whether to show the hour control. The default of null will use detection from timeFormat.
+ +
showMinute
+
Default: null - Whether to show the minute control. The default of null will use detection from timeFormat.
+ +
showSecond
+
Default: null - Whether to show the second control. The default of null will use detection from timeFormat.
+ +
showMillisec
+
Default: null - Whether to show the millisecond control. The default of null will use detection from timeFormat.
+ +
showMicrosec
+
Default: null - Whether to show the microsecond control. The default of null will use detection from timeFormat.
+ +
showTimezone
+
Default: null - Whether to show the timezone select.
+ +
showTime
+
Default: true - Whether to show the time selected within the datetimepicker.
+ +
stepHour
+
Default: 1 - Hours per step the slider makes.
+ +
stepMinute
+
Default: 1 - Minutes per step the slider makes.
+ +
stepSecond
+
Default: 1 - Seconds per step the slider makes.
+ +
stepMillisec
+
Default: 1 - Milliseconds per step the slider makes.
+ +
stepMicrosec
+
Default: 1 - Microseconds per step the slider makes.
+ +
hour
+
Default: 0 - Initial hour set.
+ +
minute
+
Default: 0 - Initial minute set.
+ +
second
+
Default: 0 - Initial second set.
+ +
millisec
+
Default: 0 - Initial millisecond set.
+ +
microsec
+
Default: 0 - Initial microsecond set. Note: Javascript's native Date object does not natively support microseconds. Timepicker adds ability to simply Date.setMicroseconds(m) and Date.getMicroseconds(). Date comparisons will not acknowledge microseconds. Use this only for display purposes.
+ +
timezone
+
Default: null - Initial timezone set. This is the offset in minutes. If null the browser's local timezone will be used. If you're timezone is "-0400" you would use -240. For backwards compatibility you may pass "-0400", however the timezone is stored in minutes and more reliable.
+ +
hourMin
+
Default: 0 - The minimum hour allowed for all dates.
+ +
minuteMin
+
Default: 0 - The minimum minute allowed for all dates.
+ +
secondMin
+
Default: 0 - The minimum second allowed for all dates.
+ +
millisecMin
+
Default: 0 - The minimum millisecond allowed for all dates.
+ +
microsecMin
+
Default: 0 - The minimum microsecond allowed for all dates.
+ +
hourMax
+
Default: 23 - The maximum hour allowed for all dates.
+ +
minuteMax
+
Default: 59 - The maximum minute allowed for all dates.
+ +
secondMax
+
Default: 59 - The maximum second allowed for all dates.
+ +
millisecMax
+
Default: 999 - The maximum millisecond allowed for all dates.
+ +
microsecMax
+
Default: 999 - The maximum microsecond allowed for all dates.
+ +
hourGrid
+
Default: 0 - When greater than 0 a label grid will be generated under the slider. This number represents the units (in hours) between labels.
+ +
minuteGrid
+
Default: 0 - When greater than 0 a label grid will be generated under the slider. This number represents the units (in minutes) between labels.
+ +
secondGrid
+
Default: 0 - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in seconds) between labels.
+ +
millisecGrid
+
Default: 0 - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in milliseconds) between labels.
+ +
microsecGrid
+
Default: 0 - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in microseconds) between labels.
+
+ +

Other Options

+
+
showButtonPanel
+
Default: true - Whether to show the button panel at the bottom. This is generally needed.
+ +
timeOnly
+
Default: false - Hide the datepicker and only provide a time interface.
+ +
timeOnlyShowDate
+
Default: false - Show the date and time in the input, but only allow the timepicker.
+ +
onSelect
+
Default: null - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).
+ +
alwaysSetTime
+
Default: true - Always have a time set internally, even before user has chosen one.
+ +
separator
+
Default: " " - When formatting the time this string is placed between the formatted date and formatted time.
+ +
pickerTimeFormat
+
Default: (timeFormat option) - How to format the time displayed within the timepicker.
+ +
pickerTimeSuffix
+
Default: (timeSuffix option) - String to place after the formatted time within the timepicker.
+ +
showTimepicker
+
Default: true - Whether to show the timepicker within the datepicker.
+ +
addSliderAccess
+
Default: false - Adds the sliderAccess plugin to sliders within timepicker
+ +
sliderAccessArgs
+
Default: null - Object to pass to sliderAccess when used.
+ +
defaultValue
+
Default: null - String of the default time value placed in the input on focus when the input is empty.
+ +
minDateTime
+
Default: null - Date object of the minimum datetime allowed. Also available as minDate.
+ +
maxDateTime
+
Default: null - Date object of the maximum datetime allowed. Also Available as maxDate.
+ +
minTime
+
Default: null - String of the minimum time allowed. '8:00 am' will restrict to times after 8am
+ +
maxTime
+
Default: null - String of the maximum time allowed. '8:00 pm' will restrict to times before 8pm
+ +
parse
+
Default: 'strict' - How to parse the time string. Two methods are provided: 'strict' which must match the timeFormat exactly, and 'loose' which uses javascript's new Date(timeString) to guess the time. You may also pass in a function(timeFormat, timeString, options) to handle the parsing yourself, returning a simple object: +
{
+	hour: 19,
+	minute: 10,
+	second: 23,
+	millisec: 45,
+	microsec: 23,
+	timezone: '-0400'
+}
+
+
+ +
+ + + +
+ +

Formatting Your Time

+ +

The default format is "HH:mm". To use 12 hour time use something similar to: "hh:mm tt". When both "t" and lower case "h" are present in the timeFormat, 12 hour time will be used.

+ +
+
H
Hour with no leading 0 (24 hour)
+
HH
Hour with leading 0 (24 hour)
+
h
Hour with no leading 0 (12 hour)
+
hh
Hour with leading 0 (12 hour)
+
m
Minute with no leading 0
+
mm
Minute with leading 0
+
s
Second with no leading 0
+
ss
Second with leading 0
+
l
Milliseconds always with leading 0
+
c
Microseconds always with leading 0
+
t
a or p for AM/PM
+
T
A or P for AM/PM
+
tt
am or pm for AM/PM
+
TT
AM or PM for AM/PM
+
z
Timezone as defined by timezoneList
+
Z
Timezone in Iso 8601 format (+04:45)
+
'...'
Literal text (Uses single quotes)
+
+ +

Formats are used in the following ways:

+
    +
  • timeFormat option
  • +
  • altTimeFormat option
  • +
  • pickerTimeFormat option
  • +
  • $.datepicker.formatTime(format, timeObj, options) utility method
  • +
  • $.datepicker.parseTime(format, timeStr, options) utility method
  • +
+ +

For help with formatting the date portion, visit the datepicker documentation for formatting dates.

+
+ + + +
+ +

Working with Localizations

+ +

Timepicker comes with many translations and localizations, thanks to all the contributors. They can be found in the i18n folder in the git repo.

+ +

The quick and cheap way to use localizations is to pass in options to a timepicker instance:

+ +
$('#example123').timepicker({
+	timeOnlyTitle: 'Выберите время',
+	timeText: 'Время',
+	hourText: 'Часы',
+	minuteText: 'Минуты',
+	secondText: 'Секунды',
+	currentText: 'Сейчас',
+	closeText: 'Закрыть'
+});
+
+

However, if you plan to use timepicker extensively you will need to include (build your own) localization. It is simply assigning those same variables to an object.

+

As you see in the example below we maintain a separate object for timepicker. This way we aren't bound to any future changes within datepicker.

+ +
$.datepicker.regional['ru'] = {
+	closeText: 'Закрыть',
+	prevText: '<Пред',
+	nextText: 'След>',
+	currentText: 'Сегодня',
+	monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
+	'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
+	monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
+	'Июл','Авг','Сен','Окт','Ноя','Дек'],
+	dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
+	dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
+	dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
+	weekHeader: 'Не',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''
+};
+$.datepicker.setDefaults($.datepicker.regional['ru']);
+
+
+$.timepicker.regional['ru'] = {
+	timeOnlyTitle: 'Выберите время',
+	timeText: 'Время',
+	hourText: 'Часы',
+	minuteText: 'Минуты',
+	secondText: 'Секунды',
+	millisecText: 'Миллисекунды',
+	timezoneText: 'Часовой пояс',
+	currentText: 'Сейчас',
+	closeText: 'Закрыть',
+	timeFormat: 'HH:mm',
+	amNames: ['AM', 'A'],
+	pmNames: ['PM', 'P'],
+	isRTL: false
+};
+$.timepicker.setDefaults($.timepicker.regional['ru']);
+
+ +

Now all you have to do is call timepicker and the Russian localization is used. Generally you only need to include the localization file, it will setDefaults() for you.

+

As of version 1.4.5 a combined file of all localizations available is included. This file DOES NOT call setDefaults(), so you will need to pass, or merge with your options.

+ +
$('#example123').timepicker($.timepicker.regional['ru']);
+
+ +

Localization files for datepicker are typically available in your jQueryUI downloads.

+
+ + + +
+

Examples

+ + + +

Basic Initializations

+ + +
+

Add a simple datetimepicker to jQuery UI's datepicker

+
+ +
+
+$('#basic_example_1').datetimepicker();
+
+
+ + + +
+

Add only a timepicker:

+
+ +
+
+$('#basic_example_2').timepicker();
+
+
+ + +
+

Format the time:

+
+ +
+
+$('#basic_example_3').datetimepicker({
+	timeFormat: "hh:mm tt"
+});
+
+
+ + + +
+

Timepicker comes with a collection of localization files and one combined file with all available localizations. $.timepicker.regional["your localization code here"] is a simple object with preset options:

+
+ +
+
+$('#basic_example_4').timepicker(
+	$.timepicker.regional['es']
+);
+
+
+ +

Using Timezones

+ + +
+

Simplest timezone usage:

+
+ +
+
+$('#timezone_example_1').datetimepicker({
+	timeFormat: 'hh:mm tt z'
+});
+
+
+ + +
+

Define your own timezone options:

+
+ +
+
+$('#timezone_example_2').datetimepicker({
+	timeFormat: 'HH:mm z',
+	timezoneList: [ 
+			{ value: -300, label: 'Eastern'}, 
+			{ value: -360, label: 'Central' }, 
+			{ value: -420, label: 'Mountain' }, 
+			{ value: -480, label: 'Pacific' } 
+		]
+});
+
+
+ + +
+

You may also use timezone string abbreviations for values. This should be used with caution. Computing accurate javascript Date objects may not be possible when trying to retrieve or set the date from timepicker (see setDate and getDate examples below). For simple input values however this should work.

+
+ +
+
+$('#timezone_example_3').datetimepicker({
+	timeFormat: 'HH:mm z',
+	timezone: 'MT',
+	timezoneList: [ 
+			{ value: 'ET', label: 'Eastern'}, 
+			{ value: 'CT', label: 'Central' }, 
+			{ value: 'MT', label: 'Mountain' }, 
+			{ value: 'PT', label: 'Pacific' } 
+		]
+});
+
+
+
+ +

Slider Modifications

+ + +
+

Add a grid to each slider:

+
+ +
+
+$('#slider_example_1').timepicker({
+	hourGrid: 4,
+	minuteGrid: 10,
+	timeFormat: 'hh:mm tt'
+});
+
+
+ + +
+

Set the interval step of sliders:

+
+ +
+
+$('#slider_example_2').datetimepicker({
+	timeFormat: 'HH:mm:ss',
+	stepHour: 2,
+	stepMinute: 10,
+	stepSecond: 10
+});
+
+
+ + +
+

Add sliderAccess plugin for touch devices:

+
+ +
+
+$('#slider_example_3').datetimepicker({
+	addSliderAccess: true,
+	sliderAccessArgs: { touchonly: false }
+});
+
+ + +
+

Use dropdowns instead of sliders. By default if slider is not available dropdowns will be used.

+
+ +
+
+$('#slider_example_4').datetimepicker({
+	controlType: 'select',
+	timeFormat: 'hh:mm tt'
+});
+
+ + +
+

Create your own control by implementing the create, options, and value methods. If you want to use your new control for all instances use the $.timepicker.setDefaults({controlType:myControl}). Here we implement jQueryUI's spinner control (jQueryUI 1.9+).

+
+ +
+
var myControl=  {
+	create: function(tp_inst, obj, unit, val, min, max, step){
+		$('<input class="ui-timepicker-input" value="'+val+'" style="width:50%">')
+			.appendTo(obj)
+			.spinner({
+				min: min,
+				max: max,
+				step: step,
+				change: function(e,ui){ // key events
+						// don't call if api was used and not key press
+						if(e.originalEvent !== undefined)
+							tp_inst._onTimeChange();
+						tp_inst._onSelectHandler();
+					},
+				spin: function(e,ui){ // spin events
+						tp_inst.control.value(tp_inst, obj, unit, ui.value);
+						tp_inst._onTimeChange();
+						tp_inst._onSelectHandler();
+					}
+			});
+		return obj;
+	},
+	options: function(tp_inst, obj, unit, opts, val){
+		if(typeof(opts) == 'string' && val !== undefined)
+			return obj.find('.ui-timepicker-input').spinner(opts, val);
+		return obj.find('.ui-timepicker-input').spinner(opts);
+	},
+	value: function(tp_inst, obj, unit, val){
+		if(val !== undefined)
+			return obj.find('.ui-timepicker-input').spinner('value', val);
+		return obj.find('.ui-timepicker-input').spinner('value');
+	}
+};
+
+$('#slider_example_5').datetimepicker({
+	controlType: myControl
+});
+
+ +

Alternate Fields

+ + +
+

Alt field in the simplest form:

+
+ + +
+
+$('#alt_example_1').datetimepicker({
+	altField: "#alt_example_1_alt"
+});
+
+
+ + +
+

With datetime in both:

+
+ + +
+
+$('#alt_example_2').datetimepicker({
+	altField: "#alt_example_2_alt",
+	altFieldTimeOnly: false
+});
+
+
+ + +
+

Format the altField differently:

+
+ + +
+
+$('#alt_example_3').datetimepicker({
+	altField: "#alt_example_3_alt",
+	altFieldTimeOnly: false,
+	altFormat: "yy-mm-dd",
+	altTimeFormat: "h:m t",
+	altSeparator: " @ "
+});
+
+
+ + +
+

With inline mode using altField:

+
+ + +
+
+$('#alt_example_4').datetimepicker({
+	altField: "#alt_example_4_alt",
+	altFieldTimeOnly: false
+});
+
+
+ +

Time Restraints

+ + +
+

Set the min/max hour of every date:

+
+ +
+
+$('#rest_example_1').timepicker({
+	hourMin: 8,
+	hourMax: 16
+});
+
+
+ + +
+

Set the min/max date numerically:

+
+ +
+
+$('#rest_example_2').datetimepicker({
+	numberOfMonths: 2,
+	minDate: 0,
+	maxDate: 30
+});
+
+
+ + +
+

Set the min/max date and time with a Date object:

+
+ +
+
+$('#rest_example_3').datetimepicker({
+	minDate: new Date(2010, 11, 20, 8, 30),
+	maxDate: new Date(2010, 11, 31, 17, 30)
+});
+
+
+ + +

Time Ranges

+ + +
+

Restrict a start and end date by using onSelect and onClose events for more control over functionality:

+

For more examples and advanced usage grab the Handling Time eBook.

+
+ + +
+
+var startDateTextBox = $('#range_example_1_start');
+var endDateTextBox = $('#range_example_1_end');
+
+startDateTextBox.datetimepicker({ 
+	timeFormat: 'HH:mm z',
+	onClose: function(dateText, inst) {
+		if (endDateTextBox.val() != '') {
+			var testStartDate = startDateTextBox.datetimepicker('getDate');
+			var testEndDate = endDateTextBox.datetimepicker('getDate');
+			if (testStartDate > testEndDate)
+				endDateTextBox.datetimepicker('setDate', testStartDate);
+		}
+		else {
+			endDateTextBox.val(dateText);
+		}
+	},
+	onSelect: function (selectedDateTime){
+		endDateTextBox.datetimepicker('option', 'minDate', startDateTextBox.datetimepicker('getDate') );
+	}
+});
+endDateTextBox.datetimepicker({ 
+	timeFormat: 'HH:mm z',
+	onClose: function(dateText, inst) {
+		if (startDateTextBox.val() != '') {
+			var testStartDate = startDateTextBox.datetimepicker('getDate');
+			var testEndDate = endDateTextBox.datetimepicker('getDate');
+			if (testStartDate > testEndDate)
+				startDateTextBox.datetimepicker('setDate', testEndDate);
+		}
+		else {
+			startDateTextBox.val(dateText);
+		}
+	},
+	onSelect: function (selectedDateTime){
+		startDateTextBox.datetimepicker('option', 'maxDate', endDateTextBox.datetimepicker('getDate') );
+	}
+});
+
+
+ + +
+

Timepicker also includes some shortcut methods for ranges:

+
+ + +
+
+var startDateTextBox = $('#range_example_2_start');
+var endDateTextBox = $('#range_example_2_end');
+
+$.timepicker.datetimeRange(
+	startDateTextBox,
+	endDateTextBox,
+	{
+		minInterval: (1000*60*60), // 1hr
+		dateFormat: 'dd M yy', 
+		timeFormat: 'HH:mm',
+		start: {}, // start picker options
+		end: {} // end picker options					
+	}
+);
+
+
+ + +
+

To use only times for a time range use $.timepicker.timeRange():

+
+ + +
+
+var startTimeTextBox = $('#range_example_3_start');
+var endTimeTextBox = $('#range_example_3_end');
+
+$.timepicker.timeRange(
+	startTimeTextBox,
+	endTimeTextBox,
+	{
+		minInterval: (1000*60*60), // 1hr
+		timeFormat: 'HH:mm',
+		start: {}, // start picker options
+		end: {} // end picker options
+	}
+);
+
+
+ + +
+

Even though this plugin focuses on datetime, it also provides a dateRange function:

+
+ + +
+
+var startDateTextBox = $('#range_example_4_start');
+var endDateTextBox = $('#range_example_4_end');
+
+$.timepicker.dateRange(
+	startDateTextBox,
+	endDateTextBox,
+	{
+		minInterval: (1000*60*60*24*4), // 4 days
+		maxInterval: (1000*60*60*24*8), // 8 days
+		start: {}, // start picker options
+		end: {} // end picker options
+	}
+);
+
+
+ +

Utilities

+ + +
+

Get and Set Datetime with the getDate and setDate methods. This example uses timezone to demonstrate the timepicker regonizes the timezones and computes the offsets when getting and setting.

+
+ + + +
+ +
+var ex13 = $('#utility_example_1');
+
+ex13.datetimepicker({
+	timeFormat: 'hh:mm tt z',
+	separator: ' @ ',
+	showTimezone: true
+});
+
+$('#utility_example_1_setdt').click(function(){
+	ex13.datetimepicker('setDate', (new Date()) );
+});
+
+$('#utility_example_1_getdt').click(function(){
+	alert(ex13.datetimepicker('getDate'));
+});
+
+
+ + +
+

Use the utility function to format your own time. $.datepicker.formatTime(format, time, options)

+
+
format
required - string represenation of the time format to use
+
time
required - hash: { hour, minute, second, millisecond, timezone }
+
options
optional - hash of any options in regional translation (ampm, amNames, pmNames..)
+
+

Returns a time string in the specified format.

+
+
+
+ +
+$('#utility_example_2').text(
+	$.datepicker.formatTime('HH:mm z', { hour: 14, minute: 36, timezone: '+2000' }, {})
+);
+
+
+ + +
+

Use the utility function to parses a formatted time. $.datepicker.parseTime(format, timeString, options)

+
+
format
required - string represenation of the time format to use
+
time
required - time string matching the format given in parameter 1
+
options
optional - hash of any options in regional translation (ampm, amNames, pmNames..)
+
+

Returns an object with hours, minutes, seconds, milliseconds, timezone.

+
+
+
+ +
+$('#utility_example_3').text(JSON.stringify( 
+	$.datepicker.parseTime('HH:mm:ss:l z', "14:36:21:765 +2000", {}) 
+));
+
+
+ +
+
+ + +
+ + + + + + + + + + + + + + + + diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-sliderAccess.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-sliderAccess.js new file mode 100644 index 00000000..b075c669 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-sliderAccess.js @@ -0,0 +1,91 @@ +/* + * jQuery UI Slider Access + * By: Trent Richardson [http://trentrichardson.com] + * Version 0.3 + * Last Modified: 10/20/2012 + * + * Copyright 2011 Trent Richardson + * Dual licensed under the MIT and GPL licenses. + * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt + * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt + * + */ + (function($){ + + $.fn.extend({ + sliderAccess: function(options){ + options = options || {}; + options.touchonly = options.touchonly !== undefined? options.touchonly : true; // by default only show it if touch device + + if(options.touchonly === true && !("ontouchend" in document)){ + return $(this); + } + + return $(this).each(function(i,obj){ + var $t = $(this), + o = $.extend({},{ + where: 'after', + step: $t.slider('option','step'), + upIcon: 'ui-icon-plus', + downIcon: 'ui-icon-minus', + text: false, + upText: '+', + downText: '-', + buttonset: true, + buttonsetTag: 'span', + isRTL: false + }, options), + $buttons = $('<'+ o.buttonsetTag +' class="ui-slider-access">'+ + ''+ + ''+ + ''); + + $buttons.children('button').each(function(j, jobj){ + var $jt = $(this); + $jt.button({ + text: o.text, + icons: { primary: $jt.data('icon') } + }) + .click(function(e){ + var step = $jt.data('step'), + curr = $t.slider('value'), + newval = curr += step*1, + minval = $t.slider('option','min'), + maxval = $t.slider('option','max'), + slidee = $t.slider("option", "slide") || function(){}, + stope = $t.slider("option", "stop") || function(){}; + + e.preventDefault(); + + if(newval < minval || newval > maxval){ + return; + } + + $t.slider('value', newval); + + slidee.call($t, null, { value: newval }); + stope.call($t, null, { value: newval }); + }); + }); + + // before or after + $t[o.where]($buttons); + + if(o.buttonset){ + $buttons.removeClass('ui-corner-right').removeClass('ui-corner-left').buttonset(); + $buttons.eq(0).addClass('ui-corner-left'); + $buttons.eq(1).addClass('ui-corner-right'); + } + + // adjust the width so we don't break the original layout + var bOuterWidth = $buttons.css({ + marginLeft: ((o.where === 'after' && !o.isRTL) || (o.where === 'before' && o.isRTL)? 10:0), + marginRight: ((o.where === 'before' && !o.isRTL) || (o.where === 'after' && o.isRTL)? 10:0) + }).outerWidth(true) + 5; + var tOuterWidth = $t.outerWidth(true); + $t.css('display','inline-block').width(tOuterWidth-bOuterWidth); + }); + } + }); + +})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.css b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.css new file mode 100644 index 00000000..da12d983 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.css @@ -0,0 +1,11 @@ +.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } +.ui-timepicker-div dl { text-align: left; } +.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; } +.ui-timepicker-div dl dd { margin: 0 10px 10px 40%; } +.ui-timepicker-div td { font-size: 90%; } +.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } + +.ui-timepicker-rtl{ direction: rtl; } +.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; } +.ui-timepicker-rtl dl dt{ float: right; clear: right; } +.ui-timepicker-rtl dl dd { margin: 0 40% 10px 10px; } \ No newline at end of file diff --git a/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.js b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.js new file mode 100644 index 00000000..0baae3e7 --- /dev/null +++ b/src/main/webapp/jquery/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.js @@ -0,0 +1,2223 @@ +/*! jQuery Timepicker Addon - v1.5.0 - 2014-09-01 +* http://trentrichardson.com/examples/timepicker +* Copyright (c) 2014 Trent Richardson; Licensed MIT */ +(function ($) { + + /* + * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded" + */ + $.ui.timepicker = $.ui.timepicker || {}; + if ($.ui.timepicker.version) { + return; + } + + /* + * Extend jQueryUI, get it started with our version number + */ + $.extend($.ui, { + timepicker: { + version: "1.5.0" + } + }); + + /* + * Timepicker manager. + * Use the singleton instance of this class, $.timepicker, to interact with the time picker. + * Settings for (groups of) time pickers are maintained in an instance object, + * allowing multiple different settings on the same page. + */ + var Timepicker = function () { + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + currentText: 'Now', + closeText: 'Done', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + timeFormat: 'HH:mm', + timeSuffix: '', + timeOnlyTitle: 'Choose Time', + timeText: 'Time', + hourText: 'Hour', + minuteText: 'Minute', + secondText: 'Second', + millisecText: 'Millisecond', + microsecText: 'Microsecond', + timezoneText: 'Time Zone', + isRTL: false + }; + this._defaults = { // Global defaults for all the datetime picker instances + showButtonPanel: true, + timeOnly: false, + timeOnlyShowDate: false, + showHour: null, + showMinute: null, + showSecond: null, + showMillisec: null, + showMicrosec: null, + showTimezone: null, + showTime: true, + stepHour: 1, + stepMinute: 1, + stepSecond: 1, + stepMillisec: 1, + stepMicrosec: 1, + hour: 0, + minute: 0, + second: 0, + millisec: 0, + microsec: 0, + timezone: null, + hourMin: 0, + minuteMin: 0, + secondMin: 0, + millisecMin: 0, + microsecMin: 0, + hourMax: 23, + minuteMax: 59, + secondMax: 59, + millisecMax: 999, + microsecMax: 999, + minDateTime: null, + maxDateTime: null, + maxTime: null, + minTime: null, + onSelect: null, + hourGrid: 0, + minuteGrid: 0, + secondGrid: 0, + millisecGrid: 0, + microsecGrid: 0, + alwaysSetTime: true, + separator: ' ', + altFieldTimeOnly: true, + altTimeFormat: null, + altSeparator: null, + altTimeSuffix: null, + altRedirectFocus: true, + pickerTimeFormat: null, + pickerTimeSuffix: null, + showTimepicker: true, + timezoneList: null, + addSliderAccess: false, + sliderAccessArgs: null, + controlType: 'slider', + defaultValue: null, + parse: 'strict' + }; + $.extend(this._defaults, this.regional['']); + }; + + $.extend(Timepicker.prototype, { + $input: null, + $altInput: null, + $timeObj: null, + inst: null, + hour_slider: null, + minute_slider: null, + second_slider: null, + millisec_slider: null, + microsec_slider: null, + timezone_select: null, + maxTime: null, + minTime: null, + hour: 0, + minute: 0, + second: 0, + millisec: 0, + microsec: 0, + timezone: null, + hourMinOriginal: null, + minuteMinOriginal: null, + secondMinOriginal: null, + millisecMinOriginal: null, + microsecMinOriginal: null, + hourMaxOriginal: null, + minuteMaxOriginal: null, + secondMaxOriginal: null, + millisecMaxOriginal: null, + microsecMaxOriginal: null, + ampm: '', + formattedDate: '', + formattedTime: '', + formattedDateTime: '', + timezoneList: null, + units: ['hour', 'minute', 'second', 'millisec', 'microsec'], + support: {}, + control: null, + + /* + * Override the default settings for all instances of the time picker. + * @param {Object} settings object - the new settings to use as defaults (anonymous object) + * @return {Object} the manager object + */ + setDefaults: function (settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + /* + * Create a new Timepicker instance + */ + _newInst: function ($input, opts) { + var tp_inst = new Timepicker(), + inlineSettings = {}, + fns = {}, + overrides, i; + + for (var attrName in this._defaults) { + if (this._defaults.hasOwnProperty(attrName)) { + var attrValue = $input.attr('time:' + attrName); + if (attrValue) { + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + } + + overrides = { + beforeShow: function (input, dp_inst) { + if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) { + return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst); + } + }, + onChangeMonthYear: function (year, month, dp_inst) { + // Update the time as well : this prevents the time from disappearing from the $input field. + tp_inst._updateDateTime(dp_inst); + if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) { + tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); + } + }, + onClose: function (dateText, dp_inst) { + if (tp_inst.timeDefined === true && $input.val() !== '') { + tp_inst._updateDateTime(dp_inst); + } + if ($.isFunction(tp_inst._defaults.evnts.onClose)) { + tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst); + } + } + }; + for (i in overrides) { + if (overrides.hasOwnProperty(i)) { + fns[i] = opts[i] || null; + } + } + + tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, { + evnts: fns, + timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); + }); + tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) { + return val.toUpperCase(); + }); + tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) { + return val.toUpperCase(); + }); + + // detect which units are supported + tp_inst.support = detectSupport( + tp_inst._defaults.timeFormat + + (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') + + (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : '')); + + // controlType is string - key to our this._controls + if (typeof(tp_inst._defaults.controlType) === 'string') { + if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') { + tp_inst._defaults.controlType = 'select'; + } + tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType]; + } + // controlType is an object and must implement create, options, value methods + else { + tp_inst.control = tp_inst._defaults.controlType; + } + + // prep the timezone options + var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60, + 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840]; + if (tp_inst._defaults.timezoneList !== null) { + timezoneList = tp_inst._defaults.timezoneList; + } + var tzl = timezoneList.length, tzi = 0, tzv = null; + if (tzl > 0 && typeof timezoneList[0] !== 'object') { + for (; tzi < tzl; tzi++) { + tzv = timezoneList[tzi]; + timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) }; + } + } + tp_inst._defaults.timezoneList = timezoneList; + + // set the default units + tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) : + ((new Date()).getTimezoneOffset() * -1); + tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : + tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour; + tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : + tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute; + tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : + tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second; + tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : + tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec; + tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin : + tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec; + tp_inst.ampm = ''; + tp_inst.$input = $input; + + if (tp_inst._defaults.altField) { + tp_inst.$altInput = $(tp_inst._defaults.altField); + if (tp_inst._defaults.altRedirectFocus === true) { + tp_inst.$altInput.css({ + cursor: 'pointer' + }).focus(function () { + $input.trigger("focus"); + }); + } + } + + if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) { + tp_inst._defaults.minDate = new Date(); + } + if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) { + tp_inst._defaults.maxDate = new Date(); + } + + // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. + if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) { + tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); + } + if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) { + tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); + } + if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) { + tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); + } + if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) { + tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); + } + tp_inst.$input.bind('focus', function () { + tp_inst._onFocus(); + }); + + return tp_inst; + }, + + /* + * add our sliders to the calendar + */ + _addTimePicker: function (dp_inst) { + var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val(); + + this.timeDefined = this._parseTime(currDT); + this._limitMinMaxDateTime(dp_inst, false); + this._injectTimePicker(); + }, + + /* + * parse the time string from input value or _setTime + */ + _parseTime: function (timeString, withDate) { + if (!this.inst) { + this.inst = $.datepicker._getInst(this.$input[0]); + } + + if (withDate || !this._defaults.timeOnly) { + var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); + try { + var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults); + if (!parseRes.timeObj) { + return false; + } + $.extend(this, parseRes.timeObj); + } catch (err) { + $.timepicker.log("Error parsing the date/time string: " + err + + "\ndate/time string = " + timeString + + "\ntimeFormat = " + this._defaults.timeFormat + + "\ndateFormat = " + dp_dateFormat); + return false; + } + return true; + } else { + var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults); + if (!timeObj) { + return false; + } + $.extend(this, timeObj); + return true; + } + }, + + /* + * generate and inject html for timepicker into ui datepicker + */ + _injectTimePicker: function () { + var $dp = this.inst.dpDiv, + o = this.inst.settings, + tp_inst = this, + litem = '', + uitem = '', + show = null, + max = {}, + gridSize = {}, + size = null, + i = 0, + l = 0; + + // Prevent displaying twice + if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) { + var noDisplay = ' style="display:none;"', + html = '
' + '
' + o.timeText + '
' + + '
'; + + // Create the markup + for (i = 0, l = this.units.length; i < l; i++) { + litem = this.units[i]; + uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); + show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; + + // Added by Peter Medeiros: + // - Figure out what the hour/minute/second max should be based on the step values. + // - Example: if stepMinute is 15, then minMax is 45. + max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10); + gridSize[litem] = 0; + + html += '
' + o[litem + 'Text'] + '
' + + '
'; + + if (show && o[litem + 'Grid'] > 0) { + html += '
'; + + if (litem === 'hour') { + for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) { + gridSize[litem]++; + var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o); + html += ''; + } + } + else { + for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) { + gridSize[litem]++; + html += ''; + } + } + + html += '
' + tmph + '' + ((m < 10) ? '0' : '') + m + '
'; + } + html += '
'; + } + + // Timezone + var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone; + html += '
' + o.timezoneText + '
'; + html += '
'; + + // Create the elements from string + html += '
'; + var $tp = $(html); + + // if we only want time picker... + if (o.timeOnly === true) { + $tp.prepend('
' + '
' + o.timeOnlyTitle + '
' + '
'); + $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); + } + + // add sliders, adjust grids, add events + for (i = 0, l = tp_inst.units.length; i < l; i++) { + litem = tp_inst.units[i]; + uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); + show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; + + // add the slider + tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]); + + // adjust the grid and add click event + if (show && o[litem + 'Grid'] > 0) { + size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']); + $tp.find('.ui_tpicker_' + litem + ' table').css({ + width: size + "%", + marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"), + marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0', + borderCollapse: 'collapse' + }).find("td").click(function (e) { + var $t = $(this), + h = $t.html(), + n = parseInt(h.replace(/[^0-9]/g), 10), + ap = h.replace(/[^apm]/ig), + f = $t.data('for'); // loses scope, so we use data-for + + if (f === 'hour') { + if (ap.indexOf('p') !== -1 && n < 12) { + n += 12; + } + else { + if (ap.indexOf('a') !== -1 && n === 12) { + n = 0; + } + } + } + + tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n); + + tp_inst._onTimeChange(); + tp_inst._onSelectHandler(); + }).css({ + cursor: 'pointer', + width: (100 / gridSize[litem]) + '%', + textAlign: 'center', + overflow: 'hidden' + }); + } // end if grid > 0 + } // end for loop + + // Add timezone options + this.timezone_select = $tp.find('.ui_tpicker_timezone').append('').find("select"); + $.fn.append.apply(this.timezone_select, + $.map(o.timezoneList, function (val, idx) { + return $("