Skip to content

Commit

Permalink
ExL reverted the Analytics namespace removal
Browse files Browse the repository at this point in the history
  • Loading branch information
danmichaelo committed Oct 29, 2019
1 parent 1e9a0d1 commit 8edf704
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

(Nothing yet)

## [0.8.2] - 2019-10-29

### Fixed

- Fix for revertion of namespace removal in Alma Analytics API response
(seems like the removal was just a mistake from Ex Libris)

## [0.8.1] - 2019-10-01

### Changed
Expand All @@ -19,7 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- URL encode user IDs in URLs (since Alma user IDs can contain any Unicode character).
- Added extra type check in error response handling
- Docs: Fix "Item by barcode" anchor (#14)
- Fix for breaking change in Alma Analytics API response
- Fix for sudden namespace removal in Alma Analytics API response

## [0.8.0] - 2019-04-08

Expand Down
2 changes: 1 addition & 1 deletion spec/Analytics/RowSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function let()
// We need to be able to handle missing data, so let's assume we have
// a report with three columns, but that we for this row only got data
// for two of the columns (data missing for Column2).
$xml = QuiteSimpleXMLElement::make('<Row>
$xml = QuiteSimpleXMLElement::make('<Row xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<Column0>0</Column0>
<Column1>col1 content</Column1>
<Column3>col3 content</Column3>
Expand Down
2 changes: 1 addition & 1 deletion spec/data/analytics_response.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
<IsFinished>true</IsFinished>
<ResultXml>
<rowset>
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
<xsd:complexType name="Row">
<xsd:sequence>
Expand Down
4 changes: 2 additions & 2 deletions spec/data/analytics_response_part1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ResumptionToken>9672D715A8E2EAAA6F30DD22FC52BE4CCAE35E29D921E0AC8BE8C6734C9E1571B4E48EEFCA4046EFF8CD7D1662C2D0A7677D3AD05EDC3CA7F06182E34E9D7A2F</ResumptionToken>
<IsFinished>false</IsFinished>
<ResultXml>
<rowset>
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
<xsd:complexType name="Row">
<xsd:sequence>
Expand Down Expand Up @@ -4967,4 +4967,4 @@
</Row>
</rowset>
</ResultXml>
</QueryResult></report>
</QueryResult></report>
4 changes: 2 additions & 2 deletions spec/data/analytics_response_part2.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
<IsFinished>false</IsFinished>
<ResultXml>
<rowset>
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<Row>
<Column0>0</Column0>
<Column1>Elkins, James</Column1>
Expand Down Expand Up @@ -4967,4 +4967,4 @@ Stockholm Chamber of Commerce</Column12>
</Row>
</rowset>
</ResultXml>
</QueryResult></report>
</QueryResult></report>
4 changes: 2 additions & 2 deletions spec/data/analytics_response_part3.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
<IsFinished>true</IsFinished>
<ResultXml>
<rowset>
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<Row>
<Column0>0</Column0>
<Column1>Parham, Peter 1950-</Column1>
Expand Down Expand Up @@ -2917,4 +2917,4 @@
</Row>
</rowset>
</ResultXml>
</QueryResult></report>
</QueryResult></report>
2 changes: 1 addition & 1 deletion src/Analytics/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function fetchBatch($attempt = 1, $chunkSize = null)

$this->readColumnHeaders($results);

$rows = $results->all('//Row');
$rows = $results->all('//rowset:Row');

foreach ($rows as $row) {
$this->resources[] = $this->convertToResource($row);
Expand Down
2 changes: 1 addition & 1 deletion src/Analytics/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(QuiteSimpleXMLElement $data, $headers)
{
$this->headers = $headers;
foreach ($headers as $idx => $header) {
$value = $data->text('Column' . ($idx + 1)) ?: null;
$value = $data->text('rowset:Column' . ($idx + 1)) ?: null;
$this->byIndex[$idx] = $value;
$this->byHeader[$header] = $value;
}
Expand Down

0 comments on commit 8edf704

Please sign in to comment.