source: branches/work_303/core/ARSetFieldHelper.h @ 242

Revision 242, 2.9 KB checked in by jls17, 8 years ago (diff)
  • now the CDocActionSetFieldsHelper class uses the the CARSetFieldHelper class
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
52private:
53        void Parse();
54        bool CheckAssignment(const ARAssignStruct &assignment);
55
56private:
57        CARInside& arIn;                                // reference to CARInside instance
58        CARSchema connectedSchema;                      // the schema which the activelink is attached to and which is used for field id resolving
59        const ARSetFieldsActionStruct& setFieldsStruct; // the action ifself
60        IfElseState ifElse;                             // is the action a if- or else-action
61        int nAction;                                    // action index
62
63        // results after parsing
64        SetFieldType type;
65       
66        string serverName;
67        int serverFromFieldId;
68
69        string schemaName;
70        int schemaFromFieldId;
71
72        int noMatchValue;
73        int multiMatchValue;
74
75        ARQualifierStruct* qualifier;
76        string sqlCommand;
77};
Note: See TracBrowser for help on using the repository browser.