Data Provider for UsersData Provider for Usershttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1137864832024-03-28T22:15:32Z2024-03-28T22:15:32ZRE: Data Provider for UsersALEX KEILhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1138621392019-06-03T09:56:41Z2019-06-03T09:56:41ZHi. That's the thing it's not a custom portlet.. although at this rate I may have too lol. I've just created a form directly off the page.. added a few text field and a list. Added a data adapter.. then used that data adapter on the list field. I can add screenshots if neededALEX KEIL2019-06-03T09:56:41ZRE: Data Provider for UsersOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1138617922019-06-03T09:52:00Z2019-06-03T09:52:00ZDoes this include that you're using this function as Administrator? Can you show code, e.g. some simplified reproducible excerpt from your portlet?Olaf Kock2019-06-03T09:52:00ZRE: Data Provider for UsersALEX KEILhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1138611712019-06-03T09:13:05Z2019-06-03T09:13:05ZHI Olaf<br />Thanks for that. That URL is where i was getting the information for when i was trying this.Ill try to clarify:<br /><br />When i use a URL like these:<br /><a href="http://localhost:8080/api/jsonws/country/get-countries/active/true">http://localhost:8080/api/jsonws/country/get-countries/active/true</a><br /><a href="http://localhost:8080/api/jsonws/country/get-countries/active/true"></a>i put that in the data-adapter setup, assign it to a list control in a form, then when i select it, the drop-down populates with the countries. It also works for Region<br />When i do the same with this<br /><a href="http://localhost:8080/api/jsonws/user/get-company-users/company-id/20099/start/1/end/10000%0A">http://localhost:8080/api/jsonws/user/get-company-users/company-id/20099/start/1/end/10000</a><br /><a href="http://localhost:8080/api/jsonws/user/get-company-users/company-id/20099/start/1/end/10000%0A"></a>, put that in the data-adapter setup, assign it to a list control in a form, but when i select the dropdown it says something like no results available.<br />If i invoke it directly from the localhost:8080/api/jsonws page, it works. If i put the URL directly into a browser (including the p_auth parameter), it works. The only time it does not is when i use it in a select list (with the data adapter).<br />Hope that clears up my question <img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" ><br />Thanks so much for all your help thus far.ALEX KEIL2019-06-03T09:13:05ZRE: Data Provider for UsersOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1138607972019-06-03T08:20:33Z2019-06-03T08:20:33Z<div class="quote-title">ALEX KEIL:</div><blockquote><br />Can you elaborate on what you meant by check the API&amp;#39;s as an administrator?Those jsonws i have already been using to try to get the lists</blockquote><br /><br />Log in as administrator, then go to<br /><br />http://localhost:7180/api/jsonws?contextName=&amp;signature=%2Fuser%2Fget-company-users-3-long-int-int<br /><br />and fill in the companyId (get it from Control Panel / Virtual Instances) and the range. You&#39;ll see what kind if data you&#39;ll retrieve in that API browser.Olaf Kock2019-06-03T08:20:33ZRE: Data Provider for UsersALEX KEILhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1138596312019-06-03T05:32:57Z2019-06-03T05:32:57ZHi Olaf<br />Thanks for your reply <img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" >I get the security etc, its just in the form i'm creating users need to choose from a list of existing users already in the database.Can you elaborate on what you meant by check the API's as an administrator?Those jsonws i have already been using to try to get the lists <img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" >Thanks!ALEX KEIL2019-06-03T05:32:57ZRE: Data Provider for UsersOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1138574932019-06-02T10:08:00Z2019-06-02T10:08:00Z<div class="quote-title">ALEX KEIL:</div><blockquote><br />Thanks for that.. that is what I was using to get the URLs and parameters that I've been testing with. It works for country but doesn't work for users.. that's the main issue I'm having.<br /></blockquote>You probably don't want to expose all your users' data to many people, thus access to user data is very strictly permissioned to those few people (or roles) who can edit the user's data. I'm assuming that this is the main problem you're running into. Instead of providing the permission to view user data to more people (which might look like a quick fix), check the (mentioned above) web api for jsonws as an Administrator and see what kind of data is associated with a user: You don't want that in everybody's hand.<br />You should rather write your own custom service that exposes the subset of the user's fields that you care for. But note: These days even exposure of the email address isn't really something that you'd like to risk.Olaf Kock2019-06-02T10:08:00ZRE: Data Provider for UsersALEX KEILhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1138571162019-06-02T06:29:01Z2019-06-02T06:29:01ZHi David<br />Thanks for that.. that is what I was using to get the URLs and parameters that I've been testing with. It works for country but doesn't work for users.. that's the main issue I'm having.<br />ThanksALEX KEIL2019-06-02T06:29:01ZRE: Data Provider for UsersDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1138568002019-06-02T06:22:09Z2019-06-02T06:22:09ZForgive me if you know this, but have you tried just surfing the /api/jsonws itself?<br /><br />It's a web-based UI where you can find registered services and see what the parameters are and fill them in, etc. It basically allows you to try everything out until you find the right service, method and parameters that returns the data you need, plus it can eliminate the guesswork you're trying to do right now...David H Nebinger2019-06-02T06:22:09ZRE: Data Provider for UsersALEX KEILhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1137987702019-06-01T22:29:22Z2019-06-01T22:29:22Zsorry.. i re-wrote that a few times and left off the actual question!I did some more testing but still can't get it.. my issue seems to be two fold. What i am trying to do is get a list of users in a drop-down in a form, so people can choose from that while entering data into the form.<br />1/ can't seem to get parameters to work.. <br />for example if i put this URL in:<a href="http://localhost:8080/api/jsonws/country/get-countries/active/True">http://localhost:8080/api/jsonws/country/get-countries/active/True</a><br />inputs : none<br />outputs : $..companyId<br />type: list<br />then use that data provider in the drop-down, it will list the countries<br />If i use this URL<br /><a href="http://localhost:8080/api/jsonws/country/get-countries/active/True">http://localhost:8080/api/jsonws/country/get-countries/active/</a>{true}<br />inputs : label = active, paramter = true, type = text <br />then use that data provider in the drop-down, it just shows 'no results were found'<br /><br />2/ What i really need to use is a list of users.. i tried the following:<br /><a href="http://localhost:8080/api/jsonws/contact/get-company-contacts/company-id/20099/start/1/end/100">http://localhost:8080/api/jsonws/contact/get-company-contacts/company-id/20099/start/1/end/100<br /></a>with no inputs<br /><a href="http://localhost:8080/api/jsonws/contact/get-company-contacts/company-id/20099/start/1/end/100">http://localhost:8080/api/jsonws/contact/get-company-contacts/company-id/{companyId}/start/{start}/end/{</a>end}<br />with inputs filled in<br /><a href="http://localhost:8080/api/jsonws/user/get-company-users?companyId=20099&start=1&end=10000">http://localhost:8080/api/jsonws/user/get-company-users?companyId=20099&start=1&end=10000<br /></a>with no inputs<br /><a href="http://localhost:8080/api/jsonws/user/get-company-users?companyId=20099&start=1&end=10000">http://localhost:8080/api/jsonws/user/get-company-users?companyId={companyId}&start={start}&end={</a>end}<br />with inputs filled in<br /><a href="http://localhost:8080/api/jsonws/user/get-company-users?companyId=20099&start=1&end=10000">http://localhost:8080/api/jsonws/user/get-company-users?{companyId}&{start}&{</a>end}<br />with inputs filled in<br />each time it comes up with 'no results found'I thought it might be security related, in API authentication settings i found 'System Default SAP Entry <br />signatures'<br />com.liferay.portal.kernel.service.CountryService#getCountries <br />com.liferay.portal.kernel.service.RegionService#getRegions<br />so i added <br />com.liferay.portal.kernel.service.UserService<br />com.liferay.portal.kernel.service.CompanyService<br />onto the end, and even removed them all and just put '*' but still didnt work. <br />Documentation says its for external service only but thought it was worth a try.<br />So my question is.. what needs to be done to get a list of users please.ALEX KEIL2019-06-01T22:29:22ZRE: Data Provider for UsersDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1137870532019-06-01T14:59:18Z2019-06-01T14:59:18ZWhat's the question?<br /><br />I mean, if it is "why is the parameter required", well these are not like a normal REST sort of thing where you can browse up and down the chain.<br /><br />These are specific URLs that take known, required parameters to complete their task.David H Nebinger2019-06-01T14:59:18ZData Provider for UsersALEX KEILhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1137864822019-06-01T09:44:37Z2019-06-01T09:44:37ZHello, trying to setup a data provider to list all users in the site, running into issues, so did some testing with a link with less paramters needed.<br /><a href="http://localhost:8080/api/jsonws/country/get-countries?">http://localhost:8080/api/jsonws/country/get-countries?</a> (<br />so if i put in this url:a<br /><a href="http://localhost:8080/api/jsonws/country/get-countries?">http://localhost:8080/api/jsonws/country/get-countries?</a><br /><a href="http://localhost:8080/api/jsonws/country/get-countries?"></a>and nothing in the inputs section, it works a treat.<br />according to the documentation (and testing) this is valid<a href="http://localhost:8080/api/jsonws/country/get-country-by-name/name/Australia?">http://localhost:8080/api/jsonws/country/get-country-by-name/name/Australia?</a>p_auth=<your key><br />so in the data adapter i use this URL<a href="http://localhost:8080/api/jsonws/country/get-country-by-name/name/Australia?">http://localhost:8080/api/jsonws/country/get-country-by-name/name/?</a><br />and nothing in the inputs section, i get the following in the console (as you would expect)<br />2019-06-01 11:08:31.950 ERROR [http-nio-8080-exec-7][JSONWebServiceServiceAction:116] Missing value for parameter name<br />You get the same if you browse too<br /><a href="http://localhost:8080/api/jsonws/country/get-country-by-name/name/Australia?">http://localhost:8080/api/jsonws/country/get-country-by-name/name/?</a>p_auth=<your key><br />so t