Flagbit_Factfinder - Version 3.5.1

Version Notes

[+BUGFIX] set $graceful parameter to true. This avoid exceptions on Mage::register if the key already exists. This happens if the layered navigation will be included more than once. i. e. left and content
[+BUGFIX] issue #34 selected filters are displayed twice
[+BUGFIX] trim category values before encoding them
[+BUGFIX] don't send clicktracking if disabled
[~BUGFIX] don't allow default attributes inside the attribute-setup
[+TASK] updated FF PHP framework
[~TASK] improved export memory usage, by unsetting some bigger variables
[~TASK] remove typical magento parameters from the request to ff
[~TASK] extracted method sendClickTrackingForSingleProduct

Download this release

Release Info

Developer Magento Core Team
Extension Flagbit_Factfinder
Version 3.5.1
Comparing to
See all releases


Code changes from version 3.4.8 to 3.5.1

Files changed (86) hide show
  1. app/code/community/Flagbit/FactFinder/Block/Adminhtml/Exportlink.php +1 -1
  2. app/code/community/Flagbit/FactFinder/Block/Product/List/Upsell.php +16 -14
  3. app/code/community/Flagbit/FactFinder/Block/Scic.php +0 -89
  4. app/code/community/Flagbit/FactFinder/Block/Tracking.php +108 -0
  5. app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Product/List.php +39 -29
  6. app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Search.php +27 -17
  7. app/code/community/Flagbit/FactFinder/Helper/Data.php +10 -0
  8. app/code/community/Flagbit/FactFinder/Helper/Search.php +5 -4
  9. app/code/community/Flagbit/FactFinder/Model/Export/Product.php +1 -1
  10. app/code/community/Flagbit/FactFinder/Model/Facade.php +31 -1
  11. app/code/community/Flagbit/FactFinder/Model/Handler/ProductDetailCampaign.php +1 -1
  12. app/code/community/Flagbit/FactFinder/Model/Handler/Search.php +10 -1
  13. app/code/community/Flagbit/FactFinder/Model/Handler/Tracking.php +64 -0
  14. app/code/community/Flagbit/FactFinder/Model/Handler/Tracking/Scic.php +73 -0
  15. app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Item.php +2 -2
  16. app/code/community/Flagbit/FactFinder/Model/Mysql4/Search/Collection.php +10 -3
  17. app/code/community/Flagbit/FactFinder/Model/Observer.php +114 -82
  18. app/code/community/Flagbit/FactFinder/Model/Processor.php +5 -0
  19. app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Ffversion.php +4 -0
  20. app/code/community/Flagbit/FactFinder/controllers/ProxyController.php +13 -7
  21. app/code/community/Flagbit/FactFinder/etc/config.xml +20 -15
  22. app/design/frontend/base/default/layout/factfinder.xml +2 -2
  23. app/design/frontend/base/default/template/factfinder/form.advancedsuggest68.phtml +10 -2
  24. app/design/frontend/base/default/template/factfinder/{scic.phtml → tracking.phtml} +7 -6
  25. app/locale/de_DE/Flagbit_FactFinder.csv +2 -1
  26. js/factfinder/{scic.js → tracking.js} +2 -3
  27. lib/FACTFinder/Abstract/Adapter.php +1 -5
  28. lib/FACTFinder/AsnSliderFilter.php +8 -0
  29. lib/FACTFinder/Default/CompareAdapter.php +0 -12
  30. lib/FACTFinder/Default/RecommendationAdapter.php +2 -2
  31. lib/FACTFinder/Default/SimilarRecordsAdapter.php +1 -1
  32. lib/FACTFinder/Default/TagCloudAdapter.php +13 -0
  33. lib/FACTFinder/Default/TrackingAdapter.php +103 -0
  34. lib/FACTFinder/Http/DummyProvider.php +10 -16
  35. lib/FACTFinder/Http/TrackingAdapter.php +31 -0
  36. lib/FACTFinder/Item.php +8 -0
  37. lib/FACTFinder/Json66/CompareAdapter.php +71 -0
  38. lib/FACTFinder/Json66/ImportAdapter.php +74 -0
  39. lib/FACTFinder/Json66/RecommendationAdapter.php +11 -0
  40. lib/FACTFinder/Json66/SearchAdapter.php +515 -0
  41. lib/FACTFinder/Json66/SimilarRecordsAdapter.php +75 -0
  42. lib/FACTFinder/Json66/SuggestAdapter.php +58 -0
  43. lib/FACTFinder/Json66/TagCloudAdapter.php +55 -0
  44. lib/FACTFinder/Json67/CompareAdapter.php +7 -0
  45. lib/FACTFinder/Json67/ImportAdapter.php +10 -0
  46. lib/FACTFinder/Json67/ProductCampaignAdapter.php +160 -0
  47. lib/FACTFinder/Json67/RecommendationAdapter.php +88 -0
  48. lib/FACTFinder/Json67/SearchAdapter.php +138 -0
  49. lib/FACTFinder/Json67/SimilarRecordsAdapter.php +7 -0
  50. lib/FACTFinder/Json67/SuggestAdapter.php +10 -0
  51. lib/FACTFinder/Json67/TagCloudAdapter.php +10 -0
  52. lib/FACTFinder/Json68/CompareAdapter.php +7 -0
  53. lib/FACTFinder/Json68/ImportAdapter.php +10 -0
  54. lib/FACTFinder/Json68/ProductCampaignAdapter.php +25 -0
  55. lib/FACTFinder/Json68/RecommendationAdapter.php +10 -0
  56. lib/FACTFinder/Json68/SearchAdapter.php +42 -0
  57. lib/FACTFinder/Json68/SimilarRecordsAdapter.php +4 -0
  58. lib/FACTFinder/Json68/SuggestAdapter.php +22 -0
  59. lib/FACTFinder/Json68/TagCloudAdapter.php +10 -0
  60. lib/FACTFinder/Json69/CompareAdapter.php +7 -0
  61. lib/FACTFinder/Json69/ImportAdapter.php +10 -0
  62. lib/FACTFinder/Json69/ProductCampaignAdapter.php +8 -0
  63. lib/FACTFinder/Json69/RecommendationAdapter.php +10 -0
  64. lib/FACTFinder/Json69/SearchAdapter.php +74 -0
  65. lib/FACTFinder/Json69/SimilarRecordsAdapter.php +7 -0
  66. lib/FACTFinder/Json69/SuggestAdapter.php +17 -0
  67. lib/FACTFinder/Json69/TagCloudAdapter.php +11 -0
  68. lib/FACTFinder/Paging.php +16 -2
  69. lib/FACTFinder/ParametersParser.php +8 -2
  70. lib/FACTFinder/Record.php +1 -1
  71. lib/FACTFinder/Result.php +21 -0
  72. lib/FACTFinder/SuggestQuery.php +22 -13
  73. lib/FACTFinder/Util.php +36 -4
  74. lib/FACTFinder/Xml65/SearchAdapter.php +115 -87
  75. lib/FACTFinder/Xml66/SearchAdapter.php +7 -23
  76. lib/FACTFinder/Xml68/SearchAdapter.php +2 -66
  77. lib/FACTFinder/Xml69/CompareAdapter.php +17 -0
  78. lib/FACTFinder/Xml69/ImportAdapter.php +17 -0
  79. lib/FACTFinder/Xml69/ProductCampaignAdapter.php +18 -0
  80. lib/FACTFinder/Xml69/RecommendationAdapter.php +17 -0
  81. lib/FACTFinder/Xml69/SearchAdapter.php +67 -0
  82. lib/FACTFinder/Xml69/SimilarRecordsAdapter.php +17 -0
  83. lib/FACTFinder/Xml69/SuggestAdapter.php +17 -0
  84. lib/FACTFinder/Xml69/TagCloudAdapter.php +11 -0
  85. lib/FACTFinder/Xml69/TrackingAdapter.php +7 -0
  86. package.xml +13 -14
app/code/community/Flagbit/FactFinder/Block/Adminhtml/Exportlink.php CHANGED
@@ -52,7 +52,7 @@ class Flagbit_FactFinder_Block_Adminhtml_Exportlink extends Mage_Adminhtml_Block
52
  }
53
  }
54
 
55
- $password = Mage::getStoreConfig('factfinder/search/auth_password');
56
 
57
  if ($store) $storeParam = '&store='.(int)Mage::getConfig()->getNode('stores/' . $store . '/system/store/id');
58
  else $storeParam = '';
52
  }
53
  }
54
 
55
+ $password = Mage::getStoreConfig('factfinder/search/auth_password', $store);
56
 
57
  if ($store) $storeParam = '&store='.(int)Mage::getConfig()->getNode('stores/' . $store . '/system/store/id');
58
  else $storeParam = '';
app/code/community/Flagbit/FactFinder/Block/Product/List/Upsell.php CHANGED
@@ -26,18 +26,20 @@ class Flagbit_FactFinder_Block_Product_List_Upsell extends Mage_Catalog_Block_Pr
26
 
27
  protected function _prepareLayout()
28
  {
29
- $productIds = array(
30
- Mage::registry('current_product')->getData(Mage::helper('factfinder/search')->getIdFieldName())
31
- );
32
-
 
 
33
  if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')) {
34
  $this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_productDetailCampaign', $productIds);
35
  }
36
-
37
  if (Mage::getStoreConfigFlag('factfinder/activation/upsell')) {
38
  $this->_recommendationsHandler = Mage::getSingleton('factfinder/handler_recommendations', $productIds);
39
  }
40
-
41
  return parent::_prepareLayout();
42
  }
43
 
@@ -64,7 +66,7 @@ class Flagbit_FactFinder_Block_Product_List_Upsell extends Mage_Catalog_Block_Pr
64
  $mergedUpsell = array_merge($pushedProducts, (array) $recommendations);
65
  $this->applyUpsells($mergedUpsell);
66
  }
67
-
68
  return $this;
69
  }
70
 
@@ -73,10 +75,10 @@ class Flagbit_FactFinder_Block_Product_List_Upsell extends Mage_Catalog_Block_Pr
73
  try {
74
  $product = Mage::registry('product');
75
  /* @var $product Mage_Catalog_Model_Product */
76
-
77
- // build new FACTFinder_Result with combined data
78
  $recommendations = FF::getInstance('result', $upsells, count($upsells));
79
-
80
  if ($recommendations == null) {
81
  throw new Exception('No recommendations given - check connection to FACT-Finder and FACT-Finder configuration');
82
  }
@@ -118,10 +120,10 @@ class Flagbit_FactFinder_Block_Product_List_Upsell extends Mage_Catalog_Block_Pr
118
  $this->_itemCollection = new Varien_Data_Collection();
119
  }
120
  }
121
-
122
  /**
123
  * get pushed products to combine with recommendations
124
- *
125
  * @return array
126
  */
127
  protected function getPushedProducts()
@@ -133,8 +135,8 @@ class Flagbit_FactFinder_Block_Product_List_Upsell extends Mage_Catalog_Block_Pr
133
  if($_campaigns && $_campaigns->hasPushedProducts()){
134
  $pushedProducts = $_campaigns->getPushedProducts();
135
  }
136
-
137
  return $pushedProducts;
138
  }
139
-
140
  }
26
 
27
  protected function _prepareLayout()
28
  {
29
+ $productIds = array();
30
+
31
+ if(Mage::registry('current_product') instanceof Mage_Catalog_Model_Product){
32
+ $productIds[] = Mage::registry('current_product')->getData(Mage::helper('factfinder/search')->getIdFieldName());
33
+ }
34
+
35
  if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')) {
36
  $this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_productDetailCampaign', $productIds);
37
  }
38
+
39
  if (Mage::getStoreConfigFlag('factfinder/activation/upsell')) {
40
  $this->_recommendationsHandler = Mage::getSingleton('factfinder/handler_recommendations', $productIds);
41
  }
42
+
43
  return parent::_prepareLayout();
44
  }
45
 
66
  $mergedUpsell = array_merge($pushedProducts, (array) $recommendations);
67
  $this->applyUpsells($mergedUpsell);
68
  }
69
+
70
  return $this;
71
  }
72
 
75
  try {
76
  $product = Mage::registry('product');
77
  /* @var $product Mage_Catalog_Model_Product */
78
+
79
+ // build new FACTFinder_Result with combined data
80
  $recommendations = FF::getInstance('result', $upsells, count($upsells));
81
+
82
  if ($recommendations == null) {
83
  throw new Exception('No recommendations given - check connection to FACT-Finder and FACT-Finder configuration');
84
  }
120
  $this->_itemCollection = new Varien_Data_Collection();
121
  }
122
  }
123
+
124
  /**
125
  * get pushed products to combine with recommendations
126
+ *
127
  * @return array
128
  */
129
  protected function getPushedProducts()
135
  if($_campaigns && $_campaigns->hasPushedProducts()){
136
  $pushedProducts = $_campaigns->getPushedProducts();
137
  }
138
+
139
  return $pushedProducts;
140
  }
141
+
142
  }
app/code/community/Flagbit/FactFinder/Block/Scic.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
- /**
3
- * Flagbit_FactFinder
4
- *
5
- * @category Mage
6
- * @package Flagbit_FactFinder
7
- * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
8
- */
9
-
10
- /**
11
- * Block class
12
- *
13
- * This class is used to disable Magento´s default Price and Category Filter Output
14
- *
15
- * @category Mage
16
- * @package Flagbit_FactFinder
17
- * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
18
- * @author Joerg Weller <weller@flagbit.de>
19
- * @version $Id$
20
- */
21
- class Flagbit_FactFinder_Block_Scic extends Mage_Core_Block_Template
22
- {
23
-
24
- /**
25
- * get Product Result Collection
26
- *
27
- * @return Flagbit_FactFinder_Model_Mysql4_Search_Collection
28
- */
29
- protected function _getProductResultCollection()
30
- {
31
- return Mage::getSingleton('factfinder/layer')->getProductCollection();
32
- }
33
-
34
- /**
35
- * get Product URL to ID Mapping JSON Object
36
- *
37
- * @return string
38
- */
39
- public function getJsonUrlToIdMappingObject()
40
- {
41
- $data = array();
42
- foreach($this->_getProductResultCollection() as $product){
43
- $data[$product->getProductUrl()] = $product->getId();
44
- }
45
- return Mage::helper('core')->jsonEncode($data);
46
- }
47
-
48
- /**
49
- * get Product and Search Details by ID as JSON Object
50
- *
51
- * @return string
52
- */
53
- public function getJsonDataObject()
54
- {
55
- $searchHelper = Mage::helper('factfinder/search');
56
- $idFieldName = $searchHelper->getIdFieldName();
57
-
58
- $dataTemplate = array(
59
- 'query' => $searchHelper->getQuery()->getQueryText(),
60
- 'page' => $searchHelper->getCurrentPage(),
61
- 'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
62
- 'pageSize' => $searchHelper->getPageLimit(),
63
- 'origPageSize' => $searchHelper->getDefaultPerPageValue(),
64
- 'channel' => Mage::getStoreConfig('factfinder/search/channel'),
65
- 'event' => 'click'
66
- );
67
-
68
- $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
69
- if ($customerId) {
70
- $dataTemplate['userId'] = md5('customer_' . $customerId);
71
- }
72
-
73
- $data = array();
74
- foreach($this->_getProductResultCollection() as $product){
75
- $key = $product->getId();
76
- $data[$key] = array(
77
- 'id' => $product->getData($idFieldName),
78
- 'pos' => $product->getPosition(),
79
- 'origPos' => $product->getOriginalPosition(),
80
- 'title' => $product->getName(),
81
- 'simi' => $product->getSimilarity()
82
- );
83
- $data[$key] += $dataTemplate;
84
- }
85
-
86
- return Mage::helper('core')->jsonEncode($data);
87
- }
88
-
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Flagbit/FactFinder/Block/Tracking.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Flagbit_FactFinder
4
+ *
5
+ * @category Mage
6
+ * @package Flagbit_FactFinder
7
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
8
+ */
9
+
10
+ /**
11
+ * Tracking block class
12
+ *
13
+ * @category Mage
14
+ * @package Flagbit_FactFinder
15
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
16
+ * @author Joerg Weller <joerg.weller@flagbit.de>
17
+ * @author Nicolai Essig <nicolai.essig@flagbit.de>
18
+ * @version $Id$
19
+ */
20
+ class Flagbit_FactFinder_Block_Tracking extends Mage_Core_Block_Template
21
+ {
22
+
23
+ /**
24
+ * get Product Result Collection
25
+ *
26
+ * @return Flagbit_FactFinder_Model_Mysql4_Search_Collection
27
+ */
28
+ protected function _getProductResultCollection()
29
+ {
30
+ return Mage::getSingleton('factfinder/layer')->getProductCollection();
31
+ }
32
+
33
+ /**
34
+ * get Product URL to ID Mapping JSON Object
35
+ *
36
+ * @return string
37
+ */
38
+ public function getJsonUrlToIdMappingObject()
39
+ {
40
+ $data = array();
41
+ foreach($this->_getProductResultCollection() as $product){
42
+ $data[$product->getProductUrl()] = $product->getId();
43
+ }
44
+ return Mage::helper('core')->jsonEncode($data);
45
+ }
46
+
47
+ /**
48
+ * get Product and Search Details by ID as JSON Object
49
+ *
50
+ * @return string
51
+ */
52
+ public function getJsonDataObject()
53
+ {
54
+ $searchHelper = Mage::helper('factfinder/search');
55
+ $idFieldName = $searchHelper->getIdFieldName();
56
+
57
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
58
+ if ($customerId) {
59
+ $customerId = md5('customer_' . $customerId);
60
+ }
61
+
62
+ if(Mage::helper('factfinder')->useOldTracking())
63
+ {
64
+ $dataTemplate = array(
65
+ 'query' => $searchHelper->getQuery()->getQueryText(),
66
+ 'page' => $searchHelper->getCurrentPage(),
67
+ 'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
68
+ 'pageSize' => $searchHelper->getPageLimit(),
69
+ 'origPageSize' => $searchHelper->getDefaultPerPageValue(),
70
+ 'channel' => Mage::getStoreConfig('factfinder/search/channel'),
71
+ 'userId' => $customerId,
72
+ 'event' => 'click'
73
+ );
74
+ } else {
75
+ $dataTemplate = array(
76
+ 'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey(),
77
+ 'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
78
+ 'uid' => $customerId,
79
+ 'site' => Mage::app()->getStore()->getCode(),
80
+ 'event' => FACTFinder_Default_TrackingAdapter::EVENT_INSPECT
81
+ );
82
+ }
83
+
84
+ $data = array();
85
+ foreach($this->_getProductResultCollection() as $product){
86
+ $key = $product->getId();
87
+
88
+ $data[$key] = array(
89
+ 'id' => $product->getData($idFieldName),
90
+ );
91
+
92
+ if(Mage::helper('factfinder')->useOldTracking())
93
+ {
94
+ $data[$key] += array(
95
+ 'pos' => $product->getPosition(),
96
+ 'origPos' => $product->getOriginalPosition(),
97
+ 'title' => $product->getName(),
98
+ 'simi' => $product->getSimilarity()
99
+ );
100
+ }
101
+
102
+ $data[$key] += $dataTemplate;
103
+ }
104
+
105
+ return Mage::helper('core')->jsonEncode($data);
106
+ }
107
+
108
+ }
app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Product/List.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
  /**
3
  * Flagbit_FactFinder
4
  *
@@ -9,9 +9,9 @@
9
 
10
  /**
11
  * Block class
12
- *
13
- * This class is used to disable Magento´s default apply Filter
14
- *
15
  * @category Mage
16
  * @package Flagbit_FactFinder
17
  * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
@@ -19,7 +19,7 @@
19
  * @version $Id$
20
  */
21
  class Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List extends Mage_XmlConnect_Block_Catalog_Product_List {
22
-
23
  /**
24
  * Retrieve product collection with all prepared data and limitations
25
  *
@@ -29,24 +29,20 @@ class Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List extends Mage_XmlC
29
  {
30
  if(!Mage::helper('factfinder/search')->getIsEnabled()){
31
  return parent::_getProductCollection();
32
- }
33
-
34
- if (is_null($this->_productCollection)) {
35
- switch($this->getRequest()->getActionName()){
36
-
37
- case 'search':
38
- $this->__getSearchProductCollection();
39
- break;
40
-
41
- default:
42
- parent::_getProductCollection();
43
- break;
44
  }
45
  }
46
  return $this->_productCollection;
47
  }
48
-
49
-
50
  /**
51
  * Retrieve product collection with all prepared data and limitations
52
  *
@@ -73,16 +69,32 @@ class Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List extends Mage_XmlC
73
  * Apply filters
74
  */
75
  foreach ($attributes as $attributeItem) {
76
-
77
  $attributeCode = $attributeItem->getAttributeCode();
78
- $filterModel = $this->helper('xmlconnect')->getFilterByKey($attributeCode);
79
 
80
- $filterModel->setLayer($layer)
81
- ->setAttributeModel($attributeItem);
82
 
83
  $filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $attributeCode;
 
 
 
 
 
 
 
84
  $filters[] = $filterModel;
85
  }
 
 
 
 
 
 
 
 
 
 
 
86
  $this->_collectedFilters = $filters;
87
  }
88
 
@@ -103,20 +115,18 @@ class Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List extends Mage_XmlC
103
  $offset = (int)$request->getParam('offset', 0);
104
  $count = (int)$request->getParam('count', 0);
105
  $count = $count <= 0 ? 1 : $count;
106
- if($offset + $count < $collection->getSize()){
107
  $this->setHasProductItems(1);
108
  }
109
  $collection->getSelect()->limit($count, $offset);
110
-
111
  $collection->setFlag('require_stock_items', true);
112
-
113
  $this->_productCollection = $collection;
114
  }
115
-
116
  return $this->_productCollection;
117
- }
 
118
 
119
-
120
  }
121
 
122
 
1
+ <?php
2
  /**
3
  * Flagbit_FactFinder
4
  *
9
 
10
  /**
11
  * Block class
12
+ *
13
+ * This class is used to disable Magento´s default apply Filter
14
+ *
15
  * @category Mage
16
  * @package Flagbit_FactFinder
17
  * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
19
  * @version $Id$
20
  */
21
  class Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List extends Mage_XmlConnect_Block_Catalog_Product_List {
22
+
23
  /**
24
  * Retrieve product collection with all prepared data and limitations
25
  *
29
  {
30
  if(!Mage::helper('factfinder/search')->getIsEnabled()){
31
  return parent::_getProductCollection();
32
+ }
33
+
34
+ if (is_null($this->_productCollection)) {
35
+ if (strpos($this->getRequest()->getActionName(), 'search') !== false) {
36
+ $this->__getSearchProductCollection();
37
+ }
38
+ else {
39
+ parent::_getProductCollection();
 
 
 
 
40
  }
41
  }
42
  return $this->_productCollection;
43
  }
44
+
45
+
46
  /**
47
  * Retrieve product collection with all prepared data and limitations
48
  *
69
  * Apply filters
70
  */
71
  foreach ($attributes as $attributeItem) {
 
72
  $attributeCode = $attributeItem->getAttributeCode();
73
+ list($filterModel, $filterBlock) = $this->helper('xmlconnect')->getFilterByKey($attributeCode);
74
 
75
+ $filterModel->setLayer($layer)->setAttributeModel($attributeItem);
 
76
 
77
  $filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $attributeCode;
78
+ /**
79
+ * Set new request var
80
+ */
81
+ if (isset($requestParams[$filterParam])) {
82
+ $filterModel->setRequestVar($filterParam);
83
+ }
84
+ $filterModel->apply($request, $filterBlock);
85
  $filters[] = $filterModel;
86
  }
87
+
88
+ /**
89
+ * Separately apply and save category filter
90
+ */
91
+ list($categoryFilter, $categoryFilterBlock) = $this->helper('xmlconnect')->getFilterByKey('category');
92
+ $filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $categoryFilter->getRequestVar();
93
+
94
+ $categoryFilter->setLayer($layer)->setRequestVar($filterParam)
95
+ ->apply($this->getRequest(), $categoryFilterBlock);
96
+ $filters[] = $categoryFilter;
97
+
98
  $this->_collectedFilters = $filters;
99
  }
100
 
115
  $offset = (int)$request->getParam('offset', 0);
116
  $count = (int)$request->getParam('count', 0);
117
  $count = $count <= 0 ? 1 : $count;
118
+ if ($offset + $count < $collection->getSize()) {
119
  $this->setHasProductItems(1);
120
  }
121
  $collection->getSelect()->limit($count, $offset);
 
122
  $collection->setFlag('require_stock_items', true);
123
+
124
  $this->_productCollection = $collection;
125
  }
 
126
  return $this->_productCollection;
127
+ }
128
+
129
 
 
130
  }
131
 
132
 
app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Search.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
  /**
3
  * Flagbit_FactFinder
4
  *
@@ -9,9 +9,9 @@
9
 
10
  /**
11
  * Block class
12
- *
13
  * This class is used provide FAC-Finder filters
14
- *
15
  * @category Mage
16
  * @package Flagbit_FactFinder
17
  * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
@@ -19,8 +19,8 @@
19
  * @version $Id$
20
  */
21
  class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search extends Mage_XmlConnect_Block_Catalog_Search {
22
-
23
-
24
  /**
25
  * Search results xml renderer
26
  * XML also contains filters that can be apply (accorfingly already applyed filters and search query)
@@ -32,8 +32,8 @@ class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search extends Mage_XmlConnect
32
  {
33
  if(!Mage::helper('factfinder/search')->getIsEnabled()){
34
  return parent::_toHtml();
35
- }
36
-
37
  $searchXmlObject = new Mage_XmlConnect_Model_Simplexml_Element('<search></search>');
38
  $filtersXmlObject = new Mage_XmlConnect_Model_Simplexml_Element('<filters></filters>');
39
 
@@ -80,28 +80,27 @@ class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search extends Mage_XmlConnect
80
  }
81
  if ($isLayeredNavigationAllowed && $productListBlock && $showFiltersAndOrders) {
82
  $filters = $productListBlock->getCollectedFilters();
83
-
84
  /**
85
  * Render filters xml
86
  */
87
  foreach ($filters as $filter) {
88
- if (!count($filter->getAttributeModel()->getItems())) {
89
  continue;
90
  }
91
-
92
  $item = $filtersXmlObject->addChild('item');
93
  $item->addChild('name', $searchXmlObject->xmlentities($filter->getName()));
94
  $item->addChild('code', $filter->getRequestVar());
95
  $values = $item->addChild('values');
96
 
97
- foreach ($filter->getAttributeModel()->getItems() as $valueArray) {
98
- $valueItem = new Varien_Object($valueArray);
99
  $count = (int)$valueItem->getCount();
100
  if (!$count) {
101
  continue;
102
  }
103
  $value = $values->addChild('value');
104
- $value->addChild('id', base64_encode($valueItem->getValue()));
105
  $value->addChild('label', $searchXmlObject->xmlentities(strip_tags($valueItem->getLabel())));
106
  $value->addChild('count', $count);
107
  }
@@ -113,11 +112,22 @@ class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search extends Mage_XmlConnect
113
  * Sort fields
114
  */
115
  if ($showFiltersAndOrders) {
116
- $searchXmlObject->appendChild($this->getProductSortFeildsXmlObject());
117
  }
118
 
119
  return $searchXmlObject->asNiceXml();
120
  }
121
-
122
-
123
- }
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
  /**
3
  * Flagbit_FactFinder
4
  *
9
 
10
  /**
11
  * Block class
12
+ *
13
  * This class is used provide FAC-Finder filters
14
+ *
15
  * @category Mage
16
  * @package Flagbit_FactFinder
17
  * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
19
  * @version $Id$
20
  */
21
  class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search extends Mage_XmlConnect_Block_Catalog_Search {
22
+
23
+
24
  /**
25
  * Search results xml renderer
26
  * XML also contains filters that can be apply (accorfingly already applyed filters and search query)
32
  {
33
  if(!Mage::helper('factfinder/search')->getIsEnabled()){
34
  return parent::_toHtml();
35
+ }
36
+
37
  $searchXmlObject = new Mage_XmlConnect_Model_Simplexml_Element('<search></search>');
38
  $filtersXmlObject = new Mage_XmlConnect_Model_Simplexml_Element('<filters></filters>');
39
 
80
  }
81
  if ($isLayeredNavigationAllowed && $productListBlock && $showFiltersAndOrders) {
82
  $filters = $productListBlock->getCollectedFilters();
83
+
84
  /**
85
  * Render filters xml
86
  */
87
  foreach ($filters as $filter) {
88
+ if (!$this->_isFilterItemsHasValues($filter)) {
89
  continue;
90
  }
91
+
92
  $item = $filtersXmlObject->addChild('item');
93
  $item->addChild('name', $searchXmlObject->xmlentities($filter->getName()));
94
  $item->addChild('code', $filter->getRequestVar());
95
  $values = $item->addChild('values');
96
 
97
+ foreach ($filter->getItems() as $valueItem) {
 
98
  $count = (int)$valueItem->getCount();
99
  if (!$count) {
100
  continue;
101
  }
102
  $value = $values->addChild('value');
103
+ $value->addChild('id', $valueItem->getValueString());
104
  $value->addChild('label', $searchXmlObject->xmlentities(strip_tags($valueItem->getLabel())));
105
  $value->addChild('count', $count);
106
  }
112
  * Sort fields
113
  */
114
  if ($showFiltersAndOrders) {
115
+ $searchXmlObject->appendChild($this->getProductSortFieldsXmlObject());
116
  }
117
 
118
  return $searchXmlObject->asNiceXml();
119
  }
120
+
121
+ /**
122
+ * Overwrite original fallback, because they forgot to return
123
+ *
124
+ * @return Mage_XmlConnect_Model_Simplexml_Element
125
+ */
126
+ public function getProductSortFieldsXmlObject()
127
+ {
128
+ if(method_exists(get_parent_class($this), 'getProductSortFieldsXmlObject')) {
129
+ return parent::getProductSortFieldsXmlObject();
130
+ }
131
+ return parent::getProductSortFeildsXmlObject();
132
+ }
133
+ }
app/code/community/Flagbit/FactFinder/Helper/Data.php CHANGED
@@ -32,5 +32,15 @@ class Flagbit_FactFinder_Helper_Data extends Mage_Core_Helper_Abstract {
32
  $model = Mage::getConfig()->getNode("global/models/$code");
33
  return $module && $module->is('active') || $model;
34
  }
 
 
 
 
 
 
 
 
 
 
35
 
36
  }
32
  $model = Mage::getConfig()->getNode("global/models/$code");
33
  return $module && $module->is('active') || $model;
34
  }
35
+
36
+ /**
37
+ * Decide which tracking should be used
38
+ *
39
+ * @return bool
40
+ */
41
+ public function useOldTracking()
42
+ {
43
+ return (Mage::getStoreConfig('factfinder/search/ffversion') < 69);
44
+ }
45
 
46
  }
app/code/community/Flagbit/FactFinder/Helper/Search.php CHANGED
@@ -112,7 +112,7 @@ class Flagbit_FactFinder_Helper_Search extends Mage_Core_Helper_Abstract {
112
  $nextRetryTimestamp = intval(time() / 60) + $delay;
113
  Mage::app()->saveCache($nextRetryTimestamp, $this->_getCacheId('nextRetryTimestamp'), array(self::CACHE_TAG));
114
  }
115
-
116
  protected function _disableFallback()
117
  {
118
  self::$_skipFactFinder = false;
@@ -145,7 +145,7 @@ class Flagbit_FactFinder_Helper_Search extends Mage_Core_Helper_Abstract {
145
 
146
  return self::$_skipFactFinder;
147
  }
148
-
149
  /**
150
  * resets all fallback counter values.
151
  *
@@ -170,7 +170,7 @@ class Flagbit_FactFinder_Helper_Search extends Mage_Core_Helper_Abstract {
170
 
171
  $failedAttempts = $this->_loadFailedAttempts();
172
  $failedAttempts = $this->_removeOldEntries($failedAttempts);
173
- $failedAttempts[] = intval(time() / 60);
174
  $this->_saveFailedAttempts($failedAttempts);
175
 
176
  self::$_failedAttemptRegistered = true;
@@ -279,7 +279,8 @@ class Flagbit_FactFinder_Helper_Search extends Mage_Core_Helper_Abstract {
279
  */
280
  public function getIsOnSearchPage()
281
  {
282
- return Mage::app()->getRequest()->getModuleName() == 'catalogsearch' || Mage::app()->getRequest()->getModuleName() == 'xmlconnect';
 
283
  }
284
 
285
 
112
  $nextRetryTimestamp = intval(time() / 60) + $delay;
113
  Mage::app()->saveCache($nextRetryTimestamp, $this->_getCacheId('nextRetryTimestamp'), array(self::CACHE_TAG));
114
  }
115
+
116
  protected function _disableFallback()
117
  {
118
  self::$_skipFactFinder = false;
145
 
146
  return self::$_skipFactFinder;
147
  }
148
+
149
  /**
150
  * resets all fallback counter values.
151
  *
170
 
171
  $failedAttempts = $this->_loadFailedAttempts();
172
  $failedAttempts = $this->_removeOldEntries($failedAttempts);
173
+ $failedAttempts[] = intval(time() / 60);
174
  $this->_saveFailedAttempts($failedAttempts);
175
 
176
  self::$_failedAttemptRegistered = true;
279
  */
280
  public function getIsOnSearchPage()
281
  {
282
+ return Mage::app()->getRequest()->getModuleName() == 'catalogsearch' ||
283
+ (Mage::app()->getRequest()->getModuleName() == 'xmlconnect' && strpos(Mage::app()->getRequest()->getActionName(), 'search') !== false);
284
  }
285
 
286
 
app/code/community/Flagbit/FactFinder/Model/Export/Product.php CHANGED
@@ -456,7 +456,7 @@ class Flagbit_FactFinder_Model_Export_Product extends Mage_CatalogSearch_Model_M
456
  )
457
  )
458
  ->where('main.store_id = ?', $storeId)
459
- ->where('e.path LIKE \'1/' . Mage::app()->getStore()->getRootCategoryId() .'/%\'')
460
  ->group('main.product_id');
461
 
462
  $this->_productsToCategoryPath = $this->_getReadAdapter()->fetchPairs($select);
456
  )
457
  )
458
  ->where('main.store_id = ?', $storeId)
459
+ ->where('e.path LIKE \'1/' . Mage::app()->getStore($storeId)->getRootCategoryId() .'/%\'')
460
  ->group('main.product_id');
461
 
462
  $this->_productsToCategoryPath = $this->_getReadAdapter()->fetchPairs($select);
app/code/community/Flagbit/FactFinder/Model/Facade.php CHANGED
@@ -111,6 +111,11 @@ class Flagbit_FactFinder_Model_Facade
111
  return $this->_getAdapter("similarRecords", $channel);
112
  }
113
 
 
 
 
 
 
114
  public function configureSearchAdapter($params, $channel = null, $id = null)
115
  {
116
  $this->_configureAdapter($params, "search", $channel, $id);
@@ -156,6 +161,11 @@ class Flagbit_FactFinder_Model_Facade
156
  $this->_configureAdapter($params, "similarRecords", $channel, $id);
157
  }
158
 
 
 
 
 
 
159
  protected function _configureAdapter($params, $type, $channel = null, $id = null)
160
  {
161
  $adapter = $this->_getAdapter($type, $channel, $id);
@@ -300,6 +310,11 @@ class Flagbit_FactFinder_Model_Facade
300
  }
301
 
302
  public function applyTracking($channel = null, $id = null)
 
 
 
 
 
303
  {
304
  return $this->_getFactFinderObject("Scic", "applyTracking", $channel, $id);
305
  }
@@ -361,10 +376,25 @@ class Flagbit_FactFinder_Model_Facade
361
 
362
  protected function _getFactFinderObject($adapterType, $objectGetter, $channel = null, $id = null)
363
  {
 
 
 
 
 
 
 
364
  try {
365
  $this->_loadAllData();
366
  $adapterGetter = "get".$adapterType."Adapter";
367
- return $this->$adapterGetter($channel, $id)->$objectGetter();
 
 
 
 
 
 
 
 
368
  } catch (Exception $e) {
369
  Mage::logException($e);
370
  return null;
111
  return $this->_getAdapter("similarRecords", $channel);
112
  }
113
 
114
+ public function getTrackingAdapter($channel = null)
115
+ {
116
+ return $this->_getAdapter("tracking", $channel);
117
+ }
118
+
119
  public function configureSearchAdapter($params, $channel = null, $id = null)
120
  {
121
  $this->_configureAdapter($params, "search", $channel, $id);
161
  $this->_configureAdapter($params, "similarRecords", $channel, $id);
162
  }
163
 
164
+ public function configureTrackingAdapter($params, $channel = null, $id = null)
165
+ {
166
+ $this->_configureAdapter($params, "tracking", $channel, $id);
167
+ }
168
+
169
  protected function _configureAdapter($params, $type, $channel = null, $id = null)
170
  {
171
  $adapter = $this->_getAdapter($type, $channel, $id);
310
  }
311
 
312
  public function applyTracking($channel = null, $id = null)
313
+ {
314
+ return $this->_getFactFinderObject("Tracking", "applyTracking", $channel, $id);
315
+ }
316
+
317
+ public function applyScicTracking($channel = null, $id = null)
318
  {
319
  return $this->_getFactFinderObject("Scic", "applyTracking", $channel, $id);
320
  }
376
 
377
  protected function _getFactFinderObject($adapterType, $objectGetter, $channel = null, $id = null)
378
  {
379
+ $cacheKey = 'FACTFINDER_'.implode('_',func_get_args()).'_' . md5(serialize($this->_getParamsParser()));
380
+
381
+ if(Mage::app()->useCache('factfinder_search') && $cache = Mage::app()->loadCache($cacheKey))
382
+ {
383
+ return unserialize($cache);
384
+ }
385
+
386
  try {
387
  $this->_loadAllData();
388
  $adapterGetter = "get".$adapterType."Adapter";
389
+
390
+ $data = $this->$adapterGetter($channel, $id)->$objectGetter();
391
+
392
+ if(Mage::app()->useCache('factfinder_search'))
393
+ {
394
+ Mage::app()->saveCache(serialize($data), $cacheKey, array('FACTFINDER_SEARCH'), 600);
395
+ }
396
+
397
+ return $data;
398
  } catch (Exception $e) {
399
  Mage::logException($e);
400
  return null;
app/code/community/Flagbit/FactFinder/Model/Handler/ProductDetailCampaign.php CHANGED
@@ -20,7 +20,7 @@ class Flagbit_FactFinder_Model_Handler_ProductDetailCampaign
20
  protected function _getProductNumberParam()
21
  {
22
  if(is_array($this->_productIds))
23
- return $this->_productIds[0];
24
  else
25
  return $this->_productIds;
26
  }
20
  protected function _getProductNumberParam()
21
  {
22
  if(is_array($this->_productIds))
23
+ return current($this->_productIds);
24
  else
25
  return $this->_productIds;
26
  }
app/code/community/Flagbit/FactFinder/Model/Handler/Search.php CHANGED
@@ -49,7 +49,7 @@ class Flagbit_FactFinder_Model_Handler_Search
49
  $params['idsOnly'] = FF::getSingleton('configuration')->getIdsOnly() ? 'true' : 'false';
50
  $params['query'] = $_query;
51
 
52
- $count = $requestParams['count'];
53
  if ($count > 0) {
54
  $params['productsPerPage'] = $count;
55
  $params['page'] = ($requestParams['offset'] / $count) + 1;
@@ -92,6 +92,9 @@ class Flagbit_FactFinder_Model_Handler_Search
92
  $requestParams['Category'] = $this->_getCurrentFactFinderCategoryPath();
93
  }
94
 
 
 
 
95
  case "catalogsearch":
96
  default:
97
  $_query = '*';
@@ -352,6 +355,12 @@ class Flagbit_FactFinder_Model_Handler_Search
352
  $value .= '~~~'.$selectOptions[$option->getField()];
353
  }
354
  }
 
 
 
 
 
 
355
  break;
356
  }
357
  return $value;
49
  $params['idsOnly'] = FF::getSingleton('configuration')->getIdsOnly() ? 'true' : 'false';
50
  $params['query'] = $_query;
51
 
52
+ $count = isset($requestParams['count']) ? $requestParams['count'] : 0;
53
  if ($count > 0) {
54
  $params['productsPerPage'] = $count;
55
  $params['page'] = ($requestParams['offset'] / $count) + 1;
92
  $requestParams['Category'] = $this->_getCurrentFactFinderCategoryPath();
93
  }
94
 
95
+
96
+ $params['navigation'] = 'true';
97
+
98
  case "catalogsearch":
99
  default:
100
  $_query = '*';
355
  $value .= '~~~'.$selectOptions[$option->getField()];
356
  }
357
  }
358
+
359
+ // Workaround if only one option is selected
360
+ if($value == $option->getField().'|') {
361
+ $value = '';
362
+ }
363
+
364
  break;
365
  }
366
  return $value;
app/code/community/Flagbit/FactFinder/Model/Handler/Tracking.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handles tracking data
4
+ *
5
+ * @category Mage
6
+ * @package Flagbit_FactFinder
7
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
8
+ * @author Nicolai Essig <nicolai.essig@flagbit.de>
9
+ * @version $Id: Tracking.php 20.08.13 11:35 $
10
+ *
11
+ **/
12
+ class Flagbit_FactFinder_Model_Handler_Tracking
13
+ extends Flagbit_FactFinder_Model_Handler_Abstract
14
+ {
15
+ /**
16
+ * @var array
17
+ */
18
+ protected $_trackingAdapter;
19
+
20
+ /**
21
+ * {@inheritdoc}
22
+ */
23
+ protected function configureFacade() {}
24
+
25
+ /**
26
+ * Get tracking adapter
27
+ *
28
+ * @return tracking adapter object
29
+ */
30
+ public function getTrackingAdapter()
31
+ {
32
+ if($this->_trackingAdapter === null)
33
+ {
34
+ if(Mage::helper('factfinder')->useOldTracking()) {
35
+ $this->_trackingAdapter = Mage::getModel('factfinder/handler_tracking_scic');
36
+ }
37
+ // If old tracking was not activated use the new tracking
38
+ if ($this->_trackingAdapter === null) {
39
+ $this->_trackingAdapter = $this->_getFacade()->getTrackingAdapter();
40
+ }
41
+ if ($this->_trackingAdapter === null)
42
+ $this->_trackingAdapter = array();
43
+ }
44
+ return $this->_trackingAdapter;
45
+ }
46
+
47
+ /**
48
+ * Fire tracking request
49
+ *
50
+ * @return mixed|null
51
+ */
52
+ public function applyTracking()
53
+ {
54
+ if(Mage::helper('factfinder')->useOldTracking()) {
55
+ $result = $this->_getFacade()->applyScicTracking();
56
+ } else {
57
+ $result = $this->_getFacade()->applyTracking();
58
+ }
59
+
60
+ Mage::getSingleton('core/session')->setFactFinderRefKey(null);
61
+
62
+ return $result;
63
+ }
64
+ }
app/code/community/Flagbit/FactFinder/Model/Handler/Tracking/Scic.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Creates a mapping between new and old tracking methods
4
+ *
5
+ * @category Mage
6
+ * @package Flagbit_FactFinder
7
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
8
+ * @author Nicolai Essig <nicolai.essig@flagbit.de>
9
+ * @version $Id: Scic.php 26.08.13 15:05 $
10
+ *
11
+ **/
12
+ class Flagbit_FactFinder_Model_Handler_Tracking_Scic
13
+ extends Flagbit_FactFinder_Model_Handler_Abstract
14
+ {
15
+ protected function configureFacade() {}
16
+
17
+ /**
18
+ * Mapping method from new -> old tracking
19
+ *
20
+ * @param $event
21
+ * @param $inputParams
22
+ * @return FACTFinder_Default_ScicAdapter
23
+ */
24
+ public function setupEventTracking($event, $inputParams)
25
+ {
26
+ /* @var $scicAdapter FACTFinder_Default_ScicAdapter */
27
+ $scicAdapter = $this->_getFacade()->getScicAdapter();
28
+
29
+ switch ($event) {
30
+ case FACTFinder_Default_TrackingAdapter::EVENT_INSPECT:
31
+ $searchHelper = $searchHelper = Mage::helper('factfinder/search');
32
+ $scicAdapter->setupClickTracking(
33
+ $inputParams['id'],
34
+ $inputParams['sid'],
35
+ $searchHelper->getQuery()->getQueryText(),
36
+ 1, //pos
37
+ 1, //origPos
38
+ 1, //page
39
+ $inputParams['product']->getSimilarity(),
40
+ $inputParams['product']->getName(),
41
+ $searchHelper->getPageLimit(),
42
+ $searchHelper->getDefaultPerPageValue());
43
+ break;
44
+ case FACTFinder_Default_TrackingAdapter::EVENT_CART:
45
+ $scicAdapter->setupCartTracking(
46
+ $inputParams['id'],
47
+ $inputParams['sid'],
48
+ $inputParams['amount'],
49
+ $inputParams['price'],
50
+ $inputParams['uid']
51
+ );
52
+ break;
53
+ case FACTFinder_Default_TrackingAdapter::EVENT_BUY:
54
+ $scicAdapter->setupCheckoutTracking(
55
+ $inputParams['id'],
56
+ $inputParams['sid'],
57
+ $inputParams['amount'],
58
+ $inputParams['price'],
59
+ $inputParams['uid']
60
+ );
61
+ break;
62
+ case FACTFinder_Default_TrackingAdapter::EVENT_DISPLAY:
63
+ case FACTFinder_Default_TrackingAdapter::EVENT_FEEDBACK:
64
+ case FACTFinder_Default_TrackingAdapter::EVENT_AVAILABILITY_CHECK:
65
+ case FACTFinder_Default_TrackingAdapter::EVENT_CACHE_HIT:
66
+ case FACTFinder_Default_TrackingAdapter::EVENT_SESSION_START:
67
+ // Not implemented yet
68
+ break;
69
+ }
70
+
71
+ return $scicAdapter;
72
+ }
73
+ }
app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Item.php CHANGED
@@ -8,8 +8,8 @@ class Flagbit_FactFinder_Model_Layer_Filter_Item extends Mage_Catalog_Model_Laye
8
  * @return string
9
  */
10
  public function getRemoveUrl()
11
- {
12
- if ($this->getFilter()->getRequestVar() == 'Category' && $this->getValue() != '') {
13
  $query = array($this->getFilter()->getRequestVar()=>$this->getValue());
14
  $params['_current'] = true;
15
  $params['_use_rewrite'] = true;
8
  * @return string
9
  */
10
  public function getRemoveUrl()
11
+ {
12
+ if (strtolower($this->getFilter()->getRequestVar()) == 'category' || $this->getValue() != '') {
13
  $query = array($this->getFilter()->getRequestVar()=>$this->getValue());
14
  $params['_current'] = true;
15
  $params['_use_rewrite'] = true;
app/code/community/Flagbit/FactFinder/Model/Mysql4/Search/Collection.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @category Mage
6
  * @package Flagbit_FactFinder
7
- * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
8
  */
9
 
10
  /**
@@ -14,8 +14,9 @@
14
  *
15
  * @category Mage
16
  * @package Flagbit_FactFinder
17
- * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
18
- * @author Joerg Weller <weller@flagbit.de>
 
19
  * @version $Id$
20
  */
21
  class Flagbit_FactFinder_Model_Mysql4_Search_Collection
@@ -50,6 +51,12 @@ class Flagbit_FactFinder_Model_Mysql4_Search_Collection
50
  {
51
  // get product IDs from Fact-Finder
52
  $productIds = $this->_getSearchHandler()->getSearchResult();
 
 
 
 
 
 
53
 
54
  if (!empty($productIds)) {
55
  $idFieldName = Mage::helper('factfinder/search')->getIdFieldName();
4
  *
5
  * @category Mage
6
  * @package Flagbit_FactFinder
7
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
8
  */
9
 
10
  /**
14
  *
15
  * @category Mage
16
  * @package Flagbit_FactFinder
17
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
18
+ * @author Joerg Weller <joerg.weller@flagbit.de>
19
+ * @author Nicolai Essig <nicolai.essig@flagbit.de>
20
  * @version $Id$
21
  */
22
  class Flagbit_FactFinder_Model_Mysql4_Search_Collection
51
  {
52
  // get product IDs from Fact-Finder
53
  $productIds = $this->_getSearchHandler()->getSearchResult();
54
+
55
+ Mage::getSingleton('core/session')->setFactFinderRefKey(null);
56
+ if($refKey = Mage::getSingleton('factfinder/facade')->getSearchResult()->getRefKey())
57
+ {
58
+ Mage::getSingleton('core/session')->setFactFinderRefKey($refKey);
59
+ }
60
 
61
  if (!empty($productIds)) {
62
  $idFieldName = Mage::helper('factfinder/search')->getIdFieldName();
app/code/community/Flagbit/FactFinder/Model/Observer.php CHANGED
@@ -14,9 +14,10 @@
14
  *
15
  * @category Mage
16
  * @package Flagbit_FactFinder
17
- * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
18
- * @author Michael Türk <tuerk@flagbit.de>
19
- * @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
 
20
  */
21
  class Flagbit_FactFinder_Model_Observer
22
  {
@@ -49,20 +50,68 @@ class Flagbit_FactFinder_Model_Observer
49
  }
50
 
51
  try {
52
- $facade = Mage::getModel('factfinder/facade');
53
- $facade->getScicAdapter()->setupCartTracking(
54
- $product->getData($idFieldName),
55
- md5(Mage::getSingleton('core/session')->getSessionId()),
56
- $qty,
57
- $product->getFinalPrice($qty),
58
- $customerId);
59
- $facade->applyTracking();
 
 
 
 
 
 
 
60
  }
61
  catch (Exception $e) {
62
  Mage::helper('factfinder/debug')->log($e->getMessage());
63
  }
64
  }
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  /**
68
  * Observer method
@@ -129,14 +178,22 @@ class Flagbit_FactFinder_Model_Observer
129
  $facade->setStoreId($item->getStoreId());
130
  $storeId = $item->getStoreId();
131
  }
132
- $facade->getScicAdapter()->setupCheckoutTracking(
133
- $item->getProductId(),
134
- $item->getSid(),
135
- $item->getCount(),
136
- $item->getPrice(),
137
- $item->getUserid());
138
 
139
- $facade->applyTracking();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
  $item->delete($item);
142
  }
@@ -220,12 +277,12 @@ class Flagbit_FactFinder_Model_Observer
220
  $matches = array();
221
  $label = preg_quote(Mage::helper('factfinder')->__('FACT-Finder Business User Cockpit'));
222
  $pattern = '/(\<a[^\>]*href=\"([^\"]*)\"[^\>]*)\>\w*\<span\>\w*' . $label . '\w*\<\/span\>/msU';
223
- preg_match($pattern, $html, $matches);
224
-
225
- $url = Mage::getSingleton('factfinder/facade')->getManagementUrl();
226
- $replace = str_replace($matches[2], $url, $matches[1]) . ' target="_blank"';
227
-
228
- $transport->setHtml(str_replace($matches[1], $replace, $html));
229
  }
230
 
231
  /**
@@ -253,11 +310,7 @@ class Flagbit_FactFinder_Model_Observer
253
  $update->addHandle('factfinder_suggest_version_gt68');
254
  }
255
  }
256
- if (Mage::helper('factfinder/search')->getIsEnabled(false, 'advisory')) {
257
- $layout = $observer->getLayout();
258
- $update = $layout->getUpdate();
259
- $update->addHandle('factfinder_advisory_enabled');
260
- }
261
  $request = Mage::app()->getRequest();
262
  //catalogsearch_result_index
263
  if (Mage::helper('factfinder/search')->getIsEnabled(false, 'clicktracking')
@@ -270,30 +323,49 @@ class Flagbit_FactFinder_Model_Observer
270
  }
271
  }
272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  /**
274
  * Checks if the result set's size is one. If so the user is redirected to the product detail page. This is checked
275
- * right before the first block is rendered so headers can still be sent. The ordinary collection load event is
276
  * triggered too late.
277
- *
278
- * @param Varien_Event_Observer $observer
279
  */
280
- public function redirectToProductIfSingleResult($observer)
281
  {
282
  if (!Mage::helper('factfinder/search')->getIsEnabled() || !Mage::helper('factfinder/search')->getIsOnSearchPage() || Mage::registry('redirectAlreadyChecked')) {
283
  return;
284
  }
285
-
286
  Mage::register('redirectAlreadyChecked', 1);
287
  if (Mage::getStoreConfig('factfinder/config/redirectOnSingleResult')) {
288
  $block = Mage::app()->getLayout()->getBlock('search_result_list');
289
-
290
  if (!$block instanceof Mage_Catalog_Block_Product_List) {
291
  return;
292
  }
293
-
294
  $collection = $block->getLoadedProductCollection();
295
  $collection->load();
296
-
297
  if (count($collection) == 1) {
298
  $product = $collection->getFirstItem();
299
 
@@ -305,53 +377,13 @@ class Flagbit_FactFinder_Model_Observer
305
  exit;
306
  }
307
  }
308
-
309
- $response = Mage::app()->getResponse();
310
- $response->setHeader('Expires', gmdate("D, d M Y H:i:s", time() + 600), true);
311
- $response->setHeader('Cache-Control', 'public, max-age=600, must-revalidate', true);
312
- $response->setHeader('Pragma', null, true);
313
- }
314
-
315
- protected function sendClickTrackingForSingleProduct($product)
316
- {
317
- $searchHelper = Mage::helper('factfinder/search');
318
-
319
- if (!$searchHelper->getIsEnabled(false, 'clicktracking')) {
320
- return;
321
- }
322
-
323
- try {
324
- $idFieldName = $searchHelper->getIdFieldName();
325
-
326
- $facade = Mage::getModel('factfinder/facade');
327
- $facade->getScicAdapter()->setupClickTracking(
328
- $product->getData($idFieldName),
329
- md5(Mage::getSingleton('core/session')->getSessionId()),
330
- $searchHelper->getQuery()->getQueryText(),
331
- 1, //pos
332
- 1, //origPos
333
- 1, //page
334
- $product->getSimilarity,
335
- $product->getName(),
336
- $searchHelper->getPageLimit(),
337
- $searchHelper->getDefaultPerPageValue());
338
- $facade->applyTracking();
339
- }
340
- catch (Exception $e) {
341
- Mage::helper('factfinder/debug')->log($e->getMessage());
342
- }
343
- }
344
-
345
- public function initializeAfterSearchNavigation()
346
- {
347
- $asnBlock = Mage::registry(self::_asnBlockRegistryKey);
348
- if($asnBlock instanceof Flagbit_FactFinder_Block_Layer)
349
- {
350
- $asnBlock->initializeAfterSearchNavigation();
351
- }
352
  }
353
 
354
- public function handleCampaignRedirect()
 
 
 
 
355
  {
356
  $redirectBlock = Mage::registry(self::_campaignRedirectRegistryKey);
357
  if($redirectBlock instanceof Flagbit_FactFinder_Block_Layer)
14
  *
15
  * @category Mage
16
  * @package Flagbit_FactFinder
17
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
18
+ * @author Michael Türk <michael.tuerk@flagbit.de>
19
+ * @author Nicolai Essig <nicolai.essig@flagbit.de>
20
+ * @version $Id: Observer.php 26.08.13 15:05 $
21
  */
22
  class Flagbit_FactFinder_Model_Observer
23
  {
50
  }
51
 
52
  try {
53
+ /* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
54
+ $tracking = Mage::getModel('factfinder/handler_tracking');
55
+ $tracking->getTrackingAdapter()->setupEventTracking(
56
+ FACTFinder_Default_TrackingAdapter::EVENT_CART,
57
+ array(
58
+ 'id' => $product->getData($idFieldName),
59
+ 'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
60
+ 'amount' => $qty,
61
+ 'price' => $product->getFinalPrice($qty),
62
+ 'uid' => $customerId,
63
+ 'site' => Mage::app()->getStore()->getCode(),
64
+ 'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey()
65
+ )
66
+ );
67
+ $tracking->applyTracking();
68
  }
69
  catch (Exception $e) {
70
  Mage::helper('factfinder/debug')->log($e->getMessage());
71
  }
72
  }
73
 
74
+ /**
75
+ * Tracking of single product click
76
+ *
77
+ * @param $product
78
+ */
79
+ protected function sendClickTrackingForSingleProduct($product)
80
+ {
81
+ $searchHelper = Mage::helper('factfinder/search');
82
+
83
+ if (!$searchHelper->getIsEnabled(false, 'clicktracking')) {
84
+ return;
85
+ }
86
+
87
+ try {
88
+ $idFieldName = $searchHelper->getIdFieldName();
89
+
90
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
91
+ if ($customerId) {
92
+ $customerId = md5('customer_' . $customerId);
93
+ }
94
+
95
+ /* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
96
+ $tracking = Mage::getModel('factfinder/handler_tracking');
97
+ $tracking->getTrackingAdapter()->setupEventTracking(
98
+ FACTFinder_Default_TrackingAdapter::EVENT_INSPECT,
99
+ array(
100
+ 'id' => $product->getData($idFieldName),
101
+ 'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
102
+ 'price' => $product->getFinalPrice(),
103
+ 'uid' => $customerId,
104
+ 'site' => Mage::app()->getStore()->getCode(),
105
+ 'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey(),
106
+ 'product' => $product
107
+ )
108
+ );
109
+ $tracking->applyTracking();
110
+ }
111
+ catch (Exception $e) {
112
+ Mage::helper('factfinder/debug')->log($e->getMessage());
113
+ }
114
+ }
115
 
116
  /**
117
  * Observer method
178
  $facade->setStoreId($item->getStoreId());
179
  $storeId = $item->getStoreId();
180
  }
 
 
 
 
 
 
181
 
182
+ /* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
183
+ $tracking = Mage::getModel('factfinder/handler_tracking');
184
+ $tracking->getTrackingAdapter()->setupEventTracking(
185
+ FACTFinder_Default_TrackingAdapter::EVENT_BUY,
186
+ array(
187
+ 'id' => $item->getProductId(),
188
+ 'sid' => $item->getSid(),
189
+ 'amount' => $item->getCount(),
190
+ 'price' => $item->getPrice(),
191
+ 'uid' => md5('customer_' . $item->getUserid()),
192
+ 'site' => Mage::app()->getStore($storeId)->getCode(),
193
+ 'sourceRefKey' => ''
194
+ )
195
+ );
196
+ $tracking->applyTracking();
197
 
198
  $item->delete($item);
199
  }
277
  $matches = array();
278
  $label = preg_quote(Mage::helper('factfinder')->__('FACT-Finder Business User Cockpit'));
279
  $pattern = '/(\<a[^\>]*href=\"([^\"]*)\"[^\>]*)\>\w*\<span\>\w*' . $label . '\w*\<\/span\>/msU';
280
+ if (preg_match($pattern, $html, $matches)) {
281
+ $url = Mage::getSingleton('factfinder/facade')->getManagementUrl();
282
+ $replace = str_replace($matches[2], $url, $matches[1]) . ' target="_blank"';
283
+
284
+ $transport->setHtml(str_replace($matches[1], $replace, $html));
285
+ }
286
  }
287
 
288
  /**
310
  $update->addHandle('factfinder_suggest_version_gt68');
311
  }
312
  }
313
+
 
 
 
 
314
  $request = Mage::app()->getRequest();
315
  //catalogsearch_result_index
316
  if (Mage::helper('factfinder/search')->getIsEnabled(false, 'clicktracking')
323
  }
324
  }
325
 
326
+ public function initializeAfterSearchNavigation()
327
+ {
328
+ $asnBlock = Mage::registry(self::_asnBlockRegistryKey);
329
+ if($asnBlock instanceof Flagbit_FactFinder_Block_Layer)
330
+ {
331
+ $asnBlock->initializeAfterSearchNavigation();
332
+ }
333
+ }
334
+
335
+ /**
336
+ * Handle redirects in this single method to control the execution order.
337
+ *
338
+ * @param Varien_Event_Observer $observer
339
+ */
340
+ public function handleRedirects(Varien_Event_Observer $observer)
341
+ {
342
+ $this->_handleCampaignRedirect();
343
+ $this->_redirectToProductIfSingleResult();
344
+ }
345
+
346
  /**
347
  * Checks if the result set's size is one. If so the user is redirected to the product detail page. This is checked
348
+ * right before the first block is rendered so headers can still be sent. The ordinary collection load event is
349
  * triggered too late.
350
+ *
 
351
  */
352
+ protected function _redirectToProductIfSingleResult()
353
  {
354
  if (!Mage::helper('factfinder/search')->getIsEnabled() || !Mage::helper('factfinder/search')->getIsOnSearchPage() || Mage::registry('redirectAlreadyChecked')) {
355
  return;
356
  }
357
+
358
  Mage::register('redirectAlreadyChecked', 1);
359
  if (Mage::getStoreConfig('factfinder/config/redirectOnSingleResult')) {
360
  $block = Mage::app()->getLayout()->getBlock('search_result_list');
361
+
362
  if (!$block instanceof Mage_Catalog_Block_Product_List) {
363
  return;
364
  }
365
+
366
  $collection = $block->getLoadedProductCollection();
367
  $collection->load();
368
+
369
  if (count($collection) == 1) {
370
  $product = $collection->getFirstItem();
371
 
377
  exit;
378
  }
379
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  }
381
 
382
+ /**
383
+ * Handle campaign redirects
384
+ *
385
+ */
386
+ protected function _handleCampaignRedirect()
387
  {
388
  $redirectBlock = Mage::registry(self::_campaignRedirectRegistryKey);
389
  if($redirectBlock instanceof Flagbit_FactFinder_Block_Layer)
app/code/community/Flagbit/FactFinder/Model/Processor.php CHANGED
@@ -138,6 +138,11 @@ class Flagbit_FactFinder_Model_Processor
138
  return $this->_getFacade()->applyTracking();
139
  break;
140
 
 
 
 
 
 
141
  case 'factfinder_proxy_suggest':
142
  $handler = new Flagbit_FactFinder_Model_Handler_Suggest(
143
  $this->_getRequestParam('query'),
138
  return $this->_getFacade()->applyTracking();
139
  break;
140
 
141
+ case 'factfinder_proxy_tracking':
142
+ $this->_getFacade()->getTrackingAdapter()->setupTrackingFromRequest();
143
+ return $this->_getFacade()->applyTracking();
144
+ break;
145
+
146
  case 'factfinder_proxy_suggest':
147
  $handler = new Flagbit_FactFinder_Model_Handler_Suggest(
148
  $this->_getRequestParam('query'),
app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Ffversion.php CHANGED
@@ -28,6 +28,10 @@ class Flagbit_FactFinder_Model_System_Config_Source_Ffversion
28
  public function toOptionArray()
29
  {
30
  return array(
 
 
 
 
31
  array(
32
  'value' => 68,
33
  'label' => '6.8'
28
  public function toOptionArray()
29
  {
30
  return array(
31
+ array(
32
+ 'value' => 69,
33
+ 'label' => '6.9'
34
+ ),
35
  array(
36
  'value' => 68,
37
  'label' => '6.8'
app/code/community/Flagbit/FactFinder/controllers/ProxyController.php CHANGED
@@ -20,19 +20,25 @@
20
  * @version $Id$
21
  */
22
  class Flagbit_FactFinder_ProxyController extends Mage_Core_Controller_Front_Action {
23
-
 
 
 
 
 
 
 
 
 
 
24
  /**
25
  * scic Action
26
  */
27
  public function scicAction()
28
  {
29
- $this->getResponse()->setBody(
30
- Mage::getModel('factfinder/processor')->handleInAppRequest($this->getFullActionName())
31
- );
32
  }
33
-
34
-
35
-
36
  /**
37
  * suggest Action
38
  */
20
  * @version $Id$
21
  */
22
  class Flagbit_FactFinder_ProxyController extends Mage_Core_Controller_Front_Action {
23
+
24
+ /**
25
+ * tracking Action
26
+ */
27
+ public function trackingAction()
28
+ {
29
+ $this->getResponse()->setBody(
30
+ Mage::getModel('factfinder/processor')->handleInAppRequest($this->getFullActionName())
31
+ );
32
+ }
33
+
34
  /**
35
  * scic Action
36
  */
37
  public function scicAction()
38
  {
39
+ $this->trackingAction();
 
 
40
  }
41
+
 
 
42
  /**
43
  * suggest Action
44
  */
app/code/community/Flagbit/FactFinder/etc/config.xml CHANGED
@@ -22,7 +22,7 @@
22
  <modules>
23
  <Flagbit_FactFinder>
24
  <active>true</active>
25
- <version>3.4.8</version>
26
  </Flagbit_FactFinder>
27
  </modules>
28
  <global>
@@ -111,6 +111,15 @@
111
  </observers>
112
  </controller_action_predispatch_adminhtml_system_config_save>
113
  </events>
 
 
 
 
 
 
 
 
 
114
  </global>
115
  <frontend>
116
  <layout>
@@ -156,18 +165,14 @@
156
  </controller_action_layout_load_before>
157
  <controller_action_layout_generate_blocks_after>
158
  <observers>
159
- <handleCampaignRedirect>
160
- <class>factfinder/observer</class>
161
- <method>handleCampaignRedirect</method>
162
- </handleCampaignRedirect>
163
  <initializeAfterSearchNavigation>
164
  <class>factfinder/observer</class>
165
  <method>initializeAfterSearchNavigation</method>
166
  </initializeAfterSearchNavigation>
167
- <redirectToProductIfSingleResult>
168
  <class>factfinder/observer</class>
169
- <method>redirectToProductIfSingleResult</method>
170
- </redirectToProductIfSingleResult>
171
  </observers>
172
  </controller_action_layout_generate_blocks_after>
173
  </events>
@@ -254,26 +259,26 @@
254
  </search>
255
  </catalog>
256
  <factfinder>
257
- <version>3.4.8</version>
258
  <revision>$Rev: 25896 $</revision>
259
- <debug>true</debug>
260
 
261
  <!-- search settings: WARNING: dont change settings here, please use the Magento backoffice ...
262
  if you still have to change something here, dont forget to clear the configuration cache -->
263
  <search>
264
- <address>magento.fact-finder.de</address>
265
- <port>8080</port>
266
  <protocol>http</protocol> <!-- possible values: http, https -->
267
 
268
- <ffversion>66</ffversion>
269
 
270
- <auth_user>client</auth_user>
271
  <auth_password></auth_password>
272
  <auth_type>advanced</auth_type> <!-- possible values: http (for FF <= 6.4); simple | advanced (for FF >= 6.5)-->
273
  <auth_advancedPrefix>FACT-FINDER</auth_advancedPrefix>
274
  <auth_advancedPostfix>FACT-FINDER</auth_advancedPostfix>
275
 
276
- <context>MagentoSearch65</context>
277
  <channel></channel>
278
  <language></language>
279
  </search>
22
  <modules>
23
  <Flagbit_FactFinder>
24
  <active>true</active>
25
+ <version>3.5.1</version>
26
  </Flagbit_FactFinder>
27
  </modules>
28
  <global>
111
  </observers>
112
  </controller_action_predispatch_adminhtml_system_config_save>
113
  </events>
114
+ <cache>
115
+ <types>
116
+ <factfinder_search translate="label,description" module="factfinder">
117
+ <label>FACT-Finder</label>
118
+ <description>Search Request Cache</description>
119
+ <tags>FACTFINDER_SEARCH</tags>
120
+ </factfinder_search>
121
+ </types>
122
+ </cache>
123
  </global>
124
  <frontend>
125
  <layout>
165
  </controller_action_layout_load_before>
166
  <controller_action_layout_generate_blocks_after>
167
  <observers>
 
 
 
 
168
  <initializeAfterSearchNavigation>
169
  <class>factfinder/observer</class>
170
  <method>initializeAfterSearchNavigation</method>
171
  </initializeAfterSearchNavigation>
172
+ <handleRedirects>
173
  <class>factfinder/observer</class>
174
+ <method>handleRedirects</method>
175
+ </handleRedirects>
176
  </observers>
177
  </controller_action_layout_generate_blocks_after>
178
  </events>
259
  </search>
260
  </catalog>
261
  <factfinder>
262
+ <version>3.5.1</version>
263
  <revision>$Rev: 25896 $</revision>
264
+ <debug>false</debug>
265
 
266
  <!-- search settings: WARNING: dont change settings here, please use the Magento backoffice ...
267
  if you still have to change something here, dont forget to clear the configuration cache -->
268
  <search>
269
+ <address>example.com</address>
270
+ <port>80</port>
271
  <protocol>http</protocol> <!-- possible values: http, https -->
272
 
273
+ <ffversion>68</ffversion>
274
 
275
+ <auth_user></auth_user>
276
  <auth_password></auth_password>
277
  <auth_type>advanced</auth_type> <!-- possible values: http (for FF <= 6.4); simple | advanced (for FF >= 6.5)-->
278
  <auth_advancedPrefix>FACT-FINDER</auth_advancedPrefix>
279
  <auth_advancedPostfix>FACT-FINDER</auth_advancedPostfix>
280
 
281
+ <context></context>
282
  <channel></channel>
283
  <language></language>
284
  </search>
app/design/frontend/base/default/layout/factfinder.xml CHANGED
@@ -69,10 +69,10 @@
69
 
70
  <factfinder_clicktracking_enabled>
71
  <reference name="head">
72
- <action method="addJs"><script>factfinder/scic.js</script></action>
73
  </reference>
74
  <reference name="content">
75
- <block type="factfinder/scic" name="factfinder.scic" template="factfinder/scic.phtml"/>
76
  </reference>
77
  </factfinder_clicktracking_enabled>
78
  </layout>
69
 
70
  <factfinder_clicktracking_enabled>
71
  <reference name="head">
72
+ <action method="addJs"><script>factfinder/tracking.js</script></action>
73
  </reference>
74
  <reference name="content">
75
+ <block type="factfinder/tracking" name="factfinder.tracking" template="factfinder/tracking.phtml"/>
76
  </reference>
77
  </factfinder_clicktracking_enabled>
78
  </layout>
app/design/frontend/base/default/template/factfinder/form.advancedsuggest68.phtml CHANGED
@@ -49,8 +49,16 @@
49
  return i18n[string];
50
  }
51
 
52
- console.log(data);
53
-
 
 
 
 
 
 
 
 
54
  var content = '<ul>';
55
  content += '<li style="display: none" class="selected selectable-item"></li>';
56
  var currentChannel = '';
49
  return i18n[string];
50
  }
51
 
52
+ // Try to get channel from search request, if no channel was found
53
+ for(var i = 0; i < data.length; i++) {
54
+ if(typeof(data[i].channel) == 'undefined' || data[i].channel == '') {
55
+ var params = data[i].searchParams.toQueryParams();
56
+ if(typeof(params.channel) != 'undefined') {
57
+ data[i].channel = params.channel;
58
+ }
59
+ }
60
+ }
61
+
62
  var content = '<ul>';
63
  content += '<li style="display: none" class="selected selectable-item"></li>';
64
  var currentChannel = '';
app/design/frontend/base/default/template/factfinder/{scic.phtml → tracking.phtml} RENAMED
@@ -4,29 +4,30 @@
4
  *
5
  * @category Mage
6
  * @package Flagbit_FactFinder
7
- * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
8
  */
9
 
10
  /**
11
- * Add FACT-Finder SCIC
12
  *
13
  * @category Mage
14
  * @package Flagbit_FactFinder
15
- * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
16
  * @author Joerg Weller <weller@flagbit.de>
 
17
  * @version $Id$
18
  */
19
  ?>
20
  <script type="text/javascript">
21
- var factfinderSCIC = new FactfinderSCIC(
22
  '.col-main',
23
  $H(<?php echo $this->getJsonDataObject();?>),
24
  $H(<?php echo $this->getJsonUrlToIdMappingObject();?>),
25
- '<?php echo $this->getUrl('factfinder/proxy/scic'); ?>',
26
  false
27
  );
28
 
29
  Event.observe(document, 'dom:loaded', function(event) {
30
- factfinderSCIC.init();
31
  });
32
  </script>
4
  *
5
  * @category Mage
6
  * @package Flagbit_FactFinder
7
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
8
  */
9
 
10
  /**
11
+ * Add FACT-Finder Tracking
12
  *
13
  * @category Mage
14
  * @package Flagbit_FactFinder
15
+ * @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
16
  * @author Joerg Weller <weller@flagbit.de>
17
+ * @author Nicolai Essig <nicolai.essig@flagbit.de>
18
  * @version $Id$
19
  */
20
  ?>
21
  <script type="text/javascript">
22
+ var factfinderTracking = new FactfinderTracking(
23
  '.col-main',
24
  $H(<?php echo $this->getJsonDataObject();?>),
25
  $H(<?php echo $this->getJsonUrlToIdMappingObject();?>),
26
+ '<?php echo (Mage::helper('factfinder')->useOldTracking() ? $this->getUrl('factfinder/proxy/scic') : $this->getUrl('factfinder/proxy/tracking')) ?>',
27
  false
28
  );
29
 
30
  Event.observe(document, 'dom:loaded', function(event) {
31
+ factfinderTracking.init();
32
  });
33
  </script>
app/locale/de_DE/Flagbit_FactFinder.csv CHANGED
@@ -86,4 +86,5 @@
86
  "User name", "Benutzername"
87
  "User name for authentication", "Benutzername für Authentifizierung"
88
  "Yes", "Ja"
89
- "Your server's clock does not agree with FACT-Finder's. Please make sure your clock is set correctly.", "Ihre Serverzeit stimmt nicht mit der von FACT-Finder überein. Bitte stellen Sie sicher, dass Ihre Serverzeit korrekt eingestellt ist."
 
86
  "User name", "Benutzername"
87
  "User name for authentication", "Benutzername für Authentifizierung"
88
  "Yes", "Ja"
89
+ "Your server's clock does not agree with FACT-Finder's. Please make sure your clock is set correctly.", "Ihre Serverzeit stimmt nicht mit der von FACT-Finder überein. Bitte stellen Sie sicher, dass Ihre Serverzeit korrekt eingestellt ist."
90
+ "Search Request Cache","Suchanfragen Cache"
js/factfinder/{scic.js → tracking.js} RENAMED
@@ -1,4 +1,4 @@
1
- var FactfinderSCIC = Class.create({
2
  url: null,
3
  data: null,
4
  classname: null,
@@ -51,8 +51,7 @@ var FactfinderSCIC = Class.create({
51
  recordRequest: function(id, eventType) {
52
 
53
  var data = this.data.get(id);
54
- data.event = eventType;
55
-
56
  this.request = new Ajax.Request(this.url, {
57
  asynchronous: this.asynchronous,
58
  method: 'post',
1
+ var FactfinderTracking = Class.create({
2
  url: null,
3
  data: null,
4
  classname: null,
51
  recordRequest: function(id, eventType) {
52
 
53
  var data = this.data.get(id);
54
+
 
55
  this.request = new Ajax.Request(this.url, {
56
  asynchronous: this.asynchronous,
57
  method: 'post',
lib/FACTFinder/Abstract/Adapter.php CHANGED
@@ -58,15 +58,11 @@ abstract class FACTFinder_Abstract_Adapter
58
  }
59
 
60
  /**
61
- * returns the data lazily. if it isn't available yet, it will be requested from the dataprovider.
62
  * decorates the dataprovider::getData method so a inheriting class does not have to use the dataprovider
63
  */
64
  protected function getData()
65
  {
66
- if(!isset($this->data)) {
67
- $this->data = $this->getDataProvider()->getData();
68
- }
69
- return $this->data;
70
  }
71
 
72
  protected function reloadData()
58
  }
59
 
60
  /**
 
61
  * decorates the dataprovider::getData method so a inheriting class does not have to use the dataprovider
62
  */
63
  protected function getData()
64
  {
65
+ return $this->getDataProvider()->getData();
 
 
 
66
  }
67
 
68
  protected function reloadData()
lib/FACTFinder/AsnSliderFilter.php CHANGED
@@ -101,6 +101,14 @@ class FACTFinder_AsnSliderFilter
101
  return $this->baseUrl;
102
  }
103
 
 
 
 
 
 
 
 
 
104
  /**
105
  * returns true if the selected range is not the same as the absolute range
106
  *
101
  return $this->baseUrl;
102
  }
103
 
104
+ /**
105
+ * Allows to overwrite the base url.
106
+ * @param $url string new url
107
+ */
108
+ public function setBaseUrl($url) {
109
+ $this->baseUrl = $url;
110
+ }
111
+
112
  /**
113
  * returns true if the selected range is not the same as the absolute range
114
  *
lib/FACTFinder/Default/CompareAdapter.php CHANGED
@@ -1,18 +1,6 @@
1
  <?php
2
- /**
3
- * FACT-Finder PHP Framework
4
- *
5
- * @category Library
6
- * @package FACTFinder\Xml67
7
- * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
- */
9
-
10
  /**
11
  * product comparison adapter using the xml interface
12
- *
13
- * @author Rudolf Batt <rb@omikron.net>
14
- * @version $Id: CompareAdapter.php 25893 2010-06-29 08:19:43Z rb $
15
- * @package FACTFinder\Xml68
16
  */
17
  class FACTFinder_Default_CompareAdapter extends FACTFinder_Abstract_Adapter
18
  {protected $productIds = array();
1
  <?php
 
 
 
 
 
 
 
 
2
  /**
3
  * product comparison adapter using the xml interface
 
 
 
 
4
  */
5
  class FACTFinder_Default_CompareAdapter extends FACTFinder_Abstract_Adapter
6
  {protected $productIds = array();
lib/FACTFinder/Default/RecommendationAdapter.php CHANGED
@@ -69,7 +69,7 @@ class FACTFinder_Default_RecommendationAdapter extends FACTFinder_Abstract_Adapt
69
 
70
  public function setIdsOnly($idsOnly) {
71
  // Reset the recommendations, if more detail is wanted than before
72
- if($this->idsOnly && !$idsOnly) $recommendationUpToDate = false;
73
  $this->idsOnly = $idsOnly;
74
  $this->getDataProvider()->setParam('idsOnly', $idsOnly ? 'true' : 'false');
75
  }
@@ -90,7 +90,7 @@ class FACTFinder_Default_RecommendationAdapter extends FACTFinder_Abstract_Adapt
90
  $this->productIds = array($requestParams['id']);
91
  }
92
  if (empty($this->productIds)) {
93
- trigger_error('recommendations can not be loaded without id. could not load id from request', E_USER_WARNING);
94
  return array();
95
  }
96
  }
69
 
70
  public function setIdsOnly($idsOnly) {
71
  // Reset the recommendations, if more detail is wanted than before
72
+ if($this->idsOnly && !$idsOnly) $this->recommendationUpToDate = false;
73
  $this->idsOnly = $idsOnly;
74
  $this->getDataProvider()->setParam('idsOnly', $idsOnly ? 'true' : 'false');
75
  }
90
  $this->productIds = array($requestParams['id']);
91
  }
92
  if (empty($this->productIds)) {
93
+ trigger_error('Recommendations cannot be loaded without id. Could not load id from request.', E_USER_WARNING);
94
  return array();
95
  }
96
  }
lib/FACTFinder/Default/SimilarRecordsAdapter.php CHANGED
@@ -70,7 +70,7 @@ class FACTFinder_Default_SimilarRecordsAdapter extends FACTFinder_Abstract_Adapt
70
  /**
71
  * returns similar attributes for previously specified id. if no id is set, try to fetch parameter 'id'.
72
  * if no id is available, there will be a warning raised and returning an empty array
73
-
74
  * @return array $similarAttributes of strings (field names as keys)
75
  */
76
  public function getSimilarAttributes() {
70
  /**
71
  * returns similar attributes for previously specified id. if no id is set, try to fetch parameter 'id'.
72
  * if no id is available, there will be a warning raised and returning an empty array
73
+ *
74
  * @return array $similarAttributes of strings (field names as keys)
75
  */
76
  public function getSimilarAttributes() {
lib/FACTFinder/Default/TagCloudAdapter.php CHANGED
@@ -30,6 +30,19 @@ class FACTFinder_Default_TagCloudAdapter extends FACTFinder_Abstract_Adapter
30
  return $this->tagCloud;
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * @return array $tagCloud list of FACTFinder_Tag objects
35
  */
30
  return $this->tagCloud;
31
  }
32
 
33
+ /**
34
+ * with this method a different wordcount can be set. default from FF is 30.
35
+ *
36
+ * @param int word count
37
+ */
38
+ public function setWordCount($wordCount) {
39
+ // set maximum results for tagcloud
40
+ if( !empty( $wordCount ) && is_numeric( $wordCount ) )
41
+ {
42
+ $this->getDataProvider()->setParam('wordCount', $wordCount);
43
+ }
44
+ }
45
+
46
  /**
47
  * @return array $tagCloud list of FACTFinder_Tag objects
48
  */
lib/FACTFinder/Default/TrackingAdapter.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Tracking adapter using the new tracking API introduced with FF 6.9.
4
+ */
5
+ class FACTFinder_Default_TrackingAdapter extends FACTFinder_Abstract_Adapter
6
+ {
7
+ // A result (product, banner, ASN element, ...) referenced by the key has been displayed.
8
+ const EVENT_DISPLAY = 'display';
9
+ // Visitor has given feedback about a ResultNode. Reference Key is optional.
10
+ const EVENT_FEEDBACK = 'feedback';
11
+ // The user clicked on a product / detail view.
12
+ const EVENT_INSPECT = 'inspect';
13
+ // The user checked the availability of a product.
14
+ const EVENT_AVAILABILITY_CHECK = 'availabilityCheck';
15
+ // The user added an item to the cart.
16
+ const EVENT_CART = 'cart';
17
+ // The user bought or booked a product or service.
18
+ const EVENT_BUY = 'buy';
19
+ // A request of the user could be answered from the shop cache.
20
+ const EVENT_CACHE_HIT = 'cacheHit';
21
+ // A new session has been created for a user.
22
+ const EVENT_SESSION_START = 'sessionStart';
23
+
24
+ /**
25
+ * let the data provider save the tracking params
26
+ *
27
+ * @return boolean $success
28
+ */
29
+ public function applyTracking()
30
+ {
31
+ $this->log->debug("Tracking not available before FF 6.9!");
32
+ return false;
33
+ }
34
+
35
+ public function prepareDefaultParams($inputParams, $event) {
36
+ $eventsNoSourceRefKeyRequired = array(
37
+ self::EVENT_INSPECT,
38
+ self::EVENT_CART,
39
+ self::EVENT_BUY,
40
+ self::EVENT_SESSION_START
41
+ );
42
+
43
+ $sid = $inputParams['sid'];
44
+ if (strlen($sid) == 0)
45
+ $sid = session_id();
46
+
47
+ $sourceRefKey = $inputParams['sourceRefKey'];
48
+ if (!in_array($event, $eventsNoSourceRefKeyRequired, true) && strlen($sourceRefKey) == 0)
49
+ throw new UnexpectedValueException("No sourceRefKey in parameters");
50
+
51
+ $params = array('sourceRefKey' => $sourceRefKey, 'sid' => $sid);
52
+
53
+ $optParams = array('uid', 'cookieId', 'price', 'amount', 'positive', 'message', 'site', 'id', 'mid');
54
+ foreach ($optParams AS $optParam) {
55
+ if (isset($inputParams[$optParam]) && strlen($inputParams[$optParam]) > 0)
56
+ $params[$optParam] = $inputParams[$optParam];
57
+ }
58
+
59
+ return $params;
60
+ }
61
+
62
+ public function doTrackingFromRequest()
63
+ {
64
+ $this->setupTrackingFromRequest();
65
+ return $this->applyTracking();
66
+ }
67
+
68
+ public function setupTrackingFromRequest()
69
+ {
70
+ $params = $this->getParamsParser()->getServerRequestParams();
71
+ $this->getDataProvider()->setParams($params);
72
+ }
73
+
74
+ public function trackEvent($event, $inputParams)
75
+ {
76
+ $this->setupEventTracking($event, $inputParams);
77
+ return $this->applyTracking();
78
+ }
79
+
80
+ public function setupEventTracking($event, $inputParams)
81
+ {
82
+ $params = $this->prepareDefaultParams($inputParams, $event);
83
+
84
+ $events = array(
85
+ self::EVENT_DISPLAY,
86
+ self::EVENT_FEEDBACK,
87
+ self::EVENT_INSPECT,
88
+ self::EVENT_AVAILABILITY_CHECK,
89
+ self::EVENT_CART,
90
+ self::EVENT_BUY,
91
+ self::EVENT_CACHE_HIT,
92
+ self::EVENT_SESSION_START
93
+ );
94
+
95
+ if (!in_array($event, $events, true)) {
96
+ throw new UnexpectedValueException("Event $event not known.");
97
+ }
98
+
99
+ $params['event'] = $event;
100
+
101
+ $this->getDataProvider()->setParams($params);
102
+ }
103
+ }
lib/FACTFinder/Http/DummyProvider.php CHANGED
@@ -1,32 +1,26 @@
1
  <?php
2
  /**
3
- * FACT-Finder PHP Framework
4
- *
5
- * @category Library
6
- * @package FACTFinder\Http
7
- * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
- */
9
-
10
- /**
11
- * this data provider loads the data from local static xml files
12
  * it is only intended to be used for testing
13
- *
14
- * @author Rudolf Batt <rb@omikron.net>, Martin Buettner <martin.buettner@omikron.net>
15
- * @version $Id: DummyProvider.php 44086 2012-02-29 17:19:43Z martin.buettner $
16
- * @package FACTFinder\Http
17
  */
18
  class FACTFinder_Http_DummyProvider extends FACTFinder_Abstract_DataProvider
19
  {
20
  protected $data;
21
  protected $previousFileName;
22
-
23
- protected $fileLocation;
 
24
 
25
  public function setFileLocation($loc)
26
  {
27
  $this->fileLocation = substr($loc, -1) == DS ? $loc : $loc.DS;
28
  }
29
 
 
 
 
 
 
30
  /**
31
  * we just offer this function, for compatibility with the DataProvider API
32
  *
@@ -107,7 +101,7 @@ class FACTFinder_Http_DummyProvider extends FACTFinder_Abstract_DataProvider
107
 
108
  ksort($params, SORT_STRING);
109
  $fileName .= http_build_query($params, '', '_');
110
- $fileName .= ".xml";
111
 
112
  // The following line removes all []-indices from array parameters, because tomcat doesn't need them
113
  $fileName = preg_replace("/%5B[A-Za-z0-9]*%5D/", "", $fileName);
1
  <?php
2
  /**
3
+ * this data provider loads the data from local static files
 
 
 
 
 
 
 
 
4
  * it is only intended to be used for testing
 
 
 
 
5
  */
6
  class FACTFinder_Http_DummyProvider extends FACTFinder_Abstract_DataProvider
7
  {
8
  protected $data;
9
  protected $previousFileName;
10
+
11
+ protected $fileLocation;
12
+ protected $fileExtension = ".xml";
13
 
14
  public function setFileLocation($loc)
15
  {
16
  $this->fileLocation = substr($loc, -1) == DS ? $loc : $loc.DS;
17
  }
18
 
19
+ public function setFileExtension($ext)
20
+ {
21
+ $this->fileExtension = $ext[0] == "." ? $ext : ".$ext";
22
+ }
23
+
24
  /**
25
  * we just offer this function, for compatibility with the DataProvider API
26
  *
101
 
102
  ksort($params, SORT_STRING);
103
  $fileName .= http_build_query($params, '', '_');
104
+ $fileName .= $this->fileExtension;
105
 
106
  // The following line removes all []-indices from array parameters, because tomcat doesn't need them
107
  $fileName = preg_replace("/%5B[A-Za-z0-9]*%5D/", "", $fileName);
lib/FACTFinder/Http/TrackingAdapter.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Tracking adapter using the new tracking API introduced with FF 6.9.
4
+ */
5
+ class FACTFinder_Http_TrackingAdapter extends FACTFinder_Default_TrackingAdapter
6
+ {
7
+ /**
8
+ * Set up the tracking adapter for 6.9.
9
+ */
10
+ protected function init()
11
+ {
12
+ $this->log->info("Initializing new Tracking adapter.");
13
+ $this->getDataProvider()->setType('Tracking.ff');
14
+ $this->getDataProvider()->setCurlOptions(array(
15
+ CURLOPT_CONNECTTIMEOUT => $this->getDataProvider()->getConfig()->getScicConnectTimeout(),
16
+ CURLOPT_TIMEOUT => $this->getDataProvider()->getConfig()->getScicTimeout()
17
+ ));
18
+ }
19
+
20
+ /**
21
+ * Trigger the actual tracking request.
22
+ *
23
+ * @return boolean $success
24
+ */
25
+ public function applyTracking()
26
+ {
27
+ // Is this even correct for the new interface?
28
+ $success = trim($this->getData());
29
+ return $success == 'The event was successfully tracked';
30
+ }
31
+ }
lib/FACTFinder/Item.php CHANGED
@@ -52,4 +52,12 @@ class FACTFinder_Item
52
  public function isSelected() {
53
  return $this->isSelected;
54
  }
 
 
 
 
 
 
 
 
55
  }
52
  public function isSelected() {
53
  return $this->isSelected;
54
  }
55
+
56
+ /**
57
+ * Allows to override the URL of the item
58
+ * @param $url string new URL to set
59
+ */
60
+ public function setUrl($url) {
61
+ $this->url = $url;
62
+ }
63
  }
lib/FACTFinder/Json66/CompareAdapter.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json66_CompareAdapter extends FACTFinder_Default_CompareAdapter
3
+ {
4
+ /**
5
+ * @return void
6
+ **/
7
+ public function init() {
8
+ $this->log->info("Initializing new compare adapter.");
9
+ $this->getDataProvider()->setParam('format', 'json');
10
+ $this->getDataProvider()->setType('Compare.ff');
11
+ }
12
+
13
+ /**
14
+ * try to parse data as json
15
+ *
16
+ * @throws Exception of data is no valid JSON
17
+ * @return stdClass
18
+ */
19
+ protected function getData()
20
+ {
21
+ $jsonData = json_decode(parent::getData(), true);
22
+ if ($jsonData === null)
23
+ throw new InvalidArgumentException("json_decode() raised error ".json_last_error());
24
+ return $jsonData;
25
+ }
26
+
27
+ /**
28
+ * @return array $comparableAttributes of strings (field names as keys, hasDifferences as values)
29
+ **/
30
+ protected function createComparableAttributes() {
31
+ $comparableAttributes = array();
32
+ $jsonData = $this->getData();
33
+ foreach($jsonData['attributes'] as $attributeData){
34
+ $name = $attributeData['attributeName'];
35
+ $comparableAttributes[$name] = $attributeData['different'];
36
+ }
37
+ return $comparableAttributes;
38
+ }
39
+
40
+ /**
41
+ * @return array $comparedRecords list of FACTFinder_Record items
42
+ **/
43
+ protected function createComparedRecords() {
44
+ $comparedRecords = array();
45
+ $jsonData = $this->getData();
46
+ if (!empty($jsonData['records'])) {
47
+ $encodingHandler = $this->getEncodingHandler();
48
+
49
+ if ($this->idsOnly && !$this->attributesUpToDate) {
50
+ $this->createComparableAttributes();
51
+ $this->attributesUpToDate = true;
52
+ }
53
+
54
+ $positionCounter = 1;
55
+ foreach ($jsonData['records'] AS $recordData){
56
+ // get current position
57
+ $position = $positionCounter;
58
+ $positionCounter++;
59
+
60
+ $comparedRecords[] = FF::getInstance('record',
61
+ $recordData['id'],
62
+ 100,
63
+ $position,
64
+ $position,
65
+ $this->getEncodingHandler()->encodeServerContentForPage($recordData['record'])
66
+ );
67
+ }
68
+ }
69
+ return $comparedRecords;
70
+ }
71
+ }
lib/FACTFinder/Json66/ImportAdapter.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * import adapter using the json interface
4
+ **/
5
+ class FACTFinder_Json66_ImportAdapter extends FACTFinder_Default_ImportAdapter
6
+ {
7
+ /**
8
+ * @return void
9
+ **/
10
+ public function init()
11
+ {
12
+ $this->log->info("Initializing new import adapter.");
13
+ $this->getDataProvider()->setParam('format', 'json');
14
+ }
15
+
16
+ /**
17
+ * try to parse data as json
18
+ *
19
+ * @throws Exception of data is no valid JSON
20
+ * @return stdClass
21
+ */
22
+ protected function getData()
23
+ {
24
+ $jsonData = json_decode(parent::getData());
25
+ if ($jsonData === null)
26
+ throw new InvalidArgumentException("json_decode() raised error ".json_last_error());
27
+ return $jsonData;
28
+ }
29
+
30
+ /**
31
+ * @param bool $download import files will also be updated if true
32
+ * @param string $type determines which import will be triggered. can be 'data', 'suggest' or 'recommendation'
33
+ * @return object $report import report in xml format
34
+ */
35
+ protected function triggerImport($download, $type = 'data')
36
+ {
37
+ $this->getDataProvider()->setCurlOptions(array(
38
+ CURLOPT_CONNECTTIMEOUT => $this->getDataProvider()->getConfig()->getImportConnectTimeout(),
39
+ CURLOPT_TIMEOUT => $this->getDataProvider()->getConfig()->getImportTimeout()
40
+ ));
41
+
42
+ $this->getDataProvider()->setParam('download', $download ? 'true' : 'false');
43
+ switch($type)
44
+ {
45
+ case 'suggest':
46
+ $this->getDataProvider()->setType('Import.ff');
47
+ $this->getDataProvider()->setParam('type', 'suggest');
48
+ break;
49
+ case 'recommendation':
50
+ $this->getDataProvider()->setType('Recommender.ff');
51
+ $this->getDataProvider()->setParam('do', 'importData');
52
+ break;
53
+ case 'data':
54
+ default:
55
+ $this->getDataProvider()->setType('Import.ff');
56
+ break;
57
+ }
58
+
59
+ $report = $this->getData();
60
+
61
+ // clean up for next import
62
+ switch($type)
63
+ {
64
+ case 'suggest':
65
+ $this->getDataProvider()->unsetParam('type');
66
+ break;
67
+ case 'recommendation':
68
+ $this->getDataProvider()->unsetParam('do');
69
+ break;
70
+ }
71
+
72
+ return $report;
73
+ }
74
+ }
lib/FACTFinder/Json66/RecommendationAdapter.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * adapter for the factfinder recommendation engine, working with the JSON interface of FF6.6
4
+ */
5
+ class FACTFinder_Json66_RecommendationAdapter extends FACTFinder_Default_RecommendationAdapter
6
+ {
7
+ protected function createRecommendations() {
8
+ $this->log->error("FF 6.6 does not provide a JSON API for its recommendation engine");
9
+ return FF::getInstance('result', array(), 0);
10
+ }
11
+ }
lib/FACTFinder/Json66/SearchAdapter.php ADDED
@@ -0,0 +1,515 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * search adapter using the json interface. expects a json formated string from the dataprovider
4
+ */
5
+ class FACTFinder_Json66_SearchAdapter extends FACTFinder_Default_SearchAdapter
6
+ {
7
+ protected $status = null;
8
+ protected $isArticleNumberSearch;
9
+ private $jsonData;
10
+
11
+ /**
12
+ * init
13
+ */
14
+ protected function init()
15
+ {
16
+ $this->log->info("Initializing new search adapter.");
17
+ $this->getDataProvider()->setParam('format', 'json');
18
+ $this->getDataProvider()->setType('Search.ff');
19
+ }
20
+
21
+ /**
22
+ * try to parse data as json
23
+ *
24
+ * @throws Exception of data is no valid JSON
25
+ * @return stdClass
26
+ */
27
+ protected function getData()
28
+ {
29
+ if($this->jsonData === null)
30
+ {
31
+ $rawData = parent::getData();
32
+ $this->jsonData = json_decode($rawData, true); // the second parameter turns JSON-objects into associative arrays which makes extracting the record fields easier
33
+ if ($this->jsonData === null)
34
+ {
35
+ $error = json_last_error();
36
+ // In case of an error 500, FF 6.6 does not return valid JSON; try to fix it
37
+ $this->jsonData = json_decode('{'.$rawData.'}', true);
38
+ if ($this->jsonData === null)
39
+ throw new InvalidArgumentException('json_decode() raised error '.$error);
40
+ }
41
+ }
42
+ return $this->jsonData;
43
+ }
44
+
45
+ /**
46
+ * get status of the article number search
47
+ *
48
+ * @return string status
49
+ **/
50
+ public function getArticleNumberSearchStatus()
51
+ {
52
+ if ($this->articleNumberSearchStatus == null) {
53
+
54
+ $this->isArticleNumberSearch = false;
55
+ $this->articleNumberSearchStatus = self::NO_RESULT;
56
+
57
+ if ($this->getStatus() != self::NO_RESULT) {
58
+ $this->loadArticleNumberSearchInformations();
59
+ }
60
+ }
61
+ return $this->articleNumberSearchStatus;
62
+ }
63
+
64
+ /**
65
+ * returns true if the search was an article number search
66
+ *
67
+ * @return boolean isArticleNumberSearch
68
+ **/
69
+ public function isArticleNumberSearch()
70
+ {
71
+ if ($this->isArticleNumberSearch === null) {
72
+
73
+ $this->isArticleNumberSearch = false;
74
+
75
+ if ($this->getStatus() != self::NO_RESULT) {
76
+ $this->loadArticleNumberSearchInformations();
77
+ }
78
+ }
79
+ return $this->isArticleNumberSearch;
80
+ }
81
+
82
+ /**
83
+ * fetch article number search status from the json result
84
+ *
85
+ * @return void
86
+ */
87
+ private function loadArticleNumberSearchInformations()
88
+ {
89
+ $jsonData = $this->getData();
90
+ switch ($jsonData["searchResult"]["resultArticleNumberStatus"]) {
91
+ case 'nothingFound':
92
+ $this->isArticleNumberSearch = true;
93
+ $this->articleNumberSearchStatus = self::NOTHING_FOUND;
94
+ break;
95
+ case 'resultsFound':
96
+ $this->isArticleNumberSearch = true;
97
+ $this->articleNumberSearchStatus = self::RESULTS_FOUND;
98
+ break;
99
+ case 'noArticleNumberSearch':
100
+ default:
101
+ $this->isArticleNumberSearch = false;
102
+ $this->articleNumberSearchStatus = self::NO_RESULT;
103
+ }
104
+ }
105
+
106
+ /**
107
+ * returns true if the search-process was aborted because of a timeout
108
+ *
109
+ * @return boolean true if search timed out
110
+ **/
111
+ public function isSearchTimedOut()
112
+ {
113
+ $jsonData = $this->getData();
114
+ return $jsonData['searchResult']['timedOut'];
115
+ }
116
+
117
+ /**
118
+ * get search status
119
+ *
120
+ * @return string status
121
+ **/
122
+ public function getStatus()
123
+ {
124
+ $jsonData = $this->getData();
125
+ if ($this->status == null) {
126
+ switch ($jsonData['searchResult']['resultStatus']) {
127
+ case 'nothingFound':
128
+ $this->status = self::NOTHING_FOUND;
129
+ break;
130
+ case 'resultsFound':
131
+ $this->status = self::RESULTS_FOUND;
132
+ break;
133
+ default:
134
+ $this->status = self::NO_RESULT;
135
+ }
136
+ }
137
+ return $this->status;
138
+ }
139
+
140
+ protected function createSearchParams()
141
+ {
142
+ $breadCrumbTrail = $this->getBreadCrumbTrail();
143
+ if (sizeof($breadCrumbTrail) > 0) {
144
+ $paramString = $breadCrumbTrail[sizeof($breadCrumbTrail) - 1]->getUrl();
145
+ $searchParams = $this->getParamsParser()->getFactfinderParamsFromString($paramString);
146
+ } else {
147
+ $searchParams = $this->getParamsParser()->getFactfinderParams();
148
+ }
149
+ return $searchParams;
150
+ }
151
+ /**
152
+ * create result object
153
+ **/
154
+ protected function createResult()
155
+ {
156
+ return $this->getResultFromRawResult($this->getData());
157
+ }
158
+
159
+ protected function getResultFromRawResult($jsonData) {
160
+ //init default values
161
+ $result = array();
162
+ $resultCount = 0;
163
+
164
+ $searchResultData = $jsonData['searchResult'];
165
+
166
+ if (!empty($searchResultData['records'])) {
167
+ $resultCount = $searchResultData['resultCount'];
168
+ $encodingHandler = $this->getEncodingHandler();
169
+
170
+ $paging = $this->getPaging();
171
+ $positionOffset = ($paging->getCurrentPageNumber() - 1) * $this->getProductsPerPageOptions()->getSelectedOption()->getValue();
172
+
173
+ //load result
174
+ $positionCounter = 1;
175
+ foreach($searchResultData['records'] AS $recordData){
176
+ // get current position
177
+ $position = $positionOffset + $positionCounter;
178
+ $positionCounter++;
179
+
180
+ $result[] = $this->getRecordFromRawRecord($recordData, $position);
181
+ }
182
+ }
183
+ return FF::getInstance('result', $result, $resultCount);
184
+ }
185
+
186
+ protected function getRecordFromRawRecord($recordData, $position)
187
+ {
188
+ $originalPosition = $position;
189
+
190
+ $fieldValues = $recordData['record'];
191
+
192
+ if (isset($fieldValues['__ORIG_POSITION__']))
193
+ {
194
+ $originalPosition = (int) $fieldValues['__ORIG_POSITION__'];
195
+ unset($fieldValues['__ORIG_POSITION__']);
196
+ }
197
+
198
+ $record = FF::getInstance('record',
199
+ strval($recordData['id']),
200
+ $recordData['searchSimilarity'],
201
+ $position,
202
+ $originalPosition,
203
+ $this->getEncodingHandler()->encodeServerContentForPage($fieldValues)
204
+ );
205
+
206
+ $record->setSeoPath(strval($recordData['seoPath']));
207
+
208
+ foreach($recordData['keywords'] AS $keyword) {
209
+ $record->addKeyword(strval($keyword));
210
+ }
211
+
212
+ return $record;
213
+ }
214
+
215
+ /**
216
+ * @return FACTFinder_Asn
217
+ **/
218
+ protected function createAsn()
219
+ {
220
+ $asn = array();
221
+ $jsonData = $this->getData();
222
+ if (!empty($jsonData['searchResult']['groups'])) {
223
+
224
+ foreach ($jsonData['searchResult']['groups'] AS $groupData) {
225
+ $group = $this->createGroupInstance($groupData);
226
+
227
+ $elements = array_merge($groupData['selectedElements'], $groupData['elements']);
228
+
229
+ //get filters of the current group
230
+ foreach ($elements AS $elementData) {
231
+ $filter = $this->createFilter($elementData, $group);
232
+
233
+ $group->addFilter($filter);
234
+ }
235
+ $asn[] = $group;
236
+ }
237
+ }
238
+ return FF::getInstance('asn', $asn);
239
+ }
240
+
241
+ protected function createGroupInstance($groupData)
242
+ {
243
+ $groupName = $groupData['name'];
244
+ $groupUnit = $groupData['unit'];
245
+
246
+ return FF::getInstance('asnGroup',
247
+ array(),
248
+ $this->getEncodingHandler()->encodeServerContentForPage($groupName),
249
+ $groupData['detailedLinks'],
250
+ $this->getEncodingHandler()->encodeServerContentForPage($groupUnit),
251
+ $groupData['filterStyle']
252
+ );
253
+ }
254
+
255
+ protected function createFilter($elementData, $group)
256
+ {
257
+ $filterLink = $this->createLink($elementData);
258
+
259
+ if ($group->isSliderStyle()) {
260
+ // get last (empty) parameter from the search params property
261
+ $params = $this->getParamsParser()->parseParamsFromResultString(trim($elementData['searchParams']));
262
+ end($params);
263
+ $filterLink .= '&' . key($params) . '=';
264
+
265
+ $filter = FF::getInstance('asnSliderFilter',
266
+ $filterLink,
267
+ $elementData['absoluteMinValue'],
268
+ $elementData['absoluteMaxValue'],
269
+ $elementData['selectedMinValue'],
270
+ $elementData['selectedMaxValue'],
271
+ $elementData['associatedFieldName']
272
+ );
273
+ } else {
274
+ $filter = FF::getInstance('asnFilterItem',
275
+ $this->getEncodingHandler()->encodeServerContentForPage($elementData['name']),
276
+ $filterLink,
277
+ $elementData['selected'],
278
+ $elementData['recordCount'],
279
+ $elementData['clusterLevel'],
280
+ ($elementData['previewImageURL'] ? $elementData['previewImageURL'] : ''),
281
+ $elementData['associatedFieldName']
282
+ );
283
+ }
284
+
285
+ return $filter;
286
+ }
287
+
288
+ protected function createLink($item)
289
+ {
290
+ return $this->getParamsParser()->createPageLink(
291
+ $this->getParamsParser()->parseParamsFromResultString(trim($item['searchParams']))
292
+ );
293
+ }
294
+
295
+ /**
296
+ * @return array of FACTFinder_SortItem objects
297
+ **/
298
+ protected function createSorting()
299
+ {
300
+ $sorting = array();
301
+ $jsonData = $this->getData();
302
+
303
+ $encodingHandler = $this->getEncodingHandler();
304
+ foreach ($jsonData['searchResult']['sortsList'] AS $sortItemData) {
305
+ $sortLink = $this->createLink($sortItemData);
306
+
307
+ $sorting[] = FF::getInstance('item',
308
+ $encodingHandler->encodeServerContentForPage(trim($sortItemData['description'])),
309
+ $sortLink,
310
+ $sortItemData['selected']
311
+ );
312
+ }
313
+ return $sorting;
314
+ }
315
+
316
+ /**
317
+ * @return array of FACTFinder_Item objects
318
+ **/
319
+ protected function createPaging()
320
+ {
321
+ $paging = null;
322
+ $jsonData = $this->getData();
323
+ $pagingData = $jsonData['searchResult']['paging'];
324
+ if (!empty($pagingData)) {
325
+ $paging = FF::getInstance('paging',
326
+ $pagingData['currentPage'],
327
+ $pagingData['pageCount'],
328
+ $this->getParamsParser()
329
+ );
330
+ } else {
331
+ $paging = FF::getInstance('paging', 1, 1, $this->getParamsParser());
332
+ }
333
+ return $paging;
334
+ }
335
+
336
+ /**
337
+ * @return FACTFinder_ProductsPerPageOptions
338
+ */
339
+ protected function createProductsPerPageOptions()
340
+ {
341
+ $pppOptions = array(); //default
342
+ $jsonData = $this->getData();
343
+
344
+ if (!empty($jsonData['searchResult']['resultsPerPageList']))
345
+ {
346
+ $defaultOption = -1;
347
+ $selectedOption = -1;
348
+ $options = array();
349
+ foreach ($jsonData['searchResult']['resultsPerPageList'] AS $optionData) {
350
+ $value = $optionData['value'];
351
+
352
+ if($optionData['default'])
353
+ $defaultOption = $value;
354
+ if($optionData['selected'])
355
+ $selectedOption = $value;
356
+
357
+ $url = $this->getParamsParser()->createPageLink(
358
+ $this->getParamsParser()->parseParamsFromResultString(trim($optionData['searchParams']))
359
+ );
360
+ $options[$value] = $url;
361
+ }
362
+ $pppOptions = FF::getInstance('productsPerPageOptions', $options, $defaultOption, $selectedOption);
363
+ }
364
+ return $pppOptions;
365
+ }
366
+
367
+ /**
368
+ * @return array of FACTFinder_BreadCrumbItem objects
369
+ */
370
+ protected function createBreadCrumbTrail()
371
+ {
372
+ $breadCrumbTrail = array();
373
+ $jsonData = $this->getData();
374
+
375
+ $breadCrumbTrailData = $jsonData['searchResult']['breadCrumbTrailItems'];
376
+
377
+ $encodingHandler = $this->getEncodingHandler();
378
+
379
+ $i = 1;
380
+ foreach($breadCrumbTrailData as $breadCrumbData)
381
+ {
382
+ $link = $this->createLink($breadCrumbData);
383
+
384
+ $fieldName = '';
385
+
386
+ $type = $encodingHandler->encodeServerContentForPage($breadCrumbData['type']);
387
+
388
+ if ($type == 'filter') {
389
+ $fieldName = $encodingHandler->encodeServerContentForPage($breadCrumbData['associatedFieldName']);
390
+ }
391
+
392
+ $breadCrumbTrail[] = FF::getInstance('breadCrumbItem',
393
+ $encodingHandler->encodeServerContentForPage(trim($breadCrumbData['text'])),
394
+ $link,
395
+ ($i == count($breadCrumbTrailData)),
396
+ $type,
397
+ $fieldName,
398
+ '' // The JSON response does not have a separate field for the unit but instead includes
399
+ // it in the "text" field.
400
+ );
401
+ ++$i;
402
+ }
403
+
404
+ return $breadCrumbTrail;
405
+ }
406
+
407
+
408
+ /**
409
+ * @return array of FACTFinder_Campaign objects
410
+ */
411
+ protected function createCampaigns()
412
+ {
413
+ $campaigns = array();
414
+ $jsonData = $this->getData();
415
+
416
+ if (isset($jsonData['campaigns'])) {
417
+ foreach ($jsonData['campaigns'] as $campaignData) {
418
+ $campaign = $this->createEmptyCampaignObject($campaignData);
419
+
420
+ $this->fillCampaignObject($campaign, $campaignData);
421
+
422
+ $campaigns[] = $campaign;
423
+ }
424
+ }
425
+ $campaignIterator = FF::getInstance('campaignIterator', $campaigns);
426
+ return $campaignIterator;
427
+ }
428
+
429
+ protected function createEmptyCampaignObject($campaignData)
430
+ {
431
+ return FF::getInstance('campaign',
432
+ $this->getEncodingHandler()->encodeServerContentForPage($campaignData['name']),
433
+ $this->getEncodingHandler()->encodeServerContentForPage($campaignData['category']),
434
+ $this->getEncodingHandler()->encodeServerUrlForPageUrl($campaignData['target']['destination'])
435
+ );
436
+ }
437
+
438
+ protected function fillCampaignObject($campaign, $campaignData)
439
+ {
440
+ $this->fillCampaignWithFeedback($campaign, $campaignData);
441
+ $this->fillCampaignWithPushedProducts($campaign, $campaignData);
442
+ }
443
+
444
+ protected function fillCampaignWithFeedback($campaign, $campaignData)
445
+ {
446
+ $campaign->addFeedback($this->getEncodingHandler()->encodeServerContentForPage($campaignData['feedbackTexts']));
447
+ }
448
+
449
+ protected function fillCampaignWithPushedProducts($campaign, $campaignData)
450
+ {
451
+ if (!empty($campaignData['pushedProducts'])) {
452
+ $pushedProducts = array();
453
+ foreach ($campaignData['pushedProducts'] AS $recordData) {
454
+ $fieldName = $recordData['field'];
455
+ $fieldValue = $recordData['name'];
456
+ $jsonData = $this->getData();
457
+ foreach ($jsonData['pushedProducts'] as $pushedProductData)
458
+ {
459
+ if ($pushedProductData['record'][$fieldName] == $fieldValue)
460
+ {
461
+ $record = FF::getInstance('record', $pushedProductData['id']);
462
+ $record->setValues($this->getEncodingHandler()->encodeServerContentForPage($pushedProductData['record']));
463
+
464
+ $pushedProducts[] = $record;
465
+ break;
466
+ }
467
+ }
468
+ }
469
+ $campaign->addPushedProducts($pushedProducts);
470
+ }
471
+ }
472
+
473
+ /**
474
+ * @return array of FACTFinder_SingleWordSearchItem objects
475
+ */
476
+ protected function createSingleWordSearch()
477
+ {
478
+ $jsonData = $this->getData();
479
+ $singleWordSearch = array();
480
+
481
+ if (!empty($jsonData['searchResults']['singleWordResults'])) {
482
+ $encodingHandler = $this->getEncodingHandler();
483
+ foreach ($jsonData['searchResults']['singleWordResults'] as $swsData) {
484
+ $query = $encodingHandler->encodeServerContentForPage($swsData['word']);
485
+ $singleWordSearchItem = FF::getInstance('singleWordSearchItem',
486
+ $query,
487
+ $this->getParamsParser()->createPageLink(array('query' => $query)),
488
+ $swsData['count']
489
+ );
490
+
491
+ $position = 1;
492
+ foreach($swsData['previewRecords'] as $recordData) {
493
+ $record = $this->getRecordFromRawRecord($recordData, $position);
494
+ $singleWordSearchItem->addPreviewRecord($record);
495
+ $position++;
496
+ }
497
+
498
+ $singleWordSearch[] = $singleWordSearchItem;
499
+ }
500
+ }
501
+ return $singleWordSearch;
502
+ }
503
+
504
+ public function getError()
505
+ {
506
+ $jsonData = $this->getData();
507
+ return isset($jsonData['error']) ? $jsonData['error'] : null;
508
+ }
509
+
510
+ public function getStackTrace()
511
+ {
512
+ $jsonData = $this->getData();
513
+ return isset($jsonData['stacktrace']) ? $jsonData['stacktrace'] : null;
514
+ }
515
+ }
lib/FACTFinder/Json66/SimilarRecordsAdapter.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json66_SimilarRecordsAdapter extends FACTFinder_Default_SimilarRecordsAdapter
3
+ {
4
+ /**
5
+ * @return void
6
+ **/
7
+ public function init() {
8
+ $this->log->info("Initializing new similar records adapter.");
9
+ $this->getDataProvider()->setParam('format', 'json');
10
+ $this->getDataProvider()->setType('SimilarRecords.ff');
11
+ }
12
+
13
+ /**
14
+ * try to parse data as json
15
+ *
16
+ * @throws Exception of data is no valid JSON
17
+ * @return stdClass
18
+ */
19
+ protected function getData()
20
+ {
21
+ $jsonData = json_decode(parent::getData(), true);
22
+ if ($jsonData === null)
23
+ throw new InvalidArgumentException("json_decode() raised error ".json_last_error());
24
+ return $jsonData;
25
+ }
26
+
27
+ protected function reloadData()
28
+ {
29
+ $jsonData = json_decode(parent::reloadData(), true);
30
+ if ($jsonData === null)
31
+ throw new InvalidArgumentException("json_decode() raised error ".json_last_error());
32
+ return $jsonData;
33
+ }
34
+
35
+ /**
36
+ * @param string id of the product which should be used to get similar attributes
37
+ * @return array $similarAttributes of value strings (field names as keys)
38
+ **/
39
+ protected function createSimilarAttributes() {
40
+ $similarAttributes = array();
41
+ $jsonData = $this->reloadData();
42
+ foreach($jsonData['attributes'] as $attributeData){
43
+ $similarAttributes[$attributeData['name']] = $attributeData['value'];
44
+ }
45
+ return $similarAttributes;
46
+ }
47
+
48
+ /**
49
+ * @param string id of the product which should be used to get similar records
50
+ * @return array $similarRecords list of FACTFinder_Record items
51
+ **/
52
+ protected function createSimilarRecords() {
53
+ $similarRecords = array();
54
+ $jsonData = $this->getData();
55
+ if (!empty($jsonData['records'])) {
56
+ $encodingHandler = $this->getEncodingHandler();
57
+
58
+ $positionCounter = 1;
59
+ foreach($jsonData['records'] as $recordData) {
60
+ // get current position
61
+ $position = $positionCounter;
62
+ $positionCounter++;
63
+
64
+ $similarRecords[] = FF::getInstance('record',
65
+ $recordData['id'],
66
+ 100,
67
+ $position,
68
+ $position,
69
+ $this->getEncodingHandler()->encodeServerContentForPage($recordData['record'])
70
+ );
71
+ }
72
+ }
73
+ return $similarRecords;
74
+ }
75
+ }
lib/FACTFinder/Json66/SuggestAdapter.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * suggest adapter using the json interface. expects a json formated string from the dataprovider
4
+ */
5
+ class FACTFinder_Json66_SuggestAdapter extends FACTFinder_Http_SuggestAdapter
6
+ {
7
+ /**
8
+ * init
9
+ */
10
+ protected function init()
11
+ {
12
+ parent::init();
13
+ $this->getDataProvider()->setParam('format', 'json');
14
+ }
15
+
16
+ /**
17
+ * try to parse data as json
18
+ *
19
+ * @throws Exception of data is no valid JSON
20
+ * @return stdClass
21
+ */
22
+ protected function getData()
23
+ {
24
+ $jsonData = json_decode(parent::getData());
25
+ if ($jsonData === null)
26
+ throw new InvalidArgumentException("json_decode() raised error ".json_last_error());
27
+ return $jsonData;
28
+ }
29
+
30
+ /**
31
+ * @return array of FACTFinder_SuggestQuery objects
32
+ */
33
+ protected function createSuggestions()
34
+ {
35
+ $jsonData = $this->getData();
36
+
37
+ $suggestions = array();
38
+ foreach($jsonData as $suggestData)
39
+ $suggestions[] = $this->createSuggestQueryFrom($suggestData);
40
+
41
+ return $suggestions;
42
+ }
43
+
44
+ /**
45
+ * @return FACTFinder_SuggestQuery
46
+ **/
47
+ protected function createSuggestQueryFrom($suggestData)
48
+ {
49
+ $query = strval($suggestData->query);
50
+ return FF::getInstance('suggestQuery',
51
+ $this->getEncodingHandler()->encodeServerContentForPage($query),
52
+ $this->getParamsParser()->createPageLink(array('query' => $query)),
53
+ strval($suggestData->hitCount),
54
+ $this->getEncodingHandler()->encodeServerContentForPage(strval($suggestData->type)),
55
+ strval($suggestData->imageURL)
56
+ );
57
+ }
58
+ }
lib/FACTFinder/Json66/TagCloudAdapter.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * tag cloud adapter using the json interface
4
+ */
5
+ class FACTFinder_Json66_TagCloudAdapter extends FACTFinder_Default_TagCloudAdapter
6
+ {
7
+ /**
8
+ * @return void
9
+ **/
10
+ public function init()
11
+ {
12
+ $this->log->info("Initializing new tag cloud adapter.");
13
+ $this->getDataProvider()->setType('WhatsHot.ff');
14
+ $this->getDataProvider()->setParam('do', 'getTagCloud');
15
+ $this->getDataProvider()->setParam('format', 'json');
16
+ }
17
+
18
+ /**
19
+ * try to parse data as json
20
+ *
21
+ * @throws Exception of data is no valid JSON
22
+ * @return stdClass
23
+ */
24
+ protected function getData()
25
+ {
26
+ $jsonData = json_decode(parent::getData());
27
+ if ($jsonData === null)
28
+ throw new InvalidArgumentException("json_decode() raised error ".json_last_error());
29
+ return $jsonData;
30
+ }
31
+
32
+ /**
33
+ * @return array $tagCloud list of FACTFinder_TagQuery items
34
+ **/
35
+ protected function createTagCloud()
36
+ {
37
+ $tagCloud = array();
38
+ $jsonTagCloud = $this->getData();
39
+ if (!empty($jsonTagCloud)) {
40
+ $encodingHandler = $this->getEncodingHandler();
41
+ $ffparams = $this->getParamsParser()->getFactfinderParams();
42
+ foreach($jsonTagCloud AS $tagQueryData) {
43
+ $query = $encodingHandler->encodeServerContentForPage(strval($tagQueryData->query));
44
+ $tagCloud[] = FF::getInstance('tagQuery',
45
+ $query,
46
+ $this->getParamsParser()->createPageLink(array('query' => $query)),
47
+ ($ffparams->getQuery() == $query),
48
+ $tagQueryData->weight,
49
+ $tagQueryData->searchCount
50
+ );
51
+ }
52
+ }
53
+ return $tagCloud;
54
+ }
55
+ }
lib/FACTFinder/Json67/CompareAdapter.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json67_CompareAdapter extends FACTFinder_Json66_CompareAdapter
3
+ {
4
+ /*
5
+ * no changes in FF 6.7
6
+ */
7
+ }
lib/FACTFinder/Json67/ImportAdapter.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * import adapter using the json interface
4
+ */
5
+ class FACTFinder_Json67_ImportAdapter extends FACTFinder_Json66_ImportAdapter
6
+ {
7
+ /*
8
+ * no changes in FF 6.7
9
+ */
10
+ }
lib/FACTFinder/Json67/ProductCampaignAdapter.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json67_ProductCampaignAdapter extends FACTFinder_Default_ProductCampaignAdapter
3
+ {
4
+ /**
5
+ * @return void
6
+ **/
7
+ public function init()
8
+ {
9
+ $this->log->info("Initializing new product campaign adapter.");
10
+ $this->getDataProvider()->setType('ProductCampaign.ff');
11
+ $this->getDataProvider()->setParam('format', 'json');
12
+ $this->getDataProvider()->setParam('do', 'getProductCampaigns');
13
+ }
14
+
15
+ /**
16
+ * try to parse data as json
17
+ *
18
+ * @throws Exception of data is no valid JSON
19
+ * @return stdClass
20
+ */
21
+ protected function getData()
22
+ {
23
+ $jsonData = json_decode(parent::getData(), true);
24
+ if ($jsonData === null)
25
+ throw new InvalidArgumentException("json_decode() raised error ".json_last_error());
26
+ return $jsonData;
27
+ }
28
+
29
+ /**
30
+ * @return array of FACTFinder_Campaign objects
31
+ */
32
+ protected function createCampaigns()
33
+ {
34
+ $campaigns = array();
35
+ $jsonData = $this->getData();
36
+
37
+ foreach ($jsonData as $campaignData) {
38
+ $campaign = $this->createEmptyCampaignObject($campaignData);
39
+
40
+ $this->fillCampaignObject($campaign, $campaignData);
41
+
42
+ $campaigns[] = $campaign;
43
+ }
44
+
45
+ $campaignIterator = FF::getInstance('campaignIterator', $campaigns);
46
+ return $campaignIterator;
47
+ }
48
+
49
+ protected function createEmptyCampaignObject($campaignData)
50
+ {
51
+ return FF::getInstance('campaign',
52
+ $this->getEncodingHandler()->encodeServerContentForPage($campaignData['name']),
53
+ '',
54
+ $this->getEncodingHandler()->encodeServerUrlForPageUrl($campaignData['target']['destination'])
55
+ );
56
+ }
57
+
58
+ protected function fillCampaignObject($campaign, $campaignData)
59
+ {
60
+ switch ($campaignData['flavour'])
61
+ {
62
+ case 'FEEDBACK':
63
+ $this->fillCampaignWithFeedback($campaign, $campaignData);
64
+ $this->fillCampaignWithPushedProducts($campaign, $campaignData);
65
+ break;
66
+ case 'ADVISOR':
67
+ $this->fillCampaignWithAdvisorData($campaign, $campaignData);
68
+ break;
69
+ }
70
+ }
71
+
72
+ protected function fillCampaignWithFeedback($campaign, $campaignData)
73
+ {
74
+ if (!empty($campaignData['feedbackTexts']))
75
+ {
76
+ $feedback = array();
77
+
78
+ foreach ($campaignData['feedbackTexts'] as $feedbackData)
79
+ {
80
+ $label = $feedbackData['label'];
81
+ if ($label !== '')
82
+ $feedback[$label] = $this->getEncodingHandler()->encodeServerContentForPage($feedbackData['text']);
83
+
84
+ $id = $feedbackData['id'];
85
+ if ($id !== null)
86
+ $feedback[$id] = $this->getEncodingHandler()->encodeServerContentForPage($feedbackData['text']);
87
+ }
88
+
89
+ $campaign->addFeedback($feedback);
90
+ }
91
+ }
92
+
93
+ protected function fillCampaignWithPushedProducts($campaign, $campaignData)
94
+ {
95
+ if (!empty($campaignData['pushedProductsRecordList'])) {
96
+ $pushedProducts = array();
97
+ foreach ($campaignData['pushedProductsRecordList'] as $recordData) {
98
+ $record = FF::getInstance('record', $recordData['id']);
99
+ $record->setValues($this->getEncodingHandler()->encodeServerContentForPage($recordData['record']));
100
+
101
+ $pushedProducts[] = $record;
102
+ }
103
+ $campaign->addPushedProducts($pushedProducts);
104
+ }
105
+ }
106
+
107
+ protected function fillCampaignWithAdvisorData($campaign, $campaignData)
108
+ {
109
+ $activeQuestions = array();
110
+
111
+ // The active questions can still be empty if we have already moved down the whole question tree (while the search query still fulfills the campaign condition)
112
+ foreach ($campaignData['activeQuestions'] as $questionData)
113
+ {
114
+ $activeQuestions[] = $this->loadAdvisorQuestion($questionData);
115
+ }
116
+
117
+ $campaign->addActiveQuestions($activeQuestions);
118
+
119
+ // Fetch advisor tree if it exists
120
+ $advisorTree = array();
121
+
122
+ foreach ($campaignData['activeQuestions'] as $questionData)
123
+ {
124
+ $activeQuestions[] = $this->loadAdvisorQuestion($questionData, true);
125
+ }
126
+
127
+ $campaign->addToAdvisorTree($advisorTree);
128
+ }
129
+
130
+ protected function loadAdvisorQuestion($questionData, $recursive = false)
131
+ {
132
+ $answers = array();
133
+
134
+ foreach ($questionData['answers'] as $answerData)
135
+ {
136
+ $text = $this->getEncodingHandler()->encodeServerContentForPage($answerData['text']);
137
+ $params = $this->getParamsParser()->createPageLink(
138
+ $this->getParamsParser()->parseParamsFromResultString('') //trim($answerData['params'])) // TODO: Read out that huge params object
139
+ );
140
+
141
+ $subquestions = array();
142
+ if ($recursive)
143
+ foreach($answerData['questions'] as $subquestionData)
144
+ $subquestions[] = $this->loadAdvisorQuestion($subquestionData, true);
145
+
146
+ $answers[] = FF::getInstance('advisorAnswer',
147
+ $text,
148
+ $params,
149
+ $subquestions
150
+ );
151
+ }
152
+
153
+ return FF::getInstance('advisorQuestion',
154
+ $this->getEncodingHandler()->encodeServerContentForPage($questionData['text']),
155
+ $answers
156
+ );
157
+ }
158
+
159
+ }
160
+
lib/FACTFinder/Json67/RecommendationAdapter.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * adapter for the factfinder recommendation engine, working with the JSON interface of FF6.7
4
+ */
5
+ class FACTFinder_Json67_RecommendationAdapter extends FACTFinder_Json66_RecommendationAdapter
6
+ {
7
+ private $jsonData;
8
+
9
+ /**
10
+ * @return void
11
+ **/
12
+ public function init()
13
+ {
14
+ parent::init();
15
+ $this->log->info("Initializing new recommendation adapter.");
16
+ $this->getDataProvider()->setParam('do', 'getRecommendation');
17
+ $this->getDataProvider()->setParam('format', 'json');
18
+ $this->getDataProvider()->setType('Recommender.ff');
19
+ }
20
+
21
+ /**
22
+ * try to parse data as json
23
+ *
24
+ * @throws Exception of data is no valid JSON
25
+ * @return stdClass
26
+ */
27
+ protected function getData()
28
+ {
29
+ if($this->jsonData === null || !$this->recommendationUpToDate)
30
+ {
31
+ $this->jsonData = json_decode(parent::getData(), true); // the second parameter turns JSON-objects into associative arrays which makes extracting the record fields easier
32
+ if ($this->jsonData === null)
33
+ throw new InvalidArgumentException("json_decode() raised error ".json_last_error());
34
+ $this->recommendationUpToDate = true;
35
+ }
36
+ return $this->jsonData;
37
+ }
38
+
39
+ protected function createRecommendations() {
40
+ $records = array();
41
+
42
+ $position = 0;
43
+ foreach($this->getData() as $recordData)
44
+ if ($this->idsOnly)
45
+ $records[] = $this->createSparseRecordFrom($recordData);
46
+ else
47
+ $records[] = $this->createRecordFrom($recordData, $position++);
48
+
49
+ return FF::getInstance('result', $records, count($records));
50
+ }
51
+
52
+ protected function createSparseRecordFrom($recordData)
53
+ {
54
+ return FF::getInstance('record', strval($recordData["id"]));
55
+ }
56
+
57
+ protected function createRecordFrom($recordData, $position)
58
+ {
59
+ return FF::getInstance('record',
60
+ strval($recordData["id"]),
61
+ 100.0,
62
+ $position,
63
+ $position,
64
+ $recordData["record"]);
65
+ }
66
+
67
+ /**
68
+ * Set ids of products to base recommendation on
69
+ *
70
+ * @param array $productIds list of integers
71
+ **/
72
+ public function setProductIds($productIds) {
73
+ $this->productIds = $productIds;
74
+ $this->getDataProvider()->setArrayParam('id', $productIds);
75
+ $this->recommendationUpToDate = false;
76
+ }
77
+
78
+ /**
79
+ * Adds an id to the list of products to base recommendation on
80
+ *
81
+ * @param int $productId
82
+ **/
83
+ public function addProductId($productId) {
84
+ $this->productIds[] = $productId;
85
+ $this->getDataProvider()->setArrayParam('id', $this->productIds);
86
+ $this->recommendationUpToDate = false;
87
+ }
88
+ }
lib/FACTFinder/Json67/SearchAdapter.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * search adapter using the json interface. expects a json formated string from the dataprovider
4
+ */
5
+ class FACTFinder_Json67_SearchAdapter extends FACTFinder_Json66_SearchAdapter
6
+ {
7
+ /**
8
+ * @return array of FACTFinder_Campaign objects
9
+ */
10
+ protected function createCampaigns()
11
+ {
12
+ $campaigns = array();
13
+ $jsonData = $this->getData();
14
+
15
+ if (isset($jsonData['searchResult']['campaignsList'])) {
16
+
17
+ foreach ($jsonData['searchResult']['campaignsList'] as $campaignData) {
18
+ $campaign = $this->createEmptyCampaignObject($campaignData);
19
+
20
+ $this->fillCampaignObject($campaign, $campaignData);
21
+
22
+ $campaigns[] = $campaign;
23
+ }
24
+ }
25
+ $campaignIterator = FF::getInstance('campaignIterator', $campaigns);
26
+ return $campaignIterator;
27
+ }
28
+
29
+ protected function createEmptyCampaignObject($campaignData)
30
+ {
31
+ return FF::getInstance('campaign',
32
+ $this->getEncodingHandler()->encodeServerContentForPage($campaignData['name']),
33
+ '',
34
+ $this->getEncodingHandler()->encodeServerUrlForPageUrl($campaignData['target']['destination'])
35
+ );
36
+ }
37
+
38
+ protected function fillCampaignObject($campaign, $campaignData)
39
+ {
40
+ switch ($campaignData['flavour'])
41
+ {
42
+ case 'FEEDBACK':
43
+ $this->fillCampaignWithFeedback($campaign, $campaignData);
44
+ $this->fillCampaignWithPushedProducts($campaign, $campaignData);
45
+ break;
46
+ case 'ADVISOR':
47
+ $this->fillCampaignWithAdvisorData($campaign, $campaignData);
48
+ break;
49
+ }
50
+ }
51
+
52
+ protected function fillCampaignWithFeedback($campaign, $campaignData)
53
+ {
54
+ if (!empty($campaignData['feedbackTexts']))
55
+ {
56
+ $feedback = array();
57
+
58
+ foreach ($campaignData['feedbackTexts'] as $feedbackData)
59
+ {
60
+ $label = $feedbackData['label'];
61
+ if ($label !== '')
62
+ $feedback[$label] = $this->getEncodingHandler()->encodeServerContentForPage($feedbackData['text']);
63
+
64
+ $id = $feedbackData['id'];
65
+ if ($id !== null)
66
+ $feedback[$id] = $this->getEncodingHandler()->encodeServerContentForPage($feedbackData['text']);
67
+ }
68
+
69
+ $campaign->addFeedback($feedback);
70
+ }
71
+ }
72
+
73
+ protected function fillCampaignWithPushedProducts($campaign, $campaignData)
74
+ {
75
+ if (!empty($campaignData['pushedProductsRecordList'])) {
76
+ $pushedProducts = array();
77
+ foreach ($campaignData['pushedProductsRecordList'] as $recordData) {
78
+ $record = FF::getInstance('record', $recordData['id']);
79
+ $record->setValues($this->getEncodingHandler()->encodeServerContentForPage($recordData['record']));
80
+
81
+ $pushedProducts[] = $record;
82
+ }
83
+ $campaign->addPushedProducts($pushedProducts);
84
+ }
85
+ }
86
+
87
+ protected function fillCampaignWithAdvisorData($campaign, $campaignData)
88
+ {
89
+ $activeQuestions = array();
90
+
91
+ // The active questions can still be empty if we have already moved down the whole question tree (while the search query still fulfills the campaign condition)
92
+ foreach ($campaignData['activeQuestions'] as $questionData)
93
+ {
94
+ $activeQuestions[] = $this->loadAdvisorQuestion($questionData);
95
+ }
96
+
97
+ $campaign->addActiveQuestions($activeQuestions);
98
+
99
+ // Fetch advisor tree if it exists
100
+ $advisorTree = array();
101
+
102
+ foreach ($campaignData['activeQuestions'] as $questionData)
103
+ {
104
+ $activeQuestions[] = $this->loadAdvisorQuestion($questionData, true);
105
+ }
106
+
107
+ $campaign->addToAdvisorTree($advisorTree);
108
+ }
109
+
110
+ protected function loadAdvisorQuestion($questionData, $recursive = false)
111
+ {
112
+ $answers = array();
113
+
114
+ foreach ($questionData['answers'] as $answerData)
115
+ {
116
+ $text = $this->getEncodingHandler()->encodeServerContentForPage($answerData['text']);
117
+ $params = $this->getParamsParser()->createPageLink(
118
+ $this->getParamsParser()->parseParamsFromResultString(trim($answerData['params']))
119
+ );
120
+
121
+ $subquestions = array();
122
+ if ($recursive)
123
+ foreach($answerData['questions'] as $subquestionData)
124
+ $subquestions[] = $this->loadAdvisorQuestion($subquestionData, true);
125
+
126
+ $answers[] = FF::getInstance('advisorAnswer',
127
+ $text,
128
+ $params,
129
+ $subquestions
130
+ );
131
+ }
132
+
133
+ return FF::getInstance('advisorQuestion',
134
+ $this->getEncodingHandler()->encodeServerContentForPage($questionData['text']),
135
+ $answers
136
+ );
137
+ }
138
+ }
lib/FACTFinder/Json67/SimilarRecordsAdapter.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json67_SimilarRecordsAdapter extends FACTFinder_Json66_SimilarRecordsAdapter
3
+ {
4
+ /*
5
+ * no changes in FF 6.7
6
+ */
7
+ }
lib/FACTFinder/Json67/SuggestAdapter.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * suggest adapter using the json interface. expects a json formated string from the dataprovider
4
+ */
5
+ class FACTFinder_Json67_SuggestAdapter extends FACTFinder_Json66_SuggestAdapter
6
+ {
7
+ /**
8
+ * no changes in FF 6.7
9
+ **/
10
+ }
lib/FACTFinder/Json67/TagCloudAdapter.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * tag cloud adapter using the json interface
4
+ */
5
+ class FACTFinder_Json67_TagCloudAdapter extends FACTFinder_Json66_TagCloudAdapter
6
+ {
7
+ /*
8
+ * no changes in FF 6.7
9
+ */
10
+ }
lib/FACTFinder/Json68/CompareAdapter.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json68_CompareAdapter extends FACTFinder_Json67_CompareAdapter
3
+ {
4
+ /*
5
+ * no changes in FF 6.8
6
+ */
7
+ }
lib/FACTFinder/Json68/ImportAdapter.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * import adapter using the json interface
4
+ */
5
+ class FACTFinder_Json68_ImportAdapter extends FACTFinder_Json67_ImportAdapter
6
+ {
7
+ /*
8
+ * no changes in FF 6.8
9
+ */
10
+ }
lib/FACTFinder/Json68/ProductCampaignAdapter.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json68_ProductCampaignAdapter extends FACTFinder_Json67_ProductCampaignAdapter
3
+ {
4
+ protected function fillCampaignWithPushedProducts($campaign, $campaignData)
5
+ {
6
+ if (!empty($campaignData['pushedProductsRecords'])) {
7
+ $pushedProducts = array();
8
+ foreach ($campaignData['pushedProductsRecords'] as $recordData) {
9
+ $record = FF::getInstance('record', $recordData['id']);
10
+ $record->setValues($this->getEncodingHandler()->encodeServerContentForPage($recordData['record']));
11
+
12
+ $pushedProducts[] = $record;
13
+ }
14
+ $campaign->addPushedProducts($pushedProducts);
15
+ }
16
+ }
17
+
18
+ // FF 6.8 removed the advisor from product detail and shopping cart campaigns
19
+ protected function fillCampaignObject($campaign, $campaignData)
20
+ {
21
+ $this->fillCampaignWithFeedback($campaign, $campaignData);
22
+ $this->fillCampaignWithPushedProducts($campaign, $campaignData);
23
+ }
24
+ }
25
+
lib/FACTFinder/Json68/RecommendationAdapter.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * recommendation adapter using the json interface
4
+ */
5
+ class FACTFinder_Json68_RecommendationAdapter extends FACTFinder_Json67_RecommendationAdapter
6
+ {
7
+ /*
8
+ * no changes in FF 6.8
9
+ */
10
+ }
lib/FACTFinder/Json68/SearchAdapter.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * search adapter using the json interface. expects a json formated string from the dataprovider
4
+ */
5
+ class FACTFinder_Json68_SearchAdapter extends FACTFinder_Json67_SearchAdapter
6
+ {
7
+ /**
8
+ * @return array of FACTFinder_Campaign objects
9
+ */
10
+ protected function createCampaigns()
11
+ {
12
+ $campaigns = array();
13
+ $jsonData = $this->getData();
14
+
15
+ if (isset($jsonData['searchResult']['campaigns'])) {
16
+
17
+ foreach ($jsonData['searchResult']['campaigns'] as $campaignData) {
18
+ $campaign = $this->createEmptyCampaignObject($campaignData);
19
+
20
+ $this->fillCampaignObject($campaign, $campaignData);
21
+
22
+ $campaigns[] = $campaign;
23
+ }
24
+ }
25
+ $campaignIterator = FF::getInstance('campaignIterator', $campaigns);
26
+ return $campaignIterator;
27
+ }
28
+
29
+ protected function fillCampaignWithPushedProducts($campaign, $campaignData)
30
+ {
31
+ if (!empty($campaignData['pushedProductsRecords'])) {
32
+ $pushedProducts = array();
33
+ foreach ($campaignData['pushedProductsRecords'] as $recordData) {
34
+ $record = FF::getInstance('record', $recordData['id']);
35
+ $record->setValues($this->getEncodingHandler()->encodeServerContentForPage($recordData['record']));
36
+
37
+ $pushedProducts[] = $record;
38
+ }
39
+ $campaign->addPushedProducts($pushedProducts);
40
+ }
41
+ }
42
+ }
lib/FACTFinder/Json68/SimilarRecordsAdapter.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json68_SimilarRecordsAdapter extends FACTFinder_Json67_SimilarRecordsAdapter
3
+ {
4
+ }
lib/FACTFinder/Json68/SuggestAdapter.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * suggest adapter using the json interface. expects a json formated string from the dataprovider
4
+ */
5
+ class FACTFinder_Json68_SuggestAdapter extends FACTFinder_Json67_SuggestAdapter
6
+ {
7
+ /**
8
+ * TODO: Utilize all new Suggest features
9
+ **/
10
+
11
+ protected function createSuggestQueryFrom($suggestData)
12
+ {
13
+ $query = strval($suggestData->name);
14
+ return FF::getInstance('suggestQuery',
15
+ $this->encodingHandler->encodeServerContentForPage($query),
16
+ $this->paramsParser->createPageLink($this->paramsParser->parseParamsFromString(strval($suggestData->searchParams))),
17
+ strval($suggestData->hitCount),
18
+ $this->encodingHandler->encodeServerContentForPage(strval($suggestData->type)),
19
+ strval($suggestData->image)
20
+ );
21
+ }
22
+ }
lib/FACTFinder/Json68/TagCloudAdapter.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * tag cloud adapter using the json interface
4
+ */
5
+ class FACTFinder_Json68_TagCloudAdapter extends FACTFinder_Json67_TagCloudAdapter
6
+ {
7
+ /*
8
+ * no changes in FF 6.8
9
+ */
10
+ }
lib/FACTFinder/Json69/CompareAdapter.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json69_CompareAdapter extends FACTFinder_Json68_CompareAdapter
3
+ {
4
+ /*
5
+ * no changes in FF 6.9
6
+ */
7
+ }
lib/FACTFinder/Json69/ImportAdapter.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * import adapter using the json interface
4
+ */
5
+ class FACTFinder_Json69_ImportAdapter extends FACTFinder_Json68_ImportAdapter
6
+ {
7
+ /*
8
+ * no changes in FF 6.9
9
+ */
10
+ }
lib/FACTFinder/Json69/ProductCampaignAdapter.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json69_ProductCampaignAdapter extends FACTFinder_Json68_ProductCampaignAdapter
3
+ {
4
+ /*
5
+ * no changes in FF 6.9
6
+ */
7
+ }
8
+
lib/FACTFinder/Json69/RecommendationAdapter.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * recommendation adapter using the json interface
4
+ */
5
+ class FACTFinder_Json69_RecommendationAdapter extends FACTFinder_Json68_RecommendationAdapter
6
+ {
7
+ /*
8
+ * no changes in FF 6.9
9
+ */
10
+ }
lib/FACTFinder/Json69/SearchAdapter.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Search adapter using the json interface.
4
+ */
5
+ class FACTFinder_Json69_SearchAdapter extends FACTFinder_Json68_SearchAdapter
6
+ {
7
+ protected $refKey = null;
8
+
9
+ protected function createLink($item) {
10
+ if ($this->refKey == null)
11
+ $this->refKey = $this->getResultFromRawResult($this->getData())->getRefKey();
12
+
13
+ return $this->getParamsParser()->createPageLink(
14
+ $this->getParamsParser()->parseParamsFromResultString(trim($item['searchParams'])),
15
+ array('sourceRefKey' => $this->refKey)
16
+ );
17
+ }
18
+
19
+ protected function getResultFromRawResult($jsonData) {
20
+ $result = parent::getResultFromRawResult($jsonData);
21
+
22
+ if (isset($jsonData['searchResult']['refKey'])) {
23
+ $result->setRefKey($jsonData['searchResult']['refKey']);
24
+ }
25
+
26
+ return $result;
27
+ }
28
+
29
+ /**
30
+ * @return array of FACTFinder_Item objects
31
+ **/
32
+ protected function createPaging()
33
+ {
34
+ $paging = parent::createPaging();
35
+
36
+ $jsonData = $this->getData();
37
+ if (!empty($jsonData['searchResult']['paging']) && isset($jsonData['searchResult']['refKey']))
38
+ $paging->setSourceRefKey($jsonData['searchResult']['refKey']);
39
+
40
+ return $paging;
41
+ }
42
+
43
+ /**
44
+ * @return FACTFinder_ProductsPerPageOptions
45
+ */
46
+ protected function createProductsPerPageOptions()
47
+ {
48
+ $pppOptions = array(); //default
49
+ $jsonData = $this->getData();
50
+
51
+ if (!empty($jsonData['searchResult']['resultsPerPageList']))
52
+ {
53
+ $defaultOption = -1;
54
+ $selectedOption = -1;
55
+ $options = array();
56
+ foreach ($jsonData['searchResult']['resultsPerPageList'] AS $optionData) {
57
+ $value = $optionData['value'];
58
+
59
+ if($optionData['default'])
60
+ $defaultOption = $value;
61
+ if($optionData['selected'])
62
+ $selectedOption = $value;
63
+
64
+ $searchParams = $this->getParamsParser()->parseParamsFromResultString(trim($optionData['searchParams']));
65
+ $searchParams['sourceRefKey'] = $jsonData['searchResult']['refKey'];
66
+ $url = $this->getParamsParser()->createPageLink($searchParams);
67
+
68
+ $options[$value] = $url;
69
+ }
70
+ $pppOptions = FF::getInstance('productsPerPageOptions', $options, $defaultOption, $selectedOption);
71
+ }
72
+ return $pppOptions;
73
+ }
74
+ }
lib/FACTFinder/Json69/SimilarRecordsAdapter.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class FACTFinder_Json69_SimilarRecordsAdapter extends FACTFinder_Json68_SimilarRecordsAdapter
3
+ {
4
+ /*
5
+ * no changes in FF 6.9
6
+ */
7
+ }
lib/FACTFinder/Json69/SuggestAdapter.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * suggest adapter using the json interface. expects a json formated string from the dataprovider
4
+ */
5
+ class FACTFinder_Json69_SuggestAdapter extends FACTFinder_Json68_SuggestAdapter
6
+ {
7
+ /**
8
+ * TODO: Utilize all new Suggest features
9
+ **/
10
+
11
+ protected function createSuggestQueryFrom($suggestData)
12
+ {
13
+ $suggestQuery = parent::createSuggestQueryFrom($suggestData);
14
+ $suggestQuery->setRefKey(strval($suggestData->refKey));
15
+ return $suggestQuery;
16
+ }
17
+ }
lib/FACTFinder/Json69/TagCloudAdapter.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * tag cloud adapter using the json interface
4
+ */
5
+ class FACTFinder_Json69_TagCloudAdapter extends FACTFinder_Json68_TagCloudAdapter
6
+ {
7
+ public function init() {
8
+ parent::init();
9
+ $this->getDataProvider()->setType('TagCloud.ff');
10
+ }
11
+ }
lib/FACTFinder/Paging.php CHANGED
@@ -24,9 +24,12 @@ class FACTFinder_Paging implements IteratorAggregate
24
  protected $params;
25
  protected $displayPageCount = 9;
26
 
 
 
 
27
  /**
28
  * class constructor - puts paging data from the SimpleXMLElement object
29
- * into usefull structure
30
  *
31
  * @param int $currentPage
32
  * @param int $pageCount
@@ -90,7 +93,10 @@ class FACTFinder_Paging implements IteratorAggregate
90
  if ($page_number > $this->pageCount || $page_number < 1) {
91
  return '';
92
  }
93
- return $this->paramsParser->createPageLink($this->params, array('page' => $page_number), $link_target);
 
 
 
94
  }
95
 
96
  /**
@@ -174,4 +180,12 @@ class FACTFinder_Paging implements IteratorAggregate
174
  return $first_page_number+$this->displayPageCount;
175
  }
176
  }
 
 
 
 
 
 
 
 
177
  }
24
  protected $params;
25
  protected $displayPageCount = 9;
26
 
27
+ /* New in 6.9. Should be version specific, but Paging is outside of the versioning structure atm. */
28
+ protected $sourceRefKey = null;
29
+
30
  /**
31
  * class constructor - puts paging data from the SimpleXMLElement object
32
+ * into useful structure
33
  *
34
  * @param int $currentPage
35
  * @param int $pageCount
93
  if ($page_number > $this->pageCount || $page_number < 1) {
94
  return '';
95
  }
96
+ $additionalParams = array('page' => $page_number);
97
+ if ($this->sourceRefKey != null)
98
+ $additionalParams['sourceRefKey'] = $this->sourceRefKey;
99
+ return $this->paramsParser->createPageLink($this->params, $additionalParams, $link_target);
100
  }
101
 
102
  /**
180
  return $first_page_number+$this->displayPageCount;
181
  }
182
  }
183
+
184
+ /** Set the sourceRefKey to add to urls.
185
+ * @param string sourceRefKey to set
186
+ */
187
+ public function setSourceRefKey($sourceRefKey)
188
+ {
189
+ $this->sourceRefKey = $sourceRefKey;
190
+ }
191
  }
lib/FACTFinder/ParametersParser.php CHANGED
@@ -121,7 +121,8 @@ class FACTFinder_ParametersParser
121
  isset($params['page']) ? $params['page'] : 1,
122
  $filters,
123
  $sortings,
124
- (isset($params['catalog']) && $params['catalog'] == 'true'),
 
125
  isset($params['followSearch']) ? $params['followSearch'] : 10000
126
  );
127
  }
@@ -279,7 +280,7 @@ class FACTFinder_ParametersParser
279
  $returnParams = array();
280
  foreach($params as $key => $value) {
281
  // copy each param and do not set to null, because mappings are stored as references in the params array
282
- if(!isset($ignoredParams[$key]) && strlen($value) > 0) {
283
  $returnParams[$key] = $value;
284
  }
285
  }
@@ -330,6 +331,11 @@ class FACTFinder_ParametersParser
330
  return $this->requestTarget;
331
  }
332
 
 
 
 
 
 
333
  /**
334
  * do mapping for a params array with the page mapping settings from the config. so this method expects server params
335
  * and return params for the page
121
  isset($params['page']) ? $params['page'] : 1,
122
  $filters,
123
  $sortings,
124
+ ((isset($params['catalog']) && $params['catalog'] == 'true') ||
125
+ (isset($params['navigation']) && $params['navigation'] == 'true')),
126
  isset($params['followSearch']) ? $params['followSearch'] : 10000
127
  );
128
  }
280
  $returnParams = array();
281
  foreach($params as $key => $value) {
282
  // copy each param and do not set to null, because mappings are stored as references in the params array
283
+ if(!isset($ignoredParams[$key]) && ((is_array($value) && count($value) > 0) || strlen($value) > 0 )) {
284
  $returnParams[$key] = $value;
285
  }
286
  }
331
  return $this->requestTarget;
332
  }
333
 
334
+ public function setRequestTarget($target)
335
+ {
336
+ $this->requestTarget = $target;
337
+ }
338
+
339
  /**
340
  * do mapping for a params array with the page mapping settings from the config. so this method expects server params
341
  * and return params for the page
lib/FACTFinder/Record.php CHANGED
@@ -255,4 +255,4 @@ class FACTFinder_Record
255
  $this->setValue($name, $value);
256
  }
257
  }
258
- }
255
  $this->setValue($name, $value);
256
  }
257
  }
258
+ }
lib/FACTFinder/Result.php CHANGED
@@ -19,6 +19,7 @@
19
  class FACTFinder_Result extends ArrayIterator
20
  {
21
  private $foundRecordsCount;
 
22
 
23
  /**
24
  * @param array record (default: empty array)
@@ -38,4 +39,24 @@ class FACTFinder_Result extends ArrayIterator
38
  public function getFoundRecordsCount(){
39
  return $this->foundRecordsCount;
40
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
19
  class FACTFinder_Result extends ArrayIterator
20
  {
21
  private $foundRecordsCount;
22
+ private $refKey;
23
 
24
  /**
25
  * @param array record (default: empty array)
39
  public function getFoundRecordsCount(){
40
  return $this->foundRecordsCount;
41
  }
42
+
43
+ /**
44
+ * Set this result's reference Key.
45
+ *
46
+ * @version since FF6.9
47
+ * @param reference Key, used for tracking
48
+ */
49
+ public final function setRefKey($refKey) {
50
+ $this->refKey = $refKey;
51
+ }
52
+
53
+ /**
54
+ * Get this result's reference Key.
55
+ *
56
+ * @version since FF6.9
57
+ * @return the reference Key used for tracking
58
+ */
59
+ public final function getRefKey() {
60
+ return $this->refKey;
61
+ }
62
  }
lib/FACTFinder/SuggestQuery.php CHANGED
@@ -1,18 +1,6 @@
1
  <?php
2
- /**
3
- * FACT-Finder PHP Framework
4
- *
5
- * @category Library
6
- * @package FACTFinder\Common
7
- * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
- */
9
-
10
  /**
11
  * represents a query for suggest
12
- *
13
- * @author Rudolf Batt <rb@omikron.net>
14
- * @version $Id: SuggestQuery.php 25893 2010-06-29 08:19:43Z rb $
15
- * @package FACTFinder\Common
16
  */
17
  class FACTFinder_SuggestQuery
18
  {
@@ -21,7 +9,8 @@ class FACTFinder_SuggestQuery
21
  private $hitCount;
22
  private $type;
23
  private $imageUrl;
24
-
 
25
  /**
26
  * @param string $value query
27
  * @param string $url url which uses the suggested query
@@ -75,4 +64,24 @@ class FACTFinder_SuggestQuery
75
  public function getImageUrl() {
76
  return $this->imageUrl;
77
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
1
  <?php
 
 
 
 
 
 
 
 
2
  /**
3
  * represents a query for suggest
 
 
 
 
4
  */
5
  class FACTFinder_SuggestQuery
6
  {
9
  private $hitCount;
10
  private $type;
11
  private $imageUrl;
12
+ private $refKey;
13
+
14
  /**
15
  * @param string $value query
16
  * @param string $url url which uses the suggested query
64
  public function getImageUrl() {
65
  return $this->imageUrl;
66
  }
67
+
68
+ /**
69
+ * Set this suggest query's reference Key.
70
+ *
71
+ * @version since FF6.9
72
+ * @param reference Key, used for tracking
73
+ */
74
+ public final function setRefKey($refKey) {
75
+ $this->refKey = $refKey;
76
+ }
77
+
78
+ /**
79
+ * Get this suggest query's reference Key.
80
+ *
81
+ * @version since FF6.9
82
+ * @return the reference Key used for tracking
83
+ */
84
+ public final function getRefKey() {
85
+ return $this->refKey;
86
+ }
87
  }
lib/FACTFinder/Util.php CHANGED
@@ -24,10 +24,42 @@ class FACTFinder_Util
24
  $this->searchAdapter = $searchAdapter;
25
  }
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  /**
28
  * @return string javascript method call "clickProduct" with all needed arguments
29
  */
30
- public function createJavaScriptClickCode($record, $title, $sid)
31
  {
32
  $query = addcslashes(htmlspecialchars($this->ffparams->getQuery()), "'");
33
  $channel = $this->ffparams->getChannel();
@@ -39,8 +71,8 @@ class FACTFinder_Util
39
  $position = $record->getPosition();
40
  if ($position != 0 && $query != '') {
41
  $originalPosition = $record->getOriginalPosition();
42
- if (!$originalPosition) $originalPosition = $position;
43
-
44
  $similarity = number_format($record->getSimilarity(), 2, '.', '');
45
  $id = $record->getId();
46
 
@@ -54,4 +86,4 @@ class FACTFinder_Util
54
 
55
  return $clickCode;
56
  }
57
- }
24
  $this->searchAdapter = $searchAdapter;
25
  }
26
 
27
+ public function createJavaScriptClickCode($record, $title, $sid, $useLegacyTracking = true) {
28
+ if (strlen($sid) == 0) $sid = session_id();
29
+ if ($useLegacyTracking) {
30
+ return $this->createLegacyJavaScriptClickCode($record, $title, $sid);
31
+ } else {
32
+ $channel = $this->ffparams->getChannel();
33
+ $id = $record->getId();
34
+ return $this->createJavaScriptTrackingCode('inspect', $this->searchAdapter->getResult()->getRefKey(), $sid, $channel, array("id" => $id));
35
+ }
36
+ }
37
+
38
+ public function createJavaScriptTrackingCode($event, $sourceRefKey, $sid = null, $channel = null, $extraParams = array()) {
39
+ if (strlen($sid) == 0) $sid = session_id();
40
+ if (strlen($channel) == 0) $channel = $this->ffparams->getChannel();
41
+ $sid = addslashes($sid);
42
+ $extString = '{';
43
+ foreach ($extraParams AS $extKey => $extVal) {
44
+ $extString .= $extKey . ": '" . $extVal . '\'';
45
+ }
46
+ $extString .= '}';
47
+ return "trackEvent('$event', '$sourceRefKey', '$sid', '$channel', $extString);";
48
+ }
49
+
50
+ public function createJavaScriptEventCode($trackingEvents, $sid, $channel) {
51
+ $result = "";
52
+ $sourceRefKey = $this->searchAdapter->getResult()->getRefKey();
53
+ foreach ($trackingEvents AS $event => $extraParams) {
54
+ $result .= $this->createJavaScriptTrackingCode($event, $sourceRefKey, $sid, $channel, $extraParams);
55
+ }
56
+ return "$(document).ready( function (){ $result });";
57
+ }
58
+
59
  /**
60
  * @return string javascript method call "clickProduct" with all needed arguments
61
  */
62
+ private function createLegacyJavaScriptClickCode($record, $title, $sid)
63
  {
64
  $query = addcslashes(htmlspecialchars($this->ffparams->getQuery()), "'");
65
  $channel = $this->ffparams->getChannel();
71
  $position = $record->getPosition();
72
  if ($position != 0 && $query != '') {
73
  $originalPosition = $record->getOriginalPosition();
74
+ if (!$originalPosition) $originalPosition = $position;
75
+
76
  $similarity = number_format($record->getSimilarity(), 2, '.', '');
77
  $id = $record->getId();
78
 
86
 
87
  return $clickCode;
88
  }
89
+ }
lib/FACTFinder/Xml65/SearchAdapter.php CHANGED
@@ -25,7 +25,7 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
25
  */
26
  protected function init()
27
  {
28
- $this->log->info("Initializing new search adapter.");
29
  $this->getDataProvider()->setParam('format', 'xml');
30
  $this->getDataProvider()->setType('Search.ff');
31
  }
@@ -51,7 +51,8 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
51
  *
52
  * @return string status
53
  **/
54
- public function getArticleNumberSearchStatus() {
 
55
  if ($this->articleNumberSearchStatus == null) {
56
 
57
  $this->isArticleNumberSearch = false;
@@ -69,7 +70,8 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
69
  *
70
  * @return boolean isArticleNumberSearch
71
  **/
72
- public function isArticleNumberSearch() {
 
73
  if ($this->isArticleNumberSearch === null) {
74
 
75
  $this->isArticleNumberSearch = false;
@@ -86,9 +88,10 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
86
  *
87
  * @return void
88
  */
89
- private function loadArticleNumberSearchInformations() {
 
90
  $xmlResult = $this->getData();
91
- switch($xmlResult->articleNumberSearchStatus){
92
  case 'nothingFound':
93
  $this->isArticleNumberSearch = true;
94
  $this->articleNumberSearchStatus = self::NOTHING_FOUND;
@@ -112,7 +115,7 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
112
  public function isSearchTimedOut()
113
  {
114
  $xmlResult = $this->getData();
115
- if($xmlResult->searchTimedOut == 'true') {
116
  return true;
117
  } else {
118
  return false;
@@ -128,7 +131,7 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
128
  {
129
  if ($this->status == null) {
130
  $xmlResult = $this->getData();
131
- switch($xmlResult->searchStatus){
132
  case 'nothingFound':
133
  $this->status = self::NOTHING_FOUND;
134
  break;
@@ -146,7 +149,7 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
146
  {
147
  $breadCrumbTrail = $this->getBreadCrumbTrail();
148
  if (sizeof($breadCrumbTrail) > 0) {
149
- $paramString = $breadCrumbTrail[sizeof($breadCrumbTrail)-1]->getUrl();
150
  $searchParams = $this->getParamsParser()->getFactfinderParamsFromString($paramString);
151
  } else {
152
  $searchParams = $this->getParamsParser()->getFactfinderParams();
@@ -157,13 +160,13 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
157
  protected function createResult()
158
  {
159
  //init default values
160
- $result = array();
161
  $resultCount = 0;
162
  $xmlResult = $this->getData();
163
 
164
  //load result values from the xml element
165
  if (!empty($xmlResult->results)) {
166
- $resultCount = (int) $xmlResult->results->attributes()->count;
167
  $encodingHandler = $this->getEncodingHandler();
168
 
169
  $paging = $this->getPaging();
@@ -171,38 +174,45 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
171
 
172
  //load result
173
  $positionCounter = 1;
174
- foreach($xmlResult->results->record AS $currentRecord){
175
  // get current position
176
  $position = $positionOffset + $positionCounter;
177
  $positionCounter++;
178
 
179
- // fetch record values
180
- $fieldValues = array();
181
- foreach($currentRecord->field AS $current_field){
182
- $currentFieldname = (string) $current_field->attributes()->name;
183
- $fieldValues[$currentFieldname] = (string) $current_field;
184
- }
185
-
186
- // get original position
187
- if (isset($fieldValues['__ORIG_POSITION__'])) {
188
- $origPosition = $fieldValues['__ORIG_POSITION__'];
189
- unset($fieldValues['__ORIG_POSITION__']);
190
- } else {
191
- $origPosition = $position;
192
- }
193
-
194
- $result[] = FF::getInstance('record',
195
- $currentRecord->attributes()->id,
196
- floatval($currentRecord->attributes()->relevancy),
197
- $position,
198
- $origPosition,
199
- $encodingHandler->encodeServerContentForPage($fieldValues)
200
- );
201
  }
202
  }
203
  return FF::getInstance('result', $result, $resultCount);
204
  }
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  /**
207
  * @return FACTFinder_Asn
208
  **/
@@ -216,61 +226,81 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
216
  $params = $this->getParamsParser()->getRequestParams();
217
 
218
  foreach ($xmlResult->asn->group AS $xmlGroup) {
219
- $groupName = $encodingHandler->encodeServerContentForPage((string)$xmlGroup->attributes()->name);
220
- $groupUnit = '';
221
- if (isset($xmlGroup->attributes()->unit)) {
222
- $groupUnit = strval($xmlGroup->attributes()->unit);
223
- }
224
-
225
- $group = FF::getInstance('asnGroup',
226
- array(),
227
- $encodingHandler->encodeServerContentForPage((string)$xmlGroup->attributes()->name),
228
- $encodingHandler->encodeServerContentForPage((string)$xmlGroup->attributes()->detailedLinks),
229
- $groupUnit,
230
- strval($xmlGroup->attributes()->style) == 'SLIDER'
231
- );
232
 
233
  //get filters of the current group
234
  foreach ($xmlGroup->element AS $xmlFilter) {
235
- $filterLink = $this->getParamsParser()->createPageLink(
236
- $this->getParamsParser()->parseParamsFromResultString(trim($xmlFilter->searchParams))
237
- );
238
-
239
- if ($group->isSliderStyle()) {
240
- // get last (empty) parameter from the search params property
241
- $params = $this->getParamsParser()->parseParamsFromResultString(trim($xmlFilter->searchParams));
242
- end($params);
243
- $filterLink .= '&'.key($params).'=';
244
-
245
- $filter = FF::getInstance('asnSliderFilter',
246
- $filterLink,
247
- strval($xmlFilter->attributes()->absoluteMin),
248
- strval($xmlFilter->attributes()->absoluteMax),
249
- strval($xmlFilter->attributes()->selectedMin),
250
- strval($xmlFilter->attributes()->selectedMax),
251
- isset($xmlFilter->attributes()->field) ? strval($xmlFilter->attributes()->field) : ''
252
- );
253
- } else {
254
- $filter = FF::getInstance('asnFilterItem',
255
- $encodingHandler->encodeServerContentForPage(trim($xmlFilter->attributes()->name)),
256
- $filterLink,
257
- strval($xmlFilter->attributes()->selected) == 'true',
258
- strval($xmlFilter->attributes()->count),
259
- strval($xmlFilter->attributes()->clusterLevel),
260
- strval($xmlFilter->attributes()->previewImage),
261
- isset($xmlFilter->attributes()->field) ? strval($xmlFilter->attributes()->field) : ''
262
- );
263
- }
264
 
265
  $group->addFilter($filter);
266
  }
267
-
268
  $asn[] = $group;
269
  }
270
  }
271
  return FF::getInstance('asn', $asn);
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /**
275
  * @return array of FACTFinder_SortItem objects
276
  **/
@@ -283,9 +313,7 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
283
  $encodingHandler = $this->getEncodingHandler();
284
 
285
  foreach ($xmlResult->sorting->sort AS $xmlSortItem) {
286
- $sortLink = $this->getParamsParser()->createPageLink(
287
- $this->getParamsParser()->parseParamsFromResultString(trim($xmlSortItem->searchParams))
288
- );
289
  $sortItem = FF::getInstance('item',
290
  $encodingHandler->encodeServerContentForPage(trim($xmlSortItem->attributes()->description)),
291
  $sortLink,
@@ -330,7 +358,7 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
330
  $selectedOption = intval(trim($xmlResult->productsPerPageOptions->attributes()->selected));
331
 
332
  $options = array();
333
- foreach($xmlResult->productsPerPageOptions->option AS $option) {
334
  $value = intval(trim($option->attributes()->value));
335
  $url = $this->getParamsParser()->createPageLink(
336
  $this->getParamsParser()->parseParamsFromResultString(trim($option->searchParams))
@@ -356,9 +384,7 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
356
  $breadCrumbCount = count($xmlResult->breadCrumbTrail->item);
357
  $i = 1;
358
  foreach ($xmlResult->breadCrumbTrail->item AS $item) {
359
- $link = $this->getParamsParser()->createPageLink(
360
- $this->getParamsParser()->parseParamsFromResultString(trim($item->searchParams))
361
- );
362
 
363
  $fieldName = '';
364
  $fieldUnit = '';
@@ -384,6 +410,7 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
384
  return $breadCrumbTrail;
385
  }
386
 
 
387
  /**
388
  * @return array of FACTFinder_Campaign objects
389
  */
@@ -426,9 +453,9 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
426
 
427
  // fetch product values
428
  $fieldValues = array();
429
- foreach($xmlProduct->field AS $current_field){
430
- $currentFieldname = (string) $current_field->attributes()->name;
431
- $fieldValues[$currentFieldname] = (string) $current_field;
432
  }
433
  $product->setValues($encodingHandler->encodeServerContentForPage($fieldValues));
434
  $pushedProducts[] = $product;
@@ -446,7 +473,8 @@ class FACTFinder_Xml65_SearchAdapter extends FACTFinder_Default_SearchAdapter
446
  /**
447
  * @return array of FACTFinder_SuggestQuery objects
448
  */
449
- protected function createSingleWordSearch() {
 
450
  $xmlResult = $this->getData();
451
  $singleWordSearch = array();
452
  if (isset($xmlResult->singleWordSearch)) {
25
  */
26
  protected function init()
27
  {
28
+ $this->log->info("Initializing new search adapter.");
29
  $this->getDataProvider()->setParam('format', 'xml');
30
  $this->getDataProvider()->setType('Search.ff');
31
  }
51
  *
52
  * @return string status
53
  **/
54
+ public function getArticleNumberSearchStatus()
55
+ {
56
  if ($this->articleNumberSearchStatus == null) {
57
 
58
  $this->isArticleNumberSearch = false;
70
  *
71
  * @return boolean isArticleNumberSearch
72
  **/
73
+ public function isArticleNumberSearch()
74
+ {
75
  if ($this->isArticleNumberSearch === null) {
76
 
77
  $this->isArticleNumberSearch = false;
88
  *
89
  * @return void
90
  */
91
+ private function loadArticleNumberSearchInformations()
92
+ {
93
  $xmlResult = $this->getData();
94
+ switch ($xmlResult->articleNumberSearchStatus) {
95
  case 'nothingFound':
96
  $this->isArticleNumberSearch = true;
97
  $this->articleNumberSearchStatus = self::NOTHING_FOUND;
115
  public function isSearchTimedOut()
116
  {
117
  $xmlResult = $this->getData();
118
+ if ($xmlResult->searchTimedOut == 'true') {
119
  return true;
120
  } else {
121
  return false;
131
  {
132
  if ($this->status == null) {
133
  $xmlResult = $this->getData();
134
+ switch ($xmlResult->searchStatus) {
135
  case 'nothingFound':
136
  $this->status = self::NOTHING_FOUND;
137
  break;
149
  {
150
  $breadCrumbTrail = $this->getBreadCrumbTrail();
151
  if (sizeof($breadCrumbTrail) > 0) {
152
+ $paramString = $breadCrumbTrail[sizeof($breadCrumbTrail) - 1]->getUrl();
153
  $searchParams = $this->getParamsParser()->getFactfinderParamsFromString($paramString);
154
  } else {
155
  $searchParams = $this->getParamsParser()->getFactfinderParams();
160
  protected function createResult()
161
  {
162
  //init default values
163
+ $result = array();
164
  $resultCount = 0;
165
  $xmlResult = $this->getData();
166
 
167
  //load result values from the xml element
168
  if (!empty($xmlResult->results)) {
169
+ $resultCount = (int)$xmlResult->results->attributes()->count;
170
  $encodingHandler = $this->getEncodingHandler();
171
 
172
  $paging = $this->getPaging();
174
 
175
  //load result
176
  $positionCounter = 1;
177
+ foreach ($xmlResult->results->record AS $currentRecord) {
178
  // get current position
179
  $position = $positionOffset + $positionCounter;
180
  $positionCounter++;
181
 
182
+ $result[] = $this->createRecord($currentRecord, $position);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
184
  }
185
  return FF::getInstance('result', $result, $resultCount);
186
  }
187
 
188
+ protected function createRecord(SimpleXmlElement $rawRecord, $position)
189
+ {
190
+ // fetch record values
191
+ $fieldValues = array();
192
+ foreach ($rawRecord->field AS $current_field) {
193
+ $currentFieldname = (string)$current_field->attributes()->name;
194
+ $fieldValues[$currentFieldname] = (string)$current_field;
195
+ }
196
+
197
+ // get original position
198
+ if (isset($fieldValues['__ORIG_POSITION__'])) {
199
+ $origPosition = $fieldValues['__ORIG_POSITION__'];
200
+ unset($fieldValues['__ORIG_POSITION__']);
201
+ } else {
202
+ $origPosition = $position;
203
+ }
204
+
205
+ $record = FF::getInstance('record',
206
+ $rawRecord->attributes()->id,
207
+ floatval($rawRecord->attributes()->relevancy),
208
+ $position,
209
+ $origPosition,
210
+ $this->getEncodingHandler()->encodeServerContentForPage($fieldValues)
211
+ );
212
+
213
+ return $record;
214
+ }
215
+
216
  /**
217
  * @return FACTFinder_Asn
218
  **/
226
  $params = $this->getParamsParser()->getRequestParams();
227
 
228
  foreach ($xmlResult->asn->group AS $xmlGroup) {
229
+ $group = $this->createGroupInstance($xmlGroup, $encodingHandler);
 
 
 
 
 
 
 
 
 
 
 
 
230
 
231
  //get filters of the current group
232
  foreach ($xmlGroup->element AS $xmlFilter) {
233
+ $filter = $this->createFilter($xmlFilter, $group, $encodingHandler, $params);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
  $group->addFilter($filter);
236
  }
 
237
  $asn[] = $group;
238
  }
239
  }
240
  return FF::getInstance('asn', $asn);
241
  }
242
 
243
+ protected function createGroupInstance($xmlGroup, $encodingHandler)
244
+ {
245
+ $groupUnit = '';
246
+ if (isset($xmlGroup->attributes()->unit)) {
247
+ $groupUnit = strval($xmlGroup->attributes()->unit);
248
+ }
249
+
250
+ return FF::getInstance('asnGroup',
251
+ array(),
252
+ $encodingHandler->encodeServerContentForPage((string)$xmlGroup->attributes()->name),
253
+ $encodingHandler->encodeServerContentForPage((string)$xmlGroup->attributes()->detailedLinks),
254
+ $encodingHandler->encodeServerContentForPage($groupUnit),
255
+ $this->getGroupStyle($xmlGroup)
256
+ );
257
+ }
258
+
259
+ protected function getGroupStyle($xmlGroup)
260
+ {
261
+ $style = strval($xmlGroup->attributes()->style);
262
+ return $style == 'SLIDER' ? $style : 'DEFAULT';
263
+ }
264
+
265
+ protected function createFilter($xmlFilter, $group, $encodingHandler, $params)
266
+ {
267
+ $filterLink = $this->createLink($xmlFilter);
268
+
269
+ if ($group->isSliderStyle()) {
270
+ // get last (empty) parameter from the search params property
271
+ $params = $this->getParamsParser()->parseParamsFromResultString(trim($xmlFilter->searchParams));
272
+ end($params);
273
+ $filterLink .= '&' . key($params) . '=';
274
+
275
+ $filter = FF::getInstance('asnSliderFilter',
276
+ $filterLink,
277
+ strval($xmlFilter->attributes()->absoluteMin),
278
+ strval($xmlFilter->attributes()->absoluteMax),
279
+ strval($xmlFilter->attributes()->selectedMin),
280
+ strval($xmlFilter->attributes()->selectedMax),
281
+ isset($xmlFilter->attributes()->field) ? strval($xmlFilter->attributes()->field) : ''
282
+ );
283
+ } else {
284
+ $filter = FF::getInstance('asnFilterItem',
285
+ $encodingHandler->encodeServerContentForPage(trim($xmlFilter->attributes()->name)),
286
+ $filterLink,
287
+ strval($xmlFilter->attributes()->selected) == 'true',
288
+ strval($xmlFilter->attributes()->count),
289
+ strval($xmlFilter->attributes()->clusterLevel),
290
+ strval($xmlFilter->attributes()->previewImage),
291
+ isset($xmlFilter->attributes()->field) ? strval($xmlFilter->attributes()->field) : ''
292
+ );
293
+ }
294
+
295
+ return $filter;
296
+ }
297
+
298
+ protected function createLink($item) {
299
+ return $this->getParamsParser()->createPageLink(
300
+ $this->getParamsParser()->parseParamsFromResultString(trim($item->searchParams))
301
+ );
302
+ }
303
+
304
  /**
305
  * @return array of FACTFinder_SortItem objects
306
  **/
313
  $encodingHandler = $this->getEncodingHandler();
314
 
315
  foreach ($xmlResult->sorting->sort AS $xmlSortItem) {
316
+ $sortLink = $this->createLink($xmlSortItem);
 
 
317
  $sortItem = FF::getInstance('item',
318
  $encodingHandler->encodeServerContentForPage(trim($xmlSortItem->attributes()->description)),
319
  $sortLink,
358
  $selectedOption = intval(trim($xmlResult->productsPerPageOptions->attributes()->selected));
359
 
360
  $options = array();
361
+ foreach ($xmlResult->productsPerPageOptions->option AS $option) {
362
  $value = intval(trim($option->attributes()->value));
363
  $url = $this->getParamsParser()->createPageLink(
364
  $this->getParamsParser()->parseParamsFromResultString(trim($option->searchParams))
384
  $breadCrumbCount = count($xmlResult->breadCrumbTrail->item);
385
  $i = 1;
386
  foreach ($xmlResult->breadCrumbTrail->item AS $item) {
387
+ $link = $this->createLink($item);
 
 
388
 
389
  $fieldName = '';
390
  $fieldUnit = '';
410
  return $breadCrumbTrail;
411
  }
412
 
413
+
414
  /**
415
  * @return array of FACTFinder_Campaign objects
416
  */
453
 
454
  // fetch product values
455
  $fieldValues = array();
456
+ foreach ($xmlProduct->field AS $current_field) {
457
+ $currentFieldname = (string)$current_field->attributes()->name;
458
+ $fieldValues[$currentFieldname] = (string)$current_field;
459
  }
460
  $product->setValues($encodingHandler->encodeServerContentForPage($fieldValues));
461
  $pushedProducts[] = $product;
473
  /**
474
  * @return array of FACTFinder_SuggestQuery objects
475
  */
476
+ protected function createSingleWordSearch()
477
+ {
478
  $xmlResult = $this->getData();
479
  $singleWordSearch = array();
480
  if (isset($xmlResult->singleWordSearch)) {
lib/FACTFinder/Xml66/SearchAdapter.php CHANGED
@@ -21,10 +21,15 @@ class FACTFinder_Xml66_SearchAdapter extends FACTFinder_Xml65_SearchAdapter
21
  **/
22
  protected function createResult()
23
  {
 
 
 
 
 
 
24
  //init default values
25
  $result = array();
26
  $resultCount = 0;
27
- $xmlResult = $this->getData();
28
 
29
  //load result values from the xml element
30
  if (!empty($xmlResult->results)) {
@@ -82,28 +87,7 @@ class FACTFinder_Xml66_SearchAdapter extends FACTFinder_Xml65_SearchAdapter
82
 
83
  protected function getRecordFromRawRecord(SimpleXmlElement $rawRecord, $position)
84
  {
85
- // fetch record values
86
- $fieldValues = array();
87
- foreach($rawRecord->field AS $current_field){
88
- $currentFieldname = (string) $current_field->attributes()->name;
89
- $fieldValues[$currentFieldname] = (string) $current_field;
90
- }
91
-
92
- // get original position
93
- if (isset($fieldValues['__ORIG_POSITION__'])) {
94
- $origPosition = $fieldValues['__ORIG_POSITION__'];
95
- unset($fieldValues['__ORIG_POSITION__']);
96
- } else {
97
- $origPosition = $position;
98
- }
99
-
100
- $record = FF::getInstance('record',
101
- $rawRecord->attributes()->id,
102
- floatval($rawRecord->attributes()->relevancy),
103
- $position,
104
- $origPosition,
105
- $this->getEncodingHandler()->encodeServerContentForPage($fieldValues)
106
- );
107
 
108
  if (isset($rawRecord->seoPath)) {
109
  $record->setSeoPath(strval($rawRecord->seoPath));
21
  **/
22
  protected function createResult()
23
  {
24
+ $xmlResult = $this->getData();
25
+
26
+ return $this->getResultFromRawResult($xmlResult);
27
+ }
28
+
29
+ protected function getResultFromRawResult($xmlResult) {
30
  //init default values
31
  $result = array();
32
  $resultCount = 0;
 
33
 
34
  //load result values from the xml element
35
  if (!empty($xmlResult->results)) {
87
 
88
  protected function getRecordFromRawRecord(SimpleXmlElement $rawRecord, $position)
89
  {
90
+ $record = $this->createRecord($rawRecord, $position);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  if (isset($rawRecord->seoPath)) {
93
  $record->setSeoPath(strval($rawRecord->seoPath));
lib/FACTFinder/Xml68/SearchAdapter.php CHANGED
@@ -16,71 +16,7 @@
16
  */
17
  class FACTFinder_Xml68_SearchAdapter extends FACTFinder_Xml67_SearchAdapter
18
  {
19
- /**
20
- * @return FACTFinder_Asn
21
- **/
22
- protected function createAsn()
23
- {
24
- $xmlResult = $this->getData();
25
- $asn = array();
26
-
27
- if (!empty($xmlResult->asn)) {
28
- $encodingHandler = $this->getEncodingHandler();
29
- $params = $this->getParamsParser()->getRequestParams();
30
-
31
- foreach ($xmlResult->asn->group AS $xmlGroup) {
32
- $groupName = $encodingHandler->encodeServerContentForPage((string)$xmlGroup->attributes()->name);
33
- $groupUnit = '';
34
- if (isset($xmlGroup->attributes()->unit)) {
35
- $groupUnit = strval($xmlGroup->attributes()->unit);
36
- }
37
-
38
- $group = FF::getInstance('asnGroup',
39
- array(),
40
- $encodingHandler->encodeServerContentForPage((string)$xmlGroup->attributes()->name),
41
- $encodingHandler->encodeServerContentForPage((string)$xmlGroup->attributes()->detailedLinks),
42
- $groupUnit,
43
- strval($xmlGroup->attributes()->style)
44
- );
45
-
46
- //get filters of the current group
47
- foreach ($xmlGroup->element AS $xmlFilter) {
48
- $filterLink = $this->getParamsParser()->createPageLink(
49
- $this->getParamsParser()->parseParamsFromResultString(trim($xmlFilter->searchParams))
50
- );
51
-
52
- if ($group->isSliderStyle()) {
53
- // get last (empty) parameter from the search params property
54
- $params = $this->getParamsParser()->parseParamsFromResultString(trim($xmlFilter->searchParams));
55
- end($params);
56
- $filterLink .= '&'.key($params).'=';
57
-
58
- $filter = FF::getInstance('asnSliderFilter',
59
- $filterLink,
60
- strval($xmlFilter->attributes()->absoluteMin),
61
- strval($xmlFilter->attributes()->absoluteMax),
62
- strval($xmlFilter->attributes()->selectedMin),
63
- strval($xmlFilter->attributes()->selectedMax),
64
- isset($xmlFilter->attributes()->field) ? strval($xmlFilter->attributes()->field) : ''
65
- );
66
- } else {
67
- $filter = FF::getInstance('asnFilterItem',
68
- $encodingHandler->encodeServerContentForPage(trim($xmlFilter->attributes()->name)),
69
- $filterLink,
70
- strval($xmlFilter->attributes()->selected) == 'true',
71
- strval($xmlFilter->attributes()->count),
72
- strval($xmlFilter->attributes()->clusterLevel),
73
- strval($xmlFilter->attributes()->previewImage),
74
- isset($xmlFilter->attributes()->field) ? strval($xmlFilter->attributes()->field) : ''
75
- );
76
- }
77
-
78
- $group->addFilter($filter);
79
- }
80
-
81
- $asn[] = $group;
82
- }
83
- }
84
- return FF::getInstance('asn', $asn);
85
  }
86
  }
16
  */
17
  class FACTFinder_Xml68_SearchAdapter extends FACTFinder_Xml67_SearchAdapter
18
  {
19
+ protected function getGroupStyle($xmlGroup) {
20
+ return strval($xmlGroup->attributes()->style);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
  }
lib/FACTFinder/Xml69/CompareAdapter.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FACT-Finder PHP Framework
4
+ *
5
+ * @category Library
6
+ * @package FACTFinder\Xml69
7
+ * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
+ */
9
+
10
+ /**
11
+ * product comparison adapter using the xml interface
12
+ *
13
+ * @package FACTFinder\Xml69
14
+ */
15
+ class FACTFinder_Xml69_CompareAdapter extends FACTFinder_Xml68_CompareAdapter
16
+ {
17
+ }
lib/FACTFinder/Xml69/ImportAdapter.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FACT-Finder PHP Framework
4
+ *
5
+ * @category Library
6
+ * @package FACTFinder\Xml69
7
+ * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
+ */
9
+
10
+ /**
11
+ * import adapter using the xml interface
12
+ *
13
+ * @package FACTFinder\Xml69
14
+ */
15
+ class FACTFinder_Xml69_ImportAdapter extends FACTFinder_Xml68_ImportAdapter
16
+ {
17
+ }
lib/FACTFinder/Xml69/ProductCampaignAdapter.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FACT-Finder PHP Framework
4
+ *
5
+ * @category Library
6
+ * @package FACTFinder\Xml69
7
+ * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
+ */
9
+
10
+ /**
11
+ * product campaign adapter using the xml interface
12
+ *
13
+ * @package FACTFinder\Xml69
14
+ */
15
+ class FACTFinder_Xml69_ProductCampaignAdapter extends FACTFinder_Xml68_ProductCampaignAdapter
16
+ {
17
+ }
18
+
lib/FACTFinder/Xml69/RecommendationAdapter.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FACT-Finder PHP Framework
4
+ *
5
+ * @category Library
6
+ * @package FACTFinder\Xml69
7
+ * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
+ */
9
+
10
+ /**
11
+ * adapter for the factfinder recommendation engine, working with the XML interface of FF6.9
12
+ *
13
+ * @package FACTFinder\Xml68
14
+ */
15
+ class FACTFinder_Xml69_RecommendationAdapter extends FACTFinder_Xml68_RecommendationAdapter
16
+ {
17
+ }
lib/FACTFinder/Xml69/SearchAdapter.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Search adapter using the xml interface.
4
+ */
5
+ class FACTFinder_Xml69_SearchAdapter extends FACTFinder_Xml68_SearchAdapter
6
+ {
7
+ protected $refKey = null;
8
+
9
+ protected function createLink($item) {
10
+ if ($this->refKey == null)
11
+ $this->refKey = $this->getResultFromRawResult($this->getData())->getRefKey();
12
+
13
+ return $this->getParamsParser()->createPageLink(
14
+ $this->getParamsParser()->parseParamsFromResultString(trim($item->searchParams)),
15
+ array('sourceRefKey' => $this->refKey)
16
+ );
17
+ }
18
+
19
+ protected function getResultFromRawResult($xmlResult) {
20
+ $result = parent::getResultFromRawResult($xmlResult);
21
+
22
+ if (isset($xmlResult->refKey)) {
23
+ $result->setRefKey(strval($xmlResult->refKey));
24
+ }
25
+
26
+ return $result;
27
+ }
28
+
29
+ /**
30
+ * @return array of FACTFinder_Item objects
31
+ **/
32
+ protected function createPaging()
33
+ {
34
+ $paging = parent::createPaging();
35
+
36
+ $xmlResult = $this->getData();
37
+ if (!empty($xmlResult->paging) && isset($xmlResult->refKey))
38
+ $paging->setSourceRefKey((string) $xmlResult->refKey);
39
+
40
+ return $paging;
41
+ }
42
+
43
+ /**
44
+ * @return FACTFinder_ProductsPerPageOptions
45
+ */
46
+ protected function createProductsPerPageOptions()
47
+ {
48
+ $pppOptions = array(); //default
49
+ $xmlResult = $this->getData();
50
+
51
+ if (!empty($xmlResult->productsPerPageOptions)) {
52
+ $defaultOption = intval(trim($xmlResult->productsPerPageOptions->attributes()->default));
53
+ $selectedOption = intval(trim($xmlResult->productsPerPageOptions->attributes()->selected));
54
+
55
+ $options = array();
56
+ foreach ($xmlResult->productsPerPageOptions->option AS $option) {
57
+ $value = intval(trim($option->attributes()->value));
58
+ $searchParams = $this->getParamsParser()->parseParamsFromResultString(trim($option->searchParams));
59
+ $searchParams['sourceRefKey'] = (string) $xmlResult->refKey;
60
+ $url = $this->getParamsParser()->createPageLink($searchParams);
61
+ $options[$value] = $url;
62
+ }
63
+ $pppOptions = FF::getInstance('productsPerPageOptions', $options, $defaultOption, $selectedOption);
64
+ }
65
+ return $pppOptions;
66
+ }
67
+ }
lib/FACTFinder/Xml69/SimilarRecordsAdapter.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FACT-Finder PHP Framework
4
+ *
5
+ * @category Library
6
+ * @package FACTFinder\Xml69
7
+ * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
+ */
9
+
10
+ /**
11
+ * similar records adapter using the xml interface
12
+ *
13
+ * @package FACTFinder\Xml69
14
+ */
15
+ class FACTFinder_Xml69_SimilarRecordsAdapter extends FACTFinder_Xml68_SimilarRecordsAdapter
16
+ {
17
+ }
lib/FACTFinder/Xml69/SuggestAdapter.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FACT-Finder PHP Framework
4
+ *
5
+ * @category Library
6
+ * @package FACTFinder\Xml69
7
+ * @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
8
+ */
9
+
10
+ /**
11
+ * suggest adapter using the xml interface. expects a xml formated string from the dataprovider
12
+ *
13
+ * @package FACTFinder\Xml69
14
+ */
15
+ class FACTFinder_Xml69_SuggestAdapter extends FACTFinder_Xml68_SuggestAdapter
16
+ {
17
+ }
lib/FACTFinder/Xml69/TagCloudAdapter.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * tag cloud adapter using the xml interface
4
+ */
5
+ class FACTFinder_Xml69_TagCloudAdapter extends FACTFinder_Xml68_TagCloudAdapter
6
+ {
7
+ public function init() {
8
+ parent::init();
9
+ $this->getDataProvider()->setType('TagCloud.ff');
10
+ }
11
+ }
lib/FACTFinder/Xml69/TrackingAdapter.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @deprecated
4
+ * Use FACTFinder_Http_TrackingAdapter instead
5
+ **/
6
+ class FACTFinder_Xml69_TrackingAdapter extends FACTFinder_Http_TrackingAdapter
7
+ {}
package.xml CHANGED
@@ -1,27 +1,26 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Flagbit_Factfinder</name>
4
- <version>3.4.8</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrates the FACT-Finder for improved product search functionality.</summary>
10
  <description>Integrates the FACT-Finder for improved product search functionality.</description>
11
- <notes>[+TASK] removed documentation from module
12
- [~TASK] Updated FF PHP framework
13
- [~TASK] Replaced magic __call method with explicit implementations.
14
- [+BUGFIX] avoid strict notice, because of static member access in non static way.
15
- [+BUGFIX] Added default value for ffversion config value.
16
- [+BUGFIX] Fixed segmentation fault - Assoc array was given to DB select. We need only the keys.
17
- [+BUGFIX] Fixed TODO: Used constants insteat of hard coded values for visibility
18
- [+BUGFIX] Removed unused $productIndexes variable
19
- [+BUGFIX] Fix for "undefined" in suggestions
20
- [+BUGFIX] make scic also work with urls that have appended parameters</notes>
21
  <authors><author><name>Flagbit GmbH Co. KG</name><user>auto-converted</user><email>magento@flagbit.de</email></author></authors>
22
- <date>2013-03-23</date>
23
- <time>18:22:59</time>
24
- <contents><target name="mageetc"><dir><dir><file name="factfinder.xml" hash="ca4dac634339217dd2ee6e8dc477d694"/></dir><dir name="modules"><file name="Flagbit_FactFinder.xml" hash="99c6b4e5981ac7592830a9fb3f5e5a0e"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="factfinder.xml" hash="5e5cb94967917aa2784d19434d02b2d4"/></dir><dir name="template"><dir name="factfinder"><file name="cockpit.phtml" hash="db2b5c21f817f1abdab3dabce26c699f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="factfinder.xml" hash="c059bb14f9d4d929db8234bdf139c2cb"/></dir><dir name="template"><dir name="factfinder"><file name="form.advancedsuggest.phtml" hash="d51345fde3b0cbede02f4d2ac7d43af0"/><file name="form.advancedsuggest68.phtml" hash="2910c0f39c52e6e02eead79688f682af"/><file name="form.mini.phtml" hash="eb49c2fb57594e2ebeed1ffb01c2606d"/><file name="logo.phtml" hash="7a40d67bf648e65345f69b2cf9d3c6b6"/><file name="scic.phtml" hash="4d4f8d2318837122973049496feafea5"/><file name="secondaryresult.phtml" hash="a4cdff409ccedb16d4fe9a038a4dd9e8"/><dir name="campaign"><file name="advisory.phtml" hash="d0ef29b97aa4c3bdfa2b94596beb5b21"/><file name="feedback.phtml" hash="a00ad977b82b199630371aef060f25ab"/><dir name="cart"><file name="advisory.phtml" hash="bb994272a6daaaba298a38023f6db212"/><file name="feedback.phtml" hash="01fa6a9cd024a2a8edaea7013b00fc89"/></dir><dir name="product"><file name="advisory.phtml" hash="00c978cf9c129c777fecf4cbbbb9d218"/><file name="feedback.phtml" hash="1bb121e2708490793190ce9f2d6ee666"/></dir></dir><dir name="filter"><file name="scriptaculousSlider.phtml" hash="e3ee4dbb6bc6e0546b4374078a9d88bc"/><file name="slider.phtml" hash="80e4e9e1c81437fe41b6a52d98e73549"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Flagbit_FactFinder.csv" hash="4df4f128de560a402243cd7718f7be2a"/></dir></dir></target><target name="magelib"><dir><dir name="FACTFinder"><file name="AdvisorAnswer.php" hash="b6dfbe2d43660b1624ce7788bef7356a"/><file name="AdvisorQuestion.php" hash="7f3d039dc86c5baebb4702f8a66ca6d4"/><file name="Asn.php" hash="8a3753feea0901c7ace25e011be38e56"/><file name="AsnFilterItem.php" hash="cdd0bb237873b54877b4b52744250018"/><file name="AsnGroup.php" hash="e2aaefed8203667491262c6bf6f41f03"/><file name="AsnSliderFilter.php" hash="da4eb96cdb47553793b278aca2d0ec19"/><file name="BreadCrumbItem.php" hash="115ffb2f30e346b29f93ce2d84be724e"/><file name="Campaign.php" hash="138f990ff2180d369bd0b441998b9cb4"/><file name="CampaignIterator.php" hash="d58f054580f0057e8471dbd8334157f1"/><file name="Configuration.php" hash="972367363e6c84fe80f2c73a1528b8aa"/><file name="Curl.php" hash="967c0b604dfdc045c9de70e9e9a44bea"/><file name="CurlHandle.php" hash="2c9dfeccd8256c16def2685e7498ae1c"/><file name="CurlInterface.php" hash="a57574dcd102ff54575cbc9131687854"/><file name="CurlStub.php" hash="01b5a07b0599ccd4b7e1b102cbdc3993"/><file name="EncodingHandler.php" hash="4f0b616bca9158bfb7eddcfcba192dc6"/><file name="Item.php" hash="431843e9e2847e8a6c966a185c39f5e9"/><file name="Loader.php" hash="c26cc57da777bfe7096fadbfeb6e1645"/><file name="Log4PhpLogger.php" hash="ecfb1f084b8d0bd2d51bf417fa0b0b3c"/><file name="NullLogger.php" hash="be8782000070665f0e9fcc011ae4fe77"/><file name="Paging.php" hash="a07db7cb4b02893792e6e29018a36858"/><file name="Parameters.php" hash="612c4a9b98cb8a17d0f2d30cf2641936"/><file name="ParametersParser.php" hash="187527e3d7f233ca60d89748be8c2896"/><file name="ProductsPerPageOptions.php" hash="1e69121e89109f31b0929706ea3dcabc"/><file name="Record.php" hash="4bc036a2d47cd1b76d09af6290f49044"/><file name="Result.php" hash="6b4e959df31a73b9fe25de7a76551970"/><file name="SingleWordSearchItem.php" hash="8f0feac780e68a8b0eab6d44dd6c6813"/><file name="SuggestQuery.php" hash="cf3cf51839e06475bdcf62bb49ee96c5"/><file name="TagQuery.php" hash="ece1fda66af2c6053507941f35423c5f"/><file name="Util.php" hash="0e6189c658c9b924bd7b92d2f70a0543"/><dir name="Abstract"><file name="Adapter.php" hash="dea9f000509f94599e3b4d38ee14d66f"/><file name="Configuration.php" hash="233565de45f56ba7bdcd604817dd7fc6"/><file name="DataProvider.php" hash="8b1dfc68d335aa006f7af9f2a60e519d"/><file name="Logger.php" hash="c5b1ace6158035e80b3d4a79a942a381"/></dir><dir name="Default"><file name="CompareAdapter.php" hash="3e440e7fc6722a82658fe1d16dc81d98"/><file name="ImportAdapter.php" hash="50c1a885dabcad55d4f7b6de00800701"/><file name="ProductCampaignAdapter.php" hash="049bfd0c3831114a2cd632af96aa0aaf"/><file name="RecommendationAdapter.php" hash="b81387e7174047bf5325df5bcc54012c"/><file name="ScicAdapter.php" hash="8fd1c9e60cdb039ce4369af63d72a459"/><file name="SearchAdapter.php" hash="ea278ff85e02d484039f3ecea58a7d65"/><file name="SimilarRecordsAdapter.php" hash="8b584060b7dfd8caac044d3bc0d7f865"/><file name="SuggestAdapter.php" hash="f74d7d5578131355f8e44e8b6e0734c7"/><file name="TagCloudAdapter.php" hash="9ff6d6b9a11f855942f0947b98b103bd"/></dir><dir name="Http"><file name="DataProvider.php" hash="d994803f248f2a7419531f13ef03fcd2"/><file name="DummyProvider.php" hash="30d61ea2ce373f5b501bb64d8ed19393"/><file name="ParallelDataProvider.php" hash="71f895680f881d06793507f7ac8e7ef3"/><file name="ScicAdapter.php" hash="c283d851d23e531a1c26fee3d8c49ea8"/><file name="StatusHelper.php" hash="e4760fadae33a5574f9445bbc73c1283"/><file name="SuggestAdapter.php" hash="875adeae854b52bb6a20322c2934423c"/><file name="UrlBuilder.php" hash="99efad6cb8243ee93a5d4b61c93d8303"/></dir><dir name="Xml64"><file name="SearchAdapter.php" hash="58a49882c741216cf278c4556ea7d224"/></dir><dir name="Xml65"><file name="ImportAdapter.php" hash="489d0aadda12a41111635a2b738936c1"/><file name="RecommendationAdapter.php" hash="dda97f6db1ae97c5a217632067d7c101"/><file name="SearchAdapter.php" hash="fee8359599acf56bc6fd5d87195d411e"/><file name="SuggestAdapter.php" hash="e5381502b74dd62be1a7aa833cbb03e2"/><file name="TagCloudAdapter.php" hash="3bca14558fbd758207e97566dafb1ca2"/></dir><dir name="Xml66"><file name="CompareAdapter.php" hash="a1e323dec8fbee2930d531765adef0cc"/><file name="ImportAdapter.php" hash="5ea0d06cc2ddc7a1b7c880203c38fe40"/><file name="RecommendationAdapter.php" hash="9490ea2b17fded94d087046065596b1b"/><file name="SearchAdapter.php" hash="82214090045d963b15ccc7073d73d7ea"/><file name="SimilarRecordsAdapter.php" hash="f6c70898407d65c5b315a9ec5ebba166"/><file name="SuggestAdapter.php" hash="813bfb64ac9d2dc45443cc7c33e854a7"/><file name="TagCloudAdapter.php" hash="a44dd623910bbb6766a0b0c25584212c"/></dir><dir name="Xml67"><file name="CompareAdapter.php" hash="37980ec507fd7f13e81ece413915da2d"/><file name="ImportAdapter.php" hash="dc0d334439aa59f3e0a4226bbf1456d2"/><file name="ProductCampaignAdapter.php" hash="794020c94d6d62c3d835f167c484f674"/><file name="RecommendationAdapter.php" hash="b991b5e2570c28530164b3cacfffa6e1"/><file name="SearchAdapter.php" hash="1458660092403f1c1f3c088c40b54550"/><file name="SimilarRecordsAdapter.php" hash="b60a974a22d3e473538524dc57d1e91d"/><file name="SuggestAdapter.php" hash="7290503daae4ae9e595cc5b1480ce8a1"/><file name="TagCloudAdapter.php" hash="d3efa6616331286cb221f8ca79021324"/></dir><dir name="Xml68"><file name="CompareAdapter.php" hash="0a8ebc48d90e7aaf131b66180d10ba11"/><file name="ImportAdapter.php" hash="bf483742e13d647da407f7da85828b98"/><file name="ProductCampaignAdapter.php" hash="db981749b20f69eca65d5ac1e622bafe"/><file name="RecommendationAdapter.php" hash="69e031adc81be7a88a0cffbe1b96c317"/><file name="SearchAdapter.php" hash="982a2bed393e0cbb32d97bb7af89263c"/><file name="SimilarRecordsAdapter.php" hash="b9c70b5c7d6d803bb1c7f1255be55285"/><file name="SuggestAdapter.php" hash="5cf5b95340983823c9e7a3fd0dc20a0b"/><file name="TagCloudAdapter.php" hash="3bfa1e877269be17ee08c403254925bf"/></dir></dir><dir name="FACTFinderCustom"><file name="Configuration.php" hash="c58a6f82de677607f50c98de87b96aa9"/></dir><dir name="SAI"><file name="Curl.php" hash="1fb18096257151b5b47bc2964dd9fe39"/><file name="CurlInterface.php" hash="714fa045dd4546d0c92cd022efb09422"/><file name="CurlStub.php" hash="2521763ee414683aced1afd1ec12511d"/><dir name="Curl"><file name="Handle.php" hash="0fc7132737da7cee7df6b974447864ac"/></dir></dir></dir></target><target name="magecommunity"><dir><dir name="Flagbit"><dir name="FactFinder"><dir name="Block"><file name="Layer.php" hash="8cc0245865ee5760fbfe7442cf859ade"/><file name="Scic.php" hash="9ba6aa43204d0aae206d9f24f09aecfc"/><file name="Secondaryresult.php" hash="cb1ca2347767ebed5671ad6a91dc881e"/><file name="TagCloud.php" hash="6e3769771ef5a1b50fc1d9a963e90aad"/><dir name="Adminhtml"><file name="Cockpit.php" hash="e12c45f55d5fd31d164187bd9d16a0bd"/><file name="Exportlink.php" hash="29044f67c1ebb0e6950da286a24a1db7"/><dir name="Form"><dir name="Field"><file name="Attribute.php" hash="2e60d7473163fa523f10b2d0c441fe24"/><file name="Attributes.php" hash="cbaf317aa5ce4417cfcd02a6c4f36486"/></dir></dir></dir><dir name="Campaign"><file name="Advisory.php" hash="04e35a0e8a75a7ddd4e3af385f933aa5"/><file name="Feedback.php" hash="a1e1f1d393bea196e07f92e171e10513"/><dir name="Cart"><file name="Advisory.php" hash="14791cddb1fd131f7f78928e7877fc48"/><file name="Feedback.php" hash="c5a0f657037274881f7d2846e004f164"/></dir><dir name="Product"><file name="Advisory.php" hash="bd1f468d56b6bc1fa3541406796c133a"/><file name="Feedback.php" hash="576bd4801d14f08bc1c62688ffab2e04"/></dir></dir><dir name="Cart"><file name="Crosssell.php" hash="96c00a397ef7e32cb0babfab8b109494"/></dir><dir name="Filter"><file name="Slider.php" hash="159d3e1b403625dbbb970e5e7ada4ec7"/></dir><dir name="Layer"><file name="Abstract.php" hash="f53a3e2d6ce0da4afee58b4ea806a342"/></dir><dir name="Product"><dir name="List"><file name="Crosssell.php" hash="86590a3e65ffe074950f4c630fc10826"/><file name="Upsell.php" hash="dabfd0b10fd73dcdcf8ddc3fd12c8569"/></dir></dir><dir name="XmlConnect"><dir name="Catalog"><file name="Search.php" hash="662f7b0df8d21626bf6193906aed5162"/><dir name="Product"><file name="List.php" hash="79103c53bbaa03f02ed8a78554dcc791"/></dir><dir name="Search"><file name="Suggest.php" hash="a0fed06b80840e63f9983909847d7e58"/></dir></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="1a0ab571e3cc525b043c39c8d71c0e18"/><file name="ProxyController.php" hash="9cac55f10a4fd33a8396bc460ee3f272"/><dir name="Adminhtml"><dir name="Factfinder"><file name="CockpitController.php" hash="4c8665feaf14c38e6ba2384db496c95a"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="1165a0fecfaa31f2aa4a882d1d8bc033"/><file name="config.xml" hash="679c8bece589f13905dc12abc5003e3c"/><file name="system.xml" hash="d3721503a1b346f60633e2f0a8e361a1"/></dir><dir name="Helper"><file name="Backend.php" hash="87b662c7c7242ef349f4606ad2ab5279"/><file name="Data.php" hash="afede9edaf2bcfbc93a4049eee5be89e"/><file name="Debug.php" hash="24b939b03efb2cd5f7815562f896576f"/><file name="Search.php" hash="667b1a5ba0de1683e5267e6bc72413ac"/></dir><dir name="Model"><file name="Facade.php" hash="98c90408b20ef80f382c38d4b9a00b08"/><file name="Layer.php" hash="9da16c44259b4a31d73f63d87787ff11"/><file name="Observer.php" hash="baa6ecdc02532639f2a295c37952804a"/><file name="Processor.php" hash="5e76103096faccd5b26b2d036bdc7c5e"/><dir name="Export"><file name="Price.php" hash="5561605bf639385c211f339f0c752a0f"/><file name="Product.php" hash="64b43674738d4314a13820edd13656da"/><file name="Stock.php" hash="28e819f8f317957a70a7d4d318e04791"/></dir><dir name="Handler"><file name="Abstract.php" hash="f5724a1c82becbc4d76a6f46dc591977"/><file name="CheckStatus.php" hash="4fc0544564271ec387a907e41fe2c231"/><file name="ProductCampaign.php" hash="831d8d3ff2cd29e090cff10c3a9c8844"/><file name="ProductDetailCampaign.php" hash="c714d9b43772f1665d64daea8d16594d"/><file name="Recommendations.php" hash="47b12e1f2f1e1d83ecaba77fdb20b63b"/><file name="Search.php" hash="165a115c5b92c40b03f7bfef04d13ef5"/><file name="SecondarySearch.php" hash="de4ced818f7865a491438a4d103b431a"/><file name="ShoppingCartCampaign.php" hash="202fc9ab4018247dfb8e8bcefd417465"/><file name="Suggest.php" hash="3b286cbda3cad188b10f7fac06e0ca32"/><file name="TagCloud.php" hash="e60bd2a5d314cfe3bad445ba88740878"/></dir><dir name="Layer"><file name="Abstract.php" hash="0a0505e719ca55320da35c7510b82d3a"/><dir name="Filter"><file name="Item.php" hash="28e42624d764342dae6cb09a1b29b7b8"/><dir name="Attribute"><file name="Abstract.php" hash="2ad710352f1803d15ba056cd93d519f1"/><file name="Catalog.php" hash="f6dce5ea64da9dfb3458ae9ff4b58a7b"/><file name="Catalogsearch.php" hash="75536576aaaa0186f166550ee746ae04"/></dir></dir></dir><dir name="Mysql4"><dir name="Campaign"><dir name="Pushedproducts"><file name="Collection.php" hash="c657b421e0137bf842ec78c26718363f"/></dir></dir><dir name="Product"><dir name="Attribute"><file name="Collection.php" hash="a5b47ca867be314d2d0edf1621608d8b"/></dir><dir name="Recommendation"><file name="Collection.php" hash="fdb6f35fa1cca09aa405bc5cd0c68601"/></dir></dir><dir name="Scic"><file name="Queue.php" hash="a1521000a1a10df8e6b580f33d06cf23"/><dir name="Queue"><file name="Collection.php" hash="5f6b0b6a50838929065ebd941cedce42"/></dir></dir><dir name="Search"><file name="Collection.php" hash="2a0c4ff355e035d11209115f054dc3dd"/><file name="Engine.php" hash="88a56eb3b4587d87bb1152476b64036e"/></dir></dir><dir name="Scic"><file name="Queue.php" hash="828d391339a22c15ad74ae1a2e784b41"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Attributes.php" hash="8259883090dc4bca9b858d047983e736"/><file name="Enabled.php" hash="3b4d1f4b37d7ddba9768a7da6e3fc778"/></dir><dir name="Source"><file name="Authtype.php" hash="5bc0b1c745782cc51d44d56299059bcb"/><file name="Ffversion.php" hash="0270fbefb18c180abc98f2e02e37532c"/><file name="Identifier.php" hash="cec45238f0e28a1bf66d10dee513c2ca"/></dir></dir></dir></dir><dir name="sql"><dir name="factfinder_setup"><file name="mysql4-install-3.2.0.php" hash="1342320595048cd96659c454381cfbb4"/><file name="mysql4-upgrade-3.2.0-3.2.1.php" hash="3d5276dfe971a6bd48aa8e2a085de004"/><file name="mysql4-upgrade-3.2.1-3.3.0.php" hash="71954ea0cf400950d23b020ff095a9ee"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="factfinder.css" hash="16766d07b20544e11184ee21f95b2692"/></dir></dir></dir></dir></dir></target><target name="mage"><dir><dir name="js"><dir name="factfinder"><file name="jXHR.js" hash="0473a3ea88f08797737814c7ffbeba18"/><file name="scic.js" hash="b3d9f34d40486a0d8ba841c9cccb4405"/><file name="suggest.js" hash="b45f28b377c73463527d9aa44e37589b"/></dir></dir></dir></target></contents>
25
  <compatible/>
26
  <dependencies/>
27
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Flagbit_Factfinder</name>
4
+ <version>3.5.1</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrates the FACT-Finder for improved product search functionality.</summary>
10
  <description>Integrates the FACT-Finder for improved product search functionality.</description>
11
+ <notes>[+BUGFIX] set $graceful parameter to true. This avoid exceptions on Mage::register if the key already exists. This happens if the layered navigation will be included more than once. i. e. left and content
12
+ [+BUGFIX] issue #34 selected filters are displayed twice
13
+ [+BUGFIX] trim category values before encoding them
14
+ [+BUGFIX] don't send clicktracking if disabled
15
+ [~BUGFIX] don't allow default attributes inside the attribute-setup
16
+ [+TASK] updated FF PHP framework
17
+ [~TASK] improved export memory usage, by unsetting some bigger variables
18
+ [~TASK] remove typical magento parameters from the request to ff
19
+ [~TASK] extracted method sendClickTrackingForSingleProduct</notes>
 
20
  <authors><author><name>Flagbit GmbH Co. KG</name><user>auto-converted</user><email>magento@flagbit.de</email></author></authors>
21
+ <date>2013-08-27</date>
22
+ <time>07:02:29</time>
23
+ <contents><target name="mageetc"><dir><dir><file name="factfinder.xml" hash="ca4dac634339217dd2ee6e8dc477d694"/></dir><dir name="modules"><file name="Flagbit_FactFinder.xml" hash="99c6b4e5981ac7592830a9fb3f5e5a0e"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="factfinder.xml" hash="5e5cb94967917aa2784d19434d02b2d4"/></dir><dir name="template"><dir name="factfinder"><file name="cockpit.phtml" hash="db2b5c21f817f1abdab3dabce26c699f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="factfinder.xml" hash="0ef84cf79848e6e3a8d254a3a33f440d"/></dir><dir name="template"><dir name="factfinder"><file name="form.advancedsuggest.phtml" hash="d51345fde3b0cbede02f4d2ac7d43af0"/><file name="form.advancedsuggest68.phtml" hash="f1442920be226f640949bfb12ca5fd9e"/><file name="form.mini.phtml" hash="eb49c2fb57594e2ebeed1ffb01c2606d"/><file name="logo.phtml" hash="7a40d67bf648e65345f69b2cf9d3c6b6"/><file name="secondaryresult.phtml" hash="a4cdff409ccedb16d4fe9a038a4dd9e8"/><file name="tracking.phtml" hash="e42ced8505b97260b83b4b55b6139b1d"/><dir name="campaign"><file name="advisory.phtml" hash="d0ef29b97aa4c3bdfa2b94596beb5b21"/><file name="feedback.phtml" hash="a00ad977b82b199630371aef060f25ab"/><dir name="cart"><file name="advisory.phtml" hash="bb994272a6daaaba298a38023f6db212"/><file name="feedback.phtml" hash="01fa6a9cd024a2a8edaea7013b00fc89"/></dir><dir name="product"><file name="advisory.phtml" hash="00c978cf9c129c777fecf4cbbbb9d218"/><file name="feedback.phtml" hash="1bb121e2708490793190ce9f2d6ee666"/></dir></dir><dir name="filter"><file name="scriptaculousSlider.phtml" hash="e3ee4dbb6bc6e0546b4374078a9d88bc"/><file name="slider.phtml" hash="80e4e9e1c81437fe41b6a52d98e73549"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Flagbit_FactFinder.csv" hash="1d511ccdd2ba03cb2291d9870c647594"/></dir></dir></target><target name="magelib"><dir><dir name="FACTFinder"><file name="AdvisorAnswer.php" hash="b6dfbe2d43660b1624ce7788bef7356a"/><file name="AdvisorQuestion.php" hash="7f3d039dc86c5baebb4702f8a66ca6d4"/><file name="Asn.php" hash="8a3753feea0901c7ace25e011be38e56"/><file name="AsnFilterItem.php" hash="cdd0bb237873b54877b4b52744250018"/><file name="AsnGroup.php" hash="e2aaefed8203667491262c6bf6f41f03"/><file name="AsnSliderFilter.php" hash="14fcd343b14d85b53d2908e04132bca4"/><file name="BreadCrumbItem.php" hash="115ffb2f30e346b29f93ce2d84be724e"/><file name="Campaign.php" hash="138f990ff2180d369bd0b441998b9cb4"/><file name="CampaignIterator.php" hash="d58f054580f0057e8471dbd8334157f1"/><file name="Configuration.php" hash="972367363e6c84fe80f2c73a1528b8aa"/><file name="Curl.php" hash="967c0b604dfdc045c9de70e9e9a44bea"/><file name="CurlHandle.php" hash="2c9dfeccd8256c16def2685e7498ae1c"/><file name="CurlInterface.php" hash="a57574dcd102ff54575cbc9131687854"/><file name="CurlStub.php" hash="01b5a07b0599ccd4b7e1b102cbdc3993"/><file name="EncodingHandler.php" hash="4f0b616bca9158bfb7eddcfcba192dc6"/><file name="Item.php" hash="b8bae7f7d296a5acca29dc3ce0c46642"/><file name="Loader.php" hash="c26cc57da777bfe7096fadbfeb6e1645"/><file name="Log4PhpLogger.php" hash="ecfb1f084b8d0bd2d51bf417fa0b0b3c"/><file name="NullLogger.php" hash="be8782000070665f0e9fcc011ae4fe77"/><file name="Paging.php" hash="4ca274beffac0c0a8cb5136b08fa8b24"/><file name="Parameters.php" hash="612c4a9b98cb8a17d0f2d30cf2641936"/><file name="ParametersParser.php" hash="9b55a42ea9195c2b40f9640ac3ba3b1a"/><file name="ProductsPerPageOptions.php" hash="1e69121e89109f31b0929706ea3dcabc"/><file name="Record.php" hash="46319caed19fbdeb5fc065ddd395b18f"/><file name="Result.php" hash="8f97f1509ee78d773aa2c5ace2830225"/><file name="SingleWordSearchItem.php" hash="8f0feac780e68a8b0eab6d44dd6c6813"/><file name="SuggestQuery.php" hash="847d637921e9bc46b9c1d3d8b03737af"/><file name="TagQuery.php" hash="ece1fda66af2c6053507941f35423c5f"/><file name="Util.php" hash="0a26a0d655c3f257b74302683a4859ba"/><dir name="Abstract"><file name="Adapter.php" hash="1c3acf21c0e5bb954973e22e52910906"/><file name="Configuration.php" hash="233565de45f56ba7bdcd604817dd7fc6"/><file name="DataProvider.php" hash="8b1dfc68d335aa006f7af9f2a60e519d"/><file name="Logger.php" hash="c5b1ace6158035e80b3d4a79a942a381"/></dir><dir name="Default"><file name="CompareAdapter.php" hash="8a8b027675e195b7be2bf5bf64666926"/><file name="ImportAdapter.php" hash="50c1a885dabcad55d4f7b6de00800701"/><file name="ProductCampaignAdapter.php" hash="049bfd0c3831114a2cd632af96aa0aaf"/><file name="RecommendationAdapter.php" hash="1858f0553c6deb21fb561cb454974a4e"/><file name="ScicAdapter.php" hash="8fd1c9e60cdb039ce4369af63d72a459"/><file name="SearchAdapter.php" hash="ea278ff85e02d484039f3ecea58a7d65"/><file name="SimilarRecordsAdapter.php" hash="b498d3df0fc663c40fc362fd20134b43"/><file name="SuggestAdapter.php" hash="f74d7d5578131355f8e44e8b6e0734c7"/><file name="TagCloudAdapter.php" hash="c2ecc0d869d232ce4b8f09eb497e2b64"/><file name="TrackingAdapter.php" hash="7816352fa227529a00e223ade35be597"/></dir><dir name="Http"><file name="DataProvider.php" hash="d994803f248f2a7419531f13ef03fcd2"/><file name="DummyProvider.php" hash="fcf82a2349f5b403912b1cb62907439c"/><file name="ParallelDataProvider.php" hash="71f895680f881d06793507f7ac8e7ef3"/><file name="ScicAdapter.php" hash="c283d851d23e531a1c26fee3d8c49ea8"/><file name="StatusHelper.php" hash="e4760fadae33a5574f9445bbc73c1283"/><file name="SuggestAdapter.php" hash="875adeae854b52bb6a20322c2934423c"/><file name="TrackingAdapter.php" hash="9ce06d21ea64a7dd329ce12e28576488"/><file name="UrlBuilder.php" hash="99efad6cb8243ee93a5d4b61c93d8303"/></dir><dir name="Json66"><file name="CompareAdapter.php" hash="3034c100a97d222704b1462db0b97811"/><file name="ImportAdapter.php" hash="63b19c72cfcf52d9832a81080678232c"/><file name="RecommendationAdapter.php" hash="9f4fed83d6d6c10b471ef8f4810eefa5"/><file name="SearchAdapter.php" hash="28111822684b93e72d40436acd3f21e0"/><file name="SimilarRecordsAdapter.php" hash="6f3565723be247381f561b60ed49d8da"/><file name="SuggestAdapter.php" hash="e06a19df2260abcd6ce46a8744ca58b0"/><file name="TagCloudAdapter.php" hash="0ef622889613de3660591ef41c08c65d"/></dir><dir name="Json67"><file name="CompareAdapter.php" hash="2324e34be1d48e42a1dafff4a6368863"/><file name="ImportAdapter.php" hash="295fa619d1a020f87e3d6772e428f4b3"/><file name="ProductCampaignAdapter.php" hash="c43222b1d277e2965e1209ff6375500c"/><file name="RecommendationAdapter.php" hash="db72e4179a831b331f53505a2ba9d01f"/><file name="SearchAdapter.php" hash="c69ac5f6fcfe47351ed3b601d03e18ad"/><file name="SimilarRecordsAdapter.php" hash="55f5553511f5fb965fa9b6abf5e9ba01"/><file name="SuggestAdapter.php" hash="ae47090fab5d202a22c8dbf9e604e2d1"/><file name="TagCloudAdapter.php" hash="1d7fdbd4ea8488d1bdfd0a4143a1a130"/></dir><dir name="Json68"><file name="CompareAdapter.php" hash="f3c610d6347a6671f5ee1bf716801ae2"/><file name="ImportAdapter.php" hash="c7ec5f12e1f7f17084de9d71c4d4051d"/><file name="ProductCampaignAdapter.php" hash="1ffc9f568d7ee73722765f16fdf45b07"/><file name="RecommendationAdapter.php" hash="b5082f0db80730bb866ac332d143f4a8"/><file name="SearchAdapter.php" hash="5814eb254324b96b10a35411bea6bc6c"/><file name="SimilarRecordsAdapter.php" hash="51412237e3233ccc3bfc124e3e9abee6"/><file name="SuggestAdapter.php" hash="9bfbd6a282aba70e3b1f2e1f632c113f"/><file name="TagCloudAdapter.php" hash="b632b03f8e044ebdd3a4f318c8e50c3a"/></dir><dir name="Json69"><file name="CompareAdapter.php" hash="e0ab8d442b26ca492d3986a32ea7a7a4"/><file name="ImportAdapter.php" hash="e969905c5ef9a2577eb80df12f5350c5"/><file name="ProductCampaignAdapter.php" hash="1ab5cb62aafe5f67c1f77461b89fe24d"/><file name="RecommendationAdapter.php" hash="0036cea44c296a3f9c8ac5c7458afb83"/><file name="SearchAdapter.php" hash="bc5b9f9404017d003fb27d21b2837609"/><file name="SimilarRecordsAdapter.php" hash="aee8d4212c9e3f1b62035be5307c73f1"/><file name="SuggestAdapter.php" hash="fce98d2451db47e4608e6f252f3759ff"/><file name="TagCloudAdapter.php" hash="e1b77df045382804e6ddfe2a05180469"/></dir><dir name="Xml64"><file name="SearchAdapter.php" hash="58a49882c741216cf278c4556ea7d224"/></dir><dir name="Xml65"><file name="ImportAdapter.php" hash="489d0aadda12a41111635a2b738936c1"/><file name="RecommendationAdapter.php" hash="dda97f6db1ae97c5a217632067d7c101"/><file name="SearchAdapter.php" hash="240370edf600728b472ae96078f3ed35"/><file name="SuggestAdapter.php" hash="e5381502b74dd62be1a7aa833cbb03e2"/><file name="TagCloudAdapter.php" hash="3bca14558fbd758207e97566dafb1ca2"/></dir><dir name="Xml66"><file name="CompareAdapter.php" hash="a1e323dec8fbee2930d531765adef0cc"/><file name="ImportAdapter.php" hash="5ea0d06cc2ddc7a1b7c880203c38fe40"/><file name="RecommendationAdapter.php" hash="9490ea2b17fded94d087046065596b1b"/><file name="SearchAdapter.php" hash="aba7b0e052a28c93bad70786706e2475"/><file name="SimilarRecordsAdapter.php" hash="f6c70898407d65c5b315a9ec5ebba166"/><file name="SuggestAdapter.php" hash="813bfb64ac9d2dc45443cc7c33e854a7"/><file name="TagCloudAdapter.php" hash="a44dd623910bbb6766a0b0c25584212c"/></dir><dir name="Xml67"><file name="CompareAdapter.php" hash="37980ec507fd7f13e81ece413915da2d"/><file name="ImportAdapter.php" hash="dc0d334439aa59f3e0a4226bbf1456d2"/><file name="ProductCampaignAdapter.php" hash="794020c94d6d62c3d835f167c484f674"/><file name="RecommendationAdapter.php" hash="b991b5e2570c28530164b3cacfffa6e1"/><file name="SearchAdapter.php" hash="1458660092403f1c1f3c088c40b54550"/><file name="SimilarRecordsAdapter.php" hash="b60a974a22d3e473538524dc57d1e91d"/><file name="SuggestAdapter.php" hash="7290503daae4ae9e595cc5b1480ce8a1"/><file name="TagCloudAdapter.php" hash="d3efa6616331286cb221f8ca79021324"/></dir><dir name="Xml68"><file name="CompareAdapter.php" hash="0a8ebc48d90e7aaf131b66180d10ba11"/><file name="ImportAdapter.php" hash="bf483742e13d647da407f7da85828b98"/><file name="ProductCampaignAdapter.php" hash="db981749b20f69eca65d5ac1e622bafe"/><file name="RecommendationAdapter.php" hash="69e031adc81be7a88a0cffbe1b96c317"/><file name="SearchAdapter.php" hash="5f33b2af574a27ce54da2fd200e54bf8"/><file name="SimilarRecordsAdapter.php" hash="b9c70b5c7d6d803bb1c7f1255be55285"/><file name="SuggestAdapter.php" hash="5cf5b95340983823c9e7a3fd0dc20a0b"/><file name="TagCloudAdapter.php" hash="3bfa1e877269be17ee08c403254925bf"/></dir><dir name="Xml69"><file name="CompareAdapter.php" hash="7fb11570f8ff0d4375808e2848b9a4e5"/><file name="ImportAdapter.php" hash="38ca51ae3571aa19df0552592c3ca7a1"/><file name="ProductCampaignAdapter.php" hash="b8387c660a11be69d4a549226fe398a9"/><file name="RecommendationAdapter.php" hash="2dcb3dd6cf309a5f0c2ae43fb203b26b"/><file name="SearchAdapter.php" hash="d40a1e847d228fa5018c47b43eb26d57"/><file name="SimilarRecordsAdapter.php" hash="ba87aaa6a786094720941117c976899d"/><file name="SuggestAdapter.php" hash="b0c54b42c01101adda15e3634b896e56"/><file name="TagCloudAdapter.php" hash="9529b709e9f1d897776d33fea96bb4df"/><file name="TrackingAdapter.php" hash="5fab2bf699274380c07988cdad48913a"/></dir></dir><dir name="FACTFinderCustom"><file name="Configuration.php" hash="c58a6f82de677607f50c98de87b96aa9"/></dir><dir name="SAI"><file name="Curl.php" hash="1fb18096257151b5b47bc2964dd9fe39"/><file name="CurlInterface.php" hash="714fa045dd4546d0c92cd022efb09422"/><file name="CurlStub.php" hash="2521763ee414683aced1afd1ec12511d"/><dir name="Curl"><file name="Handle.php" hash="0fc7132737da7cee7df6b974447864ac"/></dir></dir></dir></target><target name="magecommunity"><dir><dir name="Flagbit"><dir name="FactFinder"><dir name="Block"><file name="Layer.php" hash="8cc0245865ee5760fbfe7442cf859ade"/><file name="Secondaryresult.php" hash="cb1ca2347767ebed5671ad6a91dc881e"/><file name="TagCloud.php" hash="6e3769771ef5a1b50fc1d9a963e90aad"/><file name="Tracking.php" hash="7ce879afb562e5a0e96132fa31ebe98d"/><dir name="Adminhtml"><file name="Cockpit.php" hash="e12c45f55d5fd31d164187bd9d16a0bd"/><file name="Exportlink.php" hash="6aa91d07c5e0094c89b2494bac9d1ed3"/><dir name="Form"><dir name="Field"><file name="Attribute.php" hash="2e60d7473163fa523f10b2d0c441fe24"/><file name="Attributes.php" hash="cbaf317aa5ce4417cfcd02a6c4f36486"/></dir></dir></dir><dir name="Campaign"><file name="Advisory.php" hash="04e35a0e8a75a7ddd4e3af385f933aa5"/><file name="Feedback.php" hash="a1e1f1d393bea196e07f92e171e10513"/><dir name="Cart"><file name="Advisory.php" hash="14791cddb1fd131f7f78928e7877fc48"/><file name="Feedback.php" hash="c5a0f657037274881f7d2846e004f164"/></dir><dir name="Product"><file name="Advisory.php" hash="bd1f468d56b6bc1fa3541406796c133a"/><file name="Feedback.php" hash="576bd4801d14f08bc1c62688ffab2e04"/></dir></dir><dir name="Cart"><file name="Crosssell.php" hash="96c00a397ef7e32cb0babfab8b109494"/></dir><dir name="Filter"><file name="Slider.php" hash="159d3e1b403625dbbb970e5e7ada4ec7"/></dir><dir name="Layer"><file name="Abstract.php" hash="f53a3e2d6ce0da4afee58b4ea806a342"/></dir><dir name="Product"><dir name="List"><file name="Crosssell.php" hash="86590a3e65ffe074950f4c630fc10826"/><file name="Upsell.php" hash="2651771f335616765f26a611486b9e25"/></dir></dir><dir name="XmlConnect"><dir name="Catalog"><file name="Search.php" hash="a5719137254795a4e9053bd801bc1f39"/><dir name="Product"><file name="List.php" hash="5c6ddfd680c0bcf597d07f02de69c4a7"/></dir><dir name="Search"><file name="Suggest.php" hash="a0fed06b80840e63f9983909847d7e58"/></dir></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="1a0ab571e3cc525b043c39c8d71c0e18"/><file name="ProxyController.php" hash="1fc770e60199e28aedabba1578f569cd"/><dir name="Adminhtml"><dir name="Factfinder"><file name="CockpitController.php" hash="4c8665feaf14c38e6ba2384db496c95a"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="1165a0fecfaa31f2aa4a882d1d8bc033"/><file name="config.xml" hash="4189ec02d616430bfca0a8ebaad65261"/><file name="system.xml" hash="d3721503a1b346f60633e2f0a8e361a1"/></dir><dir name="Helper"><file name="Backend.php" hash="87b662c7c7242ef349f4606ad2ab5279"/><file name="Data.php" hash="91d08be56cfa17025d0dbfcda3691bb1"/><file name="Debug.php" hash="24b939b03efb2cd5f7815562f896576f"/><file name="Search.php" hash="f51d082432b54ae877bc92136a977e81"/></dir><dir name="Model"><file name="Facade.php" hash="943ad785ea4639d9e9a99f71253ed88b"/><file name="Layer.php" hash="9da16c44259b4a31d73f63d87787ff11"/><file name="Observer.php" hash="99b06cdb299cd09e4dfafc0f9ab2d541"/><file name="Processor.php" hash="dd87fcca325fc9bfb30e52f5a0c484fb"/><dir name="Export"><file name="Price.php" hash="5561605bf639385c211f339f0c752a0f"/><file name="Product.php" hash="e2596e998915f736435a78b8e2a4d4c2"/><file name="Stock.php" hash="28e819f8f317957a70a7d4d318e04791"/></dir><dir name="Handler"><file name="Abstract.php" hash="f5724a1c82becbc4d76a6f46dc591977"/><file name="CheckStatus.php" hash="4fc0544564271ec387a907e41fe2c231"/><file name="ProductCampaign.php" hash="831d8d3ff2cd29e090cff10c3a9c8844"/><file name="ProductDetailCampaign.php" hash="25175d7b6809c9db30e1400f4f800739"/><file name="Recommendations.php" hash="47b12e1f2f1e1d83ecaba77fdb20b63b"/><file name="Search.php" hash="31a7e04564ca9c7973b99d389ba6e00b"/><file name="SecondarySearch.php" hash="de4ced818f7865a491438a4d103b431a"/><file name="ShoppingCartCampaign.php" hash="202fc9ab4018247dfb8e8bcefd417465"/><file name="Suggest.php" hash="3b286cbda3cad188b10f7fac06e0ca32"/><file name="TagCloud.php" hash="e60bd2a5d314cfe3bad445ba88740878"/><file name="Tracking.php" hash="0df6a928578b8376a36eaa9e47079a91"/><dir name="Tracking"><file name="Scic.php" hash="6342c6f0077fb242a8955b1160abec89"/></dir></dir><dir name="Layer"><file name="Abstract.php" hash="0a0505e719ca55320da35c7510b82d3a"/><dir name="Filter"><file name="Item.php" hash="d51a705d6690e06934b81f4ed12c6f3b"/><dir name="Attribute"><file name="Abstract.php" hash="2ad710352f1803d15ba056cd93d519f1"/><file name="Catalog.php" hash="f6dce5ea64da9dfb3458ae9ff4b58a7b"/><file name="Catalogsearch.php" hash="75536576aaaa0186f166550ee746ae04"/></dir></dir></dir><dir name="Mysql4"><dir name="Campaign"><dir name="Pushedproducts"><file name="Collection.php" hash="c657b421e0137bf842ec78c26718363f"/></dir></dir><dir name="Product"><dir name="Attribute"><file name="Collection.php" hash="a5b47ca867be314d2d0edf1621608d8b"/></dir><dir name="Recommendation"><file name="Collection.php" hash="fdb6f35fa1cca09aa405bc5cd0c68601"/></dir></dir><dir name="Scic"><file name="Queue.php" hash="a1521000a1a10df8e6b580f33d06cf23"/><dir name="Queue"><file name="Collection.php" hash="5f6b0b6a50838929065ebd941cedce42"/></dir></dir><dir name="Search"><file name="Collection.php" hash="f4aba32bda99ba511686768342664774"/><file name="Engine.php" hash="88a56eb3b4587d87bb1152476b64036e"/></dir></dir><dir name="Scic"><file name="Queue.php" hash="828d391339a22c15ad74ae1a2e784b41"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Attributes.php" hash="8259883090dc4bca9b858d047983e736"/><file name="Enabled.php" hash="3b4d1f4b37d7ddba9768a7da6e3fc778"/></dir><dir name="Source"><file name="Authtype.php" hash="5bc0b1c745782cc51d44d56299059bcb"/><file name="Ffversion.php" hash="7cd3f4ed651c206e7684b2c5b7c2e788"/><file name="Identifier.php" hash="cec45238f0e28a1bf66d10dee513c2ca"/></dir></dir></dir></dir><dir name="sql"><dir name="factfinder_setup"><file name="mysql4-install-3.2.0.php" hash="1342320595048cd96659c454381cfbb4"/><file name="mysql4-upgrade-3.2.0-3.2.1.php" hash="3d5276dfe971a6bd48aa8e2a085de004"/><file name="mysql4-upgrade-3.2.1-3.3.0.php" hash="71954ea0cf400950d23b020ff095a9ee"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="factfinder.css" hash="16766d07b20544e11184ee21f95b2692"/></dir></dir></dir></dir></dir></target><target name="mage"><dir><dir name="js"><dir name="factfinder"><file name="jXHR.js" hash="0473a3ea88f08797737814c7ffbeba18"/><file name="suggest.js" hash="b45f28b377c73463527d9aa44e37589b"/><file name="tracking.js" hash="d0c9a7839c7066eec168950c37b0faf2"/></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies/>
26
  </package>