On Dec 31, 2007, at 12:30 PM, Pascal Robert wrote:
> Le 07-12-31 à 15:05, Chuck Hill a écrit :
>
>> Bonne Année!
>
> You too DrunkenMaster :-P BTW, we got an another 5 cm of snow
> today. It's fun to see people from New Jersey without winter tires
> on the highway.
And a bit more now too. :-) Well, you did say that you wanted snow
this year...
>> On Dec 27, 2007, at 1:45 PM, Pascal Robert wrote:
>>
>>> I migrated 78 projects today, and I got some problems :-/
>>> Eclipse 3.3.1.1, WOLips 3.3.4570, Tiger/WO 5.3.
>>>
>>> 1) In Xcode, most of our images and other "static" Web resources
>>> were in sub-folders of WebServerResources. Those sub-folders
>>> were not real folders (ie, they were the "yellow" type, not the
>>> blue one). Now, I'm trying to replicate the same thing in
>>> Eclipse by creating real folders, moving the images to the
>>> folders and selecting "WOLips Tools -> Exclude as
>>> WebServerResource" on the folder.
>>
>> Include as....?
>
> When I exclude the "images" folder, the files inside this folder
> are still included as resources. As an example, I have a folder
> called "images" with "icone_editer.gif" inside it. The binding on
> the WOActiveImage is:
>
> filename = "icone_editer.gif";
>
> So I don't want to change the binding (we have projects with +100
> images and I can't do a generic find & replace to fix all of those
> bindings. So I excluded the "images" folder but "icone_editer.gif"
> is included:
>
> <Image 2.png>
OK. I was not suggesting that you change the binding, just trying to
understand what was going on.
> The woproject/wsresources.exclude.patternset is ok:
>
> **/images
First, woproject does some wonky flattening stuff here. Add to that
confusing (to me) Ant patterns and it can be challenging to get this
right. I really dislikes how this part of WOProject/WOLips works. I
don't think I am alone in that, looking at how the Wonder projects
were changed to work. However - the Wonder way is not what you want
here.
Try this: that that out of the exclude patternset, and add this to
the include one:
*/**/*.png
I think that might do what you want. If not, you could try:
*/*/*.png
or
**/*.png
> It's ok in the build/ folder in the project:
>
> <Image 3.png>
>
> But when I call ant to build and install the .woa, the images
> folder is included:
>
> elvis:/tmp/migrations probert$ ls -l /Library/WebServer/Documents/
> WebObjects/AAAdmin.woa/Contents/WebServerResources/
> drwxr-xr-x 3 probert wheel 102 Dec 31 14:30 images
>
> elvis:/tmp/migrations probert$ ls -l /Library/WebServer/Documents/
> WebObjects/AAAdmin.woa/Contents/WebServerResources/images/
> -rw-r--r-- 1 probert wheel 355 Dec 31 14:30 icone_editer.gif
>
> So the path is good in the build inside Eclipse, but it's not in
> the build made by ant.
You need to play with the include paths.
>>> This tip works fine for the automatic build (the folders are not
>>> part of the .woa/.framework in the build/ folder inside Eclipse),
>>> but when I "install" the binary (WOLips Ant Tools -> Install),
>>> the images are inside the sub-folders instead of being at the top-
>>> level folder. Why does the behavior is different ?
>>
>> I am not sure I understand what you want. You want the images
>> organized into folders in Eclipse but to all be in the same
>> directory for deployment?
>
>
>> It sounds to me like the behaviour of the Ant build is different
>> because you are using the Wonder layout. The processing in the
>> Ant builder in WOProject flattens all the files into one directory
>> (or can, depending on how you include them). Anjo made some
>> changes to how it handles Resources so this does not happen (IIRC)
>> if the path contains Resources. I think he may have done the same
>> thing for WebServer resources, but I am not sure.
>>
>> I _think_ if you change your build.xml to be this, it might do
>> what you want:
>>
>> <wsresources dir=".">
>> <patternset>
>> <includesfile name="woproject/
>> wsresources.include.patternset"/>
>> <excludesfile name="woproject/
>> wsresources.exclude.patternset"/>
>> </patternset>
>> </wsresources>
>
> Already have that (inside the <woapplication> task):
>
> <woapplication customInfoPListContent="$
> {customInfoPListContent}" destDir="${dest.dir}" frameworksBaseURL="/
> WebObjects/${build.app.name}.woa/Frameworks" name="$
> {build.app.name}" principalClass="${principalClass}"
> stdFrameworks="false" webXML="${webXML}" webXML_CustomContent="$
> {webXML_CustomContent}" wsDestDir="${wsdest.dir}">
> ...
> <wsresources dir=".">
> <patternset>
> <includesfile name="woproject/
> wsresources.include.patternset"/>
> <excludesfile name="woproject/
> wsresources.exclude.patternset"/>
> </patternset>
> </wsresources>
> ...
>
>>
>>
>>> 2) If I try to link a application with a framework source AND the
>>> installed framework, I'm getting this:
>>>
>>> Caused by: java.lang.IllegalStateException:
>>> <com.webobjects.foundation.NSBundle> warning: There is already a
>>> unique instance for Bundle named 'OSUtilitaires'. Use
>>> NSBundle.bundleForName(OSUtilitaires) to access it:
>>> <com.webobjects.foundation.NSBundle name:'OSUtilitaires'
>>> bundlePath:'/Library/Frameworks/OSUtilitaires.framework'
>>> packages:'("org.apache.commons.codec.language",
>>> "org.apache.commons.httpclient",
>>> "org.apache.commons.httpclient.protocol", "org.json",
>>> "org.apache.commons.httpclient.util", "ca.os.utilitaires",
>>> "org.apache.commons.logging.impl",
>>> "org.apache.commons.httpclient.params",
>>> "org.apache.commons.codec.net",
>>> "org.apache.commons.httpclient.cookie",
>>> "org.apache.commons.httpclient.methods",
>>> "com.metaparadigm.jsonrpc", "org.apache.commons.codec",
>>> "org.apache.commons.httpclient.auth", "net.jrochkind",
>>> "org.apache.commons.httpclient.methods.multipart",
>>> "org.apache.commons.logging", "org.apache.commons.codec.binary",
>>> "org.apache.commons.codec.digest")' 290 classes >
>>> at com.webobjects.foundation.NSBundle.CreateBundleWithPath
>>> (NSBundle.java:825)
>>> at
>>> com.webobjects.foundation.NSBundle._bundleWithPathShouldCreateIsJar(
>>> NSBundle.java:487)
>>> at com.webobjects.foundation.NSBundle.LoadBundlesFromClassPath
>>> (NSBundle.java:742)
>>> at com.webobjects.foundation.NSBundle.<clinit>(NSBundle.java:365)
>>>
>>> AFAIK, it was working in previous builds of WOLips or maybe I did
>>> something wrong ?
>>
>> I am not sure about that. How are you "linking" the application
>> with the framework source?
>
> My application -> Build Path -> Configure Build Path -> Projects,
> and I add the framework's source project.
That sounds like what I have working in a older WOLips version. It
sounds like something changed. Not sure what.
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
This archive was generated by hypermail 2.0.0 : Wed Jan 02 2008 - 13:26:10 EST