Skip to content

Commit

Permalink
Merge pull request #91 from worldbank/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kbjarkefur authored Jul 31, 2017
2 parents e65dfb9 + 10f285a commit 94ca151
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions src/ado_files/iefolder.ado
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ qui {
*Produce success output
noi di "{pstd}Command ran succesfully, for the round [`itemName'] the following folders and master dofile were created:{p_end}"
noi di "{phang2}1) [${`abbreviation'}]{p_end}"
noi di "{phang2}2) [${encryptFolder}/`itemName' Encrypted Data]{p_end}"
noi di "{phang2}2) [${encryptFolder}/Round `itemName' Encrypted]{p_end}"
noi di "{phang2}3) [${`abbreviation'}/`itemName'_MasterDofile.do]{p_end}"
}
*Creating a new level of observation for master data set
Expand All @@ -156,7 +156,7 @@ qui {
*Produce success output
noi di "{pstd}Command ran succesfully, for the unit of observation [`itemName'] the following folders were created:{p_end}"
noi di "{phang2}1) [${dataWorkFolder}/MasterData/`itemName']{p_end}"
noi di "{phang2}2) [${encryptFolder}/IDMasterKey/`itemName']{p_end}"
noi di "{phang2}2) [${encryptFolder}/Master `itemName' Encrypted]{p_end}"
}
}

Expand Down Expand Up @@ -224,12 +224,20 @@ cap program drop iefolder_newRound
args subHandle rndName rndAbb

di "new round command"


*Not encrypted branch

*Test if folder where to create new folder exist
checkFolderExists "$dataWorkFolder" "parent"

*Test that the new folder does not already exist
checkFolderExists "$dataWorkFolder/`rndName'" "new"

*Encrypted branch

*Test if folder where to create new fodler exist
checkFolderExists "$encryptFolder" "parent"
*Test that the new folder does not already exist
checkFolderExists "$encryptFolder/Round `rndName' Encrypted" "new"

*Old file reference
tempname oldHandle
Expand Down Expand Up @@ -349,24 +357,25 @@ cap program drop iefolder_newUnitOfObs
di "new unitofobs command"

global mastData "$dataWorkFolder/MasterData"
global mastDataIDKey "$encryptFolder/IDMasterKey"

*********************************************
*Test if folder can be created where expected
*********************************************

*Not encrypted branch

*Test if folder where to create new folder exist
checkFolderExists "$mastDataIDKey" "parent"

checkFolderExists "$mastData" "parent"
*Test that the new folder does not already exist
checkFolderExists "$mastDataIDKey/`obsName'" "new"
checkFolderExists "$mastData/`obsName'" "new"

*Test if folder where to create new fodler exist
checkFolderExists "$mastData" "parent"

*Encrypted branch

*Test if folder where to create new fodler exist
checkFolderExists "$encryptFolder" "parent"
*Test that the new folder does not already exist
checkFolderExists "$mastData/`obsName'" "new"
checkFolderExists "$encryptFolder/Master `obsName' Encrypted" "new"

*************
*create folder in masterdata
Expand Down Expand Up @@ -428,15 +437,15 @@ cap program drop iefolder_newUnitOfObs

*************
*Create unit of observation data subfolders
createFolderWriteGlobal "DataSet" "mastData_`obsName'" masterDataSets
createFolderWriteGlobal "Dofiles" "mastData_`obsName'" mastDataDo
createFolderWriteGlobal "DataSet" "mastData_`obsName'" masterDataSets
createFolderWriteGlobal "Dofiles" "mastData_`obsName'" mastDataDo

*************
*create folder in encrypred ID key master
createFolderWriteGlobal "`obsName'" "mastDataIDKey" mastData_E_`obsName'
createFolderWriteGlobal "DataSet" "mastData_E_`obsName'" mastData_E_data
createFolderWriteGlobal "Sampling" "mastData_E_`obsName'" mastData_E_Samp
createFolderWriteGlobal "Treatment" "mastData_E_`obsName'" mastData_E_Treat
createFolderWriteGlobal "Master `obsName' Encrypted" "encryptFolder" mastData_E_`obsName'
createFolderWriteGlobal "DataSet" "mastData_E_`obsName'" mastData_E_data
createFolderWriteGlobal "Sampling" "mastData_E_`obsName'" mastData_E_Samp
createFolderWriteGlobal "Treatment Assignment" "mastData_E_`obsName'" mastData_E_Treat

end

Expand Down Expand Up @@ -553,7 +562,7 @@ cap program drop createRoundMasterDofile

*Encrypted round sub-folder
file write `roundHandle' _n _col(4)"*Encrypted round sub-folder globals" _n
createFolderWriteGlobal "`rndName' Encrypted Data" "encryptFolder" "`rnd'_encrypt" `roundHandle'
createFolderWriteGlobal "Round `rndName' Encrypted" "encryptFolder" "`rnd'_encrypt" `roundHandle'
createFolderWriteGlobal "Raw Identified Data" "`rnd'_encrypt" "`rnd'_dtRaw" `roundHandle'
createFolderWriteGlobal "Dofiles Import" "`rnd'_encrypt" "`rnd'_doImp" `roundHandle'
createFolderWriteGlobal "High Frequency Checks" "`rnd'_encrypt" "`rnd'_HFC" `roundHandle'
Expand Down Expand Up @@ -830,9 +839,6 @@ cap program drop mdofle_p1
if "`rndName'" == "" createFolderWriteGlobal "EncryptedData" "dataWorkFolder" encryptFolder `subHandle'
if "`rndName'" != "" writeGlobal "EncryptedData" "dataWorkFolder" encryptFolder `subHandle'

*Create master data subfolders
if "`rndName'" == "" createFolderWriteGlobal "IDMasterKey" "encryptFolder" masterIdDataSets `subHandle'
if "`rndName'" != "" writeGlobal "IDMasterKey" "encryptFolder" masterIdDataSets `subHandle'

if "`rndName'" == "" {
*Write sub devisor starting master and monitor data section section
Expand Down

0 comments on commit 94ca151

Please sign in to comment.