Re: Various little problems

From: Pascal Robert (prober..s.ca)
Date: Mon Dec 31 2007 - 15:30:11 EST


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.

>
> 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:






The woproject/wsresources.exclude.patternset is ok:

**/images

It's ok in the build/ folder in the project:






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.

>
>> 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.



This archive was generated by hypermail 2.0.0 : Mon Dec 31 2007 - 15:31:16 EST