New convention of install path

2012-02-16 Thread Yung-Luen Lan
Hi,

Since Xcode 4.3 is released as a single app, it will suggest to delete
the /Developer at first launch.

It seems that Apple is trying to eliminate the necessity of /Developer
in the future. If you're just like me, blindly trust the instruction
without thinking, it's likely that you will delete the whole eclipse
and webobjects stuff accidentally. (Hint: you'll also lose some handy
tools like Pixie, QuartzDebug, Quartz Composer and Dashcode.)

I was wondering if it's necessary to change the best practice of
install and setup wo/wonder/eclipse inside /Developer directory.

How do you think?

Regards,
yllan
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Embed a external command-line tool in bundle

2011-10-17 Thread Yung-Luen Lan
Found the handling code here:

https://github.com/wolips/wolips/blob/master/woproject-ant-tasks/src/java/org/objectstyle/woproject/ant/WOMapper.java

Need to figure out how to fix this with least effort.

Regards,
yllan

On Tue, Oct 18, 2011 at 12:12 AM, Yung-Luen Lan  wrote:
> My Cocoa bundle is included in the FileSet specified by
> woproject/resources.include.patternset.
> The problem is how the woapplication task handle it.
>
> According to wiki,
> http://wiki.objectstyle.org/confluence/display/WOL/WOProject-Localization
> Not localized resource should be copied to the resources directory
> preserving subdirectories structure. But the following is my ant -v
> output:
>
> [woapplication] Resources/MyTool.app/Contents/Info.plist added as
> Info.plist doesn't exist.
> [woapplication] Resources/MyTool.app/Contents/MacOS/MyTool added as
> MyTool.app/Contents/MacOS/MyTool doesn't exist.
> [woapplication] Resources/MyTool.app/Contents/PkgInfo added as
> MyTool.app/Contents/PkgInfo doesn't exist.
> [woapplication] Resources/MyTool.app/Contents/Resources/MyTool.tif
> added as MyTool.app/Contents/Resources/MyTool.tif doesn't exist.
> [woapplication]
> Resources/MyTool.app/Contents/Resources/en.lproj/InfoPlist.strings
> added as en.lproj/InfoPlist.strings doesn't exist.
>
> As  you see, the directory structure of Info.plist was flatten. The
> en.lproj inside the Cocoa app bundle was treated as a WO localized
> resource, which is wrong behavior. I really can't find documents
> specify the Info.plist behavior.
>
> Regards,
> yllan
>
> On Mon, Oct 17, 2011 at 9:12 PM, Kieran Kelleher  wrote:
>> Fiddling with the woproject/resources.*.patternset files is how the contents 
>> of the Resources dir is specified for the build logic. In the build.xml, you 
>> can see this is in target build.woapp and resources declaration.
>>
>> So you can modify the the patternset files and/or directly modify the build 
>> xml at that declaration if pattern sets alone are not able to do what you 
>> want.
>>
>> HTH, Kieran
>>
>> On Oct 17, 2011, at 7:56 AM, Yung-Luen Lan wrote:
>>
>>> Thanks. Now I have another build problem. If I move my command-line
>>> tool (actually, it's a cocoa app bundle without UI) under Resources,
>>> then the ant build process will move this file
>>>
>>> MyWOApp.woa/Contents/Resources/MyTools.app/Contents/Resources/Info.plist
>>>
>>> to
>>>
>>> MyWOApp.woa/Contents/Resources/Info.plist
>>>
>>> which leaves both my wo/cocoa apps in corrupt Info.plist state. I look
>>> the build.xml without finding anything related to the Info.plist. Why
>>> is that happen?
>>>
>>> Regards,
>>> yllan
>>>
>>> On Mon, Oct 17, 2011 at 3:54 PM, Johann Werner  wrote:
>>>> Hi yllan,
>>>>
>>>> I would put that into the 'Resources' directory and use
>>>>
>>>> WOResourceManager.pathURLForResourceNamed(
>>>>        command-line-tool-name, // name of your tool
>>>>        null, // null if you put this into your app project
>>>>        null); // null as you are not interested in localized resources
>>>>
>>>> jw
>>>>
>>>>
>>>> Am 17.10.2011 um 09:31 schrieb Yung-Luen Lan:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have some external command-line tools written by Objective-C that
>>>>> needs to be invoked in my wo app.
>>>>>
>>>>> Of course I could put them in somewhere like /usr/local/bin, etc.
>>>>>
>>>>> But I want to embed these command-line tools inside my wo app bundle
>>>>> so that people don't forget to copy the command-line tools when
>>>>> install the wo app. However, getting path of NSBundle is deprecated
>>>>> API. Which directory should I put these tools in and how do I get the
>>>>> path when I want to call them?
>>>>>
>>>>> The app is a woa bundle so don't have to take jar into account.
>>>>>
>>>>> Any comment?
>>>>>
>>>>> Regards,
>>>>> yllan
>>>>
>>>>
>>>>
>>> ___
>>> 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/kelleherk%40gmail.com
>>>
>>> This email sent to kelleh...@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: Embed a external command-line tool in bundle

2011-10-17 Thread Yung-Luen Lan
My Cocoa bundle is included in the FileSet specified by
woproject/resources.include.patternset.
The problem is how the woapplication task handle it.

According to wiki,
http://wiki.objectstyle.org/confluence/display/WOL/WOProject-Localization
Not localized resource should be copied to the resources directory
preserving subdirectories structure. But the following is my ant -v
output:

[woapplication] Resources/MyTool.app/Contents/Info.plist added as
Info.plist doesn't exist.
[woapplication] Resources/MyTool.app/Contents/MacOS/MyTool added as
MyTool.app/Contents/MacOS/MyTool doesn't exist.
[woapplication] Resources/MyTool.app/Contents/PkgInfo added as
MyTool.app/Contents/PkgInfo doesn't exist.
[woapplication] Resources/MyTool.app/Contents/Resources/MyTool.tif
added as MyTool.app/Contents/Resources/MyTool.tif doesn't exist.
[woapplication]
Resources/MyTool.app/Contents/Resources/en.lproj/InfoPlist.strings
added as en.lproj/InfoPlist.strings doesn't exist.

As you see, the directory structure of Info.plist was flatten. The
en.lproj inside the Cocoa app bundle was treated as a WO localized
resource, which is wrong behavior. I really can't find documents
specify the Info.plist behavior.

Regards,
yllan

On Mon, Oct 17, 2011 at 9:12 PM, Kieran Kelleher  wrote:
> Fiddling with the woproject/resources.*.patternset files is how the contents 
> of the Resources dir is specified for the build logic. In the build.xml, you 
> can see this is in target build.woapp and resources declaration.
>
> So you can modify the the patternset files and/or directly modify the build 
> xml at that declaration if pattern sets alone are not able to do what you 
> want.
>
> HTH, Kieran
>
> On Oct 17, 2011, at 7:56 AM, Yung-Luen Lan wrote:
>
>> Thanks. Now I have another build problem. If I move my command-line
>> tool (actually, it's a cocoa app bundle without UI) under Resources,
>> then the ant build process will move this file
>>
>> MyWOApp.woa/Contents/Resources/MyTools.app/Contents/Resources/Info.plist
>>
>> to
>>
>> MyWOApp.woa/Contents/Resources/Info.plist
>>
>> which leaves both my wo/cocoa apps in corrupt Info.plist state. I look
>> the build.xml without finding anything related to the Info.plist. Why
>> is that happen?
>>
>> Regards,
>> yllan
>>
>> On Mon, Oct 17, 2011 at 3:54 PM, Johann Werner  wrote:
>>> Hi yllan,
>>>
>>> I would put that into the 'Resources' directory and use
>>>
>>> WOResourceManager.pathURLForResourceNamed(
>>>        command-line-tool-name, // name of your tool
>>>        null, // null if you put this into your app project
>>>        null); // null as you are not interested in localized resources
>>>
>>> jw
>>>
>>>
>>> Am 17.10.2011 um 09:31 schrieb Yung-Luen Lan:
>>>
>>>> Hi,
>>>>
>>>> I have some external command-line tools written by Objective-C that
>>>> needs to be invoked in my wo app.
>>>>
>>>> Of course I could put them in somewhere like /usr/local/bin, etc.
>>>>
>>>> But I want to embed these command-line tools inside my wo app bundle
>>>> so that people don't forget to copy the command-line tools when
>>>> install the wo app. However, getting path of NSBundle is deprecated
>>>> API. Which directory should I put these tools in and how do I get the
>>>> path when I want to call them?
>>>>
>>>> The app is a woa bundle so don't have to take jar into account.
>>>>
>>>> Any comment?
>>>>
>>>> Regards,
>>>> yllan
>>>
>>>
>>>
>> ___
>> 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/kelleherk%40gmail.com
>>
>> This email sent to kelleh...@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: Embed a external command-line tool in bundle

2011-10-17 Thread Yung-Luen Lan
Thanks. Now I have another build problem. If I move my command-line
tool (actually, it's a cocoa app bundle without UI) under Resources,
then the ant build process will move this file

MyWOApp.woa/Contents/Resources/MyTools.app/Contents/Resources/Info.plist

to

MyWOApp.woa/Contents/Resources/Info.plist

which leaves both my wo/cocoa apps in corrupt Info.plist state. I look
the build.xml without finding anything related to the Info.plist. Why
is that happen?

Regards,
yllan

On Mon, Oct 17, 2011 at 3:54 PM, Johann Werner  wrote:
> Hi yllan,
>
> I would put that into the 'Resources' directory and use
>
> WOResourceManager.pathURLForResourceNamed(
>        command-line-tool-name, // name of your tool
>        null, // null if you put this into your app project
>        null); // null as you are not interested in localized resources
>
> jw
>
>
> Am 17.10.2011 um 09:31 schrieb Yung-Luen Lan:
>
>> Hi,
>>
>> I have some external command-line tools written by Objective-C that
>> needs to be invoked in my wo app.
>>
>> Of course I could put them in somewhere like /usr/local/bin, etc.
>>
>> But I want to embed these command-line tools inside my wo app bundle
>> so that people don't forget to copy the command-line tools when
>> install the wo app. However, getting path of NSBundle is deprecated
>> API. Which directory should I put these tools in and how do I get the
>> path when I want to call them?
>>
>> The app is a woa bundle so don't have to take jar into account.
>>
>> Any comment?
>>
>> Regards,
>> yllan
>
>
>
 ___
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


Embed a external command-line tool in bundle

2011-10-17 Thread Yung-Luen Lan
Hi,

I have some external command-line tools written by Objective-C that
needs to be invoked in my wo app.

Of course I could put them in somewhere like /usr/local/bin, etc.

But I want to embed these command-line tools inside my wo app bundle
so that people don't forget to copy the command-line tools when
install the wo app. However, getting path of NSBundle is deprecated
API. Which directory should I put these tools in and how do I get the
path when I want to call them?

The app is a woa bundle so don't have to take jar into account.

Any comment?

Regards,
yllan
 ___
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: WOLips complains about scala WOElement

2011-09-19 Thread Yung-Luen Lan
Thanks Marius.

If I want to add support of scala class in WOLips, where should I look
at first?
I've already checkout the WOLips source code but I have no experience
writing Eclipse plugin.

Scala helps me writing more concise code not only shorter but also
error prune. Actor helps for concurrent programming and Option leads
to better API interface that eliminates most null pointer exceptions.
Functional operator gives clear intention rather than fiddling with
loops and counters.

I think WebObjects will get a new life if it leverage the modern
language features and design from scala. Look the Play! framework… :)

Regards,
yllan

On Mon, Sep 19, 2011 at 6:47 PM, Marius Soutier
 wrote:
> That's because WOLips doesn't recognize Scala classes. I think there's no 
> workaround except extending WOLips.
>
> I hope you're not using Scala only to reduce line count :)
>
>
> On 19.09.2011, at 10:51, Yung-Luen Lan wrote:
>
>> Hi,
>>
>> I'm using WOLips stable with Eclipse 3.6 and scala 2.9.0.1 following
>> the WO wiki setup.
>>
>> Scala is amazing. It reduces a lot of LOC which results more concise
>> and clear code. So I gradually rewrite my project using scala, one
>> class at a time.
>>
>> However, Eclipse gives me errors:
>>
>> The class for 'APILogin' is either missing or does not extend
>> WOElement.    line 204        WebObjects Template Problems
>>
>> where I write  in html. I can still build with ant but
>> it cause error in eclipse. APILogin is a scala class extends other
>> java ERXComponent's subclass.
>>
>> Is there any way to get rid of this kind of error?
>>
>> Regards,
>> yllan
>> ___
>> 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/m.soutier%40starhealthcare.info
>>
>> This email sent to m.sout...@starhealthcare.info
>
>
>
 ___
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


WOLips complains about scala WOElement

2011-09-19 Thread Yung-Luen Lan
Hi,

I'm using WOLips stable with Eclipse 3.6 and scala 2.9.0.1 following
the WO wiki setup.

Scala is amazing. It reduces a lot of LOC which results more concise
and clear code. So I gradually rewrite my project using scala, one
class at a time.

However, Eclipse gives me errors:

The class for 'APILogin' is either missing or does not extend
WOElement.  line 204WebObjects Template Problems

where I write  in html. I can still build with ant but
it cause error in eclipse. APILogin is a scala class extends other
java ERXComponent's subclass.

Is there any way to get rid of this kind of error?

Regards,
yllan
 ___
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


Split large application into smaller ones

2011-03-17 Thread Yung-Luen Lan
Hi,

I want to split my one large web application into multiple smaller
applications so that each part running separately because:

1. Update one application won't affect the other. For example, I want
to deploy the admin backend but don't want to restart the customer
page.
2. If one JVM crash, the other is still alive. (Although it cost more memory)

I'm not sure if my reason is solid. Any comment?
If this is the way to go, how to share the data model between these
applications? Use something like terracota?
Does JRebel help on the point 1?

Regards,
yllan
 ___
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: First Time Database Migration fail

2011-03-17 Thread Yung-Luen Lan
You're right. After setting the shared property to none, Migration works.
What does the share entity means? I couldn't find it on wo wiki.

Regards,
yllan

On Thu, Mar 17, 2011 at 10:29 PM, John Huss  wrote:
> It look like you have some models objects marked as shared based on this in
> the stack trace:
> _preloadSharedObjectsWithModel
>
> My guess is that this is not supported (or is a bug, depending on how you
> look at it).
> John
> On Thu, Mar 17, 2011 at 5:36 AM, Yung-Luen Lan  wrote:
>>
>> Hi,
>>
>> I have a project setup with ERXMigration. The migration works except
>> the first time database initialization.
>>
>> That is, I have a newly installed server with an empty database and I
>> want my project create those tables automatically.
>> But I get errors like this:
>>
>> Mar 17 17:56:43 MyWebApp[52666] (ERXDatabaseContextDelegate.java:177)
>> INFO   - Database Exception occured: ERROR: relation "preference" does
>> not exist
>> <>
>>
>> Mar 17 17:56:43 MyWebApp[52666] (ERXApplication.java:1307) ERROR  -
>> MyWebApp failed to start.
>> <>
>>
>> Mar 17 17:56:43 MyWebApp[52666] (ERXNSLogLog4jBridge.java:43) WARN   -
>> A fatal exception occurred: EvaluateExpression failed:
>> > t0.pID, t0.value FROM Preference t0 ORDER BY t0.key DESC"
>> withBindings: >:
>>    Next exception:SQL State:42P01 -- error code: 0 -- msg: ERROR:
>> relation "preference" does not exist
>> <>
>>
>>
>> where preference is one of my data model. Stack trace was listed as
>> the following. I can create those tables by running "Generate SQL" in
>> Eclipse, but that's not a friendly way to install a webapp. Any
>> insight about this is appreciated.
>>
>> My Database0.java look like this:
>>
>> public class Database0 extends Migration {
>>
>> // downgrade omitted
>>
>> public void upgrade(EOEditingContext ec, ERXMigrationDatabase
>> database) throws Throwable {
>>        ERXMigrationTable bookTable = database.newTableNamed("Book");
>>        bookTable.newStringColumn("annotation", 1024, true);
>>        bookTable.newStringColumn("barcode", 64, false);
>>        bookTable.newIntegerColumn("bookID", false);
>>        bookTable.newIntBooleanColumn("duplex", false);
>>        bookTable.create();
>>        bookTable.setPrimaryKey("bookID");
>>
>>        ERXMigrationTable preferenceTable =
>> database.newTableNamed("Preference");
>>        preferenceTable.newStringColumn("key", 128, false);
>>        preferenceTable.newIntegerColumn("pID", false);
>>        preferenceTable.newStringColumn("value", 1024, false);
>>        preferenceTable.create();
>>        preferenceTable.setPrimaryKey("pID");
>>        // ...
>> }
>> }
>>
>> And I set the properties:
>>
>> # Migrations
>> er.migration.migrateAtStartup=true
>> er.migration.createTablesIfNecessary=true
>> er.migration.modelNames=Database
>> Database.MigrationClassPrefix=com.example.migration.Database
>> dbConnectURLGLOBAL=jdbc:postgresql://localhost/mydb
>> dbConnectUserGLOBAL=postgres
>> #Database.InitialMigrationVersion=0
>>
>> <>
>>  Position: 38at
>>
>> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
>> at
>> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
>> at
>> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
>> at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
>> at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
>> at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
>> at
>> com.webobjects.jdbcadaptor.JDBCChannel._bindInputVariablesWithBindingsAndExecute(JDBCChannel.java:272)
>> at
>> com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression(JDBCChannel.java:337)
>> at
>> com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression(JDBCChannel.java:296)
>> at
>> com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:220)
>> at
>> com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897)
>> at
>> com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.j

First Time Database Migration fail

2011-03-17 Thread Yung-Luen Lan
Hi,

I have a project setup with ERXMigration. The migration works except
the first time database initialization.

That is, I have a newly installed server with an empty database and I
want my project create those tables automatically.
But I get errors like this:

Mar 17 17:56:43 MyWebApp[52666] (ERXDatabaseContextDelegate.java:177)
INFO   - Database Exception occured: ERROR: relation "preference" does
not exist
<>

Mar 17 17:56:43 MyWebApp[52666] (ERXApplication.java:1307) ERROR  -
MyWebApp failed to start.
<>

Mar 17 17:56:43 MyWebApp[52666] (ERXNSLogLog4jBridge.java:43) WARN   -
A fatal exception occurred: EvaluateExpression failed:
:
Next exception:SQL State:42P01 -- error code: 0 -- msg: ERROR:
relation "preference" does not exist
<>


where preference is one of my data model. Stack trace was listed as
the following. I can create those tables by running "Generate SQL" in
Eclipse, but that's not a friendly way to install a webapp. Any
insight about this is appreciated.

My Database0.java look like this:

public class Database0 extends Migration {

// downgrade omitted

public void upgrade(EOEditingContext ec, ERXMigrationDatabase
database) throws Throwable {
ERXMigrationTable bookTable = database.newTableNamed("Book");
bookTable.newStringColumn("annotation", 1024, true);
bookTable.newStringColumn("barcode", 64, false);
bookTable.newIntegerColumn("bookID", false);
bookTable.newIntBooleanColumn("duplex", false);
bookTable.create();
bookTable.setPrimaryKey("bookID");

ERXMigrationTable preferenceTable = 
database.newTableNamed("Preference");
preferenceTable.newStringColumn("key", 128, false);
preferenceTable.newIntegerColumn("pID", false);
preferenceTable.newStringColumn("value", 1024, false);
preferenceTable.create();
preferenceTable.setPrimaryKey("pID");
// ...
}
}

And I set the properties:

# Migrations
er.migration.migrateAtStartup=true
er.migration.createTablesIfNecessary=true
er.migration.modelNames=Database
Database.MigrationClassPrefix=com.example.migration.Database
dbConnectURLGLOBAL=jdbc:postgresql://localhost/mydb
dbConnectUserGLOBAL=postgres
#Database.InitialMigrationVersion=0

<>
  Position: 38at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
at 
com.webobjects.jdbcadaptor.JDBCChannel._bindInputVariablesWithBindingsAndExecute(JDBCChannel.java:272)
at 
com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression(JDBCChannel.java:337)
at 
com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression(JDBCChannel.java:296)
at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:220)
at 
com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897)
at 
com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234)
at 
com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055)
at 
com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
at 
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
at 
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
at 
com.webobjects.eocontrol.EOSharedEditingContext.bindObjectsWithFetchSpecification(EOSharedEditingContext.java:401)
at 
com.webobjects.eoaccess.EODatabaseContext._preloadSharedObjectsWithModel(EODatabaseContext.java:1217)
at 
com.webobjects.eoaccess.EODatabaseContext.registeredDatabaseContextForModel(EODatabaseContext.java:1012)
at 
com.webobjects.eoaccess.EODatabaseContext.registeredDatabaseContextForModel(EODatabaseContext.java:1033)
at 
er.extensions.jdbc.ERXJDBCUtilities.databaseProductName(ERXJDBCUtilities.java:826)
at 
er.extensions.migration.ERXMigrator._buildDependenciesForModel(ERXMigrator.java:352)
at 
er.extensions.migration.ERXMigrator._buildDependenciesForModelsNamed(ERXMigrator.java:275)
at er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:184)
at 
er.extensions.appserver.ERXApplication.finishInitialization(ERXApplication.java:1186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597

Re: multipart upload become garbage

2011-01-07 Thread Yung-Luen Lan
I did some tests and verified that the string and multipart binary
POST is correct.

What I did to fix the bug is just removing 8 lines of erroneous code
which attempt to add a zero to the end of the content.

https://github.com/yllan/wonder/commit/175145c3897f7da92be66d7be07802fb5f0dd461

 if (req->content) {
content_buffer = (char *)WOMALLOC(req->content_length+1);
strncpy(content_buffer,req->content,req->content_length);
content_buffer[req->content_length] = '\0';
WOLog(WO_INFO, "---content buffer: %s",content_buffer);
strncpy(req->content,content_buffer,req->content_length+1);
WOFREE(content_buffer);
 }

The removed code is wrong because:

1. The size of req->content (a byte array) is
req->content_buffer_size, not necessary req->content_length.

if (req->content_buffer_size < req->content_length &&
memset(req->content, 0xFF, req->content_buffer_length))
the_code_will_crash();

2. Even if (req->content_buffer_size == req->content_length), if
req->content didn't contains byte zero, it will crash since the second
strncpy will violate the memory access by one byte.

3. If there is byte 0x00 in req->content, the rest bytes will be
filled with 0x00 by strncpy().

Hence I believed it's safe to removed without affecting other logic.
(CGI Adaptor has almost symmetric structure with fcgi adaptor except
without this part).
But I don't use the adaptor in my production environment because I
realized that very few people actually use this and it's not been well
tested.
Maybe we could do a survey to see which http server/adaptor you use? I
guess apache2 dominates.

Wow, 8 lines of code worth a lot of explanation.

Regards,
yllan

On Fri, Jan 7, 2011 at 6:51 AM, Q  wrote:
> On 07/01/2011, at 2:27 AM, Yung-Luen Lan wrote:
>
>> It's been a while that I'm too busy to dig into this problem.
>>
>> Anyway, I found the WebObjects FastCGI adaptor is buggy when you want
>> to upload binary files using form because the code use strncpy() to
>> copy the contents from HTTP request. It stop copy when a 0x00 byte
>> occur.
>>
>> I was a bit surprise that few one complains about this (according to
>> quick search on google) since it's a severe defect that cause data
>> loss.
>> I wonder if people is still using WO fcgi adaptor. Nevertheless, I
>> have a patched version:
>>
>> https://github.com/yllan/wonder
>>
>> In case anyone still use the fcgi adaptor.
>
> Can you confirm your fix creates no other issues?
> Have you used this change in production for long?
>
> I will commit the change to wonder if that's all that is required to resolve 
> the issue.
 ___
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: multipart upload become garbage

2011-01-06 Thread Yung-Luen Lan
It's been a while that I'm too busy to dig into this problem.

Anyway, I found the WebObjects FastCGI adaptor is buggy when you want
to upload binary files using form because the code use strncpy() to
copy the contents from HTTP request. It stop copy when a 0x00 byte
occur.

I was a bit surprise that few one complains about this (according to
quick search on google) since it's a severe defect that cause data
loss.
I wonder if people is still using WO fcgi adaptor. Nevertheless, I
have a patched version:

https://github.com/yllan/wonder

In case anyone still use the fcgi adaptor.

Regards,
yllan

On Thu, Sep 16, 2010 at 10:10 AM, Chuck Hill  wrote:
>
> On Sep 15, 2010, at 6:03 PM, Yung-Luen Lan wrote:
>
>> Ah, thanks! Maybe it's caused by WebObjects-FCGI adaptor or nginx.
>> I tried Apache2, seems don't have this kind of problem.
>
> I agree, it seems to be a bug in the adaptor.
>
>
>> Anyone use nginx w/ fcgi has the same issue?
>
> I am not using them
>
> Chuck
>
>
>> On Thu, Sep 16, 2010 at 8:25 AM, Chuck Hill  wrote:
>>> I'd expect that this is a bug in the WO Adaptor or in WO.  It could 
>>> possibly be a bug in Java or Apache, but that seems less likely.  I'd 
>>> suggest trying an update to WO 5.4.3 which has bug fixes for problems in 
>>> 5.4.2.
>>>
>>> Chuck
>>>
>>>
>>> On Sep 15, 2010, at 4:14 PM, Yung-Luen Lan wrote:
>>>
>>>> Hi,
>>>>
>>>> The following code receives one chunk of multipart uploads and
>>>> appending it to a file.
>>>> (I have a client app which split the file first and then send the
>>>> chunks one by one.)
>>>> However, I got trouble when I deploy the code to a snow leopard
>>>> machine. I found the file uploaded is not the same as the original
>>>> file.
>>>>
>>>> It seems that if there is byte '\0' occurred in the upload stream, the
>>>> succeeding bytes all becomes zero.
>>>> But this code used to work on both my old server (10.5, WO 5.4.2, Java
>>>> 1.6 32bit) and dev machine (10.6, WO 5.4.2, Java 1.6 64bit)
>>>>
>>>> What could possibly get wrong?
>>>>
>>>> Regards,
>>>> yllan
>>>>
>>>> =
>>>> try {
>>>>       WORequest r = context().request();
>>>>       WOMultipartIterator iterator = r.multipartIterator();
>>>>       WOMultipartIterator.WOFormData data = null;
>>>>       NSData fileData = null;
>>>>
>>>>       while ((data = iterator.nextFormData()) != null) {
>>>>               if (data.isFileUpload()) {
>>>>                       try {
>>>>                               InputStream stream = 
>>>> data.formDataInputStream();
>>>>                               fileData = new NSData(stream, 4096);
>>>>                       } catch (Exception e) {
>>>>                               return makeErrorXMLResponse(n, "UPLOAD: 
>>>> Failed to read Data from Stream.");
>>>>                       }
>>>>               }
>>>>       }
>>>>
>>>>       if (fileData == null)
>>>>               return makeErrorXMLResponse(n, "UPLOAD: Failed to read data 
>>>> from request.");
>>>>
>>>>       fileData.writeToStream(session().pdfStream());
>>>> } catch (Exception e) {
>>>>       return makeErrorXMLResponse(n, "UPLOAD: " + e.toString());
>>>> }
>>>> ___
>>>> 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 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: No generic method in Eclipse

2011-01-06 Thread Yung-Luen Lan
Ah, thanks for the mysterious David power on the mailing list!

Regards,
yllan

On Thu, Jan 6, 2011 at 2:18 AM, David Avendasora
 wrote:
> You have a new version of Wonder on the new computer.
>
> I assume you mean NSPropertyListSerialization, which was removed from the 
> current wonder and replaced with ERXPropertyListSerialization in the Wonder 
> 54 branch.
>
> Dave
>
>
> On Jan 5, 2011, at 1:04 AM, Yung-Luen Lan wrote:
>
>> Hi,
>>
>> I have a generic version of
>>
>> NSPropertySerialization.arrayForString
>>
>> in my project. I moved the project to another machine, which have
>> WO5.4.3 and Wonder installed. But Eclipse complains that there's no
>> such generic method.
>>
>> What could possibly go wrong? Classpath setting in wolips?
>>
>>
>> Regards,
>> yllan
>> ___
>> 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


No generic method in Eclipse

2011-01-04 Thread Yung-Luen Lan
Hi,

I have a generic version of

NSPropertySerialization.arrayForString

in my project. I moved the project to another machine, which have
WO5.4.3 and Wonder installed. But Eclipse complains that there's no
such generic method.

What could possibly go wrong? Classpath setting in wolips?


Regards,
yllan
 ___
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


multipart upload become garbage

2010-09-15 Thread Yung-Luen Lan
Hi,

The following code receives one chunk of multipart uploads and
appending it to a file.
(I have a client app which split the file first and then send the
chunks one by one.)
However, I got trouble when I deploy the code to a snow leopard
machine. I found the file uploaded is not the same as the original
file.

It seems that if there is byte '\0' occurred in the upload stream, the
succeeding bytes all becomes zero.
But this code used to work on both my old server (10.5, WO 5.4.2, Java
1.6 32bit) and dev machine (10.6, WO 5.4.2, Java 1.6 64bit)

What could possibly get wrong?

Regards,
yllan

=
try {
WORequest r = context().request();
WOMultipartIterator iterator = r.multipartIterator();
WOMultipartIterator.WOFormData data = null;
NSData fileData = null;

while ((data = iterator.nextFormData()) != null) {
if (data.isFileUpload()) {
try {
InputStream stream = data.formDataInputStream();
fileData = new NSData(stream, 4096);
} catch (Exception e) {
return makeErrorXMLResponse(n, "UPLOAD: Failed 
to read Data from Stream.");
}
}
}

if (fileData == null)
return makeErrorXMLResponse(n, "UPLOAD: Failed to read data 
from request.");

fileData.writeToStream(session().pdfStream());
} catch (Exception e) {
return makeErrorXMLResponse(n, "UPLOAD: " + e.toString());
}
 ___
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: AjaxObserveField on the radio button?

2010-08-21 Thread Yung-Luen Lan
Thanks, fullSubmit=true solved my case.

However, I get another problem, don't know if it's a bug of
Ajax.framework or webkit.

I use html5  to design my form. There is a
pretty stepper next to the field:
http://emberapp.com/yllan/images/safari-2

I can get my AOF to notice the change of value when I manually key
down the number, but when I click the stepper to change values, AUC
didn't get updated. Any insight of this?

Regards,
yllan

On Sat, Aug 21, 2010 at 4:31 PM, Farrukh Ijaz
 wrote:
> Hi Yung-Luen,
>
> First of all, if you are observing multiple fields but updating a single AUC, 
> then you do not need to use multiple AOF, only one is enough.
>
> You need to wrap your inputs and AOF inside a form. You can use 
> ERXOptionalForm for this purpose. Also you need to setup fullSubmit attribute 
> of your AOF to true. Then it will work without any problem.
>
> Farrukh
>
> Sent from my iPad
>
> On 21-Aug-2010, at 11:16 AM, Yung-Luen Lan  wrote:
>
>> Hi,
>>
>> I try to use AjaxObserveField to monitor the change of radio button.
>> However, it's not working.
>> Here is the code to demonstrate the problem:
>>
>> > />
>> > name="radio1" />
>>
>> 
>> 
>>
>> 
>>
>> 
>>
>> 
>> 
>> 
>>
>> 
>> 
>> 
>> 
>>
>> 
>>
>> No matter how I click the radio button, it won't change the value of
>> radioValue, option3 and option4 unless I click the submit button.
>> I want to update the AUC when user change the radio selection
>> immediately. Is there any way using AOF to accomplish that?
>>
>> Thanks.
>>
>> Regards,
>> yllan
>> ___
>> 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/farrukh.ijaz%40fuegodigitalmedia.com
>>
>> This email sent to farrukh.i...@fuegodigitalmedia.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


AjaxObserveField on the radio button?

2010-08-21 Thread Yung-Luen Lan
Hi,

I try to use AjaxObserveField to monitor the change of radio button.
However, it's not working.
Here is the code to demonstrate the problem:






















No matter how I click the radio button, it won't change the value of
radioValue, option3 and option4 unless I click the submit button.
I want to update the AUC when user change the radio selection
immediately. Is there any way using AOF to accomplish that?

Thanks.

Regards,
yllan
 ___
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


fetchAllEntities() only returns saved eo?

2009-08-02 Thread Yung-Luen Lan
Hi,

I'm implementing a back-end of a e-commerce system, which do CRUD on product
records.

To return a list of products, I wrote:

return Product.fetchAllProducts(ec);

To add a new product, I wrote:

Product p = new Product();
ec.insertObject(p); // the same ec as in
Product.fetchAllProducts(ec)
p.setTitle("New Item");
return null;

Since I don't want the newly created product object be exposed to
customer––especially when the price value is default value zero, I don't
save the ec immediately. Instead, I have a save and cancel button to commit
the product information.

However, when I add a new product, it's not shown in
Product.fetchAllProducts(ec). How can I get all the product objects in an ec
nevertheless it has been saved or not? Thanks.

Regards,
yllan
 ___
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: [OT] WOLips - Eclipse compatibility?

2009-06-25 Thread Yung-Luen Lan
It's likely something wrong in my system/configuration.

Another computer update successfully at the same time, and VMWare
running OSX server at the same machine have no problem either. But
different accounts on the same machine still suffer from this error.

So it should not be the problem of internet, the update sites or my
computer's hardware.

Regards,
yllan

On Thu, Jun 25, 2009 at 9:55 PM, WebObjects -
Anazys wrote:
> That works with archive or local plugin, but I always have this error with
> software sites update : I try Galileo, Eclipse and WOLips.
>
> Thanks,
> Cedric
>
> Le 25 juin 09 à 15:06, Fabian Peters a écrit :
>
>> Hi Cedric,
>>
>> Am 25.06.2009 um 12:47 schrieb WebObjects - Anazys:
>>
>>> Hello,
>>>
>>> Same problem for me :
>>> New Eclipse 3.5 install, new workspace.
>>> I just test the connection with Galileo software site update (default in
>>> eclipse) and this error :
>>> --
>>> NLS missing message: Unexpected_exception in:
>>> org.eclipse.equinox.internal.p2.updatesite.metadata.messages
>>> NLS missing message: Unexpected_exception in:
>>> org.eclipse.equinox.internal.p2.updatesite.metadata.messages
>>> java.lang.NullPointerException
>>> --
>>>
>>> So I have the same error message with WOLips update link:
>>> http://webobjects.mdimension.com/wolips/eclipse_3_5
>>> Still trying to fix that..
>>
>> I had a similar problem today with the same site, when installing another
>> eclipse plugin. Looks like some server is down. You could try to get an
>> archive of the plugin you want to install from the eclipse downloads site.
>>
>> cheers, Fabian
>>
>>> Le 25 juin 09 à 06:39, Yung-Luen Lan a écrit :
>>>
>>>> Does anyone encounter a strange error updating/installing plugins in
>>>> Eclipse 3.5 like this?
>>>>
>>>> ---
>>>> Unable to load the repository
>>>> http://webobjects.mdimension.com/wolips/eclipse_3_5
>>>> org.eclipse.equinox.internal.provisional.p2.core.ProvisionException:
>>>> No repository found at
>>>> http://webobjects.mdimension.com/wolips/eclipse_3_5.
>>>> at
>>>> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:380)
>>>> at
>>>> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:606)
>>>> at
>>>> org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
>>>> at
>>>> org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:88)
>>>> at
>>>> org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil.loadMetadataRepository(ProvisioningUtil.java:88)
>>>> at
>>>> org.eclipse.equinox.internal.provisional.p2.ui.QueryableMetadataRepositoryManager.doLoadRepository(QueryableMetadataRepositoryManager.java:55)
>>>> at
>>>> org.eclipse.equinox.internal.provisional.p2.ui.QueryableRepositoryManager.loadRepository(QueryableRepositoryManager.java:195)
>>>> at
>>>> org.eclipse.equinox.internal.provisional.p2.ui.QueryableRepositoryManager.loadAll(QueryableRepositoryManager.java:108)
>>>> at
>>>> org.eclipse.equinox.internal.p2.ui.sdk.PreloadingRepositoryHandler$2.run(PreloadingRepositoryHandler.java:71)
>>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>> ---
>>>>
>>>> I install eclipse 3.5 on another computer without this problem.
>>>>
>>>> I think it's the problem of eclipse since I also have problem updating
>>>> the built-in galileo update site.
>>>> I tried reinstall eclipse 3.5, start a new workspace, remove
>>>> ~/Library/Caches/org.eclipse.eclipse, ~/.eclipse_keyring and
>>>> ~/Library/Preferences/org.eclipse.eclipse.plist but the problem is
>>>> still here. Change another user account didn't fix that either. (Hence
>>>> it's not likely bad thing happened in users home directory)
>>>>
>>>> If you have any idea how to fix that (so I can install the wolips 3.5
>>>> branch), please let me know.
>>>>
>>>> Regards,
>>>> yllan
>>>> ___
>>>> Do

[OT] WOLips - Eclipse compatibility?

2009-06-24 Thread Yung-Luen Lan
Does anyone encounter a strange error updating/installing plugins in
Eclipse 3.5 like this?

---
Unable to load the repository
http://webobjects.mdimension.com/wolips/eclipse_3_5
 org.eclipse.equinox.internal.provisional.p2.core.ProvisionException:
No repository found at
http://webobjects.mdimension.com/wolips/eclipse_3_5.
at 
org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:380)
at 
org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:606)
at 
org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
at 
org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:88)
at 
org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil.loadMetadataRepository(ProvisioningUtil.java:88)
at 
org.eclipse.equinox.internal.provisional.p2.ui.QueryableMetadataRepositoryManager.doLoadRepository(QueryableMetadataRepositoryManager.java:55)
at 
org.eclipse.equinox.internal.provisional.p2.ui.QueryableRepositoryManager.loadRepository(QueryableRepositoryManager.java:195)
at 
org.eclipse.equinox.internal.provisional.p2.ui.QueryableRepositoryManager.loadAll(QueryableRepositoryManager.java:108)
at 
org.eclipse.equinox.internal.p2.ui.sdk.PreloadingRepositoryHandler$2.run(PreloadingRepositoryHandler.java:71)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
---

I install eclipse 3.5 on another computer without this problem.

I think it's the problem of eclipse since I also have problem updating
the built-in galileo update site.
I tried reinstall eclipse 3.5, start a new workspace, remove
~/Library/Caches/org.eclipse.eclipse, ~/.eclipse_keyring and
~/Library/Preferences/org.eclipse.eclipse.plist but the problem is
still here. Change another user account didn't fix that either. (Hence
it's not likely bad thing happened in users home directory)

If you have any idea how to fix that (so I can install the wolips 3.5
branch), please let me know.

Regards,
yllan
 ___
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: Report validation error to interface?

2009-06-19 Thread Yung-Luen Lan
Looking forward to that! :-)

Regards,
yllan

On Sat, Jun 20, 2009 at 4:08 AM, Chuck Hill wrote:
> I gave a presentation on WebObjects Validation Next Generation at WOWODC.
>  However... the code is not 100% complete yet AND it needs an example app
> and more documentation.
>
> Soon...
>
>
> Chuck
>
>
> On Jun 19, 2009, at 12:56 PM, Yung-Luen Lan wrote:
>
>> Or is there any advanced technology in newer framework/runtime that
>> gives a beautiful solution?
>>
>> regards,
>> yllan
>>
>> On Fri, Jun 19, 2009 at 7:45 PM, Yung-Luen Lan wrote:
>>>
>>> Hi,
>>>
>>> About data validation, there is a common pattern:
>>>
>>> 1. Present a form to let user input data.
>>> 2. Validate the data during input or when form submitted.
>>> 3. If there are invalid data, shows error message to each field.
>>>
>>> To complete this task, I follow the approach that set the error
>>> messages to a dictionary which was mentioned at:
>>> http://www.stepwise.com/Articles/Technical/WOValidation.html
>>>
>>> However, wolips complains that it cannot verify key beacsue the
>>> keypath 'validationData' is a collection.
>>> Also, use a bare string as a key isn't a good idea since tools cannot
>>> verify the solidness of your code.
>>>
>>> So, how do you deal with this situation?
>>>
>>> Regards,
>>> yllan
>>>
>> ___
>> 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: Large dataset for RDBMS/EOF tests?

2009-06-19 Thread Yung-Luen Lan
Um, do you require that as a movie database?

Otherwise, you could find some large enough database at
http://download.wikimedia.org/backup-index.html

Regards,
yllan

On Sat, Jun 20, 2009 at 4:27 AM, Dov Rosenberg wrote:
> Check out Netflix's recommendation engine challenge
>
> http://www.netflixprize.com/
>
> I think they have a large data set you can download.
>
> Dov
>
>
> On 6/19/09 4:07 PM, "David Avendasora"  wrote:
>
>>
>> On Jun 19, 2009, at 2:07 PM, Pascal Robert wrote:
>>
>>> This is a bit off-topic, but does anyone have a good large example
>>> dataset to test different RDBMS, mainly for performance? In fact, I
>>> think it would be nice to have such a thing with a EOModel so that
>>> not only people can test the RDBMS but also different settings for
>>> EO fetching (batch faulting, etc.). Let's just say that the Movies
>>> database is not big enough to do a suitable test... :-)
>>
>> Would there be a way to pull data out of IMDB (do they have a public
>> API like Amazon?) and simply populate the Movie DB with that?
>>
>> Dave
>>
>>
>>>
>>> ---
>>> Pascal Robert
>>>
>>> http://www.macti.ca | http://www.linkedin.com/in/macti
>>>
>>> Skype | Twitter | AIM/iChat : MacTICanada
>>>
>>> ___
>>> 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/drosenberg%40inquira.com
>>
>> This email sent to drosenb...@inquira.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/yungluen%40gmail.com
>
> This email sent to yungl...@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: Report validation error to interface?

2009-06-19 Thread Yung-Luen Lan
Or is there any advanced technology in newer framework/runtime that
gives a beautiful solution?

regards,
yllan

On Fri, Jun 19, 2009 at 7:45 PM, Yung-Luen Lan wrote:
> Hi,
>
> About data validation, there is a common pattern:
>
> 1. Present a form to let user input data.
> 2. Validate the data during input or when form submitted.
> 3. If there are invalid data, shows error message to each field.
>
> To complete this task, I follow the approach that set the error
> messages to a dictionary which was mentioned at:
> http://www.stepwise.com/Articles/Technical/WOValidation.html
>
> However, wolips complains that it cannot verify key beacsue the
> keypath 'validationData' is a collection.
> Also, use a bare string as a key isn't a good idea since tools cannot
> verify the solidness of your code.
>
> So, how do you deal with this situation?
>
> Regards,
> yllan
>
 ___
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: Clean URL

2009-06-19 Thread Yung-Luen Lan
Use a rewrite rule like this (if you use Apache):

RewriteRule ^app/(.*)$ cgi-bin/WebObjects/YourWOApp.woa/$1 [R]

Wach out if you have HTTP GET url. It seems that Apache rewrite didn't
handle URL encoding escape well. (Or just because I didn't set it up
correctly.)

Regards,
yllan

On Fri, Jun 19, 2009 at 8:30 PM, .::welemski::. wrote:
> Hi Lists,
>
> Can someone enlighten me on how did https://www.survs.com/app/wa/signin
> cleaned their webobjects URL?
>
> I'm kinda jealous... and want to learn how'd they do it...
>
> Thanks,
>
> •••
>  Lemuel Raganas
>  welem...@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/yungluen%40gmail.com
>
> This email sent to yungl...@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


Report validation error to interface?

2009-06-19 Thread Yung-Luen Lan
Hi,

About data validation, there is a common pattern:

1. Present a form to let user input data.
2. Validate the data during input or when form submitted.
3. If there are invalid data, shows error message to each field.

To complete this task, I follow the approach that set the error
messages to a dictionary which was mentioned at:
http://www.stepwise.com/Articles/Technical/WOValidation.html

However, wolips complains that it cannot verify key beacsue the
keypath 'validationData' is a collection.
Also, use a bare string as a key isn't a good idea since tools cannot
verify the solidness of your code.

So, how do you deal with this situation?

Regards,
yllan
 ___
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


Wonder version of JavaMonitor/wotaskd classpath configuration

2009-06-17 Thread Yung-Luen Lan
Hi,

I wanna try the wonder version of JavaMonitor and wotaskd.

I directly replace the origin file in
/System/Library/WebObjects/JavaApplications with the new one.
However, I got a NoClassDefFoundError: er/extensions/appserver/ERXApplication.

After investigating JavaMonitor.woa/Contents/MacOS/MacOSClassPath.txt,
I realized that it's because the environment variable HOMEROOT wasn't
set appropriately. Of course I could manually edit this file, but just
want to know what is the suggested way to configure this? Should I put
it in my .bashrc? (which I don't think it's a good idea.)

Regards,
yllan
 ___
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: Snow Leopard compatibility and the future of webobjects

2009-06-13 Thread Yung-Luen Lan
Hi Mke,

On Sat, Jun 13, 2009 at 9:14 PM, Mike Schrag wrote:
> Dave already did this, but I wanted to do a pass also.
> Let me begin this by saying that I have to be very careful what I say
> because I _actually know what is going on_.
> It would be ridiculous for Apple to even consider replacing their incredibly
> profitable and scalable web properties that are built on a very powerful
> technology.

Agree.

> Regardless of what that statement actually means, have you ever used Apple's
> WebObjects support?  I know I haven't.  Anyone who wants ACTUAL WO support,
> email me -- mDimension would be happy to put together a support package for
> you.

That's a good news.

>> Even Apple's current wo apps were not good testimonials for WO.
> iTunes Store and Apple Store are two of the largest online stores in the
> world.  I can't think of better testimonials for WO.

Let me put it this way: Microsoft live.com is the top 5 website in the
world. Will that convert you to ASP?

> Ajax framework has been available for 2 or 3 years in Project Wonder now,
> and has some capabilities that are unique to WO. If you came to WOWODC, you
> would have seen that we have frameworks for writing RESTful JSON services as
> well. Not sure what hot 21st century technology you're missing.

Even I am not here this year, I've read that on Project Wonder blog. I
really appreciate all your work on Project WONDER. Again, I didn't say
WO is like 20-century technology, but Apple's current web service is.

>> Maybe why WebObjects is still in Apple is because (1) Apple has no
>> other web technology, (2) Pierre try hard to defending and promoting
>> WO, and (3) both.
> There's a "(4) because it's awesome" that you're leaving out.

Yup, I forgot that.

Regards,
yllan
 ___
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: Snow Leopard compatibility and the future of webobjects

2009-06-13 Thread Yung-Luen Lan
Hi Dave,

On Sat, Jun 13, 2009 at 7:30 PM, David
Avendasora wrote:
> Hi yllan,
> I haven't had my coffee yet today, so I'm feeling crabby...
> On Jun 13, 2009, at 3:07 AM, Yung-Luen Lan wrote:
>> Since Apple itself is still using WebObjects for MobileMe, iTunes
>> store, AppleStore website, RADAR, devforums and many other system,
>> it's difficult to totally replace all the webobjects app to other
>> technology at once.
> Or ever. WO not only runs their public-facing apps, but it is also the
> foundation of almost every other internal application at Apple. Somebody
> from Apple once said "every penny that Apple makes flows through WO at some
> point". This is not something that they are going to walk away from.

>> Although WO 5.5/5.6 is coming, I personally
>> do not expect any other good news from Apple. First deprecates
>> wo-tools,
> I don't know how often this needs to be said, but the deprecation of the
> Apple-developed tools was very good news for WebObjects. The Cocoa-Java
> Bridge that these tools were based on was deprecated and wouldn't be
> available in Leopard. So Apple was faced with needing to re-write all the
> WO-specific dev tools from scratch. But they very wisely saw that the
> Eclipse-based toolset (WOLips) was already more powerful and less buggy and
> they chose to _support_ that instead. The tools changed, they didn't
> disappear.
> Their decision to recommend, use and invest in WOLips has had a hugely
> positive impact on the ongoing development of the WO frameworks _and_ the
> Dev Tools. All internal WO development can now focus on improving the
> frameworks instead of being sidetracked by the tools. And improve they have.
> The new templating system in WO 5.4 is really amazing.
> The strides that WOLips has made over the last year with Apple's backing is
> simply phenomenal.

I knew that the WO runtime has been improved over year, and Apple uses
many WO in their web applications notheless internal or external. What
I concerned about the future of WO is, will Apple promote WO to
public? Go to http://developer.apple.com/referencelibrary/ check how
many WO documents were produced after 2007. Only 4. The latest one
even doesn't finished yet. The example code come with Xcode are a bit
outdated and problematic. I still remember how stupid I were last year
when I came to WWDC WebObjects Lab. However, even Pascal Robert can't
get the Apple examples compiled on my system. I'm not sure if Apple
has fixed that, but the environment is unfriendly to new learner.

Besides the lack of documentation, another point is how much effort
made by Apple goes directly into the community. Of course WOLips will
be benefit if WO runtime has improvements, but did Apple ever sponsor
WOLips just like what they did to clang? Or any WO-related thing Apple
want to make it as industry standard just like block in C, OpenCL,
llvm?

I mean, if they improve WO just only becasue they have a lot of WO web
apps (think about what Adobe will do if they are accessible to carbon
frameworks--make a 64bit version without a totally rewrite) and are
going to use WO only for Apple's own applications without promoting to
public, it's not a good thing to developers outside Apple.

>> --I even talked to an Apple
>> employee at WWDC08 and he said, "You are using WebObjects? I thought
>> only europeans use that." Of course it's just kidding in a very
>> private conversation, but it more or less shows that not all Apple
>> employees are satisfying with WebObjects,
> Yeah. One guy makes a snide remark and you take it to mean there's a
> fundamental problem with WO?

No. Just like I said, it's not a problem of essence of WebObjects at all.

>> Even Apple's current wo apps were not good testimonials for WO.
> Based on what? That's a big statement.

(1) I often got a seesion timeout when I download iPhone SDK or
something right after I login into developer program page.
(2) The session management is a mess in iTunesConnect.
(3) When I click into an article in page 3 of devforum and jump back,
it goes to page 1.
(4) Short-lived session (since I type English very slow, RADAR often
kicks me out.)
(5) Apple Online Store made some bad assumption on the name of
customer and rewrite the bad data to apple acount. No way to change.
One of my friend got his name displayed on AppStore as "股公司 liu" for a
long time. The first part is not even part of his name!
(6) ..

Again, I'm not saying it's because the essense of WO, it may be caused
by flawed design, not well-trained programmer, misunderstood of
requirements or anything.

What I said is, Apple's current wo apps are not good web apps comaring
to other web apps I've used.
Since it's not an excellent we

Snow Leopard compatibility and the future of webobjects

2009-06-13 Thread Yung-Luen Lan
Hi,

*** WARNING: I  wasn't able to be at WWDC or WOWODC this year so I'm
not sure the following is correct. ***

According to the website:
http://mac.topnewsdigest.com/uncategorized/conflicting-information-about-webobjects/

"Mac OS X 10.6 server no longer support WebObjects."

I'm not to talk about NDA-things here. Instead, I'm here to discuss
what the above statement mean to us.

Since Apple itself is still using WebObjects for MobileMe, iTunes
store, AppleStore website, RADAR, devforums and many other system,
it's difficult to totally replace all the webobjects app to other
technology at once.

However, I speculate that Apple will put less and less effort on
WebObjects year by year. Although WO 5.5/5.6 is coming, I personally
do not expect any other good news from Apple. First deprecates
wo-tools, then discontinue the support of WO in the next release of
their OS. Apple's attitute is obvious––I even talked to an Apple
employee at WWDC08 and he said, "You are using WebObjects? I thought
only europeans use that." Of course it's just kidding in a very
private conversation, but it more or less shows that not all Apple
employees are satisfying with WebObjects, and I guess their percentage
isn't low. It seems that this year we have nothing metioned on the
WWDC IT session page. No lab either.

Even Apple's current wo apps were not good testimonials for WO. Some
developers think that Apple's web apps are infamous as
20-century-style and feel frustrated when using them. (It's a long
story about how Apple Online Store screw its customer's names with
iPhone dev program) Well, it may not be the problem of the essence of
WO at all, but the lack of documentation/support is.

Maybe why WebObjects is still in Apple is because (1) Apple has no
other web technology, (2) Pierre try hard to defending and promoting
WO, and (3) both. I predict the future of WebObjects will be totally
running from community.

Could you share some thoughts with me? Thanks.

Regards,
yllan
 ___
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


$parent.method binding error in eclipse

2009-01-06 Thread Yung-Luen Lan
Hi,

I have a template component with a such line:



which calls the authorized() method of the parent component.

However, eclipse always display an error saying there is no key
'authorized' for the keypath 'parent' in my class.
How do I make the error message disappear? Thanks.

Regards,
yllan
 ___
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: Lots of EOs slow down the performance

2008-11-06 Thread Yung-Luen Lan
On Fri, Nov 7, 2008 at 1:17 AM, Guido Neitzer <[EMAIL PROTECTED]> wrote:
> On 06.11.2008, at 02:05, Yung-Luen Lan wrote:
> Sure, you probably got an out of memory exception if you don't recycle your
> editing contexts and do some intelligent things for creating the output.

You're right. I don't know if it's proper to handle ECs in my way.
Normally I set a variable to hold EC in each components, sometimes I
create EOs, insert them into a new EC and track the EC with
object.editingContext(). Do you have any trick or pattern to recycle
EC? Call System.gc()?

>> Investigation more, actually, it's slow to do ec.saveChanges() with
>> 150,000 eo inserted.
> What do you expect? It has to create 150k insert statements. One for each
> object, then copy these to the JDBC driver, that one executes them one by
> one on the database ... and so on. It's just a plain inefficient way of
> creating rows in the table.

I'm not sure about this. Maybe group those SQL statements into one
transaction could help?
(Or is that already been done with EOF?)

> Again: you are running out of memory. Read the error message.
>
> First of all: EOF is not build for bulk operations. If you want to do
> something like that, you need to find other ways. What I prefer to do for
> something like that:
>
> - use ERXFetchSpecificationBatchIterator and iterate over the objects in
> small batches of 100 or 200 rows
>
> - create the CVS file on disk with an output stream that doesn't keep the
> whole thing in memory
>
> - deliver the file when the operation is done

Yeah, those are actually what I do taking your suggestions--except the
first one. I'm still learning what is a fetch specification. Thanks
again.

> Alternately, give the apps (and Eclipse) more memory - but that solves it
> only to a certain point and is definitely not a preferable solution.

>> Just curious how do you deal with editingContext.saveChanges() with
>> lots of EO inserted? Um, I don't think 150,000 should be a big deal in
>> 21 century.
> Think about what is going on in that case. You have a 15 objects in Java
> land, you might have relationships, you create string representations for
> each and every import statement, maybe more than one string per statements -
> remember String is immutable and the GC always comes too late -, you pass
> that to the JDBC adaptor as one transaction so that one keeps it's own copy
> of the statements (not sure, but likely if you expect the worst case), and
> so on. If each of your objects is around 1k of size, you 15k or around
> 146MB and that is just to keep the objects around. What did you say how much
> memory do you give your Java apps?

I totally agree your point. Let me break this into two parts--space and time.

Memory: it appears that EC isn't suited for insert a lot EO into
database because the memory footstep of EC work like this: hold
objects in memory, discard or save them to db at once. Other ORM tool
like activerecord or python.db seems don't have the concept of EC;
they just invoke save() on each objects. In this case, activerecord or
python.db are not likely devour all the memory because each object
could be collected after they're saved. I'm not saying that which one
is better than which. EC is not for doing bulk insert, just like you
said. I just want to know if there is way to save each object
seperately. Finally I put a line into loop and it works: if (i % 1000
== 0) ec.saveChangs();

Performance: I did some benchmark on my database. 150,000 insertion on
the same table:

Raw SQL, transaction: 23s
Raw SQL, no transaction: 154s
EC, saveChanges every 1000 EO inserted: 273s

Comparing raw SQL without transaction, EC method is not bad at all.
(only 1.7x slower) I don't care about to reduce the wait time from
five minutes to half. Totally acceptable. :-)

> You should do some basic calculation and estimation before you complain
> about something ... Just because you are using the tool wrong, it's not bad
> or old. You still need to know what you're doing. Especially with high level
> tools.

Ah, if my previous post offense people, I apologize. What I really
mean is obsolutely not "why webobject is bad and old", but "This
should be done easily in 21 century. I must do something wrong. What's
the correct way?"

> If you really need to do this in Java / EOF, recycle your editing contexts
> every now and then. Better - use raw database operations. We do imports of
> millions of objects each day and we have no problems ...
>
> cug
 ___
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 [EMAIL PROTECTED]


Re: Lots of EOs slow down the performance

2008-11-06 Thread Yung-Luen Lan
Ah, thanks to all.

First thing I tried is AjaxLongResponse. I thought it's acceptable to
display a progress bar and let users wait. Surprisingly, I still got a
"no instance error" after 150,000 eo created.

I then tried the suggestion to replace CSV component with a library
that dump the data into files. Nothing changed. I got the csv
component wrong. It's not slow to use component.

Investigation more, actually, it's slow to do ec.saveChanges() with
150,000 eo inserted. I got broken pipe. I got heap memory error. I
have no idea why it break AjaxLongResponse. It's in another thread,
isn't it?

Anyway, I do ec.saveChanges() each 1000-iteration of eo insertion, and it works.

Just curious how do you deal with editingContext.saveChanges() with
lots of EO inserted? Um, I don't think 150,000 should be a big deal in
21 century.

Regards,
yllan

On Wed, Nov 5, 2008 at 10:45 PM, Guido Neitzer <[EMAIL PROTECTED]> wrote:
> On 05.11.2008, at 02:56, Yung-Luen Lan wrote:
>
>> How could I improve the performance? Or at least let my page won't be
>> killed after 30 secs.
>
> 1. Use raw rows.
>
> 2. Don't use a component, dump for example into a file and deliver the file.
>
> 3. Use WOLongResponsePage or something similar (ERXLongResponseTask,
> AjaxLongResponse) to create the file in the background.
>
> 4. Use Wonder to make all of that way easier.
>
> cug
>
 ___
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 [EMAIL PROTECTED]


Lots of EOs slow down the performance

2008-11-05 Thread Yung-Luen Lan
Hi,

There is a task has be done in my wo app: creating thousands of (about
200,000) EOs and generating a csv file containing the information for
download.

When I create only 1000 EOs, it's fine. But if I create over 20,000
EOs, my page was kill due to no response after 30 secs. So there are
EOs created but no csv to download.

I checked the code, EO generating is fast. The problem is CSV
component. It's just a WORepetition with some WOString that reads the
EO's property directly.
I have no idea why it take so long to handle 200,000 EOs. (The result
file may exceed 5MB, however that's small in 21 century.)

How could I improve the performance? Or at least let my page won't be
killed after 30 secs.
(so I could wait for the csv to be generate.)

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


[OT] Is there any WebObjects folder icon?

2008-10-20 Thread Yung-Luen Lan
Wondering if there is any cool {webobjects, WOLips, Wonder} folder
icon for Mac OS X.

You know, it will be fun if your webobjects-related folder have neat
icon rather than plain folder.

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Re: Unique ID without create entity?

2008-10-04 Thread Yung-Luen Lan
Thanks for your suggestion. Could you elaborate more? Why is using PK
considered as a bad style?

Regards,
yllan

On 10/4/08, Guido Neitzer <[EMAIL PROTECTED]> wrote:
> On 03.10.2008, at 23:55, Yung-Luen Lan wrote:
>
>> I'm now connect my wo app to 3rd party banking service. According to
>> their API, I need to provide a "transaction id" that is unique for
>> each transaction or I'll get error.
>>
>> Sure, it can be done by creating an entity class and use PK as a
>> unique id. But I don't want to create the entity class since I don't
>> need that.
>>
>> What I want is just like this:
>>
>> SELECT nextval('serial');
>>
>> Can I do this in webobjects?
>
> You can, but I'd think really hard about not making an entity. What
> I'd do is creating a Transaction entity and a sequence in the
> database, populate an attribute of a new transaction with a value from
> the sequence (look at EOUtilities.rawRowsForSQL to see how to use the
> direct SQL) and store that transaction in the database - update it
> with status, log, whatever information you get from the banking
> service. Make the transaction id column unique in the database too,
> but don't use the primary key (that is considered bad style).
>
> Just as a friendly advise ...
>
> cug
>
> --
> Real World WebObjects Bootcamp at the Big Nerd Ranch:
> http://www.bignerdranch.com/classes/real-world_webobjects.shtml
>
>
 ___
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 [EMAIL PROTECTED]


Unique ID without create entity?

2008-10-03 Thread Yung-Luen Lan
Hi,

I'm now connect my wo app to 3rd party banking service. According to
their API, I need to provide a "transaction id" that is unique for
each transaction or I'll get error.

Sure, it can be done by creating an entity class and use PK as a
unique id. But I don't want to create the entity class since I don't
need that.

What I want is just like this:

SELECT nextval('serial');

Can I do this in webobjects?

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Re: Identical requests make my csv component always returns the same content

2008-09-14 Thread Yung-Luen Lan
It solves my problem!
Thank you very much!

Regards,
yllan

On Sun, Sep 14, 2008 at 4:36 PM, Stephane Guyot
<[EMAIL PROTECTED]> wrote:
>
> Ok sorry,
> I'm trying to help you but ...

Please don't say sorry. I'm really grateful for your help. :-)

> If you put , just for test , setPageCacheSize(0) on WOApplication the
> problem disapears ?
> See setPageFragmentCacheSize too.
> Did you have a Session ?
> If yes , overriding one of the methods savePage, savePageInPageCache
> or savePageInPageFragmentCache
> to prevent to put in cache some of your pages based on their name may be
> what you are looking for ?
> You can still rely on your own API on each component , like mayBeCached
> defaulting to true, and then overriding on per page basis when you don't
> want caching.
> If you have no session, url of your page may be cache by the browser, then i
> would try to add dummy value in a query string.
> HTH one more time,
> Stephane
> Le 14 sept. 08 à 09:55, Yung-Luen Lan a écrit :
>
> On Sun, Sep 14, 2008 at 3:01 PM, Stephane Guyot
> <[EMAIL PROTECTED]> wrote:
>
> Hi Yung-Luen,
> have a look on the following method : disableClientCaching ---> Class
> WOResponse
> http://developer.apple.com/documentation/DeveloperTools/Reference/WO541Reference/com/webobjects/appserver/WOResponse.html#disableClientCaching()
> You can override appendToResponse in your CSVReport page and invoke
> disableClientCaching,
> something like :
> public void appendToResponse(WOResponse aResponse, WOContext aContext) {
> aResponse.setHeader("application/vnd.ms-excel", "Content-Type");
> super.appendToResponse(aResponse, aContext);
> aResponse.disableClientCaching();
> }
>
> Yes, I've already add this line to my class. However, my problem is
> not a "client side caching" but a "server side caching" I believed.
> There is a method that disable the server side caching on
> WOApplication, but I hope there is some way to set it on specific
> components.
> Regards,
> yllan
>
>
 ___
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 [EMAIL PROTECTED]


Re: Identical requests make my csv component always returns the same content

2008-09-14 Thread Yung-Luen Lan
On Sun, Sep 14, 2008 at 3:01 PM, Stephane Guyot
<[EMAIL PROTECTED]> wrote:
>
> Hi Yung-Luen,
> have a look on the following method : disableClientCaching ---> Class
> WOResponse
> http://developer.apple.com/documentation/DeveloperTools/Reference/WO541Reference/com/webobjects/appserver/WOResponse.html#disableClientCaching()
> You can override appendToResponse in your CSVReport page and invoke
> disableClientCaching,
> something like :
>
> public void appendToResponse(WOResponse aResponse, WOContext aContext) {
> aResponse.setHeader("application/vnd.ms-excel", "Content-Type");
> super.appendToResponse(aResponse, aContext);
> aResponse.disableClientCaching();
> }
>

Yes, I've already add this line to my class. However, my problem is
not a "client side caching" but a "server side caching" I believed.

There is a method that disable the server side caching on
WOApplication, but I hope there is some way to set it on specific
components.

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Re: WOCookie & Safari

2008-09-05 Thread Yung-Luen Lan
Uh, to be more pricisely, my problem is not because WO won't parse
empty cookie properly.

My problem is, cookie containing wosid and woinst will be deleted
after quitting browser. Hence, there's no way to implement function
like "login automatically."

Digging into this problem, I found that my session cookie generated by
WO 5.4.2 contains empty expire field, which make the browser
automatically remove it on quit.

Is there any way to keep session cookie after quit browsers?

Regards,
yllan


On Fri, Sep 5, 2008 at 6:43 PM, Andrew Lindesay <[EMAIL PROTECTED]> wrote:
> Hello Yung-Luen;
>
> I think these empty cookies will parse in WO 5.4.2 now, but the application
> server will log an error each time which is a bit annoying.  I get my error
> log lines emailed to me so it was actually very annoying for a short while
> there!  For this reason, I left that code (maybe slightly improved) in situ
> and also implemented something similar here...
>
>WOApplication.handleMalformedCookieString(..)
>
> ...to strip those empty cookies as well.
>
> cheers.
>
>> Is this issue fixed in 5.4.2? I still encountered this problem (Not
>> only Safari 3, but also FireFox 3 delete my cookie on quit) in 5.4.2.
>
> ___
> 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/yungluen%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
 ___
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 [EMAIL PROTECTED]


Re: WOCookie & Safari

2008-09-05 Thread Yung-Luen Lan
Hi,

Is this issue fixed in 5.4.2? I still encountered this problem (Not
only Safari 3, but also FireFox 3 delete my cookie on quit) in 5.4.2.

However, with Andrew's code inside my WOApplication.createRequest(), I
still got the same problem.
What could be wrong in my code?

 I rewrote some lines since I don't have LEStringHelper ===
public WORequest createRequest(String aMethod, String aURL, String
anHTTPVersion, Map> someHeaders, NSData
aContent, Map someInfo) {
 if (null != someHeaders) {
 List cookieValues = (List) someHeaders.get("cookie");

 if (null != cookieValues) {
 for (int i = 0; i < cookieValues.size();) {
 String cookieValue = (String) cookieValues.get(i);

 if ((-1 != cookieValue.indexOf("=;")) ||
cookieValue.endsWith("=")) {
 StringBuffer sb = new StringBuffer();
 String [] pairs = cookieValue.split(";");


 for (String pair : pairs) {

int equalsIdx = pair.indexOf('=');

if ((-1 != equalsIdx) && (equalsIdx !=
pair.length()-1)) {
String key = pair.substring(0, 
equalsIdx).trim();
String value =
pair.substring(equalsIdx+1).trim();

if ((0 != key.length()) && (0 !=
value.length())) {
if (0 != sb.length())
sb.append(";");
sb.append(key);
sb.append("=");
sb.append(value);
}
}
 }

 if (0 != sb.length()) {
 cookieValues.set(i, sb.toString());
 i++;
 } else
 cookieValues.remove(i);
 } else
 i++;
 }
 if (0 == cookieValues.size())
someHeaders.remove("cookie");
 }
 }
 return super.createRequest(aMethod, aURL, anHTTPVersion,
someHeaders, aContent, someInfo);
}


Regards,
yllan

On Tue, Mar 4, 2008 at 8:16 AM, Andrew Lindesay <[EMAIL PROTECTED]> wrote:
> Hello Ryan;
>
> I stuck this...
>
> // [apl 18.feb.2008]
> // WebObjects 5.4.1 has a problem dealing with cookies that have their value
> as
> // an empty string.  This little block of code should be able to remove
> those
> // such that they no longer pose a problem for the WO parser.  This MUST BE
> // removed once this problem has been resolved in WO.
>
>if(null!=someHeaders)
>{
>List cookieValues = (List) someHeaders.get("cookie");
>
>if(null!=cookieValues)
>{
>for(int i=0;i{
>String cookieValue = (String)
> cookieValues.get(i);
>
>if((-1!=cookieValue.indexOf("=;")) ||
> cookieValue.endsWith("="))
>{
>StringBuffer sb = new
> StringBuffer();
>List pairs =
> LEStringHelper.splitUpWithDelimiter(cookieValue, ';');
>Iterator pairsI =
> pairs.iterator();
>
>while(pairsI.hasNext())
>{
>String pair =
> pairsI.next();
>int equalsIdx =
> pair.indexOf('=');
>
>if((-1!=equalsIdx) &&
> (equalsIdx != pair.length()-1))
>{
>String key =
> LEStringHelper.trim(pair.substring(0, equalsIdx));
>String value
> = LEStringHelper.trim(pair.substring(equalsIdx+1));
>
>
>  if((0!=key.length()) && (0!=value.length()))
>{
>
>  if(0!=sb.length())
>
>sb.append(";");
>
>
>  sb.append(key);
>
>  sb.append("=");
>
>  sb.append(value);
>}
>}
>}
>
>if(0!=sb.length())
>{

Re: Will Insensitive Like become potential sql injection?

2008-08-28 Thread Yung-Luen Lan
Thanks for your clarification.
If I only want a case-insensible "exact" equality, is there any easy
way to do the following?

select * from table where lower(email) = lower('[EMAIL PROTECTED]');

Regards,
yllan

On Fri, Aug 29, 2008 at 12:04 AM, Mike Schrag <[EMAIL PROTECTED]> wrote:
>> I wonder if that will introduce SQL injection vulnerability into my
>> system:
>> assuming adversary have * or % in his email address query string, will
>> that hurt my database security?
>
> If you are taking a string from a user and just doing "*" + thatString +
> "*", (or something like that), then, yes, they could inject additional
> regexes into that.  This isn't quite SQL injection -- I guess you'd call it
> "regex injection".  As far as whether or not it impacts your security, it
> really depends on how you're using the query.  If you're doing "and password
> like '*..." then i suppose it could, but if you're just searching, say,
> product names and someone puts in a *, it's probably going to potentially
> just give them different results.  So I guess my point is that if the
> qualifier in question is participating in a query where the results of the
> query are a security concern, then, yes, you should be careful about the
> values you accept there.
>
> ms
>
> ___
> 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/yungluen%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
 ___
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 [EMAIL PROTECTED]


Will Insensitive Like become potential sql injection?

2008-08-28 Thread Yung-Luen Lan
Hi,

I want to match my email case-insensitively, it seems that the easiest
way is using ERXQ.ILIKE.

I wonder if that will introduce SQL injection vulnerability into my system:
assuming adversary have * or % in his email address query string, will
that hurt my database security?

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Re: Resource Manager returns wrong URL for files in sub-folder of WebServerResources

2008-07-24 Thread Yung-Luen Lan
Nope. I just make symbolic links from my webserver root to WSR folder
and hard coded those absolute path.
That's the trick I learnt from David LeBer at WWDC 08.

Regards,
yllan

On Wed, Jul 23, 2008 at 5:01 PM, Paul Stringer <[EMAIL PROTECTED]> wrote:
> I had the same problem with nested folders, I ended up putting everything at
> the root of webserver resources, did you find  solution?
> ___
> 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/yungluen%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
 ___
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 [EMAIL PROTECTED]


Re: log rotation?

2008-07-21 Thread Yung-Luen Lan
I've write it to WO wiki:
http://wiki.objectstyle.org/confluence/display/WO/Web+Applications-Deployment-Logging

Anyway, how do you enable the property substitution in wonder?
I use WO 5.4.2 plus the latest Wonder but the @@blahblah@@ things were
not substituted.
Is there any configuration have to be made?

Regards,
yllan

On Fri, Jul 18, 2008 at 4:29 AM, Kieran Kelleher <[EMAIL PROTECTED]> wrote:
> An example is best ... here is my logging config straight from my current
> app down below..
>
> Note the use of @@blahblah@@ property substitution ... a Wonder feature that
> resolves when it reads Properties files.
>
> Note the values for log4j.appender.A2.file and log4j.appender.myMail.Subject
>
> Logs for every instance are unique and auto-rotate every day. Any errors get
> instantly emailed with subject line indicating which woa, host and port.
>
> 
> #
> # ERXLogger
> #
> # Pattern codes:
> # %-5p : Priority DEBUG, INFO, WARN, etc.
> # %d(ISO08601 : Date and time
> # %t : Thread
> # %c : Logger name (usually a class name)
> # %m%n : Log message arguments
>
> # Available levels are DEBUG, INFO, WARN, ERROR, FATAL
>
> # log4j appender and formatting
> log4j.rootLogger=WARN, A2, myMail
> log4j.loggerFactory=er.extensions.ERXLogger$Factory
>
> # A1 is a ConsoleAppender
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> log4j.appender.A1.layout=er.extensions.ERXPatternLayout
> #log4j.appender.A1.layout.ConversionPattern=%-5p %d{HH:mm:ss} (%-20c:%L) %x
> -%m%n
> log4j.appender.A1.layout.ConversionPattern=%r %-5p [%t] (%C{3}, %M, %L) -
> %n%m%n%n
>
> # A2 is a DailyRollingFileAppender
> log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.A2.file=/var/log/webobjects_apps/@@build.app.bundle.name@@-@@WOPort@@.log
> log4j.appender.A2.datePattern='.'-MM-dd
> log4j.appender.A2.append=true
> log4j.appender.A2.layout=er.extensions.ERXPatternLayout
> log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} [%t] (%c: %L) -
> %m%n
>
> # myMail is the SMTPAppender
> log4j.appender.myMail=org.apache.log4j.net.SMTPAppender
> log4j.appender.myMail.Threshold=ERROR
> log4j.appender.myMail.BufferSize=10
> # log4j.appender.myMail.To=,
> log4j.appender.myMail.From=
> log4j.appender.myMail.SMTPHost=@@cheetah.smtpserver@@
> log4j.appender.myMail.Subject=Log4J Error (@@build.app.bundle.name@@ host
> @@host@@ port @@WOPort@@)
> log4j.appender.myMail.layout=er.extensions.ERXPatternLayout
> # log4j.appender.myMail.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
> log4j.appender.myMail.layout.ConversionPattern=%r %-5p %d{ISO8601}%n%n%V{t
> total/u used/f free}%n%n[%t] %n%n (%C, %M, %F:%L) - %n%n%m%n
>
> 
>
>
>
>
>
> On Jul 17, 2008, at 1:43 PM, Chuck Hill wrote:
>
>>
>> On Jul 17, 2008, at 10:07 AM, Guido Neitzer wrote:
>>
>>> On 17.07.2008, at 11:04, Yung-Luen Lan wrote:
>>>
>>>> How to set the log to old way? (Automatically change the name everyday)
>>>
>>> Take a look at Log4j.
>>
>>
>> So how do you work this?  Does that not just put the logs from all the
>> instances into one file?  I am still just routing the log4j stuff to console
>> so that the log file set in JavaMonitor gets the output.
>>
>> Chuck
>>
>> --
>>
>> 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/kieran_lists%40mac.com
>>
>> This email sent to [EMAIL PROTECTED]
>
> ___
> 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/yungluen%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
 ___
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 [EMAIL PROTECTED]


Re: Localization Help! (was Localizer Default vs. Browser)

2008-07-19 Thread Yung-Luen Lan
Hi Rams,

I'm quite confused about this code. I copied this to my DirectAction
class but it didn't work.
In my project, I have English.lproj, zh_TW.lproj, zh_CN.lproj.
I have my Properies file setup with:

er.extensions.ERXLocalizer.defaultLanguage=English
er.extensions.ERXLocalizer.fileNamesToWatch=("Localizable.strings","ValidationTemplate.strings")
er.extensions.ERXLocalizer.availableLanguages=(English, zh_TW, zh_CN)
er.extensions.ERXLocalizer.frameworkSearchPath=(app,ERDirectToWeb,ERExtensions)

My system/browser is English. Default language is English. I print out
context().request().browserLanguages(), which is exactly English. But
at the top of my action, I print out session().languages() and got
zh_TW (Traditional Chinese) localizer.

Why the localizer change its language after the performActionNamed()
but before myAction actually being called?
My guess is, setup the current localizer not necessary change the
localizer of sessions. Any idea on how to make the code actually work?

Regards,
yllan

On Fri, Jun 13, 2008 at 7:46 AM, Rams <[EMAIL PROTECTED]> wrote:
> --Direct Actions--
>
> If you're using direct actions, you can stick this in your direct action
> class:
>
>@Override
>public WOActionResults performActionNamed(String actionName) {
>if(!context().hasSession()) {
>ERXLocalizer localizer =
>
>  ERXLocalizer.localizerForLanguages(context().request().browserLanguages());
>ERXLocalizer.setCurrentLocalizer(localizer);
>}
>return super.performActionNamed(actionName);
>}
>
> That will give the user their browser's default language instead of your
> server's default language if there is no session and their language is
> available.  If you aren't defaulting to direct actions though, a session is
> going to be created, that will happen anyway, and this will be superfluous.
>
 ___
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 [EMAIL PROTECTED]


Re: Resource Manager returns wrong URL for files in sub-folder of WebServerResources

2008-07-19 Thread Yung-Luen Lan
I find my files under build/MyApp.woa/Contents/WebServerResources
(built using eclipse -> Run) was flattened,
but dist/MyApp.woa/Contents/WebServerResources (built using build.xml
-> Run As Ant Build) are not.

Why are these results different? How do I make them consistent?

Regards,
yllan

On Thu, Jul 17, 2008 at 8:00 PM, Yung-Luen Lan <[EMAIL PROTECTED]> wrote:
> Yes, but urlForResourceNamed("/css/main.css", null, null, null) also returns
> "/ERROR/NOT_FOUND/app=MyAppfilename=/css/main.css".
>
> Regards,
> yllan
>
> On Thu, Jul 17, 2008 at 7:20 PM, Lachlan Deck <[EMAIL PROTECTED]> wrote:
>> On 17/07/2008, at 7:14 PM, Yung-Luen Lan wrote:
>>
>>> I put my css/javascript/images into these folder:
>>>
>>> WebServerResouces/css/
>>> WebServerResouces/js/
>>> WebServerResouces/imgs/
>>>
>>> in my eclipse wo project. I checked the compiled
>>> MyApp.woa/Contents/WebServerResources, these sub-folders were not
>>> flattened.
>>>
>>> However, when I call
>>> application().resourceManager().urlForResourceNamed("main.css", null,
>>> null, null), it returns
>>> "/WebObjects/MyApp.woa/Contents/WebServerResources/main.css". <--
>>> should be .../WSR/css/main.css
>>>
>>> And
>>> application().resourceManager().urlForResourceNamed("css/main.css",
>>> null, null, null) returns
>>> "/ERROR/NOT_FOUND/app=HypoServer/filename=css/main.css".
>>>
>>> How could I get the correct url for files inside sub-folders of WSR?
>>> Thanks.
>>
>> Have you tried urlForResourceNamed("/css/main.css", null, null, null)?
>>
>> 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 [EMAIL PROTECTED]


Re: log rotation?

2008-07-17 Thread Yung-Luen Lan
Ah, thanks. Forgot to recover my Properties file.

Regards,
yllan

On Fri, Jul 18, 2008 at 1:07 AM, Guido Neitzer <[EMAIL PROTECTED]> wrote:
> On 17.07.2008, at 11:04, Yung-Luen Lan wrote:
>
>> How to set the log to old way? (Automatically change the name everyday)
>
> Take a look at Log4j.
>
> cug
>
> --
> http://www.event-s.net
>
>
 ___
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 [EMAIL PROTECTED]


log rotation?

2008-07-17 Thread Yung-Luen Lan
Hi,

How to setup the log rotation of webobjects app? My app used to
produce log file with name like
MyApp.log.20080603
automatically. Fine.

But after I update my framework, OS and WebObjects, the log file won't
append the date to filename automatically except the app terminates!
That means, I have only one file MyApp.log, it's overwritten everyday.
(Ooops, I lost my log everyday!)
When I restart my app, the current MyApp.log becomes
MyApp.log.20080716155248451(I just need the /mm/dd) and the new
log starts from MyApp.log.

How to set the log to old way? (Automatically change the name everyday)

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Re: Resource Manager returns wrong URL for files in sub-folder of WebServerResources

2008-07-17 Thread Yung-Luen Lan
Yes, but urlForResourceNamed("/css/main.css", null, null, null) also returns
"/ERROR/NOT_FOUND/app=MyAppfilename=/css/main.css".

Regards,
yllan

On Thu, Jul 17, 2008 at 7:20 PM, Lachlan Deck <[EMAIL PROTECTED]> wrote:
> On 17/07/2008, at 7:14 PM, Yung-Luen Lan wrote:
>
>> I put my css/javascript/images into these folder:
>>
>> WebServerResouces/css/
>> WebServerResouces/js/
>> WebServerResouces/imgs/
>>
>> in my eclipse wo project. I checked the compiled
>> MyApp.woa/Contents/WebServerResources, these sub-folders were not
>> flattened.
>>
>> However, when I call
>> application().resourceManager().urlForResourceNamed("main.css", null,
>> null, null), it returns
>> "/WebObjects/MyApp.woa/Contents/WebServerResources/main.css". <--
>> should be .../WSR/css/main.css
>>
>> And
>> application().resourceManager().urlForResourceNamed("css/main.css",
>> null, null, null) returns
>> "/ERROR/NOT_FOUND/app=HypoServer/filename=css/main.css".
>>
>> How could I get the correct url for files inside sub-folders of WSR?
>> Thanks.
>
> Have you tried urlForResourceNamed("/css/main.css", null, null, null)?
>
> 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 [EMAIL PROTECTED]


Resource Manager returns wrong URL for files in sub-folder of WebServerResources

2008-07-17 Thread Yung-Luen Lan
Hi,

I put my css/javascript/images into these folder:

WebServerResouces/css/
WebServerResouces/js/
WebServerResouces/imgs/

in my eclipse wo project. I checked the compiled
MyApp.woa/Contents/WebServerResources, these sub-folders were not
flattened.

However, when I call
application().resourceManager().urlForResourceNamed("main.css", null,
null, null), it returns
"/WebObjects/MyApp.woa/Contents/WebServerResources/main.css". <--
should be .../WSR/css/main.css

And
application().resourceManager().urlForResourceNamed("css/main.css",
null, null, null) returns
"/ERROR/NOT_FOUND/app=HypoServer/filename=css/main.css".

How could I get the correct url for files inside sub-folders of WSR? Thanks.

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Re: DB Migration Paradigm?

2008-06-22 Thread Yung-Luen Lan
Thanks David.

On Sat, Jun 21, 2008 at 3:48 AM, David Holt <[EMAIL PROTECTED]> wrote:
> Hello,
> You may want to move this question to the Wonder list for better answers.
> My response is below:
> On 20-Jun-08, at 12:33 AM, Yung-Luen Lan wrote:
> [SNIP]
> You'll need to read the package summary file
> <http://webobjects.mdimension.com/wonder/api/er/extensions/migration/package-summary.html>
>  for
> information about how to incorporate migrations into an existing project.
> You will probably need to choose one method or the other. You could, for
> example, take the current state of the database as your Migration 0 and use
> the Wonder method going forward. Remember to either update your version
> table or set the property described in the overview file so that you don't
> recreate your existing tables. Be really careful with this stuff!! Back up
> your databases before you do any testing with it!!

Ah, it's my fault. I didn't realized that there's scroller on that page before!

> > And I'm adding prototype to my EOModel, which changes my EOModel a
> > lot. (each attribute will be assigned a prototype, which my change
> > their type or width.) Should I write my migration class for every
> > column manually?
> Not sure what you mean by this.

My existing model didn't use ERPrototypes. Now I want to assign each
column a prototype, but that will result a lot of changes to my model.
For example, some of my attribute (varchar) have external length 32,
and there's no varchar32 in the Prototypes popup menu in Entity
Modeler, so I'll choose the nearest varchar50. That will change a lot
of columns in my existing database! Just wonder if there is any way
that I don't need to write migration for each column manually.

> > Is there any way to generate those migration
> > automatically?
> You can generate the base migration class using EntityModeler. It takes
> prototypes into consideration, so this might address your question above.
> David

Yes, but it always generate migration file which create tables and
columns. In my case, I use this feature to generate Migration0, which
"generate" tables and columns of my existing db schema. (Well, it
didn't generate anything. I create this migration is just because I
want to let the ERMigration system know my existing project/model/db
and I'll use your trick to avoid them be really executed.) Now I want
to change the model a lot, how can I "incrementally" generate those
modifications? Like CoreData migration, you have the old model and new
one, and it will compare them automatically and give you the default
migration file.

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


DB Migration Paradigm?

2008-06-20 Thread Yung-Luen Lan
Hi,

Since Chuck said "Use prototype, or you're stupid" in his awesome
session in WOWODC 08, I looked into my project and realized that I
need to modernize it: legacy format (eogenerator / Xcode project / not
fluffy bunny layout), not using prototype in EOModel, using
session().defaultEditingContext(), pageWithName("ClassName"), etc.

Thanks to the help from David LeBer and Pascal, I converted my project
into fluffy bunny during WWDC webobjects lab.

However, when I come back and try to continuely improving my code, I
got a little bit confused about migration.

Today I read an article about migration:

http://www.stepwise.com/Articles/2005/DBChanges/index.html

finally I realized where all the java file in my project like
Database.java, Updater.java, Update0.java come from. Of course I
didn't write the corresponding UpdateX.java file since I have no idea
what it do before. When I changed EOModel, I just manually write SQL
statement and paste into psql.

Now we have er.extensions.migration. How do I convert those old-school
java file into WONDER world? I mean, my app has already run as
production server for a long time. How do I leverage the ERXMigration
into a project that didn't start with ERXMigration at first? After
that, when I make changes to EOModel, I must create an migration class
like MyMigrationX+1 right? Anything else?

And I'm adding prototype to my EOModel, which changes my EOModel a
lot. (each attribute will be assigned a prototype, which my change
their type or width.) Should I write my migration class for every
column manually? Is there any way to generate those migration
automatically?

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


[OT] Will WOWODC slides be available to download?

2008-06-07 Thread Yung-Luen Lan
Hi,

Nice to see you all at WOWODC today. Obviously I'm the one who know wo
least among all of you. (I'm still learning it!)
Thanks to many people answering questions for me.

I just wonder will these slides be available to download before videos?

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


ERPPieChart - items, nameKey, valueKey were already bound, but eclipse still warning

2008-05-04 Thread Yung-Luen Lan
Hi,

Here is my ERPPieChart.wod:

MyChart: ERPPieChart {
items = hashes;
nameKey = "Brand";
valueKey = "Quality";
}

Although I've already supplied items, nameKey and valueKey, eclipse
still give me an error "Either items, nameKey and valueKey or dataset
must be bound."
(hashes return a HashMap)

Any idea? I use WO 5.4 on Leopard with Eclipse 3.3 and the latest
Project Wonder.

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Re: EOGeneralAdaptorException when saving EOContext

2008-04-27 Thread Yung-Luen Lan
Figured it out.
Seems that my eomodeld has broken.
Rebuild my eomodeld resolved this problem! Thanks all.

Regards,
yllan


On Sun, Apr 27, 2008 at 10:34 AM, Andrew Lindesay <[EMAIL PROTECTED]> wrote:
> Hello Yung;
>
>
>
> > I have no idea why this relationship will cause the problem. Searching
> > on list, I turned on the SQL logging and see there is a
> > NullPointerException.
> > No SQL generated. What can I do to investigate this problem further?
> >
>
>  Are you using WO 5.3.3 -- there is a bug that produces an NPE there.  Can
> you perhaps switch to WO 5.4.2 to test with so that you can see the true
> exception?
>
>  cheers.
>
>  ___
>  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 [EMAIL PROTECTED]


EOGeneralAdaptorException when saving EOContext

2008-04-26 Thread Yung-Luen Lan
Hi,

I encountered com.webobjects.eoaccess.EOGeneralAdaptorException when
saveChanges() after inserting an enterprise object into editing
context.

It only happens when I set a relationship of the inserted object.
Without setting the relationship, my app run smoothly.

The inserted entity called Sale. And the problematic relationship
called referenceSale, which joins to sale.
(If a sale has a referenceSale, it will retrieve the value of property
from referenceSale instead of itself.)

Sale:
  Column  |Type |
Modifiers
--+-+
saleid   | bigint  | not null default
nextval('sale_seq'::regclass)
clientid | bigint  | not null
storeid  | bigint  |
referencesaleid  | bigint  |
... other property

Foreign-key constraints:
"sale_client_fk" FOREIGN KEY (clientid) REFERENCES
client(clientid) DEFERRABLE INITIALLY DEFERRED
"sale_store_fk" FOREIGN KEY (storeid) REFERENCES store(storeid)
DEFERRABLE INITIALLY DEFERRED
"sale_referencesale_fk" FOREIGN KEY (referencesaleid) REFERENCES
sale(saleid) DEFERRABLE INITIALLY DEFERRED

I have no idea why this relationship will cause the problem. Searching
on list, I turned on the SQL logging and see there is a
NullPointerException.
No SQL generated. What can I do to investigate this problem further?

2008-04-27 02:50:00,491 DEBUG -[-:50212 1] NSLog
(ERXNSLogLog4jBridge.java:44)  -  === Begin Internal Transaction
 2008-04-27 02:50:00,492 DEBUG -[-:50212 1] NSLog
(ERXNSLogLog4jBridge.java:44)  -  evaluateExpression:


# select the next id to insert

 2008-04-27 02:50:00,494 DEBUG -[-:50212 1] NSLog
(ERXNSLogLog4jBridge.java:44)  - 1 row(s) processed
 2008-04-27 02:50:00,499 DEBUG -[-:50212 1] NSLog
(ERXNSLogLog4jBridge.java:44)  -  === Commit Internal Transaction
 2008-04-27 02:50:00,505 DEBUG -[-:50212 1] NSLog
(ERXNSLogLog4jBridge.java:44)  -  === Begin Internal Transaction
 2008-04-27 02:50:00,506 INFO  -[-:50212 1] Exceptions
(ERXDatabaseContextDelegate.java:152)  - Database Exception occured:
java.lang.NullPointerException

# what happened? it even didn't print a PostgresqlExpression SQL!

 2008-04-27 02:50:00,507 DEBUG -[-:50212 1] NSLog
(ERXNSLogLog4jBridge.java:44)  -  === Rollback Internal Transaction
 2008-04-27 02:50:00,508 WARN  -[-:50212 1] NSLog
(ERXNSLogLog4jBridge.java:41)  -
:
Exception occurred while handling request:
com.webobjects.eoaccess.EOGeneralAdaptorException
 2008-04-27 02:50:00,512 ERROR -[-:50212 1] ERXApplication
(ERXApplication.java:1217)  - Exception caught: null
Extra info: {

}

 com.webobjects.eoaccess.EOGeneralAdaptorException
at 
com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseContextInformationAdded(EODatabaseContext.java:4500)
at 
com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseContext.java:6212)
at 
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:376)
at 
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3176)
at er.extensions.ERXEC._saveChanges(ERXEC.java:937)
at er.extensions.ERXEC.saveChanges(ERXEC.java:860)
at woserver.bookshelf.Reorder.atmPurchase(Reorder.java:641)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at 
com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636)
at 
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134)
at 
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1293)
at 
com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1686)
at 
com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447)
at 
com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at 
com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1754)
at 
com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50)
at 
com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlink.java:98)
at er.extensions.ERXHyperlink.invokeAction(ERXHyperlink.java:62)
at 
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at 
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at 
com.webobjects.appser

Re: WOGenericContainer convert elementName to lowercase automatically

2008-04-25 Thread Yung-Luen Lan
On Sat, Apr 26, 2008 at 12:48 AM, Yung-Luen Lan <[EMAIL PROTECTED]> wrote:
>  package your.app;
>
>  import com.webobjects.appserver.*;
>  import com.webobjects.appserver._private.WODynamicElementCreationException;
>  import com.webobjects.foundation.*;
>
>  public class MyGenericContainer extends WODynamicElement {
> protected NSDictionary extraBindings = null;
> protected WOAssociation elementName;
> protected WOElement children;
>
> public MyGenericContainer(String n, NSDictionary  WOAssociation> m, WOElement t) {
> super(n, m, t);
> elementName = m.objectForKey("elementName");
> if (elementName == null) {
> throw new WODynamicElementCreationException("Need 
> elementName.");
> }
>
> if (m.count() > 1) {
> NSMutableDictionary tempBindings =
>  m.mutableClone();
> tempBindings.removeObjectForKey("elementName");
> extraBindings = tempBindings.immutableClone();
> }
> children = t;
> }
>
> public void appendToResponse(WOResponse r, WOContext c) {
> r.appendContentString("<" + 
> elementName.valueInComponent(c.component()));
> if (extraBindings != null) {
> NSArray allKeys = extraBindings.allKeys();
> for (String k : allKeys) {
> WOAssociation binding = 
> extraBindings.objectForKey(k);
> r.appendContentString(" " + k + "=\"" +
>  binding.valueInComponent(c.component()).toString() + "\"");
> }
> }
> r.appendContentString(">");

Forgot to add this line:
if (children != null)

> children.appendToResponse(r, c);
> r.appendContentString("  elementName.valueInComponent(c.component()) + ">");
> }
>  }
 ___
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 [EMAIL PROTECTED]


Re: WOGenericContainer convert elementName to lowercase automatically

2008-04-25 Thread Yung-Luen Lan
Hi,

Without Wonder, it still produce lowercase only tag.

I wrote my (simplified) version of WOGenericContainer to get the
output respect to the type case of elementName.
I guess it's basic stuff but I'll post here. However, that's a good
practice anyway. (I followed Chuck's book to finish this element.
Thanks, Chuck.)


package your.app;

import com.webobjects.appserver.*;
import com.webobjects.appserver._private.WODynamicElementCreationException;
import com.webobjects.foundation.*;

public class MyGenericContainer extends WODynamicElement {
protected NSDictionary extraBindings = null;
protected WOAssociation elementName;
protected WOElement children;

public MyGenericContainer(String n, NSDictionary m, WOElement t) {
super(n, m, t);
elementName = m.objectForKey("elementName");
if (elementName == null) {
throw new WODynamicElementCreationException("Need 
elementName.");
}

if (m.count() > 1) {
NSMutableDictionary tempBindings =
m.mutableClone();
tempBindings.removeObjectForKey("elementName");
extraBindings = tempBindings.immutableClone();
}
children = t;
}

public void appendToResponse(WOResponse r, WOContext c) {
r.appendContentString("<" + 
elementName.valueInComponent(c.component()));
if (extraBindings != null) {
NSArray allKeys = extraBindings.allKeys();
for (String k : allKeys) {
WOAssociation binding = 
extraBindings.objectForKey(k);
r.appendContentString(" " + k + "=\"" +
binding.valueInComponent(c.component()).toString() + "\"");
}
}
r.appendContentString(">");
children.appendToResponse(r, c);
r.appendContentString("");
}
}


Regards,
yllan

On Fri, Apr 25, 2008 at 6:23 AM, Lachlan Deck <[EMAIL PROTECTED]> wrote:
> Hi there,
>
>
>  On 25/04/2008, at 7:01 AM, Yung-Luen Lan wrote:
>
>
> > Is it just me?
> > I think it's a bug so I filed a bug report to Apple.
> >
>
>  You'd have to take Wonder out of the mix to determine whether it's in WO or
> Wonder.
>
>  Old versions of WO used to have (terrible) upper-case tags. I suspect
> someone's put in a blanket lowercasing.
>
>  Perhaps you could adapt your code to look for the lowercased version of the
> keys?
>
>
> >
> >
> >
> > On Thu, Apr 24, 2008 at 12:06 AM, Yung-Luen Lan <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hi,
> > >
> > > I use WO to generate XML file in my project. After updating my
> > > outdated deploy environment to WO 5.4 / Project Wonder 4.x, I found
> > > the xml generated is different: all the tags rendered by
> > > WOGenericContainer become lowercase.
> > >
> > > I use CamelCase before, and match these XML tree with their CamelCase
> > > node name in other client app. Since they all become lowercase now,
> > > the client program no longer match them correctly.
> > >
> > > My wod looks like this:
> > >
> > > Client: WOGenericContainer {
> > >   elementName = "Client";
> > >   name=client.name;
> > > }
> > >
> > > but the XML code generated looks like:
> > > 
> > >
> > > Is there any way that I can set these tag to CamelCase or just tell
> > > the WO don't convert them for me?
> > >
> > > Regards,
> > > yllan
> > >
> > >
> > ___
> > 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 [EMAIL PROTECTED]
> >
>
>  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 [EMAIL PROTECTED]


Re: WOGenericContainer convert elementName to lowercase automatically

2008-04-24 Thread Yung-Luen Lan
Is it just me?
I think it's a bug so I filed a bug report to Apple.

yllan

On Thu, Apr 24, 2008 at 12:06 AM, Yung-Luen Lan <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  I use WO to generate XML file in my project. After updating my
>  outdated deploy environment to WO 5.4 / Project Wonder 4.x, I found
>  the xml generated is different: all the tags rendered by
>  WOGenericContainer become lowercase.
>
>  I use CamelCase before, and match these XML tree with their CamelCase
>  node name in other client app. Since they all become lowercase now,
>  the client program no longer match them correctly.
>
>  My wod looks like this:
>
>  Client: WOGenericContainer {
> elementName = "Client";
> name=client.name;
>  }
>
>  but the XML code generated looks like:
>  
>
>  Is there any way that I can set these tag to CamelCase or just tell
>  the WO don't convert them for me?
>
>  Regards,
>  yllan
>
 ___
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 [EMAIL PROTECTED]


WOGenericContainer convert elementName to lowercase automatically

2008-04-23 Thread Yung-Luen Lan
Hi,

I use WO to generate XML file in my project. After updating my
outdated deploy environment to WO 5.4 / Project Wonder 4.x, I found
the xml generated is different: all the tags rendered by
WOGenericContainer become lowercase.

I use CamelCase before, and match these XML tree with their CamelCase
node name in other client app. Since they all become lowercase now,
the client program no longer match them correctly.

My wod looks like this:

Client: WOGenericContainer {
elementName = "Client";
name=client.name;
}

but the XML code generated looks like:


Is there any way that I can set these tag to CamelCase or just tell
the WO don't convert them for me?

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Re: Can't get the Apple examples run

2008-04-19 Thread Yung-Luen Lan
Thanks, Mike. It really clarify my confusion about build path.

Regards,
yllan

On Thu, Apr 17, 2008 at 1:33 AM, Mike Schrag <[EMAIL PROTECTED]> wrote:
>
> > I don't have the time to watch your movie.  There is a very good chance
> that the Apple examples simply do not work with Wonder installed.
> >
> > Look at your error message.  It is complaining about JavaWOExtensions.
> This comes with WO and also comes with Wonder (Wonder has a fixed version).
> You probably have both of them installed.
> >
>  Yes ... The WO Examples are sort of messed up.  For one, they link against
> WO Eclipse source projects, which obviously nobody has but Apple, which is
> what you fixed in the first part.  But the other problem is that you're
> mixing framework and jar file libraries.
>
>  If you look at the build path for WOExamples, it depends on
> WOComponentExamples and WOComponentElements.  In WOExamples, you added the
> bundle versions (.framework folders) of the WO frameworks via the WebObjects
> Libraries build path container.  However, if you look at the build path of
> WOComponentExamples (which it depends on), that has the jar file library
> versions on the classpath.  You then end up with two versions of the same
> framework (from different places) in your build path.  If they were both the
> jar version or both the bundle version, WOLips will remove duplicates, but
> with the jar version and the framework bundle version it doesn't really know
> they're the same, and it sends them on their way into WO, which then
> explodes with a duplicate bundle error.
>
>  I actually have a patched version of NSBundle, and I've submitted a patch
> to Pierre for it also, to prevent this from being a catastrophic failure,
> which I don't believe it should be in most cases.  This should really be a
> warning, as the most common explanation is this exact scenario.
>
>  Anyway, you have two choices -- either switch the WOExamples framework to
> link to the jar frameworks like the dependent projects do, or switch the
> dependent projects to link to the bundles.  Pierre/Apple recommends going to
> the jar framework ... I personally don't like them and only use the bundles
> ... Both are supported (and, as I understand, will continue to be), but this
> is a great debate for another day :)
>
>  ms
>
>
>  ___
>  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/yungluen%40gmail.com
>
>  This email sent to [EMAIL PROTECTED]
>
 ___
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 [EMAIL PROTECTED]


Can't get the Apple examples run

2008-04-16 Thread Yung-Luen Lan
Maybe it'd be better to start a new thread instead of the original
"Ajax in ProjectWonder."
My problem is, on a newly installed machine, I still can't get the
Apple examples run.

I record my steps to a video:
http://bunny.idv.tw/~blueapple/WebObjects.m4v

Can someone point out what did I go wrong? Thanks.

Regards,
yllan

On Tue, Apr 15, 2008 at 8:57 PM, Yung-Luen Lan <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 15, 2008 at 2:37 AM, Chuck Hill <[EMAIL PROTECTED]> wrote:
>  > > 3. I found the examples come with Xcode / ProjectWonder is hard to run 
> for a newbie. I can't get any example running until I saw this screencast:
>  > > http://www.wocommunity.org/podcasts/WO54_Examples.mov
>  > >
>  > > Unfortunately, most of the example except the HelloWorld still can't 
> run. Eclipse whining:
>  > >
>  > > Caused by: java.lang.IllegalStateException: 
>  warning: There is already a unique 
> instance for Bundle named 'JavaWOExtensions'.  Use 
> NSBundle.bundleForName(JavaWOExtensions) to access it: 
>  bundlePath:'/Library/WebObjects/lib/JavaWOExtensions.jar' packages:'( 
> com.webobjects.woextensions )' 56 classes >
>  > >
>  > > or
>  > >
>  > > Caused by: java.lang.IllegalStateException: Main bundle 'Properties' 
> file can't be read.
>  > >
>  > > That's very frustrated for a beginner. I mean, why don't Apple make it 
> right at the first time? Examples are very useful for a beginner comparing to 
> javadocs. We can't run the example by simply click the build and run button 
> with standard installation, what's wrong with that?
>  > >
>  >
>  >
>  > This is your mistake.  Somehow you have created the project so that the WO 
> frameworks appear more than once on the command line.  Do you have it 
> installed in more than one place?
>
>  Thanks for your suggestions.
>
>  Uh, I have no idea what I've done wrong.
>  So today I reinstall everything in a new machine and record it to a
>  video: (Sorry I didn't speak English well)
>
>  http://bunny.idv.tw/~blueapple/WebObjects.m4v
>
>  Simply, I just install WebObjects, WOLips with Eclipse. I follow the
>  Getting Started Guide in the Examples/JavaWebObjects folder to 1)
>  install the database, 2) copy the project and 3) build the
>  frameworks wait, I can't build the frameworks!
>
>  After that, I import these projects into eclipse, configure the
>  building path according to screencast, try to run and still got the
>  same error message.
>
>  Could anyone point out what's the problem of me? Thanks!
>
>  Regards,
>  yllan
>
 ___
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 [EMAIL PROTECTED]


Re: Ajax in ProjectWonder

2008-04-15 Thread Yung-Luen Lan
On Tue, Apr 15, 2008 at 2:37 AM, Chuck Hill <[EMAIL PROTECTED]> wrote:
> > 3. I found the examples come with Xcode / ProjectWonder is hard to run for 
> > a newbie. I can't get any example running until I saw this screencast:
> > http://www.wocommunity.org/podcasts/WO54_Examples.mov
> >
> > Unfortunately, most of the example except the HelloWorld still can't run. 
> > Eclipse whining:
> >
> > Caused by: java.lang.IllegalStateException: 
> >  warning: There is already a unique 
> > instance for Bundle named 'JavaWOExtensions'.  Use 
> > NSBundle.bundleForName(JavaWOExtensions) to access it: 
> >  > bundlePath:'/Library/WebObjects/lib/JavaWOExtensions.jar' packages:'( 
> > com.webobjects.woextensions )' 56 classes >
> >
> > or
> >
> > Caused by: java.lang.IllegalStateException: Main bundle 'Properties' file 
> > can't be read.
> >
> > That's very frustrated for a beginner. I mean, why don't Apple make it 
> > right at the first time? Examples are very useful for a beginner comparing 
> > to javadocs. We can't run the example by simply click the build and run 
> > button with standard installation, what's wrong with that?
> >
>
>
> This is your mistake.  Somehow you have created the project so that the WO 
> frameworks appear more than once on the command line.  Do you have it 
> installed in more than one place?

Thanks for your suggestions.

Uh, I have no idea what I've done wrong.
So today I reinstall everything in a new machine and record it to a
video: (Sorry I didn't speak English well)

http://bunny.idv.tw/~blueapple/WebObjects.m4v

Simply, I just install WebObjects, WOLips with Eclipse. I follow the
Getting Started Guide in the Examples/JavaWebObjects folder to 1)
install the database, 2) copy the project and 3) build the
frameworks wait, I can't build the frameworks!

After that, I import these projects into eclipse, configure the
building path according to screencast, try to run and still got the
same error message.

Could anyone point out what's the problem of me? Thanks!

Regards,
yllan
 ___
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 [EMAIL PROTECTED]


Ajax in ProjectWonder

2008-04-14 Thread Yung-Luen Lan
Hi,

I leveraged the Ajax support in ProjectWonder into my project recently and
have several questions:

1. It will automatically include prototype + scriptaculous in the header of
output html. However, my html have jquery included, and they will conflict!
The $()
have different semantics in jquery and prototype. Using the AjaxUpdatingArea
will render my existing javascript useless. (Say, $('#id') no longer find
the correct element.) Is re-writing all my javascript with prototype +
scriptaculous the only way I can fix that?

2. This question is not about ProjectWonder. I want to have my WO app look
consistent without copy-n-paste html code on each page, so I make a
component like this:

Template.html



 // other css and js stuff
 


// page structure





Template.wod

Content: WOComponentContent {}
Title: WOString { value = title; }


In each page, I could simply write


// This page's content here


My problem is, using this method, I can't break my css into little part and
assign to corresponding page. How will you solve this problem?

3. I found the examples come with Xcode / ProjectWonder is hard to run for a
newbie. I can't get any example running until I saw this screencast:
http://www.wocommunity.org/podcasts/WO54_Examples.mov

Unfortunately, most of the example except the HelloWorld still can't run.
Eclipse whining:

Caused by: java.lang.IllegalStateException:
 warning: There is already a unique
instance for Bundle named 'JavaWOExtensions'.  Use
NSBundle.bundleForName(JavaWOExtensions) to access it:


or

Caused by: java.lang.IllegalStateException: Main bundle 'Properties' file
can't be read.

That's very frustrated for a beginner. I mean, why don't Apple make it right
at the first time? Examples are very useful for a beginner comparing to
javadocs. We can't run the example by simply click the build and run button
with standard installation, what's wrong with that?

Regards,
yllan
 ___
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 [EMAIL PROTECTED]

Re: NullPointerException in ERXLogger.getERXLogger

2008-02-27 Thread Yung-Luen Lan
2008/2/27 Daniele Corti <[EMAIL PROTECTED]>:

> 2008/2/27, Yung-Luen Lan <[EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
> > An extra question: when you add some features to your wo project, how do
> > you stop the current running wo server and start the new one? I don't know
> > how to do this so I run my server inside eclipse. I know it's stupid, but I
> > couldn't find the answer. Maybe it's too basic to document?
>
>
> Not a stupid question: look at the bottom panels, and select the Console
> one (if you are running WO app in development, WOLips changes it to show
> logs) at the top of the panel, you can see a little red square. You can stop
> the current app by clicking on it. It's not very visible, I've passed months
> before notice it, when I've started working on Eclipse.
>

Thanks for your reply. My question actually is, how do you do that for
normal deployed WO server. That is, the WO server is not running inside
Eclipse --- sorry that I didn't make it clear.

Regards,
yllan
 ___
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 [EMAIL PROTECTED]

NullPointerException in ERXLogger.getERXLogger

2008-02-27 Thread Yung-Luen Lan
Hi all,

I'm a newbie of both WebObjects and server programming who is responsible to
maintain a WO project left by other guy several years ago. I've added some
features and tested in Eclipse. However, during these year, I always
encountered a problem when I want to update the ERExtensions.framework in
/Library/Frameworks.

When I replace the original ERExtensions.framework (whose version is
believed ≤ Project WONDER 3) with new one, I got the exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:271)
at org.apache.log4j.LogManager.getLogger(LogManager.java:220)
at org.apache.log4j.Logger.getLogger(Logger.java:156)
at er.extensions.ERXLogger.getLogger(ERXLogger.java:111)
at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:91)
at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:121)
at woserver.Application.(Application.java:25)

And that's the very first line of my project.

public class Application extends ERXApplication {
public static final ERXLogger log = ERXLogger.getERXLogger(
Application.class);

I've my Properties file configured like this:

 BEGIN OF PART OF MY PROPERTIES FILE 
er.extensions.ERXLocalizer.frameworkSearchPath = (app,ERExtensions)
er.extensions.ERXLocalizer.defaultLanguage = English
er.extensions.ERXLocalizer.availableLanguages = (English, Chinese)

### Enterprise Objects ###
er.extensions.ERXRaiseOnMissingEditingContextDelegate = false

### Application Name ###
er.extensions.ERXApplicationHostURL = localhost

#
# Log4j Configuration
#
log4j.rootLogger = INFO, A1, A2
log4j.loggerFactory=er.extensions.ERXLogger$Factory

# Appenders
log4j.appender.A1 = org.apache.log4j.ConsoleAppender

log4j.appender.A2 = org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.datePattern='.'-MM-dd
log4j.appender.A2.append = true
log4j.appender.A2.File = /var/log/woproject/woproject.log

# A1, A2 uses PatternLayout.
log4j.appender.A1.layout = er.extensions.ERXPatternLayout
log4j.appender.A2.layout = er.extensions.ERXPatternLayout

# This pattern will produce logs that look like:
# 2002-06-18 17:46:18,292 MyAppName[4002:9133 0] MyCategory (MyClass.java:40)
- Some log
log4j.appender.A1.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]}
%c{1} (%F:%L) %x - %m%n
log4j.appender.A2.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]}
%c{1} (%F:%L) %x - %m%n

# Note that %F and %L is fairly slow and shouldn't be used in performance
intensive logging


# Custom Categories - These are the main categories and sub categories
#that are used in frameworks.


# Base Category
log4j.logger.er = INFO
log4j.logger.er.extensions.ERXNSLogLog4jBridge = INFO
log4j.additivity.er.extensions.ERXNSLogLog4jBridge = false

log4j.logger.er.changenotification = INFO
 END OF PART OF MY PROPERTIES FILE 

Hence, I must copy the old ERExtensions to a new environment every time. Did
I miss something?

An extra question: when you add some features to your wo project, how do you
stop the current running wo server and start the new one? I don't know how
to do this so I run my server inside eclipse. I know it's stupid, but I
couldn't find the answer. Maybe it's too basic to document?

Regards,
yllan
 ___
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 [EMAIL PROTECTED]

Re: How to avoid wrong mapping after new object inserted

2008-01-16 Thread Yung-Luen Lan
Thanks for all the replies.

I think my project uses Project Wonder. I'm not sure because I don't
familiar with WebObjects. I just maintain this project from another guy.

Why I think so? Because the project depends on the following frameworks:

* ERChangeNotificationJMS.framework
* ERExtensions.framework
* ERJars.framework
* ERJavaMail.framework
* JavaWOExtensions.framework
* PostgresqlPlugIn.framework

I've tried to replace these old frameworks (I guess it's ProjectWonder 2.x)
with recent version, says 3.x and 4.0, then my project can't run due to
Log4J factory method exception which I totally have no idea what it is.
Maybe I mis-configure my environment. I don't know.

Before this discussion, I had no idea what can I benefit from ProjectWonder
and why the former developer use PW. Now I know that PW fix the bugs of WO.
Thanks, Mike. But I still don't know how to incorporate new version of
ProjectWonder with my existing project. Currently I'll use Lachlan's method
to get it work.

Thanks you all!

Regards,
yllan

On Jan 16, 2008 9:44 PM, Mike Schrag <[EMAIL PROTECTED]> wrote:

> >> But you're sorting descending order on creation data... so the
> >> indexes are going to change.
> > ... unless you use Project Wonder, which has a fix for this problem.
> Incidentally, coming off of that previous thread discussing "fatal
> flaws" with WO, THIS bug is what I consider a "a fatal flaw in WO."
> It's a terrible, terrible bug that can cause nasty problems, and most
> people aren't aware it exists. It's really more that WO has a fever,
> and the only prescription is Project Wonder :) (... and more cowbell).
>
> ms
>
>  ___
> 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/yungluen%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
 ___
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 [EMAIL PROTECTED]

Re: How to avoid wrong mapping after new object inserted

2008-01-16 Thread Yung-Luen Lan
Hi,

Thanks for Lachlan's response. But I'm a little bit confused.

Does that mean I have to add a button, says, "Refresh the sales," to invoke
the refresh action? Or can I just use the refresh button on my browser to do
that?

Thanks for the help.

Regards,
yllan


On Jan 16, 2008 3:36 PM, Lachlan Deck <[EMAIL PROTECTED]> wrote:

> Hi there,
>
> your problem seems to be quite simple. See below.
>
> On 16/01/2008, at 5:12 PM, Yung-Luen Lan wrote:
>
> > 
> > protected Sale sale;
>private NSArray saleRecords;
>
> > public NSArray sales() {
>// keep the list of records consistent by keeping them in memory.
>if (saleRecords == null) {
>saleRecords = EOUtilities.objectsForEntityNamed(theSession
> ().defaultEditingContext(), "Sale");
>
>/* Filter the array with some
> EOQualifier.filteredArrayWithQualifier
> (sales, EOQualifier), snip */
>
>EOSortOrdering sort = EOSortOrdering.sortOrderingWithKey
> ("created",
> EOSortOrdering.CompareDescending );
>saleRecords = EOSortOrdering.sortedArrayUsingKeyOrderArray
> (sales,
> new NSArray(sort));
>}
> }
> >
> > public WOComponent download()
> > {
> > MyDownloader n = (MyDownloader)pageWithName("MyDownloader");
> > n.setFile(sale.file());
> > n.setFilename(sale.canonicalFileName());
> > return n;
> > }
>
>/** Add a refresh action to your page to update the list */
>public WOComponent refresh()
>{
>saleRecords = null;
>return this;
>}
>
> }
>
> 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/yungluen%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
 ___
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 [EMAIL PROTECTED]

How to avoid wrong mapping after new object inserted

2008-01-15 Thread Yung-Luen Lan
Hi,

I have a WO app which allow user to upload photos and associate a sale
record for each uploaded photo.
The record contains the unique ID in postgresql, path of the uploaded files
and other metadata like who and when the file was uploaded.

And I have a page for administrator which lists all the records. For each
record, the app display it's ID, preview, and other metadata.

So it look like this:


Preview: WOActiveImage {
action = download;
data = sale.thumbnail;
mimeType = "image/png";
style = "border: 1px solid black;";
}

Sales: WORepetition {
item = sale;
list = sales;
}


protected Sale sale;

public NSArray sales() {
NSArray sales =
EOUtilities.objectsForEntityNamed(theSession().defaultEditingContext(),
"Sale");

/* Filter the array with some
EOQualifier.filteredArrayWithQualifier(sales,
EOQualifier), snip */

EOSortOrdering sort = EOSortOrdering.sortOrderingWithKey("created",
EOSortOrdering.CompareDescending);
return EOSortOrdering.sortedArrayUsingKeyOrderArray(sales, new
NSArray(sort));
}

public WOComponent download()
{
MyDownloader n = (MyDownloader)pageWithName("MyDownloader");
n.setFile(sale.file());
n.setFilename(sale.canonicalFileName());
return n;
}


It worked with low traffic. However, when we have more and more uploading,
things went wrong. Sometimes I click the download link of, says, SaleID = x,
it didn't give me the file of SaleID = x. Instead, it returns the file of
SaleID = x - 1.

After investigating for a while, I realized that what may cause this
problem. The following is what I suspect:

First, I generate the admin page of current sale records.

After that, some user upload a new file and create a new sale record.

Because I didn't refresh my admin page so it didn't reflect the current
state of sale records. It didn't know the new sale record was inserted.
Hence it will give me the wrong

If this is the case, how can I avoid the problem? I use WO 5.3 on Tiger.

Regards,
yllan
 ___
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 [EMAIL PROTECTED]

Re: Generic code works on my machine but generate error on another machine

2007-10-31 Thread Yung-Luen Lan
Thanks, Guido.

I move the WOFrameworks down but it didn't work.

Here is the configuration of my working machine: (without error)
http://farm3.static.flickr.com/2299/1812761484_52ff1aba62_o.png

And this is another one: (oops! error)
http://farm3.static.flickr.com/2003/1811918265_0cef8587bb_o.png

You'll notice that the order of WOFrameworks in the latter picture is even
lower than the working one. And I tried all possible order permutation.

I just wondering if I should revert those generic code to avoid those
error...

Regards,
yllan

On 11/1/07, Guido Neitzer <[EMAIL PROTECTED]> wrote:
>
> On 31.10.2007, at 21:03, Yung-Luen Lan wrote:
>
> > Recently I update my project with Generic code like
> > NSArray. On my machine, it did not generate error in
> > Eclipse 3.2.2 with latest stable WOLips and Wonder 4.0. (Mac OS X
> > 10.4.10, Java 1.5.0_07, WebObjects come with Xcode 2.4)
> >
> > But on another machine, almost the same configuration, Eclipse 3.2.2
> > with latest stable WOLips, Wonder 4.0, Mac OS X 10.4.10, Java
> > 1.5.0_07, WebObjects 5.3.3, eclipse whining "The type NSArray is not
> > generic; It cannot be parameterized with arguments "
> > and failed to compile.
> >
> > I couldn't figure out what could make this difference. Did I miss
> > something to check?
>
> Classpath ordering. Check the project properties --> Build path -->
> Order and export and move the WOFrameworks wayyy down.
>
> cug
>
 ___
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 [EMAIL PROTECTED]

Generic code works on my machine but generate error on another machine

2007-10-31 Thread Yung-Luen Lan
Hi all,

Recently I update my project with Generic code like NSArray.
On my machine, it did not generate error in Eclipse 3.2.2 with latest stable
WOLips and Wonder 4.0. (Mac OS X 10.4.10, Java 1.5.0_07, WebObjects come
with Xcode 2.4)

But on another machine, almost the same configuration, Eclipse 3.2.2 with
latest stable WOLips, Wonder 4.0, Mac OS X 10.4.10, Java 1.5.0_07,
WebObjects 5.3.3, eclipse whining "The type NSArray is not generic; It
cannot be parameterized with arguments " and failed to
compile.

I couldn't figure out what could make this difference. Did I miss something
to check?

regards,

yllan
 ___
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 [EMAIL PROTECTED]

Can't build Apache2 woadaptor in Wonder

2006-06-10 Thread Yung-Luen Lan

Hi, all:

I'm moving from Apache 1.3 to Apache 2. Searching the internet, I
download the latest Wonder and try to build a new woadaptor for
Apache2. Unfortunately, there are some errors occured when making the
mod_WebObjects.so.

/opt/local/apache2/bin/apxs  -c -S CC=cc -Wc,"-O2 -Wall
-I/opt/local/apache2/include  -I../Adaptor -I/usr/include/openssl
-DSINGLE_THREADED_ADAPTOR -DMACOS -DFORKING_WEBSERVER -DAPACHE
-DAPACHE_SECURITY_ENABLED" -Wl,"-L/usr/lib -lcrypto -lssl -lm -module"
mod_WebObjects.c ../Adaptor/MoreURLCUtilities.c ../Adaptor/Platform.c
../Adaptor/WOURLCUtilities.c ../Adaptor/WOURLCUtilities_3.c
../Adaptor/appcfg.c ../Adaptor/cfgparse.c ../Adaptor/config.c
../Adaptor/hostlookup.c ../Adaptor/list.c ../Adaptor/listing.c
../Adaptor/loadaverage.c ../Adaptor/loadbalancing.c ../Adaptor/log.c
../Adaptor/nbsocket.c ../Adaptor/random.c ../Adaptor/request.c
../Adaptor/response.c ../Adaptor/roundrobin.c ../Adaptor/shmem.c
../Adaptor/strdict.c ../Adaptor/strtbl.c ../Adaptor/transaction.c
../Adaptor/transport.c ../Adaptor/wastring.c ../Adaptor/womalloc.c
../Adaptor/xmlcparser.c ../Adaptor/xmlctokenizer.c
../Adaptor/xmlparse.c
/opt/local/share/apr-1/build/libtool --silent --mode=compile cc
-prefer-pic   -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp
-g -O2 -I/opt/local/include -I/opt/local/apache2/include
-I/opt/local/include/apr-1   -I/opt/local/include/apr-1
-I/opt/local/include -O2 -Wall -I/opt/local/apache2/include
-I../Adaptor -I/usr/include/openssl  -DSINGLE_THREADED_ADAPTOR -DMACOS
-DFORKING_WEBSERVER -DAPACHE -DAPACHE_SECURITY_ENABLED  -c -o
mod_WebObjects.lo mod_WebObjects.c && touch mod_WebObjects.slo
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
apxs:Error: Command failed with rc=65536
.
make: *** [mod_WebObjects.so] Error 1

I find someone on the mailing-list had the same error because he
configure it with apache 1.3 parameters. Then I check my make.config
file over and over, but nothing obvious.

Here is my make.config:

# This file defines the basic configuration for building the adaptors.
# It defines the architecture (OS), which adaptor(s) to build, and other
# misc. configuration info. that is needed by other project makefiles.

# Set the platform you are building on
# MACOS =

# Define the OS.
ifeq "" "${OS}"
OS = MACOS
endif

# DEBUG_FLAG = -g

# Based on the OS, determine which adaptor(s) we build, and other settings.

# MacOS X Server
ifeq "NEXTSTEP" "${OS}"
ADAPTORS = CGI Apache
APXS = /usr/sbin/apxs
endif

# MacOS X
ifeq "MACOS" "$(OS)"
#ADAPTORS = CGI Apache

# Default path for apxs on version 10.0.
#APXS = /usr/sbin/apxs

# Uncomment the following lines to build for Apache2
# override above setting
ADAPTORS = Apache2
# set this to the location of your Apache2 dir
APACHE2_DIR = /opt/local/apache2
APXS = $(APACHE2_DIR)/bin/apxs # override above setting
APACHEINCLUDE_DIR = $(APACHE2_DIR)/include #override default include dir
APACHEMODULE_DIR = $(APACHE2_DIR)/modules
endif

# Windows
ifeq "WINDOWS" "${OS}"
CC = gcc
EXESUFFIX = .exe
ADAPTORS = CGI IIS
endif

ifeq "SOLARIS" "$(OS)"
ADAPTORS = CGI NSAPI Apache
# Default path for apxs on Solaris 8.
APXS = /usr/apache/bin/apxs
endif

ifeq "HPUX" "$(OS)"
ADAPTORS = CGI NSAPI
endif

# LINUX
ifeq "LINUX" "$(OS)"

# REDHAT 9
ifeq "REDHAT9" "$(OS_VERSION)"
ADAPTORS = CGI Apache2
APXS = /usr/sbin/apxs
APACHEINCLUDE_DIR = /usr/include/httpd

# OTHER LINUX
else

ADAPTORS = CGI Apache
APXS = $(shell bash -c 'if [ -d /usr/local/apache ]; then echo
/usr/local/apache/bin/apxs;else echo
/usr/sbin/apxs;fi')APACHEINCLUDEFLAGS = $(shell bash -c 'if [ -d
/usr/local/apache ]; then echo -I/usr/local/apache/include;else echo
-I/usr/include/apache;fi')endif

#end Linux
# If you are building NSAPI uncomment this and specify where Netscape
is installed.
# This is typically /opt/netscape/suitespot
# NS_ROOT =

# default compiler is cc
ifeq "${CC}" ""
CC = cc
endif

and I have apache2 installed on /opt/local/apache2.

How can I fix the building error and make my webobjects working with apache2?

Thanks!

yung-luen lan
___
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 archive@mail-archive.com