• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Incorporate a .woo file into java file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorporate a .woo file into java file


  • Subject: Re: Incorporate a .woo file into java file
  • From: Filippo Lauria <email@hidden>
  • Date: Mon, 05 May 2014 16:39:45 +0200




2014-05-05 15:27 GMT+02:00 Filippo Lauria <email@hidden>:
Hi to all,
I found out that the best way to solve problem I previously exposed (http://lists.apple.com/archives/webobjects-dev/2014/Apr/msg00055.html) is encapsulate the woo file (the one that was scrambled) into java source.

So, for example, let's assume I have this woo source file:
----------
{
    "WebObjects Release" = "WebObjects 5.0";
    encoding = NSUTF8StringEncoding;
    variables = {
        scriptDisplayGroup = {
            class = ERXDisplayGroup;
            dataSource = {
                class = EODetailDataSource;
                detailKey = steps;
                masterClassDescription = Step;
            };
            fetchesOnLoad = YES;
            formatForLikeQualifier = "%@*";
            localKeys = ();
            numberOfObjectsPerBatch = 0;
            selectsFirstObjectAfterFetch = YES;
            sortOrdering = ({class = EOSortOrdering; key = order; selectorName = "compareAscending:"; });
        };
}
----------

Actually, I can easily encapsulate it into my java source. I'm putting in the constructor of my component this:
----------
        ...
         scriptDisplayGroup = new ERXDisplayGroup<Step>();
         EODetailDataSource scriptDataSource = new EODetailDataSource(
                 EOClassDescription.classDescriptionForClass(Step.class),
                 "steps");
         scriptDisplayGroup.setFetchesOnLoad(true);
         scriptDisplayGroup.setSelectsFirstObjectAfterFetch(true);
​           ​
 
​        // i realized this was wrong:​

        ​//​
​ ​
scriptDisplayGroup.sortOrderings().add(
       
​//​
        ERXSortOrdering.sortOrderingWithKey(Step.order,
       
​//​
                ERXSortOrdering.CompareAscending));

​        // then, i replaced it with this:
        scriptDisplayGroup.setSortOrderings(
                new NSArray<>(
                        ERXSortOrdering.sortOrderingWithKey(Step.ORDER_KEY,
                                ERXSortOrdering.CompareAscending)));​

        scriptDisplayGroup.setNumberOfObjectsPerBatch(0);
        scriptDisplayGroup.setDataSource(scriptDataSource);
        scriptDisplayGroup.setLocalKeys(NSArray.EmptyArray);
        ...
----------

What I don't understand is how to "translate" the line `formatForLikeQualifier = "%@*"; ` from the woo.

Maybe it could be done appending `scriptDisplayGroup.setQualifierForKey(EOQualifier.qualifierWithQualifierFormat("%@*", null), "like");`
to the above java lines.

Is that correct?

Thank you, for answers.

​Filippo​

​
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Incorporate a .woo file into java file (From: Filippo Lauria <email@hidden>)

  • Prev by Date: Re: Tabs in ERMODTabInspectPage not showing
  • Next by Date: RuleModeler bug
  • Previous by thread: Incorporate a .woo file into java file
  • Next by thread: RuleModeler bug
  • Index(es):
    • Date
    • Thread