26-03-2014 12:31 PM
Hello,
Is it possible to start a web site generation with a script? We want a current status of repository every day. That's why that a script should start the generation over night.
It would be nice if somebody could help me.
Thank you
Solved! Go to Solution.
25-08-2014 12:22 PM
If you run ti as a bash script there is a background process mgwapp.exe opening and if you haven't close all other instances on the machine it won't run
Here is example of how you can open connection to the repository
Set oMegaApp = CreateObject ("Mega.Application")
Set oEnvironment = oMegaApp.Environments.Item(myEnvironment)
oEnvironment.CurrentAdministrator = myAdministrator
myEnv.CurrentPassword = myPassword
Set myDatabase = oEnvironment.Databases.Item(myDatabase)
Set oMegaRoot = myDatabase.Open
26-05-2014 03:53 PM
There is not any MegaApplication in background.
Here is the code which I use:
Resolution: Code examples This is the core of the code triggering the web site generation. Trigger web site generation (VB script): 'Get a web site oWebsite Set lWebSites = GetCollection("Web Site") Set oWebSite = lWebSites.Item(1) 'Generate the web site oWebsite oWebSite.GenerateWebSite() Display the list of root objects (VB script tested for MEGA 2005): 'Get a web site oWebsite Set lWebSites=GetCollection("Web Site") Set oWebSite = lWebSite.Item(1) 'Get the collection root objects of the web site oWebsite Set oWebSiteDescription = oWebSite.WebSiteDescription Set lWebSiteScope = oWebSiteDescription.GetRootObjects
but there have to be one or more steps before, that start the MegaApplication. Windows don't know this commands.
regards
26-05-2014 03:01 PM
By my experience so far:
1. The api is starting MegaApplication process in the background so if you have opened Mega it won't be able to start the process at all.
2. If you have another 'gost' or working Mega processes locking the database the script won't be able to open it
26-05-2014 02:55 PM
Hello,
thx for solutions.
Code of the solution: http://community.mega.com/t5/custom/page/page-id/mega-kb-solution?sid=50120000000mqRmAAI
starts to trigger the generation of Websites.
I think i need to start Mega in script before. How can I do that?
regards
23-05-2014 01:35 PM
The API manual mentions that the possibiltiies of vb are also available in java. I would say yes it is possible therefore
regards
22-05-2014 03:37 PM
Is there a possibilit to do it in Java?
26-03-2014 12:43 PM
Hello
You can built a script that can do this task and then add this script on the scheduler of Windows
For more information please see the solutions below:
- http://community.mega.com/t5/custom/page/page-id/mega-kb-solution?sid=50120000000mqRmAAI
- http://community.mega.com/t5/custom/page/page-id/mega-kb-solution?sid=50120000000mqz2AAA