Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* Handler for the HMI language
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "object_access_control_level.h"
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "logger.h"
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
ObjectAccessControlLevel::ObjectAccessControlLevel(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("ObjectAccessControlLevel"))
|
||||
{
|
||||
}
|
||||
|
||||
ObjectAccessControlLevel::~ObjectAccessControlLevel()
|
||||
{
|
||||
m_mainHandler->dds()->dts()->removeAccessControlLevelByKey(m_data.id);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject ObjectAccessControlLevel::createObject(const Database::OpmAccessControlLevel &data)
|
||||
{
|
||||
m_data = data;
|
||||
if (m_data.id <= 0)
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "It is not intended to insert data this way."));
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject ObjectAccessControlLevel::updateObject(const Database::OpmAccessControlLevel &)
|
||||
{
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "You are not allowed to change this datum."));
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject ObjectAccessControlLevel::removeObject()
|
||||
{
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Data removal denied."));
|
||||
}
|
||||
|
||||
void ObjectAccessControlLevel::onPublishData()
|
||||
{
|
||||
|
||||
OperatorManagement::AccessControlLevel ddsData;
|
||||
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.name(m_data.name.toStdString());
|
||||
ddsData.description(m_data.description.toStdString());
|
||||
|
||||
// Todo: Copy as above
|
||||
INFO_LOG(m_logger) << "Publish OpmAccessControlLevel-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (!m_mainHandler->dts()->publish(ddsData))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error publishing OpmAccessControlLevel-data to dds";
|
||||
}
|
||||
}
|
||||
|
||||
} // Namespace OperatorManagement
|
||||
Reference in new issue
Block a user