Fórum

Override PortalLDAPImporterImpl using EXT plugin

Kan Kon, modificado 12 Anos atrás.

Override PortalLDAPImporterImpl using EXT plugin

New Member Postagens: 23 Data de Entrada: 13/09/11 Postagens Recentes
All,
Looking to override PortalLDAPImporterImpl using IDE's ext plugin. Created ext-spring.xml as following and created corresponding class file (com.home.portal.security.ldap.CustomPortalLDAPImporterImpl). Deployed successfully but it does not seem to take effect. I have tried using "ant deploy" and "ant direct-deploy". In both cases it did not work. Any clues? Thanks

<!--?xml version="1.0" encoding="UTF-8"?-->

<beans default-destroy-method="destroy" default-init-method="afterPropertiesSet" xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    <bean id="com.liferay.portal.security.ldap.PortalLDAPImporterUtil" class="com.liferay.portal.security.ldap.PortalLDAPImporterUtil">
        <property name="portalLDAPImporter">
            <bean class="com.home.portal.security.ldap.CustomPortalLDAPImporterImpl">
                <property name="LDAPToPortalConverter" ref="ldapToPortalConverter" />
            </bean>
        </property>
    </bean>
</beans>
thumbnail
Kamesh Sampath, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Regular Member Postagens: 158 Data de Entrada: 27/05/10 Postagens Recentes
did you check if the ext is placed in the right location ?

Usually Spring container looks for the bean files in META-INF folders of jars/wars or classpath or WEB-INF .
Kan Kon, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

New Member Postagens: 23 Data de Entrada: 13/09/11 Postagens Recentes
I believe I did as I have created files under ext-impl directory from IDE. Have you tried overriding the Impl before? If yes, would mind sharing a sample?
Kan Kon, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

New Member Postagens: 23 Data de Entrada: 13/09/11 Postagens Recentes
The ext-spring.xml is created at docroot/WEB-INF/ext-impl/src/META-INF/ext-spring.xml
thumbnail
Samir Gami, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Regular Member Postagens: 162 Data de Entrada: 04/02/11 Postagens Recentes
Below are the steps to override serviceImpl classes,

• First, create your own class com.test.security.ldap.CustomPortalLDAPImporterImpl
• Extends it with class (com.liferay.portal.security.ldap.PortalLDAPImporterImpl)
• Override only those methods in which you want to make modification,
• Create ext-spring.xml in your ext plugins at plugins/ext/<custom-ext-plugin>/docroot/WEB-INF/ext-impl/src/META-INF
• Find relevant spring bean entry from portal-spring.xml and change the class entry of that spring bean in ext-spring.xml,
• Deploy your ext plugin, make sure it deploy properly,

Hope this may helps,

Thanks & Regards,
Samir Gami
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi

i followed ur steps. but i couldn't find portal-spring.xml file.
can u tell me where i get this. i am trying to change "PortalLDAPImporterImpl" class
i am in urgent of doing this.. could u pls help me

Thanks
Regards
Udaya
thumbnail
Anil Sunkari, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Expert Postagens: 427 Data de Entrada: 12/08/09 Postagens Recentes
Hi Uday,

If you have portal-source with you then you can find it in portal-impl/src/META-INF.If not you can get it from portal-impl.jar file in your server side.

Regards,
Anil Sunkari
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi
Thank u for ur reply. i found the file but i couldn't get the bean id for "PortalLDAPImporterImpl" class.
in that file i have to search using this class name rite?
thumbnail
Samir Gami, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Regular Member Postagens: 162 Data de Entrada: 04/02/11 Postagens Recentes
its defined in ldap-spring.xml
portal-impl/src/META-INF/ldap-spring.xml
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi Samir,

thank u so much. i got it and created my ext-spring.xml.
But my ext doesn't have no effect. it doesn.t show any changes to my portal.
Let me tell in steps what i did.

!. created custom class com.liferay.portal.security.ldap.UpdateAttribues
2. Extend my class from PortalLDAPImporterImpl
3. written my custom function updateUser()
4. Created ext-spring.xml with the folllowing content:
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" default-init-method="afterPropertiesSet" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

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


5. then i deployed it. it ran successfully in 11 sec.
but i couldn;t find the change i made in my fuction



Can u help me in this?

Regards
Udaya
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi,
my custom EXT got executed. but when i deployed the war file into another machine and placed the jar file in WEB-INF/lib/.
it is not executed. Anything i am missing while deploying the war file.

Procedure i did:
1. Took the war file and deployed in another instance.
2. Placed the jar files in WEB-INF/lib/
3. Restarted the server.



Thanks
Udaya
thumbnail
Anil Sunkari, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Expert Postagens: 427 Data de Entrada: 12/08/09 Postagens Recentes
Is that giving any exception (or) message ... && what are those jar files you kept in WEB-INF/lib??
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi

i placed ext-impl.jar into the WEB-INF/lib folder.


Regards
Udaya
thumbnail
Kaleem Mohammed, modificado 11 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

New Member Postagens: 7 Data de Entrada: 04/04/12 Postagens Recentes
Samir Gami:
Below are the steps to override serviceImpl classes,

• First, create your own class com.test.security.ldap.CustomPortalLDAPImporterImpl
• Extends it with class (com.liferay.portal.security.ldap.PortalLDAPImporterImpl)
• Override only those methods in which you want to make modification,
• Create ext-spring.xml in your ext plugins at plugins/ext/<custom-ext-plugin>/docroot/WEB-INF/ext-impl/src/META-INF
• Find relevant spring bean entry from portal-spring.xml and change the class entry of that spring bean in ext-spring.xml,
• Deploy your ext plugin, make sure it deploy properly,

Hope this may helps,

Thanks & Regards,
Samir Gami



Hi Samir,

I am looking to override ldap import action. Currently working on liferay 6.1 version.

Able to map basic ldap user attributes to liferay user fields. (like firstName, lastName, screenName, email, jobTitle )

Now, am looking to map LDAP phone and address to Liferay's existing phone and address fields.

Could you please guide me in doing this?

Can it be done using Hooks or I should work on EXT to implement this ? Any simple solution is highly appreciated.


Regards
Kaleem
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi Kamesh,

i am new to Liferay. can u tell me the stepwise procedure in creating an EXT. i need to modify the class "PortalLDAPImporterImpl".
ur help would be very useful for me to proceed.
Thank you
Regards,
Udaya.R
thumbnail
Anil Sunkari, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Expert Postagens: 427 Data de Entrada: 12/08/09 Postagens Recentes
Hi Uday,

Which version of LR you are using.So that accordingly we can guide you.

Regards,
Anil Sunkari
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi

i am using liferay 6.0.6


Regards
Udaya.R
thumbnail
Anil Sunkari, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Expert Postagens: 427 Data de Entrada: 12/08/09 Postagens Recentes
ok, so primarily
i) You have to create an ext plugin.
ii) later you have to extend PortalLDAPImporterImpl as you mentioned by follwing the rules on how to extend.

For reference : Click Here

Still you required any clarification.Let me know!

Regards,
Anil Sunkari
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi Anil,
i underwent a problem while creating EXT.
i override a class file under ext-services and the code working fine in the eclipse instance.
for deploying into another instance i ave to move the jar file rite,
but this ext-services does not create any jar files under "WEB-INF/lib/"
so, in order to deploy to another instance what i have t do?
ur help is much more useful for me, as i am having very short time

Thanks
regards
Udaya.R