Re: D2W Auto-Qualifying all listings
Re: D2W Auto-Qualifying all listings
- Subject: Re: D2W Auto-Qualifying all listings
- From: Chuck Hill <email@hidden>
- Date: Tue, 21 Sep 2010 14:04:30 -0700
On Sep 21, 2010, at 2:03 PM, David LeBer wrote:
>
> On 2010-09-21, at 4:25 PM, Chuck Hill wrote:
>
>>
>> On Sep 21, 2010, at 1:17 PM, Daniel Beatty wrote:
>>
>>> Greetings Chuck,
>>> Well, I decided to try going through WOLips as opposed to Hudson. I added the MySQL plugin and got a lot farther, but I am still running into some trouble. This time at the "Release" table. In particular, MySQL complains about:
>>>
>>> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE(DATE_DUE DATETIME NOT NULL, ID INTEGER NOT NULL, IS_OPEN INTEGER NOT NUL' at line 1
>>>
>>>
>>>
>>> Now the "NUL" looks suspicious, and the real question is how do I fix it?
>>
>> My guess is that this is a Red Herring. It is just showing you 80 characters (count them!) of context surrounding the error.
>>
>> Some guesses:
>> - ID is a reserved word in MySQL
>
> Nope, I use ID all the time. However... RELEASE is (tada!).
I would have been guessing a LONG time before I guessed that.
>
>> - one of the data types is wrong (wrong JDBC driver / version?)
>>
>>
>> Chuck
>>
>>
>>> On Sep 21, 2010, at 12:18 PM, Chuck Hill wrote:
>>>
>>>> You need to add the plugin framework to the classpath file in App.woa/Contents/MacOs/something
>>>>
>>>>
>>>>
>>>> On Sep 21, 2010, at 12:04 PM, Daniel Beatty wrote:
>>>>
>>>>> Greetings David,
>>>>> Looks like you are right. Here, I though I had it loaded with Hudson, but I was mistaken. Now I have copied over to /Library/Frameworks. Of course, that failed. I also tried copying my properties so that I have:
>>>>> ( cd /Library/WebObjects/JavaApplications/BugTracker.woa ;
>>>>> ./BugTracker \
>>>>> -Der.javamail.centralize=false \
>>>>> -Der.extensions.ERXApplication.developmentMode=true \
>>>>> -DdbConnectURLGLOBAL=jdbc:mysql://localhost/bug?capitalizeTypenames=true \
>>>>> -DdbConnectUserGLOBAL=bugUser \
>>>>> -DdbConnectPasswordGLOBAL=password \
>>>>> -DdbConnectPluginGLOBAL= \
>>>>> -DdbConnectDriverGLOBAL= \
>>>>> -DdbEOPrototypesEntityGLOBAL=EOJDBCMySQLPrototypes \
>>>>> -Dbuild.root=/Volumes/wabbit/Hudson/Roots \
>>>>> -Dwonder.framework.install=/Volumes/wabbit/Hudson/Wonder/Library/Frameworks \
>>>>> -Dweb.framework.install.root=/Volumes/wabbit/Hudson/Wonder/Library/WebServer/Documents/WebObjects/Frameworks \
>>>>> -Dwo.woroot=/Volumes/wabbit/Hudson/Wonder
>>>>> wo.system.frameworks=/Volumes/wabbit/Hudson/Wonder/System/Library/Frameworks \
>>>>> -Dwo.local.frameworks=/Volumes/wabbit/Hudson/Wonder/Library/Frameworks \
>>>>> -Dwo.dir.system=/Volumes/wabbit/Hudson/Wonder/System \
>>>>> -Dwo.dir.root=/Volumes/wabbit/Hudson/Wonder \
>>>>> -Dwo.dir.local=/Volumes/wabbit/Hudson/Wonder \
>>>>> -Dwo.dir.library=/Volumes/wabbit/Hudson/Wonder/System/Library \
>>>>> -Dwo.dir.local.library=/Volumes/wabbit/Hudson/Wonder/Library \
>>>>> -Dwo.dir.library.frameworks=/Volumes/wabbit/Hudson/Wonder/System/Library/Frameworks \
>>>>> -Dwo.dir.local.library.frameworks=/Volumes/wabbit/Hudson/Wonder/Library/Frameworks \
>>>>> -Dwo.dir.system=/Volumes/wabbit/Hudson/Wonder/System \
>>>>> -Dwo.extensions=/Volumes/wabbit/Hudson/Wonder/Library/WebObjects/Extensions \
>>>>> -Dwo.bootstrapjar=/Volumes/wabbit/Hudson/Wonder/System/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar \
>>>>> -Dwo.apps.root=/Volumes/wabbit/Hudson/Wonder/Library/WebObjects/Applications
>>>>> )
>>>>>
>>>>> Thus I am trying to make sense of this. Any ideas?
>>>>>
>>>>> Dan
>>>>>
>>>>>
>>>>> On Sep 21, 2010, at 10:40 AM, David LeBer wrote:
>>>>>
>>>>>>
>>>>>> On 2010-09-21, at 1:33 PM, Daniel Beatty wrote:
>>>>>>
>>>>>>> Greetings David,
>>>>>>> Just following up on one of these weirditiies. I am trying to follow the Bug Tracker example, and I get a nasty SQL error when trying to run the bug tracker. For example, I run a script containing the following:
>>>>>>> #!/bin/sh
>>>>>>> ( cd /Library/WebObjects/JavaApplications/BugTracker.woa ;
>>>>>>> ./BugTracker \
>>>>>>> -Der.javamail.centralize=false \
>>>>>>> -Der.extensions.ERXApplication.developmentMode=true \
>>>>>>> -DdbConnectURLGLOBAL=jdbc:mysql://localhost/bug?capitalizeTypenames=true \
>>>>>>> -DdbConnectUserGLOBAL=bugUser \
>>>>>>> -DdbConnectPasswordGLOBAL=changeIt \
>>>>>>> -DdbConnectPluginGLOBAL= \
>>>>>>> -DdbConnectDriverGLOBAL= \
>>>>>>> -DdbEOPrototypesEntityGLOBAL=EOJDBCMySQLPrototypes )
>>>>>>>
>>>>>>> When I run this script I get stopped at :
>>>>>>> 1401 [main] WARN er.extensions.eof.ERXModelGroup - Clearing previous class descriptions
>>>>>>> 1700 [main] INFO er.corebusinesslogic.audittrail.ERCAuditTrail - Configuration : {}
>>>>>>> 1810 [main] INFO com.thimbleware.jmemcached.MemCacheDaemon - Listening on localhost:12345
>>>>>>> 1811 [main] INFO er.caching.ERCaching - Server started: 127.0.0.1:12345 maxItems=0 maxMemory=128
>>>>>>> 1811 [main] ERROR er.caching.ERCaching - No Servers found, set er.caching.servers=server1:port1,server2:port2...
>>>>>>> 1895 [main] WARN er.extensions.migration.ERXMigrator - er.migration.modelNames is not set, defaulting to modelGroup.models() order instead.
>>>>>>> 4331 [main] INFO er.extensions.migration.ERXMigrator - Upgrading ERAttachment to version 1 with migration 'er.attachment.migrations.ERAttachment1@1a9db992'
>>>>>>> 4343 [main] INFO er.extensions.jdbc.ERXJDBCUtilities - Executing alter table ERAttachment null available VARCHAR(5) NOT NULL
>>>>>>> 4354 [main] ERROR er.extensions.appserver.ERXApplication - BugTracker failed to start.
>>>>>>>
>>>>>>>
>>>>>>> The complaint that I get is that MySQL does not like the syntax being applied. Any ideas?
>>>>>>
>>>>>> Are you running WO5.4 and MySQL without the MySQLPlugIn framework from Wonder?
>>>>>>
>>>>>>>
>>>>>>> Thank you,
>>>>>>> Dan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sep 9, 2010, at 3:32 PM, David Holt wrote:
>>>>>>>
>>>>>>>> Hi David!
>>>>>>>>
>>>>>>>> On 2010-09-09, at 3:03 PM, David Avendasora wrote:
>>>>>>>>
>>>>>>>>> Hi all D2W Gurus,
>>>>>>>>>
>>>>>>>>> I'm starting a new D2W app, and one of the things it needs to do is automatically pre-qualify all listings of of entities to filter down to only the EOs that the user is allowed to see.
>>>>>>>>
>>>>>>>> Bug Tracker does stuff like this in the Factory class. You'll find that actions return different qualified lists of things and likely uses a different pageConfiguration for each one (I'm going from memory here). It also heavily leverages the clazz pattern. Take a look at the EO for Bug.
>>>>>>>>
>>>>>>>> The way I have been doing it is to set up a navigationRootChoice based on the logged in user (conditionally display tabs). Then when they further differentiate themselves I store that to ERXThreadStorage, and the tabs reconfigure based on this new layer of qualification. You could do this multiple times, I guess. Take a look at childrenChoices code in the NavigationMenu.plist for BugTracker
>>>>>>>>
>>>>>>>>> The logic to tell if a user is allowed will be somewhat complicated as a user can belong to one or more organizations, and may have one or more roles within each organization.
>>>>>>>>
>>>>>>>> Rules should handle it. See Bug.java for the different ways lists of Bugs are returned to the app.
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I want to add a qualifiers to all searches that they perform that take their Organizations and Roles into account. Each entity that they search on will have their own set of qualifiers to do this filtering.
>>>>>>>>
>>>>>>>> I think you may want to do this in your business logic. You will need to leverage ERXThreadStorage to do so, however.
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I'm figuring on adding the qualifiers to the session so I can grab them from there.
>>>>>>>>
>>>>>>>> ERXThreadStorage. Then you can use them directly in your business logic. You can set fetch specifications that can be as complex as you wish using the qualifiers that you have stored.
>>>>>>>>
>>>>>>>>> There are hints of how to do this in this email chain from a couple years ago: http://lists.apple.com/archives/webobjects-dev/2007/Sep/msg00032.html but I'm not sure where to start implementing this for my project, and I didn't see any obvious examples in the BugTracker demo app.
>>>>>>>>>
>>>>>>>>> Any tips or pointers to other apps that do this?
>>>>>>>>
>>>>>>>> You can also do this in the navigation menu. Conditionally show or hide whole pageConfigurations based on some method. (see NavigationRootChoice method in BugTracker on the Session class)
>>>>>>>> You can also hide and show attributes on a page with rules such as entity.name = 'Media' and 'session.user.isAdmin' = true => displayPropertyKeys = ("x","y","z")
>>>>>>>>
>>>>>>>> I have found that out of the box the restricting object stuff worked reliably for one, but as soon as my needs got more complex, I had much better success moving what I wanted to do to business logic. If you step back, you'll probably agree it makes more sense to be there than in the component or controller anyway.
>>>>>>>>
>>>>>>>> BUT, there are many ways to skin this cat.
>>>>>>>>
>>>>>>>> HTH,
>>>>>>>>
>>>>>>>> d
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>> Dave _______________________________________________
>>>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>>>> Webobjects-dev mailing list (email@hidden)
>>>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>>>>
>>>>>>>>> This email sent to email@hidden
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>>> Webobjects-dev mailing list (email@hidden)
>>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>>>
>>>>>>>> This email sent to email@hidden
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>> Webobjects-dev mailing list (email@hidden)
>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>>
>>>>>>> This email sent to email@hidden
>>>>>>
>>>>>> ;david
>>>>>>
>>>>>> --
>>>>>> David LeBer
>>>>>> Codeferous Software
>>>>>> 'co-def-er-ous' adj. Literally 'code-bearing'
>>>>>> site: http://codeferous.com
>>>>>> blog: http://davidleber.net
>>>>>> profile: http://www.linkedin.com/in/davidleber
>>>>>> twitter: http://twitter.com/rebeld
>>>>>> --
>>>>>> Toronto Area Cocoa / WebObjects developers group:
>>>>>> http://tacow.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Dan Beatty, M.S. CS (B.S. EECS)
>>>>> Ph.D. Student
>>>>> Texas Tech University
>>>>> email@hidden
>>>>> http://web.me.com/danielbeatty/My_Home_Page/Welcome.html
>>>>> (806)438-6620
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Do not post admin requests to the list. They will be ignored.
>>>>> Webobjects-dev mailing list (email@hidden)
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>
>>>>> This email sent to email@hidden
>>>>
>>>> --
>>>> 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
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> Dan Beatty, M.S. CS (B.S. EECS)
>>> Ph.D. Student
>>> Texas Tech University
>>> email@hidden
>>> http://web.me.com/danielbeatty/My_Home_Page/Welcome.html
>>> (806)438-6620
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>> --
>> 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 (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> ;david
>
> --
> David LeBer
> Codeferous Software
> 'co-def-er-ous' adj. Literally 'code-bearing'
> site: http://codeferous.com
> blog: http://davidleber.net
> profile: http://www.linkedin.com/in/davidleber
> twitter: http://twitter.com/rebeld
> --
> Toronto Area Cocoa / WebObjects developers group:
> http://tacow.org
>
>
>
>
--
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden