How to mark report templates as deleted without deleting the templates permanently?



  • Hi sir,

    Our application is multi tenant application , each tenant have their own report templates .If client accidently delete any template it will permanently delete using jsreport odata api but how can i mark templates as deleted so that we can restore those templates if needed?.

    • Is it possible to add any flag like is_deleted in config file of report folder and while calling restore function is it possible query odata api using this custom flag ?

    that means query report folder with is_deleted flag is equal to true?

    • Is modifying the report folder config file with custom fields will affect report rendering performanace?

    • Is Modifiying config file with custom field is right approach?

    • Could you please suggest any solution?



  • There is no out-of-the-box solution for this.
    You could implement a custom extension for such soft deletes and restores, but that is quite some work to do.

    Perhaps you can deal with this at the database level.



  • sorry sir, i dont understand why did you told to implement custom extension ?

    • Also adding a flag is_deleted (ie,boolean variable which will mark tempates as deleted) in the config file of those temporarily deleted templates will cause any issue?

    • Also what do you mean by handling at the database level did you mean store like mongodb (where templates are stored)

    do you have any example for custom extension?



  • Also adding a flag is_deleted (ie,boolean variable which will mark tempates as deleted) in the config file of those temporarily deleted templates will cause any issue?

    I don't know how would you plan to do this exactly... I think it won't work in some simple way. However I don't know fully your scenario.

    Also what do you mean by handling at the database level did you mean store like mongodb (where templates are stored)

    Yes

    do you have any example for custom extension?

    As noted in the docs, everything is implemented as extensions in jsreport. Here are the sources
    https://github.com/jsreport/jsreport/tree/master/packages


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.