namespace wgt {
namespace rds_parser {
+/**
+ * \brief Parse RDS config file
+ */
class RDSParser {
public:
+ /**
+ * \brief Explicit constructor
+ *
+ * \param path_to_delta path to directory
+ */
explicit RDSParser(const std::string& path_to_delta);
+ /**
+ * \brief Parse package xml
+ *
+ * \return true if parsing was successful
+ */
bool Parse();
+ /**
+ * \brief Accessor to vector of files to modify
+ *
+ * \return files to modify
+ */
const std::vector<std::string>& files_to_modify() const;
+
+ /**
+ * \brief Accessor to vector of files to add
+ *
+ * \return files to add
+ */
const std::vector<std::string>& files_to_add() const;
+
+ /**
+ * \brief Accessor to vector of files to delete
+ *
+ * \return files to delete
+ */
const std::vector<std::string>& files_to_delete() const;
private:
std::string path_to_delta_;
namespace wgt {
namespace security {
+/**
+ * \brief Step that add default privileges during installation
+ */
class StepAddDefaultPrivileges : public common_installer::Step {
public:
using Step::Step;
+ /**
+ * \brief Add default privileges
+ *
+ * \return Status::OK
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief Check requirements for this step
+ *
+ * \return Status::ERROR when rmanifest data are missing,
+ * Status::OK otherwise
+ */
Status precheck() override;
SCOPE_LOG_TAG(AddDefaultPrivileges)
namespace wgt {
namespace security {
+/**
+ * \brief Step that check privileges level for settings
+ */
class StepCheckSettingsLevel : public common_installer::Step {
public:
using Step::Step;
+ /**
+ * \brief Check privileges level for settings
+ *
+ * \return Status::ERROR when invalid privileges detected,
+ * Status::OK otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
SCOPE_LOG_TAG(CheckSettingsLevel)
namespace wgt {
namespace filesystem {
+/**
+ * \brief Step that create symbolic link to application
+ */
class StepCreateSymbolicLink : public common_installer::Step {
public:
using Step::Step;
+ /**
+ * \brief Create symbolic link
+ *
+ * \return Status::ERROR when failed to create symbolic link,
+ * Status::OK otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Delete created symbolic link
+ *
+ * \return Status::OK
+ */
Status undo() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
SCOPE_LOG_TAG(SymbolicLink)
namespace wgt {
namespace encrypt {
+/**
+ * \brief Step that encrypt application resources files if flagged to do so
+ */
class StepEncryptResources : public common_installer::Step {
public:
using Step::Step;
+ /**
+ * \brief Encrypt files
+ *
+ * \return Status::ERROR when error occurred during encryption,
+ * Status::OK otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief Check requirements for this step
+ *
+ * \return Status::ERROR when manifest data are missing,
+ * Status::INVALID_VALUE when requirements are not meet,
+ * Status::OK otherwise
+ */
Status precheck() override;
private:
namespace wgt {
namespace parse {
+/**
+ * \brief This step parse manifest.xml document
+ */
class StepParse : public common_installer::Step {
public:
+
+ /**
+ * \brief Explicit constructor
+ *
+ * \param context Installer context
+ * \param check_start_file Flag if start file should be validated
+ */
explicit StepParse(common_installer::InstallerContext* context,
bool check_start_file);
+ /**
+ * \brief
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
protected:
namespace wgt {
namespace parse {
/**
- * @brief The StepParseRecovery class
+ * \brief The StepParseRecovery class
* Retrievies package information from config.xml during RECOVERY.
*
* Step is used in recovery mode.
*/
class StepParseRecovery : public StepParse {
public:
+
+ /**
+ * \brief Explicit constructor
+ *
+ * \param context installer context
+ */
explicit StepParseRecovery(common_installer::InstallerContext* context);
+ /**
+ * \brief Parse config.xml
+ *
+ * \return Status::OK
+ */
Status process() override;
+
+ /**
+ * \brief Validate requirements for this step
+ *
+ * \return Status::ERROR when root path of packages is missing,
+ * Status::OK otherwise
+ */
Status precheck() override;
+
+ /**
+ * \brief Locate config.xml file
+ *
+ * \return true if config.xml is found
+ */
bool LocateConfigFile() override;
SCOPE_LOG_TAG(ParseRecovery)
namespace wgt {
namespace rds {
+/**
+ * \brief Step that apply RDS modification during reinstallation process
+ */
class StepRDSModify : public common_installer::Step {
public:
+
+ /**
+ * \brief Explicit constructor
+ *
+ * \param context Installer context
+ */
explicit StepRDSModify(common_installer::InstallerContext* context);
+
+ /**
+ * \brief
+ *
+ * \return
+ */
Status process() override;
+
+ /**
+ * \brief Remove files from temporary location
+ *
+ * \return Status::OK
+ */
Status clean() override;
+
+ /**
+ * \brief Restore files to the state from before RDS installation
+ *
+ * \return Status::OK
+ */
Status undo() override;
+
+ /**
+ * \brief
+ *
+ * \return Status::ERROR when manifest is missing, pkgid is missing,
+ * or when path to the unpacked directory is missing or not exist,
+ * Status::OK otherwise
+ */
Status precheck() override;
private:
namespace wgt {
namespace rds {
+/**
+ * \brief This step parse .rds_delta file
+ *
+ * This is to prepare RDS installation process
+ */
class StepRDSParse : public common_installer::Step {
public:
using Step::Step;
+ /**
+ * \brief Parse .rds_delta file
+ *
+ * \return Status::ERROR when wgt backend data are missing,
+ * Status::OK otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief Validate if .rds_delta file exist
+ *
+ * \return Status::Error if file not exist,
+ * Status::OK otherwise
+ */
Status precheck() override;
private:
namespace wgt {
namespace encrypt {
+/**
+ * This step remove encryption keys used for encryption during installation
+ *
+ * This step is called during uninstallation process
+ */
class StepRemoveEncryptionData : public common_installer::Step {
public:
using Step::Step;
+ /**
+ * \brief Remove encryption keys from database
+ *
+ * \return Status::ERROR in case of failure,
+ * Status::OK otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
SCOPE_LOG_TAG(RemoveEncryptionData)
public:
using StepCopyStorageDirectories::StepCopyStorageDirectories;
+ /**
+ * \brief Create shared and private directories,
+ * and copy/restore widget files to appropriate directory
+ *
+ * \return Status::ERROR when failed to create temporary location,
+ * private temporary location, or failed to restore
+ * shared/private directory for widget,
+ * Status::OK otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Move files from shared/private directories back to source directory
+ *
+ * \return Status::OK
+ */
Status undo() override;
private:
namespace wgt {
namespace filesystem {
+/**
+ * \brief This step return path to widget icon
+ */
class StepWgtCreateIcons
: public common_installer::filesystem::StepCreateIcons {
public:
using StepCreateIcons::StepCreateIcons;
+ /**
+ * \brief Return path to widget icon
+ *
+ * \return path to widget icon
+ */
boost::filesystem::path GetIconRoot() const override;
SCOPE_LOG_TAG(WgtCreateIcons)
public:
using StepCreateStorageDirectories::StepCreateStorageDirectories;
+ /**
+ * \brief Create shared and private directories
+ *
+ * \return Status::ERROR when failed to create temporary location, or
+ * private temporary location
+ * Status::OK otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
private:
namespace wgt {
namespace filesystem {
-//
-// This step fixes unpacked directory structure so that all widget content
-// is moved from root path to res/wgt before we copy whole directory in
-// StepCopy
-//
+/**
+ * \brief This step fixes unpacked directory structure so that all widget
+ * content is moved from root path to res/wgt before we copy whole directory in
+ * StepCopy
+ */
class StepWgtResourceDirectory : public common_installer::Step {
public:
using Step::Step;
+ /**
+ * \brief Create directory structure and copy content of widget package
+ *
+ * \return Status::ERROR when failed to create proper directory structure or
+ * move source directory to destination directory,
+ * Status::OK otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief Empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
SCOPE_LOG_TAG(CreateWgtResourceDirectory)
namespace wgt {
+/**
+ * \brief Helper functionalities used before
+ * configuring app-installer steps.
+ * Eg. it is used to check, if package is to be installed or updated
+ */
class WgtAppQueryInterface : public common_installer::AppQueryInterface {
public:
+ /**
+ * \brief method for checking if package is installed based
+ * on argv
+ *
+ * \param argc main() argc argument passed to the backend
+ * \param argv main() argv argument passed to the backend
+ *
+ * \return true if package is installed
+ */
bool IsAppInstalledByArgv(int argc, char** argv) override;
};
namespace wgt {
+/**
+ * \brief Class that is used within specific backends to keep additional
+ * information regarding package
+ */
class WgtBackendData : public common_installer::BackendData {
public:
+ /**
+ * \brief Property of vector of files to add
+ */
Property<std::vector<std::string>> files_to_add;
+
+ /**
+ * \brief Property of vector of files to modify
+ */
Property<std::vector<std::string>> files_to_modify;
+
+ /**
+ * \brief Property of vector of files to delete
+ */
Property<std::vector<std::string>> files_to_delete;
+ /**
+ * \brief Property of SettingInfo
+ */
Property<parse::SettingInfo> settings;
};
namespace wgt {
/**
- * @brief The WgtInstaller class
+ * \brief The WgtInstaller class
* Subclass of AppInstaller class dedicated for handling wgt request
*
* Performs all types of requests of wgt packages and sets required sequence of
- * steps.
+ * steps
*/
class WgtInstaller : public common_installer::AppInstaller {
public:
+ /**
+ * \brief Explicit constructor
+ *
+ * \param pkgmgr pointer to pkgmgr
+ */
explicit WgtInstaller(common_installer::PkgMgrPtr pkgrmgr);
};