Page 1 of 1

TimeStamp Backup

PostPosted: Sun Jan 01, 2017 5:29 pm
by Zizi64
This extension created for the LibreOffice and OpenOffice enables the
user to make normal Save and to create a TimeStamped Backup copy of the
actual document at once.
The archiv file with a time stamped filename will placed into the
Backup directory given in the
Tools - Options - Open/LibreOffice - Paths
It is better to adjust the path of the Backup directory to a user
friendly place.

The extension has a menu item in the File menu, and a toolbar icon
in the Standard toolbar, and it works in the applications listed below:
Writer, WriterWeb, WriterMaster; Calc, Draw, Impress, Math applications.

You can download the latest (timeStampBackup_v1-1-8.oxt) version of this extension for LibreOffice
and for OpenOffice from these pages (updated):
https://extensions.libreoffice.org/exte ... amp-backup
http://flowcont.hu/LO_oxt_store/

This extension licenced under the GPL v3 licence.

timeStampBackup_v1-1-2.oxt
(53.59 KiB) Downloaded 263 times

 Edit: (There is a newer version on the extension site...)
See the latest version on the linked pages above or below in this topic. 

Re: TimeStamp Backup

PostPosted: Sun Jan 01, 2017 5:56 pm
by charlie.it
Ciao Zizi64, it's your job? My compliments to you.
I report a problem: you must have first saved the file normally?

Schermata 01-2457755 alle 16.51.49.png

Then, it does not exist for Base?

Re: TimeStamp Backup

PostPosted: Sun Jan 01, 2017 6:33 pm
by Zizi64
Thank you.
Yes, it is my job, but it is based on the structure of the extension MultiSave:
http://extensions.openoffice.org/en/project/multisave
and the extension MultiFormatSave:
http://extensions.openoffice.org/en/pro ... formatsave

And yes: you must save a new document first when you use this version of the extension. The extension works with documents that have URL.

The extension localised for three languages only: HU, EN, and DE
Sorry for my poor english, (and sorry for the german translation of the Google Translator;-) )
If you can fix (grammatically) my english and german (deutch) strings inside the extension, or if you can make the italian (and other language) strings, please help me.

I never used the Base application, therefere I have not created icons for the Base. But I suppose the StarBasic/API code can work with the Base too...
I will try to insert menu item and toolbar icon for the Base.

Re: TimeStamp Backup

PostPosted: Sun Jan 01, 2017 6:39 pm
by charlie.it
Some time ago I reported that this extension, also works with Base: https://forum.openoffice.org/en/forum/v ... 47&t=77024.

Re: TimeStamp Backup

PostPosted: Sun Jan 01, 2017 6:50 pm
by charlie.it
Ciao, here is the original extension in French and the translated extension in Italian (this one works with AOO. With LO it works, but there are not the icon in the bar):
Edit: Also here you must save a new document first when you use this version of the extension

Re: TimeStamp Backup

PostPosted: Sun Jan 01, 2017 7:04 pm
by Zizi64
I have published a version of my code in this forum in year 2015 (but it was created some years before):
https://forum.openoffice.org/en/forum/v ... y+#p362314
It is my first extension what i created. We used the code with manually associating to the menu items before. But my collegues have not experience in the associating procedure of the macro codes to a menu item or to a toolbar icon, therefore I tried to create an "easy to install" extension based on the code.

Unfortunatelly, I never found your extension on the non-english, non-hungarian web pages...)

As I see now your code is much larger than mine. Have your code some other functionalities?

Re: TimeStamp Backup

PostPosted: Sun Jan 01, 2017 7:16 pm
by charlie.it
The code in not mine, I have only traslate the text from French (with Google :oops: ). Than a volunteer/user in Italian forum has compiled it.
In the menu it allows you to make some settings, like choose the backup folder.
But yours is a great work too :super: :bravo: .

Re: TimeStamp Backup

PostPosted: Sun Jan 01, 2017 7:29 pm
by Zizi64
It would be nice if we had a similar feature embedded in the AOO/LO software package.

Re: TimeStamp Backup

PostPosted: Sun Jan 01, 2017 7:58 pm
by charlie.it
But then we would not know what to do ...

Re: TimeStamp Backup

PostPosted: Tue Jan 03, 2017 12:48 pm
by Zizi64
The version 1.1.4 contains HU, EN, DE, IT, ES, RU localisation. (The Google translator helped me. :oops: )

You can download the recent version from this webpage:
http://flowcont.hu/LO_oxt_store/

And I uploaded it here:
timeStampBackup_v1-1-4.oxt
(93.58 KiB) Downloaded 176 times

Re: TimeStamp Backup

PostPosted: Tue Jan 03, 2017 1:06 pm
by charlie.it
Great! :bravo:
(Now we expect integration with Base ;) )

Re: TimeStamp Backup

PostPosted: Tue Jan 03, 2017 1:54 pm
by Zizi64
I tried to integrate my extension to the Basic IDE. The icon, and the menu iten is appeared on the UI of the IDE, but - unfortunately - my code can NOT archive the Basic code of the active Module, or the active Directory. It can save the active (Calc, Writer, etc...) document only.
(I will examine the code of the extension linked by you for some "ideas"...)

I suppose it: the Base integration will cause some Problems for me.

Re: TimeStamp Backup

PostPosted: Fri Jun 16, 2017 10:21 pm
by john1320
Very useful. Why not add this extension to extensions.openoffice.org or post it on GitHub? )

Re: TimeStamp Backup

PostPosted: Sun Jun 18, 2017 2:04 pm
by Zizi64
My son (Kovács Levente) has uploaded the project onto GIThub:

https://github.com/kovleventer/timeStampBackup

Re: TimeStamp Backup

PostPosted: Tue Jun 20, 2017 10:17 am
by hubert lambert
Hello Tibor,

Thank you for this extension, that I just discover yesterday.
I've translated it to french. Hope all is fine.
In addition, I think there is no need anymore to reference the description files in the manifest, if you want to trim it a little ;).
Regards,
HL

 Edit: It seems to work fine with Base, provided that the BaseWindowState.xcu file is included and the module identifier com.sun.star.sdb.DatabaseDocument added in the mergecontext entries of Addons.xcu file. 

 Edit: Nope, sorry: this works on LibreOffice only. 

Re: TimeStamp Backup

PostPosted: Tue Jun 20, 2017 12:45 pm
by hubert lambert
Finally I found a solution to make your extension available from within Base.
There was two pitfalls :
- the identifier of the module is com.sun.star.sdb.OfficeDatabaseDocument instead of com.sun.star.sdb.DatabaseDocument
- there's no standardbar in Base, only a toolbar.
Hope this works this time.

Re: TimeStamp Backup

PostPosted: Tue Jun 20, 2017 12:46 pm
by Villeroy
I think it can not work with embedded Base. When you save a copy of the document only, the currently edited database will not be included. The database is written back into the document when the last reference is closed. Any kind of grid view, form, query keeps a reference, may be reports, import ranges, pivot tables too.

Re: TimeStamp Backup

PostPosted: Tue Jun 20, 2017 5:55 pm
by hubert lambert
The new save option is only available in the main base window, not in the subcomponents. Thus it should be safe.
On the other hand, the global variable ThisComponent seems to be sometimes inconsistent with Base. Maybe would it be better to use instead StarDesktop.CurrentComponent ?

Zizi64 wrote:And yes: you must save a new document first when you use this version of the extension. The extension works with documents that have URL.

One way to avoid this problem could be to use the uno:Save dispatch command (that will pop-up the save file picker if the document has no location):
Code: Select all   Expand viewCollapse view
   [...]
   oDoc = ThisComponent
   ' save
   oFrame = oDoc.CurrentController.Frame
   oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
   oDispatcher.executeDispatch(oFrame, ".uno:Save", "", 0, Array())
   ' backup
   sDocURL = oDoc.getURL()
   sBackupURL = CreateUnoService("com.sun.star.util.PathSettings").Backup & "/" & _
   GetFileNameWithoutExtension(sDocURL, "/") & _
   sTimeStamp() & "." & _
   GetFileNameExtension(sDocURL, "/")      
   oDoc.storeToURL(sBackupURL, array())

But first of all, thanks to Zizi64 for this extension!

Re: TimeStamp Backup

PostPosted: Sun Jun 25, 2017 6:50 pm
by Kovlev
The added French localization and Base support now forms the newest (1.1.5) version of TimeStampBackup (thanks for those contributions, I tried to give proper credit in git commit messages). The displayed file saving dialog on pathless files is not yet included, as it's inclusion is still in consideration.
So the new version can be obtained either from github, FlowCont .oxt store (links were posted above), and additionally, this attachment below.
 Edit: Thanks for approval! 

Re: TimeStamp Backup

PostPosted: Sun Jun 25, 2017 9:06 pm
by Zizi64
My son, Levente (Kovlev - https://forum.openoffice.org/en/forum/m ... le&u=62579) has updated the code on the github, and the directly downloadable .oxt file on the original place based on your ideas and code snippets:
http://www.flowcont.hu/LO_oxt_store/oxt ... v1-1-5.oxt

The 1.1.5 version of the extension contains the french language support and a limited support for Base. Special thanks to Hubert Lambert.

Unfortunatelly my son can not post into this forum. There is some problem with his authorization in this forum with his registration.

 Edit: He can post now. Thanks to thomasjk 

Re: TimeStamp Backup

PostPosted: Sun Jun 25, 2017 9:28 pm
by thomasjk
Zizi64. I just approved your son's post under Kovlev. Its now part of the discussion. All new users first post are reviewed and approved by a moderator to avoid spammers.

Re: TimeStamp Backup

PostPosted: Fri Jan 05, 2018 9:41 am
by Zizi64
Version 1.1.6: NL localisation added.


http://www.flowcont.hu/LO_oxt_store/oxt ... v1-1-6.oxt

Re: TimeStamp Backup

PostPosted: Mon Apr 02, 2018 6:51 pm
by GerhardW
Hi zizi64, kovlev,

here are better german and english texts:
Code: Select all   Expand viewCollapse view
MsgBox("The document does not yet have a URL (no valid file name and / or path) ." & Chr(10) & "The document will not be archived. Save your document first.",16,"Attention:")

MsgBox("Das Dokument hat noch keine URL (keinen gültigen Dateinamen und Pfad)." & Chr(10) & "Das Dokument wird nicht archiviert. Speichern Sie zuerst das Dokument.",16,"Achtung:")

But I suggest you consider the proposiion by Hubert Lambert. It has the great advantage that you do not need any language-dependent text, then.
Simply save the document using the dispatcher call if it has no URL or with stor, if it has one, saving the timstamp copy is then identical for both cases. Here is the code:
Code: Select all   Expand viewCollapse view
   If oDoc.hasLocation() then
      oDoc.store()
     else
      document   = ThisComponent.CurrentController.Frame
      dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
      dispatcher.executeDispatch(document, ".uno:Save", "", 0, Array())
   end if
   sDocURL = oDoc.getURL()
   sBackupURL = CreateUnoService("com.sun.star.util.PathSettings").Backup & "/" & _
   GetFileNameWithoutExtension(sDocURL, "/") & _
   sTimeStamp() & "." & _
   GetFileNameExtension(sDocURL, "/")      
   oDoc.storeToURL(sBackupURL, array())

You also have to add the decaration:
Code: Select all   Expand viewCollapse view
dim dispatcher as object, document as object


Gerhard

Re: TimeStamp Backup

PostPosted: Tue Apr 03, 2018 9:01 pm
by Kovlev
Hi

About the texts, those translations were updated recently by swhib on github (https://github.com/kovleventer/timeStampBackup/pull/4), which did include the pkg descriptions as well. (Just in case if you have planned to update those.)

The file saving dialog threw an error message when the user cancelled the initial file save dialog. With that fixed (a simple 'if' check to see if the document still not has a location) I see no reason not to include this patch. This new version is available now at http://flowcont.hu/LO_oxt_store/, github, and the newly created LO extensions page: https://extensions.libreoffice.org/extensions/timestamp-backup

Re: TimeStamp Backup

PostPosted: Thu Apr 05, 2018 12:26 am
by GerhardW
Hi kovlev,

I simply don't understand what the link https://github.com/kovleventer/timeStampBackup/pull/4 means. None of the entries does tell me anything.
I proposed a better german and english translation and a code (not my invention) that will make a translations unnecessary. Take it or leave it!
I will use your - or your father's - code with my changes, thanks for that.
I am working with LibreOffice, so perhaps this will be my last post here.

Gerhard

Re: TimeStamp Backup

PostPosted: Thu Apr 05, 2018 12:39 am
by Kovlev
Hi

Those entries are edited files with translations from another guy. But this is irrelevant in this case, since I did accept your proposed code (thanks for you and hubert lambert). With this update the current version number is 1.1.8, and this version does contain your edit (in case you don't want to modify the code everytime you reinstall this extension, you can use that).