Package er.extensions.eof

Examples of er.extensions.eof.ERXKeyFilter


    editingContext().saveChanges();
    return response(movie, showFilter());
  }

  protected ERXKeyFilter showFilter() {
    ERXKeyFilter filter = ERXKeyFilter.filterWithNone();
    filter.include(Movie.TITLE);
    filter.include(Movie.RATED);
    filter.include(Movie.POSTER_NAME);
    filter.include(Movie.DATE_RELEASED);
    filter.include(Movie.CATEGORY);

    return filter;
  }
View Full Code Here


   * you expose to qualifiers through query parameters
   *
   * @return
   */
  public static ERXKeyFilter queryFilter() {
    ERXKeyFilter filter = ERXKeyFilter.filterWithAllRecursive();
    return filter;
  }
View Full Code Here

  /**
   * This showFilter is used by indexAction and showAction and says to return all attributes
   * of an Animal as well as the Owner relationship, and for the owner, include all of its attributes.
   */
  public static ERXKeyFilter showFilter() {
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(Animal.OWNER).includeAttributes();
    return filter;
  }
View Full Code Here

   * The updateFilter us used by updateAction and createAction and says to allow updating any attributes of an
   * Animal as well as the Owner relationship.
   * @return
   */
  public static ERXKeyFilter updateFilter() {
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(Animal.OWNER);
    return filter;
  }
View Full Code Here

  public CarController(WORequest request) {
    super(request);
  }

  protected ERXKeyFilter showFilter() {
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(new ERXKey<Manufacturer>("manufacturer"));
    return filter;
  }
View Full Code Here

    Person person = routeObjectForKey("person");
    return person;
  }

  public static ERXKeyFilter queryFilter() {
    ERXKeyFilter filter = ERXKeyFilter.filterWithAllRecursive();
    return filter;
  }
View Full Code Here

   * This shows adding a derived attribute into the filter results.
   *
   * @return
   */
  public static ERXKeyFilter showFilter() {
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(Person.COMPANY).includeAttributes();
    filter.include(Person.PETS).includeAttributes();
    filter.include(new ERXKey<NSTimestamp>("derivedCurrentTime")); // derivedCurrentTime is a non-model method on Person
    return filter;
  }
View Full Code Here

    filter.include(new ERXKey<NSTimestamp>("derivedCurrentTime")); // derivedCurrentTime is a non-model method on Person
    return filter;
  }

  public static ERXKeyFilter updateFilter() {
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(Person.COMPANY).includeAttributes(); // let you update a company inside of a person
    return filter;
  }
View Full Code Here

   * that you can update the object on the other side of the relationship, but you can't change the
   * related object itself.
   */
  public WOActionResults lockedUpdateAction() {
    Person person = person();
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(Person.COMPANY).includeAttributes(); // let you update a company inside of a person
    filter.lockRelationship(Person.COMPANY); // don't let you change the company relationship
    update(person, filter);
    editingContext().saveChanges();
    return response(person, showFilter());
  }
View Full Code Here

   * securityUpdate is just like a regular update except that it will not let you change the person's
   * company name to Microsoft when updating the Person using the ERXKeyFilter.Delegate API
   */
  public WOActionResults securityUpdateAction() {
    Person person = person();
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(Person.COMPANY).includeAttributes(); // let you update a company inside of a person
    filter.setDelegate(new ERXKeyFilter.Delegate() {
      public void willTakeValueForKey(Object target, Object value, String key) throws SecurityException {
        if (target instanceof Company && "name".equals(key) && value != null && ((String)value).contains("Microsoft")) {
          throw new SecurityException("You can't change a Person's company name to Microsoft.");
        }
      }
View Full Code Here

TOP

Related Classes of er.extensions.eof.ERXKeyFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.