Re: foreach: list must not be a constant

2013-02-15 Thread Þór Sigurðsson
Check if these lines are missing from your project's build.properties file:

component.inlineBindingPrefix=$
component.inlineBindingSuffix=
component.wellFormedTemplateRequired=false

/Þór

On 14.2.2013, at 19:24, John Pollard wrote:

 Hi List,

 In wolips html view I get an error on the first line of the following html 
 code:

  wo:foreach list=$playerGroups item=$nextPlayerGroup
wo:ERQMListViewElement
  h3webobject name=playerGroupLink/webobject/h3
/wo:ERQMListViewElement
  /wo:foreach

 The error is on the foreach line: list must not be a constant, though it 
 isn't a constant and it works ok when run.

 I have updated wolips based on http://wocommunity.org/wolips/3.7/stable/

 Thanks for any help.
 John



 ___
 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/thors%40us.is

 This email sent to th...@us.is




Fyrirvari á tölvupósti / e-mail disclaimer
http://us.is/fyrirvari

 ___
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: WYSIWIG editor with WO

2013-02-15 Thread Theodore Petrosky
I use it all the time! Everything is broken apart and well labeled. I wish 
there was something like this for wonder.



--- On Thu, 2/14/13, Ken Anderson kenli...@anderhome.com wrote:

 From: Ken Anderson kenli...@anderhome.com
 Subject: Re: WYSIWIG editor with WO
 To: Ramsey Gurley rgur...@smarthealth.com
 Cc: WebObjects Development webobjects-dev@lists.apple.com
 Date: Thursday, February 14, 2013, 5:58 PM
 Guys,
 
 I found a site called lynda.com that has tons of training
 videos that look really good so far.  Anyone have any
 experience with them?
 
 Thanks,
 Ken
 
 
 On Feb 12, 2013, at 3:28 PM, Ramsey Gurley rgur...@smarthealth.com
 wrote:
 
  The basics
  
  http://www.w3schools.com/TAGS/ref_byfunc.asp
  
  They also have an intro to CSS
  
  http://www.w3schools.com/css/css_intro.asp
  
  Make sure you validate
  
  http://validator.w3.org
  
  Validating can be a bit tricky when you start injecting
 stuff everywhere with Ajax. Do validation long enough to
 know what you're doing, and then you'll know better than to
 insert divs inside of spans as well as other
 numbskull shenanigans.
  
  When you're really 1337, you can pick up SVG. It's the
 drawing markup of the web
  
  http://www.learnsvg.com/books/learnsvg/dnld/eBookFullAll.zip
  
  You can do stuff like barcodes in one SVG line element.
 It's pretty awesome.
  
  Ramsey
  
  On Feb 12, 2013, at 12:14 PM, Ken Anderson wrote:
  
  Yeah, I think the better bet is to learn this stuff
 once and for all.  Any recommendations for a good guide
 to html5 and css3 ?  I asked this earlier and got a
 number of responses, but hey... :)
  
  Thanks again everyone!
  Ken
  
  On Feb 12, 2013, at 2:04 PM, Johnny Miller jlmil...@kahalawai.com
 wrote:
  
  Hi Ken,
  
  There are also a number of companies who
 provide a PSD 2 HTML service (just Google it).  The
 code quality you get is pretty high and they're reasonably
 priced.  Although, I would recommend learning HTML and
 CSS.
  
  Johnny
  
  On Feb 12, 2013, at 7:09 AM, Ken Anderson
 kenli...@anderhome.com
 wrote:
  
  David,
  
  No doubt - we already have a graphic
 designer, who will do comps for me to work from.  The
 big question is, how do I get those comps into the real
 world.  She doesn't do HTML, but getting a comp into
 HTML is pretty straightforward… the hard part is all the
 movement that people have become accustomed to.
  
  I was thinking I could take her raw
 graphics, the comp, and put them together in something like
 DreamWeaver, then WO-ify it from there.  Reasonable?
  
  Thanks - and hope to see you at WOWODC!
  
  (The original) Ken
  
  On Feb 12, 2013, at 12:07 PM, David LeBer
 dleber_wo...@codeferous.com
 wrote:
  
  Ken,
  
  The workflow that has worked for us is
 to hire a designer, have them mock up the pages as plain
 html, then cut them into bits and wo-ify them.
  
  I have a decent aesthetic sense, and
 good attention to detail, but would never consider myself a
 designer. I've found that nothing beats having a good design
 to start with.
  
  D
  
  On 2013-02-12, at 11:58 AM, Ken
 Anderson kenli...@anderhome.com
 wrote:
  
  All,
  
  I'm building a web site, and would
 like some of the more whizzy UI's that are common
 today.  I could go out and learn HTML5 and CSS3, but I
 was wondering if there's a reasonable shortcut like
 Dreamweaver or another editor.
  
  Does anyone have any
 recommendations or experience?
  
  Thanks!
  Ken
 
 ___
  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/dleber_wodev%40codeferous.com
  
  This email sent to dleber_wo...@codeferous.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:
  https://lists.apple.com/mailman/options/webobjects-dev/jlmiller%40kahalawai.com
  
  This email sent to jlmil...@kahalawai.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:
  https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
  
  This email sent to rgur...@smarthealth.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:
 https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
 
 This email sent to tedp...@yahoo.com

 ___
Do not post admin requests to the list. They will be ignored.

Re: foreach: list must not be a constant

2013-02-15 Thread John Pollard
Many thanks, that fixed it, I had:

component.inlineBindingPrefix=[
component.inlineBindingSuffix=]
component.wellFormedTemplateRequired=true

Though using $ as the binding did actually work, even given the error showing.

Also my previous note about using an NSMutableArray was a red herring, the 
error message popped up again later.

Any pointers to best resources for learning the wognl way would be gladly 
received. I have found the list of wo: shortcuts in Eclipse, Preferences, 
WOLips, Inline Binding Shortcuts

John

On 15 Feb 2013, at 08:14, Þór Sigurðsson th...@us.is wrote:

 Check if these lines are missing from your project's build.properties file:
 
 component.inlineBindingPrefix=$
 component.inlineBindingSuffix=
 component.wellFormedTemplateRequired=false
 
 /Þór
 
 On 14.2.2013, at 19:24, John Pollard wrote:
 
 Hi List,
 
 In wolips html view I get an error on the first line of the following html 
 code:
 
 wo:foreach list=$playerGroups item=$nextPlayerGroup
   wo:ERQMListViewElement
 h3webobject name=playerGroupLink/webobject/h3
   /wo:ERQMListViewElement
 /wo:foreach
 
 The error is on the foreach line: list must not be a constant, though it 
 isn't a constant and it works ok when run.
 
 I have updated wolips based on http://wocommunity.org/wolips/3.7/stable/
 
 Thanks for any help.
 John
 
 
 
 ___
 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/thors%40us.is
 
 This email sent to th...@us.is
 
 
 
 
 Fyrirvari á tölvupósti / e-mail disclaimer
 http://us.is/fyrirvari


 ___
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: Business rules and filtering

2013-02-15 Thread Oscar González

Hi Ralph,
That wil be nice of you
Saludos.

From: ralph.sche...@gmx.net
Subject: Re: Business rules and filtering
Date: Thu, 14 Feb 2013 14:07:42 +0100
To: prob...@macti.ca
CC: webobjects-dev@lists.apple.com

Hi Pascal, 
You could consider the JBoss Drools Framework, or, if you want to implement 
more complex processes, jBPM. 
http://www.jboss.org/jbpm
http://www.jboss.org/drools/
JBPM comes with a nice Eclipse plugin that even lets you define the process as 
a nice flowchart and hook it up to your Java code. 
Advantage: the rules and the process model can be changed without redeploying 
the app, you just change the file and call a refresh method to read it. 
I am currently using this for validation rules in an online shop that needs 
frequent modifications of those rules. 
It's a piece of cake to integrate this into a WO app. All you need to do is add 
some Jars to your project. 
I have built a little test Project as a proof of concept. Let me know if you 
would like the source. If more people are interested, I might write a Wiki 
page...

Cheers, 
Ralph

Von meinem iPad gesendet
Am 14.02.2013 um 13:38 schrieb Pascal Robert prob...@macti.ca:

Hi guys,

In a shopping cart, how would you apply discount based on business rules? For 
example, if someone buy a quantity of 3 of the same item, you apply discount X, 
or if an item is ordered before a certain date, you apply discount Y.  Yes, I 
can do that all in code, but that's not very flexible.

Any ideas?
 ___
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/ralph.scheuer%40gmx.net

This email sent to ralph.sche...@gmx.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:
https://lists.apple.com/mailman/options/webobjects-dev/racso_gp%40hotmail.com

This email sent to racso...@hotmail.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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


ideas to dupe an EO

2013-02-15 Thread Theodore Petrosky
I am looking for an idea on duping an EO. I've thought of putting a hyperlink 
on the listPage then I thought of putting a button on the editPage (i am toying 
with that now).

I duped ERMODInspectPage and I added a button. If I create a localInstance in a 
new EC, how can I save this 'new' EO. it isn't a new EO yet just a duplicate in 
a new editing context. I am looking at ERXEOControlUtilities to see if there 
are any methods to create a new EO from my old one.

but some pointing in the right direction would be appreciated.

Ted
 ___
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: ideas to dupe an EO

2013-02-15 Thread David LeBer
You probably want ERXCopyable.

http://www.mail-archive.com/webobjects-dev@lists.apple.com/msg52084.html

D

On 2013-02-15, at 10:42 AM, Theodore Petrosky tedp...@yahoo.com wrote:

 I am looking for an idea on duping an EO. I've thought of putting a hyperlink 
 on the listPage then I thought of putting a button on the editPage (i am 
 toying with that now).
 
 I duped ERMODInspectPage and I added a button. If I create a localInstance in 
 a new EC, how can I save this 'new' EO. it isn't a new EO yet just a 
 duplicate in a new editing context. I am looking at ERXEOControlUtilities to 
 see if there are any methods to create a new EO from my old one.
 
 but some pointing in the right direction would be appreciated.
 
 Ted
 ___
 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/dleber_wodev%40codeferous.com
 
 This email sent to dleber_wo...@codeferous.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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: foreach: list must not be a constant

2013-02-15 Thread Pascal Robert

Le 2013-02-15 à 06:00, John Pollard j...@pollardweb.com a écrit :

 Many thanks, that fixed it, I had:
 
 component.inlineBindingPrefix=[
 component.inlineBindingSuffix=]
 component.wellFormedTemplateRequired=true
 
 Though using $ as the binding did actually work, even given the error showing.
 
 Also my previous note about using an NSMutableArray was a red herring, the 
 error message popped up again later.
 
 Any pointers to best resources for learning the wognl way would be gladly 
 received. I have found the list of wo: shortcuts in Eclipse, Preferences, 
 WOLips, Inline Binding Shortcuts

http://wiki.wocommunity.org/display/documentation/WOOgnl+Framework

 John
 
 On 15 Feb 2013, at 08:14, Þór Sigurðsson th...@us.is wrote:
 
 Check if these lines are missing from your project's build.properties file:
 
 component.inlineBindingPrefix=$
 component.inlineBindingSuffix=
 component.wellFormedTemplateRequired=false
 
 /Þór
 
 On 14.2.2013, at 19:24, John Pollard wrote:
 
 Hi List,
 
 In wolips html view I get an error on the first line of the following html 
 code:
 
wo:foreach list=$playerGroups item=$nextPlayerGroup
  wo:ERQMListViewElement
h3webobject name=playerGroupLink/webobject/h3
  /wo:ERQMListViewElement
/wo:foreach
 
 The error is on the foreach line: list must not be a constant, though it 
 isn't a constant and it works ok when run.
 
 I have updated wolips based on http://wocommunity.org/wolips/3.7/stable/
 
 Thanks for any help.
 John
 
 
 
 ___
 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/thors%40us.is
 
 This email sent to th...@us.is
 
 
 
 
 Fyrirvari á tölvupósti / e-mail disclaimer
 http://us.is/fyrirvari
 
 
 ___
 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/probert%40macti.ca
 
 This email sent to prob...@macti.ca


 ___
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: ideas to dupe an EO

2013-02-15 Thread Theodore Petrosky
David,

I downloaded the ERXCopyable.java and added it to my Wonder. 

I added the implements ERXCopyableAgenda to my EO and experimented with 
adding the default overrides. Finally living with:

@Override
public Agenda copy() {
Agenda copy = (Agenda) copy(new NSMutableDictionaryEOGlobalID, 
ERXCopyable?());
return copy;
}

@Override
public Agenda copy(NSMutableDictionaryEOGlobalID, ERXCopyable? 
copiedObjects) {
Agenda copy = ERXCopyable.DefaultImplementation.copy(copiedObjects, 
(Agenda) this);
return copy;
}

@Override
public Agenda duplicate(NSMutableDictionaryEOGlobalID, ERXCopyable? 
copiedObjects) {
Agenda duplicate = ERXCopyable.Utility.modelCopy(copiedObjects, 
(Agenda) this);
return duplicate;
}

I am trying to add a method to my version of the ERMODInspectPage that will 
create and save a new copy the object().

i'm stuck with the method that fires to duplicate the EO. Could you point me to 
some code that actually copies?

Ted


--- On Fri, 2/15/13, David LeBer dleber_wo...@codeferous.com wrote:

 From: David LeBer dleber_wo...@codeferous.com
 Subject: Re: ideas to dupe an EO
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: WebObjects Development webobjects-dev@lists.apple.com
 Date: Friday, February 15, 2013, 10:51 AM
 You probably want ERXCopyable.
 
 http://www.mail-archive.com/webobjects-dev@lists.apple.com/msg52084.html
 
 D
 
 On 2013-02-15, at 10:42 AM, Theodore Petrosky tedp...@yahoo.com
 wrote:
 
  I am looking for an idea on duping an EO. I've thought
 of putting a hyperlink on the listPage then I thought of
 putting a button on the editPage (i am toying with that
 now).
  
  I duped ERMODInspectPage and I added a button. If I
 create a localInstance in a new EC, how can I save this
 'new' EO. it isn't a new EO yet just a duplicate in a new
 editing context. I am looking at ERXEOControlUtilities to
 see if there are any methods to create a new EO from my old
 one.
  
  but some pointing in the right direction would be
 appreciated.
  
  Ted
  ___
  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/dleber_wodev%40codeferous.com
  
  This email sent to dleber_wo...@codeferous.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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Mobile to full site page, not refreshed until browser refresh

2013-02-15 Thread John Pollard
Hi list,

I have a site that will display in mobile / full site mode: www.team-picker.com
Click the Mobile site link next to the 4th tick down to see the mobile 
version.
Then click the Full Site button at the bottom left of the mobile page view.
This is where I have a problem, on returning to the full site view, the layout 
is corrupt. Viewing the page source, somehow the mobile elements of the mobile 
page have been retained. However, if you now Refresh your browser, the page is 
corrected.
How can I force the Full Site link to display the original page completely? It 
is currently a component action, but could equally be a direct action (doesn't 
help).

Note that if you view on a mobile phone first, the mobile page is presented by 
default. The same problem is seen there after clicking the Full Site button the 
full view is messed up and is fixed by a refresh within the mobile browser.

The state of Application.setPageRefreshOnBacktrackEnabled() does not make a 
difference.

What can the browser refresh be doing that my link to the page doesn't cause to 
happen in the first place?

Is it something odd with jQueryMobile perhaps which is used on the mobile page 
via ERQMHtmlTemplate, somehow causing the mobilification to persist for a 
further page request.

Thanks
John
 ___
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: Mobile to full site page, not refreshed until browser refresh - solved

2013-02-15 Thread John Pollard
Problem solved, nothing to do with WebObjects.
I needed to add the following to the button:
data-ajax=false;
In order to allow the link to escape out to the full site.

On 15 Feb 2013, at 18:43, John Pollard j...@pollardweb.com wrote:

 Hi list,
 
 I have a site that will display in mobile / full site mode: 
 www.team-picker.com
 Click the Mobile site link next to the 4th tick down to see the mobile 
 version.
 Then click the Full Site button at the bottom left of the mobile page view.
 This is where I have a problem, on returning to the full site view, the 
 layout is corrupt. Viewing the page source, somehow the mobile elements of 
 the mobile page have been retained. However, if you now Refresh your browser, 
 the page is corrected.
 How can I force the Full Site link to display the original page completely? 
 It is currently a component action, but could equally be a direct action 
 (doesn't help).
 
 Note that if you view on a mobile phone first, the mobile page is presented 
 by default. The same problem is seen there after clicking the Full Site 
 button the full view is messed up and is fixed by a refresh within the mobile 
 browser.
 
 The state of Application.setPageRefreshOnBacktrackEnabled() does not make a 
 difference.
 
 What can the browser refresh be doing that my link to the page doesn't cause 
 to happen in the first place?
 
 Is it something odd with jQueryMobile perhaps which is used on the mobile 
 page via ERQMHtmlTemplate, somehow causing the mobilification to persist for 
 a further page request.
 
 Thanks
 John
 ___
 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/john%40pollardweb.com
 
 This email sent to j...@pollardweb.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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: ideas to dupe an EO

2013-02-15 Thread David Avendasora
Hi Ted,

On Feb 16, 2013, at 2:11 AM, Theodore Petrosky tedp...@yahoo.com wrote:

 @Override
 public Agenda duplicate(NSMutableDictionaryEOGlobalID, ERXCopyable? 
 copiedObjects) {
   Agenda duplicate = ERXCopyable.Utility.modelCopy(copiedObjects, 
 (Agenda) this);
   return duplicate;
 }

Whoops! My Javadoc has lead you astray. Change the modelCopy call to 
deepCopy. So:

@Override
public Agenda duplicate(NSMutableDictionaryEOGlobalID, ERXCopyable? 
copiedObjects) {
Agenda duplicate = ERXCopyable.Utility.deepCopy(copiedObjects, (Agenda) 
this);
return duplicate;
}

In order to use the modelCopy method, you need to add entries Agenda's 
UserInfo dictionary in your EOModel which I'm guessing you haven't done.

Once you've done that, calling anInstanceOfAgenda.copy() will create a new 
instance of Agenda EO in the same EC as anInstanceOfAgenda and then copy all 
the attributes and relationships from anInstanceOfAgenda to the new instance. 
You then need to make all the related Entities implement ERXCopyable as well.

The deepCopy assumes that you want copies of all of Agenda's related EOs also, 
which may or may not be true (probably not). If it is not true, you will need 
to change the duplicate method to do what is correct for Agenda and its related 
EOs. If you have Practical WebObjects, read Chapter 9, with special attention 
to the Tweaking the Copy Process section on page 264.

Basically, you are going to want to use some combination of the various 
ERXCopyable.Utility.CopyRelationship methods where   could be 
reference, shallow or deep. See the javadoc for an explanation of what each 
will do.

I hope that helps you!

Dave


 
 I am trying to add a method to my version of the ERMODInspectPage that will 
 create and save a new copy the object().
 
 i'm stuck with the method that fires to duplicate the EO. Could you point me 
 to some code that actually copies?
 
 Ted
 
 
 --- On Fri, 2/15/13, David LeBer dleber_wo...@codeferous.com wrote:
 
 From: David LeBer dleber_wo...@codeferous.com
 Subject: Re: ideas to dupe an EO
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: WebObjects Development webobjects-dev@lists.apple.com
 Date: Friday, February 15, 2013, 10:51 AM
 You probably want ERXCopyable.
 
 http://www.mail-archive.com/webobjects-dev@lists.apple.com/msg52084.html
 
 D
 
 On 2013-02-15, at 10:42 AM, Theodore Petrosky tedp...@yahoo.com
 wrote:
 
 I am looking for an idea on duping an EO. I've thought
 of putting a hyperlink on the listPage then I thought of
 putting a button on the editPage (i am toying with that
 now).
 
 I duped ERMODInspectPage and I added a button. If I
 create a localInstance in a new EC, how can I save this
 'new' EO. it isn't a new EO yet just a duplicate in a new
 editing context. I am looking at ERXEOControlUtilities to
 see if there are any methods to create a new EO from my old
 one.
 
 but some pointing in the right direction would be
 appreciated.
 
 Ted
 ___
 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/dleber_wodev%40codeferous.com
 
 This email sent to dleber_wo...@codeferous.com
 
 
 
 


—
WebObjects - so easy that even Dave Avendasora can do it!™
—
David Avendasora
Senior Software Abuser
Kaiten, Inc.





 ___
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: ideas to dupe an EO

2013-02-15 Thread Theodore Petrosky
Thank you very much for the catch!!!

I am stuck half way in D2W land. the TPMODInspectPage only knows about the 
object(). I was hoping that I could just wire up a button that says Dupe and 
the method would dupe the EO, saveChanges and present the lastPage.

Obviously, object().copy() won't work as object is an EO that doesn't know that 
the method copy() exists. I don't think I should be casting this to an Entity 
of Agenda as that kind of destroys the abstracting process.

I think I need to do (pseudo coded)

if (object().respondsTo(copy)) {
EO newObject = object().copy();
saveChanges(newObject().editingContext);
}

But I am tired and lost here. I have the Practical WO book at home and hope 
that will shed light on my ineptitude.

Ted

--- On Fri, 2/15/13, David Avendasora webobje...@avendasora.com wrote:

 From: David Avendasora webobje...@avendasora.com
 Subject: Re: ideas to dupe an EO
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: WebObjects Development webobjects-dev@lists.apple.com
 Date: Friday, February 15, 2013, 3:52 PM
 Hi Ted,
 
 On Feb 16, 2013, at 2:11 AM, Theodore Petrosky tedp...@yahoo.com
 wrote:
 
  @Override
  public Agenda
 duplicate(NSMutableDictionaryEOGlobalID,
 ERXCopyable? copiedObjects) {
      Agenda duplicate =
 ERXCopyable.Utility.modelCopy(copiedObjects, (Agenda)
 this);
      return duplicate;
  }
 
 Whoops! My Javadoc has lead you astray. Change the
 modelCopy call to deepCopy. So:
 
     @Override
     public Agenda
 duplicate(NSMutableDictionaryEOGlobalID,
 ERXCopyable? copiedObjects) {
     Agenda duplicate =
 ERXCopyable.Utility.deepCopy(copiedObjects, (Agenda) this);
     return duplicate;
     }
 
 In order to use the modelCopy method, you need to add
 entries Agenda's UserInfo dictionary in your EOModel which
 I'm guessing you haven't done.
 
 Once you've done that, calling anInstanceOfAgenda.copy()
 will create a new instance of Agenda EO in the same EC as
 anInstanceOfAgenda and then copy all the attributes and
 relationships from anInstanceOfAgenda to the new instance.
 You then need to make all the related Entities implement
 ERXCopyable as well.
 
 The deepCopy assumes that you want copies of all of Agenda's
 related EOs also, which may or may not be true (probably
 not). If it is not true, you will need to change the
 duplicate method to do what is correct for Agenda and its
 related EOs. If you have Practical WebObjects, read Chapter
 9, with special attention to the Tweaking the Copy Process
 section on page 264.
 
 Basically, you are going to want to use some combination of
 the various ERXCopyable.Utility.CopyRelationship methods
 where   could be reference, shallow or deep. See
 the javadoc for an explanation of what each will do.
 
 I hope that helps you!
 
 Dave
 
 
  
  I am trying to add a method to my version of the
 ERMODInspectPage that will create and save a new copy the
 object().
  
  i'm stuck with the method that fires to duplicate the
 EO. Could you point me to some code that actually copies?
  
  Ted
  
  
  --- On Fri, 2/15/13, David LeBer dleber_wo...@codeferous.com
 wrote:
  
  From: David LeBer dleber_wo...@codeferous.com
  Subject: Re: ideas to dupe an EO
  To: Theodore Petrosky tedp...@yahoo.com
  Cc: WebObjects Development webobjects-dev@lists.apple.com
  Date: Friday, February 15, 2013, 10:51 AM
  You probably want ERXCopyable.
  
  http://www.mail-archive.com/webobjects-dev@lists.apple.com/msg52084.html
  
  D
  
  On 2013-02-15, at 10:42 AM, Theodore Petrosky
 tedp...@yahoo.com
  wrote:
  
  I am looking for an idea on duping an EO. I've
 thought
  of putting a hyperlink on the listPage then I
 thought of
  putting a button on the editPage (i am toying with
 that
  now).
  
  I duped ERMODInspectPage and I added a button.
 If I
  create a localInstance in a new EC, how can I save
 this
  'new' EO. it isn't a new EO yet just a duplicate in
 a new
  editing context. I am looking at
 ERXEOControlUtilities to
  see if there are any methods to create a new EO
 from my old
  one.
  
  but some pointing in the right direction would
 be
  appreciated.
  
  Ted
 
 ___
  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/dleber_wodev%40codeferous.com
  
  This email sent to dleber_wo...@codeferous.com
  
  
  
  
 
 
 —
 WebObjects - so easy that even Dave Avendasora can do
 it!™
 —
 David Avendasora
 Senior Software Abuser
 Kaiten, Inc.
 
 
 
 
 

 ___
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


Re: ideas to dupe an EO

2013-02-15 Thread Theodore Petrosky
Thank you very much for the catch!!!

I am stuck half way in D2W land. the TPMODInspectPage only knows about the 
object(). I was hoping that I could just wire up a button that says Dupe and 
the method would dupe the EO, saveChanges and present the lastPage.

Obviously, object().copy() won't work as object is an EO that doesn't know that 
the method copy() exists. I don't think I should be casting this to an Entity 
of Agenda as tha
 ___
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: ideas to dupe an EO

2013-02-15 Thread David LeBer
Ted,

You should be able to do something like:

((ERXCopyable)object()).copy();

Or more safely:

if (object() instanceof ERXCopyable) {
...
((ERXCopyable)object()).copy();
...
}

notactuallylookedattheapivoidwhereprohibitedbylawyourmilagemayvary.

On 2013-02-15, at 4:12 PM, Theodore Petrosky tedp...@yahoo.com wrote:

 Thank you very much for the catch!!!
 
 I am stuck half way in D2W land. the TPMODInspectPage only knows about the 
 object(). I was hoping that I could just wire up a button that says Dupe 
 and the method would dupe the EO, saveChanges and present the lastPage.
 
 Obviously, object().copy() won't work as object is an EO that doesn't know 
 that the method copy() exists. I don't think I should be casting this to an 
 Entity of Agenda as that kind of destroys the abstracting process.
 
 I think I need to do (pseudo coded)
 
 if (object().respondsTo(copy)) {
EO newObject = object().copy();
saveChanges(newObject().editingContext);
 }
 
 But I am tired and lost here. I have the Practical WO book at home and hope 
 that will shed light on my ineptitude.
 
 Ted
 
 --- On Fri, 2/15/13, David Avendasora webobje...@avendasora.com wrote:
 
 From: David Avendasora webobje...@avendasora.com
 Subject: Re: ideas to dupe an EO
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: WebObjects Development webobjects-dev@lists.apple.com
 Date: Friday, February 15, 2013, 3:52 PM
 Hi Ted,
 
 On Feb 16, 2013, at 2:11 AM, Theodore Petrosky tedp...@yahoo.com
 wrote:
 
 @Override
 public Agenda
 duplicate(NSMutableDictionaryEOGlobalID,
 ERXCopyable? copiedObjects) {
 Agenda duplicate =
 ERXCopyable.Utility.modelCopy(copiedObjects, (Agenda)
 this);
 return duplicate;
 }
 
 Whoops! My Javadoc has lead you astray. Change the
 modelCopy call to deepCopy. So:
 
 @Override
 public Agenda
 duplicate(NSMutableDictionaryEOGlobalID,
 ERXCopyable? copiedObjects) {
 Agenda duplicate =
 ERXCopyable.Utility.deepCopy(copiedObjects, (Agenda) this);
 return duplicate;
 }
 
 In order to use the modelCopy method, you need to add
 entries Agenda's UserInfo dictionary in your EOModel which
 I'm guessing you haven't done.
 
 Once you've done that, calling anInstanceOfAgenda.copy()
 will create a new instance of Agenda EO in the same EC as
 anInstanceOfAgenda and then copy all the attributes and
 relationships from anInstanceOfAgenda to the new instance.
 You then need to make all the related Entities implement
 ERXCopyable as well.
 
 The deepCopy assumes that you want copies of all of Agenda's
 related EOs also, which may or may not be true (probably
 not). If it is not true, you will need to change the
 duplicate method to do what is correct for Agenda and its
 related EOs. If you have Practical WebObjects, read Chapter
 9, with special attention to the Tweaking the Copy Process
 section on page 264.
 
 Basically, you are going to want to use some combination of
 the various ERXCopyable.Utility.CopyRelationship methods
 where   could be reference, shallow or deep. See
 the javadoc for an explanation of what each will do.
 
 I hope that helps you!
 
 Dave
 
 
 
 I am trying to add a method to my version of the
 ERMODInspectPage that will create and save a new copy the
 object().
 
 i'm stuck with the method that fires to duplicate the
 EO. Could you point me to some code that actually copies?
 
 Ted
 
 
 --- On Fri, 2/15/13, David LeBer dleber_wo...@codeferous.com
 wrote:
 
 From: David LeBer dleber_wo...@codeferous.com
 Subject: Re: ideas to dupe an EO
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: WebObjects Development webobjects-dev@lists.apple.com
 Date: Friday, February 15, 2013, 10:51 AM
 You probably want ERXCopyable.
 
 http://www.mail-archive.com/webobjects-dev@lists.apple.com/msg52084.html
 
 D
 
 On 2013-02-15, at 10:42 AM, Theodore Petrosky
 tedp...@yahoo.com
 wrote:
 
 I am looking for an idea on duping an EO. I've
 thought
 of putting a hyperlink on the listPage then I
 thought of
 putting a button on the editPage (i am toying with
 that
 now).
 
 I duped ERMODInspectPage and I added a button.
 If I
 create a localInstance in a new EC, how can I save
 this
 'new' EO. it isn't a new EO yet just a duplicate in
 a new
 editing context. I am looking at
 ERXEOControlUtilities to
 see if there are any methods to create a new EO
 from my old
 one.
 
 but some pointing in the right direction would
 be
 appreciated.
 
 Ted
 
 ___
 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/dleber_wodev%40codeferous.com
 
 This email sent to dleber_wo...@codeferous.com
 
 
 
 
 
 
 —
 WebObjects - so easy that even Dave Avendasora can do
 it!™
 —
 David