You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/01/04 19:37:31 UTC

[2/3] isis git commit: ISIS-1287: added faq for how to implement a spell checker.

ISIS-1287: added faq for how to implement a spell checker.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/49ad625d
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/49ad625d
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/49ad625d

Branch: refs/heads/master
Commit: 49ad625dc6f23b8128f4e988466d897fb66fe9ec
Parents: ea39e8d
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Jan 4 16:11:11 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Jan 4 16:11:11 2016 +0000

----------------------------------------------------------------------
 .../src/main/asciidoc/guides/_ugfun_faqs.adoc   |  1 +
 ...un_faqs_how-to-implement-a-spellchecker.adoc | 30 ++++++++++++++++++++
 2 files changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/49ad625d/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs.adoc
index fc109a2..2d30ccd 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs.adoc
@@ -17,3 +17,4 @@ include::_ugfun_faqs_enhance-only.adoc[leveloffset=+1]
 include::_ugfun_faqs_per-user-themes.adoc[leveloffset=+1]
 include::_ugfun_faqs_i18n-label-in-wicket-viewer.adoc[leveloffset=+1]
 include::_ugfun_faqs_how-to-handle-void-and-null-results.adoc[leveloffset=+1]
+include::_ugfun_faqs_how-to-implement-a-spellchecker.adoc[leveloffset=+1]

http://git-wip-us.apache.org/repos/asf/isis/blob/49ad625d/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs_how-to-implement-a-spellchecker.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs_how-to-implement-a-spellchecker.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs_how-to-implement-a-spellchecker.adoc
new file mode 100644
index 0000000..8c2599a
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_faqs_how-to-implement-a-spellchecker.adoc
@@ -0,0 +1,30 @@
+[[_ugfun_faqs_how-to-implement-a-spellchecker]]
+= How to implement a spellchecker?
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+From this link:http://isis.markmail.org/thread/dduarjscrbnodfsi[thread] on the Apache Isis users mailing list:
+
+* _What is the easiest way to add a spell checker to the text written in a field in
+   a domain object, for instance to check English syntax?_
+
+One way to implement is to use the xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus]:
+
+* Set up a xref:rgcsm.adoc#_rgcsm_classes_domainevent[domain event] xref:rgcsm.adoc#_rgcsm_classes_super_AbstractSubscriber[subscriber] that can veto the changes.
+
+* if the change is made through an action, you can use xref:rgant.adoc#_rgant_Action_domainEvent[`@Action#domainEvent()`].
+
+if if the change is made through an edit, you can use xref:rgant.adoc#_rgant_Property_domainEvent[`@Property#domainEvent()`].
+
+You'll need some way to know which fields should be spell checked.  Two ways spring to mind:
+
+* either look at the domain event's identifier
+
+* or subclass the domain event (recommended anyway) and have those subclass events implement some sort of marker
+interface, eg a `SpellCheckEvent`.
+
+And you'll (obviously) also need some sort of spell checker implementation to call.
+