Examples of HPerson


Examples of org.zanata.model.HPerson

            FacesMessages.instance().addToControl("email",
                    "#{msgs['javax.faces.component.UIInput.REQUIRED']}");
            return false;
        }

        HPerson person = personDAO.findByEmail(email);

        if (person != null && !person.getAccount().equals(account)) {
            FacesMessages.instance().addToControl("email",
                    "This email address is already taken");
            return false;
        }
        return true;
View Full Code Here

Examples of org.zanata.model.HPerson

    EmailChangeService emailChangeService;

    @Create
    public void onCreate() {
        username = identity.getCredentials().getUsername();
        HPerson person =
                personDAO.findById(
                        authenticatedAccount.getPerson().getId(), false);
        name = person.getName();
        email = person.getEmail();
        authenticatedAccount.getPerson().setName(this.name);
        authenticatedAccount.getPerson().setEmail(this.email);
    }
View Full Code Here

Examples of org.zanata.model.HPerson

        public void onSelectItemAction() {
            if (StringUtils.isEmpty(getSelectedItem())) {
                return;
            }

            HPerson maintainer = personDAO.findByUsername(getSelectedItem());
            getInstance().getMaintainers().add(maintainer);
            update(conversationScopeMessages);
            reset();
            conversationScopeMessages.setMessage(FacesMessage.SEVERITY_INFO,
                    msgs.format("jsf.MaintainerAddedToGroup",
                            maintainer.getName()));
        }
View Full Code Here

Examples of org.zanata.model.HPerson

    @In
    AccountDAO accountDAO;

    protected void validateEmail(String email) {
        HPerson person = personDAO.findByEmail(email);

        if (person != null && !person.getAccount().equals(authenticatedAccount)) {
            valid = false;
            FacesMessages.instance().addToControl("email",
                    "This email address is already taken");
        }
    }
View Full Code Here

Examples of org.zanata.model.HPerson

    private HPerson person;

    @Begin(join = true)
    public HPerson getPerson() {
        if (person == null)
            person = new HPerson();
        return person;
    }
View Full Code Here

Examples of org.zanata.model.HPerson

    private static HTextFlowTarget createTarget(Date lastChanged,
            String lastModifiedPerson, Integer versionNum,
            @NotNull Map<Integer, HTextFlowTargetHistory> historyMap) {
        HTextFlowTarget target = new HTextFlowTarget();
        target.setLastChanged(lastChanged);
        HPerson person = new HPerson();
        person.setName(lastModifiedPerson);
        target.setLastModifiedBy(person);
        target.setVersionNum(versionNum);
        target.setHistory(historyMap);
        target.setContents("a", "b");
        return target;
View Full Code Here

Examples of org.zanata.model.HPerson

        TestFixture.setId(2L, hLocale);

        HTextFlow textFlow =
                TestFixture.makeHTextFlow(1L, hLocale, ContentState.Rejected);

        HPerson commenter = new HPerson();
        TestFixture.setId(3L, commenter);

        return new HTextFlowTargetReviewComment(textFlow.getTargets().get(
                hLocale.getId()), comment, commenter);
    }
View Full Code Here

Examples of org.zanata.model.HPerson

                Matchers.equalTo("pahuang"));
    }

    private static HAccount createHAccount(String email, String name) {
        HAccount hAccount = new HAccount();
        HPerson hPerson = new HPerson();
        hPerson.setEmail(email);
        hPerson.setName(name);
        hAccount.setPerson(hPerson);
        return hAccount;
    }
View Full Code Here

Examples of org.zanata.model.HPerson

                        changed = true;
                        Long actorId;
                        if (incomingTarget.getTranslator() != null) {
                            String email =
                                    incomingTarget.getTranslator().getEmail();
                            HPerson hPerson = personDAO.findByEmail(email);
                            if (hPerson == null) {
                                hPerson = new HPerson();
                                hPerson.setEmail(email);
                                hPerson.setName(incomingTarget.getTranslator()
                                        .getName());
                                personDAO.makePersistent(hPerson);
                            }
                            hTarget.setTranslator(hPerson);
                            hTarget.setLastModifiedBy(hPerson);
                            actorId = hPerson.getId();
                        } else {
                            hTarget.setTranslator(null);
                            hTarget.setLastModifiedBy(null);
                            actorId = null;
                        }
View Full Code Here

Examples of org.zanata.model.HPerson

    public void joinOrUpdateRoleInLanguageTeam(String locale, Long personId,
            boolean isTranslator, boolean isReviewer, boolean isCoordinator)
            throws ZanataServiceException {
        LocaleId localeId = new LocaleId(locale);
        HPerson currentPerson = personDAO.findById(personId, false);

        boolean alreadyJoined =
                localeMemberDAO.isLocaleMember(personId, localeId);
        HLocaleMember localeMember;
        if (!alreadyJoined) {
            if (currentPerson.getLanguageMemberships().size() >= MAX_NUMBER_MEMBERSHIP) {
                throw new ZanataServiceException(
                        "You can only be a member of up to "
                                + MAX_NUMBER_MEMBERSHIP
                                + " languages at one time.");
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.