#include <plugin_install/job_plugin_install.h>
#include <job_exception_base.h>
#include <plugin_install/plugin_objects.h>
+#include <installer_log.h>
using namespace WrtDB;
namespace Logic {
InstallerLogic::InstallerLogic() :
- m_NextHandle(0),m_job(0)
+ m_job(0),
+ m_NextHandle(0)
{}
InstallerLogic::~InstallerLogic()
void InstallerLogic::Initialize()
{
- LogDebug("Done");
+ _D("Done");
}
void InstallerLogic::Terminate()
if(m_job)
m_job->SetPaused(true);
- LogDebug("Done");
+ _D("Done");
}
Jobs::JobHandle InstallerLogic::AddAndStartJob()
// But each Job has different constructor, so creating new Job is specific
Jobs::JobHandle InstallerLogic::InstallWidget(
const std::string & widgetPath,
- const WidgetInstallationStruct &
+ const std::string & pkgId,
+ const Jobs::WidgetInstall::WidgetInstallationStruct &
installerStruct)
{
if(m_job)
{
- LogError("Job is in progress. It is impossible to add new job");
+ _E("Job is in progress. It is impossible to add new job");
return -1;
}
- LogDebug("New Widget Installation:");
-
- m_job =
- new Jobs::WidgetInstall::JobWidgetInstall(widgetPath, installerStruct);
+ _D("New Widget Installation:");
+ m_job = new Jobs::WidgetInstall::JobWidgetInstall(widgetPath, pkgId, installerStruct);
return AddAndStartJob();
}
{
if(m_job)
{
- LogError("Job is in progress. It is impossible to add new job");
+ _E("Job is in progress. It is impossible to add new job");
return -1;
}
- LogDebug("New Widget Uninstallation");
+ _D("New Widget Uninstallation");
m_job =
new Jobs::WidgetUninstall::JobWidgetUninstall(widgetPkgName,
{
if(m_job)
{
- LogError("Job is in progress. It is impossible to add new job");
+ _E("Job is in progress. It is impossible to add new job");
return -1;
}
- LogDebug("New Plugin Installation");
+ _D("New Plugin Installation");
// TODO Conversion to PluginPath is temporary
m_job =
return false;
} catch (Jobs::JobExceptionBase &exc) {
//start revert job
- LogDebug("Exception occured: " << exc.getParam() <<
- ". Reverting job...");
+ _D("Exception occured: %d. Reverting job...", exc.getParam());
bool hasAbortSteps = job->Abort();
job->SetAbortStarted(true);
job->SaveExceptionData(exc);
if (depHandle ==
Jobs::PluginInstall::JobPluginInstall::INVALID_HANDLE)
{
- LogError("Library implementing: " <<
- *requiredObject << " NOT FOUND");
+ _E("Library implementing: %s NOT FOUND", (*requiredObject).c_str());
//PluginDAO::SetPluginInstallationStatus(INSTALLATION_WAITING);
return false;