Commits

Christian Junk committed 14c0e3e

Added PropertySetService for easier usage.

Comments (0)

Files changed (4)

PropertysetGrailsPlugin.groovy

 class PropertysetGrailsPlugin {
     // the plugin version
-    def version = "1.0.8"
+    def version = "1.0.9"
     // the version or versions of Grails the plugin is designed for
     def grailsVersion = "2.1 > *"
     // the other plugins this plugin depends on

grails-app/services/com/opensymphony/module/propertyset/PropertySetService.groovy

+package com.opensymphony.module.propertyset
+
+import org.codehaus.groovy.grails.compiler.injection.GrailsAwareClassLoader
+
+class PropertySetService {
+
+    def PropertySet getProperySet(int entityId, String entityName) {
+        def args = [entityId: entityId, entityName: entityName]
+        PropertySetManager.getInstance("gorm", args, new GrailsAwareClassLoader(getClass().getClassLoader()))
+    }
+}
-<plugin name='propertyset' version='1.0.8' grailsVersion='2.1 &gt; *'>
+<plugin name='propertyset' version='1.0.9' grailsVersion='2.1 &gt; *'>
   <author>Christian Junk</author>
   <authorEmail>christian@christianjunk.de</authorEmail>
   <title>Propertyset Plugin</title>
     <resource>com.opensymphony.module.propertyset.PropertyNumber</resource>
     <resource>com.opensymphony.module.propertyset.PropertyString</resource>
     <resource>com.opensymphony.module.propertyset.PropertyText</resource>
+    <resource>com.opensymphony.module.propertyset.PropertySetService</resource>
   </resources>
   <repositories>
     <repository name='grailsCentral' url='http://grails.org/plugins' />

test/unit/com/opensymphony/module/propertyset/PropertySetServiceTests.groovy

+package com.opensymphony.module.propertyset
+
+
+
+import grails.test.mixin.*
+import org.junit.*
+
+/**
+ * See the API for {@link grails.test.mixin.services.ServiceUnitTestMixin} for usage instructions
+ */
+@TestFor(PropertySetService)
+class PropertySetServiceTests {
+
+    void testSomething() {
+        fail "Implement me"
+    }
+}