Package er.bugtracker

Examples of er.bugtracker.People


public class PeopleDelegate extends BranchDelegate {

    @Override
    protected NSArray defaultBranchChoices(D2WContext context) {
        NSArray result = super.defaultBranchChoices(context);
        People people = (People) object(context);
        if(ERXEOControlUtilities.eoEquals(people, People.clazz.currentUser(people.editingContext())) || people.editingContext().globalIDForObject(people).isTemporary()) {
            result = choiceByRemovingKeys(new NSArray("delete"), result);
            result = choiceByRemovingKeys(new NSArray("view"), result);
        }
        return result;
    }
View Full Code Here


        EOEditingContext ec = ERXEC.newEditingContext();
        ec.lock();
        try {
            NSArray everybody = People.clazz.allObjects(ec);
            for (Enumeration e = everybody.objectEnumerator(); e.hasMoreElements();) {
                People person = (People) e.nextElement();
                NSDictionary bindings = new NSDictionary(new Object[] { person }, new Object[] { "user" });
                NSArray unreadBugs = person.unreadBugs();
                String email = person.email();
                if (unreadBugs.count() > 0 && email != null && email.length() != 0) {
                    BugReportEmail emailBody = (BugReportEmail)WOApplication.application().pageWithName("BugReportEmail", ERXWOContext.newContext());
                    emailBody.takeValueForKey(unreadBugs, "unreadBugs");
                    emailBody.takeValueForKey(person, "owner");
                    WOMailDelivery.sharedInstance().composeComponentEmail("bugtracker@netstruxr.com", new NSArray(email), null,
View Full Code Here

  public static final String USERNAME = "sel_name";
  public static final String PASSWORD = "sel_pass";
  private static final String NAME = "SeleniumName";
 
  private void deleteTestPeople() {
      People people = People.clazz.userWithUsernamePassword(session().defaultEditingContext(), USERNAME, PASSWORD);
      if (people != null) {
          EOEditingContext ec = ERXEC.newEditingContext();
          ec.lock();
          try {
              people = (People) EOUtilities.localInstanceOfObject(ec, people);
                ERXUtilities.deleteObjects(ec, people.allBugs());
                people.delete();
              // ERXEOAccessUtilities.deleteRowsDescribedByQualifier(ec, Bug.ENTITY, qualifier)
              /* TODO: this should be done in BTBusinessLogic */
              EOKeyValueQualifier frameworkQualifier = new EOKeyValueQualifier(Framework.Key.OWNER, EOQualifier.QualifierOperatorEqual, people);
              assert(frameworkQualifier != null);
              NSArray frameworks = ERXEOControlUtilities.objectsWithQualifier(ec,
View Full Code Here

      }
  }
 
  private People addTestPeople(boolean isAdmin) {
    EOEditingContext ec = ERXEC.newEditingContext();
    People people = People.clazz.createAndInsertObject(ec);
    people.setName(NAME);
    people.setLogin(USERNAME);
    people.setPassword(PASSWORD);
    people.setIsAdmin(isAdmin);
    ec.saveChanges();
    log.debug("People " + USERNAME + " added");
    return people;
  }
View Full Code Here

  }
 
  private WOActionResults ensureTestPeopleAreLoggedIn() {
    Session session = (Session)session();
        session.setLanguage("English");
    People people = People.clazz.userWithUsernamePassword(session.defaultEditingContext(), USERNAME, PASSWORD);
    session.setUser(people);
    return success();
  }
View Full Code Here

        return ensureTestPeopleAreLoggedIn();
    }

    public WOActionResults ensurePeopleSetupAction() {
      Session session = (Session)session();
        People people = People.clazz.userWithUsernamePassword(session.defaultEditingContext(), "user100", "user");
        assert people != null;
        people.setIsActive(false);
       
        people = People.clazz.userWithUsernamePassword(session.defaultEditingContext(), "user101", "user");
        assert people != null;
        people.setIsActive(true);
        people.setIsAdmin(false);
        people.setIsEngineering(false);
        people.setIsCustomerService(true);
        session.defaultEditingContext().saveChanges();
       
        return ensureTestAdminAction();
    }
View Full Code Here

        if (username==null || password==null) {
            errorMessage="Please specify both fields!";
            return null;
        }
       
        People  userObject = People.clazz.userWithUsernamePassword(editingContext, username, password);
        if(userObject == null) {
            errorMessage="Sorry login incorrect!";
            return null;
        }

        if (!userObject.isActive()) {
            errorMessage="Sorry your account is inactive!";
            return null;
        }
        session.setUser(userObject);
        boolean isAdmin = userObject.isAdmin();
        D2W.factory().setWebAssistantEnabled(isAdmin);
        String encryptedIDPrimaryKey = ERXCrypto.crypterForAlgorithm(ERXCrypto.BLOWFISH).encrypt(userObject.primaryKey());
        WOCookie loginCookie=new WOCookie("BTL", rememberPassword ?  encryptedIDPrimaryKey : "-");
        loginCookie.setExpires(NSTimestamp.DistantFuture);
        loginCookie.setPath("/");
        context().response().addCookie(loginCookie);
        WOComponent nextPage = nextPage();
View Full Code Here

TOP

Related Classes of er.bugtracker.People

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.