Permalink
Browse files

drumroll

  • Loading branch information...
1 parent 2b0067a commit 5471fa2ac2bdc2218ea14d542b3ebdfa209f716c @smaldini smaldini committed Aug 13, 2012
Showing with 291 additions and 214 deletions.
  1. +10 −6 scripts/Docx.groovy
  2. +2 −2 src/docs/guide/configuration/accessing_plugin_config.gdoc
  3. +2 −2 src/docs/guide/configuration/changing_config.gdoc
  4. +4 −4 src/docs/guide/configuration/declaring_configuration_options.gdoc
  5. +4 −4 src/docs/guide/events.gdoc
  6. +2 −2 src/docs/guide/events/artifact.gdoc
  7. +2 −2 src/docs/guide/events/config.gdoc
  8. +6 −6 src/docs/guide/events/gorm.gdoc
  9. +16 −16 src/docs/guide/events/listening.gdoc
  10. +10 −10 src/docs/guide/events/replying.gdoc
  11. +8 −8 src/docs/guide/events/sending.gdoc
  12. +2 −2 src/docs/guide/gettingStarted.gdoc
  13. +2 −2 src/docs/guide/navigation/menu_navigation.gdoc
  14. +4 −4 src/docs/guide/navigation/navigation_by_convention.gdoc
  15. +2 −2 src/docs/guide/navigation/navigation_concepts.gdoc
  16. +10 −10 src/docs/guide/navigation/navigation_tags.gdoc
  17. +12 −12 src/docs/guide/navigation/using_navigation_dsl.gdoc
  18. +2 −2 src/docs/guide/security.gdoc
  19. +4 −4 src/docs/guide/security/security_implementing_bridge.gdoc
  20. +8 −8 src/docs/guide/uiextension/uix_tags.gdoc
  21. +2 −2 src/docs/ref/Events Methods/countListeners.gdoc
  22. +2 −2 src/docs/ref/Events Methods/event.gdoc
  23. +2 −2 src/docs/ref/Events Methods/on.gdoc
  24. +2 −2 src/docs/ref/Events Methods/removeListeners.gdoc
  25. +2 −2 src/docs/ref/Events Methods/waitFor.gdoc
  26. +2 −2 src/docs/ref/Global Properties/pluginConfig.gdoc
  27. +2 −2 src/docs/ref/Navigation Tags/menu.gdoc
  28. +2 −2 src/docs/ref/Navigation Tags/primary.gdoc
  29. +2 −2 src/docs/ref/Navigation Tags/secondary.gdoc
  30. +2 −2 src/docs/ref/Navigation Tags/set.gdoc
  31. +2 −2 src/docs/ref/Navigation Tags/title.gdoc
  32. +4 −4 src/docs/ref/Plugin Conventions/doWithConfig.gdoc
  33. +4 −4 src/docs/ref/Plugin Conventions/doWithConfigOptions.gdoc
  34. +2 −2 src/docs/ref/Security Methods/userHasAllRoles.gdoc
  35. +2 −2 src/docs/ref/Security Methods/userHasAnyRole.gdoc
  36. +2 −2 src/docs/ref/Security Methods/userIsAllowed.gdoc
  37. +2 −2 src/docs/ref/Security Methods/withUser.gdoc
  38. +2 −2 src/docs/ref/Security Properties/securityIdentity.gdoc
  39. +2 −2 src/docs/ref/Security Properties/securityInfo.gdoc
  40. +2 −2 src/docs/ref/Security Tags/createLoginLink.gdoc
  41. +2 −2 src/docs/ref/Security Tags/createLogoutLink.gdoc
  42. +2 −2 src/docs/ref/Security Tags/createSignupLink.gdoc
  43. +2 −2 src/docs/ref/Security Tags/identity.gdoc
  44. +2 −2 src/docs/ref/Security Tags/ifLoggedIn.gdoc
  45. +2 −2 src/docs/ref/Security Tags/ifNotLoggedIn.gdoc
  46. +2 −2 src/docs/ref/Security Tags/ifNotPermitted.gdoc
  47. +2 −2 src/docs/ref/Security Tags/ifPermitted.gdoc
  48. +2 −2 src/docs/ref/Security Tags/info.gdoc
  49. +2 −2 src/docs/ref/Security Tags/loginButton.gdoc
  50. +2 −2 src/docs/ref/Security Tags/logoutButton.gdoc
  51. +2 −2 src/docs/ref/Security Tags/signupButton.gdoc
  52. +2 −2 src/docs/ref/Tags System/config.gdoc
  53. +2 −2 src/docs/ref/Tags System/requiresBean.gdoc
  54. +2 −2 src/docs/ref/Ui Extension Properties/pluginFlash.gdoc
  55. +2 −2 src/docs/ref/Ui Extension Properties/pluginRequestAttributes.gdoc
  56. +2 −2 src/docs/ref/Ui Extension Properties/pluginSession.gdoc
  57. +2 −2 src/docs/ref/Ui Extension Tags/attrIfSet.gdoc
  58. +2 −2 src/docs/ref/Ui Extension Tags/button.gdoc
  59. +6 −6 src/docs/ref/Ui Extension Tags/displayMessage.gdoc
  60. +2 −2 src/docs/ref/Ui Extension Tags/dummyText.gdoc
  61. +2 −2 src/docs/ref/Ui Extension Tags/joinClasses.gdoc
  62. +2 −2 src/docs/ref/Ui Extension Tags/label.gdoc
  63. +2 −2 src/docs/ref/Ui Extension Tags/organization.gdoc
  64. +2 −2 src/docs/ref/Ui Extension Tags/siteName.gdoc
  65. +4 −4 src/docs/ref/Ui Extension Tags/siteURL.gdoc
  66. +2 −2 src/docs/ref/Ui Extension Tags/smartLink.gdoc
  67. +2 −2 src/docs/ref/Ui Extension Tags/text.gdoc
  68. +2 −2 src/docs/ref/Ui Extension Tags/year.gdoc
  69. +69 −0 src/docs/templates/css/shBrushXml.js
  70. +1 −0 src/docs/templates/css/shCoreMidnight.css
  71. +1 −0 src/docs/templates/html/guideItem.html
  72. +1 −0 src/docs/templates/html/layout.html
  73. +1 −0 src/docs/templates/html/referenceItem.html
View
@@ -23,7 +23,7 @@
includeTargets << grailsScript("_GrailsDocs")
-target(addMacros:'New Macros') {
+target(addMacros: 'New Macros') {
depends(setupDoc)
config.grails.doc.css = config.grails?.doc?.css ?: new File("$platformCorePluginDir/src/docs/templates/css")
@@ -32,7 +32,7 @@ target(addMacros:'New Macros') {
org.radeox.macro.MacroLoader.newInstance().add(org.radeox.macro.MacroRepository.instance, new org.radeox.macro.Preserved() {
@Override
String getName() {
- 'html'
+ 'docx'
}
@Override
@@ -46,6 +46,8 @@ target(addMacros:'New Macros') {
addSpecial('-' as char)
addSpecial('#' as char)
addSpecial('@' as char)
+ addSpecial('<' as char)
+ addSpecial('>' as char)
addSpecial('\\' as char)
addSpecial('\n' as char)
addSpecial('\r' as char)
@@ -55,20 +57,22 @@ target(addMacros:'New Macros') {
void execute(Writer writer, org.radeox.macro.parameter.MacroParameter params) {
def content = replace(org.radeox.util.Encoder.unescape(params.content))
if (params.length == 0) {
- writer << content
+ writer << '<pre class="brush: groovy;">' << content << '</pre>'
} else {
switch (params.get(0)) {
- case 'groovy':
- writer << '<pre class="brush: groovy;">' << content << '</pre>'
+ case 'xml':
+ writer << '<pre class="brush: xml;">' << content << '</pre>'
break
+ default:
+ writer << content
}
}
}
})
}
-target(extradocs:"Extra Docs") {
+target(extradocs: "Extra Docs") {
depends(createConfig, addMacros, docs)
}
@@ -6,13 +6,13 @@ your plugin, automatically namespace for your plugin using the @plugin.<pluginNa
So in a service you can trivially access this config inside a service or controller for example:
-{code}
+{docx}
class MyPluginService {
def doSomething() {
if (pluginConfig.enabled) {
println "It worked!"
}
}
}
-{code}
+{docx}
@@ -7,7 +7,7 @@ The code uses a simple DSL that is identical to normal Config except:
The application Config is loaded first. All the doWithConfig blocks are evaluated and the results merged in.
-{code}
+{docx}
def doWithConfig = { config ->
platformUi {
ui.Bootstrap.button.cssClass = 'btn'
@@ -21,6 +21,6 @@ def doWithConfig = { config ->
grails.x.y = config.p.q == 'something' ? true : false
}
}
-{code}
+{docx}
See [doWithConfig|pluginConventions] for more details.
@@ -4,23 +4,23 @@ This allows the platform to warn users when they mistype a config name or supply
Do declare the options your plugin supports, add the @doWithConfigOptions@ closure to your plugin descriptor:
-{code}
+{docx}
def doWithConfigOptions = {
'organization.name'(type: String, defaultValue: 'My Corp (set plugin.platformCore.organization.name)')
'site.name'(type: String, defaultValue: 'Our App (set plugin.platformCore.site.name)')
}
-{code}
+{docx}
This block, from the platform core, defines two configuration values of type String, with a default value.
You can also supply a custom validator:
-{code}
+{docx}
def doWithConfigOptions = {
'concurrentConnections'(type: Integer, defaultValue: 10,
validator: { v -> v < 500 ? null : 'concurrent.connections.too.big' }
}
-{code}
+{docx}
Behaving just like constraint validators, your validator returns null for "ok" or an i18n message string for the error.
@@ -21,7 +21,7 @@ and get maximum flexibility when required :
In a nutshell, you will :
* Send events :
-{html:groovy}
+{docx}
class UserController{
def registration(){
@@ -46,10 +46,10 @@ class UserController{
}
}
}
-{html}
+{docx}
* Write listeners (or event handler, or event reactor or whatever you call it):
-{html:groovy}
+{docx}
class UserService{
//use method name 'mailRegistration' as topic name
@@ -73,4 +73,4 @@ class UserService{
}
}
}
-{html}
+{docx}
@@ -37,7 +37,7 @@ timeout | Long | | Default timeout for execution time, throwing a TimeoutExcept
\* | \* | | Any attributes can be written to be used by plugins through EventDefinition.othersAttributes
{table}
-{html:groovy}
+{docx}
events = {
//prevents any events in gorm namespace
'*' namespace:'gorm', disabled:true
@@ -75,7 +75,7 @@ events = {
//testTopic9 onError:'anotherTopicErrors', onReply:'anotherTopicReplies'
}
-{html}
+{docx}
h3. Reloading in Development mode
@@ -9,7 +9,7 @@ Based on Platform-Core [configuration|guide:configuration] mechanism, the plugin
{table}
In addition, you can override beans values such as gormTopicSupport
-{html:groovy}
+{docx}
beans{
gormTopicSupport {
//transform gorm Events Objects types into topics
@@ -22,4 +22,4 @@ beans{
]
}
}
-{html}
+{docx}
@@ -19,7 +19,7 @@ Same listeners behaviors apply, e.g. using EventMessage for the argument type, u
Because listeners are called if there are *no arguments* or the argument *type is assignable to current event data type*, specifying
a domain class is the only required step to filter domains events.
-{html:groovy}
+{docx}
class SomeService{
@Listener(namespace = 'gorm')
@@ -39,21 +39,21 @@ class SomeService{
}
}
-{html}
+{docx}
h3. Filtering with Events Artifact
Setting a filter through an Events artifact allows more fined control and efficient selection since it prevents events to be
propagated :
-{html:groovy}
+{docx}
events = {
'afterInsert' namespace:'gorm', filter:Book
'afterDelete' namespace:'gorm', filter:{it.id > 5}
'afterUpdate' namespace:'gorm', filter:{it in Book || it in Author}
'beforeDelete' namespace:'gorm', disabled:true
}
-{html}
+{docx}
{note}
GORM may generate tons of events. Consider using it wisely, combine it with routing filtering.
@@ -72,7 +72,7 @@ If a listener handles one of the _before\*_ topics and returns a boolean value,
* Returning *true* will just let the chain continuing
-{html:groovy}
+{docx}
class SomeService{
//veto any Book insert
@@ -82,4 +82,4 @@ class SomeService{
}
}
-{html}
+{docx}
@@ -7,7 +7,7 @@ h3. Defining listeners at compile time
Within Grails services you can use the *@Listener* annotation. It takes a *topic* string, but you can omit it and use the *method name* as the topic to listen for:
-{html:groovy}
+{docx}
class SomeService{
@grails.events.Listener(topic = 'userLogged')
@@ -19,12 +19,12 @@ class SomeService{
def mailSent(){
}
}
-{html}
+{docx}
Event methods can define a *single argument*, and the value is the object sent with the event. Usually this is the "subject" of the event.
However an event is carried by an enveloppe called EventMessage which contains several useful metadata like additionnal headers, current topic :
-{html:groovy}
+{docx}
class SomeService{
@grails.events.Listener(topic = 'userLogged')
@@ -34,7 +34,7 @@ class SomeService{
println userMessage.data // displays data
}
}
-{html}
+{docx}
If a listener argument type is not assignable to an event data type, the event *silently skips the mismatching listener*. If you want to catch
every event types, use Object type or if the argument is not necessary, do not declare it.
@@ -49,7 +49,7 @@ h3. Namespacing
Your declared events belongs to the *app* namespace, unless you tune it using the *namespace* argument or the Events DSL we will introduce later.
-{html:groovy}
+{docx}
class SomeService{
@grails.events.Listener(topic = 'userLogged', namespace = 'security')
@@ -61,17 +61,17 @@ class SomeService{
def afterInsert(User user){
}
}
-{html}
+{docx}
Remember that you will need to specify the scope when triggering events if you customize it with a different value than *app* :
-{html:groovy}
+{docx}
class SomeController{
def myAction(){
event for:'security', topic:'userLogged', data:session.user
}
}
-{html}
+{docx}
{warning}
It's mandatory to declare namespace when using events bus from a plugin in order to avoid any conflicts.
@@ -81,7 +81,7 @@ h3. Proxy (AOP) support
By default, listeners try to call the original method (unproxified bean). Using *proxySupport* you can tweak this setting :
-{html:groovy}
+{docx}
class SomeService{
static transactional = true
@@ -92,13 +92,13 @@ class SomeService{
}
}
-{html}
+{docx}
h3. Dynamic listeners
Some edge cases need runtime registration. If you meet this use case, use the injected [on|Events Methods] method :
-{html:groovy}
+{docx}
class SomeController{
def testInlineListener = {
@@ -117,13 +117,13 @@ class SomeController{
render "$listener registered"
}
}
-{html}
+{docx}
h3. Wildcard support
Capturing a wider group of events can be useful, specially for monitoring purposes. It's possible to listen for multiple topics/namespaces in a single shot using *wildcard as the last character*.
-{html:groovy}
+{docx}
class SomeService{
@grails.events.Listener(namespace='role-*', topic = 'chat-*')
@@ -132,7 +132,7 @@ class SomeService{
println userMessage.event
}
}
-{html}
+{docx}
{note}
This feature will probably evolve to a smarter implementation behaving like UrlMappings and authorizing substring captures
@@ -149,7 +149,7 @@ The above square brackets determine each optional part of the sequence id thus a
This pattern is useful when using *countListeners*, *removeListeners* or *extensions*. For instance, overriding
a generated *channel* with *events-si* plugin requires to use @namespace://topic@ if _namespace_ is different from "app".
Another example to count listeners:
-{html:groovy}
+{docx}
//count every listeners subscribed to 'mytopic' inside TestService
countListeners("mytopic:my.TestService")
@@ -158,7 +158,7 @@ countListeners("gorm://*")
//remove every listeners in TestService
removeListeners("*:my.TestService")
-{html}
+{docx}
h3. Reloading in Development mode
Oops, something went wrong.

0 comments on commit 5471fa2

Please sign in to comment.