source: branches/work_304/core/ARSetFieldHelper.h @ 368

Revision 368, 3.2 KB checked in by jls17, 6 years ago (diff)
  • added support for filterApi calls (input-mapping, output-mapping, creates field-references)
Line 
1//Copyright (C) 2012 John Luthgers | jls17
2//
3//This file is part of ARInside.
4//
5//    ARInside is free software: you can redistribute it and/or modify
6//    it under the terms of the GNU General Public License as published by
7//    the Free Software Foundation, version 2 of the License.
8//
9//    ARInside is distributed in the hope that it will be useful,
10//    but WITHOUT ANY WARRANTY; without even the implied warranty of
11//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12//    GNU General Public License for more details.
13//
14//    You should have received a copy of the GNU General Public License
15//    along with ARInside.  If not, see <http://www.gnu.org/licenses/>.
16#pragma once
17
18#include "../ARInside.h"
19
20enum SetFieldType
21{
22        SFT_CURRENT,
23        SFT_SERVER,
24        SFT_SAMPLEDATA,
25        SFT_SQL,
26        SFT_FILTERAPI,
27        SFT_WEBSERVICE,
28        SFT_ATRIUM_ORCHESTRATOR,
29};
30
31// === CARSetFieldHelper ===
32// This class is used to decode some of the informations needed for creating setfield documentation. It does
33// not generate any documentation. It is used to recursively parse out some informations which are not directly
34// available.
35
36class CARSetFieldHelper
37{
38public:
39        CARSetFieldHelper(CARInside &arInside, const CARSchema& wfConnectedSchema, const ARSetFieldsActionStruct& sFieldStruct, IfElseState ifElse, int numAction);
40        ~CARSetFieldHelper(void);
41
42        SetFieldType GetType();
43        const string& GetServerName() const;    // only for activelinks
44        const string& GetSchemaName() const;    // the schema used in this action (in case GetType == SFT_CURRENT, this is the same as wfConnectSchema
45        int GetSchemaFieldId();                 // schema from fieldid or keyword
46        int GetServerFieldId();                 // server from fieldid or keyword
47        int GetNoMatchOption();                 // noMatch option for supported actions (SERVER, SQL)
48        int GetMultiMatchOption();              // multiMatch option for supported actions (SERVER, SQL)
49        ARQualifierStruct* GetQualifier();      // qualifier struct
50        const string& GetSqlCommand() const;    // the sql command in case type = SFT_SQL
51
52        int GetFilterAPINumItems() const;       // in case of SFT_FILTERAPI, it returns the item count of the input mapping
53        const ARAssignStruct* GetFilterAPIInputs() const; // in case of SFT_FILTERAPI, it returns the input mapping
54
55private:
56        void Parse();
57        bool CheckAssignment(const ARAssignStruct &assignment);
58
59private:
60        CARInside& arIn;                                // reference to CARInside instance
61        CARSchema connectedSchema;                      // the schema which the activelink is attached to and which is used for field id resolving
62        const ARSetFieldsActionStruct& setFieldsStruct; // the action ifself
63        IfElseState ifElse;                             // is the action a if- or else-action
64        int nAction;                                    // action index
65
66        // results after parsing
67        SetFieldType type;
68       
69        string serverName;
70        int serverFromFieldId;
71
72        string schemaName;
73        int schemaFromFieldId;
74
75        int noMatchValue;
76        int multiMatchValue;
77
78        ARQualifierStruct* qualifier;
79        string sqlCommand;
80
81        ARAssignStruct* filterApiInputValues;
82        int filterApiInputNumItems;
83};
Note: See TracBrowser for help on using the repository browser.