7 Replies Latest reply: Dec 1, 2010 8:37 AM by mstaszew RSS

    Retrieve uploaded document filename via REST API

    mstaszew

      Hi there, I thought that I had posted this question before, but can't seem to locate it. I apologize if this is a duplicate.

       

      I am trying to retrieve the filename of a binary document. The only thing that I see in the REST API documentation is getBinaryDocumentContent which does give me the filename, but has the undesired effect of returning the data too. Is there a method for retrieving the document filename without downloading the document's contents too?

       

      Thanks,

      Michael

        • Re: Retrieve uploaded document filename via REST API
          mstaszew

          I apologize for the bump, but this topic is rather important to me and I'm hoping that one of the Jive guys who visit the forum can chime in with a quick pointer or confirmation that it's not possible to retrieve a document's filename without retrieving the contents. From the looks of it in the documentation this isn't possible, but here's hoping that the documentation is missing a method.

           

          Thanks in advance.

            • Re: Retrieve uploaded document filename via REST API
              mstaszew

              Another rude bump/solicitation attempt hoping for some feedback.

               

              Thanks,

              Michael

                • Re: Retrieve uploaded document filename via REST API
                  Aaron Johnson

                  Doesn't look like it to me.

                   

                  AJ

                    • Re: Retrieve uploaded document filename via REST API
                      mstaszew

                      Thanks for the confirmaion. I was hoping that the REST documentation had an ommission or typo! Is there a formal procedure for logging enhancement requests? If so I'd like to log this as it's a fairly big deal for those who wish to surface the more useful features of Jive from within their application.

                       

                      Similar to this situation, it would be nice if attachments for a document or message could be retrieved such that the data was not present. I see this as a shortcoming in the REST methods that would be better implemented by adding one additional layer. For instance, document and attachment XML should contain everything that is currently present except for the actual base64 encoded data. There should be a new method introduced that returns the data from an ID. That allows the end user to have full access to a document's properties before committing to the delay required to download said document which could be large for larger documents.

                       

                      Thanks,

                      Michael

                        • Re: Retrieve uploaded document filename via REST API
                          Aaron Johnson

                          great question Michael. As part of the 5.0 release we're actually putting a bunch of engineering weight behind a first class web services layer that'll have long lived team working behind it.  Erskine is the product manager for the team / initiative, I'll leave it up to him to answer the question about getting stuff like this into the feature queue.

                           

                          Cheers,

                           

                          AJ

                          • Re: Retrieve uploaded document filename via REST API
                            Erskine Williams

                            Hey Michael,

                            Thanks for the input. Could you give me a bit more detail on what sort of client you're writing that needs access to this information? i.e. what is the use case? Also, which version(s) of the REST API's are you using?

                            Cheers,

                            Erskine

                              • Re: Retrieve uploaded document filename via REST API
                                mstaszew

                                A little background on our application and user community. We write an application for database programmers, DBAs, data analysts, etc. We have a LOT of users and a ton of useful information scattered among 3 or 4 websites, 2 Yahoo groups that we currently use for a message board, various documents in-house, etc. We are moving over to Jive to consolidate these resources and bring our users into a position to write documents for other users, blog posts, and share anything else that would be helpful for others. We also want to have a central place where users can search for help and information.

                                 

                                So, what I am doing is writing an interface that connects our application to Jive SBS. Some research suggests that if a user needs to leave the application that they use all day for work to find help they are less inclined to do so. As a first step we'd like to mimic some of the features present on our Jive community home page. This includes the ability to see popular discussions, start new ones, reply to existing ones, search for information in documents, blogs, or discussions. Create documents and view existing documents. Essentially it will be a watered down version of what they can do on the web, but keeps them in our application where they are more likely to use the vast resources available to them.

                                 

                                The REST implementation appears to be in decent shape now to provide much of that functionality, but document and attachment handling falls a little short on feature richness. For example, when using the web page to view a discussion I can see that there is an attachment. I can even see the attachment's filename. I can then click the attachment and choose to save the file to disk (or cancel) and the download proceeds. Similarly I can view documents and see the filename before downloading the document. This is great, but this is not available to those using REST. If I present the user with a list of documents I can show the document's title and who created it. When the user clicks the link to download the document at that time I should prompt them for a filename, but this is impossible if I don't know the filename associated with the document or even the document's filetype. I have to first download the entire document to get the filename. Attachments are no different. Currently the only way to get attachments for an object are to fetch all attachments at once using the getAttachmentsByDocumentID method. If a document has 3 attachments that are 20mb each the user will have to wait for 60mb of data to be downloaded before they can see any of the filenames. The user should be able to see the 3 filenames before any file contents have been downloaded and then they should be able to click 1 filename and download that single document. I don't see that this is possible now.

                                 

                                My proposal is to provide everything that you currently do when calling getAttachmentsByDocumentID, but exclude all attachment <data> nodes. Then, introduce another method that retrieves the binary content of an attachment by ID. Also, the document object XML should contain everything that it currently does in addition to everything provided in the BinaryBody object XML excluding the <data> nodes. The getBinaryDocumentContent method should then return a BinaryBody object that includes the <data> nodes. This approach allows full access to binary object properties without wasting resources and time by downloading unnecessary binary data until requested by the user.

                                 

                                Thanks,

                                Michael