3 Replies Latest reply on Jan 15, 2014 6:43 AM by jvillafanez

    Trash and untrash files

    jvillafanez

      Hi, Lev Waisberg Yuval Varkel

      We're having some issues implementing these features in the external storage. I've check the example that comes with the Jive SDK VM but it hasn't implemented these methods, so I'm not sure what the external storage should return. I've tried with an empty response and returning the external id of the file, but Jive only show "An unexpected error has occurred".

       

      We're using https://jivesoftware-own-cloud.doritosoftware.com/

       

      Is it possible to check the logs of the server to have an idea of what's going on in case of error?

       

      Thanks!

        • Re: Trash and untrash files

          You should return the ExStorageFileEntity which is the same type of object you return when uploading a new file.

            • Re: Re: Trash and untrash files
              jvillafanez

              Ok, I'm returning the same information when I upload a new file, when the file is trashed or untrashed:

               

              {"externalId":"d3f8bdb4-14fd-4df6-bd84-743247e2ff67",
               "version":{"externalId":"c3cbb1e3-9860-48fe-aafe-ff5dae4aa990",
                          "contentType":"image/png",
                          "fileName":"Audio_Cd.png",
                          "size":7322,
                          "resources":[
                                 {"name":"self","url":"/version/c3cbb1e3-9860-48fe-aafe-ff5dae4aa990","verbs":["GET","PUT","DELETE"]},
                                 {"name":"downloadVersion","url":"/binary/c3cbb1e3-9860-48fe-aafe-ff5dae4aa990","verbs":["GET"]},
                                 {"name":"fileParent","url":"/file/d3f8bdb4-14fd-4df6-bd84-743247e2ff67","verbs":["GET"]}]},
               "resources":[
                     {"name":"self","url":"/file/d3f8bdb4-14fd-4df6-bd84-743247e2ff67","verbs":["GET","PUT","DELETE"]},
                     {"name":"uploadVersion","url":"/file/d3f8bdb4-14fd-4df6-bd84-743247e2ff67","verbs":["POST"]},
                     {"name":"trashFile","url":"/trashFile/d3f8bdb4-14fd-4df6-bd84-743247e2ff67","verbs":["POST"]},
                     {"name":"untrashFile","url":"/untrashFile/d3f8bdb4-14fd-4df6-bd84-743247e2ff67","verbs":["POST"]}]
              

               

              I don't think I can return more information right now because I'm only storing the externalId, I would need to store the rest of the fields if they're needed. I was expecting that Jive would take care of missing fields by keeping their old value.

               

              What's bothering me is that sometimes work and others not. If I upload a file and immediately after I delete it, it works; If I upload a file, access to it through group content and delete it, it seems to fail. The request to server is made and a similar response as the one above is sent back, but the file is still shown and in the admin console the file is still in "published" state. It's like Jive is ignoring the deletion, although the file is trashed in the external storage.

               

              Any idea?

              1 person found this helpful