|
@@ -38,7 +38,7 @@ class ParserFile
|
38
|
38
|
foreach ($files as $file) {
|
39
|
39
|
$resultEntries = array();
|
40
|
40
|
$entrada = file_get_contents($file);
|
41
|
|
- $xml = simplexml_load_string($entrada, "SimpleXMLElement", LIBXML_NOCDATA | LIBXML_PARSEHUGE);
|
|
41
|
+ $xml = simplexml_load_string($entrada, "SimpleXMLElement", LIBXML_NOCDATA);
|
42
|
42
|
$json = json_encode($xml);
|
43
|
43
|
$array = json_decode($json, true);
|
44
|
44
|
|
|
@@ -47,34 +47,35 @@ class ParserFile
|
47
|
47
|
foreach ($array['entry'] as $clave => $row) {
|
48
|
48
|
|
49
|
49
|
$arrayDeletedEntries = $xml->children('at', true);
|
|
50
|
+ //$var = $xml->entry[$clave]->ContractFolderStatus;
|
|
51
|
+ //$var2 = $this->existAttribute($var, "ContractFolderStatusCode", "string", "listURI");
|
|
52
|
+ $resultEntries[$filename]['general'][$aux] = $this->nodoEntry($row, $xml->entry[$clave], $datosPerfil->id);
|
50
|
53
|
|
51
|
|
- $resultEntries[$filename]['general'][$aux] = $this->nodoEntry($row, $datosPerfil->id);
|
|
54
|
+ $resultEntries[$filename]['contractInfo'][$aux] = $this->nodoContractFolderStatus($row, $xml->entry[$clave]);
|
52
|
55
|
|
53
|
|
- $resultEntries[$filename]['contractInfo'][$aux] = $this->nodoContractFolderStatus($row);
|
|
56
|
+ $resultEntries[$filename]['locatedContractingParty'][$aux] = $this->nodoLocatedContractingParty($row, $xml->entry[$clave]);
|
54
|
57
|
|
55
|
|
- $resultEntries[$filename]['locatedContractingParty'][$aux] = $this->nodoLocatedContractingParty($row);
|
|
58
|
+ $resultEntries[$filename]['party'][$aux] = $this->nodoParty($row, $xml->entry[$clave]);
|
56
|
59
|
|
57
|
|
- $resultEntries[$filename]['party'][$aux] = $this->nodoParty($row);
|
|
60
|
+ $resultEntries[$filename]['procurementProject'][$aux] = $this->nodoPresupuesto($row, $xml->entry[$clave]);
|
58
|
61
|
|
59
|
|
- $resultEntries[$filename]['procurementProject'][$aux] = $this->nodoPresupuesto($row);
|
|
62
|
+ $resultEntries[$filename]['procurementProjectLot'][$aux] = $this->nodoProcurementProjectLot($row, $xml->entry[$clave]);
|
60
|
63
|
|
61
|
|
- $resultEntries[$filename]['procurementProjectLot'][$aux] = $this->nodoProcurementProjectLot($row);
|
|
64
|
+ $resultEntries[$filename]['tenderingTerms'][$aux] = $this->nodoTenderingTerms($row, $xml->entry[$clave]);
|
62
|
65
|
|
63
|
|
- $resultEntries[$filename]['tenderingTerms'][$aux] = $this->nodoTenderingTerms($row);
|
|
66
|
+ $resultEntries[$filename]['tenderingProcess'][$aux] = $this->nodoTenderingProcess($row, $xml->entry[$clave]);
|
64
|
67
|
|
65
|
|
- $resultEntries[$filename]['tenderingProcess'][$aux] = $this->nodoTenderingProcess($row);
|
66
|
|
-
|
67
|
|
- $resultEntries[$filename]['tenderingResult'][$aux] = $this->nodoTenderResult($row);
|
|
68
|
+ $resultEntries[$filename]['tenderingResult'][$aux] = $this->nodoTenderResult($row, $xml->entry[$clave]);
|
68
|
69
|
|
69
|
70
|
//$resultEntries[$filename]['validNoticeInfo'][$aux] = $this->nodoValidNoticeInfo($row);
|
70
|
71
|
|
71
|
|
- $resultEntries[$filename]['legalDocs'][$aux] = $this->nodoLegalDoc($row);
|
|
72
|
+ $resultEntries[$filename]['legalDocs'][$aux] = $this->nodoLegalDoc($row, $xml->entry[$clave]);
|
72
|
73
|
|
73
|
|
- $resultEntries[$filename]['technicalDocs'][$aux] = $this->nodoTechnicalDocumentReference($row);
|
|
74
|
+ $resultEntries[$filename]['technicalDocs'][$aux] = $this->nodoTechnicalDocumentReference($row, $xml->entry[$clave]);
|
74
|
75
|
|
75
|
|
- $resultEntries[$filename]['generalDocs'][$aux] = $this->nodoGeneralDocuments($row);
|
|
76
|
+ $resultEntries[$filename]['generalDocs'][$aux] = $this->nodoGeneralDocuments($row, $xml->entry[$clave]);
|
76
|
77
|
|
77
|
|
- $resultEntries[$filename]['additionalDocs'][$aux] = $this->nodoAdditionalDocumentReference($row);
|
|
78
|
+ $resultEntries[$filename]['additionalDocs'][$aux] = $this->nodoAdditionalDocumentReference($row, $xml->entry[$clave]);
|
78
|
79
|
|
79
|
80
|
$aux++;
|
80
|
81
|
|
|
@@ -84,20 +85,21 @@ class ParserFile
|
84
|
85
|
$this->CI->parserdatabasebruto->setDatosParser($resultEntries, $fechaInicioParser, $datosPerfil);
|
85
|
86
|
|
86
|
87
|
$resultEntries = array();
|
87
|
|
- $this->CI->parserdatabaselimpio->index();
|
|
88
|
+ $this->CI->parserdatabaselimpio->index($fechaInicioParser);
|
|
89
|
+
|
88
|
90
|
}
|
89
|
91
|
|
90
|
92
|
return;
|
91
|
93
|
}
|
92
|
94
|
|
93
|
|
- private function nodoEntry($xml, $tipoPerfil)
|
|
95
|
+ private function nodoEntry($xml, $xmlPrimitivo, $tipoPerfil)
|
94
|
96
|
{
|
95
|
97
|
$resultEntries = array();
|
96
|
98
|
$id_licitacion = (string) substr($xml['id'], strrpos($xml['id'], '/') + 1);
|
97
|
99
|
$resultEntries['url_id_licitacion'] = (string) $xml['id'];
|
98
|
100
|
$resultEntries['id_licitacion'] = $id_licitacion;
|
99
|
101
|
$this->idLicitacion = $id_licitacion;
|
100
|
|
- //$resultEntries['link_uri'] = (string) $this->existAttribute($xml, "link", "string", 'href');
|
|
102
|
+ $resultEntries['link_uri'] = (string) $this->existAttribute($xmlPrimitivo, "link", "string", 'href');
|
101
|
103
|
$resultEntries['summary'] = (string) $xml['summary'];
|
102
|
104
|
$resultEntries['title'] = (string) $xml['title'];
|
103
|
105
|
$resultEntries['updated'] = (string) $xml['updated'];
|
|
@@ -106,7 +108,7 @@ class ParserFile
|
106
|
108
|
return $resultEntries;
|
107
|
109
|
}
|
108
|
110
|
|
109
|
|
- private function nodoContractFolderStatus($xml)
|
|
111
|
+ private function nodoContractFolderStatus($xml, $xmlPrimitivo)
|
110
|
112
|
{
|
111
|
113
|
$resultEntries = array();
|
112
|
114
|
if (array_key_exists("ContractFolderStatus", $xml)) {
|
|
@@ -114,7 +116,7 @@ class ParserFile
|
114
|
116
|
|
115
|
117
|
$resultEntries['ContractFolderID'] = (string) $contractFolder['ContractFolderID'];
|
116
|
118
|
$resultEntries['ContractFolderStatusCode'] = (string) $contractFolder['ContractFolderStatusCode'];
|
117
|
|
- $resultEntries['ContractFolderStatusCodeAttr'] = $this->existAttribute($contractFolder, "ContractFolderStatusCode", "string", 'listURI');
|
|
119
|
+ $resultEntries['ContractFolderStatusCodeAttr'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus, "ContractFolderStatusCode", "string", 'listURI');
|
118
|
120
|
$resultEntries['id_ajena_licitacion'] = $this->idLicitacion;
|
119
|
121
|
$resultEntries['id_compuesta'] = $this->idLicitacion . "_01";
|
120
|
122
|
$resultEntries['fecha_creacion_log'] = $this->fechaInicioParser;
|
|
@@ -123,13 +125,14 @@ class ParserFile
|
123
|
125
|
return $resultEntries;
|
124
|
126
|
}
|
125
|
127
|
|
126
|
|
- private function nodoLocatedContractingParty($xml)
|
|
128
|
+ private function nodoLocatedContractingParty($xml, $xmlPrimitivo)
|
127
|
129
|
{
|
128
|
130
|
$resultEntries = array();
|
129
|
131
|
if (array_key_exists("LocatedContractingParty", $xml['ContractFolderStatus'])) {
|
130
|
132
|
$LocatedContractingParty = $xml['ContractFolderStatus']['LocatedContractingParty'];
|
131
|
133
|
|
132
|
134
|
$resultEntries['locatedContractingParty']['contractingPartyTypeCode'] = $this->existNodo($LocatedContractingParty, "ContractingPartyTypeCode", 'string');
|
|
135
|
+ $resultEntries['locatedContractingParty']['contractingPartyTypeCodeUri'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->LocatedContractingParty, "ContractingPartyTypeCode", "string", 'listURI');
|
133
|
136
|
//$resultEntries['locatedContractingParty']['contractingPartyTypeCodeUri'] = $this->existAttribute($LocatedContractingParty, "ContractingPartyTypeCode", 'string', 'listURI');
|
134
|
137
|
|
135
|
138
|
if (array_key_exists("ActivityCode", $xml['ContractFolderStatus']['LocatedContractingParty'])) {
|
|
@@ -140,7 +143,9 @@ class ParserFile
|
140
|
143
|
for ($i = 0; $i < count($activity); $i++) {
|
141
|
144
|
$resultEntries['activity'][$i]['activityCode'] = (string) $activity[$i];
|
142
|
145
|
//$resultEntries['activity'][$i]['activityCodeUri'] = (string) $activity[$i]->attributes()['listURI'];
|
|
146
|
+ $resultEntries['activity'][$i]['activityCodeUri'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->LocatedContractingParty, "ActivityCode", "string", 'listURI');
|
143
|
147
|
$resultEntries['activity'][$i]['id_ajena_licitacion'] = $this->idLicitacion;
|
|
148
|
+ $resultEntries['activity'][$i]['id_compuesta_padre'] = $this->idLicitacion . "_02_";
|
144
|
149
|
$resultEntries['activity'][$i]['id_compuesta'] = $this->idLicitacion . "_02_" . $i;
|
145
|
150
|
$resultEntries['activity'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
|
146
|
151
|
}
|
|
@@ -155,7 +160,7 @@ class ParserFile
|
155
|
160
|
return $resultEntries;
|
156
|
161
|
}
|
157
|
162
|
|
158
|
|
- private function nodoParty($xml)
|
|
163
|
+ private function nodoParty($xml, $xmlPrimitivo)
|
159
|
164
|
{
|
160
|
165
|
$resultEntries = array();
|
161
|
166
|
if (array_key_exists("Party", $xml['ContractFolderStatus']['LocatedContractingParty'])) {
|
|
@@ -167,8 +172,10 @@ class ParserFile
|
167
|
172
|
for ($i = 0; $i < count($party['PartyIdentification']); $i++) {
|
168
|
173
|
$resultEntries['partyIdentification'][$i]['idPartyIdent'] = $this->existNodo($party['PartyIdentification'][$i], "ID", 'string');
|
169
|
174
|
//$resultEntries['partyIdentification'][$i]['attr'] = $this->existAttribute($party, $party['PartyIdentification'][$i]['ID'], "string", 'schemeName');
|
|
175
|
+ $resultEntries['partyIdentification'][$i]['attr'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->LocatedContractingParty->Party->PartyIdentification[$i], "ID", "string", 'schemeName');
|
170
|
176
|
$resultEntries['partyIdentification'][$i]['id_ajena_licitacion'] = $this->idLicitacion;
|
171
|
177
|
$resultEntries['partyIdentification'][$i]['id_compuesta'] = $this->idLicitacion . "_03_" . $i;
|
|
178
|
+ $resultEntries['partyIdentification'][$i]['id_compuesta_padre'] = $this->idLicitacion . "_03";
|
172
|
179
|
$resultEntries['partyIdentification'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
|
173
|
180
|
}
|
174
|
181
|
}
|
|
@@ -188,7 +195,7 @@ class ParserFile
|
188
|
195
|
return $resultEntries;
|
189
|
196
|
}
|
190
|
197
|
|
191
|
|
- private function nodoPresupuesto($xml)
|
|
198
|
+ private function nodoPresupuesto($xml, $xmlPrimitivo)
|
192
|
199
|
{
|
193
|
200
|
$resultEntries = array();
|
194
|
201
|
|
|
@@ -221,7 +228,9 @@ class ParserFile
|
221
|
228
|
for ($i = 0; $i < count($procurementProject['RequiredCommodityClassification']); $i++) {
|
222
|
229
|
$resultEntries['itemClass'][$i]['itemClassification_value'] = $this->existNodo($procurementProject['RequiredCommodityClassification'][$i], 'ItemClassificationCode', 'string');
|
223
|
230
|
//$resultEntries['itemClass'][$i]['itemClassification_attr'] = (string) $procurementProject['RequiredCommodityClassification'][$i]['ItemClassificationCode']['listURI'];
|
|
231
|
+ $resultEntries['itemClass'][$i]['itemClassification_attr'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->ProcurementProject->RequiredCommodityClassification[$i], "ItemClassificationCode", "string", 'listURI');
|
224
|
232
|
$resultEntries['itemClass'][$i]['id_ajena_licitacion'] = $this->idLicitacion;
|
|
233
|
+ $resultEntries['itemClass'][$i]['id_compuesta_padre'] = $this->idLicitacion . "_04";
|
225
|
234
|
$resultEntries['itemClass'][$i]['id_compuesta'] = $this->idLicitacion . "_04_" . $i;
|
226
|
235
|
$resultEntries['itemClass'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
|
227
|
236
|
}
|
|
@@ -231,6 +240,7 @@ class ParserFile
|
231
|
240
|
$resultEntries['budget']['countrySubentity'] = $this->existNodo($procurementProject['RealizedLocation'], 'CountrySubentity', 'string');
|
232
|
241
|
if (array_key_exists("CountrySubentityCode", $procurementProject['RealizedLocation'])) {
|
233
|
242
|
$resultEntries['budget']['countrySubentityCode'] = $this->existNodo($procurementProject['RealizedLocation'], 'CountrySubentityCode', 'string');
|
|
243
|
+ $resultEntries['budget']['countrySubentityCode'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->ProcurementProject->RealizedLocation, "CountrySubentityCode", "string", 'listURI');
|
234
|
244
|
//$resultEntries['budget']['countrySubentityCodeAttr'] = $this->existAttribute($procurementProject['RealizedLocation'], "CountrySubentityCode", "string", 'listURI');
|
235
|
245
|
}
|
236
|
246
|
|
|
@@ -244,6 +254,7 @@ class ParserFile
|
244
|
254
|
$resultEntries['budget']['durationMesure'] = $this->existNodo($procurementProject['PlannedPeriod'], 'DurationMeasure', 'string');
|
245
|
255
|
$resultEntries['budget']['duracion_inicio'] = $this->existNodo($procurementProject['PlannedPeriod'], 'StartDate', 'string');
|
246
|
256
|
$resultEntries['budget']['duracion_fin'] = $this->existNodo($procurementProject['PlannedPeriod'], 'EndDate', 'string');
|
|
257
|
+ $resultEntries['budget']['medida'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->ProcurementProject->PlannedPeriod, "DurationMeasure", "string", 'unitCode');
|
247
|
258
|
//$resultEntries['budget']['medida'] = $this->existAttribute($procurementProject['PlannedPeriod'], "DurationMeasure", "string", 'unitCode');
|
248
|
259
|
|
249
|
260
|
if (array_key_exists("ContractExtension", $procurementProject)) {
|
|
@@ -254,7 +265,7 @@ class ParserFile
|
254
|
265
|
return $resultEntries;
|
255
|
266
|
}
|
256
|
267
|
|
257
|
|
- private function nodoProcurementProjectLot($xml)
|
|
268
|
+ private function nodoProcurementProjectLot($xml, $xmlPrimitivo)
|
258
|
269
|
{
|
259
|
270
|
$resultEntries = array();
|
260
|
271
|
if (array_key_exists("ProcurementProjectLot", $xml['ContractFolderStatus'])) {
|
|
@@ -291,7 +302,9 @@ class ParserFile
|
291
|
302
|
"idItem" => $this->existNodo($clasificacionItems[$j], "ItemClassificationCode", "string"),
|
292
|
303
|
"id_ajena_licitacion" => $this->idLicitacion,
|
293
|
304
|
"id_compuesta" => $this->idLicitacion . "_05_" . $i . "_" . $j,
|
|
305
|
+ "id_compuesta_padre" => $this->idLicitacion . "_05_" . $i,
|
294
|
306
|
"fecha_creacion_log" => $this->fechaInicioParser,
|
|
307
|
+ "id_attr" => $this->existAttribute($xmlPrimitivo->ContractFolderStatus->ProcurementProjectLot->RequiredCommodityClassification, "ItemClassificationCode", "string", 'listURI'),
|
295
|
308
|
//$resultEntries["itemClassification"][$i]['itemClassification'][$j]['id_attr'] = $this->existAttribute($clasificacionItems[$j], "ItemClassificationCode", "string", 'listURI');
|
296
|
309
|
);
|
297
|
310
|
}
|
|
@@ -376,6 +389,7 @@ class ParserFile
|
376
|
389
|
$resultEntries["awardingCriteria"][$i]['description'] = $this->existNodo($tendererAwardingTerms[$i], 'WeightNumeric', 'string');
|
377
|
390
|
$resultEntries["awardingCriteria"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
|
378
|
391
|
$resultEntries["awardingCriteria"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
|
|
392
|
+ $resultEntries["awardingCriteria"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
|
379
|
393
|
$resultEntries['awardingCriteria'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
|
380
|
394
|
}
|
381
|
395
|
}
|
|
@@ -391,6 +405,7 @@ class ParserFile
|
391
|
405
|
$resultEntries["TendererQualificationRequest"][$i]['description'] = $this->existNodo($tendererQualificationRequest[$i]['TechnicalEvaluationCriteria'], 'Description', 'string');
|
392
|
406
|
$resultEntries["TendererQualificationRequest"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
|
393
|
407
|
$resultEntries["TendererQualificationRequest"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
|
|
408
|
+ $resultEntries["TendererQualificationRequest"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
|
394
|
409
|
$resultEntries['TendererQualificationRequest'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
|
395
|
410
|
}
|
396
|
411
|
|
|
@@ -404,6 +419,7 @@ class ParserFile
|
404
|
419
|
$resultEntries["FinancialEvaluationCriteria"][$i]['description'] = $this->existNodo($financialEvaluationCriteria[$i], 'Description', 'string');
|
405
|
420
|
$resultEntries["FinancialEvaluationCriteria"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
|
406
|
421
|
$resultEntries["FinancialEvaluationCriteria"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
|
|
422
|
+ $resultEntries["FinancialEvaluationCriteria"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
|
407
|
423
|
$resultEntries['FinancialEvaluationCriteria'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
|
408
|
424
|
}
|
409
|
425
|
}
|
|
@@ -416,6 +432,7 @@ class ParserFile
|
416
|
432
|
$resultEntries["SpecificTendererRequirement"][$i]['evaluationCriteriaTypeCode_attr'] = $this->existAttribute($specificTendererRequirement[$i]['SpecificTendererRequirement'], "RequirementTypeCode", "string", 'listURI');
|
417
|
433
|
$resultEntries["SpecificTendererRequirement"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
|
418
|
434
|
$resultEntries["SpecificTendererRequirement"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
|
|
435
|
+ $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
|
419
|
436
|
$resultEntries['SpecificTendererRequirement'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
|
420
|
437
|
}
|
421
|
438
|
}
|