├── .gitignore ├── webapp ├── WEB-INF │ ├── www │ │ ├── me │ │ │ ├── index.vm │ │ │ ├── blog │ │ │ │ ├── draft.vm │ │ │ │ ├── history.vm │ │ │ │ ├── catalog.vm │ │ │ │ ├── post.vm │ │ │ │ └── edit.vm │ │ │ ├── profile.vm │ │ │ ├── page.vm │ │ │ └── pwd.vm │ │ ├── about │ │ │ └── index.vm │ │ ├── home │ │ │ ├── login.vm │ │ │ └── reg.vm │ │ ├── index.vm │ │ └── blog │ │ │ ├── tag │ │ │ └── index.vm │ │ │ ├── user │ │ │ └── index.vm │ │ │ ├── catalog │ │ │ └── index.vm │ │ │ └── index.vm │ ├── lib │ │ ├── log4j.jar │ │ ├── oreilly.jar │ │ ├── dtools-ini.jar │ │ ├── c3p0-0.9.1.2.jar │ │ ├── jsoup-1.6.2.jar │ │ ├── velocity-1.7.jar │ │ ├── filters-2.0.235.jar │ │ ├── slf4j-api-1.6.1.jar │ │ ├── commons-codec-1.5.jar │ │ ├── commons-io-2.0.1.jar │ │ ├── commons-lang-2.6.jar │ │ ├── slf4j-jdk14-1.6.1.jar │ │ ├── commons-digester-1.8.jar │ │ ├── ehcache-core-2.4.2.jar │ │ ├── gif4j_pro_trial_2.3.jar │ │ ├── IKAnalyzer3.2.0Stable.jar │ │ ├── commons-logging-1.1.1.jar │ │ ├── commons-beanutils-1.8.3.jar │ │ ├── commons-collections-3.2.1.jar │ │ ├── commons-dbutils-1.3-qxh.jar │ │ ├── velocity-tools-view-1.4.jar │ │ └── mysql-connector-java-5.1.13-bin.jar │ ├── layout │ │ ├── error │ │ │ ├── 404.vm │ │ │ ├── 500.vm │ │ │ └── 403.vm │ │ ├── inc │ │ │ ├── cnzz.vm │ │ │ ├── ujian.vm │ │ │ ├── share.vm │ │ │ ├── header.vm │ │ │ ├── duoshuo.vm │ │ │ ├── footer.vm │ │ │ └── banner.vm │ │ ├── default.vm │ │ └── shell │ │ │ ├── login.vm │ │ │ ├── blank.vm │ │ │ ├── home.vm │ │ │ └── me.vm │ └── conf │ │ └── velocity-toolbox.xml ├── img │ ├── 404.png │ ├── y.png │ ├── camel.png │ ├── code.png │ ├── guest.png │ ├── favicon.ico │ └── microblog-logos.png ├── js │ ├── jcrop │ │ ├── css │ │ │ ├── Jcrop.gif │ │ │ └── jquery.Jcrop.min.css │ │ └── index.html │ ├── art │ │ ├── skins │ │ │ ├── black │ │ │ │ ├── bg.png │ │ │ │ ├── bg2.png │ │ │ │ ├── bg_css3.png │ │ │ │ └── bg_css3_2.png │ │ │ ├── blue │ │ │ │ ├── bg.png │ │ │ │ ├── bg2.png │ │ │ │ ├── bg_css3.png │ │ │ │ └── bg_css3_2.png │ │ │ ├── green │ │ │ │ ├── bg.png │ │ │ │ ├── bg2.png │ │ │ │ ├── bg_css3.png │ │ │ │ ├── color_bg.png │ │ │ │ └── bg_css3_2.png │ │ │ ├── loading.gif │ │ │ ├── opera │ │ │ │ ├── s1.png │ │ │ │ └── s2.png │ │ │ ├── aero │ │ │ │ ├── aero_s.png │ │ │ │ └── aero_s2.png │ │ │ ├── chrome │ │ │ │ ├── border.png │ │ │ │ └── chrome_s.png │ │ │ └── idialog │ │ │ │ ├── idialog_s.png │ │ │ │ └── idialog_s2.png │ │ └── artDialog.plugins.min.js │ ├── ke4 │ │ ├── themes │ │ │ ├── common │ │ │ │ ├── rm.gif │ │ │ │ ├── anchor.gif │ │ │ │ ├── blank.gif │ │ │ │ ├── flash.gif │ │ │ │ ├── media.gif │ │ │ │ └── loading.gif │ │ │ ├── qq │ │ │ │ └── editor.gif │ │ │ ├── default │ │ │ │ ├── default.png │ │ │ │ └── background.png │ │ │ └── simple │ │ │ │ └── simple.css │ │ └── plugins │ │ │ ├── emoticons │ │ │ └── images │ │ │ │ ├── 0.gif │ │ │ │ ├── 1.gif │ │ │ │ ├── 10.gif │ │ │ │ ├── 11.gif │ │ │ │ ├── 12.gif │ │ │ │ ├── 13.gif │ │ │ │ ├── 14.gif │ │ │ │ ├── 15.gif │ │ │ │ ├── 16.gif │ │ │ │ ├── 17.gif │ │ │ │ ├── 18.gif │ │ │ │ ├── 19.gif │ │ │ │ ├── 2.gif │ │ │ │ ├── 20.gif │ │ │ │ ├── 21.gif │ │ │ │ ├── 22.gif │ │ │ │ ├── 23.gif │ │ │ │ ├── 24.gif │ │ │ │ ├── 25.gif │ │ │ │ ├── 26.gif │ │ │ │ ├── 27.gif │ │ │ │ ├── 28.gif │ │ │ │ ├── 29.gif │ │ │ │ ├── 3.gif │ │ │ │ ├── 30.gif │ │ │ │ ├── 31.gif │ │ │ │ ├── 32.gif │ │ │ │ ├── 33.gif │ │ │ │ ├── 34.gif │ │ │ │ ├── 35.gif │ │ │ │ ├── 36.gif │ │ │ │ ├── 37.gif │ │ │ │ ├── 38.gif │ │ │ │ ├── 39.gif │ │ │ │ ├── 4.gif │ │ │ │ ├── 40.gif │ │ │ │ ├── 41.gif │ │ │ │ ├── 42.gif │ │ │ │ ├── 43.gif │ │ │ │ ├── 44.gif │ │ │ │ ├── 45.gif │ │ │ │ ├── 46.gif │ │ │ │ ├── 47.gif │ │ │ │ ├── 48.gif │ │ │ │ ├── 49.gif │ │ │ │ ├── 5.gif │ │ │ │ ├── 50.gif │ │ │ │ ├── 51.gif │ │ │ │ ├── 52.gif │ │ │ │ ├── 53.gif │ │ │ │ ├── 54.gif │ │ │ │ ├── 55.gif │ │ │ │ ├── 56.gif │ │ │ │ ├── 57.gif │ │ │ │ ├── 58.gif │ │ │ │ ├── 59.gif │ │ │ │ ├── 6.gif │ │ │ │ ├── 60.gif │ │ │ │ ├── 61.gif │ │ │ │ ├── 62.gif │ │ │ │ ├── 63.gif │ │ │ │ ├── 64.gif │ │ │ │ ├── 65.gif │ │ │ │ ├── 66.gif │ │ │ │ ├── 67.gif │ │ │ │ ├── 68.gif │ │ │ │ ├── 69.gif │ │ │ │ ├── 7.gif │ │ │ │ ├── 70.gif │ │ │ │ ├── 71.gif │ │ │ │ ├── 72.gif │ │ │ │ ├── 73.gif │ │ │ │ ├── 74.gif │ │ │ │ ├── 75.gif │ │ │ │ ├── 76.gif │ │ │ │ ├── 77.gif │ │ │ │ ├── 78.gif │ │ │ │ ├── 79.gif │ │ │ │ ├── 8.gif │ │ │ │ ├── 80.gif │ │ │ │ ├── 81.gif │ │ │ │ ├── 82.gif │ │ │ │ ├── 83.gif │ │ │ │ ├── 84.gif │ │ │ │ ├── 85.gif │ │ │ │ ├── 86.gif │ │ │ │ ├── 87.gif │ │ │ │ ├── 88.gif │ │ │ │ ├── 89.gif │ │ │ │ ├── 9.gif │ │ │ │ ├── 90.gif │ │ │ │ ├── 91.gif │ │ │ │ ├── 92.gif │ │ │ │ ├── 93.gif │ │ │ │ ├── 94.gif │ │ │ │ ├── 95.gif │ │ │ │ ├── 96.gif │ │ │ │ ├── 97.gif │ │ │ │ ├── 98.gif │ │ │ │ ├── 99.gif │ │ │ │ ├── 100.gif │ │ │ │ ├── 101.gif │ │ │ │ ├── 102.gif │ │ │ │ ├── 103.gif │ │ │ │ ├── 104.gif │ │ │ │ ├── 105.gif │ │ │ │ ├── 106.gif │ │ │ │ ├── 107.gif │ │ │ │ ├── 108.gif │ │ │ │ ├── 109.gif │ │ │ │ ├── 110.gif │ │ │ │ ├── 111.gif │ │ │ │ ├── 112.gif │ │ │ │ ├── 113.gif │ │ │ │ ├── 114.gif │ │ │ │ ├── 115.gif │ │ │ │ ├── 116.gif │ │ │ │ ├── 117.gif │ │ │ │ ├── 118.gif │ │ │ │ ├── 119.gif │ │ │ │ ├── 120.gif │ │ │ │ ├── 121.gif │ │ │ │ ├── 122.gif │ │ │ │ ├── 123.gif │ │ │ │ ├── 124.gif │ │ │ │ ├── 125.gif │ │ │ │ ├── 126.gif │ │ │ │ ├── 127.gif │ │ │ │ ├── 128.gif │ │ │ │ ├── 129.gif │ │ │ │ ├── 130.gif │ │ │ │ ├── 131.gif │ │ │ │ ├── 132.gif │ │ │ │ ├── 133.gif │ │ │ │ ├── 134.gif │ │ │ │ └── static.gif │ │ │ ├── image │ │ │ └── images │ │ │ │ ├── align_top.gif │ │ │ │ ├── refresh.png │ │ │ │ ├── align_left.gif │ │ │ │ └── align_right.gif │ │ │ ├── filemanager │ │ │ └── images │ │ │ │ ├── go-up.gif │ │ │ │ ├── file-16.gif │ │ │ │ ├── file-64.gif │ │ │ │ ├── folder-16.gif │ │ │ │ └── folder-64.gif │ │ │ ├── multiimage │ │ │ └── images │ │ │ │ ├── image.png │ │ │ │ ├── swfupload.swf │ │ │ │ ├── select-files-en.png │ │ │ │ └── select-files-zh_CN.png │ │ │ ├── template │ │ │ ├── html │ │ │ │ ├── 1.html │ │ │ │ ├── 3.html │ │ │ │ └── 2.html │ │ │ └── template.js │ │ │ ├── autoheight │ │ │ └── autoheight.js │ │ │ ├── code │ │ │ ├── prettify.css │ │ │ └── code.js │ │ │ ├── pagebreak │ │ │ └── pagebreak.js │ │ │ ├── preview │ │ │ └── preview.js │ │ │ ├── clearhtml │ │ │ └── clearhtml.js │ │ │ ├── lineheight │ │ │ └── lineheight.js │ │ │ ├── baidumap │ │ │ ├── map.html │ │ │ └── index.html │ │ │ ├── plainpaste │ │ │ └── plainpaste.js │ │ │ ├── anchor │ │ │ └── anchor.js │ │ │ ├── wordpaste │ │ │ └── wordpaste.js │ │ │ ├── map │ │ │ └── map.html │ │ │ ├── quickformat │ │ │ └── quickformat.js │ │ │ └── link │ │ │ └── link.js │ └── m.js ├── robots.txt └── css │ ├── ke-coder.css │ ├── prettify.css │ └── genius.css ├── lib ├── ant-launcher.jar ├── junit-4.8.1.jar └── servlet-api.jar ├── src ├── org │ └── iperl │ │ ├── toolbox │ │ ├── TagTool.java │ │ ├── CatalogTool.java │ │ ├── UserTool.java │ │ └── BlogTool.java │ │ ├── util │ │ └── InputChecker.java │ │ ├── dto │ │ └── Pagination.java │ │ ├── service │ │ ├── PageService.java │ │ ├── StorageService.java │ │ ├── CatalogService.java │ │ ├── TagService.java │ │ └── UserService.java │ │ ├── action │ │ ├── UtilAction.java │ │ ├── BaseAction.java │ │ ├── FileAction.java │ │ ├── CatalogAction.java │ │ └── BlogAction.java │ │ └── beans │ │ ├── Tag.java │ │ ├── BlogTag.java │ │ ├── Invitation.java │ │ ├── Page.java │ │ └── BlogCatalog.java └── my │ ├── img │ ├── ImgException.java │ ├── ImgHandler.java │ ├── MyScaleFilter.java │ └── GeneralPathRect.java │ ├── mvc │ ├── ActionException.java │ ├── IUser.java │ ├── Annotation.java │ ├── BadWord.java │ └── MultipartRequest.java │ ├── cache │ ├── CacheException.java │ ├── CacheProvider.java │ ├── Cache.java │ ├── CacheDirective.java │ └── CacheManager.java │ ├── db │ └── DBException.java │ ├── util │ ├── SqlUtil.java │ ├── MyListUtils.java │ ├── UniqueStringList.java │ ├── Storage.java │ └── ResourceUtils.java │ ├── toolbox │ ├── LinkTool.java │ └── CoreTool.java │ └── view │ ├── ResourceTool.java │ └── VelocityServlet.java ├── .project ├── conf ├── db.properties ├── log4j.properties └── ehcache.xml ├── README.md └── .classpath /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Package Files # 4 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/index.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | 后台管理页面 -------------------------------------------------------------------------------- /webapp/img/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/img/404.png -------------------------------------------------------------------------------- /webapp/img/y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/img/y.png -------------------------------------------------------------------------------- /lib/ant-launcher.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/lib/ant-launcher.jar -------------------------------------------------------------------------------- /lib/junit-4.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/lib/junit-4.8.1.jar -------------------------------------------------------------------------------- /lib/servlet-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/lib/servlet-api.jar -------------------------------------------------------------------------------- /webapp/img/camel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/img/camel.png -------------------------------------------------------------------------------- /webapp/img/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/img/code.png -------------------------------------------------------------------------------- /webapp/img/guest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/img/guest.png -------------------------------------------------------------------------------- /webapp/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/img/favicon.ico -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/log4j.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/log4j.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/oreilly.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/oreilly.jar -------------------------------------------------------------------------------- /webapp/img/microblog-logos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/img/microblog-logos.png -------------------------------------------------------------------------------- /webapp/js/jcrop/css/Jcrop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/jcrop/css/Jcrop.gif -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/dtools-ini.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/dtools-ini.jar -------------------------------------------------------------------------------- /webapp/js/art/skins/black/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/black/bg.png -------------------------------------------------------------------------------- /webapp/js/art/skins/black/bg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/black/bg2.png -------------------------------------------------------------------------------- /webapp/js/art/skins/blue/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/blue/bg.png -------------------------------------------------------------------------------- /webapp/js/art/skins/blue/bg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/blue/bg2.png -------------------------------------------------------------------------------- /webapp/js/art/skins/green/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/green/bg.png -------------------------------------------------------------------------------- /webapp/js/art/skins/green/bg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/green/bg2.png -------------------------------------------------------------------------------- /webapp/js/art/skins/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/loading.gif -------------------------------------------------------------------------------- /webapp/js/art/skins/opera/s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/opera/s1.png -------------------------------------------------------------------------------- /webapp/js/art/skins/opera/s2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/opera/s2.png -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/c3p0-0.9.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/c3p0-0.9.1.2.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/jsoup-1.6.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/jsoup-1.6.2.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/velocity-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/velocity-1.7.jar -------------------------------------------------------------------------------- /webapp/js/art/skins/aero/aero_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/aero/aero_s.png -------------------------------------------------------------------------------- /webapp/js/ke4/themes/common/rm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/common/rm.gif -------------------------------------------------------------------------------- /webapp/js/ke4/themes/qq/editor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/qq/editor.gif -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/error/404.vm: -------------------------------------------------------------------------------- 1 | #set($layout = "shell/blank.vm") 2 | Oops...The page is missing. Go home -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/filters-2.0.235.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/filters-2.0.235.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/slf4j-api-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/slf4j-api-1.6.1.jar -------------------------------------------------------------------------------- /webapp/js/art/skins/aero/aero_s2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/aero/aero_s2.png -------------------------------------------------------------------------------- /webapp/js/art/skins/black/bg_css3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/black/bg_css3.png -------------------------------------------------------------------------------- /webapp/js/art/skins/blue/bg_css3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/blue/bg_css3.png -------------------------------------------------------------------------------- /webapp/js/art/skins/blue/bg_css3_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/blue/bg_css3_2.png -------------------------------------------------------------------------------- /webapp/js/art/skins/chrome/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/chrome/border.png -------------------------------------------------------------------------------- /webapp/js/art/skins/green/bg_css3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/green/bg_css3.png -------------------------------------------------------------------------------- /webapp/js/art/skins/green/color_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/green/color_bg.png -------------------------------------------------------------------------------- /webapp/js/ke4/themes/common/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/common/anchor.gif -------------------------------------------------------------------------------- /webapp/js/ke4/themes/common/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/common/blank.gif -------------------------------------------------------------------------------- /webapp/js/ke4/themes/common/flash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/common/flash.gif -------------------------------------------------------------------------------- /webapp/js/ke4/themes/common/media.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/common/media.gif -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/inc/cnzz.vm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/commons-codec-1.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/commons-codec-1.5.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/commons-io-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/commons-io-2.0.1.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/commons-lang-2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/commons-lang-2.6.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/slf4j-jdk14-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/slf4j-jdk14-1.6.1.jar -------------------------------------------------------------------------------- /webapp/js/art/skins/black/bg_css3_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/black/bg_css3_2.png -------------------------------------------------------------------------------- /webapp/js/art/skins/chrome/chrome_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/chrome/chrome_s.png -------------------------------------------------------------------------------- /webapp/js/art/skins/green/bg_css3_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/green/bg_css3_2.png -------------------------------------------------------------------------------- /webapp/js/ke4/themes/common/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/common/loading.gif -------------------------------------------------------------------------------- /webapp/js/ke4/themes/default/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/default/default.png -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/commons-digester-1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/commons-digester-1.8.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/ehcache-core-2.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/ehcache-core-2.4.2.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/gif4j_pro_trial_2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/gif4j_pro_trial_2.3.jar -------------------------------------------------------------------------------- /webapp/js/art/skins/idialog/idialog_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/idialog/idialog_s.png -------------------------------------------------------------------------------- /webapp/js/art/skins/idialog/idialog_s2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/art/skins/idialog/idialog_s2.png -------------------------------------------------------------------------------- /webapp/js/ke4/themes/default/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/themes/default/background.png -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/IKAnalyzer3.2.0Stable.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/IKAnalyzer3.2.0Stable.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/commons-logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/commons-logging-1.1.1.jar -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/0.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/1.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/10.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/11.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/12.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/13.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/14.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/15.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/16.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/17.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/18.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/19.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/2.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/20.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/21.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/22.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/23.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/24.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/25.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/26.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/27.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/28.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/29.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/3.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/30.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/31.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/32.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/33.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/34.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/35.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/36.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/37.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/38.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/39.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/4.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/40.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/41.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/42.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/43.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/44.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/45.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/46.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/47.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/48.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/49.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/5.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/50.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/51.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/52.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/53.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/54.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/55.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/56.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/57.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/58.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/59.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/6.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/60.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/61.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/62.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/63.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/64.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/65.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/66.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/67.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/68.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/69.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/7.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/70.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/71.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/72.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/72.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/73.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/73.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/74.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/74.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/75.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/75.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/76.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/76.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/77.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/77.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/78.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/78.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/79.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/79.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/8.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/80.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/80.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/81.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/81.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/82.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/82.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/83.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/83.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/84.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/84.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/85.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/85.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/86.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/86.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/87.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/87.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/88.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/88.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/89.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/89.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/9.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/90.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/90.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/91.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/91.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/92.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/92.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/93.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/93.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/94.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/94.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/95.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/95.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/96.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/96.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/97.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/97.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/98.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/98.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/99.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/99.gif -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/commons-beanutils-1.8.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/commons-beanutils-1.8.3.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/commons-collections-3.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/commons-collections-3.2.1.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/commons-dbutils-1.3-qxh.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/commons-dbutils-1.3-qxh.jar -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/velocity-tools-view-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/velocity-tools-view-1.4.jar -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/100.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/100.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/101.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/101.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/102.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/102.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/103.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/103.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/104.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/104.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/105.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/105.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/106.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/106.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/107.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/107.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/108.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/108.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/109.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/109.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/110.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/110.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/111.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/111.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/112.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/112.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/113.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/113.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/114.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/114.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/115.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/115.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/116.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/116.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/117.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/117.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/118.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/118.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/119.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/119.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/120.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/120.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/121.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/121.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/122.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/122.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/123.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/123.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/124.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/124.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/125.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/125.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/126.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/126.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/127.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/127.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/128.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/128.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/129.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/129.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/130.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/130.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/131.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/131.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/132.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/132.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/133.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/133.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/134.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/134.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/image/images/align_top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/image/images/align_top.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/image/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/image/images/refresh.png -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/error/500.vm: -------------------------------------------------------------------------------- 1 | #set($layout = "shell/blank.vm") 2 | Oops...Something wrong...Please mailto:cnperl@163.com. We will repair soon. 3Q -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/emoticons/images/static.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/emoticons/images/static.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/filemanager/images/go-up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/filemanager/images/go-up.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/image/images/align_left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/image/images/align_left.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/image/images/align_right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/image/images/align_right.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/multiimage/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/multiimage/images/image.png -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/filemanager/images/file-16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/filemanager/images/file-16.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/filemanager/images/file-64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/filemanager/images/file-64.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/multiimage/images/swfupload.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/multiimage/images/swfupload.swf -------------------------------------------------------------------------------- /webapp/WEB-INF/lib/mysql-connector-java-5.1.13-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/WEB-INF/lib/mysql-connector-java-5.1.13-bin.jar -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/filemanager/images/folder-16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/filemanager/images/folder-16.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/filemanager/images/folder-64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/filemanager/images/folder-64.gif -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/multiimage/images/select-files-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/multiimage/images/select-files-en.png -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/multiimage/images/select-files-zh_CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlricQin/TBlog/master/webapp/js/ke4/plugins/multiimage/images/select-files-zh_CN.png -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/error/403.vm: -------------------------------------------------------------------------------- 1 | #set($layout = "shell/blank.vm") 2 | Oops...You don't have permission to view the page. Any question? mailto:cnperl@163.com Go home -------------------------------------------------------------------------------- /webapp/robots.txt: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | User-agent: * 6 | Disallow: /admin/ 7 | Disallow: /home/ 8 | Disallow: /u/ 9 | Disallow: /user/ 10 | Disallow: /img/ 11 | Disallow: /css/ 12 | Disallow: /js/ 13 | Disallow: /WEB-INF/ 14 | Disallow: /uploads/ 15 | Disallow: /me/ 16 | Disallow: /other/ 17 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/template/html/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

8 | 在此处输入标题 9 |

10 |

11 | 在此处输入内容 12 |

13 | 14 | -------------------------------------------------------------------------------- /src/org/iperl/toolbox/TagTool.java: -------------------------------------------------------------------------------- 1 | package org.iperl.toolbox; 2 | 3 | import java.util.List; 4 | 5 | import org.iperl.beans.Tag; 6 | import org.iperl.service.TagService; 7 | 8 | public class TagTool { 9 | 10 | public static List all(){ 11 | List list = TagService.all(); 12 | return list; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/my/img/ImgException.java: -------------------------------------------------------------------------------- 1 | package my.img; 2 | 3 | /** 4 | * 图像处理异常 5 | * @author Winter Lau 6 | * @date 2010-4-26 上午09:22:13 7 | */ 8 | public class ImgException extends RuntimeException { 9 | 10 | public ImgException(String message, Throwable cause) { 11 | super(message, cause); 12 | } 13 | 14 | public ImgException(String message) { 15 | super(message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/my/mvc/ActionException.java: -------------------------------------------------------------------------------- 1 | package my.mvc; 2 | 3 | public class ActionException extends RuntimeException { 4 | 5 | public ActionException(){ 6 | 7 | } 8 | 9 | public ActionException(String msg) { 10 | super(msg); 11 | } 12 | 13 | public ActionException(Throwable t){ 14 | super(t); 15 | } 16 | 17 | public ActionException(String s, Throwable t){ 18 | super(s, t); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/blog/draft.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | iPerl首页 » 后台管理 » 我的草稿箱 3 |
4 | 5 | #set($list = $blog_tool.draft()) 6 | #foreach($o in $list) 7 | $!{o.title} - edit - delete
8 | #end 9 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/inc/ujian.vm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 友荐云推荐 6 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/blog/history.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | iPerl首页 » 后台管理 » 我发表过的博文 3 |
4 | #set($list = $blog_tool.pubed()) 5 | #foreach($o in $list) 6 | $!{o.title} - edit - delete
7 | #end 8 | -------------------------------------------------------------------------------- /src/my/mvc/IUser.java: -------------------------------------------------------------------------------- 1 | package my.mvc; 2 | 3 | public interface IUser { 4 | 5 | public static final byte ROLE_BANNED = -1; 6 | public static final byte ROLE_GENERAL = 0; 7 | public static final byte ROLE_EDITOR = 1; 8 | public static final byte ROLE_ADMIN = 2; 9 | 10 | public boolean IsBlocked(); 11 | 12 | public long getId(); 13 | 14 | public String getPwd(); 15 | 16 | public byte getRole(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | TBlog 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/inc/share.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /src/org/iperl/toolbox/CatalogTool.java: -------------------------------------------------------------------------------- 1 | package org.iperl.toolbox; 2 | 3 | import java.util.List; 4 | 5 | import org.iperl.beans.BlogCatalog; 6 | import org.iperl.service.CatalogService; 7 | 8 | public class CatalogTool { 9 | 10 | public static List all(){ 11 | List list = CatalogService.allCatalogs(); 12 | return list; 13 | } 14 | 15 | public static BlogCatalog detail(int id){ 16 | return BlogCatalog.INSTANCE.Get(id); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/my/cache/CacheException.java: -------------------------------------------------------------------------------- 1 | package my.cache; 2 | 3 | /** 4 | * 缓存异常 5 | * @author Winter Lau 6 | */ 7 | public class CacheException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = -8747630300668561700L; 10 | 11 | public CacheException(String s) { 12 | super(s); 13 | } 14 | 15 | public CacheException(String s, Throwable e) { 16 | super(s, e); 17 | } 18 | 19 | public CacheException(Throwable e) { 20 | super(e); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/template/html/3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

8 | 在此处输入内容 9 |

10 |
    11 |
  1. 12 | 描述1 13 |
  2. 14 |
  3. 15 | 描述2 16 |
  4. 17 |
  5. 18 | 描述3 19 |
  6. 20 |
21 |

22 | 在此处输入内容 23 |

24 |
    25 |
  • 26 | 描述1 27 |
  • 28 |
  • 29 | 描述2 30 |
  • 31 |
  • 32 | 描述3 33 |
  • 34 |
35 | 36 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/inc/header.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/my/db/DBException.java: -------------------------------------------------------------------------------- 1 | package my.db; 2 | 3 | /** 4 | * @author Ulric 5 | */ 6 | public class DBException extends RuntimeException { 7 | 8 | private static final long serialVersionUID = -4607978556048816003L; 9 | 10 | public DBException(){ 11 | super(); 12 | } 13 | 14 | public DBException(String s){ 15 | super(s); 16 | } 17 | 18 | public DBException(Throwable t){ 19 | super(t); 20 | } 21 | 22 | public DBException(String s, Throwable t){ 23 | super(s, t); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /conf/db.properties: -------------------------------------------------------------------------------- 1 | # DataSource 2 | jdbc.datasource=com.mchange.v2.c3p0.ComboPooledDataSource 3 | jdbc.show_sql=true 4 | 5 | # Database Configurations 6 | jdbc.driverClass=com.mysql.jdbc.Driver 7 | jdbc.jdbcUrl=jdbc:mysql://localhost:3306/iperl?autoReconnect=true&useUnicode=true&characterEncoding=utf-8 8 | jdbc.user=root 9 | jdbc.password= 10 | jdbc.maxPoolSize=50 11 | jdbc.minPoolSize=2 12 | jdbc.initialPoolSize=2 13 | jdbc.acquireIncrement=2 14 | jdbc.maxStatements=1000 15 | jdbc.maxIdleTime=300 16 | jdbc.checkoutTimeout=5000 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TBlog 2 | ===== 3 | 4 | Team Blog 团队博客 5 | 6 | 部署说明: 7 | 8 | 1、项目根目录下有个build.xml,用于使用ant来做编译构建 9 | 10 | 2、也可以导入eclipse直接让eclipse帮忙编译,我平时开发都是用的普通版本的eclipse,不是jee版,记得把webapp/WEB-INF/lib和lib目录加入到classpath 11 | 12 | 3、上面两种方法达到的效果就是:所有内容编译完成之后都会放置到webapp/WEB-INF目录下,即此时的webapp目录已经是一个符合jee规范的目录结构了 13 | 14 | 4、在tomcat的server.xml中配置一句话:放在标签内,注意path的配置,目前项目要求是只能部署在 / 下 15 | 16 | 5、data目录下有个iperl.sql的脚本,你懂的 17 | 18 | 6、conf/db.properties是数据库的配置,你懂的 19 | 20 | O了 21 | 22 | 23 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/inc/duoshuo.vm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 14 | -------------------------------------------------------------------------------- /src/org/iperl/util/InputChecker.java: -------------------------------------------------------------------------------- 1 | package org.iperl.util; 2 | 3 | import org.apache.commons.lang.StringUtils; 4 | import org.jsoup.Jsoup; 5 | import org.jsoup.safety.Whitelist; 6 | 7 | public class InputChecker { 8 | 9 | public static boolean identIsOK(String ident) { 10 | if (StringUtils.isBlank(ident)) { 11 | return false; 12 | } 13 | 14 | ident = Jsoup.clean(ident, Whitelist.none()); 15 | if (StringUtils.isBlank(ident)) { 16 | return false; 17 | } 18 | 19 | if (StringUtils.isAlphanumeric(ident)) { 20 | return true; 21 | } else { 22 | return false; 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/template/html/2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

8 | 标题 9 |

10 | 11 | 12 | 13 | 16 | 19 | 20 | 21 | 24 | 27 | 28 | 29 | 32 | 35 | 36 | 37 |
14 |

标题1

15 |
17 |

标题1

18 |
22 | 内容1 23 | 25 | 内容2 26 |
30 | 内容3 31 | 33 | 内容4 34 |
38 |

39 | 表格说明 40 |

41 | 42 | -------------------------------------------------------------------------------- /webapp/js/m.js: -------------------------------------------------------------------------------- 1 | function alertMsg(msg){ 2 | art.dialog({ 3 | title:"提示信息", 4 | okValue:"确定", 5 | content:"" + msg, 6 | ok:function(){return true;} 7 | }); 8 | } 9 | function alertMsgCallback(msg,callback){ 10 | art.dialog({ 11 | title:"提示信息", 12 | okValue:"确定", 13 | content:"" + msg, 14 | ok:callback 15 | }); 16 | } 17 | function delObj(url){ 18 | if(confirm('Really to delete?')){ 19 | jQuery.post(url,function(data){ 20 | if(data.msg.length>0){ 21 | alertMsg(data.msg); 22 | }else{ 23 | alertMsgCallback("Delete Success",function(){ 24 | location.reload(); 25 | }); 26 | } 27 | },'json'); 28 | } 29 | } 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/org/iperl/dto/Pagination.java: -------------------------------------------------------------------------------- 1 | package org.iperl.dto; 2 | 3 | import java.util.List; 4 | 5 | public class Pagination { 6 | 7 | private int cnt; 8 | private List list; 9 | 10 | public Pagination() { 11 | 12 | } 13 | 14 | public Pagination(int cnt, List list) { 15 | this.cnt = cnt; 16 | this.list = list; 17 | } 18 | 19 | public int getCnt() { 20 | return cnt; 21 | } 22 | 23 | public void setCnt(int cnt) { 24 | this.cnt = cnt; 25 | } 26 | 27 | public List getList() { 28 | return list; 29 | } 30 | 31 | public void setList(List list) { 32 | this.list = list; 33 | } 34 | 35 | public static int safePageNo(int pageNo) { 36 | return pageNo <= 0 ? 1 : pageNo; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/my/util/SqlUtil.java: -------------------------------------------------------------------------------- 1 | package my.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | import org.apache.commons.lang.StringUtils; 8 | 9 | public class SqlUtil { 10 | 11 | public static List idsStr2IntList(String ids) { 12 | ids = ids.trim(); 13 | 14 | if (StringUtils.isBlank(ids)) { 15 | return Collections.emptyList(); 16 | } 17 | 18 | String[] idStrArr = StringUtils.split(ids, ','); 19 | 20 | List idList = new ArrayList(idStrArr.length); 21 | for (String idStr : idStrArr) { 22 | if (StringUtils.isBlank(idStr)) { 23 | continue; 24 | } 25 | idList.add(Integer.parseInt(idStr)); 26 | } 27 | 28 | return idList; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/default.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $!{stitle} - iPerl 7 | 8 | 9 | 10 | #include("WEB-INF/layout/inc/header.vm") 11 | 12 | 13 | 14 |
15 | $screen_content 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /src/org/iperl/service/PageService.java: -------------------------------------------------------------------------------- 1 | package org.iperl.service; 2 | 3 | import my.mvc.ActionException; 4 | 5 | import org.apache.commons.lang.StringUtils; 6 | import org.iperl.beans.Page; 7 | import org.iperl.beans.User; 8 | 9 | public class PageService { 10 | 11 | public static void save(String content, User user) { 12 | if (StringUtils.isBlank(content)) { 13 | throw new ActionException("content is blank"); 14 | } 15 | 16 | int pageid = user.getPageid(); 17 | if (pageid == 0) { 18 | throw new ActionException("pageid == 0"); 19 | } 20 | 21 | Page page = Page.INSTANCE.Get(pageid); 22 | if (page == null) { 23 | throw new ActionException("page is null"); 24 | } 25 | 26 | page.updateAttr("content", content); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/org/iperl/action/UtilAction.java: -------------------------------------------------------------------------------- 1 | package org.iperl.action; 2 | 3 | import java.io.IOException; 4 | import java.util.UUID; 5 | 6 | import org.iperl.beans.Invitation; 7 | 8 | import my.img.ImageCaptchaService; 9 | import my.mvc.Annotation; 10 | import my.mvc.IUser; 11 | import my.mvc.RequestContext; 12 | 13 | public class UtilAction extends BaseAction { 14 | 15 | public void captcha(RequestContext ctx) throws IOException { 16 | ImageCaptchaService.get(ctx); 17 | } 18 | 19 | @Annotation.UserRoleRequired(role=IUser.ROLE_ADMIN) 20 | public void invitation(RequestContext ctx) throws IOException { 21 | String uuid = UUID.randomUUID().toString(); 22 | Invitation invitation = new Invitation(uuid, 0); 23 | invitation.Save(); 24 | ctx.print(uuid); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/shell/login.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $!{stitle} - iPerl 7 | 8 | 9 | 10 | #include("WEB-INF/layout/inc/header.vm") 11 | 12 | 13 | 14 |
15 | 16 | $screen_content 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/shell/blank.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $!{stitle} - iPerl 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | $screen_content 16 | #include("WEB-INF/layout/inc/footer.vm") 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/shell/home.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $!{stitle} - iPerl 7 | 8 | 9 | 10 | #include("WEB-INF/layout/inc/header.vm") 11 | 12 | 13 | 14 |
15 | #parse("WEB-INF/layout/inc/banner.vm") 16 | $screen_content 17 | #include("WEB-INF/layout/inc/footer.vm") 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /webapp/css/ke-coder.css: -------------------------------------------------------------------------------- 1 | .ke-content { 2 | font-size: 10pt; 3 | font-family:微软雅黑,Courier New,Arial; 4 | } 5 | .ke-content pre { 6 | font-size:9pt; 7 | font-family:Consolas,Courier New,Arial; 8 | border:1px solid #ddd; 9 | border-left:5px solid #6CE26C; 10 | background:#f6f6f6; 11 | padding:5px; 12 | } 13 | 14 | .ke-content p { 15 | margin: 0 0 15px 0; 16 | } 17 | 18 | .ke-content div.ref {border:1px solid #ddd;margin:0 0 10px 0;padding:2px;font-size:9pt;background:#ffe;} 19 | .ke-content div.ref h4 {margin:0;padding:1px 3px;background:#CC9966;color:#fff;font-size:9pt;font-weight:normal;} 20 | .ke-content div.ref .ref_body {margin:0;padding:2px;line-height:20px;color:#666;font-size:9pt;} 21 | 22 | 23 | .ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;} 24 | -------------------------------------------------------------------------------- /src/my/mvc/Annotation.java: -------------------------------------------------------------------------------- 1 | package my.mvc; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 系统所有注释的容器 7 | * @author Winter Lau 8 | */ 9 | public class Annotation { 10 | /** 11 | * 用户权限注释 12 | * @author liudong 13 | */ 14 | @Target(ElementType.METHOD) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | public @interface UserRoleRequired { 17 | 18 | /** 19 | * 用户的角色 20 | * @return 21 | */ 22 | public byte role() default IUser.ROLE_GENERAL ; 23 | 24 | } 25 | 26 | /** 27 | * 只允许使用POST方式执行的Action方法 28 | * @author liudong 29 | */ 30 | @Target(ElementType.METHOD) 31 | @Retention(RetentionPolicy.RUNTIME) 32 | public static @interface PostMethod { 33 | 34 | } 35 | 36 | /** 37 | * 输出JSON格式的提示信息 38 | * @author liudong 39 | */ 40 | @Target(ElementType.METHOD) 41 | @Retention(RetentionPolicy.RUNTIME) 42 | public @interface JSONOutputEnabled { 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/my/toolbox/LinkTool.java: -------------------------------------------------------------------------------- 1 | package my.toolbox; 2 | 3 | import my.mvc.RequestContext; 4 | 5 | import org.apache.commons.lang.math.NumberUtils; 6 | 7 | public class LinkTool { 8 | 9 | public String param(String name, String...def_value) { 10 | if(RequestContext.get() == null || RequestContext.get().request() == null){ 11 | return (def_value.length>0)?def_value[0]:null; 12 | } 13 | String v = RequestContext.get().request().getParameter(name); 14 | return (v!=null)?v:((def_value.length>0)?def_value[0]:null); 15 | } 16 | 17 | public long param(String name, long def_value) { 18 | return NumberUtils.toLong(param(name), def_value); 19 | } 20 | 21 | public int param(String name, int def_value) { 22 | return NumberUtils.toInt(param(name), def_value); 23 | } 24 | 25 | public byte param(String name, byte def_value) { 26 | return (byte)NumberUtils.toInt(param(name), def_value); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/org/iperl/beans/Tag.java: -------------------------------------------------------------------------------- 1 | package org.iperl.beans; 2 | 3 | import my.db.POJO; 4 | 5 | /** 6 | * @author Ulric Qin 7 | * @date 2013-4-23 8 | */ 9 | public class Tag extends POJO { 10 | 11 | private static final long serialVersionUID = -175186951649912278L; 12 | public static Tag INSTANCE = new Tag(); 13 | 14 | private String name; 15 | private int cnt; 16 | 17 | public Tag() { 18 | 19 | } 20 | 21 | public Tag(String name, int cnt) { 22 | super(); 23 | this.name = name; 24 | this.cnt = cnt; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | 35 | public int getCnt() { 36 | return cnt; 37 | } 38 | 39 | public void setCnt(int cnt) { 40 | this.cnt = cnt; 41 | } 42 | 43 | @Override 44 | protected boolean IsObjectCachedByID() { 45 | return true; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/my/cache/CacheProvider.java: -------------------------------------------------------------------------------- 1 | package my.cache; 2 | 3 | /** 4 | * Support for pluggable caches. 5 | * @author Winter Lau 6 | */ 7 | public interface CacheProvider { 8 | 9 | /** 10 | * Configure the cache 11 | * 12 | * @param regionName the name of the cache region 13 | * @param autoCreate autoCreate settings 14 | * @throws CacheException 15 | */ 16 | public Cache buildCache(String regionName, boolean autoCreate) throws CacheException; 17 | 18 | /** 19 | * Callback to perform any necessary initialization of the underlying cache implementation 20 | * during SessionFactory construction. 21 | * 22 | * @param properties current configuration settings. 23 | */ 24 | public void start() throws CacheException; 25 | 26 | /** 27 | * Callback to perform any necessary cleanup of the underlying cache implementation 28 | * during SessionFactory.close(). 29 | */ 30 | public void stop(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/inc/footer.vm: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | iPerl.org is open source on GitHub.
5 | Patches, suggestions, and comments are welcome. 6 |
7 |
8 | Powered by Ulric Qin 9 |
10 |
11 | 12 | 13 | 14 | 15 | 18 | 19 |
20 | 21 |
-------------------------------------------------------------------------------- /webapp/js/ke4/plugins/autoheight/autoheight.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('autoheight', function(K) { 11 | var self = this; 12 | 13 | if (!self.autoHeightMode) { 14 | return; 15 | } 16 | 17 | var edit = self.edit; 18 | var body = edit.doc.body; 19 | var minHeight = K.removeUnit(self.height); 20 | 21 | edit.iframe[0].scroll = 'no'; 22 | body.style.overflowY = 'hidden'; 23 | 24 | edit.afterChange(function() { 25 | self.resize(null, Math.max((K.IE ? body.scrollHeight : body.offsetHeight) + 62, minHeight)); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /src/my/view/ResourceTool.java: -------------------------------------------------------------------------------- 1 | package my.view; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.apache.velocity.VelocityContext; 6 | import org.apache.velocity.tools.view.context.ViewContext; 7 | 8 | 9 | /** 10 | * 用于国际化资源的Velocity工具类 11 | * @author Winter Lau 12 | */ 13 | public class ResourceTool { 14 | 15 | private HttpServletRequest request; 16 | private VelocityContext velocity; 17 | 18 | /* 19 | * Initialize toolbox 20 | * @see org.apache.velocity.tools.view.tools.ViewTool#init(java.lang.Object) 21 | */ 22 | public void init(Object arg0) { 23 | //scope: request or session 24 | if(arg0 instanceof ViewContext){ 25 | ViewContext viewContext = (ViewContext) arg0; 26 | request = viewContext.getRequest(); 27 | velocity = (VelocityContext)viewContext.getVelocityContext(); 28 | } 29 | } 30 | 31 | public String this_vm(){ 32 | return velocity.getCurrentTemplateName(); 33 | } 34 | } -------------------------------------------------------------------------------- /src/org/iperl/action/BaseAction.java: -------------------------------------------------------------------------------- 1 | package org.iperl.action; 2 | 3 | import my.mvc.ActionException; 4 | import my.mvc.RequestContext; 5 | 6 | import org.apache.commons.lang.StringUtils; 7 | import org.iperl.beans.User; 8 | 9 | public class BaseAction { 10 | 11 | protected User safeUser(RequestContext ctx) { 12 | int userid = ctx.param("userid", 0); 13 | if (userid == 0) { 14 | throw new ActionException("Parameter userid is necessary"); 15 | } 16 | User user = User.INSTANCE.Get(userid); 17 | if (user == null) { 18 | throw new ActionException("The user[id:" + userid 19 | + "] is not exists"); 20 | } 21 | return user; 22 | } 23 | 24 | protected void checkBlank(String[] keys, String[] vals) { 25 | int len = keys.length; 26 | for (int i = 0; i < len; i++) { 27 | if (StringUtils.isBlank(vals[i])) { 28 | throw new ActionException(keys[i] + " can not be blank."); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/org/iperl/beans/BlogTag.java: -------------------------------------------------------------------------------- 1 | package org.iperl.beans; 2 | 3 | import my.db.POJO; 4 | 5 | /** 6 | * @author Ulric Qin 7 | * @date 2013-4-23 8 | */ 9 | public class BlogTag extends POJO { 10 | 11 | private static final long serialVersionUID = -2487455203891033742L; 12 | public static BlogTag INSTANCE = new BlogTag(); 13 | 14 | private int blog; 15 | private int tag; 16 | 17 | public BlogTag() { 18 | 19 | } 20 | 21 | public BlogTag(int blog, int tag) { 22 | super(); 23 | this.blog = blog; 24 | this.tag = tag; 25 | } 26 | 27 | public int getBlog() { 28 | return blog; 29 | } 30 | 31 | public void setBlog(int blog) { 32 | this.blog = blog; 33 | } 34 | 35 | public int getTag() { 36 | return tag; 37 | } 38 | 39 | public void setTag(int tag) { 40 | this.tag = tag; 41 | } 42 | 43 | @Override 44 | protected boolean IsObjectCachedByID() { 45 | return true; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/org/iperl/beans/Invitation.java: -------------------------------------------------------------------------------- 1 | package org.iperl.beans; 2 | 3 | import my.db.POJO; 4 | 5 | /** 6 | * @author Ulric Qin 7 | * @date 2013-4-28 8 | */ 9 | public class Invitation extends POJO { 10 | 11 | private static final long serialVersionUID = 2877086653334198632L; 12 | 13 | public static Invitation INSTANCE = new Invitation(); 14 | 15 | private String invitation; 16 | private int used; 17 | 18 | public Invitation() { 19 | 20 | } 21 | 22 | public Invitation(String invitation, int used) { 23 | super(); 24 | this.invitation = invitation; 25 | this.used = used; 26 | } 27 | 28 | public String getInvitation() { 29 | return invitation; 30 | } 31 | 32 | public void setInvitation(String invitation) { 33 | this.invitation = invitation; 34 | } 35 | 36 | public int getUsed() { 37 | return used; 38 | } 39 | 40 | public void setUsed(int used) { 41 | this.used = used; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/org/iperl/action/FileAction.java: -------------------------------------------------------------------------------- 1 | package org.iperl.action; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | 6 | import org.iperl.service.StorageService; 7 | 8 | import my.mvc.Annotation; 9 | import my.mvc.RequestContext; 10 | 11 | public class FileAction { 12 | 13 | private static final long MAX_IMG_SIZE = 1 * 1024 * 1024; 14 | 15 | @Annotation.JSONOutputEnabled 16 | public void up(RequestContext ctx) throws IOException { 17 | File imgFile = ctx.image("imgFile"); 18 | if (imgFile.length() > MAX_IMG_SIZE) { 19 | ctx.output_json(new String[] { "error", "message" }, new Object[] { 20 | 1, "File is too large" }); 21 | return; 22 | } 23 | 24 | StorageService ss = StorageService.KEFILES; 25 | String path = ss.save(imgFile); 26 | ctx.output_json(new String[] { "error", "url" }, new Object[] {0, ss.getReadPath() + path}); 27 | } 28 | 29 | @Annotation.JSONOutputEnabled 30 | public void list(RequestContext ctx) throws IOException { 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/org/iperl/service/StorageService.java: -------------------------------------------------------------------------------- 1 | package org.iperl.service; 2 | 3 | import my.mvc.RequestContext; 4 | import my.util.Storage; 5 | 6 | /** 7 | * 文件存储服务 使用方法: File img = ...; String path = StorageService.FILES.save(img); 8 | * StorageService.FILES.delete(path); 9 | * 10 | * @author Winter Lau 11 | * @date 2010-9-2 上午11:35:56 12 | */ 13 | public class StorageService extends Storage { 14 | 15 | public final static StorageService KEFILES = new StorageService("kefiles"); 16 | public final static StorageService USERPICS = new StorageService("userpics"); 17 | 18 | private String file_path; 19 | private String read_path; 20 | 21 | private StorageService(String ext) { 22 | this.file_path = RequestContext.root() + "uploads" 23 | + java.io.File.separator + ext + java.io.File.separator; 24 | this.read_path = "/uploads/" + ext + "/"; 25 | } 26 | 27 | @Override 28 | public String getBasePath() { 29 | return file_path; 30 | } 31 | 32 | public String getReadPath() { 33 | return read_path; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/code/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} 2 | 3 | pre.prettyprint { 4 | border: 0; 5 | border-left: 3px solid rgb(204, 204, 204); 6 | margin-left: 2em; 7 | padding: 0.5em; 8 | font-size: 110%; 9 | display: block; 10 | font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; 11 | margin: 1em 0px; 12 | white-space: pre; 13 | } 14 | -------------------------------------------------------------------------------- /src/my/util/MyListUtils.java: -------------------------------------------------------------------------------- 1 | package my.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.apache.commons.collections.ListUtils; 7 | 8 | /** 9 | * 列表工具包扩展 10 | * @author Winter Lau 11 | * @date 2010-3-1 下午09:18:33 12 | */ 13 | public class MyListUtils extends ListUtils { 14 | 15 | /** 16 | * 列表过滤 17 | * @param 18 | * @param objs 19 | * @param filter 20 | * @return 21 | */ 22 | public static List filter(List objs, ObjectFilter filter) { 23 | List new_objs = new ArrayList(); 24 | for(T obj : objs){ 25 | if(filter.filter(obj)) 26 | new_objs.add(obj); 27 | } 28 | return new_objs; 29 | } 30 | 31 | /** 32 | * 对象过滤 33 | */ 34 | public static interface ObjectFilter { 35 | public boolean filter(T obj) ; 36 | } 37 | 38 | public static List filterNotNull(List objs) { 39 | return filter(objs, new ObjectFilter() { 40 | 41 | @Override 42 | public boolean filter(T obj) { 43 | return obj != null; 44 | } 45 | }); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/my/util/UniqueStringList.java: -------------------------------------------------------------------------------- 1 | package my.util; 2 | 3 | import java.util.LinkedList; 4 | import java.util.ListIterator; 5 | 6 | /** 7 | * 唯一字符串List 8 | * 在这个列表中,会保证里面的每个字符串都是唯一的,可决定是否进行大小写匹配。 9 | 目前只支持用add方法添加的对象,其他方法尚未实现。 10 | * @date 2010-10-21 上午11:41:38 11 | */ 12 | public class UniqueStringList extends LinkedList { 13 | 14 | private boolean ignoreCase; 15 | 16 | public UniqueStringList(boolean ignoreCase) { 17 | this.ignoreCase = ignoreCase; 18 | } 19 | 20 | @Override 21 | public boolean add(String e) { 22 | ListIterator iterator = listIterator(); 23 | while (iterator.hasNext()) { 24 | String next = iterator.next(); 25 | if(ignoreCase?e.equalsIgnoreCase(next):e.equals(next)) 26 | return false; 27 | } 28 | return super.add(e); 29 | } 30 | 31 | public static void main(String[] args) { 32 | UniqueStringList usl = new UniqueStringList(true); 33 | usl.add("oschina"); 34 | usl.add("OSCHINA"); 35 | usl.add("OSChina"); 36 | for(String s : usl) 37 | System.out.println(s); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /conf/log4j.properties: -------------------------------------------------------------------------------- 1 | ### set log levels ### 2 | log4j.rootLogger =info, stdout, D, E 3 | 4 | 5 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target = System.out 7 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 8 | log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c:%L - %m%n 9 | 10 | log4j.appender.D = org.apache.log4j.DailyRollingFileAppender 11 | log4j.appender.D.File = ~/logs/iperl-java-log.log 12 | log4j.appender.D.Append = true 13 | 14 | log4j.appender.D.Threshold = DEBUG 15 | log4j.appender.D.layout = org.apache.log4j.PatternLayout 16 | log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [%t:%r] - %c:%L - [%p] %m%n 17 | 18 | log4j.appender.E = org.apache.log4j.DailyRollingFileAppender 19 | 20 | log4j.appender.E.File = ~/logs/iperl-java-error.log 21 | log4j.appender.E.Append = true 22 | 23 | log4j.appender.E.Threshold = ERROR 24 | log4j.appender.E.layout = org.apache.log4j.PatternLayout 25 | log4j.appender.E.layout.ConversionPattern =%-d{yyyy-MM-dd HH\:mm\:ss} [%t\:%r] - %c\:%L - [%p] %m%n 26 | -------------------------------------------------------------------------------- /src/org/iperl/beans/Page.java: -------------------------------------------------------------------------------- 1 | package org.iperl.beans; 2 | 3 | import my.db.POJO; 4 | 5 | /** 6 | * @author Ulric Qin 7 | * @date 2013-4-28 8 | */ 9 | public class Page extends POJO { 10 | 11 | private static final long serialVersionUID = -6937830725872019323L; 12 | 13 | public static Page INSTANCE = new Page(); 14 | 15 | private int user; 16 | private String content; 17 | 18 | public Page() { 19 | 20 | } 21 | 22 | public Page(int user, String content) { 23 | this.user = user; 24 | this.content = content; 25 | } 26 | 27 | public int getUser() { 28 | return user; 29 | } 30 | 31 | public void setUser(int user) { 32 | this.user = user; 33 | } 34 | 35 | public String getContent() { 36 | return content; 37 | } 38 | 39 | public void setContent(String content) { 40 | this.content = content; 41 | } 42 | 43 | @Override 44 | protected boolean IsObjectCachedByID() { 45 | return true; 46 | } 47 | 48 | @Override 49 | protected long GetAutoLoadUser() { 50 | return getUser(); 51 | } 52 | 53 | @Override 54 | protected boolean IsAutoLoadUser() { 55 | return true; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/pagebreak/pagebreak.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('pagebreak', function(K) { 11 | var self = this; 12 | var name = 'pagebreak'; 13 | var pagebreakHtml = K.undef(self.pagebreakHtml, '
'); 14 | 15 | self.clickToolbar(name, function() { 16 | var cmd = self.cmd, range = cmd.range; 17 | self.focus(); 18 | range.enlarge(true); 19 | cmd.split(true); 20 | var tail = self.newlineTag == 'br' || K.WEBKIT ? '' : '

'; 21 | self.insertHtml(pagebreakHtml + tail); 22 | if (tail !== '') { 23 | var p = K('#__kindeditor_tail_tag__', self.edit.doc); 24 | range.selectNodeContents(p[0]); 25 | p.removeAttr('id'); 26 | cmd.select(); 27 | } 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/preview/preview.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('preview', function(K) { 11 | var self = this, name = 'preview', undefined; 12 | self.clickToolbar(name, function() { 13 | var lang = self.lang(name + '.'), 14 | html = '
' + 15 | '' + 16 | '
', 17 | dialog = self.createDialog({ 18 | name : name, 19 | width : 750, 20 | title : self.lang(name), 21 | body : html 22 | }), 23 | iframe = K('iframe', dialog.div), 24 | doc = K.iframeDoc(iframe); 25 | doc.open(); 26 | doc.write(self.fullHtml()); 27 | doc.close(); 28 | K(doc.body).css('background-color', '#FFF'); 29 | iframe[0].contentWindow.focus(); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/inc/banner.vm: -------------------------------------------------------------------------------- 1 | #set($user = $core.user()) 2 | #set($show_name = ${user.ident}) 3 | #if(${user.nickname}) 4 | #set($show_name = ${user.nickname}) 5 | #end 6 | 34 |
-------------------------------------------------------------------------------- /webapp/WEB-INF/www/about/index.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/home.vm") 2 | #set($ident = $link.param('p1','')) 3 | #set($page = $user_tool.pageByIdent($ident)) 4 | #set($user = $user_tool.detail(${page.user})) 5 | #set($stitle="${user.showName()}的个人简介") 6 | 12 |
13 |
14 | 15 |
16 |
17 | ${user.showName()}($!{user.resume}) 18 |
19 |
20 |
21 | ${page.content} 22 |
23 |
24 |
25 |
26 | #include("WEB-INF/layout/inc/duoshuo.vm") 27 |
28 |
29 | 30 |
31 |
32 | 33 | 38 | 39 |
40 |
41 | 42 | -------------------------------------------------------------------------------- /src/my/cache/Cache.java: -------------------------------------------------------------------------------- 1 | package my.cache; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 缓存接口 7 | * @author Winter Lau 8 | */ 9 | public interface Cache { 10 | 11 | /** 12 | * Get an item from the cache, nontransactionally 13 | * @param key 14 | * @return the cached object or null 15 | * @throws CacheException 16 | */ 17 | public Object get(Object key) throws CacheException; 18 | 19 | /** 20 | * Add an item to the cache, nontransactionally, with 21 | * failfast semantics 22 | * @param key 23 | * @param value 24 | * @throws CacheException 25 | */ 26 | public void put(Object key, Object value) throws CacheException; 27 | 28 | /** 29 | * Add an item to the cache 30 | * @param key 31 | * @param value 32 | * @throws CacheException 33 | */ 34 | public void update(Object key, Object value) throws CacheException; 35 | 36 | @SuppressWarnings("rawtypes") 37 | public List keys() throws CacheException ; 38 | 39 | /** 40 | * Remove an item from the cache 41 | */ 42 | public void remove(Object key) throws CacheException; 43 | 44 | /** 45 | * Clear the cache 46 | */ 47 | public void clear() throws CacheException; 48 | 49 | /** 50 | * Clean up 51 | */ 52 | public void destroy() throws CacheException; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/clearhtml/clearhtml.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('clearhtml', function(K) { 11 | var self = this, name = 'clearhtml'; 12 | self.clickToolbar(name, function() { 13 | self.focus(); 14 | var html = self.html(); 15 | html = html.replace(/(]*>)([\s\S]*?)(<\/script>)/ig, ''); 16 | html = html.replace(/(]*>)([\s\S]*?)(<\/style>)/ig, ''); 17 | html = K.formatHtml(html, { 18 | a : ['href', 'target'], 19 | embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'], 20 | img : ['src', 'width', 'height', 'border', 'alt', 'title', '.width', '.height'], 21 | table : ['border'], 22 | 'td,th' : ['rowspan', 'colspan'], 23 | 'div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [] 24 | }); 25 | self.html(html); 26 | self.cmd.selection(true); 27 | self.addBookmark(); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/lineheight/lineheight.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('lineheight', function(K) { 11 | var self = this, name = 'lineheight', lang = self.lang(name + '.'); 12 | self.clickToolbar(name, function() { 13 | var curVal = '', commonNode = self.cmd.commonNode({'*' : '.line-height'}); 14 | if (commonNode) { 15 | curVal = commonNode.css('line-height'); 16 | } 17 | var menu = self.createMenu({ 18 | name : name, 19 | width : 150 20 | }); 21 | K.each(lang.lineHeight, function(i, row) { 22 | K.each(row, function(key, val) { 23 | menu.addItem({ 24 | title : val, 25 | checked : curVal === key, 26 | click : function() { 27 | self.cmd.toggle('', { 28 | span : '.line-height=' + key 29 | }); 30 | self.updateState(); 31 | self.addBookmark(); 32 | self.hideMenu(); 33 | } 34 | }); 35 | }); 36 | }); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /src/org/iperl/beans/BlogCatalog.java: -------------------------------------------------------------------------------- 1 | package org.iperl.beans; 2 | 3 | import java.util.List; 4 | 5 | import my.db.POJO; 6 | 7 | /** 8 | * @author Ulric Qin 9 | * @date 2013-4-23 10 | */ 11 | public class BlogCatalog extends POJO { 12 | 13 | private static final long serialVersionUID = 7843062550538033030L; 14 | public static BlogCatalog INSTANCE = new BlogCatalog(); 15 | 16 | private String name; 17 | private String ident; 18 | private int dorder; 19 | 20 | public BlogCatalog() { 21 | 22 | } 23 | 24 | public BlogCatalog(String name, String ident, int dorder) { 25 | super(); 26 | this.name = name; 27 | this.ident = ident; 28 | this.dorder = dorder; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | public void setName(String name) { 36 | this.name = name; 37 | } 38 | 39 | public String getIdent() { 40 | return ident; 41 | } 42 | 43 | public void setIdent(String ident) { 44 | this.ident = ident; 45 | } 46 | 47 | public int getDorder() { 48 | return dorder; 49 | } 50 | 51 | public void setDorder(int dorder) { 52 | this.dorder = dorder; 53 | } 54 | 55 | @Override 56 | protected boolean IsObjectCachedByID() { 57 | return true; 58 | } 59 | 60 | public int blogCnt() { 61 | return Blog.INSTANCE.TotalCount("catalog = ?", getId()); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/org/iperl/service/CatalogService.java: -------------------------------------------------------------------------------- 1 | package org.iperl.service; 2 | 3 | import java.util.List; 4 | 5 | import my.cache.CacheManager; 6 | import my.mvc.ActionException; 7 | 8 | import org.iperl.beans.BlogCatalog; 9 | 10 | public class CatalogService { 11 | 12 | private static final String idsKey = "order by dorder desc"; 13 | 14 | public static void addCatalog(String ident, String name, int dorder) { 15 | BlogCatalog bc = new BlogCatalog(name, ident, dorder); 16 | if (bc.Save() > 0) { 17 | CacheManager.evict(BlogCatalog.INSTANCE.CacheRegion(), idsKey); 18 | } 19 | } 20 | 21 | public static List allCatalogs() { 22 | List ids = BlogCatalog.INSTANCE.IDs(idsKey); 23 | return BlogCatalog.INSTANCE.LoadList(ids); 24 | } 25 | 26 | public static void delCatalog(BlogCatalog bc) { 27 | int cnt = bc.blogCnt(); 28 | if (cnt > 0) { 29 | throw new ActionException("There are some blogs under " 30 | + bc.getName() + ". So it can not be deleted"); 31 | } 32 | if (bc.Delete()) { 33 | CacheManager.evict(BlogCatalog.INSTANCE.CacheRegion(), idsKey); 34 | } 35 | } 36 | 37 | public static boolean updateCatalog(String ident, String name, int dorder, 38 | BlogCatalog bc) { 39 | return bc.updateAttrs(new String[] { "ident", "name", "dorder" }, 40 | new Object[] { ident, name, dorder }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/baidumap/map.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Baidu Maps 6 | 10 | 11 | 39 | 40 | 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/home/login.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/login.vm") 2 |

登陆


3 |
4 |
5 | 登录ID: 6 | 7 |
8 |
9 | 登录密码: 10 | 11 |
12 | 13 |
14 |   15 | 16 | 没有账号?去 注册 17 |
18 |
19 | 20 | 21 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/profile.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | #set($user=$core.user()) 3 | iPerl首页 » 后台管理 » 个人信息修改 4 |
5 | 6 |
7 |
8 | 登录ID: 9 | 10 | 这将是您以后登录用的唯一凭证,只允许字母和数字 11 |
12 |
13 | 用户昵称: 14 | 15 |
16 |
17 | 个性签名: 18 | 19 |
20 | 21 |
22 |   23 | 24 |
25 |
26 | 27 | 51 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/index.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/home.vm") 2 | #set($stitle="互联网自动化运维") 3 | #set($pageno = $link.param('p',1)) 4 | #set($page_size = 10) 5 | #set($curr_uri = '') 6 | #set($ret = $blog_tool.topNew($pageno, $page_size)) 7 | 13 |
14 |
15 | 16 | #foreach($o in ${ret.list}) 17 |
18 |
19 | $!{o.title} 20 |
21 |
22 | $core.sub_str($!{o.content}, 500) 23 |
24 |
25 |
26 | #tager($o) 27 |
28 |
29 | 阅读全文... 30 |
31 |
32 |
33 |
34 | #authorBar($o) 35 |
36 | #end 37 | 38 | #pager($curr_uri ${ret.cnt} $page_size) 39 |
40 |
41 | 42 | 51 | 52 |
53 |
-------------------------------------------------------------------------------- /src/my/img/ImgHandler.java: -------------------------------------------------------------------------------- 1 | package my.img; 2 | 3 | import java.io.File; 4 | 5 | /** 6 | * 图像处理接口 7 | * @author Winter Lau 8 | * @date 2010-4-26 上午09:15:10 9 | */ 10 | public interface ImgHandler { 11 | 12 | /** 13 | * 图像自动根据比例缩小到指定的方框中 14 | * @param src 15 | * @param dest 16 | * @param size 17 | * @return 18 | * @throws ImgException 19 | */ 20 | public int[] shrink(File src, File dest, int size) throws ImgException ; 21 | 22 | /** 23 | * 图像缩放 24 | * @param src 源文件 25 | * @param dest 目标文件 26 | * @param w 缩放宽度 27 | * @param h 缩放高度 28 | * @exception 29 | */ 30 | public void scale(File src, File dest, int w, int h) throws ImgException ; 31 | 32 | /** 33 | * 将图像缩放到某个正方形框内 34 | * @param src 源文件 35 | * @param dest 目标文件 36 | * @param size 正方形大小 37 | * @exception 38 | */ 39 | public void scale(File src, File dest, int size) throws ImgException ; 40 | 41 | /** 42 | * 进行图像剪裁 43 | * @param src 源文件 44 | * @param dest 目标文件 45 | * @param left 剪裁部分的左上角x轴 46 | * @param top 剪裁部分的左上角y轴 47 | * @param width 剪裁部分的宽度 48 | * @param height 剪裁部分的高度 49 | * @param w 目标大小宽度 50 | * @param h 目标大小高度 51 | * @throws ImgException 52 | */ 53 | public void crop(File src, File dest, int left, int top, int width, int height, int w, int h) throws ImgException ; 54 | 55 | /** 56 | * 图像旋转 57 | * @param src 源文件 58 | * @param dest 目标文件 59 | * @param degrees 旋转度数 60 | * @throws ImgException 61 | */ 62 | public void rotate(File src, File dest, double degrees) throws ImgException ; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/blog/tag/index.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/home.vm") 2 | #set($tag = $link.param('p1','')) 3 | #set($stitle="$tag") 4 | #set($pageno = $link.param('p',1)) 5 | #set($page_size = 10) 6 | #set($curr_uri = '') 7 | #set($ret = $blog_tool.byTag($tag, $pageno, $page_size)) 8 | 14 |
15 |
16 | 17 | 18 | #foreach($o in ${ret.list}) 19 |
20 |
21 | $!{o.title} 22 |
23 |
24 | $core.sub_str($!{o.content}, 500) 25 |
26 |
27 |
28 | #tager($o) 29 |
30 |
31 | 阅读全文... 32 |
33 |
34 |
35 |
36 | #authorBar($o) 37 |
38 | #end 39 | 40 | #pager($curr_uri ${ret.cnt} $page_size) 41 |
42 |
43 | 44 | 51 | 52 |
53 |
-------------------------------------------------------------------------------- /webapp/js/ke4/plugins/plainpaste/plainpaste.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('plainpaste', function(K) { 11 | var self = this, name = 'plainpaste'; 12 | self.clickToolbar(name, function() { 13 | var lang = self.lang(name + '.'), 14 | html = '
' + 15 | '
' + lang.comment + '
' + 16 | '' + 17 | '
', 18 | dialog = self.createDialog({ 19 | name : name, 20 | width : 450, 21 | title : self.lang(name), 22 | body : html, 23 | yesBtn : { 24 | name : self.lang('yes'), 25 | click : function(e) { 26 | var html = textarea.val(); 27 | html = K.escape(html); 28 | html = html.replace(/ {2}/g, '  '); 29 | if (self.newlineTag == 'p') { 30 | html = html.replace(/^/, '

').replace(/$/, '

').replace(/\n/g, '

'); 31 | } else { 32 | html = html.replace(/\n/g, '
$&'); 33 | } 34 | self.insertHtml(html).hideDialog().focus(); 35 | } 36 | } 37 | }), 38 | textarea = K('textarea', dialog.div); 39 | textarea[0].focus(); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/blog/user/index.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/home.vm") 2 | #set($user_id = $link.param('p1',0)) 3 | #set($user=$user_tool.detail($user_id)) 4 | #set($stitle="${user.showName()}发表的博文") 5 | #set($pageno = $link.param('p',1)) 6 | #set($page_size = 3) 7 | #set($curr_uri = '') 8 | #set($ret = $blog_tool.byUser($user_id, $pageno, $page_size)) 9 | 15 |

16 |
17 | 18 | 19 | #foreach($o in ${ret.list}) 20 |
21 |
22 | $!{o.title} 23 |
24 |
25 | $core.sub_str($!{o.content}, 500) 26 |
27 |
28 |
29 | #tager($o) 30 |
31 |
32 | 阅读全文... 33 |
34 |
35 |
36 |
37 | #authorBar($o) 38 |
39 | #end 40 | 41 | #pager($curr_uri ${ret.cnt} $page_size) 42 |
43 |
44 | 45 | 50 | 51 |
52 |
-------------------------------------------------------------------------------- /src/my/img/MyScaleFilter.java: -------------------------------------------------------------------------------- 1 | package my.img; 2 | 3 | import java.awt.Graphics2D; 4 | import java.awt.Image; 5 | import java.awt.image.BufferedImage; 6 | import java.awt.image.ColorModel; 7 | 8 | import com.jhlabs.image.AbstractBufferedImageOp; 9 | 10 | /** 11 | * Scales an image using the area-averaging algorithm, which can't be done with AffineTransformOp. 12 | * @author Winter Lau 13 | * @date 2010-4-26 上午11:56:06 14 | */ 15 | public class MyScaleFilter extends AbstractBufferedImageOp { 16 | 17 | private int width; 18 | private int height; 19 | 20 | /** 21 | * Construct a ScaleFilter. 22 | */ 23 | public MyScaleFilter() { 24 | this(32, 32); 25 | } 26 | 27 | /** 28 | * Construct a ScaleFilter. 29 | * @param width the width to scale to 30 | * @param height the height to scale to 31 | */ 32 | public MyScaleFilter( int width, int height ) { 33 | this.width = width; 34 | this.height = height; 35 | } 36 | 37 | public BufferedImage filter( BufferedImage src, BufferedImage dst ) { 38 | if ( dst == null ) { 39 | ColorModel dstCM = src.getColorModel(); 40 | dst = new BufferedImage(dstCM, 41 | dstCM.createCompatibleWritableRaster( width, height ), 42 | dstCM.isAlphaPremultiplied(), null); 43 | } 44 | 45 | Image scaleImage = src.getScaledInstance( width, height, Image.SCALE_SMOOTH ); 46 | Graphics2D g = dst.createGraphics(); 47 | g.drawImage( scaleImage, 0, 0, width, height, null ); 48 | g.dispose(); 49 | 50 | return dst; 51 | } 52 | 53 | public String toString() { 54 | return "Distort/Scale"; 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /src/org/iperl/toolbox/UserTool.java: -------------------------------------------------------------------------------- 1 | package org.iperl.toolbox; 2 | 3 | import java.util.List; 4 | 5 | import my.toolbox.CoreTool; 6 | 7 | import org.apache.commons.lang.StringUtils; 8 | import org.iperl.beans.Page; 9 | import org.iperl.beans.User; 10 | import org.iperl.service.UserService; 11 | 12 | public class UserTool { 13 | 14 | public static Page page() { 15 | User user = CoreTool.user(); 16 | if (user == null) { 17 | return null; 18 | } 19 | int pageid = user.getPageid(); 20 | if (pageid == 0) { 21 | // 第一次访问,需要创建 22 | Long userId = user.getId(); 23 | Page page = new Page(userId.intValue(), ""); 24 | page.Save(); 25 | return page; 26 | } 27 | return Page.INSTANCE.Get(pageid); 28 | } 29 | 30 | public static Page pageByIdent(String ident) { 31 | if (StringUtils.isBlank(ident)) { 32 | return null; 33 | } 34 | 35 | User user = byIdent(ident); 36 | if (user == null) { 37 | return null; 38 | } 39 | 40 | int pageid = user.getPageid(); 41 | if (pageid == 0) { 42 | Long userId = user.getId(); 43 | Page page = new Page(userId.intValue(), ""); 44 | page.Save(); 45 | return page; 46 | } 47 | return Page.INSTANCE.Get(pageid); 48 | } 49 | 50 | public static User byIdent(String ident) { 51 | if (StringUtils.isBlank(ident)) { 52 | return null; 53 | } 54 | 55 | User user = UserService.byIdent(ident); 56 | return user; 57 | } 58 | 59 | public static User detail(int id) { 60 | return User.INSTANCE.Get(id); 61 | } 62 | 63 | public static List topAuthor(int count){ 64 | return UserService.topAuthor(count); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/page.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | #set($stitle="个人主页定制") 3 | #set($page = $user_tool.page()) 4 | iPerl首页 » 后台管理 » 个人主页定制 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/blog/catalog/index.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/home.vm") 2 | #set($catalog_id = $link.param('p1',0)) 3 | #set($catalog=$catalog_tool.detail($catalog_id)) 4 | #set($stitle="${catalog.name}") 5 | #set($pageno = $link.param('p',1)) 6 | #set($page_size = 10) 7 | #set($curr_uri = '') 8 | #set($ret = $blog_tool.byCatalog($catalog_id, $pageno, $page_size)) 9 | 15 |
16 |
17 | 18 | 19 | #foreach($o in ${ret.list}) 20 |
21 |
22 | $!{o.title} 23 |
24 |
25 | $core.sub_str($!{o.content}, 500) 26 |
27 |
28 |
29 | #tager($o) 30 |
31 |
32 | 阅读全文... 33 |
34 |
35 |
36 |
37 | #authorBar($o) 38 |
39 | #end 40 | 41 | #pager($curr_uri ${ret.cnt} $page_size) 42 |
43 |
44 | 45 | 52 | 53 |
54 |
-------------------------------------------------------------------------------- /webapp/WEB-INF/conf/velocity-toolbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | date 5 | application 6 | org.apache.velocity.tools.generic.ComparisonDateTool 7 | 8 | 9 | 10 | escape 11 | application 12 | org.apache.velocity.tools.generic.EscapeTool 13 | 14 | 15 | core 16 | application 17 | my.toolbox.CoreTool 18 | 19 | 20 | link 21 | application 22 | my.toolbox.LinkTool 23 | 24 | 25 | date_tool 26 | application 27 | my.util.DateUtil 28 | 29 | 30 | catalog_tool 31 | application 32 | org.iperl.toolbox.CatalogTool 33 | 34 | 35 | blog_tool 36 | application 37 | org.iperl.toolbox.BlogTool 38 | 39 | 40 | user_tool 41 | application 42 | org.iperl.toolbox.UserTool 43 | 44 | 45 | tag_tool 46 | application 47 | org.iperl.toolbox.TagTool 48 | 49 | 50 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/anchor/anchor.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('anchor', function(K) { 11 | var self = this, name = 'anchor', lang = self.lang(name + '.'); 12 | self.plugin.anchor = { 13 | edit : function() { 14 | var html = ['
', 15 | '
', 16 | '', 17 | '', 18 | '
', 19 | '
'].join(''); 20 | var dialog = self.createDialog({ 21 | name : name, 22 | width : 300, 23 | title : self.lang(name), 24 | body : html, 25 | yesBtn : { 26 | name : self.lang('yes'), 27 | click : function(e) { 28 | self.insertHtml('').hideDialog().focus(); 29 | } 30 | } 31 | }); 32 | var div = dialog.div, 33 | nameBox = K('input[name="name"]', div); 34 | var img = self.plugin.getSelectedAnchor(); 35 | if (img) { 36 | nameBox.val(unescape(img.attr('data-ke-name'))); 37 | } 38 | nameBox[0].focus(); 39 | nameBox[0].select(); 40 | }, 41 | 'delete' : function() { 42 | self.plugin.getSelectedAnchor().remove(); 43 | } 44 | }; 45 | self.clickToolbar(name, self.plugin.anchor.edit); 46 | }); 47 | -------------------------------------------------------------------------------- /conf/ehcache.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | 21 | 22 | 24 | 25 | 27 | 28 | 30 | 31 | 33 | 34 | 36 | 37 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/home/reg.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/login.vm") 2 |

填写以下信息即可轻松注册哦


3 |
4 |
5 | 登录ID: 6 | 7 | 这将是您以后登录用的唯一凭证,只允许字母和数字 8 |
9 |
10 | 用户昵称: 11 | 12 |
13 |
14 | 您的签名: 15 | 16 |
17 |
18 | 登录密码: 19 | 20 |
21 |
22 | 邀请码: 23 | 24 |
25 | 26 |
31 |
32 | 33 | 34 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /webapp/css/prettify.css: -------------------------------------------------------------------------------- 1 | code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} 2 | code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;} 3 | pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12.025px;line-height:18px;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;white-space:pre;white-space:pre-wrap;word-break:break-all;word-wrap:break-word;}pre.prettyprint{margin-bottom:18px;} 4 | pre code{padding:0;color:inherit;background-color:transparent;border:0;} 5 | 6 | .com { color: #93a1a1; } 7 | .lit { color: #195f91; } 8 | .pun, .opn, .clo { color: #93a1a1; } 9 | .fun { color: #dc322f; } 10 | .str, .atv { color: #D14; } 11 | .kwd, .linenums .tag { color: #1e347b; } 12 | .typ, .atn, .dec, .var { color: teal; } 13 | .pln { color: #48484c; } 14 | 15 | .com, .lit, .pun, .opn, .clo, .fun,.str, .atv,.kwd, .linenums .tag,.typ, .atn, .dec, .var, .pln { 16 | font-family: Consolas, Menlo, Monaco, "Courier New", monospace; 17 | } 18 | 19 | .prettyprint { 20 | padding: 8px; 21 | background-color: #f7f7f9; 22 | border: 1px solid #e1e1e8; 23 | } 24 | .prettyprint.linenums { 25 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 26 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 27 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 28 | } 29 | 30 | /* Specify class=linenums on a pre to get line numbering */ 31 | ol.linenums { 32 | margin: 0 0 0 33px; /* IE indents via margin-left */ 33 | } 34 | ol.linenums li { 35 | padding-left: 12px; 36 | color: #bebec5; 37 | line-height: 18px; 38 | text-shadow: 0 1px 0 #fff; 39 | } 40 | -------------------------------------------------------------------------------- /webapp/WEB-INF/layout/shell/me.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $!{stitle} - iPerl 7 | 8 | 9 | 10 | #include("WEB-INF/layout/inc/header.vm") 11 | 12 | 13 | #set($user=$core.user()) 14 | 15 |
16 | #if($user) 17 | #parse("WEB-INF/layout/inc/banner.vm") 18 | 35 | $screen_content 36 | #else 37 | Login first 38 | #end 39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/wordpaste/wordpaste.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('wordpaste', function(K) { 11 | var self = this, name = 'wordpaste'; 12 | self.clickToolbar(name, function() { 13 | var lang = self.lang(name + '.'), 14 | html = '
' + 15 | '
' + lang.comment + '
' + 16 | '' + 17 | '
', 18 | dialog = self.createDialog({ 19 | name : name, 20 | width : 450, 21 | title : self.lang(name), 22 | body : html, 23 | yesBtn : { 24 | name : self.lang('yes'), 25 | click : function(e) { 26 | var str = doc.body.innerHTML; 27 | str = K.clearMsWord(str, self.filterMode ? self.htmlTags : K.options.htmlTags); 28 | self.insertHtml(str).hideDialog().focus(); 29 | } 30 | } 31 | }), 32 | div = dialog.div, 33 | iframe = K('iframe', div), 34 | doc = K.iframeDoc(iframe); 35 | if (!K.IE) { 36 | doc.designMode = 'on'; 37 | } 38 | doc.open(); 39 | doc.write('WordPaste'); 40 | doc.write(''); 41 | if (!K.IE) { 42 | doc.write('
'); 43 | } 44 | doc.write(''); 45 | doc.close(); 46 | if (K.IE) { 47 | doc.body.contentEditable = 'true'; 48 | } 49 | iframe[0].contentWindow.focus(); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/map/map.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 53 | 54 | 55 |
56 | 57 | -------------------------------------------------------------------------------- /src/org/iperl/service/TagService.java: -------------------------------------------------------------------------------- 1 | package org.iperl.service; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.commons.collections.CollectionUtils; 6 | import org.apache.commons.lang.StringUtils; 7 | import org.iperl.beans.BlogTag; 8 | import org.iperl.beans.Tag; 9 | 10 | public class TagService { 11 | 12 | public static Long addTag(String tag) { 13 | tag = tag.trim(); 14 | Tag tagObj = Tag.INSTANCE.GetByAttr("name", tag); 15 | if (tagObj == null) { 16 | tagObj = new Tag(tag, 1); 17 | return tagObj.Save(); 18 | } 19 | int cnt = tagObj.getCnt() + 1; 20 | tagObj.updateAttr("cnt", cnt); 21 | return tagObj.getId(); 22 | } 23 | 24 | public static void batchAddTags(Long blogId, String keywords) { 25 | if (StringUtils.isBlank(keywords)) { 26 | return; 27 | } 28 | String[] tagArr = StringUtils.split(keywords, ','); 29 | for (String tag : tagArr) { 30 | Long tagId = addTag(tag); 31 | BlogTag bt = new BlogTag(blogId.intValue(), tagId.intValue()); 32 | bt.Save(); 33 | } 34 | } 35 | 36 | public static void batchDelTags(Long blogId, String keywords) { 37 | if (StringUtils.isBlank(keywords)) { 38 | return; 39 | } 40 | 41 | List list = BlogTag.INSTANCE.BatchGetByAttr("blog", blogId); 42 | for (BlogTag bt : list) { 43 | int tagId = bt.getTag(); 44 | if (bt.Delete()) { 45 | Tag t = Tag.INSTANCE.GetByAttr("id", tagId); 46 | int cnt = t.getCnt() - 1; 47 | if (cnt == 0) { 48 | t.Delete(); 49 | } else { 50 | t.updateAttr("cnt", cnt); 51 | } 52 | } 53 | } 54 | } 55 | 56 | public static List all() { 57 | List ids = Tag.INSTANCE.IDs("order by cnt desc"); 58 | return Tag.INSTANCE.LoadList(ids); 59 | } 60 | 61 | public static Tag findByName(String tag) { 62 | if(StringUtils.isBlank(tag)){ 63 | return null; 64 | } 65 | 66 | List ids = Tag.INSTANCE.IDs("where name = ? ", tag); 67 | if(CollectionUtils.isEmpty(ids)){ 68 | return null; 69 | } 70 | 71 | Long id = ids.get(0); 72 | return Tag.INSTANCE.Get(id); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/pwd.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | iPerl首页 » 后台管理 » 密码修改 3 |
4 | 5 |
6 |
7 | 输入旧密码: 8 | 9 |
10 |
11 | 输入新密码: 12 | 13 |
14 |
15 | 再次输入新密码: 16 | 17 |
18 |
19 |   20 | 21 |
22 |
23 | 24 | 67 | 68 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/blog/catalog.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | iPerl首页 » 后台管理 » 分类管理 3 |
4 | #set($cs = $catalog_tool.all()) 5 | #foreach($o in $cs) 6 | $!{o.ident} - $!{o.name} - $!{o.dorder} - edit - delete
7 | #end 8 |
9 | 10 | ident: name: dorder: 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /webapp/css/genius.css: -------------------------------------------------------------------------------- 1 | div.nav-123 { 2 | width: 940px; 3 | float: left; 4 | margin-left: 40px; 5 | } 6 | div.nav-123 div { 7 | color: #005d72; 8 | font-weight: bold; 9 | float: left; 10 | margin-top: 12px; 11 | font-size:16px; 12 | } 13 | div.nav-123 div span { 14 | display: block; 15 | position: relative; 16 | left: -20px; 17 | top: 16px; 18 | width: 10px; 19 | height: 10px; 20 | background-color: #005d72; 21 | } 22 | div.nav-123 div.page-signature { 23 | margin-bottom: 12px; 24 | } 25 | div.nav-123 ul div { 26 | color: #333333; 27 | font-weight: normal; 28 | } 29 | div.nav-123 ul { 30 | width: 940px; 31 | float: left; 32 | margin-left: 0; 33 | list-style:none; 34 | } 35 | div.nav-123 ul li { 36 | float: left; 37 | width: 160px; 38 | margin-right: 20px; 39 | margin-top: 12px; 40 | } 41 | div.nav-123 ul li a { 42 | font-weight: bold; 43 | font-size: 14px; 44 | color:#313131; 45 | } 46 | div.nav-123 ul li a:hover { text-decoration:underline;} 47 | div.nav-123 ul li span { 48 | color: #797979; 49 | display: block; 50 | width: 160px; 51 | font-size: 12px; 52 | } 53 | div.nav-123 ul div span { 54 | display: block; 55 | position: relative; 56 | left: -14px; 57 | top: 15px; 58 | width: 6px; 59 | height: 6px; 60 | background-color: #333333; 61 | } 62 | em a { 63 | display: inline-block; 64 | position: relative; 65 | top: 4px; 66 | width: 24px; 67 | height: 24px; 68 | margin-left: 10px; 69 | } 70 | a.microblog-163 { 71 | background: url("/img/microblog-logos.png") 0 0 no-repeat; 72 | } 73 | a.microblog-sina { 74 | background: url("/img/microblog-logos.png") -120px 0 no-repeat; 75 | } 76 | a.microblog-sohu { 77 | background: url("/img/microblog-logos.png") -30px 0 no-repeat; 78 | } 79 | a.microblog-qq { 80 | background: url("/img/microblog-logos.png") -60px 0 no-repeat; 81 | } 82 | a.microblog-t { 83 | background: url("/img/microblog-logos.png") -90px 0 no-repeat; 84 | } 85 | .tsw_contact { 86 | padding:10px; 87 | margin-top:20px; 88 | text-align:center; 89 | } 90 | 91 | .baidu{ 92 | margin-top:25px; 93 | margin-left:39px; 94 | } 95 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /webapp/js/jcrop/css/jquery.Jcrop.min.css: -------------------------------------------------------------------------------- 1 | /* jquery.Jcrop.min.css v0.9.12 (build:20130126) */ 2 | .jcrop-holder{direction:ltr;text-align:left;} 3 | .jcrop-vline,.jcrop-hline{background:#FFF url(Jcrop.gif);font-size:0;position:absolute;} 4 | .jcrop-vline{height:100%;width:1px!important;} 5 | .jcrop-vline.right{right:0;} 6 | .jcrop-hline{height:1px!important;width:100%;} 7 | .jcrop-hline.bottom{bottom:0;} 8 | .jcrop-tracker{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;height:100%;width:100%;} 9 | .jcrop-handle{background-color:#333;border:1px #EEE solid;font-size:1px;height:7px;width:7px;} 10 | .jcrop-handle.ord-n{left:50%;margin-left:-4px;margin-top:-4px;top:0;} 11 | .jcrop-handle.ord-s{bottom:0;left:50%;margin-bottom:-4px;margin-left:-4px;} 12 | .jcrop-handle.ord-e{margin-right:-4px;margin-top:-4px;right:0;top:50%;} 13 | .jcrop-handle.ord-w{left:0;margin-left:-4px;margin-top:-4px;top:50%;} 14 | .jcrop-handle.ord-nw{left:0;margin-left:-4px;margin-top:-4px;top:0;} 15 | .jcrop-handle.ord-ne{margin-right:-4px;margin-top:-4px;right:0;top:0;} 16 | .jcrop-handle.ord-se{bottom:0;margin-bottom:-4px;margin-right:-4px;right:0;} 17 | .jcrop-handle.ord-sw{bottom:0;left:0;margin-bottom:-4px;margin-left:-4px;} 18 | .jcrop-dragbar.ord-n,.jcrop-dragbar.ord-s{height:7px;width:100%;} 19 | .jcrop-dragbar.ord-e,.jcrop-dragbar.ord-w{height:100%;width:7px;} 20 | .jcrop-dragbar.ord-n{margin-top:-4px;} 21 | .jcrop-dragbar.ord-s{bottom:0;margin-bottom:-4px;} 22 | .jcrop-dragbar.ord-e{margin-right:-4px;right:0;} 23 | .jcrop-dragbar.ord-w{margin-left:-4px;} 24 | .jcrop-light .jcrop-vline,.jcrop-light .jcrop-hline{background:#FFF;filter:alpha(opacity=70)!important;opacity:.70!important;} 25 | .jcrop-light .jcrop-handle{-moz-border-radius:3px;-webkit-border-radius:3px;background-color:#000;border-color:#FFF;border-radius:3px;} 26 | .jcrop-dark .jcrop-vline,.jcrop-dark .jcrop-hline{background:#000;filter:alpha(opacity=70)!important;opacity:.7!important;} 27 | .jcrop-dark .jcrop-handle{-moz-border-radius:3px;-webkit-border-radius:3px;background-color:#FFF;border-color:#000;border-radius:3px;} 28 | .solid-line .jcrop-vline,.solid-line .jcrop-hline{background:#FFF;} 29 | .jcrop-holder img,img.jcrop-preview{max-width:none;} 30 | -------------------------------------------------------------------------------- /src/my/mvc/BadWord.java: -------------------------------------------------------------------------------- 1 | package my.mvc; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import org.apache.commons.io.FileUtils; 9 | import org.apache.commons.io.LineIterator; 10 | import org.apache.commons.lang.StringUtils; 11 | 12 | /** 13 | * 敏感字词 14 | * @author Winter Lau 15 | * @date 2010-1-11 下午10:51:30 16 | */ 17 | public class BadWord { 18 | 19 | private final static File wordfilter = new File(RequestContext.root() + "WEB-INF" + File.separator + "conf" + File.separator + "wordfilter.txt"); 20 | 21 | private static long lastModified = 0L; 22 | private static List words = new ArrayList(); 23 | 24 | private static void _CheckReload(){ 25 | if(wordfilter.lastModified() > lastModified){ 26 | synchronized(BadWord.class){ 27 | try{ 28 | lastModified = wordfilter.lastModified(); 29 | LineIterator lines = FileUtils.lineIterator(wordfilter, "utf-8"); 30 | while(lines.hasNext()){ 31 | String line = lines.nextLine(); 32 | if(StringUtils.isNotBlank(line)) 33 | words.add(StringUtils.trim(line).toLowerCase()); 34 | } 35 | }catch(IOException e){ 36 | e.printStackTrace(); 37 | } 38 | } 39 | } 40 | } 41 | 42 | /** 43 | * 检查敏感字内容 44 | * @param contents 45 | */ 46 | public static String Check(String...contents) { 47 | if(!wordfilter.exists()) 48 | return null; 49 | _CheckReload(); 50 | for(String word : words){ 51 | for(String content : contents) 52 | if(content!=null && content.indexOf(word) >= 0) 53 | return word; 54 | } 55 | return null; 56 | } 57 | 58 | public static List List() { 59 | _CheckReload(); 60 | return words; 61 | } 62 | 63 | public static void Add(String word) throws IOException { 64 | word = word.toLowerCase(); 65 | if(!words.contains(word)){ 66 | words.add(word); 67 | FileUtils.writeLines(wordfilter, "UTF-8", words); 68 | lastModified = wordfilter.lastModified(); 69 | } 70 | } 71 | 72 | public static void Delete(String word) throws IOException { 73 | word = word.toLowerCase(); 74 | words.remove(word); 75 | FileUtils.writeLines(wordfilter, "UTF-8", words); 76 | lastModified = wordfilter.lastModified(); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/org/iperl/service/UserService.java: -------------------------------------------------------------------------------- 1 | package org.iperl.service; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import my.mvc.ActionException; 8 | import my.mvc.IUser; 9 | import my.mvc.RequestContext; 10 | 11 | import org.apache.commons.codec.digest.DigestUtils; 12 | import org.apache.commons.collections.CollectionUtils; 13 | import org.apache.commons.lang.StringUtils; 14 | import org.iperl.beans.User; 15 | 16 | public class UserService { 17 | 18 | public static final String G_USER = "g_user"; 19 | 20 | public static User GetLoginUser(HttpServletRequest req) { 21 | Object loginUser = req.getAttribute(G_USER); 22 | if (loginUser == null) { 23 | // get user id from cookie 24 | IUser cookie_user = RequestContext.get().getUserFromCookie(); 25 | if (cookie_user == null) { 26 | return null; 27 | } 28 | User user = User.INSTANCE.Get(cookie_user.getId()); 29 | if (user != null 30 | && StringUtils.equalsIgnoreCase(user.getPwd(), 31 | cookie_user.getPwd())) { 32 | req.setAttribute(G_USER, user); 33 | return user; 34 | } 35 | } 36 | return (User) loginUser; 37 | } 38 | 39 | public static User Login(String ident, String pwd) { 40 | if (StringUtils.isBlank(ident) || StringUtils.isBlank(pwd)) { 41 | throw new ActionException("ident or pwd is blank"); 42 | } 43 | 44 | User user = User.INSTANCE.GetByAttr("ident", ident); 45 | if (user == null) { 46 | throw new ActionException("You are not exists"); 47 | } 48 | 49 | if (!(StringUtils.equalsIgnoreCase(user.getPwd(),DigestUtils.shaHex(pwd)))) { 50 | throw new ActionException("Password is wrong"); 51 | } 52 | 53 | if (user.IsBlocked()) { 54 | throw new ActionException("You are banned. Any question? mail to admin"); 55 | } 56 | 57 | return user; 58 | } 59 | 60 | public static User byIdent(String ident) { 61 | // 实际只有个一个匹配,用IDs这个方法只是为了缓存 62 | List ids = User.INSTANCE.IDs("where ident = ?", ident); 63 | if(CollectionUtils.isEmpty(ids)){ 64 | return null; 65 | } 66 | Long id = ids.get(0); 67 | return User.INSTANCE.Get(id); 68 | } 69 | 70 | public static List topAuthor(int count) { 71 | List ids = User.INSTANCE.IDs("where blogcnt > 0 order by blogcnt desc limit ?", count); 72 | return User.INSTANCE.LoadList(ids); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/my/util/Storage.java: -------------------------------------------------------------------------------- 1 | package my.util; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.FileNotFoundException; 6 | import java.io.IOException; 7 | import java.text.SimpleDateFormat; 8 | import java.util.Date; 9 | 10 | import org.apache.commons.io.FileUtils; 11 | import org.apache.commons.io.FilenameUtils; 12 | import org.apache.commons.lang.RandomStringUtils; 13 | 14 | /** 15 | * 存储服务 16 | * @author Winter Lau 17 | * @date 2010-9-25 下午12:32:05 18 | */ 19 | public abstract class Storage { 20 | 21 | private final static SimpleDateFormat FMT_FN = new SimpleDateFormat("yyyy/MM/dd_HHmmss_"); 22 | 23 | protected abstract String getBasePath(); 24 | 25 | /** 26 | * 读取文件数据 27 | * @param path 28 | * @return 29 | * @throws FileNotFoundException 30 | */ 31 | public FileInputStream read(String path) throws FileNotFoundException { 32 | return new FileInputStream(getBasePath() + path); 33 | } 34 | 35 | /** 36 | * 读取文件 37 | * @param path 38 | * @return 39 | * @throws FileNotFoundException 40 | */ 41 | public File readFile(String path) throws FileNotFoundException { 42 | return new File(getBasePath() + path); 43 | } 44 | 45 | /** 46 | * 判断文件是否存在 47 | * @param path 48 | * @return 49 | */ 50 | public boolean exist(String path) { 51 | return new File(getBasePath() + path).exists(); 52 | } 53 | 54 | /** 55 | * 保存文件,并返回对应的文件URI 56 | * @param f 57 | * @return 58 | * @throws IOException 59 | */ 60 | public String save(File f) throws IOException { 61 | String uri = FMT_FN.format(new Date()) + 62 | RandomStringUtils.randomAlphanumeric(4) + '.' + 63 | FilenameUtils.getExtension(f.getName()).toLowerCase(); 64 | return save(f, uri); 65 | } 66 | 67 | /** 68 | * 保存文件到指定路径 69 | * @param f 70 | * @param path 71 | * @throws IOException 72 | */ 73 | public String save(File f, String path) throws IOException { 74 | File dest = new File(getBasePath() + path); 75 | if(!dest.getParentFile().exists()) 76 | dest.getParentFile().mkdirs(); 77 | FileUtils.copyFile(f, dest); 78 | return path; 79 | } 80 | 81 | /** 82 | * 根据路径来删除文件 83 | * @param path 84 | * @throws IOException 85 | */ 86 | public void delete(String path) throws IOException { 87 | File dest = new File(getBasePath() + path); 88 | FileUtils.forceDelete(dest); 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/quickformat/quickformat.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('quickformat', function(K) { 11 | var self = this, name = 'quickformat', 12 | blockMap = K.toMap('blockquote,center,div,h1,h2,h3,h4,h5,h6,p'); 13 | function getFirstChild(knode) { 14 | var child = knode.first(); 15 | while (child && child.first()) { 16 | child = child.first(); 17 | } 18 | return child; 19 | } 20 | self.clickToolbar(name, function() { 21 | self.focus(); 22 | var doc = self.edit.doc, 23 | range = self.cmd.range, 24 | child = K(doc.body).first(), next, 25 | nodeList = [], subList = [], 26 | bookmark = range.createBookmark(true); 27 | while(child) { 28 | next = child.next(); 29 | var firstChild = getFirstChild(child); 30 | if (!firstChild || firstChild.name != 'img') { 31 | if (blockMap[child.name]) { 32 | child.html(child.html().replace(/^(\s| | )+/ig, '')); 33 | child.css('text-indent', '2em'); 34 | } else { 35 | subList.push(child); 36 | } 37 | if (!next || (blockMap[next.name] || blockMap[child.name] && !blockMap[next.name])) { 38 | if (subList.length > 0) { 39 | nodeList.push(subList); 40 | } 41 | subList = []; 42 | } 43 | } 44 | child = next; 45 | } 46 | K.each(nodeList, function(i, subList) { 47 | var wrapper = K('

', doc); 48 | subList[0].before(wrapper); 49 | K.each(subList, function(i, knode) { 50 | wrapper.append(knode); 51 | }); 52 | }); 53 | range.moveToBookmark(bookmark); 54 | self.addBookmark(); 55 | }); 56 | }); 57 | 58 | /** 59 | -------------------------- 60 | abcd
61 | 1234
62 | 63 | to 64 | 65 |

66 | abcd
67 | 1234
68 |

69 | 70 | -------------------------- 71 | 72 |   abcd1233 73 |

1234

74 | 75 | to 76 | 77 |

abcd1233

78 |

1234

79 | 80 | -------------------------- 81 | */ -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/template/template.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('template', function(K) { 11 | var self = this, name = 'template', lang = self.lang(name + '.'), 12 | htmlPath = self.pluginsPath + name + '/html/'; 13 | function getFilePath(fileName) { 14 | return htmlPath + fileName + '?ver=' + encodeURIComponent(K.DEBUG ? K.TIME : K.VERSION); 15 | } 16 | self.clickToolbar(name, function() { 17 | var lang = self.lang(name + '.'), 18 | arr = ['
', 19 | '
', 20 | // left start 21 | '
', 22 | lang. selectTemplate + '
', 28 | // right start 29 | '
', 30 | ' ', 31 | '
', 32 | '
', 33 | '
', 34 | '', 35 | '
'].join(''); 36 | var dialog = self.createDialog({ 37 | name : name, 38 | width : 500, 39 | title : self.lang(name), 40 | body : html, 41 | yesBtn : { 42 | name : self.lang('yes'), 43 | click : function(e) { 44 | var doc = K.iframeDoc(iframe); 45 | self[checkbox[0].checked ? 'html' : 'insertHtml'](doc.body.innerHTML).hideDialog().focus(); 46 | } 47 | } 48 | }); 49 | var selectBox = K('select', dialog.div), 50 | checkbox = K('[name="replaceFlag"]', dialog.div), 51 | iframe = K('iframe', dialog.div); 52 | checkbox[0].checked = true; 53 | iframe.attr('src', getFilePath(selectBox.val())); 54 | selectBox.change(function() { 55 | iframe.attr('src', getFilePath(this.value)); 56 | }); 57 | }); 58 | }); 59 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/code/code.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | // google code prettify: http://google-code-prettify.googlecode.com/ 11 | // http://google-code-prettify.googlecode.com/ 12 | 13 | KindEditor.plugin('code', function(K) { 14 | var self = this, name = 'code'; 15 | self.clickToolbar(name, function() { 16 | var lang = self.lang(name + '.'), 17 | html = ['
', 18 | '
', 19 | '', 35 | '
', 36 | '', 37 | '
'].join(''), 38 | dialog = self.createDialog({ 39 | name : name, 40 | width : 450, 41 | title : self.lang(name), 42 | body : html, 43 | yesBtn : { 44 | name : self.lang('yes'), 45 | click : function(e) { 46 | var type = K('.ke-code-type', dialog.div).val(), 47 | code = textarea.val(), 48 | cls = type === '' ? '' : ' lang-' + type, 49 | html = '
\n' + K.escape(code) + '
'; 50 | if (K.trim(code) === '') { 51 | alert(lang.pleaseInput); 52 | textarea[0].focus(); 53 | return; 54 | } 55 | self.insertHtml(html).hideDialog().focus(); 56 | } 57 | } 58 | }), 59 | textarea = K('textarea', dialog.div); 60 | textarea[0].focus(); 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/link/link.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * KindEditor - WYSIWYG HTML Editor for Internet 3 | * Copyright (C) 2006-2011 kindsoft.net 4 | * 5 | * @author Roddy 6 | * @site http://www.kindsoft.net/ 7 | * @licence http://www.kindsoft.net/license.php 8 | *******************************************************************************/ 9 | 10 | KindEditor.plugin('link', function(K) { 11 | var self = this, name = 'link'; 12 | self.plugin.link = { 13 | edit : function() { 14 | var lang = self.lang(name + '.'), 15 | html = '
' + 16 | //url 17 | '
' + 18 | '' + 19 | '
' + 20 | //type 21 | '
' + 22 | '' + 23 | '' + 24 | '
' + 25 | '
', 26 | dialog = self.createDialog({ 27 | name : name, 28 | width : 450, 29 | title : self.lang(name), 30 | body : html, 31 | yesBtn : { 32 | name : self.lang('yes'), 33 | click : function(e) { 34 | var url = K.trim(urlBox.val()); 35 | if (url == 'http://' || K.invalidUrl(url)) { 36 | alert(self.lang('invalidUrl')); 37 | urlBox[0].focus(); 38 | return; 39 | } 40 | self.exec('createlink', url, typeBox.val()).hideDialog().focus(); 41 | } 42 | } 43 | }), 44 | div = dialog.div, 45 | urlBox = K('input[name="url"]', div), 46 | typeBox = K('select[name="type"]', div); 47 | urlBox.val('http://'); 48 | typeBox[0].options[0] = new Option(lang.newWindow, '_blank'); 49 | typeBox[0].options[1] = new Option(lang.selfWindow, ''); 50 | self.cmd.selection(); 51 | var a = self.plugin.getSelectedLink(); 52 | if (a) { 53 | self.cmd.range.selectNode(a[0]); 54 | self.cmd.select(); 55 | urlBox.val(a.attr('data-ke-src')); 56 | typeBox.val(a.attr('target')); 57 | } 58 | urlBox[0].focus(); 59 | urlBox[0].select(); 60 | }, 61 | 'delete' : function() { 62 | self.exec('unlink', null); 63 | } 64 | }; 65 | self.clickToolbar(name, self.plugin.link.edit); 66 | }); 67 | -------------------------------------------------------------------------------- /src/my/mvc/MultipartRequest.java: -------------------------------------------------------------------------------- 1 | package my.mvc; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.Enumeration; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletRequestWrapper; 11 | 12 | /** 13 | * Multipart Encapsulation 14 | * @author Winter Lau 15 | */ 16 | @SuppressWarnings("unchecked") 17 | public class MultipartRequest extends HttpServletRequestWrapper { 18 | 19 | private com.oreilly.servlet.MultipartRequest multipartRequest; 20 | 21 | public MultipartRequest(HttpServletRequest req, 22 | String upload_tmp_path, int MAX_FILE_SIZE, String enc) 23 | throws IOException{ 24 | super(req); 25 | this.multipartRequest = new com.oreilly.servlet.MultipartRequest(req, 26 | upload_tmp_path, MAX_FILE_SIZE,enc); 27 | } 28 | 29 | public String getContentType(String name) { 30 | return multipartRequest.getContentType(name); 31 | } 32 | 33 | public File getFile(String name) { 34 | return multipartRequest.getFile(name); 35 | } 36 | 37 | public Enumeration getFileNames() { 38 | return multipartRequest.getFileNames(); 39 | } 40 | 41 | public String getFilesystemName(String name) { 42 | return multipartRequest.getFilesystemName(name); 43 | } 44 | 45 | public String getOriginalFileName(String name) { 46 | return multipartRequest.getOriginalFileName(name); 47 | } 48 | 49 | @Override 50 | public String getParameter(String name) { 51 | String v = super.getParameter(name); 52 | if(v == null) 53 | v =multipartRequest.getParameter(name); 54 | return v; 55 | } 56 | 57 | @Override 58 | public Enumeration getParameterNames() { 59 | return multipartRequest.getParameterNames(); 60 | } 61 | 62 | @Override 63 | public String[] getParameterValues(String name) { 64 | String[] v = super.getParameterValues(name); 65 | if(v == null) 66 | v = multipartRequest.getParameterValues(name); 67 | return v; 68 | } 69 | 70 | @Override 71 | public Map getParameterMap() { 72 | Map map = new HashMap(); 73 | Enumeration names = getParameterNames(); 74 | while(names.hasMoreElements()){ 75 | String name = names.nextElement(); 76 | String[] values = getParameterValues(name); 77 | map.put(name, (values!=null&&values.length==1)?values[0]:values); 78 | } 79 | return map; 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/org/iperl/action/CatalogAction.java: -------------------------------------------------------------------------------- 1 | package org.iperl.action; 2 | 3 | import java.io.IOException; 4 | 5 | import my.mvc.ActionException; 6 | import my.mvc.Annotation; 7 | import my.mvc.RequestContext; 8 | 9 | import org.apache.commons.lang.StringUtils; 10 | import org.iperl.beans.BlogCatalog; 11 | import org.iperl.service.CatalogService; 12 | 13 | public class CatalogAction extends BaseAction { 14 | 15 | @Annotation.JSONOutputEnabled 16 | @Annotation.PostMethod 17 | @Annotation.UserRoleRequired() 18 | public void add(RequestContext ctx) throws IOException { 19 | String ident = ctx.param("ident", ""); 20 | String name = ctx.param("name", ""); 21 | int dorder = ctx.param("dorder", 0); 22 | 23 | if (StringUtils.isBlank(ident)) { 24 | throw new ActionException("ident is blank"); 25 | } 26 | 27 | if (StringUtils.isBlank(name)) { 28 | throw new ActionException("name is blank"); 29 | } 30 | 31 | CatalogService.addCatalog(ident, name, dorder); 32 | ctx.output_json("msg", ""); 33 | } 34 | 35 | @Annotation.JSONOutputEnabled 36 | @Annotation.PostMethod 37 | @Annotation.UserRoleRequired() 38 | public void del(RequestContext ctx) throws IOException { 39 | int id = ctx.param("id", 0); 40 | if (id == 0) { 41 | throw new ActionException("id is necessary"); 42 | } 43 | 44 | BlogCatalog bc = BlogCatalog.INSTANCE.Get(id); 45 | if (bc == null) { 46 | throw new ActionException("The catalog[id:" + id 47 | + "] is not exists"); 48 | } 49 | 50 | CatalogService.delCatalog(bc); 51 | ctx.output_json("msg", ""); 52 | } 53 | 54 | @Annotation.JSONOutputEnabled 55 | @Annotation.PostMethod 56 | @Annotation.UserRoleRequired() 57 | public void update(RequestContext ctx) throws IOException { 58 | String ident = ctx.param("ident", ""); 59 | String name = ctx.param("name", ""); 60 | int dorder = ctx.param("dorder", 0); 61 | int id = ctx.param("id", 0); 62 | 63 | if (id == 0) { 64 | throw new ActionException("id is necessary"); 65 | } 66 | 67 | if (StringUtils.isBlank(ident)) { 68 | throw new ActionException("ident is blank"); 69 | } 70 | 71 | if (StringUtils.isBlank(name)) { 72 | throw new ActionException("name is blank"); 73 | } 74 | 75 | BlogCatalog bc = BlogCatalog.INSTANCE.Get(id); 76 | if (bc == null) { 77 | throw new ActionException("The catalog[id:" + id 78 | + "] is not exists"); 79 | } 80 | 81 | boolean success = CatalogService.updateCatalog(ident, name, dorder, bc); 82 | String msg = success ? "" : "Unknown Error"; 83 | ctx.output_json("msg", msg); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/blog/index.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/home.vm") 2 | #set($blogid = $link.param('p1',0)) 3 | #set($blog = $blog_tool.detail($blogid)) 4 | #if($blog) 5 | #set($user=$core.user()) 6 | #set($stitle="$!{blog.title}") 7 | #set($skeywords="$!{blog.keywords}") 8 | #set($sdesn="$!{blog.desn}") 9 | 16 |
17 |
18 | #if(!$blog.pubed()) 19 | 20 | #end 21 | 22 | 23 |
24 |
25 |

$!{blog.title}

26 | #if($user && ${user.id} eq ${blog.user}) 27 | 编辑 28 | #end 29 |
30 |
31 |
32 | #if($core.is_not_blank(${blog.desn})) 33 | 34 | #end 35 |
$!{blog.content}
36 |
37 |
38 |
39 | #tager($blog) 40 |
41 |
42 |
43 |
44 | #authorBar($blog) 45 |
46 |
47 |
48 | 上一篇:#if(${blog.pre()})$!{blog.pre().title}#else没有了#end
49 | 下一篇:#if(${blog.next()})$!{blog.next().title}#else没有了#end 50 |
51 |
52 | #include("WEB-INF/layout/inc/ujian.vm") 53 |
54 |
55 | #include("WEB-INF/layout/inc/duoshuo.vm") 56 |
57 |
58 | 59 |
60 |
61 | 62 | 69 | 70 |
71 |
72 | #else 73 | #notFound 74 | #end 75 | -------------------------------------------------------------------------------- /src/my/img/GeneralPathRect.java: -------------------------------------------------------------------------------- 1 | package my.img; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.Graphics2D; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.ActionListener; 7 | import java.awt.geom.GeneralPath; 8 | import java.awt.geom.RoundRectangle2D; 9 | import java.awt.image.BufferedImage; 10 | import java.io.File; 11 | import java.io.IOException; 12 | 13 | import javax.imageio.ImageIO; 14 | import javax.swing.JFileChooser; 15 | import javax.swing.JFrame; 16 | import javax.swing.JMenu; 17 | import javax.swing.JMenuBar; 18 | import javax.swing.JMenuItem; 19 | import javax.swing.JPanel; 20 | import javax.swing.filechooser.FileNameExtensionFilter; 21 | 22 | public class GeneralPathRect { 23 | /** * @param args */ 24 | public static void main(String[] args) { 25 | new GeneralPathRectFrame(); 26 | } 27 | } 28 | 29 | class GeneralPathRectFrame extends JFrame { 30 | private static final long serialVersionUID = 1L; 31 | private GeneralPath path = new GeneralPath(); 32 | BufferedImage image; 33 | JFileChooser chooser = new JFileChooser(); 34 | JMenuBar bar = new JMenuBar(); 35 | JPanel panel = new drawPanel(); 36 | 37 | public GeneralPathRectFrame() { 38 | setSize(400, 400); 39 | JMenu file = new JMenu("file"); 40 | JMenuItem openItem = new JMenuItem("导入图片"); 41 | openItem.addActionListener(new ActionListener() { 42 | @Override 43 | public void actionPerformed(ActionEvent arg0) { 44 | chooser.setCurrentDirectory(new File(".")); 45 | String[] suffiex = ImageIO.getReaderFileSuffixes(); 46 | chooser.setFileFilter(new FileNameExtensionFilter("Image file", 47 | suffiex)); 48 | int ans = chooser.showOpenDialog(GeneralPathRectFrame.this); 49 | if (ans == JFileChooser.APPROVE_OPTION) { 50 | try { 51 | image = ImageIO.read(chooser.getSelectedFile()); 52 | repaint(); 53 | } catch (IOException e) { 54 | e.printStackTrace(); 55 | } 56 | } 57 | } 58 | }); 59 | file.add(openItem); 60 | // panel.insertComponent(); 61 | add(panel); 62 | bar.add(file); 63 | setJMenuBar(bar); 64 | setVisible(true); 65 | } 66 | 67 | class drawPanel extends JPanel { 68 | private static final long serialVersionUID = 1L; 69 | 70 | public void paint(Graphics g) { 71 | Graphics2D g2 = (Graphics2D) g; 72 | if (image != null) { 73 | int width = image.getWidth(), height = image.getHeight(); 74 | RoundRectangle2D rect = new RoundRectangle2D.Double(0, 0, 75 | width, height, 20, 20); 76 | path.append(rect, false); 77 | g2.setClip(path); 78 | g2.drawImage(image, 0, 0, null); 79 | } else 80 | g.drawString("nihoa", 0, 0); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /webapp/js/ke4/themes/simple/simple.css: -------------------------------------------------------------------------------- 1 | /* container */ 2 | .ke-container-simple { 3 | display: block; 4 | border: 1px solid #CCC; 5 | background-color: #FFF; 6 | overflow: hidden; 7 | } 8 | /* toolbar */ 9 | .ke-container-simple .ke-toolbar { 10 | border-bottom: 1px solid #CCC; 11 | background-color: #FFF; 12 | padding: 2px 5px; 13 | overflow: hidden; 14 | } 15 | .ke-container-simple .ke-toolbar .ke-outline { 16 | border: 1px solid #FFF; 17 | background-color: transparent; 18 | margin: 1px; 19 | padding: 1px 2px; 20 | font-size: 0; 21 | line-height: 0; 22 | overflow: hidden; 23 | cursor: pointer; 24 | } 25 | .ke-container-simple .ke-toolbar .ke-on { 26 | border: 1px solid #5690D2; 27 | } 28 | .ke-container-simple .ke-toolbar .ke-selected { 29 | border: 1px solid #5690D2; 30 | background-color: #E9EFF6; 31 | } 32 | .ke-container-simple .ke-toolbar .ke-disabled { 33 | cursor: default; 34 | } 35 | /* statusbar */ 36 | .ke-container-simple .ke-statusbar { 37 | position: relative; 38 | background-color: #FFF; 39 | border-top: 1px solid #CCCCCC; 40 | font-size: 0; 41 | line-height: 0; 42 | *height: 12px; 43 | overflow: hidden; 44 | text-align: center; 45 | cursor: s-resize; 46 | } 47 | /* menu */ 48 | .ke-menu-simple { 49 | border: 1px solid #A0A0A0; 50 | background-color: #FFF; 51 | color: #222222; 52 | padding: 2px; 53 | font-family: "sans serif",tahoma,verdana,helvetica; 54 | font-size: 12px; 55 | text-align: left; 56 | overflow: hidden; 57 | } 58 | .ke-menu-simple .ke-menu-item { 59 | border: 1px solid #FFF; 60 | background-color: #FFF; 61 | color: #222222; 62 | height: 24px; 63 | overflow: hidden; 64 | cursor: pointer; 65 | } 66 | .ke-menu-simple .ke-menu-item-on { 67 | border: 1px solid #5690D2; 68 | background-color: #FFF; 69 | } 70 | /* colorpicker */ 71 | .ke-colorpicker-simple { 72 | border: 1px solid #A0A0A0; 73 | background-color: #FEFEFE; 74 | color: #222222; 75 | padding: 2px; 76 | } 77 | .ke-colorpicker-simple .ke-colorpicker-cell { 78 | font-size: 0; 79 | line-height: 0; 80 | border: 1px solid #FEFEFE; 81 | cursor: pointer; 82 | margin:3px; 83 | padding:0; 84 | } 85 | .ke-colorpicker-simple .ke-colorpicker-cell-top { 86 | font-family: "sans serif",tahoma,verdana,helvetica; 87 | font-size: 12px; 88 | line-height: 24px; 89 | border: 1px solid #FEFEFE; 90 | cursor: pointer; 91 | margin:0; 92 | padding:0; 93 | text-align: center; 94 | } 95 | .ke-colorpicker-simple .ke-colorpicker-cell-on { 96 | border: 1px solid #5690D2; 97 | } 98 | .ke-colorpicker-simple .ke-colorpicker-cell-selected { 99 | border: 1px solid #2446AB; 100 | } 101 | -------------------------------------------------------------------------------- /webapp/js/jcrop/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jcrop: the jQuery Image Cropping Plugin 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 | 17 | 24 | 25 | 26 | 27 | Jcrop 28 | is the image cropping plugin for 29 | jQuery.
30 | You've successfully unpacked Jcrop. 31 |
32 | 33 |

Static Demos

34 | 35 | 55 | 56 |

Live Demo

57 | 58 | 62 | 63 |

Jcrop Links

64 | 65 | 69 | 70 | 76 |
77 | 78 |
79 |
80 |
81 |
82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/blog/post.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | iPerl首页 » 后台管理 » 发表博文 3 |
4 | 5 |
6 |
文章标题: *
7 |
英文标题:用于显示在URL地址中,不能有空格,用 - 分隔word,为了SEO
8 |
类型: 9 | 14 | 原始地址: 转载或翻译时请给出原始地址
15 |
16 | 文章分类: 17 | 22 | 管理分类 23 |
24 |
25 | 26 |
27 |
28 | 分类Tag: 多个关键字用半角逗号隔开,最多5个,同时用于html的keywords字段,for SEO 29 |
30 |
31 | 导读(同时用于html的description,为了SEO): 32 |
33 | 34 |
35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/my/cache/CacheDirective.java: -------------------------------------------------------------------------------- 1 | package my.cache; 2 | 3 | import java.io.IOException; 4 | import java.io.Serializable; 5 | import java.io.StringWriter; 6 | import java.io.Writer; 7 | import java.util.Hashtable; 8 | 9 | import org.apache.commons.lang.StringUtils; 10 | import org.apache.velocity.context.InternalContextAdapter; 11 | import org.apache.velocity.exception.MethodInvocationException; 12 | import org.apache.velocity.exception.ParseErrorException; 13 | import org.apache.velocity.exception.ResourceNotFoundException; 14 | import org.apache.velocity.runtime.directive.Directive; 15 | import org.apache.velocity.runtime.parser.node.Node; 16 | import org.apache.velocity.runtime.parser.node.SimpleNode; 17 | 18 | /** 19 | * Velocity模板上用于控制缓存的指令 20 | * @author Winter Lau 21 | * @date 2009-3-16 下午04:40:19 22 | */ 23 | public class CacheDirective extends Directive { 24 | 25 | final static Hashtable body_tpls = new Hashtable(); 26 | 27 | @Override 28 | public String getName() { return "cache"; } //指定指令的名称 29 | 30 | @Override 31 | public int getType() { return BLOCK; } //指定指令类型为块指令 32 | 33 | /* (non-Javadoc) 34 | * @see org.apache.velocity.runtime.directive.Directive#render() 35 | */ 36 | @Override 37 | public boolean render(InternalContextAdapter context, Writer writer, Node node) 38 | throws IOException, ResourceNotFoundException, ParseErrorException, 39 | MethodInvocationException 40 | { 41 | //获得缓存信息 42 | SimpleNode sn_region = (SimpleNode) node.jjtGetChild(0); 43 | String region = (String)sn_region.value(context); 44 | SimpleNode sn_key = (SimpleNode) node.jjtGetChild(1); 45 | Serializable key = (Serializable)sn_key.value(context); 46 | 47 | Node body = node.jjtGetChild(2); 48 | //检查内容是否有变化 49 | String tpl_key = key+"@"+region; 50 | String body_tpl = body.literal(); 51 | String old_body_tpl = body_tpls.get(tpl_key); 52 | String cache_html = CacheManager.get(String.class, region, key); 53 | if(cache_html == null || !StringUtils.equals(body_tpl, old_body_tpl)){ 54 | StringWriter sw = new StringWriter(); 55 | body.render(context, sw); 56 | cache_html = sw.toString(); 57 | CacheManager.set(region, key, cache_html); 58 | body_tpls.put(tpl_key, body_tpl); 59 | } 60 | writer.write(cache_html); 61 | return true; 62 | } 63 | } 64 | 65 | 66 | /* 67 | 使用方法: 68 | #cache("News","home") 69 | ## 读取数据库中最新新闻并显示 70 |
    71 | #foreach($news in $NewsTool.ListTopNews(10)) 72 |
  • 73 | 74 | $date.format("yyyy-MM-dd",${news.pub_time}) 75 | 76 | ${news.title} 77 |
  • 78 | #end 79 |
80 | #end 81 | 82 | */ 83 | -------------------------------------------------------------------------------- /src/my/view/VelocityServlet.java: -------------------------------------------------------------------------------- 1 | package my.view; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | 8 | import javax.servlet.ServletException; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | import org.apache.commons.logging.Log; 13 | import org.apache.commons.logging.LogFactory; 14 | import org.apache.velocity.exception.MethodInvocationException; 15 | import org.apache.velocity.exception.ResourceNotFoundException; 16 | import org.apache.velocity.tools.view.servlet.VelocityLayoutServlet; 17 | 18 | /** 19 | * 自定义velocity的错误处理 20 | * @author liudong 21 | */ 22 | public final class VelocityServlet extends VelocityLayoutServlet { 23 | 24 | private final static Log LOG = LogFactory.getLog(VelocityServlet.class); 25 | 26 | @Override 27 | protected void error(HttpServletRequest req, HttpServletResponse res, 28 | Exception excp) throws ServletException { 29 | 30 | Throwable t = excp; 31 | if(excp instanceof MethodInvocationException) 32 | t = ((MethodInvocationException)excp).getWrappedThrowable(); 33 | 34 | try{ 35 | if(t instanceof ResourceNotFoundException){ 36 | LOG.error(t.getMessage() + "(" + req.getRequestURL().toString() + ")"); 37 | if(!res.isCommitted()) 38 | res.sendError(HttpServletResponse.SC_NOT_FOUND); 39 | } 40 | else{ 41 | StringBuilder log = new StringBuilder("ERROR:Unknown Velocity Error,url="); 42 | log.append(req.getRequestURL()); 43 | if(req.getQueryString()!=null){ 44 | log.append('?'); 45 | log.append(req.getQueryString()); 46 | } 47 | log.append('('); 48 | log.append(new Date()); 49 | log.append(')'); 50 | LOG.error(log.toString(), t); 51 | log = null; 52 | req.setAttribute("javax.servlet.jsp.jspException", t); 53 | res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); 54 | } 55 | }catch(IOException e){ 56 | LOG.error("Exception occured in VelocityServlet.error", e); 57 | throw new ServletException(e); 58 | }catch(IllegalStateException e){ 59 | LOG.error("==============<>==============", e.getCause()); 60 | throw new ServletException(e); 61 | } 62 | return; 63 | } 64 | 65 | @Override 66 | protected void doRequest(HttpServletRequest req, HttpServletResponse res) 67 | throws ServletException, IOException { 68 | 69 | long runtime = System.currentTimeMillis(); 70 | super.doRequest(req, res); 71 | if(req.getAttribute("close_comment")==null){ 72 | Date cur_time = Calendar.getInstance(req.getLocale()).getTime(); 73 | PrintWriter pw = res.getWriter(); 74 | pw.print("\r\n"); 79 | } 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /webapp/js/art/artDialog.plugins.min.js: -------------------------------------------------------------------------------- 1 | (function(c){c.alert=c.dialog.alert=function(b,a){return c.dialog({id:"Alert",fixed:!0,lock:!0,content:b,ok:!0,beforeunload:a})};c.confirm=c.dialog.confirm=function(b,a,m){return c.dialog({id:"Confirm",fixed:!0,lock:!0,content:b,ok:a,cancel:m})};c.prompt=c.dialog.prompt=function(b,a,m){var d;return c.dialog({id:"Prompt",fixed:!0,lock:!0,content:['
',b,'
'].join(""),initialize:function(){d=this.dom.content.find(".d-input-text")[0];d.select();d.focus()},ok:function(){return a&&a.call(this,d.value)},cancel:function(){}})};c.dialog.prototype.shake=function(){var b=function(a,b,c){var h=+new Date,e=setInterval(function(){var f=(+new Date-h)/c;1<=f?(clearInterval(e),b(f)):a(f)},13)},a=function(c,d,g,h){var e=h;void 0===e&&(e=6,g/=e);var f=parseInt(c.style.marginLeft)||0;b(function(a){c.style.marginLeft=f+(d-f)*a+"px"},function(){0!==e&&a(c,1===e?0:1.3*(d/e-d),g,--e)},g)};return function(){a(this.dom.wrap[0],40,600);return this}}();var o=function(){var b=this,a=function(a){var c=b[a];b[a]=function(){return c.apply(b,arguments)}};a("start");a("over");a("end")};o.prototype={start:function(b){c(document).bind("mousemove",this.over).bind("mouseup",this.end);this._sClientX=b.clientX;this._sClientY=b.clientY;this.onstart(b.clientX,b.clientY);return!1},over:function(b){this._mClientX=b.clientX;this._mClientY=b.clientY;this.onover(b.clientX-this._sClientX,b.clientY-this._sClientY);return!1},end:function(b){c(document).unbind("mousemove",this.over).unbind("mouseup",this.end);this.onend(b.clientX,b.clientY);return!1}};var j=c(window),k=c(document),i=document.documentElement,p=!!("minWidth"in i.style)&&"onlosecapture"in i,q="setCapture"in i,r=function(){return!1},n=function(b){var a=new o,c=artDialog.focus,d=c.dom,g=d.wrap,h=d.title,e=g[0],f=h[0],i=d.main[0],l=e.style,s=i.style,t=b.target===d.se[0]?!0:!1,u=(d="fixed"===e.style.position)?0:k.scrollLeft(),v=d?0:k.scrollTop(),n=j.width()-e.offsetWidth+u,A=j.height()-e.offsetHeight+v,w,x,y,z;a.onstart=function(){t?(w=i.offsetWidth,x=i.offsetHeight):(y=e.offsetLeft,z=e.offsetTop);k.bind("dblclick",a.end).bind("dragstart",r);p?h.bind("losecapture",a.end):j.bind("blur",a.end);q&&f.setCapture();g.addClass("d-state-drag");c.focus()};a.onover=function(a,b){if(t){var c=a+w,d=b+x;l.width="auto";s.width=Math.max(0,c)+"px";l.width=e.offsetWidth+"px";s.height=Math.max(0,d)+"px"}else c=Math.max(u,Math.min(n,a+y)),d=Math.max(v,Math.min(A,b+z)),l.left=c+"px",l.top=d+"px"};a.onend=function(){k.unbind("dblclick",a.end).unbind("dragstart",r);p?h.unbind("losecapture",a.end):j.unbind("blur",a.end);q&&f.releaseCapture();g.removeClass("d-state-drag")};a.start(b)};c(document).bind("mousedown",function(b){var a=artDialog.focus;if(a){var c=b.target,d=a.config,a=a.dom;if(!1!==d.drag&&c===a.title[0]||!1!==d.resize&&c===a.se[0])return n(b),!1}})})(this.art||this.jQuery); -------------------------------------------------------------------------------- /src/my/cache/CacheManager.java: -------------------------------------------------------------------------------- 1 | package my.cache; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.apache.commons.logging.Log; 6 | import org.apache.commons.logging.LogFactory; 7 | 8 | /** 9 | * 缓存助手 10 | CacheManager.set(xxxx), CacheManager.get(xxx) 11 | * @author Winter Lau 12 | */ 13 | public class CacheManager { 14 | 15 | private final static Log log = LogFactory.getLog(CacheManager.class); 16 | private static CacheProvider provider; 17 | 18 | static { 19 | initCacheProvider("my.cache.EhCacheProvider"); 20 | } 21 | 22 | private static void initCacheProvider(String prv_name){ 23 | try{ 24 | CacheManager.provider = (CacheProvider)Class.forName(prv_name).newInstance(); 25 | CacheManager.provider.start(); 26 | log.info("Using CacheProvider : " + provider.getClass().getName()); 27 | }catch(Exception e){ 28 | log.fatal("Unabled to initialize cache provider:" + prv_name + ", using ehcache default.", e); 29 | CacheManager.provider = new EhCacheProvider(); 30 | } 31 | } 32 | 33 | private final static Cache _GetCache(String cache_name, boolean autoCreate) { 34 | if(provider == null){ 35 | provider = new EhCacheProvider(); 36 | } 37 | return provider.buildCache(cache_name, autoCreate); 38 | } 39 | 40 | /** 41 | * 获取缓存中的数据 42 | * @param name 43 | * @param key 44 | * @return 45 | */ 46 | public final static Object get(String name, Serializable key){ 47 | //System.out.println("GET1 => " + name+":"+key); 48 | if(name!=null && key != null) 49 | return _GetCache(name, true).get(key); 50 | return null; 51 | } 52 | 53 | /** 54 | * 获取缓存中的数据 55 | * @param 56 | * @param resultClass 57 | * @param name 58 | * @param key 59 | * @return 60 | */ 61 | @SuppressWarnings("unchecked") 62 | public final static T get(Class resultClass, String name, Serializable key){ 63 | //System.out.println("GET2 => " + name+":"+key); 64 | if(name!=null && key != null) 65 | return (T)_GetCache(name, true).get(key); 66 | return null; 67 | } 68 | 69 | /** 70 | * 写入缓存 71 | * @param name 72 | * @param key 73 | * @param value 74 | */ 75 | public final static void set(String name, Serializable key, Serializable value){ 76 | //System.out.println("SET => " + name+":"+key+"="+value); 77 | if(name!=null && key != null && value!=null) 78 | _GetCache(name, true).put(key, value); 79 | } 80 | 81 | /** 82 | * 清除缓冲中的某个数据 83 | * @param name 84 | * @param key 85 | */ 86 | public final static void evict(String name, Serializable key){ 87 | if(name!=null && key != null) 88 | _GetCache(name, true).remove(key); 89 | } 90 | 91 | /** 92 | * 清除缓冲中的某个数据 93 | * @param name 94 | * @param key 95 | */ 96 | public final static void justEvict(String name, Serializable key){ 97 | if(name!=null && key != null){ 98 | Cache cache = _GetCache(name, false); 99 | if(cache != null) 100 | cache.remove(key); 101 | } 102 | } 103 | 104 | } 105 | -------------------------------------------------------------------------------- /webapp/js/ke4/plugins/baidumap/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 百度地图API自定义地图 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 83 | -------------------------------------------------------------------------------- /webapp/WEB-INF/www/me/blog/edit.vm: -------------------------------------------------------------------------------- 1 | #set($layout="shell/me.vm") 2 | #set($blogid = $link.param('blogid',0)) 3 | #set($blog = $blog_tool.detail($blogid)) 4 | iPerl首页 » 后台管理 » 发表博文 5 |
6 | 7 |
8 | 9 |
文章标题: *
10 |
英文标题:用于显示在URL地址中,不能有空格,用 - 分隔word,为了SEO
11 |
类型: 12 | 17 | 原始地址: 转载或翻译时请给出原始地址
18 |
19 | 文章分类: 20 | 25 | 管理分类 26 |
27 |
28 | 29 |
30 |
31 | 分类Tag: 多个关键字用半角逗号隔开,最多5个,同时用于html的keywords字段,for SEO 32 |
33 |
34 | 导读(同时用于html的description,为了SEO): 35 |
36 | 37 |
38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/my/toolbox/CoreTool.java: -------------------------------------------------------------------------------- 1 | package my.toolbox; 2 | 3 | import java.util.Collection; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import my.mvc.RequestContext; 8 | 9 | import org.apache.commons.collections.CollectionUtils; 10 | import org.apache.commons.lang.StringUtils; 11 | import org.iperl.beans.User; 12 | import org.iperl.service.UserService; 13 | import org.jsoup.Jsoup; 14 | import org.jsoup.safety.Whitelist; 15 | 16 | public class CoreTool { 17 | 18 | public static HttpServletRequest request(){ 19 | if(RequestContext.get() == null){ 20 | return null; 21 | } else { 22 | return RequestContext.get().request(); 23 | } 24 | } 25 | 26 | public static User user(){ 27 | if(RequestContext.get() == null || RequestContext.get().request() == null){ 28 | return null; 29 | } 30 | User user = UserService.GetLoginUser(RequestContext.get().request()); 31 | return user; 32 | } 33 | 34 | public static long page_count(long total_cnt, int page_size) { 35 | if (total_cnt <= 0) { 36 | return 0; 37 | } 38 | if (page_size <= 0) { 39 | return 1; 40 | } 41 | return (total_cnt + page_size - 1) / page_size; 42 | } 43 | 44 | public static boolean obj_is_null(Object obj) { 45 | return obj == null; 46 | } 47 | 48 | public static boolean obj_is_not_null(Object obj) { 49 | if (obj instanceof String) { 50 | return !StringUtils.isBlank((String) obj); 51 | } else { 52 | return obj != null; 53 | } 54 | } 55 | 56 | public static String sub_str(String src, int size) { 57 | if (StringUtils.isBlank(src)) { 58 | return ""; 59 | } 60 | src = Jsoup.clean(src, Whitelist.basic()); 61 | int len = src.length(); 62 | if (len > size) { 63 | src = src.substring(0, size); 64 | return Jsoup.clean(src, Whitelist.basicWithImages()); 65 | } else { 66 | return src; 67 | } 68 | } 69 | 70 | public static String sub_str_none(String src, int size) { 71 | if (StringUtils.isBlank(src)) { 72 | return ""; 73 | } 74 | src = Jsoup.clean(src, Whitelist.none()); 75 | int len = src.length(); 76 | if (len > size) { 77 | return src.substring(0, size); 78 | } else { 79 | return src; 80 | } 81 | } 82 | 83 | public static boolean is_empty(Collection coll){ 84 | return CollectionUtils.isEmpty(coll); 85 | } 86 | 87 | public static int str_len(String str){ 88 | if(StringUtils.isBlank(str)){ 89 | return 0; 90 | }else { 91 | return str.length(); 92 | } 93 | } 94 | 95 | public static boolean is_blank(String str){ 96 | return StringUtils.isBlank(str); 97 | } 98 | 99 | public static boolean is_not_blank(String str){ 100 | return StringUtils.isNotBlank(str); 101 | } 102 | 103 | public static String nl2br(String content) { 104 | return StringUtils.replace(content, "\n", "
"); 105 | } 106 | 107 | public static String nobr(String str){ 108 | return StringUtils.replace(str, "
", ""); 109 | } 110 | 111 | public static String htmlSpecialChars(String str) { 112 | str = str.replaceAll("&", "&"); 113 | str = str.replaceAll("<", "<"); 114 | str = str.replaceAll(">", ">"); 115 | str = str.replaceAll("\"", """); 116 | return str; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /src/org/iperl/action/BlogAction.java: -------------------------------------------------------------------------------- 1 | package org.iperl.action; 2 | 3 | import java.io.IOException; 4 | 5 | import my.mvc.ActionException; 6 | import my.mvc.Annotation; 7 | import my.mvc.RequestContext; 8 | import my.toolbox.CoreTool; 9 | 10 | import org.apache.commons.lang.StringUtils; 11 | import org.iperl.beans.Blog; 12 | import org.iperl.beans.User; 13 | import org.iperl.service.BlogService; 14 | 15 | public class BlogAction extends BaseAction { 16 | 17 | @Annotation.JSONOutputEnabled 18 | @Annotation.PostMethod 19 | @Annotation.UserRoleRequired() 20 | public void post(RequestContext ctx) throws IOException { 21 | String title = ctx.param("title", ""); 22 | String ident = ctx.param("ident", ""); 23 | Integer type = ctx.param("type", 0); 24 | String url = ctx.param("url", ""); 25 | int catalog = ctx.param("catalog", 0); 26 | String content = ctx.param("content", ""); 27 | String tags = ctx.param("tags", ""); 28 | String desn = ctx.param("desn", ""); 29 | 30 | String post = ctx.param("post", ""); 31 | Integer status = StringUtils.isBlank(post) ? 0 : 1; 32 | 33 | checkBlank(new String[] { "title", "content" }, new String[] { title, 34 | content }); 35 | 36 | User user = CoreTool.user(); 37 | Long userId = user.getId(); 38 | Blog blog = new Blog(title, ident, tags, desn, type.byteValue(), url, 39 | content, userId.intValue(), catalog, status.byteValue()); 40 | long blogId = BlogService.addBlog(blog); 41 | 42 | ctx.output_json(new String[]{"msg", "id"}, new Object[]{"", blogId}); 43 | } 44 | 45 | @Annotation.JSONOutputEnabled 46 | @Annotation.PostMethod 47 | @Annotation.UserRoleRequired() 48 | public void edit(RequestContext ctx) throws IOException { 49 | String title = ctx.param("title", ""); 50 | String ident = ctx.param("ident", ""); 51 | Integer type = ctx.param("type", 0); 52 | String url = ctx.param("url", ""); 53 | int catalog = ctx.param("catalog", 0); 54 | String content = ctx.param("content", ""); 55 | String tags = ctx.param("tags", ""); 56 | String desn = ctx.param("desn", ""); 57 | 58 | String post = ctx.param("post", ""); 59 | Integer status = StringUtils.isBlank(post) ? 0 : 1; 60 | 61 | checkBlank(new String[] { "title", "content" }, new String[] { title, 62 | content }); 63 | 64 | Blog blog = safeBlog(ctx); 65 | BlogService.update(blog, title, ident, tags, desn, type, url, content, catalog, status); 66 | 67 | ctx.output_json("msg", ""); 68 | } 69 | 70 | 71 | @Annotation.JSONOutputEnabled 72 | @Annotation.PostMethod 73 | @Annotation.UserRoleRequired() 74 | public void del(RequestContext ctx) throws IOException { 75 | Blog blog = safeBlog(ctx); 76 | BlogService.delBlog(blog); 77 | ctx.output_json("msg", ""); 78 | } 79 | 80 | public void hit(RequestContext ctx) throws IOException { 81 | Blog blog = safeBlog(ctx); 82 | blog.updateAttr("hits", blog.getHits() + 1); 83 | } 84 | 85 | protected Blog safeBlog(RequestContext ctx) { 86 | int blogid = ctx.param("blogid", 0); 87 | if (blogid == 0) { 88 | throw new ActionException("Parameter blogid is necessary"); 89 | } 90 | Blog blog = Blog.INSTANCE.Get(blogid); 91 | if (blog == null) { 92 | throw new ActionException("The blog[id:" + blogid 93 | + "] is not exists"); 94 | } 95 | return blog; 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/org/iperl/toolbox/BlogTool.java: -------------------------------------------------------------------------------- 1 | package org.iperl.toolbox; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | import org.iperl.beans.Blog; 7 | import org.iperl.beans.Tag; 8 | import org.iperl.dto.Pagination; 9 | import org.iperl.service.BlogService; 10 | import org.iperl.service.TagService; 11 | import org.jsoup.Jsoup; 12 | import org.jsoup.nodes.Document; 13 | import org.jsoup.nodes.Element; 14 | import org.jsoup.select.Elements; 15 | 16 | public class BlogTool { 17 | 18 | public static List Anchor = Arrays.asList("h1", "h2", "h3", "h4", 19 | "h5", "h6"); 20 | 21 | public static List draft() { 22 | List list = BlogService.draft(); 23 | return list; 24 | } 25 | 26 | public static List pubed() { 27 | List list = BlogService.pubed(); 28 | return list; 29 | } 30 | 31 | public static Blog detail(int id) { 32 | return Blog.INSTANCE.Get(id); 33 | } 34 | 35 | public static Pagination topNew(int pageno, int pagesize) { 36 | pageno = pageno <= 0 ? 1 : pageno; 37 | pagesize = pagesize <= 0 ? 10 : pagesize; 38 | return BlogService.topNew(pageno, pagesize); 39 | } 40 | 41 | public static List topHits(int count){ 42 | List list = BlogService.topHits(count); 43 | return list; 44 | } 45 | 46 | public static Pagination byCatalog(int catalogId, int pageno, int pagesize){ 47 | pageno = pageno <= 0 ? 1 : pageno; 48 | pagesize = pagesize <= 0 ? 10 : pagesize; 49 | return BlogService.byCatalog(catalogId, pageno, pagesize); 50 | } 51 | 52 | public static Pagination byUser(int userId, int pageno, int pagesize){ 53 | pageno = pageno <= 0 ? 1 : pageno; 54 | pagesize = pagesize <= 0 ? 10 : pagesize; 55 | return BlogService.byUser(userId, pageno, pagesize); 56 | } 57 | 58 | public static Pagination byTag(String tag, int pageno, int pagesize){ 59 | pageno = pageno <= 0 ? 1 : pageno; 60 | pagesize = pagesize <= 0 ? 10 : pagesize; 61 | Tag tagObj = TagService.findByName(tag); 62 | if(tagObj == null){ 63 | return null; 64 | } 65 | return BlogService.byTag(tagObj, pageno, pagesize); 66 | } 67 | 68 | public static String htmlAnchor(String html) { 69 | Document doc = Jsoup.parseBodyFragment(html); 70 | Elements anchors = doc.select("*"); 71 | int i = 0; 72 | for (Element anchor : anchors) { 73 | String tagName = anchor.tagName().toLowerCase(); 74 | if (Anchor.contains(tagName) && anchor.hasText()) { 75 | i++; 76 | anchor.before(""); 78 | } 79 | } 80 | return doc.body().html(); 81 | } 82 | 83 | public static String htmlContent(String html) { 84 | StringBuffer content = new StringBuffer(); 85 | Document doc = Jsoup.parseBodyFragment(html); 86 | Elements anchors = doc.select("*"); 87 | int i = 0; 88 | for (Element anchor : anchors) { 89 | String tagName = anchor.tagName().toLowerCase(); 90 | if (Anchor.contains(tagName) && anchor.hasText()) { 91 | i++; 92 | content.append("
  • " 94 | + anchor.text() + "
  • "); 95 | } 96 | } 97 | return content.toString(); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/my/util/ResourceUtils.java: -------------------------------------------------------------------------------- 1 | package my.util; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.FileInputStream; 5 | import java.io.InputStream; 6 | import java.io.InputStreamReader; 7 | import java.text.MessageFormat; 8 | import java.util.Locale; 9 | import java.util.MissingResourceException; 10 | import java.util.ResourceBundle; 11 | 12 | import org.apache.commons.io.IOUtils; 13 | 14 | /** 15 | * 国际化资源工具类 16 | * @author liudong 17 | */ 18 | public class ResourceUtils { 19 | 20 | private final static MyResourceBundleControl ctl = new MyResourceBundleControl(); 21 | 22 | /** 23 | * 返回 {res}.properties 中 key 对应的值 24 | * @param baseName 25 | * @param key 26 | * @return 27 | */ 28 | public static String getString(String baseName, String key) { 29 | return _getStringForLocale(Locale.getDefault(), baseName ,key); 30 | } 31 | 32 | public static String ui(String key){ return getString("ui", key); } 33 | 34 | /** 35 | * 返回 {res}.properties 中 key 对应的值 36 | * @param locale 37 | * @param baseName 38 | * @param key 39 | * @return 40 | */ 41 | private static String _getStringForLocale(Locale locale, String baseName, String key) { 42 | try{ 43 | ResourceBundle rb = ResourceBundle.getBundle(baseName, locale, ResourceUtils.class.getClassLoader(), ctl); 44 | return (rb != null)?rb.getString(key):null; 45 | }catch(MissingResourceException e){ 46 | return null; 47 | }catch(NullPointerException e){ 48 | return null; 49 | } 50 | } 51 | 52 | /** 53 | * 返回 {res}.properties 中 key 对应的值,并对值进行参数格式化 54 | * @param baseName 55 | * @param key 56 | * @param args 57 | * @return 58 | */ 59 | public static String getString(String baseName, String key, Object...args) { 60 | String text = getString(baseName, key); 61 | return (text!=null)?MessageFormat.format(text, args):null; 62 | } 63 | 64 | /** 65 | * 返回 {res}.properties 中 key 对应的值,并对值进行参数格式化 66 | * @param locale 67 | * @param baseName 68 | * @param key 69 | * @param args 70 | * @return 71 | */ 72 | public static String getStringForLocale(Locale locale, String baseName, String key, Object...args) { 73 | String text = _getStringForLocale(locale, baseName, key); 74 | return (text!=null)?MessageFormat.format(text, args):null; 75 | } 76 | 77 | public static String loadFromResource(String resource) { 78 | InputStream in = null; 79 | BufferedReader reader = null; 80 | try { 81 | in = new FileInputStream(resource); 82 | reader = new BufferedReader(new InputStreamReader(in, "utf-8")); 83 | return IOUtils.toString(reader); 84 | } catch (Exception excp) { 85 | throw new RuntimeException(excp); 86 | } finally { 87 | IOUtils.closeQuietly(reader); 88 | IOUtils.closeQuietly(in); 89 | reader = null; 90 | } 91 | } 92 | 93 | /** 94 | * 重载控制器,每1个小时重载一次 95 | * @author Winter Lau 96 | * @date 2010-5-12 下午11:20:02 97 | */ 98 | private static class MyResourceBundleControl extends ResourceBundle.Control { 99 | 100 | /** 101 | * 每1个小时重载一次 102 | */ 103 | @Override 104 | public long getTimeToLive(String baseName, Locale locale) { 105 | return 3600000; 106 | } 107 | 108 | @Override 109 | public boolean needsReload(String baseName, Locale locale, 110 | String format, ClassLoader loader, 111 | ResourceBundle bundle, long loadTime) { 112 | return true; 113 | } 114 | } 115 | } 116 | --------------------------------------------------------------------------------