Added support for database maintenance. Added core plugin.
parent
1264b2547a
commit
7c90c66468
@ -0,0 +1,25 @@
|
||||
#include "coreplugin.h"
|
||||
#include <QJsonDocument>
|
||||
#include <QFile>
|
||||
|
||||
CorePlugin::CorePlugin()
|
||||
{
|
||||
Q_INIT_RESOURCE(rc);
|
||||
|
||||
QFile f(":/metaData.json");
|
||||
f.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||
QJsonDocument d = QJsonDocument::fromJson(f.readAll());
|
||||
init(d.object());
|
||||
f.close();
|
||||
}
|
||||
|
||||
CorePlugin::~CorePlugin()
|
||||
{
|
||||
}
|
||||
|
||||
void CorePlugin::initServiceUi()
|
||||
{
|
||||
m_service = NULL;
|
||||
m_ui = NULL;
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
#ifndef COREPLUGIN_H
|
||||
#define COREPLUGIN_H
|
||||
|
||||
#include "imetadataplugin.h"
|
||||
|
||||
class CorePlugin : public IMetaDataPlugin
|
||||
{
|
||||
public:
|
||||
CorePlugin();
|
||||
~CorePlugin();
|
||||
|
||||
// IMetaDataPlugin interface
|
||||
protected:
|
||||
virtual void initServiceUi();
|
||||
};
|
||||
|
||||
#endif // COREPLUGIN_H
|
@ -0,0 +1,73 @@
|
||||
{
|
||||
"MetaData" : {
|
||||
"id" : "CORE",
|
||||
"name" : {
|
||||
"default" : "Core plugin",
|
||||
"CZ" : "Jádro"
|
||||
},
|
||||
"descriptoin" : {
|
||||
"default" : "",
|
||||
"CZ" : ""
|
||||
},
|
||||
"schemaVersion" : 1,
|
||||
"sql" : [
|
||||
"CREATE TABLE \"User\" (
|
||||
\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
\"login\" TEXT NULL,
|
||||
\"password\" TEXT NULL,
|
||||
\"name\" TEXT NULL,
|
||||
\"lastModDate\" TEXT NULL,
|
||||
\"createDate\" TEXT NULL,
|
||||
\"active\" INTEGER NOT NULL,
|
||||
\"isAdmin\" INTEGER NOT NULL);
|
||||
|
||||
CREATE TABLE \"User_listRoles\" (
|
||||
\"object_id\" INTEGER NOT NULL,
|
||||
\"value\" INTEGER NOT NULL,
|
||||
CONSTRAINT \"object_id_fk\"
|
||||
FOREIGN KEY (\"object_id\")
|
||||
REFERENCES \"User\" (\"id\")
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT \"value_fk\"
|
||||
FOREIGN KEY (\"value\")
|
||||
REFERENCES \"Role\" (\"id\")
|
||||
DEFERRABLE INITIALLY DEFERRED);
|
||||
|
||||
CREATE INDEX \"User_listRoles_object_id_i\"
|
||||
ON \"User_listRoles\" (\"object_id\");
|
||||
|
||||
CREATE TABLE \"Role\" (
|
||||
\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
\"name\" TEXT NULL,
|
||||
\"lastModDate\" TEXT NULL,
|
||||
\"createDate\" TEXT NULL,
|
||||
\"active\" INTEGER NOT NULL);
|
||||
|
||||
CREATE TABLE \"Role_listPermissions\" (
|
||||
\"object_id\" INTEGER NOT NULL,
|
||||
\"value\" INTEGER NOT NULL,
|
||||
CONSTRAINT \"object_id_fk\"
|
||||
FOREIGN KEY (\"object_id\")
|
||||
REFERENCES \"Role\" (\"id\")
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT \"value_fk\"
|
||||
FOREIGN KEY (\"value\")
|
||||
REFERENCES \"Permission\" (\"id\")
|
||||
DEFERRABLE INITIALLY DEFERRED);
|
||||
|
||||
CREATE INDEX \"Role_listPermissions_object_id_i\"
|
||||
ON \"Role_listPermissions\" (\"object_id\");
|
||||
|
||||
CREATE TABLE \"Permission\" (
|
||||
\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
\"pluginId\" TEXT NULL,
|
||||
\"permissionName\" TEXT NULL,
|
||||
\"lastModDate\" TEXT NULL,
|
||||
\"createDate\" TEXT NULL,
|
||||
\"active\" INTEGER NOT NULL);"
|
||||
|
||||
|
||||
],
|
||||
"dependencies" : []
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>metaData.json</file>
|
||||
</qresource>
|
||||
</RCC>
|
Loading…
Reference in New Issue