Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
karthik N
Screen Name Uniqueness
September 7, 2011 11:55 PM
Answer

karthik N

Rank: Regular Member

Posts: 106

Join Date: June 30, 2011

Recent Posts

Hi,

Can we remove screen name uniqueness in liferay?
i would like to set only email address unique for me.


Regards,
Karthik N
Pranay R Patadiya
RE: Screen Name Uniqueness
September 8, 2011 12:42 AM
Answer

Pranay R Patadiya

Rank: Regular Member

Posts: 181

Join Date: February 22, 2010

Recent Posts

Hi Karthik,

The code for not duplicating User Screen name is written in UserLocalServiceImpl java file in LR Source.
In this class there is method validateScreenName.
The Code is in the above mentioned method is:
1
2User user = userPersistence.fetchByC_SN(companyId, screenName);
3
4        if (user != null) {
5            throw new DuplicateUserScreenNameException();
6        }


So, you need to extend this java file.

For you information there is one more thing, you can also change screen name validater file in property file.
1
2users.screen.name.validator=com.liferay.portal.security.auth.DefaultScreenNameValidator
3    #users.screen.name.validator=com.liferay.portal.security.auth.LiberalScreenNameValidator


Let me know if you want anything more.

Thanks,
Pranay
karthik N
RE: Screen Name Uniqueness
September 8, 2011 3:12 AM
Answer

karthik N

Rank: Regular Member

Posts: 106

Join Date: June 30, 2011

Recent Posts

Hi Pranay,
Screen name doesn't allow spaces, I need to import users from LDAP , My LDAP display name is mapped to liferay screen name,
suppose if i have spaces in Display name, users are not getting imported,
What i need to do is,
if the screen name have space means,my validation removes that space
How can i code this?
Is der any way to do this?


Thanks in advance


Karthik
Pranay R Patadiya
RE: Screen Name Uniqueness
September 8, 2011 4:59 AM
Answer

Pranay R Patadiya

Rank: Regular Member

Posts: 181

Join Date: February 22, 2010

Recent Posts

Hi,
As I have told you,
Use the below mentioned property:
1users.screen.name.validator=com.liferay.portal.security.auth.LiberalScreenNameValidator


And also if you need then extend Class UserLocalServiceImpl and validateScreenName method of that class.

Thanks,
Pranay
karthik N
RE: Screen Name Uniqueness
September 8, 2011 6:22 AM
Answer

karthik N

Rank: Regular Member

Posts: 106

Join Date: June 30, 2011

Recent Posts

Hi Pranay,

I have tried to implement this with hook to override the user service,But it will arise class not found exception.
In which way i have to explore this either Hook or Ext?

Im new person in to liferay..

Can u help me in this?


Thanks

Regards,
Karthik N
Pranay R Patadiya
RE: Screen Name Uniqueness
September 8, 2011 6:36 AM
Answer

Pranay R Patadiya

Rank: Regular Member

Posts: 181

Join Date: February 22, 2010

Recent Posts

Use ext for that.

Thanks,
Pranay
karthik N
RE: Screen Name Uniqueness
September 8, 2011 10:18 PM
Answer

karthik N

Rank: Regular Member

Posts: 106

Join Date: June 30, 2011

Recent Posts

Thanks Pranay,
I will try and let you Know.
Udaya Ramakrishnan
RE: Screen Name Uniqueness
September 8, 2011 11:26 PM
Answer

Udaya Ramakrishnan

Rank: Junior Member

Posts: 67

Join Date: September 6, 2011

Recent Posts

hi,

I am very new to Liferay. My requirement is i have to import users from LDAP into Liferay.
there i have to give my Full name( containing space) as Screen Name.
But in Liferay, for screen name it wont allow spaces.
is there any way to overcome from my problem.
here u have asked to use ext. is there any solution to override though hooks.
i need a solution soon.
pls give me a stepwise procedure in doing that.


Thank u in advance


regards
Udaya.R
Pranay R Patadiya
RE: Screen Name Uniqueness
September 8, 2011 11:38 PM
Answer

Pranay R Patadiya

Rank: Regular Member

Posts: 181

Join Date: February 22, 2010

Recent Posts

Plz, read above post.

Thanks,
Pranay
Chintan Akhani
RE: Screen Name Uniqueness
April 16, 2012 2:41 AM
Answer

Chintan Akhani

Rank: Regular Member

Posts: 111

Join Date: March 13, 2008

Recent Posts

Pranay R Patadiya:
Plz, read above post.

Thanks,
Pranay



Hew do we support character like 'ü' in screen Name?
Alberto Chaparro
RE: Screen Name Uniqueness
April 16, 2012 3:30 AM
Answer

Alberto Chaparro

LIFERAY STAFF

Rank: Regular Member

Posts: 100

Join Date: April 25, 2011

Recent Posts

Hi,

You can take a look at the following scheme in order to understand completely this process:
Screename Validation Wiki

I hope this helps you.

Regards.
Hitoshi Ozawa
RE: Screen Name Uniqueness
April 17, 2012 3:01 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Should have answered that people shouldn't be messing around with screen name. Making Liferay accept non-unique screen name and with spaces by modifying validation seems to work, but it may stop Liferay from working properly becauase some methods rely on returning only one screen name. These methods will not work properly when there are several non-unique screen names.
Just changing codes to force to do something is completely different from changing specification to make the system continue working properly. Should only change specification after completely understanding how Liferay works.