I would not recommend calling an import from a public url. What you better can do is create a separate application for CMSImport in app.config and modify trees.config so that cmsimport can be used in the new section and you have nothing else there.
And/or you can configure a Dashboard (see chapter 8 of the usermanual http://soetemansoftware.nl/cmsimport/downloads ) where people can only execute the imports you defined.Then people only see cmsimport but only after they logged in.
That is what I would recommend but if you really need to you can use the following code snippet (this is an internal API so can be changed in future releases)
Hope this answers your question for now.
usings
using CMSImportLibrary.Import;
using CMSImportLibrary.Helpers;
Code
var importId = Guid.NewGuid().ToString();
var state = Helpers.StateHelper.GetPersistedStateByWizardID(the id in the database here);
var importOptions = new ImportOptions { UserId = scheduledTask.RunTaskAs };
Calling import from code
Hi all,
I would need to call an import manually from code.
The answer in this topic in unfortunately out of date as the ExecuteImport(Guid importId) method is not longer in ImportHelper class. https://our.umbraco.org/projects/developer-tools/cmsimport/using-cmsimport/28928-Calling-an-import-definition-manually-from-code
Does anyone know if there another way to manually call an import function with the Id please?
Thanks a lot in advance.
Laura
Hi Laura,
I replied to your email this morning.
Hi Laura,
I would not recommend calling an import from a public url. What you better can do is create a separate application for CMSImport in app.config and modify trees.config so that cmsimport can be used in the new section and you have nothing else there.
And/or you can configure a Dashboard (see chapter 8 of the usermanual http://soetemansoftware.nl/cmsimport/downloads ) where people can only execute the imports you defined.Then people only see cmsimport but only after they logged in.
That is what I would recommend but if you really need to you can use the following code snippet (this is an internal API so can be changed in future releases)
Hope this answers your question for now.
usings
Code
Best,
Richard
is working on a reply...