This is a summary of what is currently working:
.ext files are text files, that the old Petra 2.x has written and parsed, for transferring records of personnel or conference participants between offices.
Import partner data from an .ext file:
csharp\ICT\Petra\Server\lib\MPartner\web\ImportExt.cs, class TPartnerFileImport
method: public PartnerImportExportTDS ImportAllData(string[] ALinesToImport,
string ALimitToOption,
bool ADoNotOverwrite,
out TVerificationResultCollection AResultList);
This method gets the data of the file in a string array, and puts all partner info, that should be saved, into a typed dataset PartnerImportExportTDS.
The caller has to store the data. (eg. PartnerImportExportTDSAccess.SubmitChanges(MainDS, out VerificationResult)))
There is a web connector for that function, in csharp\ICT\Petra\Server\lib\MPartner\web\ImportExport.cs, TImportExportWebConnector,
method public static PartnerImportExportTDS ImportFromPartnerExtract(string[] ATextFileLines, out TVerificationResultCollection AVerificationResult)
The WebConnector is called already from the client, in the screen PartnerImport (csharp\ICT\Petra\Client\MPartner\Gui\PartnerImport.ManualCode.cs). That screen is comparable with the CSV import screen in Petra 2.x, where the user can determine which partners to import and which to ignore, and how to match them to existing partners. For the compatibility with Petra 2.x, it is not required to support .ext file here.
see also the test code in csharp\ICT\Testing\lib\MPartner\server\PartnerExports\PartnerExtracts.cs
This method is already used by the web client:
csharp\ICT\Petra\Server\lib\MConference\ConferenceApplications.cs,
public static bool UploadPetraExtract(string APartnerKeyFile, string AEventCode, out TVerificationResultCollection AVerificationResult)
TODO: find the TODO comments in the file csharp\ICT\Petra\Server\lib\MPartner\web\ImportExt.cs, eg. missing support for tables PmDocumentType, PmDocumentCategory, etc
TODO: see the notes to the bug sourceforge.net/apps/mantisbt/o ... php?id=133.
important: Still TODO: overwrite things in the database. I have not tested that yet (parameter ADoNotOverwrite). At the moment, only new records are added, existing records are not changed. Should show the warnings for new data, which is just logged at the moment. Petra 2.x did show a report.
Also TODO: optionally create an extract, as Petra 2.x did
Export partner data and write to .ext file:
csharp\ICT\Petra\Server\lib\MPartner\web\ExportExt.cs, class TPartnerFileExport, Method string ExportAllData(PartnerImportExportTDS AMainDS, Int32 ASiteKey, Int32 ALocationKey, StringCollection ASpecificBuildingInfo)
This seems not to be called from anywhere in OpenPetra yet.
The data export looks to be fine.
TODO: add a method to the webconnector TImportExportWebConnector in csharp\ICT\Petra\Server\lib\MPartner\web\ImportExport.cs, and run nant generateGlue
TODO: add functionality to the client, to store the returned string into a file