Changeset 379 for branches


Ignore:
Timestamp:
02/03/14 17:31:15 (6 years ago)
Author:
jls17
Message:
  • made the schema (the action reads from) a member variable to make splitting code into separate member functions easier
Location:
branches/work_304/doc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/work_304/doc/DocActionSetFieldsHelper.cpp

    r378 r379  
    4040ostream& CDocActionSetFieldsHelper::ToStream(std::ostream &writer) 
    4141{ 
    42         stringstream strmSchema; 
    4342        stringstream strmSchemaDisplay; 
    4443        stringstream strmServer; 
     
    5756                        strmServer << arIn.LinkToServerInfo(arIn.appConfig.serverName, rootLevel); 
    5857                        strmSchemaDisplay << "CURRENT SCREEN"; 
    59                         strmSchema << sfh.GetSchemaName(); 
     58                        schemaNameActionIsReadingFrom = sfh.GetSchemaName(); 
    6059                        break; 
    6160                case SFT_SERVER: 
     
    8281                                        fieldId = sfh.GetSchemaFieldId(); 
    8382                                        strmSchemaDisplay << "$" << (fieldId < 0 ? CAREnum::Keyword(abs(fieldId)) : arIn.LinkToField(attachedSchemaName, fieldId, rootLevel)) << "$ (Sample Form: " << arIn.LinkToSchema(readSchema, rootLevel) << ")"; 
    84                                         strmSchema << readSchema; 
     83                                        schemaNameActionIsReadingFrom = readSchema; 
    8584 
    8685                                        CRefItem refItemForm(obj, ifElse, nAction, REFM_SETFIELDS_FORM); 
     
    9291 
    9392                                        strmSchemaDisplay << readSchema; 
    94                                         strmSchema << readSchema; 
     93                                        schemaNameActionIsReadingFrom = readSchema; 
    9594                                } 
    9695 
     
    123122                        { 
    124123                                strmServer << arIn.LinkToServerInfo(sfh.GetServerName(), rootLevel); 
    125                                 strmSchema << AR_ASSIGN_SQL_SCHEMA_NAME; 
     124                                schemaNameActionIsReadingFrom = AR_ASSIGN_SQL_SCHEMA_NAME; 
    126125                                strmSchemaDisplay << "SQL"; 
    127126 
     
    143142                        { 
    144143                                string schemaName = sfh.GetSchemaName(); 
    145                                 strmSchema << sfh.GetSchemaName(); 
     144                                schemaNameActionIsReadingFrom = sfh.GetSchemaName(); 
    146145 
    147146                                if (schemaName.substr(0, 1) == "$") 
     
    251250                                // TODO: implement Atrium Orchestrator actions correctly 
    252251                                strmServer << arIn.LinkToServerInfo(AR_CURRENT_SERVER_TAG, rootLevel); 
    253                                 strmSchema << sfh.GetSchemaName(); 
     252                                schemaNameActionIsReadingFrom = sfh.GetSchemaName(); 
    254253                                strmSchemaDisplay << sfh.GetSchemaName(); 
    255254 
     
    262261        if (useDefaultFieldMappingTable) 
    263262        { 
    264                 GenerateDefaultMappingTable(strmSchema, strmSchemaDisplay, strmServer, strmQual); 
    265         } 
    266  
     263                GenerateDefaultMappingTable(strmSchemaDisplay, strmServer, strmQual); 
     264        } 
     265 
     266        writer << strmSchemaDisplay.str() << endl; 
    267267        return writer; 
    268268} 
    269269 
    270 void CDocActionSetFieldsHelper::GenerateDefaultMappingTable(stringstream &strmSchema, stringstream &strmSchemaDisplay, stringstream &strmServer, stringstream &strmQual) 
    271 { 
    272         //For the following internal calculations we need a secondary form 
    273         string readFromSchemaName = strmSchema.str(); 
    274  
     270void CDocActionSetFieldsHelper::GenerateDefaultMappingTable(stringstream &strmSchemaDisplay, stringstream &strmServer, stringstream &strmQual) 
     271{ 
    275272        string tmpDisplayName = strmSchemaDisplay.str(); 
    276273        if(tmpDisplayName.size()==0) 
    277                 tmpDisplayName = readFromSchemaName; 
    278  
     274                tmpDisplayName = schemaNameActionIsReadingFrom; 
    279275 
    280276        if (this->showServerNameInOutput) 
     
    291287        { 
    292288                strmSchemaDisplay << " All Matching Ids<br/>"; 
    293                 CDocAllMatchingIdsTable allMatchingFieldsTable(attachedSchemaName, readFromSchemaName, obj, CDocAllMatchingIdsTable::AMM_SETFIELDS, nAction, ifElse, rootLevel); 
     289                CDocAllMatchingIdsTable allMatchingFieldsTable(attachedSchemaName, schemaNameActionIsReadingFrom, obj, CDocAllMatchingIdsTable::AMM_SETFIELDS, nAction, ifElse, rootLevel); 
    294290                allMatchingFieldsTable.ToStream(strmSchemaDisplay); 
    295291        } 
     
    297293        { 
    298294                strmSchemaDisplay << "<br/>" << endl; 
    299                 CARAssignHelper assignHelper(arIn, rootLevel, obj, attachedSchemaName, readFromSchemaName); 
     295                CARAssignHelper assignHelper(arIn, rootLevel, obj, attachedSchemaName, schemaNameActionIsReadingFrom); 
    300296                strmSchemaDisplay << assignHelper.SetFieldsAssignment(setFieldsStruct, nAction, ifElse); 
    301297        } 
  • branches/work_304/doc/DocActionSetFieldsHelper.h

    r377 r379  
    4646        bool showServerNameInOutput; 
    4747 
     48        std::string schemaNameActionIsReadingFrom; 
     49 
    4850private: 
    49         void GenerateDefaultMappingTable(std::stringstream &strmSchema, std::stringstream &strmSchemaDisplay, std::stringstream &strmServer, std::stringstream &strmQual); 
     51        void GenerateDefaultMappingTable(std::stringstream &strmSchemaDisplay, std::stringstream &strmServer, std::stringstream &strmQual); 
    5052        string processMappingXML( TiXmlNode* pParent, string sParent, CTable &tblFieldList, string form, WebserviceMappingMode type); 
    5153}; 
Note: See TracChangeset for help on using the changeset viewer.