Thanks Sven,

But you haven't understood my question, in the first place there is no
PSML for the user at all. That should have been there right?

On 6/24/05, Sven Richter <[EMAIL PROTECTED]> wrote:
> Hi Mahaveer,
> 
> I think, the reason for that is exactly what I was talking about.
> Subdirectories are not copied. Unless, you don't have any
> subdirectories. Than it should work.
> 
> Regards,
> Sven.
> 
> Mahaveer Jain wrote:
> >Hi all,
> >
> >I am trying to create user using my own class, which is similar to
> >CreateNewUserAndConfirm.java. The user is created but the psml file is
> >not created. Can some one help me?
> >
> >Mahaveer
> >
> >Here is the code
> >-------------------------------------------------
> >
> > package com.indent.actions;
> >
> >import com.ai.application.utils.AppObjects;
> >import com.ai.application.interfaces.AFactoryPart;
> >import com.ai.application.interfaces.RequestExecutionException;
> >import com.ai.application.interfaces.RequestExecutorResponse;
> >import org.apache.jetspeed.om.security.JetspeedUser;
> >import org.apache.jetspeed.services.JetspeedSecurity;
> >import org.apache.jetspeed.services.resources.JetspeedResources;
> >import org.apache.jetspeed.services.security.JetspeedSecurityException;
> >import org.apache.turbine.util.GenerateUniqueId;
> >
> >import java.util.Date;
> >import java.util.Map;
> >import java.util.Hashtable;
> >
> >public class ShareOnWebAddUsers extends AFactoryPart{
> >    public Object executeRequestForPart(String requestName, Map args)
> >throws RequestExecutionException {
> >        try {
> >            String pass1 = (String) args.get("password");
> >            String email = (String) args.get("email");
> >            String username = (String) args.get("username");
> >
> >            // convert case if configured
> >            username = JetspeedSecurity.convertUserName(username);
> >            pass1 = JetspeedSecurity.convertPassword(pass1);
> >
> >            boolean accountExists = true;
> >            try {
> >                JetspeedSecurity.getUser(username);
> >            } catch (JetspeedSecurityException e) {
> >                accountExists = false;
> >            }
> >
> >            if (!accountExists) {
> >                Date now = new Date();
> >
> >                JetspeedUser user = JetspeedSecurity.getUserInstance();
> >
> >                user.setUserName(username);
> >                user.setCreateDate(now);
> >                user.setLastLogin(new Date(0));
> >                user.setFirstName((String) args.get("firstname"));
> >                user.setLastName((String) args.get("lastname"));
> >                user.setEmail((String) args.get("email"));
> >
> >                String confirmValue = GenerateUniqueId.getIdentifier();
> >                confirmValue = JetspeedResources.CONFIRM_VALUE;
> >                user.setConfirmed(confirmValue);
> >
> >                user.setPassword(pass1);
> >                JetspeedSecurity.addUser(user);
> >                createUser(user, args);
> >
> >            }
> >        } catch (Exception e) {
> >            //Log.error("CreateNewUserAndConfirm", e);
> >            //data.setMessage(e.toString());
> >            //data.setStackTrace(StringUtils.stackTrace(e), e);
> >            
> > //data.setScreenTemplate(JetspeedResources.getString("template.error",
> >"Error"));
> >        }
> >        return new RequestExecutorResponse(true);
> >    }
> >
> >    /**
> >     * After jetspeed creating new user, add additional properties for new 
> > user
> >     *
> >     * @param user the new user that has been created
> >     * @param data the current RunData instance
> >     * @throws Exception passed up from JetspeedSecurity
> >     */
> >    private void createUser(JetspeedUser user, Map args) throws Exception {
> >        Hashtable args2 = new Hashtable();
> >        args2.put("company_id", "5");
> >        args2.put("user_id", user.getUserName());
> >        // args2.put("profile_userid", "turbine");
> >
> >        String email = (String) args.get("email");
> >        args2.put("email", email);
> >        args2.put("firstname", (String) args.get("firstname"));
> >        args2.put("lastname", (String) args.get("lastname"));
> >        String request = "initializeNewUser";
> >        Object obj = AppObjects.getIFactory().getObject(request, args2);
> >    }
> >}
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to