@@ -30,10 +30,13 @@ ScComponentManagerCommandHandler::ScComponentManagerCommandHandler()
30
30
{CommandsConstantsFlags::CLASS, keynodes::ScComponentManagerKeynodes::rrel_class},
31
31
{CommandsConstantsFlags::EXPLANATION, keynodes::ScComponentManagerKeynodes::rrel_explanation}};
32
32
33
- m_SearchParametersRelations = {
33
+ m_SearchNodesParametersRelations = {
34
34
{CommandsConstantsFlags::AUTHOR, keynodes::ScComponentManagerKeynodes::rrel_author},
35
35
{CommandsConstantsFlags::CLASS, keynodes::ScComponentManagerKeynodes::rrel_class},
36
36
{CommandsConstantsFlags::EXPLANATION, keynodes::ScComponentManagerKeynodes::rrel_explanation}};
37
+
38
+ m_SearchLinksParametersRelations = {
39
+ {CommandsConstantsFlags::EXPLANATION, keynodes::ScComponentManagerKeynodes::rrel_explanation}};
37
40
}
38
41
39
42
bool ScComponentManagerCommandHandler::Handle (
@@ -111,11 +114,27 @@ void ScComponentManagerCommandHandler::FormInstallActionNodeParameter(
111
114
void ScComponentManagerCommandHandler::FormSearchActionNodeParameter (ScAddr const & action, CommandParameters const & commandParameters)
112
115
{
113
116
ScAddr paramsSet;
114
- for (auto const & param : commandParameters)
117
+ ScAddr foundParamValue;
118
+ for (auto const & params : commandParameters)
115
119
{
116
- if (m_SearchParametersRelations.find (param.first ) != m_SearchParametersRelations.cend ())
120
+ paramsSet = m_context->CreateNode (ScType::NodeConst);
121
+ for (std::string const & paramValue : params.second )
117
122
{
118
- paramsSet = m_context->CreateNode (ScType::NodeConst);
123
+ // Process parameter if it is a link
124
+ if (m_SearchNodesParametersRelations.find (params.first ) != m_SearchNodesParametersRelations.cend ())
125
+ {
126
+ foundParamValue = m_context->HelperFindBySystemIdtf (paramValue);
127
+ utils::GenerationUtils::generateRelationBetween (m_context, action, paramsSet, m_SearchNodesParametersRelations.at (params.first ));
128
+ }
129
+ // Process parameter if it is a node
130
+ else if (m_SearchLinksParametersRelations.find (params.first ) != m_SearchLinksParametersRelations.cend ())
131
+ {
132
+ foundParamValue = m_context->CreateLink ();
133
+ m_context->SetLinkContent (foundParamValue, paramValue);
134
+ utils::GenerationUtils::generateRelationBetween (m_context, action, paramsSet, m_SearchLinksParametersRelations.at (params.first ));
135
+ }
136
+
137
+ m_context->CreateEdge (ScType::EdgeAccessConstPosPerm, paramsSet, foundParamValue);
119
138
}
120
139
}
121
140
}
0 commit comments