Examples of ProfileForm


Examples of com.google.devrel.training.conference.form.ProfileForm

    }

    @Test
    public void testUpdateProfile() throws Exception {
        // Save for the first time.
        conferenceApi.saveProfile(user, new ProfileForm(DISPLAY_NAME, TEE_SHIRT_SIZE));
        Profile profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
        assertEquals(USER_ID, profile.getUserId());
        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
        assertEquals(DISPLAY_NAME, profile.getDisplayName());
        // Then try to update it.
        String newDisplayName = "New Name";
        TeeShirtSize newTeeShirtSize = TeeShirtSize.L;
        conferenceApi.saveProfile(user, new ProfileForm(newDisplayName, newTeeShirtSize));
        profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
        assertEquals(USER_ID, profile.getUserId());
        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(newTeeShirtSize, profile.getTeeShirtSize());
        assertEquals(newDisplayName, profile.getDisplayName());
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm

        assertEquals(newDisplayName, profile.getDisplayName());
    }

    @Test
    public void testUpdateProfileWithNulls() throws Exception {
        conferenceApi.saveProfile(user, new ProfileForm(DISPLAY_NAME, TEE_SHIRT_SIZE));
        // Update the Profile with null values.
        Profile profile = conferenceApi.saveProfile(user, new ProfileForm(null, null));
        // Expected behavior is that the existing properties do not get overwritten

        // Check the return value first.
        assertEquals(USER_ID, profile.getUserId());
        assertEquals(EMAIL, profile.getMainEmail());
View Full Code Here

Examples of org.jresearch.gossip.forms.ProfileForm

        UserDAO dao = UserDAO.getInstance();
        PendingRegistrationForm pprForm = (PendingRegistrationForm) form;
        try {
           

            ProfileForm profile = new ProfileForm();
            profile.setLogin(pprForm.getLogin());
            profile.setEmail(pprForm.getEmail());
            String password = dao.generatePassword();
            profile.setPassword(password);
            profile.setPassword2(password);

            if (dao.checkPendingUser(pprForm.getLogin(), pprForm.getCode())
                    && dao.addUser(profile)) {
                dao.deletePendingUser(pprForm.getLogin());
                User newuser = dao.getUser(profile.getLogin(), profile
                        .getPassword());
                log(request, "logs.LOG7", newuser.getName());

                if (newuser.getStatus() > 0) {
                    newuser.setIp(request.getRemoteAddr());
                    session.setAttribute(IConst.SESSION.USER_KEY, newuser);
                    /*
                     * MailMessage(String messagetext, String subject, String
                     * addrfrom, String namefrom, String addrto, String nameto)
                     */
                    MessageResources messages = getResources(request);
                    Configurator config = Configurator.getInstance();

                    /*
                     * {0} - login {1} - new password {2} - site url {3} - site
                     * name
                     */
                    StringBuffer siteUrl = new StringBuffer();
                    siteUrl.append(request.getServerName());
                    siteUrl.append(":");
                    siteUrl.append(request.getServerPort());
                    siteUrl.append(request.getContextPath());
                    siteUrl.append(config.get(IConst.CONFIG.MODULE_PREFIX));
                    siteUrl.append("/");

                    Object[] messArgs = new Object[] { newuser.getName(),
                            profile.getPassword(), siteUrl.toString(),
                            config.get(IConst.CONFIG.SITE_NAME) };

                    MailQueue queue = (MailQueue) session.getServletContext()
                            .getAttribute(IConst.CONTEXT.MAIL_QUEUE);
                    queue.push(new MailMessage(messages.getMessage(
View Full Code Here

Examples of org.jresearch.gossip.forms.ProfileForm

            throws JGossipException {
        HttpSession session = request.getSession();

        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        UserDAO dao = UserDAO.getInstance();
        ProfileForm pForm = (ProfileForm) form;
        String forward=IConst.TOKEN.PAGE;
        try {
            if (Configurator.getInstance().getBoolean(
                    IConst.CONFIG.ENABLE_EXT_SIGN_ON)
                    && !dao.isUserExist(user.getName())) {
                //add new forum user
                pForm.setLogin(user.getName());
                pForm.setPassword(user.getName());
                pForm.setPassword2(user.getName());
                dao.addUser(pForm);
                user = dao.getUser(pForm.getLogin(), pForm.getPassword());
                if (user.getStatus() == UserStatus.GUEST) {
                    session.setAttribute(IConst.SESSION.USER_KEY, user);
                    throw new LogicException(getResources(request).getMessage(
                            "errors.ERR22")
                            + user.getName());
View Full Code Here

Examples of org.jresearch.gossip.forms.ProfileForm

        HttpSession session = request.getSession();
        UserDAO dao = UserDAO.getInstance();

        try {

            ProfileForm pf = (ProfileForm) form;
            String tempPass = dao.generatePassword();
            pf.setPassword(tempPass);
            pf.setPassword2(tempPass);

            if (dao.addUser(pf)) {
                User newuser = dao.getUser(pf.getLogin(), pf.getPassword());
                log(request, "logs.LOG29", newuser.getName());
                setStatusMessage(request, "status.USER_ADDED", newuser
                        .getName());

                /*
 
View Full Code Here

Examples of org.jresearch.gossip.forms.ProfileForm

    public ActionForward process(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws SystemException {
        HttpSession session = request.getSession();
        if (null == request.getAttribute("profileForm")) {
            ProfileForm profile = new ProfileForm();
            User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
            profile.setUserInfo(user);
            request.setAttribute("profileForm", profile);
        }
        return (mapping.findForward("showProfile"));
    }
View Full Code Here

Examples of uk.gov.nationalarchives.droid.gui.ProfileForm

     * @param profile
     *            the active profile form.
     */
    @Override
    public void fireEvent(final ProfileInstance profile) {
        final ProfileForm activeProfile = context.getSelectedProfile();
        if (activeProfile == null || activeProfile.getProfile() == null) {
            setEnabled(saveAsAction, false); // save as - N
            setEnabled(saveAction, false); // save - N
            setEnabled(loadAction, true); // load - Y
            setEnabled(createAction, true); // new - Y
            setEnabled(runAction, false); // run - N
            setEnabled(stopAction, false); // stop - N
            setEnabled(resourceEditing, false); // add resource - N
            setEnabled(closeAction, false); // close - N
            setEnabled(exportAction, false); // export - N
            setEnabled(filterAction, false); // filter - N
            setEnabled(filterEnabledAction, false); // filter enabled - N
            setEnabled(reportAction, false); // report - N
        } else if (activeProfile.getProfile().equals(profile)) {
            EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    ProfileStateMachine state = states.get(profile.getState());
                    if (state != null) {
View Full Code Here

Examples of uk.gov.nationalarchives.droid.gui.ProfileForm

     * @param selectedFiles the files to add
     * @param recursive if any directories should be conisdered as recursive profile spec resources.
     */
    public void add(Collection<File> selectedFiles, boolean recursive) {
       
        ProfileForm selectedProfile = droidContext.getSelectedProfile();
        DefaultTreeModel treeModel = selectedProfile.getTreeModel();
        ProfileInstance profile = selectedProfile.getProfile();
        ProfileSpec profileSpec = profile.getProfileSpec();
       
        DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeModel.getRoot();
        for (File selectedFile : selectedFiles) {
            AbstractProfileResource newResource;
View Full Code Here

Examples of uk.gov.nationalarchives.droid.gui.ProfileForm

        if (errorStrings.size() > 0) {
            JOptionPane.showMessageDialog(filterDialog, errorStrings.toArray());
        } else {
            filterDialog.getDroidContext().getSelectedProfile().getProfile().setDirty(true);
//            filterDialog.getDroidContext().getSelectedProfile().onResourceChanged();
            ProfileForm profileToFilter = filterDialog.getDroidContext().getSelectedProfile();
            ApplyFilterToTreeTableAction applyFilterToTreeAction =
                new ApplyFilterToTreeTableAction(profileToFilter, filterDialog.getProfileManager());
            applyFilterToTreeAction.applyFilter();
            filterDialog.dispatchEvent(new WindowEvent(filterDialog,  WindowEvent.WINDOW_CLOSING));
        }
View Full Code Here

Examples of uk.gov.nationalarchives.droid.gui.ProfileForm

    /**
     * Removes the selected items.
     */
    public void remove() {

        ProfileForm selectedProfile = droidContext.getSelectedProfile();

        DefaultTreeModel treeMdl = selectedProfile.getTreeModel();
        Outline outline = selectedProfile.getResultsOutline();
        ProfileInstance profile = selectedProfile.getProfile();

        int[] selectedRows = outline.getSelectedRows();

        for (int i = selectedRows.length; i > 0; i--) {
            // remove node from profile spec
            int index = selectedRows[i - 1];

            DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline
                    .getValueAt(index, 0);
            ProfileResourceNode prn = (ProfileResourceNode) treeNode
                    .getUserObject();
            if (profile.removeResource(prn.getUri())) {
                treeMdl.removeNodeFromParent(treeNode);
            }
        }

        profileManager.updateProfileSpec(
                selectedProfile.getProfile().getUuid(), profile
                        .getProfileSpec());
//        if (profile.isDirty()) {
//            selectedProfile.onResourceChanged();
//        }

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.