Browse Source

version-zhicheng

sitask
zhicheng.zhang 5 years ago
commit
0a7ebc9c0d
  1. BIN
      cl_stream_datasave/cl_stream_datasave-2.0-SNAPSHOT.jar
  2. 179
      cl_stream_datasave/cl_stream_datasave.iml
  3. 125
      cl_stream_datasave/es.txt
  4. 542
      cl_stream_datasave/es_mapping
  5. 547
      cl_stream_datasave/foreground
  6. 187
      cl_stream_datasave/pom.xml
  7. 69
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/download/DownLoadFile.java
  8. 38
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/download/MyCookieJar.java
  9. 190
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/download/OkHttpUtils.java
  10. 33
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/download/ProxyIp.java
  11. 11
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/kafka/IKafka.java
  12. 117
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/kafka/ReadKafka.java
  13. 671
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/listen/DataSaveManager.java
  14. 424
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/listen/DataSaveManager_kongtianyuan.java
  15. 77
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/listen/ListenKafkaManager.java
  16. 30
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/listen/ListenTaskManager.java
  17. 226
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/DBConnectionManager.java
  18. 317
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/DBUtil.java
  19. 861
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/DateUtil.java
  20. 33
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/PropertiesUtil.java
  21. 37
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/ReadLine.java
  22. 21
      cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/WriteMethod.java
  23. 147
      cl_stream_datasave/src/main/java/com/bfd/mf/entity/AllKeys.java
  24. 21
      cl_stream_datasave/src/main/java/com/bfd/mf/entity/DataSaveManager.java
  25. 39
      cl_stream_datasave/src/main/java/com/bfd/mf/entity/FieldInfo.java
  26. 207
      cl_stream_datasave/src/main/java/com/bfd/mf/entity/FieldNormaliz.java
  27. 1397
      cl_stream_datasave/src/main/java/com/bfd/mf/entity/ReaultInfo.java
  28. 74
      cl_stream_datasave/src/main/java/com/bfd/mf/entity/impl/DataSaveManagerImpl.java
  29. 26
      cl_stream_datasave/src/main/java/com/bfd/mf/entity/mysql/FiledTableInfo.java
  30. 70
      cl_stream_datasave/src/main/java/com/bfd/mf/entity/mysql/SubjectTask.java
  31. 11
      cl_stream_datasave/src/main/java/com/bfd/mf/runstart/GeterExit.java
  32. 73
      cl_stream_datasave/src/main/java/com/bfd/mf/runstart/RunStartDataSave.java
  33. 37
      cl_stream_datasave/src/main/java/com/bfd/mf/runstart/TaskFileUtils.java
  34. 13
      cl_stream_datasave/src/test/java/AboutMysql.java
  35. 19
      cl_stream_datasave/src/test/java/CreatIndex.java
  36. 32
      cl_stream_datasave/src/test/java/Test1.java
  37. 205
      cl_stream_mybatis/cl_stream_mybatis.iml
  38. 180
      cl_stream_mybatis/pom.xml
  39. 18
      cl_stream_mybatis/src/main/java/com/bfd/mf/TestmybatisApplication.java
  40. 58
      cl_stream_mybatis/src/main/java/com/bfd/mf/common/ExternalConnCache.java
  41. 38
      cl_stream_mybatis/src/main/java/com/bfd/mf/common/PageBean.java
  42. 11
      cl_stream_mybatis/src/main/java/com/bfd/mf/config/XmlConfiguration.java
  43. 256
      cl_stream_mybatis/src/main/java/com/bfd/mf/controller/CompanyController.java
  44. 39
      cl_stream_mybatis/src/main/java/com/bfd/mf/entity/FieldInfo.java
  45. 258
      cl_stream_mybatis/src/main/java/com/bfd/mf/entity/FieldNormaliz.java
  46. 22
      cl_stream_mybatis/src/main/java/com/bfd/mf/entity/Record.java
  47. 84
      cl_stream_mybatis/src/main/java/com/bfd/mf/entity/StatInfo.java
  48. 86
      cl_stream_mybatis/src/main/java/com/bfd/mf/es/ESHandler.java
  49. 23
      cl_stream_mybatis/src/main/java/com/bfd/mf/mapper/FieldNormalizMapper.java
  50. 20
      cl_stream_mybatis/src/main/java/com/bfd/mf/mapper/StatMapper.java
  51. 12
      cl_stream_mybatis/src/main/java/com/bfd/mf/sendTask/SendTask.java
  52. 23
      cl_stream_mybatis/src/main/java/com/bfd/mf/sendTask/impl/SendTaskImpl.java
  53. 22
      cl_stream_mybatis/src/main/java/com/bfd/mf/service/FieldNormalizService.java
  54. 8
      cl_stream_mybatis/src/main/java/com/bfd/mf/service/MetaSearchService.java
  55. 17
      cl_stream_mybatis/src/main/java/com/bfd/mf/service/StatService.java
  56. 46
      cl_stream_mybatis/src/main/java/com/bfd/mf/service/impl/FieldNormalizServiceImpl.java
  57. 35
      cl_stream_mybatis/src/main/java/com/bfd/mf/service/impl/MetaSearchServiceImpl.java
  58. 42
      cl_stream_mybatis/src/main/java/com/bfd/mf/service/impl/StatServiceImpl.java
  59. 53
      cl_stream_mybatis/src/main/java/com/bfd/mf/tools/ConnectionRmi.java
  60. 18
      cl_stream_mybatis/src/main/resources/application.properties
  61. 63
      cl_stream_mybatis/src/main/resources/com/bfd/mf/mapper/fieldNormaliz.xml
  62. 50
      cl_stream_mybatis/src/main/resources/com/bfd/mf/mapper/statInfo.xml
  63. 31
      cl_stream_mybatis/src/main/resources/com/bfd/mf/spring/applicationContext.xml
  64. 4
      cl_stream_mybatis/src/main/resources/datasources.properties
  65. 18
      cl_stream_mybatis/src/main/resources/log4j.properties
  66. 124
      cl_stream_mybatis/src/main/resources/static/scripts/AjaxObject.js
  67. 203
      cl_stream_mybatis/src/main/resources/static/scripts/jquery.TableExcel.js
  68. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/jquery-1.3.2.min.js
  69. 209
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/plugins/ajaxfileupload.js
  70. 49
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.blind.js
  71. 78
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.bounce.js
  72. 54
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.clip.js
  73. 543
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.core.js
  74. 50
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.drop.js
  75. 79
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.explode.js
  76. 56
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.fold.js
  77. 48
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.highlight.js
  78. 56
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.pulsate.js
  79. 180
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.scale.js
  80. 57
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.shake.js
  81. 50
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.slide.js
  82. 45
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.transfer.js
  83. 762
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/jquery-ui-i18n.js
  84. 20
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-ar.js
  85. 20
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-bg.js
  86. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-ca.js
  87. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-cs.js
  88. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-da.js
  89. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-de.js
  90. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-el.js
  91. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-eo.js
  92. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-es.js
  93. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-fa.js
  94. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-fi.js
  95. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-fr.js
  96. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-he.js
  97. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-hr.js
  98. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-hu.js
  99. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-hy.js
  100. 19
      cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-id.js

BIN
cl_stream_datasave/cl_stream_datasave-2.0-SNAPSHOT.jar

179
cl_stream_datasave/cl_stream_datasave.iml

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/kafka-0.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/kafka-utils/kafka/0.10/kafka-0.10.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../jarlib/slf4j-api-1.7.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/bfd_harpc_service-0.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/BfdRedisTools-2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/dataManager-0.0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/hanlp-portable-1.6.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/nlp_common_util-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/taskManager-0.0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/utils-0.0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: bfd:utils:3.0.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.22" level="project" />
<orderEntry type="library" name="Maven: com.bfd:elastiUtils:0.0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: kafka-utils:kafka:0.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.kafka:kafka_2.10:0.10.2.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:0.10.2.0" level="project" />
<orderEntry type="library" name="Maven: net.jpountz.lz4:lz4:1.3.0" level="project" />
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.2.6" level="project" />
<orderEntry type="library" name="Maven: net.sf.jopt-simple:jopt-simple:5.0.3" level="project" />
<orderEntry type="library" name="Maven: com.yammer.metrics:metrics-core:2.2.0" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.10.6" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.21" level="project" />
<orderEntry type="library" name="Maven: com.101tec:zkclient:0.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.4.9" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.1.22" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.29" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch:elasticsearch:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch:elasticsearch-core:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-core:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-analyzers-common:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-backward-codecs:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-grouping:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-highlighter:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-join:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-memory:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-misc:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-queries:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-queryparser:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-sandbox:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-spatial:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-spatial-extras:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-spatial3d:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-suggest:7.2.1" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch:securesm:1.2" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch:elasticsearch-cli:6.2.3" level="project" />
<orderEntry type="library" name="Maven: com.carrotsearch:hppc:0.7.1" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.10" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.10" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.8.10" level="project" />
<orderEntry type="library" name="Maven: com.tdunning:t-digest:3.0" level="project" />
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.9" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.9.1" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch:jna:4.5.1" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.client:transport:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:reindex-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:lang-mustache-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: com.github.spullara.mustache.java:compiler:0.9.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:percolator-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:parent-join-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:rank-eval-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.client:elasticsearch-rest-high-level-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.client:elasticsearch-rest-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.5" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:aggs-matrix-stats-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:transport-netty4-client:6.2.3" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.16.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.16.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.16.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.16.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.16.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.16.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.16.Final" level="project" />
<orderEntry type="library" name="Maven: org.locationtech.spatial4j:spatial4j:0.6" level="project" />
<orderEntry type="library" name="Maven: com.vividsolutions:jts:1.13" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.9.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.6.0" level="project" />
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.11.0" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.13-beta-1" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
</component>
</module>

125
cl_stream_datasave/es.txt

@ -0,0 +1,125 @@
enSource
source
language
crawlTimeStr
primary
listBrand
projectName
createTimeStr
lastModifiedTime
cate
title
content
pictureList
videoUrl
pubTimeStr
postId
commentId
url
commentsCount
attitudesCount
collectCount
favorCnt
quoteCount
readCount
viewCnt
downCnt
postSource
commentUrl
commentScore
sign
impression
skuProperties
price
nomorprice
brand
productParameter
promotionInfo
smallImgs
forwardAttitudesCount
forwardAuthor
forwardAvatar
forwardCommentsCount
forwardContent
forwardImgs
forwardPostSource
forwardPubTime
forwardQuoteCount
forwardUrl
forwardUserId
forwardUserType
forwardUserUrl
age
sex
author
authorId
authorLevel
authornickname
avatar
userUrl
userType
area
city
country
location
province
isVip
forumScore
fansCount
friendsCount 
postCount
translateTitle
translateContent
filePath
resolution
extension
thumbnails
videoTime
isDownload
crawlDataFlag
attr
pageType
siteId
otherSourceJson
availability
channel
contentTag
dataCount
docId
docType
getSource
finalPhrase
originalPhrase
urlHash
titleLength
titleSimHash
contentLength
contentSimHash
expression
hashTag
hlKeywords
opinions
places
sysAbstract
sysKeywords
sysSentiment
pageCommentCount
pageTranspondCount
egc
pgc
ugc
brandId
firstListBrand
secondListBrand
threeListBrand
fourListBrand
fiveListBrand
crawlDate
crawlDay
crawlTime
pubDate
pubDay
pubTime
createDate
createDay
createTime

542
cl_stream_datasave/es_mapping

@ -0,0 +1,542 @@
{
"commentUrl":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"channel":{
"type":"keyword"
},
"readCount":{
"type":"long"
},
"quoteCount":{
"type":"long"
},
"brand":{
"analyzer":"ik_smart",
"term_vector":"yes",
"type":"text",
"fields":{
"shingles":{
"analyzer":"shingle_analyzer",
"type":"text"
}
}
},
"brandId":{
"type":"keyword"
},
"createTimeStr":{
"type":"keyword"
},
"authornickname":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"contentSimHash":{
"type":"keyword"
},
"crawlDay":{
"type":"long"
},
"titleSimHash":{
"type":"keyword"
},
"commentId":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"originalPhrase":{
"type":"keyword"
},
"forwardContent":{
"analyzer":"ik_smart",
"type":"text",
"fields":{
"shingles":{
"analyzer":"shingle_analyzer",
"type":"text"
}
}
},
"finalPhrase":{
"type":"keyword"
},
"availability":{
"type":"integer"
},
"forwardUserId":{
"type":"keyword"
},
"forwardUserType":{
"type":"integer"
},
"forwardUserUrl":{
"type":"keyword"
},
"forwardAvatar":{
"type":"keyword"
},
"forwardImgs":{
"type":"keyword"
},
"forwardPostSource":{
"type":"keyword"
},
"forwardAttitudesCount":{
"type":"long"
},
"forwardCommentsCount":{
"type":"long"
},
"forwardQuoteCount":{
"type":"long"
},
"forwardPubTime":{
"type":"long"
},
"titleLength":{
"type":"long"
},
"forwardAuthor":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"sysAbstract":{
"analyzer":"ik_smart",
"type":"text"
},
"forwardUrl":{
"type":"keyword"
},
"createDate":{
"type":"date"
},
"docType":{
"type":"keyword"
},
"getSource":{
"type":"keyword"
},
"dataCount":{
"type":"integer"
},
"primary":{
"type":"integer"
},
"cate":{
"type":"keyword"
},
"sex":{
"type":"keyword"
},
"collectCount":{
"type":"long"
},
"crawlDate":{
"type":"date"
},
"avatar":{
"type":"keyword"
},
"url":{
"type":"keyword"
},
"skuProperties":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"expression":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"hashTag":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"places":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"opinions":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"hlKeywords":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"createTime":{
"type":"long"
},
"contentLength":{
"type":"integer"
},
"pubTime":{
"type":"long"
},
"fansCount":{
"type":"keyword"
},
"language":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"source":{
"type":"keyword"
},
"enSource":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"pictureList":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"userUrl":{
"type":"keyword"
},
"videoUrl":{
"type":"keyword"
},
"contentTag":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"author":{
"type":"keyword"
},
"authorId":{
"type":"keyword"
},
"authorLevel":{
"type":"keyword"
},
"sysSentiment":{
"type":"double"
},
"price":{
"type":"double"
},
"nomorprice":{
"type":"double"
},
"attitudesCount":{
"type":"keyword"
},
"createDay":{
"type":"long"
},
"postId":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"pubDate":{
"type":"date"
},
"sysKeywords":{
"type":"keyword"
},
"crawlTime":{
"type":"long"
},
"userType":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"projectName":{
"type":"keyword"
},
"lastModifiedTime":{
"type":"long"
},
"productParameter":{
"analyzer":"ik_smart",
"term_vector":"yes",
"type":"text",
"fields":{
"shingles":{
"analyzer":"shingle_analyzer",
"type":"text"
}
}
},
"docId":{
"type":"keyword"
},
"commentScore":{
"type":"long"
},
"urlHash":{
"type":"keyword"
},
"_id_":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"title":{
"analyzer":"ik_smart",
"term_vector":"yes",
"type":"text",
"fields":{
"shingles":{
"analyzer":"shingle_analyzer",
"type":"text"
}
}
},
"pageTranspondCount":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"pageCommentCount":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"content":{
"analyzer":"ik_smart",
"term_vector":"yes",
"type":"text",
"fields":{
"shingles":{
"analyzer":"shingle_analyzer",
"type":"text"
}
}
},
"pubDay":{
"type":"long"
},
"pubTimeStr":{
"type":"keyword"
},
"postSource":{
"type":"keyword"
},
"crawlTimeStr":{
"type":"keyword"
},
"postCount":{
"type":"keyword"
},
"friendsCount":{
"type":"keyword"
},
"commentsCount":{
"type":"long"
},
"favorCnt":{
"type":"long"
},
"viewCnt":{
"type":"long"
},
"downCnt":{
"type":"long"
},
"sign":{
"type":"keyword"
},
"isVip":{
"type":"integer"
},
"forumScore":{
"type":"keyword"
},
"impression":{
"type":"keyword"
},
"promotionInfo":{
"type":"keyword"
},
"smallImgs":{
"type":"keyword"
},
"listBrand":{
"analyzer":"ik_smart",
"term_vector":"yes",
"type":"text",
"fields":{
"shingles":{
"analyzer":"shingle_analyzer",
"type":"text"
}
}
},
"firstListBrand":{
"type":"keyword"
},
"secondListBrand":{
"type":"keyword"
},
"threeListBrand":{
"type":"keyword"
},
"fourListBrand":{
"type":"keyword"
},
"fiveListBrand":{
"type":"keyword"
},
"area":{
"type":"keyword"
},
"location":{
"type":"keyword"
},
"country":{
"type":"keyword"
},
"province":{
"type":"keyword"
},
"city":{
"type":"keyword"
},
"age":{
"type":"keyword"
},
"egc":{
"type":"integer"
},
"pgc":{
"type":"integer"
},
"ugc":{
"type":"integer"
},
"translateTitle":{
"type":"keyword"
},
"translateContent":{
"type":"keyword"
},
"filePath":{
"type":"keyword"
},
"resolution":{
"type":"keyword"
},
"extension":{
"type":"keyword"
},
"thumbnails":{
"type":"keyword"
},
"videoTime":{
"type":"keyword"
},
"isDownload":{
"type":"keyword"
},
"crawlDataFlag":{
"type":"keyword"
},
"attr":{
"type":"keyword"
},
"pageType":{
"type":"keyword"
},
"siteId":{
"type":"keyword"
},
"otherSourceJson":{
"type":"keyword"
}
}

547
cl_stream_datasave/foreground

@ -0,0 +1,547 @@
{
"commentUrl":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"channel":{
"type":"keyword"
},
"readCount":{
"type":"long"
},
"quoteCount":{
"type":"long"
},
"brand":{
"term_vector":"yes",
"type":"text",
"analyzer":"ik_smart",
"search_analyzer":"ik_smart",
"fields":{
"shingles":{
"type":"text",
"analyzer":"shingle_analyzer"
}
}
},
"brandId":{
"type":"keyword"
},
"createTimeStr":{
"type":"keyword"
},
"authornickname":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"contentSimHash":{
"type":"keyword"
},
"crawlDay":{
"type":"long"
},
"titleSimHash":{
"type":"keyword"
},
"commentId":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"originalPhrase":{
"type":"keyword"
},
"forwardContent":{
"analyzer":"ik_smart",
"type":"text",
"fields":{
"shingles":{
"analyzer":"shingle_analyzer",
"type":"text"
}
}
},
"finalPhrase":{
"type":"keyword"
},
"availability":{
"type":"integer"
},
"forwardUserId":{
"type":"keyword"
},
"forwardUserType":{
"type":"integer"
},
"forwardUserUrl":{
"type":"keyword"
},
"forwardAvatar":{
"type":"keyword"
},
"forwardImgs":{
"type":"keyword"
},
"forwardPostSource":{
"type":"keyword"
},
"forwardAttitudesCount":{
"type":"long"
},
"forwardCommentsCount":{
"type":"long"
},
"forwardQuoteCount":{
"type":"long"
},
"forwardPubTime":{
"type":"long"
},
"titleLength":{
"type":"long"
},
"forwardAuthor":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"sysAbstract":{
"analyzer":"ik_smart",
"type":"text"
},
"forwardUrl":{
"type":"keyword"
},
"createDate":{
"type":"date"
},
"docType":{
"type":"keyword"
},
"getSource":{
"type":"keyword"
},
"dataCount":{
"type":"integer"
},
"primary":{
"type":"integer"
},
"cate":{
"type":"keyword"
},
"sex":{
"type":"keyword"
},
"collectCount":{
"type":"long"
},
"crawlDate":{
"type":"date"
},
"avatar":{
"type":"keyword"
},
"url":{
"type":"keyword"
},
"skuProperties":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"expression":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"hashTag":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"places":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"opinions":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"hlKeywords":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"createTime":{
"type":"long"
},
"contentLength":{
"type":"integer"
},
"pubTime":{
"type":"long"
},
"fansCount":{
"type":"keyword"
},
"language":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"source":{
"type":"keyword"
},
"enSource":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"pictureList":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"userUrl":{
"type":"keyword"
},
"videoUrl":{
"type":"keyword"
},
"contentTag":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"author":{
"type":"keyword"
},
"authorId":{
"type":"keyword"
},
"authorLevel":{
"type":"keyword"
},
"sysSentiment":{
"type":"double"
},
"price":{
"type":"double"
},
"nomorprice":{
"type":"double"
},
"attitudesCount":{
"type":"keyword"
},
"createDay":{
"type":"long"
},
"postId":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"pubDate":{
"type":"date"
},
"sysKeywords":{
"type":"keyword"
},
"crawlTime":{
"type":"long"
},
"userType":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"projectName":{
"type":"keyword"
},
"lastModifiedTime":{
"type":"long"
},
"productParameter":{
"term_vector":"yes",
"type":"text",
"analyzer":"ik_smart",
"search_analyzer":"ik_smart",
"fields":{
"shingles":{
"type":"text",
"analyzer":"shingle_analyzer"
}
}
},
"docId":{
"type":"keyword"
},
"commentScore":{
"type":"long"
},
"urlHash":{
"type":"keyword"
},
"_id_":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"title":{
"term_vector":"yes",
"type":"text",
"analyzer":"ik_smart",
"search_analyzer":"ik_smart",
"fields":{
"shingles":{
"type":"text",
"analyzer":"shingle_analyzer"
}
}
},
"pageTranspondCount":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"pageCommentCount":{
"type":"text",
"fields":{
"keyword":{
"ignore_above":256,
"type":"keyword"
}
}
},
"content":{
"term_vector":"yes",
"type":"text",
"analyzer":"ik_smart",
"search_analyzer":"ik_smart",
"fields":{
"shingles":{
"type":"text",
"analyzer":"shingle_analyzer"
}
}
},
"pubDay":{
"type":"long"
},
"pubTimeStr":{
"type":"keyword"
},
"postSource":{
"type":"keyword"
},
"crawlTimeStr":{
"type":"keyword"
},
"postCount":{
"type":"keyword"
},
"friendsCount":{
"type":"keyword"
},
"commentsCount":{
"type":"long"
},
"favorCnt":{
"type":"long"
},
"viewCnt":{
"type":"long"
},
"downCnt":{
"type":"long"
},
"sign":{
"type":"keyword"
},
"isVip":{
"type":"integer"
},
"forumScore":{
"type":"keyword"
},
"impression":{
"type":"keyword"
},
"promotionInfo":{
"type":"keyword"
},
"smallImgs":{
"type":"keyword"
},
"listBrand":{
"term_vector":"yes",
"type":"text",
"analyzer":"ik_smart",
"search_analyzer":"ik_smart",
"fields":{
"shingles":{
"type":"text",
"analyzer":"shingle_analyzer"
}
}
},
"firstListBrand":{
"type":"keyword"
},
"secondListBrand":{
"type":"keyword"
},
"threeListBrand":{
"type":"keyword"
},
"fourListBrand":{
"type":"keyword"
},
"fiveListBrand":{
"type":"keyword"
},
"area":{
"type":"keyword"
},
"location":{
"type":"keyword"
},
"country":{
"type":"keyword"
},
"province":{
"type":"keyword"
},
"city":{
"type":"keyword"
},
"age":{
"type":"keyword"
},
"egc":{
"type":"integer"
},
"pgc":{
"type":"integer"
},
"ugc":{
"type":"integer"
},
"translateTitle":{
"type":"keyword"
},
"translateContent":{
"type":"keyword"
},
"filePath":{
"type":"keyword"
},
"resolution":{
"type":"keyword"
},
"extension":{
"type":"keyword"
},
"thumbnails":{
"type":"keyword"
},
"videoTime":{
"type":"keyword"
},
"isDownload":{
"type":"keyword"
},
"crawlDataFlag":{
"type":"keyword"
},
"attr":{
"type":"keyword"
},
"pageType":{
"type":"keyword"
},
"siteId":{
"type":"keyword"
},
"otherSourceJson":{
"type":"keyword"
}
}

187
cl_stream_datasave/pom.xml

@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cl_stream</artifactId>
<groupId>com.bfd.mf</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cl_stream_datasave</artifactId>
<properties>
<start-class>com.bfd.mf.runstart.RunStartDataSave</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skipTests>true</skipTests>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>bfd</groupId>
<artifactId>utils</artifactId>
<version>3.0.0</version>
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/../../jarlib/utils-3.0.0.jar</systemPath>-->
</dependency>
<dependency>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>com.bfd</groupId>
<artifactId>elastiUtils</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>kafka-utils</groupId>
<artifactId>kafka</artifactId>
<version>0.10</version>
<!--<exclusions>-->
<!--<exclusion>-->
<!--<artifactId>zookeeper</artifactId>-->
<!--<groupId>org.apache.zookeeper</groupId>-->
<!--</exclusion>-->
<!--<exclusion>-->
<!--<artifactId>slf4j-api</artifactId>-->
<!--<groupId>org.slf4j</groupId>-->
<!--</exclusion>-->
<!--</exclusions>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/../../jarlib/kafka-0.10.jar</systemPath>-->
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.1.22</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.29</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.2.3</version>
<exclusions>
<exclusion>
<artifactId>jackson-core</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
<exclusion>
<artifactId>jopt-simple</artifactId>
<groupId>net.sf.jopt-simple</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.2.3</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.2.3</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>transport-netty4-client</artifactId>
<version>6.2.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.1</version>
<exclusions>
<exclusion>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.slf4j</groupId>-->
<!--<artifactId>slf4j-simple</artifactId>-->
<!--<version>1.7.22</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.slf4j</groupId>-->
<!--<artifactId>slf4j-api</artifactId>-->
<!--<version>1.7.25</version>-->
<!--</dependency>-->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13-beta-1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.bfd.mf.runstart.RunStartDataSave</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

69
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/download/DownLoadFile.java

@ -0,0 +1,69 @@
package com.bfd.mf.datasave.download;
import com.alibaba.fastjson.JSONObject;
import okhttp3.*;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class DownLoadFile {
public static Map<String,Object> downloadAndSaveFile(String getUrl,String putUrl){
String realUrl = "";Integer size;
Map<String,Object> realresult= new HashMap<>();
try{
String files [] = getUrl.split("/");
String fileName = getUrl.split("/")[files.length-1];
Map<String,String> header = new HashMap<>();
header.put("User-Agent","Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36");
// header.put("Connection","close");
try {
Map<String,Object> downloadresult = OkHttpUtils.doGetBytes(getUrl,header);
if (downloadresult.containsKey("content")){
byte[] content = (byte[]) downloadresult.get("content");
size= (Integer) downloadresult.get("size");
Thread.sleep(4000);
String result = DownLoadFile.upload(putUrl,fileName,content);
realUrl = JSONObject.parseObject(result).getString("url");
realresult.put("realUrl",realUrl);
realresult.put("size",size);
}
} catch (IOException e) {
e.printStackTrace();
}
}catch (Exception e){
e.printStackTrace();
}
return realresult;
}
public static String upload(String uploadUrl,String fileName,byte[] content) {
String result = "";
try {
OkHttpClient httpClient = new OkHttpClient();
MultipartBody multipartBody = new MultipartBody.Builder().
setType(MultipartBody.FORM)
.addFormDataPart("file", fileName,
RequestBody.create(MediaType.parse("multipart/form-data;charset=utf-8"),
content))
.addFormDataPart("output", "json")
.build();
Request request = new Request.Builder()
.url(uploadUrl)
.post(multipartBody)
.build();
Response response = httpClient.newCall(request).execute();
if (response.isSuccessful()) {
ResponseBody body = response.body();
if (body != null) {
result = body.string();
}
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
}

38
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/download/MyCookieJar.java

@ -0,0 +1,38 @@
package com.bfd.mf.datasave.download;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class MyCookieJar implements CookieJar {
private final Map<String, Map<String, Cookie>> cookieStore = new ConcurrentHashMap<>();
@Override
public void saveFromResponse(HttpUrl httpUrl, List<Cookie> list) {
Map<String, Cookie> cookies = cookieStore.get(httpUrl.host());
if (cookies == null) {
cookies = new HashMap<>();
}
for (Cookie c : list) {
cookies.put(c.name(), c);
}
}
@Override
public List<Cookie> loadForRequest(HttpUrl httpUrl) {
Map<String,Cookie> cookies = cookieStore.get(httpUrl.host());
List<Cookie> list = new ArrayList<>();
if (cookies == null)
return list;
cookies.forEach((k,v) -> list.add(v));
return list;
}
}

190
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/download/OkHttpUtils.java

@ -0,0 +1,190 @@
package com.bfd.mf.datasave.download;
import okhttp3.*;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Created by BFD_303 on 2017/7/7.
*/
public class OkHttpUtils {
private static final CookieJar cookieJar = new MyCookieJar();
private static final OkHttpClient dClient = new OkHttpClient().newBuilder()
.cookieJar(cookieJar)
.connectTimeout(10, TimeUnit.MINUTES)
.readTimeout(10,TimeUnit.MINUTES)
.writeTimeout(10,TimeUnit.MINUTES)
.build();
private static String doExecute(Request request, OkHttpClient client) throws Exception{
if (client == null)
client = dClient;
Response response = null;
try{
response = client.newCall(request).execute();
System.out.println(request.url() + " => get status code is " + response.code());
return response.isSuccessful() ? response.body().string() : "";
}finally {
if (response != null)
response.close();
}
}
//
public static String doGet(String url, Map<String,String> headers,String ip,int port) throws Exception {
OkHttpClient client ;
if (ip == null)
client = dClient;
else
client = dClient.newBuilder()
.cookieJar(cookieJar)
.proxy(new Proxy(Proxy.Type.HTTP,new InetSocketAddress(ip,port)))
.connectTimeout(10, TimeUnit.SECONDS)
.build();
Request.Builder builder = new Request.Builder().url(url);
if (headers != null && headers.size() > 0){
headers.forEach((k,v) -> builder.addHeader(k,v));
}
Request request = builder.build();
return doExecute(request,client);
}
public static String doPost(String url, Map<String,String> headers,Map<String,String> params) throws Exception {
OkHttpClient client = dClient.newBuilder()
.cookieJar(cookieJar)
.connectTimeout(30, TimeUnit.SECONDS)
.build();
FormBody.Builder bodyBuilder= new FormBody.Builder();
if (params != null){
params.forEach((k,v) -> bodyBuilder.add(k,v));
}
RequestBody body = bodyBuilder.build();
Request.Builder builder = new Request.Builder().url(url).post(body);
if (headers != null && headers.size() > 0){
headers.forEach((k,v) -> builder.addHeader(k,v));
}
Request request = builder.build();
return doExecute(request,client);
}
public static String doPost(String url, Map<String,String> headers,Map<String,String> params, ProxyIp ip) throws Exception {
OkHttpClient client;
if (ip == null)
client = dClient;
else
client = dClient.newBuilder()
.cookieJar(cookieJar)
.proxy(new Proxy(ip.getType(),new InetSocketAddress(ip.getIp(),ip.getPort())))
.connectTimeout(5, TimeUnit.SECONDS)
.build();
FormBody.Builder bodyBuilder= new FormBody.Builder();
if (params != null){
params.forEach((k,v) -> bodyBuilder.add(k,v));
}
RequestBody body = bodyBuilder.build();
Request.Builder builder = new Request.Builder().url(url).post(body);
if (headers != null && headers.size() > 0){
headers.forEach((k,v) -> builder.addHeader(k,v));
}
Request request = builder.build();
return doExecute(request,client);
}
public static byte[] doPostByte(String url,Map<String,String> headers,Map<String,String> params,ProxyIp ip) throws IOException {
OkHttpClient client;
if (ip == null)
client = dClient;
else
client = dClient.newBuilder()
.cookieJar(cookieJar)
.proxy(new Proxy(ip.getType(),new InetSocketAddress(ip.getIp(),ip.getPort())))
.connectTimeout(10, TimeUnit.SECONDS)
.build();
FormBody.Builder bodyBuilder= new FormBody.Builder();
if (params != null){
params.forEach((k,v) -> bodyBuilder.add(k,v));
}
RequestBody body = bodyBuilder.build();
Request.Builder builder = new Request.Builder().url(url).post(body);
if (headers != null && headers.size() > 0){
headers.forEach((k,v) -> builder.addHeader(k,v));
}
Request request = builder.build();
Response response = null;
try{
response = client.newCall(request).execute();
System.out.println(request.url() + " => get status code is " + response.code());
// cookieJar.loadForRequest(request.url()).forEach(c -> System.out.println(c.name() + " -> " + c.value()));
return response.isSuccessful() ? response.body().bytes() : null;
}finally {
if (response != null)
response.close();
}
}
public static byte[] doGetByte(String url,Map<String,String> headers) throws IOException {
Request.Builder rBuilder = new Request.Builder().url(url);
if (headers != null){
headers.forEach((k,v) -> rBuilder.addHeader(k,v));
}
Request request = rBuilder.build();
Response response = null;
try{
response = dClient.newCall(request).execute();
System.out.println(request.url() + " => get status code is " + response.code());
System.out.println( " => get size code is " + Integer.valueOf(response.header("Content-Length"))/1024);
return response.isSuccessful() ? response.body().bytes() : null;
}finally {
if (response != null)
response.close();
System.gc();
}
}
public static Map<String,Object> doGetBytes(String url,Map<String,String> headers) throws IOException {
Map<String,Object> result= new HashMap<>();
Request.Builder rBuilder = new Request.Builder().url(url);
if (headers != null){
headers.forEach((k,v) -> rBuilder.addHeader(k,v));
}
Request request = rBuilder.build();
Response response = null;
try{
response = dClient.newCall(request).execute();
System.out.println(request.url() + " => get status code is " + response.code());
if (response.isSuccessful()) {
ResponseBody body = response.body();
if (body != null) {
byte[] content=response.body().bytes();
result.put("content",content);
int size=Integer.valueOf(response.header("Content-Length"))/1024;
result.put("size",size);
}
}
return result;
}finally {
if (response != null)
response.close();
System.gc();
}
}
}

33
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/download/ProxyIp.java

@ -0,0 +1,33 @@
package com.bfd.mf.datasave.download;
import java.net.Proxy;
public class ProxyIp {
private static Proxy.Type type;
private static String ip;
private static int port;
public static Proxy.Type getType() {
return type;
}
public static void setType(Proxy.Type type) {
ProxyIp.type = type;
}
public static String getIp() {
return ip;
}
public static void setIp(String ip) {
ProxyIp.ip = ip;
}
public static int getPort() {
return port;
}
public static void setPort(int port) {
ProxyIp.port = port;
}
}

11
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/kafka/IKafka.java

@ -0,0 +1,11 @@
package com.bfd.mf.datasave.kafka;
import java.util.List;
public interface IKafka {
public void read();
public void read(String readTopicName);
public void read(String readTopicName, String groupId);
public void write(List<String> data, String writeTopicName);
public void stop();
}

117
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/kafka/ReadKafka.java

@ -0,0 +1,117 @@
package com.bfd.mf.datasave.kafka;
import com.bfd.crawler.kafka7.KfkConsumer;
import com.bfd.crawler.kafka7.KfkProducer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
public class ReadKafka implements IKafka{
private static Log LOG = LogFactory.getLog(ReadKafka.class);
private BlockingQueue<String> queue;
private String defaultReadTopicName;
private int threadNums;
private String groupId;
private int kafkaServerName ;
private int esSerName ;
public ReadKafka(BlockingQueue<String> queue,String topicName,int threadNums,String groupId,int kafkaServerName,int esSerName){
this.queue = queue;
this.defaultReadTopicName = topicName;
this.threadNums =threadNums;
this.groupId = groupId;
this.kafkaServerName = kafkaServerName ;
this.esSerName = esSerName ;
}
// public void read(){
// KfkConsumer.startReadThread(this.queue, this.defaultReadTopicName,this.threadNums,this.groupId,this.kafkaServerName);
// }
//
public void read(){
System.out.println(this.queue+"队列"+this.defaultReadTopicName+"topic"+this.threadNums+"group"+this.groupId+"sercer"+this.kafkaServerName);
//KfkConsumer.startReadThread(this.queue, this.defaultReadTopicName,this.threadNums,this.groupId,this.kafkaServerName);
KfkConsumer.startReadThread(this.queue, this.defaultReadTopicName,this.threadNums, this.groupId,this.kafkaServerName);
}
@Override
public void read(String readTopicName) {
KfkConsumer.startReadThread(this.queue, readTopicName,this.threadNums,this.groupId,this.kafkaServerName);
}
@Override
public void read(String readTopicName, String groupId) {
KfkConsumer.startReadThread(this.queue, readTopicName,this.threadNums,groupId,this.kafkaServerName);
}
@Override
public void write(List<String> data,String writeTopicName ) {
KfkProducer.getInstance(kafkaServerName,"").send(writeTopicName,data);
}
@Override
public void stop() {
LOG.info("ending:kfk consumer:stopping...");
KfkConsumer.stopKfkConsumerThreads();
LOG.info("ending:kfk consumer:closed");
}
// public static void main(String[] args) {
// test2();
// }
//
// public static void test2(){
// BlockingQueue<String> queue = new LinkedBlockingDeque<String>();
// String topicName = "Ejingdongdedup";
// int threadNums = 5;
// ReadKafka kfk = new ReadKafka(queue, topicName, threadNums,"bbs_group_test",1,1);
// kfk.read();
// while(true){
// if(queue.size()>0){
// try {
// System.out.println("kafka 读取结果 : "+queue.take());
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }else{
//// kfk.stop();
//// break;
// }
// }
//
// }
//
// public static void test1(){
//
//
//
// BlockingQueue<String> queue = new LinkedBlockingDeque<String>();
// String topicName = "test_hrn";
// int threadNums = 5;
// ReadKafka kfk = new ReadKafka(queue, topicName, threadNums,"test_group_2",1,1);
//// List<String> data = new ArrayList<String>();
//// for(int i=1000;i<1010;i++){
//// data.add("test_" + i);
//// }
//// kfk.write(data);
//
//
// kfk.read();
// while(true){
// if(queue.size()>0){
// try {
// System.out.println(queue.take());
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }else{
//// kfk.stop();
//// break;
// }
// }
//
// }
}

671
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/listen/DataSaveManager.java

@ -0,0 +1,671 @@
package com.bfd.mf.datasave.listen;
import com.alibaba.fastjson.JSONArray;
import com.bfd.crawler.elasti.ElastiProducer;
import com.bfd.crawler.kafka7.KfkProducer;
import com.bfd.crawler.kafka7.utils.PropertiesParser;
import com.bfd.crawler.utils.JsonUtils;
import com.bfd.mf.datasave.download.DownLoadFile;
import com.bfd.mf.datasave.tools.DateUtil;
import com.bfd.mf.datasave.tools.ReadLine;
import com.bfd.mf.datasave.tools.WriteMethod;
import com.bfd.mf.entity.AllKeys;
import com.bfd.mf.entity.FieldNormaliz;
import com.bfd.mf.entity.mysql.SubjectTask;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import scala.collection.generic.BitOperations;
//import org.apache.logging.log4j.core.parser.ParseException;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class DataSaveManager implements Runnable{
private static Logger log = Logger.getLogger(DataSaveManager.class);
private String data ;
private FieldNormaliz fieldNormaliz ;
private static Map<String, List<Map<String,String>>> subject;
private static Map<Integer,Map<String,String>> tableInfoMap;
private static String preIndex = "cl_index_";
private static String preSubject = "cl_subject_";
private static int subjectEsNum = 1;
private static int indexEsNum = 2;
private static String indexType = "docs";
private static int bussinessType = 1;
private static String kafkaTopic = "dataFromES_";
private static String myGoFastAddr = "http://172.18.1.113:8080/upload";
private static Map<String, Object> resultMap = AllKeys.getMap();
private static String filePath = "../datasaveputkafka_file/";//
public DataSaveManager(String data, FieldNormaliz fieldNormaliz){
this.data = data ;
this.fieldNormaliz = fieldNormaliz ;
}
public DataSaveManager(String data, FieldNormaliz fieldNormaliz,
Map<String, List<Map<String,String>>> subject,
Map<Integer,Map<String,String>> tableInfoMap){
this.data = data ;
this.fieldNormaliz = fieldNormaliz ;
this.subject = subject;
this.tableInfoMap = tableInfoMap;
}
public void excData(){
try{
int kafkaNum = fieldNormaliz.getKafkaSerName();
Map<String,Object> jsonData = JsonUtils.parseObject(data);
Map<String,String> tableInfo = tableInfoMap.get(bussinessType) ;
String res = convertData(jsonData, tableInfo);
Map<String, Object> resultMap = getResponse(res); // resultMap 就是将要写入到 ES kafka 的一条数据
System.out.println("The Message : "+JsonUtils.toJSONString(resultMap));
//System.out.println("The Message subject: "+JsonUtils.toJSONString(subject));
// 1先判断是主贴还是评论 主贴写日期索引回帖评论写 渠道索引
String dateIndexName = getIndexName(resultMap);
System.out.println(dateIndexName);
int index= Integer.parseInt(dateIndexName.split("cl_index_")[1].split("-")[0]);
if(resultMap.containsKey("primary") && resultMap.get("primary").toString().equals("0")) {
dateIndexName = preIndex + resultMap.get("docType").toString();
}
System.out.println("切割后的索引名字"+index);
//writerToKafka(2, "dataFromES_10000tw", resultMap);
// writerToSubjectES("cl_subject_10429", resultMap);
if (index>2015){
writerToIndexES(dateIndexName, resultMap);
}
//System.out.println("-----------------------继续后面的步骤哇--------------------: " + JsonUtils.toJSONString(resultMap));
// 2判断数据中是否要下载标识如果有需要先下载对应的文件然后替换存储路径后再保存数据
if(resultMap.containsKey("crawlDataFlag") && resultMap.containsKey("isDownload")) { //resultMap.containsKey("isDownload")
String key = getAllMapKey(resultMap);
//String getUrl = (String) resultMap.get("filePath");
List<String> filePathlist=new ArrayList<>();
List<String> imagePathlist=new ArrayList<>();
List<String> videoPathlist=new ArrayList<>();
List<String> filePath= (List<String>) resultMap.get("filePath");
List<String> imagePath= (List<String>) resultMap.get("imagePath");
List<String> videoPath= (List<String>) resultMap.get("videoPath");
// subject 中可以获取到这个key 对应的 专题信息
System.out.println("key == " + key + " **** " + JsonUtils.toJSONString(subject));
if(subject.containsKey(key)) {
List<Map<String, String>> subjectList = subject.get(key);
for (Map<String, String> subjectMap : subjectList) {
String go_fast_addr = subjectMap.get("go_fast_addr");
String subject_id = subjectMap.get("subject_id");
String isDownload = (String)resultMap.get("isDownload");
if (isDownload.equals("true")) {
String putUrl = myGoFastAddr;
if (!go_fast_addr.isEmpty()){
putUrl = go_fast_addr;
}
if (filePath.size()>0){
Iterator<String> it = filePath.iterator();
List<Map<String,String>> valueList = new ArrayList<>();
Map<String,String> filemap =new HashMap<>();
while(it.hasNext()){
String geturl= it.next();
Map<String,Object> resultmap = DownLoadFile.downloadAndSaveFile(geturl, putUrl);
String resulturl= (String) resultmap.get("realUrl");
String size= resultmap.get("size").toString()+"KB";
if (resulturl!= null && resulturl.length()!= 0){
filemap.put(resulturl,size);
filePathlist.add(resulturl);
}else {
System.out.print("很遗憾,怎么有下载失败了");
filePath.add(geturl);
filemap.put(geturl,size);
}
}
//valueList.add(filemap);
// if(videoPathlist.size()>0){
// resultMap.put("ugc",1);
// }
// else {
// resultMap.put("ugc",0);
// }
resultMap.put("filePathSize",JsonUtils.toJSONString(filemap));
resultMap.put("filePath", filePathlist);
}
if (imagePath.size()>0){
List<Map<String,String>> valueList = new ArrayList<>();
Map<String,String> imagemap =new HashMap<>();
Iterator<String> it = imagePath.iterator();
while(it.hasNext()){
String geturl= it.next();
Map<String,Object> resultmap = DownLoadFile.downloadAndSaveFile(geturl, putUrl);
String resulturl= (String) resultmap.get("realUrl");
String size= resultmap.get("size").toString()+"KB";
if (resulturl!= null && resulturl.length()!= 0){
imagemap.put(resulturl,size); //url +size
imagePathlist.add(resulturl);//url
}else{
System.out.print("很遗憾,怎么有下载失败了");
imagePath.add(geturl);
imagemap.put(geturl,size);
}
}
//valueList.add(imagemap);
// if(imagePath.size()>0){
// resultMap.put("pgc",1);
// }
// else {
// resultMap.put("pgc",0);
// }
resultMap.put("imagePathSize",JsonUtils.toJSONString(imagemap));
resultMap.put("imagePath", imagePathlist);
}
if (videoPath.size()>0){
List<Map<String,String>> valueList = new ArrayList<>();
Map<String,String> videomap =new HashMap<>();
Iterator<String> it = videoPath.iterator();
while(it.hasNext()){
String geturl= it.next();
System.out.println(putUrl+"putUrl是哪个啊");
Map<String,Object> resultmap = DownLoadFile.downloadAndSaveFile(geturl, putUrl);
String resulturl= (String) resultmap.get("realUrl");
String size= resultmap.get("size").toString()+"KB";
System.out.println("视频地址啊"+resulturl);
if (resulturl!= null && resulturl.length()!= 0){//判断 是否下载成功
videomap.put(geturl,size);
videoPathlist.add(resulturl);}else{
videoPathlist.add(geturl);
videomap.put(geturl,size);
}
}
//valueList.add(videomap);
if(videoPathlist.size()>0){
resultMap.put("egc",1);
}
else {
resultMap.put("egc",0);
}
resultMap.put("videoPathSize",JsonUtils.toJSONString(videomap));
resultMap.put("videoPath", videoPathlist);
}
}
String task_id = subjectMap.get("task_id");
String external_id = subjectMap.get("external_id");
resultMap.put("taskId", task_id);
resultMap.put("externalId", external_id);
String indexName = preSubject + subject_id;
// 数据写入到对应的专题索引中
writerToSubjectES(indexName, resultMap);
String kafka_addr = subjectMap.get("kafka_addr");
if (!kafka_addr.isEmpty()) {
// 数据写入到指定的kafka
kafkaTopic = kafkaTopic + "_" + subject_id;
//kafkaNum 指的是etc kafka 配置文件的编号
int num= checkPathExists(kafka_addr);
if (num>0){
System.out.print(num);
writerToKafka(num, "dataFromES_10000", resultMap);}
}
}
}
}else{
System.out.println(" 这条数据都没有标识位,就不往专题的索引存储了呗!!!!" + resultMap.get("dataId"));
}
}catch(Exception e){
e.printStackTrace();
log.error(data);
}
}
private static void writerToSubjectES(String indexName , Map<String, Object> responseMap) {
System.out.println("==========================写入到【专题】ES : ==========" + indexName + " - "+responseMap.get("docId") );
WriteMethod.writeMethod("zhuti.txt",JsonUtils.toJSONString(responseMap));
// System.out.println("==========================写入到【专题】ES : ==========" + indexName + " - "+responseMap.get("videoPath") );
ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, subjectEsNum, indexName, indexType);
elastiProducer.sendMessageToEs(JsonUtils.toJSONString(responseMap));
//System.out.println("==========================写入到【专题】ES : ==========" + indexName + " - "+JsonUtils.toJSONString(responseMap) );
}
private static void writerToIndexES(String indexName , Map<String, Object> responseMap) {
System.out.println("==========================写入到【日期】ES : ==========" + indexName + " - "+responseMap.get("docId"));
ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, indexEsNum, indexName, indexType);
elastiProducer.sendMessageToEs(JsonUtils.toJSONString(responseMap));
}
private static void writerToKafka(int kafkaNum,String indexName, String key, Map<String, Object> responseMap) {
try{
List<Map<String,String>> subjects = subject.get(key);
if(subjects.size() > 0) {
for (Map<String, String> sub : subjects) {
String subjectId = sub.get("subject_id");
String exportToKafka = sub.get("export_to_kafka");
String kafkaAddr = sub.get("kafka_addr");
//System.out.println("indexName : " + indexName + " ; subjectId : " + subjectId);
if (indexName.contains(subjectId) && exportToKafka.equals("1")) {
System.out.println("-----------------------------------------将数据写到对应的 kafka 中 : " + kafkaAddr);
//KfkProducer.getInstance().send("test0910", JsonUtils.toJSONString(responseMap));
}
}
}else{
System.out.println("空的????????" + key);
}
}catch (Exception e){
e.printStackTrace();
}
}
private static void writerToKafka(int kafkaNum,String kafkaTopic,Map<String, Object> responseMap) {
try{
System.out.println("要写的kafka : "+kafkaNum + " ; kafkaTopic: " + kafkaTopic);
KfkProducer.getInstance(kafkaNum, kafkaTopic).send(kafkaTopic, JsonUtils.toJSONString(responseMap));
}catch (Exception e){
e.printStackTrace();
}
}
private static String downloadAndChange(String indexName ,String key ,Map<String, Object> responseMap,String defaultgetUrl ) {
String newdefaultUrl="";
try{
// 判断数据是否有文件需要下载如果有需要下载的讲文件下载到对应的 gofast 地址中
if(null != responseMap && responseMap.containsKey("isDownload")){
String isDownload = (String)responseMap.get("isDownload");
if(isDownload.equals("true")){
// String getUrl = "https://www.bilibili.com/video/BV1gJ411L7aF?from=search&seid";
String getUrl = defaultgetUrl;
System.out.println("实际要下载的视频链接: "+getUrl);
List<Map<String,String>> subjects = subject.get(key);
for (Map<String,String> sub: subjects) {
String subjectId = sub.get("subject_id");
if(indexName.contains(subjectId)){
//String putUrl = sub.get("go_fast_addr");
System.out.println("gofast的地址是这个啊"+myGoFastAddr);
//newdefaultUrl = DownLoadFile.downloadAndSaveFile(getUrl,myGoFastAddr);
System.out.println("下载后的地址链接: "+newdefaultUrl);
//responseMap.put("videoUrl",resulturl);
// responseMap.put("filePath","http://172.26.11.110:8080/group1/default/20200904/09/58/5/VIUuOnpnGyE.mp4");
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
return newdefaultUrl;
}
private static String getAllMapKey(Map<String,Object> responseMap){
String key = null;
if(responseMap.containsKey("enSource")){
String enSource = (String) responseMap.get("enSource");
if(responseMap.containsKey("crawlDataFlag")) {
String crawlDataFlag = (String) responseMap.get("crawlDataFlag");
key = enSource+"#####"+crawlDataFlag;
}else{
System.out.println("数据没有标识???为什么呀?" + JsonUtils.toJSONString(responseMap));
}
}
return key.toLowerCase();
}
// private List<String> getIndexNameList(String key , Map<String,Object> responseMap) {
// List<String> indexNames = new ArrayList<>();
// try{
// System.out.println( key + " ; task_subject: "+JsonUtils.toJSONString(subject));
// if(subject.containsKey(key)){
// List<Map<String,String>> values = subject.get(key);
// for (Map<String,String> val: values) {
// String subjectId = val.get("subject_id");
// String taskId = val.get("task_id");
// String externalId = val.get("external_id");
// System.out.println(taskId + " -- " + externalId);
// System.out.println(externalId);
// indexNames.add(preSubject + subjectId);
// }
// }else{
// //System.out.println("3333 : " + JsonUtils.toJSONString(responseMap));
// System.out.println("这条数据不用写到 【专题】 索引中哦!!! " +
// "crawlDataFlag = " +responseMap.get("crawlDataFlag") + " ; " +
// "id = " + responseMap.get("dataId") + " ; " +
// "pubTime = " + responseMap.get("pubTimeStr"));
// }
//
//// }else{
//// System.out.println("33333 "+responseMap);
//// }
//
//// for (Map.Entry<String, String> entry : subject.entrySet()) {
//// System.out.println("subject : key= " + entry.getKey() + " and value= " + entry.getValue());
//// }
//// for (Map.Entry<String, String> entry : downloadAddr.entrySet()) {
//// System.out.println("download : key= " + entry.getKey() + " and value= " + entry.getValue());
//// }
//// for (Map.Entry<String, String> entry : kafkaAddr.entrySet()) {
//// System.out.println("kafka: key= " + entry.getKey() + " and value= " + entry.getValue());
//// }
// }catch (Exception e){
// e.printStackTrace();
// }
// return indexNames;
// }
// private static String getIndexName(Map<String,Object> responseMap) {
// String pubTimeStr = responseMap.get("pubTimeStr").toString().split(" ")[0];
// String indexName = preIndex+pubTimeStr;
// return indexName;
// }
private static String getIndexName(Map<String,Object> responseMap) {
String pubTimeStr= null;
try {
//System.out.print(responseMap);
//System.out.print(responseMap.get("pubTimeStr").toString()+"pubTimeStr是啦啦啦");
pubTimeStr = getDayString( responseMap.get("pubTimeStr").toString());
} catch (ParseException e) {
e.printStackTrace();
}
String indexName = preIndex+pubTimeStr;
return indexName;
}
private static Map<String, Object> getResponse(String dataNew) throws Exception {
Map<String,Object> responseMap = new HashMap<>(resultMap);
try {
Map<String, Object> dataMap = JsonUtils.parseObject(dataNew);
for (Map.Entry<String, Object> entry : dataMap.entrySet()) {
if (resultMap.containsKey(entry.getKey())) {
responseMap.put(entry.getKey(), entry.getValue());
}
}
return responseMap;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
// public static void main(String[] args) {
// String getUrl = "https://wx1.sinaimg.cn/mw1024/89c644a5ly8fnskt9bm5gj20ro0rogls.jpg";
// String putUrl = "http://172.26.11.110:8080/upload";
// String url = DownLoadFile.downloadAndSaveFile(getUrl,putUrl);
// System.out.println(url);
// }
// public static void main(String[] args) {
// int bussinessType = 1;
// int esServerName = 2;
// String indexType = "docs";
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// Date dBegin = null;
// try {
// dBegin = sdf.parse("2020-08-11");
// Date dEnd = sdf.parse("2020-08-12");
// List < Date > lDate = findDates(dBegin, dEnd);
// for (Date d:lDate) {
//// String indexName = "cl_index_"+ sdf.format(d);
// String indexName = "cl_index_news";
//// String indexName = "cl_index_yilong_comment";
//// String indexName = "cl_subject_10277";
// System.out.println(indexName);
// ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, esServerName, indexName, indexType);
// System.out.println(elastiProducer);
// }
//// ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, esServerName, indexName, indexType);
//// System.out.println(esServerName+"#"+indexName+" : "+ JsonUtils.toJSONString(elastiProducer));
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
private static String convertData(Map<String,Object> jsonData, Map<String,String> tableInfo){
try{
Map<String,Object> jsonDatanew = new HashMap<String,Object>(jsonData);
for(Map.Entry<String, Object> entry : jsonDatanew.entrySet()){
String key = entry.getKey() ;
Object dataValue = entry.getValue();
if(key.equals("content") && dataValue != null){
String content = dataValue.toString().replaceAll("[^\\u0000-\\uFFFF]", "") ;
jsonData.put(key, content);
}
if(key.equals("title") && dataValue != null){
String title = dataValue.toString().replaceAll("[^\\u0000-\\uFFFF]", "") ;
jsonData.put(key, title);
}
if(key.equals("author") && dataValue != null){
String author = dataValue.toString().replaceAll("[^\\u0000-\\uFFFF]", "") ;
jsonData.put(key, author);
}
// if(key.equals("videoPath") && dataValue != null){
// List<String> list=new ArrayList<>();
// list.add(dataValue.toString());
// jsonData.put(key,list);
// }
// if(key.equals("imagePath")&&dataValue != null){
// List<String> list=new ArrayList<>();
// list.add(dataValue.toString());
// jsonData.put(key,list);
// }
// if(key.equals("filePath") && dataValue != null){
// List<String> list=new ArrayList<>();
// list.add(dataValue.toString());
// jsonData.put(key,list);
// }
if(tableInfo.containsKey(key)){
System.out.print("tableInfo"+tableInfo);
String value = tableInfo.get(key);
if(value.equals("Integer")){
if(StringUtils.isNotBlank(dataValue.toString())){
String dataValuenew = dataValue.toString();
if(dataValuenew.contains(",")){
dataValuenew = dataValuenew.replace(",", "");
jsonData.put(key, Integer.valueOf(dataValuenew)) ;
}else if(dataValuenew.contains("顶")){
dataValuenew = "0";
jsonData.put(key, Integer.valueOf(dataValuenew)) ;
}else if(dataValuenew.endsWith("万")){
dataValuenew = dataValuenew.substring(0, dataValuenew.indexOf("万"));
jsonData.put(key, new Double(Double.valueOf(dataValuenew) * 10000).intValue()) ;
}else if(dataValuenew.endsWith("万+")){
dataValuenew = dataValuenew.substring(0,dataValuenew.indexOf("万+")) ;
jsonData.put(key, new Double(Double.valueOf(dataValuenew) * 10000).intValue()) ;
}else{
try{
if(dataValue.toString().contains("全部评论")){
dataValue = dataValue.toString().replace("全部评论 (","").replace(")","");
}
jsonData.put(key, Integer.valueOf(dataValue.toString())) ;
}catch(Exception e){
System.out.println("ERROR key " + key + "; value " + dataValue.toString());
jsonData.put(key, 0) ;
e.printStackTrace();
log.error("parse data IntFormat err value:"+dataValue);
}
}
}else{
jsonData.put(key, 0) ;
}
}else if(value.equals("List")){
if(StringUtils.isNotBlank(dataValue.toString())){
jsonData.put(key, JSONArray.parseArray(dataValue.toString())) ;
} else{
jsonData.put(key, new ArrayList<String>()) ;
}
}else if(value.equals("Long")){
if(StringUtils.isNotBlank(dataValue.toString())){
try{
Long theValue = 0L;
if(dataValue.toString().contains("万+")){
Double dou = Double.valueOf(dataValue.toString().replace("万+",""));
theValue =new Double(dou * 10000).longValue(); ;
jsonData.put(key,theValue) ;
}else{
jsonData.put(key,Long.valueOf(dataValue.toString())) ;
}
}catch(Exception e){
jsonData.put(key, 0) ;
e.printStackTrace();
log.error("parse data LongFormat err value:"+dataValue);
}
}else{
jsonData.put(key, 0) ;
}
}
}
}
return JsonUtils.toJSONString(jsonData) ;
}catch(Exception e){
e.printStackTrace();
log.error("parse data NumberFormat err :"+jsonData);
}
return null ;
}
public static Pattern datePattrn = Pattern.compile("^\\d{4}\\-\\d{2}\\-\\d{2}\\s\\d{2}\\:\\d{2}:\\d{2}$");
// private String getDayString(String indexName){
// Matcher matcher = datePattrn.matcher(indexName);
// String result = "";
// if(matcher.find()){
// if(StringUtils.isBlank(indexName)){
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// return sdf.format(new Date());
// }
// }else{
// result = DateUtil.getDate();
// return result;
// }
// result = indexName.trim().split("\\s+")[0];
// return result;
// }
private static String getDayString(String indexName) throws ParseException {
Matcher matcher = datePattrn.matcher(indexName);
String result = "";
if(matcher.find()){
if(StringUtils.isBlank(indexName)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(new Date());
}
}else{
result = DateUtil.getDate();
return result;
}
result = indexName.trim().split("\\s+")[0];
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
boolean checkResult = check(result);
if(!checkResult) {
return format1.format(new Date());
}
try {
Long date = format1.parse(result).getTime();
Long date1 = new Date().getTime();
if (date > date1) {
return format1.format(new Date());
}
} catch (ParseException e) {
e.printStackTrace();
}
return result;
}
public static boolean check (String str) {
// SimpleDateFormat sd=new SimpleDateFormat("yyyy-MM-dd");//括号内为日期格式y代表年份M代表年份中的月份为避免与小时中的分钟数m冲突此处用Md代表月份中的天数
// try {
// sd.setLenient(false);//此处指定日期/时间解析是否不严格在true是不严格false时为严格
// sd.parse(str); //从给定字符串的开始解析文本以生成一个日期
// }
// catch (Exception e) {
// return false;
// }
// return true;
SimpleDateFormat sd=new SimpleDateFormat("yyyy-MM-dd");//括号内为日期格式y代表年份M代表年份中的月份为避免与小时中的分钟数m冲突此处用Md代表月份中的天数
try {
sd.setLenient(false);//此处指定日期/时间解析是否不严格在true是不严格false时为严格
sd.parse(str);//从给定字符串的开始解析文本以生成一个日期
}
catch (Exception e) {
return false;
}
return true;
}
@Override
public void run() {
excData();
}
public List <Date> findDates(Date dBegin, Date dEnd) {
List lDate = new ArrayList();
lDate.add(dBegin);
Calendar calBegin = Calendar.getInstance();
// 使用给定的 Date 设置此 Calendar 的时间
calBegin.setTime(dBegin);
Calendar calEnd = Calendar.getInstance();
// 使用给定的 Date 设置此 Calendar 的时间
calEnd.setTime(dEnd);
// 测试此日期是否在指定日期之后
while (dEnd.after(calBegin.getTime())) {
// 根据日历的规则为给定的日历字段添加或减去指定的时间量
calBegin.add(Calendar.DAY_OF_MONTH, 1);
lDate.add(calBegin.getTime());
}
return lDate;
}
public static int checkPathExists(String kafka_addr){//检查文件夹是否存在kafka的配置文件
int num = 0;
String filename="";
if (kafka_addr.equals("172.18.1.119:9992")){
num=1;
}else if(kafka_addr.equals("172.18.1.178:9092,172.18.1.181:9092,172.18.1.182:9092")) {
num=2;
}else if(kafka_addr.equals("172.26.11.123:9092")) {
num=3;
}else if(kafka_addr.equals("50.19.49.16:9092")) {
num=4;
}else if(kafka_addr.equals("172.18.1.113:9092")) {
num=5;
}else {
if (kafka_addr.contains(",")){
filename=kafka_addr.split(",")[0];
}
filename=filename.split(":")[0];
System.out.print(filename+"kafka_adds是");
String filepath="../etc/"+filename+".properties";
File file = new File(filepath);
List<String> properties = ReadLine.readLine(new File("../etc/1_kafka.properties"));
if (!file.exists()) {
WriteMethod.writeMethod(filepath,"crawl.kfk.metadata.broker.list="+kafka_addr);
for(int i=1;i<properties.size();i++){
System.out.print(filepath);
WriteMethod.writeMethod(filepath,properties.get(i));
}
}
num = Integer.parseInt(filename);
}
return num;
}
}

424
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/listen/DataSaveManager_kongtianyuan.java

@ -0,0 +1,424 @@
//package com.bfd.mf.datasave.listen;
//
//import com.alibaba.fastjson.JSONArray;
//import com.bfd.crawler.elasti.ElastiProducer;
//import com.bfd.crawler.kafka7.KfkProducer;
//import com.bfd.crawler.utils.JsonUtils;
//import com.bfd.mf.datasave.download.DownLoadFile;
//import com.bfd.mf.datasave.tools.DateUtil;
//import com.bfd.mf.entity.AllKeys;
//import com.bfd.mf.entity.FieldNormaliz;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.log4j.Logger;
//
//import java.text.SimpleDateFormat;
//import java.util.*;
//import java.util.regex.Matcher;
//import java.util.regex.Pattern;
//
//public class DataSaveManager_kongtianyuan implements Runnable{
//
// private static Logger log = Logger.getLogger(DataSaveManager_kongtianyuan.class);
// private String data ;
// private FieldNormaliz fieldNormaliz ;
// private static Map<String, List<Map<String,String>>> subject;
// private static Map<Integer,Map<String,String>> tableInfoMap;
// private static String preIndex = "cl_index_";
// private static String preSubject = "cl_subject_";
// private static int subjectEsNum = 1;
// private static int indexEsNum = 2;
// private static String indexType = "docs";
// private static int bussinessType = 1;
// private static String kafkaTopic = "newsTopic_fromES";
// private static Map<String, Object> resultMap = AllKeys.getMap();
//
// public DataSaveManager_kongtianyuan(String data, FieldNormaliz fieldNormaliz){
// this.data = data ;
// this.fieldNormaliz = fieldNormaliz ;
// }
//
//
// public DataSaveManager_kongtianyuan(String data, FieldNormaliz fieldNormaliz,
// Map<String, List<Map<String,String>>> subject,
// Map<Integer,Map<String,String>> tableInfoMap){
// this.data = data ;
// this.fieldNormaliz = fieldNormaliz ;
// this.subject = subject;
// this.tableInfoMap = tableInfoMap;
// }
//
//
// public void excData(){
// try{
// int kafkaNum = fieldNormaliz.getKafkaSerName();
// Map<String,Object> jsonData = JsonUtils.parseObject(data);
// Map<String,String> tableInfo = tableInfoMap.get(bussinessType) ;
// String res = convertData(jsonData, tableInfo);
// Map<String, Object> resultMap = getResponse(res);
//// System.out.println("resultMap : " + JsonUtils.toJSONString(resultMap));
// // 直接先将数据写入到日期索引的ES中
// String dateIndexName = getIndexName(resultMap);
// if(resultMap.containsKey("primary") && resultMap.get("primary").toString().equals("0")) {
// dateIndexName = preIndex + resultMap.get("docType").toString();
// }
// writerToKafka(kafkaNum,kafkaTopic,resultMap);
// // writerToIndexES(dateIndexName, resultMap);
//
//// if(responseMap.containsKey("crawlDataFlag")){
//// // 需要根据这个标识位知道要添加的 ID 要写入的ES
//// String key = getAllMapKey(responseMap);
//// //List<String> indexNames = getIndexNameList(key,responseMap);
//// WriterToSubjectES("",responseMap);
//// }
//// System.out.println("4444 : " + JsonUtils.toJSONString(responseMap));
//// WriterToIndexES(dateIndexName, responseMap);
// // 判断数据要写入到哪个索引然后讲数据写入到对应的索引中
//// if(null != responseMap && responseMap.containsKey("source")) {
//// //key = twitter#####account:https://twitter.com/spokespersonchn &&& 索引名称是 cl_subject_10337 &&& 数据标识keyword:folklore
//// String key = getAllMapKey(responseMap);
//// System.out.println(" ============== key = " + key + "; crawlDataFlag = " + responseMap.get("crawlDataFlag"));
//// // subject 中可以根据 key get 数据 要不要写 kafka,kafka的地址,文件要不要下载文件输出的go-fast地址
//// List<String> indexNames = getIndexNameList(key,responseMap);
//// System.out.println("indexNames size = "+indexNames.size());
//// for(String in: indexNames){
//// System.out.println("key = " + key +" &&& 索引名称是: " + in + " &&& 数据标识:" + responseMap.get("crawlDataFlag"));
//// if(key.contains(responseMap.get("crawlDataFlag").toString().toLowerCase())) {
//// // 根据 key 索引名 subject 中查看数据要下载文件的gofast地址
//// responseMap = downloadAndChange(in, key, responseMap);
//// // 根据 key 索引名 subject 中查看数据是否要导出到kafka,写到 kafka 中的数据得是替换文件地址后的数据
//// writerToKafka(in, key, responseMap);
//// // 讲数据写入到对应索引的ES
//// WriterToSubjectES(in, responseMap);
//// }else{
//// System.out.println("对应关系错了!!!! key = " + key +" ;&&& 数据标识:" + responseMap.get("crawlDataFlag"));
//// }
//// }
//// }
// }catch(Exception e){
// e.printStackTrace();
// log.error(data);
// }
// }
//
// private static void writerToSubjectES(String indexName , Map<String, Object> responseMap) {
// System.out.println("==========================写入到【专题】ES : ==========" + indexName + " - "+responseMap.get("docId"));
//// ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, subjectEsNum, indexName, indexType);
//// elastiProducer.sendMessageToEs(JsonUtils.toJSONString(responseMap));
//
// }
//
// private static void writerToIndexES(String indexName , Map<String, Object> responseMap) {
// System.out.println("==========================写入到【日期】ES : ==========" + indexName + " - "+responseMap.get("docId"));
// ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, indexEsNum, indexName, indexType);
// elastiProducer.sendMessageToEs(JsonUtils.toJSONString(responseMap));
//
// }
//
// private static void writerToKafka(int kafkaNum,String indexName, String key, Map<String, Object> responseMap) {
// try{
// List<Map<String,String>> subjects = subject.get(key);
// if(subjects.size() > 0) {
// for (Map<String, String> sub : subjects) {
// String subjectId = sub.get("subject_id");
// String exportToKafka = sub.get("export_to_kafka");
// String kafkaAddr = sub.get("kafka_addr");
// //System.out.println("indexName : " + indexName + " ; subjectId : " + subjectId);
// if (indexName.contains(subjectId) && exportToKafka.equals("1")) {
// System.out.println("-----------------------------------------将数据写到对应的 kafka 中 : " + kafkaAddr);
// //KfkProducer.getInstance().send("test0910", JsonUtils.toJSONString(responseMap));
// }
// }
// }else{
// System.out.println("空的????????" + key);
// }
//
// }catch (Exception e){
// e.printStackTrace();
// }
// }
//
// private static void writerToKafka(int kafkaNum,String kafkaTopic,Map<String, Object> responseMap) {
// try{
// System.out.println("要写的kafka : "+kafkaNum + " ; kafkaTopic: " + kafkaTopic);
// KfkProducer.getInstance(kafkaNum, kafkaTopic).send(kafkaTopic, JsonUtils.toJSONString(responseMap));
// }catch (Exception e){
// e.printStackTrace();
// }
// }
//
// private static Map<String,Object> downloadAndChange(String indexName ,String key ,Map<String, Object> responseMap) {
// try{
// // 判断数据是否有文件需要下载如果有需要下载的讲文件下载到对应的 gofast 地址中
// if(null != responseMap && responseMap.containsKey("isDownload")){
// String isDownload = (String)responseMap.get("isDownload");
// if(isDownload.equals("true")){
//// String getUrl = "https://wx1.sinaimg.cn/mw1024/89c644a5ly8fnskt9bm5gj20ro0rogls.jpg";
// String getUrl = (String) responseMap.get("videoUrl");
//// System.out.println("实际要下载的视频链接: "+getUrl1);
// List<Map<String,String>> subjects = subject.get(key);
// for (Map<String,String> sub: subjects) {
// String subjectId = sub.get("subject_id");
// if(indexName.contains(subjectId)){
// String putUrl = sub.get("go_fast_addr");
// String resulturl = DownLoadFile.downloadAndSaveFile(getUrl,putUrl);
//// System.out.println("下载后的地址链接: "+resulturl);
// responseMap.put("videoUrl",resulturl);
//// responseMap.put("filePath","http://172.26.11.110:8080/group1/default/20200904/09/58/5/VIUuOnpnGyE.mp4");
// }
// }
// }
// }
// }catch (Exception e){
// e.printStackTrace();
// }
// return responseMap;
// }
//
// private static String getAllMapKey(Map<String,Object> responseMap){
// String key = null;
// if(responseMap.containsKey("enSource")){
// String enSource = (String) responseMap.get("enSource");
// if(responseMap.containsKey("crawlDataFlag")) {
// String crawlDataFlag = (String) responseMap.get("crawlDataFlag");
// key = enSource+"#####"+crawlDataFlag;
// }else{
// System.out.println("数据没有标识???为什么呀?" + JsonUtils.toJSONString(responseMap));
// }
// }
// return key;
// }
//
//// private List<String> getIndexNameList(String key , Map<String,Object> responseMap) {
//// List<String> indexNames = new ArrayList<>();
//// try{
//// System.out.println( key + " ; task_subject: "+JsonUtils.toJSONString(subject));
//// if(subject.containsKey(key)){
//// List<Map<String,String>> values = subject.get(key);
//// for (Map<String,String> val: values) {
//// String subjectId = val.get("subject_id");
//// String taskId = val.get("task_id");
//// String externalId = val.get("external_id");
//// System.out.println(taskId + " -- " + externalId);
//// System.out.println(externalId);
//// indexNames.add(preSubject + subjectId);
//// }
//// }else{
//// //System.out.println("3333 : " + JsonUtils.toJSONString(responseMap));
//// System.out.println("这条数据不用写到 【专题】 索引中哦!!! " +
//// "crawlDataFlag = " +responseMap.get("crawlDataFlag") + " ; " +
//// "id = " + responseMap.get("dataId") + " ; " +
//// "pubTime = " + responseMap.get("pubTimeStr"));
//// }
////
////// }else{
////// System.out.println("33333 "+responseMap);
////// }
////
////// for (Map.Entry<String, String> entry : subject.entrySet()) {
////// System.out.println("subject : key= " + entry.getKey() + " and value= " + entry.getValue());
////// }
////// for (Map.Entry<String, String> entry : downloadAddr.entrySet()) {
////// System.out.println("download : key= " + entry.getKey() + " and value= " + entry.getValue());
////// }
////// for (Map.Entry<String, String> entry : kafkaAddr.entrySet()) {
////// System.out.println("kafka: key= " + entry.getKey() + " and value= " + entry.getValue());
////// }
//// }catch (Exception e){
//// e.printStackTrace();
//// }
//// return indexNames;
//// }
//
// private static String getIndexName(Map<String,Object> responseMap) {
// String pubTimeStr = responseMap.get("pubTimeStr").toString().split(" ")[0];
// String indexName = preIndex+pubTimeStr;
// return indexName;
// }
//
// private static Map<String, Object> getResponse(String dataNew) throws Exception {
// Map<String,Object> responseMap = new HashMap<>(resultMap);
// try {
// Map<String, Object> dataMap = JsonUtils.parseObject(dataNew);
// for (Map.Entry<String, Object> entry : dataMap.entrySet()) {
// if (resultMap.containsKey(entry.getKey())) {
// responseMap.put(entry.getKey(), entry.getValue());
// }
// }
// return responseMap;
// }catch (Exception e){
// e.printStackTrace();
// return null;
// }
// }
//
//// public static void main(String[] args) {
//// String getUrl = "https://wx1.sinaimg.cn/mw1024/89c644a5ly8fnskt9bm5gj20ro0rogls.jpg";
//// String putUrl = "http://172.26.11.110:8080/upload";
//// String url = DownLoadFile.downloadAndSaveFile(getUrl,putUrl);
//// System.out.println(url);
//// }
//
//// public static void main(String[] args) {
//// int bussinessType = 1;
//// int esServerName = 2;
//// String indexType = "docs";
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date dBegin = null;
//// try {
//// dBegin = sdf.parse("2020-08-11");
//// Date dEnd = sdf.parse("2020-08-12");
//// List < Date > lDate = findDates(dBegin, dEnd);
//// for (Date d:lDate) {
////// String indexName = "cl_index_"+ sdf.format(d);
//// String indexName = "cl_index_news";
////// String indexName = "cl_index_yilong_comment";
////// String indexName = "cl_subject_10277";
//// System.out.println(indexName);
//// ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, esServerName, indexName, indexType);
//// System.out.println(elastiProducer);
//// }
////// ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, esServerName, indexName, indexType);
////// System.out.println(esServerName+"#"+indexName+" : "+ JsonUtils.toJSONString(elastiProducer));
//// } catch (Exception e) {
//// e.printStackTrace();
//// }
//// }
//
//
// private static String convertData(Map<String,Object> jsonData, Map<String,String> tableInfo){
// try{
// Map<String,Object> jsonDatanew = new HashMap<String,Object>(jsonData);
// for(Map.Entry<String, Object> entry : jsonDatanew.entrySet()){
// String key = entry.getKey() ;
// Object dataValue = entry.getValue();
// if(key.equals("content") && dataValue != null){
// String content = dataValue.toString().replaceAll("[^\\u0000-\\uFFFF]", "") ;
// jsonData.put(key, content);
// }
// if(key.equals("title") && dataValue != null){
// String title = dataValue.toString().replaceAll("[^\\u0000-\\uFFFF]", "") ;
// jsonData.put(key, title);
// }
// if(key.equals("author") && dataValue != null){
// String author = dataValue.toString().replaceAll("[^\\u0000-\\uFFFF]", "") ;
// jsonData.put(key, author);
// }
// if(tableInfo.containsKey(key)){
// String value = tableInfo.get(key);
// if(value.equals("Integer")){
// if(StringUtils.isNotBlank(dataValue.toString())){
// String dataValuenew = dataValue.toString();
// if(dataValuenew.contains(",")){
// dataValuenew = dataValuenew.replace(",", "");
// jsonData.put(key, Integer.valueOf(dataValuenew)) ;
// }else if(dataValuenew.contains("顶")){
// dataValuenew = "0";
// jsonData.put(key, Integer.valueOf(dataValuenew)) ;
// }else if(dataValuenew.endsWith("万")){
// dataValuenew = dataValuenew.substring(0, dataValuenew.indexOf("万"));
// jsonData.put(key, new Double(Double.valueOf(dataValuenew) * 10000).intValue()) ;
// }else if(dataValuenew.endsWith("万+")){
// dataValuenew = dataValuenew.substring(0,dataValuenew.indexOf("万+")) ;
// jsonData.put(key, new Double(Double.valueOf(dataValuenew) * 10000).intValue()) ;
// }else{
// try{
// if(dataValue.toString().contains("全部评论")){
// dataValue = dataValue.toString().replace("全部评论 (","").replace(")","");
// }
// jsonData.put(key, Integer.valueOf(dataValue.toString())) ;
// }catch(Exception e){
// System.out.println("ERROR key " + key + "; value " + dataValue.toString());
// jsonData.put(key, 0) ;
// e.printStackTrace();
// log.error("parse data IntFormat err value:"+dataValue);
// }
// }
// }else{
// jsonData.put(key, 0) ;
// }
//
// }else if(value.equals("List")){
// if(StringUtils.isNotBlank(dataValue.toString())){
// jsonData.put(key, JSONArray.parseArray(dataValue.toString())) ;
// } else{
// jsonData.put(key, new ArrayList<String>()) ;
// }
// }else if(value.equals("Long")){
// if(StringUtils.isNotBlank(dataValue.toString())){
// try{
// jsonData.put(key, Long.valueOf(dataValue.toString())) ;
// }catch(Exception e){
// jsonData.put(key, 0) ;
// e.printStackTrace();
// log.error("parse data LongFormat err value:"+dataValue);
// }
// }else{
// jsonData.put(key, 0) ;
// }
// }
// }
// }
// return JsonUtils.toJSONString(jsonData) ;
// }catch(Exception e){
// e.printStackTrace();
// log.error("parse data NumberFormat err :"+jsonData);
// }
// return null ;
// }
//
// public static Pattern datePattrn = Pattern.compile("^\\d{4}\\-\\d{2}\\-\\d{2}\\s\\d{2}\\:\\d{2}:\\d{2}$");
//
// private String getDayString(String indexName){
// Matcher matcher = datePattrn.matcher(indexName);
// String result = "";
// if(matcher.find()){
// if(StringUtils.isBlank(indexName)){
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// return sdf.format(new Date());
// }
// }else{
// result = DateUtil.getDate();
// return result;
// }
// result = indexName.trim().split("\\s+")[0];
// return result;
// }
//
// public boolean check (String str) {
// SimpleDateFormat sd=new SimpleDateFormat("yyyy-MM-dd");//括号内为日期格式y代表年份M代表年份中的月份为避免与小时中的分钟数m冲突此处用Md代表月份中的天数
// try {
// sd.setLenient(false);//此处指定日期/时间解析是否不严格在true是不严格false时为严格
// sd.parse(str); //从给定字符串的开始解析文本以生成一个日期
// }
// catch (Exception e) {
// return false;
// }
// return true;
// }
//
//
// @Override
// public void run() {
// excData();
// }
//
// public List <Date> findDates(Date dBegin, Date dEnd) {
// List lDate = new ArrayList();
// lDate.add(dBegin);
// Calendar calBegin = Calendar.getInstance();
// // 使用给定的 Date 设置此 Calendar 的时间
// calBegin.setTime(dBegin);
// Calendar calEnd = Calendar.getInstance();
// // 使用给定的 Date 设置此 Calendar 的时间
// calEnd.setTime(dEnd);
// // 测试此日期是否在指定日期之后
// while (dEnd.after(calBegin.getTime())) {
// // 根据日历的规则为给定的日历字段添加或减去指定的时间量
// calBegin.add(Calendar.DAY_OF_MONTH, 1);
// lDate.add(calBegin.getTime());
// }
// return lDate;
// }
//
//
//}

77
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/listen/ListenKafkaManager.java

@ -0,0 +1,77 @@
package com.bfd.mf.datasave.listen;
import com.bfd.crawler.kafka7.KfkConsumer;
import com.bfd.mf.datasave.kafka.ReadKafka;
import com.bfd.mf.datasave.tools.DateUtil;
import com.bfd.mf.entity.FieldNormaliz;
import com.bfd.mf.entity.mysql.FiledTableInfo;
import com.bfd.mf.entity.mysql.SubjectTask;
import java.util.List;
import java.util.Map;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class ListenKafkaManager implements Runnable{
private LinkedBlockingDeque<String> queue= new LinkedBlockingDeque<String>(5000);
private boolean isRun = true;
private FieldNormaliz fieldNormaliz;
private ThreadPoolExecutor spiderPoolExec ;
private Map<String, List<Map<String,String>>> subject;
private Map<Integer,Map<String,String>> tableInfoMap;
public ListenKafkaManager(FieldNormaliz fieldNormaliz){
int croePoolsize = 20 ;
int maximumPoolsize = 60;
long keepAliveTime = 0;
this.spiderPoolExec = new ThreadPoolExecutor(croePoolsize, maximumPoolsize, keepAliveTime, TimeUnit.SECONDS, new SynchronousQueue<Runnable>());
this.fieldNormaliz = fieldNormaliz ;
this.subject = SubjectTask.subjectTaskMap;
this.tableInfoMap = FiledTableInfo.tableInfoMap;
String kafkaname = fieldNormaliz.getKafkaName() ;
// KfkConsumer.startReadThread(queue,"Ejingdongdedup_filter1",10,"333",2);
ReadKafka readKafka = new ReadKafka(queue , kafkaname ,10 , fieldNormaliz.getGroupId(), fieldNormaliz.getKafkaSerName(),fieldNormaliz.getEsSerName());
readKafka.read();
}
@Override
public void run() {
while(isRun){
if(this.queue.size() < 1){
DateUtil.sleep(1);
continue;
}
String data = this.queue.poll();
if(data == null) continue ;
if (data.equals("__Exit__")) break ;
this.addTask(data);
}
}
private void addTask(String data){
while ( spiderPoolExec.getPoolSize() >= spiderPoolExec.getMaximumPoolSize() ||
spiderPoolExec.getActiveCount() >= spiderPoolExec.getMaximumPoolSize()) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
//spiderPoolExec.submit(new DataSaveManager(data, fieldNormaliz));
//spiderPoolExec.submit(new DataSaveManager_kongtianyuan(data, fieldNormaliz,subject,tableInfoMap));
spiderPoolExec.submit(new DataSaveManager(data, fieldNormaliz,subject,tableInfoMap));
}
public void setSwitch(boolean flag){
this.isRun = flag ;
}
public LinkedBlockingDeque<String> getQueue(){
return queue ;
}
}

30
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/listen/ListenTaskManager.java

@ -0,0 +1,30 @@
package com.bfd.mf.datasave.listen;
import com.bfd.mf.entity.FieldNormaliz;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
public class ListenTaskManager {
private static Set<String> listenkafkaTopicThreadObj = new TreeSet<String>();
public static Map<String,ListenKafkaManager> listenKafkaManagers = new HashMap<String,ListenKafkaManager>();
public static void addKafkaTopicListen(FieldNormaliz fieldNormaliz){
String kafkaTopicName = fieldNormaliz.getKafkaName() ;
int kafkaServerName = fieldNormaliz.getKafkaSerName() ;
if (!listenkafkaTopicThreadObj.contains(kafkaServerName+"#"+kafkaTopicName)) {
listenkafkaTopicThreadObj.add(kafkaServerName+"#"+kafkaTopicName);
ListenKafkaManager listenKafkaManager = new ListenKafkaManager(fieldNormaliz);
new Thread(listenKafkaManager).start();
listenKafkaManagers.put(kafkaServerName+"#"+kafkaTopicName, listenKafkaManager);
}
}
}

226
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/DBConnectionManager.java

@ -0,0 +1,226 @@
package com.bfd.mf.datasave.tools;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.*;
public class DBConnectionManager {
private static DBConnectionManager m_dbInstance;
private static int m_ClientNum;
@SuppressWarnings("rawtypes")
private Vector drivers = new Vector();
@SuppressWarnings("rawtypes")
private Hashtable pools = new Hashtable();
public int nCount;
public int iConID;
public static synchronized DBConnectionManager getInstance(String name) {
if (m_dbInstance == null)
m_dbInstance = new DBConnectionManager(name);
m_ClientNum++;
return m_dbInstance;
}
private DBConnectionManager(String name) {
init(name);
}
public void freeConnection(String name, Connection con) {
DBConnectionPool pool = (DBConnectionPool) pools.get(name);
if (pool != null) {
pool.freeConnection(con);
}
}
public Connection getConnection(String name) {
DBConnectionPool pool = (DBConnectionPool) pools.get(name);
if (pool != null)
return pool.getConnection();
return null;
}
public Connection getConnection(String name, long time) {
DBConnectionPool pool = (DBConnectionPool) pools.get(name);
if (pool != null) {
return pool.getConnection(time);
}
return null;
}
@SuppressWarnings("rawtypes")
public void release() {
if (--m_ClientNum != 0)
return;
Enumeration allPools = pools.elements();
while (allPools.hasMoreElements()) {
DBConnectionPool pool = (DBConnectionPool) allPools.nextElement();
pool.release();
}
Enumeration allDrivers = drivers.elements();
while (allDrivers.hasMoreElements()) {
Driver driver = (Driver) allDrivers.nextElement();
try {
DriverManager.deregisterDriver(driver);
} catch (SQLException e) {
}
}
System.gc();
}
@SuppressWarnings({ "unchecked"})
private void createPools(Map<String,String> props) {
Set<String> propNames = props.keySet();
for(String name:propNames){
if (name.endsWith(".url")) {
String poolName = name.substring(0, name.lastIndexOf("."));
String url = props.get(poolName + ".url");
if (url == null) {
continue;
}
String user = props.get(poolName + ".user");
String password = props.get(poolName + ".password");
String maxconn="0";
if(props.containsKey(poolName + ".maxconn"))
maxconn = props.get(poolName + ".maxconn");
else
maxconn = "50";
int max = 0;
try {
max = Integer.parseInt(maxconn);
} catch (Exception e) {
max = 50;
}
DBConnectionPool pool = new DBConnectionPool(poolName, url, user, password, max);
pools.put(poolName, pool);
}
}
}
private void init(String name) {
Map<String, String> config=PropertiesUtil.getProperties(name);
if(config==null){
System.exit(-1);
}
loadDrivers(config);
createPools(config);
}
@SuppressWarnings("unchecked")
private void loadDrivers(Map<String,String> props) {
String driverClasses = props.get("drivers");
StringTokenizer st = new StringTokenizer(driverClasses);
while (st.hasMoreElements()) {
String driverClassName = st.nextToken().trim();
try {
Driver driver = (Driver) Class.forName(driverClassName).newInstance();
DriverManager.registerDriver(driver);
drivers.addElement(driver);
} catch (Exception e) {
}
}
}
class DBConnectionPool {
private int checkedOut;
@SuppressWarnings("rawtypes")
private Vector freeConnections = new Vector();
private int maxConn;
private String name;
private String password;
private String URL;
private String user;
public DBConnectionPool(String name, String URL, String user, String password, int maxConn) {
this.name = name;
this.URL = URL;
this.user = user;
this.password = password;
this.maxConn = maxConn;
}
@SuppressWarnings("unchecked")
public synchronized void freeConnection(Connection con) {
freeConnections.addElement(con);
checkedOut--;
notifyAll();
}
@SuppressWarnings("resource")
public synchronized Connection getConnection() {
Connection con = null;
if (freeConnections.size() > 0) {
con = (Connection) freeConnections.firstElement();
freeConnections.removeElementAt(0);
try {
if (con.isClosed() || !con.isValid(2)) {
checkedOut--;
con = null;
con = getConnection();
}
} catch (SQLException e) {
checkedOut--;
con = null;
con = getConnection();
}
} else if (maxConn == 0 || checkedOut < maxConn) {
con = newConnection();
}else{
}
if (con != null) {
checkedOut++;
}
return con;
}
public synchronized Connection getConnection(long timeout) {
long startTime = 0;
Connection con;
while ((con = getConnection()) == null) {
try {
wait(timeout);
} catch (InterruptedException e) {
}
if (startTime++ >= timeout) {
return null;
}
}
return con;
}
@SuppressWarnings("rawtypes")
public synchronized void release() {
Enumeration allConnections = freeConnections.elements();
while (allConnections.hasMoreElements()) {
Connection con = (Connection) allConnections.nextElement();
try {
con.close();
} catch (SQLException e) {
}
}
freeConnections.removeAllElements();
}
private Connection newConnection() {
Connection con = null;
try {
if (user == null)
con = DriverManager.getConnection(URL);
else
con = DriverManager.getConnection(URL, user, password);
} catch (SQLException e) {
return null;
}
return con;
}
}
}

317
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/DBUtil.java

@ -0,0 +1,317 @@
package com.bfd.mf.datasave.tools;
import java.sql.*;
import java.util.*;
/**
* the operation of the db
* @author ruining.he
* @createTime 2015年5月5日上午10:28:56
* */
public class DBUtil {
private static String etc_path = "";
private static DBConnectionManager dbManager = null;
private static Map<String,DBUtil> map = Collections.synchronizedMap(new HashMap<String,DBUtil>());
private String conn_name;
private DBUtil(String conn){
if(dbManager==null)
dbManager = DBConnectionManager.getInstance(etc_path);
this.conn_name = conn;
}
public static void init(String path){
etc_path = path;
}
public static DBUtil getInstance(String connectionName){
if("".equals(etc_path) && dbManager==null){
System.exit(0);
}
if(map.containsKey(connectionName))
return map.get(connectionName);
else{
DBUtil dbUtil = new DBUtil(connectionName);
map.put(connectionName, dbUtil);
return dbUtil;
}
}
private DBConnectionManager getDBCONConnectionManager(){
return dbManager;
}
public List<Map<String,Object>> query(String querySql){
List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
List<String> columns = new ArrayList<String>();
DBConnectionManager dbm=getDBCONConnectionManager();
Connection conn=null;
while(conn == null){
conn = dbm.getConnection(conn_name);
// DateUtil.sleep(1);
}
Statement statement = null;
ResultSet rs = null;
try {
conn.setAutoCommit(false);
statement=conn.createStatement();
rs=statement.executeQuery(querySql);
ResultSetMetaData data = rs.getMetaData();
for(int i=1;i<=data.getColumnCount();i++) {
columns.add(data.getColumnName(i));
}
while(rs.next()) {
HashMap<String,Object> map = new HashMap<String, Object>();
for(int i=0;i<columns.size();i++) {
map.put(columns.get(i).toLowerCase(), rs.getObject(columns.get(i)));//key to lowercase
}
list.add(map);
}
conn.commit();
} catch (Exception e) {
list.clear();
return list;
} finally{
try {
if(rs!=null)
rs.close();
if(statement!=null)
statement.close();
} catch (Exception e2) {
}
dbm.freeConnection(conn_name, conn);
}
return list;
}
public List<Map<String,Object>> queryOriginalColumn(String querySql){
List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
List<String> columns = new ArrayList<String>();
DBConnectionManager dbm=getDBCONConnectionManager();
Connection conn=null;
while(conn == null){
conn = dbm.getConnection(conn_name);
try {
Thread.currentThread().sleep(1*1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Statement statement = null;
ResultSet rs = null;
try {
conn.setAutoCommit(false);
statement=conn.createStatement();
rs=statement.executeQuery(querySql);
ResultSetMetaData data = rs.getMetaData();
for(int i=1;i<=data.getColumnCount();i++){
columns.add(data.getColumnName(i));
}
while(rs.next()){
HashMap<String,Object> map = new HashMap<String, Object>();
for(int i=0;i<columns.size();i++){
map.put(columns.get(i), rs.getObject(columns.get(i)));//key to lowercase
}
list.add(map);
}
conn.commit();
} catch (Exception e) {
list.clear();
return list;
} finally{
try {
if(rs!=null)
rs.close();
if(statement!=null)
statement.close();
} catch (Exception e2) {
}
dbm.freeConnection(conn_name, conn);
}
return list;
}
public List<Map<String,Object>> getQuaryResult(String quartReplyTable,String iid,Object node_name,Object website_source,Object keyword,Object title ,Object url){
DBConnectionManager dbm=getDBCONConnectionManager();
Connection conn=null;
while(conn == null){
conn = dbm.getConnection(conn_name);
}
Statement statement = null;
ResultSet rs = null;
String querySql = "";
try {
conn.setAutoCommit(false);
statement=conn.createStatement();
rs=statement.executeQuery("select * from "+quartReplyTable+" where iid = '"+iid+"'");
List<Map<String,Object>> datalist = new ArrayList<Map<String,Object>>();
while(rs.next()){
Map<String,Object> dataMap = new HashMap<String,Object>();
dataMap.put("node_name", node_name);
dataMap.put("website_source", website_source);
dataMap.put("iid", rs.getObject("iid"));
dataMap.put("keyword", keyword);
dataMap.put("title", title);
dataMap.put("url", url);
dataMap.put("node_type", rs.getObject("node_type"));
dataMap.put("authorname", rs.getObject("authorname"));
dataMap.put("publicNumberName", rs.getObject("publicNumberName"));
dataMap.put("newstime", rs.getObject("newstime"));
dataMap.put("contents", rs.getObject("contents"));
dataMap.put("reply_cnt", rs.getObject("reply_cnt"));
dataMap.put("forward_num", rs.getObject("forward_num"));
dataMap.put("reply_up_cnt", rs.getObject("reply_up_cnt"));
dataMap.put("click_num", rs.getObject("click_num"));
int reply_cnt = 0;
if(rs.getObject("reply_cnt") != null){
reply_cnt = Integer.parseInt((String) rs.getObject("reply_cnt"));
}
int forward_num = 0 ;
if(rs.getObject("forward_num") != null ){
forward_num = Integer.parseInt((String) rs.getObject("forward_num"));
}
dataMap.put("integra_sound_vol",1 + reply_cnt + forward_num);
dataMap.put("cate", rs.getObject("cate"));
dataMap.put("page_reply_cnt", rs.getObject("page_reply_cnt"));
dataMap.put("page_forward_num", rs.getObject("page_forward_num"));
datalist.add(dataMap);
}
return datalist;
} catch (Exception e) {
} finally{
try {
if(rs!=null)
rs.close();
if(statement!=null)
statement.close();
} catch (Exception e2) {
}
dbm.freeConnection(conn_name, conn);
}
return null;
}
public int quaryCount(String querySql){
DBConnectionManager dbm=getDBCONConnectionManager();
Connection conn=null;
while(conn == null){
conn = dbm.getConnection(conn_name);
try {
Thread.currentThread().sleep(1*1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Statement statement = null;
ResultSet rs = null;
try {
conn.setAutoCommit(false);
statement=conn.createStatement();
rs=statement.executeQuery(querySql);
while(rs.next()){
return rs.getInt(1);
}
conn.commit();
} catch (Exception e) {
} finally{
try {
if(rs!=null)
rs.close();
if(statement!=null)
statement.close();
} catch (Exception e2) {
}
dbm.freeConnection(conn_name, conn);
}
return 0;
}
public void executeBatch(List<String> sqlCache){
DBConnectionManager dbm=getDBCONConnectionManager();
Connection conn=null;
while(conn == null){
conn = dbm.getConnection(conn_name);
}
try {
conn.setAutoCommit(false);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Statement statement = null;
try {
statement = conn.createStatement();
for (int i = 0; i < sqlCache.size(); i++) {
statement.addBatch(sqlCache.get(i));
}
statement.executeBatch();
conn.commit();
System.out.println("mysql execute batch committed...");
}catch (Exception bue) {
bue.printStackTrace();
}finally{
if(statement!=null){
try {
statement.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(conn!=null){
dbm.freeConnection(conn_name, conn);
}
}
}
public int execute(String sql){
DBConnectionManager dbm=getDBCONConnectionManager();
Connection conn= null;
while(conn == null){
conn = dbm.getConnection(conn_name);
// DateUtil.sleep(1);
}
Statement st = null;
try {
conn.setAutoCommit(false);
st = conn.createStatement();
int rs = st.executeUpdate(sql);
conn.commit();
return rs;
// } catch (com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException e1){
// return ConfigCache.CODE_EXIST_IN_DB_AND_NOT_EXIST_IN_DUPLICATE;
}catch (Exception e) {
//return -10;
}finally{
try {
if(st!=null)
st.close();
} catch (Exception e2) {
}
dbm.freeConnection(conn_name, conn);
}
return 0;
}
}

861
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/DateUtil.java

@ -0,0 +1,861 @@
package com.bfd.mf.datasave.tools;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
/**
* 日期处理工具类
*/
public class DateUtil {
//~ Static fields/initializers =============================================
private static Log log = LogFactory.getLog(DateUtil.class);
private static String defaultDatePattern = null;
private static String timePattern = "HH:mm";
public static final String TS_FORMAT = DateUtil.getDatePattern() + " HH:mm:ss.S";
private static Calendar cale = Calendar.getInstance();
//~ Methods ================================================================
public DateUtil(){
}
/**
* 获得服务器当前日期及时间以格式为yyyy-MM-dd HH:mm:ss的日期字符串形式返回
*/
public static String getDateTime(){
try{
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return datetime.format(Calendar.getInstance().getTime());
} catch(Exception e){
log.debug("DateUtil.getDateTime():" + e.getMessage());
return "";
}
}
/**
* 获得服务器当前日期及时间以格式为yyyy-MM-dd HH:mm:ss的日期字符串形式返回
*/
public static String getDateTime(long date){
try{
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return datetime.format(new Date(date));
} catch(Exception e){
log.debug("DateUtil.getDateTime():" + e.getMessage());
return "";
}
}
/**
* 获得服务器当前日期以格式为yyyy-MM-dd的日期字符串形式返回
*/
public static String getDate(){
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
return date.format(Calendar.getInstance().getTime());
} catch(Exception e){
log.debug("DateUtil.getDate():" + e.getMessage());
return "";
}
}
/**
* 获得服务器当前时间以格式为HH:mm:ss的日期字符串形式返回
*/
public static String getTime(){
String temp = "";
try{
SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss");
temp += time.format(cale.getTime());
return temp;
} catch(Exception e){
log.debug("DateUtil.getTime():" + e.getMessage());
return "";
}
}
/**
* 获得服务器当前时间以格式为HH:mm:ss的日期字符串形式返回
*/
public static int getHour(){
int temp = 0;
try{
temp = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
return temp;
} catch(Exception e){
log.debug("DateUtil.getTime():" + e.getMessage());
return 0;
}
}
/**
* 返回日期加X天后的日期
*/
@SuppressWarnings("static-access")
public static int getHour(String fromdate){
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
GregorianCalendar gCal = new GregorianCalendar();
Date datetime = date.parse(fromdate) ;
gCal.setTime(datetime) ;
return gCal.get(gCal.HOUR_OF_DAY);
} catch(Exception e){
log.debug("DateUtil.addDay():" + e.toString());
return 0;
}
}
public static int getMinute(){
int temp = 0;
try{
temp = Calendar.getInstance().get(Calendar.MINUTE);
return temp;
} catch(Exception e){
log.debug("DateUtil.getTime():" + e.getMessage());
return 0;
}
}
/**
* 统计时开始日期的默认值,
* 今年的开始时间
*/
public static String getStartDate(){
try{
return getYear() + "-01-01";
} catch(Exception e){
log.debug("DateUtil.getStartDate():" + e.getMessage());
return "";
}
}
/**
* 统计时结束日期的默认值
*/
public static String getEndDate(){
try{
return getDate();
} catch(Exception e){
log.debug("DateUtil.getEndDate():" + e.getMessage());
return "";
}
}
/**
* 获得服务器当前日期的年份
*/
public static String getYear(){
try{
//返回的int型需要字符串转换
return String.valueOf(cale.get(Calendar.YEAR));
} catch(Exception e){
log.debug("DateUtil.getYear():" + e.getMessage());
return "";
}
}
/**
* 获得服务器当前日期的月份
*/
public static String getMonth(){
try{
//一个数字格式非常好
java.text.DecimalFormat df = new java.text.DecimalFormat();
df.applyPattern("00");
return df.format((cale.get(Calendar.MONTH) + 1));
//return String.valueOf(cale.get(Calendar.MONTH) + 1);
} catch(Exception e){
log.debug("DateUtil.getMonth():" + e.getMessage());
return "";
}
}
/**
* 获得服务器在当前月中天数
*/
public static String getDay(){
try{
return String.valueOf(cale.get(Calendar.DAY_OF_MONTH));
} catch(Exception e){
log.debug("DateUtil.getDay():" + e.getMessage());
return "";
}
}
/**
* 比较两个日期相差的天数,
* 第一个日期要比第二个日期要晚
*/
public static int getDays(String date1,String date2){
int margin;
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
ParsePosition pos1 = new ParsePosition(0);
Date dt1 = date.parse(date1,pos);
Date dt2 = date.parse(date2,pos1);
long l = dt1.getTime() - dt2.getTime();
margin = (int)(l / (24 * 60 * 60 * 1000));
return margin;
} catch(Exception e){
log.debug("DateUtil.getDays():" + e.toString());
return 0;
}
}
/**
* 比较两个日期相差的 小时数,
* 第一个日期要比第二个日期要晚
*/
public static int getHours(String date1,String date2){
int margin;
try{
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ParsePosition pos = new ParsePosition(0);
ParsePosition pos1 = new ParsePosition(0);
Date dt1 = datetime.parse(date1,pos);
Date dt2 = datetime.parse(date2,pos1);
long l = dt1.getTime() - dt2.getTime();
margin = (int)(l / ( 60 * 60 * 1000));
return margin;
} catch(Exception e){
log.debug("DateUtil.getHours():" + e.toString());
return 0;
}
}
/**
* 比较两个日期相差的分钟数,
* 第一个日期要比第二个日期要晚
*/
public static int getMinutes(String date1,String date2){
int margin;
try{
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ParsePosition pos = new ParsePosition(0);
ParsePosition pos1 = new ParsePosition(0);
Date dt1 = datetime.parse(date1,pos);
Date dt2 = datetime.parse(date2,pos1);
long l = dt1.getTime() - dt2.getTime();
margin = (int)(l / ( 60 * 1000));
return margin;
} catch(Exception e){
log.debug("DateUtil.getMinutes():" + e.toString());
return 0;
}
}
/**
* 返回日期加X天后的日期
*/
@SuppressWarnings("static-access")
public static int getMinutes(String fromdate){
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
GregorianCalendar gCal = new GregorianCalendar();
Date datetime = date.parse(fromdate) ;
gCal.setTime(datetime) ;
return gCal.get(gCal.MINUTE);
} catch(Exception e){
log.debug("DateUtil.addDay():" + e.toString());
return 0;
}
}
/**
* 比较两个日期相差的秒数,
* 第一个日期要比第二个日期要晚
*/
public static int getSeconds(String date1,String date2){
int margin;
try{
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date dt1 = datetime.parse(date1);
Date dt2 = datetime.parse(date2);
long dateintvlong = dt1.getTime() - dt2.getTime();
margin = (int)(dateintvlong /1000);
return margin;
} catch(Exception e){
log.debug("DateUtil.getSeconds():" + e.toString());
return 0;
}
}
/**
* 比较两个日期相差的天数格式不一样
* 第一个日期要比第二个日期要晚
*/
public static double getDoubledays(String date1,String date2){
double margin;
try{
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ParsePosition pos = new ParsePosition(0);
ParsePosition pos1 = new ParsePosition(0);
Date dt1 = datetime.parse(date1,pos);
Date dt2 = datetime.parse(date2,pos1);
long l = dt1.getTime() - dt2.getTime();
margin = (l / (24 * 60 * 60 * 1000.00));
return margin;
} catch(Exception e){
log.debug("DateUtil.getMargin():" + e.toString());
return 0;
}
}
/**
* 比较两个日期相差的月数
*/
public static int getMonthMargin(String date1,String date2){
int margin;
try{
margin = (Integer.parseInt(date2.substring(0,4)) - Integer.parseInt(date1.substring(0,4)))* 12;
margin += (Integer.parseInt(date2.substring(4,7).replaceAll("-0","-")) - Integer.parseInt(date1.substring(4,7).replaceAll("-0","-")));
return margin;
} catch(Exception e){
log.debug("DateUtil.getMargin():" + e.toString());
return 0;
}
}
/**
* 返回日期加X天后的日期
*/
public static String addDay(String fromdate,int i){
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
GregorianCalendar gCal = new GregorianCalendar(Integer.parseInt(fromdate.substring(0,4)),Integer.parseInt(fromdate.substring(5,7))-1,Integer.parseInt(fromdate.substring(8,10)));
gCal.add(GregorianCalendar.DATE,i);
return date.format(gCal.getTime());
} catch(Exception e){
log.debug("DateUtil.addDay():" + e.toString());
return getDate();
}
}
/**
* 返回日期加X天后的日期
*/
public static String addDay(int i){
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
Calendar cale = Calendar.getInstance() ;
cale.add(Calendar.DAY_OF_MONTH, i) ;
return date.format(cale.getTime());
} catch(Exception e){
log.debug("DateUtil.addDay():" + e.toString());
return getDate();
}
}
/**
* 返回日期加X月后的日期
*/
public static String addMonth(String fromdate,int i){
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
GregorianCalendar gCal = new GregorianCalendar(Integer.parseInt(fromdate.substring(0,4)),Integer.parseInt(fromdate.substring(5,7))-1,Integer.parseInt(fromdate.substring(8,10)));
gCal.add(GregorianCalendar.MONTH,i);
return date.format(gCal.getTime());
} catch(Exception e){
log.debug("DateUtil.addMonth():" + e.toString());
return getDate();
}
}
/**
* 返回日期加X年后的日期
*/
public static String addYear(String fromdate,int i){
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
GregorianCalendar gCal = new GregorianCalendar(Integer.parseInt(fromdate.substring(0,4)),Integer.parseInt(fromdate.substring(5,7))-1,Integer.parseInt(fromdate.substring(8,10)));
gCal.add(GregorianCalendar.YEAR,i);
return date.format(gCal.getTime());
} catch(Exception e){
log.debug("DateUtil.addYear():" + e.toString());
return "";
}
}
/**
* 返回某年某月中的最大天
*/
public static int getMaxDay(String year,String month){
int day = 0;
try{
int iyear = Integer.parseInt(year);
int imonth = Integer.parseInt(month);
if(imonth == 1 || imonth == 3 || imonth == 5 || imonth == 7 || imonth == 8 || imonth == 10 || imonth == 12){
day = 31;
} else if(imonth == 4 || imonth == 6 || imonth == 9 || imonth == 11){
day = 30;
} else if((0 == (iyear % 4)) && (0 != (iyear % 100)) || (0 == (iyear % 400))){
day = 29;
} else{
day = 28;
}
return day;
} catch(Exception e){
log.debug("DateUtil.getMonthDay():" + e.toString());
return 1;
}
}
/**
* 格式化日期
*/
@SuppressWarnings("static-access")
public String rollDate(String orgDate,int Type,int Span){
try{
String temp = "";
int iyear,imonth,iday;
int iPos = 0;
char seperater = '-';
if(orgDate == null || orgDate.length() < 6){
return "";
}
iPos = orgDate.indexOf(seperater);
if(iPos > 0){
iyear = Integer.parseInt(orgDate.substring(0,iPos));
temp = orgDate.substring(iPos + 1);
} else{
iyear = Integer.parseInt(orgDate.substring(0,4));
temp = orgDate.substring(4);
}
iPos = temp.indexOf(seperater);
if(iPos > 0){
imonth = Integer.parseInt(temp.substring(0,iPos));
temp = temp.substring(iPos + 1);
} else{
imonth = Integer.parseInt(temp.substring(0,2));
temp = temp.substring(2);
}
imonth--;
if(imonth < 0 || imonth > 11){
imonth = 0;
}
iday = Integer.parseInt(temp);
if(iday < 1 || iday > 31)
iday = 1;
Calendar orgcale = Calendar.getInstance();
orgcale.set(iyear,imonth,iday);
temp = this.rollDate(orgcale,Type,Span);
return temp;
}catch(Exception e){
return "";
}
}
public static String rollDate(Calendar cal,int Type,int Span){
try{
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
String temp = "";
Calendar rolcale;
rolcale = cal;
rolcale.add(Type,Span);
temp = date.format(rolcale.getTime());
return temp;
}catch(Exception e){
return "";
}
}
/**
*
* 返回默认的日期格式
*
*/
public static synchronized String getDatePattern() {
defaultDatePattern = "yyyy-MM-dd";
return defaultDatePattern;
}
/**
* 将指定日期按默认格式进行格式代化成字符串后输出如yyyy-MM-dd
*/
public static final String getDate(Date aDate) {
SimpleDateFormat df = null;
String returnValue = "";
if (aDate != null) {
df = new SimpleDateFormat(getDatePattern());
returnValue = df.format(aDate);
}
return (returnValue);
}
/**
* 取得给定日期的时间字符串格式为当前默认时间格式
*/
public static String getTimeNow(Date theTime) {
return getDateTime(timePattern, theTime);
}
/**
* 取得当前时间的Calendar日历对象
*/
public Calendar getToday() throws ParseException {
Date today = new Date();
SimpleDateFormat df = new SimpleDateFormat(getDatePattern());
String todayAsString = df.format(today);
Calendar cal = new GregorianCalendar();
cal.setTime(convertStringToDate(todayAsString));
return cal;
}
/**
* 将日期类转换成指定格式的字符串形式
*/
public static final String getDateTime(String aMask, Date aDate) {
SimpleDateFormat df = null;
String returnValue = "";
if (aDate == null) {
log.error("aDate is null!");
} else {
df = new SimpleDateFormat(aMask);
returnValue = df.format(aDate);
}
return (returnValue);
}
/**
* 将指定的日期转换成默认格式的字符串形式
*/
public static final String convertDateToString(Date aDate) {
return getDateTime(getDatePattern(), aDate);
}
/**
* 将日期字符串按指定格式转换成日期类型
* @param aMask 指定的日期格式:yyyy-MM-dd
* @param strDate 待转换的日期字符串
*/
public static final Date convertStringToDate(String aMask, String strDate)
throws ParseException {
SimpleDateFormat df = null;
Date date = null;
df = new SimpleDateFormat(aMask);
if (log.isDebugEnabled()) {
log.debug("converting '" + strDate + "' to date with mask '"
+ aMask + "'");
}
try {
date = df.parse(strDate);
} catch (ParseException pe) {
log.error("ParseException: " + pe);
throw pe;
}
return (date);
}
/**
* 将日期字符串按默认格式转换成日期类型
*/
public static Date convertStringToDate(String strDate)
throws ParseException {
Date aDate = null;
try {
if (log.isDebugEnabled()) {
log.debug("converting date with pattern: " + getDatePattern());
}
aDate = convertStringToDate(getDatePattern(), strDate);
} catch (ParseException pe) {
log.error("Could not convert '" + strDate
+ "' to a date, throwing exception");
throw new ParseException(pe.getMessage(),
pe.getErrorOffset());
}
return aDate;
}
/**
* 返回一个JAVA简单类型的日期字符串
*/
public static String getSimpleDateFormat(){
SimpleDateFormat formatter=new SimpleDateFormat();
String NDateTime=formatter.format(new Date());
return NDateTime;
}
/**
* 将两个字符串格式的日期进行比较
* @param last 要比较的第一个日期字符串
* @param now 要比较的第二个日期格式字符串
* @return true(last 在now 日期之前),false(last 在now 日期之后)
*/
public static boolean compareTo(String last, String now) {
try {
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
Date temp1 = formatter.parse(last);
Date temp2 = formatter.parse(now);
if (temp1.after(temp2))
return false;
else if (temp1.before(temp2))
return true;
} catch (ParseException e) {
log.debug(e.getMessage());
}
return false;
}
/**
* 将两个字符串格式的日期进行比较
* @param last 要比较的第一个日期字符串
* @param now 要比较的第二个日期格式字符串
* @return true(last 在now 日期之前),false(last 在now 日期之后)
*/
public static boolean compareToForBBS(String last, String now) {
try {
if(last.equals(now))
return true;
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyy-MM-dd");
Date temp1 = formatter.parse(last);
Date temp2 = formatter.parse(now);
if (temp1.after(temp2))
return false;
else if (temp1.before(temp2))
return true;
} catch (ParseException e) {
log.debug(e.getMessage());
}
return false;
}
/**
* 为查询日期添加最小时间
* @return
*/
@SuppressWarnings("deprecation")
public static Date addStartTime(Date param) {
Date date = param;
try{
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
return date;
}catch(Exception ex){
return date;
}
}
/**
* 为查询日期添加最大时间
* @return
*/
@SuppressWarnings("deprecation")
public static Date addEndTime(Date param) {
Date date = param;
try{
date.setHours(23);
date.setMinutes(59);
date.setSeconds(0);
return date;
}catch(Exception ex){
return date;
}
}
/**
* 返回系统现在年份中指定月份的天数
* @return 指定月的总天数
*/
@SuppressWarnings("deprecation")
public static String getMonthLastDay(int month)
{
Date date=new Date();
int[][] day={{0,30,28,31,30,31,30,31,31,30,31,30,31},
{0,31,29,31,30,31,30,31,31,30,31,30,31}};
int year=date.getYear()+1900;
if(year%4==0 && year%100!=0 || year%400==0)
{
return day[1][month]+"";
}
else
{
return day[0][month]+"";
}
}
/**
* 返回指定年份中指定月份的天数
* @return 指定月的总天数
*/
public static String getMonthLastDay(int year,int month)
{
int[][] day={{0,30,28,31,30,31,30,31,31,30,31,30,31},
{0,31,29,31,30,31,30,31,31,30,31,30,31}};
if(year%4==0 && year%100!=0 || year%400==0)
{
return day[1][month]+"";
}
else
{
return day[0][month]+"";
}
}
/**
* 取得当前时间的日戳
* @return
*/
@SuppressWarnings("deprecation")
public static String getTimestamp(){
Date date=new Date();
String timestamp=""+(date.getYear()+1900)+date.getMonth()+date.getDate()+date.getMinutes()+date.getSeconds()+date.getTime();
return timestamp;
}
/**
* 取得指定时间的日戳
* @return
*/
@SuppressWarnings("deprecation")
public static String getTimestamp(Date date){
String timestamp=""+(date.getYear()+1900)+date.getMonth()+date.getDate()+date.getMinutes()+date.getSeconds()+date.getTime();
return timestamp;
}
public static Date getDate(String time) {
Date date = new Date();
try {
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
date = datetime.parse(time);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
public static long getTimeMillis(String datetime){
long timemillis = 0 ;
Calendar cal = Calendar.getInstance();
Date date = getDate(datetime) ;
cal.setTime(date) ;
timemillis = cal.getTimeInMillis() ;
return timemillis ;
}
public static long getsmallSec(String datetime1,String datetime2){
long time1 = 0 ;
long time2 = 0 ;
long time = 0 ;
if(datetime1!=null){
time1 = getTimeMillis(datetime1) ;
}
if(datetime2!=null){
time2 = getTimeMillis(datetime2) ;
}
if(time1==0){
time = time2 ;
}else if(time2==0){
time = time1 ;
}else if(time1>time2){
time = time2 ;
}else{
time = time1 ;
}
time = time/1000 ;
return time ;
}
/**
* @Description: TODO
* @param calendarField 修改的字段
* @param calc add/sub
* @param n
* @return 
* 
* @return String   
* @throws
*/
public static String getDatetimeNfieldgap(int calendarField,String calc,int n){
try{
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar cal = Calendar.getInstance() ;
int value = cal.get(calendarField) ;
if(calc.equals("add")){
cal.set(calendarField, value+n) ;
}else if(calc.equals("sub")){
cal.set(calendarField, value-n);
}
return datetime.format(cal.getTime());
} catch(Exception e){
log.debug("DateUtil.getDay():" + e.getMessage());
return "" ;
}
}
@SuppressWarnings("static-access")
public static void sleep(int seconds){
if(seconds<1)
return;
try {
Thread.currentThread().sleep(seconds*1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@SuppressWarnings("static-access")
public static void sleepLong(long millisecond){
if(millisecond<1)
return;
try {
Thread.currentThread().sleep(millisecond);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
// public static void main(String[] args) {
// boolean flag = compareToForBBS("0000-06-01 00:00:00.0","11-09");
// System.out.println(flag);
// }
}

33
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/PropertiesUtil.java

@ -0,0 +1,33 @@
package com.bfd.mf.datasave.tools;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
* properties文件读取
* @author ruining.he
* */
public class PropertiesUtil {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static Map<String,String> getProperties(String filePath){
Properties properties=new Properties();
try {
Reader reader = new InputStreamReader(new FileInputStream(new File(filePath)), "utf8");
properties.load(reader);
return new HashMap(properties);
} catch (FileNotFoundException e) {
} catch (IOException e) {
}
return null;
}
// public static void main(String[] args) {
// Map<String,String> map = getProperties("E:\\BaiFenDian\\工作文档\\5月\\B版_develop\\test\\info-config");
// for(String k:map.keySet()){
// System.out.println(k + ":" + map.get(k));
// }
// }
}

37
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/ReadLine.java

@ -0,0 +1,37 @@
package com.bfd.mf.datasave.tools;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class ReadLine {
public static List<String> readLine( File fileName){
List<String> list = new ArrayList<String> ();
String line;
try {
InputStreamReader read = new InputStreamReader(new FileInputStream(fileName), "utf-8");
BufferedReader reader = new BufferedReader(read);
while ((line = reader.readLine()) != null) {
try {
if (line.length() > 0) {
list.add(line);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return list;
}catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}

21
cl_stream_datasave/src/main/java/com/bfd/mf/datasave/tools/WriteMethod.java

@ -0,0 +1,21 @@
package com.bfd.mf.datasave.tools;
import java.io.FileWriter;
import java.io.IOException;
/**
* Created by BFD-229 on 2017/7/6.
*/
public class WriteMethod {
public static void writeMethod(String fileName, String json){
try{
FileWriter writer=new FileWriter(fileName,true);
writer.write(json+"\n");
writer.close();
} catch (IOException e)
{
e.printStackTrace();
}
}
}

147
cl_stream_datasave/src/main/java/com/bfd/mf/entity/AllKeys.java

@ -0,0 +1,147 @@
package com.bfd.mf.entity;
import java.util.*;
public class AllKeys {
private static Map<String,Object> map = new HashMap();
public static Map<String, Object> getMap() {
return map;
}
public static void setMap(Map<String, Object> map) {
AllKeys.map = map;
}
static {
map.put("_id_","");
map.put("age","");
map.put("area","");
map.put("attitudesCount","");
map.put("attr","");
map.put("author","");
map.put("authorId","");
map.put("authorLevel","");
map.put("authornickname","");
map.put("availability",0);
map.put("avatar","");
map.put("brand","");
map.put("brandId","");
map.put("cate","");
map.put("channel","");
map.put("city","");
map.put("collectCount",0);
map.put("commentId","");
map.put("commentScore",0);
map.put("commentsCount",0);
map.put("commentUrl","");
map.put("content","");
map.put("contentLength",0);
map.put("contentSimHash","");
map.put("contentTag","");
map.put("country","");
map.put("crawlDataFlag","");
map.put("crawlDate",new Date ());
map.put("crawlDay",0L);
map.put("crawlTime",0L);
map.put("crawlTimeStr","");
map.put("createDate",new Date ());
map.put("createDay",0L);
map.put("createTime",0L);
map.put("createTimeStr","");
map.put("dataCount",0);
map.put("dataId","");
map.put("docId","");
map.put("docType","");
map.put("downCnt",0);
map.put("egc",0);
map.put("enSource","");
map.put("expression",new ArrayList<>());
map.put("extension","");
map.put("fansCount","");
map.put("favorCnt",0);
map.put("filePath",new ArrayList<>());
map.put("imagePath",new ArrayList<>());
map.put("videoPath",new ArrayList<>());
map.put("finalPhrase","");
map.put("firstListBrand","");
map.put("fiveListBrand","");
map.put("forumScore","");
map.put("forwardAttitudesCount",0);
map.put("forwardAuthor","");
map.put("forwardAvatar","");
map.put("forwardCommentsCount",0);
map.put("forwardContent","");
map.put("forwardImgs","");
map.put("forwardPostSource","");
map.put("forwardPubTime",0L);
map.put("forwardQuoteCount",0);
map.put("forwardUrl","");
map.put("forwardUserId","");
map.put("forwardUserType",0);
map.put("forwardUserUrl","");
map.put("fourListBrand","");
map.put("friendsCount","");
map.put("getSource","");
map.put("hashTag",new ArrayList<>());
map.put("hlKeywords",new ArrayList<>());
map.put("impression","");
map.put("isDownload",false);
map.put("isVip",0);
map.put("language","");
map.put("lastModifiedTime",0L);
map.put("listBrand","");
map.put("location","");
map.put("nomorprice",0);
map.put("opinions",new ArrayList<>());
map.put("originalPhrase","");
map.put("otherSourceJson","");
map.put("pageCommentCount",0);
map.put("pageTranspondCount",0);
map.put("pageType","");
map.put("pgc",0);
map.put("pictureList","");
map.put("places",new ArrayList<>());
map.put("postCount","");
map.put("postId","");
map.put("postSource","");
map.put("price",0);
map.put("primary",1);
map.put("productParameter","");
map.put("projectName","");
map.put("promotionInfo","");
map.put("province","");
map.put("pubDate",new Date());
map.put("pubDay",0L);
map.put("pubTime",0L);
map.put("pubTimeStr","");
map.put("quoteCount",0);
map.put("readCount",0);
map.put("resolution","");
map.put("secondListBrand","");
map.put("sex","");
map.put("sign","");
map.put("siteId","");
map.put("skuProperties","");
map.put("smallImgs","");
map.put("source","");
map.put("sysAbstract","");
map.put("sysKeywords","");
map.put("sysSentiment",0.0);
map.put("threeListBrand","");
map.put("thumbnails","");
map.put("title","");
map.put("titleLength",0);
map.put("titleSimHash","");
map.put("translateContent","");
map.put("translateTitle","");
map.put("ugc",0);
map.put("url","");
map.put("urlHash","");
map.put("userType","");
map.put("userUrl","");
map.put("videoTime","");
map.put("videoUrl","");
map.put("viewCnt",0);
}
}

21
cl_stream_datasave/src/main/java/com/bfd/mf/entity/DataSaveManager.java

@ -0,0 +1,21 @@
package com.bfd.mf.entity;
import com.bfd.mf.entity.FieldNormaliz;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Map;
public interface DataSaveManager extends Remote{
public void addTaskName(FieldNormaliz fieldNormaliz) throws RemoteException;
public void stopImprotTask(int kafkaSerName, String kafkaName) throws RemoteException ;
public void startImprotTask(String kafkaName) throws RemoteException ;
public long getNowImportEsNum(Map<String, Object> param) throws RemoteException;
public int getNowKafkaNum() throws RemoteException ;
}

39
cl_stream_datasave/src/main/java/com/bfd/mf/entity/FieldInfo.java

@ -0,0 +1,39 @@
package com.bfd.mf.entity;
import java.util.List;
public class FieldInfo {
private String kafka_type ;
private List<String> kafkaJsonString ;
private List<String> kafkaJsonArray ;
public String getKafka_type() {
return kafka_type;
}
public void setKafka_type(String kafka_type) {
this.kafka_type = kafka_type;
}
public List<String> getKafkaJsonString() {
return kafkaJsonString;
}
public void setKafkaJsonString(List<String> kafkaJsonString) {
this.kafkaJsonString = kafkaJsonString;
}
public List<String> getKafkaJsonArray() {
return kafkaJsonArray;
}
public void setKafkaJsonArray(List<String> kafkaJsonArray) {
this.kafkaJsonArray = kafkaJsonArray;
}
}

207
cl_stream_datasave/src/main/java/com/bfd/mf/entity/FieldNormaliz.java

@ -0,0 +1,207 @@
package com.bfd.mf.entity;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
public class FieldNormaliz implements Serializable{
private static final long serialVersionUID = 1L;
private int id ;
private String kafkaName ;
private int kafkaSerName ;
private int esSerName ;
private String esSuffixNames ;
private String docType ;
private int isSemtimentApi ;
private boolean ishlKeyword ;
private int bussinessType ;
private Map<String, String> fieldNormalizeContentMap ;
private Map<String, String> fieldNormalizeCommentMap ;
private Map<Integer,Map<String, Map<String, String>>> fieldDataMap ;
private Map<String, FieldInfo> fieldInfo ;
private String groupId ;
private String createTime ;
private String finshTime ;
private int status ;
private String projectName ;
public String getKafkaName() {
return kafkaName;
}
public void setKafkaName(String kafkaName) {
this.kafkaName = kafkaName;
}
public int getKafkaSerName() {
return kafkaSerName;
}
public void setKafkaSerName(int kafkaSerName) {
this.kafkaSerName = kafkaSerName;
}
public int getEsSerName() {
return esSerName;
}
public void setEsSerName(int esSerName) {
this.esSerName = esSerName;
}
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType;
}
public int getIsSemtimentApi() {
return isSemtimentApi;
}
public void setIsSemtimentApi(int isSemtimentApi) {
this.isSemtimentApi = isSemtimentApi;
}
public int getBussinessType() {
return bussinessType;
}
public void setBussinessType(int bussinessType) {
this.bussinessType = bussinessType;
}
public Map<String, String> getFieldNormalizeContentMap() {
return fieldNormalizeContentMap;
}
public void setFieldNormalizeContentMap(Map<String, String> fieldNormalizeContentMap) {
this.fieldNormalizeContentMap = fieldNormalizeContentMap;
}
public Map<String, String> getFieldNormalizeCommentMap() {
return fieldNormalizeCommentMap;
}
public void setFieldNormalizeCommentMap(Map<String, String> fieldNormalizeCommentMap) {
this.fieldNormalizeCommentMap = fieldNormalizeCommentMap;
}
public Map<Integer,Map<String, Map<String, String>>> getFieldDataMap() {
return fieldDataMap;
}
public Map<String,Map<String, String>> getFieldDataMapByType(String type){
return fieldDataMap.get(type);
}
public void addFieldDataMap(String type, Map<String, Object> fixFieldData, Integer bussinessType){
Set<String> keys = fixFieldData.keySet() ;
Map<String,Map<String, String>> fieldMaps = fieldDataMap.get(bussinessType) ;
Map<String, String> fieldMap = fieldMaps.get(type) ;
for(String key : keys){
fieldMap.put(key, key) ;
}
fieldMaps.put(type, fieldMap);
fieldDataMap.put(bussinessType, fieldMaps) ;
}
public void setFieldDataMap(Map<Integer,Map<String, Map<String, String>>> fieldDataMap) {
this.fieldDataMap = fieldDataMap;
}
public Map<String, FieldInfo> getFieldInfo() {
return fieldInfo;
}
public void setFieldInfo(Map<String, FieldInfo> fieldInfo) {
this.fieldInfo = fieldInfo;
}
public boolean isIshlKeyword() {
return ishlKeyword;
}
public void setIshlKeyword(boolean ishlKeyword) {
this.ishlKeyword = ishlKeyword;
}
public String getEsSuffixNames() {
return esSuffixNames;
}
public void setEsSuffixNames(String esSuffixNames) {
this.esSuffixNames = esSuffixNames;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getFinshTime() {
return finshTime;
}
public void setFinshTime(String finshTime) {
this.finshTime = finshTime;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
}

1397
cl_stream_datasave/src/main/java/com/bfd/mf/entity/ReaultInfo.java
File diff suppressed because it is too large
View File

74
cl_stream_datasave/src/main/java/com/bfd/mf/entity/impl/DataSaveManagerImpl.java

@ -0,0 +1,74 @@
package com.bfd.mf.entity.impl;
import com.bfd.crawler.elasti.ElatiIndexManager;
import com.bfd.crawler.kafka7.KfkConsumer;
import com.bfd.mf.datasave.listen.ListenKafkaManager;
import com.bfd.mf.datasave.listen.ListenTaskManager;
import com.bfd.mf.entity.DataSaveManager;
import com.bfd.mf.entity.FieldNormaliz;
import org.apache.commons.lang3.StringUtils;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Map;
public class DataSaveManagerImpl extends UnicastRemoteObject implements DataSaveManager {
private static final long serialVersionUID = 1L;
public DataSaveManagerImpl() throws RemoteException {
super();
}
@Override
public void addTaskName(FieldNormaliz fieldNormaliz) throws RemoteException {
ListenTaskManager.addKafkaTopicListen(fieldNormaliz);
}
@Override
public void stopImprotTask(int kafkaSerName, String kafkaName) throws RemoteException{
if(ListenTaskManager.listenKafkaManagers.size() > 0){
KfkConsumer.stopKfkConsumerThreads(kafkaSerName, kafkaName);
ListenKafkaManager listenKafkaManager = ListenTaskManager.listenKafkaManagers.get(kafkaSerName+"#"+kafkaName) ;
listenKafkaManager.setSwitch(false);
ListenTaskManager.listenKafkaManagers.remove(kafkaSerName+"#"+kafkaName);
}
}
@Override
public void startImprotTask(String kafkaName) throws RemoteException{
if(ListenTaskManager.listenKafkaManagers.size() > 0){
System.out.println("kafkaName : "+kafkaName);
ListenKafkaManager listenKafkaManager = ListenTaskManager.listenKafkaManagers.get(kafkaName) ;
listenKafkaManager.setSwitch(true);
}
}
/**
* 获取当前插入到 ES 中的数据 (仅限查询后台的ES 因为前台的ES 是按日期的因此暂时不统计)
*/
@Override
public long getNowImportEsNum(Map<String,Object> param) throws RemoteException{
long esNum = 0 ;
try{
int esServerName = Integer.valueOf(param.get("esServerName").toString()) ;
if(param.containsKey("indexName")){
String indexName = param.get("indexName").toString() ;
if(StringUtils.isNotBlank(indexName)){
ElatiIndexManager elatiIndexManager = ElatiIndexManager.getInstance(esServerName) ;
esNum += elatiIndexManager.getindexNum(indexName+"_content") ;
ElatiIndexManager elatiIndexManagerCommment = ElatiIndexManager.getInstance(esServerName) ;
esNum += elatiIndexManagerCommment.getindexNum(indexName+"_comment") ;
}
}
}catch(Exception e){
e.printStackTrace();
}
return esNum;
}
@Override
public int getNowKafkaNum() throws RemoteException{
return 0 ;
}
}

26
cl_stream_datasave/src/main/java/com/bfd/mf/entity/mysql/FiledTableInfo.java

@ -0,0 +1,26 @@
package com.bfd.mf.entity.mysql;
import com.bfd.mf.datasave.tools.DBUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FiledTableInfo {
public static Map<Integer,Map<String,String>> tableInfoMap = new HashMap<Integer,Map<String,String>>();
public static void loadTableInfo(){
List<Map<String, Object>> tableInfoList1 = DBUtil.getInstance("db_stat").query("select * from mf_field_table_info where bussiness_type = 1");
if(tableInfoList1.size() > 0){
Map<String,String> tablefieldValue = new HashMap<String,String>();
for(Map<String, Object> tableInfo : tableInfoList1){
tablefieldValue.put(tableInfo.get("col_name").toString(), tableInfo.get("col_type").toString());
}
tableInfoMap.put(1, tablefieldValue);
}
}
}

70
cl_stream_datasave/src/main/java/com/bfd/mf/entity/mysql/SubjectTask.java

@ -0,0 +1,70 @@
package com.bfd.mf.entity.mysql;
//import com.bfd.crawler.utils.JsonUtils;
import com.bfd.mf.datasave.tools.DBUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SubjectTask {
public static Map<String, List<Map<String,String>>> subjectTaskMap = new HashMap<>();
public static void loadSubjectTask(){
subjectTaskMap.clear();
List<Map<String, Object>> subjectTaskList = DBUtil.getInstance("db_stat").query("SELECT cst.id,ct.external_id,cst.subject_id, cst.task_id, ct.cid, ct.crawl_data_flag,cs.export_to_kafka,cs.kafka_addr,cs.go_fast_addr FROM cl_subject_task cst JOIN cl_subject cs ON (cst.subject_id = cs.id) LEFT JOIN cl_task ct ON (cst.task_id = ct.id );");
//System.out.println("***&&&&&**"+subjectTaskList+"subjectTaskList");
if(subjectTaskList.size() > 0){
String key = "";
for(Map<String, Object> subjectTask : subjectTaskList){ //{subject_id=10222, name=我是张三, task_id=188, id=71, crawl_data_flag=aaa}
key = subjectTask.get("cid") + "#####" + subjectTask.get("crawl_data_flag");
//System.out.print(key+"asdasd");
Map<String,String> value = new HashMap<>();
List<Map<String,String>> valueList = new ArrayList<>();
String v_subject_id = "";
String v_go_fast_addr = "";
String v_export_to_kafka = "";
String v_kafka_addr = "";
String v_task_id = "";
String v_external_id ="";
if(null != subjectTask.get("subject_id")) {
v_subject_id = subjectTask.get("subject_id").toString();
}
if(null != subjectTask.get("go_fast_addr")) {
v_go_fast_addr = subjectTask.get("go_fast_addr").toString();
}
if(null != subjectTask.get("kafka_addr")) {
v_kafka_addr = subjectTask.get("kafka_addr").toString();
}
if(null != subjectTask.get("export_to_kafka")){
v_export_to_kafka = subjectTask.get("export_to_kafka").toString();
}
if(null !=subjectTask.get("task_id")){
v_task_id = subjectTask.get("task_id").toString();
}
if(null !=subjectTask.get("external_id")){
v_external_id = subjectTask.get("external_id").toString();
}
value.put("subject_id",v_subject_id);
value.put("go_fast_addr",v_go_fast_addr);
value.put("export_to_kafka",v_export_to_kafka);
value.put("kafka_addr",v_kafka_addr);
value.put("task_id",v_task_id);
value.put("external_id",v_external_id);
//System.out.print(v_external_id+"external_id");
String newkey = key.toLowerCase();
if(subjectTaskMap.containsKey(newkey)){
valueList = subjectTaskMap.get(newkey);
valueList.add(value);
}else{
valueList.add(value);
}
subjectTaskMap.put(newkey,valueList);
}
//System.out.println(JsonUtils.toJSONString(subjectTaskMap));
}
}
}

11
cl_stream_datasave/src/main/java/com/bfd/mf/runstart/GeterExit.java

@ -0,0 +1,11 @@
//package com.bfd.mf.runstart;
//
//
//public class GeterExit extends Thread {
//
// public void run() {
// System.out.println("system run close...");
// TaskFileUtils.clearTaskQueue();
// System.out.println("system run closeed");
// }
//}

73
cl_stream_datasave/src/main/java/com/bfd/mf/runstart/RunStartDataSave.java

@ -0,0 +1,73 @@
package com.bfd.mf.runstart;
import com.bfd.crawler.kafka7.KfkConsumer;
import com.bfd.crawler.kafka7.consts.KafkaConsts;
import com.bfd.mf.entity.DataSaveManager;
import com.bfd.mf.entity.impl.DataSaveManagerImpl;
import com.bfd.mf.datasave.tools.DBUtil;
import com.bfd.mf.entity.mysql.FiledTableInfo;
import com.bfd.mf.entity.mysql.SubjectTask;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
public class RunStartDataSave {
private static final Logger LOG = Logger.getLogger(RunStartDataSave.class);
private static String log4jPath = "../etc/log4j.properties";
private static String dbPath = "../etc/db.properties";
static {
PropertyConfigurator.configureAndWatch(log4jPath);
DBUtil.init(dbPath);
}
public static void main(String[] args) {
//KfkConsumer.startReadThread(this.queue, readTopicName,this.threadNums,this.groupId,this.kafkaServerName);
FiledTableInfo.loadTableInfo();
// cl_subject_task
startRmiService();
while (true){
SubjectTask.loadSubjectTask();
try {
Thread.sleep(30000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
/**后面增加把es缓存的数据关闭的时候处理 不让丢数据**/
//Runtime.getRuntime().addShutdownHook(new GeterExit());
}
public static void startRmiService() {
try {
/*** 创建一个远程对象 ***/
DataSaveManager dataSaveManager = new DataSaveManagerImpl();
/***
* 本地主机上的远程对象注册表Registry的实例 并指定端口为8888这一步必不可少Java默认端口是1099
* 必不可缺的一步缺少注册表创建则无法绑定对象到远程注册表上
***/
LocateRegistry.createRegistry(1099);
/*** 把远程对象注册到RMI注册服务器上,并命名为taskManager ***/
/*** 绑定的URL标准格式为:rmi://host:port/name(其中协议名可以省略,下面两种写法都是正确的) ***/
Naming.bind("//127.0.0.1:1099/dataSaveManager", dataSaveManager);
System.out.println(">>>>>INFO:远程IHello对象绑定成功!");
} catch (RemoteException e) {
System.out.println("创建远程对象发生异常!");
e.printStackTrace();
} catch (MalformedURLException e) {
System.out.println("发生URL畸形异常!");
e.printStackTrace();
} catch (AlreadyBoundException e) {
e.printStackTrace();
}
}
}

37
cl_stream_datasave/src/main/java/com/bfd/mf/runstart/TaskFileUtils.java

@ -0,0 +1,37 @@
//package com.bfd.mf.runstart;
//
//import com.bfd.crawler.kafka7.KfkConsumer;
//import com.bfd.mf.datasave.listen.ListenKafkaManager;
//import com.bfd.mf.datasave.listen.ListenTaskManager;
//import org.apache.log4j.Logger;
//
//import java.util.Map;
//import java.util.concurrent.LinkedBlockingDeque;
//
//public class TaskFileUtils {
//
// private static Logger log = Logger.getLogger(TaskFileUtils.class);
//
// public static void clearTaskQueue(){
// if(ListenTaskManager.listenKafkaManagers.size() > 0){
// for(Map.Entry<String,ListenKafkaManager> entry : ListenTaskManager.listenKafkaManagers.entrySet()){
// try {
// ListenKafkaManager listenKafkaManager = entry.getValue() ;
// String kafkaInfo = entry.getKey();
// KfkConsumer.stopKfkConsumerThreads(Integer.valueOf(kafkaInfo.split("#")[0]), kafkaInfo.split("#")[1]);
// LinkedBlockingDeque<String> cacheQueue = listenKafkaManager.getQueue() ;
// if (cacheQueue.size() == 0) {
// listenKafkaManager.setSwitch(false);
// continue ;
// }
// cacheQueue.put("__Exit__");
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// log.error("TaskFileUtils>>> clearTaskQueue err "+e);
// }
// }
// }
//
// }
//}

13
cl_stream_datasave/src/test/java/AboutMysql.java

@ -0,0 +1,13 @@
//import com.bfd.mf.datasave.tools.DBUtil;
//import com.bfd.mf.entity.mysql.SubjectTask;
//import org.junit.Test;
//
//public class AboutMysql {
//
//
// @Test
// public void test1(){
// DBUtil.init("../etc/db.properties");
// SubjectTask.loadSubjectTask();
// }
//}

19
cl_stream_datasave/src/test/java/CreatIndex.java

@ -0,0 +1,19 @@
public class CreatIndex {
// 110 话题索引ES
// public static void main(String[] args) {
// int bussinessType = 1;
// int esServerName = 2;
// String indexType = "docs";
// try {
// for (int i = 0 ; i < 00 ; i ++) {
// String indexName = "cl_subject_00"+i ;
// System.out.println(indexName);
// ElastiProducer elastiProducer = ElastiProducer.getInstance(bussinessType, esServerName, indexName, indexType);
// System.out.println(elastiProducer);
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
}

32
cl_stream_datasave/src/test/java/Test1.java

@ -0,0 +1,32 @@
import com.bfd.crawler.utils.JsonUtils;
import com.bfd.mf.datasave.tools.ReadLine;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Test1 {
public static void main(String[] args) {
List<String> list = ReadLine.readLine(new File("E:\\work\\workspace2020\\socialx\\SocialX_Stream\\SocialX_Stream/es.txt"));
Map<String,Object> map1 = new HashMap<>();
for (String line:list) {
System.out.println(line);
String key = line.split("\t@@@\t")[0];
String type = line.split("\t@@@\t")[1];
if(type.contains("Long")){
}
// Map<String,Object> map2 = new HashMap<>();
Map<String,Object> map3 = new HashMap<>();
map3.put("type","keyword");
map3.put("index",true);
map1.put(line,map3);
// map1.put(map2);
}
System.out.println(JsonUtils.toJSONString(map1));
}
}

205
cl_stream_mybatis/cl_stream_mybatis.iml

@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/webapp" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/BfdRedisTools-2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/dataManager-0.0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/hanlp-portable-1.6.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/kafka-0.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/taskManager-0.0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/utils-0.0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../jarlib/utils-3.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.4.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.4.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.4.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.4.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.4.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.6" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.2.4.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:1.4.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-jdbc:8.5.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-juli:8.5.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.3.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.1" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.5" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.1" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.1.22" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j:1.3.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.22" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.22" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.22" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.4.3.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:1.4.3.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.4.3.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:2.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.json:json:20140107" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.5.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.5.RELEASE" level="project" />
<orderEntry type="module" module-name="serviceManager" />
<orderEntry type="module" module-name="dataSaveManager" />
<orderEntry type="library" name="Maven: javax.servlet:jstl:1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-jasper:8.5.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.6" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jdt.core.compiler:ecj:4.5.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.15" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
<orderEntry type="library" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.5" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
<orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch:elasticsearch:6.0.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-core:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-analyzers-common:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-backward-codecs:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-grouping:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-highlighter:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-join:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-memory:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-misc:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-queries:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-queryparser:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-sandbox:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-spatial:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-spatial-extras:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-spatial3d:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-suggest:7.0.1" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch:securesm:1.1" level="project" />
<orderEntry type="library" name="Maven: net.sf.jopt-simple:jopt-simple:5.0.2" level="project" />
<orderEntry type="library" name="Maven: com.carrotsearch:hppc:0.7.1" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.6" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.tdunning:t-digest:3.0" level="project" />
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.9" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.6.2" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch:jna:4.4.0-1" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.client:transport:6.0.0" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:transport-netty4-client:6.0.0" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.13.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.13.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.13.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.13.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.13.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.13.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.13.Final" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:reindex-client:6.0.0" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.client:elasticsearch-rest-client:6.0.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.5" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:lang-mustache-client:6.0.0" level="project" />
<orderEntry type="library" name="Maven: com.github.spullara.mustache.java:compiler:0.9.3" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:percolator-client:6.0.0" level="project" />
<orderEntry type="library" name="Maven: org.elasticsearch.plugin:parent-join-client:6.0.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.40" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
</component>
</module>

180
cl_stream_mybatis/pom.xml

@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--<parent>-->
<!--<artifactId>cl_stream</artifactId>-->
<!--<groupId>com.bfd.mf</groupId>-->
<!--<version>2.0-SNAPSHOT</version>-->
<!--</parent>-->
<modelVersion>4.0.0</modelVersion>
<artifactId>cl_stream_mybatis</artifactId>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--<spring-boot-version>2.0.0.RELEASE</spring-boot-version>-->
<skipTests>true</skipTests>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.1.22</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
<version>1.3.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.bfd.mf</groupId>
<artifactId>serviceManager</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.bfd.mf</groupId>
<artifactId>dataSaveManager</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.2.RELEASE</version>
<configuration>
<mainClass>com.bfd.mf.TestmybatisApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>${project.basedir}/src/main/webapp</directory>
<!--注意此次必须要放在此目录下才能被访问到-->
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
</build>
</project>

18
cl_stream_mybatis/src/main/java/com/bfd/mf/TestmybatisApplication.java

@ -0,0 +1,18 @@
package com.bfd.mf;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@MapperScan("com.bfd.mf.mapper")
public class TestmybatisApplication {
public static void main(String[] args) {
try {
SpringApplication.run(TestmybatisApplication.class, args);
}catch (Exception e){
e.printStackTrace();
}
}
}

58
cl_stream_mybatis/src/main/java/com/bfd/mf/common/ExternalConnCache.java

@ -0,0 +1,58 @@
package com.bfd.mf.common;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.Settings.Builder;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.transport.client.PreBuiltTransportClient;
import org.springframework.stereotype.Component;
import java.net.InetAddress;
@Component
public class ExternalConnCache {
private static final String hosts = "172.18.1.148";
private static final Integer port = 9303;
private static final String clusterName = "SQ_Mini_new";
private static TransportClient transportClient ;
/*private static String hosts;
private static String port;
private static String clusterName;
*/
/*@Value("${externalConn.cache.hosts}")
public void setHosts(String hosts) {
ExternalConnCache.hosts = hosts;
}
@Value("${externalConn.cache.port}")
public void setPort(String port) {
ExternalConnCache.port = port;
}
@Value("${externalConn.cache.clusterName}")
public void setClusterName(String clusterName) {
ExternalConnCache.clusterName = clusterName;
}*/
public static TransportClient getTransportClient(){
if(transportClient == null){
try{
Builder builder =
Settings.builder().put("cluster.name", clusterName).put("client.transport.sniff", false);
Settings esSettings = builder.build();
transportClient = new PreBuiltTransportClient(esSettings);
transportClient.addTransportAddress(new TransportAddress(InetAddress.getByName(hosts),Integer.valueOf(port)));
}catch (Exception ex){
ex.printStackTrace();
new RuntimeException(ex);
}finally {
}
}
return transportClient;
}
}

38
cl_stream_mybatis/src/main/java/com/bfd/mf/common/PageBean.java

@ -0,0 +1,38 @@
package com.bfd.mf.common;
import java.io.Serializable;
public class PageBean<T> implements Serializable {
private static final long serialVersionUID = 8656597559014685635L;
private long total; //总记录数
private long quarycount; // 当前页的数量 <= pageSize该属性来自ArrayList的size属性
public PageBean() {
}
public PageBean(long total, long quarycount) {
this.total = total;
this.quarycount = quarycount;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
public long getQuarycount() {
return quarycount;
}
public void setQuarycount(long quarycount) {
this.quarycount = quarycount;
}
}

11
cl_stream_mybatis/src/main/java/com/bfd/mf/config/XmlConfiguration.java

@ -0,0 +1,11 @@
package com.bfd.mf.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
@Configuration
@ImportResource({"classpath:/com/bfd/mf/spring/applicationContext.xml"})
public class XmlConfiguration {
}

256
cl_stream_mybatis/src/main/java/com/bfd/mf/controller/CompanyController.java

@ -0,0 +1,256 @@
package com.bfd.mf.controller;
import com.bfd.mf.common.PageBean;
import com.bfd.mf.entity.DataSaveManager;
import com.bfd.mf.entity.FieldNormaliz;
import com.bfd.mf.entity.StatInfo;
import com.bfd.mf.service.rmi.ServiceManager;
import com.bfd.mf.service.FieldNormalizService;
import com.bfd.mf.service.MetaSearchService;
import com.bfd.mf.service.StatService;
import com.bfd.mf.tools.ConnectionRmi;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author hanzhitong
* @version 1.0
* @description com.uniocredit.controller
* @date 2018/5/15
*/
@Controller
@RequestMapping("/web")
public class CompanyController {
private Logger logger = LoggerFactory.getLogger(CompanyController.class);
@Autowired
private FieldNormalizService fieldNormalizService;
@Autowired
private MetaSearchService metaSearchService ;
@Autowired
private StatService statService ;
private ServiceManager serviceManager = ConnectionRmi.getServiceManager();
private DataSaveManager dataSaveManager = ConnectionRmi.getDataSaveManager();
public Map<Integer,Map<String,Object>> taskInfos = new HashMap<Integer,Map<String,Object>>();
private SimpleDateFormat ddf = new SimpleDateFormat("yyyy-MM-dd");
@RequestMapping(value = { "/upload" }, method = RequestMethod.GET)
public String upload() {
return "importdb" ;
}
/**
* 重载
*/
@RequestMapping(value = { "/upload" }, method = RequestMethod.POST)
public String upload(HttpServletRequest request,
@RequestParam(value="myfile") MultipartFile[] files) {
List<String> fileNames = new ArrayList<String>();
List<String> errfileNames = new ArrayList<String>();
String uploadFile = request.getSession().getServletContext().getRealPath("/")+"upload/";
File dir = new File(uploadFile);
if(!dir.exists()){
dir.mkdir();
}
for (MultipartFile file: files){
String fileName=file.getOriginalFilename();
System.out.println(fileName);
File serverFile = new File(uploadFile + fileName);
try {
file.transferTo(serverFile);
// excelToDB.exc_import_db(uploadFile + fileName);
if(serverFile.exists() && serverFile.isFile())
serverFile.delete();
fileNames.add(fileName);
} catch (IOException e) {
errfileNames.add(fileName);
logger.error(fileName+"--上传到服务器报错!!");
e.printStackTrace();
} catch (Exception e) {
errfileNames.add(fileName);
e.printStackTrace();
}
}
if(errfileNames.size() > 0){
request.setAttribute("errfileNames",errfileNames);
}
request.setAttribute("fileNames",fileNames);
return "importdb" ;
}
@RequestMapping(value = { "/taskInfo" }, method = RequestMethod.POST)
public String addTask(@RequestParam("kafkaSerName") String kafkaSerName,
@RequestParam("kafkaName") String kafkaName,@RequestParam("groupId") String groupId,
@RequestParam("bussinessType") String bussinessType,@RequestParam("esSerName") String esSerName,
@RequestParam("esSuffixNames") String esSuffixNames, @RequestParam("projectName") String projectName,
@RequestParam("isSemtimentApi") String isSemtimentApi) {
FieldNormaliz fieldNormaliz = new FieldNormaliz();
fieldNormaliz.setEsSerName(Integer.valueOf(esSerName));
fieldNormaliz.setBussinessType(Integer.valueOf(bussinessType));
fieldNormaliz.setEsSuffixNames(esSuffixNames);
fieldNormaliz.setKafkaName(kafkaName);
fieldNormaliz.setGroupId(groupId);
fieldNormaliz.setKafkaSerName(Integer.valueOf(kafkaSerName));
fieldNormaliz.setProjectName(projectName);
fieldNormaliz.setIsSemtimentApi(Integer.valueOf(isSemtimentApi));
fieldNormaliz.setKafkaSuffixName("filter1");
fieldNormalizService.add(fieldNormaliz) ;
return "importdb" ;
}
/**
* 获取任务列表
* @return
*/
@RequestMapping(value = { "/tasklist" }, method = RequestMethod.POST)
@ResponseBody
public String tasklist() {
List<FieldNormaliz> fieldNormalizs = fieldNormalizService.getFieldNormalizList() ;
Map<String, Object> map = new HashMap<String, Object>();
map.put("fieldNormalizs", fieldNormalizs);
String result = JSONObject.fromObject(map).toString();
return result ;
}
@RequestMapping(value = { "/startTask" }, method = RequestMethod.POST)
public String startTask(int id){
FieldNormaliz fieldNormaliz = fieldNormalizService.getFieldNormalizById(id);
Map<String,Object> map = new HashMap<String,Object>();
map.put("kafkaName", fieldNormaliz.getKafkaName()) ;
map.put("taskid", fieldNormaliz.getId()) ;
map.put("busniessType", fieldNormaliz.getBussinessType()) ; // 2=后台 1=前台
map.put("esServerName",fieldNormaliz.getEsSerName()); // 1= 后台 2=前台
map.put("indexName",fieldNormaliz.getEsSuffixNames());
taskInfos.put(fieldNormaliz.getId(), map);
try {
System.out.println("任务开始 ~" + fieldNormaliz.getId());
//serviceManager.addTaskName(fieldNormaliz);
serviceManager.addTaskName(fieldNormaliz);
if(fieldNormaliz.getIsSemtimentApi() == 1){
String kafkaName = fieldNormaliz.getKafkaName() ;
String kafkasuffixName = fieldNormaliz.getKafkaSuffixName() ;
fieldNormaliz.setKafkaName(kafkaName+"_"+kafkasuffixName);
System.out.println(fieldNormaliz.toString()+"fieldNormaliz是000");
dataSaveManager.addTaskName(fieldNormaliz);
}
} catch (RemoteException e) {
e.printStackTrace();
}
fieldNormalizService.update(id, fieldNormaliz);
return "importdb";
}
@RequestMapping(value = { "/stopTask" }, method = RequestMethod.POST)
public String stopTask(int id){
FieldNormaliz fieldNormaliz = fieldNormalizService.getFieldNormalizById(id);
fieldNormalizService.delete(id);
if(fieldNormaliz != null){
String kafkaName = "";
try{
kafkaName = fieldNormaliz.getKafkaName() ;
}catch(Exception e){
e.printStackTrace();
}
if(taskInfos.containsKey(id)){
taskInfos.remove(id);
}
try {
if(StringUtils.isNotBlank(kafkaName)){
int kafkaSerName= fieldNormaliz.getKafkaSerName() ;
serviceManager.stopImprotTask(kafkaSerName,kafkaName) ;
if(fieldNormaliz.getIsSemtimentApi() == 1){
String kafkasuffixName = fieldNormaliz.getKafkaSuffixName() ;
dataSaveManager.stopImprotTask(kafkaSerName,kafkaName+"_"+kafkasuffixName);
}
}
} catch (RemoteException e) {
e.printStackTrace();
}
}
return "importdb";
}
@RequestMapping(value = { "/refreshStats" }, method = RequestMethod.POST)
@ResponseBody
public String refreshStats(){
List<Map<String, Object>> statdatas= new ArrayList<Map<String, Object>>();
try{
// if(taskInfos.size() > 0){
// for(Map.Entry<Integer,Map<String,Object>> entry : taskInfos.entrySet()){
// Map<String,Object> taski = entry.getValue() ;
// int kafkaNum = serviceManager.getNowKafkaNum(taski) ; // 获取 kafka 当前条数
// String checkDay = ddf.format(new Date());
// String kafkaName = taski.get("kafkaName").toString();
// String indexName = taski.get("indexName").toString() ;
// PageBean pageBean = metaSearchService.metaSearchPageList(indexName, new Date().getTime()) ;
// long quaryesToalNum= pageBean.getTotal();
// long quaryesDiffrows = pageBean.getQuarycount();
// StatInfo statInfo = statService.getStatInfoByCheck(checkDay, kafkaName, indexName);
// if(statInfo != null){
// int kafkaN = statInfo.getKafkaRows() ;
// int esN = statInfo.getIndexRows() ;
// int esdiffNum = statInfo.getDiffRows() ;
// if(kafkaNum != kafkaN || esN != quaryesToalNum || quaryesDiffrows != esdiffNum ){
// statService.update(checkDay, kafkaName, indexName, quaryesToalNum , quaryesDiffrows, kafkaNum);
// }
// }else{
// StatInfo statInfonew = new StatInfo();
// statInfonew.setCheckDay(checkDay);
// statInfonew.setKafkaName(kafkaName);
// statInfonew.setKafkaRows(kafkaNum);
// statInfonew.setIndexName(indexName);
// statInfonew.setIndexRows((int) quaryesToalNum);
// statInfonew.setDiffRows((int) quaryesDiffrows);
// statService.add(statInfonew);
// }
// }
// }
List<StatInfo> statlist = statService.getStatInfo();
if(statlist.size() > 0){
Map<String, Object> statdata ;
for(StatInfo statInfo : statlist){
statdata = new HashMap<String, Object>();
statdata.put("indexName", statInfo.getIndexName());
statdata.put("kafkaNum", statInfo.getKafkaRows());
statdata.put("esNum", statInfo.getIndexRows());
statdata.put("diffesNum", statInfo.getDiffRows());
statdata.put("checkDay", statInfo.getCheckDay());
statdata.put("kafkaName", statInfo.getKafkaName());
statdatas.add(statdata);
}
}
}catch(Exception e){
e.printStackTrace();
}
Map<String, Object> map = new HashMap<String, Object>();
map.put("autoRefresh", statdatas);
String result = JSONObject.fromObject(map).toString();
return result;
}
}

39
cl_stream_mybatis/src/main/java/com/bfd/mf/entity/FieldInfo.java

@ -0,0 +1,39 @@
package com.bfd.mf.entity;
import java.util.List;
public class FieldInfo {
private String kafka_type ;
private List<String> kafkaJsonString ;
private List<String> kafkaJsonArray ;
public String getKafka_type() {
return kafka_type;
}
public void setKafka_type(String kafka_type) {
this.kafka_type = kafka_type;
}
public List<String> getKafkaJsonString() {
return kafkaJsonString;
}
public void setKafkaJsonString(List<String> kafkaJsonString) {
this.kafkaJsonString = kafkaJsonString;
}
public List<String> getKafkaJsonArray() {
return kafkaJsonArray;
}
public void setKafkaJsonArray(List<String> kafkaJsonArray) {
this.kafkaJsonArray = kafkaJsonArray;
}
}

258
cl_stream_mybatis/src/main/java/com/bfd/mf/entity/FieldNormaliz.java

@ -0,0 +1,258 @@
package com.bfd.mf.entity;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
public class FieldNormaliz implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id ;
private String kafkaName ;
private int kafkaSerName ;
private int esSerName ;
private String esSuffixNames ;
private String docType ;
private int isSemtimentApi ;
private boolean ishlKeyword ;
private int bussinessType ;
private Map<String, String> fieldNormalizeContentMap ;
private Map<String, String> fieldNormalizeCommentMap ;
private Map<Integer,Map<String, Map<String, String>>> fieldDataMap ;
private Map<String, FieldInfo> fieldInfo ;
private String groupId ;
private String createTime ;
private String finshTime ;
private int status ;
private String projectName ;
private Map<Integer,Map<String, Map<String, String>>> userfieldDataMap ;
private String kafkaSuffixName ;
public String getKafkaSuffixName() {
return kafkaSuffixName;
}
public void setKafkaSuffixName(String kafkaSuffixName) {
this.kafkaSuffixName = kafkaSuffixName;
}
public String getKafkaName() {
return kafkaName;
}
public void setKafkaName(String kafkaName) {
this.kafkaName = kafkaName;
}
public int getKafkaSerName() {
return kafkaSerName;
}
public void setKafkaSerName(int kafkaSerName) {
this.kafkaSerName = kafkaSerName;
}
public int getEsSerName() {
return esSerName;
}
public void setEsSerName(int esSerName) {
this.esSerName = esSerName;
}
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType;
}
public int getIsSemtimentApi() {
return isSemtimentApi;
}
public void setIsSemtimentApi(int isSemtimentApi) {
this.isSemtimentApi = isSemtimentApi;
}
public int getBussinessType() {
return bussinessType;
}
public void setBussinessType(int bussinessType) {
this.bussinessType = bussinessType;
}
public Map<String, String> getFieldNormalizeContentMap() {
return fieldNormalizeContentMap;
}
public void setFieldNormalizeContentMap(Map<String, String> fieldNormalizeContentMap) {
this.fieldNormalizeContentMap = fieldNormalizeContentMap;
}
public Map<String, String> getFieldNormalizeCommentMap() {
return fieldNormalizeCommentMap;
}
public void setFieldNormalizeCommentMap(Map<String, String> fieldNormalizeCommentMap) {
this.fieldNormalizeCommentMap = fieldNormalizeCommentMap;
}
public Map<Integer,Map<String, Map<String, String>>> getFieldDataMap() {
return fieldDataMap;
}
public Map<String,Map<String, String>> getFieldDataMapByType(String type){
return fieldDataMap.get(type);
}
public void addFieldDataMap(String type, Map<String, Object> fixFieldData, Integer bussinessType){
Set<String> keys = fixFieldData.keySet() ;
Map<String,Map<String, String>> fieldMaps = fieldDataMap.get(bussinessType) ;
Map<String, String> fieldMap = fieldMaps.get(type) ;
for(String key : keys){
fieldMap.put(key, key) ;
}
fieldMaps.put(type, fieldMap);
fieldDataMap.put(bussinessType, fieldMaps) ;
}
public void setFieldDataMap(Map<Integer,Map<String, Map<String, String>>> fieldDataMap) {
this.fieldDataMap = fieldDataMap;
}
public Map<String, FieldInfo> getFieldInfo() {
return fieldInfo;
}
public void setFieldInfo(Map<String, FieldInfo> fieldInfo) {
this.fieldInfo = fieldInfo;
}
public boolean isIshlKeyword() {
return ishlKeyword;
}
public void setIshlKeyword(boolean ishlKeyword) {
this.ishlKeyword = ishlKeyword;
}
public String getEsSuffixNames() {
return esSuffixNames;
}
public void setEsSuffixNames(String esSuffixNames) {
this.esSuffixNames = esSuffixNames;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getFinshTime() {
return finshTime;
}
public void setFinshTime(String finshTime) {
this.finshTime = finshTime;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public Map<Integer, Map<String, Map<String, String>>> getUserfieldDataMap() {
return userfieldDataMap;
}
public void setUserfieldDataMap(Map<Integer, Map<String, Map<String, String>>> userfieldDataMap) {
this.userfieldDataMap = userfieldDataMap;
}
@Override
public String toString() {
return "FieldNormaliz{" +
"id=" + id +
", kafkaName='" + kafkaName + '\'' +
", kafkaSerName=" + kafkaSerName +
", esSerName=" + esSerName +
", esSuffixNames='" + esSuffixNames + '\'' +
", docType='" + docType + '\'' +
", isSemtimentApi=" + isSemtimentApi +
", ishlKeyword=" + ishlKeyword +
", bussinessType=" + bussinessType +
", fieldNormalizeContentMap=" + fieldNormalizeContentMap +
", fieldNormalizeCommentMap=" + fieldNormalizeCommentMap +
", fieldDataMap=" + fieldDataMap +
", fieldInfo=" + fieldInfo +
", groupId='" + groupId + '\'' +
", createTime='" + createTime + '\'' +
", finshTime='" + finshTime + '\'' +
", status=" + status +
", projectName='" + projectName + '\'' +
", userfieldDataMap=" + userfieldDataMap +
", kafkaSuffixName='" + kafkaSuffixName + '\'' +
'}';
}
}

22
cl_stream_mybatis/src/main/java/com/bfd/mf/entity/Record.java

@ -0,0 +1,22 @@
package com.bfd.mf.entity;
import java.util.List;
import java.util.Map;
public class Record {
private Long counts;
private List<Map<String, Object>> records;
public Long getCounts() {
return counts;
}
public void setCounts(Long counts) {
this.counts = counts;
}
public List<Map<String, Object>> getRecords() {
return records;
}
public void setRecords(List<Map<String, Object>> records) {
this.records = records;
}
}

84
cl_stream_mybatis/src/main/java/com/bfd/mf/entity/StatInfo.java

@ -0,0 +1,84 @@
package com.bfd.mf.entity;
import java.io.Serializable;
public class StatInfo implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String checkDay ;
private String kafkaName ;
private int kafkaRows ;
private String indexName ;
private int indexRows ;
private int diffRows;
private String addTime ;
public String getCheckDay() {
return checkDay;
}
public void setCheckDay(String checkDay) {
this.checkDay = checkDay;
}
public String getKafkaName() {
return kafkaName;
}
public void setKafkaName(String kafkaName) {
this.kafkaName = kafkaName;
}
public int getKafkaRows() {
return kafkaRows;
}
public void setKafkaRows(int kafkaRows) {
this.kafkaRows = kafkaRows;
}
public String getIndexName() {
return indexName;
}
public void setIndexName(String indexName) {
this.indexName = indexName;
}
public int getIndexRows() {
return indexRows;
}
public void setIndexRows(int indexRows) {
this.indexRows = indexRows;
}
public int getDiffRows() {
return diffRows;
}
public void setDiffRows(int diffRows) {
this.diffRows = diffRows;
}
public String getAddTime() {
return addTime;
}
public void setAddTime(String addTime) {
this.addTime = addTime;
}
}

86
cl_stream_mybatis/src/main/java/com/bfd/mf/es/ESHandler.java

@ -0,0 +1,86 @@
package com.bfd.mf.es;
import com.bfd.mf.common.ExternalConnCache;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import java.text.SimpleDateFormat;
import java.util.Date;
@Repository
public class ESHandler {
private static final Logger logger = LoggerFactory.getLogger(ESHandler.class);
private static final SimpleDateFormat startddf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
private static final SimpleDateFormat nowddf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public long synoPageSearch(String indexName, long nowcreateTime) {
TransportClient client = ExternalConnCache.getTransportClient();
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
if(nowcreateTime != 0){
String startTime = startddf.format(new Date(nowcreateTime));
String nowTime = nowddf.format(new Date(nowcreateTime)) ;
queryBuilder.must(QueryBuilders.rangeQuery("createTimeStr").from(startTime).to(nowTime));
}else{
queryBuilder.must(QueryBuilders.matchAllQuery());
}
SearchResponse response;
try {
SearchRequestBuilder srb = client.prepareSearch(indexName)
.setTypes("docs")
.setQuery(queryBuilder);
response = srb.get();
} catch (Exception e) {
e.printStackTrace();
return 0 ;
}
Long count = response.getHits().getTotalHits();
return count ;
}
// public static void main(String[] args) {
// String indexName = "overseas_content";
//// JSONArray jsonArray = new JSONArray();
//// jsonArray.add("{\"id\":259,\"question\":\"人工智能是指什么\",\"answer\":\"AI,人工智能它是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学。\",\"createdBy\":1,\"createTime\":1541757803,\"lastModifiedBy\":1,\"lastModifiedTime\":1541757803}");
//
// //jsonArray.add("{\"id\":4440,\"question\":\"人工智能指什么\",\"answer\":\"AI,人工智能它是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学。\",\"createdBy\":1,\"createTime\":1541757803,\"lastModifiedBy\":1,\"lastModifiedTime\":1541757803}");
//
// //System.out.println(jsonArray.toJSONString());
//
// //batchInsert(indexName, type, jsonArray);
//
// //update(jsonArray, indexName, type);
//
// //String ids = "24,25";
// //deleteByIDs(indexName, type, ids);
//// ChatPairs chatPairs = new ChatPairs();
//// chatPairs.setAnswer("请问能帮我介绍一下AI");
//// chatPairs.setQuestion("请问能帮我介绍一下AI");
//// chatSearch(indexName,type, chatPairs);
//
//// Synonym synonym = new Synonym();
//// synonym.setRoot("抓取");
//// synoSearch(indexName,type, 1, 10, synonym);
//
// //exportIndex(indexName);
// ESHandler esh = new ESHandler();
// long a= esh.synoPageSearch(indexName,0); //13978
// System.out.println(a);
// }
}

23
cl_stream_mybatis/src/main/java/com/bfd/mf/mapper/FieldNormalizMapper.java

@ -0,0 +1,23 @@
package com.bfd.mf.mapper;
import com.bfd.mf.entity.FieldNormaliz;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
@Mapper
public interface FieldNormalizMapper {
FieldNormaliz getFieldNormalizById(Integer id);
public List<FieldNormaliz> getFieldNormalizList();
public int add(FieldNormaliz fieldNormaliz);
public int update(@Param("id") Integer id, @Param("fieldNormaliz") FieldNormaliz fieldNormaliz);
public int delete(Integer id);
}

20
cl_stream_mybatis/src/main/java/com/bfd/mf/mapper/StatMapper.java

@ -0,0 +1,20 @@
package com.bfd.mf.mapper;
import com.bfd.mf.entity.StatInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface StatMapper {
public List<StatInfo> getStatInfo();
public int add(StatInfo statInfo);
public int update(@Param("checkDay") String checkDay, @Param("kafkaName") String kafkaName, @Param("indexName") String indexName, @Param("indexRows") long indexRows, @Param("diffRows") long diffRows, @Param("kafkaRows") int kafkaRows);
public StatInfo getStatInfoByCheck(@Param("checkDay") String checkDay, @Param("kafkaName") String kafkaName, @Param("indexName") String indexName);
}

12
cl_stream_mybatis/src/main/java/com/bfd/mf/sendTask/SendTask.java

@ -0,0 +1,12 @@
package com.bfd.mf.sendTask;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Map;
public interface SendTask extends Remote{
public void backTopic(Map<String, Object> dataMap) throws RemoteException;
}

23
cl_stream_mybatis/src/main/java/com/bfd/mf/sendTask/impl/SendTaskImpl.java

@ -0,0 +1,23 @@
package com.bfd.mf.sendTask.impl;
import com.bfd.mf.sendTask.SendTask;
import java.io.Serializable;
import java.rmi.RemoteException;
import java.util.Map;
public class SendTaskImpl implements SendTask,Serializable,Cloneable{
/**
*
*/
private static final long serialVersionUID = 6269469187077502624L;
@Override
public void backTopic(Map<String, Object> dataMap) throws RemoteException {
// TODO Auto-generated method stub
}
}

22
cl_stream_mybatis/src/main/java/com/bfd/mf/service/FieldNormalizService.java

@ -0,0 +1,22 @@
package com.bfd.mf.service;
import com.bfd.mf.entity.FieldNormaliz;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public interface FieldNormalizService {
FieldNormaliz getFieldNormalizById(Integer id);
public List<FieldNormaliz> getFieldNormalizList();
public int add(FieldNormaliz fieldNormaliz);
public int update(Integer id, FieldNormaliz fieldNormaliz);
public int delete(Integer id);
}

8
cl_stream_mybatis/src/main/java/com/bfd/mf/service/MetaSearchService.java

@ -0,0 +1,8 @@
package com.bfd.mf.service;
import com.bfd.mf.common.PageBean;
public interface MetaSearchService {
PageBean metaSearchPageList(String indexName, long createTime);
}

17
cl_stream_mybatis/src/main/java/com/bfd/mf/service/StatService.java

@ -0,0 +1,17 @@
package com.bfd.mf.service;
import com.bfd.mf.entity.StatInfo;
import java.util.List;
public interface StatService {
public List<StatInfo> getStatInfo();
public int add(StatInfo statInfo);
public int update(String checkDay, String kafkaName, String indexName, long quaryesToalNum, long quaryesDiffrows, int kafkaNum);
public StatInfo getStatInfoByCheck(String checkDay, String kafkaName, String indexName);
}

46
cl_stream_mybatis/src/main/java/com/bfd/mf/service/impl/FieldNormalizServiceImpl.java

@ -0,0 +1,46 @@
package com.bfd.mf.service.impl;
import com.bfd.mf.entity.FieldNormaliz;
import com.bfd.mf.mapper.FieldNormalizMapper;
import com.bfd.mf.service.FieldNormalizService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class FieldNormalizServiceImpl implements FieldNormalizService {
@Autowired
private FieldNormalizMapper fieldNormalizMapper ;
@Override
public FieldNormaliz getFieldNormalizById(Integer id) {
// TODO Auto-generated method stub
return fieldNormalizMapper.getFieldNormalizById(id);
}
@Override
public List<FieldNormaliz> getFieldNormalizList() {
// TODO Auto-generated method stub
return fieldNormalizMapper.getFieldNormalizList();
}
@Override
public int add(FieldNormaliz fieldNormaliz) {
// TODO Auto-generated method stub
return fieldNormalizMapper.add(fieldNormaliz);
}
@Override
public int update(Integer id, FieldNormaliz fieldNormaliz) {
// TODO Auto-generated method stub
return fieldNormalizMapper.update(id, fieldNormaliz);
}
@Override
public int delete(Integer id) {
// TODO Auto-generated method stub
return fieldNormalizMapper.delete(id);
}
}

35
cl_stream_mybatis/src/main/java/com/bfd/mf/service/impl/MetaSearchServiceImpl.java

@ -0,0 +1,35 @@
package com.bfd.mf.service.impl;
import com.bfd.mf.common.PageBean;
import com.bfd.mf.es.ESHandler;
import com.bfd.mf.service.MetaSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MetaSearchServiceImpl implements MetaSearchService {
@Autowired
private ESHandler esHandler;
@Override
public PageBean metaSearchPageList(String indexName, long createTime) {
// TODO Auto-generated method stub
try {
long quarycommentCount = esHandler.synoPageSearch(indexName+"_comment",createTime);
long quarycontentCount = esHandler.synoPageSearch(indexName+"_content",createTime);
long totalcommentCount = esHandler.synoPageSearch(indexName+"_comment",0);
long totalcontentCount = esHandler.synoPageSearch(indexName+"_content",0);
PageBean pageBean = new PageBean();
pageBean.setTotal(totalcommentCount + totalcontentCount);
pageBean.setQuarycount(quarycommentCount + quarycontentCount);
return pageBean;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}

42
cl_stream_mybatis/src/main/java/com/bfd/mf/service/impl/StatServiceImpl.java

@ -0,0 +1,42 @@
package com.bfd.mf.service.impl;
import com.bfd.mf.entity.StatInfo;
import com.bfd.mf.mapper.StatMapper;
import com.bfd.mf.service.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StatServiceImpl implements StatService {
@Autowired
private StatMapper statMapper ;
@Override
public List<StatInfo> getStatInfo() {
// TODO Auto-generated method stub
return statMapper.getStatInfo();
}
@Override
public int add(StatInfo statInfo) {
// TODO Auto-generated method stub
return statMapper.add(statInfo);
}
@Override
public int update(String checkDay,String kafkaName,String indexName,long quaryesToalNum ,long quaryesDiffrows,int kafkaNum) {
// TODO Auto-generated method stub
return statMapper.update(checkDay,kafkaName,indexName, quaryesToalNum, quaryesDiffrows, kafkaNum);
}
@Override
public StatInfo getStatInfoByCheck(String checkDay, String kafkaName, String indexName) {
// TODO Auto-generated method stub
return statMapper.getStatInfoByCheck(checkDay, kafkaName, indexName);
}
}

53
cl_stream_mybatis/src/main/java/com/bfd/mf/tools/ConnectionRmi.java

@ -0,0 +1,53 @@
package com.bfd.mf.tools;
import com.bfd.mf.entity.DataSaveManager;
import com.bfd.mf.service.rmi.ServiceManager;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class ConnectionRmi {
private static ServiceManager serviceManager ;
private static DataSaveManager dataSaveManager ;
private ConnectionRmi() {}
private static ServiceManager initServiceManager() {
Registry registry;
try {
registry = LocateRegistry.getRegistry("127.0.0.1", 8899);
serviceManager = (ServiceManager) registry.lookup("serviceManager");
} catch (RemoteException e) {
e.printStackTrace();
} catch (NotBoundException e) {
e.printStackTrace();
}
return serviceManager;
}
private static DataSaveManager initDataSaveManager() {
Registry registry;
try {
registry = LocateRegistry.getRegistry("127.0.0.1", 1099);
dataSaveManager = (DataSaveManager) registry.lookup("dataSaveManager");
} catch (RemoteException e) {
e.printStackTrace();
} catch (NotBoundException e) {
e.printStackTrace();
}
return dataSaveManager;
}
public static ServiceManager getServiceManager(){
return initServiceManager();
}
public static DataSaveManager getDataSaveManager(){
return initDataSaveManager();
}
}

18
cl_stream_mybatis/src/main/resources/application.properties

@ -0,0 +1,18 @@
# mysql
#spring.datasource.url=jdbc:mysql://192.168.67.152/field_normaliz?useUnicode=true&characterEncoding=utf-8
#spring.datasource.username=root
#spring.datasource.password=Bfd123!@#
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://172.26.11.113:3306/bfd_sq_data?useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=bfd123
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.mvc.view.suffix=.jsp
spring.mvc.view.prefix=/WEB-INF/
spring.mvc.static-path-pattern=/static/**
#mybatis
mybatis.mapperLocations=classpath:com/bfd/mf/mapper/*.xml

63
cl_stream_mybatis/src/main/resources/com/bfd/mf/mapper/fieldNormaliz.xml

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bfd.mf.mapper.FieldNormalizMapper" >
<resultMap id="BaseResultMap" type="com.bfd.mf.entity.FieldNormaliz" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="kafka_server" property="kafkaSerName" jdbcType="INTEGER" />
<result column="es_server" property="esSerName" jdbcType="VARCHAR" />
<result column="bussiness_type" property="bussinessType" jdbcType="INTEGER" />
<result column="es_index_name" property="esSuffixNames" jdbcType="VARCHAR" />
<result column="kafka_topic" property="kafkaName" jdbcType="VARCHAR" />
<result column="groupid" property="groupId" jdbcType="VARCHAR"/>
<result column="project_name" property="projectName" jdbcType="VARCHAR"/>
<result column="is_semtiment_api" property="isSemtimentApi" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="finish_time" property="finshTime" jdbcType="TIMESTAMP"/>
<result column="status" property="status" jdbcType="INTEGER" />
<result column="kafka_suffix_name" property="kafkaSuffixName" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List" >
id, kafka_server, es_server, bussiness_type,es_index_name,kafka_topic,groupid,project_name,is_semtiment_api,kafka_suffix_name
</sql>
<select id="getFieldNormalizList" resultMap="BaseResultMap" >
SELECT
id,kafka_server,kafka_topic,groupid,es_server,bussiness_type,es_index_name,project_name,is_semtiment_api,STATUS,kafka_suffix_name,
DATE_FORMAT(finish_time,'%Y-%m-%d %H:%i:%s') AS finish_time,
DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%s') AS create_time
FROM
mf_kafka_info
</select>
<select id="getFieldNormalizById" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
SELECT
<include refid="Base_Column_List" />
FROM mf_kafka_info
WHERE id = #{id}
</select>
<insert id="add" parameterType="com.bfd.mf.entity.FieldNormaliz" >
INSERT INTO
mf_kafka_info
(kafka_server,kafka_topic,groupid,es_server,bussiness_type,es_index_name,create_time,project_name,is_semtiment_api,kafka_suffix_name)
VALUES
(#{kafkaSerName}, #{kafkaName}, #{groupId}, #{esSerName}, #{bussinessType}, #{esSuffixNames}, now(), #{projectName}, #{isSemtimentApi}, #{kafkaSuffixName})
</insert>
<update id="update" parameterType="java.util.Map" >
UPDATE
mf_kafka_info
SET
status = 1
WHERE
id = #{id}
</update>
<delete id="delete" parameterType="java.lang.Integer" >
DELETE FROM
mf_kafka_info
WHERE
id = #{id}
</delete>
</mapper>

50
cl_stream_mybatis/src/main/resources/com/bfd/mf/mapper/statInfo.xml

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bfd.mf.mapper.StatMapper" >
<resultMap id="BaseResultMap" type="com.bfd.mf.entity.StatInfo" >
<result column="check_day" property="checkDay" jdbcType="VARCHAR" />
<result column="kafka_name" property="kafkaName" jdbcType="VARCHAR" />
<result column="kafka_rows" property="kafkaRows" jdbcType="INTEGER" />
<result column="index_name" property="indexName" jdbcType="VARCHAR" />
<result column="index_rows" property="indexRows" jdbcType="INTEGER" />
<result column="diff_rows" property="diffRows" jdbcType="INTEGER"/>
<result column="add_time" property="addTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List" >
check_day, kafka_name, kafka_rows, index_name, index_rows, diff_rows, add_time
</sql>
<select id="getStatInfo" resultMap="BaseResultMap" >
SELECT
check_day,kafka_name,kafka_rows,index_name,index_rows,diff_rows,DATE_FORMAT(add_time, '%Y-%m-%d %H:%i:%s') as add_time
FROM
mf_check_rows_list
</select>
<insert id="add" parameterType="com.bfd.mf.entity.StatInfo" >
INSERT INTO
mf_check_rows_list
(check_day,kafka_name,kafka_rows,index_name,index_rows,diff_rows,add_time)
VALUES
(#{checkDay}, #{kafkaName}, #{kafkaRows}, #{indexName}, #{indexRows}, #{diffRows}, now())
</insert>
<update id="update" parameterType="java.util.Map" >
UPDATE
mf_check_rows_list
SET
kafka_rows = #{kafkaRows}, index_rows = #{indexRows} , diff_rows = #{diffRows}
WHERE
check_day = #{checkDay} and kafka_name = #{kafkaName} and index_name = #{indexName}
</update>
<select id="getStatInfoByCheck" resultMap="BaseResultMap" parameterType="java.util.Map" >
SELECT
check_day,kafka_name,kafka_rows,index_name,index_rows,diff_rows,DATE_FORMAT(add_time, '%Y-%m-%d %H:%i:%s') as add_time
FROM
mf_check_rows_list
WHERE
check_day = #{checkDay} and kafka_name = #{kafkaName} and index_name = #{indexName}
</select>
</mapper>

31
cl_stream_mybatis/src/main/resources/com/bfd/mf/spring/applicationContext.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean id="propertyConfigurers"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:/datasources.properties
</value>
</property>
</bean>
<bean id="sendTask" class="com.bfd.mf.sendTask.impl.SendTaskImpl">
</bean>
<bean id="baseServiceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter">
<!-- 调用Service -->
<property name="service" ref="sendTask" />
<!-- value值是提供给客户端调用 -->
<property name="serviceName" value="baseService" />
<!-- service接口 -->
<property name="serviceInterface" value="com.bfd.mf.sendTask.SendTask" />
<!-- 注册端口 -->
<property name="registryPort" value="1200" />
</bean>
</beans>

4
cl_stream_mybatis/src/main/resources/datasources.properties

@ -0,0 +1,4 @@
sms_username=0c44a92f900c5
sms_password=100817121800010094
sms_url=http://www.xcapi.net:18018/xcapi/smsApiSend.do
#

18
cl_stream_mybatis/src/main/resources/log4j.properties

@ -0,0 +1,18 @@
log4j.rootLogger=DEBUG, error
###### error appender definition #######
log4j.appender.error=org.apache.log4j.DailyRollingFileAppender
log4j.appender.error.File=logs/sdkclient_error.log
log4j.appender.error.Append=true
log4j.appender.error.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.error.layout=org.apache.log4j.PatternLayout
log4j.appender.error.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] %m%n
#error only
log4j.appender.error.filter.F1=org.apache.log4j.varia.LevelRangeFilter
log4j.appender.error.filter.F1.LevelMin=ERROR
log4j.appender.error.filter.F1.LevelMax=ERROR
#
log4j.appender.error.filter.F2=org.apache.log4j.varia.LevelMatchFilter
log4j.appender.error.filter.F2.levelToMatch=WARN
log4j.appender.error.filter.F2.acceptOnMatch=false

124
cl_stream_mybatis/src/main/resources/static/scripts/AjaxObject.js

@ -0,0 +1,124 @@
/*---------------------------- Ajax 请求对象 ----------------------------*/
/**************************************************
-- 属性
url: 请求地址
method: 请求方法GET 或者 POST默认为 GET
flag: 异步或者同步请求true 或者 false默认为 true
info: 请求参数默认为 null只有当请求方法为 POST 才被使用
//isEval: 是否调用 eval() 函数(true 或者 false),默认为为 false;
//callback: 是否设置回调函数(true或者false),默认为 true;
result: Ajax 请求的响应结果
-- 方法
executeRequest: 执行 Ajax 请求的方法
onReady: 绑定函数到 req.onreadystatechange 事件
dealResult: 只提供了函数名称用来设置用户自己的函数在用户自己的函数中用来处理 Ajax 请求的返回结果
**************************************************/
function Ajax(url, method, flag, info) {
this.url = url;
this.method = method || "GET";
this.flag = (flag == false) ? false : (flag || true);
this.info = info || null;
//this.isEval = false;
//this.callback = true;
this.result = null;
var req = null; // req: XMLHttpRequest 对象;
// 实例化 req 对象
(function() {
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
if (req.overrideMimeType) {
//req.overrideMimeType("text/xml");
}
} else if (window.ActiveXObject) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("该浏览器不支持 Ajax !");
req = null;
}
}
/* Msxml2.XMLHTTP.5.0, 4.0, 3.0 2.0 1.0
for (var i = 5; i; i--) {
try {
alert(i);
if (i != 2) {
req = new ActiveXObject("Msxml2.XMLHTTP." + i + ".0");
}
} catch (e) {
alert(e);
continue;
}
}*/
}
}());
this.executeRequest = function () {
if (!req || !this.url) {
alert("req 为空或者 url 为空!");
return;
}
if (this.url.indexOf("_id_=") != -1) {
// 不改变
} else {
// 保证每次请求的 URL 都不一样,防止缓存
var rand = "_id_=" + Math.random();
if (this.url.indexOf("?") != -1) {
this.url += "&" + rand;
} else {
this.url += "?" + rand;
}
}
/*// 判断是否设置回调函数
if (this.callback) {
this.onReady(req);
}*/
// 设置回调函数
this.onReady(req, this);
// 初始化 req 对象
req.open(this.method, this.url, this.flag);
// 判断,是否为 POST 请求
if ((this.method.toUpperCase() == "POST") && this.info) {
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
}
// 向服务器端发送请求
req.send(this.info);
/*// 判断是否执行 eval() 函数
if (this.isEval) {
eval(req.responseText);
}*/
};
this.onReady = function (req, ajax) {
req.onreadystatechange = function () {
if (req.readyState == 4) {
var result = req.responseText;
if (req.status == 200) {
ajax.result = result;
if (ajax.dealResult) {
ajax.dealResult(result);
} else {
var message = "请为 Ajax对象的 dealResult 设置回调函数!";
message += "\r\n例如:Ajax对象.dealResult=function(result) { Your Code }";
message += "\r\n其中,result 参数为服务器端返回的响应数据。";
//alert(message);
}
} else {
//alert("响应错误!");
//alert(result);
}
}
};
};
this.dealResult; // = function(result) { };
}

203
cl_stream_mybatis/src/main/resources/static/scripts/jquery.TableExcel.js

@ -0,0 +1,203 @@
/*
生成EXCEL的数据格式定义
{
name: '',
widths: [xxx,,xxx],
clazz" '',
style: '',
data: [
{
height: xxx,
clazz" '',
style: '',
cell: [
{
range: 'xxx.xxx',
text: '',
clazz: '',
style: ''
},{
}
]
},,{
}
], ,[
]
}
*/
(function($) {
$.fn.exportTableData = function(options) {
var opts = $.extend({}, $.fn.exportTableData.defaults, options);
var table = $(this[0]);
if (table.attr('nodeName').toUpperCase() != 'TABLE')
return null;
var result = {
widths: [],
data: []
};
readCSS(result, table);
var cols = table.find('col');
cols.each(function(i) {
result.widths[i] = $(this).width();
})
var trs = table.find('tr');
trs.each(function(row) {
var tr = $(this);
result.data[row] = {
height: tr.height(),
cell: []
};
readCSS(result.data[row], tr);
var tds = tr.find('td');
tds.each(function(col) {
var td = $(this);
var val = td.html();
if (opts.callback)
val = opts.callback(tr, td, row, col, val);
result.data[row].cell[col] = {
text: val
}
readRange(result.data[row].cell[col], td);
readCSS(result.data[row].cell[col], td);
})
})
return result;
function readRange(data, el) {
var rowSpan = el.attr('rowSpan');
var colSpan = el.attr('colSpan');
rowSpan = rowSpan ? parseInt(rowSpan) : 1;
colSpan = colSpan ? parseInt(colSpan) : 1;
if (rowSpan != 1 || colSpan != 1)
data.range = rowSpan + '.' + colSpan;
}
function readCSS(data, el) {
var clazz = el.attr('class');
if (clazz)
data.clazz = clazz;
var style = el.attr('style');
if (style)
data.style = style;
}
};
$.fn.exportTableData.defaults = {
callback: function(tr, td, row, col, val) {
return val;
}
};
$.fn.parseImportTableConfig = function(options) {
var opts = $.extend({}, $.fn.parseImportTableConfig.defaults, options);
var table = $(this[0]);
if (table.attr('nodeName').toUpperCase() != 'TABLE')
return null;
var result = '';
var trs = table.find('tr');
trs.each(function(row) {
var tr = $(this);
var tds = tr.find('td');
tds.each(function(col) {
var td = $(this);
if (opts.callback) {
if (opts.callback({
tr: tr,
td: td,
row: row,
col: col
}) == false)
return;
}
result += row + '.' + col + ' ';
})
})
return result;
};
$.fn.parseImportTableConfig.defaults = {
callback: function(params) {
return true;
}
};
$.fn.importTableData = function(data, options) {
var opts = $.extend({}, $.fn.importTableData.defaults, options);
var table = $(this[0]);
if (table.attr('nodeName').toUpperCase() != 'TABLE')
return null;
var importTds = [];
var trs = table.find('tr');
trs.each(function(row) {
var tr = $(this);
var tds = tr.find('td');
tds.each(function(col) {
var td = $(this);
var key = row + '.' + col;
if (typeof(data[key]) == 'undefined')
return;
var params = {
tr: tr,
td: td,
row: row,
col: col,
val: data[key]
};
if (opts.callback) {
if (opts.callback(params) == false)
return;
}
var val = params.val;
var orgVal = td.html();
if (val != null && val != orgVal) {
td.html(val);
importTds[importTds.length] = td;
}
})
})
if (importTds.length > 0 && opts.finish)
opts.finish(importTds);
};
$.fn.importTableData.defaults = {
callback: function(params) {
return true;
},
finish: function(tds) {
}
};
})(jQuery);

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/jquery-1.3.2.min.js
File diff suppressed because it is too large
View File

209
cl_stream_mybatis/src/main/resources/static/scripts/jquery/plugins/ajaxfileupload.js

@ -0,0 +1,209 @@
jQuery.extend({
createUploadIframe: function(id, uri)
{
//create frame
var frameId = 'jUploadFrame' + id;
if(window.ActiveXObject) {
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
if(typeof uri== 'boolean'){
io.src = 'javascript:false';
}
else if(typeof uri== 'string'){
io.src = uri;
}
}
else {
var io = document.createElement('iframe');
io.id = frameId;
io.name = frameId;
}
io.style.position = 'absolute';
io.style.top = '-1000px';
io.style.left = '-1000px';
document.body.appendChild(io);
return io
},
createUploadForm: function(id, fileElementId, data)
{
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = $('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
var oldElement = $('#' + fileElementId);
var newElement = $(oldElement).clone();
$(oldElement).attr('id', fileId);
$(oldElement).before(newElement);
$(oldElement).appendTo(form);
if (data) {
for (var name in data) {
var field = $('<input type="hidden" name="' + name + '" value="' + data[name] + '"/>');
field.appendTo(form);
}
}
//set attributes
$(form).css('position', 'absolute');
$(form).css('top', '-1200px');
$(form).css('left', '-1200px');
$(form).appendTo('body');
return form;
},
ajaxFileUpload: function(s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = new Date().getTime()
var form = jQuery.createUploadForm(id, s.fileElementId, s.data);
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
// Watch for a new set of requests
if ( s.global && ! jQuery.active++ )
{
jQuery.event.trigger( "ajaxStart" );
}
var requestDone = false;
// Create the request object
var xml = {}
if ( s.global )
jQuery.event.trigger("ajaxSend", [xml, s]);
// Wait for a response to come back
var uploadCallback = function(isTimeout)
{
var io = document.getElementById(frameId);
try
{
if(io.contentWindow)
{
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument)
{
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
}
}catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if ( xml || isTimeout == "timeout")
{
requestDone = true;
var status;
try {
status = isTimeout != "timeout" ? "success" : "error";
// Make sure that the request was successful or notmodified
if ( status != "error" )
{
// process the data (runs the xml through httpData regardless of callback)
var data = jQuery.uploadHttpData( xml, s.dataType );
// If a local callback was specified, fire it and pass it the data
if ( s.success )
s.success( data, status );
// Fire the global callback
if( s.global )
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
} else
jQuery.handleError(s, xml, status);
} catch(e)
{
status = "error";
jQuery.handleError(s, xml, status, e);
}
// The request was completed
if( s.global )
jQuery.event.trigger( "ajaxComplete", [xml, s] );
// Handle the global AJAX counter
if ( s.global && ! --jQuery.active )
jQuery.event.trigger( "ajaxStop" );
// Process result
if ( s.complete )
s.complete(xml, status);
jQuery(io).unbind()
setTimeout(function()
{ try
{
$(io).remove();
$(form).remove();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
}, 100)
xml = null
}
}
// Timeout checker
if ( s.timeout > 0 )
{
setTimeout(function(){
// Check to see if the request is still happening
if( !requestDone ) uploadCallback( "timeout" );
}, s.timeout);
}
try
{
// var io = $('#' + frameId);
var form = $('#' + formId);
$(form).attr('action', s.url);
$(form).attr('method', 'POST');
$(form).attr('target', frameId);
if(form.encoding)
{
form.encoding = 'multipart/form-data';
}
else
{
form.enctype = 'multipart/form-data';
}
$(form).submit();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if(window.attachEvent){
document.getElementById(frameId).attachEvent('onload', uploadCallback);
}
else{
document.getElementById(frameId).addEventListener('load', uploadCallback, false);
}
return {abort: function () {}};
},
uploadHttpData: function( r, type ) {
var data = !type;
data = type == "xml" || data ? r.responseXML : r.responseText;
// If the type is "script", eval it in global context
if ( type == "script" )
jQuery.globalEval( data );
// Get the JavaScript object, if JSON is used.
if ( type == "json" )
eval( "data = " + data );
// evaluate scripts within html
if ( type == "html" )
jQuery("<div>").html(data).evalScripts();
//alert($('param', data).each(function(){alert($(this).attr('value'));}));
return data;
}
})

49
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.blind.js

@ -0,0 +1,49 @@
/*
* jQuery UI Effects Blind 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Blind
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.blind = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['position','top','left'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
var direction = o.options.direction || 'vertical'; // Default direction
// Adjust
$.effects.save(el, props); el.show(); // Save & Show
var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
var ref = (direction == 'vertical') ? 'height' : 'width';
var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
if(mode == 'show') wrapper.css(ref, 0); // Shift
// Animation
var animation = {};
animation[ref] = mode == 'show' ? distance : 0;
// Animate
wrapper.animate(animation, o.duration, o.options.easing, function() {
if(mode == 'hide') el.hide(); // Hide
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(el[0], arguments); // Callback
el.dequeue();
});
});
};
})(jQuery);

78
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.bounce.js

@ -0,0 +1,78 @@
/*
* jQuery UI Effects Bounce 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Bounce
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.bounce = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['position','top','left'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
var direction = o.options.direction || 'up'; // Default direction
var distance = o.options.distance || 20; // Default distance
var times = o.options.times || 5; // Default # of times
var speed = o.duration || 250; // Default speed per bounce
if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE
// Adjust
$.effects.save(el, props); el.show(); // Save & Show
$.effects.createWrapper(el); // Create Wrapper
var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
if (mode == 'hide') distance = distance / (times * 2);
if (mode != 'hide') times--;
// Animate
if (mode == 'show') { // Show Bounce
var animation = {opacity: 1};
animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
el.animate(animation, speed / 2, o.options.easing);
distance = distance / 2;
times--;
};
for (var i = 0; i < times; i++) { // Bounces
var animation1 = {}, animation2 = {};
animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
distance = (mode == 'hide') ? distance * 2 : distance / 2;
};
if (mode == 'hide') { // Last Bounce
var animation = {opacity: 0};
animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
el.animate(animation, speed / 2, o.options.easing, function(){
el.hide(); // Hide
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(this, arguments); // Callback
});
} else {
var animation1 = {}, animation2 = {};
animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(this, arguments); // Callback
});
};
el.queue('fx', function() { el.dequeue(); });
el.dequeue();
});
};
})(jQuery);

54
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.clip.js

@ -0,0 +1,54 @@
/*
* jQuery UI Effects Clip 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Clip
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.clip = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['position','top','left','height','width'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
var direction = o.options.direction || 'vertical'; // Default direction
// Adjust
$.effects.save(el, props); el.show(); // Save & Show
var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
var animate = el[0].tagName == 'IMG' ? wrapper : el;
var ref = {
size: (direction == 'vertical') ? 'height' : 'width',
position: (direction == 'vertical') ? 'top' : 'left'
};
var distance = (direction == 'vertical') ? animate.height() : animate.width();
if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift
// Animation
var animation = {};
animation[ref.size] = mode == 'show' ? distance : 0;
animation[ref.position] = mode == 'show' ? 0 : distance / 2;
// Animate
animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
if(mode == 'hide') el.hide(); // Hide
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(el[0], arguments); // Callback
el.dequeue();
}});
});
};
})(jQuery);

543
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.core.js

@ -0,0 +1,543 @@
/*
* jQuery UI Effects 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/
*/
;jQuery.effects || (function($) {
$.effects = {
version: "1.7",
// Saves a set of properties in a data storage
save: function(element, set) {
for(var i=0; i < set.length; i++) {
if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);
}
},
// Restores a set of previously saved properties from a data storage
restore: function(element, set) {
for(var i=0; i < set.length; i++) {
if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));
}
},
setMode: function(el, mode) {
if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
return mode;
},
getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
// this should be a little more flexible in the future to handle a string & hash
var y, x;
switch (origin[0]) {
case 'top': y = 0; break;
case 'middle': y = 0.5; break;
case 'bottom': y = 1; break;
default: y = origin[0] / original.height;
};
switch (origin[1]) {
case 'left': x = 0; break;
case 'center': x = 0.5; break;
case 'right': x = 1; break;
default: x = origin[1] / original.width;
};
return {x: x, y: y};
},
// Wraps the element around a wrapper that copies position properties
createWrapper: function(element) {
//if the element is already wrapped, return it
if (element.parent().is('.ui-effects-wrapper'))
return element.parent();
//Cache width,height and float properties of the element, and create a wrapper around it
var props = { width: element.outerWidth(true), height: element.outerHeight(true), 'float': element.css('float') };
element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
var wrapper = element.parent();
//Transfer the positioning of the element to the wrapper
if (element.css('position') == 'static') {
wrapper.css({ position: 'relative' });
element.css({ position: 'relative'} );
} else {
var top = element.css('top'); if(isNaN(parseInt(top,10))) top = 'auto';
var left = element.css('left'); if(isNaN(parseInt(left,10))) left = 'auto';
wrapper.css({ position: element.css('position'), top: top, left: left, zIndex: element.css('z-index') }).show();
element.css({position: 'relative', top: 0, left: 0 });
}
wrapper.css(props);
return wrapper;
},
removeWrapper: function(element) {
if (element.parent().is('.ui-effects-wrapper'))
return element.parent().replaceWith(element);
return element;
},
setTransition: function(element, list, factor, value) {
value = value || {};
$.each(list, function(i, x){
unit = element.cssUnit(x);
if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
});
return value;
},
//Base function to animate from one class to another in a seamless transition
animateClass: function(value, duration, easing, callback) {
var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
var ea = (typeof easing == "string" ? easing : null);
return this.each(function() {
var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }
//Let's get a style offset
var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove);
var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove);
// The main function to form the object for animation
for(var n in newStyle) {
if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
&& n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
&& newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
&& (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */
&& (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
) offset[n] = newStyle[n];
}
that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
// Change style attribute back to original. For stupid IE, we need to clear the damn object.
if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove);
if(cb) cb.apply(this, arguments);
});
});
}
};
function _normalizeArguments(a, m) {
var o = a[1] && a[1].constructor == Object ? a[1] : {}; if(m) o.mode = m;
var speed = a[1] && a[1].constructor != Object ? a[1] : (o.duration ? o.duration : a[2]); //either comes from options.duration or the secon/third argument
speed = $.fx.off ? 0 : typeof speed === "number" ? speed : $.fx.speeds[speed] || $.fx.speeds._default;
var callback = o.callback || ( $.isFunction(a[1]) && a[1] ) || ( $.isFunction(a[2]) && a[2] ) || ( $.isFunction(a[3]) && a[3] );
return [a[0], o, speed, callback];
}
//Extend the methods of jQuery
$.fn.extend({
//Save old methods
_show: $.fn.show,
_hide: $.fn.hide,
__toggle: $.fn.toggle,
_addClass: $.fn.addClass,
_removeClass: $.fn.removeClass,
_toggleClass: $.fn.toggleClass,
// New effect methods
effect: function(fx, options, speed, callback) {
return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: options || {}, duration: speed, callback: callback }) : null;
},
show: function() {
if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
return this._show.apply(this, arguments);
else {
return this.effect.apply(this, _normalizeArguments(arguments, 'show'));
}
},
hide: function() {
if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
return this._hide.apply(this, arguments);
else {
return this.effect.apply(this, _normalizeArguments(arguments, 'hide'));
}
},
toggle: function(){
if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) || (arguments[0].constructor == Function))
return this.__toggle.apply(this, arguments);
else {
return this.effect.apply(this, _normalizeArguments(arguments, 'toggle'));
}
},
addClass: function(classNames, speed, easing, callback) {
return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
},
removeClass: function(classNames,speed,easing,callback) {
return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
},
toggleClass: function(classNames,speed,easing,callback) {
return ( (typeof speed !== "boolean") && speed ) ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames, speed);
},
morph: function(remove,add,speed,easing,callback) {
return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
},
switchClass: function() {
return this.morph.apply(this, arguments);
},
// helper functions
cssUnit: function(key) {
var style = this.css(key), val = [];
$.each( ['em','px','%','pt'], function(i, unit){
if(style.indexOf(unit) > 0)
val = [parseFloat(style), unit];
});
return val;
}
});
/*
* jQuery Color Animations
* Copyright 2007 John Resig
* Released under the MIT and GPL licenses.
*/
// We override the animation for all of these color styles
$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
$.fx.step[attr] = function(fx) {
if ( fx.state == 0 ) {
fx.start = getColor( fx.elem, attr );
fx.end = getRGB( fx.end );
}
fx.elem.style[attr] = "rgb(" + [
Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0],10), 255), 0),
Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1],10), 255), 0),
Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2],10), 255), 0)
].join(",") + ")";
};
});
// Color Conversion functions from highlightFade
// By Blair Mitchelmore
// http://jquery.offput.ca/highlightFade/
// Parse strings looking for color tuples [255,255,255]
function getRGB(color) {
var result;
// Check if we're already dealing with an array of colors
if ( color && color.constructor == Array && color.length == 3 )
return color;
// Look for rgb(num,num,num)
if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
// Look for rgb(num%,num%,num%)
if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
// Look for #a0b1c2
if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
// Look for #fff
if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
// Look for rgba(0, 0, 0, 0) == transparent in Safari 3
if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent'];
// Otherwise, we're most likely dealing with a named color
return colors[$.trim(color).toLowerCase()];
}
function getColor(elem, attr) {
var color;
do {
color = $.curCSS(elem, attr);
// Keep going until we find an element that has color, or we hit the body
if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
break;
attr = "backgroundColor";
} while ( elem = elem.parentNode );
return getRGB(color);
};
// Some named colors to work with
// From Interface by Stefan Petre
// http://interface.eyecon.ro/
var colors = {
aqua:[0,255,255],
azure:[240,255,255],
beige:[245,245,220],
black:[0,0,0],
blue:[0,0,255],
brown:[165,42,42],
cyan:[0,255,255],
darkblue:[0,0,139],
darkcyan:[0,139,139],
darkgrey:[169,169,169],
darkgreen:[0,100,0],
darkkhaki:[189,183,107],
darkmagenta:[139,0,139],
darkolivegreen:[85,107,47],
darkorange:[255,140,0],
darkorchid:[153,50,204],
darkred:[139,0,0],
darksalmon:[233,150,122],
darkviolet:[148,0,211],
fuchsia:[255,0,255],
gold:[255,215,0],
green:[0,128,0],
indigo:[75,0,130],
khaki:[240,230,140],
lightblue:[173,216,230],
lightcyan:[224,255,255],
lightgreen:[144,238,144],
lightgrey:[211,211,211],
lightpink:[255,182,193],
lightyellow:[255,255,224],
lime:[0,255,0],
magenta:[255,0,255],
maroon:[128,0,0],
navy:[0,0,128],
olive:[128,128,0],
orange:[255,165,0],
pink:[255,192,203],
purple:[128,0,128],
violet:[128,0,128],
red:[255,0,0],
silver:[192,192,192],
white:[255,255,255],
yellow:[255,255,0],
transparent: [255,255,255]
};
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
$.easing.jswing = $.easing.swing;
$.extend($.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert($.easing.default);
return $.easing[$.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});
/*
*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
* Copyright 2001 Robert Penner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
})(jQuery);

50
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.drop.js

@ -0,0 +1,50 @@
/*
* jQuery UI Effects Drop 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Drop
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.drop = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['position','top','left','opacity'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
var direction = o.options.direction || 'left'; // Default Direction
// Adjust
$.effects.save(el, props); el.show(); // Save & Show
$.effects.createWrapper(el); // Create Wrapper
var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
// Animation
var animation = {opacity: mode == 'show' ? 1 : 0};
animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
// Animate
el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
if(mode == 'hide') el.hide(); // Hide
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(this, arguments); // Callback
el.dequeue();
}});
});
};
})(jQuery);

79
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.explode.js

@ -0,0 +1,79 @@
/*
* jQuery UI Effects Explode 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Explode
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.explode = function(o) {
return this.queue(function() {
var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
var el = $(this).show().css('visibility', 'hidden');
var offset = el.offset();
//Substract the margins - not fixing the problem yet.
offset.top -= parseInt(el.css("marginTop"),10) || 0;
offset.left -= parseInt(el.css("marginLeft"),10) || 0;
var width = el.outerWidth(true);
var height = el.outerHeight(true);
for(var i=0;i<rows;i++) { // =
for(var j=0;j<cells;j++) { // ||
el
.clone()
.appendTo('body')
.wrap('<div></div>')
.css({
position: 'absolute',
visibility: 'visible',
left: -j*(width/cells),
top: -i*(height/rows)
})
.parent()
.addClass('ui-effects-explode')
.css({
position: 'absolute',
overflow: 'hidden',
width: width/cells,
height: height/rows,
left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
opacity: o.options.mode == 'show' ? 0 : 1
}).animate({
left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
opacity: o.options.mode == 'show' ? 1 : 0
}, o.duration || 500);
}
}
// Set a timeout, to call the callback approx. when the other animations have finished
setTimeout(function() {
o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
if(o.callback) o.callback.apply(el[0]); // Callback
el.dequeue();
$('div.ui-effects-explode').remove();
}, o.duration || 500);
});
};
})(jQuery);

56
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.fold.js

@ -0,0 +1,56 @@
/*
* jQuery UI Effects Fold 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Fold
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.fold = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['position','top','left'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
var size = o.options.size || 15; // Default fold size
var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
// Adjust
$.effects.save(el, props); el.show(); // Save & Show
var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
var widthFirst = ((mode == 'show') != horizFirst);
var ref = widthFirst ? ['width', 'height'] : ['height', 'width'];
var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];
var percent = /([0-9]+)%/.exec(size);
if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1];
if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift
// Animation
var animation1 = {}, animation2 = {};
animation1[ref[0]] = mode == 'show' ? distance[0] : size;
animation2[ref[1]] = mode == 'show' ? distance[1] : 0;
// Animate
wrapper.animate(animation1, duration, o.options.easing)
.animate(animation2, duration, o.options.easing, function() {
if(mode == 'hide') el.hide(); // Hide
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(el[0], arguments); // Callback
el.dequeue();
});
});
};
})(jQuery);

48
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.highlight.js

@ -0,0 +1,48 @@
/*
* jQuery UI Effects Highlight 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Highlight
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.highlight = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['backgroundImage','backgroundColor','opacity'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
var color = o.options.color || "#ffff99"; // Default highlight color
var oldColor = el.css("backgroundColor");
// Adjust
$.effects.save(el, props); el.show(); // Save & Show
el.css({backgroundImage: 'none', backgroundColor: color}); // Shift
// Animation
var animation = {backgroundColor: oldColor };
if (mode == "hide") animation['opacity'] = 0;
// Animate
el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
if(mode == "hide") el.hide();
$.effects.restore(el, props);
if (mode == "show" && $.browser.msie) this.style.removeAttribute('filter');
if(o.callback) o.callback.apply(this, arguments);
el.dequeue();
}});
});
};
})(jQuery);

56
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.pulsate.js

@ -0,0 +1,56 @@
/*
* jQuery UI Effects Pulsate 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Pulsate
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.pulsate = function(o) {
return this.queue(function() {
// Create element
var el = $(this);
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
var times = o.options.times || 5; // Default # of times
var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
// Adjust
if (mode == 'hide') times--;
if (el.is(':hidden')) { // Show fadeIn
el.css('opacity', 0);
el.show(); // Show
el.animate({opacity: 1}, duration, o.options.easing);
times = times-2;
}
// Animate
for (var i = 0; i < times; i++) { // Pulsate
el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing);
};
if (mode == 'hide') { // Last Pulse
el.animate({opacity: 0}, duration, o.options.easing, function(){
el.hide(); // Hide
if(o.callback) o.callback.apply(this, arguments); // Callback
});
} else {
el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing, function(){
if(o.callback) o.callback.apply(this, arguments); // Callback
});
};
el.queue('fx', function() { el.dequeue(); });
el.dequeue();
});
};
})(jQuery);

180
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.scale.js

@ -0,0 +1,180 @@
/*
* jQuery UI Effects Scale 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Scale
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.puff = function(o) {
return this.queue(function() {
// Create element
var el = $(this);
// Set options
var options = $.extend(true, {}, o.options);
var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
var percent = parseInt(o.options.percent,10) || 150; // Set default puff percent
options.fade = true; // It's not a puff if it doesn't fade! :)
var original = {height: el.height(), width: el.width()}; // Save original
// Adjust
var factor = percent / 100;
el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor};
// Animation
options.from = el.from;
options.percent = (mode == 'hide') ? percent : 100;
options.mode = mode;
// Animate
el.effect('scale', options, o.duration, o.callback);
el.dequeue();
});
};
$.effects.scale = function(o) {
return this.queue(function() {
// Create element
var el = $(this);
// Set options
var options = $.extend(true, {}, o.options);
var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent
var direction = o.options.direction || 'both'; // Set default axis
var origin = o.options.origin; // The origin of the scaling
if (mode != 'effect') { // Set default origin and restore for show/hide
options.origin = origin || ['middle','center'];
options.restore = true;
}
var original = {height: el.height(), width: el.width()}; // Save original
el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state
// Adjust
var factor = { // Set scaling factor
y: direction != 'horizontal' ? (percent / 100) : 1,
x: direction != 'vertical' ? (percent / 100) : 1
};
el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state
if (o.options.fade) { // Fade option to support puff
if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};
if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};
};
// Animation
options.from = el.from; options.to = el.to; options.mode = mode;
// Animate
el.effect('size', options, o.duration, o.callback);
el.dequeue();
});
};
$.effects.size = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['position','top','left','width','height','overflow','opacity'];
var props1 = ['position','top','left','overflow','opacity']; // Always restore
var props2 = ['width','height','overflow']; // Copy for children
var cProps = ['fontSize'];
var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];
var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
var restore = o.options.restore || false; // Default restore
var scale = o.options.scale || 'both'; // Default scale mode
var origin = o.options.origin; // The origin of the sizing
var original = {height: el.height(), width: el.width()}; // Save original
el.from = o.options.from || original; // Default from state
el.to = o.options.to || original; // Default to state
// Adjust
if (origin) { // Calculate baseline shifts
var baseline = $.effects.getBaseline(origin, original);
el.from.top = (original.height - el.from.height) * baseline.y;
el.from.left = (original.width - el.from.width) * baseline.x;
el.to.top = (original.height - el.to.height) * baseline.y;
el.to.left = (original.width - el.to.width) * baseline.x;
};
var factor = { // Set scaling factor
from: {y: el.from.height / original.height, x: el.from.width / original.width},
to: {y: el.to.height / original.height, x: el.to.width / original.width}
};
if (scale == 'box' || scale == 'both') { // Scale the css box
if (factor.from.y != factor.to.y) { // Vertical props scaling
props = props.concat(vProps);
el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
};
if (factor.from.x != factor.to.x) { // Horizontal props scaling
props = props.concat(hProps);
el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);
el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);
};
};
if (scale == 'content' || scale == 'both') { // Scale the content
if (factor.from.y != factor.to.y) { // Vertical props scaling
props = props.concat(cProps);
el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);
el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);
};
};
$.effects.save(el, restore ? props : props1); el.show(); // Save & Show
$.effects.createWrapper(el); // Create Wrapper
el.css('overflow','hidden').css(el.from); // Shift
// Animate
if (scale == 'content' || scale == 'both') { // Scale the children
vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size
hProps = hProps.concat(['marginLeft','marginRight']); // Add margins
props2 = props.concat(vProps).concat(hProps); // Concat
el.find("*[width]").each(function(){
child = $(this);
if (restore) $.effects.save(child, props2);
var c_original = {height: child.height(), width: child.width()}; // Save original
child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};
child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};
if (factor.from.y != factor.to.y) { // Vertical props scaling
child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);
child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);
};
if (factor.from.x != factor.to.x) { // Horizontal props scaling
child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);
child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);
};
child.css(child.from); // Shift children
child.animate(child.to, o.duration, o.options.easing, function(){
if (restore) $.effects.restore(child, props2); // Restore children
}); // Animate children
});
};
// Animate
el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
if(mode == 'hide') el.hide(); // Hide
$.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(this, arguments); // Callback
el.dequeue();
}});
});
};
})(jQuery);

57
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.shake.js

@ -0,0 +1,57 @@
/*
* jQuery UI Effects Shake 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Shake
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.shake = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['position','top','left'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
var direction = o.options.direction || 'left'; // Default direction
var distance = o.options.distance || 20; // Default distance
var times = o.options.times || 3; // Default # of times
var speed = o.duration || o.options.duration || 140; // Default speed per shake
// Adjust
$.effects.save(el, props); el.show(); // Save & Show
$.effects.createWrapper(el); // Create Wrapper
var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
// Animation
var animation = {}, animation1 = {}, animation2 = {};
animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2;
animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2;
// Animate
el.animate(animation, speed, o.options.easing);
for (var i = 1; i < times; i++) { // Shakes
el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
};
el.animate(animation1, speed, o.options.easing).
animate(animation, speed / 2, o.options.easing, function(){ // Last shake
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(this, arguments); // Callback
});
el.queue('fx', function() { el.dequeue(); });
el.dequeue();
});
};
})(jQuery);

50
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.slide.js

@ -0,0 +1,50 @@
/*
* jQuery UI Effects Slide 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Slide
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.slide = function(o) {
return this.queue(function() {
// Create element
var el = $(this), props = ['position','top','left'];
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
var direction = o.options.direction || 'left'; // Default Direction
// Adjust
$.effects.save(el, props); el.show(); // Save & Show
$.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift
// Animation
var animation = {};
animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
// Animate
el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
if(mode == 'hide') el.hide(); // Hide
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(this, arguments); // Callback
el.dequeue();
}});
});
};
})(jQuery);

45
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/effects.transfer.js

@ -0,0 +1,45 @@
/*
* jQuery UI Effects Transfer 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Transfer
*
* Depends:
* effects.core.js
*/
(function($) {
$.effects.transfer = function(o) {
return this.queue(function() {
var elem = $(this),
target = $(o.options.to),
endPosition = target.offset(),
animation = {
top: endPosition.top,
left: endPosition.left,
height: target.innerHeight(),
width: target.innerWidth()
},
startPosition = elem.offset(),
transfer = $('<div class="ui-effects-transfer"></div>')
.appendTo(document.body)
.addClass(o.options.className)
.css({
top: startPosition.top,
left: startPosition.left,
height: elem.innerHeight(),
width: elem.innerWidth(),
position: 'absolute'
})
.animate(animation, o.duration, o.options.easing, function() {
transfer.remove();
(o.callback && o.callback.apply(elem[0], arguments));
elem.dequeue();
});
});
};
})(jQuery);

762
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/jquery-ui-i18n.js

@ -0,0 +1,762 @@
/* Arabic Translation for jQuery UI date picker plugin. */
/* Khaled Al Horani -- koko.dw@gmail.com */
/* خالد الحوراني -- koko.dw@gmail.com */
/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
jQuery(function($){
$.datepicker.regional['ar'] = {
closeText: 'إغلاق',
prevText: '&#x3c;السابق',
nextText: 'التالي&#x3e;',
currentText: 'اليوم',
monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران',
'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'],
dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'],
dayNamesMin: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: true};
$.datepicker.setDefaults($.datepicker.regional['ar']);
});/* Bulgarian initialisation for the jQuery UI date picker plugin. */
/* Written by Stoyan Kyosev (http://svest.org). */
jQuery(function($){
$.datepicker.regional['bg'] = {
closeText: 'затвори',
prevText: '&#x3c;назад',
nextText: 'напред&#x3e;',
nextBigText: '&#x3e;&#x3e;',
currentText: 'днес',
monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
'Юли','Август','Септември','Октомври','Ноември','Декември'],
monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
'Юли','Авг','Сеп','Окт','Нов','Дек'],
dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['bg']);
});
/* Inicialitzaci� en catal� per a l'extenci� 'calendar' per jQuery. */
/* Writers: (joan.leon@gmail.com). */
jQuery(function($){
$.datepicker.regional['ca'] = {
closeText: 'Tancar',
prevText: '&#x3c;Ant',
nextText: 'Seg&#x3e;',
currentText: 'Avui',
monthNames: ['Gener','Febrer','Mar&ccedil;','Abril','Maig','Juny',
'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'],
monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
'Jul','Ago','Set','Oct','Nov','Des'],
dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
dateFormat: 'mm/dd/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['ca']);
});/* Czech initialisation for the jQuery UI date picker plugin. */
/* Written by Tomas Muller (tomas@tomas-muller.net). */
jQuery(function($){
$.datepicker.regional['cs'] = {
closeText: 'Zavřít',
prevText: '&#x3c;Dříve',
nextText: 'Později&#x3e;',
currentText: 'Nyní',
monthNames: ['leden','únor','březen','duben','květen','červen',
'červenec','srpen','září','říjen','listopad','prosinec'],
monthNamesShort: ['led','úno','bře','dub','kvě','čer',
'čvc','srp','zář','říj','lis','pro'],
dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
dayNamesMin: ['ne','po','út','st','čt','pá','so'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['cs']);
});
/* Danish initialisation for the jQuery UI date picker plugin. */
/* Written by Jan Christensen ( deletestuff@gmail.com). */
jQuery(function($){
$.datepicker.regional['da'] = {
closeText: 'Luk',
prevText: '&#x3c;Forrige',
nextText: 'Næste&#x3e;',
currentText: 'Idag',
monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
'Juli','August','September','Oktober','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Aug','Sep','Okt','Nov','Dec'],
dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
dateFormat: 'dd-mm-yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['da']);
});
/* German initialisation for the jQuery UI date picker plugin. */
/* Written by Milian Wolff (mail@milianw.de). */
jQuery(function($){
$.datepicker.regional['de'] = {
closeText: 'schließen',
prevText: '&#x3c;zurück',
nextText: 'Vor&#x3e;',
currentText: 'heute',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['de']);
});
/* Greek (el) initialisation for the jQuery UI date picker plugin. */
/* Written by Alex Cicovic (http://www.alexcicovic.com) */
jQuery(function($){
$.datepicker.regional['el'] = {
closeText: 'Κλείσιμο',
prevText: 'Προηγούμενος',
nextText: 'Επόμενος',
currentText: 'Τρέχων Μήνας',
monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
dateFormat: 'dd/mm/yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['el']);
});/* Esperanto initialisation for the jQuery UI date picker plugin. */
/* Written by Olivier M. (olivierweb@ifrance.com). */
jQuery(function($){
$.datepicker.regional['eo'] = {
closeText: 'Fermi',
prevText: '&lt;Anta',
nextText: 'Sekv&gt;',
currentText: 'Nuna',
monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Aŭg','Sep','Okt','Nov','Dec'],
dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'],
dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['eo']);
});
/* Inicializaci�n en espa�ol para la extensi�n 'UI date picker' para jQuery. */
/* Traducido por Vester (xvester@gmail.com). */
jQuery(function($){
$.datepicker.regional['es'] = {
closeText: 'Cerrar',
prevText: '&#x3c;Ant',
nextText: 'Sig&#x3e;',
currentText: 'Hoy',
monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
'Jul','Ago','Sep','Oct','Nov','Dic'],
dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'],
dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'],
dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','S&aacute;'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['es']);
});/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
/* Javad Mowlanezhad -- jmowla@gmail.com */
/* Jalali calendar should supported soon! (Its implemented but I have to test it) */
jQuery(function($) {
$.datepicker.regional['fa'] = {
closeText: 'بستن',
prevText: '&#x3c;قبلي',
nextText: 'بعدي&#x3e;',
currentText: 'امروز',
monthNames: ['فروردين','ارديبهشت','خرداد','تير','مرداد','شهريور',
'مهر','آبان','آذر','دي','بهمن','اسفند'],
monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
dayNames: ['يکشنبه','دوشنبه','سه‌شنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'],
dayNamesShort: ['ي','د','س','چ','پ','ج', 'ش'],
dayNamesMin: ['ي','د','س','چ','پ','ج', 'ش'],
dateFormat: 'yy/mm/dd', firstDay: 6,
isRTL: true};
$.datepicker.setDefaults($.datepicker.regional['fa']);
});/* Finnish initialisation for the jQuery UI date picker plugin. */
/* Written by Harri Kilpi� (harrikilpio@gmail.com). */
jQuery(function($){
$.datepicker.regional['fi'] = {
closeText: 'Sulje',
prevText: '&laquo;Edellinen',
nextText: 'Seuraava&raquo;',
currentText: 'T&auml;n&auml;&auml;n',
monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kes&auml;kuu',
'Hein&auml;kuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kes&auml;',
'Hein&auml;','Elo','Syys','Loka','Marras','Joulu'],
dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'],
dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['fi']);
});
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood@virginbroadband.com.au) and Stéphane Nahmani (sholby@sholby.net). */
jQuery(function($){
$.datepicker.regional['fr'] = {
closeText: 'Fermer',
prevText: '&#x3c;Préc',
nextText: 'Suiv&#x3e;',
currentText: 'Courant',
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
'Jul','Aoû','Sep','Oct','Nov','Déc'],
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
dateFormat: 'dd/mm/yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['fr']);
});/* Hebrew initialisation for the UI Datepicker extension. */
/* Written by Amir Hardon (ahardon at gmail dot com). */
jQuery(function($){
$.datepicker.regional['he'] = {
closeText: 'סגור',
prevText: '&#x3c;הקודם',
nextText: 'הבא&#x3e;',
currentText: 'היום',
monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
monthNamesShort: ['1','2','3','4','5','6',
'7','8','9','10','11','12'],
dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: true};
$.datepicker.setDefaults($.datepicker.regional['he']);
});
/* Croatian i18n for the jQuery UI date picker plugin. */
/* Written by Vjekoslav Nesek. */
jQuery(function($){
$.datepicker.regional['hr'] = {
closeText: 'Zatvori',
prevText: '&#x3c;',
nextText: '&#x3e;',
currentText: 'Danas',
monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipani',
'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
'Srp','Kol','Ruj','Lis','Stu','Pro'],
dayNames: ['Nedjalja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
dateFormat: 'dd.mm.yy.', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['hr']);
});/* Hungarian initialisation for the jQuery UI date picker plugin. */
/* Written by Istvan Karaszi (jquerycalendar@spam.raszi.hu). */
jQuery(function($){
$.datepicker.regional['hu'] = {
closeText: 'bezárás',
prevText: '&laquo;&nbsp;vissza',
nextText: 'előre&nbsp;&raquo;',
currentText: 'ma',
monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június',
'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún',
'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
dayNames: ['Vasámap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
dateFormat: 'yy-mm-dd', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['hu']);
});
/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/
jQuery(function($){
$.datepicker.regional['hy'] = {
closeText: 'Փակել',
prevText: '&#x3c;Նախ.',
nextText: 'Հաջ.&#x3e;',
currentText: 'Այսօր',
monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս',
'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'],
monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս',
'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'],
dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'],
dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['hy']);
});/* Indonesian initialisation for the jQuery UI date picker plugin. */
/* Written by Deden Fathurahman (dedenf@gmail.com). */
jQuery(function($){
$.datepicker.regional['id'] = {
closeText: 'Tutup',
prevText: '&#x3c;mundur',
nextText: 'maju&#x3e;',
currentText: 'hari ini',
monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
'Juli','Agustus','September','Oktober','Nopember','Desember'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
'Jul','Agus','Sep','Okt','Nop','Des'],
dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['id']);
});/* Icelandic initialisation for the jQuery UI date picker plugin. */
/* Written by Haukur H. Thorsson (haukur@eskill.is). */
jQuery(function($){
$.datepicker.regional['is'] = {
closeText: 'Loka',
prevText: '&#x3c; Fyrri',
nextText: 'N&aelig;sti &#x3e;',
currentText: '&Iacute; dag',
monthNames: ['Jan&uacute;ar','Febr&uacute;ar','Mars','Apr&iacute;l','Ma&iacute','J&uacute;n&iacute;',
'J&uacute;l&iacute;','&Aacute;g&uacute;st','September','Okt&oacute;ber','N&oacute;vember','Desember'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Ma&iacute;','J&uacute;n',
'J&uacute;l','&Aacute;g&uacute;','Sep','Okt','N&oacute;v','Des'],
dayNames: ['Sunnudagur','M&aacute;nudagur','&THORN;ri&eth;judagur','Mi&eth;vikudagur','Fimmtudagur','F&ouml;studagur','Laugardagur'],
dayNamesShort: ['Sun','M&aacute;n','&THORN;ri','Mi&eth;','Fim','F&ouml;s','Lau'],
dayNamesMin: ['Su','M&aacute;','&THORN;r','Mi','Fi','F&ouml;','La'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['is']);
});/* Italian initialisation for the jQuery UI date picker plugin. */
/* Written by Apaella (apaella@gmail.com). */
jQuery(function($){
$.datepicker.regional['it'] = {
closeText: 'Chiudi',
prevText: '&#x3c;Prec',
nextText: 'Succ&#x3e;',
currentText: 'Oggi',
monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
'Lug','Ago','Set','Ott','Nov','Dic'],
dayNames: ['Domenica','Luned&#236','Marted&#236','Mercoled&#236','Gioved&#236','Venerd&#236','Sabato'],
dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa'],
dateFormat: 'dd/mm/yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['it']);
});
/* Japanese initialisation for the jQuery UI date picker plugin. */
/* Written by Kentaro SATO (kentaro@ranvis.com). */
jQuery(function($){
$.datepicker.regional['ja'] = {
closeText: '閉じる',
prevText: '&#x3c;前',
nextText: '次&#x3e;',
currentText: '今日',
monthNames: ['1月','2月','3月','4月','5月','6月',
'7月','8月','9月','10月','11月','12月'],
monthNamesShort: ['1月','2月','3月','4月','5月','6月',
'7月','8月','9月','10月','11月','12月'],
dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
dayNamesShort: ['日','月','火','水','木','金','土'],
dayNamesMin: ['日','月','火','水','木','金','土'],
dateFormat: 'yy/mm/dd', firstDay: 0,
isRTL: false,
showMonthAfterYear: true};
$.datepicker.setDefaults($.datepicker.regional['ja']);
});/* Korean initialisation for the jQuery calendar extension. */
/* Written by DaeKwon Kang (ncrash.dk@gmail.com). */
jQuery(function($){
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',
'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],
monthNamesShort: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',
'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
dateFormat: 'yy-mm-dd', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['ko']);
});/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* @author Arturas Paleicikas <arturas@avalon.lt> */
jQuery(function($){
$.datepicker.regional['lt'] = {
closeText: 'Uždaryti',
prevText: '&#x3c;Atgal',
nextText: 'Pirmyn&#x3e;',
currentText: 'Šiandien',
monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
'Lie','Rugp','Rugs','Spa','Lap','Gru'],
dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'],
dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'],
dateFormat: 'yy-mm-dd', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['lt']);
});/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* @author Arturas Paleicikas <arturas.paleicikas@metasite.net> */
jQuery(function($){
$.datepicker.regional['lv'] = {
closeText: 'Aizvērt',
prevText: 'Iepr',
nextText: 'Nāka',
currentText: 'Šodien',
monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs',
'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn',
'Jūl','Aug','Sep','Okt','Nov','Dec'],
dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
dateFormat: 'dd-mm-yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['lv']);
});/* Malaysian initialisation for the jQuery UI date picker plugin. */
/* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */
jQuery(function($){
$.datepicker.regional['ms'] = {
closeText: 'Tutup',
prevText: '&#x3c;Sebelum',
nextText: 'Selepas&#x3e;',
currentText: 'hari ini',
monthNames: ['Januari','Februari','Mac','April','Mei','Jun',
'Julai','Ogos','September','Oktober','November','Disember'],
monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun',
'Jul','Ogo','Sep','Okt','Nov','Dis'],
dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'],
dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'],
dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['ms']);
});/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Mathias Bynens <http://mathiasbynens.be/> */
jQuery(function($){
$.datepicker.regional.nl = {
closeText: 'Sluiten',
prevText: '←',
nextText: '→',
currentText: 'Vandaag',
monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun',
'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
dateFormat: 'dd/mm/yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional.nl);
});/* Norwegian initialisation for the jQuery UI date picker plugin. */
/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */
jQuery(function($){
$.datepicker.regional['no'] = {
closeText: 'Lukk',
prevText: '&laquo;Forrige',
nextText: 'Neste&raquo;',
currentText: 'I dag',
monthNames: ['Januar','Februar','Mars','April','Mai','Juni',
'Juli','August','September','Oktober','November','Desember'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Des'],
dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
dateFormat: 'yy-mm-dd', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['no']);
});
/* Polish initialisation for the jQuery UI date picker plugin. */
/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */
jQuery(function($){
$.datepicker.regional['pl'] = {
closeText: 'Zamknij',
prevText: '&#x3c;Poprzedni',
nextText: 'Następny&#x3e;',
currentText: 'Dziś',
monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
'Lip','Sie','Wrz','Pa','Lis','Gru'],
dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
dateFormat: 'yy-mm-dd', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['pl']);
});
/* Brazilian initialisation for the jQuery UI date picker plugin. */
/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */
jQuery(function($){
$.datepicker.regional['pt-BR'] = {
closeText: 'Fechar',
prevText: '&#x3c;Anterior',
nextText: 'Pr&oacute;ximo&#x3e;',
currentText: 'Hoje',
monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho',
'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
'Jul','Ago','Set','Out','Nov','Dez'],
dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
});/* Romanian initialisation for the jQuery UI date picker plugin. */
/* Written by Edmond L. (ll_edmond@walla.com). */
jQuery(function($){
$.datepicker.regional['ro'] = {
closeText: 'Inchide',
prevText: '&#x3c;Anterior',
nextText: 'Urmator&#x3e;',
currentText: 'Azi',
monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Junie',
'Julie','August','Septembrie','Octobrie','Noiembrie','Decembrie'],
monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Noi', 'Dec'],
dayNames: ['Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'],
dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'],
dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sa'],
dateFormat: 'mm/dd/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['ro']);
});
/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Andrew Stromnov (stromnov@gmail.com). */
jQuery(function($){
$.datepicker.regional['ru'] = {
closeText: 'Закрыть',
prevText: '&#x3c;Пред',
nextText: 'След&#x3e;',
currentText: 'Сегодня',
monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
'Июл','Авг','Сен','Окт','Ноя','Дек'],
dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['ru']);
});/* Slovak initialisation for the jQuery UI date picker plugin. */
/* Written by Vojtech Rinik (vojto@hmm.sk). */
jQuery(function($){
$.datepicker.regional['sk'] = {
closeText: 'Zavrieť',
prevText: '&#x3c;Predchádzajúci',
nextText: 'Nasledujúci&#x3e;',
currentText: 'Dnes',
monthNames: ['Január','Február','Marec','Apríl','Máj','Jún',
'Júl','August','September','Október','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
'Júl','Aug','Sep','Okt','Nov','Dec'],
dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'],
dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'],
dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'],
dateFormat: 'dd.mm.yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['sk']);
});
/* Slovenian initialisation for the jQuery UI date picker plugin. */
/* Written by Jaka Jancar (jaka@kubje.org). */
/* c = &#x10D;, s = &#x161; z = &#x17E; C = &#x10C; S = &#x160; Z = &#x17D; */
jQuery(function($){
$.datepicker.regional['sl'] = {
closeText: 'Zapri',
prevText: '&lt;Prej&#x161;nji',
nextText: 'Naslednji&gt;',
currentText: 'Trenutni',
monthNames: ['Januar','Februar','Marec','April','Maj','Junij',
'Julij','Avgust','September','Oktober','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Avg','Sep','Okt','Nov','Dec'],
dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','&#x10C;etrtek','Petek','Sobota'],
dayNamesShort: ['Ned','Pon','Tor','Sre','&#x10C;et','Pet','Sob'],
dayNamesMin: ['Ne','Po','To','Sr','&#x10C;e','Pe','So'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['sl']);
});
/* Albanian initialisation for the jQuery UI date picker plugin. */
/* Written by Flakron Bytyqi (flakron@gmail.com). */
jQuery(function($){
$.datepicker.regional['sq'] = {
closeText: 'mbylle',
prevText: '&#x3c;mbrapa',
nextText: 'Përpara&#x3e;',
currentText: 'sot',
monthNames: ['Janar','Shkurt','Mars','Pril','Maj','Qershor',
'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'],
monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer',
'Kor','Gus','Sht','Tet','Nën','Dhj'],
dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'],
dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'],
dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['sq']);
});
/* Serbian i18n for the jQuery UI date picker plugin. */
/* Written by Dejan Dimić. */
jQuery(function($){
$.datepicker.regional['sr-SR'] = {
closeText: 'Zatvori',
prevText: '&#x3c;',
nextText: '&#x3e;',
currentText: 'Danas',
monthNames: ['Januar','Februar','Mart','April','Maj','Jun',
'Jul','Avgust','Septembar','Oktobar','Novembar','Decembar'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Avg','Sep','Okt','Nov','Dec'],
dayNames: ['Nedelja','Ponedeljak','Utorak','Sreda','Četvrtak','Petak','Subota'],
dayNamesShort: ['Ned','Pon','Uto','Sre','Čet','Pet','Sub'],
dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
dateFormat: 'dd/mm/yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['sr-SR']);
});
/* Serbian i18n for the jQuery UI date picker plugin. */
/* Written by Dejan Dimić. */
jQuery(function($){
$.datepicker.regional['sr'] = {
closeText: 'Затвори',
prevText: '&#x3c;',
nextText: '&#x3e;',
currentText: 'Данас',
monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун',
'Јул','Август','Септембар','Октобар','Новембар','Децембар'],
monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун',
'Јул','Авг','Сеп','Окт','Нов','Дец'],
dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'],
dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'],
dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'],
dateFormat: 'dd/mm/yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['sr']);
});
/* Swedish initialisation for the jQuery UI date picker plugin. */
/* Written by Anders Ekdahl ( anders@nomadiz.se). */
jQuery(function($){
$.datepicker.regional['sv'] = {
closeText: 'Stäng',
prevText: '&laquo;Förra',
nextText: 'Nästa&raquo;',
currentText: 'Idag',
monthNames: ['Januari','Februari','Mars','April','Maj','Juni',
'Juli','Augusti','September','Oktober','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Aug','Sep','Okt','Nov','Dec'],
dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'],
dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'],
dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'],
dateFormat: 'yy-mm-dd', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['sv']);
});
/* Thai initialisation for the jQuery UI date picker plugin. */
/* Written by pipo (pipo@sixhead.com). */
jQuery(function($){
$.datepicker.regional['th'] = {
closeText: 'ปิด',
prevText: '&laquo;&nbsp;ย้อน',
nextText: 'ถัดไป&nbsp;&raquo;',
currentText: 'วันนี้',
monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน',
'กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.',
'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'],
dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'],
dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['th']);
});/* Turkish initialisation for the jQuery UI date picker plugin. */
/* Written by Izzet Emre Erkan (kara@karalamalar.net). */
jQuery(function($){
$.datepicker.regional['tr'] = {
closeText: 'kapat',
prevText: '&#x3c;geri',
nextText: 'ileri&#x3e',
currentText: 'bugün',
monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz',
'Tem','Ağu','Eyl','Eki','Kas','Ara'],
dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['tr']);
});/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */
jQuery(function($){
$.datepicker.regional['uk'] = {
closeText: 'Закрити',
prevText: '&#x3c;',
nextText: '&#x3e;',
currentText: 'Сьогодні',
monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],
monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
'Лип','Сер','Вер','Жов','Лис','Гру'],
dayNames: ['неділя','понеділок','вівторок','середа','четвер','пятниця','суббота'],
dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'],
dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['uk']);
});/* Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by Cloudream (cloudream@gmail.com). */
jQuery(function($){
$.datepicker.regional['zh-CN'] = {
closeText: '关闭',
prevText: '&#x3c;上月',
nextText: '下月&#x3e;',
currentText: '今天',
monthNames: ['一月','二月','三月','四月','五月','六月',
'七月','八月','九月','十月','十一月','十二月'],
monthNamesShort: ['一','二','三','四','五','六',
'七','八','九','十','十一','十二'],
dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
dayNamesMin: ['日','一','二','三','四','五','六'],
dateFormat: 'yy-mm-dd', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
});
/* Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by Ressol (ressol@gmail.com). */
jQuery(function($){
$.datepicker.regional['zh-TW'] = {
closeText: '關閉',
prevText: '&#x3c;上月',
nextText: '下月&#x3e;',
currentText: '今天',
monthNames: ['一月','二月','三月','四月','五月','六月',
'七月','八月','九月','十月','十一月','十二月'],
monthNamesShort: ['一','二','三','四','五','六',
'七','八','九','十','十一','十二'],
dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
dayNamesMin: ['日','一','二','三','四','五','六'],
dateFormat: 'yy/mm/dd', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['zh-TW']);
});

20
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-ar.js

@ -0,0 +1,20 @@
/* Arabic Translation for jQuery UI date picker plugin. */
/* Khaled Al Horani -- koko.dw@gmail.com */
/* خالد الحوراني -- koko.dw@gmail.com */
/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
jQuery(function($){
$.datepicker.regional['ar'] = {
closeText: 'إغلاق',
prevText: '&#x3c;السابق',
nextText: 'التالي&#x3e;',
currentText: 'اليوم',
monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران',
'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'],
dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'],
dayNamesMin: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: true};
$.datepicker.setDefaults($.datepicker.regional['ar']);
});

20
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-bg.js

@ -0,0 +1,20 @@
/* Bulgarian initialisation for the jQuery UI date picker plugin. */
/* Written by Stoyan Kyosev (http://svest.org). */
jQuery(function($){
$.datepicker.regional['bg'] = {
closeText: 'затвори',
prevText: '&#x3c;назад',
nextText: 'напред&#x3e;',
nextBigText: '&#x3e;&#x3e;',
currentText: 'днес',
monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
'Юли','Август','Септември','Октомври','Ноември','Декември'],
monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
'Юли','Авг','Сеп','Окт','Нов','Дек'],
dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['bg']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-ca.js

@ -0,0 +1,19 @@
/* Inicialitzaci� en catal� per a l'extenci� 'calendar' per jQuery. */
/* Writers: (joan.leon@gmail.com). */
jQuery(function($){
$.datepicker.regional['ca'] = {
closeText: 'Tancar',
prevText: '&#x3c;Ant',
nextText: 'Seg&#x3e;',
currentText: 'Avui',
monthNames: ['Gener','Febrer','Mar&ccedil;','Abril','Maig','Juny',
'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'],
monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
'Jul','Ago','Set','Oct','Nov','Des'],
dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
dateFormat: 'mm/dd/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['ca']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-cs.js

@ -0,0 +1,19 @@
/* Czech initialisation for the jQuery UI date picker plugin. */
/* Written by Tomas Muller (tomas@tomas-muller.net). */
jQuery(function($){
$.datepicker.regional['cs'] = {
closeText: 'Zavřít',
prevText: '&#x3c;Dříve',
nextText: 'Později&#x3e;',
currentText: 'Nyní',
monthNames: ['leden','únor','březen','duben','květen','červen',
'červenec','srpen','září','říjen','listopad','prosinec'],
monthNamesShort: ['led','úno','bře','dub','kvě','čer',
'čvc','srp','zář','říj','lis','pro'],
dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
dayNamesMin: ['ne','po','út','st','čt','pá','so'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['cs']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-da.js

@ -0,0 +1,19 @@
/* Danish initialisation for the jQuery UI date picker plugin. */
/* Written by Jan Christensen ( deletestuff@gmail.com). */
jQuery(function($){
$.datepicker.regional['da'] = {
closeText: 'Luk',
prevText: '&#x3c;Forrige',
nextText: 'Næste&#x3e;',
currentText: 'Idag',
monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
'Juli','August','September','Oktober','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Aug','Sep','Okt','Nov','Dec'],
dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
dateFormat: 'dd-mm-yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['da']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-de.js

@ -0,0 +1,19 @@
/* German initialisation for the jQuery UI date picker plugin. */
/* Written by Milian Wolff (mail@milianw.de). */
jQuery(function($){
$.datepicker.regional['de'] = {
closeText: 'schließen',
prevText: '&#x3c;zurück',
nextText: 'Vor&#x3e;',
currentText: 'heute',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['de']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-el.js

@ -0,0 +1,19 @@
/* Greek (el) initialisation for the jQuery UI date picker plugin. */
/* Written by Alex Cicovic (http://www.alexcicovic.com) */
jQuery(function($){
$.datepicker.regional['el'] = {
closeText: 'Κλείσιμο',
prevText: 'Προηγούμενος',
nextText: 'Επόμενος',
currentText: 'Τρέχων Μήνας',
monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
dateFormat: 'dd/mm/yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['el']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-eo.js

@ -0,0 +1,19 @@
/* Esperanto initialisation for the jQuery UI date picker plugin. */
/* Written by Olivier M. (olivierweb@ifrance.com). */
jQuery(function($){
$.datepicker.regional['eo'] = {
closeText: 'Fermi',
prevText: '&lt;Anta',
nextText: 'Sekv&gt;',
currentText: 'Nuna',
monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Aŭg','Sep','Okt','Nov','Dec'],
dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'],
dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['eo']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-es.js

@ -0,0 +1,19 @@
/* Inicializaci�n en espa�ol para la extensi�n 'UI date picker' para jQuery. */
/* Traducido por Vester (xvester@gmail.com). */
jQuery(function($){
$.datepicker.regional['es'] = {
closeText: 'Cerrar',
prevText: '&#x3c;Ant',
nextText: 'Sig&#x3e;',
currentText: 'Hoy',
monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
'Jul','Ago','Sep','Oct','Nov','Dic'],
dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'],
dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'],
dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','S&aacute;'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['es']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-fa.js

@ -0,0 +1,19 @@
/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
/* Javad Mowlanezhad -- jmowla@gmail.com */
/* Jalali calendar should supported soon! (Its implemented but I have to test it) */
jQuery(function($) {
$.datepicker.regional['fa'] = {
closeText: 'بستن',
prevText: '&#x3c;قبلي',
nextText: 'بعدي&#x3e;',
currentText: 'امروز',
monthNames: ['فروردين','ارديبهشت','خرداد','تير','مرداد','شهريور',
'مهر','آبان','آذر','دي','بهمن','اسفند'],
monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
dayNames: ['يکشنبه','دوشنبه','سه‌شنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'],
dayNamesShort: ['ي','د','س','چ','پ','ج', 'ش'],
dayNamesMin: ['ي','د','س','چ','پ','ج', 'ش'],
dateFormat: 'yy/mm/dd', firstDay: 6,
isRTL: true};
$.datepicker.setDefaults($.datepicker.regional['fa']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-fi.js

@ -0,0 +1,19 @@
/* Finnish initialisation for the jQuery UI date picker plugin. */
/* Written by Harri Kilpi� (harrikilpio@gmail.com). */
jQuery(function($){
$.datepicker.regional['fi'] = {
closeText: 'Sulje',
prevText: '&laquo;Edellinen',
nextText: 'Seuraava&raquo;',
currentText: 'T&auml;n&auml;&auml;n',
monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kes&auml;kuu',
'Hein&auml;kuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kes&auml;',
'Hein&auml;','Elo','Syys','Loka','Marras','Joulu'],
dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'],
dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['fi']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-fr.js

@ -0,0 +1,19 @@
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood@virginbroadband.com.au) and Stéphane Nahmani (sholby@sholby.net). */
jQuery(function($){
$.datepicker.regional['fr'] = {
closeText: 'Fermer',
prevText: '&#x3c;Préc',
nextText: 'Suiv&#x3e;',
currentText: 'Courant',
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
'Jul','Aoû','Sep','Oct','Nov','Déc'],
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
dateFormat: 'dd/mm/yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['fr']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-he.js

@ -0,0 +1,19 @@
/* Hebrew initialisation for the UI Datepicker extension. */
/* Written by Amir Hardon (ahardon at gmail dot com). */
jQuery(function($){
$.datepicker.regional['he'] = {
closeText: 'סגור',
prevText: '&#x3c;הקודם',
nextText: 'הבא&#x3e;',
currentText: 'היום',
monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
monthNamesShort: ['1','2','3','4','5','6',
'7','8','9','10','11','12'],
dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: true};
$.datepicker.setDefaults($.datepicker.regional['he']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-hr.js

@ -0,0 +1,19 @@
/* Croatian i18n for the jQuery UI date picker plugin. */
/* Written by Vjekoslav Nesek. */
jQuery(function($){
$.datepicker.regional['hr'] = {
closeText: 'Zatvori',
prevText: '&#x3c;',
nextText: '&#x3e;',
currentText: 'Danas',
monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipani',
'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
'Srp','Kol','Ruj','Lis','Stu','Pro'],
dayNames: ['Nedjalja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
dateFormat: 'dd.mm.yy.', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['hr']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-hu.js

@ -0,0 +1,19 @@
/* Hungarian initialisation for the jQuery UI date picker plugin. */
/* Written by Istvan Karaszi (jquerycalendar@spam.raszi.hu). */
jQuery(function($){
$.datepicker.regional['hu'] = {
closeText: 'bezárás',
prevText: '&laquo;&nbsp;vissza',
nextText: 'előre&nbsp;&raquo;',
currentText: 'ma',
monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június',
'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún',
'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
dayNames: ['Vasámap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
dateFormat: 'yy-mm-dd', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['hu']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-hy.js

@ -0,0 +1,19 @@
/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/
jQuery(function($){
$.datepicker.regional['hy'] = {
closeText: 'Փակել',
prevText: '&#x3c;Նախ.',
nextText: 'Հաջ.&#x3e;',
currentText: 'Այսօր',
monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս',
'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'],
monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս',
'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'],
dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'],
dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
dateFormat: 'dd.mm.yy', firstDay: 1,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['hy']);
});

19
cl_stream_mybatis/src/main/resources/static/scripts/jquery/ui/i18n/ui.datepicker-id.js

@ -0,0 +1,19 @@
/* Indonesian initialisation for the jQuery UI date picker plugin. */
/* Written by Deden Fathurahman (dedenf@gmail.com). */
jQuery(function($){
$.datepicker.regional['id'] = {
closeText: 'Tutup',
prevText: '&#x3c;mundur',
nextText: 'maju&#x3e;',
currentText: 'hari ini',
monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
'Juli','Agustus','September','Oktober','Nopember','Desember'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
'Jul','Agus','Sep','Okt','Nop','Des'],
dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
dateFormat: 'dd/mm/yy', firstDay: 0,
isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['id']);
});

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save