• 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
Users Groups (and grouping)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Users Groups (and grouping)


  • Subject: Users Groups (and grouping)
  • From: Theodore Petrosky <email@hidden>
  • Date: Tue, 13 Aug 2013 14:19:30 -0400

I have been playing with D2W and I may have boxed myself into a corner.

A User is of a type. a User can be a Vendor or a Client or a Worker. So I thought that I would create an attribute 'userType' in User. I wanted  to have a Vendor tab and a Client tab and I have it mostly working. 

when I create a ListVendorPage:

public WOComponent listVendorAction() {

 

  EOEditingContext ec = ERXEC.newEditingContext();
    ListPageInterface lpi = (ListPageInterface) D2W.factory().listPageForEntityNamed("AppUser", session()); 

    EODatabaseDataSource ds = new EODatabaseDataSource(ec, "AppUser");

    ERXFetchSpecification<AppUser> fs = 
        new ERXFetchSpecification<AppUser>(AppUser.ENTITY_NAME, AppUser.IS_ACTIVE.eq(true).and(AppUser.USER_TYPE.eq("Vendor")), null);

    ds.setFetchSpecification(fs);

    lpi.setDataSource(ds);

    ((D2WComponent) lpi).d2wContext().takeValueForKey("ListVendor", "navigationState");
    ((D2WComponent) lpi).d2wContext().takeValueForKey("Vendor", "userTypeKey");

    

    return (D2WPage) lpi;
}

I am also adding that userTypeKey so I can target rules like this:

100 : (pageConfiguration = 'ListAppUser' and userTypeKey = 'Vendor') => displayNameForPageConfiguration = "Vendor List" [com.webobjects.directtoweb.Assignment]

Maybe there is a better way? If I select to edit a Vendor, I wanted rules:

100 : (pageConfiguration = 'EditAppUser' and userTypeKey = 'Vendor') => navigationState = "ListVendor" [com.webobjects.directtoweb.Assignment]
100 : (pageConfiguration = 'EditAppUser' and userTypeKey = 'admins') => navigationState = "ListAdmins" [com.webobjects.directtoweb.Assignment]

then I thought that what I should be using is inheritance.  Vendor inherits from User, Administrators inherit from User. In the past, I would have created a User with boolean attributes for  Vendor, Client, Employee, Admin. After all a user can be both an employee and a vendor.

How are youse guys doing this?

Ted
 _______________________________________________
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

  • Follow-Ups:
    • Re: Users Groups (and grouping)
      • From: Johnny Miller <email@hidden>
    • Re: Users Groups (and grouping)
      • From: Ramsey Gurley <email@hidden>
  • Prev by Date: Re: ERXEC question
  • Next by Date: Re: Users Groups (and grouping)
  • Previous by thread: Re: ERXEC question
  • Next by thread: Re: Users Groups (and grouping)
  • Index(es):
    • Date
    • Thread