Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Nisarg Parikh
Why Liferay does not allow blank space in screen name?
November 17, 2011 5:55 AM
Answer

Nisarg Parikh

Rank: Expert

Posts: 262

Join Date: December 30, 2009

Recent Posts

Hi Firends,

Is there any specific reason why Liferay does not allow space in screen name?

Thank you.

-Nisarg
Ravi Kumar Gupta
RE: Why Liferay does not allow blank space in screen name?
November 17, 2011 6:05 AM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1303

Join Date: June 23, 2009

Recent Posts

I guess its general or untold standard that screen names or user names or anything that can uniquely identify an entity does not have spaces.. emoticon
Suraj Bihari
RE: Why Liferay does not allow blank space in screen name?
November 17, 2011 7:41 AM
Answer

Suraj Bihari

Rank: Junior Member

Posts: 42

Join Date: May 20, 2011

Recent Posts

For community members looking for an answer, here's my 2 cents:

Currently it is possible to use screennames with spaces. In portal-ext.properties add:

users.screen.name.validator=com.liferay.portal.security.auth.LiberalScreenNameValidator

See this thread http://www.liferay.com/community/forums/-/message_boards/message/7760914

Good Luck!
Ravi Kumar Gupta
RE: Why Liferay does not allow blank space in screen name?
November 17, 2011 8:06 AM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1303

Join Date: June 23, 2009

Recent Posts

hmm.. you are right Suraj,

This class has one method which just checks if given screen name is null or not..
 1
 2public class LiberalScreenNameValidator extends DefaultScreenNameValidator {
 3
 4    public boolean validate(long companyId, String screenName) {
 5        if (Validator.isNull(screenName)) {
 6            return false;
 7        }
 8        else {
 9            return true;
10        }
11    }
12
13}


Thanks for Sharing... emoticon
Sandeep Nair
RE: Why Liferay does not allow blank space in screen name?
November 17, 2011 7:39 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1731

Join Date: November 5, 2008

Recent Posts

The reason is that Liferay uses screenname to construct friendly url of users public or private page. For example if screen name is test its http:/domain/web/test for public pages and http://domain//group/test for private pages.
Suraj Bihari
RE: Why Liferay does not allow blank space in screen name?
November 23, 2011 2:52 AM
Answer

Suraj Bihari

Rank: Junior Member

Posts: 42

Join Date: May 20, 2011

Recent Posts

Thanks Ravi,

Btw... for all Liferay Features to work you want to remove (special character like) space from the screenname emoticon

Best regards,
Suraj