How to save project loaded in IDEEngine to DB?

Hello,
Currently I am using the IDEEngine to allow users to creating writing and saving projects.

But now I need to save the whole project to DB. By whole project I mean the name of the project and all its files (that is all the the form files and code files).

I am trying to use IDEEngine1.Files. But am not able to make any progress.

How to do this?

And how to load the whole project from DB in IDEEngine?

Regards,

Yogesh

Hi Yogesh,

There is a topic in the manual dedicated to that subject: 

http://www.tmssoftware.biz/business/scripter/doc/web/storingscriptsandprojectsi.html
http://www.tmssoftware.biz/business/scripter/doc/web/replacingsaveloadoperations.html
http://www.tmssoftware.biz/business/scripter/doc/web/replacingopensavedialogs.html
http://www.tmssoftware.biz/business/scripter/doc/web/checkingifafilenameisval.html
Hello Wagner,

I have read this topic and know about that. But here the case is different.

What happens is that generally the user will save the project to the hard disk normally while developing. But at times they will open a project from hard disk and would need a way to save the same (opened from hard drive) project to DB.

In this particular case I would need a way to enum all files associated with the open project and save the same to DB.

How to do this?

Then you will have to do it manually. IDEEngine1.Files should be the way to go. What are your issues with it?

Hello Wagne,


Ok my issues are:
1. How do I save a project created in Scripter (IDE) in DB when it contains Forms as well as modules?
2.
I can extract source code for modules using the SourceCode property but
how to get the content of forms in a format that I can store in DB?

On the other side pleas guide me as to how to load/recreate the whole project from DB.

Regards,

Yogesh

What I don't understand is why don't you use the events? If you call LoadProject/SaveProject, the proper events will be called even if the events are called separated for each file/form in the project, where to save it is up to you, you can save it to a memory stream, to a temp file, anywhere. 

Hello Wagner,

Thanks for your reply.


I cannot because I am allowing the user to create and save project to HDD.

They would want to add the project to DB only after they have completed its development and testing.because once the project is saved to DB it will be available to all the user in current network and they should be able to use it directly.at their end when using my software.

Regards,

Yogesh

Can't you just set a flag and your code in events behave accordingly? Either save to db, either save to file, depending on the settings. Or even setting/unsetting the event when you want to save to DB.

Hello Wagner,

Thanks for this brilliant idea. I will play with it and if I run in any trouble I will post on this thread.

Regards,

Yogesh
Hello,

If a project is already saved and then I call IDEEngine1.SaveProject

The IDEEngine1 only fires the OnSaveFile once with the file name and content of that Unit which is currently active in the IDE.

Is this behavior by design?

Regards,

Yogesh
Hello,

I also tried using DlgSaveAll but this also does not fire SaveFile event for Forms that are not modified when called. It does fire event for code files even if they are not modified.

Is there any other way to get SaveFile event to always fire?

Regards,

Yogesh

SaveProject just saves the project file (ssproj). You must call SaveFile for each file in project you want to save, for example:


For I := 0 to IDEEngine1.Files.Count - 1 do
  IDEEngine1.Files.Save;