掲示板

user registration requires more fields

12年前 に Arvind Patil によって更新されました。

user registration requires more fields

New Member 投稿: 10 参加年月日: 11/10/26 最新の投稿
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
thumbnail
12年前 に Rojalin Patri によって更新されました。

RE: user registration requires more fields

Expert 投稿: 287 参加年月日: 11/03/22 最新の投稿
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
thumbnail
12年前 に Hitoshi Ozawa によって更新されました。

RE: user registration requires more fields

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
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
12年前 に Arvind Patil によって更新されました。

RE: user registration requires more fields

New Member 投稿: 10 参加年月日: 11/10/26 最新の投稿
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)
thumbnail
12年前 に Hitoshi Ozawa によって更新されました。

RE: user registration requires more fields

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
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
12年前 に Sheryl Brewer によって更新されました。

RE: user registration requires more fields

New Member 投稿: 1 参加年月日: 11/12/29 最新の投稿
Interesting issue. I always was too lazy to fill all the blanks while registering.






PDF editor
thumbnail
12年前 に Hitoshi Ozawa によって更新されました。

RE: user registration requires more fields

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
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.
12年前 に Arvind Patil によって更新されました。

RE: user registration requires more fields

New Member 投稿: 10 参加年月日: 11/10/26 最新の投稿
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)