playmaker420
playmaker420

Reputation: 1537

How to add/update Ldap server programatically in Liferay

I have a test server installed with liferay 6.2 g4 and it is configured with a LDAP server.The configuration was done through the portal-ext.properties file.As per my understanding configuration mentioned in the portal-ext.properties file are effective only during the initial setup. Any change in the Ldap configuration should done through the control panel.The control panel show the ldap servers in a list(search container).and we can select and edit the ldap server from control panel.

Now what im trying is like, i want to do this from a custom portlet.ie I want to list the ldap servers in my portlet and should be able update it. I have checked the PortalLDAPExporterUtil,PortalLDAPImporterUtil but that didnt help.

Can someone help me to find out which Liferay API should i look to achieve this.

Upvotes: 0

Views: 422

Answers (1)

playmaker420
playmaker420

Reputation: 1537

I got the answer from the liferay forum by their staff Jorge Díaz.

You can find the code where LDAP servers are stored at control panel at following files: edit_ldap_server.jsp: https://github.com/liferay/liferay-portal/blob/6.2.x/portal-web/docroot/html/portlet/portal_settings/edit_ldap_server.jsp EditLDAPServerAction: https://github.com/liferay/liferay-portal/blob/6.2.x/portal-impl/src/com/liferay/portlet/portalsettings/action/EditLDAPServerAction.java

At first JSP, edit_ldap_server.jsp the parameters are filed by final user and sent to EditLDAPServerAction. This second java only retrieves that information and stores it to preferences (method EditLDAPServerAction.addLDAPServer)

You cannot call this methods from a portlet, but perhaps you can copy and paste internal logic.

Orginal Answer:https://www.liferay.com/community/forums//message_boards/message/55597042

Upvotes: 0

Related Questions