留言板

How to override Liferay core PortalLDAPImporterImpl class

Frantisek Simon,修改在11 年前。

How to override Liferay core PortalLDAPImporterImpl class

New Member 帖子: 5 加入日期: 13-2-7 最近的帖子
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.
thumbnail
Hitoshi Ozawa,修改在11 年前。

RE: How to override Liferay core PortalLDAPImporterImpl class

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
PortalLDAPImporterImpl.java is in \portal-impl\src\com\liferay\portal\security\ldap
Just override this class in your ext plugin.
Frantisek Simon,修改在11 年前。

RE: How to override Liferay core PortalLDAPImporterImpl class

New Member 帖子: 5 加入日期: 13-2-7 最近的帖子
Hello,

I know where is original class. I put my class on plugins path:
plugins\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,修改在11 年前。

RE: How to override Liferay core PortalLDAPImporterImpl class

New Member 帖子: 5 加入日期: 13-2-7 最近的帖子
Nobody knows how to override core Liferay class or where should be a problem?
thumbnail
Jitendra Rajput,修改在11 年前。

RE: How to override Liferay core PortalLDAPImporterImpl class

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
Override using ext-plugin.

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

<bean id="com.liferay.portal.security.ldap.PortalLDAPImporterUtil" class="com.liferay.portal.security.ldap.PortalLDAPImporterUtil">
		<property name="portalLDAPImporter">
			<bean class="com.my.portal.security.ldap.CustomPortalLDAPImporterImpl">
				<property name="LDAPToPortalConverter" ref="ldapToPortalConverter" />
			</bean>
		</property>
</bean>



Create your CustomPortalLDAPImporterImpl and override original class.