Skip to content
Browse files

add notes about artifact namespacing in whatsNew

  • Loading branch information...
1 parent 0a55052 commit 4fc994f47d99c7d443803fcb30962535d20e9ff3 @jeffbrown jeffbrown committed Sep 12, 2012
Showing with 49 additions and 1 deletion.
  1. +49 −1 src/en/guide/introduction/whatsNew22.gdoc
View
50 src/en/guide/introduction/whatsNew22.gdoc
@@ -1,6 +1,54 @@
h4. Namespace Support
-TODO
+Grails 2.2 includes improved support for managing naming conflicts between artifacts provided by an application and its plugins.
+
+Bean names for Service artifacts provided by a plugin are now prefixed with the plugin name. For example, if a Service named @com.publishing.AuthorService@ is provided by
+a plugin named @PublishingUtilities@ and another Service named @com.bookutils.AuthorService@ is provided by a plugin named @BookUtilities@, the bean names for those services
+will be @publishingUtilitiesAuthorService@ and @bookUtilitiesAuthorService@ respectively. If a plugin provides a Service that does not have a name which conflicts with any
+other Service, then a bean alias will automatically be created that does not contain the prefix and the alias will refer to the bean referenced by the prefixed name. Service
+artifacts provided directly by the application will have no prefix added to the relevant bean name. See the [dependency injection and services|guide:dependencyInjectionServices] docs.
+
+Domain classes provided by a plugin will have their default database table name prefixed with the plugin name if the @grails.gorm.table.prefix.enabled@ config property is
+set to @true@. For example, if the @PublishingUtilities@ plugin provides a domain class named @Book@, the default table name for that domain class will be
+@PUBLISHING_UTILITIES_BOOK@ if the @grails.gorm.table.prefix.enabled@ config property is set to @true@.
+
+URL Mappings may now include a @plugin@ attribute to indicate that the controller referenced in the mapping is provided by a particular plugin.
+
+{code:java}
+static mappings = {
+
+ // requests to /bookAuthors will be handled by the
+ // AuthorController provided by the BookUtilities plugin
+ "/bookAuthors" {
+ controller = 'author'
+ plugin = 'bookUtilities'
+ }
+
+ // requests to /publishingAuthors will be handled by the
+ // AuthorController provided by the Publishing plugin
+ "/publishingAuthors" {
+ controller 'author'
+ plugin = 'publishing'
+ }
+}
+{code}
+
+See the [namespaced controllers|guide:namespacedControllers] docs for more information.
+
+Controller methods and GSP Tags which accept a controller name as a paramater now support an optional parameter indicating
+that the controller is provided by a specific plugin.
+
+{code:java}
+<g:link controller="user" plugin="springSecurity">Manage Users</g:link>
+{code}
+
+{code:java}
+class DemoController {
+ def index() {
+ redirect controller: 'user', action: 'list', plugin: 'springSecurity'
+ }
+}
+{code}
h4. Forked Tomcat Execution

0 comments on commit 4fc994f

Please sign in to comment.
Something went wrong with that request. Please try again.