Re: Multi-Tenant Data Architecture
I read with great interest as I encountere the same situation some time ago. In practice (at least in my case), it worked to have the app run on separate EOF stacks accessing different database. So , it simplified the case to only have one instance in JavaMonitor for multi databases. However, it is not the preferred way due to the following same reason.. That is our main concern. Today we have 20 instances, but this number is likely to increase considerably in near future. If it grows to 40, are you planning on having each instance host all 40? I'd look into EOF stack size if you are thinking of having 40 in one JVM and there is a significant amount of data per tenant. That might work out to a lot of RAM per instance and so few instances per machine. It is just something to keep in mind. Shared this too and Chuck has a good point. So I opted to redisign and put all into single database. The backup / restore is a good point. Managing many EOF stacks and ensuring that one tenant does not see another tenants information might be just as complex in either scenario. I have no idea how / if EOModelGroup implements cloning. You would have to test it. I'd probably choose to do it manually so that I had control if I ever needed to make any other changes. When a session is created, you will need to ensure that all editing contexts created for that session use the correct EOObjectStoreCoordinator. You will also want to ensure that you don't use default in your code (defaultEditingContext(), defaultModelGroup() etc.) as these are unlikey to return objects from the correct EOF stack. Caveat: this is theoretical, I don't have any experience doing this. I don't think that many people have done this, so you run the risk of finding bugs in seldom executed EOF code. My tests concurred so far. It worked as Chuck mentioned, never use default. Called OSC right at the session constructor to be safe. Thank you very much! We are not in a hurry to make this change in our application, but we are worried about future. I'll try to make some tests following your advices and see what happens. Please let us know what happens. This is seldom explored territory. I run into the similar situation and will be good to know how it goes. Cheers Cheong Hee ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multi-Tenant Data Architecture
Hi; I've done two reasonably complex "multi-tenant" systems which are now seven and five years in production. Both are running out of unified models and I haven't heard of any issues around data authorisation issues. cheers. I did something like this a while ago and it was actually pretty simple to come up with a model that worked for the situation we had: ___ Andrew Lindesay www.lindesay.co.nz ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multi-Tenant Data Architecture
On 23/09/2009, at 8:46 AM, Henrique Prange wrote: Chuck Hill wrote: - problems / load on one tenant do not impact others - guaranteed that one tenant will not accidently see information from another This last one is exactly the reason why we can't have a shared database at all. This is what we do .. simply requires an auto injected and'd qualifier + relevant tables related to said tenant. - some increase in RAM usage due to duplicated loading of code and JVM If you don't want to do that and are committed to doing this in one instance, the next best way is to tag the root object with the tenant. But you said "separate databases", so that is ruled out. You mean data categorized by tenant? The application already supports this kind of architecture. We deploy one application with more than one tenant using a shared database in very exceptional cases. But that is not the rule. In most cases we can't take the risk of providing wrong information for a customer. We've never had that problem - but I understand it's theoretically possible as is providing the wrong connection dictionary ;-) Writing a bug free multi-tenant application with shared data is time consuming and expensive. In the case of this specific application is also too risky. Also, a shared database make the backup/restore process very difficult. You can backup everything easily, but how to revert the data for a single tenant? Very good point. But likewise shared app instances (as we use) must be updated simultaneously also. The only way that I can think of to accomplish what you want is to create an EOModelGroup for each tenant. A separate copy of each model will need to be loaded into each group and the database connection information set for that tenant. Each EOModelGroup will serve as the basis for a new EOF stack (rooted at EOObjectStoreCoordinator). Miguel gave me this same idea off-list. So, I think that is the way to go. :) Sorry for the stupid question, but would be enough to get the defaultModelGroup, clone it and change the URL for database connection on each cloned model? Or is it a better/safe idea to create one by one and load models as if it were the first time? When a session is created, you will need to ensure that all editing contexts created for that session use the correct EOObjectStoreCoordinator. You will also want to ensure that you don't use default in your code (defaultEditingContext(), defaultModelGroup() etc.) as these are unlikey to return objects from the correct EOF stack. Caveat: this is theoretical, I don't have any experience doing this. I don't think that many people have done this, so you run the risk of finding bugs in seldom executed EOF code. Thank you very much! We are not in a hurry to make this change in our application, but we are worried about future. I'll try to make some tests following your advices and see what happens. with regards, -- Lachlan Deck ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multi-Tenant Data Architecture
On Sep 22, 2009, at 4:34 PM, Chuck Hill wrote: - some increase in RAM usage due to duplicated loading of code and JVM If you don't want to do that and are committed to doing this in one instance, the next best way is to tag the root object with the tenant. But you said "separate databases", so that is ruled out. You mean data categorized by tenant? Yes. I did something like this a while ago and it was actually pretty simple to come up with a model that worked for the situation we had: - all (!) entities have a client (tenant?) relationship - this is set along with audit information in awakeFromInsertion (init) automatically as every user belongs to a client - the app automatically limits fetches with restricting qualifiers (D2W app) - if an object gets fetched and it's awakeFromFetch is called and the client of this object and the client of the current user don't match, it throws a fatal exception, the users session is logged (every single action), the stack trace is logged, and the session terminated - I don't use any raw row fetching at all This worked quite well, the app didn't have many clients but I never had any complaints about data being shown that shouldn't have been shown. If you are really determined you could make sure on a per call basis, that no data is accessed from a different client. Guido ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
On Sep 22, 2009, at 4:27 PM, Ramsey Lee Gurley wrote: On Sep 22, 2009, at 2:05 PM, Chuck Hill wrote: On Sep 22, 2009, at 9:57 AM, David Avendasora wrote: On Sep 22, 2009, at 12:19 PM, Chuck Hill wrote: On Sep 22, 2009, at 9:07 AM, David Avendasora wrote: On Sep 22, 2009, at 11:29 AM, Freddie Tilley wrote: Value class of type NSNumber does not work for me, using a value class of java.lang.Boolean does. Interesting. It is odd to have a ValueType of c with a ValueClass of NSNumber... but it's working for me. Okay, Chuck, here's where you put your snide comment about my Modeling skills. :-P One cannot comment on what does not exist. :-P I'd want to see screen shots of each to be sure we are all talking about the same thing. Here's my custom Prototype: Here's my attribute that implements the Boolean prototype: Not sure why that works and not inclined to dig into it right now. Chuck According to the 'legacy' docs, that's the way it's supposed to work. That seems odd as Boolean is not a Number. There is trickery there in EOF. David, your modeling skills should be safe from Chuck's snide comments... for now (^_^) I am unlikely to allow simple facts to stand in my way. ;-) Chuck http://developer.apple.com/legacy/mac/library/documentation/WebObjects/UsingEOModeler/4WorkingWithAttributes/WorkingWithAttributes.html#/ /apple_ref/doc/uid/TP30001018-CH204-BABFGECE Ramsey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multi-Tenant Data Architecture
Hi Henrique, On Sep 22, 2009, at 3:46 PM, Henrique Prange wrote: Hi Chuck, Chuck Hill wrote: The easiest, and perhaps best, way to do this is to have different instances for each tenant. The configuration (in JavaMonitor or elsewhere) can then specify the database. That is our current way to deploy the application. Well, then you already know the pros and cons of that scenario! :-) Pros: - easy Not so easy when you have more than 20 different instances (and counting) running on JavaMonitor. :p 20 does not seem like that many to manage. - problems / load on one tenant do not impact others - guaranteed that one tenant will not accidently see information from another This last one is exactly the reason why we can't have a shared database at all. Cons: - more instances to administer That is our main concern. Today we have 20 instances, but this number is likely to increase considerably in near future. If it grows to 40, are you planning on having each instance host all 40? I'd look into EOF stack size if you are thinking of having 40 in one JVM and there is a significant amount of data per tenant. That might work out to a lot of RAM per instance and so few instances per machine. It is just something to keep in mind. - some increase in RAM usage due to duplicated loading of code and JVM If you don't want to do that and are committed to doing this in one instance, the next best way is to tag the root object with the tenant. But you said "separate databases", so that is ruled out. You mean data categorized by tenant? Yes. The application already supports this kind of architecture. We deploy one application with more than one tenant using a shared database in very exceptional cases. But that is not the rule. In most cases we can't take the risk of providing wrong information for a customer. Writing a bug free multi-tenant application with shared data is time consuming and expensive. In the case of this specific application is also too risky. Also, a shared database make the backup/restore process very difficult. You can backup everything easily, but how to revert the data for a single tenant? The backup / restore is a good point. Managing many EOF stacks and ensuring that one tenant does not see another tenants information might be just as complex in either scenario. The only way that I can think of to accomplish what you want is to create an EOModelGroup for each tenant. A separate copy of each model will need to be loaded into each group and the database connection information set for that tenant. Each EOModelGroup will serve as the basis for a new EOF stack (rooted at EOObjectStoreCoordinator). Miguel gave me this same idea off-list. So, I think that is the way to go. :) Sorry for the stupid question, but would be enough to get the defaultModelGroup, clone it and change the URL for database connection on each cloned model? Or is it a better/safe idea to create one by one and load models as if it were the first time? I have no idea how / if EOModelGroup implements cloning. You would have to test it. I'd probably choose to do it manually so that I had control if I ever needed to make any other changes. When a session is created, you will need to ensure that all editing contexts created for that session use the correct EOObjectStoreCoordinator. You will also want to ensure that you don't use default in your code (defaultEditingContext(), defaultModelGroup() etc.) as these are unlikey to return objects from the correct EOF stack. Caveat: this is theoretical, I don't have any experience doing this. I don't think that many people have done this, so you run the risk of finding bugs in seldom executed EOF code. Thank you very much! We are not in a hurry to make this change in our application, but we are worried about future. I'll try to make some tests following your advices and see what happens. Please let us know what happens. This is seldom explored territory. Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
On Sep 22, 2009, at 2:05 PM, Chuck Hill wrote: On Sep 22, 2009, at 9:57 AM, David Avendasora wrote: On Sep 22, 2009, at 12:19 PM, Chuck Hill wrote: On Sep 22, 2009, at 9:07 AM, David Avendasora wrote: On Sep 22, 2009, at 11:29 AM, Freddie Tilley wrote: Value class of type NSNumber does not work for me, using a value class of java.lang.Boolean does. Interesting. It is odd to have a ValueType of c with a ValueClass of NSNumber... but it's working for me. Okay, Chuck, here's where you put your snide comment about my Modeling skills. :-P One cannot comment on what does not exist. :-P I'd want to see screen shots of each to be sure we are all talking about the same thing. Here's my custom Prototype: Here's my attribute that implements the Boolean prototype: Not sure why that works and not inclined to dig into it right now. Chuck According to the 'legacy' docs, that's the way it's supposed to work. David, your modeling skills should be safe from Chuck's snide comments... for now (^_^) http://developer.apple.com/legacy/mac/library/documentation/WebObjects/UsingEOModeler/4WorkingWithAttributes/WorkingWithAttributes.html#//apple_ref/doc/uid/TP30001018-CH204-BABFGECE Ramsey smime.p7s Description: S/MIME cryptographic signature ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multi-Tenant Data Architecture
Hi Denis, Thank you very much, Denis. I haven't found this thread while googling by the subject. The Eugene e-mail has exactly what I need... Sample code. :) Cheers, Henrique Denis Frolov wrote: Hi Henrique, This thread may be of interest: http://lists.apple.com/archives/webobjects-dev//2007/Jul/msg00390.html We are still using the approach described by Eugene in this thread. On Sat, Sep 19, 2009 at 7:09 PM, Henrique Prange wrote: Hi all, Is there a way to configure EOF to access separate databases for each tenant in *one* application? I'm working in an application that has a strong non-functional requirement on multi-tenant architecture with isolated database access. I've seen some discussion related with this subject, but it was not clear to me how could I implement this kind of stuff. Any directions are really appreciated. Cheers, Henrique ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/dfrolov%40demax.ru This email sent to dfro...@demax.ru ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multi-Tenant Data Architecture
Hi Chuck, Chuck Hill wrote: The easiest, and perhaps best, way to do this is to have different instances for each tenant. The configuration (in JavaMonitor or elsewhere) can then specify the database. That is our current way to deploy the application. Pros: - easy Not so easy when you have more than 20 different instances (and counting) running on JavaMonitor. :p - problems / load on one tenant do not impact others - guaranteed that one tenant will not accidently see information from another This last one is exactly the reason why we can't have a shared database at all. Cons: - more instances to administer That is our main concern. Today we have 20 instances, but this number is likely to increase considerably in near future. - some increase in RAM usage due to duplicated loading of code and JVM If you don't want to do that and are committed to doing this in one instance, the next best way is to tag the root object with the tenant. But you said "separate databases", so that is ruled out. You mean data categorized by tenant? The application already supports this kind of architecture. We deploy one application with more than one tenant using a shared database in very exceptional cases. But that is not the rule. In most cases we can't take the risk of providing wrong information for a customer. Writing a bug free multi-tenant application with shared data is time consuming and expensive. In the case of this specific application is also too risky. Also, a shared database make the backup/restore process very difficult. You can backup everything easily, but how to revert the data for a single tenant? The only way that I can think of to accomplish what you want is to create an EOModelGroup for each tenant. A separate copy of each model will need to be loaded into each group and the database connection information set for that tenant. Each EOModelGroup will serve as the basis for a new EOF stack (rooted at EOObjectStoreCoordinator). Miguel gave me this same idea off-list. So, I think that is the way to go. :) Sorry for the stupid question, but would be enough to get the defaultModelGroup, clone it and change the URL for database connection on each cloned model? Or is it a better/safe idea to create one by one and load models as if it were the first time? When a session is created, you will need to ensure that all editing contexts created for that session use the correct EOObjectStoreCoordinator. You will also want to ensure that you don't use default in your code (defaultEditingContext(), defaultModelGroup() etc.) as these are unlikey to return objects from the correct EOF stack. Caveat: this is theoretical, I don't have any experience doing this. I don't think that many people have done this, so you run the risk of finding bugs in seldom executed EOF code. Thank you very much! We are not in a hurry to make this change in our application, but we are worried about future. I'll try to make some tests following your advices and see what happens. Cheers, Henrique ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Very interesting case
I've been following your thread and will throw this out at you. I write a lot of components that have to broken up into different forms for layout and continuity purposes, just like you are if you're using a batch nav bar. It is quite a pain to have submit buttons all over the place. Using Ajax observers and submitting the form automatically on a change can make the ui experience much better. You still have to PAY ATTENTION to what you are doing re validation etc. but it can make it easier. So you can observe your other form data and automatically submit it to get it in your component code but make it seemless when you proceed to the next batch. JAL John A. Larson President Precision Instruments, Inc. Ph: 847-824-4194 Fax: 866-240-7104 Sent from my iPhone On Sep 22, 2009, at 2:23 PM, Don Lindsay wrote: It is using the WONavigationBar component from WOExtensions. It is a hyperlink, inside that control. Don On Sep 22, 2009, at 12:22 PM, Chuck Hill wrote: On Sep 22, 2009, at 2:32 AM, Don Lindsay wrote: Hello; I have a displayGroup displaying batches of 5 items per page. When a user clicks the next page, What is "clicks the next page"? If it is a WOHyperlink then the form values will not get submitted. You need to use a WOSubmitButton to send what the user entered to the app. Chuck which uses displayNextBatch() for the display group, if the user goes back to the previous page, all of their answers have been cleared as if they never entered anything. If I use a WOSubmit button to submit the changes and use saveChanges on the EO everything stays selected. But should a user be required to do this everytime they go to another batch? Is there something I can do to retain selected values across batches for when a user returns to the page, without issuing a savechanges via a WOSubmit? This is a very vanilla form, no code that is manipulating the EO objects, it is all done through WO Controls ,WORepetitions, and display groups. Thanks Don On Sep 21, 2009, at 10:45 PM, Chuck Hill wrote: On Sep 21, 2009, at 2:16 PM, Don Lindsay wrote: I know, I have been piddling with it and probably violated many commandments. That is not something that you can do and expect sane results. It is a binary sort of thing. Either you lock correctly and obey the commandments, or EOF.doCrazyThingsAtRandom(true). Your call. You seem to have found a work around, but that does not address why the EO was not getting saved. I strongly suspect that you have a latent bug lurking in the background. Chuck Let me explain what I am doing and see if anyone has any insight. I have a datamodel with the following: Users (identifier Integer, username string, password string) Pages (identifier Integer, PageDescription string, active integer, position Integer) Questions (identifier integer, questiontext string, pageidentifier integer, active integer) Question Lookup Values (identifier, descriptivetext string, active integer) UserAnswers(identifier integer, useridentifier integer, questionidentifier integer, answeridentifier integer) Pretty simple. A user can access any page, any question on a page, and answer a question only once. So I created an entity: useranswers ( User, Question, Answer(would contain a question lookup) ) Pages can have one or more questions, Questions can have zero or more Question Lookup Values. More than one question can relate to a question lookup value. So the relationship looks like this: Pages <-->> Questions <<-->> Lookup Values User <-->> UserAnswers <<--> Question So what I have done is create a component that takes a User as a property when it is created setUser(...). I then created a WODisplayGroup for Pages with no detail. I then created a WODisplayGroup for Questions with detail pointing to pages. I then created a WODisplayGroup for UserAnswers with detail pointing to questions. The issue I have with the UserAnswers displaygroup is that it also requires a qualification to a User as well as a question. N problemo, I use the queryMatch().setValueForKey (theUserObject,"theUser"). Now here is where I run into issues, Question.theAnswers relationship returns an NSArray because it is a to-many. How do I bind this to the selection property of a WOPopupButton, I can't that I know of.> Don On Sep 21, 2009, at 4:31 PM, Chuck Hill wrote: On Sep 21, 2009, at 1:17 PM, Don Lindsay wrote: Hello; I have a component that I am updating a table of answers based on selections made by the user from a worepitition. The code being executed is: try { String sEoQualifierText = "page="; sEoQualifierText += Integer.toString((Integer) thePage().valueForKey("identifier")); sEoQualifierText += " and question="; sEoQualifierText += Integer.toString((Integer) theQuestion().valueForKey("identifier")); s
Re: Very interesting case
On Sep 22, 2009, at 12:23 PM, Don Lindsay wrote: It is using the WONavigationBar component from WOExtensions. It is a hyperlink, inside that control. That would leave you (rhyme with duct). That works fine to navigation, but does not handle data submission. The answer is, of course, Wonder. ERXBatchNavigationBar appears to do what you want. Or you can make your own navigation that uses WOImageButton to change batches. Chuck Don On Sep 22, 2009, at 12:22 PM, Chuck Hill wrote: On Sep 22, 2009, at 2:32 AM, Don Lindsay wrote: Hello; I have a displayGroup displaying batches of 5 items per page. When a user clicks the next page, What is "clicks the next page"? If it is a WOHyperlink then the form values will not get submitted. You need to use a WOSubmitButton to send what the user entered to the app. Chuck which uses displayNextBatch() for the display group, if the user goes back to the previous page, all of their answers have been cleared as if they never entered anything. If I use a WOSubmit button to submit the changes and use saveChanges on the EO everything stays selected. But should a user be required to do this everytime they go to another batch? Is there something I can do to retain selected values across batches for when a user returns to the page, without issuing a savechanges via a WOSubmit? This is a very vanilla form, no code that is manipulating the EO objects, it is all done through WO Controls ,WORepetitions, and display groups. Thanks Don On Sep 21, 2009, at 10:45 PM, Chuck Hill wrote: On Sep 21, 2009, at 2:16 PM, Don Lindsay wrote: I know, I have been piddling with it and probably violated many commandments. That is not something that you can do and expect sane results. It is a binary sort of thing. Either you lock correctly and obey the commandments, or EOF.doCrazyThingsAtRandom(true). Your call. You seem to have found a work around, but that does not address why the EO was not getting saved. I strongly suspect that you have a latent bug lurking in the background. Chuck Let me explain what I am doing and see if anyone has any insight. I have a datamodel with the following: Users (identifier Integer, username string, password string) Pages (identifier Integer, PageDescription string, active integer, position Integer) Questions (identifier integer, questiontext string, pageidentifier integer, active integer) Question Lookup Values (identifier, descriptivetext string, active integer) UserAnswers(identifier integer, useridentifier integer, questionidentifier integer, answeridentifier integer) Pretty simple. A user can access any page, any question on a page, and answer a question only once. So I created an entity: useranswers ( User, Question, Answer(would contain a question lookup) ) Pages can have one or more questions, Questions can have zero or more Question Lookup Values. More than one question can relate to a question lookup value. So the relationship looks like this: Pages <-->> Questions <<-->> Lookup Values User <-->> UserAnswers <<--> Question So what I have done is create a component that takes a User as a property when it is created setUser(...). I then created a WODisplayGroup for Pages with no detail. I then created a WODisplayGroup for Questions with detail pointing to pages. I then created a WODisplayGroup for UserAnswers with detail pointing to questions. The issue I have with the UserAnswers displaygroup is that it also requires a qualification to a User as well as a question. N problemo, I use the queryMatch().setValueForKey(theUserObject,"theUser"). Now here is where I run into issues, Question.theAnswers relationship returns an NSArray because it is a to-many. How do I bind this to the selection property of a WOPopupButton, I can't that I know of.> Don On Sep 21, 2009, at 4:31 PM, Chuck Hill wrote: On Sep 21, 2009, at 1:17 PM, Don Lindsay wrote: Hello; I have a component that I am updating a table of answers based on selections made by the user from a worepitition. The code being executed is: try { String sEoQualifierText = "page="; sEoQualifierText += Integer.toString((Integer)thePage().valueForKey("identifier")); sEoQualifierText += " and question="; sEoQualifierText += Integer .toString((Integer)theQuestion().valueForKey("identifier")); sEoQualifierText += " and user="; sEoQualifierText += Integer.toString((Integer) ((EOEnterpriseObject)theUser).valueForKey("identifier")); EOQualifier oQual = EOQualifier.qualifierWithQualifierFormat(sEoQualifierText,null); What are you doing? And why? What is thePage().valueForKey("identifier")? Home brew binding sync? Generic Record based EOs with no Java classes? Wonder's ERXQ will make your life so much easier to read and
Re: Very interesting case
It is using the WONavigationBar component from WOExtensions. It is a hyperlink, inside that control. Don On Sep 22, 2009, at 12:22 PM, Chuck Hill wrote: On Sep 22, 2009, at 2:32 AM, Don Lindsay wrote: Hello; I have a displayGroup displaying batches of 5 items per page. When a user clicks the next page, What is "clicks the next page"? If it is a WOHyperlink then the form values will not get submitted. You need to use a WOSubmitButton to send what the user entered to the app. Chuck which uses displayNextBatch() for the display group, if the user goes back to the previous page, all of their answers have been cleared as if they never entered anything. If I use a WOSubmit button to submit the changes and use saveChanges on the EO everything stays selected. But should a user be required to do this everytime they go to another batch? Is there something I can do to retain selected values across batches for when a user returns to the page, without issuing a savechanges via a WOSubmit? This is a very vanilla form, no code that is manipulating the EO objects, it is all done through WO Controls ,WORepetitions, and display groups. Thanks Don On Sep 21, 2009, at 10:45 PM, Chuck Hill wrote: On Sep 21, 2009, at 2:16 PM, Don Lindsay wrote: I know, I have been piddling with it and probably violated many commandments. That is not something that you can do and expect sane results. It is a binary sort of thing. Either you lock correctly and obey the commandments, or EOF.doCrazyThingsAtRandom(true). Your call. You seem to have found a work around, but that does not address why the EO was not getting saved. I strongly suspect that you have a latent bug lurking in the background. Chuck Let me explain what I am doing and see if anyone has any insight. I have a datamodel with the following: Users (identifier Integer, username string, password string) Pages (identifier Integer, PageDescription string, active integer, position Integer) Questions (identifier integer, questiontext string, pageidentifier integer, active integer) Question Lookup Values (identifier, descriptivetext string, active integer) UserAnswers(identifier integer, useridentifier integer, questionidentifier integer, answeridentifier integer) Pretty simple. A user can access any page, any question on a page, and answer a question only once. So I created an entity: useranswers ( User, Question, Answer(would contain a question lookup) ) Pages can have one or more questions, Questions can have zero or more Question Lookup Values. More than one question can relate to a question lookup value. So the relationship looks like this: Pages <-->> Questions <<-->> Lookup Values User <-->> UserAnswers <<--> Question So what I have done is create a component that takes a User as a property when it is created setUser(...). I then created a WODisplayGroup for Pages with no detail. I then created a WODisplayGroup for Questions with detail pointing to pages. I then created a WODisplayGroup for UserAnswers with detail pointing to questions. The issue I have with the UserAnswers displaygroup is that it also requires a qualification to a User as well as a question. N problemo, I use the queryMatch().setValueForKey(theUserObject,"theUser"). Now here is where I run into issues, Question.theAnswers relationship returns an NSArray because it is a to-many. How do I bind this to the selection property of a WOPopupButton, I can't that I know of.> Don On Sep 21, 2009, at 4:31 PM, Chuck Hill wrote: On Sep 21, 2009, at 1:17 PM, Don Lindsay wrote: Hello; I have a component that I am updating a table of answers based on selections made by the user from a worepitition. The code being executed is: try { String sEoQualifierText = "page="; sEoQualifierText += Integer.toString((Integer)thePage().valueForKey("identifier")); sEoQualifierText += " and question="; sEoQualifierText += Integer .toString((Integer)theQuestion().valueForKey("identifier")); sEoQualifierText += " and user="; sEoQualifierText += Integer.toString((Integer) ((EOEnterpriseObject)theUser).valueForKey("identifier")); EOQualifier oQual = EOQualifier.qualifierWithQualifierFormat(sEoQualifierText,null); What are you doing? And why? What is thePage().valueForKey("identifier")? Home brew binding sync? Generic Record based EOs with no Java classes? Wonder's ERXQ will make your life so much easier to read and maintain. EOFetchSpecification oFetch = new EOFetchSpecification("UserAnswers",oQual,null); NSArray aAnswer = oEO().objectsWithFetchSpecification(oFetch); oEO().lock(); Nooo. Why lock like that? Why not just gouge your eyes out and hammer pencils into your ears? It will be
[Reminder] The surveys
Hi guys, Don't forget the annual surveys (I really do hope that we are not down to 53 organizations, right?). The organization survey ; http://www.survs.com/survey?id=CRDU8UY3&channel=T8TGXAW70R The individual : http://www.survs.com/survey?id=21MIN2X6&channel=3O47WI4G11 WOWODC 2010 : http://www.survs.com/survey?id=7LC0Z7PS&channel=A6E0BC8FPU The org survey can be answered in 10 minutes, and only a couple of questions are required, so don't be afraid! ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
AjaxInPlace
Hi.. I'm using an AjaxInPlace component. I'd like to perform a validation. I bound the ajaxinplace with a saveaction. But... even if my "validation" fails, the edit template switch to the view template. I'd like to stay in the edit mode until either the user presses cancel or the validation is successful. I see the canSave bindings, but it is checked before the saveAction, so that binding is not the right one.. What can I use?? Francesco ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
On Sep 22, 2009, at 2:05 PM, Chuck Hill wrote: Here's my custom Prototype: Here's my attribute that implements the Boolean prototype: Not sure why that works and not inclined to dig into it right now. Agreed. Dave ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
On Sep 22, 2009, at 9:57 AM, David Avendasora wrote: On Sep 22, 2009, at 12:19 PM, Chuck Hill wrote: On Sep 22, 2009, at 9:07 AM, David Avendasora wrote: On Sep 22, 2009, at 11:29 AM, Freddie Tilley wrote: Value class of type NSNumber does not work for me, using a value class of java.lang.Boolean does. Interesting. It is odd to have a ValueType of c with a ValueClass of NSNumber... but it's working for me. Okay, Chuck, here's where you put your snide comment about my Modeling skills. :-P One cannot comment on what does not exist. :-P I'd want to see screen shots of each to be sure we are all talking about the same thing. Here's my custom Prototype: Here's my attribute that implements the Boolean prototype: Not sure why that works and not inclined to dig into it right now. Chuck 2009/9/22 David Avendasora : Okay, let's try it completely manually. Here's what I have setup in one of my custom Prototypes for MS SQL Server: External Type: bit Class: java.lang.Boolean Data Type: Custom - Custom External Width: Value Class: NSNumber Value Type: c Factory Method: ConversionMethod: Init Argument: These settings work for me in a current project that talks to a SQL Server 2000 DB. Dave On Sep 22, 2009, at 11:01 AM, Freddie Tilley wrote: This will give me class cast errors java.lang.Short cannot be cast to java.lang.Boolean 2009/9/22 David Avendasora : That prototype doesn't do what you think it does. That will convert the boolean value true to the string "true" and and false to "false" which obviously won't save into a bit column. Look at the intBoolean Wonder prototype. You may need to set the Prototype to "intNumber" first, and then to "intBoolean" to get it to work as I think there is a bug in Entity Modeler that doesn't properly update the external type when changing to "intBoolean". Dave On Sep 22, 2009, at 10:25 AM, Freddie Tilley wrote: the EOJDBCSQLServerPrototypes boolean type defaults to bit with a custom data type as follows: External Width: 5 Value Class: java.lang.Boolean Value type: c Factory Method: valueOf Conversion Method: toString Init Argument: String 2009/9/22 David Avendasora : Hi Freddie, I don't believe Microsoft SQL Server has a boolean datatype. What datatype are you using for the column in the DB? Dave On Sep 22, 2009, at 7:32 AM, Freddie Tilley wrote: I have a problem with writing a boolean value to the database, using the EOJDBCSQLServerPrototypes and the boolean type. I'm also using Chuck Hills MicrosoftPlugin. If I set the boolean to true when creating an object it actually sets this value in the db when saving. But if I edit the object again and set the boolean value to false. It will show the value as false in the list, but it will remain True in the database. And after this I cannot change the value to True anymore. What's going on here? Freddie Tilley ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects -- Chuck Hi
Re: Very interesting case
On Sep 22, 2009, at 2:32 AM, Don Lindsay wrote: Hello; I have a displayGroup displaying batches of 5 items per page. When a user clicks the next page, What is "clicks the next page"? If it is a WOHyperlink then the form values will not get submitted. You need to use a WOSubmitButton to send what the user entered to the app. Chuck which uses displayNextBatch() for the display group, if the user goes back to the previous page, all of their answers have been cleared as if they never entered anything. If I use a WOSubmit button to submit the changes and use saveChanges on the EO everything stays selected. But should a user be required to do this everytime they go to another batch? Is there something I can do to retain selected values across batches for when a user returns to the page, without issuing a savechanges via a WOSubmit? This is a very vanilla form, no code that is manipulating the EO objects, it is all done through WO Controls ,WORepetitions, and display groups. Thanks Don On Sep 21, 2009, at 10:45 PM, Chuck Hill wrote: On Sep 21, 2009, at 2:16 PM, Don Lindsay wrote: I know, I have been piddling with it and probably violated many commandments. That is not something that you can do and expect sane results. It is a binary sort of thing. Either you lock correctly and obey the commandments, or EOF.doCrazyThingsAtRandom(true). Your call. You seem to have found a work around, but that does not address why the EO was not getting saved. I strongly suspect that you have a latent bug lurking in the background. Chuck Let me explain what I am doing and see if anyone has any insight. I have a datamodel with the following: Users (identifier Integer, username string, password string) Pages (identifier Integer, PageDescription string, active integer, position Integer) Questions (identifier integer, questiontext string, pageidentifier integer, active integer) Question Lookup Values (identifier, descriptivetext string, active integer) UserAnswers(identifier integer, useridentifier integer, questionidentifier integer, answeridentifier integer) Pretty simple. A user can access any page, any question on a page, and answer a question only once. So I created an entity: useranswers ( User, Question, Answer(would contain a question lookup) ) Pages can have one or more questions, Questions can have zero or more Question Lookup Values. More than one question can relate to a question lookup value. So the relationship looks like this: Pages <-->> Questions <<-->> Lookup Values User <-->> UserAnswers <<--> Question So what I have done is create a component that takes a User as a property when it is created setUser(...). I then created a WODisplayGroup for Pages with no detail. I then created a WODisplayGroup for Questions with detail pointing to pages. I then created a WODisplayGroup for UserAnswers with detail pointing to questions. The issue I have with the UserAnswers displaygroup is that it also requires a qualification to a User as well as a question. N problemo, I use the queryMatch().setValueForKey(theUserObject,"theUser"). Now here is where I run into issues, Question.theAnswers relationship returns an NSArray because it is a to-many. How do I bind this to the selection property of a WOPopupButton, I can't that I know of.> Don On Sep 21, 2009, at 4:31 PM, Chuck Hill wrote: On Sep 21, 2009, at 1:17 PM, Don Lindsay wrote: Hello; I have a component that I am updating a table of answers based on selections made by the user from a worepitition. The code being executed is: try { String sEoQualifierText = "page="; sEoQualifierText += Integer.toString((Integer)thePage().valueForKey("identifier")); sEoQualifierText += " and question="; sEoQualifierText += Integer .toString((Integer)theQuestion().valueForKey("identifier")); sEoQualifierText += " and user="; sEoQualifierText += Integer.toString((Integer) ((EOEnterpriseObject)theUser).valueForKey("identifier")); EOQualifier oQual = EOQualifier.qualifierWithQualifierFormat(sEoQualifierText,null); What are you doing? And why? What is thePage().valueForKey("identifier")? Home brew binding sync? Generic Record based EOs with no Java classes? Wonder's ERXQ will make your life so much easier to read and maintain. EOFetchSpecification oFetch = new EOFetchSpecification("UserAnswers",oQual,null); NSArray aAnswer = oEO().objectsWithFetchSpecification(oFetch); oEO().lock(); Nooo. Why lock like that? Why not just gouge your eyes out and hammer pencils into your ears? It will be quicker and less painful and just as effective. Locking like that is useless and wrong and just won't work. Ever. Use ERXEC or the MultiECLockManager.
Re: WebObjects 5.4.3 and SQL Server 2005
On Sep 22, 2009, at 9:07 AM, David Avendasora wrote: On Sep 22, 2009, at 11:29 AM, Freddie Tilley wrote: Value class of type NSNumber does not work for me, using a value class of java.lang.Boolean does. Interesting. It is odd to have a ValueType of c with a ValueClass of NSNumber... but it's working for me. Okay, Chuck, here's where you put your snide comment about my Modeling skills. :-P One cannot comment on what does not exist. :-P I'd want to see screen shots of each to be sure we are all talking about the same thing. Chuck 2009/9/22 David Avendasora : Okay, let's try it completely manually. Here's what I have setup in one of my custom Prototypes for MS SQL Server: External Type: bit Class: java.lang.Boolean Data Type: Custom - Custom External Width: Value Class: NSNumber Value Type: c Factory Method: ConversionMethod: Init Argument: These settings work for me in a current project that talks to a SQL Server 2000 DB. Dave On Sep 22, 2009, at 11:01 AM, Freddie Tilley wrote: This will give me class cast errors java.lang.Short cannot be cast to java.lang.Boolean 2009/9/22 David Avendasora : That prototype doesn't do what you think it does. That will convert the boolean value true to the string "true" and and false to "false" which obviously won't save into a bit column. Look at the intBoolean Wonder prototype. You may need to set the Prototype to "intNumber" first, and then to "intBoolean" to get it to work as I think there is a bug in Entity Modeler that doesn't properly update the external type when changing to "intBoolean". Dave On Sep 22, 2009, at 10:25 AM, Freddie Tilley wrote: the EOJDBCSQLServerPrototypes boolean type defaults to bit with a custom data type as follows: External Width: 5 Value Class: java.lang.Boolean Value type: c Factory Method: valueOf Conversion Method: toString Init Argument: String 2009/9/22 David Avendasora : Hi Freddie, I don't believe Microsoft SQL Server has a boolean datatype. What datatype are you using for the column in the DB? Dave On Sep 22, 2009, at 7:32 AM, Freddie Tilley wrote: I have a problem with writing a boolean value to the database, using the EOJDBCSQLServerPrototypes and the boolean type. I'm also using Chuck Hills MicrosoftPlugin. If I set the boolean to true when creating an object it actually sets this value in the db when saving. But if I edit the object again and set the boolean value to false. It will show the value as false in the list, but it will remain True in the database. And after this I cannot change the value to True anymore. What's going on here? Freddie Tilley ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archi
Re: writing to nfs mounts
On Sep 22, 2009, at 7:43 AM, Gordon Belray wrote: Hey, we're having trouble writing to nfs mounts from within WebObjects. Even if we change ownership to appserver, it isn't writing. drwxrwxrwx 9 _appserver 100 4096 Sep 21 15:15 media drwxrwxrwx 2 _appserver 100 4096 Sep 21 19:18 mediaupload This has worked in the past for me, but in this case, the mounts are also mapped to different drives (our system admin did the setup). Any ideas? Do you get an exception? Are the GID and UID numbers the same on both machines for this group / user? Are the mounted drives on OS X? On the same version of OS X? Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Rewrite Rule
So, if you're going through apache and you have the two patterns set and not commented, it should rewrite. Make sure there is no space or so at the end of the pattern. Also, make sure you're running with the ERXWOContext54 in your classpath if you are using WO 5.4. Set a breakpoint in _rewriteUrl in ERXApplication and see whether it gets hit. If not, check whether the WOContext class you're using is an ERXWOContext and if you are running 5.4, this won't work. Guido -- http://www.event-s.net On 21. Sep. 2009, at 22:33 , ute Hoffmann wrote: Upps, I think so. At which Property do I have to look to know. I run in deployment and definitley come via apache but I have not set anything deliberately. I'm a new wonder user so maybe I overlooked something...? Am 21.09.2009 um 18:17 schrieb Guido Neitzer: Are you running in WebServer connect mode? cug -- http://www.event-s.net On 20. Sep. 2009, at 02:02 , ute Hoffmann wrote: Hi, should this work for applications which have a session as well, or will it work only for sessionless apps? * * er.extensions.ERXApplication.replaceApplicationPath.pattern=/cgi- bin/WebObjects/YourApp.woa * er.extensions.ERXApplication.replaceApplicationPath.replace=/ yourapp * * * and in Apache 2.2: * * RewriteRule ^/yourapp(.*)$ /cgi-bin/WebObjects/YourApp.woa$1 [PT,L] * * * or Apache 1.3: * * RewriteRule ^/yourapp(.*)$ /cgi-bin/WebObjects/YourApp.woa$1 [P,L] * I put it into the properties file of an Application, but nothing changed in the way the URL's were displayed. I use WOHyperlinks which call directActions with parameters and have a session. I have the Application extend a Application class in a framework which then in turn extends ERXApplication. Could that be part of my problem? But the Application starts up ok, and the added properties are in the logfile, so I THINK they should be seen... Probably this is very basic, sorry. Thanks for your help. Regards, Ute ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/guido.neitzer%40gmail.com This email sent to guido.neit...@gmail.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
On Sep 22, 2009, at 11:29 AM, Freddie Tilley wrote: Value class of type NSNumber does not work for me, using a value class of java.lang.Boolean does. Interesting. It is odd to have a ValueType of c with a ValueClass of NSNumber... but it's working for me. Okay, Chuck, here's where you put your snide comment about my Modeling skills. :-P Dave Thanks! 2009/9/22 David Avendasora : Okay, let's try it completely manually. Here's what I have setup in one of my custom Prototypes for MS SQL Server: External Type: bit Class: java.lang.Boolean Data Type: Custom - Custom External Width: Value Class: NSNumber Value Type: c Factory Method: ConversionMethod: Init Argument: These settings work for me in a current project that talks to a SQL Server 2000 DB. Dave On Sep 22, 2009, at 11:01 AM, Freddie Tilley wrote: This will give me class cast errors java.lang.Short cannot be cast to java.lang.Boolean 2009/9/22 David Avendasora : That prototype doesn't do what you think it does. That will convert the boolean value true to the string "true" and and false to "false" which obviously won't save into a bit column. Look at the intBoolean Wonder prototype. You may need to set the Prototype to "intNumber" first, and then to "intBoolean" to get it to work as I think there is a bug in Entity Modeler that doesn't properly update the external type when changing to "intBoolean". Dave On Sep 22, 2009, at 10:25 AM, Freddie Tilley wrote: the EOJDBCSQLServerPrototypes boolean type defaults to bit with a custom data type as follows: External Width: 5 Value Class: java.lang.Boolean Value type: c Factory Method: valueOf Conversion Method: toString Init Argument: String 2009/9/22 David Avendasora : Hi Freddie, I don't believe Microsoft SQL Server has a boolean datatype. What datatype are you using for the column in the DB? Dave On Sep 22, 2009, at 7:32 AM, Freddie Tilley wrote: I have a problem with writing a boolean value to the database, using the EOJDBCSQLServerPrototypes and the boolean type. I'm also using Chuck Hills MicrosoftPlugin. If I set the boolean to true when creating an object it actually sets this value in the db when saving. But if I edit the object again and set the boolean value to false. It will show the value as false in the list, but it will remain True in the database. And after this I cannot change the value to True anymore. What's going on here? Freddie Tilley ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: DirectAction with cookies and session
Doh! I needed to add the session id through SWFUpload post params not through directActionURLForActionNamed's query dictionary. thanks. -fw Chuck Hill 09/21/2009 09:53 PM To Fred Wells cc webobjects-dev@lists.apple.com Subject Re: DirectAction with cookies and session On Sep 21, 2009, at 1:19 PM, Fred Wells wrote: > > Hello, > If I missed this I apologize but I can't seem to find anything on > this. I'm trying to test out SWFUpload within one of my WO apps. > It is currently set up to store sessionID in cookies. SWFUpload > needs a post-upload URL for processing, I need the session > information to be > available to that URL. How are you making the URL? Cookies should be OK. Or the URL can have ?wosid= > I can't seem to get DirectAction to 'isSessionIDInRequest' always > comes up false and 'sessionID' always is null. I've tried > constructing the URL through WOActionURL and > 'directActionURLForActionNamed'. WOActionURL? WOContext you mean? If you are doing this in Java, WOContext.directActionURLForActionNamed should do what you want. > Both make a [what looks like] a valid directaction URL. > But when sent it never finds the session from the cookie. Is there > something else I have to do when trying to use a DirectAction in a > session? Log out the request headers. Is the cookie in there? Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects Disclaimer The information in this email and any attachments may contain proprietary and confidential information that is intended for the addressee(s) only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, retention or use of the contents of this information is prohibited. When addressed to our clients or vendors, any information contained in this e-mail or any attachments is subject to the terms and conditions in any governing contract. If you have received this e-mail in error, please immediately contact the sender and delete the e-mail. ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
Value class of type NSNumber does not work for me, using a value class of java.lang.Boolean does. Thanks! 2009/9/22 David Avendasora : > Okay, let's try it completely manually. > Here's what I have setup in one of my custom Prototypes for MS SQL Server: > External Type: bit > Class: java.lang.Boolean > Data Type: Custom - Custom > External Width: > Value Class: NSNumber > Value Type: c > Factory Method: > ConversionMethod: > Init Argument: > These settings work for me in a current project that talks to a SQL Server > 2000 DB. > Dave > > On Sep 22, 2009, at 11:01 AM, Freddie Tilley wrote: > > This will give me class cast errors > > java.lang.Short cannot be cast to java.lang.Boolean > > > 2009/9/22 David Avendasora : > > That prototype doesn't do what you think it does. That will convert the > > boolean value true to the string "true" and and false to "false" which > > obviously won't save into a bit column. > > Look at the intBoolean Wonder prototype. You may need to set the Prototype > > to "intNumber" first, and then to "intBoolean" to get it to work as I think > > there is a bug in Entity Modeler that doesn't properly update the external > > type when changing to "intBoolean". > > Dave > > On Sep 22, 2009, at 10:25 AM, Freddie Tilley wrote: > > the EOJDBCSQLServerPrototypes boolean type defaults to bit with a > > custom data type as follows: > > External Width: 5 > > Value Class: java.lang.Boolean > > Value type: c > > Factory Method: valueOf > > Conversion Method: toString > > Init Argument: String > > 2009/9/22 David Avendasora : > > Hi Freddie, > > I don't believe Microsoft SQL Server has a boolean datatype. What > > datatype > > are you using for the column in the DB? > > Dave > > > On Sep 22, 2009, at 7:32 AM, Freddie Tilley wrote: > > I have a problem with writing a boolean value to the database, using > > the EOJDBCSQLServerPrototypes and the boolean type. I'm also > > using Chuck Hills MicrosoftPlugin. > > If I set the boolean to true when creating an object it actually sets > > this value in the db when saving. > > But if I edit the object again and set the boolean value to false. It > > will show the value as false in the list, but it will remain True > > in the database. And after this I cannot change the value to True > > anymore. > > What's going on here? > > Freddie Tilley > > ___ > > Do not post admin requests to the list. They will be ignored. > > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > > Help/Unsubscribe/Update your Subscription: > > > http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com > > This email sent to webobje...@avendasora.com > > > > > ___ > > Do not post admin requests to the list. They will be ignored. > > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > > Help/Unsubscribe/Update your Subscription: > > http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com > > This email sent to webobje...@avendasora.com > > > > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com > > This email sent to webobje...@avendasora.com > > > > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
Okay, let's try it completely manually. Here's what I have setup in one of my custom Prototypes for MS SQL Server: External Type: bit Class: java.lang.Boolean Data Type: Custom - Custom External Width: Value Class: NSNumber Value Type: c Factory Method: ConversionMethod: Init Argument: These settings work for me in a current project that talks to a SQL Server 2000 DB. Dave On Sep 22, 2009, at 11:01 AM, Freddie Tilley wrote: This will give me class cast errors java.lang.Short cannot be cast to java.lang.Boolean 2009/9/22 David Avendasora : That prototype doesn't do what you think it does. That will convert the boolean value true to the string "true" and and false to "false" which obviously won't save into a bit column. Look at the intBoolean Wonder prototype. You may need to set the Prototype to "intNumber" first, and then to "intBoolean" to get it to work as I think there is a bug in Entity Modeler that doesn't properly update the external type when changing to "intBoolean". Dave On Sep 22, 2009, at 10:25 AM, Freddie Tilley wrote: the EOJDBCSQLServerPrototypes boolean type defaults to bit with a custom data type as follows: External Width: 5 Value Class: java.lang.Boolean Value type: c Factory Method: valueOf Conversion Method: toString Init Argument: String 2009/9/22 David Avendasora : Hi Freddie, I don't believe Microsoft SQL Server has a boolean datatype. What datatype are you using for the column in the DB? Dave On Sep 22, 2009, at 7:32 AM, Freddie Tilley wrote: I have a problem with writing a boolean value to the database, using the EOJDBCSQLServerPrototypes and the boolean type. I'm also using Chuck Hills MicrosoftPlugin. If I set the boolean to true when creating an object it actually sets this value in the db when saving. But if I edit the object again and set the boolean value to false. It will show the value as false in the list, but it will remain True in the database. And after this I cannot change the value to True anymore. What's going on here? Freddie Tilley ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
This will give me class cast errors java.lang.Short cannot be cast to java.lang.Boolean 2009/9/22 David Avendasora : > That prototype doesn't do what you think it does. That will convert the > boolean value true to the string "true" and and false to "false" which > obviously won't save into a bit column. > > Look at the intBoolean Wonder prototype. You may need to set the Prototype > to "intNumber" first, and then to "intBoolean" to get it to work as I think > there is a bug in Entity Modeler that doesn't properly update the external > type when changing to "intBoolean". > > Dave > > On Sep 22, 2009, at 10:25 AM, Freddie Tilley wrote: > >> the EOJDBCSQLServerPrototypes boolean type defaults to bit with a >> custom data type as follows: >> >> External Width: 5 >> Value Class: java.lang.Boolean >> Value type: c >> Factory Method: valueOf >> Conversion Method: toString >> Init Argument: String >> >> 2009/9/22 David Avendasora : >>> >>> Hi Freddie, >>> >>> I don't believe Microsoft SQL Server has a boolean datatype. What >>> datatype >>> are you using for the column in the DB? >>> >>> Dave >>> >>> >>> On Sep 22, 2009, at 7:32 AM, Freddie Tilley wrote: >>> I have a problem with writing a boolean value to the database, using the EOJDBCSQLServerPrototypes and the boolean type. I'm also using Chuck Hills MicrosoftPlugin. If I set the boolean to true when creating an object it actually sets this value in the db when saving. But if I edit the object again and set the boolean value to false. It will show the value as false in the list, but it will remain True in the database. And after this I cannot change the value to True anymore. What's going on here? Freddie Tilley ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com >>> >>> >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> >> http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com >> >> This email sent to webobje...@avendasora.com >> >> > > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
On Sep 22, 2009, at 10:39 AM, David Avendasora wrote: I think there is a bug in Entity Modeler that doesn't properly update the external type when changing to "intBoolean". And yes, I'll finally create a Jira ticket for this. :-) Dave ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
writing to nfs mounts
Hey, we're having trouble writing to nfs mounts from within WebObjects. Even if we change ownership to appserver, it isn't writing. drwxrwxrwx 9 _appserver 100 4096 Sep 21 15:15 media drwxrwxrwx 2 _appserver 100 4096 Sep 21 19:18 mediaupload This has worked in the past for me, but in this case, the mounts are also mapped to different drives (our system admin did the setup). Any ideas? Thanks, Gordon Gordon Belray Application Programmer Information Technology Services University of Toronto Libraries gordon.bel...@utoronto.ca 416-946-8617 w 416-427-7007 m ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
That prototype doesn't do what you think it does. That will convert the boolean value true to the string "true" and and false to "false" which obviously won't save into a bit column. Look at the intBoolean Wonder prototype. You may need to set the Prototype to "intNumber" first, and then to "intBoolean" to get it to work as I think there is a bug in Entity Modeler that doesn't properly update the external type when changing to "intBoolean". Dave On Sep 22, 2009, at 10:25 AM, Freddie Tilley wrote: the EOJDBCSQLServerPrototypes boolean type defaults to bit with a custom data type as follows: External Width: 5 Value Class: java.lang.Boolean Value type: c Factory Method: valueOf Conversion Method: toString Init Argument: String 2009/9/22 David Avendasora : Hi Freddie, I don't believe Microsoft SQL Server has a boolean datatype. What datatype are you using for the column in the DB? Dave On Sep 22, 2009, at 7:32 AM, Freddie Tilley wrote: I have a problem with writing a boolean value to the database, using the EOJDBCSQLServerPrototypes and the boolean type. I'm also using Chuck Hills MicrosoftPlugin. If I set the boolean to true when creating an object it actually sets this value in the db when saving. But if I edit the object again and set the boolean value to false. It will show the value as false in the list, but it will remain True in the database. And after this I cannot change the value to True anymore. What's going on here? Freddie Tilley ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to webobje...@avendasora.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects 5.4.3 and SQL Server 2005
the EOJDBCSQLServerPrototypes boolean type defaults to bit with a custom data type as follows: External Width: 5 Value Class: java.lang.Boolean Value type: c Factory Method: valueOf Conversion Method: toString Init Argument: String 2009/9/22 David Avendasora : > Hi Freddie, > > I don't believe Microsoft SQL Server has a boolean datatype. What datatype > are you using for the column in the DB? > > Dave > > > On Sep 22, 2009, at 7:32 AM, Freddie Tilley wrote: > >> I have a problem with writing a boolean value to the database, using >> the EOJDBCSQLServerPrototypes and the boolean type. I'm also >> using Chuck Hills MicrosoftPlugin. >> >> If I set the boolean to true when creating an object it actually sets >> this value in the db when saving. >> >> But if I edit the object again and set the boolean value to false. It >> will show the value as false in the list, but it will remain True >> in the database. And after this I cannot change the value to True anymore. >> >> What's going on here? >> >> Freddie Tilley >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> >> http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com >> >> This email sent to webobje...@avendasora.com >> >> > > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
WebObjects 5.4.3 and SQL Server 2005
I have a problem with writing a boolean value to the database, using the EOJDBCSQLServerPrototypes and the boolean type. I'm also using Chuck Hills MicrosoftPlugin. If I set the boolean to true when creating an object it actually sets this value in the db when saving. But if I edit the object again and set the boolean value to false. It will show the value as false in the list, but it will remain True in the database. And after this I cannot change the value to True anymore. What's going on here? Freddie Tilley ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Very interesting case
Hello; I have a displayGroup displaying batches of 5 items per page. When a user clicks the next page, which uses displayNextBatch() for the display group, if the user goes back to the previous page, all of their answers have been cleared as if they never entered anything. If I use a WOSubmit button to submit the changes and use saveChanges on the EO everything stays selected. But should a user be required to do this everytime they go to another batch? Is there something I can do to retain selected values across batches for when a user returns to the page, without issuing a savechanges via a WOSubmit? This is a very vanilla form, no code that is manipulating the EO objects, it is all done through WO Controls ,WORepetitions, and display groups. Thanks Don On Sep 21, 2009, at 10:45 PM, Chuck Hill wrote: On Sep 21, 2009, at 2:16 PM, Don Lindsay wrote: I know, I have been piddling with it and probably violated many commandments. That is not something that you can do and expect sane results. It is a binary sort of thing. Either you lock correctly and obey the commandments, or EOF.doCrazyThingsAtRandom(true). Your call. You seem to have found a work around, but that does not address why the EO was not getting saved. I strongly suspect that you have a latent bug lurking in the background. Chuck Let me explain what I am doing and see if anyone has any insight. I have a datamodel with the following: Users (identifier Integer, username string, password string) Pages (identifier Integer, PageDescription string, active integer, position Integer) Questions (identifier integer, questiontext string, pageidentifier integer, active integer) Question Lookup Values (identifier, descriptivetext string, active integer) UserAnswers(identifier integer, useridentifier integer, questionidentifier integer, answeridentifier integer) Pretty simple. A user can access any page, any question on a page, and answer a question only once. So I created an entity: useranswers ( User, Question, Answer(would contain a question lookup) ) Pages can have one or more questions, Questions can have zero or more Question Lookup Values. More than one question can relate to a question lookup value. So the relationship looks like this: Pages <-->> Questions <<-->> Lookup Values User <-->> UserAnswers <<--> Question So what I have done is create a component that takes a User as a property when it is created setUser(...). I then created a WODisplayGroup for Pages with no detail. I then created a WODisplayGroup for Questions with detail pointing to pages. I then created a WODisplayGroup for UserAnswers with detail pointing to questions. The issue I have with the UserAnswers displaygroup is that it also requires a qualification to a User as well as a question. N problemo, I use the queryMatch().setValueForKey(theUserObject,"theUser"). Now here is where I run into issues, Question.theAnswers relationship returns an NSArray because it is a to-many. How do I bind this to the selection property of a WOPopupButton, I can't that I know of. <> Don On Sep 21, 2009, at 4:31 PM, Chuck Hill wrote: On Sep 21, 2009, at 1:17 PM, Don Lindsay wrote: Hello; I have a component that I am updating a table of answers based on selections made by the user from a worepitition. The code being executed is: try { String sEoQualifierText = "page="; sEoQualifierText += Integer.toString((Integer)thePage().valueForKey("identifier")); sEoQualifierText += " and question="; sEoQualifierText += Integer.toString((Integer)theQuestion().valueForKey("identifier")); sEoQualifierText += " and user="; sEoQualifierText += Integer.toString((Integer) ((EOEnterpriseObject)theUser).valueForKey("identifier")); EOQualifier oQual = EOQualifier.qualifierWithQualifierFormat(sEoQualifierText,null); What are you doing? And why? What is thePage().valueForKey("identifier")? Home brew binding sync? Generic Record based EOs with no Java classes? Wonder's ERXQ will make your life so much easier to read and maintain. EOFetchSpecification oFetch = new EOFetchSpecification("UserAnswers",oQual,null); NSArray aAnswer = oEO().objectsWithFetchSpecification(oFetch); oEO().lock(); Nooo. Why lock like that? Why not just gouge your eyes out and hammer pencils into your ears? It will be quicker and less painful and just as effective. Locking like that is useless and wrong and just won't work. Ever. Use ERXEC or the MultiECLockManager. Your chances of doing it right another other way approach null. ((UserAnswers )aAnswer .objectAtIndex(0)).setTheAnswer((QuestionLookup)theAnswer()); //((EOEnterpriseObject)aAnswer.objectAtIndex(0)).willChange
Re: WebObjects and dependency injection (DI)
On Sep 22, 2009, at 11:31 AM, Andrus Adamchik wrote: We normally use Class.forName().newInstance() in some way or other to handle that. So can DI help me there? If yes, how? Also there's a number of standard scenarios, where you can swap the actual service implementation behind the immutable injected interface proxy for a short period of time (e.g. within a request thread). A backend service may have request object injected in it, and when a service method is called within the request scope, the right request object is dynamically bound to the interface proxy. (Of course WORequest is not an interface, so it will require more indirection in WO). In the same way you can bind your own request-scoped implementations of your custom services somewhere in the beginning of the request. And this transparently sets the execution context for all you other services and components. Andrus ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Recommendations for deployment on VPS?
On 20/09/2009, at 4:41 PM, Chan Yeow Heong, Jerome wrote: Does anyone have any recommendations of which VPS hosting provider / solution to use for a deployment of a WebObjects application? :P I have some apps deployed on a VPS at eapps.com (CentOS) under JavaMonitor. -- Paul. w http://logicsquad.net/ h http://paul.hoadley.name/ ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Proper Wonder/App Initialization for testing
Here is what we do using JUnit 4: 1. Add a super-class for all your test classes, e.g.: public class IntegrationTest { @BeforeClass public static void init() { ERXExtensions.initApp(Application.class, new String[0]); } } 2. Extend your test classes from IntegrationTest, e.g.: public class ArtistTest extends IntegrationTest { @Test public void songsAreDeletedWhenArtistIsDeleted() { // Create test objects assertThat(...); } Normally, we have 3 types of tests: 1. Unit tests (do not require app initialization, use mocks, run with JUnit, are very fast). 2. Integration tests (require app initialization, use real db, run with JUnit, are slow). 3. Acceptance tests (require running app, use real db and browser, run with Selenium or WebDriver, are very slow). And we have three source folders for each kind of tests: 1. Tests/Unit 2. Tests/Integration 3. Tests/Acceptance Unit and Integration tests can be run from Eclipse using JUnit runner by choosing "Run As -> JUnit Test" either on the whole Tests/... folder or on specific test. Unit tests are also run from Hudson using ant upon each commit. Integration and Acceptance tests are too slow and are run once a day or manually before deployment. ps: @BeforeSuite would most probably work as well (it's just we are not using TestNG). On Mon, Sep 21, 2009 at 7:55 PM, Greg Brown wrote: > Hi, > > I converted an app to use Wonder, and I think my tests need do do something > new so that all the Wonder stuff initializes properly. > > This page: > http://wiki.objectstyle.org/confluence/display/WONDER/Integrate+Wonder+Into+an+Existing+Application > > has nothing about tests ;>o > > Unit type tests seem to run fine without initializing the wonder frameworks, > but database type (dbuinit) tests probably need the wonder stuff to be > properly initialized. > > ERXExtensions has a bunch of initApp, initEOF, initialize methods, which one > is generally best for testNG / dbuinit initializations? Or do I need > something like an initApp followed by a initEOF? > > How do people handle this? a @BeforeSuite annotation to a method which calls > some er.extensions.ERXExtensions.initFoo()? > > > > Thanks, > > gb > > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/dfrolov%40demax.ru > > This email sent to dfro...@demax.ru > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects and dependency injection (DI)
On Sep 22, 2009, at 9:07 AM, Anjo Krank wrote: My argument being, I have a lot of code that depends on various "services" and their instantiation. But 90% of the time, this code depends on user input, program state and external stuff. It's very rare that I actually know at compile time what implementation I have. We normally use Class.forName().newInstance() in some way or other to handle that. So can DI help me there? If yes, how? DI is just an environment to help you with your interface-based design. Nothing prevents you from writing a dynamic strategy-based service. At the same time DI it can simplify the public API of your services in many cases by removing environment-specific arguments from your method signatures. E.g.: ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, model.name()); ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, dbc); ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, channel); may become ERXSQLHelper sqlHelper = sqlHelperService.newSQLHelper(model.name()); ERXSQLHelper sqlHelper = sqlHelperService.newSQLHelper(dbc); ERXSQLHelper sqlHelper = sqlHelperService.newSQLHelper(channel); So here you don't need to pass ec to the method as it is injected in sqlHelperService behind the scenes. This means that you don't need to carry over all needed parameters through the call chain, just to pass it down to some method. It creates some really nice refactoring opportunities, and again - it reduces coupling of the public API. I should say I didn't get DI in theory until I tried it. Just like many programming optimizations (say OO vs. procedural) this is about a better abstraction which is not really obvious until you start using it. Andrus ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multi-Tenant Data Architecture
Hi Henrique, This thread may be of interest: http://lists.apple.com/archives/webobjects-dev//2007/Jul/msg00390.html We are still using the approach described by Eugene in this thread. On Sat, Sep 19, 2009 at 7:09 PM, Henrique Prange wrote: > Hi all, > > Is there a way to configure EOF to access separate databases for each tenant > in *one* application? > > I'm working in an application that has a strong non-functional requirement > on multi-tenant architecture with isolated database access. > > I've seen some discussion related with this subject, but it was not clear to > me how could I implement this kind of stuff. > > Any directions are really appreciated. > > Cheers, > > Henrique > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/dfrolov%40demax.ru > > This email sent to dfro...@demax.ru > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects and dependency injection (DI)
On Sep 22, 2009, at 10:50 AM, Lachlan Deck wrote: Yeah, this is what I assumed Anjo was getting at - after some thought, of course (as Anjo's usually the king of succinctness :) It seems to me that factory instantiations (as above) and/or making use of delegates provides all the opportunities for environment/ context-based switching that DI promises. i.e., both delegate style and DI style require the declaration of injection points and interfaces to implement, factories providing all the opportunities for custom implementations etc... so Andrus would you like to elaborate on why you think DI would be particularly advantageous over these given that it would require hacks? I haven't said it would be advantageous under WO. This remains to be seen. WO is not built for DI, so slapping it on top is going against the flow. That much I can see already. Andrus ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
WebObjects jobs in Paris
Hi guys, Some of you know me as a Sophiacom employee. But I'm also working for another company and we are looking for WO developers. See below the job description. Please email your applications to h...@bebook.com . Have a good day. Philippe Rabier - bebook recruits 4 software engineers based in the Paris area : Overall job description This position is for a senior software development lead who will take responsibility for end-to-end design of key modules of the bebook application. He/she will join a start-up team that is finalizing an application to create, distribute, search and consult catalogs. As bebook is expected to face rapid user base growth, he/she will bring is expertise in developing robust and secure applications while innovating to make it easy to use and attractive. Role As member of the bebook's IT team, you will participate in : product requirements technical and feasibility analysis design and development of the WebObject server application application security and performances optimization implementation from prototype to production Experience 5+ year experience in client-server applications.development Knowledge in following environments : WebObjects, Wonder, XHTML/CSS (or equivalent) Previous experience with Flex/Air, JavaScript, Maven would be an advantage Expertise in application deployment with focus on security and database optimization Application development and maintenance in hyper user base growth Profile Self starter Organized team spirited Thrive in a start up environment Company Created in june 2008 and based in Paris, France, bebook is finalizing a SaaS offering targeted at a broad audience: B2B: creation and publication of catalogs, CRM and e-commerce B2C: portal for research and consultation of catalogs bebook is expanding the team to move from pilot to production environment and enhance applications that will be available to its customers. ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects and dependency injection (DI)
On 22/09/2009, at 1:18 AM, Henrique Prange wrote: Andrus Adamchik wrote: I know it is not the traditional "WO way" of doing things, but from my experience using a dependency injection container in your app (Spring, Guice, etc.) is one single thing that you can do to dramatically improve the design quality, and produce flexible and maintainable code. We have been using Guice with WO for some time in our projects. Our code become easier to test without requiring too much boilerplate code using a DI container. Are you able to provide (if you've got time) some more concrete examples of what was easier? WO does a bit of that on its own (such as session and application injection in components), but doesn't bundle a container that a developer could use for the custom "services" (unlike say Tapestry, that does have a DI container at its core). Say I have a WO application and I'd like to use Spring or Guice to inject custom services in the WOComponents, instead of looking them up in WOApplication (or worse - defining them as static singletons somewhere). This sounds easy on the surface. I don't remember all the component creation internals now (it's been a while since I poked around the framework code), but I am pretty sure I can create them with my own factory that is DI container aware. On the other hand (also because I've been out of the loop on WO for quite some time), I am sure I am missing some pieces of the puzzle that would make such setup less practical or outright painful. Instead of changing component creation internals, we've created an extension of ERXComponent that obtain the injector and inject the required members. It is not a perfect solution (you can't use constructor injection this way), but it is easy to implement. Why would you want constructor injection for WOComponents? This and the fact that DI capabilities don't seem to bother the rest of the community, I figured I'd ask the list on your opinions, while I am trying to wire this thing up in the background. So anybody played with DI-on-WO in some form with any success? We have an audit framework completely based on Guice. We have created extensions of other important classes to make it possible, like ERXGenericRecord and ERXEC and we have created a @WOSessionScoped scope to create/obtain objects per WOSession. Just a question, Henrique: wouldn't it be better to use an ERXEC custom factory so that every ec created (even by included frameworks) are able to be scoped correctly in this sense? We are planning to create an open source framework with this stuff. We are just polishing what we've done to use some new features of Guice 2.0. Cheers, Henrique ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/lachlan.deck%40gmail.com This email sent to lachlan.d...@gmail.com with regards, -- Lachlan Deck ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects and dependency injection (DI)
On 22/09/2009, at 4:07 PM, Anjo Krank wrote: I'm not sure you understand... the String thing is only the bottleneck. I have caller code like: ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, model.name ()); ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, dbc); ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, channel); Surely you don't suggest I need to create a "module" in every top- level caller? My argument being, I have a lot of code that depends on various "services" and their instantiation. But 90% of the time, this code depends on user input, program state and external stuff. It's very rare that I actually know at compile time what implementation I have. We normally use Class.forName().newInstance() in some way or other to handle that. So can DI help me there? If yes, how? Yeah, this is what I assumed Anjo was getting at - after some thought, of course (as Anjo's usually the king of succinctness :) It seems to me that factory instantiations (as above) and/or making use of delegates provides all the opportunities for environment/ context-based switching that DI promises. i.e., both delegate style and DI style require the declaration of injection points and interfaces to implement, factories providing all the opportunities for custom implementations etc... so Andrus would you like to elaborate on why you think DI would be particularly advantageous over these given that it would require hacks? And Kieran: properties are there to make things *easier* I wouldn't want to avoid if's at the cost of putting every constructor in there... I dread the guy who has to deal with that after you... Cheers, Anjo Am 22.09.2009 um 00:11 schrieb Henrique Prange: Hi Anjo, You would not need a static method to create new ERXSQLHelper objects if you were using a DI container. For example, using Guice you could declare a helper property that must be injected. @Inject ERXSQLHelper helper; If you were too lazy you could let the user define which implementation to use. For example, using Guice this is achieved with a Module with the following binding: bind(ERXSQLHelper.class).to(OracleSQLHelper.class); If I had to implement this using Guice, I would create an ERXSQLHelper provider that would return the right ERXSQLHelper based on the chosen database. Of course, to avoid the same code (nested ifs) inside the provider, I would refactor the way the database type is defined too. IMHO, one advantage of this approach is I could create my own extension of ERXSQLHelper class and bind to all ERXSQLHelper declarations easily. I just need to create my own Module with the following code: bind(ERXSQLHelper.class).to(MyOwnSQLHelper.class); I could do the same thing with the current implementation, but I need to set a property that is not type safe and you had to write a lot of boilerplate code to support this. Guice fail fast mechanism also helps to find problems earlier. If something is wrong with the bindings, an exception is thrown as soon as you create the Injector. In your example, I would get a NoClassDefFound in runtime, during a very important presentation, of course. :p And last, but not least, you could bind a MockERXSQLHelper class when unit testing classes that depend upon ERXSQLHelper. Cheers, Henrique Anjo Krank wrote: U-huh. So how about a real world example and not these cooked up things. Take a look at the ERXSQLHelper. Depending on various types of input it creates a concrete subclass. Can DI change this to sth more "clean"? Cheers, Anjo public static ERXSQLHelper newSQLHelper(String databaseProductName) { synchronized (_sqlHelperMap) { ERXSQLHelper sqlHelper = _sqlHelperMap.get(databaseProductName); if (sqlHelper == null) { try { String sqlHelperClassName = ERXProperties.stringForKey (databaseProductName + ".SQLHelper"); if (sqlHelperClassName == null) { if (databaseProductName.equalsIgnoreCase("frontbase")) { sqlHelper = new FrontBaseSQLHelper(); } else if (databaseProductName.equalsIgnoreCase("mysql")) { sqlHelper = new MySQLSQLHelper(); } else if (databaseProductName.equalsIgnoreCase("oracle")) { sqlHelper = new OracleSQLHelper(); } else if (databaseProductName.equalsIgnoreCase ("postgresql")) { sqlHelper = new PostgresqlSQLHelper(); } else if (databaseProductName.equalsIgnoreCase ("openbase")) { sqlHelper = new OpenBaseSQLHelper(); } else if (databaseProductName.equalsIgnoreCase("derby")) { sqlHelper = new DerbySQLHelper(); } else if (databaseProductName.equalsIgnoreCase ("microsoft")) { sqlHelper = new MicrosoftSQLHelper(); } else { try { sqlHelper = (ERXSQLHel