Page 3 of 3
Problem Loading a Pdf File
Posted: Wed Mar 18, 2015 6:02 am
by leonardo
Ok, Yurii, thanks, and here's the information you requested:
The user only read the database file and collection. There is no upload, create, or delete actions by the user.
The file collection holds the actual pdf file and the file name assigned to it ( e.g. xxxxxxfffggggg-name1.pdf).
The database also has some collections that hold specific information about each pdf file in the file collection (e.g. "Name1.pdf", which is part of the assigned Id or file name of the pdf file).
4 Information from the collection is used in the UI. When an item is clicked, its name is used to find the file in the file collection, where part of that name contains the name of the item clicked.
I hope that is clearer.
In this app I have a need for 2 methods to get the desired file name in the file collection:
How to map the file name from the file collection directly to the UI
How to use code to get the file name when a part of that name is provided, as in no 4 above.
Problem Loading a Pdf File
Posted: Thu Mar 19, 2015 4:16 am
by Yurii Orishchuk
Hi Leonardo,
Okay, so you have just one service(files list service).
In this case you have incorrect service "response" parameters.
Should be like on screen shot:
Details: http://prntscr.com/6iktzn/direct
You can set it manually like on screen shot or make it automatically:
Open service Test tab.
Click "Test"
Result will appear.
Click "Import as response"
Details: http://prntscr.com/6ikuig/direct
Then you can navigate to "response" tab and check response parameters.
Regards.
Problem Loading a Pdf File
Posted: Fri Mar 20, 2015 3:59 am
by leonardo
Thanks, Yurii. But I have 2 services for the page.
The first service is used to show the contents from a collection in the database
This second service is used, as you already know, to show the file name for each item. I know it's close, but not working yet when the 2 services are combined.
Problem Loading a Pdf File
Posted: Mon Mar 23, 2015 4:57 am
by Yurii Orishchuk
Hi Leo,
You don't need two services.
But you should have "fileName" field in this custom collection.
If you have not this field you should:
Add this field to this custom collection.
Populate each item(on create or edit processing) with needed value(actual fileName)
Use this field to populate goal list.
Regard.
Problem Loading a Pdf File
Posted: Tue Mar 24, 2015 3:11 am
by leonardo
Hi Yurii,
Looks like am going in circles here. I thought with the mapping example you gave it would be fairly easy to combine the 2 services on a page.
I have hundreds of these pdf files. It would be very tedious to enter them in the field one by one. Is this the only way to do this?
- Is it not possible to perform a search on the file collection for the nearest match and use the result? For example, if the pdf clicked on the UI is "2000-9", can't Appery.io search for the pdfname in the file collection for any file name with "2000-9"? Can you give an example on nor to do that?
- Or is there a way to automate inserting the filename value from the file collection into the new field?
- Is it possible to convert fields from the file collection into a collection?
Problem Loading a Pdf File
Posted: Fri Mar 27, 2015 12:40 am
by Yurii Orishchuk
Hi Leonardo.
It's not possible(out of the box) to search through files collection.
Yes you can automate it with your collection "create" service.
2.1 on fileupload service success event - invoke this collection "create" service and pass just received filename and maybe other values you need.
Not sure what you mean.
Regards.
Problem Loading a Pdf File
Posted: Mon Apr 06, 2015 11:03 pm
by leonardo
By 3. I mean, can I capture all the id or filename field and export as json or CVS instead of capturing the whole database?
- I am at a loss here on how to do that in #2. Do you have screenshot examples? Thanks.
Problem Loading a Pdf File
Posted: Wed Apr 08, 2015 1:26 am
by Yurii Orishchuk
Hi Leo,
May be you need files collection list?
If so please see following screen shots about service settings:
Settings: http://prntscr.com/6qzoh4/direct
Request: http://prntscr.com/6qzopj/direct
Test: http://prntscr.com/6qzowi/direct
Regards.