leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Problem Loading a Pdf File

Ok, Yurii, thanks, and here's the information you requested:

  1. The user only read the database file and collection. There is no upload, create, or delete actions by the user.

  2. The file collection holds the actual pdf file and the file name assigned to it ( e.g. xxxxxxfffggggg-name1.pdf).

  3. 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:

  4. How to map the file name from the file collection directly to the UI

  5. How to use code to get the file name when a part of that name is provided, as in no 4 above.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Problem Loading a Pdf File

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:

  1. Open service Test tab.

  2. Click "Test"

  3. Result will appear.

  4. Click "Import as response"
    Details: http://prntscr.com/6ikuig/direct

    Then you can navigate to "response" tab and check response parameters.

    Regards.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Problem Loading a Pdf File

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Problem Loading a Pdf File

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:

  1. Add this field to this custom collection.

  2. Populate each item(on create or edit processing) with needed value(actual fileName)

  3. Use this field to populate goal list.

    Regard.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Problem Loading a Pdf File

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?

  1. 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?
  2. Or is there a way to automate inserting the filename value from the file collection into the new field?
  3. Is it possible to convert fields from the file collection into a collection?
Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Problem Loading a Pdf File

Hi Leonardo.

  1. It's not possible(out of the box) to search through files collection.

  2. 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.

  3. Not sure what you mean.

    Regards.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Problem Loading a Pdf File

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?

  1. I am at a loss here on how to do that in #2. Do you have screenshot examples? Thanks.
Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Problem Loading a Pdf File

Hi Leo,

May be you need files collection list?

If so please see following screen shots about service settings:

  1. Settings: http://prntscr.com/6qzoh4/direct

  2. Request: http://prntscr.com/6qzopj/direct

  3. Test: http://prntscr.com/6qzowi/direct

    Regards.

Return to “Issues”