-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: JSON structure for recursive file searching #315
Comments
It's outlined in the Wiki (check "response example"): https://github.com/servocoder/RichFilemanager/wiki/API#get-seekfolder |
Thanks for the link! Is there's someway to display folder name along with the file names? If there are copies of a folder then searching recursively becomes less helpful as seen in this case: Could we add a folder field or do you have some suggestions? Also here is the JSON I'm generating from the connector. Does it look as expected? {"data":[{"id":"d/Step1ofTOC.png","type":"file","attributes":{"name":"Step1ofTOC.png","path":"d/Step1ofTOC.png","readable":1,"writable":1,"created":1524074639,"modified":1524074639,"size":802408,"extension":"png","timestamp":7081.5458344}},{"id":"d/step2.png","type":"file","attributes":{"name":"step2.png","path":"d/step2.png","readable":1,"writable":1,"created":1524074641,"modified":1524074641,"size":48820,"extension":"png","timestamp":7079.46785}},{"id":"d/Step2ofTOC.png","type":"file","attributes":{"name":"Step2ofTOC.png","path":"d/Step2ofTOC.png","readable":1,"writable":1,"created":1524074643,"modified":1524074643,"size":200595,"extension":"png","timestamp":7077.3498296}},{"id":"d/step3.png","type":"file","attributes":{"name":"step3.png","path":"d/step3.png","readable":1,"writable":1,"created":1524074645,"modified":1524074645,"size":79314,"extension":"png","timestamp":7075.0208004}},{"id":"d/Step3ofTOC.png","type":"file","attributes":{"name":"Step3ofTOC.png","path":"d/Step3ofTOC.png","readable":1,"writable":1,"created":1524074647,"modified":1524074647,"size":200595,"extension":"png","timestamp":7072.964784}},{"id":"d/step4.png","type":"file","attributes":{"name":"step4.png","path":"d/step4.png","readable":1,"writable":1,"created":1524074649,"modified":1524074649,"size":127988,"extension":"png","timestamp":7070.8707669999994}},{"id":"d/Step4ofTOC.png","type":"file","attributes":{"name":"Step4ofTOC.png","path":"d/Step4ofTOC.png","readable":1,"writable":1,"created":1524074651,"modified":1524074651,"size":176029,"extension":"png","timestamp":7068.8017412}},{"id":"d/step5.png","type":"file","attributes":{"name":"step5.png","path":"d/step5.png","readable":1,"writable":1,"created":1524074654,"modified":1524074654,"size":92869,"extension":"png","timestamp":7066.4697172}},{"id":"My folder/7255-dizzy-face.png","type":"file","attributes":{"name":"7255-dizzy-face.png","path":"My folder/7255-dizzy-face.png","readable":1,"writable":1,"created":1522104091,"modified":1522104091,"size":12332,"extension":"png","timestamp":1977629.1790007}},{"id":"d/png","type":"folder","attributes":{"name":"png","path":"C:/Code/richFileManager/API.NetCore/wwwroot/ContentLibrary/d/png","readable":1,"writable":1,"created":1524075605,"modified":1524075605,"timestamp":6114.7626850999995}}]} |
Full path in listview upon search is possible. This mostly relates to the template. Open <span data-bind="text: koItem.rdo.attributes.name"></span> And replace it with: <span data-bind="text: $root.searchModel.value() ? koItem.rdo.id : koItem.rdo.attributes.name"></span> You are able to modify output as you do in a regular JS code. For example, you can remove a leading slash as: The drawback is that |
I found responsiveness delay in items rendering while server-side search in case you modify path, like in my example. Fixed with the latest commit. Now use <span data-bind="text: $root.searchModel.isRendered() ? koItem.rdo.id : koItem.rdo.attributes.name"></span> |
Mostly. As you can see in the Wiki the "id" property string is prepended with a leading slash across all examples. I can't remember for sure if this is a key point, but it may potentially cause issues. On the other hand if all others API method return "id" property without leading slash and all RFM actions work good, you could leave it as is and watch how it will go. |
When you complete I would expect you provide a PR with features that currently missed in ASP.NET Core connector, like recursive search. Thanks for your efforts. |
Sorry for the delay, I've been away. In response to:
I had prototyped having a full path as pictured here. I'm simply using the koItem.rdo.attributes.Id field. FYI, I have added the first character slash as requested which is not in this picture. As an alternative solution, I was wondering if we could add a column in the template when recursive search is enabled. Something like:
Per the wiki, we don't have a variable FolderName, maybe something like something like this pseudo code:
For the connector, I will make a PR soon with a list of improvements. Thanks for your efforts as well. |
Do you mean to add a separate column to display folder name? Does this make any sense? Don't you satisfy with how the paths are represented at your screenshot?
Have just merged your PR. Thanks a lot! |
Some note on the current state of the connector for clarity.
|
<span data-bind="text: $root.searchModel.value() ? koItem.rdo.id : koItem.rdo.attributes.name"></span>
|
You are correct that this is not a large issue. However, this doesn't match how Window or Linux/Unix systems generally return data in a separate column when searching recursively. It might also be helpful to be able to sort by folder paths and then have the files display in alphabetical order. Linux/Unix (Please notice the 'Path' column): Windows (Please notice the 'Folder' column): IMHO, the Linux/Unix example with the 'Path' column is closest to what I believe we need. If we need another parameter returned from the .Net Core connector, I can take that task on, but I'm not sure about the other connectors. |
I see. You tend to implement new column to display the folder path as it's at your screens above. Well, this can make sense. I don't think this require any additional data from the connectors. We can split the For instance if the Then fetched path for new column: Does this match your vision? |
Yes, your understanding is correct and this will match with my version of the connector. Thanks! |
I use the following server-side connector (check one):
My familiarity with the project is as follows (check one):
Hello,
Could you please provide the format of the expected JSON file when performing a recursive search from the server? I can't seem to figure out what is expected.
Thanks!
The text was updated successfully, but these errors were encountered: