I want to provide user search facilty in my chat server so that other user can search user based on some their interest, locations etc. Is there is some way to implement such feature… and can we search user by name or id ? .
I see this plugin and I also found getSearchFields() method in UserProvider interface which can be used for defining fields on which we can do search and findUsers method for searching users.
we can implement these methods according to our need in our UserProvider implimentation.
I want to extend OFUser tables fields for gender,phone number, and other custom profile, and want to search users based on these new fields,
could any body please help me on this issue.
Also using UserSearchManager I could only search users by Username, and search user based on Name causes Uncaught exception: Field not found for the specified variable name.
actually I want to store more information from xmpp clients, as I mentioned above, and want these parameters be searchable to find specific user, something like what is provided in online social nets,
As I know, VCard is designed to hold extra info, but using this structure causes huge load for every search, also I see VCard2OFUser plugin but this plugin also has the same problem of resource usage, I faced two solutions listed bellow:
1-As you said, create another table to hold VCard fields (eg. gender,education,city, etc) and write an openfire plugin to update this table on every vcard update per user. Also write another plugin to provide usersearch based on OpenFire native search plugin, that enables Smack clients to query server for results.
2-Migrate to LDAP solution, and write a web-based form to update LDAP profile items from the clients (something like webview in android client), and use current search plugin to search users based on custom fields.
which one do you advise? and if you have better soltio please explain.
I’m really new to openfire plugin development, and find resources bellow:
I reach a final solution, please read it and confirm if its possible,extendible and simple also,
These are the steps I’m going to take:
*in the server side:
1-create a table OFUserProfile to hold custom user profile data (UID,Name,PhoneNumber,City,Gender,etc)
2-Write an Openfire plugin to move all VCard Data to theire related field in newlly creaded table (OFUserProfile)
2-Write an Openfire plugin to Update or Insert profile data whenever a User VCard in OFUser table updated/inserted.
3-Write a Customized Version of Openfire search plugin to search users based on any specified field of OFUserProfile Table and return user JID or list of user JID s.
**in the Client side,
1- Use the native vcard update methods of smack to update user profile info
2- User the native search plugin to search users based on specific profile field
Is is OK, and easy to implement?
Please Help which type of plugins is suited for each of the above plugins to clone for further development.
I’d start with ‘2- User the native search plugin to search users based on specific profile field’ and ‘3-Write a Customized Version of Openfire search plugin to search users based on any specified field of OFUserProfile Table and return user JID or list of user JID s’ to make sure that searching for other vCard fields work for the client. I’m not sure whether this is implemented in Spark. This seems to be the critical part.
Creating and updating the new table is easy and can be done later. The vCard2ofUser plugin should be a good starting point and easy to extend.