├── .classpath ├── .gitignore ├── .project ├── .settings ├── com.springsource.server.ide.jdt.core.xml ├── com.springsource.sts.config.flow.prefs ├── org.eclipse.ajdt.core.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.m2e.core.prefs ├── org.eclipse.wst.common.component ├── org.eclipse.wst.common.project.facet.core.prefs.xml ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.validation.prefs ├── org.maven.ide.eclipse.prefs ├── org.springframework.ide.eclipse.beans.core.prefs └── org.springframework.ide.eclipse.core.prefs ├── .springBeans ├── README.md ├── data-model └── springblog-datamodel.clay ├── entries.xml ├── hibernate.reveng.xml ├── lib └── spring-instrument-tomcat-4.2.2.RELEASE.jar ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── prospring3 │ │ │ └── springblog │ │ │ ├── JpaCatergoryTest.java │ │ │ ├── JpaCommentTest.java │ │ │ ├── JpaEntryAuditTest.java │ │ │ ├── JpaEntryTest.java │ │ │ ├── JpaTest.java │ │ │ ├── MyBatisCategoryServiceTest.java │ │ │ ├── MyBatisEntryServiceTest.java │ │ │ ├── MyBatisTest.java │ │ │ ├── MyBatisUserServiceTest.java │ │ │ ├── auditor │ │ │ └── AuditorAwareBean.java │ │ │ ├── batch │ │ │ ├── integration │ │ │ │ └── FileMessageToJobRequest.java │ │ │ └── validator │ │ │ │ └── BeanValidationValidator.java │ │ │ ├── common │ │ │ └── aop │ │ │ │ ├── ListBasedObscenityFilter.java │ │ │ │ ├── ObscenityFilter.java │ │ │ │ └── ObscenityFilterAdvice.java │ │ │ ├── domain │ │ │ ├── AbstractBlogPosting.java │ │ │ ├── AppUser.java │ │ │ ├── Attachment.java │ │ │ ├── BlogPosting.java │ │ │ ├── Category.java │ │ │ ├── Comment.java │ │ │ ├── CommentAttachment.java │ │ │ ├── Entries.java │ │ │ ├── Entry.java │ │ │ ├── EntryAttachment.java │ │ │ ├── EntryRating.java │ │ │ ├── Role.java │ │ │ ├── SearchCriteria.java │ │ │ └── SearchCriteriaPage.java │ │ │ ├── mybatis │ │ │ ├── plugin │ │ │ │ └── MyBatisPlugin.java │ │ │ └── type │ │ │ │ └── DateTimeTypeHandler.java │ │ │ ├── persistence │ │ │ ├── CategoryMapper.java │ │ │ ├── EntryMapper.java │ │ │ └── UserMapper.java │ │ │ ├── repository │ │ │ ├── CategoryRepository.java │ │ │ ├── CommentAttachmentRepository.java │ │ │ ├── CommentRepository.java │ │ │ ├── EntryAttachmentRepository.java │ │ │ ├── EntryRepository.java │ │ │ └── UserRepository.java │ │ │ ├── security │ │ │ └── provider │ │ │ │ └── UserDetailsServiceImpl.java │ │ │ ├── service │ │ │ ├── CategoryService.java │ │ │ ├── CommentAttachmentService.java │ │ │ ├── CommentService.java │ │ │ ├── EntryAttachmentService.java │ │ │ ├── EntryAuditService.java │ │ │ ├── EntryService.java │ │ │ ├── HelloService.java │ │ │ ├── HousekeepingService.java │ │ │ ├── UserService.java │ │ │ ├── jpa │ │ │ │ ├── CategoryServiceImpl.java │ │ │ │ ├── CommentAttachmentServiceImpl.java │ │ │ │ ├── CommentServiceImpl.java │ │ │ │ ├── EntryAttachmentServiceImpl.java │ │ │ │ ├── EntryAuditServiceImpl.java │ │ │ │ ├── EntryServiceImpl.java │ │ │ │ ├── HelloServiceImpl.java │ │ │ │ ├── HousekeepingServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ └── mybatis │ │ │ │ ├── CategoryServiceImpl.java │ │ │ │ ├── CommentAttachmentServiceImpl.java │ │ │ │ ├── CommentServiceImpl.java │ │ │ │ ├── EntryAttachmentServiceImpl.java │ │ │ │ ├── EntryAuditServiceImpl.java │ │ │ │ ├── EntryServiceImpl.java │ │ │ │ ├── HelloServiceImpl.java │ │ │ │ ├── HousekeepingServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ ├── web │ │ │ ├── blogapp │ │ │ │ └── controller │ │ │ │ │ ├── AuditController.java │ │ │ │ │ ├── CategoryController.java │ │ │ │ │ ├── CommentController.java │ │ │ │ │ ├── EntryController.java │ │ │ │ │ ├── FileDownloadController.java │ │ │ │ │ ├── FileUploadController.java │ │ │ │ │ ├── SecurityController.java │ │ │ │ │ └── TempController.java │ │ │ ├── controller │ │ │ │ └── HomeController.java │ │ │ ├── form │ │ │ │ ├── EntryGrid.java │ │ │ │ ├── Message.java │ │ │ │ └── UploadItem.java │ │ │ ├── restful │ │ │ │ └── controller │ │ │ │ │ └── BlogRestfulController.java │ │ │ └── util │ │ │ │ └── UrlUtil.java │ │ │ └── xml │ │ │ └── handler │ │ │ └── DateTimeFieldHandler.java │ ├── resources │ │ ├── META-INF │ │ │ └── orm.xml │ │ ├── castor.properties │ │ ├── com │ │ │ └── apress │ │ │ │ └── prospring3 │ │ │ │ └── springblog │ │ │ │ └── persistence │ │ │ │ ├── CategoryMapper.xml │ │ │ │ ├── EntryMapper.xml │ │ │ │ └── UserMapper.xml │ │ ├── jpa-app-context.xml │ │ ├── log4j.xml │ │ ├── mybatis-app-context.xml │ │ ├── oxm-mapping.xml │ │ ├── springblog.properties │ │ └── sql │ │ │ ├── initial-data.sql │ │ │ ├── schema-mysql.sql │ │ │ └── schema.sql │ └── webapp │ │ ├── META-INF │ │ ├── aop.xml │ │ └── context.xml │ │ ├── WEB-INF │ │ ├── classes │ │ │ └── standard.properties │ │ ├── i18n │ │ │ ├── application.properties │ │ │ ├── application_zh_HK.properties │ │ │ ├── messages.properties │ │ │ └── messages_zh_HK.properties │ │ ├── layouts │ │ │ ├── default.jspx │ │ │ ├── default.jspx.20111214 │ │ │ ├── default.jspx.20111218 │ │ │ ├── layouts.xml │ │ │ └── temp.jspx │ │ ├── spring │ │ │ ├── batch-context.xml │ │ │ ├── blogapp-webmvc-config.xml │ │ │ ├── datasource.xml │ │ │ ├── jpa-service-context.xml │ │ │ ├── jpa-tx-config.xml │ │ │ ├── mybatis-service-context.xml │ │ │ ├── mybatis-tx-config.xml │ │ │ ├── restful-context.xml │ │ │ ├── root-context.xml │ │ │ └── security-context.xml │ │ ├── views │ │ │ ├── blogs │ │ │ │ ├── edit.jspx │ │ │ │ ├── list.jspx │ │ │ │ ├── show.jspx │ │ │ │ └── views.xml │ │ │ ├── comments │ │ │ │ ├── edit.jspx │ │ │ │ └── views.xml │ │ │ ├── footer.jspx │ │ │ ├── header.jspx │ │ │ ├── home.jsp │ │ │ ├── menu.jspx │ │ │ └── views.xml │ │ └── web.xml │ │ ├── ckeditor │ │ ├── .htaccess │ │ ├── adapters │ │ │ └── jquery.js │ │ ├── ckeditor.js │ │ ├── ckeditor_basic.js │ │ ├── config.js │ │ ├── contents.css │ │ ├── images │ │ │ └── spacer.gif │ │ ├── lang │ │ │ ├── _languages.js │ │ │ ├── _translationstatus.txt │ │ │ ├── af.js │ │ │ ├── ar.js │ │ │ ├── bg.js │ │ │ ├── bn.js │ │ │ ├── bs.js │ │ │ ├── ca.js │ │ │ ├── cs.js │ │ │ ├── cy.js │ │ │ ├── da.js │ │ │ ├── de.js │ │ │ ├── el.js │ │ │ ├── en-au.js │ │ │ ├── en-ca.js │ │ │ ├── en-gb.js │ │ │ ├── en.js │ │ │ ├── eo.js │ │ │ ├── es.js │ │ │ ├── et.js │ │ │ ├── eu.js │ │ │ ├── fa.js │ │ │ ├── fi.js │ │ │ ├── fo.js │ │ │ ├── fr-ca.js │ │ │ ├── fr.js │ │ │ ├── gl.js │ │ │ ├── gu.js │ │ │ ├── he.js │ │ │ ├── hi.js │ │ │ ├── hr.js │ │ │ ├── hu.js │ │ │ ├── is.js │ │ │ ├── it.js │ │ │ ├── ja.js │ │ │ ├── ka.js │ │ │ ├── km.js │ │ │ ├── ko.js │ │ │ ├── lt.js │ │ │ ├── lv.js │ │ │ ├── mn.js │ │ │ ├── ms.js │ │ │ ├── nb.js │ │ │ ├── nl.js │ │ │ ├── no.js │ │ │ ├── pl.js │ │ │ ├── pt-br.js │ │ │ ├── pt.js │ │ │ ├── ro.js │ │ │ ├── ru.js │ │ │ ├── sk.js │ │ │ ├── sl.js │ │ │ ├── sr-latn.js │ │ │ ├── sr.js │ │ │ ├── sv.js │ │ │ ├── th.js │ │ │ ├── tr.js │ │ │ ├── uk.js │ │ │ ├── vi.js │ │ │ ├── zh-cn.js │ │ │ └── zh.js │ │ ├── plugins │ │ │ ├── a11yhelp │ │ │ │ ├── dialogs │ │ │ │ │ └── a11yhelp.js │ │ │ │ └── lang │ │ │ │ │ ├── en.js │ │ │ │ │ └── he.js │ │ │ ├── about │ │ │ │ └── dialogs │ │ │ │ │ ├── about.js │ │ │ │ │ └── logo_ckeditor.png │ │ │ ├── adobeair │ │ │ │ └── plugin.js │ │ │ ├── ajax │ │ │ │ └── plugin.js │ │ │ ├── autogrow │ │ │ │ └── plugin.js │ │ │ ├── bbcode │ │ │ │ └── plugin.js │ │ │ ├── clipboard │ │ │ │ └── dialogs │ │ │ │ │ └── paste.js │ │ │ ├── colordialog │ │ │ │ └── dialogs │ │ │ │ │ └── colordialog.js │ │ │ ├── devtools │ │ │ │ ├── lang │ │ │ │ │ └── en.js │ │ │ │ └── plugin.js │ │ │ ├── dialog │ │ │ │ └── dialogDefinition.js │ │ │ ├── div │ │ │ │ └── dialogs │ │ │ │ │ └── div.js │ │ │ ├── docprops │ │ │ │ ├── dialogs │ │ │ │ │ └── docprops.js │ │ │ │ └── plugin.js │ │ │ ├── find │ │ │ │ └── dialogs │ │ │ │ │ └── find.js │ │ │ ├── flash │ │ │ │ ├── dialogs │ │ │ │ │ └── flash.js │ │ │ │ └── images │ │ │ │ │ └── placeholder.png │ │ │ ├── forms │ │ │ │ ├── dialogs │ │ │ │ │ ├── button.js │ │ │ │ │ ├── checkbox.js │ │ │ │ │ ├── form.js │ │ │ │ │ ├── hiddenfield.js │ │ │ │ │ ├── radio.js │ │ │ │ │ ├── select.js │ │ │ │ │ ├── textarea.js │ │ │ │ │ └── textfield.js │ │ │ │ └── images │ │ │ │ │ └── hiddenfield.gif │ │ │ ├── iframe │ │ │ │ ├── dialogs │ │ │ │ │ └── iframe.js │ │ │ │ └── images │ │ │ │ │ └── placeholder.png │ │ │ ├── iframedialog │ │ │ │ └── plugin.js │ │ │ ├── image │ │ │ │ └── dialogs │ │ │ │ │ └── image.js │ │ │ ├── link │ │ │ │ ├── dialogs │ │ │ │ │ ├── anchor.js │ │ │ │ │ └── link.js │ │ │ │ └── images │ │ │ │ │ └── anchor.gif │ │ │ ├── liststyle │ │ │ │ └── dialogs │ │ │ │ │ └── liststyle.js │ │ │ ├── pagebreak │ │ │ │ └── images │ │ │ │ │ └── pagebreak.gif │ │ │ ├── pastefromword │ │ │ │ └── filter │ │ │ │ │ └── default.js │ │ │ ├── pastetext │ │ │ │ └── dialogs │ │ │ │ │ └── pastetext.js │ │ │ ├── placeholder │ │ │ │ ├── dialogs │ │ │ │ │ └── placeholder.js │ │ │ │ ├── lang │ │ │ │ │ ├── en.js │ │ │ │ │ └── he.js │ │ │ │ ├── placeholder.gif │ │ │ │ └── plugin.js │ │ │ ├── scayt │ │ │ │ └── dialogs │ │ │ │ │ ├── options.js │ │ │ │ │ └── toolbar.css │ │ │ ├── showblocks │ │ │ │ └── images │ │ │ │ │ ├── block_address.png │ │ │ │ │ ├── block_blockquote.png │ │ │ │ │ ├── block_div.png │ │ │ │ │ ├── block_h1.png │ │ │ │ │ ├── block_h2.png │ │ │ │ │ ├── block_h3.png │ │ │ │ │ ├── block_h4.png │ │ │ │ │ ├── block_h5.png │ │ │ │ │ ├── block_h6.png │ │ │ │ │ ├── block_p.png │ │ │ │ │ └── block_pre.png │ │ │ ├── smiley │ │ │ │ ├── dialogs │ │ │ │ │ └── smiley.js │ │ │ │ └── images │ │ │ │ │ ├── angel_smile.gif │ │ │ │ │ ├── angry_smile.gif │ │ │ │ │ ├── broken_heart.gif │ │ │ │ │ ├── confused_smile.gif │ │ │ │ │ ├── cry_smile.gif │ │ │ │ │ ├── devil_smile.gif │ │ │ │ │ ├── embaressed_smile.gif │ │ │ │ │ ├── envelope.gif │ │ │ │ │ ├── heart.gif │ │ │ │ │ ├── kiss.gif │ │ │ │ │ ├── lightbulb.gif │ │ │ │ │ ├── omg_smile.gif │ │ │ │ │ ├── regular_smile.gif │ │ │ │ │ ├── sad_smile.gif │ │ │ │ │ ├── shades_smile.gif │ │ │ │ │ ├── teeth_smile.gif │ │ │ │ │ ├── thumbs_down.gif │ │ │ │ │ ├── thumbs_up.gif │ │ │ │ │ ├── tounge_smile.gif │ │ │ │ │ ├── whatchutalkingabout_smile.gif │ │ │ │ │ └── wink_smile.gif │ │ │ ├── specialchar │ │ │ │ ├── dialogs │ │ │ │ │ └── specialchar.js │ │ │ │ └── lang │ │ │ │ │ └── en.js │ │ │ ├── styles │ │ │ │ └── styles │ │ │ │ │ └── default.js │ │ │ ├── stylesheetparser │ │ │ │ └── plugin.js │ │ │ ├── table │ │ │ │ └── dialogs │ │ │ │ │ └── table.js │ │ │ ├── tableresize │ │ │ │ └── plugin.js │ │ │ ├── tabletools │ │ │ │ └── dialogs │ │ │ │ │ └── tableCell.js │ │ │ ├── templates │ │ │ │ ├── dialogs │ │ │ │ │ └── templates.js │ │ │ │ └── templates │ │ │ │ │ ├── default.js │ │ │ │ │ └── images │ │ │ │ │ ├── template1.gif │ │ │ │ │ ├── template2.gif │ │ │ │ │ └── template3.gif │ │ │ ├── uicolor │ │ │ │ ├── dialogs │ │ │ │ │ └── uicolor.js │ │ │ │ ├── lang │ │ │ │ │ ├── en.js │ │ │ │ │ └── he.js │ │ │ │ ├── plugin.js │ │ │ │ ├── uicolor.gif │ │ │ │ └── yui │ │ │ │ │ ├── assets │ │ │ │ │ ├── hue_bg.png │ │ │ │ │ ├── hue_thumb.png │ │ │ │ │ ├── picker_mask.png │ │ │ │ │ ├── picker_thumb.png │ │ │ │ │ └── yui.css │ │ │ │ │ └── yui.js │ │ │ ├── wsc │ │ │ │ └── dialogs │ │ │ │ │ ├── ciframe.html │ │ │ │ │ ├── tmpFrameset.html │ │ │ │ │ ├── wsc.css │ │ │ │ │ └── wsc.js │ │ │ └── xml │ │ │ │ └── plugin.js │ │ ├── skins │ │ │ ├── kama │ │ │ │ ├── dialog.css │ │ │ │ ├── editor.css │ │ │ │ ├── icons.png │ │ │ │ ├── icons_rtl.png │ │ │ │ ├── images │ │ │ │ │ ├── dialog_sides.gif │ │ │ │ │ ├── dialog_sides.png │ │ │ │ │ ├── dialog_sides_rtl.png │ │ │ │ │ ├── mini.gif │ │ │ │ │ ├── noimage.png │ │ │ │ │ ├── sprites.png │ │ │ │ │ ├── sprites_ie6.png │ │ │ │ │ └── toolbar_start.gif │ │ │ │ ├── skin.js │ │ │ │ └── templates.css │ │ │ ├── office2003 │ │ │ │ ├── dialog.css │ │ │ │ ├── editor.css │ │ │ │ ├── icons.png │ │ │ │ ├── icons_rtl.png │ │ │ │ ├── images │ │ │ │ │ ├── dialog_sides.gif │ │ │ │ │ ├── dialog_sides.png │ │ │ │ │ ├── dialog_sides_rtl.png │ │ │ │ │ ├── mini.gif │ │ │ │ │ ├── noimage.png │ │ │ │ │ ├── sprites.png │ │ │ │ │ └── sprites_ie6.png │ │ │ │ ├── skin.js │ │ │ │ └── templates.css │ │ │ └── v2 │ │ │ │ ├── dialog.css │ │ │ │ ├── editor.css │ │ │ │ ├── icons.png │ │ │ │ ├── icons_rtl.png │ │ │ │ ├── images │ │ │ │ ├── dialog_sides.gif │ │ │ │ ├── dialog_sides.png │ │ │ │ ├── dialog_sides_rtl.png │ │ │ │ ├── mini.gif │ │ │ │ ├── noimage.png │ │ │ │ ├── sprites.png │ │ │ │ ├── sprites_ie6.png │ │ │ │ └── toolbar_start.gif │ │ │ │ ├── skin.js │ │ │ │ └── templates.css │ │ └── themes │ │ │ └── default │ │ │ └── theme.js │ │ ├── images │ │ ├── add.png │ │ ├── apress-logo.jpg │ │ ├── banner-graphic.png │ │ ├── build-with.jpg │ │ ├── create.png │ │ ├── delete.png │ │ ├── en.png │ │ ├── favicon.ico │ │ ├── list.png │ │ ├── resultset_first.png │ │ ├── resultset_last.png │ │ ├── resultset_next.png │ │ ├── resultset_previous.png │ │ ├── show.png │ │ ├── springblog-logo.jpg │ │ ├── springsource-logo.png │ │ └── update.png │ │ ├── jqgrid │ │ ├── css │ │ │ └── ui.jqgrid.css │ │ ├── js │ │ │ ├── i18n │ │ │ │ ├── grid.locale-ar.js │ │ │ │ ├── grid.locale-bg.js │ │ │ │ ├── grid.locale-cat.js │ │ │ │ ├── grid.locale-cs.js │ │ │ │ ├── grid.locale-da.js │ │ │ │ ├── grid.locale-el.js │ │ │ │ ├── grid.locale-en.js │ │ │ │ ├── grid.locale-es.js │ │ │ │ ├── grid.locale-fa.js │ │ │ │ ├── grid.locale-fi.js │ │ │ │ ├── grid.locale-fr.js │ │ │ │ ├── grid.locale-gl.js │ │ │ │ ├── grid.locale-he.js │ │ │ │ ├── grid.locale-hu.js │ │ │ │ ├── grid.locale-is.js │ │ │ │ ├── grid.locale-ja.js │ │ │ │ ├── grid.locale-lt.js │ │ │ │ ├── grid.locale-mne.js │ │ │ │ ├── grid.locale-nl.js │ │ │ │ ├── grid.locale-no.js │ │ │ │ ├── grid.locale-pl.js │ │ │ │ ├── grid.locale-pt-br.js │ │ │ │ ├── grid.locale-ro.js │ │ │ │ ├── grid.locale-ru.js │ │ │ │ ├── grid.locale-sk.js │ │ │ │ ├── grid.locale-sr.js │ │ │ │ ├── grid.locale-sv.js │ │ │ │ ├── grid.locale-tr.js │ │ │ │ └── grid.locale-ua.js │ │ │ ├── jquery.jqGrid.min.js │ │ │ └── jquery.jqGrid.src.js │ │ └── plugins │ │ │ ├── grid.addons.js │ │ │ ├── grid.addons.js.20111219 │ │ │ ├── grid.postext.js │ │ │ ├── grid.setcolumns.js │ │ │ ├── jquery.contextmenu.js │ │ │ ├── jquery.searchFilter.js │ │ │ ├── jquery.tablednd.js │ │ │ ├── searchFilter.css │ │ │ ├── ui.multiselect.css │ │ │ └── ui.multiselect.js │ │ ├── scripts │ │ ├── javascript.js │ │ ├── jquery-1.7.1.js │ │ └── jquery-ui-1.8.16.custom.min.js │ │ └── styles │ │ ├── custom-theme │ │ ├── images │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_75_ffffff_1x400.png │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ ├── ui-bg_inset-soft_95_fef1ec_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ ├── jquery-ui-1.8.16.custom.css │ │ └── jquery-ui-1.8.16.custom.css.20111214 │ │ ├── messages │ │ ├── error.png │ │ ├── info.png │ │ ├── messages.css │ │ ├── success.png │ │ └── warning.png │ │ └── standard.css └── test │ ├── java │ └── com │ │ └── apress │ │ └── prospring3 │ │ └── springblog │ │ ├── common │ │ └── aop │ │ │ └── ObscenityFilterTest.java │ │ └── service │ │ └── jpa │ │ └── EntryServiceImplTest.java │ └── resources │ ├── app-context-test.xml │ ├── jpa-app-context-test.xml │ └── log4j.xml └── uml-model ├── springblog-uml-model.asta └── springblog-uml-model.asta.bak /.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 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | release.properties 7 | dependency-reduced-pom.xml 8 | buildNumber.properties 9 | .mvn/timing.properties 10 | .DS_Store -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | springblog 4 | 5 | 6 | Servers 7 | 8 | 9 | 10 | org.eclipse.wst.jsdt.core.javascriptValidator 11 | 12 | 13 | 14 | 15 | org.eclipse.ajdt.core.ajbuilder 16 | 17 | 18 | 19 | 20 | org.eclipse.wst.common.project.facet.core.builder 21 | 22 | 23 | 24 | 25 | org.eclipse.wst.validation.validationbuilder 26 | 27 | 28 | 29 | 30 | org.springframework.ide.eclipse.core.springbuilder 31 | 32 | 33 | 34 | 35 | org.eclipse.m2e.core.maven2Builder 36 | 37 | 38 | 39 | 40 | 41 | com.springsource.sts.roo.core.nature 42 | org.springframework.ide.eclipse.core.springnature 43 | org.eclipse.ajdt.ui.ajnature 44 | org.eclipse.jem.workbench.JavaEMFNature 45 | org.eclipse.jdt.core.javanature 46 | org.eclipse.wst.common.project.facet.core.nature 47 | org.eclipse.wst.common.modulecore.ModuleCoreNature 48 | org.eclipse.wst.jsdt.core.jsNature 49 | org.eclipse.m2e.core.maven2Nature 50 | 51 | 52 | -------------------------------------------------------------------------------- /.settings/com.springsource.server.ide.jdt.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.settings/com.springsource.sts.config.flow.prefs: -------------------------------------------------------------------------------- 1 | //com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/batch\:/springblog/src/main/webapp/WEB-INF/spring/batch-context.xml=\n\n\n\n\n\n 2 | //com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/springblog/src/main/webapp/WEB-INF/spring/batch-context.xml=\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n 3 | eclipse.preferences.version=1 4 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.8 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 12 | org.eclipse.jdt.core.compiler.source=1.8 13 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Oct 10 10:00:49 CST 2011 2 | activeProfiles= 3 | eclipse.preferences.version=1 4 | resolveWorkspaceProjects=true 5 | version=1 6 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.prefs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | DELEGATES_PREFERENCE=delegateValidatorList 2 | USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; 3 | USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; 4 | USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationtrueversion1.2.700.v201508251749 5 | disabled=06target 6 | eclipse.preferences.version=1 7 | override=true 8 | suspend=true 9 | vf.version=3 10 | -------------------------------------------------------------------------------- /.settings/org.maven.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | #Tue Mar 17 14:28:16 EDT 2009 2 | activeProfiles= 3 | eclipse.preferences.version=1 4 | fullBuildGoals=process-test-resources 5 | includeModules=false 6 | resolveWorkspaceProjects=true 7 | resourceFilterGoals=process-resources resources\:testResources 8 | skipCompilerPlugin=true 9 | version=1 10 | -------------------------------------------------------------------------------- /.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | src/main/webapp/WEB-INF/spring/datasource.xml 11 | src/main/webapp/WEB-INF/spring/jpa-tx-config.xml 12 | src/main/webapp/WEB-INF/spring/security-context.xml 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ProSpring 3 - SpringBlog Application 2 | The SpringBlog application is the sample application for the book Pro Spring 3, which covers various topics in using Spring Framework. 3 | 4 | The application is built with: 5 | - Spring Framework 4.2.2 6 | - Service layer with implementation with JPA (Hibernate with Spring Data JPA) and MyBatis 7 | - Spring AOP 8 | - Spring MVC, JSP, jQuery, jQueryUI, jqGrid, CKEditor 9 | - RESTful-WS 10 | - Spring Batch 11 | - Spring Integration 12 | 13 | ## Purpose 14 | The main purpose is to showcase the topics discussed in the book. On the other hand, it can be used as a reference application for developers in using latest version of Spring Framework with related tools to build a JEE application. 15 | 16 | ## Check out sources 17 | `git clone git://github.com/prospring3/springblog.git` 18 | 19 | ## Book 20 | [Pro Spring 3](http://www.apress.com/9781430241072) 21 | 22 | ## Notes for running the application within STS 23 | I found problem in running this application id tc Server within STS (version 3.7.1), but works with Tomcat 8. 24 | So please following the instructions below in running the application in STS and Tomcat in your local environment: 25 | * Download and unzip Apache Tomcat 8 in your local PC 26 | * Copy the file "/lib/spring-instrument-tomcat-4.2.2.RELEASE.jar into the "lib" folder of the extracted Tomcat server 27 | * In STS, create a new server which points to the Tomcat 8 installed above 28 | * Deploy the application to the Tomcat Server and verify that the application is up and running 29 | * Access the application via the URL: `http://localhost:8080/springblog/blogs` 30 | 31 | For any questions, please feel free to contact me and I will take a look. 32 | -------------------------------------------------------------------------------- /entries.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SpringBlog by batch 5 | Spring 6 | Spring Batch 7 | 8 | Testing SpringBlog posting entry by batch upload 9 | 10 | 11 | -------------------------------------------------------------------------------- /hibernate.reveng.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/spring-instrument-tomcat-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/lib/spring-instrument-tomcat-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/JpaCatergoryTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.context.support.GenericXmlApplicationContext; 9 | 10 | import com.apress.prospring3.springblog.domain.Category; 11 | import com.apress.prospring3.springblog.service.CategoryService; 12 | 13 | /** 14 | * @author Clarence 15 | * 16 | */ 17 | public class JpaCatergoryTest { 18 | 19 | /** 20 | * @param args 21 | */ 22 | public static void main(String[] args) { 23 | 24 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 25 | ctx.load("classpath:jpa-app-context.xml"); 26 | ctx.refresh(); 27 | 28 | System.out.println("App context initialized successfully"); 29 | 30 | CategoryService categoryService = ctx.getBean("categoryService", CategoryService.class); 31 | 32 | List categories = categoryService.findAllParentCategory(); 33 | 34 | for (Category category: categories) { 35 | System.out.println("Category id: " + category.getCategoryId()); 36 | List subCategories = categoryService.findAllSubCategory(category.getCategoryId()); 37 | for (Category subCategory: subCategories) { 38 | System.out.println("Sub-category id: " + subCategory.getCategoryId()); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/JpaCommentTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.context.support.GenericXmlApplicationContext; 9 | 10 | import com.apress.prospring3.springblog.domain.Comment; 11 | import com.apress.prospring3.springblog.service.CommentService; 12 | 13 | /** 14 | * @author Clarence 15 | * 16 | */ 17 | public class JpaCommentTest { 18 | 19 | /** 20 | * @param args 21 | */ 22 | public static void main(String[] args) { 23 | 24 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 25 | ctx.load("classpath:jpa-app-context.xml"); 26 | ctx.refresh(); 27 | 28 | System.out.println("App context initialized successfully"); 29 | 30 | CommentService commentService = ctx.getBean("commentService", CommentService.class); 31 | 32 | List comments = commentService.findByEntryId(1l); 33 | 34 | System.out.println("No of comments: " + comments.size()); 35 | 36 | for (Comment comment: comments) { 37 | System.out.println(comment.getPostBy()); 38 | } 39 | 40 | List replyTos = commentService.findReplyToByEntryId(3l); 41 | 42 | for (String replyTo: replyTos) { 43 | System.out.println(replyTo); 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/JpaEntryAuditTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.context.support.GenericXmlApplicationContext; 9 | 10 | import com.apress.prospring3.springblog.domain.Entry; 11 | import com.apress.prospring3.springblog.service.EntryAuditService; 12 | 13 | /** 14 | * @author Clarence 15 | * 16 | */ 17 | public class JpaEntryAuditTest { 18 | 19 | /** 20 | * @param args 21 | */ 22 | public static void main(String[] args) { 23 | 24 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 25 | ctx.load("classpath:jpa-app-context.xml"); 26 | ctx.refresh(); 27 | 28 | System.out.println("App context initialized successfully"); 29 | 30 | EntryAuditService entryAuditService = ctx.getBean("entryAuditService", EntryAuditService.class); 31 | 32 | List entries = entryAuditService.findAuditById(1l); 33 | 34 | for (Entry entry: entries) { 35 | System.out.println(entry); 36 | } 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/JpaEntryTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog; 5 | 6 | import org.joda.time.DateTime; 7 | import org.joda.time.format.DateTimeFormat; 8 | import org.springframework.context.support.GenericXmlApplicationContext; 9 | import org.springframework.data.domain.Page; 10 | import org.springframework.data.domain.PageRequest; 11 | 12 | import com.apress.prospring3.springblog.domain.Entry; 13 | import com.apress.prospring3.springblog.domain.SearchCriteria; 14 | import com.apress.prospring3.springblog.service.EntryService; 15 | 16 | /** 17 | * @author Clarence 18 | * 19 | */ 20 | public class JpaEntryTest { 21 | 22 | /** 23 | * @param args 24 | */ 25 | public static void main(String[] args) { 26 | 27 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 28 | ctx.load("classpath:jpa-app-context.xml"); 29 | ctx.refresh(); 30 | 31 | System.out.println("App context initialized successfully"); 32 | 33 | EntryService entryService = ctx.getBean("entryService", EntryService.class); 34 | 35 | PageRequest pageRequest = new PageRequest(0, 10); 36 | 37 | String subject = "%"; 38 | String categoryId = "Spring"; 39 | DateTime fromPostDate = DateTimeFormat.forPattern("yyyy-MM-dd").parseDateTime("1900-01-01"); 40 | DateTime toPostDate = DateTimeFormat.forPattern("yyyy-MM-dd").parseDateTime("2011-12-18"); 41 | 42 | SearchCriteria searchCriteria = new SearchCriteria(); 43 | searchCriteria.setSubject(subject); 44 | searchCriteria.setCategoryId(categoryId); 45 | searchCriteria.setFromPostDate(fromPostDate); 46 | searchCriteria.setToPostDate(toPostDate); 47 | 48 | Page entries = entryService.findEntryByCriteria(searchCriteria, pageRequest); 49 | System.out.println("No. of entries:" + entries.getNumberOfElements()); 50 | 51 | //Page entries = entryService.findAllByPage(pageRequest); 52 | //System.out.println("No. of entries:" + entries.getNumberOfElements()); 53 | 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/MyBatisCategoryServiceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.context.support.GenericXmlApplicationContext; 9 | 10 | import com.apress.prospring3.springblog.domain.Category; 11 | import com.apress.prospring3.springblog.service.CategoryService; 12 | 13 | /** 14 | * @author Clarence 15 | * 16 | */ 17 | public class MyBatisCategoryServiceTest { 18 | 19 | /** 20 | * @param args 21 | */ 22 | public static void main(String[] args) { 23 | 24 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 25 | ctx.load("classpath:mybatis-app-context.xml"); 26 | ctx.refresh(); 27 | 28 | System.out.println("App context initialized successfully"); 29 | 30 | CategoryService categoryService = ctx.getBean("categoryService", CategoryService.class); 31 | 32 | List categories = categoryService.findAll(); 33 | 34 | for (Category category: categories) System.out.println("Category: " + category.getCategoryId()); 35 | 36 | List parentCategories = categoryService.findAllParentCategory(); 37 | 38 | List subCategories; 39 | for (Category category: parentCategories) { 40 | System.out.println("Parent Category: " + category.getCategoryId()); 41 | 42 | subCategories = categoryService.findAllSubCategory(category.getCategoryId()); 43 | for (Category categoryTemp: subCategories) System.out.println("--->Sub Category: " + categoryTemp.getCategoryId()); 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/MyBatisEntryServiceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 27, 2011 3 | */ 4 | package com.apress.prospring3.springblog; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.context.support.GenericXmlApplicationContext; 9 | 10 | import com.apress.prospring3.springblog.domain.Entry; 11 | import com.apress.prospring3.springblog.service.EntryService; 12 | 13 | /** 14 | * @author Clarence 15 | * 16 | */ 17 | public class MyBatisEntryServiceTest { 18 | 19 | /** 20 | * @param args 21 | */ 22 | public static void main(String[] args) { 23 | 24 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 25 | ctx.load("classpath:mybatis-app-context.xml"); 26 | ctx.refresh(); 27 | 28 | System.out.println("App context initialized successfully"); 29 | 30 | EntryService entryService = ctx.getBean("entryService", EntryService.class); 31 | 32 | List entries = entryService.findAll(); 33 | 34 | //System.err.println("Size: " + entries.size()); 35 | for (Entry entry: entries) System.out.println("Entry: " + entry); 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/MyBatisUserServiceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog; 5 | 6 | import org.springframework.context.support.GenericXmlApplicationContext; 7 | 8 | import com.apress.prospring3.springblog.domain.AppUser; 9 | import com.apress.prospring3.springblog.service.UserService; 10 | 11 | /** 12 | * @author Clarence 13 | * 14 | */ 15 | public class MyBatisUserServiceTest { 16 | 17 | /** 18 | * @param args 19 | */ 20 | public static void main(String[] args) { 21 | 22 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 23 | ctx.load("classpath:mybatis-app-context.xml"); 24 | ctx.refresh(); 25 | 26 | System.out.println("App context initialized successfully"); 27 | 28 | UserService userService = ctx.getBean("userService", UserService.class); 29 | 30 | AppUser appUser = userService.findByUserName("clarence"); 31 | 32 | System.out.println("User name: " + appUser.getUserName()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/auditor/AuditorAwareBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 18, 2011 3 | */ 4 | package com.apress.prospring3.springblog.auditor; 5 | 6 | import org.springframework.data.domain.AuditorAware; 7 | import org.springframework.security.core.Authentication; 8 | import org.springframework.security.core.context.SecurityContextHolder; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public class AuditorAwareBean implements AuditorAware { 15 | 16 | public String getCurrentAuditor() { 17 | 18 | Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); 19 | 20 | String currentUser = null; 21 | 22 | if (authentication != null) { 23 | currentUser = authentication.getName(); 24 | } else { 25 | // For import entry using batch job 26 | currentUser = "batch"; 27 | } 28 | 29 | return currentUser; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/batch/integration/FileMessageToJobRequest.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring3.springblog.batch.integration; 2 | 3 | import java.io.File; 4 | 5 | import org.springframework.batch.core.Job; 6 | import org.springframework.batch.core.JobParametersBuilder; 7 | import org.springframework.batch.integration.launch.JobLaunchRequest; 8 | import org.springframework.messaging.Message; 9 | import org.springframework.integration.annotation.Transformer; 10 | 11 | /** 12 | * Spring batch with integration to trigger file import job. 13 | * 14 | * @author clarence 15 | * 16 | */ 17 | public class FileMessageToJobRequest { 18 | 19 | private Job job; 20 | private String fileParameterName; 21 | 22 | public void setFileParameterName(String fileParameterName) { 23 | this.fileParameterName = fileParameterName; 24 | } 25 | 26 | public void setJob(Job job) { 27 | this.job = job; 28 | } 29 | 30 | @Transformer 31 | public JobLaunchRequest toRequest(Message message) 32 | { 33 | JobParametersBuilder jobParametersBuilder = new JobParametersBuilder(); 34 | jobParametersBuilder.addString(fileParameterName, 35 | message.getPayload().getAbsolutePath()); 36 | return new JobLaunchRequest(job, jobParametersBuilder.toJobParameters()); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/batch/validator/BeanValidationValidator.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring3.springblog.batch.validator; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | import javax.validation.ConstraintViolation; 7 | 8 | import org.springframework.batch.item.validator.ValidationException; 9 | import org.springframework.batch.item.validator.Validator; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | 12 | /** 13 | * Batch validator to perform validation using Bean Validation API. 14 | * 15 | * @author Clarence 16 | * 17 | */ 18 | public class BeanValidationValidator implements Validator { 19 | 20 | @Autowired 21 | private javax.validation.Validator validator; 22 | 23 | public void validate(Entry value) throws ValidationException { 24 | 25 | Set> violations = new HashSet>(); 26 | violations = validator.validate(value); 27 | if(!violations.isEmpty()) { 28 | throw new ValidationException("Validation failed for " + value + ": " + 29 | violationsToString(violations)); 30 | } 31 | } 32 | 33 | private String violationsToString(Set> violations) { 34 | 35 | StringBuilder violationMessage = new StringBuilder(); 36 | 37 | for (ConstraintViolation violation: violations) { 38 | violationMessage.append(violation.getMessage() + "|"); 39 | } 40 | 41 | return violationMessage.toString(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/common/aop/ObscenityFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 3, 2011 3 | */ 4 | package com.apress.prospring3.springblog.common.aop; 5 | 6 | /** 7 | * @author Clarence 8 | * 9 | */ 10 | public interface ObscenityFilter { 11 | 12 | public boolean containsObscenities(String data); 13 | 14 | public String obfuscateObscenities(String data); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/common/aop/ObscenityFilterAdvice.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 3, 2011 3 | */ 4 | package com.apress.prospring3.springblog.common.aop; 5 | 6 | import org.aspectj.lang.JoinPoint; 7 | import org.aspectj.lang.annotation.Aspect; 8 | import org.aspectj.lang.annotation.Before; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Configurable; 11 | import org.springframework.stereotype.Component; 12 | 13 | import com.apress.prospring3.springblog.domain.BlogPosting; 14 | 15 | /** 16 | * @author Clarence 17 | * 18 | */ 19 | @Component 20 | @Configurable 21 | @Aspect 22 | public class ObscenityFilterAdvice { 23 | 24 | @Autowired 25 | private ObscenityFilter obscenityFilter; 26 | 27 | public void setObscenityFilter(ObscenityFilter obscenityFilter) { 28 | this.obscenityFilter = obscenityFilter; 29 | } 30 | 31 | @Before("execution(* com.apress.prospring3.springblog.service..*(..))") 32 | public void filterObscenities(JoinPoint joinPoint) 33 | throws Throwable { 34 | Object[] args = joinPoint.getArgs(); 35 | for (int x = 0; x < args.length; x++) { 36 | if (args[x] instanceof BlogPosting) { 37 | BlogPosting arg = (BlogPosting) args[x]; 38 | if (obscenityFilter.containsObscenities(arg.getBody())) { 39 | arg.setBody(obscenityFilter.obfuscateObscenities(arg.getBody())); 40 | } 41 | if (obscenityFilter.containsObscenities(arg.getSubject())) { 42 | arg.setSubject(obscenityFilter 43 | .obfuscateObscenities(arg.getSubject())); 44 | } 45 | } 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/Attachment.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 28, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import static javax.persistence.GenerationType.IDENTITY; 7 | 8 | import java.io.Serializable; 9 | 10 | import javax.persistence.Basic; 11 | import javax.persistence.Column; 12 | import javax.persistence.FetchType; 13 | import javax.persistence.GeneratedValue; 14 | import javax.persistence.Id; 15 | import javax.persistence.Lob; 16 | import javax.persistence.MappedSuperclass; 17 | 18 | /** 19 | * @author Clarence 20 | * 21 | */ 22 | @MappedSuperclass 23 | public class Attachment implements Serializable { 24 | 25 | private Long id; 26 | private String fileName; 27 | private String contentType; 28 | private byte[] fileData; 29 | 30 | @Id 31 | @GeneratedValue(strategy = IDENTITY) 32 | @Column(name = "ID") 33 | public Long getId() { 34 | return this.id; 35 | } 36 | 37 | public void setId(Long id) { 38 | this.id = id; 39 | } 40 | 41 | @Column(name = "FILE_NAME") 42 | public String getFileName() { 43 | return this.fileName; 44 | } 45 | 46 | public void setFileName(String fileName) { 47 | this.fileName = fileName; 48 | } 49 | 50 | @Column(name = "CONTENT_TYPE") 51 | public String getContentType() { 52 | return this.contentType; 53 | } 54 | 55 | public void setContentType(String contentType) { 56 | this.contentType = contentType; 57 | } 58 | 59 | @Lob 60 | @Basic(fetch=FetchType.LAZY) 61 | @Column(name = "FILE_DATA") 62 | public byte[] getFileData() { 63 | return this.fileData; 64 | } 65 | 66 | public void setFileData(byte[] fileData) { 67 | this.fileData = fileData; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/BlogPosting.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Nov 1, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import org.joda.time.DateTime; 7 | 8 | /** 9 | * @author Clarence 10 | * 11 | */ 12 | public interface BlogPosting { 13 | 14 | public String getBody(); 15 | public void setBody(String body); 16 | 17 | public DateTime getPostDate(); 18 | public void setPostDate(DateTime postDate); 19 | 20 | public String getSubject(); 21 | public void setSubject(String subject); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/Category.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import java.io.Serializable; 7 | import java.util.HashSet; 8 | import java.util.Set; 9 | 10 | import javax.persistence.Column; 11 | import javax.persistence.Entity; 12 | import javax.persistence.FetchType; 13 | import javax.persistence.Id; 14 | import javax.persistence.JoinColumn; 15 | import javax.persistence.ManyToOne; 16 | import javax.persistence.OneToMany; 17 | import javax.persistence.Table; 18 | 19 | import com.fasterxml.jackson.annotation.JsonIgnore; 20 | 21 | /** 22 | * @author Clarence 23 | * 24 | */ 25 | @Entity 26 | @Table(name = "category") 27 | public class Category implements Serializable { 28 | 29 | private String categoryId; 30 | private Category parentCategory; 31 | private Set subCategories = new HashSet(); 32 | 33 | public Category() { 34 | } 35 | 36 | public Category(String categoryId) { 37 | this.categoryId = categoryId; 38 | } 39 | 40 | public Category(String categoryId, Category parentCategory, 41 | Set subCategories) { 42 | this.categoryId = categoryId; 43 | this.parentCategory = parentCategory; 44 | this.subCategories = subCategories; 45 | } 46 | 47 | @Id 48 | @Column(name = "CATEGORY_ID") 49 | public String getCategoryId() { 50 | return this.categoryId; 51 | } 52 | 53 | public void setCategoryId(String categoryId) { 54 | this.categoryId = categoryId; 55 | } 56 | 57 | @JsonIgnore 58 | @ManyToOne(fetch = FetchType.LAZY) 59 | @JoinColumn(name = "PARENT_CATEGORY_ID") 60 | public Category getParentCategory() { 61 | return this.parentCategory; 62 | } 63 | 64 | public void setParentCategory(Category parentCategory) { 65 | this.parentCategory = parentCategory; 66 | } 67 | 68 | @JsonIgnore 69 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "parentCategory") 70 | public Set getSubCategories() { 71 | return this.subCategories; 72 | } 73 | 74 | public void setSubCategories(Set subCategories) { 75 | this.subCategories = subCategories; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/CommentAttachment.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 28, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import javax.persistence.Entity; 7 | import javax.persistence.FetchType; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | /** 13 | * @author Clarence 14 | * 15 | */ 16 | @Entity 17 | @Table(name="COMMENT_ATTACHMENT_DETAIL") 18 | public class CommentAttachment extends Attachment { 19 | 20 | private Comment comment; 21 | 22 | @ManyToOne(fetch = FetchType.LAZY) 23 | @JoinColumn(name = "COMMENT_ID") 24 | public Comment getComment() { 25 | return comment; 26 | } 27 | 28 | public void setComment(Comment comment) { 29 | this.comment = comment; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/Entries.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 12, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Clarence 10 | * 11 | */ 12 | public class Entries { 13 | 14 | private List entries; 15 | 16 | public Entries() { 17 | } 18 | 19 | public Entries(List entries) { 20 | this.entries = entries; 21 | } 22 | 23 | public List getEntries() { 24 | return entries; 25 | } 26 | 27 | public void setEntries(List entries) { 28 | this.entries = entries; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/EntryAttachment.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 28, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import javax.persistence.Entity; 7 | import javax.persistence.FetchType; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | /** 13 | * @author Clarence 14 | * 15 | */ 16 | @Entity 17 | @Table(name="ENTRY_ATTACHMENT_DETAIL") 18 | public class EntryAttachment extends Attachment { 19 | 20 | private Entry entry; 21 | 22 | @ManyToOne(fetch = FetchType.LAZY) 23 | @JoinColumn(name = "ENTRY_ID") 24 | public Entry getEntry() { 25 | return entry; 26 | } 27 | 28 | public void setEntry(Entry entry) { 29 | this.entry = entry; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/EntryRating.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import static javax.persistence.GenerationType.IDENTITY; 7 | 8 | import java.io.Serializable; 9 | 10 | import javax.persistence.Column; 11 | import javax.persistence.Entity; 12 | import javax.persistence.FetchType; 13 | import javax.persistence.GeneratedValue; 14 | import javax.persistence.Id; 15 | import javax.persistence.JoinColumn; 16 | import javax.persistence.ManyToOne; 17 | import javax.persistence.Table; 18 | 19 | /** 20 | * @author Clarence 21 | * 22 | */ 23 | @Entity 24 | @Table(name = "entry_rating") 25 | public class EntryRating implements Serializable { 26 | 27 | private Long id; 28 | private Entry entry; 29 | private int rating; 30 | private String rateBy; 31 | 32 | public EntryRating() { 33 | } 34 | 35 | public EntryRating(Entry entry, int rating, String rateBy) { 36 | this.entry = entry; 37 | this.rating = rating; 38 | this.rateBy = rateBy; 39 | } 40 | 41 | @Id 42 | @GeneratedValue(strategy = IDENTITY) 43 | @Column(name = "ID") 44 | public Long getId() { 45 | return this.id; 46 | } 47 | 48 | public void setId(Long id) { 49 | this.id = id; 50 | } 51 | 52 | @ManyToOne(fetch = FetchType.LAZY) 53 | @JoinColumn(name = "ENTRY_ID") 54 | public Entry getEntry() { 55 | return this.entry; 56 | } 57 | 58 | public void setEntry(Entry entry) { 59 | this.entry = entry; 60 | } 61 | 62 | @Column(name = "RATING") 63 | public int getRating() { 64 | return this.rating; 65 | } 66 | 67 | public void setRating(int rating) { 68 | this.rating = rating; 69 | } 70 | 71 | @Column(name = "RATE_BY") 72 | public String getRateBy() { 73 | return this.rateBy; 74 | } 75 | 76 | public void setRateBy(String rateBy) { 77 | this.rateBy = rateBy; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/Role.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import java.io.Serializable; 7 | import java.util.HashSet; 8 | import java.util.Set; 9 | 10 | import javax.persistence.Column; 11 | import javax.persistence.Entity; 12 | import javax.persistence.FetchType; 13 | import javax.persistence.Id; 14 | import javax.persistence.ManyToMany; 15 | import javax.persistence.Table; 16 | 17 | /** 18 | * @author Clarence 19 | * 20 | */ 21 | @Entity 22 | @Table(name = "role") 23 | public class Role implements Serializable { 24 | 25 | private String roleId; 26 | private String description; 27 | private Set appUsers = new HashSet(0); 28 | 29 | public Role() { 30 | } 31 | 32 | public Role(String roleId) { 33 | this.roleId = roleId; 34 | } 35 | 36 | public Role(String roleId, String description, Set appUsers) { 37 | this.roleId = roleId; 38 | this.description = description; 39 | this.appUsers = appUsers; 40 | } 41 | 42 | @Id 43 | @Column(name = "ROLE_ID") 44 | public String getRoleId() { 45 | return this.roleId; 46 | } 47 | 48 | public void setRoleId(String roleId) { 49 | this.roleId = roleId; 50 | } 51 | 52 | @Column(name = "DESCRIPTION") 53 | public String getDescription() { 54 | return this.description; 55 | } 56 | 57 | public void setDescription(String description) { 58 | this.description = description; 59 | } 60 | 61 | @ManyToMany(fetch = FetchType.LAZY, mappedBy = "roles") 62 | public Set getAppUsers() { 63 | return this.appUsers; 64 | } 65 | 66 | public void setAppUsers(Set appUsers) { 67 | this.appUsers = appUsers; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/SearchCriteria.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 19, 2011 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import org.joda.time.DateTime; 7 | 8 | /** 9 | * @author Clarence 10 | * 11 | */ 12 | public class SearchCriteria { 13 | 14 | private String subject; 15 | 16 | private String categoryId; 17 | 18 | private DateTime fromPostDate; 19 | 20 | private DateTime toPostDate; 21 | 22 | public String getSubject() { 23 | return subject; 24 | } 25 | 26 | public void setSubject(String subject) { 27 | this.subject = subject; 28 | } 29 | 30 | public String getCategoryId() { 31 | return categoryId; 32 | } 33 | 34 | public void setCategoryId(String categoryId) { 35 | this.categoryId = categoryId; 36 | } 37 | 38 | public DateTime getFromPostDate() { 39 | return fromPostDate; 40 | } 41 | 42 | public void setFromPostDate(DateTime fromPostDate) { 43 | this.fromPostDate = fromPostDate; 44 | } 45 | 46 | public DateTime getToPostDate() { 47 | return toPostDate; 48 | } 49 | 50 | public void setToPostDate(DateTime toPostDate) { 51 | this.toPostDate = toPostDate; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/domain/SearchCriteriaPage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.domain; 5 | 6 | import org.joda.time.DateTime; 7 | 8 | /** 9 | * @author Clarence 10 | * 11 | */ 12 | public class SearchCriteriaPage { 13 | 14 | private String subject; 15 | 16 | private String categoryId; 17 | 18 | private DateTime fromPostDate; 19 | 20 | private DateTime toPostDate; 21 | 22 | private int offset; 23 | 24 | private int pageSize; 25 | 26 | public String getSubject() { 27 | return subject; 28 | } 29 | 30 | public void setSubject(String subject) { 31 | this.subject = subject; 32 | } 33 | 34 | public String getCategoryId() { 35 | return categoryId; 36 | } 37 | 38 | public void setCategoryId(String categoryId) { 39 | this.categoryId = categoryId; 40 | } 41 | 42 | public DateTime getFromPostDate() { 43 | return fromPostDate; 44 | } 45 | 46 | public void setFromPostDate(DateTime fromPostDate) { 47 | this.fromPostDate = fromPostDate; 48 | } 49 | 50 | public DateTime getToPostDate() { 51 | return toPostDate; 52 | } 53 | 54 | public void setToPostDate(DateTime toPostDate) { 55 | this.toPostDate = toPostDate; 56 | } 57 | 58 | public int getOffset() { 59 | return offset; 60 | } 61 | 62 | public void setOffset(int offset) { 63 | this.offset = offset; 64 | } 65 | 66 | public int getPageSize() { 67 | return pageSize; 68 | } 69 | 70 | public void setPageSize(int pageSize) { 71 | this.pageSize = pageSize; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/mybatis/type/DateTimeTypeHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 27, 2011 3 | */ 4 | package com.apress.prospring3.springblog.mybatis.type; 5 | 6 | import java.sql.CallableStatement; 7 | import java.sql.PreparedStatement; 8 | import java.sql.ResultSet; 9 | import java.sql.SQLException; 10 | 11 | import org.apache.ibatis.type.BaseTypeHandler; 12 | import org.apache.ibatis.type.JdbcType; 13 | import org.apache.ibatis.type.MappedTypes; 14 | import org.joda.time.DateTime; 15 | 16 | /** 17 | * @author Clarence 18 | * 19 | */ 20 | @MappedTypes(value=DateTime.class) 21 | public class DateTimeTypeHandler extends BaseTypeHandler { 22 | 23 | public void setNonNullParameter(PreparedStatement ps, int i, 24 | DateTime parameter, JdbcType jdbcType) throws SQLException { 25 | 26 | ps.setTimestamp(i, new java.sql.Timestamp((parameter).getMillis())); 27 | 28 | } 29 | 30 | public DateTime getNullableResult(ResultSet rs, String columnName) 31 | throws SQLException { 32 | java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName); 33 | if (sqlTimestamp != null) { 34 | return new DateTime(sqlTimestamp.getTime()); 35 | } 36 | return null; 37 | } 38 | 39 | @Override 40 | public DateTime getNullableResult(ResultSet rs, int index) throws SQLException { 41 | java.sql.Timestamp sqlTimestamp = rs.getTimestamp(index); 42 | if (sqlTimestamp != null) { 43 | return new DateTime(sqlTimestamp.getTime()); 44 | } 45 | return null; 46 | } 47 | 48 | public DateTime getNullableResult(CallableStatement cs, int columnIndex) 49 | throws SQLException { 50 | java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex); 51 | if (sqlTimestamp != null) { 52 | return new DateTime(sqlTimestamp.getTime()); 53 | } 54 | return null; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/persistence/CategoryMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.persistence; 5 | 6 | import java.util.List; 7 | 8 | import com.apress.prospring3.springblog.domain.Category; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public interface CategoryMapper { 15 | 16 | List findAll(); 17 | 18 | List findAllParentCategory(); 19 | 20 | List findAllSubCategory(String parentCategoryId); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/persistence/EntryMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 27, 2011 3 | */ 4 | package com.apress.prospring3.springblog.persistence; 5 | 6 | import java.util.List; 7 | 8 | import com.apress.prospring3.springblog.domain.Entry; 9 | import com.apress.prospring3.springblog.domain.SearchCriteriaPage; 10 | 11 | /** 12 | * @author Clarence 13 | * 14 | */ 15 | public interface EntryMapper { 16 | 17 | List findAll(); 18 | 19 | Entry findById(Long id); 20 | 21 | List findByCategoryId(String categoryId); 22 | 23 | List findEntryByCriteria(SearchCriteriaPage searchCriteriaPage); 24 | 25 | int findEntryCountByCriteria(SearchCriteriaPage searchCriteriaPage); 26 | 27 | void insertEntry(Entry entry); 28 | 29 | void updateEntry(Entry entry); 30 | 31 | void deleteEntry(Long id); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/persistence/UserMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.persistence; 5 | 6 | import com.apress.prospring3.springblog.domain.AppUser; 7 | 8 | /** 9 | * @author Clarence 10 | * 11 | */ 12 | public interface UserMapper { 13 | 14 | AppUser findByUserName(String userName); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/repository/CategoryRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 13, 2011 3 | */ 4 | package com.apress.prospring3.springblog.repository; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.data.repository.CrudRepository; 10 | import org.springframework.data.repository.query.Param; 11 | 12 | import com.apress.prospring3.springblog.domain.Category; 13 | 14 | /** 15 | * @author Clarence 16 | * 17 | */ 18 | public interface CategoryRepository extends CrudRepository { 19 | 20 | @Query("select c from Category c where c.parentCategory is null") 21 | public List findAllParentCategory(); 22 | 23 | @Query("select c from Category c where c.parentCategory.categoryId = :parentCategoryId") 24 | List findAllSubCategory(@Param("parentCategoryId") String parentCategoryId); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/repository/CommentAttachmentRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 28, 2011 3 | */ 4 | package com.apress.prospring3.springblog.repository; 5 | 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | import com.apress.prospring3.springblog.domain.CommentAttachment; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public interface CommentAttachmentRepository extends CrudRepository { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/repository/CommentRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 12, 2011 3 | */ 4 | package com.apress.prospring3.springblog.repository; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.data.repository.CrudRepository; 10 | import org.springframework.data.repository.query.Param; 11 | 12 | import com.apress.prospring3.springblog.domain.Comment; 13 | 14 | /** 15 | * @author Clarence 16 | * 17 | */ 18 | public interface CommentRepository extends CrudRepository { 19 | 20 | @Query("select c from Comment c where c.entry.id = :entryId") 21 | public List findByEntryId(@Param("entryId") Long entryId); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/repository/EntryAttachmentRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 15, 2011 3 | */ 4 | package com.apress.prospring3.springblog.repository; 5 | 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | import com.apress.prospring3.springblog.domain.EntryAttachment; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public interface EntryAttachmentRepository extends CrudRepository { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/repository/EntryRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog.repository; 5 | 6 | import java.util.List; 7 | 8 | import org.joda.time.DateTime; 9 | import org.springframework.data.domain.Page; 10 | import org.springframework.data.domain.Pageable; 11 | import org.springframework.data.jpa.repository.Query; 12 | import org.springframework.data.repository.PagingAndSortingRepository; 13 | import org.springframework.data.repository.query.Param; 14 | 15 | import com.apress.prospring3.springblog.domain.Entry; 16 | 17 | /** 18 | * @author Clarence 19 | * 20 | */ 21 | public interface EntryRepository extends PagingAndSortingRepository { 22 | 23 | public List findByCategoryId(String categoryId); 24 | 25 | @Query("select e from Entry e where e.subject like :subject and e.categoryId like :categoryId and e.postDate between :fromPostDate and :toPostDate") 26 | public Page findEntryByCriteria(@Param("subject") String subject, 27 | @Param("categoryId") String categoryId, 28 | @Param("fromPostDate") DateTime fromPostDate, 29 | @Param("toPostDate") DateTime toPostDate, 30 | Pageable pageable); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 20, 2011 3 | */ 4 | package com.apress.prospring3.springblog.repository; 5 | 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | import com.apress.prospring3.springblog.domain.AppUser; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public interface UserRepository extends CrudRepository { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/CategoryService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 13, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | import java.util.List; 7 | 8 | import com.apress.prospring3.springblog.domain.Category; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public interface CategoryService { 15 | 16 | public List findAll(); 17 | 18 | public List findAllParentCategory(); 19 | 20 | public List findAllSubCategory(String parentCategoryId); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/CommentAttachmentService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 28, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | import com.apress.prospring3.springblog.domain.CommentAttachment; 7 | 8 | /** 9 | * @author Clarence 10 | * 11 | */ 12 | public interface CommentAttachmentService { 13 | 14 | public CommentAttachment findById(Long id); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/CommentService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 12, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | import java.util.List; 7 | 8 | import com.apress.prospring3.springblog.domain.Comment; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public interface CommentService { 15 | 16 | public Comment findById(Long id); 17 | 18 | public List findByEntryId(Long entryId); 19 | 20 | public Comment save(Comment comment); 21 | 22 | public void delete(Comment comment); 23 | 24 | public List findReplyToByEntryId(Long entryId); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/EntryAttachmentService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 15, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | import com.apress.prospring3.springblog.domain.EntryAttachment; 7 | 8 | /** 9 | * @author Clarence 10 | * 11 | */ 12 | public interface EntryAttachmentService { 13 | 14 | public EntryAttachment findById(Long id); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/EntryAuditService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 24, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | import java.util.List; 7 | 8 | import com.apress.prospring3.springblog.domain.Entry; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public interface EntryAuditService { 15 | 16 | /** 17 | * Retrieve all audit for an entry base on id 18 | * @param id 19 | * @return 20 | */ 21 | public List findAuditById(Long id); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/EntryService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.data.domain.Page; 9 | import org.springframework.data.domain.Pageable; 10 | 11 | import com.apress.prospring3.springblog.domain.Entry; 12 | import com.apress.prospring3.springblog.domain.SearchCriteria; 13 | 14 | /** 15 | * @author Clarence 16 | * 17 | */ 18 | public interface EntryService { 19 | 20 | public List findAll(); 21 | 22 | public Entry findById(Long id); 23 | 24 | public List findByCategoryId(String categoryId); 25 | 26 | public Entry save(Entry entry); 27 | 28 | public void delete(Entry entry); 29 | 30 | public Page findAllByPage(Pageable pageable); 31 | 32 | public Page findEntryByCriteria(SearchCriteria searchCriteria, Pageable pageable); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/HelloService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | /** 7 | * @author Clarence 8 | * 9 | */ 10 | public interface HelloService { 11 | 12 | public String sayHello(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/HousekeepingService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 8, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | /** 7 | * @author Clarence 8 | * 9 | */ 10 | public interface HousekeepingService { 11 | 12 | /** 13 | * Scheduled job to purge audit records. 14 | */ 15 | public void auditPurgeJob(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/UserService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 20, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service; 5 | 6 | import com.apress.prospring3.springblog.domain.AppUser; 7 | 8 | /** 9 | * @author Clarence 10 | * 11 | */ 12 | public interface UserService { 13 | 14 | public AppUser findByUserName(String userName); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/jpa/CategoryServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 13, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Repository; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.apress.prospring3.springblog.domain.Category; 14 | import com.apress.prospring3.springblog.repository.CategoryRepository; 15 | import com.apress.prospring3.springblog.service.CategoryService; 16 | import com.google.common.collect.Lists; 17 | 18 | /** 19 | * @author Clarence 20 | * 21 | */ 22 | @Service("categoryService") 23 | @Repository 24 | @Transactional 25 | public class CategoryServiceImpl implements CategoryService { 26 | 27 | @Autowired 28 | private CategoryRepository categoryRepository; 29 | 30 | @Override 31 | @Transactional(readOnly=true) 32 | public List findAll() { 33 | return Lists.newArrayList(categoryRepository.findAll()); 34 | } 35 | 36 | @Override 37 | @Transactional(readOnly=true) 38 | public List findAllParentCategory() { 39 | return categoryRepository.findAllParentCategory(); 40 | } 41 | 42 | @Override 43 | @Transactional(readOnly=true) 44 | public List findAllSubCategory(String parentCategoryId) { 45 | return categoryRepository.findAllSubCategory(parentCategoryId); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/jpa/CommentAttachmentServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 28, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Repository; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.apress.prospring3.springblog.domain.CommentAttachment; 12 | import com.apress.prospring3.springblog.repository.CommentAttachmentRepository; 13 | import com.apress.prospring3.springblog.service.CommentAttachmentService; 14 | 15 | /** 16 | * @author Clarence 17 | * 18 | */ 19 | @Service("commentAttachmentService") 20 | @Repository 21 | @Transactional 22 | public class CommentAttachmentServiceImpl implements CommentAttachmentService { 23 | 24 | @Autowired 25 | private CommentAttachmentRepository attachmentRepository; 26 | 27 | @Override 28 | @Transactional(readOnly=true) 29 | public CommentAttachment findById(Long id) { 30 | return attachmentRepository.findOne(id); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/jpa/CommentServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 12, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import java.util.List; 7 | 8 | import javax.persistence.EntityManager; 9 | import javax.persistence.PersistenceContext; 10 | import javax.persistence.TypedQuery; 11 | 12 | import org.slf4j.Logger; 13 | import org.slf4j.LoggerFactory; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.stereotype.Repository; 16 | import org.springframework.stereotype.Service; 17 | import org.springframework.transaction.annotation.Transactional; 18 | 19 | import com.apress.prospring3.springblog.domain.Comment; 20 | import com.apress.prospring3.springblog.repository.CommentRepository; 21 | import com.apress.prospring3.springblog.service.CommentService; 22 | 23 | /** 24 | * @author Clarence 25 | * 26 | */ 27 | @Service("commentService") 28 | @Repository 29 | @Transactional 30 | public class CommentServiceImpl implements CommentService { 31 | 32 | final Logger logger = LoggerFactory.getLogger(CommentServiceImpl.class); 33 | 34 | @PersistenceContext 35 | private EntityManager em; 36 | 37 | @Autowired 38 | private CommentRepository commentResository; 39 | 40 | @Override 41 | @Transactional(readOnly=true) 42 | public Comment findById(Long id) { 43 | return commentResository.findOne(id); 44 | } 45 | 46 | @Override 47 | @Transactional(readOnly=true) 48 | public List findByEntryId(Long entryId) { 49 | logger.info("Finding comments for entry with id {}", entryId); 50 | return commentResository.findByEntryId(entryId); 51 | } 52 | 53 | @Override 54 | public List findReplyToByEntryId(Long entryId) { 55 | TypedQuery query = em.createNamedQuery("Comment.findReplyToByEntryId", String.class); 56 | query.setParameter("entryId", entryId); 57 | return query.getResultList(); 58 | } 59 | 60 | @Override 61 | public Comment save(Comment comment) { 62 | return commentResository.save(comment); 63 | } 64 | 65 | @Override 66 | public void delete(Comment comment) { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/jpa/EntryAttachmentServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 15, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Repository; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.apress.prospring3.springblog.domain.EntryAttachment; 12 | import com.apress.prospring3.springblog.repository.EntryAttachmentRepository; 13 | import com.apress.prospring3.springblog.service.EntryAttachmentService; 14 | 15 | /** 16 | * @author Clarence 17 | * 18 | */ 19 | @Service("entryAttachmentService") 20 | @Repository 21 | @Transactional 22 | public class EntryAttachmentServiceImpl implements EntryAttachmentService { 23 | 24 | @Autowired 25 | private EntryAttachmentRepository attachmentRepository; 26 | 27 | @Override 28 | @Transactional(readOnly=true) 29 | public EntryAttachment findById(Long id) { 30 | return attachmentRepository.findOne(id); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/jpa/EntryAuditServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 24, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import javax.persistence.EntityManager; 10 | import javax.persistence.PersistenceContext; 11 | 12 | import org.hibernate.envers.AuditReader; 13 | import org.hibernate.envers.AuditReaderFactory; 14 | import org.springframework.stereotype.Repository; 15 | import org.springframework.stereotype.Service; 16 | import org.springframework.transaction.annotation.Transactional; 17 | 18 | import com.apress.prospring3.springblog.domain.Entry; 19 | import com.apress.prospring3.springblog.service.EntryAuditService; 20 | import com.google.common.collect.Lists; 21 | 22 | /** 23 | * @author Clarence 24 | * 25 | */ 26 | @Service("entryAuditService") 27 | @Repository 28 | @Transactional 29 | public class EntryAuditServiceImpl implements EntryAuditService { 30 | 31 | @PersistenceContext 32 | private EntityManager entityManager; 33 | 34 | @Transactional(readOnly=true) 35 | public List findAuditById(Long id) { 36 | AuditReader auditReader = AuditReaderFactory.get(entityManager); 37 | List revisions = auditReader.getRevisions(Entry.class, id); 38 | 39 | revisions = Lists.reverse(revisions); 40 | 41 | List entries = new ArrayList(); 42 | Entry entry; 43 | for (Number revision: revisions) { 44 | entry = auditReader.find(Entry.class, id, revision); 45 | entries.add(entry); 46 | } 47 | return entries; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/jpa/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.apress.prospring3.springblog.service.HelloService; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | @Service("helloService") 15 | public class HelloServiceImpl implements HelloService { 16 | 17 | /* (non-Javadoc) 18 | * @see com.apress.prospring3.springblog.service.HelloService#sayHello() 19 | */ 20 | @Override 21 | public String sayHello() { 22 | return "Hello JPA Imlementation!"; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/jpa/HousekeepingServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 8, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.scheduling.annotation.Scheduled; 8 | import org.springframework.stereotype.Repository; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import com.apress.prospring3.springblog.service.HousekeepingService; 13 | 14 | /** 15 | * @author Clarence 16 | * 17 | */ 18 | @Service("housekeepingService") 19 | @Repository 20 | @Transactional 21 | public class HousekeepingServiceImpl implements HousekeepingService { 22 | 23 | @Value("${audit.record.history.days}") 24 | private int auditHistoryDays; 25 | 26 | @Scheduled(cron="0 0 0 * * ?") 27 | public void auditPurgeJob() { 28 | // Purge audit record logic goes here 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/jpa/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 20, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Repository; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.apress.prospring3.springblog.domain.AppUser; 12 | import com.apress.prospring3.springblog.repository.UserRepository; 13 | import com.apress.prospring3.springblog.service.UserService; 14 | 15 | /** 16 | * @author Clarence 17 | * 18 | */ 19 | @Service("userService") 20 | @Repository 21 | @Transactional 22 | public class UserServiceImpl implements UserService { 23 | 24 | @Autowired 25 | private UserRepository userRepository; 26 | 27 | @Override 28 | @Transactional(readOnly=true) 29 | public AppUser findByUserName(String userName) { 30 | return userRepository.findOne(userName); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/mybatis/CategoryServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service.mybatis; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Repository; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.apress.prospring3.springblog.domain.Category; 14 | import com.apress.prospring3.springblog.persistence.CategoryMapper; 15 | import com.apress.prospring3.springblog.service.CategoryService; 16 | 17 | /** 18 | * @author Clarence 19 | * 20 | */ 21 | @Service("categoryService") 22 | @Repository 23 | @Transactional 24 | public class CategoryServiceImpl implements CategoryService { 25 | 26 | @Autowired 27 | private CategoryMapper categoryMapper; 28 | 29 | @Override 30 | @Transactional(readOnly=true) 31 | public List findAll() { 32 | return categoryMapper.findAll(); 33 | } 34 | 35 | @Override 36 | @Transactional(readOnly=true) 37 | public List findAllParentCategory() { 38 | return categoryMapper.findAllParentCategory(); 39 | } 40 | 41 | @Override 42 | @Transactional(readOnly=true) 43 | public List findAllSubCategory(String parentCategoryId) { 44 | return categoryMapper.findAllSubCategory(parentCategoryId); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/mybatis/CommentAttachmentServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service.mybatis; 5 | 6 | import org.springframework.stereotype.Repository; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.apress.prospring3.springblog.domain.CommentAttachment; 11 | import com.apress.prospring3.springblog.service.CommentAttachmentService; 12 | 13 | /** 14 | * @author Clarence 15 | * 16 | */ 17 | @Service("commentAttachmentService") 18 | @Repository 19 | @Transactional 20 | public class CommentAttachmentServiceImpl implements CommentAttachmentService { 21 | 22 | @Override 23 | @Transactional(readOnly=true) 24 | public CommentAttachment findById(Long id) { 25 | // TODO Auto-generated method stub 26 | return null; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/mybatis/CommentServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service.mybatis; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.stereotype.Repository; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import com.apress.prospring3.springblog.domain.Comment; 13 | import com.apress.prospring3.springblog.service.CommentService; 14 | 15 | /** 16 | * @author Clarence 17 | * 18 | */ 19 | @Service("commentService") 20 | @Repository 21 | @Transactional 22 | public class CommentServiceImpl implements CommentService { 23 | 24 | @Override 25 | @Transactional(readOnly=true) 26 | public Comment findById(Long id) { 27 | // TODO Auto-generated method stub 28 | return null; 29 | } 30 | 31 | @Override 32 | @Transactional(readOnly=true) 33 | public List findByEntryId(Long entryId) { 34 | // TODO Auto-generated method stub 35 | return null; 36 | } 37 | 38 | @Override 39 | public Comment save(Comment comment) { 40 | // TODO Auto-generated method stub 41 | return null; 42 | } 43 | 44 | @Override 45 | public void delete(Comment comment) { 46 | // TODO Auto-generated method stub 47 | 48 | } 49 | 50 | @Override 51 | @Transactional(readOnly=true) 52 | public List findReplyToByEntryId(Long entryId) { 53 | // TODO Auto-generated method stub 54 | return null; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/mybatis/EntryAttachmentServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service.mybatis; 5 | 6 | import org.springframework.stereotype.Repository; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.apress.prospring3.springblog.domain.EntryAttachment; 11 | import com.apress.prospring3.springblog.service.EntryAttachmentService; 12 | 13 | /** 14 | * @author Clarence 15 | * 16 | */ 17 | @Service("entryAttachmentService") 18 | @Repository 19 | @Transactional 20 | public class EntryAttachmentServiceImpl implements EntryAttachmentService { 21 | 22 | @Override 23 | @Transactional(readOnly=true) 24 | public EntryAttachment findById(Long id) { 25 | // TODO Auto-generated method stub 26 | return null; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/mybatis/EntryAuditServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service.mybatis; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.stereotype.Repository; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import com.apress.prospring3.springblog.domain.Entry; 13 | import com.apress.prospring3.springblog.service.EntryAuditService; 14 | 15 | /** 16 | * @author Clarence 17 | * 18 | */ 19 | @Service("entryAuditService") 20 | @Repository 21 | @Transactional 22 | public class EntryAuditServiceImpl implements EntryAuditService { 23 | 24 | @Override 25 | @Transactional(readOnly=true) 26 | public List findAuditById(Long id) { 27 | // TODO Auto-generated method stub 28 | return null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/mybatis/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 21, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.mybatis; 5 | 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.apress.prospring3.springblog.service.HelloService; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | @Service("helloService") 15 | public class HelloServiceImpl implements HelloService { 16 | 17 | /* (non-Javadoc) 18 | * @see com.apress.prospring3.springblog.service.HelloService#sayHello() 19 | */ 20 | @Override 21 | public String sayHello() { 22 | return "Hello MyBatis Imlementation!"; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/mybatis/HousekeepingServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service.mybatis; 5 | 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.scheduling.annotation.Scheduled; 8 | import org.springframework.stereotype.Repository; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import com.apress.prospring3.springblog.service.HousekeepingService; 13 | 14 | /** 15 | * @author Clarence 16 | * 17 | */ 18 | @Service("housekeepingService") 19 | @Repository 20 | @Transactional 21 | public class HousekeepingServiceImpl implements HousekeepingService { 22 | 23 | @Value("${audit.record.history.days}") 24 | private int auditHistoryDays; 25 | 26 | @Scheduled(cron="0 0 0 * * ?") 27 | public void auditPurgeJob() { 28 | // Purge audit record logic goes here 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/service/mybatis/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 25, 2012 3 | */ 4 | package com.apress.prospring3.springblog.service.mybatis; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Repository; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.apress.prospring3.springblog.domain.AppUser; 12 | import com.apress.prospring3.springblog.persistence.UserMapper; 13 | import com.apress.prospring3.springblog.service.UserService; 14 | 15 | /** 16 | * @author Clarence 17 | * 18 | */ 19 | @Service("userService") 20 | @Repository 21 | @Transactional 22 | public class UserServiceImpl implements UserService { 23 | 24 | @Autowired 25 | private UserMapper userMapper; 26 | 27 | @Override 28 | @Transactional(readOnly=true) 29 | public AppUser findByUserName(String userName) { 30 | return userMapper.findByUserName(userName); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/blogapp/controller/AuditController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 24, 2012 3 | */ 4 | package com.apress.prospring3.springblog.web.blogapp.controller; 5 | 6 | import java.util.List; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.PathVariable; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import com.apress.prospring3.springblog.domain.Entry; 18 | import com.apress.prospring3.springblog.service.EntryAuditService; 19 | import com.apress.prospring3.springblog.web.form.EntryGrid; 20 | 21 | /** 22 | * @author Clarence 23 | * 24 | */ 25 | @RequestMapping("/audit") 26 | @Controller 27 | public class AuditController { 28 | 29 | private static final Logger logger = LoggerFactory.getLogger(AuditController.class); 30 | 31 | @Autowired 32 | private EntryAuditService entryAuditService; 33 | 34 | @RequestMapping(value = "/blog/{id}", method = RequestMethod.GET) 35 | @ResponseBody 36 | public EntryGrid listEntryAudit(@PathVariable("id") Long id) { 37 | 38 | logger.info("Retrieving audit records for Entry with id: {}", id); 39 | 40 | List auditEntries = entryAuditService.findAuditById(id); 41 | 42 | // Construct the grid data that will return as JSON data 43 | EntryGrid entryGrid = new EntryGrid(); 44 | entryGrid.setCurrentPage(1); 45 | entryGrid.setTotalPages(1); 46 | entryGrid.setTotalRecords(auditEntries.size()); 47 | entryGrid.setEntryData(auditEntries); 48 | 49 | return entryGrid; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/blogapp/controller/SecurityController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Jan 24, 2012 3 | */ 4 | package com.apress.prospring3.springblog.web.blogapp.controller; 5 | 6 | import java.util.Locale; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.context.MessageSource; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.ui.Model; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | 16 | import com.apress.prospring3.springblog.web.form.Message; 17 | 18 | /** 19 | * @author Clarence 20 | * 21 | */ 22 | @RequestMapping("/security") 23 | @Controller 24 | public class SecurityController { 25 | 26 | final Logger logger = LoggerFactory.getLogger(SecurityController.class); 27 | 28 | @Autowired 29 | private MessageSource messageSource; 30 | 31 | @RequestMapping("/loginfail") 32 | public String loginFail(Model uiModel, Locale locale) { 33 | logger.info("Login failed detected"); 34 | uiModel.addAttribute("message", new Message("error", messageSource.getMessage("message_login_fail", new Object[]{}, locale))); 35 | return "blogs/list"; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/blogapp/controller/TempController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 18, 2011 3 | */ 4 | package com.apress.prospring3.springblog.web.blogapp.controller; 5 | 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | 11 | /** 12 | * @author Clarence 13 | * 14 | */ 15 | @RequestMapping("/temp") 16 | @Controller 17 | public class TempController { 18 | 19 | @RequestMapping(method = RequestMethod.GET) 20 | public String list(Model uiModel) { 21 | return "temp/index"; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring3.springblog.web.controller; 2 | 3 | import java.text.DateFormat; 4 | import java.util.Date; 5 | import java.util.Locale; 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.Model; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | 15 | import com.apress.prospring3.springblog.service.HelloService; 16 | 17 | /** 18 | * Handles requests for the application home page. 19 | */ 20 | @RequestMapping("/home") 21 | @Controller 22 | public class HomeController { 23 | 24 | private static final Logger logger = LoggerFactory.getLogger(HomeController.class); 25 | 26 | @Autowired 27 | private HelloService helloService; 28 | 29 | /** 30 | * Simply selects the home view to render by returning its name. 31 | */ 32 | @RequestMapping(value = "/", method = RequestMethod.GET) 33 | public String home(Locale locale, Model model) { 34 | logger.info("Welcome home! the client locale is "+ locale.toString()); 35 | logger.info("Hello service: "+ helloService.sayHello()); 36 | Date date = new Date(); 37 | DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); 38 | 39 | String formattedDate = dateFormat.format(date); 40 | 41 | model.addAttribute("serverTime", formattedDate ); 42 | 43 | return "home"; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/form/EntryGrid.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 18, 2011 3 | */ 4 | package com.apress.prospring3.springblog.web.form; 5 | 6 | import java.util.List; 7 | 8 | import com.apress.prospring3.springblog.domain.Entry; 9 | 10 | /** 11 | * @author Clarence 12 | * 13 | */ 14 | public class EntryGrid { 15 | 16 | private int totalPages; 17 | 18 | private int currentPage; 19 | 20 | private long totalRecords; 21 | 22 | private List entryData; 23 | 24 | public int getTotalPages() { 25 | return totalPages; 26 | } 27 | 28 | public void setTotalPages(int totalPages) { 29 | this.totalPages = totalPages; 30 | } 31 | 32 | public int getCurrentPage() { 33 | return currentPage; 34 | } 35 | 36 | public void setCurrentPage(int currentPage) { 37 | this.currentPage = currentPage; 38 | } 39 | 40 | public long getTotalRecords() { 41 | return totalRecords; 42 | } 43 | 44 | public void setTotalRecords(long totalRecords) { 45 | this.totalRecords = totalRecords; 46 | } 47 | 48 | public List getEntryData() { 49 | return entryData; 50 | } 51 | 52 | public void setEntryData(List entryData) { 53 | this.entryData = entryData; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/form/Message.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 15, 2011 3 | */ 4 | package com.apress.prospring3.springblog.web.form; 5 | 6 | /** 7 | * @author Clarence 8 | * 9 | */ 10 | public class Message { 11 | 12 | private String type; 13 | 14 | private String message; 15 | 16 | public Message() { 17 | } 18 | 19 | public Message(String type, String message) { 20 | this.type = type; 21 | this.message = message; 22 | } 23 | 24 | public String getType() { 25 | return type; 26 | } 27 | 28 | public void setType(String type) { 29 | this.type = type; 30 | } 31 | 32 | public String getMessage() { 33 | return message; 34 | } 35 | 36 | public void setMessage(String message) { 37 | this.message = message; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/form/UploadItem.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 15, 2011 3 | */ 4 | package com.apress.prospring3.springblog.web.form; 5 | 6 | 7 | /** 8 | * @author Clarence 9 | * 10 | */ 11 | public class UploadItem { 12 | 13 | private Long blogId; 14 | 15 | private Long commentId; 16 | 17 | private String uploadType; 18 | 19 | public Long getBlogId() { 20 | return blogId; 21 | } 22 | 23 | public void setBlogId(Long blogId) { 24 | this.blogId = blogId; 25 | } 26 | 27 | public Long getCommentId() { 28 | return commentId; 29 | } 30 | 31 | public void setCommentId(Long commentId) { 32 | this.commentId = commentId; 33 | } 34 | 35 | public String getUploadType() { 36 | return uploadType; 37 | } 38 | 39 | public void setUploadType(String uploadType) { 40 | this.uploadType = uploadType; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/restful/controller/BlogRestfulController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 12, 2011 3 | */ 4 | package com.apress.prospring3.springblog.web.restful.controller; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import com.apress.prospring3.springblog.domain.Entries; 15 | import com.apress.prospring3.springblog.service.EntryService; 16 | 17 | /** 18 | * @author Clarence 19 | * 20 | */ 21 | @Controller 22 | @RequestMapping(value="/blog") 23 | public class BlogRestfulController { 24 | 25 | final Logger logger = LoggerFactory.getLogger(BlogRestfulController.class); 26 | 27 | @Autowired 28 | private EntryService entryService; 29 | 30 | @RequestMapping(value = "/listdata", method = RequestMethod.GET) 31 | @ResponseBody 32 | public Entries listData() { 33 | return new Entries(entryService.findAll()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/web/util/UrlUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Dec 12, 2011 3 | */ 4 | package com.apress.prospring3.springblog.web.util; 5 | 6 | import java.io.UnsupportedEncodingException; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.web.util.UriUtils; 11 | import org.springframework.web.util.WebUtils; 12 | 13 | /** 14 | * @author Clarence 15 | * 16 | */ 17 | public class UrlUtil { 18 | 19 | public static String encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) { 20 | String enc = httpServletRequest.getCharacterEncoding(); 21 | if (enc == null) { 22 | enc = WebUtils.DEFAULT_CHARACTER_ENCODING; 23 | } 24 | try { 25 | pathSegment = UriUtils.encodePathSegment(pathSegment, enc); 26 | } 27 | catch (UnsupportedEncodingException uee) {} 28 | return pathSegment; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/apress/prospring3/springblog/xml/handler/DateTimeFieldHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Nov 29, 2011 3 | */ 4 | package com.apress.prospring3.springblog.xml.handler; 5 | 6 | import java.util.Properties; 7 | 8 | import org.exolab.castor.mapping.GeneralizedFieldHandler; 9 | import org.exolab.castor.mapping.ValidityException; 10 | import org.joda.time.DateTime; 11 | import org.joda.time.format.DateTimeFormat; 12 | import org.joda.time.format.DateTimeFormatter; 13 | 14 | 15 | /** 16 | * @author Clarence 17 | * 18 | */ 19 | public class DateTimeFieldHandler extends GeneralizedFieldHandler { 20 | 21 | private static String dateFormatPattern; 22 | 23 | public void setConfiguration(Properties config) throws ValidityException { 24 | dateFormatPattern = config.getProperty("date-format"); 25 | } 26 | 27 | public Object convertUponGet(Object value) { 28 | 29 | DateTime dateTime = (DateTime) value; 30 | 31 | return format(dateTime); 32 | } 33 | 34 | public Object convertUponSet(Object value) { 35 | 36 | String dateTimeString = (String) value; 37 | 38 | return parse(dateTimeString); 39 | } 40 | 41 | public Class getFieldType() { 42 | return DateTime.class; 43 | } 44 | 45 | protected static String format(final DateTime dateTime) { 46 | 47 | String dateTimeString = ""; 48 | 49 | if (dateTime != null) { 50 | DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern(dateFormatPattern); 51 | dateTimeString = dateTimeFormatter.print(dateTime); 52 | } 53 | 54 | return dateTimeString; 55 | 56 | } 57 | 58 | protected static DateTime parse(final String dateTimeString) { 59 | 60 | DateTime dateTime = new DateTime(); 61 | 62 | if (dateTimeString != null) { 63 | DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern(dateFormatPattern); 64 | dateTime = dateTimeFormatter.parseDateTime(dateTimeString); 65 | } 66 | 67 | return dateTime; 68 | 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/orm.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | JPA 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/castor.properties: -------------------------------------------------------------------------------- 1 | org.exolab.castor.indent=true -------------------------------------------------------------------------------- /src/main/resources/com/apress/prospring3/springblog/persistence/CategoryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/com/apress/prospring3/springblog/persistence/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 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 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/main/resources/oxm-mapping.xml: -------------------------------------------------------------------------------- 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 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/resources/springblog.properties: -------------------------------------------------------------------------------- 1 | audit.record.history.days=30 -------------------------------------------------------------------------------- /src/main/resources/sql/initial-data.sql: -------------------------------------------------------------------------------- 1 | insert into role values ('ROLE_USER', 'User'); 2 | insert into role values ('ROLE_ADMIN', 'Administrator'); 3 | insert into role values ('ROLE_REMOTE', 'Remote User'); 4 | 5 | insert into app_user values ('clarence', 'clarence', 'Clarence Ho', 'prospring3', '2011-10-21', 'prospring3', '2011-10-21'); 6 | insert into app_user values ('admin', 'admin', 'Administrator', 'prospring3', '2011-10-21', 'prospring3', '2011-10-21'); 7 | insert into app_user values ('remote', 'remote', 'Remote User', 'prospring3', '2011-10-21', 'prospring3', '2011-10-21'); 8 | insert into app_user values ('user', 'user', 'Normal User', 'prospring3', '2011-10-21', 'prospring3', '2011-10-21'); 9 | 10 | insert into user_role_detail values ('clarence','ROLE_ADMIN'); 11 | insert into user_role_detail values ('clarence','ROLE_USER'); 12 | insert into user_role_detail values ('admin','ROLE_ADMIN'); 13 | insert into user_role_detail values ('admin','ROLE_USER'); 14 | insert into user_role_detail values ('remote','ROLE_REMOTE'); 15 | insert into user_role_detail values ('user','ROLE_USER'); 16 | 17 | insert into category values ('Java', null); 18 | insert into category values ('Spring', null); 19 | insert into category values ('JPA', null); 20 | insert into category values ('Spring Batch', 'Spring'); 21 | insert into category values ('Spring Integration', 'Spring'); 22 | insert into category values ('Spring Webflow', 'Spring'); 23 | insert into category values ('Spring Roo', 'Spring'); 24 | insert into category values ('Hibernate', 'JPA'); 25 | insert into category values ('Eclipse Link', 'JPA'); 26 | insert into category values ('Collections', 'Java'); 27 | insert into category values ('JSR-303', 'Java'); -------------------------------------------------------------------------------- /src/main/webapp/META-INF/aop.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/webapp/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/standard.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/standard.css 2 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/i18n/application.properties: -------------------------------------------------------------------------------- 1 | #Updated at Thu Dec 08 19:42:28 CST 2011 2 | #Thu Dec 08 19:42:28 CST 2011 3 | application_name=SpringBlog 4 | label_com_clarence_test_contact_model_contact=Contact 5 | label_com_clarence_test_contact_model_contact_birthdate=Birth Date 6 | label_com_clarence_test_contact_model_contact_firstname=First Name 7 | label_com_clarence_test_contact_model_contact_id=Id 8 | label_com_clarence_test_contact_model_contact_lastname=Last Name 9 | label_com_clarence_test_contact_model_contact_plural=Contacts 10 | label_com_clarence_test_contact_model_contact_version=Version 11 | menu_category_contact_label=Contact 12 | menu_item_contact_list_label=Contacts 13 | menu_item_contact_new_label=Contact 14 | 15 | # Label for blog posting entries 16 | label_blog_posting_entries=Blog Posting Entries 17 | label_post_date=Post Date 18 | label_subject=Subject 19 | label_body=Body 20 | label_category=Category 21 | label_sub_category=Sub Category 22 | label_post_by=Post By 23 | label_from_post_date=From Post Date 24 | label_to_post_date=To Post Date 25 | label_blog_new=New Blog Post 26 | label_blog_update=Update Blog Post 27 | label_last_modified_date=Modified Date 28 | label_last_modified_by=Modified By 29 | 30 | # language 31 | label_language=Language 32 | label_locale_en_US=English US 33 | label_local_zh_HK=Chinese HK 34 | 35 | # navigation 36 | label_login=Login 37 | label_username=User Name 38 | label_password=Password 39 | label_logout=Logout 40 | label_welcome=Welcome 41 | label_home=Home 42 | label_please_login_to_post_entries=Please login to post entries 43 | label_new_blog_posting=New Blog Posting 44 | label_user_maintenance=User Maintenance 45 | label_login_hint=Hint 46 | 47 | # format 48 | post_date_pattern=yyyy-MM-dd 49 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/i18n/application_zh_HK.properties: -------------------------------------------------------------------------------- 1 | #Updated at Thu Dec 08 19:42:28 CST 2011 2 | #Thu Dec 08 19:42:28 CST 2011 3 | application_name=SpringBlog 4 | label_com_clarence_test_contact_model_contact=Contact 5 | label_com_clarence_test_contact_model_contact_birthdate=Birth Date 6 | label_com_clarence_test_contact_model_contact_firstname=First Name 7 | label_com_clarence_test_contact_model_contact_id=Id 8 | label_com_clarence_test_contact_model_contact_lastname=Last Name 9 | label_com_clarence_test_contact_model_contact_plural=Contacts 10 | label_com_clarence_test_contact_model_contact_version=Version 11 | menu_category_contact_label=Contact 12 | menu_item_contact_list_label=Contacts 13 | menu_item_contact_new_label=Contact 14 | 15 | # Label for blog posting entries 16 | label_blog_posting_entries=\u7DB2\u8A8C\u5217 17 | label_post_date=\u767C\u51FA\u65E5 18 | label_subject=\u984C\u76EE 19 | label_body=\u5167\u5BB9 20 | label_category=\u985E\u5225 21 | label_sub_category=\u5206\u985E\u5225 22 | label_post_by=\u767C\u51FA\u4EBA 23 | label_from_post_date=\u7531\u767C\u51FA\u65E5 24 | label_to_post_date=\u81F3\u767C\u51FA\u65E5 25 | label_blog_new=\u65B0\u589E\u7DB2\u8A8C 26 | label_blog_update=\u66F4\u6539\u7DB2\u8A8C 27 | label_last_modified_date=\u66F4\u6539\u65E5\u671F 28 | label_last_modified_by=\u66F4\u6539\u4EBA 29 | 30 | # language 31 | label_language=\u8A9E\u8A00 32 | label_locale_en_US=\u82F1\u6587 (\u7F8E\u570B) 33 | label_local_zh_HK=\u4E2D\u6587 (\u9999\u6E2F) 34 | 35 | # navigation 36 | label_login=\u767B\u5165 37 | label_username=\u540D\u7A31 38 | label_password=\u5BC6\u78BC 39 | label_logout=\u767B\u51FA 40 | label_welcome=\u6B61\u8FCE 41 | label_home=\u4E3B\u9801 42 | label_please_login_to_post_entries=\u8ACB\u767B\u5165\u518D\u767C\u7DB2\u8A8C 43 | label_new_blog_posting=\u65B0\u589E\u7DB2\u8A8C 44 | label_user_maintenance=\u7528\u6237\u7BA1\u7406 45 | label_login_hint=\u63D0\u793A 46 | 47 | # format 48 | post_date_pattern=yyyy-MM-dd 49 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layouts/layouts.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/spring/datasource.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/spring/jpa-service-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/spring/mybatis-service-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/spring/mybatis-tx-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/spring/restful-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/spring/security-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/blogs/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 11 | 12 | 13 | 15 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/comments/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/footer.jspx: -------------------------------------------------------------------------------- 1 | 2 | 30 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/header.jspx: -------------------------------------------------------------------------------- 1 | 40 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ page session="false" %> 3 | 4 | 5 | Home 6 | 7 | 8 |

9 | Hello world! 10 |

11 | 12 |

The time on the server is ${serverTime}.

13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/.htaccess: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | # For licensing, see LICENSE.html or http://ckeditor.com/license 4 | # 5 | 6 | # 7 | # On some specific Linux installations you could face problems with Firefox. 8 | # It could give you errors when loading the editor saying that some illegal 9 | # characters were found (three strange chars in the beginning of the file). 10 | # This could happen if you map the .js or .css files to PHP, for example. 11 | # 12 | # Those characters are the Byte Order Mask (BOM) of the Unicode encoded files. 13 | # All FCKeditor files are Unicode encoded. 14 | # 15 | 16 | AddType application/x-javascript .js 17 | AddType text/css .css 18 | 19 | # 20 | # If PHP is mapped to handle XML files, you could have some issues. The 21 | # following will disable it. 22 | # 23 | 24 | AddType text/xml .xml 25 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/config.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.editorConfig = function( config ) 7 | { 8 | // Define changes to default configuration here. For example: 9 | // config.language = 'fr'; 10 | // config.uiColor = '#AADC6E'; 11 | }; 12 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/contents.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | body 7 | { 8 | /* Font */ 9 | font-family: Arial, Verdana, sans-serif; 10 | font-size: 12px; 11 | 12 | /* Text color */ 13 | color: #222; 14 | 15 | /* Remove the background color to make it transparent */ 16 | background-color: #fff; 17 | } 18 | 19 | ol,ul,dl 20 | { 21 | /* IE7: reset rtl list margin. (#7334) */ 22 | *margin-right:0px; 23 | /* preserved spaces for list items with text direction other than the list. (#6249,#8049)*/ 24 | padding:0 40px; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/images/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/images/spacer.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/lang/_languages.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | var CKEDITOR_LANGS=(function(){var b={af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',cy:'Welsh',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-gb':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French','fr-ca':'French (Canada)',gl:'Galician',gu:'Gujarati',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',is:'Icelandic',it:'Italian',ja:'Japanese',ka:'Georgian',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},c=[];for(var d in b)c.push({code:d,name:b[d]});c.sort(function(e,f){return e.name.cke_about_container{color:#000 !important;padding:10px 10px 0;margin-top:5px}.cke_about_container p{margin: 0 0 10px;}.cke_about_container .cke_about_logo{height:81px;background-color:#fff;background-image:url('+CKEDITOR.plugins.get('about').path+'dialogs/logo_ckeditor.png);'+'background-position:center; '+'background-repeat:no-repeat;'+'margin-bottom:10px;'+'}'+'.cke_about_container a'+'{'+'cursor:pointer !important;'+'color:blue !important;'+'text-decoration:underline !important;'+'}'+''+'
'+''+'

'+'CKEditor '+CKEDITOR.version+' (revision '+CKEDITOR.revision+')
'+'http://ckeditor.com'+'

'+'

'+b.help.replace('$1',''+b.userGuide+'')+'

'+'

'+b.moreInfo+'
'+'http://ckeditor.com/license'+'

'+'

'+b.copy.replace('$1','CKSource - Frederico Knabben')+'

'+'
'}]}],buttons:[CKEDITOR.dialog.cancelButton]};}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/about/dialogs/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/about/dialogs/logo_ckeditor.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/ajax/plugin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | (function(){CKEDITOR.plugins.add('ajax',{requires:['xml']});CKEDITOR.ajax=(function(){var a=function(){if(!CKEDITOR.env.ie||location.protocol!='file:')try{return new XMLHttpRequest();}catch(f){}try{return new ActiveXObject('Msxml2.XMLHTTP');}catch(g){}try{return new ActiveXObject('Microsoft.XMLHTTP');}catch(h){}return null;},b=function(f){return f.readyState==4&&(f.status>=200&&f.status<300||f.status==304||f.status===0||f.status==1223);},c=function(f){if(b(f))return f.responseText;return null;},d=function(f){if(b(f)){var g=f.responseXML;return new CKEDITOR.xml(g&&g.firstChild?g:f.responseText);}return null;},e=function(f,g,h){var i=!!g,j=a();if(!j)return null;j.open('GET',f,i);if(i)j.onreadystatechange=function(){if(j.readyState==4){g(h(j));j=null;}};j.send(null);return i?'':h(j);};return{load:function(f,g){return e(f,g,c);},loadXml:function(f,g){return e(f,g,d);}};})();})(); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/autogrow/plugin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | (function(){function a(c){var d=c.getStyle('overflow-y'),e=c.getDocument(),f=CKEDITOR.dom.element.createFromHtml(''+(CKEDITOR.env.webkit?' ':'')+'',e);e[CKEDITOR.env.ie?'getBody':'getDocumentElement']().append(f);var g=f.getDocumentPosition(e).y+f.$.offsetHeight;f.remove();c.setStyle('overflow-y',d);return g;};var b=function(c){if(!c.window)return;var d=c.document,e=new CKEDITOR.dom.element(d.getWindow().$.frameElement),f=d.getBody(),g=d.getDocumentElement(),h=c.window.getViewPaneSize().height,i=d.$.compatMode=='BackCompat'?f:g,j=a(i);j+=c.config.autoGrow_bottomSpace||0;var k=c.config.autoGrow_minHeight!=undefined?c.config.autoGrow_minHeight:200,l=c.config.autoGrow_maxHeight||Infinity;j=Math.max(j,k);j=Math.min(j,l);if(j!=h){j=c.fire('autoGrow',{currentHeight:h,newHeight:j}).newHeight;c.resize(c.container.getStyle('width'),j,true);}if(i.$.scrollHeight>i.$.clientHeight&&j=8)?d.document.createElement(''):d.document.createElement('input');e.setAttribute('type','hidden');g.commitContent(e);var f=d.createFakeElement(e,'cke_hidden','hiddenfield');if(!g.hiddenField)d.insertElement(f);else{f.replace(g.hiddenField);d.getSelection().selectElement(f);}return true;},contents:[{id:'info',label:a.lang.hidden.title,title:a.lang.hidden.title,elements:[{id:'_cke_saved_name',type:'text',label:a.lang.hidden.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){if(this.getValue())b.setAttribute('name',this.getValue());else b.removeAttribute('name');}},{id:'value',type:'text',label:a.lang.hidden.value,'default':'',accessKey:'V',setup:function(b){this.setValue(b.getAttribute('value')||'');},commit:function(b){if(this.getValue())b.setAttribute('value',this.getValue());else b.removeAttribute('value');}}]}]};}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/forms/dialogs/radio.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.dialog.add('radio',function(a){return{title:a.lang.checkboxAndRadio.radioTitle,minWidth:350,minHeight:140,onShow:function(){var c=this;delete c.radioButton;var b=c.getParentEditor().getSelection().getSelectedElement();if(b&&b.getName()=='input'&&b.getAttribute('type')=='radio'){c.radioButton=b;c.setupContent(b);}},onOk:function(){var b,c=this.radioButton,d=!c;if(d){b=this.getParentEditor();c=b.document.createElement('input');c.setAttribute('type','radio');}if(d)b.insertElement(c);this.commitContent({element:c});},contents:[{id:'info',label:a.lang.checkboxAndRadio.radioTitle,title:a.lang.checkboxAndRadio.radioTitle,elements:[{id:'name',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){var c=b.element;if(this.getValue())c.data('cke-saved-name',this.getValue());else{c.data('cke-saved-name',false);c.removeAttribute('name');}}},{id:'value',type:'text',label:a.lang.checkboxAndRadio.value,'default':'',accessKey:'V',setup:function(b){this.setValue(b.getAttribute('value')||'');},commit:function(b){var c=b.element;if(this.getValue())c.setAttribute('value',this.getValue());else c.removeAttribute('value');}},{id:'checked',type:'checkbox',label:a.lang.checkboxAndRadio.selected,'default':'',accessKey:'S',value:'checked',setup:function(b){this.setValue(b.getAttribute('checked'));},commit:function(b){var c=b.element;if(!(CKEDITOR.env.ie||CKEDITOR.env.opera)){if(this.getValue())c.setAttribute('checked','checked');else c.removeAttribute('checked');}else{var d=c.getAttribute('checked'),e=!!this.getValue();if(d!=e){var f=CKEDITOR.dom.element.createFromHtml('',a.document);c.copyAttributes(f,{type:1,checked:1});f.replace(c);a.getSelection().selectElement(f);b.element=f;}}}}]}]};}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/forms/dialogs/textarea.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.dialog.add('textarea',function(a){return{title:a.lang.textarea.title,minWidth:350,minHeight:220,onShow:function(){var c=this;delete c.textarea;var b=c.getParentEditor().getSelection().getSelectedElement();if(b&&b.getName()=='textarea'){c.textarea=b;c.setupContent(b);}},onOk:function(){var b,c=this.textarea,d=!c;if(d){b=this.getParentEditor();c=b.document.createElement('textarea');}this.commitContent(c);if(d)b.insertElement(c);},contents:[{id:'info',label:a.lang.textarea.title,title:a.lang.textarea.title,elements:[{id:'_cke_saved_name',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){if(this.getValue())b.data('cke-saved-name',this.getValue());else{b.data('cke-saved-name',false);b.removeAttribute('name');}}},{type:'hbox',widths:['50%','50%'],children:[{id:'cols',type:'text',label:a.lang.textarea.cols,'default':'',accessKey:'C',style:'width:50px',validate:CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed),setup:function(b){var c=b.hasAttribute('cols')&&b.getAttribute('cols');this.setValue(c||'');},commit:function(b){if(this.getValue())b.setAttribute('cols',this.getValue());else b.removeAttribute('cols');}},{id:'rows',type:'text',label:a.lang.textarea.rows,'default':'',accessKey:'R',style:'width:50px',validate:CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed),setup:function(b){var c=b.hasAttribute('rows')&&b.getAttribute('rows');this.setValue(c||'');},commit:function(b){if(this.getValue())b.setAttribute('rows',this.getValue());else b.removeAttribute('rows');}}]},{id:'value',type:'textarea',label:a.lang.textfield.value,'default':'',setup:function(b){this.setValue(b.$.defaultValue);},commit:function(b){b.$.value=b.$.defaultValue=this.getValue();}}]}]};}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/forms/images/hiddenfield.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/forms/images/hiddenfield.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/iframe/images/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/iframe/images/placeholder.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/iframedialog/plugin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.plugins.add('iframedialog',{requires:['dialog'],onLoad:function(){CKEDITOR.dialog.addIframe=function(a,b,c,d,e,f,g){var h={type:'iframe',src:c,width:'100%',height:'100%'};if(typeof f=='function')h.onContentLoad=f;else h.onContentLoad=function(){var k=this.getElement(),l=k.$.contentWindow;if(l.onDialogEvent){var m=this.getDialog(),n=function(o){return l.onDialogEvent(o);};m.on('ok',n);m.on('cancel',n);m.on('resize',n);m.on('hide',function(o){m.removeListener('ok',n);m.removeListener('cancel',n);m.removeListener('resize',n);o.removeListener();});l.onDialogEvent({name:'load',sender:this,editor:m._.editor});}};var i={title:b,minWidth:d,minHeight:e,contents:[{id:'iframe',label:b,expand:true,elements:[h]}]};for(var j in g)i[j]=g[j];this.add(a,function(){return i;});};(function(){var a=function(b,c,d){if(arguments.length<3)return;var e=this._||(this._={}),f=c.onContentLoad&&CKEDITOR.tools.bind(c.onContentLoad,this),g=CKEDITOR.tools.cssLength(c.width),h=CKEDITOR.tools.cssLength(c.height);e.frameId=CKEDITOR.tools.getNextId()+'_iframe';b.on('load',function(){var k=CKEDITOR.document.getById(e.frameId),l=k.getParent();l.setStyles({width:g,height:h});});var i={src:'%2',id:e.frameId,frameborder:0,allowtransparency:true},j=[];if(typeof c.onContentLoad=='function')i.onload='CKEDITOR.tools.callFunction(%1);';CKEDITOR.ui.dialog.uiElement.call(this,b,c,j,'iframe',{width:g,height:h},i,'');d.push('
');j=j.join('');b.on('show',function(){var k=CKEDITOR.document.getById(e.frameId),l=k.getParent(),m=CKEDITOR.tools.addFunction(f),n=j.replace('%1',m).replace('%2',CKEDITOR.tools.htmlEncode(c.src));l.setHtml(n);});};a.prototype=new CKEDITOR.ui.dialog.uiElement();CKEDITOR.dialog.addUIElement('iframe',{build:function(b,c,d){return new a(b,c,d);}});})();}}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/link/dialogs/anchor.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.dialog.add('anchor',function(a){var b=function(d){this._.selectedElement=d;var e=d.data('cke-saved-name');this.setValueOf('info','txtName',e||'');};function c(d,e){return d.createFakeElement(e,'cke_anchor','anchor');};return{title:a.lang.anchor.title,minWidth:300,minHeight:60,onOk:function(){var k=this;var d=k.getValueOf('info','txtName'),e={name:d,'data-cke-saved-name':d};if(k._.selectedElement){if(k._.selectedElement.data('cke-realelement')){var f=c(a,a.document.createElement('a',{attributes:e}));f.replace(k._.selectedElement);}else k._.selectedElement.setAttributes(e);}else{var g=a.getSelection(),h=g&&g.getRanges()[0];if(h.collapsed){if(CKEDITOR.plugins.link.synAnchorSelector)e['class']='cke_anchor_empty';if(CKEDITOR.plugins.link.emptyAnchorFix){e.contenteditable='false';e['data-cke-editable']=1;}var i=a.document.createElement('a',{attributes:e});if(CKEDITOR.plugins.link.fakeAnchor)i=c(a,i);h.insertNode(i);}else{if(CKEDITOR.env.ie&&CKEDITOR.env.version<9)e['class']='cke_anchor';var j=new CKEDITOR.style({element:'a',attributes:e});j.type=CKEDITOR.STYLE_INLINE;j.apply(a.document);}}},onHide:function(){delete this._.selectedElement;},onShow:function(){var h=this;var d=a.getSelection(),e=d.getSelectedElement(),f;if(e){if(CKEDITOR.plugins.link.fakeAnchor){var g=CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,e);g&&b.call(h,g);h._.selectedElement=e;}else if(e.is('a')&&e.hasAttribute('name'))b.call(h,e);}else{f=CKEDITOR.plugins.link.getSelectedLink(a);if(f){b.call(h,f);d.selectElement(f);}}h.getContentElement('info','txtName').focus();},contents:[{id:'info',label:a.lang.anchor.title,accessKey:'I',elements:[{type:'text',id:'txtName',label:a.lang.anchor.name,required:true,validate:function(){if(!this.getValue()){alert(a.lang.anchor.errorName);return false;}return true;}}]}]};}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/link/images/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/link/images/anchor.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/pagebreak/images/pagebreak.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/pagebreak/images/pagebreak.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/pastetext/dialogs/pastetext.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | (function(){CKEDITOR.dialog.add('pastetext',function(a){return{title:a.lang.pasteText.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?368:350,minHeight:240,onShow:function(){this.setupContent();},onOk:function(){this.commitContent();},contents:[{label:a.lang.common.generalTab,id:'general',elements:[{type:'html',id:'pasteMsg',html:'
'+a.lang.clipboard.pasteMsg+'
'},{type:'textarea',id:'content',className:'cke_pastetext',onLoad:function(){var b=this.getDialog().getContentElement('general','pasteMsg').getElement(),c=this.getElement().getElementsByTag('textarea').getItem(0);c.setAttribute('aria-labelledby',b.$.id);c.setStyle('direction',a.config.contentsLangDirection);},focus:function(){this.getElement().focus();},setup:function(){this.setValue('');},commit:function(){var b=this.getValue();setTimeout(function(){a.fire('paste',{text:b});},0);}}]}]};});})(); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/placeholder/dialogs/placeholder.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | (function(){function a(b,c){var d=b.lang.placeholder,e=b.lang.common.generalTab;return{title:d.title,minWidth:300,minHeight:80,contents:[{id:'info',label:e,title:e,elements:[{id:'text',type:'text',style:'width: 100%;',label:d.text,'default':'',required:true,validate:CKEDITOR.dialog.validate.notEmpty(d.textMissing),setup:function(f){if(c)this.setValue(f.getText().slice(2,-2));},commit:function(f){var g='[['+this.getValue()+']]';CKEDITOR.plugins.placeholder.createPlaceholder(b,f,g);}}]}],onShow:function(){if(c)this._element=CKEDITOR.plugins.placeholder.getSelectedPlaceHoder(b);this.setupContent(this._element);},onOk:function(){this.commitContent(this._element);delete this._element;}};};CKEDITOR.dialog.add('createplaceholder',function(b){return a(b);});CKEDITOR.dialog.add('editplaceholder',function(b){return a(b,1);});})(); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/placeholder/lang/en.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.plugins.setLang('placeholder','en',{placeholder:{title:'Placeholder Properties',toolbar:'Create Placeholder',text:'Placeholder Text',edit:'Edit Placeholder',textMissing:'The placeholder must contain text.'}}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/placeholder/lang/he.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.plugins.setLang('placeholder','he',{placeholder:{title:'מאפייני שומר מקום',toolbar:'צור שומר מקום',text:'תוכן שומר המקום',edit:'ערוך שומר מקום',textMissing:'שומר המקום חייב להכיל טקסט.'}}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/placeholder/placeholder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/placeholder/placeholder.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/scayt/dialogs/toolbar.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | a{text-decoration:none;padding:2px 4px 4px 6px;display:block;border-width:1px;border-style:solid;margin:0;}a.cke_scayt_toogle:hover,a.cke_scayt_toogle:focus,a.cke_scayt_toogle:active{border-color:#316ac5;background-color:#dff1ff;color:#000;cursor:pointer;margin:0;}a.cke_scayt_toogle{color:#316ac5;border-color:#fff;}.scayt_enabled a.cke_scayt_item{color:#316ac5;border-color:#fff;margin:0;}.scayt_disabled a.cke_scayt_item{color:gray;border-color:#fff;}.scayt_enabled a.cke_scayt_item:hover,.scayt_enabled a.cke_scayt_item:focus,.scayt_enabled a.cke_scayt_item:active{border-color:#316ac5;background-color:#dff1ff;color:#000;cursor:pointer;}.scayt_disabled a.cke_scayt_item:hover,.scayt_disabled a.cke_scayt_item:focus,.scayt_disabled a.cke_scayt_item:active{border-color:gray;background-color:#dff1ff;color:gray;cursor:no-drop;}.cke_scayt_set_on,.cke_scayt_set_off{display:none;}.scayt_enabled .cke_scayt_set_on{display:none;}.scayt_disabled .cke_scayt_set_on{display:inline;}.scayt_disabled .cke_scayt_set_off{display:none;}.scayt_enabled .cke_scayt_set_off{display:inline;} 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_address.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_blockquote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_blockquote.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_div.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_div.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_h1.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_h2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_h2.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_h3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_h3.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_h4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_h4.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_h5.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_h6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_h6.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_p.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/showblocks/images/block_pre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/showblocks/images/block_pre.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/angel_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/angel_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/angry_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/angry_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/broken_heart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/broken_heart.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/confused_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/confused_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/cry_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/cry_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/devil_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/devil_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/embaressed_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/embaressed_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/envelope.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/envelope.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/heart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/heart.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/kiss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/kiss.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/lightbulb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/lightbulb.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/omg_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/omg_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/regular_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/regular_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/sad_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/sad_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/shades_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/shades_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/teeth_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/teeth_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/thumbs_down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/thumbs_down.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/thumbs_up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/thumbs_up.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/tounge_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/tounge_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/smiley/images/wink_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/smiley/images/wink_smile.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/styles/styles/default.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.stylesSet.add('default',[{name:'Blue Title',element:'h3',styles:{color:'Blue'}},{name:'Red Title',element:'h3',styles:{color:'Red'}},{name:'Marker: Yellow',element:'span',styles:{'background-color':'Yellow'}},{name:'Marker: Green',element:'span',styles:{'background-color':'Lime'}},{name:'Big',element:'big'},{name:'Small',element:'small'},{name:'Typewriter',element:'tt'},{name:'Computer Code',element:'code'},{name:'Keyboard Phrase',element:'kbd'},{name:'Sample Text',element:'samp'},{name:'Variable',element:'var'},{name:'Deleted Text',element:'del'},{name:'Inserted Text',element:'ins'},{name:'Cited Work',element:'cite'},{name:'Inline Quotation',element:'q'},{name:'Language: RTL',element:'span',attributes:{dir:'rtl'}},{name:'Language: LTR',element:'span',attributes:{dir:'ltr'}},{name:'Image on Left',element:'img',attributes:{style:'padding: 5px; margin-right: 5px',border:'2',align:'left'}},{name:'Image on Right',element:'img',attributes:{style:'padding: 5px; margin-left: 5px',border:'2',align:'right'}},{name:'Borderless Table',element:'table',styles:{'border-style':'hidden','background-color':'#E6E6FA'}},{name:'Square Bulleted List',element:'ul',styles:{'list-style-type':'square'}}]); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/stylesheetparser/plugin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | (function(){function a(c,d,e){var f=c.join(' ');f=f.replace(/(,|>|\+|~)/g,' ');f=f.replace(/\[[^\]]*/g,'');f=f.replace(/#[^\s]*/g,'');f=f.replace(/\:{1,2}[^\s]*/g,'');f=f.replace(/\s+/g,' ');var g=f.split(' '),h=[];for(var i=0;iType the title here

Type the text here

'},{title:'Strange Template',image:'template2.gif',description:'A template that defines two colums, each one with a title, and some text.',html:'

Title 1

Title 2

Text 1Text 2

More text goes here.

'},{title:'Text and Table',image:'template3.gif',description:'A title with some text and a table.',html:'

Title goes here

Table title
   
   
   

Type the text here

'}]}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/templates/templates/images/template1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/templates/templates/images/template1.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/templates/templates/images/template2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/templates/templates/images/template2.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/templates/templates/images/template3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/templates/templates/images/template3.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/uicolor/lang/en.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.plugins.setLang('uicolor','en',{uicolor:{title:'UI Color Picker',preview:'Live preview',config:'Paste this string into your config.js file',predefined:'Predefined color sets'}}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/uicolor/lang/he.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.plugins.setLang('uicolor','he',{uicolor:{title:'בחירת צבע ממשק משתמש',preview:'תצוגה מקדימה',config:'הדבק את הטקסט הבא לתוך הקובץ config.js',predefined:'קבוצות צבעים מוגדרות מראש'}}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/uicolor/plugin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.plugins.add('uicolor',{requires:['dialog'],lang:['en','he'],init:function(a){if(CKEDITOR.env.ie6Compat)return;a.addCommand('uicolor',new CKEDITOR.dialogCommand('uicolor'));a.ui.addButton('UIColor',{label:a.lang.uicolor.title,command:'uicolor',icon:this.path+'uicolor.gif'});CKEDITOR.dialog.add('uicolor',this.path+'dialogs/uicolor.js');CKEDITOR.scriptLoader.load(CKEDITOR.getUrl('plugins/uicolor/yui/yui.js'));a.element.getDocument().appendStyleSheet(CKEDITOR.getUrl('plugins/uicolor/yui/assets/yui.css'));}}); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/uicolor/uicolor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/uicolor/uicolor.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/uicolor/yui/assets/hue_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/uicolor/yui/assets/hue_bg.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/uicolor/yui/assets/picker_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/uicolor/yui/assets/picker_mask.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/wsc/dialogs/ciframe.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 47 | 48 |

49 | 50 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/wsc/dialogs/tmpFrameset.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/wsc/dialogs/wsc.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | html,body{background-color:transparent;margin:0;padding:0;}body{padding:10px;}body,td,input,select,textarea{font-size:11px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;}.midtext{padding:0;margin:10px;}.midtext p{padding:0;margin:10px;}.Button{border:#737357 1px solid;color:#3b3b1f;background-color:#c7c78f;}.PopupTabArea{color:#737357;background-color:#e3e3c7;}.PopupTitleBorder{border-bottom:#d5d59d 1px solid;}.PopupTabEmptyArea{padding-left:10px;border-bottom:#d5d59d 1px solid;}.PopupTab,.PopupTabSelected{border-right:#d5d59d 1px solid;border-top:#d5d59d 1px solid;border-left:#d5d59d 1px solid;padding:3px 5px 3px 5px;color:#737357;}.PopupTab{margin-top:1px;border-bottom:#d5d59d 1px solid;cursor:pointer;}.PopupTabSelected{font-weight:bold;cursor:default;padding-top:4px;border-bottom:#f1f1e3 1px solid;background-color:#f1f1e3;} 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/plugins/xml/plugin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | (function(){CKEDITOR.plugins.add('xml',{});CKEDITOR.xml=function(a){var b=null;if(typeof a=='object')b=a;else{var c=(a||'').replace(/ /g,'\xa0');if(window.DOMParser)b=new DOMParser().parseFromString(c,'text/xml');else if(window.ActiveXObject){try{b=new ActiveXObject('MSXML2.DOMDocument');}catch(d){try{b=new ActiveXObject('Microsoft.XmlDom');}catch(d){}}if(b){b.async=false;b.resolveExternals=false;b.validateOnParse=false;b.loadXML(c);}}}this.baseXml=b;};CKEDITOR.xml.prototype={selectSingleNode:function(a,b){var c=this.baseXml;if(b||(b=c))if(CKEDITOR.env.ie||b.selectSingleNode)return b.selectSingleNode(a);else if(c.evaluate){var d=c.evaluate(a,b,null,9,null);return d&&d.singleNodeValue||null;}return null;},selectNodes:function(a,b){var c=this.baseXml,d=[];if(b||(b=c))if(CKEDITOR.env.ie||b.selectNodes)return b.selectNodes(a);else if(c.evaluate){var e=c.evaluate(a,b,null,5,null);if(e){var f;while(f=e.iterateNext())d.push(f);}}return d;},getInnerXml:function(a,b){var c=this.selectSingleNode(a,b),d=[];if(c){c=c.firstChild;while(c){if(c.xml)d.push(c.xml);else if(window.XMLSerializer)d.push(new XMLSerializer().serializeToString(c));c=c.nextSibling;}}return d.length?d.join(''):null;}};})(); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/icons.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/icons_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/icons_rtl.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/images/dialog_sides.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/images/dialog_sides.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/images/dialog_sides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/images/dialog_sides.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/images/dialog_sides_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/images/dialog_sides_rtl.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/images/mini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/images/mini.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/images/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/images/noimage.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/images/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/images/sprites.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/images/sprites_ie6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/images/sprites_ie6.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/images/toolbar_start.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/kama/images/toolbar_start.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/kama/templates.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | .cke_skin_kama .cke_tpl_list{border:#dcdcdc 2px solid;background-color:#fff;overflow-y:auto;overflow-x:hidden;width:100%;height:220px;}.cke_skin_kama .cke_tpl_item{margin:5px;padding:7px;border:#eee 1px solid;*width:88%;}.cke_skin_kama .cke_tpl_preview{border-collapse:separate;text-indent:0;width:100%;}.cke_skin_kama .cke_tpl_preview td{padding:2px;vertical-align:middle;}.cke_skin_kama .cke_tpl_preview .cke_tpl_preview_img{width:100px;}.cke_skin_kama .cke_tpl_preview span{white-space:normal;}.cke_skin_kama .cke_tpl_title{font-weight:bold;}.cke_skin_kama .cke_tpl_list a:active .cke_tpl_item,.cke_skin_kama .cke_tpl_list a:hover .cke_tpl_item,.cke_skin_kama .cke_tpl_list a:focus .cke_tpl_item{border:#f93 1px solid;background-color:#fffacd;}.cke_skin_kama .cke_tpl_list a:active *,.cke_skin_kama .cke_tpl_list a:hover *,.cke_skin_kama .cke_tpl_list a:focus *{cursor:pointer;}.cke_skin_kama .cke_browser_ie6 .cke_tpl_list a:active,.cke_skin_kama .cke_browser_ie6 .cke_tpl_list a:hover,.cke_skin_kama .cke_browser_ie6 .cke_tpl_list a:focus{background-position:0 0;}.cke_skin_kama .cke_hc .cke_tpl_list a:active .cke_tpl_item,.cke_skin_kama .cke_hc .cke_tpl_list a:hover .cke_tpl_item,.cke_skin_kama .cke_hc .cke_tpl_list a:focus .cke_tpl_item{border-width:3px;}.cke_skin_kama .cke_tpl_empty,.cke_tpl_loading{text-align:center;padding:5px;} 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/icons.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/icons_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/icons_rtl.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/images/dialog_sides.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/images/dialog_sides.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/images/dialog_sides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/images/dialog_sides.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/images/dialog_sides_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/images/dialog_sides_rtl.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/images/mini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/images/mini.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/images/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/images/noimage.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/images/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/images/sprites.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/images/sprites_ie6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/office2003/images/sprites_ie6.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/skin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.skins.add('office2003',(function(){return{editor:{css:['editor.css']},dialog:{css:['dialog.css']},separator:{canGroup:false},templates:{css:['templates.css']},margins:[0,14,18,14]};})());(function(){CKEDITOR.dialog?a():CKEDITOR.on('dialogPluginReady',a);function a(){CKEDITOR.dialog.on('resize',function(b){var c=b.data,d=c.width,e=c.height,f=c.dialog,g=f.parts.contents;if(c.skin!='office2003')return;g.setStyles({width:d+'px',height:e+'px'});if(!CKEDITOR.env.ie||CKEDITOR.env.ie9Compat)return;var h=function(){var i=f.parts.dialog.getChild([0,0,0]),j=i.getChild(0),k=j.getSize('width');e+=j.getChild(0).getSize('height')+1;var l=i.getChild(2);l.setSize('width',k);l=i.getChild(7);l.setSize('width',k-28);l=i.getChild(4);l.setSize('height',e);l=i.getChild(5);l.setSize('height',e);};setTimeout(h,100);if(b.editor.lang.dir=='rtl')setTimeout(h,1000);});};})(); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/office2003/templates.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | .cke_skin_office2003 .cke_tpl_list{border:#dcdcdc 2px solid;background-color:#fff;overflow:auto;width:100%;height:220px;}.cke_skin_office2003 .cke_tpl_item{margin:5px;padding:7px;border:#eee 1px solid;*width:88%;}.cke_skin_office2003 .cke_tpl_preview{border-collapse:separate;text-indent:0;width:100%;}.cke_skin_office2003 .cke_tpl_preview td{padding:2px;vertical-align:middle;}.cke_skin_office2003 .cke_tpl_preview .cke_tpl_preview_img{width:100px;}.cke_skin_office2003 .cke_tpl_preview span{white-space:normal;}.cke_skin_office2003 .cke_tpl_title{font-weight:bold;}.cke_skin_office2003 .cke_tpl_list a:active .cke_tpl_item,.cke_skin_office2003 .cke_tpl_list a:hover .cke_tpl_item,.cke_skin_office2003 .cke_tpl_list a:focus .cke_tpl_item{border:#f93 1px solid!important;background-color:#fffacd!important;}.cke_skin_office2003 .cke_tpl_list a:active *,.cke_skin_office2003 .cke_tpl_list a:hover *,.cke_skin_office2003 .cke_tpl_list a:focus *{cursor:pointer;}.cke_skin_office2003 .cke_browser_ie6 .cke_tpl_list a:active,.cke_skin_office2003 .cke_browser_ie6 .cke_tpl_list a:hover,.cke_skin_office2003 .cke_browser_ie6 .cke_tpl_list a:focus{background-position:0 0;}.cke_skin_office2003 .cke_tpl_list a:active .cke_tpl_item,.cke_skin_office2003 .cke_tpl_list a:hover .cke_tpl_item,.cke_skin_office2003 .cke_tpl_list a:focus .cke_tpl_item{border-width:3px;}.cke_skin_office2003 .cke_tpl_empty,.cke_tpl_loading{text-align:center;padding:5px;} 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/icons.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/icons_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/icons_rtl.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/images/dialog_sides.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/images/dialog_sides.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/images/dialog_sides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/images/dialog_sides.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/images/dialog_sides_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/images/dialog_sides_rtl.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/images/mini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/images/mini.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/images/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/images/noimage.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/images/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/images/sprites.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/images/sprites_ie6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/images/sprites_ie6.png -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/images/toolbar_start.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/ckeditor/skins/v2/images/toolbar_start.gif -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/skin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.skins.add('v2',(function(){return{editor:{css:['editor.css']},dialog:{css:['dialog.css']},separator:{canGroup:false},templates:{css:['templates.css']},margins:[0,14,18,14]};})());(function(){CKEDITOR.dialog?a():CKEDITOR.on('dialogPluginReady',a);function a(){CKEDITOR.dialog.on('resize',function(b){var c=b.data,d=c.width,e=c.height,f=c.dialog,g=f.parts.contents;if(c.skin!='v2')return;g.setStyles({width:d+'px',height:e+'px'});if(!CKEDITOR.env.ie||CKEDITOR.env.ie9Compat)return;setTimeout(function(){var h=f.parts.dialog.getChild([0,0,0]),i=h.getChild(0),j=i.getSize('width');e+=i.getChild(0).getSize('height')+1;var k=h.getChild(2);k.setSize('width',j);k=h.getChild(7);k.setSize('width',j-28);k=h.getChild(4);k.setSize('height',e);k=h.getChild(5);k.setSize('height',e);},100);});};})(); 7 | -------------------------------------------------------------------------------- /src/main/webapp/ckeditor/skins/v2/templates.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | .cke_skin_v2 .cke_tpl_list{border:#dcdcdc 2px solid;background-color:#fff;overflow:auto;width:100%;height:220px;}.cke_skin_v2 .cke_tpl_item{margin:5px;padding:7px;border:#eee 1px solid;*width:88%;}.cke_skin_v2 .cke_tpl_preview{border-collapse:separate;text-indent:0;width:100%;}.cke_skin_v2 .cke_tpl_preview td{padding:2px;vertical-align:middle;}.cke_skin_v2 .cke_tpl_preview .cke_tpl_preview_img{width:100px;}.cke_skin_v2 .cke_tpl_preview span{white-space:normal;}.cke_skin_v2 .cke_tpl_title{font-weight:bold;}.cke_skin_v2 .cke_tpl_list a:active .cke_tpl_item,.cke_skin_v2 .cke_tpl_list a:hover .cke_tpl_item,.cke_skin_v2 .cke_tpl_list a:focus .cke_tpl_item{border:#f93 1px solid!important;background-color:#fffacd!important;}.cke_skin_v2 .cke_tpl_list a:active *,.cke_skin_v2 .cke_tpl_list a:hover *,.cke_skin_v2 .cke_tpl_list a:focus *{cursor:pointer;}.cke_skin_v2 .cke_browser_ie6 .cke_tpl_list a:active,.cke_skin_v2 .cke_browser_ie6 .cke_tpl_list a:hover,.cke_skin_v2 .cke_browser_ie6 .cke_tpl_list a:focus{background-position:0 0;}.cke_skin_v2 .cke_tpl_list a:active .cke_tpl_item,.cke_skin_v2 .cke_tpl_list a:hover .cke_tpl_item,.cke_skin_v2 .cke_tpl_list a:focus .cke_tpl_item{border-width:3px;}.cke_skin_v2 .cke_tpl_empty,.cke_tpl_loading{text-align:center;padding:5px;} 7 | -------------------------------------------------------------------------------- /src/main/webapp/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/add.png -------------------------------------------------------------------------------- /src/main/webapp/images/apress-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/apress-logo.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/banner-graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/banner-graphic.png -------------------------------------------------------------------------------- /src/main/webapp/images/build-with.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/build-with.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/create.png -------------------------------------------------------------------------------- /src/main/webapp/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/delete.png -------------------------------------------------------------------------------- /src/main/webapp/images/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/en.png -------------------------------------------------------------------------------- /src/main/webapp/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/favicon.ico -------------------------------------------------------------------------------- /src/main/webapp/images/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/list.png -------------------------------------------------------------------------------- /src/main/webapp/images/resultset_first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/resultset_first.png -------------------------------------------------------------------------------- /src/main/webapp/images/resultset_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/resultset_last.png -------------------------------------------------------------------------------- /src/main/webapp/images/resultset_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/resultset_next.png -------------------------------------------------------------------------------- /src/main/webapp/images/resultset_previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/resultset_previous.png -------------------------------------------------------------------------------- /src/main/webapp/images/show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/show.png -------------------------------------------------------------------------------- /src/main/webapp/images/springblog-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/springblog-logo.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/springsource-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/springsource-logo.png -------------------------------------------------------------------------------- /src/main/webapp/images/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/images/update.png -------------------------------------------------------------------------------- /src/main/webapp/jqgrid/js/i18n/grid.locale-no.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/jqgrid/js/i18n/grid.locale-no.js -------------------------------------------------------------------------------- /src/main/webapp/jqgrid/plugins/grid.postext.js: -------------------------------------------------------------------------------- 1 | ;(function($){ 2 | /** 3 | * jqGrid extension 4 | * Paul Tiseo ptiseo@wasteconsultants.com 5 | * 6 | * Dual licensed under the MIT and GPL licenses: 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * http://www.gnu.org/licenses/gpl-2.0.html 9 | **/ 10 | $.jgrid.extend({ 11 | getPostData : function(){ 12 | var $t = this[0]; 13 | if(!$t.grid) { return; } 14 | return $t.p.postData; 15 | }, 16 | setPostData : function( newdata ) { 17 | var $t = this[0]; 18 | if(!$t.grid) { return; } 19 | // check if newdata is correct type 20 | if ( typeof(newdata) === 'object' ) { 21 | $t.p.postData = newdata; 22 | } 23 | else { 24 | alert("Error: cannot add a non-object postData value. postData unchanged."); 25 | } 26 | }, 27 | appendPostData : function( newdata ) { 28 | var $t = this[0]; 29 | if(!$t.grid) { return; } 30 | // check if newdata is correct type 31 | if ( typeof(newdata) === 'object' ) { 32 | $.extend($t.p.postData, newdata); 33 | } 34 | else { 35 | alert("Error: cannot append a non-object postData value. postData unchanged."); 36 | } 37 | }, 38 | setPostDataItem : function( key, val ) { 39 | var $t = this[0]; 40 | if(!$t.grid) { return; } 41 | $t.p.postData[key] = val; 42 | }, 43 | getPostDataItem : function( key ) { 44 | var $t = this[0]; 45 | if(!$t.grid) { return; } 46 | return $t.p.postData[key]; 47 | }, 48 | removePostDataItem : function( key ) { 49 | var $t = this[0]; 50 | if(!$t.grid) { return; } 51 | delete $t.p.postData[key]; 52 | }, 53 | getUserData : function(){ 54 | var $t = this[0]; 55 | if(!$t.grid) { return; } 56 | return $t.p.userData; 57 | }, 58 | getUserDataItem : function( key ) { 59 | var $t = this[0]; 60 | if(!$t.grid) { return; } 61 | return $t.p.userData[key]; 62 | } 63 | }); 64 | })(jQuery); -------------------------------------------------------------------------------- /src/main/webapp/jqgrid/plugins/searchFilter.css: -------------------------------------------------------------------------------- 1 | .ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;} 2 | .ui-searchFilter table {position:relative; margin:0em; width:auto} 3 | .ui-searchFilter table td {margin: 0em; padding: 1px;} 4 | .ui-searchFilter table td input, .ui-searchFilter table td select {margin: 0.1em;} 5 | .ui-searchFilter .ui-state-default { cursor: pointer; } 6 | .ui-searchFilter .divider hr {margin: 1px; } -------------------------------------------------------------------------------- /src/main/webapp/jqgrid/plugins/ui.multiselect.css: -------------------------------------------------------------------------------- 1 | /* Multiselect 2 | ----------------------------------*/ 3 | 4 | .ui-multiselect { border: solid 1px; font-size: 0.8em; } 5 | .ui-multiselect ul { -moz-user-select: none; } 6 | .ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; } 7 | .ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;} 8 | .ui-multiselect li.ui-draggable-dragging { padding-left: 10px; } 9 | 10 | .ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; } 11 | .ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; } 12 | .ui-multiselect ul.selected li { } 13 | 14 | .ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; } 15 | .ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; } 16 | .ui-multiselect ul.available li { padding-left: 10px; } 17 | 18 | .ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;} 19 | .ui-multiselect .ui-state-hover { border: none; } 20 | .ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;} 21 | 22 | .ui-multiselect .add-all { float: right; padding: 7px;} 23 | .ui-multiselect .remove-all { float: right; padding: 7px;} 24 | .ui-multiselect .search { float: left; padding: 4px;} 25 | .ui-multiselect .count { float: left; padding: 7px;} 26 | 27 | .ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; } 28 | .ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; } 29 | 30 | .ui-multiselect input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; } -------------------------------------------------------------------------------- /src/main/webapp/scripts/javascript.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/scripts/javascript.js -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /src/main/webapp/styles/custom-theme/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/custom-theme/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /src/main/webapp/styles/messages/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/messages/error.png -------------------------------------------------------------------------------- /src/main/webapp/styles/messages/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/messages/info.png -------------------------------------------------------------------------------- /src/main/webapp/styles/messages/messages.css: -------------------------------------------------------------------------------- 1 | div.info,div.success,div.warning,div.error { 2 | border: 1px solid; 3 | margin: 10px 0px; 4 | padding: 15px 10px 15px 50px; 5 | background-repeat: no-repeat; 6 | background-position: 10px center; 7 | } 8 | 9 | div.info { 10 | color: #00529B; 11 | background-color: #BDE5F8; 12 | background-image: url('info.png'); 13 | } 14 | 15 | div.success { 16 | color: #4F8A10; 17 | background-color: #DFF2BF; 18 | background-image: url('success.png'); 19 | } 20 | 21 | div.warning { 22 | color: #9F6000; 23 | background-color: #FEEFB3; 24 | background-image: url('warning.png'); 25 | } 26 | 27 | div.error { 28 | color: #D8000C; 29 | background-color: #FFBABA; 30 | background-image: url('error.png'); 31 | } 32 | 33 | span { 34 | margin: 5px 5px 5px 5px; 35 | } 36 | 37 | span.success { 38 | color: #4F8A10; 39 | } 40 | 41 | span.error { 42 | color: #D8000C; 43 | } 44 | 45 | ul li { 46 | padding: 5px; 47 | } -------------------------------------------------------------------------------- /src/main/webapp/styles/messages/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/messages/success.png -------------------------------------------------------------------------------- /src/main/webapp/styles/messages/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/src/main/webapp/styles/messages/warning.png -------------------------------------------------------------------------------- /src/test/java/com/apress/prospring3/springblog/common/aop/ObscenityFilterTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Oct 3, 2011 3 | */ 4 | package com.apress.prospring3.springblog.common.aop; 5 | 6 | import static org.junit.Assert.assertTrue; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.test.context.ContextConfiguration; 12 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 13 | 14 | /** 15 | * @author Clarence 16 | * 17 | */ 18 | @RunWith(SpringJUnit4ClassRunner.class) 19 | @ContextConfiguration(locations = {"/app-context-test.xml"}) 20 | public class ObscenityFilterTest { 21 | 22 | @Autowired 23 | private ObscenityFilter obscenityFilter; 24 | 25 | @Test 26 | public void testReplaceObscenity() { 27 | 28 | String testData = "Crap! Kiss my arse, you damn bugger!"; 29 | 30 | assertTrue("Test data should contain obscenities", obscenityFilter.containsObscenities(testData)); 31 | 32 | String val = obscenityFilter.obfuscateObscenities(testData); 33 | 34 | System.out.println(val); 35 | 36 | assertTrue(val.indexOf("arse") == -1); 37 | assertTrue(val.indexOf("Crap") == -1); 38 | assertTrue(val.indexOf("damn") == -1); 39 | assertTrue(val.indexOf("bugger") == -1); 40 | assertTrue(val.indexOf("Kiss") > -1); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/com/apress/prospring3/springblog/service/jpa/EntryServiceImplTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created on Nov 1, 2011 3 | */ 4 | package com.apress.prospring3.springblog.service.jpa; 5 | 6 | import org.joda.time.DateTime; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.test.context.ContextConfiguration; 11 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 12 | 13 | import com.apress.prospring3.springblog.domain.Entry; 14 | import com.apress.prospring3.springblog.service.EntryService; 15 | 16 | /** 17 | * @author Clarence 18 | * 19 | */ 20 | @RunWith(SpringJUnit4ClassRunner.class) 21 | @ContextConfiguration(locations = {"/jpa-app-context-test.xml"}) 22 | public class EntryServiceImplTest { 23 | 24 | @Autowired 25 | private EntryService entryService; 26 | 27 | @Test 28 | public void testInsert() { 29 | Entry entry = new Entry(); 30 | entry.setSubject("Testing entry clarence"); 31 | entry.setBody("Testing entry clarence"); 32 | entry.setPostDate(new DateTime()); 33 | entry.setCategoryId("Spring"); 34 | entry.setCreatedBy("prospring3"); 35 | entry.setCreatedDate(new DateTime()); 36 | entry.setLastModifiedBy("prospring3"); 37 | entry.setLastModifiedDate(new DateTime()); 38 | entryService.save(entry); 39 | System.out.println("Entry: " + entry); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/test/resources/app-context-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | crap 28 | damn 29 | arse 30 | bugger 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/test/resources/log4j.xml: -------------------------------------------------------------------------------- 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 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /uml-model/springblog-uml-model.asta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/uml-model/springblog-uml-model.asta -------------------------------------------------------------------------------- /uml-model/springblog-uml-model.asta.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prospring3/springblog/6f2d97071eb0a3dcaa891bfa1ae7abce2b1c0a94/uml-model/springblog-uml-model.asta.bak --------------------------------------------------------------------------------