Anonymous avatar Anonymous committed ecc2ee9

Added rpType to ResponsibleParty and descendents. Refactored calls to import services into controller.

Comments (0)

Files changed (5)

grails-app/controllers/ImportController.groovy

 
     def index = {
 
-			//def importFile = "/Users/rob/Dropbox/Projects/basecamp/db/xml/rapportinc-20090721001012.xml"
-      def importFile = "/Users/rob/Dropbox/Projects/basecamp/db/xml/koyanainc-20090716141017.xml"
+			def importFile = "/Users/rob/Dropbox/Projects/basecamp/db/xml/rapportinc-20090721001012.xml"
+      //def importFile = "/Users/rob/Dropbox/Projects/basecamp/db/xml/koyanainc-20090716141017.xml"
 
        //importXMLService.importFromFile("/Users/rmacgreg/Dropbox/Projects/basecamp/db/xml/koyanainc-20090716141017.xml")
        //importXMLService.importFromFile("/Users/rmacgreg/Dropbox/Projects/basecamp/db/xml/rapportinc-20090721001012.xml")

grails-app/domain/com/koyanainc/bc/Client.groovy

 
 class Client extends ResponsibleParty {
 
+	//Initializer
+	{
+		rpType = "com.koyanainc.bc.Client"
+	}
+
     String name
     String addressOne = ""
     String addressTwo = ""

grails-app/domain/com/koyanainc/bc/Firm.groovy

 
 class Firm extends ResponsibleParty {
 
+	//Initializer
+	{
+		rpType = "com.koyanainc.bc.Firm"
+	}
+
     String name
     String addressOne = ""
     String addressTwo = ""

grails-app/domain/com/koyanainc/bc/Person.groovy

 
 class Person extends ResponsibleParty{
 
+	//Initializer
+	{
+		rpType = "com.koyanainc.bc.Person";
+	}
+
     String firstName = ""
     String lastName = ""
     String title = ""
     }
 
 
+
     String toString()
     {
         firstName

grails-app/domain/com/koyanainc/bc/ResponsibleParty.groovy

 package com.koyanainc.bc
 
 class ResponsibleParty {
-   
-   /**   
-   static getById(id)
-   {
-      def rp = ResponsibleParty.findById(id)
-      if(null == rp ) println "\n\n\t Responsible Party id:${id} cannot be found in db"
-      
-      println "ResponsibleParty type:${rp?.'responsiblePartyType'}"
-   }
-**/
+
+   String rpType
+
     static mapping = {
         id generator: 'assigned'
         //tablePerHierarchy false
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.