Fórumok

Override PortalLDAPImporterImpl using EXT plugin

Kan Kon, módosítva 12 év-val korábban

Override PortalLDAPImporterImpl using EXT plugin

New Member Bejegyzések: 23 Csatlakozás dátuma: 2011.09.13. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Regular Member Bejegyzések: 158 Csatlakozás dátuma: 2010.05.27. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

New Member Bejegyzések: 23 Csatlakozás dátuma: 2011.09.13. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

New Member Bejegyzések: 23 Csatlakozás dátuma: 2011.09.13. Legújabb bejegyzések
The ext-spring.xml is created at docroot/WEB-INF/ext-impl/src/META-INF/ext-spring.xml
thumbnail
Samir Gami, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Regular Member Bejegyzések: 162 Csatlakozás dátuma: 2011.02.04. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Bejegyzések: 67 Csatlakozás dátuma: 2011.09.07. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Expert Bejegyzések: 427 Csatlakozás dátuma: 2009.08.12. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Bejegyzések: 67 Csatlakozás dátuma: 2011.09.07. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Regular Member Bejegyzések: 162 Csatlakozás dátuma: 2011.02.04. Legújabb bejegyzések
its defined in ldap-spring.xml
portal-impl/src/META-INF/ldap-spring.xml
thumbnail
Udaya Ramakrishnan, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Bejegyzések: 67 Csatlakozás dátuma: 2011.09.07. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Bejegyzések: 67 Csatlakozás dátuma: 2011.09.07. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Expert Bejegyzések: 427 Csatlakozás dátuma: 2009.08.12. Legújabb bejegyzések
Is that giving any exception (or) message ... && what are those jar files you kept in WEB-INF/lib??
thumbnail
Udaya Ramakrishnan, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Bejegyzések: 67 Csatlakozás dátuma: 2011.09.07. Legújabb bejegyzések
hi

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


Regards
Udaya
thumbnail
Kaleem Mohammed, módosítva 11 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

New Member Bejegyzések: 7 Csatlakozás dátuma: 2012.04.04. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Bejegyzések: 67 Csatlakozás dátuma: 2011.09.07. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Expert Bejegyzések: 427 Csatlakozás dátuma: 2009.08.12. Legújabb bejegyzések
Hi Uday,

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

Regards,
Anil Sunkari
thumbnail
Udaya Ramakrishnan, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Bejegyzések: 67 Csatlakozás dátuma: 2011.09.07. Legújabb bejegyzések
hi

i am using liferay 6.0.6


Regards
Udaya.R
thumbnail
Anil Sunkari, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Expert Bejegyzések: 427 Csatlakozás dátuma: 2009.08.12. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Override PortalLDAPImporterImpl using EXT plugin

Junior Member Bejegyzések: 67 Csatlakozás dátuma: 2011.09.07. Legújabb bejegyzések
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