Tribune

Home » Liferay Social Office

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Arvind Patil
user registration requires more fields
26 ottobre 2011 16.30
Risposta

Arvind Patil

Punteggio: New Member

Messaggi: 10

Data di Iscrizione: 26 ottobre 2011

Messaggi recenti

Hi
I am Arvind.I am new to Liferay.I will have to add more fields to Liferay existing GUI like address,Country,Username and some more.But I dont know how to start with it and what to do.Could any one give me step by step procedure.I could not be able to find addUser.java class .Please help.
Thanks in advance
Rojalin Patri
RE: user registration requires more fields
26 ottobre 2011 22.38
Risposta

Rojalin Patri

Punteggio: Expert

Messaggi: 287

Data di Iscrizione: 22 marzo 2011

Messaggi recenti

Hi Arvind,
the file UserLocalServiceUtil.java take care of adding user.you can just create a hook and override the adduser() function with the additional fields.In front end webapps/ROOT/html/portlet/enterprise_admin/user/details.jsp handles the front end UI part.You can override the jsp in your hook as well.
Hope this helps
Hitoshi Ozawa
RE: user registration requires more fields
27 ottobre 2011 5.39
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7949

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

Liferay already have address,Country and screen name fields in the user page. Exactly which GUI page are you referring to?

If you'll looking for an interface instead of a GUI page, check the following page:
http://docs.liferay.com/portal/6.0/javadocs/com/liferay/portal/service/AddressLocalServiceUtil.html
Arvind Patil
RE: user registration requires more fields
15 novembre 2011 20.41
Risposta

Arvind Patil

Punteggio: New Member

Messaggi: 10

Data di Iscrizione: 26 ottobre 2011

Messaggi recenti

Arvind Patil:
Hi
I am Arvind.I am new to Liferay.I will have to add more fields to Liferay existing GUI like address,Country,Username and some more.But I dont know how to start with it and what to do.Could any one give me step by step procedure.I could not be able to find addUser.java class .Please help.
Thanks in advance


Thanks in advance.
I am trying to access following method from portlet .I tried UserServiceUtil.updateUser.It inserted user in database tables in User_ but when I try to see view all users in Liferay Control Panel I could not see added users.They are just in USer_
I am trying with UserLocalServiceUtil.addUser() but it is giving me errors.



long creatorUserId=23455;
long companyId=54444;
boolean autoPassword=false;
String password1="Arvind";
String password2="Patil";
boolean autoScreenName=false;
String screenName="Arvind.Patil";
String emailAddress="abc@yahoo.com";
long facebookId=12334455;
String openId="Rohan";
Locale locale=Locale.US;
String firstName="Arvind";
String middleName="S";
String lastName="Patil";
int prefixId=123;
int suffixId=234;
boolean male=false;
int birthdayMonth=11;
int birthdayDay=12;
int birthdayYear=61;
String jobTitle="Student";
long[] groupIds={0};
long[] organizationIds={0};
long[] roleIds={0};
long[] userGroupIds={0};
boolean sendEmail=false;
ServiceContext serviceContext = new ServiceContext();


UserLocalServiceUtil.addUser(creatorUserId,
companyId,
autoPassword,
password1,
password2,
autoScreenName,
screenName,
emailAddress,
facebookId,
openId,
locale,
firstName,
middleName,
lastName,
prefixId,
suffixId,
male,
birthdayMonth,
birthdayDay,
birthdayYear,
jobTitle,
groupIds,
organizationIds,
roleIds,
userGroupIds,
sendEmail,serviceContext
);

at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:35)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.servlet.ServletException: com.liferay.portal.NoSuchCompanyException: No Company exists with the primary key 54444
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
at com.liferay.portal.kernel.servlet.PageContextWrapper.handlePageException(PageContextWrapper.java:141)
at org.apache.jsp.view_jsp._jspService(view_jsp.java:268)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
... 222 more
Caused by: com.liferay.portal.NoSuchCompanyException: No Company exists with the primary key 54444
at com.liferay.portal.service.persistence.CompanyPersistenceImpl.findByPrimaryKey(CompanyPersistenceImpl.java:436)
Arvind Patil
RE: user registration requires more fields
15 novembre 2011 21.03
Risposta

Arvind Patil

Punteggio: New Member

Messaggi: 10

Data di Iscrizione: 26 ottobre 2011

Messaggi recenti

Thanks in advance.
I am trying to access following method from portlet .I tried UserServiceUtil.updateUser().It inserted user in database tables in User_ but when I try to see view all users in Liferay Control Panel I could not see added users.They are just in USer_
I am trying with UserLocalServiceUtil.addUser() but it is giving me errors.

I am registering users from external web application and then want to use them inside Liferay.
Thanks in advance.



long creatorUserId=23455;
long companyId=54444;
boolean autoPassword=false;
String password1="Arvind";
String password2="Patil";
boolean autoScreenName=false;
String screenName="Arvind.Patil";
String emailAddress="abc@yahoo.com";
long facebookId=12334455;
String openId="Rohan";
Locale locale=Locale.US;
String firstName="Arvind";
String middleName="S";
String lastName="Patil";
int prefixId=123;
int suffixId=234;
boolean male=false;
int birthdayMonth=11;
int birthdayDay=12;
int birthdayYear=61;
String jobTitle="Student";
long[] groupIds={0};
long[] organizationIds={0};
long[] roleIds={0};
long[] userGroupIds={0};
boolean sendEmail=false;
ServiceContext serviceContext = new ServiceContext();


UserLocalServiceUtil.addUser(creatorUserId,
companyId,
autoPassword,
password1,
password2,
autoScreenName,
screenName,
emailAddress,
facebookId,
openId,
locale,
firstName,
middleName,
lastName,
prefixId,
suffixId,
male,
birthdayMonth,
birthdayDay,
birthdayYear,
jobTitle,
groupIds,
organizationIds,
roleIds,
userGroupIds,
sendEmail,serviceContext
);

at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:35)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.servlet.ServletException: com.liferay.portal.NoSuchCompanyException: No Company exists with the primary key 54444
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
at com.liferay.portal.kernel.servlet.PageContextWrapper.handlePageException(PageContextWrapper.java:141)
at org.apache.jsp.view_jsp._jspService(view_jsp.java:268)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
... 222 more
Caused by: com.liferay.portal.NoSuchCompanyException: No Company exists with the primary key 54444
at com.liferay.portal.service.persistence.CompanyPersistenceImpl.findByPrimaryKey(CompanyPersistenceImpl.java:436)
Hitoshi Ozawa
RE: user registration requires more fields
16 novembre 2011 14.38
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7949

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

ANY REASON YOU ARE POSTING THE SAME MESSAGE TWICE? I do hope that you have a very good answer for this!

Also, WHY ARE YOU CROSS-POSTING SEVERAL TIMES IN DIFFERENT THREADS?!
http://www.liferay.com/community/forums/-/message_boards/message/10422104

Caused by: javax.servlet.ServletException: com.liferay.portal.NoSuchCompanyException: No Company exists with the primary key 54444

From the error message, it seems you haven't created a company with id =54444
Sheryl Brewer
RE: user registration requires more fields
29 dicembre 2011 3.26
Risposta

Sheryl Brewer

Punteggio: New Member

Messaggi: 1

Data di Iscrizione: 29 dicembre 2011

Messaggi recenti

Interesting issue. I always was too lazy to fill all the blanks while registering.






PDF editor
Hitoshi Ozawa
RE: user registration requires more fields
31 dicembre 2011 3.46
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7949

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

Not all fields are required but some are. It's hard to distinguish necessary fields from Liferay's JavaDoc - I'm teaching some programmers on using
Liferay API's and this has been a most common problem.

BTW, users beinng added to the user_ database table and not appearing from in the Control Panel is probably because the user hasn't been added
to the index. Should reindex after user/group modification.