Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Frantisek Simon
How to override Liferay core PortalLDAPImporterImpl class
February 14, 2013 8:08 AM
Answer

Frantisek Simon

Rank: New Member

Posts: 5

Join Date: February 7, 2013

Recent Posts

Hello,

I have problem to import users from LDAP to Liferay. I need to debug / change function of Liferay core class PortalLDAPImporterImpl.

Can somebody please post exact way how to override this class with use of SDK plugins / ext ? (directory structure, xml files, java class file - empty skeleton just to know where to put class).

I tried many combinations but still I am not able to override this class.

Thank you very much.
Hitoshi Ozawa
RE: How to override Liferay core PortalLDAPImporterImpl class
February 14, 2013 1:20 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

PortalLDAPImporterImpl.java is in \portal-impl\src\com\liferay\portal\security\ldap
Just override this class in your ext plugin.
Frantisek Simon
RE: How to override Liferay core PortalLDAPImporterImpl class
February 14, 2013 11:30 PM
Answer

Frantisek Simon

Rank: New Member

Posts: 5

Join Date: February 7, 2013

Recent Posts

Hello,

I know where is original class. I put my class on plugins path:
1plugins\ext\%name-of-plugin%\docroot\WEB-INF\ext-impl\src\com\liferay\portal\security\ldap


I run ant deploy for this plugin and restart tomcat. Its still use original class.

Any help would be great.
Frantisek Simon
RE: How to override Liferay core PortalLDAPImporterImpl class
February 21, 2013 12:03 AM
Answer

Frantisek Simon

Rank: New Member

Posts: 5

Join Date: February 7, 2013

Recent Posts

Nobody knows how to override core Liferay class or where should be a problem?
Jitendra Rajput
RE: How to override Liferay core PortalLDAPImporterImpl class
February 21, 2013 3:17 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 748

Join Date: January 7, 2011

Recent Posts

Override using ext-plugin.

1) Create ext-spring.xml inside ext-impl\src\META-INF\
2) Add below bean entry inside ext-spring.xml

1<bean id="com.liferay.portal.security.ldap.PortalLDAPImporterUtil" class="com.liferay.portal.security.ldap.PortalLDAPImporterUtil">
2        <property name="portalLDAPImporter">
3            <bean class="com.my.portal.security.ldap.CustomPortalLDAPImporterImpl">
4                <property name="LDAPToPortalConverter" ref="ldapToPortalConverter" />
5            </bean>
6        </property>
7</bean>



Create your CustomPortalLDAPImporterImpl and override original class.