• 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: Darn DG login page!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Darn DG login page!


  • Subject: Re: Darn DG login page!
  • From: David LeBer <email@hidden>
  • Date: Fri, 5 Nov 2004 14:28:36 -0500

On Nov 5, 2004, at 2:07 PM, Jeremy Matthews wrote:

Ok,

I have an Entity "MemberData", that stores user ID's ("idKey") passwords ("idPassword"); privilege level ("statusLevel") in a separate entity "MemberDataRel" that is accessed through a to-One relationship in MemberData. Initially, I create a user with the same id and password "admin" in the DB, so there is something (initially) to compare against until other users are created. I'm using a DG to query entries against a field for ID and Password. Everything is mapped correctly, but the code is not working....can't see why yet...but the hours are long.

Here is the fetch specification I drew in the Entity (and selected) for the "loginDG" DG I created. I'm thinking this is unecessary anyways?

((idKey = $idKey) and (idPassword = $idPassword))

I'm going to ignore your code as it looks horribly broken, and without the bindings (.wod) I cannot decipher it.


I would have to start by saying that a WoDisplayGroup is horrible overkill for this kind of thing.

I'd do something like this:

String username; // assume exists and bound to the username WOTextField
String password; // assume exists and bound to the password WOTextField

public WOComponent checkUserLogin() { // bound to your WOSubmitButton
EOEditingContext ec = session().defaultEditingContext();
NSDictionary args = new NSDictionary(new NSArray(new String[] {username, password}),
new NSArray(new String[] {"username", "password"}));
try {
MemberData user = (MemberData)EOUtilities.objectMatchingValues(ec, "MemberData", args);
// Hot dang! We got ourselves a user, Do something!
// return somePageOrOther;
} catch (EOObjectNotAvailableException e) {
// No user found, do something else.
// return this.context().page();
}
}



;david

--
David LeBer
Codebase Software Systems
site:   http://www.codebase.ca
blog: http://david.codebase.ca

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >Darn DG login page! (From: Jeremy Matthews <email@hidden>)

  • Prev by Date: Re: O-R Mapping Article in Software Dev Times
  • Next by Date: Re: O-R Mapping Article in Software Dev Times
  • Previous by thread: Darn DG login page!
  • Next by thread: EOmodeler problem
  • Index(es):
    • Date
    • Thread