DndInxmail_Subscriber - Version 3.1.0.5

Version Notes

Version 3.1.0.5

Download this release

Release Info

Developer Mattheo Geoffray
Extension DndInxmail_Subscriber
Version 3.1.0.5
Comparing to
See all releases


Code changes from version 3.1.0.3 to 3.1.0.5

Files changed (141) hide show
  1. app/code/community/DndInxmail/Subscriber/Block/Adminhtml/Notifications.php +26 -0
  2. app/code/community/DndInxmail/Subscriber/Block/Adminhtml/System/Config/Form/Field/Payment.php +15 -0
  3. app/code/community/DndInxmail/Subscriber/Block/Adminhtml/System/Config/Form/Field/Universal.php +145 -0
  4. app/code/community/DndInxmail/Subscriber/Block/Adminhtml/System/Config/Form/Field/Universal/Select.php +20 -0
  5. app/code/community/DndInxmail/Subscriber/Helper/Mapping.php +33 -31
  6. app/code/community/DndInxmail/Subscriber/Helper/Synchronize.php +175 -21
  7. app/code/community/DndInxmail/Subscriber/Model/Adminhtml/System/Config/Source/Customer/Attributes.php +244 -0
  8. app/code/community/DndInxmail/Subscriber/Model/Adminhtml/System/Config/Source/Inxmail/GroupedColumns.php +81 -0
  9. app/code/community/DndInxmail/Subscriber/Model/Resource/Newsletter/Subscriber.php +78 -0
  10. app/code/community/DndInxmail/Subscriber/controllers/Adminhtml/InxmailNotificationController.php +38 -0
  11. app/code/community/DndInxmail/Subscriber/controllers/SynchronizeController.php +6 -1
  12. app/code/community/DndInxmail/Subscriber/etc/config.xml +16 -1
  13. app/code/community/DndInxmail/Subscriber/etc/system.xml +25 -117
  14. app/code/community/DndInxmail/Subscriber/sql/dndinxmail_subscriber_setup/mysql4-upgrade-3.1.0.4-3.1.1.0.php +89 -0
  15. app/design/adminhtml/default/default/layout/dndinxmail.xml +6 -0
  16. app/design/adminhtml/default/default/template/dndinxmail/subscriber/notifications.phtml +12 -0
  17. lib/Inx/Api/APIException.php +39 -39
  18. lib/Inx/Api/Action/Action.php +180 -180
  19. lib/Inx/Api/Action/ActionManager.php +97 -97
  20. lib/Inx/Api/Action/Command.php +32 -32
  21. lib/Inx/Api/Action/CommandFactory.php +202 -202
  22. lib/Inx/Api/Action/DeleteRecipientCommand.php +18 -18
  23. lib/Inx/Api/Action/SendActionMailCommand.php +42 -42
  24. lib/Inx/Api/Action/SendMailCommand.php +56 -56
  25. lib/Inx/Api/Action/SetValueCommand.php +72 -72
  26. lib/Inx/Api/Action/SubUnsubscriptionCommand.php +61 -61
  27. lib/Inx/Api/Action/SubscriptionCommand.php +48 -48
  28. lib/Inx/Api/Action/UnsubscriptionCommand.php +56 -56
  29. lib/Inx/Api/Approval/Approver.php +100 -100
  30. lib/Inx/Api/Approval/ApproverManager.php +46 -46
  31. lib/Inx/Api/BOManager.php +43 -43
  32. lib/Inx/Api/BOResultSet.php +56 -56
  33. lib/Inx/Api/Blacklist/BlacklistEntry.php +102 -102
  34. lib/Inx/Api/Blacklist/BlacklistManager.php +109 -109
  35. lib/Inx/Api/Bounce/Bounce.php +257 -257
  36. lib/Inx/Api/Bounce/BounceManager.php +143 -143
  37. lib/Inx/Api/BusinessObject.php +44 -44
  38. lib/Inx/Api/ConnectException.php +18 -18
  39. lib/Inx/Api/DataAccess/ClickData.php +390 -390
  40. lib/Inx/Api/DataAccess/ClickDataRowSet.php +209 -209
  41. lib/Inx/Api/DataAccess/DataAccess.php +92 -92
  42. lib/Inx/Api/DataAccess/DataRowSet.php +100 -100
  43. lib/Inx/Api/DataAccess/LinkData.php +78 -78
  44. lib/Inx/Api/DataAccess/LinkDataRowSet.php +220 -220
  45. lib/Inx/Api/DataException.php +19 -19
  46. lib/Inx/Api/DesignTemplate/DesignCollection.php +85 -85
  47. lib/Inx/Api/DesignTemplate/DesignCollectionManager.php +127 -127
  48. lib/Inx/Api/DesignTemplate/ImportException.php +111 -111
  49. lib/Inx/Api/DesignTemplate/Style.php +32 -32
  50. lib/Inx/Api/DesignTemplate/Template.php +50 -50
  51. lib/Inx/Api/FeatureNotAvailableException.php +22 -22
  52. lib/Inx/Api/Features.php +136 -136
  53. lib/Inx/Api/Filter/Filter.php +165 -165
  54. lib/Inx/Api/Filter/FilterManager.php +96 -96
  55. lib/Inx/Api/FilterStmtException.php +17 -17
  56. lib/Inx/Api/IOException.php +12 -12
  57. lib/Inx/Api/IllegalArgumentException.php +16 -16
  58. lib/Inx/Api/IllegalStateException.php +18 -18
  59. lib/Inx/Api/Inbox/InboxManager.php +98 -98
  60. lib/Inx/Api/Inbox/InboxMessage.php +267 -267
  61. lib/Inx/Api/IndexOutOfBoundsException.php +28 -28
  62. lib/Inx/Api/IndexSelection.php +100 -100
  63. lib/Inx/Api/InputStream.php +15 -15
  64. lib/Inx/Api/List/AdminListContext.php +25 -25
  65. lib/Inx/Api/List/ListSize.php +29 -29
  66. lib/Inx/Api/List/SystemListContext.php +27 -27
  67. lib/Inx/Api/LockException.php +43 -43
  68. lib/Inx/Api/LockTicket.php +105 -105
  69. lib/Inx/Api/LoginException.php +56 -56
  70. lib/Inx/Api/Mail/Attachment.php +57 -57
  71. lib/Inx/Api/Mail/BuildException.php +63 -63
  72. lib/Inx/Api/Mail/HeaderField.php +74 -74
  73. lib/Inx/Api/Mail/MailContent.php +161 -161
  74. lib/Inx/Api/Mail/MailingRenderer.php +133 -133
  75. lib/Inx/Api/Mail/ParseException.php +57 -57
  76. lib/Inx/Api/Mail/RenderError.php +142 -142
  77. lib/Inx/Api/Mailing/ContentHandler.php +23 -23
  78. lib/Inx/Api/Mailing/HtmlTextContentHandler.php +19 -19
  79. lib/Inx/Api/Mailing/Mailing.php +689 -689
  80. lib/Inx/Api/Mailing/MailingConstants.php +64 -64
  81. lib/Inx/Api/Mailing/MailingManager.php +238 -238
  82. lib/Inx/Api/Mailing/MailingStateException.php +61 -61
  83. lib/Inx/Api/Mailing/MultiPartContentHandler.php +46 -46
  84. lib/Inx/Api/Mailing/PlainTextContentHandler.php +17 -17
  85. lib/Inx/Api/Mailing/SendException.php +17 -17
  86. lib/Inx/Api/Mailing/SendingInfo.php +56 -56
  87. lib/Inx/Api/Mailing/SinglePartContentHandler.php +33 -33
  88. lib/Inx/Api/Mailing/XsltContentHandler.php +48 -48
  89. lib/Inx/Api/Mailing/XsltHtmlTextContentHandler.php +34 -34
  90. lib/Inx/Api/Mailing/XsltMultiPartContentHandler.php +45 -45
  91. lib/Inx/Api/Mailing/XsltPlainTextContentHandler.php +33 -33
  92. lib/Inx/Api/MailingTemplate/MailingTemplate.php +130 -130
  93. lib/Inx/Api/MailingTemplate/MailingTemplateManager.php +96 -96
  94. lib/Inx/Api/NameException.php +20 -20
  95. lib/Inx/Api/NullPointerException.php +12 -12
  96. lib/Inx/Api/Order.php +19 -19
  97. lib/Inx/Api/Plugin/PluginStore.php +99 -99
  98. lib/Inx/Api/PluginStatusService.php +110 -110
  99. lib/Inx/Api/Property/ApprovalPropertyValue.php +141 -141
  100. lib/Inx/Api/Property/FormatChoicePropertyFormatter.php +467 -467
  101. lib/Inx/Api/Property/Property.php +126 -126
  102. lib/Inx/Api/Property/PropertyFormatter.php +77 -77
  103. lib/Inx/Api/Property/PropertyNames.php +240 -240
  104. lib/Inx/Api/Recipient/Attribute.php +266 -266
  105. lib/Inx/Api/Recipient/AttributeManager.php +159 -159
  106. lib/Inx/Api/Recipient/AttributeNotFoundException.php +17 -17
  107. lib/Inx/Api/Recipient/BlackListException.php +16 -16
  108. lib/Inx/Api/Recipient/DuplicateKeyException.php +18 -18
  109. lib/Inx/Api/Recipient/IllegalValueException.php +20 -20
  110. lib/Inx/Api/Recipient/SelectException.php +20 -20
  111. lib/Inx/Api/RemoteException.php +30 -30
  112. lib/Inx/Api/Reporting/ConfigDescriptor.php +106 -106
  113. lib/Inx/Api/Reporting/Control.php +129 -129
  114. lib/Inx/Api/Reporting/ControlUnit.php +50 -50
  115. lib/Inx/Api/Reporting/DownloadableResult.php +108 -108
  116. lib/Inx/Api/Reporting/ReportEngine.php +129 -129
  117. lib/Inx/Api/Reporting/ReportException.php +19 -19
  118. lib/Inx/Api/Reporting/ReportRequest.php +237 -237
  119. lib/Inx/Api/Reporting/ReportTicket.php +90 -90
  120. lib/Inx/Api/Resource/Resource.php +196 -196
  121. lib/Inx/Api/Resource/ResourceManager.php +118 -118
  122. lib/Inx/Api/SecurityException.php +10 -10
  123. lib/Inx/Api/ServerTime.php +47 -47
  124. lib/Inx/Api/Subscription/SubscriptionLogEntryRowSet.php +547 -547
  125. lib/Inx/Api/Testprofiles/TestRecipientContext.php +146 -146
  126. lib/Inx/Api/Testprofiles/TestRecipientRowSet.php +524 -524
  127. lib/Inx/Api/TextModule/TextModule.php +156 -156
  128. lib/Inx/Api/TextModule/TextModuleManager.php +89 -89
  129. lib/Inx/Api/TriggerMail/Attachment.php +54 -54
  130. lib/Inx/Api/TriggerMail/BuildException.php +60 -60
  131. lib/Inx/Api/TriggerMail/BuildMode.php +135 -135
  132. lib/Inx/Api/TriggerMail/ParseException.php +56 -56
  133. lib/Inx/Api/TriggerMail/RenderError.php +143 -143
  134. lib/Inx/Api/TriggerMail/TriggerMailContent.php +137 -137
  135. lib/Inx/Api/TriggerMail/TriggerMailingConstants.php +24 -24
  136. lib/Inx/Api/TriggerMail/TriggerMailingContentType.php +167 -167
  137. lib/Inx/Api/TriggerMail/TriggerMailingExceptionType.php +139 -139
  138. lib/Inx/Api/TriggerMail/TriggerMailingRenderer.php +284 -284
  139. lib/Inx/Api/TriggerMailing/Descriptor/ActionTriggerDescriptorBuilder.php +22 -22
  140. lib/Inx/Api/TriggerMailing/Descriptor/AnniversaryTriggerDescriptorBuilder.php +99 -99
  141. lib/Inx/Api/TriggerMailing/Descriptor/AttributeTriggerDescriptorBuilder.php +0 -97
app/code/community/DndInxmail/Subscriber/Block/Adminhtml/Notifications.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class DndInxmail_Subscriber_Block_Adminhtml_Notifications extends Mage_Core_Block_Template
4
+ {
5
+
6
+
7
+ /**
8
+ * @return array
9
+ */
10
+ public function getMessages()
11
+ {
12
+ $errorsJson = Mage::getStoreConfig(DndInxmail_Subscriber_Helper_Synchronize::DND_INXMAIL_ADMIN_NOTIFICATION);
13
+ try {
14
+ $errors = Mage::helper('core')->jsonDecode($errorsJson);
15
+ } catch (Exception $e) {
16
+ $errors = array();
17
+ }
18
+
19
+ if (!is_array($errors)) {
20
+ $errors = array();
21
+ }
22
+
23
+ return $errors;
24
+ }
25
+ }
26
+
app/code/community/DndInxmail/Subscriber/Block/Adminhtml/System/Config/Form/Field/Payment.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Module Block
5
+ * @package DndInxmail_Subscriber
6
+ * @dev Alexander Velykzhanin
7
+ * @last_modified 29/07/2015
8
+ * @copyright Copyright (c) 2015 Flagbit GmbH & Co. KG
9
+ * @author Flagbit GmbH & Co. KG : https://www.flagbit.de/
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
+ */
12
+ class DndInxmail_Subscriber_Block_Adminhtml_System_Config_Form_Field_Payment
13
+ extends DndInxmail_Subscriber_Block_Adminhtml_System_Config_Form_Field_Universal
14
+ {
15
+ }
app/code/community/DndInxmail/Subscriber/Block/Adminhtml/System/Config/Form/Field/Universal.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Module Block
5
+ * @package DndInxmail_Subscriber
6
+ * @dev Alexander Velykzhanin
7
+ * @last_modified 29/07/2015
8
+ * @copyright Copyright (c) 2015 Flagbit GmbH & Co. KG
9
+ * @author Flagbit GmbH & Co. KG : https://www.flagbit.de/
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
+ */
12
+ class DndInxmail_Subscriber_Block_Adminhtml_System_Config_Form_Field_Universal
13
+ extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
14
+ {
15
+
16
+
17
+ protected $_fields = array();
18
+
19
+
20
+ /**
21
+ * load column config
22
+ *
23
+ * @return Varien_Simplexml_Element
24
+ */
25
+ protected function _loadColumnConfig()
26
+ {
27
+ return new Varien_Simplexml_Element(
28
+ $this->getElement()->getOriginalData('columns')
29
+ );
30
+ }
31
+
32
+
33
+ /**
34
+ * get Text field renderer
35
+ *
36
+ * @param $field
37
+ * @return null
38
+ */
39
+ protected function _getFieldText($field)
40
+ {
41
+ return null;
42
+ }
43
+
44
+
45
+ /**
46
+ * get Select field renderer
47
+ *
48
+ * @param $field
49
+ * @return null
50
+ */
51
+ protected function _getFieldSelect($field)
52
+ {
53
+ $sourceModelName =(string) $field->source_model;
54
+ if(empty($sourceModelName)){
55
+ return null;
56
+ }
57
+ $sourceModel = Mage::getModel($sourceModelName);
58
+
59
+ $select = $this->getLayout()->createBlock(
60
+ 'dndinxmail_subscriber/adminhtml_system_config_form_field_universal_select', '',
61
+ array('is_render_to_js_template' => true)
62
+ );
63
+ $select->setOptions($sourceModel->toOptionArray());
64
+ $select->setClass($field->getName().'_select');
65
+
66
+ if(!empty($field->style)){
67
+ $select->setExtraParams('style="'.$field->style.'"');
68
+ }
69
+
70
+ return $select;
71
+ }
72
+
73
+
74
+ /**
75
+ * Prepare to render
76
+ */
77
+ protected function _prepareToRender()
78
+ {
79
+
80
+ /* @var $field Varien_Simplexml_Element */
81
+ foreach($this->_loadColumnConfig() as $field){
82
+
83
+ $this->addColumn($field->getName(), array(
84
+ 'label' => Mage::helper('dndinxmail_subscriber')->__((string) $field->label),
85
+ 'style' => (string) $field->style,
86
+ 'renderer' => $this->_getFieldRenderer($field)
87
+ ));
88
+ }
89
+
90
+ $this->_addAfter = false;
91
+ $_label = $this->getElement()->getOriginalData('button_label');
92
+ if(empty($_label)){
93
+ $_label = 'Add';
94
+ }
95
+ $this->_addButtonLabel = Mage::helper('dndinxmail_subscriber')->__($_label);
96
+ }
97
+
98
+
99
+ /**
100
+ * get Field renderer
101
+ *
102
+ * @param $field
103
+ * @return null
104
+ */
105
+ protected function _getFieldRenderer($field)
106
+ {
107
+ if(!isset($this->_fields[$field->getName()])){
108
+
109
+ $_type = (string) $field->type;
110
+ if(!$_type){
111
+ $_type = 'text';
112
+ }
113
+
114
+ $_fieldRenderMethod = '_getField'.ucfirst($_type);
115
+ if(!is_callable(array($this, $_fieldRenderMethod))){
116
+ return null;
117
+ }
118
+ $this->_fields[$field->getName()] = call_user_func(array($this, $_fieldRenderMethod), $field);
119
+ }
120
+ return $this->_fields[$field->getName()];
121
+ }
122
+
123
+
124
+ /**
125
+ * Prepare existing row data object
126
+ *
127
+ * @param Varien_Object
128
+ */
129
+ protected function _prepareArrayRow(Varien_Object $row)
130
+ {
131
+ /* @var $field Varien_Simplexml_Element */
132
+ foreach($this->_loadColumnConfig() as $field){
133
+
134
+ $_type = (string) $field->type;
135
+ if(!$_type || $_type != 'select'){
136
+ continue;
137
+ }
138
+
139
+ $row->setData(
140
+ 'option_extra_attr_' . $this->_getFieldRenderer($field)->calcOptionHash($row->getData($field->getName())),
141
+ 'selected="selected"'
142
+ );
143
+ }
144
+ }
145
+ }
app/code/community/DndInxmail/Subscriber/Block/Adminhtml/System/Config/Form/Field/Universal/Select.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Module Block
5
+ * @package DndInxmail_Subscriber
6
+ * @dev Alexander Velykzhanin
7
+ * @last_modified 29/07/2015
8
+ * @copyright Copyright (c) 2015 Flagbit GmbH & Co. KG
9
+ * @author Flagbit GmbH & Co. KG : https://www.flagbit.de/
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
+ */
12
+ class DndInxmail_Subscriber_Block_Adminhtml_System_Config_Form_Field_Universal_Select extends Mage_Core_Block_Html_Select {
13
+
14
+
15
+ public function setInputName($value)
16
+ {
17
+ return $this->setName($value);
18
+ }
19
+
20
+ }
app/code/community/DndInxmail/Subscriber/Helper/Mapping.php CHANGED
@@ -4,7 +4,8 @@
4
  * @category Module Helper
5
  * @package DndInxmail_Subscriber
6
  * @dev Merlin
7
- * @last_modified 06/05/2015
 
8
  * @copyright Copyright (c) 2012 Agence Dn'D
9
  * @author Agence Dn'D - Conseil en creation de site e-Commerce Magento : http://www.dnd.fr/
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
@@ -12,29 +13,15 @@
12
  class DndInxmail_Subscriber_Helper_Mapping extends DndInxmail_Subscriber_Helper_Abstract
13
  {
14
 
 
 
 
 
15
  /**
16
  * @var null
17
  */
18
  protected $_mapping = null; // Mapping object
19
 
20
- // Fields for customer attributes
21
- /**
22
- * @var array
23
- */
24
- protected $_customerAttributes = array(
25
- 'entity_id',
26
- 'website_id',
27
- 'group_id',
28
- 'store_id',
29
- 'created_at',
30
- 'updated_at',
31
- 'is_active',
32
- 'prefix',
33
- 'firstname',
34
- 'lastname',
35
- 'gender',
36
- 'dob'
37
- );
38
 
39
  // Fields for dynamics attributes
40
  /**
@@ -58,16 +45,30 @@ class DndInxmail_Subscriber_Helper_Mapping extends DndInxmail_Subscriber_Helper_
58
  if ($this->_mapping == null) {
59
 
60
  $mapping = array();
61
- foreach ($this->_customerAttributes as $cAttribute) {
62
- $cValue = $this->getCustomerAttributeConfig($cAttribute);
63
- if ($cValue != '' && $cValue != null) {
64
- $mapping[$cAttribute] = $cValue;
 
65
  }
 
 
 
 
 
 
 
 
 
66
  }
 
67
  foreach ($this->_dynamicAttributes as $dAttribute) {
68
  $dValue = $this->getDynamicAttributeConfig($dAttribute);
69
  if ($dValue != '' && $dValue != null) {
70
- $mapping[$dAttribute] = $dValue;
 
 
 
71
  }
72
  }
73
 
@@ -90,16 +91,17 @@ class DndInxmail_Subscriber_Helper_Mapping extends DndInxmail_Subscriber_Helper_
90
  return (in_array($attribute, $this->_dynamicAttributes)) ? true : false;
91
  }
92
 
 
93
  /**
94
- * Get customer attribute's Inxmail column from Magento configuration
95
- *
96
- * @param string $attribute Attribute key
97
- *
98
- * @return mixed Attribute value
99
  */
100
- public function getCustomerAttributeConfig($attribute)
101
  {
102
- return Mage::getStoreConfig('dndinxmail_subscriber_mapping/mapping_customer/' . $attribute);
 
 
 
 
103
  }
104
 
105
  /**
4
  * @category Module Helper
5
  * @package DndInxmail_Subscriber
6
  * @dev Merlin
7
+ * @dev Alexander Velykzhanin
8
+ * @last_modified 05/08/2015
9
  * @copyright Copyright (c) 2012 Agence Dn'D
10
  * @author Agence Dn'D - Conseil en creation de site e-Commerce Magento : http://www.dnd.fr/
11
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
13
  class DndInxmail_Subscriber_Helper_Mapping extends DndInxmail_Subscriber_Helper_Abstract
14
  {
15
 
16
+
17
+ const CONFIG_MAPPING = 'dndinxmail_subscriber_mapping/mapping_customer/mapping';
18
+
19
+
20
  /**
21
  * @var null
22
  */
23
  protected $_mapping = null; // Mapping object
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  // Fields for dynamics attributes
27
  /**
45
  if ($this->_mapping == null) {
46
 
47
  $mapping = array();
48
+
49
+ $newMappings = $this->getAttributeMappingConfig();
50
+ foreach ($newMappings as $newMapping) {
51
+ if (!$newMapping['attribute_code']) {
52
+ continue;
53
  }
54
+ // 1st part is attribute type (customer/customer_address), 2nd - attribute code
55
+ $dividedCode = explode(':', $newMapping['attribute_code']);
56
+ if (count($dividedCode) != 2 || !$dividedCode[0] || !$dividedCode[1]) {
57
+ continue;
58
+ }
59
+ $mapping[$dividedCode[1]] = array (
60
+ 'inxmail_column' => $newMapping['inxmail_column'],
61
+ 'attribute_type' => $dividedCode[0],
62
+ );
63
  }
64
+
65
  foreach ($this->_dynamicAttributes as $dAttribute) {
66
  $dValue = $this->getDynamicAttributeConfig($dAttribute);
67
  if ($dValue != '' && $dValue != null) {
68
+ $mapping[$dAttribute] = array(
69
+ 'inxmail_column' => $dValue,
70
+ 'attribute_type' => 'customer',
71
+ );
72
  }
73
  }
74
 
91
  return (in_array($attribute, $this->_dynamicAttributes)) ? true : false;
92
  }
93
 
94
+
95
  /**
96
+ * @return mixed
 
 
 
 
97
  */
98
+ public function getAttributeMappingConfig()
99
  {
100
+ $config = Mage::getStoreConfig(self::CONFIG_MAPPING);
101
+ if ($config) {
102
+ $config = unserialize($config);
103
+ }
104
+ return $config;
105
  }
106
 
107
  /**
app/code/community/DndInxmail/Subscriber/Helper/Synchronize.php CHANGED
@@ -4,7 +4,8 @@
4
  * @category Module Helper
5
  * @package DndInxmail_Subscriber
6
  * @dev Merlin
7
- * @last_modified 13/03/2013
 
8
  * @copyright Copyright (c) 2012 Agence Dn'D
9
  * @author Agence Dn'D - Conseil en creation de site e-Commerce Magento : http://www.dnd.fr/
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
@@ -39,6 +40,10 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
39
  *
40
  */
41
  const DNDINXMAIL_CUSTOMER_MAPPING_STATUS_DELETED = 'deleted'; // Customer mapping deleted status
 
 
 
 
42
 
43
  /**
44
  * @var null
@@ -63,6 +68,13 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
63
  */
64
  protected $_customerCollection = null; // Customer collection for dynamic attributes
65
 
 
 
 
 
 
 
 
66
  /**
67
  * Open an Inxmail session
68
  *
@@ -203,22 +215,38 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
203
  }
204
 
205
  $mappingHelper = Mage::helper('dndinxmail_subscriber/mapping');
 
206
  $customer = $this->getCustomerByEmail($email);
207
  $vars = array();
208
 
209
  if ($customer != false) {
210
  $fields = $mappingHelper->getMappingFields();
211
- foreach ($fields as $magentoField => $inxmailField) {
 
212
  if ($mappingHelper->isDynamicAttribute($magentoField)) {
213
  $dynamicData = $this->getDynamicData($magentoField, $email);
214
  if ($dynamicData !== false) {
215
- $vars[$inxmailField] = $dynamicData;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  }
217
  }
218
- $value = $customer->getData($magentoField);
219
  if ($value != null) {
220
- $value = $this->_processAttributesValue($magentoField, $value);
221
- $vars[$inxmailField] = $value;
222
  }
223
  }
224
  }
@@ -354,9 +382,13 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
354
  */
355
  public function getCustomerByEmail($email)
356
  {
357
- $websites = Mage::app()->getWebsites();
358
- $website = reset($websites);
359
- $website = (count($website) > 0) ? $website->getId() : Mage::app()->getWebsite()->getId();
 
 
 
 
360
 
361
  $customer = Mage::getModel('customer/customer')->setWebsiteId($website)->loadByEmail($email);
362
 
@@ -717,30 +749,86 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
717
  *
718
  * @param $field
719
  * @param $value
 
720
  *
721
  * @return string
722
  */
723
- protected function _processAttributesValue($field, $value)
724
  {
725
- switch ($field) {
726
 
727
- case 'gender':
728
- $gender = '';
729
- if ($value == '2') {
730
- $gender = 'f';
731
- }
732
- elseif ($value == '1') {
733
- $gender = 'm';
734
- }
735
 
736
- $value = $gender;
737
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
738
 
 
 
 
739
  }
740
 
741
  return $value;
742
  }
743
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
744
  /**
745
  * Get data for dynamic attributes
746
  *
@@ -914,6 +1002,8 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
914
 
915
  $contextListManager = $this->getListContextManager();
916
 
 
 
917
  foreach ($groupsConfig as $groupId) {
918
 
919
  $listName = $groupHelper->formatInxmailListName($groupId);
@@ -933,6 +1023,7 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
933
  if (!$emails) continue;
934
 
935
  $inxmailList = $contextListManager->get($list->getId());
 
936
  foreach ($emails as $email) {
937
 
938
  $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
@@ -951,6 +1042,69 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
951
  return true;
952
  }
953
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
954
  /**
955
  * Initiate an action based on the subscriber status
956
  *
4
  * @category Module Helper
5
  * @package DndInxmail_Subscriber
6
  * @dev Merlin
7
+ * @dev Alexander Velykzhanin
8
+ * @last_modified 05/08/2015
9
  * @copyright Copyright (c) 2012 Agence Dn'D
10
  * @author Agence Dn'D - Conseil en creation de site e-Commerce Magento : http://www.dnd.fr/
11
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
40
  *
41
  */
42
  const DNDINXMAIL_CUSTOMER_MAPPING_STATUS_DELETED = 'deleted'; // Customer mapping deleted status
43
+ /**
44
+ * Stores synchronization error notifications
45
+ */
46
+ const DND_INXMAIL_ADMIN_NOTIFICATION = 'dndinxmail_subscriber_general/general/notifications';
47
 
48
  /**
49
  * @var null
68
  */
69
  protected $_customerCollection = null; // Customer collection for dynamic attributes
70
 
71
+ /**
72
+ * Contains cache for loaded attributes
73
+ *
74
+ * @var array
75
+ */
76
+ protected $_attributes = array();
77
+
78
  /**
79
  * Open an Inxmail session
80
  *
215
  }
216
 
217
  $mappingHelper = Mage::helper('dndinxmail_subscriber/mapping');
218
+ /** @var null|Mage_Customer_Model_Customer $customer */
219
  $customer = $this->getCustomerByEmail($email);
220
  $vars = array();
221
 
222
  if ($customer != false) {
223
  $fields = $mappingHelper->getMappingFields();
224
+ foreach ($fields as $magentoField => $config) {
225
+ $inxmailColumn = $config['inxmail_column'];
226
  if ($mappingHelper->isDynamicAttribute($magentoField)) {
227
  $dynamicData = $this->getDynamicData($magentoField, $email);
228
  if ($dynamicData !== false) {
229
+ $vars[$inxmailColumn] = $dynamicData;
230
+ }
231
+
232
+ continue;
233
+ }
234
+ $attributeType = $config['attribute_type'];
235
+
236
+ $value = null;
237
+ if ($attributeType === 'customer') {
238
+ $value = $customer->getData($magentoField);
239
+ } elseif ($attributeType === 'customer_address') {
240
+ $customerAddress = $customer->getDefaultBillingAddress();
241
+
242
+ if ($customerAddress && $customerAddress->getId()) {
243
+ $value = $customerAddress->getData($magentoField);
244
  }
245
  }
246
+
247
  if ($value != null) {
248
+ $value = $this->_processAttributesValue($magentoField, $value, $attributeType);
249
+ $vars[$inxmailColumn] = $value;
250
  }
251
  }
252
  }
382
  */
383
  public function getCustomerByEmail($email)
384
  {
385
+ if(Mage::app()->getStore()->getCode() == Mage_Core_Model_Store::ADMIN_CODE) {
386
+ $websites = Mage::app()->getWebsites();
387
+ $website = reset($websites);
388
+ $website = (count($website) > 0) ? $website->getId() : Mage::app()->getWebsite()->getId();
389
+ } else {
390
+ $website = Mage::app()->getWebsite()->getId();
391
+ }
392
 
393
  $customer = Mage::getModel('customer/customer')->setWebsiteId($website)->loadByEmail($email);
394
 
749
  *
750
  * @param $field
751
  * @param $value
752
+ * @param $attributeType
753
  *
754
  * @return string
755
  */
756
+ protected function _processAttributesValue($field, $value, $attributeType)
757
  {
 
758
 
759
+ if ($field == 'gender') {
760
+ $gender = '';
761
+ if ($value == '2') {
762
+ $gender = 'f';
763
+ }
764
+ elseif ($value == '1') {
765
+ $gender = 'm';
766
+ }
767
 
768
+ return $gender;
769
+ }
770
+
771
+ $attribute = $this->_getAttribute($field, $attributeType);
772
+
773
+ if (!is_null($attribute) && $attribute->usesSource()) {
774
+ if ($attribute->getFrontendInput() === 'select') {
775
+ $value = $attribute->getSource()
776
+ ->getOptionText($value);
777
+ } elseif ($attribute->getFrontendInput() === 'multiselect') {
778
+ $exploded = explode(',', $value);
779
+ $values = array();
780
+ foreach ($exploded as $singleValue) {
781
+ $optionText = $attribute->getSource()
782
+ ->getOptionText($singleValue);
783
+
784
+ if (is_array($optionText)) {
785
+ $values[] = $optionText['label'];
786
+ } else {
787
+ $values[] = $optionText;
788
+ }
789
 
790
+ }
791
+ $value = implode(',', $values);
792
+ }
793
  }
794
 
795
  return $value;
796
  }
797
 
798
+
799
+ /**
800
+ * @param $field
801
+ * @param $attributeType
802
+ *
803
+ * @return null|Mage_Eav_Model_Entity_Attribute
804
+ */
805
+ protected function _getAttribute($field, $attributeType)
806
+ {
807
+ if (!array_key_exists($attributeType, $this->_attributes)) {
808
+ $attributes = array();
809
+ if ($attributeType === 'customer_address') {
810
+ $attributeCollection = Mage::getResourceModel('customer/address_attribute_collection');
811
+ } else {
812
+ $attributeCollection = Mage::getResourceModel('customer/attribute_collection');
813
+ }
814
+
815
+ foreach ($attributeCollection as $attribute) {
816
+ $attributes[$attribute->getAttributeCode()] = $attribute;
817
+ }
818
+
819
+ $this->_attributes[$attributeType] = $attributes;
820
+ }
821
+
822
+ $attribute = null;
823
+ if (array_key_exists($field, $this->_attributes[$attributeType])) {
824
+ $attribute = $this->_attributes[$attributeType][$field];
825
+ }
826
+
827
+ return $attribute;
828
+ }
829
+
830
+
831
+
832
  /**
833
  * Get data for dynamic attributes
834
  *
1002
 
1003
  $contextListManager = $this->getListContextManager();
1004
 
1005
+ $this->doMappingCheck();
1006
+
1007
  foreach ($groupsConfig as $groupId) {
1008
 
1009
  $listName = $groupHelper->formatInxmailListName($groupId);
1023
  if (!$emails) continue;
1024
 
1025
  $inxmailList = $contextListManager->get($list->getId());
1026
+
1027
  foreach ($emails as $email) {
1028
 
1029
  $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
1042
  return true;
1043
  }
1044
 
1045
+
1046
+ /**
1047
+ * @return bool
1048
+ */
1049
+ public function doMappingCheck()
1050
+ {
1051
+ $hasErrors = false;
1052
+ $errors = array();
1053
+ /** @var DndInxmail_Subscriber_Helper_Mapping $mappingHelper */
1054
+ $mappingHelper = Mage::helper('dndinxmail_subscriber/mapping');
1055
+ /** @var DndInxmail_Subscriber_Helper_Log $logHelper */
1056
+ $logHelper = Mage::helper('dndinxmail_subscriber/log');
1057
+
1058
+ $fields = $mappingHelper->getMappingFields();
1059
+ $recipientContext = $this->getRecipientContext();
1060
+ $recipientMetaData = $recipientContext->getMetaData();
1061
+
1062
+ foreach ($fields as $magentoField => $config) {
1063
+ if ($mappingHelper->isDynamicAttribute($magentoField)) {
1064
+ continue;
1065
+ }
1066
+ $inxmailColumn = $config['inxmail_column'];
1067
+ $customerAttribute = Mage::getModel('eav/entity_attribute')->loadByCode('customer', $magentoField);
1068
+ $customerAddressAttribute = Mage::getModel('eav/entity_attribute')
1069
+ ->loadByCode('customer_address', $magentoField);
1070
+ if (!$customerAttribute->getId() && !$customerAddressAttribute->getId()) {
1071
+ $errors[] = sprintf(
1072
+ "'%s' magento attribute not found during synchronization for '%s' column",
1073
+ $magentoField,
1074
+ $inxmailColumn
1075
+ );
1076
+ $hasErrors = true;
1077
+ }
1078
+
1079
+ try {
1080
+ $recipientMetaData->getUserAttribute($inxmailColumn);
1081
+ } catch (Inx_Api_Recipient_AttributeNotFoundException $e) {
1082
+ $errors[] = sprintf(
1083
+ "'%s' inxmail column not found during synchronization for '%s' magento field",
1084
+ $inxmailColumn,
1085
+ $magentoField
1086
+ );
1087
+ $hasErrors = true;
1088
+ }
1089
+ }
1090
+
1091
+ $currentNotifications = Mage::getStoreConfig(self::DND_INXMAIL_ADMIN_NOTIFICATION);
1092
+ if ($hasErrors && !empty($errors)) {
1093
+ foreach ($errors as $error) {
1094
+ $logHelper->logData($error);
1095
+ }
1096
+ }
1097
+
1098
+ $errorsJson = Mage::helper('core')->jsonEncode($errors);
1099
+ if ($currentNotifications !== $errorsJson) {
1100
+ $config = new Mage_Core_Model_Config();
1101
+ $config->saveConfig(self::DND_INXMAIL_ADMIN_NOTIFICATION, $errorsJson);
1102
+ $config->cleanCache();
1103
+ }
1104
+
1105
+ return $hasErrors;
1106
+ }
1107
+
1108
  /**
1109
  * Initiate an action based on the subscriber status
1110
  *
app/code/community/DndInxmail/Subscriber/Model/Adminhtml/System/Config/Source/Customer/Attributes.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Module Model
5
+ * @package DndInxmail_Subscriber
6
+ * @dev Alexander Velykzhanin
7
+ * @last_modified 05/08/2015
8
+ * @copyright Copyright (c) 2015 Flagbit GmbH & Co. KG
9
+ * @author Flagbit GmbH & Co. KG : https://www.flagbit.de/
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
+ */
12
+ class DndInxmail_Subscriber_Model_Adminhtml_System_Config_Source_Customer_Attributes
13
+ {
14
+
15
+ /**
16
+ * @var
17
+ */
18
+ protected $_options;
19
+
20
+
21
+ /**
22
+ * Attributes that we don't need to map(will not be used or are mapped automatically
23
+ *
24
+ * @var array
25
+ */
26
+ protected $_attributesToSkip = array(
27
+ 'customer' => array(
28
+ 'disable_auto_group_change',
29
+ 'email',
30
+ 'default_billing',
31
+ 'default_shipping',
32
+ 'password_hash',
33
+ 'reward_update_notification',
34
+ 'reward_warning_notification',
35
+ 'rp_token',
36
+ 'rp_token_created_at',
37
+ ),
38
+ 'customer_address' => array(
39
+ 'firstname',
40
+ 'lastname',
41
+ 'middlename',
42
+ 'prefix',
43
+ 'suffix',
44
+ ),
45
+ );
46
+
47
+
48
+ /**
49
+ * @return array
50
+ */
51
+ protected function _getStaticAttributes()
52
+ {
53
+ $helper = Mage::helper('dndinxmail_subscriber');
54
+
55
+ return array(
56
+ array(
57
+ 'label' => $helper->__('Customer ID'),
58
+ 'value' => 'customer:entity_id',
59
+ 'params' => array(
60
+ 'data-type' => Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER,
61
+ ),
62
+ ),
63
+ array(
64
+ 'label' => $helper->__('Update Date'),
65
+ 'value' => 'customer:updated_at',
66
+ 'params' => array(
67
+ 'data-type' => Inx_Api_Recipient_Attribute::DATA_TYPE_DATE,
68
+ ),
69
+ ),
70
+ array(
71
+ 'label' => $helper->__('Customer is active'),
72
+ 'value' => 'customer:is_active',
73
+ 'params' => array(
74
+ 'data-type' => Inx_Api_Recipient_Attribute::DATA_TYPE_BOOLEAN,
75
+ ),
76
+ ),
77
+ array(
78
+ 'label' => $helper->__('Creation Date'),
79
+ 'value' => 'customer:created_at',
80
+ 'params' => array(
81
+ 'data-type' => Inx_Api_Recipient_Attribute::DATA_TYPE_DATE,
82
+ ),
83
+ ),
84
+ array(
85
+ 'label' => $helper->__('Group ID'),
86
+ 'value' => 'customer:group_id',
87
+ 'params' => array(
88
+ 'data-type' => Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER,
89
+ ),
90
+ ),
91
+ array(
92
+ 'label' => $helper->__('Store ID'),
93
+ 'value' => 'customer:store_id',
94
+ 'params' => array(
95
+ 'data-type' => Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER,
96
+ ),
97
+ ),
98
+ array(
99
+ 'label' => $helper->__('Website ID'),
100
+ 'value' => 'customer:website_id',
101
+ 'params' => array(
102
+ 'data-type' => Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER,
103
+ ),
104
+ ),
105
+ );
106
+ }
107
+
108
+
109
+ /**
110
+ * Get product attributes
111
+ *
112
+ * @return array Product attributes
113
+ */
114
+ public function toOptionArray()
115
+ {
116
+ if (!$this->_options) {
117
+ $customerAttributes = Mage::getResourceModel('customer/attribute_collection');
118
+ // Static columns that are not attributes
119
+ $results = $this->_getStaticAttributes();
120
+
121
+ $customerAddressAttributes = Mage::getResourceModel('customer/address_attribute_collection');
122
+
123
+ $customerOptions = $this->_getAttributesOptions($customerAttributes, 'customer');
124
+ $customerAddressOptions = $this->_getAttributesOptions($customerAddressAttributes, 'customer_address');
125
+
126
+ $results = array_merge($results, $customerOptions, $customerAddressOptions);
127
+
128
+ uasort($results, function($a, $b) {
129
+ return $a['label'] > $b['label'];
130
+ });
131
+
132
+ $helper = Mage::helper('dndinxmail_subscriber');
133
+ $groupedOptions = array(
134
+ Inx_Api_Recipient_Attribute::DATA_TYPE_DATE => array(
135
+ 'label' => $helper->__('Type Date'),
136
+ 'value' => array(),
137
+ ),
138
+ Inx_Api_Recipient_Attribute::DATA_TYPE_DOUBLE => array(
139
+ 'label' => $helper->__('Type Float'),
140
+ 'value' => array(),
141
+ ),
142
+ Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER => array(
143
+ 'label' => $helper->__('Type Integer'),
144
+ 'value' => array(),
145
+ ),
146
+ Inx_Api_Recipient_Attribute::DATA_TYPE_STRING => array(
147
+ 'label' => $helper->__('Type Text'),
148
+ 'value' => array(),
149
+ ),
150
+ Inx_Api_Recipient_Attribute::DATA_TYPE_BOOLEAN => array(
151
+ 'label' => $helper->__('Type Yes/No'),
152
+ 'value' => array(),
153
+ ),
154
+ );
155
+
156
+ foreach ($results as $result) {
157
+ $groupedOptions[$result['params']['data-type']]['value'][] = $result;
158
+ }
159
+
160
+ foreach ($groupedOptions as $type => $groupedOption) {
161
+ if (!count($groupedOption['value'])) {
162
+ unset($groupedOptions[$type]);
163
+ }
164
+ }
165
+
166
+ array_unshift(
167
+ $groupedOptions,
168
+ array(
169
+ 'label' => $helper->__('Please select value'),
170
+ 'value' => '',
171
+ )
172
+ );
173
+
174
+ $this->_options = $groupedOptions;
175
+ }
176
+
177
+ return $this->_options;
178
+ }
179
+
180
+
181
+ /**
182
+ * @param $attributes
183
+ * @param $attributeType
184
+ *
185
+ * @return array
186
+ */
187
+ public function _getAttributesOptions($attributes, $attributeType)
188
+ {
189
+ $typeMapping = $this->getTypeMapping();
190
+ $results = array();
191
+
192
+ foreach ($attributes as $attribute) {
193
+ $code = $attribute->getAttributeCode();
194
+ if (in_array($code, $this->_attributesToSkip[$attributeType])) {
195
+ continue;
196
+ }
197
+ // Region id should be excluded to have only one region in list. Later we will check both as exclusion
198
+ // from general behavior
199
+ if ($code == 'region_id') {
200
+ continue;
201
+ }
202
+ $label = $attribute->getFrontendLabel();
203
+ $backendType = $attribute->getBackendType();
204
+ if ($backendType == 'static') {
205
+ continue;
206
+ } elseif ($attribute->getFrontendInput() == 'boolean') {
207
+ $type = Inx_Api_Recipient_Attribute::DATA_TYPE_BOOLEAN;
208
+ } elseif ($attribute->getFrontendInput() == 'select' || $attribute->getFrontendInput() == 'multiselect') {
209
+ $type = Inx_Api_Recipient_Attribute::DATA_TYPE_STRING;
210
+ } else {
211
+ $type = $typeMapping[$backendType];
212
+ }
213
+ if (!$label) {
214
+ $label .= $code;
215
+ }
216
+ $results[] = array(
217
+ 'label' => $label,
218
+ 'value' => sprintf('%s:%s', $attributeType, $code),
219
+ 'params' => array(
220
+ 'data-type' => $type,
221
+ ),
222
+ );
223
+ }
224
+
225
+ return $results;
226
+ }
227
+
228
+
229
+ /**
230
+ * @return array
231
+ */
232
+ static public function getTypeMapping()
233
+ {
234
+ return array(
235
+ 'varchar' => Inx_Api_Recipient_Attribute::DATA_TYPE_STRING,
236
+ 'datetime' => Inx_Api_Recipient_Attribute::DATA_TYPE_DATE,
237
+ 'int' => Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER,
238
+ 'text' => Inx_Api_Recipient_Attribute::DATA_TYPE_STRING,
239
+ 'decimal' => Inx_Api_Recipient_Attribute::DATA_TYPE_DOUBLE,
240
+ );
241
+ }
242
+ }
243
+
244
+
app/code/community/DndInxmail/Subscriber/Model/Adminhtml/System/Config/Source/Inxmail/GroupedColumns.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Module Model
5
+ * @package DndInxmail_Subscriber
6
+ * @dev Alexander Velykzhanin
7
+ * @last_modified 29/07/2015
8
+ * @copyright Copyright (c) 2015 Flagbit GmbH & Co. KG
9
+ * @author Flagbit GmbH & Co. KG : https://www.flagbit.de/
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
+ */
12
+ class DndInxmail_Subscriber_Model_Adminhtml_System_Config_Source_Inxmail_GroupedColumns
13
+ extends DndInxmail_Subscriber_Model_Adminhtml_System_Config_Source_Inxmail_Columns
14
+ {
15
+
16
+
17
+ /**
18
+ * Get all Inxmail Columns
19
+ *
20
+ * @return array Inxmail lists
21
+ */
22
+ public function toOptionArray()
23
+ {
24
+ if (!$this->_options) {
25
+ $options = parent::toOptionArray();
26
+
27
+ $helper = Mage::helper('dndinxmail_subscriber');
28
+
29
+ $groupedOptions = array(
30
+ array(
31
+ 'label' => $helper->__('Please select column'),
32
+ 'value' => '',
33
+ ),
34
+ Inx_Api_Recipient_Attribute::DATA_TYPE_DATE => array(
35
+ 'label' => $helper->__('Type Date'),
36
+ 'value' => array(),
37
+ ),
38
+ Inx_Api_Recipient_Attribute::DATA_TYPE_DOUBLE => array(
39
+ 'label' => $helper->__('Type Float'),
40
+ 'value' => array(),
41
+ ),
42
+ Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER => array(
43
+ 'label' => $helper->__('Type Integer'),
44
+ 'value' => array(),
45
+ ),
46
+ Inx_Api_Recipient_Attribute::DATA_TYPE_STRING => array(
47
+ 'label' => $helper->__('Type Text'),
48
+ 'value' => array(),
49
+ ),
50
+ Inx_Api_Recipient_Attribute::DATA_TYPE_BOOLEAN => array(
51
+ 'label' => $helper->__('Type Yes/No'),
52
+ 'value' => array(),
53
+ ),
54
+ );
55
+
56
+ foreach ($options as $option) {
57
+ if (!array_key_exists($option['type'], $groupedOptions)) {
58
+ continue;
59
+ }
60
+ $groupedOptions[$option['type']]['value'][] = array(
61
+ 'value' => $option['value'],
62
+ 'label' => $option['label'],
63
+ 'params' => array(
64
+ 'data-type' => $option['type'],
65
+ ),
66
+ );
67
+ }
68
+
69
+ foreach ($groupedOptions as $type => $groupedOption) {
70
+ if (is_array($groupedOption['value']) && !count($groupedOption['value'])) {
71
+ unset($groupedOptions[$type]);
72
+ }
73
+ }
74
+
75
+ $this->_options = $groupedOptions;
76
+ }
77
+
78
+ return $this->_options;
79
+ }
80
+
81
+ }
app/code/community/DndInxmail/Subscriber/Model/Resource/Newsletter/Subscriber.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class DndInxmail_Subscriber_Model_Resource_Newsletter_Subscriber extends Mage_Newsletter_Model_Resource_Subscriber
4
+ {
5
+
6
+
7
+ /**
8
+ * Load subscriber from DB by email
9
+ *
10
+ * @param string $subscriberEmail
11
+ * @return array
12
+ */
13
+ public function loadByEmail($subscriberEmail)
14
+ {
15
+ $storeId = Mage::app()->getStore()->getId();
16
+
17
+ $select = $this->_read->select()
18
+ ->from($this->getMainTable())
19
+ ->where('subscriber_email=:subscriber_email')
20
+ ->where('store_id=:store_id'); // Add store ID for newsletters
21
+
22
+ $result = $this->_read->fetchRow($select, array(
23
+ 'subscriber_email' => $subscriberEmail,
24
+ 'store_id' => $storeId
25
+ ));
26
+
27
+ if (!$result) {
28
+ return array();
29
+ }
30
+
31
+ return $result;
32
+ }
33
+
34
+ /**
35
+ * Load subscriber by customer
36
+ *
37
+ * @param Mage_Customer_Model_Customer $customer
38
+ * @return array
39
+ */
40
+ public function loadByCustomer(Mage_Customer_Model_Customer $customer)
41
+ {
42
+ $select = $this->_read->select()
43
+ ->from($this->getMainTable())
44
+ ->where('customer_id=:customer_id')
45
+ ->where('store_id=:store_id');
46
+
47
+ $storeId = Mage::app()->getStore()->getId();
48
+ if ($storeId == Mage_Core_Model_App::ADMIN_STORE_ID) {
49
+ $storeId = $customer->getStoreId();
50
+ }
51
+
52
+ $result = $this->_read->fetchRow($select, array(
53
+ 'customer_id' => $customer->getId(),
54
+ 'store_id' => $storeId,
55
+ ));
56
+
57
+ if ($result) {
58
+ return $result;
59
+ }
60
+
61
+ $select = $this->_read->select()
62
+ ->from($this->getMainTable())
63
+ ->where('subscriber_email=:subscriber_email')
64
+ ->where('store_id=:store_id');
65
+
66
+ $result = $this->_read->fetchRow($select, array(
67
+ 'subscriber_email' => $customer->getEmail(),
68
+ 'store_id' => $storeId
69
+ ));
70
+
71
+ if ($result) {
72
+ return $result;
73
+ }
74
+
75
+ return array();
76
+ }
77
+
78
+ }
app/code/community/DndInxmail/Subscriber/controllers/Adminhtml/InxmailNotificationController.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Module Controller
5
+ * @package DndInxmail_Subscriber
6
+ * @dev Alexander Velykzhanin
7
+ * @last_modified 26/08/2015
8
+ * @copyright Copyright (c) 2015 Flagbit GmbH & Co. KG
9
+ * @author Flagbit GmbH & Co. KG : https://www.flagbit.de/
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
+ */
12
+ class DndInxmail_Subscriber_Adminhtml_InxmailNotificationController extends Mage_Adminhtml_Controller_Action
13
+ {
14
+
15
+
16
+ protected $_publicActions = array('removeNotification');
17
+
18
+
19
+ protected function _isAllowed()
20
+ {
21
+ return true;
22
+ }
23
+
24
+
25
+ /**
26
+ * Remove admin notification
27
+ */
28
+ public function removeNotificationAction()
29
+ {
30
+ $config = new Mage_Core_Model_Config();
31
+ $emptyJson = Mage::helper('core')->jsonEncode(array());
32
+ $config->saveConfig(DndInxmail_Subscriber_Helper_Synchronize::DND_INXMAIL_ADMIN_NOTIFICATION, $emptyJson);
33
+ $config->cleanCache();
34
+
35
+ $this->_redirectReferer();
36
+ }
37
+ }
38
+
app/code/community/DndInxmail/Subscriber/controllers/SynchronizeController.php CHANGED
@@ -39,8 +39,13 @@ class DndInxmail_Subscriber_SynchronizeController extends Mage_Core_Controller_F
39
 
40
  try {
41
  $unsubscribedStore = $synchronize->getUnsubscribedCustomers($store->getStoreId());
 
 
 
 
42
  $synchronize->unsubscribeCustomersFromInxmail($unsubscribedStore);
43
  $synchronize->unsubscribeCustomersFromGroups();
 
44
  }
45
  catch (Exception $e) {
46
  $message = Mage::helper('dndinxmail_subscriber')->__('Error synchronizing unsubscribed customers from Inxmail');
@@ -114,7 +119,7 @@ class DndInxmail_Subscriber_SynchronizeController extends Mage_Core_Controller_F
114
  $pass = Zend_Json::decode($pass);
115
 
116
  if ($data['failed'] == 'false') {
117
-
118
  try {
119
 
120
  foreach ($pass as $subscriber) {
39
 
40
  try {
41
  $unsubscribedStore = $synchronize->getUnsubscribedCustomers($store->getStoreId());
42
+
43
+ // Emulate store that is synchronized to get correct email subscription by store
44
+ $appEmulation = Mage::getSingleton('core/app_emulation');
45
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($store->getStoreId());
46
  $synchronize->unsubscribeCustomersFromInxmail($unsubscribedStore);
47
  $synchronize->unsubscribeCustomersFromGroups();
48
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
49
  }
50
  catch (Exception $e) {
51
  $message = Mage::helper('dndinxmail_subscriber')->__('Error synchronizing unsubscribed customers from Inxmail');
119
  $pass = Zend_Json::decode($pass);
120
 
121
  if ($data['failed'] == 'false') {
122
+ $synchronize->doMappingCheck();
123
  try {
124
 
125
  foreach ($pass as $subscriber) {
app/code/community/DndInxmail/Subscriber/etc/config.xml CHANGED
@@ -13,7 +13,7 @@
13
  <config>
14
  <modules>
15
  <DndInxmail_Subscriber>
16
- <version>3.1.0.3</version>
17
  </DndInxmail_Subscriber>
18
  </modules>
19
  <global>
@@ -21,7 +21,22 @@
21
  <dndinxmail_subscriber>
22
  <class>DndInxmail_Subscriber_Model</class>
23
  </dndinxmail_subscriber>
 
 
 
 
 
24
  </models>
 
 
 
 
 
 
 
 
 
 
25
  <blocks>
26
  <dndinxmail_subscriber>
27
  <class>DndInxmail_Subscriber_Block</class>
13
  <config>
14
  <modules>
15
  <DndInxmail_Subscriber>
16
+ <version>3.1.0.5</version>
17
  </DndInxmail_Subscriber>
18
  </modules>
19
  <global>
21
  <dndinxmail_subscriber>
22
  <class>DndInxmail_Subscriber_Model</class>
23
  </dndinxmail_subscriber>
24
+ <newsletter_resource>
25
+ <rewrite>
26
+ <subscriber>DndInxmail_Subscriber_Model_Resource_Newsletter_Subscriber</subscriber>
27
+ </rewrite>
28
+ </newsletter_resource>
29
  </models>
30
+
31
+ <resources>
32
+ <dndinxmail_subscriber_setup>
33
+ <setup>
34
+ <module>DndInxmail_Subscriber</module>
35
+ <class>Mage_Customer_Model_Resource_Setup</class>
36
+ </setup>
37
+ </dndinxmail_subscriber_setup>
38
+ </resources>
39
+
40
  <blocks>
41
  <dndinxmail_subscriber>
42
  <class>DndInxmail_Subscriber_Block</class>
app/code/community/DndInxmail/Subscriber/etc/system.xml CHANGED
@@ -134,126 +134,34 @@
134
  <show_in_website>1</show_in_website>
135
  <show_in_store>0</show_in_store>
136
  <fields>
137
- <entity_id>
138
- <label>Customer ID</label>
139
- <frontend_type>select</frontend_type>
140
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_int</source_model>
141
  <sort_order>10</sort_order>
142
  <show_in_default>1</show_in_default>
143
  <show_in_website>1</show_in_website>
144
- <show_in_store>1</show_in_store>
145
- <comment>Type Integer</comment>
146
- </entity_id>
147
- <prefix>
148
- <label>Prefix</label>
149
- <frontend_type>select</frontend_type>
150
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_text</source_model>
151
- <sort_order>15</sort_order>
152
- <show_in_default>1</show_in_default>
153
- <show_in_website>1</show_in_website>
154
- <show_in_store>1</show_in_store>
155
- <comment>Type Text</comment>
156
- </prefix>
157
- <gender>
158
- <label>Gender</label>
159
- <frontend_type>select</frontend_type>
160
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_text</source_model>
161
- <sort_order>16</sort_order>
162
- <show_in_default>1</show_in_default>
163
- <show_in_website>1</show_in_website>
164
- <show_in_store>1</show_in_store>
165
- <comment>Type Text</comment>
166
- </gender>
167
- <firstname>
168
- <label>Firstname</label>
169
- <frontend_type>select</frontend_type>
170
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_text</source_model>
171
- <sort_order>20</sort_order>
172
- <show_in_default>1</show_in_default>
173
- <show_in_website>1</show_in_website>
174
- <show_in_store>1</show_in_store>
175
- <comment>Type Text</comment>
176
- </firstname>
177
- <lastname>
178
- <label>Lastname</label>
179
- <frontend_type>select</frontend_type>
180
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_text</source_model>
181
- <sort_order>30</sort_order>
182
- <show_in_default>1</show_in_default>
183
- <show_in_website>1</show_in_website>
184
- <show_in_store>1</show_in_store>
185
- <comment>Type Text</comment>
186
- </lastname>
187
- <dob>
188
- <label>Date Of Birth</label>
189
- <frontend_type>select</frontend_type>
190
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_dateonly</source_model>
191
- <sort_order>35</sort_order>
192
- <show_in_default>1</show_in_default>
193
- <show_in_website>1</show_in_website>
194
- <show_in_store>1</show_in_store>
195
- <comment>Type Date only</comment>
196
- </dob>
197
- <group_id>
198
- <label>Group ID</label>
199
- <frontend_type>select</frontend_type>
200
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_int</source_model>
201
- <sort_order>40</sort_order>
202
- <show_in_default>1</show_in_default>
203
- <show_in_website>1</show_in_website>
204
- <show_in_store>1</show_in_store>
205
- <comment>Type Integer</comment>
206
- </group_id>
207
- <website_id>
208
- <label>Website ID</label>
209
- <frontend_type>select</frontend_type>
210
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_int</source_model>
211
- <sort_order>50</sort_order>
212
- <show_in_default>1</show_in_default>
213
- <show_in_website>1</show_in_website>
214
- <show_in_store>1</show_in_store>
215
- <comment>Type Integer</comment>
216
- </website_id>
217
- <store_id>
218
- <label>Store ID</label>
219
- <frontend_type>select</frontend_type>
220
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_int</source_model>
221
- <sort_order>60</sort_order>
222
- <show_in_default>1</show_in_default>
223
- <show_in_website>1</show_in_website>
224
- <show_in_store>1</show_in_store>
225
- <comment>Type Integer</comment>
226
- </store_id>
227
- <created_at>
228
- <label>Creation Date</label>
229
- <frontend_type>select</frontend_type>
230
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_dateonly</source_model>
231
- <sort_order>70</sort_order>
232
- <show_in_default>1</show_in_default>
233
- <show_in_website>1</show_in_website>
234
- <show_in_store>1</show_in_store>
235
- <comment>Type Date only</comment>
236
- </created_at>
237
- <updated_at>
238
- <label>Update Date</label>
239
- <frontend_type>select</frontend_type>
240
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_dateonly</source_model>
241
- <sort_order>80</sort_order>
242
- <show_in_default>1</show_in_default>
243
- <show_in_website>1</show_in_website>
244
- <show_in_store>1</show_in_store>
245
- <comment>Type Date only</comment>
246
- </updated_at>
247
- <is_active>
248
- <label>Customer is active</label>
249
- <frontend_type>select</frontend_type>
250
- <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_columns_type_yesno</source_model>
251
- <sort_order>90</sort_order>
252
- <show_in_default>1</show_in_default>
253
- <show_in_website>1</show_in_website>
254
- <show_in_store>1</show_in_store>
255
- <comment>Type Yes/No</comment>
256
- </is_active>
257
  </fields>
258
  </mapping_customer>
259
  <mapping_dynamics>
134
  <show_in_website>1</show_in_website>
135
  <show_in_store>0</show_in_store>
136
  <fields>
137
+ <mapping>
138
+ <label>Mapping</label>
139
+ <frontend_model>dndinxmail_subscriber/adminhtml_system_config_form_field_payment</frontend_model>
140
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
141
  <sort_order>10</sort_order>
142
  <show_in_default>1</show_in_default>
143
  <show_in_website>1</show_in_website>
144
+ <show_in_store>0</show_in_store>
145
+ <button_label>Add mapping</button_label>
146
+ <columns>
147
+ <![CDATA[
148
+ <fields>
149
+ <attribute_code>
150
+ <type>select</type>
151
+ <label>Customer Attribute</label>
152
+ <source_model>dndinxmail_subscriber/adminhtml_system_config_source_customer_attributes</source_model>
153
+ <style>width:240px</style>
154
+ </attribute_code>
155
+ <inxmail_column>
156
+ <type>select</type>
157
+ <label>Inxmail Column</label>
158
+ <source_model>dndinxmail_subscriber/adminhtml_system_config_source_inxmail_groupedColumns</source_model>
159
+ <style>width:240px</style>
160
+ </inxmail_column>
161
+ </fields>
162
+ ]]>
163
+ </columns>
164
+ </mapping>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  </fields>
166
  </mapping_customer>
167
  <mapping_dynamics>
app/code/community/DndInxmail/Subscriber/sql/dndinxmail_subscriber_setup/mysql4-upgrade-3.1.0.4-3.1.1.0.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /** @var Mage_Core_Model_Resource_Setup $installer */
4
+ $installer = $this;
5
+
6
+ $installer->startSetup();
7
+
8
+ $customerAttributes = array(
9
+ 'entity_id',
10
+ 'website_id',
11
+ 'group_id',
12
+ 'store_id',
13
+ 'created_at',
14
+ 'updated_at',
15
+ 'is_active',
16
+ 'prefix',
17
+ 'firstname',
18
+ 'lastname',
19
+ 'gender',
20
+ 'dob'
21
+ );
22
+
23
+ $config = new Mage_Core_Model_Config();
24
+
25
+ /** @var Mage_Core_Model_Resource_Config_Data_Collection $configCollection */
26
+ $configCollection = Mage::getModel('core/config_data')->getCollection();
27
+ $configCollection->addPathFilter('dndinxmail_subscriber_mapping/mapping_customer');
28
+
29
+ $mapping = array();
30
+ $defaultMapping = array();
31
+ foreach ($configCollection as $configItem) {
32
+ // If value is null or empty we do not set it
33
+ if (!$configItem->getValue()) {
34
+ continue;
35
+ }
36
+
37
+ $dividedConfigPath = explode('/', $configItem->getPath());
38
+ // Get attribute code
39
+ $path = end($dividedConfigPath);
40
+
41
+ if ($configItem->getScope() == 'default') {
42
+ $defaultMapping[$path] = $configItem->getValue();
43
+ } elseif ($configItem->getScope() == 'websites') {
44
+ $scopeId = $configItem->getScopeId();
45
+ if (!array_key_exists($scopeId, $mapping)) {
46
+ $mapping[$scopeId] = array();
47
+ }
48
+ $mapping[$scopeId][$path] = $configItem->getValue();
49
+ }
50
+ }
51
+
52
+ // Set values from default configuration if they were not set for website
53
+ foreach ($mapping as $websiteId => $websiteMapping) {
54
+ foreach ($defaultMapping as $attributeCode => $inxmailColumn) {
55
+ if (!array_key_exists($attributeCode, $websiteMapping)) {
56
+ $mapping[$websiteId][$attributeCode] = $defaultMapping[$attributeCode];
57
+ }
58
+ }
59
+ }
60
+
61
+ $newMappingConfigPath = 'dndinxmail_subscriber_mapping/mapping_customer/mapping';
62
+
63
+ // Save default mapping
64
+ $mappingToSave = array();
65
+ foreach ($defaultMapping as $attributeCode => $inxmailColumn) {
66
+ $mappingToSave[] = array(
67
+ 'attribute_code' => 'customer:' . $attributeCode,
68
+ 'inxmail_column' => $inxmailColumn,
69
+ );
70
+ }
71
+ if (!empty($mappingToSave)) {
72
+ $config->saveConfig($newMappingConfigPath, serialize($mappingToSave));
73
+ }
74
+
75
+ // Save mappings per websites
76
+ foreach ($mapping as $websiteId => $websiteMapping) {
77
+ $mappingToSave = array();
78
+ foreach ($websiteMapping as $attributeCode => $inxmailColumn) {
79
+ $mappingToSave[] = array(
80
+ 'attribute_code' => 'customer:' . $attributeCode,
81
+ 'inxmail_column' => $inxmailColumn,
82
+ );
83
+ }
84
+ if (!empty($mappingToSave)) {
85
+ $config->saveConfig($newMappingConfigPath, serialize($mappingToSave), 'websites', $websiteId);
86
+ }
87
+ }
88
+
89
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/dndinxmail.xml CHANGED
@@ -5,4 +5,10 @@
5
  <block type="adminhtml/template" name="dndinxmail_form" template="dndinxmail/subscriber/system/inxmail/columns.phtml" />
6
  </reference>
7
  </adminhtml_inxmailcolumns_new>
 
 
 
 
 
 
8
  </layout>
5
  <block type="adminhtml/template" name="dndinxmail_form" template="dndinxmail/subscriber/system/inxmail/columns.phtml" />
6
  </reference>
7
  </adminhtml_inxmailcolumns_new>
8
+
9
+ <default>
10
+ <reference name="notifications">
11
+ <block type="dndinxmail_subscriber/adminhtml_notifications" name="dndinxmail_notifications" template="dndinxmail/subscriber/notifications.phtml" />
12
+ </reference>
13
+ </default>
14
  </layout>
app/design/adminhtml/default/default/template/dndinxmail/subscriber/notifications.phtml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $messages = $this->getMessages(); ?>
2
+ <?php if (count($messages)): ?>
3
+ <div class="notification-global">
4
+ <?php echo $this->__('INXMAIL: Errors in mapping:'); ?>
5
+ <div class="f-right"><a href="<?php echo $this->getUrl('adminhtml/inxmailNotification/removeNotification'); ?>"><?php echo $this->__('Remove'); ?></a></div>
6
+ <ul>
7
+ <?php foreach ($messages as $message): ?>
8
+ <li><?php echo $message; ?></li>
9
+ <?php endforeach; ?>
10
+ </ul>
11
+ </div>
12
+ <?php endif; ?>
lib/Inx/Api/APIException.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * <i>Inx_Api_APIException</i> is the runtime exception that can be thrown during the normal operation of the API.
7
- *
8
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
9
- * @package Inxmail
10
- */
11
- class Inx_Api_APIException extends Exception
12
- {
13
- /**
14
- * @var Exception the original exception that was thrown.
15
- */
16
- public $oCause = null;
17
-
18
- /**
19
- * Constructs a new api runtime exception with the specified detail message.
20
- *
21
- * @param string $sMsg the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
22
- * @param Exception $oCause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt>
23
- * value is permitted, and indicates that the cause is nonexistent or unknown.)
24
- */
25
- function __construct($sMsg, Exception $oCause = null) {
26
- parent::__construct($sMsg);
27
- $this->oCause = $oCause;
28
- }
29
-
30
- /**
31
- * Returns the original exception.
32
- *
33
- * @return Exception the original exception.
34
- */
35
- public function getCause()
36
- {
37
- return $this->oCause;
38
- }
39
-
40
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * <i>Inx_Api_APIException</i> is the runtime exception that can be thrown during the normal operation of the API.
7
+ *
8
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
9
+ * @package Inxmail
10
+ */
11
+ class Inx_Api_APIException extends Exception
12
+ {
13
+ /**
14
+ * @var Exception the original exception that was thrown.
15
+ */
16
+ public $oCause = null;
17
+
18
+ /**
19
+ * Constructs a new api runtime exception with the specified detail message.
20
+ *
21
+ * @param string $sMsg the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
22
+ * @param Exception $oCause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt>
23
+ * value is permitted, and indicates that the cause is nonexistent or unknown.)
24
+ */
25
+ function __construct($sMsg, Exception $oCause = null) {
26
+ parent::__construct($sMsg);
27
+ $this->oCause = $oCause;
28
+ }
29
+
30
+ /**
31
+ * Returns the original exception.
32
+ *
33
+ * @return Exception the original exception.
34
+ */
35
+ public function getCause()
36
+ {
37
+ return $this->oCause;
38
+ }
39
+
40
  }
lib/Inx/Api/Action/Action.php CHANGED
@@ -1,180 +1,180 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * An <i>Inx_Api_Action_Action</i> is a powerful tool which can manipulate or send a mail to a recipient for which
8
- * an event has occurred. To do so, an <i>Inx_Api_Action_Action</i> has a list of commands that will be executed
9
- * when the event occurs. Using this pattern, complex actions may be created. An <i>Inx_Api_Action_Action</i> could,
10
- * for example, be configured to respond automatically to flame mails.
11
- * <p>
12
- * <i>Inx_Api_Action_Action</i>s can be accessed using the <i>Inx_Api_Action_ActionManager</i>.
13
- * <p>
14
- * The different types of commands are:
15
- * <ul>
16
- * <li><i>Inx_Api_Action_DeleteRecipientCommand</i> - Permanently remove the recipient.
17
- * <li><i>Inx_Api_Action_SendMailCommand</i> - Send a mailing to the recipient.
18
- * <li><i>Inx_Api_Action_SendActionMailCommand</i> - Send an action mailing to the recipient.
19
- * <li><i>Inx_Api_Action_SetValueCommand</i> - Set an attribute value of the recipient.
20
- * <li><i>Inx_Api_Action_SubscriptionCommand</i> - Subscribe the recipient.
21
- * <li><i>Inx_Api_Action_UnsubscriptionCommand</i> - Unsubscribe the recipient.
22
- * </ul>
23
- * These commands are created by the <i>Inx_Api_Action_CommandFactory</i> which can be obtained from the
24
- * <i>Inx_Api_Action_ActionManager</i>.
25
- * <p>
26
- * There are different event types which are triggered by inxmail.
27
- * <p>
28
- * System-wide events (the owner is the SystemListContext):
29
- * <ul>
30
- * <li>EVENT_TYPE_CLICK - A link in an email is clicked.
31
- * <li>EVENT_TYPE_HARD_BOUNCE - A hard bounce mail is received.
32
- * <li>EVENT_TYPE_SOFT_BOUNCE - A soft bounce mail is received.
33
- * <li>EVENT_TYPE_UNKNOWN_BOUNCE - An unknown mail is detected through the bounce mailbox.
34
- * <li>EVENT_TYPE_AUTO_RESPONDER_BOUNCE - An auto-responder mail is received through the bounce mailbox.
35
- * <li>EVENT_TYPE_AUTO_RESPONDER_REPLY - An auto-responder mail is received through the normal mailbox.
36
- * <li>EVENT_TYPE_FLAME_REPLY - A flame mail is received through the normal mailbox.
37
- * <li>EVENT_TYPE_UNKNOWN_REPLY - An unknown mail is detected through the normal mailbox.
38
- * </ul>
39
- * <p>
40
- * ListContext-specific events (the owner is a StandardListContext or a FilterListContext):
41
- * <ul>
42
- * <li>EVENT_TYPE_NEWSLETTER_SENT - A newsletter was sent.
43
- * <li>EVENT_TYPE_SINGLE_MAIL_SENT - A single mail was sent.
44
- * <li>EVENT_TYPE_SUBSCRIBE - A recipient was successfully subscribed.
45
- * <li>EVENT_TYPE_UNSUBSCRIBE - A recipient was successfully unsubscribed.
46
- * </ul>
47
- * <p>
48
- * Note: The usage of <i>Inx_Api_Action_Action</i>s requires the api user right: <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
49
- * <p>
50
- * For an example on how to use actions, see the <i>Inx_Api_Action_ActionManager</i> documentation.
51
- *
52
- * @see Inx_Api_Action_Command
53
- * @see Inx_Api_Action_ActionManager
54
- * @since API 1.2.0
55
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
56
- * @package Inxmail
57
- * @subpackage Action
58
- */
59
- interface Inx_Api_Action_Action extends Inx_Api_BusinessObject
60
- {
61
- /**
62
- * Constant for the name attribute.
63
- * Used by the <code>UpdateException</code> to indicate the error source.
64
- */
65
- const ATTRIBUTE_NAME = 0;
66
-
67
- /**
68
- * Constant for the event type attribute.
69
- * Used by the <code>UpdateException</code> to indicate the error source.
70
- */
71
- const ATTRIBUTE_EVENT_TYPE = 1;
72
-
73
- /**
74
- * Constant for the list context attribute.
75
- * Used by the <code>UpdateException</code> to indicate the error source.
76
- */
77
- const ATTRIBUTE_LIST_CONTEXT_ID = 2;
78
-
79
- /**
80
- * Constant for the commands attribute.
81
- * Used by the <code>UpdateException</code> to indicate the error source.
82
- */
83
- const ATTRIBUTE_COMMANDS = 3;
84
-
85
-
86
- /** Constant for event type: CLICK - A link in an email is clicked. */
87
- const EVENT_TYPE_CLICK = 1;
88
-
89
- /** Constant for event type: NEWSLETTER_SENT - A newsletter was sent. */
90
- const EVENT_TYPE_NEWSLETTER_SENT = 10;
91
-
92
- /** Constant for event type: SINGLE_MAIL_SENT - A single mail was sent. */
93
- const EVENT_TYPE_SINGLE_MAIL_SENT = 11;
94
-
95
- /** Constant for event type: HARD_BOUNCE - A hard bounce mail is received. */
96
- const EVENT_TYPE_HARD_BOUNCE = 20;
97
-
98
- /** Constant for event type: SOFT_BOUNCE - A soft bounce mail is received. */
99
- const EVENT_TYPE_SOFT_BOUNCE = 21;
100
-
101
- /** Constant for event type: UNKNOWN_BOUNCE - An unknown mail is detected through the bounce mailbox. */
102
- const EVENT_TYPE_UNKNOWN_BOUNCE = 22;
103
-
104
- /** Constant for event type: AUTO_RESPONDER_BOUNCE - An auto-responder mail is received through the bounce mailbox. */
105
- const EVENT_TYPE_AUTO_RESPONDER_BOUNCE = 23;
106
-
107
- /** Constant for event type: AUTO_RESPONDER_REPLY - An auto-responder mail is received through the normal mailbox. */
108
- const EVENT_TYPE_AUTO_RESPONDER_REPLY = 30;
109
-
110
- /** Constant for event type: FLAME_REPLY - A flame mail is received through the normal mailbox. */
111
- const EVENT_TYPE_FLAME_REPLY = 31;
112
-
113
- /** Constant for event type: UNKNOWN_REPLY - An unknown mail is detected through the normal mailbox. */
114
- const EVENT_TYPE_UNKNOWN_REPLY = 32;
115
-
116
- /** Constant for event type: SUBSCRIBE - A recipient was successfully subscribed. */
117
- const EVENT_TYPE_SUBSCRIBE = 40;
118
-
119
- /** Constant for event type: UNSUBSCRIBE - A recipient was successfully unsubscribed. */
120
- const EVENT_TYPE_UNSUBSCRIBE = 41;
121
-
122
-
123
- /**
124
- * Returns the unique name of this action.
125
- *
126
- * @return string the unique name of this action.
127
- */
128
- public function getName();
129
-
130
-
131
- /**
132
- * Sets the name of this action.
133
- *
134
- * @param string $sName the unique name of this action.
135
- */
136
- public function updateName( $sName );
137
-
138
-
139
- /**
140
- * Returns the id of the list context which this action belongs to.
141
- *
142
- * @return int the id of the list context which this action belongs to.
143
- */
144
- public function getListContextId();
145
-
146
-
147
- /**
148
- * Returns the event type of this action.
149
- * Can be one of the event type constants defined in the <code>Action</code> interface.
150
- *
151
- * @return int the event type.
152
- */
153
- public function getEventType();
154
-
155
-
156
- /**
157
- * Sets the event type of this action.
158
- * Can be one of the event type constants defined in the <code>Action</code> interface.
159
- *
160
- * @param int $iEventType the event type.
161
- */
162
- public function updateEventType( $iEventType );
163
-
164
-
165
- /**
166
- * Returns the commands this action will execute on the specified event.
167
- *
168
- * @return array the commands.
169
- */
170
- public function getCommands();
171
-
172
-
173
- /**
174
- * Sets the commands this action will execute on the specified event.
175
- *
176
- * @param array $aCmds the commands.
177
- */
178
- public function updateCommands( $aCmds );
179
-
180
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Action_Action</i> is a powerful tool which can manipulate or send a mail to a recipient for which
8
+ * an event has occurred. To do so, an <i>Inx_Api_Action_Action</i> has a list of commands that will be executed
9
+ * when the event occurs. Using this pattern, complex actions may be created. An <i>Inx_Api_Action_Action</i> could,
10
+ * for example, be configured to respond automatically to flame mails.
11
+ * <p>
12
+ * <i>Inx_Api_Action_Action</i>s can be accessed using the <i>Inx_Api_Action_ActionManager</i>.
13
+ * <p>
14
+ * The different types of commands are:
15
+ * <ul>
16
+ * <li><i>Inx_Api_Action_DeleteRecipientCommand</i> - Permanently remove the recipient.
17
+ * <li><i>Inx_Api_Action_SendMailCommand</i> - Send a mailing to the recipient.
18
+ * <li><i>Inx_Api_Action_SendActionMailCommand</i> - Send an action mailing to the recipient.
19
+ * <li><i>Inx_Api_Action_SetValueCommand</i> - Set an attribute value of the recipient.
20
+ * <li><i>Inx_Api_Action_SubscriptionCommand</i> - Subscribe the recipient.
21
+ * <li><i>Inx_Api_Action_UnsubscriptionCommand</i> - Unsubscribe the recipient.
22
+ * </ul>
23
+ * These commands are created by the <i>Inx_Api_Action_CommandFactory</i> which can be obtained from the
24
+ * <i>Inx_Api_Action_ActionManager</i>.
25
+ * <p>
26
+ * There are different event types which are triggered by inxmail.
27
+ * <p>
28
+ * System-wide events (the owner is the SystemListContext):
29
+ * <ul>
30
+ * <li>EVENT_TYPE_CLICK - A link in an email is clicked.
31
+ * <li>EVENT_TYPE_HARD_BOUNCE - A hard bounce mail is received.
32
+ * <li>EVENT_TYPE_SOFT_BOUNCE - A soft bounce mail is received.
33
+ * <li>EVENT_TYPE_UNKNOWN_BOUNCE - An unknown mail is detected through the bounce mailbox.
34
+ * <li>EVENT_TYPE_AUTO_RESPONDER_BOUNCE - An auto-responder mail is received through the bounce mailbox.
35
+ * <li>EVENT_TYPE_AUTO_RESPONDER_REPLY - An auto-responder mail is received through the normal mailbox.
36
+ * <li>EVENT_TYPE_FLAME_REPLY - A flame mail is received through the normal mailbox.
37
+ * <li>EVENT_TYPE_UNKNOWN_REPLY - An unknown mail is detected through the normal mailbox.
38
+ * </ul>
39
+ * <p>
40
+ * ListContext-specific events (the owner is a StandardListContext or a FilterListContext):
41
+ * <ul>
42
+ * <li>EVENT_TYPE_NEWSLETTER_SENT - A newsletter was sent.
43
+ * <li>EVENT_TYPE_SINGLE_MAIL_SENT - A single mail was sent.
44
+ * <li>EVENT_TYPE_SUBSCRIBE - A recipient was successfully subscribed.
45
+ * <li>EVENT_TYPE_UNSUBSCRIBE - A recipient was successfully unsubscribed.
46
+ * </ul>
47
+ * <p>
48
+ * Note: The usage of <i>Inx_Api_Action_Action</i>s requires the api user right: <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
49
+ * <p>
50
+ * For an example on how to use actions, see the <i>Inx_Api_Action_ActionManager</i> documentation.
51
+ *
52
+ * @see Inx_Api_Action_Command
53
+ * @see Inx_Api_Action_ActionManager
54
+ * @since API 1.2.0
55
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
56
+ * @package Inxmail
57
+ * @subpackage Action
58
+ */
59
+ interface Inx_Api_Action_Action extends Inx_Api_BusinessObject
60
+ {
61
+ /**
62
+ * Constant for the name attribute.
63
+ * Used by the <code>UpdateException</code> to indicate the error source.
64
+ */
65
+ const ATTRIBUTE_NAME = 0;
66
+
67
+ /**
68
+ * Constant for the event type attribute.
69
+ * Used by the <code>UpdateException</code> to indicate the error source.
70
+ */
71
+ const ATTRIBUTE_EVENT_TYPE = 1;
72
+
73
+ /**
74
+ * Constant for the list context attribute.
75
+ * Used by the <code>UpdateException</code> to indicate the error source.
76
+ */
77
+ const ATTRIBUTE_LIST_CONTEXT_ID = 2;
78
+
79
+ /**
80
+ * Constant for the commands attribute.
81
+ * Used by the <code>UpdateException</code> to indicate the error source.
82
+ */
83
+ const ATTRIBUTE_COMMANDS = 3;
84
+
85
+
86
+ /** Constant for event type: CLICK - A link in an email is clicked. */
87
+ const EVENT_TYPE_CLICK = 1;
88
+
89
+ /** Constant for event type: NEWSLETTER_SENT - A newsletter was sent. */
90
+ const EVENT_TYPE_NEWSLETTER_SENT = 10;
91
+
92
+ /** Constant for event type: SINGLE_MAIL_SENT - A single mail was sent. */
93
+ const EVENT_TYPE_SINGLE_MAIL_SENT = 11;
94
+
95
+ /** Constant for event type: HARD_BOUNCE - A hard bounce mail is received. */
96
+ const EVENT_TYPE_HARD_BOUNCE = 20;
97
+
98
+ /** Constant for event type: SOFT_BOUNCE - A soft bounce mail is received. */
99
+ const EVENT_TYPE_SOFT_BOUNCE = 21;
100
+
101
+ /** Constant for event type: UNKNOWN_BOUNCE - An unknown mail is detected through the bounce mailbox. */
102
+ const EVENT_TYPE_UNKNOWN_BOUNCE = 22;
103
+
104
+ /** Constant for event type: AUTO_RESPONDER_BOUNCE - An auto-responder mail is received through the bounce mailbox. */
105
+ const EVENT_TYPE_AUTO_RESPONDER_BOUNCE = 23;
106
+
107
+ /** Constant for event type: AUTO_RESPONDER_REPLY - An auto-responder mail is received through the normal mailbox. */
108
+ const EVENT_TYPE_AUTO_RESPONDER_REPLY = 30;
109
+
110
+ /** Constant for event type: FLAME_REPLY - A flame mail is received through the normal mailbox. */
111
+ const EVENT_TYPE_FLAME_REPLY = 31;
112
+
113
+ /** Constant for event type: UNKNOWN_REPLY - An unknown mail is detected through the normal mailbox. */
114
+ const EVENT_TYPE_UNKNOWN_REPLY = 32;
115
+
116
+ /** Constant for event type: SUBSCRIBE - A recipient was successfully subscribed. */
117
+ const EVENT_TYPE_SUBSCRIBE = 40;
118
+
119
+ /** Constant for event type: UNSUBSCRIBE - A recipient was successfully unsubscribed. */
120
+ const EVENT_TYPE_UNSUBSCRIBE = 41;
121
+
122
+
123
+ /**
124
+ * Returns the unique name of this action.
125
+ *
126
+ * @return string the unique name of this action.
127
+ */
128
+ public function getName();
129
+
130
+
131
+ /**
132
+ * Sets the name of this action.
133
+ *
134
+ * @param string $sName the unique name of this action.
135
+ */
136
+ public function updateName( $sName );
137
+
138
+
139
+ /**
140
+ * Returns the id of the list context which this action belongs to.
141
+ *
142
+ * @return int the id of the list context which this action belongs to.
143
+ */
144
+ public function getListContextId();
145
+
146
+
147
+ /**
148
+ * Returns the event type of this action.
149
+ * Can be one of the event type constants defined in the <code>Action</code> interface.
150
+ *
151
+ * @return int the event type.
152
+ */
153
+ public function getEventType();
154
+
155
+
156
+ /**
157
+ * Sets the event type of this action.
158
+ * Can be one of the event type constants defined in the <code>Action</code> interface.
159
+ *
160
+ * @param int $iEventType the event type.
161
+ */
162
+ public function updateEventType( $iEventType );
163
+
164
+
165
+ /**
166
+ * Returns the commands this action will execute on the specified event.
167
+ *
168
+ * @return array the commands.
169
+ */
170
+ public function getCommands();
171
+
172
+
173
+ /**
174
+ * Sets the commands this action will execute on the specified event.
175
+ *
176
+ * @param array $aCmds the commands.
177
+ */
178
+ public function updateCommands( $aCmds );
179
+
180
+ }
lib/Inx/Api/Action/ActionManager.php CHANGED
@@ -1,97 +1,97 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * The <i>Inx_Api_Action_ActionManager</i> manages all actions.
8
- * The following snippet creates a new <i>Action</i> that sets the lastClick recipient attribute
9
- * (last time the recipient clicked a link) to the current date and increments the clickCount
10
- * recipient attribute (the number of clicks by the recipient):
11
- *
12
- * <PRE>
13
- * $oListContextManager = $oSession->getListContextManager();
14
- * $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
15
- *
16
- * $oRecipientMetaData = $session->createRecipientContext()->getMetaData();
17
- * $iLastClick = $oRecipientMetaData->getUserAttribute( &quot;lastClick&quot; )->getId();
18
- * $iClickCount = $oRecipientMetaData->getUserAttribute( &quot;clickCount&quot; )->getId();
19
- *
20
- * $oActionMgr = $oSession->getActionManager();
21
- *
22
- * $oAction = $oActionMgr->createAction( $oListContext );
23
- * $oAction->updateEventType( Inx_Api_Action_Action::EVENT_TYPE_CLICK );
24
- * $oAction->updateName( "Click-Registry" );
25
- *
26
- * $oCommandFactory = $oActionMgr->getCommandFactory();
27
- *
28
- * $aCmds = array();
29
- * $aCmds[] = $oCommandFactory->createSetValueCmd( $iLastClick, "=Date()" );
30
- * $aCmds[] = $oCommandFactory->createSetRelativeValueCmd( $iClickCount, 1 );
31
- *
32
- * $oAction->updateCommands( $aCmds );
33
- * $oAction->commitUpdate();
34
- * </PRE>
35
- *
36
- * <p>
37
- * Note: The recipient attributes referenced in the snippet are not standard attributes and must be created using the
38
- * <i>Inx_Api_Recipient_AttributeManager</i> before they may be used in the shown way.
39
- * <p>
40
- * Note: The usage of <i>Inx_Api_Action_Action</i>s requires the api user right: <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
41
- * <p>
42
- * For more information on actions (including event types), see the <i>Inx_Api_Action_Action</i> documentation.
43
- *
44
- * @see Inx_Api_Action_Action
45
- * @since API 1.2.0
46
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
47
- * @package Inxmail
48
- * @subpackage Action
49
- */
50
- interface Inx_Api_Action_ActionManager extends Inx_Api_BOManager
51
- {
52
-
53
- /**
54
- * Creates a new, empty action with the specified owning list. If the action is not list specific, the
55
- * system list context must be used. The following snippet retrieves the system list context:
56
- *
57
- * <PRE>
58
- * $oListContextManager = $oSession->getListContextManager();
59
- * $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
60
- * </PRE>
61
- *
62
- *
63
- * @param Inx_Api_List_ListContext $oListContext the list owning the action.
64
- * @return Inx_Api_Action_Action a new action.
65
- *
66
- */
67
- public function createAction( Inx_Api_List_ListContext $oListContext );
68
-
69
-
70
- /**
71
- * Selects all actions owned by the specified list context. To retrieve actions which are not list
72
- * specific, use the system list context. The following snippet retrieves the system list context:
73
- *
74
- * <PRE>
75
- * $oListContextManager = $oSession->getListContextManager();
76
- * $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
77
- * </PRE>
78
- *
79
- *
80
- * @paramInx_Api_List_ListContext|int $mListContext the list context (or list id) which owns the actions to retrieve.
81
- * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> object that contains the actions owned by the specified list.
82
- * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
83
- * <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
84
- */
85
- public function select( $mListContext );
86
-
87
-
88
- /**
89
- * Returns the factory used to create new commands.
90
- * <i>Inx_Api_Action_Command</i>s are executed by an <i>Inx_Api_Action</i> if the event associated with that
91
- * action is triggered.
92
- *
93
- * @return Inx_Api_Action_CommandFactory the command factory.
94
- */
95
- public function getCommandFactory();
96
-
97
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Action_ActionManager</i> manages all actions.
8
+ * The following snippet creates a new <i>Action</i> that sets the lastClick recipient attribute
9
+ * (last time the recipient clicked a link) to the current date and increments the clickCount
10
+ * recipient attribute (the number of clicks by the recipient):
11
+ *
12
+ * <PRE>
13
+ * $oListContextManager = $oSession->getListContextManager();
14
+ * $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
15
+ *
16
+ * $oRecipientMetaData = $session->createRecipientContext()->getMetaData();
17
+ * $iLastClick = $oRecipientMetaData->getUserAttribute( &quot;lastClick&quot; )->getId();
18
+ * $iClickCount = $oRecipientMetaData->getUserAttribute( &quot;clickCount&quot; )->getId();
19
+ *
20
+ * $oActionMgr = $oSession->getActionManager();
21
+ *
22
+ * $oAction = $oActionMgr->createAction( $oListContext );
23
+ * $oAction->updateEventType( Inx_Api_Action_Action::EVENT_TYPE_CLICK );
24
+ * $oAction->updateName( "Click-Registry" );
25
+ *
26
+ * $oCommandFactory = $oActionMgr->getCommandFactory();
27
+ *
28
+ * $aCmds = array();
29
+ * $aCmds[] = $oCommandFactory->createSetValueCmd( $iLastClick, "=Date()" );
30
+ * $aCmds[] = $oCommandFactory->createSetRelativeValueCmd( $iClickCount, 1 );
31
+ *
32
+ * $oAction->updateCommands( $aCmds );
33
+ * $oAction->commitUpdate();
34
+ * </PRE>
35
+ *
36
+ * <p>
37
+ * Note: The recipient attributes referenced in the snippet are not standard attributes and must be created using the
38
+ * <i>Inx_Api_Recipient_AttributeManager</i> before they may be used in the shown way.
39
+ * <p>
40
+ * Note: The usage of <i>Inx_Api_Action_Action</i>s requires the api user right: <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
41
+ * <p>
42
+ * For more information on actions (including event types), see the <i>Inx_Api_Action_Action</i> documentation.
43
+ *
44
+ * @see Inx_Api_Action_Action
45
+ * @since API 1.2.0
46
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
47
+ * @package Inxmail
48
+ * @subpackage Action
49
+ */
50
+ interface Inx_Api_Action_ActionManager extends Inx_Api_BOManager
51
+ {
52
+
53
+ /**
54
+ * Creates a new, empty action with the specified owning list. If the action is not list specific, the
55
+ * system list context must be used. The following snippet retrieves the system list context:
56
+ *
57
+ * <PRE>
58
+ * $oListContextManager = $oSession->getListContextManager();
59
+ * $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
60
+ * </PRE>
61
+ *
62
+ *
63
+ * @param Inx_Api_List_ListContext $oListContext the list owning the action.
64
+ * @return Inx_Api_Action_Action a new action.
65
+ *
66
+ */
67
+ public function createAction( Inx_Api_List_ListContext $oListContext );
68
+
69
+
70
+ /**
71
+ * Selects all actions owned by the specified list context. To retrieve actions which are not list
72
+ * specific, use the system list context. The following snippet retrieves the system list context:
73
+ *
74
+ * <PRE>
75
+ * $oListContextManager = $oSession->getListContextManager();
76
+ * $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
77
+ * </PRE>
78
+ *
79
+ *
80
+ * @paramInx_Api_List_ListContext|int $mListContext the list context (or list id) which owns the actions to retrieve.
81
+ * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> object that contains the actions owned by the specified list.
82
+ * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
83
+ * <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
84
+ */
85
+ public function select( $mListContext );
86
+
87
+
88
+ /**
89
+ * Returns the factory used to create new commands.
90
+ * <i>Inx_Api_Action_Command</i>s are executed by an <i>Inx_Api_Action</i> if the event associated with that
91
+ * action is triggered.
92
+ *
93
+ * @return Inx_Api_Action_CommandFactory the command factory.
94
+ */
95
+ public function getCommandFactory();
96
+
97
+ }
lib/Inx/Api/Action/Command.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * The <i>Inx_Api_Action_Command</i> interface identifies commands which are executed by an <i>Inx_Api_Action_Action</i>
8
- * when the event associated with the action is triggered.
9
- * <i>Inx_Api_Action_Command</i>s can be used to manipulate a recipient or to send a single mailing to that recipient.
10
- * <p>
11
- * The different types of commands are:
12
- * <ul>
13
- * <li><i>Inx_Api_Action_DeleteRecipientCommand</i> - Permanently remove the recipient.
14
- * <li><i>Inx_Api_Action_SendMailCommand</i> - Send a mailing to the recipient.
15
- * <li><i>Inx_Api_Action_SetValueCommand</i> - Set an attribute value of the recipient.
16
- * <li><i>Inx_Api_Action_SubscriptionCommand</i> - Subscribe the recipient.
17
- * <li><i>Inx_Api_Action_UnsubscriptionCommand</i> - Unsubscribe the recipient.
18
- * </ul>
19
- * <p>
20
- * For an example on how to use commands and actions, see the <i>Inx_Api_Action_ActionManager</i> documentation.
21
- *
22
- * @see Inx_Api_Action_Action
23
- * @see Inx_Api_Action_ActionManager
24
- * @since API 1.2.0
25
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
26
- * @package Inxmail
27
- * @subpackage Action
28
- */
29
- interface Inx_Api_Action_Command
30
- {
31
-
32
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Action_Command</i> interface identifies commands which are executed by an <i>Inx_Api_Action_Action</i>
8
+ * when the event associated with the action is triggered.
9
+ * <i>Inx_Api_Action_Command</i>s can be used to manipulate a recipient or to send a single mailing to that recipient.
10
+ * <p>
11
+ * The different types of commands are:
12
+ * <ul>
13
+ * <li><i>Inx_Api_Action_DeleteRecipientCommand</i> - Permanently remove the recipient.
14
+ * <li><i>Inx_Api_Action_SendMailCommand</i> - Send a mailing to the recipient.
15
+ * <li><i>Inx_Api_Action_SetValueCommand</i> - Set an attribute value of the recipient.
16
+ * <li><i>Inx_Api_Action_SubscriptionCommand</i> - Subscribe the recipient.
17
+ * <li><i>Inx_Api_Action_UnsubscriptionCommand</i> - Unsubscribe the recipient.
18
+ * </ul>
19
+ * <p>
20
+ * For an example on how to use commands and actions, see the <i>Inx_Api_Action_ActionManager</i> documentation.
21
+ *
22
+ * @see Inx_Api_Action_Action
23
+ * @see Inx_Api_Action_ActionManager
24
+ * @since API 1.2.0
25
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
26
+ * @package Inxmail
27
+ * @subpackage Action
28
+ */
29
+ interface Inx_Api_Action_Command
30
+ {
31
+
32
+ }
lib/Inx/Api/Action/CommandFactory.php CHANGED
@@ -1,202 +1,202 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * The <i>Inx_Api_Action_CommandFactory</i> is a factory for creating <i>Inx_Api_Action_Command</i>s.
8
- * <p>
9
- * For an example on how to use commands and actions, see the <i>Inx_Api_Action_ActionManager</i>
10
- * documentation.
11
- *
12
- * @see Inx_Api_Action_Command
13
- * @see Inx_Api_Action_ActionManager
14
- * @since API 1.2.0
15
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
16
- * @package Inxmail
17
- * @subpackage Action
18
- */
19
- interface Inx_Api_Action_CommandFactory
20
- {
21
-
22
- /**
23
- * Creates a new <i>Inx_Api_Action_DeleteRecipientCommand</i> that will delete the recipient permanently
24
- * from the system.
25
- *
26
- * @return Inx_Api_Action_DeleteRecipientCommand a new <i>Inx_Api_Action_DeleteRecipientCommand</i>.
27
- */
28
- public function createDeleteRecipientCmd();
29
-
30
-
31
- /**
32
- * Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets a value based on an expression.
33
- * The expression must begin with an equal sign. The data type of the expression must be the same as the
34
- * data type of the specified attribute.
35
- * <p>
36
- * See the Inxmail client documentation for a detailed description.
37
- *
38
- * <PRE>
39
- * $oFactory->createSetValueCmd( $oDatetimeAttr->getId(), "=Date()" );
40
- * </PRE>
41
- *
42
- * @param int $iAttributeId the id of the user attribute.
43
- * @param string $sExpression an expression that sets the value of the attribute.
44
- * @return Inx_Api_Action_SetValueCommand a new <i>Inx_Api_Action_SetValueCommand</i>.
45
- * @see Inx_Api_Recipient_Attribute
46
- */
47
- public function createSetValueCmd( $iAttributeId, $sExpression );
48
-
49
-
50
- /**
51
- * Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets an absolute value.
52
- * Some examples for allowed values, dependent on the data type: <br>
53
- * <ul>
54
- * <li>DataType.TEXT - "Text", null
55
- * <li>DataType.INTEGER - "12", "-3", null
56
- * <li>DataType.DOUBLE - "3.4", "-1.25", null
57
- * <li>DataType.BOOLEAN - "TRUE", "FALSE"
58
- * <li>DataType.DATETIME - "31.12.2006 23:45:00"; (dd.MM.yyyy HH:mm:ss or dd.MM.yyyy HH:mm), null
59
- * <li>DataType.DATE - "31.12.2006"; (dd.MM.yyyy), null
60
- * <li>DataType.TIME - "23:45:00"; (HH:mm:ss or HH:mm), null
61
- * </ul>
62
- *
63
- * @param int $iAttributeId the id of the user attribute.
64
- * @param string $sAbsoluteValue an absolute value for the attribute.
65
- * @return Inx_Api_Action_SetValue_Command a new <i>Inx_Api_Action_SetValueCommand</i>.
66
- * @see Inx_Api_Recipient_Attribute
67
- */
68
- public function createSetAbsoluteValueCmd( $iAttributeId, $sAbsoluteValue );
69
-
70
-
71
- /**
72
- * Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets a relative value.
73
- * Examples for allowed values, dependent on the data type: <br>
74
- * <ul>
75
- * <li>DataType.TEXT - "3", "-10"
76
- * <li>DataType.INTEGER - "12", "-3"
77
- * <li>DataType.DOUBLE - "3.4", "-1.25"
78
- * </ul>
79
- * <p>
80
- * You might wonder why text attributes can be incremented/decremented. This is a convenience for attributes that
81
- * are numbers by nature but have the type text. DO NOT use this method for changing real text attributes, as this
82
- * will overwrite the value.
83
- *
84
- * @param int $iAttributeId the id of the user attribute.
85
- * @param string $sRelativeValue a relative value for the attribute that can be positive (increment) or negative
86
- * (decrement).
87
- * @return Inx_Api_Action_SetValueCommand a new <i>Inx_Api_Action_SetValueCommand</i>.
88
- * @see Inx_Api_Recipient_Attribute
89
- */
90
- public function createSetRelativeValueCmd( $iAttributeId, $sRelativeValue );
91
-
92
-
93
- /**
94
- * Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which subscribes the recipient to the specified
95
- * standard list.
96
- *
97
- * @param int $iListContextId the id of the standard list context to which to subscribe to.
98
- * @param bool $blSubscriptionProcessingEnabled true if subscription processing is enabled, false if direct (forced)
99
- * subscription is used. If processing and double opt in (DOI) are enabled, this will send a verification
100
- * email to the recipient.
101
- * @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
102
- * @deprecated use createSubscriptionCmd2(int, bool) instead.
103
- */
104
- public function createSubscriptionCmd( $iListContextId, $blSubscriptionProcessingEnabled );
105
-
106
-
107
- /**
108
- * Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which unsubscribes the recipient from the
109
- * specified standard list.
110
- *
111
- * @param int $iListContextId the id of the standard list context from which to unsubscribe from.
112
- * @param bool $blSnsubscriptionProcessingEnabled true if unsubscription processing is enabled, false if direct
113
- * (forced) unsubscription is used. If processing and double opt out (DOO) are enabled, this will send
114
- * a verification email to the recipient.
115
- * @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
116
- * @deprecated use createUnsubscriptionCmd2(int, bool) instead.
117
- */
118
- public function createUnsubscriptionCmd( $iListContextId, $blSnsubscriptionProcessingEnabled );
119
-
120
-
121
- /**
122
- * Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which unsubscribes the recipient from all standard
123
- * lists.
124
- *
125
- * @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
126
- * @deprecated use createUnsubscribeAllCmd2() instead.
127
- */
128
- public function createUnsubscribeAllCmd();
129
-
130
-
131
- /**
132
- * Creates an <i>Inx_Api_Action_SubscriptionCommand</i> which subscribes the recipient to the specified
133
- * standard list.
134
- *
135
- * @param int $iListContextId the id of the standard list context to which to subscribe to.
136
- * @param bool $blSubscriptionProcessingEnabled true if subscription processing is enabled, false if direct
137
- * (forced) subscription is used. If processing and double opt in (DOI) are enabled, this will send
138
- * a verification email to the recipient.
139
- * @return Inx_Api_Action_SubscriptionCommand a new <i>Inx_Api_Action_SubscriptionCommand</i>.
140
- * @since API 1.6.0
141
- */
142
- public function createSubscriptionCmd2( $iListContextId,
143
- $blSubscriptionProcessingEnabled );
144
-
145
-
146
- /**
147
- * Creates an <i>Inx_Api_Action_UnsubscriptionCommand</i> which unsubscribes the recipient from the
148
- * specified standard list.
149
- *
150
- * @param int $iListContextId the id of the standard list context from which to unsubscribe from.
151
- * @param bool $blSnsubscriptionProcessingEnabled true if unsubscription processing is enabled, false if
152
- * direct (forced) unsubscription is used. If processing and double opt out (DOO) are enabled,
153
- * this will send a verification email to the recipient.
154
- * @return Inx_Api_Action_UnsubscriptionCommand a new <i>Inx_Api_Action_UnsubscriptionCommand</i>.
155
- * @since API 1.6.0
156
- */
157
- public function createUnsubscriptionCmd2( $iListContextId,
158
- $blSnsubscriptionProcessingEnabled );
159
-
160
-
161
- /**
162
- * Creates an <i>Inx_Api_Action_UnsubscriptionCommand</i> which unsubscribes the recipient from all
163
- * standard lists.
164
- *
165
- * @return Inx_Api_Action_UnsubscriptionCommand a new <i>Inx_Api_Action_UnsubscriptionCommand</i>.
166
- * @since API 1.6.0
167
- */
168
- public function createUnsubscribeAllCmd2();
169
-
170
-
171
-
172
- /**
173
- * Creates an <i>Inx_Api_Action_SendMailCommand</i> which sends the last newsletter from the
174
- * specified list context to the recipient.
175
- *
176
- * @param int $iListContextId the id of the standard or filter list context.
177
- * @return Inx_Api_Action_SendMailCommand a new <i>Inx_Api_Action_SendMailCommand</i>.
178
- */
179
- public function createSendLastNewsletterCmd( $iListContextId );
180
-
181
-
182
- /**
183
- * Creates an <i>Inx_Api_Action_SendMailCommand</i> which sends the specified mailing from the
184
- * corresponding list context to the recipient.
185
- *
186
- * @param int $iListContextId the id of the standard or filter list context containing the mailing.
187
- * @param int $iMailingId the id of the mailing to send.
188
- * @return Inx_Api_Action_SendMailCommand a new <i>Inx_Api_Action_SendMailCommand</i>.
189
- */
190
- public function createSendMailCmd( $iListContextId, $iMailingId );
191
-
192
- /**
193
- * Creates an <i>Inx_Api_Action_SendActionMailCommand</i> which sends the specified action mailing
194
- * from the corresponding list context to the recipient.
195
- *
196
- * @param int $iListContextId id of the standard or filter list context containing the action mailing.
197
- * @param int $iActionMailingId the id of the action mailing to send.
198
- * @return Inx_Api_Action_SendActionMailCommand a new <i>Inx_Api_Action_SendActionMailCommand</i>.
199
- * @since API 1.10.0
200
- */
201
- public function createSendActionMailCmd( $iListContextId, $iActionMailingId );
202
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Action_CommandFactory</i> is a factory for creating <i>Inx_Api_Action_Command</i>s.
8
+ * <p>
9
+ * For an example on how to use commands and actions, see the <i>Inx_Api_Action_ActionManager</i>
10
+ * documentation.
11
+ *
12
+ * @see Inx_Api_Action_Command
13
+ * @see Inx_Api_Action_ActionManager
14
+ * @since API 1.2.0
15
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
16
+ * @package Inxmail
17
+ * @subpackage Action
18
+ */
19
+ interface Inx_Api_Action_CommandFactory
20
+ {
21
+
22
+ /**
23
+ * Creates a new <i>Inx_Api_Action_DeleteRecipientCommand</i> that will delete the recipient permanently
24
+ * from the system.
25
+ *
26
+ * @return Inx_Api_Action_DeleteRecipientCommand a new <i>Inx_Api_Action_DeleteRecipientCommand</i>.
27
+ */
28
+ public function createDeleteRecipientCmd();
29
+
30
+
31
+ /**
32
+ * Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets a value based on an expression.
33
+ * The expression must begin with an equal sign. The data type of the expression must be the same as the
34
+ * data type of the specified attribute.
35
+ * <p>
36
+ * See the Inxmail client documentation for a detailed description.
37
+ *
38
+ * <PRE>
39
+ * $oFactory->createSetValueCmd( $oDatetimeAttr->getId(), "=Date()" );
40
+ * </PRE>
41
+ *
42
+ * @param int $iAttributeId the id of the user attribute.
43
+ * @param string $sExpression an expression that sets the value of the attribute.
44
+ * @return Inx_Api_Action_SetValueCommand a new <i>Inx_Api_Action_SetValueCommand</i>.
45
+ * @see Inx_Api_Recipient_Attribute
46
+ */
47
+ public function createSetValueCmd( $iAttributeId, $sExpression );
48
+
49
+
50
+ /**
51
+ * Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets an absolute value.
52
+ * Some examples for allowed values, dependent on the data type: <br>
53
+ * <ul>
54
+ * <li>DataType.TEXT - "Text", null
55
+ * <li>DataType.INTEGER - "12", "-3", null
56
+ * <li>DataType.DOUBLE - "3.4", "-1.25", null
57
+ * <li>DataType.BOOLEAN - "TRUE", "FALSE"
58
+ * <li>DataType.DATETIME - "31.12.2006 23:45:00"; (dd.MM.yyyy HH:mm:ss or dd.MM.yyyy HH:mm), null
59
+ * <li>DataType.DATE - "31.12.2006"; (dd.MM.yyyy), null
60
+ * <li>DataType.TIME - "23:45:00"; (HH:mm:ss or HH:mm), null
61
+ * </ul>
62
+ *
63
+ * @param int $iAttributeId the id of the user attribute.
64
+ * @param string $sAbsoluteValue an absolute value for the attribute.
65
+ * @return Inx_Api_Action_SetValue_Command a new <i>Inx_Api_Action_SetValueCommand</i>.
66
+ * @see Inx_Api_Recipient_Attribute
67
+ */
68
+ public function createSetAbsoluteValueCmd( $iAttributeId, $sAbsoluteValue );
69
+
70
+
71
+ /**
72
+ * Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets a relative value.
73
+ * Examples for allowed values, dependent on the data type: <br>
74
+ * <ul>
75
+ * <li>DataType.TEXT - "3", "-10"
76
+ * <li>DataType.INTEGER - "12", "-3"
77
+ * <li>DataType.DOUBLE - "3.4", "-1.25"
78
+ * </ul>
79
+ * <p>
80
+ * You might wonder why text attributes can be incremented/decremented. This is a convenience for attributes that
81
+ * are numbers by nature but have the type text. DO NOT use this method for changing real text attributes, as this
82
+ * will overwrite the value.
83
+ *
84
+ * @param int $iAttributeId the id of the user attribute.
85
+ * @param string $sRelativeValue a relative value for the attribute that can be positive (increment) or negative
86
+ * (decrement).
87
+ * @return Inx_Api_Action_SetValueCommand a new <i>Inx_Api_Action_SetValueCommand</i>.
88
+ * @see Inx_Api_Recipient_Attribute
89
+ */
90
+ public function createSetRelativeValueCmd( $iAttributeId, $sRelativeValue );
91
+
92
+
93
+ /**
94
+ * Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which subscribes the recipient to the specified
95
+ * standard list.
96
+ *
97
+ * @param int $iListContextId the id of the standard list context to which to subscribe to.
98
+ * @param bool $blSubscriptionProcessingEnabled true if subscription processing is enabled, false if direct (forced)
99
+ * subscription is used. If processing and double opt in (DOI) are enabled, this will send a verification
100
+ * email to the recipient.
101
+ * @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
102
+ * @deprecated use createSubscriptionCmd2(int, bool) instead.
103
+ */
104
+ public function createSubscriptionCmd( $iListContextId, $blSubscriptionProcessingEnabled );
105
+
106
+
107
+ /**
108
+ * Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which unsubscribes the recipient from the
109
+ * specified standard list.
110
+ *
111
+ * @param int $iListContextId the id of the standard list context from which to unsubscribe from.
112
+ * @param bool $blSnsubscriptionProcessingEnabled true if unsubscription processing is enabled, false if direct
113
+ * (forced) unsubscription is used. If processing and double opt out (DOO) are enabled, this will send
114
+ * a verification email to the recipient.
115
+ * @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
116
+ * @deprecated use createUnsubscriptionCmd2(int, bool) instead.
117
+ */
118
+ public function createUnsubscriptionCmd( $iListContextId, $blSnsubscriptionProcessingEnabled );
119
+
120
+
121
+ /**
122
+ * Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which unsubscribes the recipient from all standard
123
+ * lists.
124
+ *
125
+ * @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
126
+ * @deprecated use createUnsubscribeAllCmd2() instead.
127
+ */
128
+ public function createUnsubscribeAllCmd();
129
+
130
+
131
+ /**
132
+ * Creates an <i>Inx_Api_Action_SubscriptionCommand</i> which subscribes the recipient to the specified
133
+ * standard list.
134
+ *
135
+ * @param int $iListContextId the id of the standard list context to which to subscribe to.
136
+ * @param bool $blSubscriptionProcessingEnabled true if subscription processing is enabled, false if direct
137
+ * (forced) subscription is used. If processing and double opt in (DOI) are enabled, this will send
138
+ * a verification email to the recipient.
139
+ * @return Inx_Api_Action_SubscriptionCommand a new <i>Inx_Api_Action_SubscriptionCommand</i>.
140
+ * @since API 1.6.0
141
+ */
142
+ public function createSubscriptionCmd2( $iListContextId,
143
+ $blSubscriptionProcessingEnabled );
144
+
145
+
146
+ /**
147
+ * Creates an <i>Inx_Api_Action_UnsubscriptionCommand</i> which unsubscribes the recipient from the
148
+ * specified standard list.
149
+ *
150
+ * @param int $iListContextId the id of the standard list context from which to unsubscribe from.
151
+ * @param bool $blSnsubscriptionProcessingEnabled true if unsubscription processing is enabled, false if
152
+ * direct (forced) unsubscription is used. If processing and double opt out (DOO) are enabled,
153
+ * this will send a verification email to the recipient.
154
+ * @return Inx_Api_Action_UnsubscriptionCommand a new <i>Inx_Api_Action_UnsubscriptionCommand</i>.
155
+ * @since API 1.6.0
156
+ */
157
+ public function createUnsubscriptionCmd2( $iListContextId,
158
+ $blSnsubscriptionProcessingEnabled );
159
+
160
+
161
+ /**
162
+ * Creates an <i>Inx_Api_Action_UnsubscriptionCommand</i> which unsubscribes the recipient from all
163
+ * standard lists.
164
+ *
165
+ * @return Inx_Api_Action_UnsubscriptionCommand a new <i>Inx_Api_Action_UnsubscriptionCommand</i>.
166
+ * @since API 1.6.0
167
+ */
168
+ public function createUnsubscribeAllCmd2();
169
+
170
+
171
+
172
+ /**
173
+ * Creates an <i>Inx_Api_Action_SendMailCommand</i> which sends the last newsletter from the
174
+ * specified list context to the recipient.
175
+ *
176
+ * @param int $iListContextId the id of the standard or filter list context.
177
+ * @return Inx_Api_Action_SendMailCommand a new <i>Inx_Api_Action_SendMailCommand</i>.
178
+ */
179
+ public function createSendLastNewsletterCmd( $iListContextId );
180
+
181
+
182
+ /**
183
+ * Creates an <i>Inx_Api_Action_SendMailCommand</i> which sends the specified mailing from the
184
+ * corresponding list context to the recipient.
185
+ *
186
+ * @param int $iListContextId the id of the standard or filter list context containing the mailing.
187
+ * @param int $iMailingId the id of the mailing to send.
188
+ * @return Inx_Api_Action_SendMailCommand a new <i>Inx_Api_Action_SendMailCommand</i>.
189
+ */
190
+ public function createSendMailCmd( $iListContextId, $iMailingId );
191
+
192
+ /**
193
+ * Creates an <i>Inx_Api_Action_SendActionMailCommand</i> which sends the specified action mailing
194
+ * from the corresponding list context to the recipient.
195
+ *
196
+ * @param int $iListContextId id of the standard or filter list context containing the action mailing.
197
+ * @param int $iActionMailingId the id of the action mailing to send.
198
+ * @return Inx_Api_Action_SendActionMailCommand a new <i>Inx_Api_Action_SendActionMailCommand</i>.
199
+ * @since API 1.10.0
200
+ */
201
+ public function createSendActionMailCmd( $iListContextId, $iActionMailingId );
202
+ }
lib/Inx/Api/Action/DeleteRecipientCommand.php CHANGED
@@ -1,18 +1,18 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * Use the <i>Inx_Api_Action_DeleteRecipientCommand</i> to permanently delete a recipient from the system.
8
- *
9
- * @see Inx_Api_Action_CommandFactory
10
- * @since API 1.2.0
11
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
12
- * @package Inxmail
13
- * @subpackage Action
14
- */
15
- interface Inx_Api_Action_DeleteRecipientCommand extends Inx_Api_Action_Command
16
- {
17
-
18
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * Use the <i>Inx_Api_Action_DeleteRecipientCommand</i> to permanently delete a recipient from the system.
8
+ *
9
+ * @see Inx_Api_Action_CommandFactory
10
+ * @since API 1.2.0
11
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
12
+ * @package Inxmail
13
+ * @subpackage Action
14
+ */
15
+ interface Inx_Api_Action_DeleteRecipientCommand extends Inx_Api_Action_Command
16
+ {
17
+
18
+ }
lib/Inx/Api/Action/SendActionMailCommand.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2006 Inxmail GmbH. All Rights Reserved. This code is part of the Inxmail API documentation. It is
4
- * distributed in the hope that it will be useful, but a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS,
5
- * REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
6
- * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. INXMAIL GMBH ("INXMAIL") AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
7
- * DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO
8
- * EVENT WILL INXMAIL OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
9
- * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT
10
- * OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF INXMAIL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
11
- * You acknowledge that this software is not designed, licensed or intended for use in the design, construction,
12
- * operation or maintenance of any nuclear facility.
13
- */
14
-
15
- /**
16
- * @package Inxmail
17
- * @subpackage Action
18
- */
19
- /**
20
- * Use the <i>Inx_Api_Action_SendActionMailCommand</i> to send an action mailing to a recipient. The action
21
- * mailing must be approved in order to be used.
22
- *
23
- * @see Inx_Api_Action_CommandFactory
24
- * @since API 1.10.0
25
- */
26
- interface Inx_Api_Action_SendActionMailCommand extends Inx_Api_Action_Command
27
- {
28
- /**
29
- * Returns the id of the standard or filter list context associated with this command.
30
- *
31
- * @return int the id of the list context.
32
- */
33
- public function getListContextId();
34
-
35
-
36
- /**
37
- * Returns the id of the action mailing associated with this command.
38
- *
39
- * @return int the id of the action mailing.
40
- */
41
- public function getMailingId();
42
-
43
  }
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2006 Inxmail GmbH. All Rights Reserved. This code is part of the Inxmail API documentation. It is
4
+ * distributed in the hope that it will be useful, but a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS,
5
+ * REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
6
+ * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. INXMAIL GMBH ("INXMAIL") AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
7
+ * DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO
8
+ * EVENT WILL INXMAIL OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
9
+ * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT
10
+ * OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF INXMAIL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
11
+ * You acknowledge that this software is not designed, licensed or intended for use in the design, construction,
12
+ * operation or maintenance of any nuclear facility.
13
+ */
14
+
15
+ /**
16
+ * @package Inxmail
17
+ * @subpackage Action
18
+ */
19
+ /**
20
+ * Use the <i>Inx_Api_Action_SendActionMailCommand</i> to send an action mailing to a recipient. The action
21
+ * mailing must be approved in order to be used.
22
+ *
23
+ * @see Inx_Api_Action_CommandFactory
24
+ * @since API 1.10.0
25
+ */
26
+ interface Inx_Api_Action_SendActionMailCommand extends Inx_Api_Action_Command
27
+ {
28
+ /**
29
+ * Returns the id of the standard or filter list context associated with this command.
30
+ *
31
+ * @return int the id of the list context.
32
+ */
33
+ public function getListContextId();
34
+
35
+
36
+ /**
37
+ * Returns the id of the action mailing associated with this command.
38
+ *
39
+ * @return int the id of the action mailing.
40
+ */
41
+ public function getMailingId();
42
+
43
  }
lib/Inx/Api/Action/SendMailCommand.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * Use the <i>Inx_Api_Action_SendMailCommand</i> to send a mailing to a recipient.
8
- * This command can be configured to either send a specific mailing or to send the last mailing
9
- * (newsletter) in the recipients list.
10
- *
11
- * @see Inx_Api_Action_CommandFactory
12
- * @since API 1.2.0
13
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
14
- * @package Inxmail
15
- * @subpackage Action
16
- */
17
- interface Inx_Api_Action_SendMailCommand extends Inx_Api_Action_Command
18
- {
19
-
20
- /**
21
- * Command type: Send a specific mailing.
22
- */
23
- const CMD_TYPE_SPECIFIC_MAILING = 0;
24
-
25
- /**
26
- * Command type: Send the last newsletter.
27
- */
28
- const CMD_TYPE_LAST_MAILING = 1;
29
-
30
-
31
- /**
32
- * Returns the command type: Inx_Api_Action_SendMailCommand::CMD_TYPE_SPECIFIC_MAILING or
33
- * Inx_Api_Action_SendMailCommand::CMD_TYPE_LAST_MAILING.
34
- *
35
- * @return int the command type.
36
- */
37
- public function getCmdType();
38
-
39
-
40
- /**
41
- * Returns the id of the standard or filter list context associated with this command.
42
- *
43
- * @return int the id of the list context
44
- */
45
- public function getListContextId();
46
-
47
-
48
- /**
49
- * Returns the id of the mailing associated with this command. Only specified if the command type is
50
- * Inx_Api_Action_SendMailCommand::CMD_TYPE_SPECIFIC_MAILING.
51
- *
52
- * @return int the id of the mailing.
53
- */
54
- public function getMailingId();
55
-
56
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * Use the <i>Inx_Api_Action_SendMailCommand</i> to send a mailing to a recipient.
8
+ * This command can be configured to either send a specific mailing or to send the last mailing
9
+ * (newsletter) in the recipients list.
10
+ *
11
+ * @see Inx_Api_Action_CommandFactory
12
+ * @since API 1.2.0
13
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
14
+ * @package Inxmail
15
+ * @subpackage Action
16
+ */
17
+ interface Inx_Api_Action_SendMailCommand extends Inx_Api_Action_Command
18
+ {
19
+
20
+ /**
21
+ * Command type: Send a specific mailing.
22
+ */
23
+ const CMD_TYPE_SPECIFIC_MAILING = 0;
24
+
25
+ /**
26
+ * Command type: Send the last newsletter.
27
+ */
28
+ const CMD_TYPE_LAST_MAILING = 1;
29
+
30
+
31
+ /**
32
+ * Returns the command type: Inx_Api_Action_SendMailCommand::CMD_TYPE_SPECIFIC_MAILING or
33
+ * Inx_Api_Action_SendMailCommand::CMD_TYPE_LAST_MAILING.
34
+ *
35
+ * @return int the command type.
36
+ */
37
+ public function getCmdType();
38
+
39
+
40
+ /**
41
+ * Returns the id of the standard or filter list context associated with this command.
42
+ *
43
+ * @return int the id of the list context
44
+ */
45
+ public function getListContextId();
46
+
47
+
48
+ /**
49
+ * Returns the id of the mailing associated with this command. Only specified if the command type is
50
+ * Inx_Api_Action_SendMailCommand::CMD_TYPE_SPECIFIC_MAILING.
51
+ *
52
+ * @return int the id of the mailing.
53
+ */
54
+ public function getMailingId();
55
+
56
+ }
lib/Inx/Api/Action/SetValueCommand.php CHANGED
@@ -1,72 +1,72 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * Use the <i>Inx_Api_Action_SetValueCommand</i> to set an attribute value. There are three ways to set the attribute value:
8
- * <ul>
9
- * <li>CMD_TYPE_ABSOLUTE: Absolute value (e.g. 5 or 1)
10
- * <li>CMD_TYPE_RELATIVE: Relative value (e.g. 2 to increment the value by 2)
11
- * <li>CMD_TYPE_FREE_EXPRESSION: Free expression (e.g. "=Date()" to set a date attribute to the current date)
12
- * </ul>
13
- * Note: The data type of a value must be the same as the data type of the specified attribute. Relative values can only
14
- * be set for the following data types:
15
- * <ul>
16
- * <li>DataType.Integer
17
- * <li>DataType.Double
18
- * <li>DataType.Text
19
- * </ul>
20
- *
21
- * @see Inx_Api_Action_CommandFactory
22
- * @see Inx_Api_Recipient_Attribute
23
- * @since API 1.2.0
24
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
25
- * @package Inxmail
26
- * @subpackage Action
27
- */
28
- interface Inx_Api_Action_SetValueCommand extends Inx_Api_Action_Command
29
- {
30
- /**
31
- * Command type: Sets an absolute value.
32
- */
33
- const CMD_TYPE_ABSOLUTE = 0;
34
-
35
- /**
36
- * Command type: Sets a relative value.
37
- */
38
- const CMD_TYPE_RELATIVE = 1;
39
-
40
- /**
41
- * Command type: Sets a value from a free expression.
42
- */
43
- const CMD_TYPE_FREE_EXPRESSION = 2;
44
-
45
-
46
- /**
47
- * Returns the id of the affected user attribute.
48
- *
49
- * @return int the id of the affected user attribute.
50
- */
51
- public function getAttributeId();
52
-
53
-
54
- /**
55
- * Returns the command type:
56
- * Inx_Api_Action_SetValueCommand::CMD_TYPE_ABSOLUTE,
57
- * Inx_Api_Action_SetValueCommand::CMD_TYPE_RELATIVE or
58
- * Inx_Api_Action_SetValueCommand::CMD_TYPE_FREE_EXPRESSION
59
- *
60
- * @return int the command type.
61
- */
62
- public function getCmdType();
63
-
64
-
65
- /**
66
- * Returns the expression/value to set for the attribute.
67
- *
68
- * @return string the expression/value.
69
- */
70
- public function getExpression();
71
-
72
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * Use the <i>Inx_Api_Action_SetValueCommand</i> to set an attribute value. There are three ways to set the attribute value:
8
+ * <ul>
9
+ * <li>CMD_TYPE_ABSOLUTE: Absolute value (e.g. 5 or 1)
10
+ * <li>CMD_TYPE_RELATIVE: Relative value (e.g. 2 to increment the value by 2)
11
+ * <li>CMD_TYPE_FREE_EXPRESSION: Free expression (e.g. "=Date()" to set a date attribute to the current date)
12
+ * </ul>
13
+ * Note: The data type of a value must be the same as the data type of the specified attribute. Relative values can only
14
+ * be set for the following data types:
15
+ * <ul>
16
+ * <li>DataType.Integer
17
+ * <li>DataType.Double
18
+ * <li>DataType.Text
19
+ * </ul>
20
+ *
21
+ * @see Inx_Api_Action_CommandFactory
22
+ * @see Inx_Api_Recipient_Attribute
23
+ * @since API 1.2.0
24
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
25
+ * @package Inxmail
26
+ * @subpackage Action
27
+ */
28
+ interface Inx_Api_Action_SetValueCommand extends Inx_Api_Action_Command
29
+ {
30
+ /**
31
+ * Command type: Sets an absolute value.
32
+ */
33
+ const CMD_TYPE_ABSOLUTE = 0;
34
+
35
+ /**
36
+ * Command type: Sets a relative value.
37
+ */
38
+ const CMD_TYPE_RELATIVE = 1;
39
+
40
+ /**
41
+ * Command type: Sets a value from a free expression.
42
+ */
43
+ const CMD_TYPE_FREE_EXPRESSION = 2;
44
+
45
+
46
+ /**
47
+ * Returns the id of the affected user attribute.
48
+ *
49
+ * @return int the id of the affected user attribute.
50
+ */
51
+ public function getAttributeId();
52
+
53
+
54
+ /**
55
+ * Returns the command type:
56
+ * Inx_Api_Action_SetValueCommand::CMD_TYPE_ABSOLUTE,
57
+ * Inx_Api_Action_SetValueCommand::CMD_TYPE_RELATIVE or
58
+ * Inx_Api_Action_SetValueCommand::CMD_TYPE_FREE_EXPRESSION
59
+ *
60
+ * @return int the command type.
61
+ */
62
+ public function getCmdType();
63
+
64
+
65
+ /**
66
+ * Returns the expression/value to set for the attribute.
67
+ *
68
+ * @return string the expression/value.
69
+ */
70
+ public function getExpression();
71
+
72
+ }
lib/Inx/Api/Action/SubUnsubscriptionCommand.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * Use the <i>Inx_Api_Action_SubUnsubscriptionCommand</i> to subscribe/unsubscribe a recipient to/from the specified standard
8
- * list (CMD_TYPE_SUBSCRIBE and CMD_TYPE_UNSUBSCRIBE) or unsubscribe a recipient from all standard lists (MD_TYPE_UNSUBSCRIBE_ALL).
9
- *
10
- * @see Inx_Api_Action_CommandFactory
11
- * @since API 1.2.0
12
- * @version $Revision$ $Date$ $Author$
13
- * @deprecated Use <i>Inx_Api_Action_SubscriptionCommand</i> and <i>Inx_Api_Action_UnsubscriptionCommand</i> instead.
14
- */
15
- interface Inx_Api_Action_SubUnsubscriptionCommand extends Inx_Api_Action_Command
16
- {
17
- /**
18
- * Command type: Subscribe to a standard list.
19
- */
20
- const CMD_TYPE_SUBSCRIBE = 0;
21
-
22
- /**
23
- * Command type: Unsubscribe from a standard list.
24
- */
25
- const CMD_TYPE_UNSUBSCRIBE = 1;
26
-
27
- /**
28
- * Command type: Unsubscribe from all standard lists.
29
- */
30
- const CMD_TYPE_UNSUBSCRIBE_ALL = 2;
31
-
32
-
33
- /**
34
- * Returns the id of the list context. Only specified if the command type
35
- * is CMD_TYPE_SUBSCRIBE or CMD_TYPE_UNSUBSCRIBE.
36
- *
37
- * @return int the id of the list context.
38
- */
39
- public function getListContextId();
40
-
41
-
42
- /**
43
- * Returns the command type:
44
- * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_SUBSCRIBE,
45
- * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE or
46
- * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE_ALL
47
- *
48
- * @return int the command type.
49
- */
50
- public function getCmdType();
51
-
52
-
53
- /**
54
- * Specifies if the subscription/unsubscription processing is enabled or the recipient will be
55
- * subscribed/unsubscribed directly. If processing and double opt in (DOI) / double opt out (DOO) are enabled, this
56
- * will send a verification email to the recipient.
57
- *
58
- * @return bool true if the subscription/unsubscription processing is enabled, false otherwise.
59
- */
60
- public function isProcessingEnabled();
61
-
62
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * Use the <i>Inx_Api_Action_SubUnsubscriptionCommand</i> to subscribe/unsubscribe a recipient to/from the specified standard
8
+ * list (CMD_TYPE_SUBSCRIBE and CMD_TYPE_UNSUBSCRIBE) or unsubscribe a recipient from all standard lists (MD_TYPE_UNSUBSCRIBE_ALL).
9
+ *
10
+ * @see Inx_Api_Action_CommandFactory
11
+ * @since API 1.2.0
12
+ * @version $Revision$ $Date$ $Author$
13
+ * @deprecated Use <i>Inx_Api_Action_SubscriptionCommand</i> and <i>Inx_Api_Action_UnsubscriptionCommand</i> instead.
14
+ */
15
+ interface Inx_Api_Action_SubUnsubscriptionCommand extends Inx_Api_Action_Command
16
+ {
17
+ /**
18
+ * Command type: Subscribe to a standard list.
19
+ */
20
+ const CMD_TYPE_SUBSCRIBE = 0;
21
+
22
+ /**
23
+ * Command type: Unsubscribe from a standard list.
24
+ */
25
+ const CMD_TYPE_UNSUBSCRIBE = 1;
26
+
27
+ /**
28
+ * Command type: Unsubscribe from all standard lists.
29
+ */
30
+ const CMD_TYPE_UNSUBSCRIBE_ALL = 2;
31
+
32
+
33
+ /**
34
+ * Returns the id of the list context. Only specified if the command type
35
+ * is CMD_TYPE_SUBSCRIBE or CMD_TYPE_UNSUBSCRIBE.
36
+ *
37
+ * @return int the id of the list context.
38
+ */
39
+ public function getListContextId();
40
+
41
+
42
+ /**
43
+ * Returns the command type:
44
+ * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_SUBSCRIBE,
45
+ * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE or
46
+ * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE_ALL
47
+ *
48
+ * @return int the command type.
49
+ */
50
+ public function getCmdType();
51
+
52
+
53
+ /**
54
+ * Specifies if the subscription/unsubscription processing is enabled or the recipient will be
55
+ * subscribed/unsubscribed directly. If processing and double opt in (DOI) / double opt out (DOO) are enabled, this
56
+ * will send a verification email to the recipient.
57
+ *
58
+ * @return bool true if the subscription/unsubscription processing is enabled, false otherwise.
59
+ */
60
+ public function isProcessingEnabled();
61
+
62
  }
lib/Inx/Api/Action/SubscriptionCommand.php CHANGED
@@ -1,49 +1,49 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * Use the <i>Inx_Api_Action_SubscriptionCommand</i> to subscribe the recipient to the specified standard list.
8
- *
9
- * @see Inx_Api_Action_CommandFactory
10
- * @since API 1.2.0
11
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
12
- * @package Inxmail
13
- * @subpackage Action
14
- */
15
- interface Inx_Api_Action_SubscriptionCommand extends Inx_Api_Action_Command
16
- {
17
- /**
18
- * Command type: Subscribe to a standard list.
19
- */
20
- const CMD_TYPE_SUBSCRIBE = 5;
21
-
22
-
23
-
24
- /**
25
- * Returns the id of the list context. Only specified if the command type is CMD_TYPE_SUBSCRIBE.
26
- *
27
- * @return int the id of the list context.
28
- */
29
- public function getListContextId();
30
-
31
-
32
- /**
33
- * Returns the command type:
34
- * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_SUBSCRIBE,
35
- *
36
- * @return int the command type.
37
- */
38
- public function getCmdType();
39
-
40
-
41
- /**
42
- * Specifies if the subscription processing is enabled or the recipient will be subscribed directly. If processing
43
- * and double opt in (DOI) are enabled, this will send a verification email to the recipient.
44
- *
45
- * @return bool true if the subscription processing is enabled, false otherwise.
46
- */
47
- public function isProcessingEnabled();
48
-
49
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * Use the <i>Inx_Api_Action_SubscriptionCommand</i> to subscribe the recipient to the specified standard list.
8
+ *
9
+ * @see Inx_Api_Action_CommandFactory
10
+ * @since API 1.2.0
11
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
12
+ * @package Inxmail
13
+ * @subpackage Action
14
+ */
15
+ interface Inx_Api_Action_SubscriptionCommand extends Inx_Api_Action_Command
16
+ {
17
+ /**
18
+ * Command type: Subscribe to a standard list.
19
+ */
20
+ const CMD_TYPE_SUBSCRIBE = 5;
21
+
22
+
23
+
24
+ /**
25
+ * Returns the id of the list context. Only specified if the command type is CMD_TYPE_SUBSCRIBE.
26
+ *
27
+ * @return int the id of the list context.
28
+ */
29
+ public function getListContextId();
30
+
31
+
32
+ /**
33
+ * Returns the command type:
34
+ * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_SUBSCRIBE,
35
+ *
36
+ * @return int the command type.
37
+ */
38
+ public function getCmdType();
39
+
40
+
41
+ /**
42
+ * Specifies if the subscription processing is enabled or the recipient will be subscribed directly. If processing
43
+ * and double opt in (DOI) are enabled, this will send a verification email to the recipient.
44
+ *
45
+ * @return bool true if the subscription processing is enabled, false otherwise.
46
+ */
47
+ public function isProcessingEnabled();
48
+
49
  }
lib/Inx/Api/Action/UnsubscriptionCommand.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Action
5
- */
6
- /**
7
- * Use the <i>Inx_Api_Action_UnsubscriptionCommand</i> to unsubscribe the recipient from the specified standard list or
8
- * unsubscribe the recipient from all standard lists.
9
- *
10
- * @see Inx_Api_Action_CommandFactory
11
- * @since API 1.2.0
12
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
13
- * @package Inxmail
14
- * @subpackage Action
15
- */
16
- interface Inx_Api_Action_UnsubscriptionCommand extends Inx_Api_Action_Command
17
- {
18
-
19
- /**
20
- * Command type: Unsubscribe from a standard list.
21
- */
22
- const CMD_TYPE_UNSUBSCRIBE = 6;
23
-
24
- /**
25
- * Command type: Unsubscribe from all standard lists.
26
- */
27
- const CMD_TYPE_UNSUBSCRIBE_ALL = 2;
28
-
29
-
30
- /**
31
- * Returns the id of the list context. Only specified if the command type
32
- * is CMD_TYPE_UNSUBSCRIBE.
33
- *
34
- * @return int the id of the list context.
35
- */
36
- public function getListContextId();
37
-
38
-
39
- /**
40
- * Returns the command type:
41
- * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE or
42
- * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE_ALL
43
- *
44
- * @return int the command type.
45
- */
46
- public function getCmdType();
47
-
48
-
49
- /**
50
- * Specifies if the unsubscription processing is enabled or the recipient will be unsubscribed directly. If
51
- * processing and double opt out (DOO) are enabled, this will send a verification email to the recipient.
52
- *
53
- * @return bool true if the unsubscription processing is enabled, false otherwise.
54
- */
55
- public function isProcessingEnabled();
56
-
57
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Action
5
+ */
6
+ /**
7
+ * Use the <i>Inx_Api_Action_UnsubscriptionCommand</i> to unsubscribe the recipient from the specified standard list or
8
+ * unsubscribe the recipient from all standard lists.
9
+ *
10
+ * @see Inx_Api_Action_CommandFactory
11
+ * @since API 1.2.0
12
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
13
+ * @package Inxmail
14
+ * @subpackage Action
15
+ */
16
+ interface Inx_Api_Action_UnsubscriptionCommand extends Inx_Api_Action_Command
17
+ {
18
+
19
+ /**
20
+ * Command type: Unsubscribe from a standard list.
21
+ */
22
+ const CMD_TYPE_UNSUBSCRIBE = 6;
23
+
24
+ /**
25
+ * Command type: Unsubscribe from all standard lists.
26
+ */
27
+ const CMD_TYPE_UNSUBSCRIBE_ALL = 2;
28
+
29
+
30
+ /**
31
+ * Returns the id of the list context. Only specified if the command type
32
+ * is CMD_TYPE_UNSUBSCRIBE.
33
+ *
34
+ * @return int the id of the list context.
35
+ */
36
+ public function getListContextId();
37
+
38
+
39
+ /**
40
+ * Returns the command type:
41
+ * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE or
42
+ * Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE_ALL
43
+ *
44
+ * @return int the command type.
45
+ */
46
+ public function getCmdType();
47
+
48
+
49
+ /**
50
+ * Specifies if the unsubscription processing is enabled or the recipient will be unsubscribed directly. If
51
+ * processing and double opt out (DOO) are enabled, this will send a verification email to the recipient.
52
+ *
53
+ * @return bool true if the unsubscription processing is enabled, false otherwise.
54
+ */
55
+ public function isProcessingEnabled();
56
+
57
  }
lib/Inx/Api/Approval/Approver.php CHANGED
@@ -1,100 +1,100 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Approval
5
- */
6
- /**
7
- * An <i>Inx_Api_Approval_Approver</i> represents a person that has to approve a mailing before it can be sent.
8
- * <P>
9
- * Note: The system wide approvers are only assigned to the system list. Therefore, the system list id is the only id in
10
- * the array returned by <i>getLists()</i>.
11
- * <p>
12
- * Note: In order to commit changes, all attributes enlisted in this class must be assigned a non null value.
13
- * <p>
14
- * Note: The usage of <i>Inx_Api_Approval_Approver</i>s requires the api user right: <i>Inx_Api_UserRights::PROPERTY_SYSTEM_USE</i>
15
- * <p>
16
- * For an example on how to use approvers, see the Inx_Api_Approval_ApproverManager documentation.
17
- *
18
- * @see Inx_Api_Approval_ApproverManager
19
- * @since API 1.6.0
20
- * @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
21
- * @package Inxmail
22
- * @subpackage Approval
23
- */
24
- interface Inx_Api_Approval_Approver extends Inx_Api_BusinessObject
25
- {
26
-
27
- /**
28
- * Returns the name of the approver.
29
- *
30
- * @return string the name of the approver.
31
- */
32
- public function getName();
33
-
34
-
35
- /**
36
- * Sets a new for the approver.
37
- *
38
- * @param string $sName the new name of the approver.
39
- */
40
- public function updateName( $sName );
41
-
42
-
43
- /**
44
- * Returns the email address of the approver.
45
- *
46
- * @return string the email address of the approver.
47
- */
48
- public function getEmail();
49
-
50
-
51
- /**
52
- * Sets a new email address for the approver.
53
- *
54
- * @param string $sEmail the new email address of the approver.
55
- */
56
- public function updateEmail( $sEmail );
57
-
58
-
59
- /**
60
- * Returns the comment of the approver.
61
- *
62
- * @return string the comment of the approver.
63
- */
64
- public function getComment();
65
-
66
-
67
- /**
68
- * Sets a new comment for the approver.
69
- *
70
- * @param string $sComment the new comment of the approver.
71
- */
72
- public function updateComment( $sComment );
73
-
74
-
75
- /**
76
- * Returns an id list of all lists the approver is assigned to.
77
- * <P>
78
- * Note: System wide approvers return only the system list id.
79
- *
80
- * @return array an id list of all lists the approver is assigned to, or the system list id if the approver is assigned to
81
- * all lists.
82
- */
83
- public function getLists();
84
-
85
-
86
- /**
87
- * Sets the lists this approver is assigned to.
88
- * <P>
89
- * Note: Use the id of the system list as the only id in the array if the approver should be assigned to all lists.
90
- * The following snippet retrieves the system list id:
91
- * <pre>
92
- * $oListContextManager = $oSession->getListContextManager();
93
- * $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
94
- * </pre>
95
- *
96
- * @param array $lists array of list ids.
97
- */
98
- public function updateLists( $lists );
99
-
100
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Approval
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Approval_Approver</i> represents a person that has to approve a mailing before it can be sent.
8
+ * <P>
9
+ * Note: The system wide approvers are only assigned to the system list. Therefore, the system list id is the only id in
10
+ * the array returned by <i>getLists()</i>.
11
+ * <p>
12
+ * Note: In order to commit changes, all attributes enlisted in this class must be assigned a non null value.
13
+ * <p>
14
+ * Note: The usage of <i>Inx_Api_Approval_Approver</i>s requires the api user right: <i>Inx_Api_UserRights::PROPERTY_SYSTEM_USE</i>
15
+ * <p>
16
+ * For an example on how to use approvers, see the Inx_Api_Approval_ApproverManager documentation.
17
+ *
18
+ * @see Inx_Api_Approval_ApproverManager
19
+ * @since API 1.6.0
20
+ * @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
21
+ * @package Inxmail
22
+ * @subpackage Approval
23
+ */
24
+ interface Inx_Api_Approval_Approver extends Inx_Api_BusinessObject
25
+ {
26
+
27
+ /**
28
+ * Returns the name of the approver.
29
+ *
30
+ * @return string the name of the approver.
31
+ */
32
+ public function getName();
33
+
34
+
35
+ /**
36
+ * Sets a new for the approver.
37
+ *
38
+ * @param string $sName the new name of the approver.
39
+ */
40
+ public function updateName( $sName );
41
+
42
+
43
+ /**
44
+ * Returns the email address of the approver.
45
+ *
46
+ * @return string the email address of the approver.
47
+ */
48
+ public function getEmail();
49
+
50
+
51
+ /**
52
+ * Sets a new email address for the approver.
53
+ *
54
+ * @param string $sEmail the new email address of the approver.
55
+ */
56
+ public function updateEmail( $sEmail );
57
+
58
+
59
+ /**
60
+ * Returns the comment of the approver.
61
+ *
62
+ * @return string the comment of the approver.
63
+ */
64
+ public function getComment();
65
+
66
+
67
+ /**
68
+ * Sets a new comment for the approver.
69
+ *
70
+ * @param string $sComment the new comment of the approver.
71
+ */
72
+ public function updateComment( $sComment );
73
+
74
+
75
+ /**
76
+ * Returns an id list of all lists the approver is assigned to.
77
+ * <P>
78
+ * Note: System wide approvers return only the system list id.
79
+ *
80
+ * @return array an id list of all lists the approver is assigned to, or the system list id if the approver is assigned to
81
+ * all lists.
82
+ */
83
+ public function getLists();
84
+
85
+
86
+ /**
87
+ * Sets the lists this approver is assigned to.
88
+ * <P>
89
+ * Note: Use the id of the system list as the only id in the array if the approver should be assigned to all lists.
90
+ * The following snippet retrieves the system list id:
91
+ * <pre>
92
+ * $oListContextManager = $oSession->getListContextManager();
93
+ * $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
94
+ * </pre>
95
+ *
96
+ * @param array $lists array of list ids.
97
+ */
98
+ public function updateLists( $lists );
99
+
100
+ }
lib/Inx/Api/Approval/ApproverManager.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Approval
5
- */
6
- /**
7
- * The <i>Inx_Api_Approval_ApproverManager</i> is used for the retrieval and creation of approvers.
8
- * The following code snippet creates a new approver responsible for the list with the id 12:
9
- *
10
- * <pre>
11
- * $approverMgr = $session->getApproverManager();
12
- * $approver = approverMgr->createApprover();
13
- * $approver->updateName( &quot;Max Mustermann&quot; );
14
- * $approver->updateComment( &quot;Approver for List 12&quot; );
15
- * $approver->updateLists( array( 12 ) );
16
- * $approver->commitUpdate();
17
- * </pre>
18
- * Note: The usage of <i>Inx_Api_Approval_Approver</i>s requires the api user right: <i>Inx_Api_UserRights::PROPERTY_SYSTEM_USE</i>
19
- * <p>
20
- * For more information on approvers, see the <i>Inx_Api_Approval_Approver</i> documentation.
21
- *
22
- * @since API 1.6.0
23
- * @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
24
- * @package Inxmail
25
- * @subpackage Approval
26
- */
27
- interface Inx_Api_Approval_ApproverManager extends Inx_Api_BOManager
28
- {
29
-
30
- /**
31
- * Selects all approvers assigned to the given list and all system wide approvers.
32
- *
33
- * @param Inx_Api_List_ListContext $olistContext all approvers assigned to this list will be retrieved.
34
- * @return Inx_Api_BOResultSet a result set containing the approvers.
35
- */
36
- public function select( $olistContext );
37
-
38
-
39
- /**
40
- * Creates a new approver.
41
- *
42
- * @return Inx_Api_Aprroval_Approver the new approver.
43
- */
44
- public function createApprover();
45
-
46
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Approval
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Approval_ApproverManager</i> is used for the retrieval and creation of approvers.
8
+ * The following code snippet creates a new approver responsible for the list with the id 12:
9
+ *
10
+ * <pre>
11
+ * $approverMgr = $session->getApproverManager();
12
+ * $approver = approverMgr->createApprover();
13
+ * $approver->updateName( &quot;Max Mustermann&quot; );
14
+ * $approver->updateComment( &quot;Approver for List 12&quot; );
15
+ * $approver->updateLists( array( 12 ) );
16
+ * $approver->commitUpdate();
17
+ * </pre>
18
+ * Note: The usage of <i>Inx_Api_Approval_Approver</i>s requires the api user right: <i>Inx_Api_UserRights::PROPERTY_SYSTEM_USE</i>
19
+ * <p>
20
+ * For more information on approvers, see the <i>Inx_Api_Approval_Approver</i> documentation.
21
+ *
22
+ * @since API 1.6.0
23
+ * @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
24
+ * @package Inxmail
25
+ * @subpackage Approval
26
+ */
27
+ interface Inx_Api_Approval_ApproverManager extends Inx_Api_BOManager
28
+ {
29
+
30
+ /**
31
+ * Selects all approvers assigned to the given list and all system wide approvers.
32
+ *
33
+ * @param Inx_Api_List_ListContext $olistContext all approvers assigned to this list will be retrieved.
34
+ * @return Inx_Api_BOResultSet a result set containing the approvers.
35
+ */
36
+ public function select( $olistContext );
37
+
38
+
39
+ /**
40
+ * Creates a new approver.
41
+ *
42
+ * @return Inx_Api_Aprroval_Approver the new approver.
43
+ */
44
+ public function createApprover();
45
+
46
+ }
lib/Inx/Api/BOManager.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * The <i>Inx_Api_BOManager</i> interface defines the basic requirements of a business object manager, including retrieval
7
- * and removal of the managed objects.
8
- * @package Inxmail
9
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
10
- */
11
- interface Inx_Api_BOManager
12
- {
13
-
14
- /**
15
- * Returns the <i>Inx_Api_BusinessObject</i> with the specified id.
16
- *
17
- * @param int $iId the id of the <i>Inx_Api_BusinessObject</i> to retrieve.
18
- * @return Inx_Api_BusinessObject the <i>Inx_Api_BusinessObject</i>.
19
- * @throws Inx_Api_DataException if no <i>Inx_Api_BusinessObject</i> could be found (e.g. the object was deleted).
20
- */
21
- public function get( $iId );
22
-
23
-
24
- /**
25
- * Removes the <i>Inx_Api_BusinessObject</i> with the specified id.
26
- *
27
- * @param int $iId the id of the <i>Inx_Api_BusinessObject</i> to be removed.
28
- * @return boolean true, if and only if the removing succeeded; false otherwise (e.g. the object was already deleted).
29
- */
30
- public function remove( $iId );
31
-
32
-
33
- /**
34
- * Returns an <i>Inx_Api_BOResultSet</i> containing all managed <i>Inx_Api_BusinessObject</i>s.
35
- * For Inx_Api_Blacklist_BlacklistManager and Inx_Api_Resource_ResourceManager two params can be specified:
36
- * 1. int $iOrderAttribute the order attribute id.
37
- * 2. the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
38
- *
39
- * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all managed <i>Inx_Api_BusinessObject</i>s.
40
- */
41
- public function selectAll();
42
-
43
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * The <i>Inx_Api_BOManager</i> interface defines the basic requirements of a business object manager, including retrieval
7
+ * and removal of the managed objects.
8
+ * @package Inxmail
9
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
10
+ */
11
+ interface Inx_Api_BOManager
12
+ {
13
+
14
+ /**
15
+ * Returns the <i>Inx_Api_BusinessObject</i> with the specified id.
16
+ *
17
+ * @param int $iId the id of the <i>Inx_Api_BusinessObject</i> to retrieve.
18
+ * @return Inx_Api_BusinessObject the <i>Inx_Api_BusinessObject</i>.
19
+ * @throws Inx_Api_DataException if no <i>Inx_Api_BusinessObject</i> could be found (e.g. the object was deleted).
20
+ */
21
+ public function get( $iId );
22
+
23
+
24
+ /**
25
+ * Removes the <i>Inx_Api_BusinessObject</i> with the specified id.
26
+ *
27
+ * @param int $iId the id of the <i>Inx_Api_BusinessObject</i> to be removed.
28
+ * @return boolean true, if and only if the removing succeeded; false otherwise (e.g. the object was already deleted).
29
+ */
30
+ public function remove( $iId );
31
+
32
+
33
+ /**
34
+ * Returns an <i>Inx_Api_BOResultSet</i> containing all managed <i>Inx_Api_BusinessObject</i>s.
35
+ * For Inx_Api_Blacklist_BlacklistManager and Inx_Api_Resource_ResourceManager two params can be specified:
36
+ * 1. int $iOrderAttribute the order attribute id.
37
+ * 2. the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
38
+ *
39
+ * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all managed <i>Inx_Api_BusinessObject</i>s.
40
+ */
41
+ public function selectAll();
42
+
43
+ }
lib/Inx/Api/BOResultSet.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_BOResultSet</i> is a list of <i>Inx_Api_BusinessObject</i>s.
7
- * The result set can be used to browse through this list, and to remove elements of the list.
8
- * <p>
9
- * <strong>Note:</strong> An <i>Inx_Api_BOResultSet</i> object <strong>must</strong> be closed once it is not needed
10
- * anymore to prevent memory leaks and other potentially harmful side effects.
11
- *
12
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
- * @package Inxmail
14
- */
15
- interface Inx_Api_BOResultSet
16
- {
17
-
18
- /**
19
- * Returns the <i>Inx_Api_BusinessObject</i> with the specified index.
20
- *
21
- * @param int $iIndex the index of the <i>Inx_Api_BusinessObject</i> to retrieve in this result set.
22
- * @return Inx_Api_BusinessObject the <i>Inx_Api_BusinessObject</i> with the specified index.
23
- * @throws Inx_Api_DataException if no <i>Inx_Api_BusinessObject</i> could be found (e.g. the object was deleted).
24
- */
25
- public function get( $iIndex );
26
-
27
-
28
- /**
29
- * Returns the number of business objects in this result set.
30
- *
31
- * @return int the number of business objects.
32
- */
33
- public function size();
34
-
35
-
36
- /**
37
- * Removes all business objects that are selected. The method returns true if and only if all selected elements
38
- * have been removed. In some case it is possible that some elements cannot be removed (e.g.
39
- * Inx_Api_List_SystemListContext, Properties, ... ).
40
- *
41
- * @param Inx_Api_IndexSelection $oSelection the selection of business objects to be removed.
42
- *
43
- * @return boolean true, if and only if the removing succeeded; false otherwise.
44
- *
45
- */
46
- public function remove( Inx_Api_IndexSelection $oSelection );
47
-
48
-
49
- /**
50
- * Closes this result set and releases any resources associated with the result set.
51
- * An <i>Inx_Api_BOResultSet</i> object <strong>must</strong> be closed once it is not needed anymore to prevent
52
- * memory leaks and other potentially harmful side effects.
53
- */
54
- public function close();
55
-
56
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_BOResultSet</i> is a list of <i>Inx_Api_BusinessObject</i>s.
7
+ * The result set can be used to browse through this list, and to remove elements of the list.
8
+ * <p>
9
+ * <strong>Note:</strong> An <i>Inx_Api_BOResultSet</i> object <strong>must</strong> be closed once it is not needed
10
+ * anymore to prevent memory leaks and other potentially harmful side effects.
11
+ *
12
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
+ * @package Inxmail
14
+ */
15
+ interface Inx_Api_BOResultSet
16
+ {
17
+
18
+ /**
19
+ * Returns the <i>Inx_Api_BusinessObject</i> with the specified index.
20
+ *
21
+ * @param int $iIndex the index of the <i>Inx_Api_BusinessObject</i> to retrieve in this result set.
22
+ * @return Inx_Api_BusinessObject the <i>Inx_Api_BusinessObject</i> with the specified index.
23
+ * @throws Inx_Api_DataException if no <i>Inx_Api_BusinessObject</i> could be found (e.g. the object was deleted).
24
+ */
25
+ public function get( $iIndex );
26
+
27
+
28
+ /**
29
+ * Returns the number of business objects in this result set.
30
+ *
31
+ * @return int the number of business objects.
32
+ */
33
+ public function size();
34
+
35
+
36
+ /**
37
+ * Removes all business objects that are selected. The method returns true if and only if all selected elements
38
+ * have been removed. In some case it is possible that some elements cannot be removed (e.g.
39
+ * Inx_Api_List_SystemListContext, Properties, ... ).
40
+ *
41
+ * @param Inx_Api_IndexSelection $oSelection the selection of business objects to be removed.
42
+ *
43
+ * @return boolean true, if and only if the removing succeeded; false otherwise.
44
+ *
45
+ */
46
+ public function remove( Inx_Api_IndexSelection $oSelection );
47
+
48
+
49
+ /**
50
+ * Closes this result set and releases any resources associated with the result set.
51
+ * An <i>Inx_Api_BOResultSet</i> object <strong>must</strong> be closed once it is not needed anymore to prevent
52
+ * memory leaks and other potentially harmful side effects.
53
+ */
54
+ public function close();
55
+
56
+ }
lib/Inx/Api/Blacklist/BlacklistEntry.php CHANGED
@@ -1,102 +1,102 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Blacklist
5
- */
6
- /**
7
- * An <i>Inx_Api_Blacklist_BlacklistEntry</i> can block individual addresses or complete address ranges so
8
- * they can not be added to the Inxmail recipient list, neither by import nor by subscription or in any other ways.
9
- * A few examples:
10
- * <ul>
11
- * <LI>name@firm.com - The address 'name@firm.com' is blocked.
12
- * <LI>*@firm.com - All personnel of this firm is blocked.
13
- * <LI>*.tv - No addresses from Tuvalu.
14
- * <LI>spam* - All addresses beginning with 'spam' are blocked.
15
- * <LI>martin@* - All Martins are blocked.
16
- * </ul>
17
- * Note: The usage of the blacklist requires the api user right: <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
18
- * <p>
19
- * For an example on how to use the blacklist, see the <i>Inx_Api_Blacklist_BlacklistManager</i> documentation.
20
- *
21
- * @see Inx_Api_Blacklist_BlacklistManager
22
- * @since API 1.1.0
23
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
24
- * @package Inxmail
25
- * @subpackage Blacklist
26
- */
27
- interface Inx_Api_Blacklist_BlacklistEntry extends Inx_Api_BusinessObject
28
- {
29
-
30
- /**
31
- * Constant of pattern attribute. Used to indicate a change of this attribute and to define the order in which
32
- * <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
33
- *
34
- * @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
35
- */
36
- const ATTRIBUTE_PATTERN = 0;
37
-
38
- /**
39
- * Constant of descriptionn attribute. Used to indicate a change of this attribute and to define the order in which
40
- * <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
41
- *
42
- * @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
43
- */
44
- const ATTRIBUTE_DESCRIPTION = 1;
45
-
46
- /**
47
- * Constant of hit count attribute. Used to indicate a change of this attribute and to define the order in which
48
- * <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
49
- *
50
- * @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
51
- */
52
- const ATTRIBUTE_HIT_COUNT = 2;
53
-
54
-
55
- /**
56
- * Returns the email address pattern.
57
- *
58
- * @return string the email address pattern
59
- */
60
- public function getPattern();
61
-
62
-
63
- /**
64
- * Changes the email address pattern.
65
- * A few examples:
66
- * <ul>
67
- * <LI>name@firm.com - The address 'name@firm.com' is blocked.
68
- * <LI>*@firm.com - All personnel of this firm is blocked.
69
- * <LI>*.tv - No addresses from Tuvalu.
70
- * <LI>spam* - All addresses beginning with 'spam' are blocked.
71
- * <LI>martin@* - All Martins are blocked.
72
- * </ul>
73
- *
74
- * @param string $sPattern the new email address pattern
75
- */
76
- public function updatePattern( $sPattern );
77
-
78
-
79
- /**
80
- * Returns the entry description.
81
- *
82
- * @return string the entry description.
83
- */
84
- public function getDescription();
85
-
86
-
87
- /**
88
- * Changes the entry description.
89
- *
90
- * @param string $sDescription the new entry description.
91
- */
92
- public function updateDescription( $sDescription );
93
-
94
-
95
- /**
96
- * Returns the number of addresses which were blocked by this entry.
97
- *
98
- * @return int the number of addresses which were blocked by this entry.
99
- */
100
- public function getHitCount();
101
-
102
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Blacklist
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Blacklist_BlacklistEntry</i> can block individual addresses or complete address ranges so
8
+ * they can not be added to the Inxmail recipient list, neither by import nor by subscription or in any other ways.
9
+ * A few examples:
10
+ * <ul>
11
+ * <LI>name@firm.com - The address 'name@firm.com' is blocked.
12
+ * <LI>*@firm.com - All personnel of this firm is blocked.
13
+ * <LI>*.tv - No addresses from Tuvalu.
14
+ * <LI>spam* - All addresses beginning with 'spam' are blocked.
15
+ * <LI>martin@* - All Martins are blocked.
16
+ * </ul>
17
+ * Note: The usage of the blacklist requires the api user right: <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
18
+ * <p>
19
+ * For an example on how to use the blacklist, see the <i>Inx_Api_Blacklist_BlacklistManager</i> documentation.
20
+ *
21
+ * @see Inx_Api_Blacklist_BlacklistManager
22
+ * @since API 1.1.0
23
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
24
+ * @package Inxmail
25
+ * @subpackage Blacklist
26
+ */
27
+ interface Inx_Api_Blacklist_BlacklistEntry extends Inx_Api_BusinessObject
28
+ {
29
+
30
+ /**
31
+ * Constant of pattern attribute. Used to indicate a change of this attribute and to define the order in which
32
+ * <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
33
+ *
34
+ * @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
35
+ */
36
+ const ATTRIBUTE_PATTERN = 0;
37
+
38
+ /**
39
+ * Constant of descriptionn attribute. Used to indicate a change of this attribute and to define the order in which
40
+ * <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
41
+ *
42
+ * @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
43
+ */
44
+ const ATTRIBUTE_DESCRIPTION = 1;
45
+
46
+ /**
47
+ * Constant of hit count attribute. Used to indicate a change of this attribute and to define the order in which
48
+ * <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
49
+ *
50
+ * @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
51
+ */
52
+ const ATTRIBUTE_HIT_COUNT = 2;
53
+
54
+
55
+ /**
56
+ * Returns the email address pattern.
57
+ *
58
+ * @return string the email address pattern
59
+ */
60
+ public function getPattern();
61
+
62
+
63
+ /**
64
+ * Changes the email address pattern.
65
+ * A few examples:
66
+ * <ul>
67
+ * <LI>name@firm.com - The address 'name@firm.com' is blocked.
68
+ * <LI>*@firm.com - All personnel of this firm is blocked.
69
+ * <LI>*.tv - No addresses from Tuvalu.
70
+ * <LI>spam* - All addresses beginning with 'spam' are blocked.
71
+ * <LI>martin@* - All Martins are blocked.
72
+ * </ul>
73
+ *
74
+ * @param string $sPattern the new email address pattern
75
+ */
76
+ public function updatePattern( $sPattern );
77
+
78
+
79
+ /**
80
+ * Returns the entry description.
81
+ *
82
+ * @return string the entry description.
83
+ */
84
+ public function getDescription();
85
+
86
+
87
+ /**
88
+ * Changes the entry description.
89
+ *
90
+ * @param string $sDescription the new entry description.
91
+ */
92
+ public function updateDescription( $sDescription );
93
+
94
+
95
+ /**
96
+ * Returns the number of addresses which were blocked by this entry.
97
+ *
98
+ * @return int the number of addresses which were blocked by this entry.
99
+ */
100
+ public function getHitCount();
101
+
102
+ }
lib/Inx/Api/Blacklist/BlacklistManager.php CHANGED
@@ -1,109 +1,109 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Blacklist
5
- */
6
- /**
7
- * Sometimes you might want to exclude particular e-mail addresses or whole address ranges from Inxmail.
8
- * For this purpose, there is a 'blacklist' of addresses, which can not be added to the Inxmail recipient list, neither
9
- * by import nor by subscription or in any other ways.
10
- * <p>
11
- * You can activate the blacklist feature from the <code>SystemListContext</code>. The following snippet shows how this
12
- * can be achieved:
13
- * <pre>
14
- * $oListContextManager = $oSession->getListContextManager();
15
- * $oSystemListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
16
- *
17
- * $oSystemListContext->enableFeature( Inx_Api_Features::BLACKLIST_FEATURE_ID );
18
- * </pre>
19
- * Using an <i>Inx_Api_Blacklist_BlacklistEntry</i>, you can block individual addresses or complete address ranges.
20
- * A few examples:
21
- * <ul>
22
- * <LI>name@firm.com - The address 'name@firm.com' is blocked.
23
- * <LI>*@firm.com - All personnel of this firm is blocked.
24
- * <LI>*.tv - No addresses from Tuvalu.
25
- * <LI>spam* - All addresses beginning with 'spam' are blocked.
26
- * <LI>martin@* - All Martins are blocked.
27
- * </ul>
28
- * The following snippet shows how to create a blacklist entry that blocks all addresses ending on 'test.com':
29
- *
30
- * <pre>
31
- * $oBlacklistManager = $oSession->getBlacklistManager();
32
- *
33
- * $oBlacklistEntry = $oBlacklistManager->createBlacklistEntry();
34
- * $oBlacklistEntry->updateDescription( &quot;All *test.com users&quot; );
35
- * $oBlacklistEntry->updatePattern( &quot;*test.com&quot; );
36
- * $oBlacklistEntry->commitUpdate();
37
- * </pre>
38
- * Note: The selectAfter, selectBefore and selectBetween methods expect an ISO 8601 formatted date string.
39
- * This date string can be created as in the following snippet:
40
- * <pre>
41
- * $dateString = date('c');
42
- * </pre>
43
- * Note: The usage of the blacklist requires the api user right: <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
44
- * <p>
45
- * For more information on blacklist entries, see the <i>Inx_Api_Blacklist_BlacklistEntry</i> documentation.
46
- *
47
- * @see Inx_Api_Blacklist_BlacklistEntry
48
- * @since API 1.1.0
49
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
50
- * @package Inxmail
51
- * @subpackage Blacklist
52
- */
53
- interface Inx_Api_Blacklist_BlacklistManager extends Inx_Api_BOManager
54
- {
55
-
56
- /**
57
- * Creates a new <i>Inx_Api_Blacklist_BlacklistEntry</i>.
58
- *
59
- * @return Inx_Api_Blacklist_BlacklistEntry the new <i>Inx_Api_Blacklist_BlacklistEntry</i>.
60
- */
61
- public function createBlacklistEntry();
62
-
63
-
64
- /**
65
- * Returns the <i>Inx_Api_Blacklist_BlacklistEntry</i> with the specified pattern.
66
- * The pattern is case insensitive.
67
- *
68
- * @param string $sPattern the pattern to find
69
- * @return Inx_Api_Blacklist_BlacklistEntry the entry, or null if no entry was found.
70
- */
71
- public function findByPattern( $sPattern );
72
-
73
-
74
- /**
75
- * Returns a result set containing all blacklist entries in the system which were created or changed after the
76
- * specified date.
77
- *
78
- * @param string $searchDate all entries after this date will be selected. The date has to be formatted as ISO 8601.
79
- * @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
80
- * @throws SecurityException if the session user doesn't have the following permission:
81
- * <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
82
- */
83
- public function selectAfter( $searchDate );
84
-
85
-
86
- /**
87
- * Returns a result set containing all blacklist entries in the system which were created or changed before the
88
- * specified date.
89
- *
90
- * @param string $searchDate all entries before this date will be selected. The date has to be formatted as ISO 8601.
91
- * @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
92
- * @throws SecurityException if the session user doesn't have the following permission:
93
- * <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
94
- */
95
- public function selectBefore( $searchDate );
96
-
97
-
98
- /**
99
- * Returns a result set containing all blacklist entries in the system which were created or changed between the
100
- * specified dates.
101
- *
102
- * @param startDate the start date for the search. The date has to be formatted as ISO 8601.
103
- * @param stopDate the end date for the search. The date has to be formatted as ISO 8601.
104
- * @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
105
- * @throws SecurityException if the session user doesn't have the following permission:
106
- * <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
107
- */
108
- public function selectBetween( $startDate, $stopDate );
109
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Blacklist
5
+ */
6
+ /**
7
+ * Sometimes you might want to exclude particular e-mail addresses or whole address ranges from Inxmail.
8
+ * For this purpose, there is a 'blacklist' of addresses, which can not be added to the Inxmail recipient list, neither
9
+ * by import nor by subscription or in any other ways.
10
+ * <p>
11
+ * You can activate the blacklist feature from the <code>SystemListContext</code>. The following snippet shows how this
12
+ * can be achieved:
13
+ * <pre>
14
+ * $oListContextManager = $oSession->getListContextManager();
15
+ * $oSystemListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
16
+ *
17
+ * $oSystemListContext->enableFeature( Inx_Api_Features::BLACKLIST_FEATURE_ID );
18
+ * </pre>
19
+ * Using an <i>Inx_Api_Blacklist_BlacklistEntry</i>, you can block individual addresses or complete address ranges.
20
+ * A few examples:
21
+ * <ul>
22
+ * <LI>name@firm.com - The address 'name@firm.com' is blocked.
23
+ * <LI>*@firm.com - All personnel of this firm is blocked.
24
+ * <LI>*.tv - No addresses from Tuvalu.
25
+ * <LI>spam* - All addresses beginning with 'spam' are blocked.
26
+ * <LI>martin@* - All Martins are blocked.
27
+ * </ul>
28
+ * The following snippet shows how to create a blacklist entry that blocks all addresses ending on 'test.com':
29
+ *
30
+ * <pre>
31
+ * $oBlacklistManager = $oSession->getBlacklistManager();
32
+ *
33
+ * $oBlacklistEntry = $oBlacklistManager->createBlacklistEntry();
34
+ * $oBlacklistEntry->updateDescription( &quot;All *test.com users&quot; );
35
+ * $oBlacklistEntry->updatePattern( &quot;*test.com&quot; );
36
+ * $oBlacklistEntry->commitUpdate();
37
+ * </pre>
38
+ * Note: The selectAfter, selectBefore and selectBetween methods expect an ISO 8601 formatted date string.
39
+ * This date string can be created as in the following snippet:
40
+ * <pre>
41
+ * $dateString = date('c');
42
+ * </pre>
43
+ * Note: The usage of the blacklist requires the api user right: <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
44
+ * <p>
45
+ * For more information on blacklist entries, see the <i>Inx_Api_Blacklist_BlacklistEntry</i> documentation.
46
+ *
47
+ * @see Inx_Api_Blacklist_BlacklistEntry
48
+ * @since API 1.1.0
49
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
50
+ * @package Inxmail
51
+ * @subpackage Blacklist
52
+ */
53
+ interface Inx_Api_Blacklist_BlacklistManager extends Inx_Api_BOManager
54
+ {
55
+
56
+ /**
57
+ * Creates a new <i>Inx_Api_Blacklist_BlacklistEntry</i>.
58
+ *
59
+ * @return Inx_Api_Blacklist_BlacklistEntry the new <i>Inx_Api_Blacklist_BlacklistEntry</i>.
60
+ */
61
+ public function createBlacklistEntry();
62
+
63
+
64
+ /**
65
+ * Returns the <i>Inx_Api_Blacklist_BlacklistEntry</i> with the specified pattern.
66
+ * The pattern is case insensitive.
67
+ *
68
+ * @param string $sPattern the pattern to find
69
+ * @return Inx_Api_Blacklist_BlacklistEntry the entry, or null if no entry was found.
70
+ */
71
+ public function findByPattern( $sPattern );
72
+
73
+
74
+ /**
75
+ * Returns a result set containing all blacklist entries in the system which were created or changed after the
76
+ * specified date.
77
+ *
78
+ * @param string $searchDate all entries after this date will be selected. The date has to be formatted as ISO 8601.
79
+ * @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
80
+ * @throws SecurityException if the session user doesn't have the following permission:
81
+ * <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
82
+ */
83
+ public function selectAfter( $searchDate );
84
+
85
+
86
+ /**
87
+ * Returns a result set containing all blacklist entries in the system which were created or changed before the
88
+ * specified date.
89
+ *
90
+ * @param string $searchDate all entries before this date will be selected. The date has to be formatted as ISO 8601.
91
+ * @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
92
+ * @throws SecurityException if the session user doesn't have the following permission:
93
+ * <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
94
+ */
95
+ public function selectBefore( $searchDate );
96
+
97
+
98
+ /**
99
+ * Returns a result set containing all blacklist entries in the system which were created or changed between the
100
+ * specified dates.
101
+ *
102
+ * @param startDate the start date for the search. The date has to be formatted as ISO 8601.
103
+ * @param stopDate the end date for the search. The date has to be formatted as ISO 8601.
104
+ * @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
105
+ * @throws SecurityException if the session user doesn't have the following permission:
106
+ * <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
107
+ */
108
+ public function selectBetween( $startDate, $stopDate );
109
+ }
lib/Inx/Api/Bounce/Bounce.php CHANGED
@@ -1,257 +1,257 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Bounce
5
- */
6
- /**
7
- * An <i>Inx_Api_Bounce_Bounce</i> object contains information related to a bounce.
8
- * With this object you can access data of the bounced mail as well as the bounce message itself.
9
- * For example you can retrieve the id of the recipient, the mailing id or the content of the bounce message.
10
- * <p>
11
- * A bounce message or notification is an error message automatically generated by a destination mail server when a mail
12
- * cannot be delivered. There are two categories of bounces: hard bounces and soft bounces. A hard bounce indicates a
13
- * permanent delivery problem (e.g. an unknown email address). A soft bounce indicates a temporary delivery problem
14
- * (e.g. the recipient inbox disk quota is exceeded).
15
- * <p>
16
- * Note: The usage of bounces requires the api user right:
17
- * <i>Inx_Api_UserRights::ERRORMAIL_FEATURE_USE</i>
18
- * <p>
19
- * For an example on how to use bounces, see the <i>Inx_Api_Bounce_BounceManager</i> documentation.
20
- *
21
- * @see Inx_Api_Bounce_BounceManager
22
- * @since API 1.4.3
23
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
24
- * @package Inxmail
25
- * @subpackage Bounce
26
- */
27
- interface Inx_Api_Bounce_Bounce extends Inx_Api_BusinessObject
28
- {
29
- /** This category represents a hard bounce. A common reason for a hard bounce is an invalid email address. */
30
- const CATEGORY_HARD_BOUNCE = 0;
31
-
32
- /**
33
- * This category represents a soft bounce. Soft bounces may occur due to temporary problems like exceeded recipient
34
- * inbox disk quota.
35
- */
36
- const CATEGORY_SOFT_BOUNCE = 1;
37
-
38
- /** This category represents a bounce of unknown type. */
39
- const CATEGORY_UNKNOWN_BOUNCE = 2;
40
-
41
- /**
42
- * State for missing recipient information. This state will be used when no <code>RecipientContext</code> and/or no
43
- * attributes are specified in the query or in case of an unknown recipient.
44
- */
45
- const RECIPIENT_STATE_UNKNOWN = 0;
46
-
47
- /** State for existent recipient. */
48
- const RECIPIENT_STATE_EXISTENT = 1;
49
-
50
- /** State for non existing (deleted) recipient. */
51
- const RECIPIENT_STATE_DELETED = 2;
52
-
53
-
54
-
55
- /**
56
- * Returns the category of this bounce. May be one of:
57
- * <ul>
58
- * <li>CATEGORY_HARD_BOUNCE
59
- * <li>CATEGORY_SOFT_BOUNCE
60
- * <li>CATEGORY_UNKNOWN_BOUNCE
61
- * </ul>
62
- *
63
- * @return int the category of this bounce.
64
- */
65
- public function getCategory();
66
-
67
-
68
- /**
69
- * Returns the date when the bounce occurred as ISO 8601 formatted date string.
70
- *
71
- * @return string the date of the bounce message as ISO 8601 formatted date string.
72
- */
73
- public function getReceptionDate();
74
-
75
-
76
- /**
77
- * Returns the sender address.
78
- *
79
- * @return string the sender address as string.
80
- */
81
- public function getSender();
82
-
83
-
84
- /**
85
- * Returns the subject of the bounce message.
86
- *
87
- * @return string the subject of the bounce message as string.
88
- */
89
- public function getSubject();
90
-
91
-
92
- /**
93
- * Returns the bounce message content as text.
94
- *
95
- * @return string the bounce message content as string.
96
- */
97
- public function getTextContent();
98
-
99
-
100
- /**
101
- * Returns the recipient id for which the bounce occurred.
102
- *
103
- * @return int the recipient id.
104
- */
105
- public function getRecipientId();
106
-
107
-
108
- /**
109
- * Returns the list id of the list in which the bounce occurred.
110
- *
111
- * @return int the list id.
112
- */
113
- public function getListId();
114
-
115
-
116
- /**
117
- * Returns the id of the bounced mailing.
118
- *
119
- * @return int the mailing id.
120
- */
121
- public function getMailingId();
122
-
123
-
124
- /**
125
- * Returns the header of the bounce message as string.
126
- *
127
- * @return string the header of the bounce message as string.
128
- */
129
- public function getHeaders();
130
-
131
-
132
- /**
133
- * Returns the complete bounce message as mime message stream.
134
- *
135
- * @return Inx_Api_InputStream the mime message as input stream.
136
- */
137
- public function getMIMEMessageAsStream();
138
-
139
- /**
140
- * Returns the matched e-mail address (i.e. the e-mail address of the recipient).
141
- *
142
- * @return string the e-mail address.
143
- * @since API 1.6.1
144
- */
145
- public function getMatchedEmailAddress();
146
-
147
- /**
148
- * Returns the state of the recipient for the current bounce.<br>
149
- * The possible recipient states are:
150
- * <ul>
151
- * <li>RECIPIENT_STATE_UNKNOWN - no attributes are queried or recipient is unknown.
152
- * <li>RECIPIENT_STATE_EXISTENT - recipient exists.
153
- * <li>RECIPIENT_STATE_DELETED - recipient is deleted.
154
- * </ul>
155
- *
156
- * @return int the recipient state.
157
- * @since API 1.6.1
158
- */
159
- public function getRecipientState();
160
-
161
-
162
- /**
163
- * Returns the integer value for the given recipient Attribute.
164
- *
165
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
166
- * @return int the integer value.
167
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
168
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>int</i>.
169
- * @since API 1.6.1
170
- */
171
- public function getInteger( $attr );
172
-
173
-
174
- /**
175
- * Returns the string value for the given recipient Attribute.
176
- *
177
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
178
- * @return string the string value.
179
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
180
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
181
- * @since API 1.6.1
182
- */
183
- public function getString( $attr );
184
-
185
-
186
- /**
187
- * Returns the datetime value for the given recipient Attribute.
188
- *
189
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
190
- * @return string the datetime value as ISO 8601 formatted datetime string.
191
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
192
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
193
- * @since API 1.6.1
194
- */
195
- public function getDatetime( $attr );
196
-
197
-
198
- /**
199
- * Returns the date value for the given recipient Attribute.
200
- *
201
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
202
- * @return string the date value as ISO 8601 formatted date string.
203
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
204
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
205
- * @since API 1.6.1
206
- */
207
- public function getDate( $attr );
208
-
209
-
210
- /**
211
- * Returns the time value for the given recipient Attribute.
212
- *
213
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
214
- * @return string the time value as ISO 8601 formatted time string.
215
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
216
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
217
- * @since API 1.6.1
218
- */
219
- public function getTime( $attr );
220
-
221
-
222
- /**
223
- * Returns the Double value for the given recipient Attribute.
224
- *
225
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
226
- * @return double the Double value.
227
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
228
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>double</i>.
229
- * @since API 1.6.1
230
- */
231
- public function getDouble( $attr );
232
-
233
-
234
- /**
235
- * Returns the Boolean value for the given recipient Attribute.
236
- *
237
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
238
- * @return bool the Boolean value.
239
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
240
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
241
- * @since API 1.6.1
242
- */
243
- public function getBoolean( $attr );
244
-
245
-
246
- /**
247
- * Returns the Object value for the given recipient Attribute.
248
- *
249
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
250
- * @return mixed the value.
251
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
252
- * @since API 1.6.1
253
- */
254
- public function getObject( $attr );
255
-
256
-
257
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Bounce
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Bounce_Bounce</i> object contains information related to a bounce.
8
+ * With this object you can access data of the bounced mail as well as the bounce message itself.
9
+ * For example you can retrieve the id of the recipient, the mailing id or the content of the bounce message.
10
+ * <p>
11
+ * A bounce message or notification is an error message automatically generated by a destination mail server when a mail
12
+ * cannot be delivered. There are two categories of bounces: hard bounces and soft bounces. A hard bounce indicates a
13
+ * permanent delivery problem (e.g. an unknown email address). A soft bounce indicates a temporary delivery problem
14
+ * (e.g. the recipient inbox disk quota is exceeded).
15
+ * <p>
16
+ * Note: The usage of bounces requires the api user right:
17
+ * <i>Inx_Api_UserRights::ERRORMAIL_FEATURE_USE</i>
18
+ * <p>
19
+ * For an example on how to use bounces, see the <i>Inx_Api_Bounce_BounceManager</i> documentation.
20
+ *
21
+ * @see Inx_Api_Bounce_BounceManager
22
+ * @since API 1.4.3
23
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
24
+ * @package Inxmail
25
+ * @subpackage Bounce
26
+ */
27
+ interface Inx_Api_Bounce_Bounce extends Inx_Api_BusinessObject
28
+ {
29
+ /** This category represents a hard bounce. A common reason for a hard bounce is an invalid email address. */
30
+ const CATEGORY_HARD_BOUNCE = 0;
31
+
32
+ /**
33
+ * This category represents a soft bounce. Soft bounces may occur due to temporary problems like exceeded recipient
34
+ * inbox disk quota.
35
+ */
36
+ const CATEGORY_SOFT_BOUNCE = 1;
37
+
38
+ /** This category represents a bounce of unknown type. */
39
+ const CATEGORY_UNKNOWN_BOUNCE = 2;
40
+
41
+ /**
42
+ * State for missing recipient information. This state will be used when no <code>RecipientContext</code> and/or no
43
+ * attributes are specified in the query or in case of an unknown recipient.
44
+ */
45
+ const RECIPIENT_STATE_UNKNOWN = 0;
46
+
47
+ /** State for existent recipient. */
48
+ const RECIPIENT_STATE_EXISTENT = 1;
49
+
50
+ /** State for non existing (deleted) recipient. */
51
+ const RECIPIENT_STATE_DELETED = 2;
52
+
53
+
54
+
55
+ /**
56
+ * Returns the category of this bounce. May be one of:
57
+ * <ul>
58
+ * <li>CATEGORY_HARD_BOUNCE
59
+ * <li>CATEGORY_SOFT_BOUNCE
60
+ * <li>CATEGORY_UNKNOWN_BOUNCE
61
+ * </ul>
62
+ *
63
+ * @return int the category of this bounce.
64
+ */
65
+ public function getCategory();
66
+
67
+
68
+ /**
69
+ * Returns the date when the bounce occurred as ISO 8601 formatted date string.
70
+ *
71
+ * @return string the date of the bounce message as ISO 8601 formatted date string.
72
+ */
73
+ public function getReceptionDate();
74
+
75
+
76
+ /**
77
+ * Returns the sender address.
78
+ *
79
+ * @return string the sender address as string.
80
+ */
81
+ public function getSender();
82
+
83
+
84
+ /**
85
+ * Returns the subject of the bounce message.
86
+ *
87
+ * @return string the subject of the bounce message as string.
88
+ */
89
+ public function getSubject();
90
+
91
+
92
+ /**
93
+ * Returns the bounce message content as text.
94
+ *
95
+ * @return string the bounce message content as string.
96
+ */
97
+ public function getTextContent();
98
+
99
+
100
+ /**
101
+ * Returns the recipient id for which the bounce occurred.
102
+ *
103
+ * @return int the recipient id.
104
+ */
105
+ public function getRecipientId();
106
+
107
+
108
+ /**
109
+ * Returns the list id of the list in which the bounce occurred.
110
+ *
111
+ * @return int the list id.
112
+ */
113
+ public function getListId();
114
+
115
+
116
+ /**
117
+ * Returns the id of the bounced mailing.
118
+ *
119
+ * @return int the mailing id.
120
+ */
121
+ public function getMailingId();
122
+
123
+
124
+ /**
125
+ * Returns the header of the bounce message as string.
126
+ *
127
+ * @return string the header of the bounce message as string.
128
+ */
129
+ public function getHeaders();
130
+
131
+
132
+ /**
133
+ * Returns the complete bounce message as mime message stream.
134
+ *
135
+ * @return Inx_Api_InputStream the mime message as input stream.
136
+ */
137
+ public function getMIMEMessageAsStream();
138
+
139
+ /**
140
+ * Returns the matched e-mail address (i.e. the e-mail address of the recipient).
141
+ *
142
+ * @return string the e-mail address.
143
+ * @since API 1.6.1
144
+ */
145
+ public function getMatchedEmailAddress();
146
+
147
+ /**
148
+ * Returns the state of the recipient for the current bounce.<br>
149
+ * The possible recipient states are:
150
+ * <ul>
151
+ * <li>RECIPIENT_STATE_UNKNOWN - no attributes are queried or recipient is unknown.
152
+ * <li>RECIPIENT_STATE_EXISTENT - recipient exists.
153
+ * <li>RECIPIENT_STATE_DELETED - recipient is deleted.
154
+ * </ul>
155
+ *
156
+ * @return int the recipient state.
157
+ * @since API 1.6.1
158
+ */
159
+ public function getRecipientState();
160
+
161
+
162
+ /**
163
+ * Returns the integer value for the given recipient Attribute.
164
+ *
165
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
166
+ * @return int the integer value.
167
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
168
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>int</i>.
169
+ * @since API 1.6.1
170
+ */
171
+ public function getInteger( $attr );
172
+
173
+
174
+ /**
175
+ * Returns the string value for the given recipient Attribute.
176
+ *
177
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
178
+ * @return string the string value.
179
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
180
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
181
+ * @since API 1.6.1
182
+ */
183
+ public function getString( $attr );
184
+
185
+
186
+ /**
187
+ * Returns the datetime value for the given recipient Attribute.
188
+ *
189
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
190
+ * @return string the datetime value as ISO 8601 formatted datetime string.
191
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
192
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
193
+ * @since API 1.6.1
194
+ */
195
+ public function getDatetime( $attr );
196
+
197
+
198
+ /**
199
+ * Returns the date value for the given recipient Attribute.
200
+ *
201
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
202
+ * @return string the date value as ISO 8601 formatted date string.
203
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
204
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
205
+ * @since API 1.6.1
206
+ */
207
+ public function getDate( $attr );
208
+
209
+
210
+ /**
211
+ * Returns the time value for the given recipient Attribute.
212
+ *
213
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
214
+ * @return string the time value as ISO 8601 formatted time string.
215
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
216
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
217
+ * @since API 1.6.1
218
+ */
219
+ public function getTime( $attr );
220
+
221
+
222
+ /**
223
+ * Returns the Double value for the given recipient Attribute.
224
+ *
225
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
226
+ * @return double the Double value.
227
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
228
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>double</i>.
229
+ * @since API 1.6.1
230
+ */
231
+ public function getDouble( $attr );
232
+
233
+
234
+ /**
235
+ * Returns the Boolean value for the given recipient Attribute.
236
+ *
237
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
238
+ * @return bool the Boolean value.
239
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
240
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
241
+ * @since API 1.6.1
242
+ */
243
+ public function getBoolean( $attr );
244
+
245
+
246
+ /**
247
+ * Returns the Object value for the given recipient Attribute.
248
+ *
249
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
250
+ * @return mixed the value.
251
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
252
+ * @since API 1.6.1
253
+ */
254
+ public function getObject( $attr );
255
+
256
+
257
+ }
lib/Inx/Api/Bounce/BounceManager.php CHANGED
@@ -1,143 +1,143 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Bounce
5
- */
6
- /**
7
- * The <i>Inx_Api_Bounce_BounceManager</i> can be used to retrieve bounces.
8
- * There are different methods for the retrieval of bounces, for example you can retrieve bounces by date.
9
- * The following example returns an <i>Inx_Api_BOResultSet</i> containing all bounces in the system:
10
- *
11
- * <PRE>
12
- * $oBounceManager = $oSession->getBounceManager();
13
- * $oBOResultSet = $oBounceManager->selectAll();
14
- *
15
- * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
16
- * {
17
- * $oBounce = $oBOResultSet->get( $i );
18
- * echo $oBounce->getSubject()."&#60;br&#62;";
19
- * }
20
- *
21
- * $oBOResultSet->close();
22
- * </PRE>
23
- *
24
- * Note: The <i>select*()</i> methods retrieve no recipient information but the id. If you wish to retrieve the
25
- * recipient state or some of the recipients attributes, use the
26
- * <i>select*(..., Inx_Api_Recipient_RecipientContext, Inx_Api_Recipient_Attribute[])</i> methods instead.
27
- * <p>
28
- * Note: The usage of bounces requires the api user right:
29
- * <i>Inx_Api_UserRights::ERRORMAIL_FEATURE_USE</i>
30
- * <p>
31
- * For more information on bounces, see the <i>Inx_Api_Bounce_Bounce</i> documentation.
32
- *
33
- * @see Inx_Api_Bounce_Bounce
34
- * @since API 1.4.3
35
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
36
- * @package Inxmail
37
- * @subpackage Bounce
38
- */
39
- interface Inx_Api_Bounce_BounceManager extends Inx_Api_BOManager
40
- {
41
- /**
42
- * Returns a result set containing all bounces which occurred before the specified date.
43
- * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
44
- * contains at least one element, the retrieved bounces will contain information about the recipient state and the
45
- * specified recipient attributes.
46
- *
47
- * @param string $searchDate all bounces before this date will be selected. The date has to be formatted as ISO 8601.
48
- * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
49
- * See <i>Inx_Api_Session->createRecipientContext()</i>.
50
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
51
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
52
- * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
53
- * @since API 1.6.1
54
- */
55
- public function selectBefore( $searchDate, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
56
-
57
-
58
- /**
59
- * Returns a result set containing all bounces which occurred after the specified date.
60
- * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
61
- * contains at least one element, the retrieved bounces will contain information about the recipient state and the
62
- * specified recipient attributes.
63
- *
64
- * @param string $searchDate all bounces after this date will be selected. The date has to be formatted as ISO 8601.
65
- * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
66
- * See <i>Inx_Api_Session->createRecipientContext()</i>.
67
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
68
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
69
- * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
70
- * @since API 1.6.1
71
- */
72
- public function selectAfter( $searchDate, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
73
-
74
-
75
- /**
76
- * Returns a result set containing all bounces which occurred between the specified dates.
77
- * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
78
- * contains at least one element, the retrieved bounces will contain information about the recipient state and the
79
- * specified recipient attributes.
80
- *
81
- * @param string $startDate the start date. The date has to be formatted as ISO 8601.
82
- * @param string $stopDate the stop date. The date has to be formatted as ISO 8601.
83
- * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
84
- * See <i>Inx_Api_Session->createRecipientContext()</i>.
85
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
86
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
87
- * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
88
- * @since API 1.6.1
89
- */
90
- public function selectBetween( $startDate, $stopDate, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
91
-
92
- /**
93
- * Returns a result set containing all bounces regarding the specified mailing.
94
- * If there are no bounces, an empty result set will be returned.
95
- * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
96
- * contains at least one element, the retrieved bounces will contain information about the recipient state and the
97
- * specified recipient attributes.
98
- *
99
- * @param int $mailingId the id of the mailing.
100
- * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
101
- * See <i>Inx_Api_Session->createRecipientContext()</i>.
102
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
103
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
104
- * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
105
- * @since API 1.6.1
106
- */
107
- public function selectByMailingId( $mailingId, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
108
-
109
-
110
- /**
111
- * Returns a result set containing all bounces regarding the specified list.
112
- * If there are no bounces, an empty result set will be returned.
113
- * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
114
- * contains at least one element, the retrieved bounces will contain information about the recipient state and the
115
- * specified recipient attributes.
116
- *
117
- * @param int $listId the id of the list.
118
- * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
119
- * See <i>Inx_Api_Session->createRecipientContext()</i>.
120
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
121
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
122
- * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
123
- * @since API 1.6.1
124
- */
125
- public function selectByListId( $listId, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
126
-
127
- /**
128
- * Returns a result set containing all bounces.
129
- * If there are no bounces, an empty result set will be returned.
130
- * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
131
- * contains at least one element, the retrieved bounces will contain information about the recipient state and the
132
- * specified recipient attributes.
133
- *
134
- * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
135
- * See <i>Inx_Api_Session->createRecipientContext()</i>.
136
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
137
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
138
- * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
139
- * @since API 1.6.1
140
- */
141
- public function selectAllBounces(Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null);
142
-
143
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Bounce
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Bounce_BounceManager</i> can be used to retrieve bounces.
8
+ * There are different methods for the retrieval of bounces, for example you can retrieve bounces by date.
9
+ * The following example returns an <i>Inx_Api_BOResultSet</i> containing all bounces in the system:
10
+ *
11
+ * <PRE>
12
+ * $oBounceManager = $oSession->getBounceManager();
13
+ * $oBOResultSet = $oBounceManager->selectAll();
14
+ *
15
+ * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
16
+ * {
17
+ * $oBounce = $oBOResultSet->get( $i );
18
+ * echo $oBounce->getSubject()."&#60;br&#62;";
19
+ * }
20
+ *
21
+ * $oBOResultSet->close();
22
+ * </PRE>
23
+ *
24
+ * Note: The <i>select*()</i> methods retrieve no recipient information but the id. If you wish to retrieve the
25
+ * recipient state or some of the recipients attributes, use the
26
+ * <i>select*(..., Inx_Api_Recipient_RecipientContext, Inx_Api_Recipient_Attribute[])</i> methods instead.
27
+ * <p>
28
+ * Note: The usage of bounces requires the api user right:
29
+ * <i>Inx_Api_UserRights::ERRORMAIL_FEATURE_USE</i>
30
+ * <p>
31
+ * For more information on bounces, see the <i>Inx_Api_Bounce_Bounce</i> documentation.
32
+ *
33
+ * @see Inx_Api_Bounce_Bounce
34
+ * @since API 1.4.3
35
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
36
+ * @package Inxmail
37
+ * @subpackage Bounce
38
+ */
39
+ interface Inx_Api_Bounce_BounceManager extends Inx_Api_BOManager
40
+ {
41
+ /**
42
+ * Returns a result set containing all bounces which occurred before the specified date.
43
+ * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
44
+ * contains at least one element, the retrieved bounces will contain information about the recipient state and the
45
+ * specified recipient attributes.
46
+ *
47
+ * @param string $searchDate all bounces before this date will be selected. The date has to be formatted as ISO 8601.
48
+ * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
49
+ * See <i>Inx_Api_Session->createRecipientContext()</i>.
50
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
51
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
52
+ * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
53
+ * @since API 1.6.1
54
+ */
55
+ public function selectBefore( $searchDate, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
56
+
57
+
58
+ /**
59
+ * Returns a result set containing all bounces which occurred after the specified date.
60
+ * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
61
+ * contains at least one element, the retrieved bounces will contain information about the recipient state and the
62
+ * specified recipient attributes.
63
+ *
64
+ * @param string $searchDate all bounces after this date will be selected. The date has to be formatted as ISO 8601.
65
+ * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
66
+ * See <i>Inx_Api_Session->createRecipientContext()</i>.
67
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
68
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
69
+ * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
70
+ * @since API 1.6.1
71
+ */
72
+ public function selectAfter( $searchDate, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
73
+
74
+
75
+ /**
76
+ * Returns a result set containing all bounces which occurred between the specified dates.
77
+ * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
78
+ * contains at least one element, the retrieved bounces will contain information about the recipient state and the
79
+ * specified recipient attributes.
80
+ *
81
+ * @param string $startDate the start date. The date has to be formatted as ISO 8601.
82
+ * @param string $stopDate the stop date. The date has to be formatted as ISO 8601.
83
+ * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
84
+ * See <i>Inx_Api_Session->createRecipientContext()</i>.
85
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
86
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
87
+ * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
88
+ * @since API 1.6.1
89
+ */
90
+ public function selectBetween( $startDate, $stopDate, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
91
+
92
+ /**
93
+ * Returns a result set containing all bounces regarding the specified mailing.
94
+ * If there are no bounces, an empty result set will be returned.
95
+ * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
96
+ * contains at least one element, the retrieved bounces will contain information about the recipient state and the
97
+ * specified recipient attributes.
98
+ *
99
+ * @param int $mailingId the id of the mailing.
100
+ * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
101
+ * See <i>Inx_Api_Session->createRecipientContext()</i>.
102
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
103
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
104
+ * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
105
+ * @since API 1.6.1
106
+ */
107
+ public function selectByMailingId( $mailingId, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
108
+
109
+
110
+ /**
111
+ * Returns a result set containing all bounces regarding the specified list.
112
+ * If there are no bounces, an empty result set will be returned.
113
+ * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
114
+ * contains at least one element, the retrieved bounces will contain information about the recipient state and the
115
+ * specified recipient attributes.
116
+ *
117
+ * @param int $listId the id of the list.
118
+ * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
119
+ * See <i>Inx_Api_Session->createRecipientContext()</i>.
120
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
121
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
122
+ * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
123
+ * @since API 1.6.1
124
+ */
125
+ public function selectByListId( $listId, Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null );
126
+
127
+ /**
128
+ * Returns a result set containing all bounces.
129
+ * If there are no bounces, an empty result set will be returned.
130
+ * If the <i>Inx_Api_Recipient_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i> array
131
+ * contains at least one element, the retrieved bounces will contain information about the recipient state and the
132
+ * specified recipient attributes.
133
+ *
134
+ * @param Inx_Api_Recipient_RecipientContext $oRc the <i>Inx_Api_Recipient_RecipientContext</i>.
135
+ * See <i>Inx_Api_Session->createRecipientContext()</i>.
136
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
137
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
138
+ * @return an <i>Inx_Api_BOResultSet</i> containing all bounces matching the condition.
139
+ * @since API 1.6.1
140
+ */
141
+ public function selectAllBounces(Inx_Api_Recipient_RecipientContext $oRc = null,array $aAttrs = null);
142
+
143
+ }
lib/Inx/Api/BusinessObject.php CHANGED
@@ -1,44 +1,44 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * The API gives access to objects of Inxmail, which are called "BusinessObjects".
7
- * For example, a mailing lists in Inxmail is such a Business Object.
8
- *
9
- * Values <i>of Inx_Api_BusinessObject</i>s can be changed with the "update" methods
10
- * (like <i>updateName()</i>). By calling <i>commitUpdate()</i> on such an object,
11
- * changes will be passed to the server. Rollback is done by the <i>reload()</i>
12
- * method, which reloads the object and discards all uncomitted changes.
13
- *
14
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
15
- * @package Inxmail
16
- */
17
- interface Inx_Api_BusinessObject
18
- {
19
-
20
- /**
21
- * Returns the unique identifier of this <i>Inx_Api_BusinessObject</i>.
22
- *
23
- * @return int the unique identifier.
24
- */
25
- public function getId();
26
-
27
-
28
- /**
29
- * Passes all changes made since the last commit to the server.
30
- *
31
- * @throws Inx_Api_UpdateException if the update failed (e.g. one of the attributes is illegal).
32
- * @throws Inx_Api_DataException if this business object could not be found on the server (e.g. the object was deleted).
33
- */
34
- public function commitUpdate();
35
-
36
-
37
- /**
38
- * Reloads this business object from the server. All changes uncomitted changes are lost.
39
- *
40
- * @throws Inx_Api_DataException if this business object could not be found on the server (e.g. the object was deleted).
41
- */
42
- public function reload();
43
-
44
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * The API gives access to objects of Inxmail, which are called "BusinessObjects".
7
+ * For example, a mailing lists in Inxmail is such a Business Object.
8
+ *
9
+ * Values <i>of Inx_Api_BusinessObject</i>s can be changed with the "update" methods
10
+ * (like <i>updateName()</i>). By calling <i>commitUpdate()</i> on such an object,
11
+ * changes will be passed to the server. Rollback is done by the <i>reload()</i>
12
+ * method, which reloads the object and discards all uncomitted changes.
13
+ *
14
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
15
+ * @package Inxmail
16
+ */
17
+ interface Inx_Api_BusinessObject
18
+ {
19
+
20
+ /**
21
+ * Returns the unique identifier of this <i>Inx_Api_BusinessObject</i>.
22
+ *
23
+ * @return int the unique identifier.
24
+ */
25
+ public function getId();
26
+
27
+
28
+ /**
29
+ * Passes all changes made since the last commit to the server.
30
+ *
31
+ * @throws Inx_Api_UpdateException if the update failed (e.g. one of the attributes is illegal).
32
+ * @throws Inx_Api_DataException if this business object could not be found on the server (e.g. the object was deleted).
33
+ */
34
+ public function commitUpdate();
35
+
36
+
37
+ /**
38
+ * Reloads this business object from the server. All changes uncomitted changes are lost.
39
+ *
40
+ * @throws Inx_Api_DataException if this business object could not be found on the server (e.g. the object was deleted).
41
+ */
42
+ public function reload();
43
+
44
+ }
lib/Inx/Api/ConnectException.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_ConnectException</i> is thrown when a connection to the server cannot be established
7
- * via the static methods provided by <i>Session</i>.
8
- * Possible reasons for this exception include:
9
- * <ul>
10
- * <li>An invalid application URL was provided
11
- * <li>The server is not reachable
12
- * </ul>
13
- *
14
- * @package Inxmail
15
- */
16
- class Inx_Api_ConnectException extends Exception
17
- {
18
-
19
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_ConnectException</i> is thrown when a connection to the server cannot be established
7
+ * via the static methods provided by <i>Session</i>.
8
+ * Possible reasons for this exception include:
9
+ * <ul>
10
+ * <li>An invalid application URL was provided
11
+ * <li>The server is not reachable
12
+ * </ul>
13
+ *
14
+ * @package Inxmail
15
+ */
16
+ class Inx_Api_ConnectException extends Exception
17
+ {
18
+
19
  }
lib/Inx/Api/DataAccess/ClickData.php CHANGED
@@ -1,390 +1,390 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DataAccess
5
- */
6
-
7
-
8
- /**
9
- * An <i>Inx_Api_DataAccess_ClickData</i> object can be used to retrieve information about a specific click
10
- * accessible through an <i>Inx_Api_DataAccess_ClickDataRowSet</i>.
11
- * A row set can be obtained using various filters:
12
- * <ul>
13
- * <li>mailing: <i>selectByMailing(int, RecipientContext, Attribute[])</i>
14
- * <li>link: <i>selectByLink(int, RecipientContext, Attribute[])</i>
15
- * <li>recipient: <i>selectByRecipient(int, RecipientContext, Attribute[])</i>
16
- * <li>recipient and mailing: <i>selectByRecipientAndMailing(int, int, RecipientContext, Attribute[])</i>
17
- * </ul>
18
- * <p>
19
- * All of these methods offer variants to filter the result by date. You can search for click data before or after a
20
- * specific date or between two specific dates.
21
- * <p>
22
- * The following example returns a result set containing click data for the specified mailing and fetches the email
23
- * address of the recipients:
24
- *
25
- * <pre>
26
- * $oDataAccess = $oSession->getDataAccess();
27
- * $oClickData = $oDataAccess->getClickData();
28
- * $oRecipientContext = $oSession->createRecipientContext();
29
- * $oEmail = $oRecipientContext->getMetaData()->getEmailAttribute();
30
- * ...
31
- * $oClickDataRowSet = $oClickData->selectByMailing( $iMailingId, $oRecipientContext, array($oEmail) );
32
- * </pre>
33
- *
34
- * For more information on the data available for clicks, see the <i>Inx_Api_DataAccess_ClickDataRowSet</i> documentation.
35
- *
36
- * @see Inx_Api_DataAccess_DataAccess
37
- * @see Inx_Api_DataAccess_ClickDataRowSet
38
- * @since API 1.4.0
39
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
40
- * @package Inxmail
41
- * @subpackage DataAccess
42
- */
43
- interface Inx_Api_DataAccess_ClickData
44
- {
45
-
46
- /**
47
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
48
- * regarding the specified mailing.
49
- * If there is no click data, an empty row set will be returned.
50
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
51
- * array contains at least one element, the retrieved click data will contain information about the recipient
52
- * state and the specified recipient attributes.
53
- *
54
- * @param int $iMailingId the id of the mailing.
55
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
56
- * See <i>Inx_Api_Session->createRecipientContext()</i>
57
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
58
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
59
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
60
- * the data produced by the given query.
61
- */
62
- public function selectByMailing( $iMailingId, Inx_Api_Recipient_RecipientContext $oRc,array $aAttrs = null);
63
-
64
-
65
- /**
66
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
67
- * regarding the specified mailing which occurred before the specified date.
68
- * If there is no click data, an empty row set will be returned.
69
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
70
- * array contains at least one element, the retrieved click data will contain information about the recipient
71
- * state and the specified recipient attributes.
72
- *
73
- * @param int $iMailingId the id of the mailing.
74
- * @param string $dtSearchDate all clicks before this date will be selected.
75
- * The date has to be formatted as ISO 8601 date string.
76
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
77
- * See <i>Inx_Api_Session->createRecipientContext()</i>
78
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
79
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
80
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
81
- * the data produced by the given query.
82
- * @since API 1.6.2
83
- */
84
- public function selectByMailingBefore( $iMailingId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc,array $aAttrs = null);
85
-
86
- /**
87
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
88
- * regarding the specified mailing which occurred after the specified date.
89
- * If there is no click data, an empty row set will be returned.
90
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
91
- * array contains at least one element, the retrieved click data will contain information about the recipient
92
- * state and the specified recipient attributes.
93
- *
94
- * @param int $iMailingId the id of the mailing.
95
- * @param string $dtSearchDate all clicks after this date will be selected.
96
- * The date has to be formatted as ISO 8601 date string.
97
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
98
- * See <i>Inx_Api_Session->createRecipientContext()</i>
99
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
100
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
101
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
102
- * the data produced by the given query.
103
- * @since API 1.6.2
104
- */
105
- public function selectByMailingAfter( $iMailingId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc,array $aAttrs = null);
106
-
107
-
108
- /**
109
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
110
- * regarding the specified mailing which occurred between the specified dates.
111
- * If there is no click data, an empty row set will be returned.
112
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
113
- * array contains at least one element, the retrieved click data will contain information about the recipient
114
- * state and the specified recipient attributes.
115
- *
116
- * @param int $iMailingId the id of the mailing.
117
- * @param string $dtStartDate the start date for the search.
118
- * The date has to be formatted as ISO 8601 date string.
119
- * @param string $dtEndDate the end date for the search.
120
- * The date has to be formatted as ISO 8601 date string.
121
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
122
- * See <i>Inx_Api_Session->createRecipientContext()</i>
123
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
124
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
125
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
126
- * the data produced by the given query.
127
- * @since API 1.6.2
128
- */
129
- public function selectByMailingBetween( $iMailingId, $dtStartDate, $dtEndDate, Inx_Api_Recipient_RecipientContext $oRc,array $aAttrs = null);
130
-
131
-
132
-
133
- /**
134
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
135
- * regarding the specified link.
136
- * If there is no click data, an empty row set will be returned.
137
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
138
- * array contains at least one element, the retrieved click data will contain information about the recipient
139
- * state and the specified recipient attributes.
140
- *
141
- * @param int $iLinkId the id of the link.
142
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
143
- * See <i>Inx_Api_Session->createRecipientContext()</i>
144
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
145
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
146
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
147
- * the data produced by the given query.
148
- */
149
- public function selectByLink( $iLinkId,Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
150
-
151
-
152
- /**
153
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
154
- * regarding the specified link which occurred before the specified date.
155
- * If there is no click data, an empty row set will be returned.
156
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
157
- * array contains at least one element, the retrieved click data will contain information about the recipient
158
- * state and the specified recipient attributes.
159
- *
160
- * @param int $iLinkId the id of the link.
161
- * @param string $dtSearchDate all clicks before this date will be selected.
162
- * The date has to be formatted as ISO 8601 date string.
163
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
164
- * See <i>Inx_Api_Session->createRecipientContext()</i>
165
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
166
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
167
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
168
- * the data produced by the given query.
169
- * @since API 1.6.2
170
- */
171
- public function selectByLinkBefore( $iLinkId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
172
-
173
- /**
174
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
175
- * regarding the specified link which occurred after the specified date.
176
- * If there is no click data, an empty row set will be returned.
177
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
178
- * array contains at least one element, the retrieved click data will contain information about the recipient
179
- * state and the specified recipient attributes.
180
- *
181
- * @param int $iLinkId the id of the link.
182
- * @param string $dtSearchDate all clicks after this date will be selected.
183
- * The date has to be formatted as ISO 8601 date string.
184
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
185
- * See <i>Inx_Api_Session->createRecipientContext()</i>
186
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
187
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
188
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
189
- * the data produced by the given query.
190
- * @since API 1.6.2
191
- */
192
- public function selectByLinkAfter( $iLinkId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
193
-
194
- /**
195
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
196
- * regarding the specified link which occurred between the specified dates.
197
- * If there is no click data, an empty row set will be returned.
198
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
199
- * array contains at least one element, the retrieved click data will contain information about the recipient
200
- * state and the specified recipient attributes.
201
- *
202
- * @param int $iLinkId the id of the link.
203
- * @param string $dtStartDate the start date for the search.
204
- * The date has to be formatted as ISO 8601 date string.
205
- * @param string $dtEndDate the end date for the search.
206
- * The date has to be formatted as ISO 8601 date string.
207
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
208
- * See <i>Inx_Api_Session->createRecipientContext()</i>
209
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
210
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
211
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
212
- * the data produced by the given query.
213
- * @since API 1.6.2
214
- */
215
- public function selectByLinkBetween( $iLinkId, $dtStartDate, $dtEndDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
216
-
217
- /**
218
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
219
- * regarding the specified recipient.
220
- * If there is no click data, an empty row set will be returned.
221
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
222
- * array contains at least one element, the retrieved click data will contain information about the recipient
223
- * state and the specified recipient attributes.
224
- *
225
- * @param int $iRecipientId the id of the recipient.
226
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
227
- * See <i>Inx_Api_Session->createRecipientContext()</i>
228
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
229
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
230
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
231
- * the data produced by the given query.
232
- */
233
- public function selectByRecipient( $iRecipientId, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
234
-
235
- /**
236
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
237
- * regarding the specified recipient which occurred before the specified date.
238
- * If there is no click data, an empty row set will be returned.
239
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
240
- * array contains at least one element, the retrieved click data will contain information about the recipient
241
- * state and the specified recipient attributes.
242
- *
243
- * @param int $iRecipientId the id of the recipient.
244
- * @param string $dtSearchDate all clicks before this date will be selected.
245
- * The date has to be formatted as ISO 8601 date string.
246
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
247
- * See <i>Inx_Api_Session->createRecipientContext()</i>
248
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
249
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
250
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
251
- * the data produced by the given query.
252
- * @since API 1.6.2
253
- */
254
- public function selectByRecipientBefore( $iRecipientId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
255
-
256
-
257
- /**
258
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
259
- * regarding the specified recipient which occurred after the specified date.
260
- * If there is no click data, an empty row set will be returned.
261
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
262
- * array contains at least one element, the retrieved click data will contain information about the recipient
263
- * state and the specified recipient attributes.
264
- *
265
- * @param int $iRecipientId the id of the recipient.
266
- * @param string $dtSearchDate all clicks after this date will be selected.
267
- * The date has to be formatted as ISO 8601 date string.
268
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
269
- * See <i>Inx_Api_Session->createRecipientContext()</i>
270
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
271
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
272
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
273
- * the data produced by the given query.
274
- * @since API 1.6.2
275
- */
276
- public function selectByRecipientAfter( $iRecipientId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
277
-
278
- /**
279
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
280
- * regarding the specified recipient which occurred between the specified dates.
281
- * If there is no click data, an empty row set will be returned.
282
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
283
- * array contains at least one element, the retrieved click data will contain information about the recipient
284
- * state and the specified recipient attributes.
285
- *
286
- * @param int $iRecipientId the id of the recipient.
287
- * @param string $dtStartDate the start date for the search.
288
- * The date has to be formatted as ISO 8601 date string.
289
- * @param string $dtEndDate the end date for the search.
290
- * The date has to be formatted as ISO 8601 date string.
291
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
292
- * See <i>Inx_Api_Session->createRecipientContext()</i>
293
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
294
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
295
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
296
- * the data produced by the given query.
297
- * @since API 1.6.2
298
- */
299
- public function selectByRecipientBetween( $iRecipientId, $dtStartDate, $dtEndDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
300
-
301
-
302
- /**
303
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
304
- * regarding the specified recipient and mailing.
305
- * If there is no click data, an empty row set will be returned.
306
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
307
- * array contains at least one element, the retrieved click data will contain information about the recipient
308
- * state and the specified recipient attributes.
309
- *
310
- * @param int $iRecipientId the id of the recipient.
311
- * @param int $iMailingId the id of the mailing.
312
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
313
- * See <i>Inx_Api_Session->createRecipientContext()</i>
314
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
315
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
316
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
317
- * the data produced by the given query.
318
- */
319
- public function selectByRecipientAndMailing( $iRecipientId, $iMailingId, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null);
320
-
321
- /**
322
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
323
- * regarding the specified recipient and mailing which occurred before the specified date.
324
- * If there is no click data, an empty row set will be returned.
325
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
326
- * array contains at least one element, the retrieved click data will contain information about the recipient
327
- * state and the specified recipient attributes.
328
- *
329
- * @param int $iRecipientId the id of the recipient.
330
- * @param int $iMailingId the id of the mailing.
331
- * @param string $dtSearchDate all clicks before this date will be selected.
332
- * The date has to be formatted as ISO 8601 date string.
333
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
334
- * See <i>Inx_Api_Session->createRecipientContext()</i>
335
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
336
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
337
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
338
- * the data produced by the given query.
339
- * @since API 1.6.2
340
- */
341
- public function selectByRecipientAndMailingBefore( $iRecipientId, $iMailingId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null);
342
-
343
- /**
344
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
345
- * regarding the specified recipient and mailing which occurred after the specified date.
346
- * If there is no click data, an empty row set will be returned.
347
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
348
- * array contains at least one element, the retrieved click data will contain information about the recipient
349
- * state and the specified recipient attributes.
350
- *
351
- * @param int $iRecipientId the id of the recipient.
352
- * @param int $iMailingId the id of the mailing.
353
- * @param string $dtSearchDate all clicks after this date will be selected.
354
- * The date has to be formatted as ISO 8601 date string.
355
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
356
- * See <i>Inx_Api_Session->createRecipientContext()</i>
357
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
358
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
359
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
360
- * the data produced by the given query.
361
- * @since API 1.6.2
362
- */
363
- public function selectByRecipientAndMailingAfter( $iRecipientId, $iMailingId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null);
364
-
365
- /**
366
- * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
367
- * regarding the specified recipient and mailing which occurred between the specified dates.
368
- * If there is no click data, an empty row set will be returned.
369
- * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
370
- * array contains at least one element, the retrieved click data will contain information about the recipient
371
- * state and the specified recipient attributes.
372
- *
373
- * @param int $iRecipientId the id of the recipient.
374
- * @param int $iMailingId the id of the mailing.
375
- * @param string $dtStartDate the start date for the search.
376
- * The date has to be formatted as ISO 8601 date string.
377
- * @param string $dtEndDate the end date for the search.
378
- * The date has to be formatted as ISO 8601 date string.
379
- * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
380
- * See <i>Inx_Api_Session->createRecipientContext()</i>
381
- * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
382
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>
383
- * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
384
- * the data produced by the given query.
385
- * @since API 1.6.2
386
- */
387
- public function selectByRecipientAndMailingBetween( $iRecipientId, $iMailingId, $dtStartDate, $dtEndDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null);
388
-
389
-
390
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DataAccess
5
+ */
6
+
7
+
8
+ /**
9
+ * An <i>Inx_Api_DataAccess_ClickData</i> object can be used to retrieve information about a specific click
10
+ * accessible through an <i>Inx_Api_DataAccess_ClickDataRowSet</i>.
11
+ * A row set can be obtained using various filters:
12
+ * <ul>
13
+ * <li>mailing: <i>selectByMailing(int, RecipientContext, Attribute[])</i>
14
+ * <li>link: <i>selectByLink(int, RecipientContext, Attribute[])</i>
15
+ * <li>recipient: <i>selectByRecipient(int, RecipientContext, Attribute[])</i>
16
+ * <li>recipient and mailing: <i>selectByRecipientAndMailing(int, int, RecipientContext, Attribute[])</i>
17
+ * </ul>
18
+ * <p>
19
+ * All of these methods offer variants to filter the result by date. You can search for click data before or after a
20
+ * specific date or between two specific dates.
21
+ * <p>
22
+ * The following example returns a result set containing click data for the specified mailing and fetches the email
23
+ * address of the recipients:
24
+ *
25
+ * <pre>
26
+ * $oDataAccess = $oSession->getDataAccess();
27
+ * $oClickData = $oDataAccess->getClickData();
28
+ * $oRecipientContext = $oSession->createRecipientContext();
29
+ * $oEmail = $oRecipientContext->getMetaData()->getEmailAttribute();
30
+ * ...
31
+ * $oClickDataRowSet = $oClickData->selectByMailing( $iMailingId, $oRecipientContext, array($oEmail) );
32
+ * </pre>
33
+ *
34
+ * For more information on the data available for clicks, see the <i>Inx_Api_DataAccess_ClickDataRowSet</i> documentation.
35
+ *
36
+ * @see Inx_Api_DataAccess_DataAccess
37
+ * @see Inx_Api_DataAccess_ClickDataRowSet
38
+ * @since API 1.4.0
39
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
40
+ * @package Inxmail
41
+ * @subpackage DataAccess
42
+ */
43
+ interface Inx_Api_DataAccess_ClickData
44
+ {
45
+
46
+ /**
47
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
48
+ * regarding the specified mailing.
49
+ * If there is no click data, an empty row set will be returned.
50
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
51
+ * array contains at least one element, the retrieved click data will contain information about the recipient
52
+ * state and the specified recipient attributes.
53
+ *
54
+ * @param int $iMailingId the id of the mailing.
55
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
56
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
57
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
58
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
59
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
60
+ * the data produced by the given query.
61
+ */
62
+ public function selectByMailing( $iMailingId, Inx_Api_Recipient_RecipientContext $oRc,array $aAttrs = null);
63
+
64
+
65
+ /**
66
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
67
+ * regarding the specified mailing which occurred before the specified date.
68
+ * If there is no click data, an empty row set will be returned.
69
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
70
+ * array contains at least one element, the retrieved click data will contain information about the recipient
71
+ * state and the specified recipient attributes.
72
+ *
73
+ * @param int $iMailingId the id of the mailing.
74
+ * @param string $dtSearchDate all clicks before this date will be selected.
75
+ * The date has to be formatted as ISO 8601 date string.
76
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
77
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
78
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
79
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
80
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
81
+ * the data produced by the given query.
82
+ * @since API 1.6.2
83
+ */
84
+ public function selectByMailingBefore( $iMailingId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc,array $aAttrs = null);
85
+
86
+ /**
87
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
88
+ * regarding the specified mailing which occurred after the specified date.
89
+ * If there is no click data, an empty row set will be returned.
90
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
91
+ * array contains at least one element, the retrieved click data will contain information about the recipient
92
+ * state and the specified recipient attributes.
93
+ *
94
+ * @param int $iMailingId the id of the mailing.
95
+ * @param string $dtSearchDate all clicks after this date will be selected.
96
+ * The date has to be formatted as ISO 8601 date string.
97
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
98
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
99
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
100
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
101
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
102
+ * the data produced by the given query.
103
+ * @since API 1.6.2
104
+ */
105
+ public function selectByMailingAfter( $iMailingId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc,array $aAttrs = null);
106
+
107
+
108
+ /**
109
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
110
+ * regarding the specified mailing which occurred between the specified dates.
111
+ * If there is no click data, an empty row set will be returned.
112
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
113
+ * array contains at least one element, the retrieved click data will contain information about the recipient
114
+ * state and the specified recipient attributes.
115
+ *
116
+ * @param int $iMailingId the id of the mailing.
117
+ * @param string $dtStartDate the start date for the search.
118
+ * The date has to be formatted as ISO 8601 date string.
119
+ * @param string $dtEndDate the end date for the search.
120
+ * The date has to be formatted as ISO 8601 date string.
121
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
122
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
123
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
124
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
125
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
126
+ * the data produced by the given query.
127
+ * @since API 1.6.2
128
+ */
129
+ public function selectByMailingBetween( $iMailingId, $dtStartDate, $dtEndDate, Inx_Api_Recipient_RecipientContext $oRc,array $aAttrs = null);
130
+
131
+
132
+
133
+ /**
134
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
135
+ * regarding the specified link.
136
+ * If there is no click data, an empty row set will be returned.
137
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
138
+ * array contains at least one element, the retrieved click data will contain information about the recipient
139
+ * state and the specified recipient attributes.
140
+ *
141
+ * @param int $iLinkId the id of the link.
142
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
143
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
144
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
145
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
146
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
147
+ * the data produced by the given query.
148
+ */
149
+ public function selectByLink( $iLinkId,Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
150
+
151
+
152
+ /**
153
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
154
+ * regarding the specified link which occurred before the specified date.
155
+ * If there is no click data, an empty row set will be returned.
156
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
157
+ * array contains at least one element, the retrieved click data will contain information about the recipient
158
+ * state and the specified recipient attributes.
159
+ *
160
+ * @param int $iLinkId the id of the link.
161
+ * @param string $dtSearchDate all clicks before this date will be selected.
162
+ * The date has to be formatted as ISO 8601 date string.
163
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
164
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
165
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
166
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
167
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
168
+ * the data produced by the given query.
169
+ * @since API 1.6.2
170
+ */
171
+ public function selectByLinkBefore( $iLinkId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
172
+
173
+ /**
174
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
175
+ * regarding the specified link which occurred after the specified date.
176
+ * If there is no click data, an empty row set will be returned.
177
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
178
+ * array contains at least one element, the retrieved click data will contain information about the recipient
179
+ * state and the specified recipient attributes.
180
+ *
181
+ * @param int $iLinkId the id of the link.
182
+ * @param string $dtSearchDate all clicks after this date will be selected.
183
+ * The date has to be formatted as ISO 8601 date string.
184
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
185
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
186
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
187
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
188
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
189
+ * the data produced by the given query.
190
+ * @since API 1.6.2
191
+ */
192
+ public function selectByLinkAfter( $iLinkId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
193
+
194
+ /**
195
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
196
+ * regarding the specified link which occurred between the specified dates.
197
+ * If there is no click data, an empty row set will be returned.
198
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
199
+ * array contains at least one element, the retrieved click data will contain information about the recipient
200
+ * state and the specified recipient attributes.
201
+ *
202
+ * @param int $iLinkId the id of the link.
203
+ * @param string $dtStartDate the start date for the search.
204
+ * The date has to be formatted as ISO 8601 date string.
205
+ * @param string $dtEndDate the end date for the search.
206
+ * The date has to be formatted as ISO 8601 date string.
207
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
208
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
209
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
210
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
211
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
212
+ * the data produced by the given query.
213
+ * @since API 1.6.2
214
+ */
215
+ public function selectByLinkBetween( $iLinkId, $dtStartDate, $dtEndDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
216
+
217
+ /**
218
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
219
+ * regarding the specified recipient.
220
+ * If there is no click data, an empty row set will be returned.
221
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
222
+ * array contains at least one element, the retrieved click data will contain information about the recipient
223
+ * state and the specified recipient attributes.
224
+ *
225
+ * @param int $iRecipientId the id of the recipient.
226
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
227
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
228
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
229
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
230
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
231
+ * the data produced by the given query.
232
+ */
233
+ public function selectByRecipient( $iRecipientId, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
234
+
235
+ /**
236
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
237
+ * regarding the specified recipient which occurred before the specified date.
238
+ * If there is no click data, an empty row set will be returned.
239
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
240
+ * array contains at least one element, the retrieved click data will contain information about the recipient
241
+ * state and the specified recipient attributes.
242
+ *
243
+ * @param int $iRecipientId the id of the recipient.
244
+ * @param string $dtSearchDate all clicks before this date will be selected.
245
+ * The date has to be formatted as ISO 8601 date string.
246
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
247
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
248
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
249
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
250
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
251
+ * the data produced by the given query.
252
+ * @since API 1.6.2
253
+ */
254
+ public function selectByRecipientBefore( $iRecipientId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
255
+
256
+
257
+ /**
258
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
259
+ * regarding the specified recipient which occurred after the specified date.
260
+ * If there is no click data, an empty row set will be returned.
261
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
262
+ * array contains at least one element, the retrieved click data will contain information about the recipient
263
+ * state and the specified recipient attributes.
264
+ *
265
+ * @param int $iRecipientId the id of the recipient.
266
+ * @param string $dtSearchDate all clicks after this date will be selected.
267
+ * The date has to be formatted as ISO 8601 date string.
268
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
269
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
270
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
271
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
272
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
273
+ * the data produced by the given query.
274
+ * @since API 1.6.2
275
+ */
276
+ public function selectByRecipientAfter( $iRecipientId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
277
+
278
+ /**
279
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
280
+ * regarding the specified recipient which occurred between the specified dates.
281
+ * If there is no click data, an empty row set will be returned.
282
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
283
+ * array contains at least one element, the retrieved click data will contain information about the recipient
284
+ * state and the specified recipient attributes.
285
+ *
286
+ * @param int $iRecipientId the id of the recipient.
287
+ * @param string $dtStartDate the start date for the search.
288
+ * The date has to be formatted as ISO 8601 date string.
289
+ * @param string $dtEndDate the end date for the search.
290
+ * The date has to be formatted as ISO 8601 date string.
291
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
292
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
293
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
294
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
295
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
296
+ * the data produced by the given query.
297
+ * @since API 1.6.2
298
+ */
299
+ public function selectByRecipientBetween( $iRecipientId, $dtStartDate, $dtEndDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null );
300
+
301
+
302
+ /**
303
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
304
+ * regarding the specified recipient and mailing.
305
+ * If there is no click data, an empty row set will be returned.
306
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
307
+ * array contains at least one element, the retrieved click data will contain information about the recipient
308
+ * state and the specified recipient attributes.
309
+ *
310
+ * @param int $iRecipientId the id of the recipient.
311
+ * @param int $iMailingId the id of the mailing.
312
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
313
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
314
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
315
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
316
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
317
+ * the data produced by the given query.
318
+ */
319
+ public function selectByRecipientAndMailing( $iRecipientId, $iMailingId, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null);
320
+
321
+ /**
322
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
323
+ * regarding the specified recipient and mailing which occurred before the specified date.
324
+ * If there is no click data, an empty row set will be returned.
325
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
326
+ * array contains at least one element, the retrieved click data will contain information about the recipient
327
+ * state and the specified recipient attributes.
328
+ *
329
+ * @param int $iRecipientId the id of the recipient.
330
+ * @param int $iMailingId the id of the mailing.
331
+ * @param string $dtSearchDate all clicks before this date will be selected.
332
+ * The date has to be formatted as ISO 8601 date string.
333
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
334
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
335
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
336
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
337
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
338
+ * the data produced by the given query.
339
+ * @since API 1.6.2
340
+ */
341
+ public function selectByRecipientAndMailingBefore( $iRecipientId, $iMailingId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null);
342
+
343
+ /**
344
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
345
+ * regarding the specified recipient and mailing which occurred after the specified date.
346
+ * If there is no click data, an empty row set will be returned.
347
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
348
+ * array contains at least one element, the retrieved click data will contain information about the recipient
349
+ * state and the specified recipient attributes.
350
+ *
351
+ * @param int $iRecipientId the id of the recipient.
352
+ * @param int $iMailingId the id of the mailing.
353
+ * @param string $dtSearchDate all clicks after this date will be selected.
354
+ * The date has to be formatted as ISO 8601 date string.
355
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
356
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
357
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
358
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
359
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
360
+ * the data produced by the given query.
361
+ * @since API 1.6.2
362
+ */
363
+ public function selectByRecipientAndMailingAfter( $iRecipientId, $iMailingId, $dtSearchDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null);
364
+
365
+ /**
366
+ * This method returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing information about all clicks
367
+ * regarding the specified recipient and mailing which occurred between the specified dates.
368
+ * If there is no click data, an empty row set will be returned.
369
+ * If the <i>Inx_Api_Recipielt_RecipientContext</i> is not null and the <i>Inx_Api_Recipient_Attribute</i>
370
+ * array contains at least one element, the retrieved click data will contain information about the recipient
371
+ * state and the specified recipient attributes.
372
+ *
373
+ * @param int $iRecipientId the id of the recipient.
374
+ * @param int $iMailingId the id of the mailing.
375
+ * @param string $dtStartDate the start date for the search.
376
+ * The date has to be formatted as ISO 8601 date string.
377
+ * @param string $dtEndDate the end date for the search.
378
+ * The date has to be formatted as ISO 8601 date string.
379
+ * @param Inx_Api_Recipient_RecipientContext $oRc the recipient context.
380
+ * See <i>Inx_Api_Session->createRecipientContext()</i>
381
+ * @param array $aAttrs an array of <i>Inx_Api_Recipient_Attribute</i>s that will be fetched for later retrieval.
382
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>
383
+ * @return Inx_Api_DataAccess_ClickDataRowSet an <i>Inx_Api_DataAccess_ClickDataRowSet</i> object that contains
384
+ * the data produced by the given query.
385
+ * @since API 1.6.2
386
+ */
387
+ public function selectByRecipientAndMailingBetween( $iRecipientId, $iMailingId, $dtStartDate, $dtEndDate, Inx_Api_Recipient_RecipientContext $oRc, array $aAttrs = null);
388
+
389
+
390
+ }
lib/Inx/Api/DataAccess/ClickDataRowSet.php CHANGED
@@ -1,209 +1,209 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DataAccess
5
- */
6
- /**
7
- * An <i>Inx_Api_DataAccess_ClickDataRowSet</i> is used to access rows of click data resulting from a query.
8
- * <p>
9
- * The following data can be retrieved:
10
- * <ul>
11
- * <li><i>Click id</i>: the unique identifier of the click.
12
- * <li><i>Link id</i>: which link was clicked?
13
- * <li><i>Recipient id</i>: which recipient clicked the link?
14
- * <li><i>Click date</i>: when did the click occur?
15
- * <li><i>User agent</i>: which user agent was used by the recipient?
16
- * <li><i>Remote host</i>: the recipients host address.
17
- * <li><i>Recipient data</i>: various data about the recipient (like state or attributes).
18
- * </ul>
19
- * The recipient state can be one of the following:
20
- * <ul>
21
- * <li>RECIPIENT_STATE_UNKNOWN - if the click is anonymous or no attributes are queried.
22
- * <li>RECIPIENT_STATE_EXISTENT - if the recipient exists.
23
- * <li>RECIPIENT_STATE_DELETED - if the recipient was deleted.
24
- * </ul>
25
- * For information on how to navigate through an <i>Inx_Api_DataAccess_ClickDataRowSet</i>, see the
26
- * <i>Inx_Api_DataAccess_DataRowSet</i> documentation.
27
- * <p>
28
- * For an example on how to query click data, see the <i>Inx_Api_DataAccess_ClickData</i> documentation.
29
- * <p>
30
- *
31
- * @see Inx_Api_DataAccess_ClickData
32
- * @see Inx_Api_DataAccess_DataRowSet
33
- * @since API 1.4.0
34
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
35
- * @package Inxmail
36
- * @subpackage DataAccess
37
- */
38
- interface Inx_Api_DataAccess_ClickDataRowSet extends Inx_Api_DataAccess_DataRowSet
39
- {
40
- /**
41
- * State for missing recipient information. This state will be used when no <i>Inx_Api_Recipient_RecipientContext</i>
42
- * and/or no attributes are specified in the query or in case of an unknown recipient.
43
- */
44
- const RECIPIENT_STATE_UNKNOWN = 0;
45
-
46
- /** State for existent recipient. */
47
- const RECIPIENT_STATE_EXISTENT = 1;
48
-
49
- /** State for non existing (deleted) recipient. */
50
- const RECIPIENT_STATE_DELETED = 2;
51
-
52
-
53
- /**
54
- * Returns the unique identifier for the current click.
55
- *
56
- * @return int the id of the current click.
57
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
58
- */
59
- public function getClickId();
60
-
61
-
62
- /**
63
- * Returns the timestamp (date) when the current click occurred.
64
- *
65
- * @return string the timestamp (date) of the current click. The date will be returned as ISO 8601 formatted date string.
66
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
67
- */
68
- public function getClickTimestamp();
69
-
70
-
71
- /**
72
- * Returns the remote host which triggered the current click.
73
- *
74
- * @return string the remote host of the current click.
75
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
76
- */
77
- public function getRemoteHost();
78
-
79
- /**
80
- * Returns the user agent which was used for the current click.
81
- *
82
- * @return string the user agent of the current click.
83
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
84
- */
85
- public function getUserAgent();
86
-
87
-
88
- /**
89
- * Returns the id of the link which was clicked.
90
- *
91
- * @return int the link id of the current click.
92
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
93
- */
94
- public function getLinkId();
95
-
96
- /**
97
- * Returns the id of the recipient who performed the current click.
98
- *
99
- * @return int the recipient id of the current click.
100
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
101
- */
102
- public function getRecipientId();
103
-
104
- /**
105
- * Returns the state of the recipient who performed the current click.
106
- * The possible recipient states are:
107
- * <ul>
108
- * <li>RECIPIENT_STATE_UNKNOWN - if the click is anonymous or no attributes are queried.
109
- * <li>RECIPIENT_STATE_EXISTENT - if the recipient exists.
110
- * <li>RECIPIENT_STATE_DELETED - if the recipient was deleted.
111
- * </ul>
112
- *
113
- * @return int the recipient state.
114
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
115
- */
116
- public function getRecipientState();
117
-
118
-
119
- /**
120
- * Returns the integer value for the given recipient Attribute.
121
- *
122
- * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
123
- * @return int the integer value.
124
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
125
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>int</i>.
126
- * @throws DataException if no row is selected (e.g. you forgot to call next()).
127
- */
128
- public function getInteger(Inx_Api_Recipient_Attribute $oAttr );
129
-
130
-
131
- /**
132
- * Returns the string value for the given recipient Attribute.
133
- *
134
- * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
135
- * @return string the string value.
136
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
137
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
138
- * @throws DataException if no row is selected (e.g. you forgot to call next()).
139
- */
140
- public function getString(Inx_Api_Recipient_Attribute $oAttr );
141
-
142
-
143
- /**
144
- * Returns the datetime value for the given recipient Attribute.
145
- *
146
- * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
147
- * @return string the datetime value as ISO 8601 formatted datetime string.
148
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
149
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
150
- * @throws DataException if no row is selected (e.g. you forgot to call next()).
151
- */
152
- public function getDatetime(Inx_Api_Recipient_Attribute $oAttr );
153
-
154
- /**
155
- * Returns the date value for the given recipient Attribute.
156
- *
157
- * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
158
- * @return string the datetime value as ISO 8601 formatted date string.
159
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
160
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
161
- * @throws DataException if no row is selected (e.g. you forgot to call next()).
162
- */
163
- public function getDate(Inx_Api_Recipient_Attribute $oAttr );
164
-
165
-
166
- /**
167
- * Returns the time value for the given recipient Attribute.
168
- *
169
- * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
170
- * @return string the time value as ISO 8601 formatted time string.
171
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
172
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
173
- * @throws DataException if no row is selected (e.g. you forgot to call next()).
174
- */
175
- public function getTime(Inx_Api_Recipient_Attribute $oAttr );
176
-
177
- /**
178
- * Returns the double value for the given recipient Attribute.
179
- *
180
- * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
181
- * @return double the double value.
182
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
183
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>double</i>.
184
- * @throws DataException if no row is selected (e.g. you forgot to call next()).
185
- */
186
- public function getDouble(Inx_Api_Recipient_Attribute $oAttr );
187
-
188
- /**
189
- * Returns the bool value for the given recipient Attribute.
190
- *
191
- * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
192
- * @return bool the bool value.
193
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
194
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
195
- * @throws DataException if no row is selected (e.g. you forgot to call next()).
196
- */
197
- public function getBoolean(Inx_Api_Recipient_Attribute $oAttr );
198
-
199
- /**
200
- * Returns the value for the given recipient Attribute.
201
- *
202
- * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
203
- * @return mixed the value.
204
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
205
- * @throws DataException if no row is selected (e.g. you forgot to call next()).
206
- */
207
- public function getObject(Inx_Api_Recipient_Attribute $oAttr);
208
-
209
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DataAccess
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_DataAccess_ClickDataRowSet</i> is used to access rows of click data resulting from a query.
8
+ * <p>
9
+ * The following data can be retrieved:
10
+ * <ul>
11
+ * <li><i>Click id</i>: the unique identifier of the click.
12
+ * <li><i>Link id</i>: which link was clicked?
13
+ * <li><i>Recipient id</i>: which recipient clicked the link?
14
+ * <li><i>Click date</i>: when did the click occur?
15
+ * <li><i>User agent</i>: which user agent was used by the recipient?
16
+ * <li><i>Remote host</i>: the recipients host address.
17
+ * <li><i>Recipient data</i>: various data about the recipient (like state or attributes).
18
+ * </ul>
19
+ * The recipient state can be one of the following:
20
+ * <ul>
21
+ * <li>RECIPIENT_STATE_UNKNOWN - if the click is anonymous or no attributes are queried.
22
+ * <li>RECIPIENT_STATE_EXISTENT - if the recipient exists.
23
+ * <li>RECIPIENT_STATE_DELETED - if the recipient was deleted.
24
+ * </ul>
25
+ * For information on how to navigate through an <i>Inx_Api_DataAccess_ClickDataRowSet</i>, see the
26
+ * <i>Inx_Api_DataAccess_DataRowSet</i> documentation.
27
+ * <p>
28
+ * For an example on how to query click data, see the <i>Inx_Api_DataAccess_ClickData</i> documentation.
29
+ * <p>
30
+ *
31
+ * @see Inx_Api_DataAccess_ClickData
32
+ * @see Inx_Api_DataAccess_DataRowSet
33
+ * @since API 1.4.0
34
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
35
+ * @package Inxmail
36
+ * @subpackage DataAccess
37
+ */
38
+ interface Inx_Api_DataAccess_ClickDataRowSet extends Inx_Api_DataAccess_DataRowSet
39
+ {
40
+ /**
41
+ * State for missing recipient information. This state will be used when no <i>Inx_Api_Recipient_RecipientContext</i>
42
+ * and/or no attributes are specified in the query or in case of an unknown recipient.
43
+ */
44
+ const RECIPIENT_STATE_UNKNOWN = 0;
45
+
46
+ /** State for existent recipient. */
47
+ const RECIPIENT_STATE_EXISTENT = 1;
48
+
49
+ /** State for non existing (deleted) recipient. */
50
+ const RECIPIENT_STATE_DELETED = 2;
51
+
52
+
53
+ /**
54
+ * Returns the unique identifier for the current click.
55
+ *
56
+ * @return int the id of the current click.
57
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
58
+ */
59
+ public function getClickId();
60
+
61
+
62
+ /**
63
+ * Returns the timestamp (date) when the current click occurred.
64
+ *
65
+ * @return string the timestamp (date) of the current click. The date will be returned as ISO 8601 formatted date string.
66
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
67
+ */
68
+ public function getClickTimestamp();
69
+
70
+
71
+ /**
72
+ * Returns the remote host which triggered the current click.
73
+ *
74
+ * @return string the remote host of the current click.
75
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
76
+ */
77
+ public function getRemoteHost();
78
+
79
+ /**
80
+ * Returns the user agent which was used for the current click.
81
+ *
82
+ * @return string the user agent of the current click.
83
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
84
+ */
85
+ public function getUserAgent();
86
+
87
+
88
+ /**
89
+ * Returns the id of the link which was clicked.
90
+ *
91
+ * @return int the link id of the current click.
92
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
93
+ */
94
+ public function getLinkId();
95
+
96
+ /**
97
+ * Returns the id of the recipient who performed the current click.
98
+ *
99
+ * @return int the recipient id of the current click.
100
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
101
+ */
102
+ public function getRecipientId();
103
+
104
+ /**
105
+ * Returns the state of the recipient who performed the current click.
106
+ * The possible recipient states are:
107
+ * <ul>
108
+ * <li>RECIPIENT_STATE_UNKNOWN - if the click is anonymous or no attributes are queried.
109
+ * <li>RECIPIENT_STATE_EXISTENT - if the recipient exists.
110
+ * <li>RECIPIENT_STATE_DELETED - if the recipient was deleted.
111
+ * </ul>
112
+ *
113
+ * @return int the recipient state.
114
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
115
+ */
116
+ public function getRecipientState();
117
+
118
+
119
+ /**
120
+ * Returns the integer value for the given recipient Attribute.
121
+ *
122
+ * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
123
+ * @return int the integer value.
124
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
125
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>int</i>.
126
+ * @throws DataException if no row is selected (e.g. you forgot to call next()).
127
+ */
128
+ public function getInteger(Inx_Api_Recipient_Attribute $oAttr );
129
+
130
+
131
+ /**
132
+ * Returns the string value for the given recipient Attribute.
133
+ *
134
+ * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
135
+ * @return string the string value.
136
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
137
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
138
+ * @throws DataException if no row is selected (e.g. you forgot to call next()).
139
+ */
140
+ public function getString(Inx_Api_Recipient_Attribute $oAttr );
141
+
142
+
143
+ /**
144
+ * Returns the datetime value for the given recipient Attribute.
145
+ *
146
+ * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
147
+ * @return string the datetime value as ISO 8601 formatted datetime string.
148
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
149
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
150
+ * @throws DataException if no row is selected (e.g. you forgot to call next()).
151
+ */
152
+ public function getDatetime(Inx_Api_Recipient_Attribute $oAttr );
153
+
154
+ /**
155
+ * Returns the date value for the given recipient Attribute.
156
+ *
157
+ * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
158
+ * @return string the datetime value as ISO 8601 formatted date string.
159
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
160
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
161
+ * @throws DataException if no row is selected (e.g. you forgot to call next()).
162
+ */
163
+ public function getDate(Inx_Api_Recipient_Attribute $oAttr );
164
+
165
+
166
+ /**
167
+ * Returns the time value for the given recipient Attribute.
168
+ *
169
+ * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
170
+ * @return string the time value as ISO 8601 formatted time string.
171
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
172
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
173
+ * @throws DataException if no row is selected (e.g. you forgot to call next()).
174
+ */
175
+ public function getTime(Inx_Api_Recipient_Attribute $oAttr );
176
+
177
+ /**
178
+ * Returns the double value for the given recipient Attribute.
179
+ *
180
+ * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
181
+ * @return double the double value.
182
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
183
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>double</i>.
184
+ * @throws DataException if no row is selected (e.g. you forgot to call next()).
185
+ */
186
+ public function getDouble(Inx_Api_Recipient_Attribute $oAttr );
187
+
188
+ /**
189
+ * Returns the bool value for the given recipient Attribute.
190
+ *
191
+ * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
192
+ * @return bool the bool value.
193
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
194
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
195
+ * @throws DataException if no row is selected (e.g. you forgot to call next()).
196
+ */
197
+ public function getBoolean(Inx_Api_Recipient_Attribute $oAttr );
198
+
199
+ /**
200
+ * Returns the value for the given recipient Attribute.
201
+ *
202
+ * @param Inx_Api_Recipient_Attribute $oAttr the recipient attribute to be retrieved.
203
+ * @return mixed the value.
204
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
205
+ * @throws DataException if no row is selected (e.g. you forgot to call next()).
206
+ */
207
+ public function getObject(Inx_Api_Recipient_Attribute $oAttr);
208
+
209
+ }
lib/Inx/Api/DataAccess/DataAccess.php CHANGED
@@ -1,93 +1,93 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DataAccess
5
- */
6
- /**
7
- * An <i>Inx_Api_DataAccess_DataAccess</i> object can be used to retrieve data regarding links and clicks.
8
- * Link data can be retrieved using an <i>Inx_Api_DataAccess_LinkData</i> object, click data by using an
9
- * <i>Inx_Api_DataAccess_ClickData</i> object. Both can be obtained via this class.
10
- * <p>
11
- * An <i>Inx_Api_DataAccess_LinkData</i> object can retrieve link data with the following filters:
12
- * <ul>
13
- * <li><i>Link id</i>: fetches a link by its unique identifier.
14
- * <li><i>Link name</i>: fetches a link by its name.
15
- * <li><i>Mailing id</i>: fetches all links used in the specified mailing.
16
- * <li><i>Recipient id</i>: fetches all links the specified user has clicked.
17
- * </ul>
18
- * <p>
19
- * An <i>Inx_Api_DataAccess_ClickData</i> object can retrieve click data with the following filters:
20
- * <ul>
21
- * <li><i>Mailing id</i>: fetches all clicks of links of the specified mailing.
22
- * <li><i>Recipient id</i>: fetches all clicks performed by the specified recipient.
23
- * <li><i>Mailing + Recipient id</i>: combination of the two above filters.
24
- * <li><i>Link id</i>: fetches all clicks of the specified link.
25
- * </ul>
26
- * All of the click data filters can be combined with a date filter: before, after or between.
27
- * <p>
28
- * <i>Inx_Api_DataAccess_LinkData</i> and <i>Inx_Api_DataAccess_ClickData</i> retrieve the information as result set:
29
- * <i>Inx_Api_DataAccess_LinkDataRowSet</i> for link data and <i>Inx_Api_DataAccess_ClickDataRowSet</i> for click data.
30
- * Using these result sets it is easy to navigate through the data retrieved by the various methods.
31
- * <p>
32
- * The following snippet returns an <i>Inx_Api_DataAccess_LinkDataRowSet</i> containing all link data for the given
33
- * recipient id:
34
- * <pre>
35
- * DataAccess da = s.getDataAccess();
36
- * LinkData ld = da.getLinkDataWithNewLinkType();
37
- * ...
38
- * LinkDataRowSet rowSet = ld.selectByRecipient( id );
39
- * </pre>
40
- * <p>
41
- * The following snippet returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing all click data for the given
42
- * recipient id:
43
- * <pre>
44
- * DataAccess da = s.getDataAccess();
45
- * ClickData cd = da.getClickData();
46
- * RecipientContext rc = s.createRecipientContext();
47
- * Attribute email = rc.getMetaData().getEmailAttribute();
48
- * ...
49
- * ClickDataRowSet rowSet = cd.selectByRecipient( id, rc, new Attribute[]{email} );
50
- * </pre>
51
- * <p>
52
- * Note: All data provided by <i>Inx_Api_DataAccess_DataAccess</i> is read only!
53
- * <p>
54
- * For more information about link and click data, see the <i>Inx_Api_DataAccess_LinkData</i> and
55
- * <i>Inx_Api_DataAccess_ClickData</i> documentation.
56
- *
57
- * @see Inx_Api_DataAccess_LinkData
58
- * @see Inx_Api_DataAccess_ClickData
59
- * @since API 1.4.0
60
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
61
- * @package Inxmail
62
- * @subpackage DataAccess
63
- */
64
- interface Inx_Api_DataAccess_DataAccess
65
- {
66
- /**
67
- * Returns the link data object which can used to access the link data.
68
- *
69
- * @deprecated old behavior is, that uniquely counted image links are counted as unique links. The new method
70
- * <i>getLinkDataWithNewLinkType()</i> returns them separated in unique-count and opening-count links.
71
- * @return Inx_Api_DataAccess_LinkData the link data object.
72
- */
73
- public function getLinkData();
74
-
75
-
76
- /**
77
- * Returns the link data object which can used to access the link data.<br>
78
- * In this method unique counted image links are not counted as unique links. These links have the new type
79
- * opening-count.
80
- *
81
- * @return Inx_Api_DataAccess_LinkData the link data object.
82
- */
83
- public function getLinkDataWithNewLinkType();
84
-
85
-
86
- /**
87
- * Returns the click data object which can be used to access the click data.<br>
88
- *
89
- * @return Inx_Api_DataAccess_ClickData the click data object.
90
- */
91
- public function getClickData();
92
-
93
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DataAccess
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_DataAccess_DataAccess</i> object can be used to retrieve data regarding links and clicks.
8
+ * Link data can be retrieved using an <i>Inx_Api_DataAccess_LinkData</i> object, click data by using an
9
+ * <i>Inx_Api_DataAccess_ClickData</i> object. Both can be obtained via this class.
10
+ * <p>
11
+ * An <i>Inx_Api_DataAccess_LinkData</i> object can retrieve link data with the following filters:
12
+ * <ul>
13
+ * <li><i>Link id</i>: fetches a link by its unique identifier.
14
+ * <li><i>Link name</i>: fetches a link by its name.
15
+ * <li><i>Mailing id</i>: fetches all links used in the specified mailing.
16
+ * <li><i>Recipient id</i>: fetches all links the specified user has clicked.
17
+ * </ul>
18
+ * <p>
19
+ * An <i>Inx_Api_DataAccess_ClickData</i> object can retrieve click data with the following filters:
20
+ * <ul>
21
+ * <li><i>Mailing id</i>: fetches all clicks of links of the specified mailing.
22
+ * <li><i>Recipient id</i>: fetches all clicks performed by the specified recipient.
23
+ * <li><i>Mailing + Recipient id</i>: combination of the two above filters.
24
+ * <li><i>Link id</i>: fetches all clicks of the specified link.
25
+ * </ul>
26
+ * All of the click data filters can be combined with a date filter: before, after or between.
27
+ * <p>
28
+ * <i>Inx_Api_DataAccess_LinkData</i> and <i>Inx_Api_DataAccess_ClickData</i> retrieve the information as result set:
29
+ * <i>Inx_Api_DataAccess_LinkDataRowSet</i> for link data and <i>Inx_Api_DataAccess_ClickDataRowSet</i> for click data.
30
+ * Using these result sets it is easy to navigate through the data retrieved by the various methods.
31
+ * <p>
32
+ * The following snippet returns an <i>Inx_Api_DataAccess_LinkDataRowSet</i> containing all link data for the given
33
+ * recipient id:
34
+ * <pre>
35
+ * DataAccess da = s.getDataAccess();
36
+ * LinkData ld = da.getLinkDataWithNewLinkType();
37
+ * ...
38
+ * LinkDataRowSet rowSet = ld.selectByRecipient( id );
39
+ * </pre>
40
+ * <p>
41
+ * The following snippet returns an <i>Inx_Api_DataAccess_ClickDataRowSet</i> containing all click data for the given
42
+ * recipient id:
43
+ * <pre>
44
+ * DataAccess da = s.getDataAccess();
45
+ * ClickData cd = da.getClickData();
46
+ * RecipientContext rc = s.createRecipientContext();
47
+ * Attribute email = rc.getMetaData().getEmailAttribute();
48
+ * ...
49
+ * ClickDataRowSet rowSet = cd.selectByRecipient( id, rc, new Attribute[]{email} );
50
+ * </pre>
51
+ * <p>
52
+ * Note: All data provided by <i>Inx_Api_DataAccess_DataAccess</i> is read only!
53
+ * <p>
54
+ * For more information about link and click data, see the <i>Inx_Api_DataAccess_LinkData</i> and
55
+ * <i>Inx_Api_DataAccess_ClickData</i> documentation.
56
+ *
57
+ * @see Inx_Api_DataAccess_LinkData
58
+ * @see Inx_Api_DataAccess_ClickData
59
+ * @since API 1.4.0
60
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
61
+ * @package Inxmail
62
+ * @subpackage DataAccess
63
+ */
64
+ interface Inx_Api_DataAccess_DataAccess
65
+ {
66
+ /**
67
+ * Returns the link data object which can used to access the link data.
68
+ *
69
+ * @deprecated old behavior is, that uniquely counted image links are counted as unique links. The new method
70
+ * <i>getLinkDataWithNewLinkType()</i> returns them separated in unique-count and opening-count links.
71
+ * @return Inx_Api_DataAccess_LinkData the link data object.
72
+ */
73
+ public function getLinkData();
74
+
75
+
76
+ /**
77
+ * Returns the link data object which can used to access the link data.<br>
78
+ * In this method unique counted image links are not counted as unique links. These links have the new type
79
+ * opening-count.
80
+ *
81
+ * @return Inx_Api_DataAccess_LinkData the link data object.
82
+ */
83
+ public function getLinkDataWithNewLinkType();
84
+
85
+
86
+ /**
87
+ * Returns the click data object which can be used to access the click data.<br>
88
+ *
89
+ * @return Inx_Api_DataAccess_ClickData the click data object.
90
+ */
91
+ public function getClickData();
92
+
93
  }
lib/Inx/Api/DataAccess/DataRowSet.php CHANGED
@@ -1,100 +1,100 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DataAccess
5
- */
6
- /**
7
- * <i>Inx_Api_DataAccess_DataRowSet</i> provides a common interface for row set navigation.
8
- * The most important methods of <i>Inx_Api_DataAccess_DataRowSet</i> are <i>next()</i> and <i>close()</i>.
9
- * The <i>next()</i> method can be used to iterate over the rows of the row set.
10
- * The following snippet shows how to iterate over an <i>Inx_Api_DataAccess_DataRowSet</i>:
11
- *
12
- * <pre>
13
- * $oDataRowSet = ... //get an Inx_Api_DataAccess_DataRowSet implementation
14
- *
15
- * while($oDataRowSet.next())
16
- * {
17
- * //retrieve some information from the row set.
18
- * }
19
- *
20
- * $oDataRowSet.close();
21
- * </pre>
22
- *
23
- * Be sure to call <i>next()</i> before the first retrieval statement on the row set. Initially the cursor is
24
- * before the first row, thus no data can be retrieved from the row set before calling <i>next()</i>. Doing so
25
- * will trigger an Inx_Api_DataException.
26
- * <p>
27
- * <strong>Note:</strong> An <i>Inx_Api_DataAccess_DataRowSet</i> object <strong>must</strong> be closed once it is not
28
- * needed anymore to prevent memory leaks and other potentially harmful side effects.
29
- *
30
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
31
- * @package Inxmail
32
- * @subpackage DataAccess
33
- */
34
- interface Inx_Api_DataAccess_DataRowSet
35
- {
36
-
37
- /**
38
- * Moves the cursor to the front of
39
- * this <i>Inx_Api_DataAccess_DataRowSet</i> object, just before the
40
- * first row. This method has no effect if the result set contains no rows.
41
- */
42
- public function beforeFirstRow();
43
-
44
- /**
45
- * Moves the cursor to the end of
46
- * this <i>Inx_Api_DataAccess_DataRowSet</i> object, just after the
47
- * last row. This method has no effect if the result set contains no rows.
48
- */
49
- public function afterLastRow();
50
-
51
- /**
52
- * Moves the cursor to the given row number in
53
- * this <i>Inx_Api_DataAccess_DataRowSet</i> object.
54
- * The first row is row 0, the second is row 1, and so on.
55
- *
56
- * @param int $iRow the number of the row to which the cursor should move.
57
- */
58
- public function setRow( $iRow );
59
-
60
- /**
61
- * Retrieves the current row number.
62
- * The first row is number 0, the second number 1, and so on.
63
- *
64
- * @return int the current row number.
65
- */
66
- public function getRow();
67
-
68
- /**
69
- * Moves the cursor down one row from its current position.
70
- * An <i>Inx_Api_DataAccess_DataRowSet</i> cursor is initially positioned before the first row;
71
- * the first call to the method <i>next()</i> makes the first row the current row;
72
- * the second call makes the second row the current row, and so on.
73
- *
74
- * @return bool <i>true</i> if the new current row is valid, <i>false</i> if there are no more rows.
75
- */
76
- public function next();
77
-
78
- /**
79
- * Moves the cursor to the previous row in this <i>Inx_Api_DataAccess_DataRowSet</i> object.
80
- *
81
- * @return bool <i>true</i> if the new current row is valid, <i>false</i> if it is off the result set.
82
- */
83
- public function previous();
84
-
85
- /**
86
- * Returns the number of rows in this <i>Inx_Api_DataAccess_DataRowSet</i> object.
87
- *
88
- * @return int the number of rows.
89
- */
90
- public function getRowCount();
91
-
92
- /**
93
- * Releases the resources associated with this <i>Inx_Api_DataAccess_DataRowSet</i> object on the server immediately.
94
- * <p>
95
- * An <i>Inx_Api_DataAccess_DataRowSet</i> object <strong>must</strong> be closed once it is not
96
- * needed anymore to prevent memory leaks and other potentially harmful side effects.
97
- */
98
- public function close();
99
-
100
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DataAccess
5
+ */
6
+ /**
7
+ * <i>Inx_Api_DataAccess_DataRowSet</i> provides a common interface for row set navigation.
8
+ * The most important methods of <i>Inx_Api_DataAccess_DataRowSet</i> are <i>next()</i> and <i>close()</i>.
9
+ * The <i>next()</i> method can be used to iterate over the rows of the row set.
10
+ * The following snippet shows how to iterate over an <i>Inx_Api_DataAccess_DataRowSet</i>:
11
+ *
12
+ * <pre>
13
+ * $oDataRowSet = ... //get an Inx_Api_DataAccess_DataRowSet implementation
14
+ *
15
+ * while($oDataRowSet.next())
16
+ * {
17
+ * //retrieve some information from the row set.
18
+ * }
19
+ *
20
+ * $oDataRowSet.close();
21
+ * </pre>
22
+ *
23
+ * Be sure to call <i>next()</i> before the first retrieval statement on the row set. Initially the cursor is
24
+ * before the first row, thus no data can be retrieved from the row set before calling <i>next()</i>. Doing so
25
+ * will trigger an Inx_Api_DataException.
26
+ * <p>
27
+ * <strong>Note:</strong> An <i>Inx_Api_DataAccess_DataRowSet</i> object <strong>must</strong> be closed once it is not
28
+ * needed anymore to prevent memory leaks and other potentially harmful side effects.
29
+ *
30
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
31
+ * @package Inxmail
32
+ * @subpackage DataAccess
33
+ */
34
+ interface Inx_Api_DataAccess_DataRowSet
35
+ {
36
+
37
+ /**
38
+ * Moves the cursor to the front of
39
+ * this <i>Inx_Api_DataAccess_DataRowSet</i> object, just before the
40
+ * first row. This method has no effect if the result set contains no rows.
41
+ */
42
+ public function beforeFirstRow();
43
+
44
+ /**
45
+ * Moves the cursor to the end of
46
+ * this <i>Inx_Api_DataAccess_DataRowSet</i> object, just after the
47
+ * last row. This method has no effect if the result set contains no rows.
48
+ */
49
+ public function afterLastRow();
50
+
51
+ /**
52
+ * Moves the cursor to the given row number in
53
+ * this <i>Inx_Api_DataAccess_DataRowSet</i> object.
54
+ * The first row is row 0, the second is row 1, and so on.
55
+ *
56
+ * @param int $iRow the number of the row to which the cursor should move.
57
+ */
58
+ public function setRow( $iRow );
59
+
60
+ /**
61
+ * Retrieves the current row number.
62
+ * The first row is number 0, the second number 1, and so on.
63
+ *
64
+ * @return int the current row number.
65
+ */
66
+ public function getRow();
67
+
68
+ /**
69
+ * Moves the cursor down one row from its current position.
70
+ * An <i>Inx_Api_DataAccess_DataRowSet</i> cursor is initially positioned before the first row;
71
+ * the first call to the method <i>next()</i> makes the first row the current row;
72
+ * the second call makes the second row the current row, and so on.
73
+ *
74
+ * @return bool <i>true</i> if the new current row is valid, <i>false</i> if there are no more rows.
75
+ */
76
+ public function next();
77
+
78
+ /**
79
+ * Moves the cursor to the previous row in this <i>Inx_Api_DataAccess_DataRowSet</i> object.
80
+ *
81
+ * @return bool <i>true</i> if the new current row is valid, <i>false</i> if it is off the result set.
82
+ */
83
+ public function previous();
84
+
85
+ /**
86
+ * Returns the number of rows in this <i>Inx_Api_DataAccess_DataRowSet</i> object.
87
+ *
88
+ * @return int the number of rows.
89
+ */
90
+ public function getRowCount();
91
+
92
+ /**
93
+ * Releases the resources associated with this <i>Inx_Api_DataAccess_DataRowSet</i> object on the server immediately.
94
+ * <p>
95
+ * An <i>Inx_Api_DataAccess_DataRowSet</i> object <strong>must</strong> be closed once it is not
96
+ * needed anymore to prevent memory leaks and other potentially harmful side effects.
97
+ */
98
+ public function close();
99
+
100
+ }
lib/Inx/Api/DataAccess/LinkData.php CHANGED
@@ -1,78 +1,78 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DataAccess
5
- */
6
- /**
7
- * An <i>Inx_Api_DataAccess_LinkData</i> object can be used to retrieve information about a specific link
8
- * accessible through an <i>Inx_Api_DataAccess_LinkDataRowSet</i>. A row set can be obtained using various filters:
9
- * <ul>
10
- * <li>Link id: <i>selectByLink(int)</i>
11
- * <li>Link name: <i>selectByLinkName(String)</i>
12
- * <li>Mailing id: <i>selectByMailing(int)</i>
13
- * <li>Recipient id: <i>selectByRecipient(int)</i>
14
- * </ul>
15
- * <p>
16
- * The following example returns a result set containing link data for the specified mailing:
17
- * <pre>
18
- * $oDataAccess = $oSession->getDataAccess();
19
- * $oLinkData = $oDataAccess->getLinkDataWithNewLinkType();
20
- * ...
21
- * $oLinkDataRowSet = $oLinkData->selectByMailing( $iMailingId );
22
- * </pre>
23
- * For more information on the data available for links, see the <i>Inx_Api_DataAccess_LinkDataRowSet</i> documentation.
24
- *
25
- * @see Inx_Api_DataAccess_DataAccess
26
- * @see Inx_Api_DataAccess_LinkDataRowSet
27
- * @since API 1.4.0
28
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
29
- * @package Inxmail
30
- * @subpackage DataAccess
31
- */
32
- interface Inx_Api_DataAccess_LinkData
33
- {
34
-
35
- /**
36
- * This method returns a row set containing information about all links in the specified mailing. If there is no
37
- * link data, an empty row set will be returned.
38
- *
39
- * @param $iMailingId the id of the mailing.
40
- * @return Inx_Api_DataAccess_LinkDataRowSet an <i>Inx_Api_DataAccess_LinkDataRowSet</i> object that contains the
41
- * data produced by the given query.
42
- */
43
- public function selectByMailing( $iMailingId );
44
-
45
-
46
- /**
47
- * This method returns a row set containing information about the specified link. If there is no link data, an empty
48
- * row set will be returned.
49
- *
50
- * @param in $iLinkId the id of the link.
51
- * @return Inx_Api_DataAccess_LinkDataRowSet an <i>Inx_Api_DataAccess_LinkDataRowSet</i> object that contains the
52
- * data produced by the given query.
53
- */
54
- public function selectByLink( $iLinkId );
55
-
56
-
57
- /**
58
- * This method returns a row set containing information about all links that were clicked by the given recipient. If
59
- * there is no link data, an empty row set will be returned.
60
- *
61
- * @param int $iRecipient the id of the recipient.
62
- * @return Inx_Api_DataAccess_LinkDataRowSet an <i>Inx_Api_DataAccess_LinkDataRowSet</i> object that contains the
63
- * data produced by the given query.
64
- */
65
- public function selectByRecipient( $iRecipient );
66
-
67
-
68
- /**
69
- * This method returns a row set containing information about all links with the given name. If there is no link
70
- * data, an empty row set will be returned.
71
- *
72
- * @param string $linkName the name of the link.
73
- * @return Inx_Api_DataAccess_LinkDataRowSet an <i>Inx_Api_DataAccess_LinkDataRowSet</i> object that contains the
74
- * data produced by the given query.
75
- */
76
- public function selectByLinkName( $linkName );
77
-
78
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DataAccess
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_DataAccess_LinkData</i> object can be used to retrieve information about a specific link
8
+ * accessible through an <i>Inx_Api_DataAccess_LinkDataRowSet</i>. A row set can be obtained using various filters:
9
+ * <ul>
10
+ * <li>Link id: <i>selectByLink(int)</i>
11
+ * <li>Link name: <i>selectByLinkName(String)</i>
12
+ * <li>Mailing id: <i>selectByMailing(int)</i>
13
+ * <li>Recipient id: <i>selectByRecipient(int)</i>
14
+ * </ul>
15
+ * <p>
16
+ * The following example returns a result set containing link data for the specified mailing:
17
+ * <pre>
18
+ * $oDataAccess = $oSession->getDataAccess();
19
+ * $oLinkData = $oDataAccess->getLinkDataWithNewLinkType();
20
+ * ...
21
+ * $oLinkDataRowSet = $oLinkData->selectByMailing( $iMailingId );
22
+ * </pre>
23
+ * For more information on the data available for links, see the <i>Inx_Api_DataAccess_LinkDataRowSet</i> documentation.
24
+ *
25
+ * @see Inx_Api_DataAccess_DataAccess
26
+ * @see Inx_Api_DataAccess_LinkDataRowSet
27
+ * @since API 1.4.0
28
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
29
+ * @package Inxmail
30
+ * @subpackage DataAccess
31
+ */
32
+ interface Inx_Api_DataAccess_LinkData
33
+ {
34
+
35
+ /**
36
+ * This method returns a row set containing information about all links in the specified mailing. If there is no
37
+ * link data, an empty row set will be returned.
38
+ *
39
+ * @param $iMailingId the id of the mailing.
40
+ * @return Inx_Api_DataAccess_LinkDataRowSet an <i>Inx_Api_DataAccess_LinkDataRowSet</i> object that contains the
41
+ * data produced by the given query.
42
+ */
43
+ public function selectByMailing( $iMailingId );
44
+
45
+
46
+ /**
47
+ * This method returns a row set containing information about the specified link. If there is no link data, an empty
48
+ * row set will be returned.
49
+ *
50
+ * @param in $iLinkId the id of the link.
51
+ * @return Inx_Api_DataAccess_LinkDataRowSet an <i>Inx_Api_DataAccess_LinkDataRowSet</i> object that contains the
52
+ * data produced by the given query.
53
+ */
54
+ public function selectByLink( $iLinkId );
55
+
56
+
57
+ /**
58
+ * This method returns a row set containing information about all links that were clicked by the given recipient. If
59
+ * there is no link data, an empty row set will be returned.
60
+ *
61
+ * @param int $iRecipient the id of the recipient.
62
+ * @return Inx_Api_DataAccess_LinkDataRowSet an <i>Inx_Api_DataAccess_LinkDataRowSet</i> object that contains the
63
+ * data produced by the given query.
64
+ */
65
+ public function selectByRecipient( $iRecipient );
66
+
67
+
68
+ /**
69
+ * This method returns a row set containing information about all links with the given name. If there is no link
70
+ * data, an empty row set will be returned.
71
+ *
72
+ * @param string $linkName the name of the link.
73
+ * @return Inx_Api_DataAccess_LinkDataRowSet an <i>Inx_Api_DataAccess_LinkDataRowSet</i> object that contains the
74
+ * data produced by the given query.
75
+ */
76
+ public function selectByLinkName( $linkName );
77
+
78
+ }
lib/Inx/Api/DataAccess/LinkDataRowSet.php CHANGED
@@ -1,220 +1,220 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DataAccess
5
- */
6
- /**
7
- * An <i>Inx_Api_DataAccess_LinkDataRowSet</i> is used to access rows of link data resulting from a query.
8
- * Only tracked links - which can be used for opening analysis - will be fetched.
9
- * <p>
10
- * The following data can be retrieved:
11
- * <ul>
12
- * <li><i>Link id</i>: the unique identifier of the link.
13
- * <li><i>Link name</i>: the name of the link (alias).
14
- * <li><i>Link type</i>: the type of the link (see constants below).
15
- * <lI><i>Link URL</i>: the Uniform resource locator (URL) of the link.
16
- * <li><i>Action id</i>: the id of the action associated to this link, if any.
17
- * <li><i>Mailing id</i>: the id of the mailing which contains the link.
18
- * </ul>
19
- * The link type can be one of the following:
20
- * <ul>
21
- * <li>LINK_TYPE_REDIRECT - can be used to perform actions before redirecting to the target URL.
22
- * <li>LINK_TYPE_UNSUBSCRIBE - unsubscribes the current recipient without verification (deprecated).
23
- * <li>LINK_TYPE_COUNT - tracking link that counts each click.
24
- * <li>LINK_TYPE_UNIQUE_COUNT - tracking link that counts each click and the <i>first</i> click of every
25
- * recipient.
26
- * <li>LINK_TYPE_VERIFY_SUBSCRIPTION - verifies the subscription of the current recipient.
27
- * <li>LINK_TYPE_VERIFY_UNSUBSCRIPTION - verifies the unsubscription of the current recipient.
28
- * <li>LINK_TYPE_OPENING_COUNT - trackable image that counts each loading.
29
- * <li>LINK_TYPE_CONTENT - tracking link embedded in external content (unique count).
30
- * <li>LINK_TYPE_OPENING_CONTENT - trackable image embedded in external content (unique count).
31
- * <li>LINK_TYPE_UNSUBSCRIBE_LINK - unsubscribes the current recipient without verification.
32
- * <li>LINK_TYPE_HEADER_UNSUBSCRIBE - unsubscribes the current recipient using the header unsubscription.
33
- * Clients which support this feature (like Google mail) will show an unsubscription button at the head of the mailing.
34
- * <li>LINK_TYPE_JSP_UNSUBSCRIBE - unsubscribes the current recipient using a JSP landing page.
35
- * <li>LINK_TYPE_PAGE_UNSUBSCRIBE - unsubscribes the current recipient using a HTML landing page.
36
- * <li>LINK_TYPE_UNKNOWN - unknown link type used for legacy APIs (server version > API version).
37
- * </ul>
38
- * For information on how to navigate through an <i>Inx_Api_DataAccess_LinkDataRowSet</i>, see the
39
- * <i>Inx_Api_DataAccess_DataRowSet</i> documentation.
40
- * <p>
41
- * For an example on how to query link data, see the <i>Inx_Api_DataAccess_LinkData</i> documentation.
42
- * <p>
43
- *
44
- * @see Inx_Api_DataAccess_LinkData
45
- * @see Inx_Api_DataAccess_DataRowSet
46
- * @since API 1.4.0
47
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
48
- * @package Inxmail
49
- * @subpackage DataAccess
50
- */
51
- interface Inx_Api_DataAccess_LinkDataRowSet extends Inx_Api_DataAccess_DataRowSet
52
- {
53
-
54
- /** The 'redirect' link type can be used to perform actions before redirecting to the target URL. */
55
- const LINK_TYPE_REDIRECT = 0;
56
-
57
- /**
58
- * The deprecated 'unsubscribe' link type unsubscribes the current recipient without verification.
59
- *
60
- * @deprecated the new unsubscription link types are:
61
- * <ul>
62
- * <li>LINK_TYPE_UNSUBSCRIBE_LINK
63
- * <li>LINK_TYPE_HEADER_UNSUBSCRIBE
64
- * <li>LINK_TYPE_JSP_UNSUBSCRIBE
65
- * <li>LINK_TYPE_PAGE_UNSUBSCRIBE
66
- * </ul>
67
- */
68
- const LINK_TYPE_UNSUBSCRIBE = 1;
69
-
70
- /** The 'count' link type counts each click of a particular link. */
71
- const LINK_TYPE_COUNT = 2;
72
-
73
- /**
74
- * The 'unique count' link type counts each click of a particular link and the <i>first</i> click of a recipient
75
- * (tracks the number of recipients that clicked the link). Both values can be used for reporting and analysis.
76
- */
77
- const LINK_TYPE_UNIQUE_COUNT = 3;
78
-
79
- /** The 'verify subscription' link type verifies the subscription of the current recipient. */
80
- const LINK_TYPE_VERIFY_SUBSCRIPTION = 5;
81
-
82
- /** The 'verify unsubscription' link type verifies the unsubscription of the current recipient. */
83
- const LINK_TYPE_VERIFY_UNSUBSCRIPTION = 6;
84
-
85
- /**
86
- * The 'opening count' link type is used to count the <i>first</i> loading of a particular image by a recipient.
87
- *
88
- * @see LINK_TYPE_UNIQUE_COUNT
89
- */
90
- const LINK_TYPE_OPENING_COUNT = 7;
91
-
92
- /**
93
- * The 'content' link type counts the number of recipients that click a link embedded in external content.
94
- *
95
- * @see LINK_TYPE_UNIQUE_COUNT
96
- * @since API 1.8.0
97
- */
98
- const LINK_TYPE_CONTENT = 8;
99
-
100
-
101
- /**
102
- * The 'opening content' link type counts the number of recipients that load an image embedded in external content.
103
- *
104
- * @see LINK_TYPE_UNIQUE_COUNT
105
- * @since API 1.8.0
106
- */
107
- const LINK_TYPE_OPENING_CONTENT = 9;
108
-
109
-
110
- /**
111
- * The 'unsubscribe link' link type unsubscribes the current recipient without verification.
112
- *
113
- * @since API 1.8.0
114
- */
115
- const LINK_TYPE_UNSUBSCRIBE_LINK = 10;
116
-
117
-
118
- /**
119
- * The 'header unsubscribe' link type unsubscribes the current recipient using the header unsubscription. Clients
120
- * which support this feature (like Google mail) will show an unsubscription button at the head of the mailing.
121
- *
122
- * @since API 1.8.0
123
- */
124
- const LINK_TYPE_HEADER_UNSUBSCRIBE = 11;
125
-
126
-
127
- /**
128
- * The 'JSP unsubscribe' link type unsubscribes the current recipient using a JSP landing page.
129
- *
130
- * @since API 1.8.0
131
- */
132
- const LINK_TYPE_JSP_UNSUBSCRIBE = 12;
133
-
134
-
135
- /**
136
- * The 'page unsubscribe' link type unsubscribes the current recipient using a HTML landing page.
137
- *
138
- * @since API 1.8.0
139
- */
140
- const LINK_TYPE_PAGE_UNSUBSCRIBE = 13;
141
-
142
-
143
- /**
144
- * The 'unknown' link type is used for legacy APIs (server version > API version). This type will be used if the
145
- * link type is not supported by the API.
146
- *
147
- * @since API 1.8.0
148
- */
149
- const LINK_TYPE_UNKNOWN = -1;
150
-
151
-
152
- /**
153
- * Returns the unique identifier of the current link.
154
- *
155
- * @return int the id of the current link.
156
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
157
- */
158
- public function getLinkId();
159
-
160
- /**
161
- * Returns the name of the current link.
162
- *
163
- * @return string the name of the current link.
164
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
165
- */
166
- public function getLinkName();
167
-
168
-
169
- /**
170
- * Returns the uniform resource locator (URL) of the current link.
171
- *
172
- * @return string the URL of the current link.
173
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
174
- */
175
- public function getLinkUrl();
176
-
177
- /**
178
- * Returns the type of the current link. The possible types are:<br>
179
- * <ul>
180
- * <li>LINK_TYPE_REDIRECT - can be used to perform actions before redirecting to the target URL.
181
- * <li>LINK_TYPE_UNSUBSCRIBE - unsubscribes the current recipient without verification (deprecated).
182
- * <li>LINK_TYPE_COUNT - tracking link that counts each click.
183
- * <li>LINK_TYPE_UNIQUE_COUNT - tracking link that counts each click and the <i>first</i> click of every
184
- * recipient.
185
- * <li>LINK_TYPE_VERIFY_SUBSCRIPTION - verifies the subscription of the current recipient.
186
- * <li>LINK_TYPE_VERIFY_UNSUBSCRIPTION - verifies the unsubscription of the current recipient.
187
- * <li>LINK_TYPE_OPENING_COUNT - trackable image that counts each loading.
188
- * <li>LINK_TYPE_CONTENT - tracking link embedded in external content (unique count).
189
- * <li>LINK_TYPE_OPENING_CONTENT - trackable image embedded in external content (unique count).
190
- * <li>LINK_TYPE_UNSUBSCRIBE_LINK - unsubscribes the current recipient without verification.
191
- * <li>LINK_TYPE_HEADER_UNSUBSCRIBE - unsubscribes the current recipient using the header unsubscription.
192
- * Clients which support this feature (like Google mail) will show an unsubscription button at the head of the
193
- * mailing.
194
- * <li>LINK_TYPE_JSP_UNSUBSCRIBE - unsubscribes the current recipient using a JSP landing page.
195
- * <li>LINK_TYPE_PAGE_UNSUBSCRIBE - unsubscribes the current recipient using a HTML landing page.
196
- * <li>LINK_TYPE_UNKNOWN - unknown link type used for legacy APIs (server version > API version).
197
- * </ul>
198
- *
199
- * @return int the type of the current link.
200
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
201
- */
202
- public function getLinkType();
203
-
204
- /**
205
- * Returns the id of the action associated to this link, or 0 if no action is associated to this link.
206
- *
207
- * @return int the id of the associated action, or 0.
208
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
209
- */
210
- public function getActionId();
211
-
212
- /**
213
- * Returns the id of the mailing which contains the current link.
214
- *
215
- * @return int the id of the mailing which contains the current link.
216
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
217
- */
218
- public function getMailingId();
219
-
220
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DataAccess
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_DataAccess_LinkDataRowSet</i> is used to access rows of link data resulting from a query.
8
+ * Only tracked links - which can be used for opening analysis - will be fetched.
9
+ * <p>
10
+ * The following data can be retrieved:
11
+ * <ul>
12
+ * <li><i>Link id</i>: the unique identifier of the link.
13
+ * <li><i>Link name</i>: the name of the link (alias).
14
+ * <li><i>Link type</i>: the type of the link (see constants below).
15
+ * <lI><i>Link URL</i>: the Uniform resource locator (URL) of the link.
16
+ * <li><i>Action id</i>: the id of the action associated to this link, if any.
17
+ * <li><i>Mailing id</i>: the id of the mailing which contains the link.
18
+ * </ul>
19
+ * The link type can be one of the following:
20
+ * <ul>
21
+ * <li>LINK_TYPE_REDIRECT - can be used to perform actions before redirecting to the target URL.
22
+ * <li>LINK_TYPE_UNSUBSCRIBE - unsubscribes the current recipient without verification (deprecated).
23
+ * <li>LINK_TYPE_COUNT - tracking link that counts each click.
24
+ * <li>LINK_TYPE_UNIQUE_COUNT - tracking link that counts each click and the <i>first</i> click of every
25
+ * recipient.
26
+ * <li>LINK_TYPE_VERIFY_SUBSCRIPTION - verifies the subscription of the current recipient.
27
+ * <li>LINK_TYPE_VERIFY_UNSUBSCRIPTION - verifies the unsubscription of the current recipient.
28
+ * <li>LINK_TYPE_OPENING_COUNT - trackable image that counts each loading.
29
+ * <li>LINK_TYPE_CONTENT - tracking link embedded in external content (unique count).
30
+ * <li>LINK_TYPE_OPENING_CONTENT - trackable image embedded in external content (unique count).
31
+ * <li>LINK_TYPE_UNSUBSCRIBE_LINK - unsubscribes the current recipient without verification.
32
+ * <li>LINK_TYPE_HEADER_UNSUBSCRIBE - unsubscribes the current recipient using the header unsubscription.
33
+ * Clients which support this feature (like Google mail) will show an unsubscription button at the head of the mailing.
34
+ * <li>LINK_TYPE_JSP_UNSUBSCRIBE - unsubscribes the current recipient using a JSP landing page.
35
+ * <li>LINK_TYPE_PAGE_UNSUBSCRIBE - unsubscribes the current recipient using a HTML landing page.
36
+ * <li>LINK_TYPE_UNKNOWN - unknown link type used for legacy APIs (server version > API version).
37
+ * </ul>
38
+ * For information on how to navigate through an <i>Inx_Api_DataAccess_LinkDataRowSet</i>, see the
39
+ * <i>Inx_Api_DataAccess_DataRowSet</i> documentation.
40
+ * <p>
41
+ * For an example on how to query link data, see the <i>Inx_Api_DataAccess_LinkData</i> documentation.
42
+ * <p>
43
+ *
44
+ * @see Inx_Api_DataAccess_LinkData
45
+ * @see Inx_Api_DataAccess_DataRowSet
46
+ * @since API 1.4.0
47
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
48
+ * @package Inxmail
49
+ * @subpackage DataAccess
50
+ */
51
+ interface Inx_Api_DataAccess_LinkDataRowSet extends Inx_Api_DataAccess_DataRowSet
52
+ {
53
+
54
+ /** The 'redirect' link type can be used to perform actions before redirecting to the target URL. */
55
+ const LINK_TYPE_REDIRECT = 0;
56
+
57
+ /**
58
+ * The deprecated 'unsubscribe' link type unsubscribes the current recipient without verification.
59
+ *
60
+ * @deprecated the new unsubscription link types are:
61
+ * <ul>
62
+ * <li>LINK_TYPE_UNSUBSCRIBE_LINK
63
+ * <li>LINK_TYPE_HEADER_UNSUBSCRIBE
64
+ * <li>LINK_TYPE_JSP_UNSUBSCRIBE
65
+ * <li>LINK_TYPE_PAGE_UNSUBSCRIBE
66
+ * </ul>
67
+ */
68
+ const LINK_TYPE_UNSUBSCRIBE = 1;
69
+
70
+ /** The 'count' link type counts each click of a particular link. */
71
+ const LINK_TYPE_COUNT = 2;
72
+
73
+ /**
74
+ * The 'unique count' link type counts each click of a particular link and the <i>first</i> click of a recipient
75
+ * (tracks the number of recipients that clicked the link). Both values can be used for reporting and analysis.
76
+ */
77
+ const LINK_TYPE_UNIQUE_COUNT = 3;
78
+
79
+ /** The 'verify subscription' link type verifies the subscription of the current recipient. */
80
+ const LINK_TYPE_VERIFY_SUBSCRIPTION = 5;
81
+
82
+ /** The 'verify unsubscription' link type verifies the unsubscription of the current recipient. */
83
+ const LINK_TYPE_VERIFY_UNSUBSCRIPTION = 6;
84
+
85
+ /**
86
+ * The 'opening count' link type is used to count the <i>first</i> loading of a particular image by a recipient.
87
+ *
88
+ * @see LINK_TYPE_UNIQUE_COUNT
89
+ */
90
+ const LINK_TYPE_OPENING_COUNT = 7;
91
+
92
+ /**
93
+ * The 'content' link type counts the number of recipients that click a link embedded in external content.
94
+ *
95
+ * @see LINK_TYPE_UNIQUE_COUNT
96
+ * @since API 1.8.0
97
+ */
98
+ const LINK_TYPE_CONTENT = 8;
99
+
100
+
101
+ /**
102
+ * The 'opening content' link type counts the number of recipients that load an image embedded in external content.
103
+ *
104
+ * @see LINK_TYPE_UNIQUE_COUNT
105
+ * @since API 1.8.0
106
+ */
107
+ const LINK_TYPE_OPENING_CONTENT = 9;
108
+
109
+
110
+ /**
111
+ * The 'unsubscribe link' link type unsubscribes the current recipient without verification.
112
+ *
113
+ * @since API 1.8.0
114
+ */
115
+ const LINK_TYPE_UNSUBSCRIBE_LINK = 10;
116
+
117
+
118
+ /**
119
+ * The 'header unsubscribe' link type unsubscribes the current recipient using the header unsubscription. Clients
120
+ * which support this feature (like Google mail) will show an unsubscription button at the head of the mailing.
121
+ *
122
+ * @since API 1.8.0
123
+ */
124
+ const LINK_TYPE_HEADER_UNSUBSCRIBE = 11;
125
+
126
+
127
+ /**
128
+ * The 'JSP unsubscribe' link type unsubscribes the current recipient using a JSP landing page.
129
+ *
130
+ * @since API 1.8.0
131
+ */
132
+ const LINK_TYPE_JSP_UNSUBSCRIBE = 12;
133
+
134
+
135
+ /**
136
+ * The 'page unsubscribe' link type unsubscribes the current recipient using a HTML landing page.
137
+ *
138
+ * @since API 1.8.0
139
+ */
140
+ const LINK_TYPE_PAGE_UNSUBSCRIBE = 13;
141
+
142
+
143
+ /**
144
+ * The 'unknown' link type is used for legacy APIs (server version > API version). This type will be used if the
145
+ * link type is not supported by the API.
146
+ *
147
+ * @since API 1.8.0
148
+ */
149
+ const LINK_TYPE_UNKNOWN = -1;
150
+
151
+
152
+ /**
153
+ * Returns the unique identifier of the current link.
154
+ *
155
+ * @return int the id of the current link.
156
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
157
+ */
158
+ public function getLinkId();
159
+
160
+ /**
161
+ * Returns the name of the current link.
162
+ *
163
+ * @return string the name of the current link.
164
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
165
+ */
166
+ public function getLinkName();
167
+
168
+
169
+ /**
170
+ * Returns the uniform resource locator (URL) of the current link.
171
+ *
172
+ * @return string the URL of the current link.
173
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
174
+ */
175
+ public function getLinkUrl();
176
+
177
+ /**
178
+ * Returns the type of the current link. The possible types are:<br>
179
+ * <ul>
180
+ * <li>LINK_TYPE_REDIRECT - can be used to perform actions before redirecting to the target URL.
181
+ * <li>LINK_TYPE_UNSUBSCRIBE - unsubscribes the current recipient without verification (deprecated).
182
+ * <li>LINK_TYPE_COUNT - tracking link that counts each click.
183
+ * <li>LINK_TYPE_UNIQUE_COUNT - tracking link that counts each click and the <i>first</i> click of every
184
+ * recipient.
185
+ * <li>LINK_TYPE_VERIFY_SUBSCRIPTION - verifies the subscription of the current recipient.
186
+ * <li>LINK_TYPE_VERIFY_UNSUBSCRIPTION - verifies the unsubscription of the current recipient.
187
+ * <li>LINK_TYPE_OPENING_COUNT - trackable image that counts each loading.
188
+ * <li>LINK_TYPE_CONTENT - tracking link embedded in external content (unique count).
189
+ * <li>LINK_TYPE_OPENING_CONTENT - trackable image embedded in external content (unique count).
190
+ * <li>LINK_TYPE_UNSUBSCRIBE_LINK - unsubscribes the current recipient without verification.
191
+ * <li>LINK_TYPE_HEADER_UNSUBSCRIBE - unsubscribes the current recipient using the header unsubscription.
192
+ * Clients which support this feature (like Google mail) will show an unsubscription button at the head of the
193
+ * mailing.
194
+ * <li>LINK_TYPE_JSP_UNSUBSCRIBE - unsubscribes the current recipient using a JSP landing page.
195
+ * <li>LINK_TYPE_PAGE_UNSUBSCRIBE - unsubscribes the current recipient using a HTML landing page.
196
+ * <li>LINK_TYPE_UNKNOWN - unknown link type used for legacy APIs (server version > API version).
197
+ * </ul>
198
+ *
199
+ * @return int the type of the current link.
200
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
201
+ */
202
+ public function getLinkType();
203
+
204
+ /**
205
+ * Returns the id of the action associated to this link, or 0 if no action is associated to this link.
206
+ *
207
+ * @return int the id of the associated action, or 0.
208
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
209
+ */
210
+ public function getActionId();
211
+
212
+ /**
213
+ * Returns the id of the mailing which contains the current link.
214
+ *
215
+ * @return int the id of the mailing which contains the current link.
216
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
217
+ */
218
+ public function getMailingId();
219
+
220
+ }
lib/Inx/Api/DataException.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_DataException</i> is thrown when a <i>BusinessObject</i> cannot be found on the server.
7
- * Example: Calling <code>commitUpdate()</code> on a <code>BusinessObject</code> that was deleted will result in a
8
- * <code>DataException</code>.
9
- *
10
- * @see Inx_Api_BusinessObject#commitUpdate()
11
- * @see Inx_Api_BusinessObject#reload()
12
- * @see Inx_Api_BOResultSet#get(int)
13
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
14
- * @package Inxmail
15
- */
16
- class Inx_Api_DataException extends Exception
17
- {
18
-
19
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_DataException</i> is thrown when a <i>BusinessObject</i> cannot be found on the server.
7
+ * Example: Calling <code>commitUpdate()</code> on a <code>BusinessObject</code> that was deleted will result in a
8
+ * <code>DataException</code>.
9
+ *
10
+ * @see Inx_Api_BusinessObject#commitUpdate()
11
+ * @see Inx_Api_BusinessObject#reload()
12
+ * @see Inx_Api_BOResultSet#get(int)
13
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
14
+ * @package Inxmail
15
+ */
16
+ class Inx_Api_DataException extends Exception
17
+ {
18
+
19
+ }
lib/Inx/Api/DesignTemplate/DesignCollection.php CHANGED
@@ -1,86 +1,86 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DesignTemplate
5
- */
6
- /**
7
- * An <i>Inx_Api_DesignTemplate_DesignCollection</i> represents a set of templates which are stored in an itc file.
8
- * Templates can be used to create complex multipart mailings which are based on a common structure defined by the template.
9
- * Templates simplify the creation of such mailings by using a specialized editor which aids in the structuring of the mailing.
10
- * <p>
11
- * The following design collection data can be retrieved:
12
- * <ul>
13
- * <li><i>Collection name</i>: the technical name of the design collection.
14
- * <li><i>Display name</i>: the display name of the design collection.
15
- * <li><i>Collection vendor</i>: the name of the design collection vendor.
16
- * <li><i>Vendor URL</i>: the uniform resource locator (URL) of the vendor (i.e. the vendors web site).
17
- * <li><i>Collection version</i>: the version of the design collection.
18
- * <li><i>Last modification date</i>: the date when the design collection was imported (the last time).
19
- * <li><i>Contained templates</i>: the templates contained by the design collection.
20
- * </ul>
21
- * <p>
22
- * Note: All data provided by <i>Inx_Api_DesignTemplate_DesignCollection</i> is read only!
23
- * <p>
24
- * For an example on how to import and use design collections, see the <i>Inx_Api_DesignTemplate_DesignCollectionManager</i>
25
- * documentation.
26
- *
27
- * @see Inx_Api_DesignTemplate_DesignCollectionManager
28
- * @see Inx_Api_DesignTemplate_Template
29
- * @since API 1.4.0
30
- * @version $Revision: 9553 $Date: 2007-01-25 15:00:09 $ $Author: nds$
31
- * @package Inxmail
32
- * @subpackage DesignTemplate
33
- */
34
- interface Inx_Api_DesignTemplate_DesignCollection extends Inx_Api_BusinessObject
35
- {
36
- /**
37
- * Returns the technical name of the design collection.
38
- *
39
- * @return string the technical name of the design collection.
40
- */
41
- public function getName();
42
-
43
- /**
44
- * Returns the display name of the design collection.
45
- *
46
- * @return string the display name of the design collection.
47
- * @since API 1.9.0
48
- */
49
- public function getDisplayName();
50
-
51
- /**
52
- * Returns the name of the design collection vendor.
53
- *
54
- * @return string the name of the design collection vendor.
55
- */
56
- public function getVendor();
57
-
58
- /**
59
- * Returns the uniform resource locator (URL) of the vendor (i.e. the vendors web site).
60
- *
61
- * @return string the URL of the design collection vendor.
62
- */
63
- public function getVendorURL();
64
-
65
- /**
66
- * Returns the version of the design collection.
67
- *
68
- * @return string the version of the design collection.
69
- */
70
- public function getVersion();
71
-
72
- /**
73
- * Returns the date when the design collection was imported (the last time).
74
- *
75
- * @return string the date of the last modification of the design collection.
76
- * The date will be returned as ISO 8601 formatted datetime string.
77
- */
78
- public function getLastModificationDate();
79
-
80
- /**
81
- * Returns all templates contained by this design collection.
82
- *
83
- * @return an array of all <i>Inx_Api_DesignTemplate_Template</i>s contained by this design collection.
84
- */
85
- public function getTemplates();
86
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DesignTemplate
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_DesignTemplate_DesignCollection</i> represents a set of templates which are stored in an itc file.
8
+ * Templates can be used to create complex multipart mailings which are based on a common structure defined by the template.
9
+ * Templates simplify the creation of such mailings by using a specialized editor which aids in the structuring of the mailing.
10
+ * <p>
11
+ * The following design collection data can be retrieved:
12
+ * <ul>
13
+ * <li><i>Collection name</i>: the technical name of the design collection.
14
+ * <li><i>Display name</i>: the display name of the design collection.
15
+ * <li><i>Collection vendor</i>: the name of the design collection vendor.
16
+ * <li><i>Vendor URL</i>: the uniform resource locator (URL) of the vendor (i.e. the vendors web site).
17
+ * <li><i>Collection version</i>: the version of the design collection.
18
+ * <li><i>Last modification date</i>: the date when the design collection was imported (the last time).
19
+ * <li><i>Contained templates</i>: the templates contained by the design collection.
20
+ * </ul>
21
+ * <p>
22
+ * Note: All data provided by <i>Inx_Api_DesignTemplate_DesignCollection</i> is read only!
23
+ * <p>
24
+ * For an example on how to import and use design collections, see the <i>Inx_Api_DesignTemplate_DesignCollectionManager</i>
25
+ * documentation.
26
+ *
27
+ * @see Inx_Api_DesignTemplate_DesignCollectionManager
28
+ * @see Inx_Api_DesignTemplate_Template
29
+ * @since API 1.4.0
30
+ * @version $Revision: 9553 $Date: 2007-01-25 15:00:09 $ $Author: nds$
31
+ * @package Inxmail
32
+ * @subpackage DesignTemplate
33
+ */
34
+ interface Inx_Api_DesignTemplate_DesignCollection extends Inx_Api_BusinessObject
35
+ {
36
+ /**
37
+ * Returns the technical name of the design collection.
38
+ *
39
+ * @return string the technical name of the design collection.
40
+ */
41
+ public function getName();
42
+
43
+ /**
44
+ * Returns the display name of the design collection.
45
+ *
46
+ * @return string the display name of the design collection.
47
+ * @since API 1.9.0
48
+ */
49
+ public function getDisplayName();
50
+
51
+ /**
52
+ * Returns the name of the design collection vendor.
53
+ *
54
+ * @return string the name of the design collection vendor.
55
+ */
56
+ public function getVendor();
57
+
58
+ /**
59
+ * Returns the uniform resource locator (URL) of the vendor (i.e. the vendors web site).
60
+ *
61
+ * @return string the URL of the design collection vendor.
62
+ */
63
+ public function getVendorURL();
64
+
65
+ /**
66
+ * Returns the version of the design collection.
67
+ *
68
+ * @return string the version of the design collection.
69
+ */
70
+ public function getVersion();
71
+
72
+ /**
73
+ * Returns the date when the design collection was imported (the last time).
74
+ *
75
+ * @return string the date of the last modification of the design collection.
76
+ * The date will be returned as ISO 8601 formatted datetime string.
77
+ */
78
+ public function getLastModificationDate();
79
+
80
+ /**
81
+ * Returns all templates contained by this design collection.
82
+ *
83
+ * @return an array of all <i>Inx_Api_DesignTemplate_Template</i>s contained by this design collection.
84
+ */
85
+ public function getTemplates();
86
  }
lib/Inx/Api/DesignTemplate/DesignCollectionManager.php CHANGED
@@ -1,127 +1,127 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DesignTemplate
5
- */
6
- /**
7
- * The <i>Inx_Api_DesignTemplate_DesignCollectionMananger</i> can be used to access <i>Inx_Api_DesignTemplate_DesignCollection</i>s.
8
- * You can import design collections from itc files into a specific list or all lists (by using the <i>SystemListContext</i>).
9
- * You can also retrieve the collections available in a specific list or all lists (by ommitting the list parameter).
10
- * <p>
11
- * <i>Inx_Api_DesignTemplate_DesignCollection</i>s are returned in an <i>Inx_Api_BOResultSet</i> that may be used to access
12
- * the individual collections.
13
- * <i>Inx_Api_DesignTemplate_DesignCollection</i>s may contain multiple templates with possibly multiple text and HTML styles.
14
- * These styles can be used to create new mailings based on the chosen template.
15
- * <p>
16
- * The following snippet shows how to generate a mailing based on a newly imported design collection:
17
- *
18
- * <pre>
19
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Name of the desired List&quot; );
20
- * $oMailing = $oSession->getMailingManager()->createMailing( $oListContext );
21
- * $oMailing->setContentHandler( &quot;Inx_Api_Mailing_XsltMultiPartContentHandler&quot; );
22
- *
23
- * $oDesignCollectionManager = $oSession->getDesignCollectionManager();
24
- *
25
- * $stream = fopen( &quot;test.itc&quot;, &quot;rb&quot;);
26
- *
27
- * $oDesignCollection = $oDesignCollectionManager->importDesignCollection( $stream, $oListContext );
28
- * fclose($stream);
29
- * $aTemplates = $oDesignCollection->getTemplates();
30
- *
31
- * $oContentHandler = $oMailing->getContentHandler();
32
- * $aStyles = $aTemplates[0]->getHTMLStyles();
33
- * $oContentHandler->updateStyle( $aStyles[0] );
34
- *
35
- * $oMailing->commitUpdate();
36
- * </pre>
37
- *
38
- * </p>
39
- * <p>
40
- * The following snippet shows how to list all available HTML styles of all design collections in a certain list:
41
- *
42
- * <pre>
43
- * $oDesignCollectionManager = $oSession->getDesignCollectionManager();
44
- *
45
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Name of the desired List&quot; );
46
- *
47
- * $oBOResultSet = $oDesignCollectionManager->select($oListContext);
48
- *
49
- * for( $i = 0; $i&lt;$oBOResultSet->getSize(); $i++)
50
- * {
51
- * $oDesignCollection = $oBOResultSet->get($i);
52
- * echo $oDesignCollection->getVendor();
53
- * echo $oDesignCollection->getVendorURL();
54
- * ...
55
- * $aTemplates = $oDesignCollection->getTemplates();
56
- * for($j = 0; $j&lt;count($aTemplates); $j++)
57
- * {
58
- * $oTemplate = $aTemplates[j];
59
- * echo $oTemplate->getName();
60
- * echo $oTemplate->getId();
61
- * $aHtmlStyles = $oTemplate->getHTMLStyles();
62
- * for ($k = 0; $k&lt;count($aHtmlStyles); $k++)
63
- * {
64
- * echo $aHtmlStyles[k]->getTemplateID();
65
- * echo $aHtmlStyles[k]->getStyleName();
66
- * }
67
- * }
68
- * }
69
- *
70
- * $oBOResultSet->close();
71
- * </pre>
72
- *
73
- * </p>
74
- * Note: The usage of <i>Inx_Api_DesignTemplate_DesignCollection</i>s requires the api user right:
75
- * <i>Inx_Api_UserRights::TEMPLATE_FEATURE_USE</i>
76
- * <p>
77
- * For more information on design collections, see the <i>Inx_Api_DesignTemplate_DesignCollection</i> documentation.
78
- *
79
- * @see Inx_Api_DesignTemplate_DesignCollection
80
- * @since API 1.4.0
81
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
82
- * @package Inxmail
83
- * @subpackage DesignTemplate
84
- */
85
-
86
- interface Inx_Api_DesignTemplate_DesignCollectionManager extends Inx_Api_BOManager
87
- {
88
- /**
89
- * Imports the desired itc file into the specified list to be used there. Importing an itc into the system list will
90
- * make the design collection available in all lists. The following snippet retrieves the system list context:
91
- * <PRE>
92
- * $oListContextManager = $oSession->getListContextManager();
93
- * $oListContextc = $oListContextManager->findByName( Inx_Api_SystemListContext::NAME );
94
- * </PRE>
95
- *
96
- * @param resource $rbItcFile the itc file handle from which the itc file will be read.
97
- * @param Inx_Api_List_ListContext $oCxt the list to import the design collection into.
98
- * @return Inx_Api_DesignTemplate_DesignCollection the generated <i>Inx_Api_DesignTemplate_DesignCollection</i>.
99
- * @throws Inx_Api_IOException if the resource cannot be read.
100
- * @throws Inx_Api_DesignTemplate_ImportException if an error occurred while importing the itc file.
101
- * @throws Inx_Api_FeatureNotAvailableException if the design template feature is not available in the given list.
102
- * This exception is thrown since API 1.9.0.
103
- */
104
- public function importDesignCollection( $rbItcFile, Inx_Api_List_ListContext $oCxt );
105
-
106
- /**
107
- * Returns the <i>Inx_Api_DesignTemplate_DesignCollection</i>s available in the specified list.
108
- * To retrieve all design collections from all lists, pass on a <i>null</i> value.
109
- *
110
- * @param Inx_Api_List_ListContext $oListContext all design collections available in this list will be returned.
111
- * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing the fetched
112
- * <i>Inx_Api_DesignTemplate_DesignCollection</i>s.
113
- */
114
- public function select( Inx_Api_List_ListContext $oListContext );
115
-
116
-
117
-
118
- /**
119
- * Returns the preview image, provided by the design collection. Can be null, if no image was provided.
120
- * This method does not return an actual screenshot of a mailing generated with this
121
- * <i>Inx_Api_DesignTemplate_Style</i>, but an image provided and generated by the design collection author.
122
- *
123
- * @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> containing the image data.
124
- * @throws Inx_Api_NullPointerException when the passed style is <i>null</i>.
125
- */
126
- public function createPreviewImageStream( Inx_Api_DesignTemplate_Style $oStyle );
127
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DesignTemplate
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_DesignTemplate_DesignCollectionMananger</i> can be used to access <i>Inx_Api_DesignTemplate_DesignCollection</i>s.
8
+ * You can import design collections from itc files into a specific list or all lists (by using the <i>SystemListContext</i>).
9
+ * You can also retrieve the collections available in a specific list or all lists (by ommitting the list parameter).
10
+ * <p>
11
+ * <i>Inx_Api_DesignTemplate_DesignCollection</i>s are returned in an <i>Inx_Api_BOResultSet</i> that may be used to access
12
+ * the individual collections.
13
+ * <i>Inx_Api_DesignTemplate_DesignCollection</i>s may contain multiple templates with possibly multiple text and HTML styles.
14
+ * These styles can be used to create new mailings based on the chosen template.
15
+ * <p>
16
+ * The following snippet shows how to generate a mailing based on a newly imported design collection:
17
+ *
18
+ * <pre>
19
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Name of the desired List&quot; );
20
+ * $oMailing = $oSession->getMailingManager()->createMailing( $oListContext );
21
+ * $oMailing->setContentHandler( &quot;Inx_Api_Mailing_XsltMultiPartContentHandler&quot; );
22
+ *
23
+ * $oDesignCollectionManager = $oSession->getDesignCollectionManager();
24
+ *
25
+ * $stream = fopen( &quot;test.itc&quot;, &quot;rb&quot;);
26
+ *
27
+ * $oDesignCollection = $oDesignCollectionManager->importDesignCollection( $stream, $oListContext );
28
+ * fclose($stream);
29
+ * $aTemplates = $oDesignCollection->getTemplates();
30
+ *
31
+ * $oContentHandler = $oMailing->getContentHandler();
32
+ * $aStyles = $aTemplates[0]->getHTMLStyles();
33
+ * $oContentHandler->updateStyle( $aStyles[0] );
34
+ *
35
+ * $oMailing->commitUpdate();
36
+ * </pre>
37
+ *
38
+ * </p>
39
+ * <p>
40
+ * The following snippet shows how to list all available HTML styles of all design collections in a certain list:
41
+ *
42
+ * <pre>
43
+ * $oDesignCollectionManager = $oSession->getDesignCollectionManager();
44
+ *
45
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Name of the desired List&quot; );
46
+ *
47
+ * $oBOResultSet = $oDesignCollectionManager->select($oListContext);
48
+ *
49
+ * for( $i = 0; $i&lt;$oBOResultSet->getSize(); $i++)
50
+ * {
51
+ * $oDesignCollection = $oBOResultSet->get($i);
52
+ * echo $oDesignCollection->getVendor();
53
+ * echo $oDesignCollection->getVendorURL();
54
+ * ...
55
+ * $aTemplates = $oDesignCollection->getTemplates();
56
+ * for($j = 0; $j&lt;count($aTemplates); $j++)
57
+ * {
58
+ * $oTemplate = $aTemplates[j];
59
+ * echo $oTemplate->getName();
60
+ * echo $oTemplate->getId();
61
+ * $aHtmlStyles = $oTemplate->getHTMLStyles();
62
+ * for ($k = 0; $k&lt;count($aHtmlStyles); $k++)
63
+ * {
64
+ * echo $aHtmlStyles[k]->getTemplateID();
65
+ * echo $aHtmlStyles[k]->getStyleName();
66
+ * }
67
+ * }
68
+ * }
69
+ *
70
+ * $oBOResultSet->close();
71
+ * </pre>
72
+ *
73
+ * </p>
74
+ * Note: The usage of <i>Inx_Api_DesignTemplate_DesignCollection</i>s requires the api user right:
75
+ * <i>Inx_Api_UserRights::TEMPLATE_FEATURE_USE</i>
76
+ * <p>
77
+ * For more information on design collections, see the <i>Inx_Api_DesignTemplate_DesignCollection</i> documentation.
78
+ *
79
+ * @see Inx_Api_DesignTemplate_DesignCollection
80
+ * @since API 1.4.0
81
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
82
+ * @package Inxmail
83
+ * @subpackage DesignTemplate
84
+ */
85
+
86
+ interface Inx_Api_DesignTemplate_DesignCollectionManager extends Inx_Api_BOManager
87
+ {
88
+ /**
89
+ * Imports the desired itc file into the specified list to be used there. Importing an itc into the system list will
90
+ * make the design collection available in all lists. The following snippet retrieves the system list context:
91
+ * <PRE>
92
+ * $oListContextManager = $oSession->getListContextManager();
93
+ * $oListContextc = $oListContextManager->findByName( Inx_Api_SystemListContext::NAME );
94
+ * </PRE>
95
+ *
96
+ * @param resource $rbItcFile the itc file handle from which the itc file will be read.
97
+ * @param Inx_Api_List_ListContext $oCxt the list to import the design collection into.
98
+ * @return Inx_Api_DesignTemplate_DesignCollection the generated <i>Inx_Api_DesignTemplate_DesignCollection</i>.
99
+ * @throws Inx_Api_IOException if the resource cannot be read.
100
+ * @throws Inx_Api_DesignTemplate_ImportException if an error occurred while importing the itc file.
101
+ * @throws Inx_Api_FeatureNotAvailableException if the design template feature is not available in the given list.
102
+ * This exception is thrown since API 1.9.0.
103
+ */
104
+ public function importDesignCollection( $rbItcFile, Inx_Api_List_ListContext $oCxt );
105
+
106
+ /**
107
+ * Returns the <i>Inx_Api_DesignTemplate_DesignCollection</i>s available in the specified list.
108
+ * To retrieve all design collections from all lists, pass on a <i>null</i> value.
109
+ *
110
+ * @param Inx_Api_List_ListContext $oListContext all design collections available in this list will be returned.
111
+ * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing the fetched
112
+ * <i>Inx_Api_DesignTemplate_DesignCollection</i>s.
113
+ */
114
+ public function select( Inx_Api_List_ListContext $oListContext );
115
+
116
+
117
+
118
+ /**
119
+ * Returns the preview image, provided by the design collection. Can be null, if no image was provided.
120
+ * This method does not return an actual screenshot of a mailing generated with this
121
+ * <i>Inx_Api_DesignTemplate_Style</i>, but an image provided and generated by the design collection author.
122
+ *
123
+ * @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> containing the image data.
124
+ * @throws Inx_Api_NullPointerException when the passed style is <i>null</i>.
125
+ */
126
+ public function createPreviewImageStream( Inx_Api_DesignTemplate_Style $oStyle );
127
+ }
lib/Inx/Api/DesignTemplate/ImportException.php CHANGED
@@ -1,111 +1,111 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DesignTemplate
5
- */
6
-
7
- /**
8
- * The <i>Inx_Api_DesignTemplate_ImportException</i> is thrown, when an error occurs while importing an itc file.
9
- * <p>
10
- * There are several types of this exception:
11
- * <ul>
12
- * <li>NO_ITC_FILE: the provided file is no valid itc file.
13
- * <li>IMPORT_ERROR: the import failed due to a non specific error.
14
- * <li>XML_ERROR: the XML data of the itc file is not valid.
15
- * <li>SYSTEM_ERROR: a major system error occurred.
16
- * </ul>
17
- * For further insight on the cause of the error, check the warnings, errors and fatals of this exception, using
18
- * the corresponding method.
19
- *
20
- * @see Inx_Api_DesignTemplate_DesignCollectionManager::importDesignCollection($resource, $oListContext)
21
- * @since API 1.4.0
22
- * @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
23
- * @package Inxmail
24
- * @subpackage DesignTemplate
25
- */
26
- class Inx_Api_DesignTemplate_ImportException extends Exception
27
- {
28
- /**
29
- * The provided import file is no valid itc file.
30
- */
31
- const NO_ITC_FILE = -1;
32
-
33
- /**
34
- * A non specific error occurred during the import.
35
- * For further insight on the cause of the error, check the warnings, errors and fatals of this exception.
36
- */
37
- const IMPORT_ERROR = -2;
38
-
39
- /**
40
- * A major system error occurred during the import. Please check what happened exactly to prevent further failures.
41
- * Tips for error analysis:
42
- * <ul>
43
- * <li>Check the warnings, errors and fatals of this exception
44
- * <li>Check the customer log of your inxmail server (if possible)
45
- * <li>Check the tomcat log of your inxmail server (if possible)
46
- * </ul>
47
- */
48
- const SYSTEM_ERROR = -5;
49
-
50
- /**
51
- * The XML data of the itc file is not valid and cannot be parsed.
52
- */
53
- const XML_ERROR = -6;
54
-
55
- private $aWarnings;
56
-
57
- private $aErrors;
58
-
59
- private $aFatals;
60
-
61
- /**
62
- * Creates an <i>Inx_Api_DesignTemplate_ImportException</i> with the given type, detail message, warnings,
63
- * errors and fatals.
64
- *
65
- * @param int $iCode the type of the exception. Can be one of the constants defined by this exception.
66
- * @param string $sMessage the detail message of the exception.
67
- * @param array $aWarnings the warning messages (string) of the exception.
68
- * @param array $aErrors the error messages (string) of the exception.
69
- * @param array $aFatals the fatal messages (string) of the exception.
70
- */
71
- public function __construct( $sMessage, $iCode, $aWarnings, $aErrors,
72
- $aFatals )
73
- {
74
- parent::__construct( $sMessage, $iCode );
75
-
76
- $this->aWarnings = $aWarnings;
77
- $this->aErrors = $aErrors;
78
- $this->aFatals = $aFatals;
79
- }
80
-
81
- /**
82
- * Returns the error level messages produced by exceptions during the import.
83
- *
84
- * @return array the error level messages (string).
85
- */
86
- public function getErrors()
87
- {
88
- return $this->aErrors;
89
- }
90
-
91
- /**
92
- * Returns the fatal level messages produced by exceptions during the import.
93
- *
94
- * @return array the fatal level messages (string).
95
- */
96
- public function getFatals()
97
- {
98
- return $this->aFatals;
99
- }
100
-
101
- /**
102
- * Returns the warning level messages produced by exceptions during the import.
103
- *
104
- * @return array the warning level messages (string).
105
- */
106
- public function getWarnings()
107
- {
108
- return $this->aWarnings;
109
- }
110
-
111
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DesignTemplate
5
+ */
6
+
7
+ /**
8
+ * The <i>Inx_Api_DesignTemplate_ImportException</i> is thrown, when an error occurs while importing an itc file.
9
+ * <p>
10
+ * There are several types of this exception:
11
+ * <ul>
12
+ * <li>NO_ITC_FILE: the provided file is no valid itc file.
13
+ * <li>IMPORT_ERROR: the import failed due to a non specific error.
14
+ * <li>XML_ERROR: the XML data of the itc file is not valid.
15
+ * <li>SYSTEM_ERROR: a major system error occurred.
16
+ * </ul>
17
+ * For further insight on the cause of the error, check the warnings, errors and fatals of this exception, using
18
+ * the corresponding method.
19
+ *
20
+ * @see Inx_Api_DesignTemplate_DesignCollectionManager::importDesignCollection($resource, $oListContext)
21
+ * @since API 1.4.0
22
+ * @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
23
+ * @package Inxmail
24
+ * @subpackage DesignTemplate
25
+ */
26
+ class Inx_Api_DesignTemplate_ImportException extends Exception
27
+ {
28
+ /**
29
+ * The provided import file is no valid itc file.
30
+ */
31
+ const NO_ITC_FILE = -1;
32
+
33
+ /**
34
+ * A non specific error occurred during the import.
35
+ * For further insight on the cause of the error, check the warnings, errors and fatals of this exception.
36
+ */
37
+ const IMPORT_ERROR = -2;
38
+
39
+ /**
40
+ * A major system error occurred during the import. Please check what happened exactly to prevent further failures.
41
+ * Tips for error analysis:
42
+ * <ul>
43
+ * <li>Check the warnings, errors and fatals of this exception
44
+ * <li>Check the customer log of your inxmail server (if possible)
45
+ * <li>Check the tomcat log of your inxmail server (if possible)
46
+ * </ul>
47
+ */
48
+ const SYSTEM_ERROR = -5;
49
+
50
+ /**
51
+ * The XML data of the itc file is not valid and cannot be parsed.
52
+ */
53
+ const XML_ERROR = -6;
54
+
55
+ private $aWarnings;
56
+
57
+ private $aErrors;
58
+
59
+ private $aFatals;
60
+
61
+ /**
62
+ * Creates an <i>Inx_Api_DesignTemplate_ImportException</i> with the given type, detail message, warnings,
63
+ * errors and fatals.
64
+ *
65
+ * @param int $iCode the type of the exception. Can be one of the constants defined by this exception.
66
+ * @param string $sMessage the detail message of the exception.
67
+ * @param array $aWarnings the warning messages (string) of the exception.
68
+ * @param array $aErrors the error messages (string) of the exception.
69
+ * @param array $aFatals the fatal messages (string) of the exception.
70
+ */
71
+ public function __construct( $sMessage, $iCode, $aWarnings, $aErrors,
72
+ $aFatals )
73
+ {
74
+ parent::__construct( $sMessage, $iCode );
75
+
76
+ $this->aWarnings = $aWarnings;
77
+ $this->aErrors = $aErrors;
78
+ $this->aFatals = $aFatals;
79
+ }
80
+
81
+ /**
82
+ * Returns the error level messages produced by exceptions during the import.
83
+ *
84
+ * @return array the error level messages (string).
85
+ */
86
+ public function getErrors()
87
+ {
88
+ return $this->aErrors;
89
+ }
90
+
91
+ /**
92
+ * Returns the fatal level messages produced by exceptions during the import.
93
+ *
94
+ * @return array the fatal level messages (string).
95
+ */
96
+ public function getFatals()
97
+ {
98
+ return $this->aFatals;
99
+ }
100
+
101
+ /**
102
+ * Returns the warning level messages produced by exceptions during the import.
103
+ *
104
+ * @return array the warning level messages (string).
105
+ */
106
+ public function getWarnings()
107
+ {
108
+ return $this->aWarnings;
109
+ }
110
+
111
+ }
lib/Inx/Api/DesignTemplate/Style.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DesignTemplate
5
- */
6
-
7
- /**
8
- * An <i>Inx_Api_DesignTemplate_Style</i> defines the visual representation of a particular template or mailing.
9
- * The style will be used to render the mailing.
10
- * <p>
11
- * For more information on templates, see the <i>Inx_Api_DesignTemplate_Template</i> documentation.
12
- *
13
- * @see Inx_Api_DesignTemplate_Template
14
- * @since API 1.4.0
15
- * @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
16
- * @package Inxmail
17
- * @subpackage DesignTemplate
18
- */
19
- interface Inx_Api_DesignTemplate_Style
20
- {
21
- /**
22
- * Returns the id of the template, which contains this style.
23
- * @return int the id of the template, which contains this style.
24
- */
25
- public function getTemplateId();
26
-
27
- /**
28
- * Returns the name of this style.
29
- * @return string the name of this style.
30
- */
31
- public function getStyleName();
32
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DesignTemplate
5
+ */
6
+
7
+ /**
8
+ * An <i>Inx_Api_DesignTemplate_Style</i> defines the visual representation of a particular template or mailing.
9
+ * The style will be used to render the mailing.
10
+ * <p>
11
+ * For more information on templates, see the <i>Inx_Api_DesignTemplate_Template</i> documentation.
12
+ *
13
+ * @see Inx_Api_DesignTemplate_Template
14
+ * @since API 1.4.0
15
+ * @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
16
+ * @package Inxmail
17
+ * @subpackage DesignTemplate
18
+ */
19
+ interface Inx_Api_DesignTemplate_Style
20
+ {
21
+ /**
22
+ * Returns the id of the template, which contains this style.
23
+ * @return int the id of the template, which contains this style.
24
+ */
25
+ public function getTemplateId();
26
+
27
+ /**
28
+ * Returns the name of this style.
29
+ * @return string the name of this style.
30
+ */
31
+ public function getStyleName();
32
+ }
lib/Inx/Api/DesignTemplate/Template.php CHANGED
@@ -1,50 +1,50 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage DesignTemplate
5
- */
6
- /**
7
- * An <i>Inx_Api_DesignTemplate_Template</i> provides a common structure for complex multipart mailings.
8
- * A template may contain multiple (but at least one) text and HTML style which is used to render the mailing.
9
- * Multiple <i>Inx_Api_DesignTemplate_Template</i>s can be stored in an <i>Inx_Api_DesignTemplate_DesignCollection</i>.
10
- *
11
- * @see Inx_Api_DesignTemplate_Style
12
- * @see Inx_Api_DesignTemplate_DesignCollection
13
- * @since API 1.4.0
14
- * @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
15
- * @package Inxmail
16
- * @subpackage DesignTemplate
17
- */
18
- interface Inx_Api_DesignTemplate_Template
19
- {
20
- /**
21
- * Returns the name of the template.
22
- *
23
- * @return string the name of the template.
24
- */
25
- public function getName();
26
-
27
- /**
28
- * Returns the id of the template.
29
- *
30
- * @return int the id of the template.
31
- */
32
- public function getId();
33
-
34
- /**
35
- * Returns all text <code>Style</code>s in this template. The default text style, which should be used for a
36
- * multipart mailing, if there is no appropriate text style for the chosen HTML style, is the first in the array.
37
- *
38
- * @return array all text <i>Inx_Api_DesignTemplate_Style</i>s of this template.
39
- * The default text style is the first in the array.
40
- */
41
- public function getTextStyles();
42
-
43
- /**
44
- * Returns all HTML <i>Inx_Api_DesignTemplate_Style</i>s in this template.
45
- * Note, that to generate a multipart mailing, the HTML style should be passed on to the <i>Inx_Api_Mailing_XsltContentHandler</i>.
46
- *
47
- * @return array all HTML styles of this template.
48
- */
49
- public function getHTMLStyles();
50
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage DesignTemplate
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_DesignTemplate_Template</i> provides a common structure for complex multipart mailings.
8
+ * A template may contain multiple (but at least one) text and HTML style which is used to render the mailing.
9
+ * Multiple <i>Inx_Api_DesignTemplate_Template</i>s can be stored in an <i>Inx_Api_DesignTemplate_DesignCollection</i>.
10
+ *
11
+ * @see Inx_Api_DesignTemplate_Style
12
+ * @see Inx_Api_DesignTemplate_DesignCollection
13
+ * @since API 1.4.0
14
+ * @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
15
+ * @package Inxmail
16
+ * @subpackage DesignTemplate
17
+ */
18
+ interface Inx_Api_DesignTemplate_Template
19
+ {
20
+ /**
21
+ * Returns the name of the template.
22
+ *
23
+ * @return string the name of the template.
24
+ */
25
+ public function getName();
26
+
27
+ /**
28
+ * Returns the id of the template.
29
+ *
30
+ * @return int the id of the template.
31
+ */
32
+ public function getId();
33
+
34
+ /**
35
+ * Returns all text <code>Style</code>s in this template. The default text style, which should be used for a
36
+ * multipart mailing, if there is no appropriate text style for the chosen HTML style, is the first in the array.
37
+ *
38
+ * @return array all text <i>Inx_Api_DesignTemplate_Style</i>s of this template.
39
+ * The default text style is the first in the array.
40
+ */
41
+ public function getTextStyles();
42
+
43
+ /**
44
+ * Returns all HTML <i>Inx_Api_DesignTemplate_Style</i>s in this template.
45
+ * Note, that to generate a multipart mailing, the HTML style should be passed on to the <i>Inx_Api_Mailing_XsltContentHandler</i>.
46
+ *
47
+ * @return array all HTML styles of this template.
48
+ */
49
+ public function getHTMLStyles();
50
+ }
lib/Inx/Api/FeatureNotAvailableException.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_FeatureNotAvailableException</i> is thrown when a feature is not available or not enabled in a list.
7
- * <p>
8
- * Example: Calling <i>Inx_Api__List_ListContext->enableFeature(Features::SUBSCRIPTION_FEATURE_ID)</i> on a dynamic
9
- * list will raise a <i>FeatureNotAvailableException</i>. The same is true wehn calling
10
- * <i>Inx_Api_Subscription_SubscriptionManager->processSubscription()</i> for a list with disabled subscription feature.
11
- *
12
- * @see Inx_Api_List_ListContext#enableFeature(int)
13
- * @see Inx_Api_List_ListContext#disableFeature(int)
14
- * @see Inx_Api_Subscription_SubscriptionManager#processSubscription(Inx_Api_List_StandardListContext, String)
15
- * @see Inx_Api_Subscription_SubscriptionManager#processUnsubscription(Inx_Api_List_StandardListContext, String)
16
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
17
- * @package Inxmail
18
- */
19
- class Inx_Api_FeatureNotAvailableException extends Inx_Api_APIException
20
- {
21
-
22
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_FeatureNotAvailableException</i> is thrown when a feature is not available or not enabled in a list.
7
+ * <p>
8
+ * Example: Calling <i>Inx_Api__List_ListContext->enableFeature(Features::SUBSCRIPTION_FEATURE_ID)</i> on a dynamic
9
+ * list will raise a <i>FeatureNotAvailableException</i>. The same is true wehn calling
10
+ * <i>Inx_Api_Subscription_SubscriptionManager->processSubscription()</i> for a list with disabled subscription feature.
11
+ *
12
+ * @see Inx_Api_List_ListContext#enableFeature(int)
13
+ * @see Inx_Api_List_ListContext#disableFeature(int)
14
+ * @see Inx_Api_Subscription_SubscriptionManager#processSubscription(Inx_Api_List_StandardListContext, String)
15
+ * @see Inx_Api_Subscription_SubscriptionManager#processUnsubscription(Inx_Api_List_StandardListContext, String)
16
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
17
+ * @package Inxmail
18
+ */
19
+ class Inx_Api_FeatureNotAvailableException extends Inx_Api_APIException
20
+ {
21
+
22
+ }
lib/Inx/Api/Features.php CHANGED
@@ -1,136 +1,136 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * Agents, like "Mailing", "Subscription" or "Resource" are called "Features"
7
- * in the API language. Which features are available can be obtained
8
- * from the <i>Inx_Api_Features</i> interface.
9
- *
10
- * Features are enabled and disabled from the Inx_Api_List_ListContext, as following example
11
- * demonstrates, which enables the "Subscription" agent in the choosen mailing list:
12
- *
13
- * <PRE>
14
- * $oListContext = $oListManager->findByName( $sListName );
15
- * $oListContext->enableFeature( Inx_Api_Features::SUBSCRIPTION_FEATURE_ID );
16
- * </PRE>
17
- *
18
- *
19
- * Not every feature is accessible for every type of list. For example, subscription
20
- * feature is available in standard lists, only. The mailing feature can be used in
21
- * standard and filter lists.
22
- *
23
- * @see Inx_Api_List_ListContext#isFeatureEnabled(int)
24
- * @see Inx_Api_List_ListContext#enableFeature(int)
25
- * @see Inx_Api_List_ListContext#disableFeature(int)
26
- * @since API 1.0
27
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
28
- * @package Inxmail
29
- */
30
- interface Inx_Api_Features
31
- {
32
-
33
- /**
34
- * The subscription feature is available in:
35
- * <ul>
36
- * <li> standard lists </li>
37
- * </ul>
38
- * @since API 1.0
39
- */
40
- const SUBSCRIPTION_FEATURE_ID = 10000;
41
-
42
- /**
43
- * The mailing feature is available in:
44
- * <ul>
45
- * <li> standard lists
46
- * <li> and filter lists
47
- * </ul>
48
- * @since API 1.0
49
- */
50
- const MAILING_FEATURE_ID = 10001;
51
-
52
- /**
53
- * The resource feature is available in:
54
- * <ul>
55
- * <li> system list
56
- * </ul>
57
- * @since API 1.0
58
- */
59
- const RESOURCE_FEATURE_ID = 10002;
60
-
61
- /**
62
- * The blacklist feature is available in:
63
- * <ul>
64
- * <li> system list
65
- * </ul>
66
- * @since API 1.1.0
67
- */
68
- const BLACKLIST_FEATURE_ID = 10003;
69
-
70
- /**
71
- * The filter feature is available in:
72
- * <ul>
73
- * <li> system list
74
- * </ul>
75
- * @since API 1.1.0
76
- */
77
- const FILTER_FEATURE_ID = 10004;
78
-
79
- /**
80
- * The report feature is available in:
81
- * <ul>
82
- * <li> standard lists
83
- * <li> filter lists
84
- * <li> and system list
85
- * </ul>
86
- * @since API 1.1.0
87
- */
88
- const REPORT_FEATURE_ID = 10005;
89
-
90
- /**
91
- * The action feature is available in:
92
- * <ul>
93
- * <li> system list
94
- * </ul>
95
- *
96
- * @since API 1.1.2
97
- */
98
- const ACTION_FEATURE_ID = 10006;
99
-
100
- /**
101
- * The textmodule, mailing template and design template feature is available in:
102
- * <ul>
103
- * <li> standard lists
104
- * <li> filter lists
105
- * <li> and system list
106
- * </ul>
107
- *
108
- * @since API 1.4.0
109
- */
110
- const TEXTMODULE_FEATURE_ID = 10007;
111
-
112
-
113
- /**
114
- * The testprofiles feature is available in:
115
- * <ul>
116
- * <li> standard lists
117
- * <li> filter lists
118
- * <li> and system list
119
- * </ul>
120
- *
121
- * @since API 1.6.0
122
- */
123
- const TESTPROFILES_FEATURE_ID = 10008;
124
-
125
- /**
126
- * The template feature is available in:
127
- * <ul>
128
- * <li>standard lists
129
- * <li>filter lists
130
- * <li>and system list
131
- *
132
- * @since API 1.7.0
133
- */
134
- const TEMPLATE_FEATURE_ID = 10009;
135
-
136
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * Agents, like "Mailing", "Subscription" or "Resource" are called "Features"
7
+ * in the API language. Which features are available can be obtained
8
+ * from the <i>Inx_Api_Features</i> interface.
9
+ *
10
+ * Features are enabled and disabled from the Inx_Api_List_ListContext, as following example
11
+ * demonstrates, which enables the "Subscription" agent in the choosen mailing list:
12
+ *
13
+ * <PRE>
14
+ * $oListContext = $oListManager->findByName( $sListName );
15
+ * $oListContext->enableFeature( Inx_Api_Features::SUBSCRIPTION_FEATURE_ID );
16
+ * </PRE>
17
+ *
18
+ *
19
+ * Not every feature is accessible for every type of list. For example, subscription
20
+ * feature is available in standard lists, only. The mailing feature can be used in
21
+ * standard and filter lists.
22
+ *
23
+ * @see Inx_Api_List_ListContext#isFeatureEnabled(int)
24
+ * @see Inx_Api_List_ListContext#enableFeature(int)
25
+ * @see Inx_Api_List_ListContext#disableFeature(int)
26
+ * @since API 1.0
27
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
28
+ * @package Inxmail
29
+ */
30
+ interface Inx_Api_Features
31
+ {
32
+
33
+ /**
34
+ * The subscription feature is available in:
35
+ * <ul>
36
+ * <li> standard lists </li>
37
+ * </ul>
38
+ * @since API 1.0
39
+ */
40
+ const SUBSCRIPTION_FEATURE_ID = 10000;
41
+
42
+ /**
43
+ * The mailing feature is available in:
44
+ * <ul>
45
+ * <li> standard lists
46
+ * <li> and filter lists
47
+ * </ul>
48
+ * @since API 1.0
49
+ */
50
+ const MAILING_FEATURE_ID = 10001;
51
+
52
+ /**
53
+ * The resource feature is available in:
54
+ * <ul>
55
+ * <li> system list
56
+ * </ul>
57
+ * @since API 1.0
58
+ */
59
+ const RESOURCE_FEATURE_ID = 10002;
60
+
61
+ /**
62
+ * The blacklist feature is available in:
63
+ * <ul>
64
+ * <li> system list
65
+ * </ul>
66
+ * @since API 1.1.0
67
+ */
68
+ const BLACKLIST_FEATURE_ID = 10003;
69
+
70
+ /**
71
+ * The filter feature is available in:
72
+ * <ul>
73
+ * <li> system list
74
+ * </ul>
75
+ * @since API 1.1.0
76
+ */
77
+ const FILTER_FEATURE_ID = 10004;
78
+
79
+ /**
80
+ * The report feature is available in:
81
+ * <ul>
82
+ * <li> standard lists
83
+ * <li> filter lists
84
+ * <li> and system list
85
+ * </ul>
86
+ * @since API 1.1.0
87
+ */
88
+ const REPORT_FEATURE_ID = 10005;
89
+
90
+ /**
91
+ * The action feature is available in:
92
+ * <ul>
93
+ * <li> system list
94
+ * </ul>
95
+ *
96
+ * @since API 1.1.2
97
+ */
98
+ const ACTION_FEATURE_ID = 10006;
99
+
100
+ /**
101
+ * The textmodule, mailing template and design template feature is available in:
102
+ * <ul>
103
+ * <li> standard lists
104
+ * <li> filter lists
105
+ * <li> and system list
106
+ * </ul>
107
+ *
108
+ * @since API 1.4.0
109
+ */
110
+ const TEXTMODULE_FEATURE_ID = 10007;
111
+
112
+
113
+ /**
114
+ * The testprofiles feature is available in:
115
+ * <ul>
116
+ * <li> standard lists
117
+ * <li> filter lists
118
+ * <li> and system list
119
+ * </ul>
120
+ *
121
+ * @since API 1.6.0
122
+ */
123
+ const TESTPROFILES_FEATURE_ID = 10008;
124
+
125
+ /**
126
+ * The template feature is available in:
127
+ * <ul>
128
+ * <li>standard lists
129
+ * <li>filter lists
130
+ * <li>and system list
131
+ *
132
+ * @since API 1.7.0
133
+ */
134
+ const TEMPLATE_FEATURE_ID = 10009;
135
+
136
+ }
lib/Inx/Api/Filter/Filter.php CHANGED
@@ -1,165 +1,165 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Filter
5
- */
6
- /**
7
- * An <i>Inx_Api_Filter_Filter</i> is used to define target groups of recipients that share common properties.
8
- * For example: All recipients born after 1970. To accomplish this, a <code>Filter</code> uses a statement.
9
- * The statement syntax is described in the documentation for {@link #updateStatement(String)}.
10
- * <p>
11
- * For an example on how to create filters, see the <i>Inx_Api_Filter_FilterManager</i> documentation.
12
- *
13
- * @see Inx_Api_Filter_FilterManager
14
- * @since API 1.1.0
15
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
16
- * @package Inxmail
17
- * @subpackage Filter
18
- */
19
- interface Inx_Api_Filter_Filter extends Inx_Api_BusinessObject
20
- {
21
- /**
22
- * Constant for the name attribute. Used as order attribute in <i>select</i> statements.
23
- *
24
- * @see Inx_Api_Filter_FilterManager::select($oListContext, $iOrderAttribute, $iOrderType)
25
- */
26
- const ATTRIBUTE_NAME = 0;
27
-
28
- /**
29
- * Constant for the statement attribute.
30
- */
31
- const ATTRIBUTE_STATEMENT = 1;
32
-
33
- /**
34
- * Constant for the creation datetime attribute. Used as order attribute in <i>select</i> statements.
35
- *
36
- * @see Inx_Api_Filter_FilterManager::select($oListContext, $iOrderAttribute, $iOrderType)
37
- */
38
- const ATTRIBUTE_CREATION_DATETIME = 2;
39
-
40
- /**
41
- * Constant for the list context attribute.
42
- */
43
- const ATTRIBUTE_LIST_CONTEXT_ID = 3;
44
-
45
-
46
- /**
47
- * Returns the unique name of this filter.
48
- *
49
- * @return string the unique name of this filter.
50
- */
51
- public function getName();
52
-
53
-
54
- /**
55
- * Sets the unique name of this filter.
56
- *
57
- * @param string $sName the unique name of this filter.
58
- */
59
- public function updateName( $sName );
60
-
61
-
62
- /**
63
- * Returns the statment of this filter. The statement defines the target group of recipients.
64
- *
65
- * @return string the statment of this filter.
66
- */
67
- public function getStatement();
68
-
69
-
70
- /**
71
- * Sets the filter statement. The statement defines the target group of recipients.
72
- * <p>
73
- * A filter statement consists of at least one condition that recipients must match. Multiple conditions may be
74
- * composed to a filter using the AND/OR operators. There are four possible condition types which may be used:
75
- * <ul>
76
- * <li><i>Column condition</i>: Compares the value of a column.
77
- * <li><i>Recipient reaction condition</i>: Checks if a recipient opened a mailing or clicked a link.
78
- * <li><i>Filter membership condition</i>: Checks if a recipient is member of a filter.
79
- * <li><i>Free expression</i>: Special checks and comparisons.
80
- * </ul>
81
- * <p>
82
- * The following operators may be used to compare columns to a given value or check their content:
83
- * <ul>
84
- * <li>column = value - checks for equality
85
- * <li>column <> value - checks for inequality
86
- * <li>column < value - checks if column value is less than given value
87
- * <li>column <= value - checks if column value is less than or equal to given value
88
- * <li>column > value - checks if column value is greater than given value
89
- * <li>column >= value - checks if column value is greater than or equal to given value
90
- * <li>column IS_EMPTY - checks if column value is empty
91
- * <li>column NOT_IS_EMPTY - checks if column value is not empty
92
- * </ul>
93
- * The check values have to be specified in the same data type as the column value. The different date types must be
94
- * specified as follows:
95
- * <ul>
96
- * <li><i>Text</i>: "Text" (be sure to escape the double quotes or use single quotes for the filter)
97
- * <li><i>Datetime</i>: #01.01.1970 13:37:42# (be sure to put a single whitespace between date and time)
98
- * <li><i>Date</i>: #01.01.1970#
99
- * <li><i>Time</i>: #13:37:42#
100
- * <li><i>Integer</i>: 42
101
- * <li><i>Floating point</i>: 47.11
102
- * <li><i>Boolean</i>: TRUE or FALSE (attention: case sensitive!)
103
- * </ul>
104
- * To specify the column which shall be compared it is best to use the Column("columnName") operator.
105
- * <p>
106
- * Using free expressions you can create more powerful statements. The operators which can be used in free
107
- * expressions are:
108
- * <ul>
109
- * <li>column LIKE value: checks for equality (case insensitive)
110
- * <li>column NOT_LIKE value: checks for inequality (case insensitive)
111
- * <li>column STARTS_WITH value: checks if column value starts with given value
112
- * <li>column NOT_STARTS_WITH value: checks if column value does not start with given value
113
- * <li>column ENDS_WITH value: checks if column value ends with given value
114
- * <li>column NOT_ENDS_WITH value: checks if column value does not end with given value
115
- * <li>column CONTAINS value: checks if column value contains given value
116
- * <li>column NOT_CONTAINS value: checks if column value does not contain given value
117
- * </ul>
118
- * All of these operators may be used along with text columns. The check values of free expressions may contain
119
- * wildcards to match a specific pattern.<br>
120
- * <strong>Note:</strong> The wilcard character used in free expressions is NOT the asterisk (*) but the percentage
121
- * sign (%).
122
- * <p>
123
- * Recipient reaction conditions may be used to select recipients who reacted on a specific mailing or link. The
124
- * operators used for recipient reaction conditions are:
125
- * <ul>
126
- * <li><i>HasOpened(mailingId)</i>: checks if the recipient opened the specified mailing
127
- * <li><i>HasClickedAnyLink(mailingId)</i>: checks if the recipient clicked any link in the specified mailing
128
- * <li><i>HasClicked(linkId)</i>: checks if the recipient clicked the specified link
129
- * </ul>
130
- * <p>
131
- * Filter membership conditions may be used to select recipients who are (or aren't) member of another filter. The
132
- * operators used for these checks are:
133
- * <ul>
134
- * <li><i>BelongsToGroup(filterName)</i>: checks if the recipient is a member of the specified filter.
135
- * <li><i>BelongsNotToGroup(filterName)</i>: checks if the recipient is not a member of the specified filter.
136
- * </ul>
137
- * <p>
138
- * Please note that date values for the filter have to be specified in german 24-hour date format. To accomplish this,
139
- * the date() function with the following date pattern can be used:
140
- * <pre>
141
- * $filterDate = date("d.m.Y H:i:s");
142
- * </pre>
143
- *
144
- * @param string $sStmt the filter statment.
145
- */
146
- public function updateStatement( $sStmt );
147
-
148
-
149
- /**
150
- * Returns the id of the list which this filter belongs to.
151
- *
152
- * @return int the id of the list which this filter belongs to.
153
- */
154
- public function getListContextId();
155
-
156
-
157
- /**
158
- * Returns the creation datetime of this filter.
159
- *
160
- * @return string the creation datetime of this filter. The creation datetime will be returned as ISO 8601
161
- * formatted datetime string.
162
- */
163
- public function getCreationDatetime();
164
-
165
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Filter
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Filter_Filter</i> is used to define target groups of recipients that share common properties.
8
+ * For example: All recipients born after 1970. To accomplish this, a <code>Filter</code> uses a statement.
9
+ * The statement syntax is described in the documentation for {@link #updateStatement(String)}.
10
+ * <p>
11
+ * For an example on how to create filters, see the <i>Inx_Api_Filter_FilterManager</i> documentation.
12
+ *
13
+ * @see Inx_Api_Filter_FilterManager
14
+ * @since API 1.1.0
15
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
16
+ * @package Inxmail
17
+ * @subpackage Filter
18
+ */
19
+ interface Inx_Api_Filter_Filter extends Inx_Api_BusinessObject
20
+ {
21
+ /**
22
+ * Constant for the name attribute. Used as order attribute in <i>select</i> statements.
23
+ *
24
+ * @see Inx_Api_Filter_FilterManager::select($oListContext, $iOrderAttribute, $iOrderType)
25
+ */
26
+ const ATTRIBUTE_NAME = 0;
27
+
28
+ /**
29
+ * Constant for the statement attribute.
30
+ */
31
+ const ATTRIBUTE_STATEMENT = 1;
32
+
33
+ /**
34
+ * Constant for the creation datetime attribute. Used as order attribute in <i>select</i> statements.
35
+ *
36
+ * @see Inx_Api_Filter_FilterManager::select($oListContext, $iOrderAttribute, $iOrderType)
37
+ */
38
+ const ATTRIBUTE_CREATION_DATETIME = 2;
39
+
40
+ /**
41
+ * Constant for the list context attribute.
42
+ */
43
+ const ATTRIBUTE_LIST_CONTEXT_ID = 3;
44
+
45
+
46
+ /**
47
+ * Returns the unique name of this filter.
48
+ *
49
+ * @return string the unique name of this filter.
50
+ */
51
+ public function getName();
52
+
53
+
54
+ /**
55
+ * Sets the unique name of this filter.
56
+ *
57
+ * @param string $sName the unique name of this filter.
58
+ */
59
+ public function updateName( $sName );
60
+
61
+
62
+ /**
63
+ * Returns the statment of this filter. The statement defines the target group of recipients.
64
+ *
65
+ * @return string the statment of this filter.
66
+ */
67
+ public function getStatement();
68
+
69
+
70
+ /**
71
+ * Sets the filter statement. The statement defines the target group of recipients.
72
+ * <p>
73
+ * A filter statement consists of at least one condition that recipients must match. Multiple conditions may be
74
+ * composed to a filter using the AND/OR operators. There are four possible condition types which may be used:
75
+ * <ul>
76
+ * <li><i>Column condition</i>: Compares the value of a column.
77
+ * <li><i>Recipient reaction condition</i>: Checks if a recipient opened a mailing or clicked a link.
78
+ * <li><i>Filter membership condition</i>: Checks if a recipient is member of a filter.
79
+ * <li><i>Free expression</i>: Special checks and comparisons.
80
+ * </ul>
81
+ * <p>
82
+ * The following operators may be used to compare columns to a given value or check their content:
83
+ * <ul>
84
+ * <li>column = value - checks for equality
85
+ * <li>column <> value - checks for inequality
86
+ * <li>column < value - checks if column value is less than given value
87
+ * <li>column <= value - checks if column value is less than or equal to given value
88
+ * <li>column > value - checks if column value is greater than given value
89
+ * <li>column >= value - checks if column value is greater than or equal to given value
90
+ * <li>column IS_EMPTY - checks if column value is empty
91
+ * <li>column NOT_IS_EMPTY - checks if column value is not empty
92
+ * </ul>
93
+ * The check values have to be specified in the same data type as the column value. The different date types must be
94
+ * specified as follows:
95
+ * <ul>
96
+ * <li><i>Text</i>: "Text" (be sure to escape the double quotes or use single quotes for the filter)
97
+ * <li><i>Datetime</i>: #01.01.1970 13:37:42# (be sure to put a single whitespace between date and time)
98
+ * <li><i>Date</i>: #01.01.1970#
99
+ * <li><i>Time</i>: #13:37:42#
100
+ * <li><i>Integer</i>: 42
101
+ * <li><i>Floating point</i>: 47.11
102
+ * <li><i>Boolean</i>: TRUE or FALSE (attention: case sensitive!)
103
+ * </ul>
104
+ * To specify the column which shall be compared it is best to use the Column("columnName") operator.
105
+ * <p>
106
+ * Using free expressions you can create more powerful statements. The operators which can be used in free
107
+ * expressions are:
108
+ * <ul>
109
+ * <li>column LIKE value: checks for equality (case insensitive)
110
+ * <li>column NOT_LIKE value: checks for inequality (case insensitive)
111
+ * <li>column STARTS_WITH value: checks if column value starts with given value
112
+ * <li>column NOT_STARTS_WITH value: checks if column value does not start with given value
113
+ * <li>column ENDS_WITH value: checks if column value ends with given value
114
+ * <li>column NOT_ENDS_WITH value: checks if column value does not end with given value
115
+ * <li>column CONTAINS value: checks if column value contains given value
116
+ * <li>column NOT_CONTAINS value: checks if column value does not contain given value
117
+ * </ul>
118
+ * All of these operators may be used along with text columns. The check values of free expressions may contain
119
+ * wildcards to match a specific pattern.<br>
120
+ * <strong>Note:</strong> The wilcard character used in free expressions is NOT the asterisk (*) but the percentage
121
+ * sign (%).
122
+ * <p>
123
+ * Recipient reaction conditions may be used to select recipients who reacted on a specific mailing or link. The
124
+ * operators used for recipient reaction conditions are:
125
+ * <ul>
126
+ * <li><i>HasOpened(mailingId)</i>: checks if the recipient opened the specified mailing
127
+ * <li><i>HasClickedAnyLink(mailingId)</i>: checks if the recipient clicked any link in the specified mailing
128
+ * <li><i>HasClicked(linkId)</i>: checks if the recipient clicked the specified link
129
+ * </ul>
130
+ * <p>
131
+ * Filter membership conditions may be used to select recipients who are (or aren't) member of another filter. The
132
+ * operators used for these checks are:
133
+ * <ul>
134
+ * <li><i>BelongsToGroup(filterName)</i>: checks if the recipient is a member of the specified filter.
135
+ * <li><i>BelongsNotToGroup(filterName)</i>: checks if the recipient is not a member of the specified filter.
136
+ * </ul>
137
+ * <p>
138
+ * Please note that date values for the filter have to be specified in german 24-hour date format. To accomplish this,
139
+ * the date() function with the following date pattern can be used:
140
+ * <pre>
141
+ * $filterDate = date("d.m.Y H:i:s");
142
+ * </pre>
143
+ *
144
+ * @param string $sStmt the filter statment.
145
+ */
146
+ public function updateStatement( $sStmt );
147
+
148
+
149
+ /**
150
+ * Returns the id of the list which this filter belongs to.
151
+ *
152
+ * @return int the id of the list which this filter belongs to.
153
+ */
154
+ public function getListContextId();
155
+
156
+
157
+ /**
158
+ * Returns the creation datetime of this filter.
159
+ *
160
+ * @return string the creation datetime of this filter. The creation datetime will be returned as ISO 8601
161
+ * formatted datetime string.
162
+ */
163
+ public function getCreationDatetime();
164
+
165
+ }
lib/Inx/Api/Filter/FilterManager.php CHANGED
@@ -1,96 +1,96 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Filter
5
- */
6
- /**
7
- * Often, mailings are to be sent not to the whole recipient list but only to a certain subgroup of recipients.
8
- * Examples for such target groups are 'All recipients who read HTML format', 'Women', 'Men', 'People interested in
9
- * product X', 'Recipients born after 1970', and so on.
10
- * <p>
11
- * The <i>Inx_Api_Filter_FilterManager</i> can be used to create and retrieve <code>Filter</code>s (target groups).
12
- * The following snippet creates a global <i>Inx_Api_Filter_Filter</i>:
13
- *
14
- * <pre>
15
- * $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
16
- * $oFilterManager = $oSession->getFilterManager();
17
- * $oFilter = $oFilterManager->createFilter( $oSystemListContext );
18
- *
19
- * $oFilter->updateName( "New Yorker" );
20
- * $oFilter->updateStatement( "city LIKE \"New York\"" );
21
- * $oFilter->commitUpdate();
22
- * </pre>
23
- * <p>
24
- * An <i>Inx_Api_Filter_Filter</i> can be assigned to an individual <i>Inx_Api_Mailing_Mailing</i>, as demonstrated
25
- * in the following snippet:
26
- *
27
- * <pre>
28
- * $oMailing = ...
29
- *
30
- * $oMailing->updateFilterId( $oFilter->getId() );
31
- * $oMailing->commitUpdate();
32
- * </pre>
33
- * <p>
34
- * The retrieval of <i>Inx_Api_Filter_Filter</i>s can be accomplished using the <i>selectAll()</i> method to retrieve all
35
- * filters, or one of the methods that expect an <i>Inx_Api_List_ListContext</i> to retrieve only the filters assigned to a
36
- * specific list.
37
- * The following snippet shows how to retrieve all filters belonging to the specified list, ordered by their creation date:
38
- *
39
- * <pre>
40
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
41
- * $oFilterManager = $oSession->getFilterManager();
42
- *
43
- * $oBOResultSet = $oFilterManager->select( $oListContext,
44
- * Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME, Inx_Api_Order::ASC );
45
- *
46
- * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
47
- * {
48
- * $oFilter = $oBOResultSet->get( $i );
49
- * echo $oFilter->getName()."&#60;br&#62;";
50
- * }
51
- *
52
- * $oBOResultSet->close();
53
- * </pre>
54
- * <p>
55
- * Note: The usage of <i>Inx_Api_Filter_Filter</i>s requires the api user right: <i>Inx_Api_UserRights::FILTER_FEATURE_USE</i>
56
- * <p>
57
- * For more information on filters and the filter statement syntax, see the <i>Inx_Api_Filter_Filter</i> documentation.
58
- *
59
- * @see Inx_Api_Filter_Filter
60
- * @since API 1.1.0
61
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
62
- * @package Inxmail
63
- * @subpackage Filter
64
- */
65
- interface Inx_Api_Filter_FilterManager extends Inx_Api_BOManager
66
- {
67
-
68
- /**
69
- * Creates a new filter that belongs to the specified list.
70
- * To create a global filter, use the system list.
71
- * The following snippet shows how to retrieve the <i>Inx_Api_List_SystemListContext</i>:
72
- * <pre>
73
- * $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
74
- * </pre>
75
- *
76
- * @param Inx_Api_List_ListContext $oListContext the owning list of the filter.
77
- * @return Inx_Api_Filter_Filter a new filter.
78
- */
79
- public function createFilter( Inx_Api_List_ListContext $oListContext );
80
-
81
- /**
82
- * Returns an <i>Inx_Api_BOResultSet</i> containing all filters which belong to the specified list ordered
83
- * by the specified order attribute and type. To retrieve the global filters, use the system list.
84
- *
85
- * @param Inx_Api_List_ListContext $oListContext all filters belonging to this list will be retrieved.
86
- * @param int $iOrderAttribute the order attribute (<i>Inx_Api_Filter_Filter::ATTRIBUTE_NAME</i> or
87
- * <i>Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME</i>). May be ommitted.
88
- * @param int $orderType the order type (<i>Inx_Api_Order::ASC</i>
89
- * or <i>Inx_Api_Order::DESC</i>). May be ommitted.
90
- * @return an <i>Inx_Api_BOResultSet</i> that contains the data produced by the given query.
91
- * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
92
- * <i>Inx_Api_UserRights::FILTER_FEATURE_USE</i>
93
- */
94
- public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute = null, $orderType = null);
95
-
96
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Filter
5
+ */
6
+ /**
7
+ * Often, mailings are to be sent not to the whole recipient list but only to a certain subgroup of recipients.
8
+ * Examples for such target groups are 'All recipients who read HTML format', 'Women', 'Men', 'People interested in
9
+ * product X', 'Recipients born after 1970', and so on.
10
+ * <p>
11
+ * The <i>Inx_Api_Filter_FilterManager</i> can be used to create and retrieve <code>Filter</code>s (target groups).
12
+ * The following snippet creates a global <i>Inx_Api_Filter_Filter</i>:
13
+ *
14
+ * <pre>
15
+ * $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
16
+ * $oFilterManager = $oSession->getFilterManager();
17
+ * $oFilter = $oFilterManager->createFilter( $oSystemListContext );
18
+ *
19
+ * $oFilter->updateName( "New Yorker" );
20
+ * $oFilter->updateStatement( "city LIKE \"New York\"" );
21
+ * $oFilter->commitUpdate();
22
+ * </pre>
23
+ * <p>
24
+ * An <i>Inx_Api_Filter_Filter</i> can be assigned to an individual <i>Inx_Api_Mailing_Mailing</i>, as demonstrated
25
+ * in the following snippet:
26
+ *
27
+ * <pre>
28
+ * $oMailing = ...
29
+ *
30
+ * $oMailing->updateFilterId( $oFilter->getId() );
31
+ * $oMailing->commitUpdate();
32
+ * </pre>
33
+ * <p>
34
+ * The retrieval of <i>Inx_Api_Filter_Filter</i>s can be accomplished using the <i>selectAll()</i> method to retrieve all
35
+ * filters, or one of the methods that expect an <i>Inx_Api_List_ListContext</i> to retrieve only the filters assigned to a
36
+ * specific list.
37
+ * The following snippet shows how to retrieve all filters belonging to the specified list, ordered by their creation date:
38
+ *
39
+ * <pre>
40
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
41
+ * $oFilterManager = $oSession->getFilterManager();
42
+ *
43
+ * $oBOResultSet = $oFilterManager->select( $oListContext,
44
+ * Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME, Inx_Api_Order::ASC );
45
+ *
46
+ * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
47
+ * {
48
+ * $oFilter = $oBOResultSet->get( $i );
49
+ * echo $oFilter->getName()."&#60;br&#62;";
50
+ * }
51
+ *
52
+ * $oBOResultSet->close();
53
+ * </pre>
54
+ * <p>
55
+ * Note: The usage of <i>Inx_Api_Filter_Filter</i>s requires the api user right: <i>Inx_Api_UserRights::FILTER_FEATURE_USE</i>
56
+ * <p>
57
+ * For more information on filters and the filter statement syntax, see the <i>Inx_Api_Filter_Filter</i> documentation.
58
+ *
59
+ * @see Inx_Api_Filter_Filter
60
+ * @since API 1.1.0
61
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
62
+ * @package Inxmail
63
+ * @subpackage Filter
64
+ */
65
+ interface Inx_Api_Filter_FilterManager extends Inx_Api_BOManager
66
+ {
67
+
68
+ /**
69
+ * Creates a new filter that belongs to the specified list.
70
+ * To create a global filter, use the system list.
71
+ * The following snippet shows how to retrieve the <i>Inx_Api_List_SystemListContext</i>:
72
+ * <pre>
73
+ * $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
74
+ * </pre>
75
+ *
76
+ * @param Inx_Api_List_ListContext $oListContext the owning list of the filter.
77
+ * @return Inx_Api_Filter_Filter a new filter.
78
+ */
79
+ public function createFilter( Inx_Api_List_ListContext $oListContext );
80
+
81
+ /**
82
+ * Returns an <i>Inx_Api_BOResultSet</i> containing all filters which belong to the specified list ordered
83
+ * by the specified order attribute and type. To retrieve the global filters, use the system list.
84
+ *
85
+ * @param Inx_Api_List_ListContext $oListContext all filters belonging to this list will be retrieved.
86
+ * @param int $iOrderAttribute the order attribute (<i>Inx_Api_Filter_Filter::ATTRIBUTE_NAME</i> or
87
+ * <i>Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME</i>). May be ommitted.
88
+ * @param int $orderType the order type (<i>Inx_Api_Order::ASC</i>
89
+ * or <i>Inx_Api_Order::DESC</i>). May be ommitted.
90
+ * @return an <i>Inx_Api_BOResultSet</i> that contains the data produced by the given query.
91
+ * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
92
+ * <i>Inx_Api_UserRights::FILTER_FEATURE_USE</i>
93
+ */
94
+ public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute = null, $orderType = null);
95
+
96
+ }
lib/Inx/Api/FilterStmtException.php CHANGED
@@ -1,18 +1,18 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
-
6
- /**
7
- * he <i>Inx_Api_FilterStmtException</i> is thrown when a filter statement is invalid. The main reasons for this
8
- * exception are syntax errors.
9
- *
10
- * @see Inx_Api_Mailing_MailingManager#select(Inx_Api_List_ListContext, int, String, int, int)
11
- * @since API 1.2
12
- * @version $Revision: 9345 $ $Date: 2007-12-07 16:49:34 +0200 (Pn, 07 Grd 2007) $ $Author: aurimas $
13
- * @package Inxmail
14
- */
15
- class Inx_Api_FilterStmtException extends Exception
16
- {
17
-
18
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+
6
+ /**
7
+ * he <i>Inx_Api_FilterStmtException</i> is thrown when a filter statement is invalid. The main reasons for this
8
+ * exception are syntax errors.
9
+ *
10
+ * @see Inx_Api_Mailing_MailingManager#select(Inx_Api_List_ListContext, int, String, int, int)
11
+ * @since API 1.2
12
+ * @version $Revision: 9345 $ $Date: 2007-12-07 16:49:34 +0200 (Pn, 07 Grd 2007) $ $Author: aurimas $
13
+ * @package Inxmail
14
+ */
15
+ class Inx_Api_FilterStmtException extends Exception
16
+ {
17
+
18
  }
lib/Inx/Api/IOException.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * Signals that an I/O exception of some sort has occurred.
7
- *
8
- * @package Inxmail
9
- */
10
- class Inx_Api_IOException extends Exception
11
- {
12
-
13
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * Signals that an I/O exception of some sort has occurred.
7
+ *
8
+ * @package Inxmail
9
+ */
10
+ class Inx_Api_IOException extends Exception
11
+ {
12
+
13
  }
lib/Inx/Api/IllegalArgumentException.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_IllegalArgumentException</i> is thrown when wrong arguments are supplied.
7
- * A common reason for this exception are data type issues.
8
- * <p>
9
- * Example: Calling <i>Mailing->sendSingleMail("sample@invalid.inv")</i> will raise this exception, because
10
- * <i>sendSingleMail()</i> expects a recipient id of type integer, not an email address string.
11
- * @version $Revision: 9348 $ $Date: 2007-12-10 09:33:56 +0200 (Pr, 10 Grd 2007) $ $Author: aurimas $
12
- * @package Inxmail
13
- */
14
- class Inx_Api_IllegalArgumentException extends Exception
15
- {
16
-
17
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_IllegalArgumentException</i> is thrown when wrong arguments are supplied.
7
+ * A common reason for this exception are data type issues.
8
+ * <p>
9
+ * Example: Calling <i>Mailing->sendSingleMail("sample@invalid.inv")</i> will raise this exception, because
10
+ * <i>sendSingleMail()</i> expects a recipient id of type integer, not an email address string.
11
+ * @version $Revision: 9348 $ $Date: 2007-12-10 09:33:56 +0200 (Pr, 10 Grd 2007) $ $Author: aurimas $
12
+ * @package Inxmail
13
+ */
14
+ class Inx_Api_IllegalArgumentException extends Exception
15
+ {
16
+
17
  }
lib/Inx/Api/IllegalStateException.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_IllegalStateException</i> is thrown when a method cannot operate as expected,
7
- * because the application is in the wrong state.
8
- * This exception is often thrown by attribute getters when methods are invoked which are illegal
9
- * for the given attribute getter.
10
- * <p>
11
- * Example: A Bounce attribute getter is incapable to retrieve any datetime attributes, although
12
- * a method for doing so is provided. However, invokig this method will raise an illegal state
13
- * exception, as this method may not be called for the given getter.
14
- *
15
- * @package Inxmail
16
- */
17
- class Inx_Api_IllegalStateException extends Exception {
18
-
19
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_IllegalStateException</i> is thrown when a method cannot operate as expected,
7
+ * because the application is in the wrong state.
8
+ * This exception is often thrown by attribute getters when methods are invoked which are illegal
9
+ * for the given attribute getter.
10
+ * <p>
11
+ * Example: A Bounce attribute getter is incapable to retrieve any datetime attributes, although
12
+ * a method for doing so is provided. However, invokig this method will raise an illegal state
13
+ * exception, as this method may not be called for the given getter.
14
+ *
15
+ * @package Inxmail
16
+ */
17
+ class Inx_Api_IllegalStateException extends Exception {
18
+
19
  }
lib/Inx/Api/Inbox/InboxManager.php CHANGED
@@ -1,99 +1,99 @@
1
- <?php
2
- /**
3
- * The <i>Inx_Api_Inbox_InboxManager</i> can be used to retrieve inbox messages.
4
- * There are different methods for the retrieval of inbox messages, for example you can retrieve messages by date.
5
- * The following example returns an <i>Inx_Api_BOResultSet</i> containing all inbox messages in the system:
6
- *
7
- * <PRE>
8
- * $oInboxManager = $oSession->getInboxManager();
9
- * $oBOResultSet = $oInboxManager->selectAll();
10
- *
11
- * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
12
- * {
13
- * $oInboxMessage = $oBOResultSet->get( $i );
14
- * echo $oInboxMessage->getSubject() . '&lt;br&gt;';
15
- * }
16
- *
17
- * $oBOResultSet->close();
18
- * </PRE>
19
- *
20
- * Note: The <i>selectAll()</i> method retrieves no recipient information but the id.
21
- * If you wish to retrieve the recipient state or some of the recipients attributes, use the
22
- * <i>selectAll($oRecipientContext, $aAttributes)</i> method instead.
23
- * <p>
24
- * Note: The usage of the <i>Inbox</i> requires the api user right: <i>Inx_Api_UserRights::ERRORMAIL_FEATURE_USE</i>
25
- * <p>
26
- * For more information on inbox messages, see the <i>Inx_Api_Inbox_InboxMessage</i> documentation.
27
- *
28
- * @see Inx_Api_Inbox_InboxMessage
29
- * @since API 1.9.0
30
- * @version $Revision:$ $Date:$ $Author:$
31
- * @package Inxmail
32
- * @subpackage Inbox
33
- */
34
- interface Inx_Api_Inbox_InboxManager extends Inx_Api_BOManager
35
- {
36
- /**
37
- * Returns a result set containing all inbox messages received before the specified date.
38
- * The date has to be passed as ISO 8601 formatted datetime string.
39
- * If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
40
- * retrieved messages will contain information about the recipient state and the specified recipient attributes.
41
- *
42
- * @param string $sSearchDate all inbox messages before this date will be selected.
43
- * @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
44
- * See <i>Inx_Api_Session::createRecipientContext()</i>.
45
- * @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
46
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
47
- * @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
48
- */
49
- public function selectBefore( $sSearchDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
50
-
51
-
52
- /**
53
- * Returns a result set containing all inbox messages received after the specified date.
54
- * The date has to be passed as ISO 8601 formatted datetime string.
55
- * If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
56
- * retrieved messages will contain information about the recipient state and the specified recipient attributes.
57
- *
58
- * @param string $sSearchDate all inbox messages after this date will be selected.
59
- * @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
60
- * See <i>Inx_Api_Session::createRecipientContext()</i>.
61
- * @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
62
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
63
- * @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
64
- */
65
- public function selectAfter( $sSearchDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
66
-
67
-
68
- /**
69
- * Returns a result set containing all inbox messages received between the specified date.
70
- * The dates have to be passed as ISO 8601 formatted datetime string.
71
- * If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
72
- * retrieved messages will contain information about the recipient state and the specified recipient attributes.
73
- *
74
- * @param string $sStartDate the start date of the search.
75
- * @param string $sStopDate the end date of the search.
76
- * @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
77
- * See <i>Inx_Api_Session::createRecipientContext()</i>.
78
- * @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
79
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
80
- * @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
81
- */
82
- public function selectBetween( $sStartDate, $sStopDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
83
-
84
-
85
- /**
86
- * Returns a result set containing all inbox messages.
87
- * If there are no messages, an empty result set will be returned.
88
- * If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
89
- * retrieved messages will contain information about the recipient state and the specified recipient attributes.
90
- *
91
- * @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
92
- * See <i>Inx_Api_Session::createRecipientContext()</i>.
93
- * @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
94
- * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
95
- * @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
96
- */
97
- public function selectAllInboxMessages( Inx_Api_Recipient_RecipientContext $rc = null, $aAttributes = null );
98
-
99
  }
1
+ <?php
2
+ /**
3
+ * The <i>Inx_Api_Inbox_InboxManager</i> can be used to retrieve inbox messages.
4
+ * There are different methods for the retrieval of inbox messages, for example you can retrieve messages by date.
5
+ * The following example returns an <i>Inx_Api_BOResultSet</i> containing all inbox messages in the system:
6
+ *
7
+ * <PRE>
8
+ * $oInboxManager = $oSession->getInboxManager();
9
+ * $oBOResultSet = $oInboxManager->selectAll();
10
+ *
11
+ * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
12
+ * {
13
+ * $oInboxMessage = $oBOResultSet->get( $i );
14
+ * echo $oInboxMessage->getSubject() . '&lt;br&gt;';
15
+ * }
16
+ *
17
+ * $oBOResultSet->close();
18
+ * </PRE>
19
+ *
20
+ * Note: The <i>selectAll()</i> method retrieves no recipient information but the id.
21
+ * If you wish to retrieve the recipient state or some of the recipients attributes, use the
22
+ * <i>selectAll($oRecipientContext, $aAttributes)</i> method instead.
23
+ * <p>
24
+ * Note: The usage of the <i>Inbox</i> requires the api user right: <i>Inx_Api_UserRights::ERRORMAIL_FEATURE_USE</i>
25
+ * <p>
26
+ * For more information on inbox messages, see the <i>Inx_Api_Inbox_InboxMessage</i> documentation.
27
+ *
28
+ * @see Inx_Api_Inbox_InboxMessage
29
+ * @since API 1.9.0
30
+ * @version $Revision:$ $Date:$ $Author:$
31
+ * @package Inxmail
32
+ * @subpackage Inbox
33
+ */
34
+ interface Inx_Api_Inbox_InboxManager extends Inx_Api_BOManager
35
+ {
36
+ /**
37
+ * Returns a result set containing all inbox messages received before the specified date.
38
+ * The date has to be passed as ISO 8601 formatted datetime string.
39
+ * If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
40
+ * retrieved messages will contain information about the recipient state and the specified recipient attributes.
41
+ *
42
+ * @param string $sSearchDate all inbox messages before this date will be selected.
43
+ * @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
44
+ * See <i>Inx_Api_Session::createRecipientContext()</i>.
45
+ * @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
46
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
47
+ * @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
48
+ */
49
+ public function selectBefore( $sSearchDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
50
+
51
+
52
+ /**
53
+ * Returns a result set containing all inbox messages received after the specified date.
54
+ * The date has to be passed as ISO 8601 formatted datetime string.
55
+ * If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
56
+ * retrieved messages will contain information about the recipient state and the specified recipient attributes.
57
+ *
58
+ * @param string $sSearchDate all inbox messages after this date will be selected.
59
+ * @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
60
+ * See <i>Inx_Api_Session::createRecipientContext()</i>.
61
+ * @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
62
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
63
+ * @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
64
+ */
65
+ public function selectAfter( $sSearchDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
66
+
67
+
68
+ /**
69
+ * Returns a result set containing all inbox messages received between the specified date.
70
+ * The dates have to be passed as ISO 8601 formatted datetime string.
71
+ * If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
72
+ * retrieved messages will contain information about the recipient state and the specified recipient attributes.
73
+ *
74
+ * @param string $sStartDate the start date of the search.
75
+ * @param string $sStopDate the end date of the search.
76
+ * @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
77
+ * See <i>Inx_Api_Session::createRecipientContext()</i>.
78
+ * @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
79
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
80
+ * @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
81
+ */
82
+ public function selectBetween( $sStartDate, $sStopDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
83
+
84
+
85
+ /**
86
+ * Returns a result set containing all inbox messages.
87
+ * If there are no messages, an empty result set will be returned.
88
+ * If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
89
+ * retrieved messages will contain information about the recipient state and the specified recipient attributes.
90
+ *
91
+ * @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
92
+ * See <i>Inx_Api_Session::createRecipientContext()</i>.
93
+ * @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
94
+ * See <i>Inx_Api_Recipient_RecipientMetaData</i>.
95
+ * @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
96
+ */
97
+ public function selectAllInboxMessages( Inx_Api_Recipient_RecipientContext $rc = null, $aAttributes = null );
98
+
99
  }
lib/Inx/Api/Inbox/InboxMessage.php CHANGED
@@ -1,268 +1,268 @@
1
- <?php
2
-
3
- /**
4
- * An <i>Inx_Api_Inbox_InboxMessage</i> object contains information related to a message received through the inbox.
5
- * With this object you can access data of a received reply, auto responder message, flame message or spam message.
6
- * For example you can retrieve the id of the recipient or the content of the received message.
7
- * <p>
8
- * For an example on how to retrieve <i>InboxMessage</i>s, see the <i>Inx_Api_Inbox_InboxManager</i> documentation.
9
- *
10
- * @see Inx_Api_Inbox_InboxManager
11
- * @since API 1.9.0
12
- * @version $Revision:$ $Date:$ $Author:$
13
- * @package Inxmail
14
- * @subpackage Inbox
15
- */
16
- interface Inx_Api_Inbox_InboxMessage extends Inx_Api_BusinessObject
17
- {
18
- /**
19
- * This category represents an auto responder message.
20
- *
21
- * @var int
22
- */
23
- const CATEGORY_AUTO_RESPONDER = 0;
24
-
25
- /**
26
- * This category represents a flame message. A flame message is a message with aggressive content and/or strong
27
- * language.
28
- *
29
- * @var int
30
- */
31
- const CATEGORY_FLAME = 1;
32
-
33
- /**
34
- * This category represents a mail categorized as undesirable by spam/virus checking software
35
- *
36
- * @var int
37
- */
38
- const CATEGORY_SPAM = 2;
39
-
40
- /**
41
- * This category represents an ordinary mail which does not match a specific category.
42
- *
43
- * @var int
44
- */
45
- const CATEGORY_UNCATEGORIZED = 3;
46
-
47
- /**
48
- * This category represents a mail of unknown type.
49
- *
50
- * @var int
51
- */
52
- const CATEGORY_UNKNOWN = 4;
53
-
54
- /**
55
- * State for missing recipient information. This state will be used when no <i>RecipientContext</i> and/or no
56
- * attributes are specified in the query or in case of an unknown recipient.
57
- *
58
- * @var int
59
- */
60
- const RECIPIENT_STATE_UNKNOWN = 0;
61
-
62
- /**
63
- * State for existent recipient.
64
- *
65
- * @var int
66
- */
67
- const RECIPIENT_STATE_EXISTENT = 1;
68
-
69
- /**
70
- * State for non existing (deleted) recipient.
71
- *
72
- * @var int
73
- */
74
- const RECIPIENT_STATE_DELETED = 2;
75
-
76
-
77
- /**
78
- * Returns the category of this inbox message. May be one of:
79
- * <ul>
80
- * <li><i>CATEGORY_AUTO_RESPONDER</i>
81
- * <li><i>CATEGORY_FLAME</i>
82
- * <li><i>CATEGORY_SPAM</i>
83
- * <li><i>CATEGORY_UNCATEGORIZED</i>
84
- * <li><i>CATEGORY_UNKNOWN</i>
85
- * </ul>
86
- *
87
- * @return int the category of this inbox message.
88
- */
89
- public function getCategory();
90
-
91
-
92
- /**
93
- * Returns the date when the message was received.
94
- * The date will be returned as ISO 8601 formatted datetime string.
95
- *
96
- * @return string the date of the message reception.
97
- */
98
- public function getReceptionDate();
99
-
100
-
101
- /**
102
- * Returns the sender address.
103
- *
104
- * @return string the sender address as string.
105
- */
106
- public function getSender();
107
-
108
-
109
- /**
110
- * Returns the subject of the received message.
111
- *
112
- * @return string the subject of the received message as string.
113
- */
114
- public function getSubject();
115
-
116
-
117
- /**
118
- * Returns the message content as text.
119
- *
120
- * @return string the message as string.
121
- */
122
- public function getTextContent();
123
-
124
-
125
- /**
126
- * Returns the id of the recipient who sent the message.
127
- *
128
- * @return int the recipient id.
129
- */
130
- public function getRecipientId();
131
-
132
-
133
- /**
134
- * Returns the header of the message as string.
135
- *
136
- * @return string the header of the message as string.
137
- */
138
- public function getHeaders();
139
-
140
-
141
- /**
142
- * Returns the complete message as mime message stream.
143
- *
144
- * @return Inx_Api_InputStream the mime message as input stream.
145
- */
146
- public function getMIMEMessageAsStream();
147
-
148
-
149
- /**
150
- * Returns the matched e-mail address (i.e. the e-mail address of the recipient).
151
- *
152
- * @return string the e-mail address.
153
- */
154
- public function getMatchedEmailAddress();
155
-
156
-
157
- /**
158
- * Returns the state of the recipient for the message.<br>
159
- * RecipientState values:
160
- * <ul>
161
- * <li><i>RECIPIENT_STATE_UNKNOWN</i> - no attributes are queried or recipient is unknown.
162
- * <li><i>RECIPIENT_STATE_EXISTENT</i> - recipient exists.
163
- * <li><i>RECIPIENT_STATE_DELETED</i> - recipient is deleted.
164
- * </ul>
165
- *
166
- * @return int the recipient state.
167
- */
168
- public function getRecipientState();
169
-
170
-
171
- /**
172
- * Returns the integer value for the given recipient Attribute.<br>
173
- *
174
- * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
175
- * @return int the integer value.
176
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
177
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>int</i>.
178
- * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
179
- */
180
- public function getInteger( Inx_Api_Recipient_Attribute $oAttribute );
181
-
182
-
183
- /**
184
- * Returns the string value for the given recipient Attribute.<br>
185
- *
186
- * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
187
- * @return string the string value.
188
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
189
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
190
- * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
191
- */
192
- public function getString( Inx_Api_Recipient_Attribute $oAttribute );
193
-
194
-
195
- /**
196
- * Returns the datetime value for the given recipient Attribute.
197
- * The datetime will be returned as ISO 8601 formatted datetime string.
198
- *
199
- * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
200
- * @return string the datetime value.
201
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
202
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
203
- * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
204
- */
205
- public function getDatetime( Inx_Api_Recipient_Attribute $oAttribute );
206
-
207
-
208
- /**
209
- * Returns the date value for the given recipient Attribute.
210
- * The date will be returned as ISO 8601 formatted date string.
211
- *
212
- * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
213
- * @return string the date value.
214
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
215
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
216
- * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
217
- */
218
- public function getDate( Inx_Api_Recipient_Attribute $oAttribute );
219
-
220
-
221
- /**
222
- * Returns the time value for the given recipient Attribute.
223
- * The time will be returned as ISO 8601 formatted time string
224
- *
225
- * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
226
- * @return string the time value.
227
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
228
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
229
- * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
230
- */
231
- public function getTime( Inx_Api_Recipient_Attribute $oAttribute );
232
-
233
-
234
- /**
235
- * Returns the float value for the given recipient Attribute.<br>
236
- *
237
- * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
238
- * @return float the float value.
239
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
240
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>float</i>.
241
- * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
242
- */
243
- public function getDouble( Inx_Api_Recipient_Attribute $oAttribute );
244
-
245
-
246
- /**
247
- * Returns the bool value for the given recipient Attribute.<br>
248
- *
249
- * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
250
- * @return bool the bool value.
251
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
252
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
253
- * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
254
- */
255
- public function getBoolean( Inx_Api_Recipient_Attribute $oAttribute );
256
-
257
-
258
- /**
259
- * Returns the value for the given recipient Attribute.<br>
260
- *
261
- * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
262
- * @return mixed the value.
263
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
264
- * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
265
- */
266
- public function getObject( Inx_Api_Recipient_Attribute $oAttribute );
267
-
268
  }
1
+ <?php
2
+
3
+ /**
4
+ * An <i>Inx_Api_Inbox_InboxMessage</i> object contains information related to a message received through the inbox.
5
+ * With this object you can access data of a received reply, auto responder message, flame message or spam message.
6
+ * For example you can retrieve the id of the recipient or the content of the received message.
7
+ * <p>
8
+ * For an example on how to retrieve <i>InboxMessage</i>s, see the <i>Inx_Api_Inbox_InboxManager</i> documentation.
9
+ *
10
+ * @see Inx_Api_Inbox_InboxManager
11
+ * @since API 1.9.0
12
+ * @version $Revision:$ $Date:$ $Author:$
13
+ * @package Inxmail
14
+ * @subpackage Inbox
15
+ */
16
+ interface Inx_Api_Inbox_InboxMessage extends Inx_Api_BusinessObject
17
+ {
18
+ /**
19
+ * This category represents an auto responder message.
20
+ *
21
+ * @var int
22
+ */
23
+ const CATEGORY_AUTO_RESPONDER = 0;
24
+
25
+ /**
26
+ * This category represents a flame message. A flame message is a message with aggressive content and/or strong
27
+ * language.
28
+ *
29
+ * @var int
30
+ */
31
+ const CATEGORY_FLAME = 1;
32
+
33
+ /**
34
+ * This category represents a mail categorized as undesirable by spam/virus checking software
35
+ *
36
+ * @var int
37
+ */
38
+ const CATEGORY_SPAM = 2;
39
+
40
+ /**
41
+ * This category represents an ordinary mail which does not match a specific category.
42
+ *
43
+ * @var int
44
+ */
45
+ const CATEGORY_UNCATEGORIZED = 3;
46
+
47
+ /**
48
+ * This category represents a mail of unknown type.
49
+ *
50
+ * @var int
51
+ */
52
+ const CATEGORY_UNKNOWN = 4;
53
+
54
+ /**
55
+ * State for missing recipient information. This state will be used when no <i>RecipientContext</i> and/or no
56
+ * attributes are specified in the query or in case of an unknown recipient.
57
+ *
58
+ * @var int
59
+ */
60
+ const RECIPIENT_STATE_UNKNOWN = 0;
61
+
62
+ /**
63
+ * State for existent recipient.
64
+ *
65
+ * @var int
66
+ */
67
+ const RECIPIENT_STATE_EXISTENT = 1;
68
+
69
+ /**
70
+ * State for non existing (deleted) recipient.
71
+ *
72
+ * @var int
73
+ */
74
+ const RECIPIENT_STATE_DELETED = 2;
75
+
76
+
77
+ /**
78
+ * Returns the category of this inbox message. May be one of:
79
+ * <ul>
80
+ * <li><i>CATEGORY_AUTO_RESPONDER</i>
81
+ * <li><i>CATEGORY_FLAME</i>
82
+ * <li><i>CATEGORY_SPAM</i>
83
+ * <li><i>CATEGORY_UNCATEGORIZED</i>
84
+ * <li><i>CATEGORY_UNKNOWN</i>
85
+ * </ul>
86
+ *
87
+ * @return int the category of this inbox message.
88
+ */
89
+ public function getCategory();
90
+
91
+
92
+ /**
93
+ * Returns the date when the message was received.
94
+ * The date will be returned as ISO 8601 formatted datetime string.
95
+ *
96
+ * @return string the date of the message reception.
97
+ */
98
+ public function getReceptionDate();
99
+
100
+
101
+ /**
102
+ * Returns the sender address.
103
+ *
104
+ * @return string the sender address as string.
105
+ */
106
+ public function getSender();
107
+
108
+
109
+ /**
110
+ * Returns the subject of the received message.
111
+ *
112
+ * @return string the subject of the received message as string.
113
+ */
114
+ public function getSubject();
115
+
116
+
117
+ /**
118
+ * Returns the message content as text.
119
+ *
120
+ * @return string the message as string.
121
+ */
122
+ public function getTextContent();
123
+
124
+
125
+ /**
126
+ * Returns the id of the recipient who sent the message.
127
+ *
128
+ * @return int the recipient id.
129
+ */
130
+ public function getRecipientId();
131
+
132
+
133
+ /**
134
+ * Returns the header of the message as string.
135
+ *
136
+ * @return string the header of the message as string.
137
+ */
138
+ public function getHeaders();
139
+
140
+
141
+ /**
142
+ * Returns the complete message as mime message stream.
143
+ *
144
+ * @return Inx_Api_InputStream the mime message as input stream.
145
+ */
146
+ public function getMIMEMessageAsStream();
147
+
148
+
149
+ /**
150
+ * Returns the matched e-mail address (i.e. the e-mail address of the recipient).
151
+ *
152
+ * @return string the e-mail address.
153
+ */
154
+ public function getMatchedEmailAddress();
155
+
156
+
157
+ /**
158
+ * Returns the state of the recipient for the message.<br>
159
+ * RecipientState values:
160
+ * <ul>
161
+ * <li><i>RECIPIENT_STATE_UNKNOWN</i> - no attributes are queried or recipient is unknown.
162
+ * <li><i>RECIPIENT_STATE_EXISTENT</i> - recipient exists.
163
+ * <li><i>RECIPIENT_STATE_DELETED</i> - recipient is deleted.
164
+ * </ul>
165
+ *
166
+ * @return int the recipient state.
167
+ */
168
+ public function getRecipientState();
169
+
170
+
171
+ /**
172
+ * Returns the integer value for the given recipient Attribute.<br>
173
+ *
174
+ * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
175
+ * @return int the integer value.
176
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
177
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>int</i>.
178
+ * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
179
+ */
180
+ public function getInteger( Inx_Api_Recipient_Attribute $oAttribute );
181
+
182
+
183
+ /**
184
+ * Returns the string value for the given recipient Attribute.<br>
185
+ *
186
+ * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
187
+ * @return string the string value.
188
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
189
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
190
+ * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
191
+ */
192
+ public function getString( Inx_Api_Recipient_Attribute $oAttribute );
193
+
194
+
195
+ /**
196
+ * Returns the datetime value for the given recipient Attribute.
197
+ * The datetime will be returned as ISO 8601 formatted datetime string.
198
+ *
199
+ * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
200
+ * @return string the datetime value.
201
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
202
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
203
+ * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
204
+ */
205
+ public function getDatetime( Inx_Api_Recipient_Attribute $oAttribute );
206
+
207
+
208
+ /**
209
+ * Returns the date value for the given recipient Attribute.
210
+ * The date will be returned as ISO 8601 formatted date string.
211
+ *
212
+ * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
213
+ * @return string the date value.
214
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
215
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
216
+ * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
217
+ */
218
+ public function getDate( Inx_Api_Recipient_Attribute $oAttribute );
219
+
220
+
221
+ /**
222
+ * Returns the time value for the given recipient Attribute.
223
+ * The time will be returned as ISO 8601 formatted time string
224
+ *
225
+ * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
226
+ * @return string the time value.
227
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
228
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
229
+ * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
230
+ */
231
+ public function getTime( Inx_Api_Recipient_Attribute $oAttribute );
232
+
233
+
234
+ /**
235
+ * Returns the float value for the given recipient Attribute.<br>
236
+ *
237
+ * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
238
+ * @return float the float value.
239
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
240
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>float</i>.
241
+ * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
242
+ */
243
+ public function getDouble( Inx_Api_Recipient_Attribute $oAttribute );
244
+
245
+
246
+ /**
247
+ * Returns the bool value for the given recipient Attribute.<br>
248
+ *
249
+ * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
250
+ * @return bool the bool value.
251
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
252
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
253
+ * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
254
+ */
255
+ public function getBoolean( Inx_Api_Recipient_Attribute $oAttribute );
256
+
257
+
258
+ /**
259
+ * Returns the value for the given recipient Attribute.<br>
260
+ *
261
+ * @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
262
+ * @return mixed the value.
263
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
264
+ * @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
265
+ */
266
+ public function getObject( Inx_Api_Recipient_Attribute $oAttribute );
267
+
268
  }
lib/Inx/Api/IndexOutOfBoundsException.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_IndexOutOfBoundsException</i> is thrown when trying to access an invalid index of an
7
- * indexed object. This applies mainly to the various RowSets and ResultSets used in the API.
8
- * <p>
9
- * Example:
10
- * <pre>
11
- * $rset = Inx_Api_Mailing_MailingManager->selectAll();
12
- *
13
- * for($i = -1; $i <= rest->size(); $i++)
14
- * {
15
- * echo $rset->get($i)->getName();
16
- * }
17
- * </pre>
18
- * This code snippet contains two errors: The first index retrieved is -1 and the last index retrieved is
19
- * rset->size(). -1 is no valid index as the first element of a ResultSet has the index 0. As the first
20
- * valid index is 0, the last valid index is rset->size() - 1. Therefore, these errors will raise an
21
- * <i>Inx_Api_IndexOutOfBoundsException</i>.
22
- * @package Inxmail
23
- */
24
- class Inx_Api_IndexOutOfBoundsException extends Exception
25
- {
26
-
27
- }
28
-
29
  ?>
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_IndexOutOfBoundsException</i> is thrown when trying to access an invalid index of an
7
+ * indexed object. This applies mainly to the various RowSets and ResultSets used in the API.
8
+ * <p>
9
+ * Example:
10
+ * <pre>
11
+ * $rset = Inx_Api_Mailing_MailingManager->selectAll();
12
+ *
13
+ * for($i = -1; $i <= rest->size(); $i++)
14
+ * {
15
+ * echo $rset->get($i)->getName();
16
+ * }
17
+ * </pre>
18
+ * This code snippet contains two errors: The first index retrieved is -1 and the last index retrieved is
19
+ * rset->size(). -1 is no valid index as the first element of a ResultSet has the index 0. As the first
20
+ * valid index is 0, the last valid index is rset->size() - 1. Therefore, these errors will raise an
21
+ * <i>Inx_Api_IndexOutOfBoundsException</i>.
22
+ * @package Inxmail
23
+ */
24
+ class Inx_Api_IndexOutOfBoundsException extends Exception
25
+ {
26
+
27
+ }
28
+
29
  ?>
lib/Inx/Api/IndexSelection.php CHANGED
@@ -1,100 +1,100 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * This class represents the current state of a selection. It encapsulates a single selection interval.
7
- *
8
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
9
- * @package Inxmail
10
- */
11
- class Inx_Api_IndexSelection
12
- {
13
- private $iBeginIndex;
14
-
15
- private $iEndIndex;
16
-
17
- /**
18
- * Creates a selection.
19
- * If $iBeginIndex and $iEndIndex are omitted, this will create an empty selection.
20
- * If only $iEndIndex is omitted, the selection will contain only $iEndIndex.
21
- * If both parameters are set, the selection will contain the set of indices between $iBeginIndex
22
- * and $iEndIndex inclusive.
23
- *
24
- * @param int $iBeginIndex one end of the interval, may be omitted.
25
- * @param int $iEndIndex other ent of the interval (inclusive), may be omitted.
26
- */
27
- public function __construct($iBeginIndex = null, $iEndIndex = null)
28
- {
29
- if ($iBeginIndex===null && $iEndIndex===null) {
30
- $this->iBeginIndex = -1;
31
- $this->iEndIndex = -1;
32
- } elseif($iBeginIndex!==null && $iEndIndex===null){
33
- $this->setSelectionInterval( $iBeginIndex );
34
- } elseif($iBeginIndex!==null && $iEndIndex!==null){
35
- $this->setSelectionInterval( $iBeginIndex, $iEndIndex );
36
- }
37
- }
38
-
39
-
40
- /**
41
- * Change the selection to be the set of indices between $iBeginIndex and $iEndIndex inclusive.
42
- * $iEndIndex may be omitted, thus changing the selection to only contain $iBeginIndex.
43
- *
44
- * @param int $iBeginIndex one end of the interval.
45
- * @param int $iEndIndex other end of the interval (inclusive), may be omitted.
46
- */
47
- public function setSelectionInterval( $iBeginIndex = null, $iEndIndex = null )
48
- {
49
- if( $iBeginIndex < 0 || $iEndIndex < 0 ) {
50
- throw new Exception( "Indices must be positive" );
51
- }
52
- if($iEndIndex===null) {
53
- $iEndIndex = $iBeginIndex;
54
- }
55
- if( $iBeginIndex > $iEndIndex) {
56
- $this->iBeginIndex = $iEndIndex;
57
- $this->iEndIndex = $iBeginIndex;
58
- } else {
59
- $this->iBeginIndex = $iBeginIndex;
60
- $this->iEndIndex = $iEndIndex;
61
- }
62
- }
63
-
64
-
65
- /**
66
- * Returns the number of selected elements.
67
- *
68
- * @return int the number of selected elements
69
- */
70
- public function getSelectionCount()
71
- {
72
- if( $this->iBeginIndex == -1 )
73
- return 0;
74
-
75
- return $this->iEndIndex - $this->iBeginIndex + 1;
76
- }
77
-
78
-
79
- /**
80
- * Returns the first selected index or -1 if the selection is empty.
81
- *
82
- * @return int the first selected index
83
- */
84
- public function getFirstIndex()
85
- {
86
- return $this->iBeginIndex;
87
- }
88
-
89
-
90
- /**
91
- * Returns the last selected index or -1 if the selection is empty.
92
- *
93
- * @return int the last selected index
94
- */
95
- public function getLastIndex()
96
- {
97
- return $this->iEndIndex;
98
- }
99
-
100
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * This class represents the current state of a selection. It encapsulates a single selection interval.
7
+ *
8
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
9
+ * @package Inxmail
10
+ */
11
+ class Inx_Api_IndexSelection
12
+ {
13
+ private $iBeginIndex;
14
+
15
+ private $iEndIndex;
16
+
17
+ /**
18
+ * Creates a selection.
19
+ * If $iBeginIndex and $iEndIndex are omitted, this will create an empty selection.
20
+ * If only $iEndIndex is omitted, the selection will contain only $iEndIndex.
21
+ * If both parameters are set, the selection will contain the set of indices between $iBeginIndex
22
+ * and $iEndIndex inclusive.
23
+ *
24
+ * @param int $iBeginIndex one end of the interval, may be omitted.
25
+ * @param int $iEndIndex other ent of the interval (inclusive), may be omitted.
26
+ */
27
+ public function __construct($iBeginIndex = null, $iEndIndex = null)
28
+ {
29
+ if ($iBeginIndex===null && $iEndIndex===null) {
30
+ $this->iBeginIndex = -1;
31
+ $this->iEndIndex = -1;
32
+ } elseif($iBeginIndex!==null && $iEndIndex===null){
33
+ $this->setSelectionInterval( $iBeginIndex );
34
+ } elseif($iBeginIndex!==null && $iEndIndex!==null){
35
+ $this->setSelectionInterval( $iBeginIndex, $iEndIndex );
36
+ }
37
+ }
38
+
39
+
40
+ /**
41
+ * Change the selection to be the set of indices between $iBeginIndex and $iEndIndex inclusive.
42
+ * $iEndIndex may be omitted, thus changing the selection to only contain $iBeginIndex.
43
+ *
44
+ * @param int $iBeginIndex one end of the interval.
45
+ * @param int $iEndIndex other end of the interval (inclusive), may be omitted.
46
+ */
47
+ public function setSelectionInterval( $iBeginIndex = null, $iEndIndex = null )
48
+ {
49
+ if( $iBeginIndex < 0 || $iEndIndex < 0 ) {
50
+ throw new Exception( "Indices must be positive" );
51
+ }
52
+ if($iEndIndex===null) {
53
+ $iEndIndex = $iBeginIndex;
54
+ }
55
+ if( $iBeginIndex > $iEndIndex) {
56
+ $this->iBeginIndex = $iEndIndex;
57
+ $this->iEndIndex = $iBeginIndex;
58
+ } else {
59
+ $this->iBeginIndex = $iBeginIndex;
60
+ $this->iEndIndex = $iEndIndex;
61
+ }
62
+ }
63
+
64
+
65
+ /**
66
+ * Returns the number of selected elements.
67
+ *
68
+ * @return int the number of selected elements
69
+ */
70
+ public function getSelectionCount()
71
+ {
72
+ if( $this->iBeginIndex == -1 )
73
+ return 0;
74
+
75
+ return $this->iEndIndex - $this->iBeginIndex + 1;
76
+ }
77
+
78
+
79
+ /**
80
+ * Returns the first selected index or -1 if the selection is empty.
81
+ *
82
+ * @return int the first selected index
83
+ */
84
+ public function getFirstIndex()
85
+ {
86
+ return $this->iBeginIndex;
87
+ }
88
+
89
+
90
+ /**
91
+ * Returns the last selected index or -1 if the selection is empty.
92
+ *
93
+ * @return int the last selected index
94
+ */
95
+ public function getLastIndex()
96
+ {
97
+ return $this->iEndIndex;
98
+ }
99
+
100
+ }
lib/Inx/Api/InputStream.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * This abstract class is the superclass of all classes representing an input stream of bytes.
7
- * Subclasses of InputStream must always provide a method that returns the next byte of input as well as a method
8
- * used to close the stream.
9
- *
10
- * @package Inxmail
11
- */
12
- abstract class Inx_Api_InputStream
13
- {
14
- abstract public function read();
15
- abstract public function close();
16
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * This abstract class is the superclass of all classes representing an input stream of bytes.
7
+ * Subclasses of InputStream must always provide a method that returns the next byte of input as well as a method
8
+ * used to close the stream.
9
+ *
10
+ * @package Inxmail
11
+ */
12
+ abstract class Inx_Api_InputStream
13
+ {
14
+ abstract public function read();
15
+ abstract public function close();
16
  }
lib/Inx/Api/List/AdminListContext.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage List
5
- */
6
- /**
7
- * The <i>Inx_Api_List_AdminListContext</i> does not represent a usual mailing list.
8
- * Mail server and user credentials, along with other administrative properties, can be defined in the administration list.
9
- * <p>
10
- * <b>At the moment the <i>Inx_Api_List_AdminListContext</i> has no functionality.</b>
11
- *
12
- * @since API 1.0
13
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
14
- * @package Inxmail
15
- * @subpackage List
16
- */
17
- interface Inx_Api_List_AdminListContext extends Inx_Api_List_ListContext
18
- {
19
-
20
- /**
21
- * The predefined, immutable name of the administration list.
22
- */
23
- const NAME = "administration";
24
-
25
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage List
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_List_AdminListContext</i> does not represent a usual mailing list.
8
+ * Mail server and user credentials, along with other administrative properties, can be defined in the administration list.
9
+ * <p>
10
+ * <b>At the moment the <i>Inx_Api_List_AdminListContext</i> has no functionality.</b>
11
+ *
12
+ * @since API 1.0
13
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
14
+ * @package Inxmail
15
+ * @subpackage List
16
+ */
17
+ interface Inx_Api_List_AdminListContext extends Inx_Api_List_ListContext
18
+ {
19
+
20
+ /**
21
+ * The predefined, immutable name of the administration list.
22
+ */
23
+ const NAME = "administration";
24
+
25
+ }
lib/Inx/Api/List/ListSize.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage List
5
- */
6
- /**
7
- * The <i>Inx_Api_List_ListSize</i> object contains the list size and the computation date of the size.
8
- *
9
- * @since API 1.4.3
10
- * @package Inxmail
11
- * @subpackage List
12
- */
13
- interface Inx_Api_List_ListSize
14
- {
15
- /**
16
- * Returns the number of recipients that are subscribed to the list.
17
- *
18
- * @return int the list size as integer.
19
- */
20
- public function getSize();
21
-
22
- /**
23
- * Returns the creation datetime when the list size was computed.
24
- *
25
- * @return the creation datetime as ISO 8601 formatted datetime string.
26
- */
27
- public function getCreationDate();
28
- }
29
- ?>
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage List
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_List_ListSize</i> object contains the list size and the computation date of the size.
8
+ *
9
+ * @since API 1.4.3
10
+ * @package Inxmail
11
+ * @subpackage List
12
+ */
13
+ interface Inx_Api_List_ListSize
14
+ {
15
+ /**
16
+ * Returns the number of recipients that are subscribed to the list.
17
+ *
18
+ * @return int the list size as integer.
19
+ */
20
+ public function getSize();
21
+
22
+ /**
23
+ * Returns the creation datetime when the list size was computed.
24
+ *
25
+ * @return the creation datetime as ISO 8601 formatted datetime string.
26
+ */
27
+ public function getCreationDate();
28
+ }
29
+ ?>
lib/Inx/Api/List/SystemListContext.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage List
5
- */
6
- /**
7
- * The <i>Inx_Api_List_SystemListContext</i> does not represent a usual mailing list.
8
- * Recipients cannot subscribe to this list and it is not possible to write emails to the recipients of the system list.
9
- * The system list stores all recipient data regardless of any mailing list association.
10
- * <p>
11
- * The property settings defined in the system list are global in that they apply to all mailing list.
12
- * A lot of property settings can only be defined here.
13
- *
14
- * @since API 1.0
15
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
16
- * @package Inxmail
17
- * @subpackage List
18
- */
19
- interface Inx_Api_List_SystemListContext extends Inx_Api_List_ListContext
20
- {
21
-
22
- /**
23
- * The predefined, immutable name of the system list.
24
- */
25
- const NAME = "system";
26
-
27
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage List
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_List_SystemListContext</i> does not represent a usual mailing list.
8
+ * Recipients cannot subscribe to this list and it is not possible to write emails to the recipients of the system list.
9
+ * The system list stores all recipient data regardless of any mailing list association.
10
+ * <p>
11
+ * The property settings defined in the system list are global in that they apply to all mailing list.
12
+ * A lot of property settings can only be defined here.
13
+ *
14
+ * @since API 1.0
15
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
16
+ * @package Inxmail
17
+ * @subpackage List
18
+ */
19
+ interface Inx_Api_List_SystemListContext extends Inx_Api_List_ListContext
20
+ {
21
+
22
+ /**
23
+ * The predefined, immutable name of the system list.
24
+ */
25
+ const NAME = "system";
26
+
27
+ }
lib/Inx/Api/LockException.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_LockException</i> is thrown if a lockable object (e.g. Mailing) is already locked.
7
- *
8
- * @see Inx_Api_Mailing_Mailing#lock()
9
- * @since API 1.0
10
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
- * @package Inxmail
12
- */
13
- class Inx_Api_LockException extends Exception
14
- {
15
-
16
- private $_oLockTicket;
17
-
18
-
19
- /**
20
- * Constructs a <i>Inx_Api_LockException</i> with the specified detail message and
21
- * specific details from lock owner.
22
- *
23
- * @param string $sMsg the detail message.
24
- * @param Inx_Api_LockTicket $oLockTicket the ticket of lock information.
25
- */
26
- public function __construct( $sMsg, Inx_Api_LockTicket $oLockTicket )
27
- {
28
- $this->_oLockTicket = $oLockTicket;
29
- parent::__construct($sMsg);
30
- }
31
-
32
-
33
- /**
34
- * Returns the lock ticket. The lock ticket contains specific details from the lock owner.
35
- *
36
- * @return Inx_Api_LockTicket the lock ticket.
37
- */
38
- public function getLockTicket()
39
- {
40
- return $this->_oLockTicket;
41
- }
42
-
43
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_LockException</i> is thrown if a lockable object (e.g. Mailing) is already locked.
7
+ *
8
+ * @see Inx_Api_Mailing_Mailing#lock()
9
+ * @since API 1.0
10
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
+ * @package Inxmail
12
+ */
13
+ class Inx_Api_LockException extends Exception
14
+ {
15
+
16
+ private $_oLockTicket;
17
+
18
+
19
+ /**
20
+ * Constructs a <i>Inx_Api_LockException</i> with the specified detail message and
21
+ * specific details from lock owner.
22
+ *
23
+ * @param string $sMsg the detail message.
24
+ * @param Inx_Api_LockTicket $oLockTicket the ticket of lock information.
25
+ */
26
+ public function __construct( $sMsg, Inx_Api_LockTicket $oLockTicket )
27
+ {
28
+ $this->_oLockTicket = $oLockTicket;
29
+ parent::__construct($sMsg);
30
+ }
31
+
32
+
33
+ /**
34
+ * Returns the lock ticket. The lock ticket contains specific details from the lock owner.
35
+ *
36
+ * @return Inx_Api_LockTicket the lock ticket.
37
+ */
38
+ public function getLockTicket()
39
+ {
40
+ return $this->_oLockTicket;
41
+ }
42
+
43
+ }
lib/Inx/Api/LockTicket.php CHANGED
@@ -1,105 +1,105 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_LockTicket</i> contains specific informations about a lock of an object (e.g. Mailing).
7
- * <p>
8
- * The information provided includes:
9
- * <ul>
10
- * <li>The id of the user who holds the lock
11
- * <li>The name of the user who holds the lock
12
- * <li>The internet address of the lock owner
13
- * <li>The creation date of the lock
14
- * <li>Whether the object is locked by this session
15
- * </ul>
16
- *
17
- * @see Inx_Api_Mailing_Mailing#getLockTicket()
18
- * @since API 1.0
19
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
20
- * @package Inxmail
21
- */
22
- class Inx_Api_LockTicket
23
- {
24
-
25
- private $_iUserId;
26
-
27
- private $_sUserName;
28
-
29
- private $_sSource;
30
-
31
- private $_sCreationDatetime;
32
-
33
- private $_blForeignLock;
34
-
35
-
36
- /**
37
- * Constructs a <i>Inx_Api_LockTicket</i> with the specified details of the lock owner.
38
- *
39
- * @param integer $iUserId the user id from of the lock owner.
40
- * @param string $sUserName the user name of the lock owner.
41
- * @param string $sSource the internet address of the lock owner.
42
- * @param string $sCreationDatetime the creation date of the existing lock.
43
- * @param boolean $blForeignLock true if locked by another session, false if locked by this session.
44
- */
45
- public function __construct( $iUserId, $sUserName, $sSource, $sCreationDatetime,
46
- $blForeignLock )
47
- {
48
- $this->_iUserId = $iUserId;
49
- $this->_sUserName = $sUserName;
50
- $this->_sSource = $sSource;
51
- $this->_sCreationDatetime = $sCreationDatetime;
52
- $this->_blForeignLock = $blForeignLock;
53
- }
54
-
55
-
56
- /**
57
- * Returns the creation date of the existing lock as ISO 8601 formatted date string.
58
- *
59
- * @return string the creation date of the existing lock.
60
- */
61
- public function getCreationDatetime()
62
- {
63
- return $this->_sCreationDatetime;
64
- }
65
-
66
- /**
67
- * Returns the internet address of the lock owner.
68
- *
69
- * @return string the internet address of the lock owner.
70
- */
71
- public function getSource()
72
- {
73
- return $this->_sSource;
74
- }
75
-
76
- /**
77
- * Returns the user id of the lock owner.
78
- *
79
- * @return string the user id of the lock owner.
80
- */
81
- public function getUserId()
82
- {
83
- return $this->_sUserId;
84
- }
85
-
86
- /**
87
- * Returns the user name of the lock owner.
88
- *
89
- * @return string the user name of the lock owner.
90
- */
91
- public function getUserName()
92
- {
93
- return $this->_sUserName;
94
- }
95
-
96
- /**
97
- * Checks if the object is locked by this session.
98
- *
99
- * @return boolean true if locked by another session, false if locked by this session.
100
- */
101
- public function isForeignLock()
102
- {
103
- return $this->_blForeignLock;
104
- }
105
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_LockTicket</i> contains specific informations about a lock of an object (e.g. Mailing).
7
+ * <p>
8
+ * The information provided includes:
9
+ * <ul>
10
+ * <li>The id of the user who holds the lock
11
+ * <li>The name of the user who holds the lock
12
+ * <li>The internet address of the lock owner
13
+ * <li>The creation date of the lock
14
+ * <li>Whether the object is locked by this session
15
+ * </ul>
16
+ *
17
+ * @see Inx_Api_Mailing_Mailing#getLockTicket()
18
+ * @since API 1.0
19
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
20
+ * @package Inxmail
21
+ */
22
+ class Inx_Api_LockTicket
23
+ {
24
+
25
+ private $_iUserId;
26
+
27
+ private $_sUserName;
28
+
29
+ private $_sSource;
30
+
31
+ private $_sCreationDatetime;
32
+
33
+ private $_blForeignLock;
34
+
35
+
36
+ /**
37
+ * Constructs a <i>Inx_Api_LockTicket</i> with the specified details of the lock owner.
38
+ *
39
+ * @param integer $iUserId the user id from of the lock owner.
40
+ * @param string $sUserName the user name of the lock owner.
41
+ * @param string $sSource the internet address of the lock owner.
42
+ * @param string $sCreationDatetime the creation date of the existing lock.
43
+ * @param boolean $blForeignLock true if locked by another session, false if locked by this session.
44
+ */
45
+ public function __construct( $iUserId, $sUserName, $sSource, $sCreationDatetime,
46
+ $blForeignLock )
47
+ {
48
+ $this->_iUserId = $iUserId;
49
+ $this->_sUserName = $sUserName;
50
+ $this->_sSource = $sSource;
51
+ $this->_sCreationDatetime = $sCreationDatetime;
52
+ $this->_blForeignLock = $blForeignLock;
53
+ }
54
+
55
+
56
+ /**
57
+ * Returns the creation date of the existing lock as ISO 8601 formatted date string.
58
+ *
59
+ * @return string the creation date of the existing lock.
60
+ */
61
+ public function getCreationDatetime()
62
+ {
63
+ return $this->_sCreationDatetime;
64
+ }
65
+
66
+ /**
67
+ * Returns the internet address of the lock owner.
68
+ *
69
+ * @return string the internet address of the lock owner.
70
+ */
71
+ public function getSource()
72
+ {
73
+ return $this->_sSource;
74
+ }
75
+
76
+ /**
77
+ * Returns the user id of the lock owner.
78
+ *
79
+ * @return string the user id of the lock owner.
80
+ */
81
+ public function getUserId()
82
+ {
83
+ return $this->_sUserId;
84
+ }
85
+
86
+ /**
87
+ * Returns the user name of the lock owner.
88
+ *
89
+ * @return string the user name of the lock owner.
90
+ */
91
+ public function getUserName()
92
+ {
93
+ return $this->_sUserName;
94
+ }
95
+
96
+ /**
97
+ * Checks if the object is locked by this session.
98
+ *
99
+ * @return boolean true if locked by another session, false if locked by this session.
100
+ */
101
+ public function isForeignLock()
102
+ {
103
+ return $this->_blForeignLock;
104
+ }
105
+ }
lib/Inx/Api/LoginException.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_LoginException</i> is thrown by login methods if the login process failed.
7
- *
8
- * @see Inx_Api_Session#createLocalSession(String, String)
9
- * @see Inx_Api_Session#createRemoteSession(String, String, String)
10
- * @since API 1.0
11
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
12
- * @package Inxmail
13
- */
14
- class Inx_Api_LoginException extends Exception
15
- {
16
- /**
17
- * System exception: The server isn't running, too many sessions are opened, no valid license can be found or the
18
- * api is incompatible to the server version.
19
- */
20
- const SYSTEM_EXCEPTION = 1000;
21
-
22
- /** An illegal username or password was specfied. */
23
- const ILLEGAL_USERNAME_OR_PASSWORD = 1001;
24
-
25
- /**
26
- * The specified user is inactive, the login right for the specified user is missing or access is denied from the ip
27
- * filter.
28
- */
29
- const USER_EXCEPTION = 1002;
30
-
31
- /**
32
- * The password expiration is elapsed.
33
- * @since 1.4.2
34
- */
35
- const PWD_VALIDITY_EXPIRATION = 1003;
36
-
37
- /**
38
- * The user is forced to change his password by the administrator.
39
- * @since 1.4.2
40
- */
41
- const PWD_FORCED_CHANGE = 1004;
42
-
43
- /**
44
- * The specified user has insufficient permissions.
45
- *
46
- * @since 1.9.0
47
- */
48
- const MISSING_PERMISSIONS = 1010;
49
-
50
- /**
51
- * The specified Plugin (secret) could not be found.
52
- *
53
- * @since 1.9.0
54
- */
55
- const MISSING_PLUGIN = 1011;
56
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_LoginException</i> is thrown by login methods if the login process failed.
7
+ *
8
+ * @see Inx_Api_Session#createLocalSession(String, String)
9
+ * @see Inx_Api_Session#createRemoteSession(String, String, String)
10
+ * @since API 1.0
11
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
12
+ * @package Inxmail
13
+ */
14
+ class Inx_Api_LoginException extends Exception
15
+ {
16
+ /**
17
+ * System exception: The server isn't running, too many sessions are opened, no valid license can be found or the
18
+ * api is incompatible to the server version.
19
+ */
20
+ const SYSTEM_EXCEPTION = 1000;
21
+
22
+ /** An illegal username or password was specfied. */
23
+ const ILLEGAL_USERNAME_OR_PASSWORD = 1001;
24
+
25
+ /**
26
+ * The specified user is inactive, the login right for the specified user is missing or access is denied from the ip
27
+ * filter.
28
+ */
29
+ const USER_EXCEPTION = 1002;
30
+
31
+ /**
32
+ * The password expiration is elapsed.
33
+ * @since 1.4.2
34
+ */
35
+ const PWD_VALIDITY_EXPIRATION = 1003;
36
+
37
+ /**
38
+ * The user is forced to change his password by the administrator.
39
+ * @since 1.4.2
40
+ */
41
+ const PWD_FORCED_CHANGE = 1004;
42
+
43
+ /**
44
+ * The specified user has insufficient permissions.
45
+ *
46
+ * @since 1.9.0
47
+ */
48
+ const MISSING_PERMISSIONS = 1010;
49
+
50
+ /**
51
+ * The specified Plugin (secret) could not be found.
52
+ *
53
+ * @since 1.9.0
54
+ */
55
+ const MISSING_PLUGIN = 1011;
56
+ }
lib/Inx/Api/Mail/Attachment.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mail
5
- */
6
- /**
7
- * The <i>Inx_Api_Mail_Attachment</i> object represents a regular attachment or an embedded image
8
- * of a mailing and is part of the <i>Inx_Api_Mail_MailContent</i> object.
9
- *
10
- * @see Inx_Api_Mail_MailContent::getAttachments()
11
- * @see Inx_Api_Mail_MailContent::getEmbeddedImages()
12
- * @since API 1.0
13
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
14
- * @package Inxmail
15
- * @subpackage Mail
16
- */
17
- interface Inx_Api_Mail_Attachment
18
- {
19
-
20
- /**
21
- * Returns the file name of a regular attachment or the image identifier of an embedded image.
22
- * An embedded image is referenced in a message body using an &lt;img&gt; tag, as follows:
23
- *
24
- * <pre>
25
- * <img src="cid:Image-Identifier">
26
- * </pre>
27
- *
28
- * @return string the file name of a regular attachment or the image identifier of an embedded image.
29
- */
30
- public function getName();
31
-
32
-
33
- /**
34
- * Returns the MIME type of this attachment, e.g. <i>application/pdf</i> or <i>image/gif</i>.
35
- *
36
- * @return string the MIME type of this attachment.
37
- */
38
- public function getContentType();
39
-
40
-
41
- /**
42
- * Return the size of the content of this attachment in bytes.
43
- *
44
- * @return int the size of the content of this attachment in bytes.
45
- */
46
- public function getSize();
47
-
48
-
49
- /**
50
- * Returns an input stream of the content of this attachment.
51
- * This method is used to download the content of this attachment.
52
- *
53
- * @return Inx_Api_InputStream an input stream of the content of this attachment.
54
- */
55
- public function getContent();
56
-
57
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mail
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Mail_Attachment</i> object represents a regular attachment or an embedded image
8
+ * of a mailing and is part of the <i>Inx_Api_Mail_MailContent</i> object.
9
+ *
10
+ * @see Inx_Api_Mail_MailContent::getAttachments()
11
+ * @see Inx_Api_Mail_MailContent::getEmbeddedImages()
12
+ * @since API 1.0
13
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
14
+ * @package Inxmail
15
+ * @subpackage Mail
16
+ */
17
+ interface Inx_Api_Mail_Attachment
18
+ {
19
+
20
+ /**
21
+ * Returns the file name of a regular attachment or the image identifier of an embedded image.
22
+ * An embedded image is referenced in a message body using an &lt;img&gt; tag, as follows:
23
+ *
24
+ * <pre>
25
+ * <img src="cid:Image-Identifier">
26
+ * </pre>
27
+ *
28
+ * @return string the file name of a regular attachment or the image identifier of an embedded image.
29
+ */
30
+ public function getName();
31
+
32
+
33
+ /**
34
+ * Returns the MIME type of this attachment, e.g. <i>application/pdf</i> or <i>image/gif</i>.
35
+ *
36
+ * @return string the MIME type of this attachment.
37
+ */
38
+ public function getContentType();
39
+
40
+
41
+ /**
42
+ * Return the size of the content of this attachment in bytes.
43
+ *
44
+ * @return int the size of the content of this attachment in bytes.
45
+ */
46
+ public function getSize();
47
+
48
+
49
+ /**
50
+ * Returns an input stream of the content of this attachment.
51
+ * This method is used to download the content of this attachment.
52
+ *
53
+ * @return Inx_Api_InputStream an input stream of the content of this attachment.
54
+ */
55
+ public function getContent();
56
+
57
+ }
lib/Inx/Api/Mail/BuildException.php CHANGED
@@ -1,63 +1,63 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mail
5
- */
6
- /**
7
- * An <i>Inx_Api_Mail_BuildException</i> is thrown when the building of a mailing fails.
8
- * This may be due to an illegal recipient address or a general building failure.
9
- * For a deeper insight on the error, consult the <i>Inx_Api_Mail_RenderError</i> associated with the exception.
10
- *
11
- * @see Inx_Api_Mail_RenderError
12
- * @see Inx_Api_Mail_MailingRenderer::build($iRecipientId, $iPreferredMailType=null)
13
- * @version $Revision: 9479 $ $Date: 2007-12-18 15:43:23 +0200 (An, 18 Grd 2007) $ $Author: aurimas $
14
- * @package Inxmail
15
- * @subpackage Mail
16
- */
17
- class Inx_Api_Mail_BuildException extends Exception
18
- {
19
- /**
20
- * The email address of the recipient for which the mailing was built.
21
- * @var string
22
- */
23
- protected $sEmailAddress;
24
-
25
- /**
26
- * Contains detail information about the error.
27
- * @var Inx_Api_Mail_RenderError
28
- */
29
- protected $oError;
30
-
31
- /**
32
- * Creates an <i>Inx_Api_Mail_BuildException</i> with the given recipient address and render error.
33
- *
34
- * @param string $sEmailAddress the email address of the recipient for which the mailing was built.
35
- * @param Inx_Api_Mail_RenderError $oError contains detail information about the error.
36
- */
37
- public function __construct( $sEmailAddress, $oError )
38
- {
39
- $this->sEmailAddress = $sEmailAddress;
40
- $this->oError = $oError;
41
- }
42
-
43
- /**
44
- * Returns detail information about the error.
45
- *
46
- * @return Inx_Api_Mail_RenderError detail information about the error.
47
- */
48
- public function getError()
49
- {
50
- return $this->oError;
51
- }
52
-
53
- /**
54
- * Returns the email address of the recipient for which the mailing was built.
55
- *
56
- * @return string the recipients email address.
57
- */
58
- public function getEmailAddress()
59
- {
60
- return $this->sEmailAddress;
61
- }
62
-
63
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mail
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Mail_BuildException</i> is thrown when the building of a mailing fails.
8
+ * This may be due to an illegal recipient address or a general building failure.
9
+ * For a deeper insight on the error, consult the <i>Inx_Api_Mail_RenderError</i> associated with the exception.
10
+ *
11
+ * @see Inx_Api_Mail_RenderError
12
+ * @see Inx_Api_Mail_MailingRenderer::build($iRecipientId, $iPreferredMailType=null)
13
+ * @version $Revision: 9479 $ $Date: 2007-12-18 15:43:23 +0200 (An, 18 Grd 2007) $ $Author: aurimas $
14
+ * @package Inxmail
15
+ * @subpackage Mail
16
+ */
17
+ class Inx_Api_Mail_BuildException extends Exception
18
+ {
19
+ /**
20
+ * The email address of the recipient for which the mailing was built.
21
+ * @var string
22
+ */
23
+ protected $sEmailAddress;
24
+
25
+ /**
26
+ * Contains detail information about the error.
27
+ * @var Inx_Api_Mail_RenderError
28
+ */
29
+ protected $oError;
30
+
31
+ /**
32
+ * Creates an <i>Inx_Api_Mail_BuildException</i> with the given recipient address and render error.
33
+ *
34
+ * @param string $sEmailAddress the email address of the recipient for which the mailing was built.
35
+ * @param Inx_Api_Mail_RenderError $oError contains detail information about the error.
36
+ */
37
+ public function __construct( $sEmailAddress, $oError )
38
+ {
39
+ $this->sEmailAddress = $sEmailAddress;
40
+ $this->oError = $oError;
41
+ }
42
+
43
+ /**
44
+ * Returns detail information about the error.
45
+ *
46
+ * @return Inx_Api_Mail_RenderError detail information about the error.
47
+ */
48
+ public function getError()
49
+ {
50
+ return $this->oError;
51
+ }
52
+
53
+ /**
54
+ * Returns the email address of the recipient for which the mailing was built.
55
+ *
56
+ * @return string the recipients email address.
57
+ */
58
+ public function getEmailAddress()
59
+ {
60
+ return $this->sEmailAddress;
61
+ }
62
+
63
+ }
lib/Inx/Api/Mail/HeaderField.php CHANGED
@@ -1,75 +1,75 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mail
5
- */
6
-
7
- /**
8
- * An <i>Inx_Api_Mail_HeaderField</i> stores a name/value pair of an email header field.
9
- *
10
- * @since API 1.9.0
11
- * @author chge
12
- */
13
- class Inx_Api_Mail_HeaderField
14
- {
15
- private $sName;
16
-
17
- private $sValue;
18
-
19
-
20
- /**
21
- * Creates an <i>Inx_Api_Mail_HeaderField</i> with the specified name and value.
22
- *
23
- * @param string $sName the name of the header field. May be ommitted.
24
- * @param string $sValue the value of the header field. May be ommitted.
25
- */
26
- public function __construct( $sName = null, $sValue = null )
27
- {
28
- $this->setName( $sName );
29
- $this->setValue( $sValue );
30
- }
31
-
32
-
33
- /**
34
- * Returns the name of the header field.
35
- *
36
- * @return string the name of the header field.
37
- */
38
- public function getName()
39
- {
40
- return $this->sName;
41
- }
42
-
43
-
44
- /**
45
- * Returns the value of the header field.
46
- *
47
- * @return string the value of the header field.
48
- */
49
- public function getValue()
50
- {
51
- return $this->sValue;
52
- }
53
-
54
-
55
- /**
56
- * Sets the name of the header field.
57
- *
58
- * @param string $sName the name of the header field.
59
- */
60
- public function setName( $sName )
61
- {
62
- $this->sName = $sName;
63
- }
64
-
65
-
66
- /**
67
- * Sets the value of the header field.
68
- *
69
- * @param string $sValue the value of the header field.
70
- */
71
- public function setValue( $sValue )
72
- {
73
- $this->sValue = $sValue;
74
- }
75
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mail
5
+ */
6
+
7
+ /**
8
+ * An <i>Inx_Api_Mail_HeaderField</i> stores a name/value pair of an email header field.
9
+ *
10
+ * @since API 1.9.0
11
+ * @author chge
12
+ */
13
+ class Inx_Api_Mail_HeaderField
14
+ {
15
+ private $sName;
16
+
17
+ private $sValue;
18
+
19
+
20
+ /**
21
+ * Creates an <i>Inx_Api_Mail_HeaderField</i> with the specified name and value.
22
+ *
23
+ * @param string $sName the name of the header field. May be ommitted.
24
+ * @param string $sValue the value of the header field. May be ommitted.
25
+ */
26
+ public function __construct( $sName = null, $sValue = null )
27
+ {
28
+ $this->setName( $sName );
29
+ $this->setValue( $sValue );
30
+ }
31
+
32
+
33
+ /**
34
+ * Returns the name of the header field.
35
+ *
36
+ * @return string the name of the header field.
37
+ */
38
+ public function getName()
39
+ {
40
+ return $this->sName;
41
+ }
42
+
43
+
44
+ /**
45
+ * Returns the value of the header field.
46
+ *
47
+ * @return string the value of the header field.
48
+ */
49
+ public function getValue()
50
+ {
51
+ return $this->sValue;
52
+ }
53
+
54
+
55
+ /**
56
+ * Sets the name of the header field.
57
+ *
58
+ * @param string $sName the name of the header field.
59
+ */
60
+ public function setName( $sName )
61
+ {
62
+ $this->sName = $sName;
63
+ }
64
+
65
+
66
+ /**
67
+ * Sets the value of the header field.
68
+ *
69
+ * @param string $sValue the value of the header field.
70
+ */
71
+ public function setValue( $sValue )
72
+ {
73
+ $this->sValue = $sValue;
74
+ }
75
  }
lib/Inx/Api/Mail/MailContent.php CHANGED
@@ -1,161 +1,161 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mail
5
- */
6
-
7
- /**
8
- * The <i>Inx_Api_Mail_MailContent</i> contains the personalized content of a mailing for a specific recipient.
9
- * The information that can be retrieved from the <i>Inx_Api_Mail_MailContent</i> includes:
10
- * <ul>
11
- * <li>The mail type: <i>getMailType()</i>
12
- * <li>Plain/HTML text: <i>getPlainText()</i> and <i>getHtmlText()</i>
13
- * <li>The subject: <i>getSubject()</i>
14
- * <li>The recipient address: <i>getRecipientAddress()</i>
15
- * <li>Attachments: <i>getAttachments()</i>
16
- * <li>Embedded images: <i>getEmbeddedImages()</i>
17
- * <li>The sender address: <i>getSenderAddress()</i>
18
- * <li>The bounce and reply addresses: <i>getBounceAddress()</i> and <i>getReplyToAddress()</i>
19
- * <li>The mail headers: <i>getHeader()</i> or <i>getMultipleHeaders()</i>
20
- * </ul>
21
- * An <i>Inx_Api_Mail_MailContent</i> object is created by an <i>Inx_Api_Mail_MailingRenderer</i> using its <i>build</i> methods.
22
- *
23
- * @see Inx_Api_Mail_MailingRenderer::build($iRecipientId, $iPreferredMailType=null)
24
- * @since API 1.0
25
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
26
- * @package Inxmail
27
- * @subpackage Mail
28
- */
29
- interface Inx_Api_Mail_MailContent
30
- {
31
-
32
- /**
33
- * Mail type indicating a HTML text mail. This mail has only a HTML text part.
34
- */
35
- const MAIL_TYPE_HTML_TEXT = 0;
36
-
37
- /**
38
- * Mail type indicating a plain text mail. This mail has only a plain text part.
39
- */
40
- const MAIL_TYPE_PLAIN_TEXT = 1;
41
-
42
- /**
43
- * Mail type indicating a multipart mail. This mail has a HTML and a plain text part.
44
- */
45
- const MAIL_TYPE_MULTIPART = 2;
46
-
47
-
48
- /**
49
- * Returns the mail type of this mail - either:
50
- * <ul>
51
- * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_HTML_TEXT</i>,
52
- * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_PLAIN_TEXT</i> or
53
- * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_MULTIPART</i>
54
- * </ul>
55
- *
56
- * @return int the mail type of this mail.
57
- */
58
- public function getMailType();
59
-
60
-
61
- /**
62
- * Returns the HTML text part of the mail, or <i>null</i> if the mail type is
63
- * <i>Inx_Api_Mail_MailContent::MAIL_TYPE_PLAIN_TEXT</i>
64
- *
65
- * @return string the html text part of the mail, if any.
66
- */
67
- public function getHtmlText();
68
-
69
-
70
- /**
71
- * Returns the plain text part of the mail, or <i>null</i> if the mail type is
72
- * <i>Inx_Api_Mail_MailContent::MAIL_TYPE_HTML_TEXT</i>
73
- *
74
- * @return string the plain text part of the mail, if any.
75
- */
76
- public function getPlainText();
77
-
78
-
79
- /**
80
- * Returns the subject of the mail.
81
- *
82
- * @return string the subject of the mail.
83
- */
84
- public function getSubject();
85
-
86
-
87
- /**
88
- * Returns the recipient address of the mail.
89
- *
90
- * @return string the recipient address of the mail.
91
- */
92
- public function getRecipientAddress();
93
-
94
-
95
- /**
96
- * Returns the sender address of the mail.
97
- *
98
- * @return string the sender address of the mail.
99
- */
100
- public function getSenderAddress();
101
-
102
-
103
- /**
104
- * Returns the reply address of the mail. This address will be used for replies.
105
- *
106
- * @return string the reply address of the mail.
107
- */
108
- public function getReplyToAddress();
109
-
110
-
111
- /**
112
- * Returns the bounce address of the mail. This address will be used for bounce messages.
113
- *
114
- * @return string the bounce address of the mail.
115
- */
116
- public function getBounceAddress();
117
-
118
-
119
- /**
120
- * Returns all regular attachments (files) of the mail.
121
- *
122
- * @return array all regular attachments of the mail.
123
- */
124
- public function getAttachments();
125
-
126
-
127
- /**
128
- * Returns all embedded images of the mail.
129
- *
130
- * @return array all embedded images of the mail.
131
- */
132
- public function getEmbeddedImages();
133
-
134
-
135
- /**
136
- * Returns the header information of the mail.
137
- * The associative array contains the key/value-pair of the headers.
138
- * <p>
139
- * Note: This method allows header fields only to be defined once.
140
- * If a header field is defined multiple times, the last value will be used.
141
- * If you wish to define header fields multiple times, use the <i>getMultipleHeaders()<i> method instead.
142
- * Nonetheless, you should be aware that defining the same header field multiple times is discouraged by RFC 5322
143
- * as this is an obsolete behavior only permitted by legacy implementations.
144
- *
145
- * @return array the header information of the mail.
146
- */
147
- public function getHeader();
148
-
149
- /**
150
- * Returns the header information of the mail.
151
- * The array contains <i>Inx_Api_Mail_HeaderField</i> objects encapsulating the key/value-pairs of the headers.
152
- * This method allows for multiple defined header fields.
153
- * <p>
154
- * Note: You should be aware that defining the same header field multiple times is discouraged by RFC 5322 as this
155
- * is an obsolete behavior only permitted by legacy implementations.
156
- *
157
- * @return array the header information of the mail.
158
- * @since API 1.9.0
159
- */
160
- public function getMultipleHeaders();
161
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mail
5
+ */
6
+
7
+ /**
8
+ * The <i>Inx_Api_Mail_MailContent</i> contains the personalized content of a mailing for a specific recipient.
9
+ * The information that can be retrieved from the <i>Inx_Api_Mail_MailContent</i> includes:
10
+ * <ul>
11
+ * <li>The mail type: <i>getMailType()</i>
12
+ * <li>Plain/HTML text: <i>getPlainText()</i> and <i>getHtmlText()</i>
13
+ * <li>The subject: <i>getSubject()</i>
14
+ * <li>The recipient address: <i>getRecipientAddress()</i>
15
+ * <li>Attachments: <i>getAttachments()</i>
16
+ * <li>Embedded images: <i>getEmbeddedImages()</i>
17
+ * <li>The sender address: <i>getSenderAddress()</i>
18
+ * <li>The bounce and reply addresses: <i>getBounceAddress()</i> and <i>getReplyToAddress()</i>
19
+ * <li>The mail headers: <i>getHeader()</i> or <i>getMultipleHeaders()</i>
20
+ * </ul>
21
+ * An <i>Inx_Api_Mail_MailContent</i> object is created by an <i>Inx_Api_Mail_MailingRenderer</i> using its <i>build</i> methods.
22
+ *
23
+ * @see Inx_Api_Mail_MailingRenderer::build($iRecipientId, $iPreferredMailType=null)
24
+ * @since API 1.0
25
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
26
+ * @package Inxmail
27
+ * @subpackage Mail
28
+ */
29
+ interface Inx_Api_Mail_MailContent
30
+ {
31
+
32
+ /**
33
+ * Mail type indicating a HTML text mail. This mail has only a HTML text part.
34
+ */
35
+ const MAIL_TYPE_HTML_TEXT = 0;
36
+
37
+ /**
38
+ * Mail type indicating a plain text mail. This mail has only a plain text part.
39
+ */
40
+ const MAIL_TYPE_PLAIN_TEXT = 1;
41
+
42
+ /**
43
+ * Mail type indicating a multipart mail. This mail has a HTML and a plain text part.
44
+ */
45
+ const MAIL_TYPE_MULTIPART = 2;
46
+
47
+
48
+ /**
49
+ * Returns the mail type of this mail - either:
50
+ * <ul>
51
+ * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_HTML_TEXT</i>,
52
+ * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_PLAIN_TEXT</i> or
53
+ * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_MULTIPART</i>
54
+ * </ul>
55
+ *
56
+ * @return int the mail type of this mail.
57
+ */
58
+ public function getMailType();
59
+
60
+
61
+ /**
62
+ * Returns the HTML text part of the mail, or <i>null</i> if the mail type is
63
+ * <i>Inx_Api_Mail_MailContent::MAIL_TYPE_PLAIN_TEXT</i>
64
+ *
65
+ * @return string the html text part of the mail, if any.
66
+ */
67
+ public function getHtmlText();
68
+
69
+
70
+ /**
71
+ * Returns the plain text part of the mail, or <i>null</i> if the mail type is
72
+ * <i>Inx_Api_Mail_MailContent::MAIL_TYPE_HTML_TEXT</i>
73
+ *
74
+ * @return string the plain text part of the mail, if any.
75
+ */
76
+ public function getPlainText();
77
+
78
+
79
+ /**
80
+ * Returns the subject of the mail.
81
+ *
82
+ * @return string the subject of the mail.
83
+ */
84
+ public function getSubject();
85
+
86
+
87
+ /**
88
+ * Returns the recipient address of the mail.
89
+ *
90
+ * @return string the recipient address of the mail.
91
+ */
92
+ public function getRecipientAddress();
93
+
94
+
95
+ /**
96
+ * Returns the sender address of the mail.
97
+ *
98
+ * @return string the sender address of the mail.
99
+ */
100
+ public function getSenderAddress();
101
+
102
+
103
+ /**
104
+ * Returns the reply address of the mail. This address will be used for replies.
105
+ *
106
+ * @return string the reply address of the mail.
107
+ */
108
+ public function getReplyToAddress();
109
+
110
+
111
+ /**
112
+ * Returns the bounce address of the mail. This address will be used for bounce messages.
113
+ *
114
+ * @return string the bounce address of the mail.
115
+ */
116
+ public function getBounceAddress();
117
+
118
+
119
+ /**
120
+ * Returns all regular attachments (files) of the mail.
121
+ *
122
+ * @return array all regular attachments of the mail.
123
+ */
124
+ public function getAttachments();
125
+
126
+
127
+ /**
128
+ * Returns all embedded images of the mail.
129
+ *
130
+ * @return array all embedded images of the mail.
131
+ */
132
+ public function getEmbeddedImages();
133
+
134
+
135
+ /**
136
+ * Returns the header information of the mail.
137
+ * The associative array contains the key/value-pair of the headers.
138
+ * <p>
139
+ * Note: This method allows header fields only to be defined once.
140
+ * If a header field is defined multiple times, the last value will be used.
141
+ * If you wish to define header fields multiple times, use the <i>getMultipleHeaders()<i> method instead.
142
+ * Nonetheless, you should be aware that defining the same header field multiple times is discouraged by RFC 5322
143
+ * as this is an obsolete behavior only permitted by legacy implementations.
144
+ *
145
+ * @return array the header information of the mail.
146
+ */
147
+ public function getHeader();
148
+
149
+ /**
150
+ * Returns the header information of the mail.
151
+ * The array contains <i>Inx_Api_Mail_HeaderField</i> objects encapsulating the key/value-pairs of the headers.
152
+ * This method allows for multiple defined header fields.
153
+ * <p>
154
+ * Note: You should be aware that defining the same header field multiple times is discouraged by RFC 5322 as this
155
+ * is an obsolete behavior only permitted by legacy implementations.
156
+ *
157
+ * @return array the header information of the mail.
158
+ * @since API 1.9.0
159
+ */
160
+ public function getMultipleHeaders();
161
+ }
lib/Inx/Api/Mail/MailingRenderer.php CHANGED
@@ -1,134 +1,134 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mail
5
- */
6
-
7
- /**
8
- * The <i>Inx_Api_Mail_MailingRenderer</i> is used to generate mail content using the API.
9
- * The main use of the class will be to generate personalized previews of mailings.
10
- * The class can also be used to generate and send single mails using a different mail sender.
11
- * Be aware that in this case the mail sending rate would decrease enormously.
12
- * <p>
13
- * To preview a mailing, acquire an <i>Inx_Api_Mail_MailingRenderer</i> from the <i>Inx_Api_Mailing_MailingManager</i>.
14
- * Each mailing needs to be parsed before building it.
15
- * The following snippet shows how to build a mail for a given recipient:
16
- * <pre>
17
- * $oMailingRenderer = $oSession->getMailingManager()->createRenderer();
18
- * $oMailingRenderer->parse( $oMailing->getId(), Inx_Api_Mail_MailingRenderer::BUILD_MODE_ALTERNATIVEVIEW_ACTIVE );
19
- * $oMailContent = $oMailingRenderer->build( $iRecipientId );
20
- * </pre>
21
- * <p>
22
- * <i>Inx_Api_Mail_MailingRenderer</i> can handle the following different build modes:
23
- * <ol>
24
- * <li><i>BUILD_MODE_PREVIEW</i> - Trackable links will not trigger any events, unsubscription links will redirect but
25
- * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
26
- * <li><i>BUILD_MODE_VIEW</i> - deprecated, should not longer be used.
27
- * <li><i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE</i> - All links are fully functional. Embedded images are replaced
28
- * with http references to image resources on the Inxmail server.
29
- * <li><i>BUILD_MODE_ALTERNATIVEVIEW_INACTIVE</i> - All links are not functional. Embedded images are replaced
30
- * with http references to image resources on the Inxmail server.
31
- * <li><i>BUILD_MODE_NORMAL</i> - The mail is rendered, ready to be sent.
32
- * <li><i>BUILD_MODE_ARCHIVE</i> - Trackable links will not trigger any events, unsubscription links will redirect but
33
- * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
34
- * <li><i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS</i> - All links are fully functional but converted to
35
- * simple links. Embedded images are replaced with http references to image resources on the Inxmail server.
36
- * <li><i>BUILD_MODE_NEWSLETTER_SIMPLE_LINKS</i> - The same as above, but the function InInboxView returns true.
37
- * </ol>
38
- * <p>
39
- * <strong>Note:</strong> An <i>Inx_Api_Mail_MailingRenderer</i> object <strong>must</strong> be closed once it is not needed
40
- * anymore to prevent memory leaks and other potentially harmful side effects.
41
- *
42
- * @see Inx_Api_Mail_MailContent
43
- * @since API 1.0
44
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
45
- * @package Inxmail
46
- * @subpackage Mail
47
- */
48
- interface Inx_Api_Mail_MailingRenderer
49
- {
50
-
51
- /** The mode to generate a normal mail, ready to be sent. */
52
- const BUILD_MODE_NORMAL = 100;
53
-
54
- /**
55
- * @deprecated use <i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE</i> instead.
56
- */
57
- const BUILD_MODE_VIEW = 101;
58
-
59
- /**
60
- * The mode for mail view: All links are fully functional.
61
- * Embedded images are replaced with http references to image resources on the Inxmail server.
62
- */
63
- const BUILD_MODE_ALTERNATIVEVIEW_ACTIVE = 101;
64
-
65
-
66
- /**
67
- * The mode for mail view: All links are not functional.
68
- * Embedded images are replaced with http references to image resources on the Inxmail server.
69
- */
70
- const BUILD_MODE_ALTERNATIVEVIEW_INACTIVE = 104;
71
-
72
- /**
73
- * The mode for mail preview: Trackable links will not trigger any events, unsubscription links will redirect but
74
- * not unsubscribe anybody.
75
- * Embedded images are replaced with http references to image resources on the Inxmail server.
76
- */
77
- const BUILD_MODE_PREVIEW = 102;
78
-
79
- /**
80
- * The mode for mail archive view: Trackable links will not trigger any events, unsubscription links will redirect
81
- * but not unsubscribe anybody.
82
- * Embedded images are replaced with http references to image resources on the Inxmail server.
83
- */
84
- const BUILD_MODE_ARCHIVE = 103;
85
-
86
-
87
- /**
88
- * Prepares the mailing for a preview.
89
- * It checks the mail quality (syntax errors, references to orphaned elements, ... ).<br>
90
- * Errors will be listed in the <i>Inx_Api_Mail_ParseException</i>.<br>
91
- * The mailingId is supposed to be valid (existing mailing).<br>
92
- *
93
- * @param int $iMailingId the id of the mailing to be parsed.
94
- * @param int $iBuildMode the mode of the build. May be one of the constants defined in this class:
95
- * <ul>
96
- * <li><i>BUILD_MODE_NORMAL</i>
97
- * <li><i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE</i>
98
- * <li><i>BUILD_MODE_ALTERNATIVEVIEW_INACTIVE</i>
99
- * <li><i>BUILD_MODE_PREVIEW</i>
100
- * <li><i>BUILD_MODE_ARCHIVE</i>
101
- * <li><i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS</i>
102
- * <li><i>BUILD_MODE_NEWSLETTER_SIMPLE_LINKS</i>
103
- * </ul>
104
- * @throws Inx_Api_Mail_ParseException if any syntax error is present in the mail.
105
- * @throws Inx_Api_APIException if the mailing id is no longer valid.
106
- */
107
- public function parse( $iMailingId, $iBuildMode );
108
-
109
- /**
110
- * Generates the personalized mail content (recipient address, subject, HTML and/or plain text, ...) for the
111
- * specified recipient with a specified mail type restriction.
112
- *
113
- * @param int $iRecipientId the id of the recipient for which the mail shall be personalized.
114
- * @param int $iPreferredMailType the mail type. May be one of:
115
- * <ul>
116
- * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_HTML_TEXT</i>
117
- * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_PLAIN_TEXT</i>
118
- * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_MULTIPART</i>
119
- * </ul>
120
- * May be ommitted (defaults to the standard mail type).
121
- * @return Inx_Api_Mail_MailContent the personalized content of the mail.
122
- * @throws Inx_Api_Mail_BuildException if the recipient could not be found, or the building failed.
123
- */
124
- public function build( $iRecipientId, $iPreferredMailType=null );
125
-
126
-
127
- /**
128
- * Closes this <i>Inx_Api_Mail_MailingRenderer</i> and releases any server resources associated with this object.
129
- * An <i>Inx_Api_Mail_MailingRenderer</i> object <strong>must</strong> be closed once it is not needed
130
- * anymore to prevent memory leaks and other potentially harmful side effects.
131
- */
132
- public function close();
133
-
134
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mail
5
+ */
6
+
7
+ /**
8
+ * The <i>Inx_Api_Mail_MailingRenderer</i> is used to generate mail content using the API.
9
+ * The main use of the class will be to generate personalized previews of mailings.
10
+ * The class can also be used to generate and send single mails using a different mail sender.
11
+ * Be aware that in this case the mail sending rate would decrease enormously.
12
+ * <p>
13
+ * To preview a mailing, acquire an <i>Inx_Api_Mail_MailingRenderer</i> from the <i>Inx_Api_Mailing_MailingManager</i>.
14
+ * Each mailing needs to be parsed before building it.
15
+ * The following snippet shows how to build a mail for a given recipient:
16
+ * <pre>
17
+ * $oMailingRenderer = $oSession->getMailingManager()->createRenderer();
18
+ * $oMailingRenderer->parse( $oMailing->getId(), Inx_Api_Mail_MailingRenderer::BUILD_MODE_ALTERNATIVEVIEW_ACTIVE );
19
+ * $oMailContent = $oMailingRenderer->build( $iRecipientId );
20
+ * </pre>
21
+ * <p>
22
+ * <i>Inx_Api_Mail_MailingRenderer</i> can handle the following different build modes:
23
+ * <ol>
24
+ * <li><i>BUILD_MODE_PREVIEW</i> - Trackable links will not trigger any events, unsubscription links will redirect but
25
+ * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
26
+ * <li><i>BUILD_MODE_VIEW</i> - deprecated, should not longer be used.
27
+ * <li><i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE</i> - All links are fully functional. Embedded images are replaced
28
+ * with http references to image resources on the Inxmail server.
29
+ * <li><i>BUILD_MODE_ALTERNATIVEVIEW_INACTIVE</i> - All links are not functional. Embedded images are replaced
30
+ * with http references to image resources on the Inxmail server.
31
+ * <li><i>BUILD_MODE_NORMAL</i> - The mail is rendered, ready to be sent.
32
+ * <li><i>BUILD_MODE_ARCHIVE</i> - Trackable links will not trigger any events, unsubscription links will redirect but
33
+ * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
34
+ * <li><i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS</i> - All links are fully functional but converted to
35
+ * simple links. Embedded images are replaced with http references to image resources on the Inxmail server.
36
+ * <li><i>BUILD_MODE_NEWSLETTER_SIMPLE_LINKS</i> - The same as above, but the function InInboxView returns true.
37
+ * </ol>
38
+ * <p>
39
+ * <strong>Note:</strong> An <i>Inx_Api_Mail_MailingRenderer</i> object <strong>must</strong> be closed once it is not needed
40
+ * anymore to prevent memory leaks and other potentially harmful side effects.
41
+ *
42
+ * @see Inx_Api_Mail_MailContent
43
+ * @since API 1.0
44
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
45
+ * @package Inxmail
46
+ * @subpackage Mail
47
+ */
48
+ interface Inx_Api_Mail_MailingRenderer
49
+ {
50
+
51
+ /** The mode to generate a normal mail, ready to be sent. */
52
+ const BUILD_MODE_NORMAL = 100;
53
+
54
+ /**
55
+ * @deprecated use <i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE</i> instead.
56
+ */
57
+ const BUILD_MODE_VIEW = 101;
58
+
59
+ /**
60
+ * The mode for mail view: All links are fully functional.
61
+ * Embedded images are replaced with http references to image resources on the Inxmail server.
62
+ */
63
+ const BUILD_MODE_ALTERNATIVEVIEW_ACTIVE = 101;
64
+
65
+
66
+ /**
67
+ * The mode for mail view: All links are not functional.
68
+ * Embedded images are replaced with http references to image resources on the Inxmail server.
69
+ */
70
+ const BUILD_MODE_ALTERNATIVEVIEW_INACTIVE = 104;
71
+
72
+ /**
73
+ * The mode for mail preview: Trackable links will not trigger any events, unsubscription links will redirect but
74
+ * not unsubscribe anybody.
75
+ * Embedded images are replaced with http references to image resources on the Inxmail server.
76
+ */
77
+ const BUILD_MODE_PREVIEW = 102;
78
+
79
+ /**
80
+ * The mode for mail archive view: Trackable links will not trigger any events, unsubscription links will redirect
81
+ * but not unsubscribe anybody.
82
+ * Embedded images are replaced with http references to image resources on the Inxmail server.
83
+ */
84
+ const BUILD_MODE_ARCHIVE = 103;
85
+
86
+
87
+ /**
88
+ * Prepares the mailing for a preview.
89
+ * It checks the mail quality (syntax errors, references to orphaned elements, ... ).<br>
90
+ * Errors will be listed in the <i>Inx_Api_Mail_ParseException</i>.<br>
91
+ * The mailingId is supposed to be valid (existing mailing).<br>
92
+ *
93
+ * @param int $iMailingId the id of the mailing to be parsed.
94
+ * @param int $iBuildMode the mode of the build. May be one of the constants defined in this class:
95
+ * <ul>
96
+ * <li><i>BUILD_MODE_NORMAL</i>
97
+ * <li><i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE</i>
98
+ * <li><i>BUILD_MODE_ALTERNATIVEVIEW_INACTIVE</i>
99
+ * <li><i>BUILD_MODE_PREVIEW</i>
100
+ * <li><i>BUILD_MODE_ARCHIVE</i>
101
+ * <li><i>BUILD_MODE_ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS</i>
102
+ * <li><i>BUILD_MODE_NEWSLETTER_SIMPLE_LINKS</i>
103
+ * </ul>
104
+ * @throws Inx_Api_Mail_ParseException if any syntax error is present in the mail.
105
+ * @throws Inx_Api_APIException if the mailing id is no longer valid.
106
+ */
107
+ public function parse( $iMailingId, $iBuildMode );
108
+
109
+ /**
110
+ * Generates the personalized mail content (recipient address, subject, HTML and/or plain text, ...) for the
111
+ * specified recipient with a specified mail type restriction.
112
+ *
113
+ * @param int $iRecipientId the id of the recipient for which the mail shall be personalized.
114
+ * @param int $iPreferredMailType the mail type. May be one of:
115
+ * <ul>
116
+ * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_HTML_TEXT</i>
117
+ * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_PLAIN_TEXT</i>
118
+ * <li><i>Inx_Api_Mail_MailContent::MAIL_TYPE_MULTIPART</i>
119
+ * </ul>
120
+ * May be ommitted (defaults to the standard mail type).
121
+ * @return Inx_Api_Mail_MailContent the personalized content of the mail.
122
+ * @throws Inx_Api_Mail_BuildException if the recipient could not be found, or the building failed.
123
+ */
124
+ public function build( $iRecipientId, $iPreferredMailType=null );
125
+
126
+
127
+ /**
128
+ * Closes this <i>Inx_Api_Mail_MailingRenderer</i> and releases any server resources associated with this object.
129
+ * An <i>Inx_Api_Mail_MailingRenderer</i> object <strong>must</strong> be closed once it is not needed
130
+ * anymore to prevent memory leaks and other potentially harmful side effects.
131
+ */
132
+ public function close();
133
+
134
  }
lib/Inx/Api/Mail/ParseException.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mail
5
- */
6
- /**
7
- * An <i>Inx_Api_Mail_ParseException</i> is thrown when the parsing of a mailing fails.
8
- * The reason for such a failure usually is a syntax error.
9
- * For a deeper insight on the error, consult the {@link RenderError}s associated with the exception.
10
- *
11
- * @see Inx_Api_Mail_RenderError
12
- * @see Inx_Api_Mail_MailingRenderer::parse( $iRecipientId, $iPreferredMailType=null )
13
- * @version $Revision: 9479 $ $Date: 2007-12-18 15:43:23 +0200 (An, 18 Grd 2007) $ $Author: aurimas $
14
- * @package Inxmail
15
- * @subpackage Mail
16
- */
17
- class Inx_Api_Mail_ParseException extends Exception
18
- {
19
- /**
20
- * Contains detail information about the error.
21
- * @var array() of Inx_Api_Mail_RenderError objects
22
- */
23
- protected $aErrors = array();
24
-
25
-
26
- /**
27
- * Creates an <i>Inx_Api_Mail_ParseException</i> with the given render errors.
28
- *
29
- * @param array $aErrors the render errors which occurred during the parsing.
30
- */
31
- public function __construct( $aErrors )
32
- {
33
- $this->aErrors = $aErrors;
34
- }
35
-
36
- /**
37
- * Returns detail information about the error by returning the render error with the given index.
38
- *
39
- * @param int $iIndex the index of the render error to be returned.
40
- * @return Inx_Api_Mail_RenderError the render error with the given index.
41
- */
42
- public function getError( $iIndex )
43
- {
44
- return $this->aErrors[$iIndex];
45
- }
46
-
47
- /**
48
- * Returns the number of render errors associated with this <i>Inx_Api_Mail_ParseException</i>.
49
- *
50
- * @return int the number of render errors.
51
- */
52
- public function getErrorCount()
53
- {
54
- return count($this->aErrors);
55
- }
56
-
57
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mail
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Mail_ParseException</i> is thrown when the parsing of a mailing fails.
8
+ * The reason for such a failure usually is a syntax error.
9
+ * For a deeper insight on the error, consult the {@link RenderError}s associated with the exception.
10
+ *
11
+ * @see Inx_Api_Mail_RenderError
12
+ * @see Inx_Api_Mail_MailingRenderer::parse( $iRecipientId, $iPreferredMailType=null )
13
+ * @version $Revision: 9479 $ $Date: 2007-12-18 15:43:23 +0200 (An, 18 Grd 2007) $ $Author: aurimas $
14
+ * @package Inxmail
15
+ * @subpackage Mail
16
+ */
17
+ class Inx_Api_Mail_ParseException extends Exception
18
+ {
19
+ /**
20
+ * Contains detail information about the error.
21
+ * @var array() of Inx_Api_Mail_RenderError objects
22
+ */
23
+ protected $aErrors = array();
24
+
25
+
26
+ /**
27
+ * Creates an <i>Inx_Api_Mail_ParseException</i> with the given render errors.
28
+ *
29
+ * @param array $aErrors the render errors which occurred during the parsing.
30
+ */
31
+ public function __construct( $aErrors )
32
+ {
33
+ $this->aErrors = $aErrors;
34
+ }
35
+
36
+ /**
37
+ * Returns detail information about the error by returning the render error with the given index.
38
+ *
39
+ * @param int $iIndex the index of the render error to be returned.
40
+ * @return Inx_Api_Mail_RenderError the render error with the given index.
41
+ */
42
+ public function getError( $iIndex )
43
+ {
44
+ return $this->aErrors[$iIndex];
45
+ }
46
+
47
+ /**
48
+ * Returns the number of render errors associated with this <i>Inx_Api_Mail_ParseException</i>.
49
+ *
50
+ * @return int the number of render errors.
51
+ */
52
+ public function getErrorCount()
53
+ {
54
+ return count($this->aErrors);
55
+ }
56
+
57
+ }
lib/Inx/Api/Mail/RenderError.php CHANGED
@@ -1,142 +1,142 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mail
5
- */
6
- /**
7
- * An <i>Inx_Api_Mail_RenderError</i> object describes the details of an error which occurred during the parsing or building of
8
- * a mailing.
9
- * <i>Inx_Api_Mail_RenderError</i> offers the following information:
10
- * <ul>
11
- * <li><i>Error type</i>: an internal error code
12
- * <li><i>Mail part</i>: the internal mail part code
13
- * <li><i>Begin line / column</i>: the line and column where the malicious token begins
14
- * <li><i>End line / column</i>: the line and column where the malicious token ends.
15
- * <li><i>Error messages</i>: the error messages
16
- * </ul>
17
- * <p>
18
- * <i>Inx_Api_Mail_RenderError</i> is mainly used internally but may provide some insight on the error source to API developers.
19
- * For example, the token position will assist you in identifying syntax errors.
20
- * The error messages may also be analyzed to identify the error source.
21
- *
22
- * @see Inx_Api_Mail_BuildException::getError()
23
- * @see Inx_Api_Mail_ParseException::getError($iIndex)
24
- * @version $Revision: 9479 $ $Date: 2007-12-18 15:43:23 +0200 (An, 18 Grd 2007) $ $Author: aurimas $
25
- * @package Inxmail
26
- * @subpackage Mail
27
- */
28
- class Inx_Api_Mail_RenderError
29
- {
30
- private $iErrorType;
31
- private $iMailPart;
32
- private $iBeginLine;
33
- private $iEndLine;
34
- private $iBeginColumn;
35
- private $iEndColumn;
36
- /**
37
- * @var array of string arguments
38
- */
39
- private $aMsgArgs;
40
-
41
-
42
- /**
43
- * Creates an <i>Inx_Api_Mail_RenderError</i> with the given details.
44
- *
45
- * @param $iErrorType the internal error code.
46
- * @param $iMailPart the internal mail part code.
47
- * @param $iBeginLine the line where the malicious token begins.
48
- * @param $iEndLine the line where the malicious token ends.
49
- * @param $iBeginColumn the column where the malicious token begins.
50
- * @param $iEndColumn the column where the malicious token ends.
51
- * @param $aMsgArgs the string error messages.
52
- */
53
- public function __construct( $iErrorType, $iMailPart, $iBeginLine,
54
- $iEndLine, $iBeginColumn, $iEndColumn, $aMsgArgs )
55
- {
56
- $this->iErrorType = $iErrorType;
57
- $this->iMailPart = $iMailPart;
58
- $this->iBeginLine = $iBeginLine;
59
- $this->iEndLine = $iEndLine;
60
- $this->iBeginColumn = $iBeginColumn;
61
- $this->iEndColumn = $iEndColumn;
62
- $this->aMsgArgs = $aMsgArgs;
63
- }
64
-
65
-
66
- /**
67
- * Returns the internal error code.
68
- *
69
- * @return int the internal error code.
70
- */
71
- public function getErrorType()
72
- {
73
- return $this->iErrorType;
74
- }
75
-
76
-
77
- /**
78
- * Returns the internal mail part code.
79
- *
80
- * @return int the internal mail part code.
81
- */
82
- public function getMailPart()
83
- {
84
- return $this->iMailPart ;
85
- }
86
-
87
-
88
- /**
89
- * Returns the line where the malicious token begins.
90
- *
91
- * @return int the line where the malicious token begins.
92
- */
93
- public function getBeginLine()
94
- {
95
- return $this->iBeginLine;
96
- }
97
-
98
-
99
- /**
100
- * Returns the line where the malicious token ends.
101
- *
102
- * @return int the line where the malicious token ends.
103
- */
104
- public function getEndLine()
105
- {
106
- return $this->iEndLine;
107
- }
108
-
109
-
110
- /**
111
- * Returns the column where the malicious token begins.
112
- *
113
- * @return int the column where the malicious token begins.
114
- */
115
- public function getBeginColumn()
116
- {
117
- return $this->iBeginColumn;
118
- }
119
-
120
-
121
- /**
122
- * Returns the column where the malicious token ends.
123
- *
124
- * @return int the column where the malicious token ends.
125
- */
126
- public function getEndColumn()
127
- {
128
- return $this->iEndColumn;
129
- }
130
-
131
-
132
- /**
133
- * Returns the error messages.
134
- *
135
- * @return array the string error messages.
136
- */
137
- public function getMsgArgs()
138
- {
139
- return $this->aMsgArgs;
140
- }
141
-
142
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mail
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Mail_RenderError</i> object describes the details of an error which occurred during the parsing or building of
8
+ * a mailing.
9
+ * <i>Inx_Api_Mail_RenderError</i> offers the following information:
10
+ * <ul>
11
+ * <li><i>Error type</i>: an internal error code
12
+ * <li><i>Mail part</i>: the internal mail part code
13
+ * <li><i>Begin line / column</i>: the line and column where the malicious token begins
14
+ * <li><i>End line / column</i>: the line and column where the malicious token ends.
15
+ * <li><i>Error messages</i>: the error messages
16
+ * </ul>
17
+ * <p>
18
+ * <i>Inx_Api_Mail_RenderError</i> is mainly used internally but may provide some insight on the error source to API developers.
19
+ * For example, the token position will assist you in identifying syntax errors.
20
+ * The error messages may also be analyzed to identify the error source.
21
+ *
22
+ * @see Inx_Api_Mail_BuildException::getError()
23
+ * @see Inx_Api_Mail_ParseException::getError($iIndex)
24
+ * @version $Revision: 9479 $ $Date: 2007-12-18 15:43:23 +0200 (An, 18 Grd 2007) $ $Author: aurimas $
25
+ * @package Inxmail
26
+ * @subpackage Mail
27
+ */
28
+ class Inx_Api_Mail_RenderError
29
+ {
30
+ private $iErrorType;
31
+ private $iMailPart;
32
+ private $iBeginLine;
33
+ private $iEndLine;
34
+ private $iBeginColumn;
35
+ private $iEndColumn;
36
+ /**
37
+ * @var array of string arguments
38
+ */
39
+ private $aMsgArgs;
40
+
41
+
42
+ /**
43
+ * Creates an <i>Inx_Api_Mail_RenderError</i> with the given details.
44
+ *
45
+ * @param $iErrorType the internal error code.
46
+ * @param $iMailPart the internal mail part code.
47
+ * @param $iBeginLine the line where the malicious token begins.
48
+ * @param $iEndLine the line where the malicious token ends.
49
+ * @param $iBeginColumn the column where the malicious token begins.
50
+ * @param $iEndColumn the column where the malicious token ends.
51
+ * @param $aMsgArgs the string error messages.
52
+ */
53
+ public function __construct( $iErrorType, $iMailPart, $iBeginLine,
54
+ $iEndLine, $iBeginColumn, $iEndColumn, $aMsgArgs )
55
+ {
56
+ $this->iErrorType = $iErrorType;
57
+ $this->iMailPart = $iMailPart;
58
+ $this->iBeginLine = $iBeginLine;
59
+ $this->iEndLine = $iEndLine;
60
+ $this->iBeginColumn = $iBeginColumn;
61
+ $this->iEndColumn = $iEndColumn;
62
+ $this->aMsgArgs = $aMsgArgs;
63
+ }
64
+
65
+
66
+ /**
67
+ * Returns the internal error code.
68
+ *
69
+ * @return int the internal error code.
70
+ */
71
+ public function getErrorType()
72
+ {
73
+ return $this->iErrorType;
74
+ }
75
+
76
+
77
+ /**
78
+ * Returns the internal mail part code.
79
+ *
80
+ * @return int the internal mail part code.
81
+ */
82
+ public function getMailPart()
83
+ {
84
+ return $this->iMailPart ;
85
+ }
86
+
87
+
88
+ /**
89
+ * Returns the line where the malicious token begins.
90
+ *
91
+ * @return int the line where the malicious token begins.
92
+ */
93
+ public function getBeginLine()
94
+ {
95
+ return $this->iBeginLine;
96
+ }
97
+
98
+
99
+ /**
100
+ * Returns the line where the malicious token ends.
101
+ *
102
+ * @return int the line where the malicious token ends.
103
+ */
104
+ public function getEndLine()
105
+ {
106
+ return $this->iEndLine;
107
+ }
108
+
109
+
110
+ /**
111
+ * Returns the column where the malicious token begins.
112
+ *
113
+ * @return int the column where the malicious token begins.
114
+ */
115
+ public function getBeginColumn()
116
+ {
117
+ return $this->iBeginColumn;
118
+ }
119
+
120
+
121
+ /**
122
+ * Returns the column where the malicious token ends.
123
+ *
124
+ * @return int the column where the malicious token ends.
125
+ */
126
+ public function getEndColumn()
127
+ {
128
+ return $this->iEndColumn;
129
+ }
130
+
131
+
132
+ /**
133
+ * Returns the error messages.
134
+ *
135
+ * @return array the string error messages.
136
+ */
137
+ public function getMsgArgs()
138
+ {
139
+ return $this->aMsgArgs;
140
+ }
141
+
142
+ }
lib/Inx/Api/Mailing/ContentHandler.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mailing
5
- */
6
- /**
7
- * The <i>Inx_Api_Mailing_ContentHandler</i> interface identifies content handlers.
8
- * Content handlers are used to store and update the content of a mailing in a specific format.
9
- * Some content handlers (like <i>Inx_Api_Mailing_XsltContentHandler</i>) provide special functionality like applying
10
- * styles to a mailing (used by templates).
11
- * <p>
12
- * There are no requirements common for all content handlers, thus content handlers are free to provide only the
13
- * methods needed for the current content type.
14
- *
15
- * @see Inx_Api_Mailing_Mailing::getContentHandler()
16
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
17
- * @package Inxmail
18
- * @subpackage Mailing
19
- */
20
- interface Inx_Api_Mailing_ContentHandler
21
- {
22
-
23
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mailing
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Mailing_ContentHandler</i> interface identifies content handlers.
8
+ * Content handlers are used to store and update the content of a mailing in a specific format.
9
+ * Some content handlers (like <i>Inx_Api_Mailing_XsltContentHandler</i>) provide special functionality like applying
10
+ * styles to a mailing (used by templates).
11
+ * <p>
12
+ * There are no requirements common for all content handlers, thus content handlers are free to provide only the
13
+ * methods needed for the current content type.
14
+ *
15
+ * @see Inx_Api_Mailing_Mailing::getContentHandler()
16
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
17
+ * @package Inxmail
18
+ * @subpackage Mailing
19
+ */
20
+ interface Inx_Api_Mailing_ContentHandler
21
+ {
22
+
23
+ }
lib/Inx/Api/Mailing/HtmlTextContentHandler.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mailing
5
- */
6
- /**
7
- * The <i>Inx_Api_Mailing_HtmlTextContentHandler</i> is a simple content handler used to store and update mailing
8
- * content in HTML format.
9
- * This content handler can only handle HTML content.
10
- * If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_MultiPartContentHandler</i> instead.
11
- *
12
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
- * @package Inxmail
14
- * @subpackage Mailing
15
- */
16
- interface Inx_Api_Mailing_HtmlTextContentHandler extends Inx_Api_Mailing_SinglePartContentHandler
17
- {
18
-
19
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mailing
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Mailing_HtmlTextContentHandler</i> is a simple content handler used to store and update mailing
8
+ * content in HTML format.
9
+ * This content handler can only handle HTML content.
10
+ * If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_MultiPartContentHandler</i> instead.
11
+ *
12
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
+ * @package Inxmail
14
+ * @subpackage Mailing
15
+ */
16
+ interface Inx_Api_Mailing_HtmlTextContentHandler extends Inx_Api_Mailing_SinglePartContentHandler
17
+ {
18
+
19
+ }
lib/Inx/Api/Mailing/Mailing.php CHANGED
@@ -1,689 +1,689 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mailing
5
- */
6
-
7
- /**
8
- * An <i>Inx_Api_Mailing_Mailing</i> object represents a mailing in inxmail.
9
- * An <i>Inx_Api_Mailing_Mailing</i> object can be used to perform various tasks:
10
- * <ul>
11
- * <li>Retrieve and update mailing meta information and content
12
- * <li>Send the mailing (immediately or scheduled)
13
- * <li>Stop sending the mailing
14
- * <li>Request the approval of a mailing
15
- * <li>Approve or revoke the approval for the mailing
16
- * </ul>
17
- * <strong>Handling mailing content</strong>
18
- * <p>
19
- * Content is put into mailings using content handlers. There are a number of such handlers:
20
- * <ul>
21
- * <li><i>Inx_Api_Mailing_PlainTextContentHandler</i> - Handles plain text content. This is the default content handler.
22
- * <li><i>Inx_Api_Mailing_HtmlTextContentHandler</i> - Handles HTML-only content.
23
- * <li><i>Inx_Api_Mailing_MultiPartContentHandler</i> - Handles multipart content (HTML and plain text), or mailings
24
- * where the content type is selected depending on the recipient profile.
25
- * <li><i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> - Handles multipart content defined by XML/XSLT, or mailings
26
- * where the content type is selected depending on the recipient profile. Used by templates.
27
- * <li><i>Inx_Api_Mailing_XsltPlainTextContentHandler</i> - Handles plain text defined by XML/XSLT. Used by templates.
28
- * <li><i>Inx_Api_Mailing_XsltHtmlTextContentHandler</i> - Handles HTML text content defined by XML/XSLT. Used by templates.
29
- * </ul>
30
- * <p>
31
- * All of these handlers offer methods to edit the content of the mailing.
32
- * The following snippet changes the content of a plain text mailing:
33
- *
34
- * <pre>
35
- * $oMailing->setContentHandler( 'Inx_Api_Mailing_PlainTextContentHandler' );
36
- * $oContentHandler = $oMailing->getContentHandler();
37
- * $oContentHandler->updateContent( "...any mailing content..." );
38
- * $oMailing->commitUpdate();
39
- * </pre>
40
- *
41
- * <strong>Approval and controlling dispatch</strong>
42
- * <p>
43
- * The following methods can be used for the approval of mailings:
44
- * <ul>
45
- * <li><i>approve($iApproverId, $sComment)</i>: approves the mailing using the given approver.
46
- * <li><i>denyApprove($iApproverId, $sComment)</i>: denies the approval of the mailing using the given approver.
47
- * <li><i>revokeApproval($sComment)</i>: revokes the approval of the mailing using the given approver.
48
- * <li><i>requestIdenticalApproval($sDeadline, $aApprovers, $aRecipients, $bIsTestRecipient, $sLocale)</i>: requests
49
- * the approval of the mailing using the given equitable approvers.
50
- * <li><i>requestEscalationApproval($sEscalation, $sDeadline, $aApprovers, $aRecipients, $bIsTestRecipient, $sLocale)</i>:
51
- * requests the approval of the mailing using the given hierarchical approvers.
52
- * </ul>
53
- * As listed above, there are two methods for requesting the approval of a mailing:
54
- * <i>requestIdenticalApproval(...)</i> and <i>requestEscalationApproval(...)</i>.
55
- * Both methods require two approvers but involve them differently.<br>
56
- * The identical approval process sends the request to both approvers simultaneously and requires only one of the
57
- * approvers to approve the mailing.
58
- * The escalation approval process at first sends the request only to the first approver.
59
- * If the escalation date expires without the first approver having approved the mailing, the request is sent to the
60
- * second approver.<br>
61
- * If the deadline date expires without any of the approvers having approved the mailing, the request will be cancelled.
62
- * In order to approve it, the mailing creator will have to request the approval again.
63
- * <p>
64
- * Note: The methods for approving a mailing are functional since Inxmail 3.8.1.
65
- * <p>
66
- * The Following methods can be used to send mailings:
67
- * <ul>
68
- * <li><i>startSending()</i>: starts the normal sending process.
69
- * <li><i>sendSingleMail($iRecipientId)</i>: send the mailing only to the specified recipient.
70
- * <li><i>sendTestMail($sTestAddress, $iRecipientId)</i>: send the mailing to the specified address, personalized for the
71
- * given recipient.
72
- * <li><i>sendTestMailWithTestprofile($sTestAddress, $iTestRecipientId)</i>: send the mailing to the specified address,
73
- * personalized for the given test profile.
74
- * </ul>
75
- * <p>
76
- * To schedule a mailing instead of sending it immediately, use the <i>scheduleMailing($sScheduleTime)</i> method.
77
- * The following snippet shows how to schedule a mailing to be sent in one hour:
78
- *
79
- * <pre>
80
- * $oMailing->scheduleMailing( date( 'c', strtotime("+1 hour") ) );
81
- * </pre>
82
- * <p>
83
- * The following snippet shows how to revoke the scheduled sending of a mailing:
84
- *
85
- * <pre>
86
- * mailing->unscheduleMailing();
87
- * </pre>
88
- * <p>
89
- * <strong>Note:</strong> For existing mailings, always call <code>lock()</code> before updating it, and
90
- * <code>unlock()</code> after committing changes!
91
- * <p>
92
- * For an example on how to retrieve and create mailings, see the <i>Inx_Api_Mailing_MailingManager</i> documentation.
93
- * <p>
94
- * For more information on the creation of <i>Inx_Api_Approval_Approver</i>s, see the
95
- * <i>Inx_Api_Approval_ApproverManager</i> documentation.
96
- *
97
- * @see Inx_Api_Mailing_MailingManager
98
- * @see Inx_Api_Mailing_ContentHandler
99
- * @see Inx_Api_Approval_ApproverManager
100
- * @since API 1.0
101
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
102
- * @package Inxmail
103
- * @subpackage Mailing
104
- */
105
- interface Inx_Api_Mailing_Mailing extends Inx_Api_BusinessObject
106
- {
107
-
108
- const ATTRIBUTE_SUBJECT = 3;
109
-
110
- const ATTRIBUTE_PLAIN_TEXT = 4;
111
-
112
- const ATTRIBUTE_HTML_TEXT = 5;
113
-
114
- const ATTRIBUTE_XML_CONTENT = 6;
115
-
116
- const ATTRIBUTE_PLAIN_TEXT_XSL = 7;
117
-
118
- const ATTRIBUTE_HTML_TEXT_XSL = 8;
119
-
120
- const ATTRIBUTE_FILTER_ID = 9;
121
-
122
- const ATTRIBUTE_SENDER_ADDRESS = 10;
123
-
124
- const ATTRIBUTE_RECIPIENT_ADDRESS = 11;
125
-
126
- const ATTRIBUTE_REPLY_TO_ADDRESS = 12;
127
-
128
- const ATTRIBUTE_PRIORITY = 13;
129
-
130
- const ATTRIBUTE_SCHEDULE_DATETIME = 14;
131
-
132
- const ATTRIBUTE_MODIFICATION_DATETIME = 15;
133
-
134
- const ATTRIBUTE_STYLE = 16;
135
-
136
- const ATTRIBUTE_SENT_START_DATETIME = 17;
137
-
138
- const ATTRIBUTE_SENT_END_DATETIME = 18;
139
-
140
- const ATTRIBUTE_NAME = 19;
141
-
142
- const STATE_DRAFT = 1;
143
-
144
- const STATE_TO_BE_APPROVE = 2;
145
-
146
- const STATE_APPROVED = 4;
147
-
148
- const STATE_SCHEDULED = 8;
149
-
150
- const STATE_SENDING = 16;
151
-
152
- const STATE_INTERRUPTED = 32;
153
-
154
- const STATE_SENT = 64;
155
-
156
- const STATE_SENDING_FAILED = 128;
157
-
158
-
159
- /**
160
- * @since API 1.6.0
161
- */
162
- const FILTER_AND = 1;
163
-
164
- /**
165
- * @since API 1.6.0
166
- */
167
- const FILTER_OR = 2;
168
-
169
- /**
170
- * @since API 1.6.0
171
- */
172
- const FILTER_NOT_IN = 3;
173
-
174
-
175
-
176
- /**
177
- * Sending this mailing to the test address. Using the specified recipient
178
- * to generating the email content.
179
- *
180
- * @param string $sTestAddresss the email address
181
- * @param int $iRecipientId the recipient to generating the email content
182
- * @throws Inx_Api_Mailing_SendException
183
- * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
184
- * @throws Inx_Api_DataException if this mailing is not found on the server
185
- */
186
- public function sendTestMail( $sTestAddress, $iRecipientId );
187
-
188
- /**
189
- * Sending this mailing to the test address. Using the specified recipient
190
- * to generating the email content.
191
- *
192
- * @param string $sTestAddresss the email address
193
- * @param int $iTestprofileId the recipient to generating the email content
194
- * @throws Inx_Api_Mailing_SendException
195
- * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
196
- * @throws Inx_Api_DataException if this mailing is not found on the server
197
- * @since API 1.6.1
198
- */
199
- public function sendTestMailWithTestprofile( $sTestAddress, $iTestprofileId );
200
-
201
-
202
- /**
203
- * Sending this mailing to the specified recipient. Using the recipient
204
- * to generating the email content.
205
- *
206
- * @param int $iRecipientId the recipient to generating the email content
207
- * @return the updated mailing
208
- * @throws Inx_Api_Mailing_SendException
209
- * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
210
- * @throws Inx_Api_DataException if this mailing is not found on the server
211
- */
212
- public function sendSingleMail( $iRecipientId );
213
-
214
-
215
- /**
216
- * Start or restart the sending of this mailing.
217
- *
218
- * Allowed mailing states are:
219
- * <ul>
220
- * <li>Inx_Api_Mailing_Mailing::STATE_APPROVED ( -> STATE_SENDING )
221
- * <li>Inx_Api_Mailing_Mailing::STATE_IInx_Api_Mailing_Mailing::ED ( -> STATE_SENDING )
222
- * </ul>
223
- *
224
- * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
225
- * @throws Inx_Api_DataException if this mailing is not found on the server
226
- */
227
- public function startSending();
228
-
229
-
230
- /**
231
- * Stop the sending of the specified mailing.
232
- *
233
- * Allowed mailing states are:
234
- * <ul>
235
- * <li>Inx_Api_Mailing_Mailing::STATE_SENDING ( -> STATE_INTERRUPTED )
236
- * </ul>
237
- *
238
- * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
239
- * @throws Inx_Api_DataException if this mailing is not found on the server
240
- */
241
- public function stopSending();
242
-
243
-
244
- /**
245
- * Approve this mailing for sending.
246
- * <p>
247
- * Allowed mailing states are:
248
- * <ul>
249
- * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE ( -> STATE_APPROVED or STATE_STATE_SCHEDULED )
250
- * </ul>
251
- *
252
- * @param approverId id of the approver
253
- * @param comment message of the approver
254
- * @throws MailingStateException if this mailing has a illegal state
255
- * @throws DataException if this mailing is not found on the server
256
- * @throws UpdateException if the request goes wrong, for example approval not active
257
- */
258
- public function approve( $iApproverId = 0, $sComment = null );
259
-
260
-
261
- /**
262
- * Deny approval of this mailing.
263
- * <p>
264
- * Allowed mailing states are:
265
- * <ul>
266
- * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE ( -> STATE_DRAFT )
267
- * </ul>
268
- *
269
- * @param approverId id of the approver
270
- * @param comment message of the approver
271
- * @throws MailingStateException if this mailing has a illegal state
272
- * @throws DataException if this mailing is not found on the server
273
- * @throws UpdateException if the request goes wrong, for example approval not active
274
- */
275
- public function denyApprove( $iApproverId, $sComment );
276
-
277
-
278
-
279
- /**
280
- * Request the approval for this mailing.
281
- *
282
- * Allowed mailing states are:
283
- * <ul>
284
- * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_TO_BE_APPROVE )
285
- * </ul>
286
- * @deprecated
287
- * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
288
- * @throws Inx_Api_DataException if this mailing is not found on the server
289
- */
290
- public function requestApproval();
291
-
292
- /**
293
- * Request the escalating approval for this mailing.
294
- * <p>
295
- * Allowed mailing states are:
296
- * <ul>
297
- * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_TO_BE_APPROVE )
298
- * </ul>
299
- *
300
- * @throws MailingStateException if this mailing has a illegal state
301
- * @throws DataException if this mailing is not found on the server
302
- * @throws UpdateException if the request goes wrong, for example approval not active
303
- */
304
- public function requestEscalationApproval( $oEscalationDate, $oDeadline, $approverIds, $recipientIds,
305
- $bIsTestRecipient, $sLocale );
306
-
307
-
308
- /**
309
- * Request the escalating approval for this mailing.
310
- * <p>
311
- * Allowed mailing states are:
312
- * <ul>
313
- * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_TO_BE_APPROVE )
314
- * </ul>
315
- *
316
- * @throws MailingStateException if this mailing has a illegal state
317
- * @throws DataException if this mailing is not found on the server
318
- * @throws UpdateException if the request goes wrong, for example approval not active
319
- */
320
- public function requestIdenticalApproval( $oDeadline, $approverIds, $recipientIds, $bIsTestRecipient,
321
- $sLocale );
322
-
323
-
324
-
325
- /**
326
- * Revoke the approval or scheduling for this mailing.
327
- * <p>
328
- * Allowed mailing states are:
329
- * <ul>
330
- * <li>Inx_Api_Mailing_Mailing::STATE_APPROVED ( -> STATE_DRAFT )
331
- * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE ( -> STATE_DRAFT )
332
- * <li>Inx_Api_Mailing_Mailing::STATE_SCHEDULED ( -> STATE_DRAFT )
333
- * </ul>
334
- *
335
- * @param comment reason why revoke is called
336
- * @throws MailingStateException if this mailing has a illegal state
337
- * @throws DataException if this mailing is not found on the server
338
- * @throws UpdateException if the request goes wrong, for example approval not active
339
- */
340
- public function revokeApproval( $sComment = null );
341
-
342
-
343
- /**
344
- * Schedules the mailing with the given date.
345
- * <p>
346
- * Allowed mailing states are:
347
- * <ul>
348
- * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_SHEDULED ) if no approval is active
349
- * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_DRAFT ) if approval is active
350
- * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVED ( -> STATE_TO_BE_APPROVED )
351
- * <li>Inx_Api_Mailing_Mailing::STATE_APPROVED ( -> STATE_SHEDULED )
352
- * <li>Inx_Api_Mailing_Mailing::STATE_INTERRUPTED ( -> STATE_SHEDULED )
353
- * </ul>
354
- *
355
- * @param scheduleTime new schedule time of the mailing
356
- * @throws MailingStateException if this mailing has a illegal state
357
- * @throws DataException if this mailing is not found on the server
358
- */
359
- public function scheduleMailing( $oScheduleTime = null ) ;
360
-
361
-
362
- /**
363
- * Unschedules the mailing.
364
- * <p>
365
- * Allowed mailing states are:
366
- * <ul>
367
- * <li>Inx_Api_Mailing_Mailing::STATE_SHEDULED( -> STATE_APPROVED or STATE_DRAFT )
368
- * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_DRAFT )
369
- * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVED ( -> STATE_TO_BE_APPROVED )
370
- * </ul>
371
- *
372
- * @throws MailingStateException if this mailing has a illegal state
373
- * @throws DataException if this mailing is not found on the server
374
- */
375
- public function unscheduleMailing();
376
-
377
- /**
378
- * Lock the this <i>Inx_Api_Mailing_Mailing</i>. For existing mailings, always
379
- * call <i>lock()</i> before updating it, and <i>unlock()</i>
380
- * after committing changes!
381
- *
382
- * @throws Inx_Api_LockException if this mailing already locked
383
- * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
384
- * @throws Inx_Api_DataException if this mailing is not found on the server
385
- */
386
- public function lock();
387
-
388
-
389
- /**
390
- * Release the lock of this <i>Inx_Api_Mailing_Mailing</i>.
391
- *
392
- * @param boolean forceForeignLock <i>true</i> - release foreign and own locks,
393
- * <i>false</i> - release only own locks
394
- * @return boolean <i>true</i> if this mailing was unlocked, <i>false</i> otherwise
395
- * @throws Inx_Api_DataException
396
- */
397
- public function unlock( $blForceForeignLock = false );
398
-
399
-
400
- /**
401
- * Returns the mailing state.
402
- *
403
- * @return int the mailing state
404
- */
405
- public function getState();
406
-
407
-
408
- /**
409
- * Checks if this mailing has a lock.
410
- *
411
- * @return boolean true if this mailing has a lock, otherwise false
412
- */
413
- public function isLocked();
414
-
415
-
416
- /**
417
- * Returns the lock ticket.
418
- *
419
- * @return Inx_Api_LockTicket the lock ticket
420
- */
421
- public function getLockTicket();
422
-
423
-
424
- /**
425
- * Returns the last modification datetime.
426
- *
427
- * @return string the last modification datetime
428
- */
429
- public function getModificationDatetime();
430
-
431
-
432
- /**
433
- * Returns the schedule datetime.
434
- *
435
- * @return string the schedule datetime, can be null
436
- */
437
- public function getScheduleDatetime();
438
-
439
-
440
- /**
441
- * Sets the schedule datetime.
442
- *
443
- * @param string $dtScheduleDatetime the schedule datetime, or null
444
- */
445
- public function updateScheduleDatetime( $dtScheduleDatetime );
446
-
447
-
448
- /**
449
- * Returns the sent datetime, null if this mailing not yet sent.
450
- *
451
- * @return string the sent datetime, or null
452
- */
453
- public function getSentDatetime();
454
-
455
-
456
- /**
457
- * Returns the approval escalation datetime of this mailing if the mailing is in the state
458
- * <i>STATE_TO_BE_APPROVE</i> and the approval process is escalating.
459
- * If the mailing state is not <i>STATE_TO_BE_APPROVE</i> or the approval process is identical,
460
- * <i>null</i> may be returned.
461
- * The date will be returned as ISO 8601 formatted datetime string.
462
- *
463
- * @see requestEscalationApproval( $oEscalationDate, $oDeadline, $approverIds, $recipientIds, $bIsTestRecipient, $sLocale )
464
- * @return string the approval escalation datetime, or <i>null</i>.
465
- * @since API 1.9.0
466
- */
467
- public function getEscalationDatetime();
468
-
469
-
470
- /**
471
- * Returns the approval deadline datetime of this mailing if the mailing is in the state <i>STATE_TO_BE_APPROVE</i>.
472
- * If the mailing state is not <i>STATE_TO_BE_APPROVE</i>, <i>null</i> may be returned.
473
- * The date will be returned as ISO 8601 formatted datetime string.
474
- *
475
- * @see requestIdenticalApproval( $oDeadline, $approverIds, $recipientIds, $bIsTestRecipient, $sLocale );
476
- * @see requestEscalationApproval( $oEscalationDate, $oDeadline, $approverIds, $recipientIds, $bIsTestRecipient, $sLocale )
477
- * @return string the approval deadline datetime, or <i>null</i>.
478
- * @since API 1.9.0
479
- */
480
- public function getDeadlineDatetime();
481
-
482
-
483
- /**
484
- * Returns the id of list context which this mailing belongs to.
485
- *
486
- * @return int the id of list context which this mailing belongs to
487
- */
488
- public function getListContextId();
489
-
490
-
491
- /**
492
- * Returns the sender address of this mailing.
493
- *
494
- * @return String the sender address of this mailing
495
- */
496
- public function getSenderAddress();
497
-
498
-
499
- /**
500
- * Sets the sender address of this mailing.
501
- *
502
- * @param string $sSenderAddress the sender address of this mailing
503
- */
504
- public function updateSenderAddress( $sSenderAddress );
505
-
506
-
507
- /**
508
- * Returns the recipient address of this mailing.
509
- *
510
- * @return String the recipient address of this mailing
511
- */
512
- public function getRecipientAddress();
513
-
514
-
515
- /**
516
- * Sets the recipient address of this mailing.
517
- *
518
- * @param string $sRecipientAddress the recipient address of this mailing
519
- */
520
- public function updateRecipientAddress( $sRecipientAddress );
521
-
522
-
523
- /**
524
- * Returns the recipient address of this mailing.
525
- *
526
- * @return string the recipient address of this mailing
527
- */
528
- public function getReplyToAddress();
529
-
530
-
531
- /**
532
- * Sets the replyTo address of this mailing.
533
- *
534
- * @param string $sReplyToAddress the replyTo address of this mailing
535
- */
536
- public function updateReplyToAddress( $sReplyToAddress );
537
-
538
-
539
- /**
540
- * Returns a sending filter of this mailing.
541
- *
542
- * @return int the filter id, 0 means that no filter is set
543
- * @since API 1.1.0
544
- */
545
- public function getFilterId();
546
-
547
-
548
- /**
549
- * Sets a sending filter of this mailing.
550
- *
551
- * @param int $iFilterId the filter id, 0 means that no filter is set
552
- * @see com.inxmail.xpro.api.filter.Filter#getId()
553
- * @since API 1.1.0
554
- */
555
- public function updateFilterId( $iFilterId );
556
-
557
- /**
558
- * Returns the sending filter of this mailing.
559
- *
560
- * @return the filter id, null means that no filter is set
561
- * @since API 1.6.0
562
- */
563
- public function getFilterIds();
564
-
565
-
566
- /**
567
- * Returns the sending filter concatenation type of this mailing.
568
- *
569
- * @return <code>FILTER_AND</code> or <code>FILTER_OR</code> or <code>FILTER_NOT_IN</code> or 0 if it is not set
570
- * @since API 1.6.0
571
- */
572
- public function getFilterConcatinationType();
573
-
574
-
575
- /**
576
- * Sets a couple of sending filter to this mailing.
577
- *
578
- * @param filterIds array of the filter ids, null for no filter is set
579
- * @param concatinationType sets how the filter should be concatinated, <code>FILTER_AND</code>,
580
- * <code>FILTER_OR</code>, <code>FILTER_NOT_IN</code>
581
- * @since API 1.6.0
582
- */
583
- public function updateFilterIds( $filterIds, $iConcatinationType );
584
-
585
-
586
- /**
587
- * Returns the value of X-Priority header. Allowed values are:
588
- * <ul>
589
- * <li><tt>null</tt> - not specified, the X-Priority header will not be set
590
- * <li>5 - lowest priority
591
- * <li>4 - low priority
592
- * <li>3 - normal priority
593
- * <li>2 - high priority
594
- * <li>1 - highest priority
595
- * </ul>
596
- *
597
- * @return Integer the value of X-Priority header, or <tt>null</tt>
598
- */
599
- public function getPriority();
600
-
601
-
602
- /**
603
- * Sets the value of X-Priority header. Allowed values are:
604
- * <ul>
605
- * <li><tt>null</tt> - not specified, the X-Priority header will not be set
606
- * <li>5 - lowest priority
607
- * <li>4 - low priority
608
- * <li>3 - normal priority
609
- * <li>2 - high priority
610
- * <li>1 - highest priority
611
- * </ul>
612
- *
613
- * @param Integer $iPriority the value of X-Priority header, or <tt>null</tt>
614
- */
615
- public function updatePriority( $iPriority );
616
-
617
-
618
- /**
619
- * Returns the subject of this mailing.
620
- *
621
- * @return String the subject of this mailing
622
- */
623
- public function getSubject();
624
-
625
-
626
- /**
627
- * Sets the subject of this mailing.
628
- *
629
- * @param String subject the subject of this mailing
630
- */
631
- public function updateSubject( $sSubject );
632
-
633
- /**
634
- * Returns the name of this mailing.
635
- *
636
- * @return String the name of this mailing
637
- */
638
- public function getName();
639
-
640
-
641
- /**
642
- * Sets the name of this mailing.
643
- *
644
- * @param String name the name of this mailing
645
- */
646
- public function updateName( $sName );
647
-
648
-
649
-
650
- /**
651
- * Returns the content handler, which contains the format-specific mail content.
652
- *
653
- * @return Inx_Api_Mailing_ContentHandler the content handler
654
- */
655
- public function getContentHandler();
656
-
657
-
658
- /**
659
- * Creates a new content handler. Allowed classes are:
660
- * <ul>
661
- * <li><i>PlainTextContentHandler</i>
662
- * <li><i>HtmlTextContentHandler</i>
663
- * <li><i>MultiPartContentHandler</i>
664
- * <li><i>XsltMultiPartContentHandler</i>
665
- * <li><i>XsltHtmlTextContentHandler</i>
666
- * <li><i>XsltPlainTextContentHandler</i>
667
- * </ul>
668
- *
669
- * @param string $oContentHandlerClazz the <i>Class</i> of the content handler
670
- */
671
- public function setContentHandler( $oContentHandlerClazz );
672
-
673
-
674
- /**
675
- * Returns the mailing info object which contains the number sent mails.
676
- *
677
- * @return the mailing info object
678
- * @throws Inx_Api_DataException
679
- */
680
- public function getSendingInfo();
681
-
682
- /**
683
- * Returns the create date of the mailing
684
- *
685
- * @return the creation date
686
- * @since 1.7.1
687
- */
688
- public function getCreationDatetime();
689
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mailing
5
+ */
6
+
7
+ /**
8
+ * An <i>Inx_Api_Mailing_Mailing</i> object represents a mailing in inxmail.
9
+ * An <i>Inx_Api_Mailing_Mailing</i> object can be used to perform various tasks:
10
+ * <ul>
11
+ * <li>Retrieve and update mailing meta information and content
12
+ * <li>Send the mailing (immediately or scheduled)
13
+ * <li>Stop sending the mailing
14
+ * <li>Request the approval of a mailing
15
+ * <li>Approve or revoke the approval for the mailing
16
+ * </ul>
17
+ * <strong>Handling mailing content</strong>
18
+ * <p>
19
+ * Content is put into mailings using content handlers. There are a number of such handlers:
20
+ * <ul>
21
+ * <li><i>Inx_Api_Mailing_PlainTextContentHandler</i> - Handles plain text content. This is the default content handler.
22
+ * <li><i>Inx_Api_Mailing_HtmlTextContentHandler</i> - Handles HTML-only content.
23
+ * <li><i>Inx_Api_Mailing_MultiPartContentHandler</i> - Handles multipart content (HTML and plain text), or mailings
24
+ * where the content type is selected depending on the recipient profile.
25
+ * <li><i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> - Handles multipart content defined by XML/XSLT, or mailings
26
+ * where the content type is selected depending on the recipient profile. Used by templates.
27
+ * <li><i>Inx_Api_Mailing_XsltPlainTextContentHandler</i> - Handles plain text defined by XML/XSLT. Used by templates.
28
+ * <li><i>Inx_Api_Mailing_XsltHtmlTextContentHandler</i> - Handles HTML text content defined by XML/XSLT. Used by templates.
29
+ * </ul>
30
+ * <p>
31
+ * All of these handlers offer methods to edit the content of the mailing.
32
+ * The following snippet changes the content of a plain text mailing:
33
+ *
34
+ * <pre>
35
+ * $oMailing->setContentHandler( 'Inx_Api_Mailing_PlainTextContentHandler' );
36
+ * $oContentHandler = $oMailing->getContentHandler();
37
+ * $oContentHandler->updateContent( "...any mailing content..." );
38
+ * $oMailing->commitUpdate();
39
+ * </pre>
40
+ *
41
+ * <strong>Approval and controlling dispatch</strong>
42
+ * <p>
43
+ * The following methods can be used for the approval of mailings:
44
+ * <ul>
45
+ * <li><i>approve($iApproverId, $sComment)</i>: approves the mailing using the given approver.
46
+ * <li><i>denyApprove($iApproverId, $sComment)</i>: denies the approval of the mailing using the given approver.
47
+ * <li><i>revokeApproval($sComment)</i>: revokes the approval of the mailing using the given approver.
48
+ * <li><i>requestIdenticalApproval($sDeadline, $aApprovers, $aRecipients, $bIsTestRecipient, $sLocale)</i>: requests
49
+ * the approval of the mailing using the given equitable approvers.
50
+ * <li><i>requestEscalationApproval($sEscalation, $sDeadline, $aApprovers, $aRecipients, $bIsTestRecipient, $sLocale)</i>:
51
+ * requests the approval of the mailing using the given hierarchical approvers.
52
+ * </ul>
53
+ * As listed above, there are two methods for requesting the approval of a mailing:
54
+ * <i>requestIdenticalApproval(...)</i> and <i>requestEscalationApproval(...)</i>.
55
+ * Both methods require two approvers but involve them differently.<br>
56
+ * The identical approval process sends the request to both approvers simultaneously and requires only one of the
57
+ * approvers to approve the mailing.
58
+ * The escalation approval process at first sends the request only to the first approver.
59
+ * If the escalation date expires without the first approver having approved the mailing, the request is sent to the
60
+ * second approver.<br>
61
+ * If the deadline date expires without any of the approvers having approved the mailing, the request will be cancelled.
62
+ * In order to approve it, the mailing creator will have to request the approval again.
63
+ * <p>
64
+ * Note: The methods for approving a mailing are functional since Inxmail 3.8.1.
65
+ * <p>
66
+ * The Following methods can be used to send mailings:
67
+ * <ul>
68
+ * <li><i>startSending()</i>: starts the normal sending process.
69
+ * <li><i>sendSingleMail($iRecipientId)</i>: send the mailing only to the specified recipient.
70
+ * <li><i>sendTestMail($sTestAddress, $iRecipientId)</i>: send the mailing to the specified address, personalized for the
71
+ * given recipient.
72
+ * <li><i>sendTestMailWithTestprofile($sTestAddress, $iTestRecipientId)</i>: send the mailing to the specified address,
73
+ * personalized for the given test profile.
74
+ * </ul>
75
+ * <p>
76
+ * To schedule a mailing instead of sending it immediately, use the <i>scheduleMailing($sScheduleTime)</i> method.
77
+ * The following snippet shows how to schedule a mailing to be sent in one hour:
78
+ *
79
+ * <pre>
80
+ * $oMailing->scheduleMailing( date( 'c', strtotime("+1 hour") ) );
81
+ * </pre>
82
+ * <p>
83
+ * The following snippet shows how to revoke the scheduled sending of a mailing:
84
+ *
85
+ * <pre>
86
+ * mailing->unscheduleMailing();
87
+ * </pre>
88
+ * <p>
89
+ * <strong>Note:</strong> For existing mailings, always call <code>lock()</code> before updating it, and
90
+ * <code>unlock()</code> after committing changes!
91
+ * <p>
92
+ * For an example on how to retrieve and create mailings, see the <i>Inx_Api_Mailing_MailingManager</i> documentation.
93
+ * <p>
94
+ * For more information on the creation of <i>Inx_Api_Approval_Approver</i>s, see the
95
+ * <i>Inx_Api_Approval_ApproverManager</i> documentation.
96
+ *
97
+ * @see Inx_Api_Mailing_MailingManager
98
+ * @see Inx_Api_Mailing_ContentHandler
99
+ * @see Inx_Api_Approval_ApproverManager
100
+ * @since API 1.0
101
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
102
+ * @package Inxmail
103
+ * @subpackage Mailing
104
+ */
105
+ interface Inx_Api_Mailing_Mailing extends Inx_Api_BusinessObject
106
+ {
107
+
108
+ const ATTRIBUTE_SUBJECT = 3;
109
+
110
+ const ATTRIBUTE_PLAIN_TEXT = 4;
111
+
112
+ const ATTRIBUTE_HTML_TEXT = 5;
113
+
114
+ const ATTRIBUTE_XML_CONTENT = 6;
115
+
116
+ const ATTRIBUTE_PLAIN_TEXT_XSL = 7;
117
+
118
+ const ATTRIBUTE_HTML_TEXT_XSL = 8;
119
+
120
+ const ATTRIBUTE_FILTER_ID = 9;
121
+
122
+ const ATTRIBUTE_SENDER_ADDRESS = 10;
123
+
124
+ const ATTRIBUTE_RECIPIENT_ADDRESS = 11;
125
+
126
+ const ATTRIBUTE_REPLY_TO_ADDRESS = 12;
127
+
128
+ const ATTRIBUTE_PRIORITY = 13;
129
+
130
+ const ATTRIBUTE_SCHEDULE_DATETIME = 14;
131
+
132
+ const ATTRIBUTE_MODIFICATION_DATETIME = 15;
133
+
134
+ const ATTRIBUTE_STYLE = 16;
135
+
136
+ const ATTRIBUTE_SENT_START_DATETIME = 17;
137
+
138
+ const ATTRIBUTE_SENT_END_DATETIME = 18;
139
+
140
+ const ATTRIBUTE_NAME = 19;
141
+
142
+ const STATE_DRAFT = 1;
143
+
144
+ const STATE_TO_BE_APPROVE = 2;
145
+
146
+ const STATE_APPROVED = 4;
147
+
148
+ const STATE_SCHEDULED = 8;
149
+
150
+ const STATE_SENDING = 16;
151
+
152
+ const STATE_INTERRUPTED = 32;
153
+
154
+ const STATE_SENT = 64;
155
+
156
+ const STATE_SENDING_FAILED = 128;
157
+
158
+
159
+ /**
160
+ * @since API 1.6.0
161
+ */
162
+ const FILTER_AND = 1;
163
+
164
+ /**
165
+ * @since API 1.6.0
166
+ */
167
+ const FILTER_OR = 2;
168
+
169
+ /**
170
+ * @since API 1.6.0
171
+ */
172
+ const FILTER_NOT_IN = 3;
173
+
174
+
175
+
176
+ /**
177
+ * Sending this mailing to the test address. Using the specified recipient
178
+ * to generating the email content.
179
+ *
180
+ * @param string $sTestAddresss the email address
181
+ * @param int $iRecipientId the recipient to generating the email content
182
+ * @throws Inx_Api_Mailing_SendException
183
+ * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
184
+ * @throws Inx_Api_DataException if this mailing is not found on the server
185
+ */
186
+ public function sendTestMail( $sTestAddress, $iRecipientId );
187
+
188
+ /**
189
+ * Sending this mailing to the test address. Using the specified recipient
190
+ * to generating the email content.
191
+ *
192
+ * @param string $sTestAddresss the email address
193
+ * @param int $iTestprofileId the recipient to generating the email content
194
+ * @throws Inx_Api_Mailing_SendException
195
+ * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
196
+ * @throws Inx_Api_DataException if this mailing is not found on the server
197
+ * @since API 1.6.1
198
+ */
199
+ public function sendTestMailWithTestprofile( $sTestAddress, $iTestprofileId );
200
+
201
+
202
+ /**
203
+ * Sending this mailing to the specified recipient. Using the recipient
204
+ * to generating the email content.
205
+ *
206
+ * @param int $iRecipientId the recipient to generating the email content
207
+ * @return the updated mailing
208
+ * @throws Inx_Api_Mailing_SendException
209
+ * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
210
+ * @throws Inx_Api_DataException if this mailing is not found on the server
211
+ */
212
+ public function sendSingleMail( $iRecipientId );
213
+
214
+
215
+ /**
216
+ * Start or restart the sending of this mailing.
217
+ *
218
+ * Allowed mailing states are:
219
+ * <ul>
220
+ * <li>Inx_Api_Mailing_Mailing::STATE_APPROVED ( -> STATE_SENDING )
221
+ * <li>Inx_Api_Mailing_Mailing::STATE_IInx_Api_Mailing_Mailing::ED ( -> STATE_SENDING )
222
+ * </ul>
223
+ *
224
+ * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
225
+ * @throws Inx_Api_DataException if this mailing is not found on the server
226
+ */
227
+ public function startSending();
228
+
229
+
230
+ /**
231
+ * Stop the sending of the specified mailing.
232
+ *
233
+ * Allowed mailing states are:
234
+ * <ul>
235
+ * <li>Inx_Api_Mailing_Mailing::STATE_SENDING ( -> STATE_INTERRUPTED )
236
+ * </ul>
237
+ *
238
+ * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
239
+ * @throws Inx_Api_DataException if this mailing is not found on the server
240
+ */
241
+ public function stopSending();
242
+
243
+
244
+ /**
245
+ * Approve this mailing for sending.
246
+ * <p>
247
+ * Allowed mailing states are:
248
+ * <ul>
249
+ * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE ( -> STATE_APPROVED or STATE_STATE_SCHEDULED )
250
+ * </ul>
251
+ *
252
+ * @param approverId id of the approver
253
+ * @param comment message of the approver
254
+ * @throws MailingStateException if this mailing has a illegal state
255
+ * @throws DataException if this mailing is not found on the server
256
+ * @throws UpdateException if the request goes wrong, for example approval not active
257
+ */
258
+ public function approve( $iApproverId = 0, $sComment = null );
259
+
260
+
261
+ /**
262
+ * Deny approval of this mailing.
263
+ * <p>
264
+ * Allowed mailing states are:
265
+ * <ul>
266
+ * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE ( -> STATE_DRAFT )
267
+ * </ul>
268
+ *
269
+ * @param approverId id of the approver
270
+ * @param comment message of the approver
271
+ * @throws MailingStateException if this mailing has a illegal state
272
+ * @throws DataException if this mailing is not found on the server
273
+ * @throws UpdateException if the request goes wrong, for example approval not active
274
+ */
275
+ public function denyApprove( $iApproverId, $sComment );
276
+
277
+
278
+
279
+ /**
280
+ * Request the approval for this mailing.
281
+ *
282
+ * Allowed mailing states are:
283
+ * <ul>
284
+ * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_TO_BE_APPROVE )
285
+ * </ul>
286
+ * @deprecated
287
+ * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
288
+ * @throws Inx_Api_DataException if this mailing is not found on the server
289
+ */
290
+ public function requestApproval();
291
+
292
+ /**
293
+ * Request the escalating approval for this mailing.
294
+ * <p>
295
+ * Allowed mailing states are:
296
+ * <ul>
297
+ * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_TO_BE_APPROVE )
298
+ * </ul>
299
+ *
300
+ * @throws MailingStateException if this mailing has a illegal state
301
+ * @throws DataException if this mailing is not found on the server
302
+ * @throws UpdateException if the request goes wrong, for example approval not active
303
+ */
304
+ public function requestEscalationApproval( $oEscalationDate, $oDeadline, $approverIds, $recipientIds,
305
+ $bIsTestRecipient, $sLocale );
306
+
307
+
308
+ /**
309
+ * Request the escalating approval for this mailing.
310
+ * <p>
311
+ * Allowed mailing states are:
312
+ * <ul>
313
+ * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_TO_BE_APPROVE )
314
+ * </ul>
315
+ *
316
+ * @throws MailingStateException if this mailing has a illegal state
317
+ * @throws DataException if this mailing is not found on the server
318
+ * @throws UpdateException if the request goes wrong, for example approval not active
319
+ */
320
+ public function requestIdenticalApproval( $oDeadline, $approverIds, $recipientIds, $bIsTestRecipient,
321
+ $sLocale );
322
+
323
+
324
+
325
+ /**
326
+ * Revoke the approval or scheduling for this mailing.
327
+ * <p>
328
+ * Allowed mailing states are:
329
+ * <ul>
330
+ * <li>Inx_Api_Mailing_Mailing::STATE_APPROVED ( -> STATE_DRAFT )
331
+ * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE ( -> STATE_DRAFT )
332
+ * <li>Inx_Api_Mailing_Mailing::STATE_SCHEDULED ( -> STATE_DRAFT )
333
+ * </ul>
334
+ *
335
+ * @param comment reason why revoke is called
336
+ * @throws MailingStateException if this mailing has a illegal state
337
+ * @throws DataException if this mailing is not found on the server
338
+ * @throws UpdateException if the request goes wrong, for example approval not active
339
+ */
340
+ public function revokeApproval( $sComment = null );
341
+
342
+
343
+ /**
344
+ * Schedules the mailing with the given date.
345
+ * <p>
346
+ * Allowed mailing states are:
347
+ * <ul>
348
+ * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_SHEDULED ) if no approval is active
349
+ * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_DRAFT ) if approval is active
350
+ * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVED ( -> STATE_TO_BE_APPROVED )
351
+ * <li>Inx_Api_Mailing_Mailing::STATE_APPROVED ( -> STATE_SHEDULED )
352
+ * <li>Inx_Api_Mailing_Mailing::STATE_INTERRUPTED ( -> STATE_SHEDULED )
353
+ * </ul>
354
+ *
355
+ * @param scheduleTime new schedule time of the mailing
356
+ * @throws MailingStateException if this mailing has a illegal state
357
+ * @throws DataException if this mailing is not found on the server
358
+ */
359
+ public function scheduleMailing( $oScheduleTime = null ) ;
360
+
361
+
362
+ /**
363
+ * Unschedules the mailing.
364
+ * <p>
365
+ * Allowed mailing states are:
366
+ * <ul>
367
+ * <li>Inx_Api_Mailing_Mailing::STATE_SHEDULED( -> STATE_APPROVED or STATE_DRAFT )
368
+ * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT ( -> STATE_DRAFT )
369
+ * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVED ( -> STATE_TO_BE_APPROVED )
370
+ * </ul>
371
+ *
372
+ * @throws MailingStateException if this mailing has a illegal state
373
+ * @throws DataException if this mailing is not found on the server
374
+ */
375
+ public function unscheduleMailing();
376
+
377
+ /**
378
+ * Lock the this <i>Inx_Api_Mailing_Mailing</i>. For existing mailings, always
379
+ * call <i>lock()</i> before updating it, and <i>unlock()</i>
380
+ * after committing changes!
381
+ *
382
+ * @throws Inx_Api_LockException if this mailing already locked
383
+ * @throws Inx_Api_Mailing_MailingStateException if this mailing has a illegal state
384
+ * @throws Inx_Api_DataException if this mailing is not found on the server
385
+ */
386
+ public function lock();
387
+
388
+
389
+ /**
390
+ * Release the lock of this <i>Inx_Api_Mailing_Mailing</i>.
391
+ *
392
+ * @param boolean forceForeignLock <i>true</i> - release foreign and own locks,
393
+ * <i>false</i> - release only own locks
394
+ * @return boolean <i>true</i> if this mailing was unlocked, <i>false</i> otherwise
395
+ * @throws Inx_Api_DataException
396
+ */
397
+ public function unlock( $blForceForeignLock = false );
398
+
399
+
400
+ /**
401
+ * Returns the mailing state.
402
+ *
403
+ * @return int the mailing state
404
+ */
405
+ public function getState();
406
+
407
+
408
+ /**
409
+ * Checks if this mailing has a lock.
410
+ *
411
+ * @return boolean true if this mailing has a lock, otherwise false
412
+ */
413
+ public function isLocked();
414
+
415
+
416
+ /**
417
+ * Returns the lock ticket.
418
+ *
419
+ * @return Inx_Api_LockTicket the lock ticket
420
+ */
421
+ public function getLockTicket();
422
+
423
+
424
+ /**
425
+ * Returns the last modification datetime.
426
+ *
427
+ * @return string the last modification datetime
428
+ */
429
+ public function getModificationDatetime();
430
+
431
+
432
+ /**
433
+ * Returns the schedule datetime.
434
+ *
435
+ * @return string the schedule datetime, can be null
436
+ */
437
+ public function getScheduleDatetime();
438
+
439
+
440
+ /**
441
+ * Sets the schedule datetime.
442
+ *
443
+ * @param string $dtScheduleDatetime the schedule datetime, or null
444
+ */
445
+ public function updateScheduleDatetime( $dtScheduleDatetime );
446
+
447
+
448
+ /**
449
+ * Returns the sent datetime, null if this mailing not yet sent.
450
+ *
451
+ * @return string the sent datetime, or null
452
+ */
453
+ public function getSentDatetime();
454
+
455
+
456
+ /**
457
+ * Returns the approval escalation datetime of this mailing if the mailing is in the state
458
+ * <i>STATE_TO_BE_APPROVE</i> and the approval process is escalating.
459
+ * If the mailing state is not <i>STATE_TO_BE_APPROVE</i> or the approval process is identical,
460
+ * <i>null</i> may be returned.
461
+ * The date will be returned as ISO 8601 formatted datetime string.
462
+ *
463
+ * @see requestEscalationApproval( $oEscalationDate, $oDeadline, $approverIds, $recipientIds, $bIsTestRecipient, $sLocale )
464
+ * @return string the approval escalation datetime, or <i>null</i>.
465
+ * @since API 1.9.0
466
+ */
467
+ public function getEscalationDatetime();
468
+
469
+
470
+ /**
471
+ * Returns the approval deadline datetime of this mailing if the mailing is in the state <i>STATE_TO_BE_APPROVE</i>.
472
+ * If the mailing state is not <i>STATE_TO_BE_APPROVE</i>, <i>null</i> may be returned.
473
+ * The date will be returned as ISO 8601 formatted datetime string.
474
+ *
475
+ * @see requestIdenticalApproval( $oDeadline, $approverIds, $recipientIds, $bIsTestRecipient, $sLocale );
476
+ * @see requestEscalationApproval( $oEscalationDate, $oDeadline, $approverIds, $recipientIds, $bIsTestRecipient, $sLocale )
477
+ * @return string the approval deadline datetime, or <i>null</i>.
478
+ * @since API 1.9.0
479
+ */
480
+ public function getDeadlineDatetime();
481
+
482
+
483
+ /**
484
+ * Returns the id of list context which this mailing belongs to.
485
+ *
486
+ * @return int the id of list context which this mailing belongs to
487
+ */
488
+ public function getListContextId();
489
+
490
+
491
+ /**
492
+ * Returns the sender address of this mailing.
493
+ *
494
+ * @return String the sender address of this mailing
495
+ */
496
+ public function getSenderAddress();
497
+
498
+
499
+ /**
500
+ * Sets the sender address of this mailing.
501
+ *
502
+ * @param string $sSenderAddress the sender address of this mailing
503
+ */
504
+ public function updateSenderAddress( $sSenderAddress );
505
+
506
+
507
+ /**
508
+ * Returns the recipient address of this mailing.
509
+ *
510
+ * @return String the recipient address of this mailing
511
+ */
512
+ public function getRecipientAddress();
513
+
514
+
515
+ /**
516
+ * Sets the recipient address of this mailing.
517
+ *
518
+ * @param string $sRecipientAddress the recipient address of this mailing
519
+ */
520
+ public function updateRecipientAddress( $sRecipientAddress );
521
+
522
+
523
+ /**
524
+ * Returns the recipient address of this mailing.
525
+ *
526
+ * @return string the recipient address of this mailing
527
+ */
528
+ public function getReplyToAddress();
529
+
530
+
531
+ /**
532
+ * Sets the replyTo address of this mailing.
533
+ *
534
+ * @param string $sReplyToAddress the replyTo address of this mailing
535
+ */
536
+ public function updateReplyToAddress( $sReplyToAddress );
537
+
538
+
539
+ /**
540
+ * Returns a sending filter of this mailing.
541
+ *
542
+ * @return int the filter id, 0 means that no filter is set
543
+ * @since API 1.1.0
544
+ */
545
+ public function getFilterId();
546
+
547
+
548
+ /**
549
+ * Sets a sending filter of this mailing.
550
+ *
551
+ * @param int $iFilterId the filter id, 0 means that no filter is set
552
+ * @see com.inxmail.xpro.api.filter.Filter#getId()
553
+ * @since API 1.1.0
554
+ */
555
+ public function updateFilterId( $iFilterId );
556
+
557
+ /**
558
+ * Returns the sending filter of this mailing.
559
+ *
560
+ * @return the filter id, null means that no filter is set
561
+ * @since API 1.6.0
562
+ */
563
+ public function getFilterIds();
564
+
565
+
566
+ /**
567
+ * Returns the sending filter concatenation type of this mailing.
568
+ *
569
+ * @return <code>FILTER_AND</code> or <code>FILTER_OR</code> or <code>FILTER_NOT_IN</code> or 0 if it is not set
570
+ * @since API 1.6.0
571
+ */
572
+ public function getFilterConcatinationType();
573
+
574
+
575
+ /**
576
+ * Sets a couple of sending filter to this mailing.
577
+ *
578
+ * @param filterIds array of the filter ids, null for no filter is set
579
+ * @param concatinationType sets how the filter should be concatinated, <code>FILTER_AND</code>,
580
+ * <code>FILTER_OR</code>, <code>FILTER_NOT_IN</code>
581
+ * @since API 1.6.0
582
+ */
583
+ public function updateFilterIds( $filterIds, $iConcatinationType );
584
+
585
+
586
+ /**
587
+ * Returns the value of X-Priority header. Allowed values are:
588
+ * <ul>
589
+ * <li><tt>null</tt> - not specified, the X-Priority header will not be set
590
+ * <li>5 - lowest priority
591
+ * <li>4 - low priority
592
+ * <li>3 - normal priority
593
+ * <li>2 - high priority
594
+ * <li>1 - highest priority
595
+ * </ul>
596
+ *
597
+ * @return Integer the value of X-Priority header, or <tt>null</tt>
598
+ */
599
+ public function getPriority();
600
+
601
+
602
+ /**
603
+ * Sets the value of X-Priority header. Allowed values are:
604
+ * <ul>
605
+ * <li><tt>null</tt> - not specified, the X-Priority header will not be set
606
+ * <li>5 - lowest priority
607
+ * <li>4 - low priority
608
+ * <li>3 - normal priority
609
+ * <li>2 - high priority
610
+ * <li>1 - highest priority
611
+ * </ul>
612
+ *
613
+ * @param Integer $iPriority the value of X-Priority header, or <tt>null</tt>
614
+ */
615
+ public function updatePriority( $iPriority );
616
+
617
+
618
+ /**
619
+ * Returns the subject of this mailing.
620
+ *
621
+ * @return String the subject of this mailing
622
+ */
623
+ public function getSubject();
624
+
625
+
626
+ /**
627
+ * Sets the subject of this mailing.
628
+ *
629
+ * @param String subject the subject of this mailing
630
+ */
631
+ public function updateSubject( $sSubject );
632
+
633
+ /**
634
+ * Returns the name of this mailing.
635
+ *
636
+ * @return String the name of this mailing
637
+ */
638
+ public function getName();
639
+
640
+
641
+ /**
642
+ * Sets the name of this mailing.
643
+ *
644
+ * @param String name the name of this mailing
645
+ */
646
+ public function updateName( $sName );
647
+
648
+
649
+
650
+ /**
651
+ * Returns the content handler, which contains the format-specific mail content.
652
+ *
653
+ * @return Inx_Api_Mailing_ContentHandler the content handler
654
+ */
655
+ public function getContentHandler();
656
+
657
+
658
+ /**
659
+ * Creates a new content handler. Allowed classes are:
660
+ * <ul>
661
+ * <li><i>PlainTextContentHandler</i>
662
+ * <li><i>HtmlTextContentHandler</i>
663
+ * <li><i>MultiPartContentHandler</i>
664
+ * <li><i>XsltMultiPartContentHandler</i>
665
+ * <li><i>XsltHtmlTextContentHandler</i>
666
+ * <li><i>XsltPlainTextContentHandler</i>
667
+ * </ul>
668
+ *
669
+ * @param string $oContentHandlerClazz the <i>Class</i> of the content handler
670
+ */
671
+ public function setContentHandler( $oContentHandlerClazz );
672
+
673
+
674
+ /**
675
+ * Returns the mailing info object which contains the number sent mails.
676
+ *
677
+ * @return the mailing info object
678
+ * @throws Inx_Api_DataException
679
+ */
680
+ public function getSendingInfo();
681
+
682
+ /**
683
+ * Returns the create date of the mailing
684
+ *
685
+ * @return the creation date
686
+ * @since 1.7.1
687
+ */
688
+ public function getCreationDatetime();
689
+ }
lib/Inx/Api/Mailing/MailingConstants.php CHANGED
@@ -1,64 +1,64 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mailing
5
- */
6
- /**
7
- * MailingConstants
8
- *
9
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
10
- * @package Inxmail
11
- * @subpackage Mailing
12
- */
13
- interface Inx_Api_Mailing_MailingConstants
14
- {
15
-
16
- const MAIL_CONTENT_TYPE_PLAIN_TEXT = 100;
17
-
18
- const MAIL_CONTENT_TYPE_HTML_TEXT = 101;
19
-
20
- const MAIL_CONTENT_TYPE_MULTI_PART = 102;
21
-
22
- const MAIL_CONTENT_TYPE_XML_XSLT_MULTI_PART = 103;
23
-
24
- const MAIL_CONTENT_TYPE_XML_XSLT_PLAIN_TEXT = 104;
25
-
26
- const MAIL_CONTENT_TYPE_XML_XSLT_HTML_TEXT = 105;
27
-
28
-
29
- /**
30
- * the array index of list type of mailing bo
31
- */
32
- const INTERNAL_MAILING_LIST_ID = 0;
33
-
34
- const INTERNAL_MAILING_CONTENT_MAIL_TYPE = 1;
35
-
36
- const INTERNAL_MAILING_FEATURE_ID = 2;
37
-
38
-
39
- const MAILING_EXCEPTION_TYPE_STATE = 1000;
40
-
41
- const MAILING_EXCEPTION_TYPE_RECIPIENT_NOT_FOUND = 1001;
42
-
43
- const MAILING_EXCEPTION_TYPE_MAILBUILD = 1002;
44
-
45
- const MAILING_EXCEPTION_TYPE_MAILING_FEATURE_DISABLED = 1003;
46
-
47
-
48
- const PARSE_SUCCESSFUL = 1;
49
-
50
- const PARSE_EXCEPTION = 2;
51
-
52
- const MAILING_NOT_FOUND = 3;
53
-
54
-
55
- const BUILD_SUCCESSFUL = 1;
56
-
57
- const BUILD_EXCEPTION = 2;
58
-
59
-
60
- const MAIL_TYPE_SYSTEM = -1;
61
-
62
- const MAILING_MAX_CHANGEDATTR_SIZE = 20;
63
-
64
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mailing
5
+ */
6
+ /**
7
+ * MailingConstants
8
+ *
9
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
10
+ * @package Inxmail
11
+ * @subpackage Mailing
12
+ */
13
+ interface Inx_Api_Mailing_MailingConstants
14
+ {
15
+
16
+ const MAIL_CONTENT_TYPE_PLAIN_TEXT = 100;
17
+
18
+ const MAIL_CONTENT_TYPE_HTML_TEXT = 101;
19
+
20
+ const MAIL_CONTENT_TYPE_MULTI_PART = 102;
21
+
22
+ const MAIL_CONTENT_TYPE_XML_XSLT_MULTI_PART = 103;
23
+
24
+ const MAIL_CONTENT_TYPE_XML_XSLT_PLAIN_TEXT = 104;
25
+
26
+ const MAIL_CONTENT_TYPE_XML_XSLT_HTML_TEXT = 105;
27
+
28
+
29
+ /**
30
+ * the array index of list type of mailing bo
31
+ */
32
+ const INTERNAL_MAILING_LIST_ID = 0;
33
+
34
+ const INTERNAL_MAILING_CONTENT_MAIL_TYPE = 1;
35
+
36
+ const INTERNAL_MAILING_FEATURE_ID = 2;
37
+
38
+
39
+ const MAILING_EXCEPTION_TYPE_STATE = 1000;
40
+
41
+ const MAILING_EXCEPTION_TYPE_RECIPIENT_NOT_FOUND = 1001;
42
+
43
+ const MAILING_EXCEPTION_TYPE_MAILBUILD = 1002;
44
+
45
+ const MAILING_EXCEPTION_TYPE_MAILING_FEATURE_DISABLED = 1003;
46
+
47
+
48
+ const PARSE_SUCCESSFUL = 1;
49
+
50
+ const PARSE_EXCEPTION = 2;
51
+
52
+ const MAILING_NOT_FOUND = 3;
53
+
54
+
55
+ const BUILD_SUCCESSFUL = 1;
56
+
57
+ const BUILD_EXCEPTION = 2;
58
+
59
+
60
+ const MAIL_TYPE_SYSTEM = -1;
61
+
62
+ const MAILING_MAX_CHANGEDATTR_SIZE = 20;
63
+
64
+ }
lib/Inx/Api/Mailing/MailingManager.php CHANGED
@@ -1,238 +1,238 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mailing
5
- */
6
-
7
- /**
8
- * The <i>Inx_Api_Mailing_MailingManager</i> manages all mailings.
9
- * The <i>MailingManager</i> can be used to perform the following tasks:
10
- * <ul>
11
- * <li>Retrieve mailings
12
- * <li>Create mailings
13
- * <li>Clone mailings
14
- * <li>Create a renderer to generate a preview of the mailing
15
- * </ul>
16
- * <p>
17
- * <strong>Mailing retrieval</strong>
18
- * <p>
19
- * There are several ways to retrieve mailings.
20
- * The simplest way is to call <i>selectAll()</i> which will retrieve all mailings.
21
- * To retrieve a single mailing, use the <i>get($iMailingId)</i> method.
22
- * To retrieve all mailings of a specific list use one of the <i>select(...)</i> methods.
23
- * Using this type of method gives you the ability to define search filters, like the mailing state.
24
- * It is also possible to order the result.
25
- * <p>
26
- * The following snippet shows how to retrieve all mailings of a specific list, which are either in the
27
- * <code>DRAFT</code> or the <code>TO_BE_APPROVE</code> state and print out their names:
28
- *
29
- * <pre>
30
- * $oMailingManager = $oSession->getMailingManager();
31
- * $oBOResultSet = $oMailingManager->select($oListContext, Inx_Api_Mailing_Mailing::STATE_DRAFT
32
- * | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE);
33
- *
34
- * for( $i = 0; $i < $oBOResultSet->size(); $i++ )
35
- * {
36
- * $oMailing = $oBOResultSet->get($i);
37
- * echo $oMailing->getName()."&#60;br&#62;";
38
- * }
39
- *
40
- * $oBOResultSet->close();
41
- * </pre>
42
- *
43
- * To retrieve all mailings of a specific list, disregarding their state, use the state filter <i>STATE_FILTER_ALL</i>.
44
- * This filter produces the same result as a bitwise combination of all mailing states.
45
- * <p>
46
- * If needed, it is possible to create much more complex select statements than the one above. This can be accomplished
47
- * using filter expressions. The following snippet extends the previous select statement with a filter that restricts
48
- * the result to mailings which were modified during the last hour. The result is also ordered by the mailing name:
49
- *
50
- * <pre>
51
- * $oMailingManager = $oSession->getMailingManager();
52
- *
53
- * $filterDate = date("d.m.Y H:i:s", strtotime("-1 hour"));
54
- * $filter = "Attribute(".Inx_Api_Mailing_Mailing::ATTRIBUTE_MODIFICATION_DATETIME.") > #".$filterDate."#";
55
- *
56
- * $oBOResultSet = $oMailingManager->select($oListContext, Inx_Api_Mailing_Mailing::STATE_DRAFT
57
- * | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE, $filter, Inx_Api_Mailing_Mailing::ATTRIBUTE_NAME,
58
- * Inx_Api_Order::ASC);
59
- *
60
- * for($i = 0; $i < $oBOResultSet->size(); $i++)
61
- * {
62
- * $oMailing = $oBOResultSet->get($i);
63
- * echo $oMailing->getName()."&#60;br&#62;";
64
- * }
65
- *
66
- * $oBOResultSet->close();
67
- * </pre>
68
- * <p>
69
- * <strong>Mailing creation and editing</strong>
70
- * <p>
71
- * The following snippet shows how to create a mailing:
72
- *
73
- * <pre>
74
- * $oMailingManager = $oSession->getMailingManager();
75
- * $oMailing = $oMailingManager->createMailing($oListContext);
76
- * $oMailing->updateSubject("Monthly Newsletter");
77
- * $oMailing->commitUpdate();
78
- * </pre>
79
- * <p>
80
- * <strong>Note:</strong> For existing mailings, always call <i>lock()</i> before updating it, and
81
- * <i>unlock()</i> after committing changes!
82
- * <p>
83
- * The following snippet shows how to edit an existing mailing:
84
- *
85
- * <pre>
86
- * $oMailingManager = $oSession->getMailingManager();
87
- * $oMailing = $oMailingManager->get($iMailingId);
88
- *
89
- * try
90
- * {
91
- * $oMailing->lock();
92
- * $oMailing->updateSubject("New Subject");
93
- * $oMailing->commitUpdate();
94
- * $oMailing->unlock();
95
- * }
96
- * catch(Inx_Api_LockException $x)
97
- * {
98
- * //somone else has locked this mailing
99
- * }
100
- * </pre>
101
- * <p>
102
- * It is not necessary to repeatedly create almost identical mailings. This can be accomplished a lot easier using the
103
- * <i>clone()</i> method.
104
- * <p>
105
- * The following snippet shows how to clone a mailing and put the clone in the specified list:
106
- *
107
- * <pre>
108
- * $oMailingManager = $oSession->getMailingManager();
109
- * $oMailingManager->cloneMailing($iMailingId, $oListContext);
110
- * </pre>
111
- * <p>
112
- * <strong>Preview generation</strong>
113
- * <p>
114
- * To create a preview of a mailing, an <i>Inx_Api_Mail_MailingRenderer</i> is needed.
115
- * A renderer can be obtained using the <i>createRenderer()</i> method.
116
- * <p>
117
- * The following snippet shows how to create a <code>MailingRenderer</code> and generate a preview of the mailing:
118
- *
119
- * <pre>
120
- * $oMailingManager = $oSession->getMailingManager();
121
- * $oMailingRenderer = $oMailingManager->createRenderer();
122
- * $oMailingRenderer->parse($iMailingId, Inx_Api_Mail_MailingRenderer::BUILD_MODE_PREVIEW);
123
- * $oMailContent = $oMailingRenderer->build($iRecipientId);
124
- *
125
- * echo $oMailContent->getPlainText()."&#60;br&#62;";
126
- * </pre>
127
- * <p>
128
- * For more information on mailings, see the <i>Inx_Api_Mailing_Mailing</i> documentation.
129
- * <p>
130
- * Note: To use mailings, the following api user right is required: <i>Inx_Api_UserRights::MAILING_FEATURE_USE</i>
131
- *
132
- * @see Inx_Api_Mailing_Mailing
133
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
134
- * @package Inxmail
135
- * @subpackage Mailing
136
- */
137
- interface Inx_Api_Mailing_MailingManager extends Inx_Api_BOManager
138
- {
139
-
140
- /** @deprecated replaced by Inx_Api_Order::ASC */
141
- const ORDER_ASC = 0;
142
-
143
- /** @deprecated replaced by Inx_Api_Order::DESC */
144
- const ORDER_DESC = 1;
145
-
146
-
147
- /**
148
- * State filter constants to returning all mailings.
149
- * It's the same like:
150
- * <pre>
151
- * $iStateFilter = Inx_Api_Mailing_Mailing::STATE_DRAFT | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE | Inx_Api_Mailing_Mailing::STATE_APPROVED
152
- * | Inx_Api_Mailing_Mailing::STATE_SCHEDULED | Inx_Api_Mailing_Mailing::STATE_SENDING| Inx_Api_Mailing_Mailing::STATE_INTERRUPTED
153
- * | Inx_Api_Mailing_Mailing::STATE_SENT | Inx_Api_Mailing_Mailing::STATE_SENDING_FAILED;
154
- * </pre>
155
- */
156
- const STATE_FILTER_ALL = 0xFFFF;
157
-
158
- /**
159
- * Selects mailings in specified order, filtered by the supplied condition.<br>
160
- * The <i>Inx_Api_BOResultSet</i> contains a set of <i>Inx_Api_Mailing_Mailing</i> objects.
161
- *
162
- * The stateFilter must be either a single value like:
163
- * <ul>
164
- * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT
165
- * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE
166
- * <li>Inx_Api_Mailing_Mailing::STATE_APPROVED
167
- * <li>Inx_Api_Mailing_Mailing::STATE_SCHEDULED
168
- * <li>Inx_Api_Mailing_Mailing::STATE_SENDING
169
- * <li>Inx_Api_Mailing_Mailing::STATE_INTERRUPTED
170
- * <li>Inx_Api_Mailing_Mailing::STATE_SENT
171
- * <li>Inx_Api_Mailing_Mailing::STATE_SENDING_FAILED
172
- * </ul>
173
- * or a bitwise combination, e.g. Inx_Api_Mailing_Mailing::STATE_SCHEDULED|Inx_Api_Mailing_Mailing::STATE_SENDING
174
- * or Inx_Api_Mailing_Mailing::STATE_DRAFT|Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE|Inx_Api_Mailing_Mailing::STATE_APPROVED
175
- *
176
- *
177
- * The filter is a boolean expression on one mailing attribute. Attributes are specified with the function <i>Attribute(id)</i>.
178
- * Please note that date-values for the filter have to be specified in german 24-hour date-format. To accomplish this, the date()
179
- * function with the following date-pattern can be used:
180
- *
181
- * <pre>
182
- * $filterDate = date("d.m.Y H:i:s");
183
- * </pre>
184
- *
185
- * The orderAttribute is the id of the order attribute.
186
- *
187
- * Allowed values for attribute ids are:
188
- * <ul>
189
- * <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SUBJECT
190
- * <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_MODIFICATION_DATETIME
191
- * <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SENT_START_DATETIME
192
- * <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SENT_END_DATETIME
193
- * </ul>
194
- *
195
- * @param Inx_Api_List_ListContext $oListContext list from which to select
196
- * @param int $iStateFilter s.above.
197
- * @param string $sFilter filter expression
198
- * @param int $iOrderAttribute order attribute id
199
- * @param int $iOrderType one of Order.ASC and Order.DESC fort order direction
200
- * @return Inx_Api_BOResultSet the result set of <i>Inx_Api_Mailing_Mailing</i> objects
201
- * @throws Inx_Api_FilterStmtException
202
- */
203
- public function select( Inx_Api_List_ListContext $oListContext = null, $iStateFilter, $sFilter = null,
204
- $iOrderAttribute = null, $iOrderType = null );
205
-
206
- /**
207
- * Creates a new mailing in the specified list.
208
- *
209
- * @param $oListContext list owner of the mailing
210
- * @return Inx_Api_Mailing_Mailing a new mailing
211
- */
212
- public function createMailing( Inx_Api_List_ListContext $oListContext );
213
-
214
-
215
- /**
216
- * Creates the new <i>Inx_Api_Mail_MailingRenderer</i> to rendering a <i>Inx_Api_Mailing_Mailing</i>.
217
- *
218
- * @return Inx_Api_Mail_MailingRenderer the new <i>Inx_Api_Mail_MailingRenderer</i>
219
- */
220
- public function createRenderer();
221
-
222
- /**
223
- * Creates the new <code>Inx_Api_Mail_MailingRenderer</code> to rendering a <code>Mailing</code> with test recipients.
224
- *
225
- * @return the new <code>Inx_Api_Mail_MailingRenderer</code>
226
- * @since API 1.6.0
227
- */
228
- public function createRendererForTestRecipient();
229
-
230
- /**
231
- * Copies a <code>Inx_Api_Mail_Mailing</code> to the specified list.
232
- *
233
- * @return the new <code>Inx_Api_Mail_Mailing</code>
234
- * @since API 1.6.0
235
- */
236
- public function cloneMailing($iMailingId, Inx_Api_List_ListContext $oListContext );
237
-
238
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mailing
5
+ */
6
+
7
+ /**
8
+ * The <i>Inx_Api_Mailing_MailingManager</i> manages all mailings.
9
+ * The <i>MailingManager</i> can be used to perform the following tasks:
10
+ * <ul>
11
+ * <li>Retrieve mailings
12
+ * <li>Create mailings
13
+ * <li>Clone mailings
14
+ * <li>Create a renderer to generate a preview of the mailing
15
+ * </ul>
16
+ * <p>
17
+ * <strong>Mailing retrieval</strong>
18
+ * <p>
19
+ * There are several ways to retrieve mailings.
20
+ * The simplest way is to call <i>selectAll()</i> which will retrieve all mailings.
21
+ * To retrieve a single mailing, use the <i>get($iMailingId)</i> method.
22
+ * To retrieve all mailings of a specific list use one of the <i>select(...)</i> methods.
23
+ * Using this type of method gives you the ability to define search filters, like the mailing state.
24
+ * It is also possible to order the result.
25
+ * <p>
26
+ * The following snippet shows how to retrieve all mailings of a specific list, which are either in the
27
+ * <code>DRAFT</code> or the <code>TO_BE_APPROVE</code> state and print out their names:
28
+ *
29
+ * <pre>
30
+ * $oMailingManager = $oSession->getMailingManager();
31
+ * $oBOResultSet = $oMailingManager->select($oListContext, Inx_Api_Mailing_Mailing::STATE_DRAFT
32
+ * | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE);
33
+ *
34
+ * for( $i = 0; $i < $oBOResultSet->size(); $i++ )
35
+ * {
36
+ * $oMailing = $oBOResultSet->get($i);
37
+ * echo $oMailing->getName()."&#60;br&#62;";
38
+ * }
39
+ *
40
+ * $oBOResultSet->close();
41
+ * </pre>
42
+ *
43
+ * To retrieve all mailings of a specific list, disregarding their state, use the state filter <i>STATE_FILTER_ALL</i>.
44
+ * This filter produces the same result as a bitwise combination of all mailing states.
45
+ * <p>
46
+ * If needed, it is possible to create much more complex select statements than the one above. This can be accomplished
47
+ * using filter expressions. The following snippet extends the previous select statement with a filter that restricts
48
+ * the result to mailings which were modified during the last hour. The result is also ordered by the mailing name:
49
+ *
50
+ * <pre>
51
+ * $oMailingManager = $oSession->getMailingManager();
52
+ *
53
+ * $filterDate = date("d.m.Y H:i:s", strtotime("-1 hour"));
54
+ * $filter = "Attribute(".Inx_Api_Mailing_Mailing::ATTRIBUTE_MODIFICATION_DATETIME.") > #".$filterDate."#";
55
+ *
56
+ * $oBOResultSet = $oMailingManager->select($oListContext, Inx_Api_Mailing_Mailing::STATE_DRAFT
57
+ * | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE, $filter, Inx_Api_Mailing_Mailing::ATTRIBUTE_NAME,
58
+ * Inx_Api_Order::ASC);
59
+ *
60
+ * for($i = 0; $i < $oBOResultSet->size(); $i++)
61
+ * {
62
+ * $oMailing = $oBOResultSet->get($i);
63
+ * echo $oMailing->getName()."&#60;br&#62;";
64
+ * }
65
+ *
66
+ * $oBOResultSet->close();
67
+ * </pre>
68
+ * <p>
69
+ * <strong>Mailing creation and editing</strong>
70
+ * <p>
71
+ * The following snippet shows how to create a mailing:
72
+ *
73
+ * <pre>
74
+ * $oMailingManager = $oSession->getMailingManager();
75
+ * $oMailing = $oMailingManager->createMailing($oListContext);
76
+ * $oMailing->updateSubject("Monthly Newsletter");
77
+ * $oMailing->commitUpdate();
78
+ * </pre>
79
+ * <p>
80
+ * <strong>Note:</strong> For existing mailings, always call <i>lock()</i> before updating it, and
81
+ * <i>unlock()</i> after committing changes!
82
+ * <p>
83
+ * The following snippet shows how to edit an existing mailing:
84
+ *
85
+ * <pre>
86
+ * $oMailingManager = $oSession->getMailingManager();
87
+ * $oMailing = $oMailingManager->get($iMailingId);
88
+ *
89
+ * try
90
+ * {
91
+ * $oMailing->lock();
92
+ * $oMailing->updateSubject("New Subject");
93
+ * $oMailing->commitUpdate();
94
+ * $oMailing->unlock();
95
+ * }
96
+ * catch(Inx_Api_LockException $x)
97
+ * {
98
+ * //somone else has locked this mailing
99
+ * }
100
+ * </pre>
101
+ * <p>
102
+ * It is not necessary to repeatedly create almost identical mailings. This can be accomplished a lot easier using the
103
+ * <i>clone()</i> method.
104
+ * <p>
105
+ * The following snippet shows how to clone a mailing and put the clone in the specified list:
106
+ *
107
+ * <pre>
108
+ * $oMailingManager = $oSession->getMailingManager();
109
+ * $oMailingManager->cloneMailing($iMailingId, $oListContext);
110
+ * </pre>
111
+ * <p>
112
+ * <strong>Preview generation</strong>
113
+ * <p>
114
+ * To create a preview of a mailing, an <i>Inx_Api_Mail_MailingRenderer</i> is needed.
115
+ * A renderer can be obtained using the <i>createRenderer()</i> method.
116
+ * <p>
117
+ * The following snippet shows how to create a <code>MailingRenderer</code> and generate a preview of the mailing:
118
+ *
119
+ * <pre>
120
+ * $oMailingManager = $oSession->getMailingManager();
121
+ * $oMailingRenderer = $oMailingManager->createRenderer();
122
+ * $oMailingRenderer->parse($iMailingId, Inx_Api_Mail_MailingRenderer::BUILD_MODE_PREVIEW);
123
+ * $oMailContent = $oMailingRenderer->build($iRecipientId);
124
+ *
125
+ * echo $oMailContent->getPlainText()."&#60;br&#62;";
126
+ * </pre>
127
+ * <p>
128
+ * For more information on mailings, see the <i>Inx_Api_Mailing_Mailing</i> documentation.
129
+ * <p>
130
+ * Note: To use mailings, the following api user right is required: <i>Inx_Api_UserRights::MAILING_FEATURE_USE</i>
131
+ *
132
+ * @see Inx_Api_Mailing_Mailing
133
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
134
+ * @package Inxmail
135
+ * @subpackage Mailing
136
+ */
137
+ interface Inx_Api_Mailing_MailingManager extends Inx_Api_BOManager
138
+ {
139
+
140
+ /** @deprecated replaced by Inx_Api_Order::ASC */
141
+ const ORDER_ASC = 0;
142
+
143
+ /** @deprecated replaced by Inx_Api_Order::DESC */
144
+ const ORDER_DESC = 1;
145
+
146
+
147
+ /**
148
+ * State filter constants to returning all mailings.
149
+ * It's the same like:
150
+ * <pre>
151
+ * $iStateFilter = Inx_Api_Mailing_Mailing::STATE_DRAFT | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE | Inx_Api_Mailing_Mailing::STATE_APPROVED
152
+ * | Inx_Api_Mailing_Mailing::STATE_SCHEDULED | Inx_Api_Mailing_Mailing::STATE_SENDING| Inx_Api_Mailing_Mailing::STATE_INTERRUPTED
153
+ * | Inx_Api_Mailing_Mailing::STATE_SENT | Inx_Api_Mailing_Mailing::STATE_SENDING_FAILED;
154
+ * </pre>
155
+ */
156
+ const STATE_FILTER_ALL = 0xFFFF;
157
+
158
+ /**
159
+ * Selects mailings in specified order, filtered by the supplied condition.<br>
160
+ * The <i>Inx_Api_BOResultSet</i> contains a set of <i>Inx_Api_Mailing_Mailing</i> objects.
161
+ *
162
+ * The stateFilter must be either a single value like:
163
+ * <ul>
164
+ * <li>Inx_Api_Mailing_Mailing::STATE_DRAFT
165
+ * <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE
166
+ * <li>Inx_Api_Mailing_Mailing::STATE_APPROVED
167
+ * <li>Inx_Api_Mailing_Mailing::STATE_SCHEDULED
168
+ * <li>Inx_Api_Mailing_Mailing::STATE_SENDING
169
+ * <li>Inx_Api_Mailing_Mailing::STATE_INTERRUPTED
170
+ * <li>Inx_Api_Mailing_Mailing::STATE_SENT
171
+ * <li>Inx_Api_Mailing_Mailing::STATE_SENDING_FAILED
172
+ * </ul>
173
+ * or a bitwise combination, e.g. Inx_Api_Mailing_Mailing::STATE_SCHEDULED|Inx_Api_Mailing_Mailing::STATE_SENDING
174
+ * or Inx_Api_Mailing_Mailing::STATE_DRAFT|Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE|Inx_Api_Mailing_Mailing::STATE_APPROVED
175
+ *
176
+ *
177
+ * The filter is a boolean expression on one mailing attribute. Attributes are specified with the function <i>Attribute(id)</i>.
178
+ * Please note that date-values for the filter have to be specified in german 24-hour date-format. To accomplish this, the date()
179
+ * function with the following date-pattern can be used:
180
+ *
181
+ * <pre>
182
+ * $filterDate = date("d.m.Y H:i:s");
183
+ * </pre>
184
+ *
185
+ * The orderAttribute is the id of the order attribute.
186
+ *
187
+ * Allowed values for attribute ids are:
188
+ * <ul>
189
+ * <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SUBJECT
190
+ * <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_MODIFICATION_DATETIME
191
+ * <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SENT_START_DATETIME
192
+ * <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SENT_END_DATETIME
193
+ * </ul>
194
+ *
195
+ * @param Inx_Api_List_ListContext $oListContext list from which to select
196
+ * @param int $iStateFilter s.above.
197
+ * @param string $sFilter filter expression
198
+ * @param int $iOrderAttribute order attribute id
199
+ * @param int $iOrderType one of Order.ASC and Order.DESC fort order direction
200
+ * @return Inx_Api_BOResultSet the result set of <i>Inx_Api_Mailing_Mailing</i> objects
201
+ * @throws Inx_Api_FilterStmtException
202
+ */
203
+ public function select( Inx_Api_List_ListContext $oListContext = null, $iStateFilter, $sFilter = null,
204
+ $iOrderAttribute = null, $iOrderType = null );
205
+
206
+ /**
207
+ * Creates a new mailing in the specified list.
208
+ *
209
+ * @param $oListContext list owner of the mailing
210
+ * @return Inx_Api_Mailing_Mailing a new mailing
211
+ */
212
+ public function createMailing( Inx_Api_List_ListContext $oListContext );
213
+
214
+
215
+ /**
216
+ * Creates the new <i>Inx_Api_Mail_MailingRenderer</i> to rendering a <i>Inx_Api_Mailing_Mailing</i>.
217
+ *
218
+ * @return Inx_Api_Mail_MailingRenderer the new <i>Inx_Api_Mail_MailingRenderer</i>
219
+ */
220
+ public function createRenderer();
221
+
222
+ /**
223
+ * Creates the new <code>Inx_Api_Mail_MailingRenderer</code> to rendering a <code>Mailing</code> with test recipients.
224
+ *
225
+ * @return the new <code>Inx_Api_Mail_MailingRenderer</code>
226
+ * @since API 1.6.0
227
+ */
228
+ public function createRendererForTestRecipient();
229
+
230
+ /**
231
+ * Copies a <code>Inx_Api_Mail_Mailing</code> to the specified list.
232
+ *
233
+ * @return the new <code>Inx_Api_Mail_Mailing</code>
234
+ * @since API 1.6.0
235
+ */
236
+ public function cloneMailing($iMailingId, Inx_Api_List_ListContext $oListContext );
237
+
238
+ }
lib/Inx/Api/Mailing/MailingStateException.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mailing
5
- */
6
-
7
- /**
8
- * An <i>Inx_Api_Mailing_MailingStateException</i> is thrown when a mailing action is invoked which is not allowed
9
- * to be performed in the current state.
10
- * For example, invoking <i>Inx_Api_Mailing_Mailing::startSending()</i> is not allowed if the mailing is in the
11
- * state <i>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE</i>, thus raising a <i>MailingStateException</i>.
12
- *
13
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
14
- * @package Inxmail
15
- * @subpackage Mailing
16
- */
17
- class Inx_Api_Mailing_MailingStateException extends Exception
18
- {
19
- /**
20
- * <i>true</i> if the mailing is locked, <i>false</i> otherwise.
21
- *
22
- * @var boolean
23
- */
24
- private $_blLocked;
25
-
26
- /**
27
- * Creates a <code>MailingStateException</code> with the given detail message, current state and locking state.
28
- *
29
- * @param string $sMsg the detail message.
30
- * @param int $iCurrentState the current state of the affected mailing.
31
- * @param bool $blLocked <code>true</code> if the mailing is locked, <code>false</code> otherwise.
32
- */
33
- public function __construct( $sMsg = null, $iCurrentState = null, $blLocked = null )
34
- {
35
- parent::__construct( $sMsg, $iCurrentState );
36
-
37
- $this->_blLocked = $blLocked;
38
- }
39
-
40
-
41
- /**
42
- * Returns the current state of the affected mailing.
43
- * Alias for <i>Inx_Api_Mailing_MailingStateException::getCode()</i>
44
- *
45
- * @return int the current state.
46
- */
47
- public function getCurrentState()
48
- {
49
- return $this->getCode();
50
- }
51
-
52
- /**
53
- * Checks if the mailing is locked.
54
- *
55
- * @return bool <i>true</i> if the mailing is locked, <i>false</i> otherwise.
56
- */
57
- public function isLocked()
58
- {
59
- return $this->blLocked;
60
- }
61
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mailing
5
+ */
6
+
7
+ /**
8
+ * An <i>Inx_Api_Mailing_MailingStateException</i> is thrown when a mailing action is invoked which is not allowed
9
+ * to be performed in the current state.
10
+ * For example, invoking <i>Inx_Api_Mailing_Mailing::startSending()</i> is not allowed if the mailing is in the
11
+ * state <i>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE</i>, thus raising a <i>MailingStateException</i>.
12
+ *
13
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
14
+ * @package Inxmail
15
+ * @subpackage Mailing
16
+ */
17
+ class Inx_Api_Mailing_MailingStateException extends Exception
18
+ {
19
+ /**
20
+ * <i>true</i> if the mailing is locked, <i>false</i> otherwise.
21
+ *
22
+ * @var boolean
23
+ */
24
+ private $_blLocked;
25
+
26
+ /**
27
+ * Creates a <code>MailingStateException</code> with the given detail message, current state and locking state.
28
+ *
29
+ * @param string $sMsg the detail message.
30
+ * @param int $iCurrentState the current state of the affected mailing.
31
+ * @param bool $blLocked <code>true</code> if the mailing is locked, <code>false</code> otherwise.
32
+ */
33
+ public function __construct( $sMsg = null, $iCurrentState = null, $blLocked = null )
34
+ {
35
+ parent::__construct( $sMsg, $iCurrentState );
36
+
37
+ $this->_blLocked = $blLocked;
38
+ }
39
+
40
+
41
+ /**
42
+ * Returns the current state of the affected mailing.
43
+ * Alias for <i>Inx_Api_Mailing_MailingStateException::getCode()</i>
44
+ *
45
+ * @return int the current state.
46
+ */
47
+ public function getCurrentState()
48
+ {
49
+ return $this->getCode();
50
+ }
51
+
52
+ /**
53
+ * Checks if the mailing is locked.
54
+ *
55
+ * @return bool <i>true</i> if the mailing is locked, <i>false</i> otherwise.
56
+ */
57
+ public function isLocked()
58
+ {
59
+ return $this->blLocked;
60
+ }
61
+ }
lib/Inx/Api/Mailing/MultiPartContentHandler.php CHANGED
@@ -1,47 +1,47 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Mailing
6
- */
7
- /**
8
- * The <i>Inx_Api_Mailing_MultiPartContentHandler</i> is a simple content handler used to store and update mailing content in
9
- * both, plain and HTML text format. Both content parts can be used separately.
10
- *
11
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
12
- * @package Inxmail
13
- * @subpackage Mailing
14
- */
15
- interface Inx_Api_Mailing_MultiPartContentHandler extends Inx_Api_Mailing_ContentHandler
16
- {
17
-
18
- /**
19
- * Returns the plain text content stored by this content handler.
20
- *
21
- * @return string the plain text content.
22
- */
23
- public function getPlainTextContent();
24
-
25
- /**
26
- * Updates the plain text content stored by this content handler.
27
- *
28
- * @param string $sPlainTextContent the new plain text content.
29
- */
30
- public function updatePlainTextContent( $sPlainTextContent );
31
-
32
-
33
- /**
34
- * Returns the HTML text content stored by this content handler.
35
- *
36
- * @return string the HTML text content.
37
- */
38
- public function getHtmlTextContent();
39
-
40
- /**
41
- * Updates the HTML text content stored by this content handler.
42
- *
43
- * @param string $sHtmlTextContent the new HTML text content.
44
- */
45
- public function updateHtmlTextContent( $sHtmlTextContent );
46
-
47
  }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Mailing
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_Mailing_MultiPartContentHandler</i> is a simple content handler used to store and update mailing content in
9
+ * both, plain and HTML text format. Both content parts can be used separately.
10
+ *
11
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
12
+ * @package Inxmail
13
+ * @subpackage Mailing
14
+ */
15
+ interface Inx_Api_Mailing_MultiPartContentHandler extends Inx_Api_Mailing_ContentHandler
16
+ {
17
+
18
+ /**
19
+ * Returns the plain text content stored by this content handler.
20
+ *
21
+ * @return string the plain text content.
22
+ */
23
+ public function getPlainTextContent();
24
+
25
+ /**
26
+ * Updates the plain text content stored by this content handler.
27
+ *
28
+ * @param string $sPlainTextContent the new plain text content.
29
+ */
30
+ public function updatePlainTextContent( $sPlainTextContent );
31
+
32
+
33
+ /**
34
+ * Returns the HTML text content stored by this content handler.
35
+ *
36
+ * @return string the HTML text content.
37
+ */
38
+ public function getHtmlTextContent();
39
+
40
+ /**
41
+ * Updates the HTML text content stored by this content handler.
42
+ *
43
+ * @param string $sHtmlTextContent the new HTML text content.
44
+ */
45
+ public function updateHtmlTextContent( $sHtmlTextContent );
46
+
47
  }
lib/Inx/Api/Mailing/PlainTextContentHandler.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Mailing
6
- */
7
- /**
8
- * Inx_Api_Mailing_PlainTextContentHandler
9
- *
10
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
- * @package Inxmail
12
- * @subpackage Mailing
13
- */
14
- interface Inx_Api_Mailing_PlainTextContentHandler extends Inx_Api_Mailing_SinglePartContentHandler
15
- {
16
-
17
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Mailing
6
+ */
7
+ /**
8
+ * Inx_Api_Mailing_PlainTextContentHandler
9
+ *
10
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
+ * @package Inxmail
12
+ * @subpackage Mailing
13
+ */
14
+ interface Inx_Api_Mailing_PlainTextContentHandler extends Inx_Api_Mailing_SinglePartContentHandler
15
+ {
16
+
17
+ }
lib/Inx/Api/Mailing/SendException.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Mailing
6
- */
7
- /**
8
- * An <i>Inx_Api_Mailing_SendException</i> is thrown when an error occurs while sending a mailing.
9
- *
10
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
- * @package Inxmail
12
- * @subpackage Mailing
13
- */
14
- class Inx_Api_Mailing_SendException extends Exception
15
- {
16
-
17
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Mailing
6
+ */
7
+ /**
8
+ * An <i>Inx_Api_Mailing_SendException</i> is thrown when an error occurs while sending a mailing.
9
+ *
10
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
+ * @package Inxmail
12
+ * @subpackage Mailing
13
+ */
14
+ class Inx_Api_Mailing_SendException extends Exception
15
+ {
16
+
17
+ }
lib/Inx/Api/Mailing/SendingInfo.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mail
5
- */
6
-
7
- /**
8
- * An <i>Inx_Api_Mailng_SendingInfo</i> object contains additional information regarding the sending of a mailing.
9
- * For example, the average mail size or the number of delivered mails.
10
- *
11
- * @since API 1.4.3
12
- * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
13
- * @package Inxmail
14
- * @subpackage Mail
15
- */
16
- interface Inx_Api_Mailing_SendingInfo
17
- {
18
-
19
- /**
20
- * Returns the number of mailings which were successfully delivered by Inxmail.
21
- *
22
- * @return int the number of mailings which were successfully delivered by Inxmail.
23
- */
24
- public function getDeliveredMailsCount();
25
-
26
-
27
- /**
28
- * Returns the number of mailings which encountered an error while sending.
29
- *
30
- * @return int the number of mailings which encountered an error while sending.
31
- */
32
- public function getSentErrorCount();
33
-
34
- /**
35
- * Returns the number of mailings for which bounce messages were received.
36
- *
37
- * @return int the number of mailings for which bounce messages were received.
38
- */
39
- public function getBounceCount();
40
-
41
- /**
42
- * Returns the number of mailings which have not been sent by Inxmail, for example because of an existing no-mail tag.
43
- *
44
- * @return int the number of mailings which have not been sent by Inxmail.
45
- */
46
- public function getNotSentMailsCount();
47
-
48
-
49
- /**
50
- * Returns the average mailing size for the sent mailing.
51
- *
52
- * @return int the average mailing size for the sent mailing.
53
- */
54
- public function getAverageMailSize();
55
- }
56
- ?>
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mail
5
+ */
6
+
7
+ /**
8
+ * An <i>Inx_Api_Mailng_SendingInfo</i> object contains additional information regarding the sending of a mailing.
9
+ * For example, the average mail size or the number of delivered mails.
10
+ *
11
+ * @since API 1.4.3
12
+ * @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
13
+ * @package Inxmail
14
+ * @subpackage Mail
15
+ */
16
+ interface Inx_Api_Mailing_SendingInfo
17
+ {
18
+
19
+ /**
20
+ * Returns the number of mailings which were successfully delivered by Inxmail.
21
+ *
22
+ * @return int the number of mailings which were successfully delivered by Inxmail.
23
+ */
24
+ public function getDeliveredMailsCount();
25
+
26
+
27
+ /**
28
+ * Returns the number of mailings which encountered an error while sending.
29
+ *
30
+ * @return int the number of mailings which encountered an error while sending.
31
+ */
32
+ public function getSentErrorCount();
33
+
34
+ /**
35
+ * Returns the number of mailings for which bounce messages were received.
36
+ *
37
+ * @return int the number of mailings for which bounce messages were received.
38
+ */
39
+ public function getBounceCount();
40
+
41
+ /**
42
+ * Returns the number of mailings which have not been sent by Inxmail, for example because of an existing no-mail tag.
43
+ *
44
+ * @return int the number of mailings which have not been sent by Inxmail.
45
+ */
46
+ public function getNotSentMailsCount();
47
+
48
+
49
+ /**
50
+ * Returns the average mailing size for the sent mailing.
51
+ *
52
+ * @return int the average mailing size for the sent mailing.
53
+ */
54
+ public function getAverageMailSize();
55
+ }
56
+ ?>
lib/Inx/Api/Mailing/SinglePartContentHandler.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Mailing
6
- */
7
- /**
8
- * The <i>Inx_Api_Mailing_SinglePartContentHandler</i> interface defines the basic requirements of a content
9
- * handler that handles only one content type (for example text or HTML).
10
- *
11
- * @since API 1.2.0
12
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
- * @package Inxmail
14
- * @subpackage Mailing
15
- */
16
- interface Inx_Api_Mailing_SinglePartContentHandler extends Inx_Api_Mailing_ContentHandler
17
- {
18
-
19
- /**
20
- * Returns the content stored by this content handler.
21
- *
22
- * @return string the content.
23
- */
24
- public function getContent();
25
-
26
- /**
27
- * Updates the content stored by this content handler.
28
- *
29
- * @param string $sContent the new content.
30
- */
31
- public function updateContent( $sContent );
32
-
33
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Mailing
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_Mailing_SinglePartContentHandler</i> interface defines the basic requirements of a content
9
+ * handler that handles only one content type (for example text or HTML).
10
+ *
11
+ * @since API 1.2.0
12
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
+ * @package Inxmail
14
+ * @subpackage Mailing
15
+ */
16
+ interface Inx_Api_Mailing_SinglePartContentHandler extends Inx_Api_Mailing_ContentHandler
17
+ {
18
+
19
+ /**
20
+ * Returns the content stored by this content handler.
21
+ *
22
+ * @return string the content.
23
+ */
24
+ public function getContent();
25
+
26
+ /**
27
+ * Updates the content stored by this content handler.
28
+ *
29
+ * @param string $sContent the new content.
30
+ */
31
+ public function updateContent( $sContent );
32
+
33
+ }
lib/Inx/Api/Mailing/XsltContentHandler.php CHANGED
@@ -1,48 +1,48 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Mailing
6
- */
7
- /**
8
- * The <i>Inx_Api_Mailing_XsltContentHandler</i> defines the basic requirements for a content handler that handles XML based
9
- * content. This type of content handler is used by templates to structure (XML content) and format (Style) a mailing.
10
- *
11
- * @since API 1.2.0
12
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
- * @package Inxmail
14
- * @subpackage Mailing
15
- */
16
- interface Inx_Api_Mailing_XsltContentHandler extends Inx_Api_Mailing_ContentHandler
17
- {
18
-
19
- /**
20
- * Returns the raw XML content stored by this content handler.
21
- *
22
- * @return string the raw XML content.
23
- */
24
- public function getXmlContent();
25
-
26
- /**
27
- * Updates the raw XML content stored by this content handler.
28
- *
29
- * @param string $sContent the new raw XML content.
30
- */
31
- public function updateXmlContent( $sContent );
32
-
33
-
34
- /**
35
- * Returns the style, the mailing has been created with.
36
- * The style is used to format the mailing, very similar to a CSS file.
37
- *
38
- * @return Inx_Api_DesignTemplate_Style the style used to format the mailing.
39
- */
40
- public function getStyle();
41
-
42
- /**
43
- * Updates the style used for the mailing. The style is used to format the mailing, very similar to a CSS file.
44
- *
45
- * @param Inx_Api_DesignTemplate_Style style the new style (has to be from the same template as the old one).
46
- */
47
- public function updateStyle( Inx_Api_DesignTemplate_Style $oStyle );
48
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Mailing
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_Mailing_XsltContentHandler</i> defines the basic requirements for a content handler that handles XML based
9
+ * content. This type of content handler is used by templates to structure (XML content) and format (Style) a mailing.
10
+ *
11
+ * @since API 1.2.0
12
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
+ * @package Inxmail
14
+ * @subpackage Mailing
15
+ */
16
+ interface Inx_Api_Mailing_XsltContentHandler extends Inx_Api_Mailing_ContentHandler
17
+ {
18
+
19
+ /**
20
+ * Returns the raw XML content stored by this content handler.
21
+ *
22
+ * @return string the raw XML content.
23
+ */
24
+ public function getXmlContent();
25
+
26
+ /**
27
+ * Updates the raw XML content stored by this content handler.
28
+ *
29
+ * @param string $sContent the new raw XML content.
30
+ */
31
+ public function updateXmlContent( $sContent );
32
+
33
+
34
+ /**
35
+ * Returns the style, the mailing has been created with.
36
+ * The style is used to format the mailing, very similar to a CSS file.
37
+ *
38
+ * @return Inx_Api_DesignTemplate_Style the style used to format the mailing.
39
+ */
40
+ public function getStyle();
41
+
42
+ /**
43
+ * Updates the style used for the mailing. The style is used to format the mailing, very similar to a CSS file.
44
+ *
45
+ * @param Inx_Api_DesignTemplate_Style style the new style (has to be from the same template as the old one).
46
+ */
47
+ public function updateStyle( Inx_Api_DesignTemplate_Style $oStyle );
48
+ }
lib/Inx/Api/Mailing/XsltHtmlTextContentHandler.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Mailing
6
- */
7
- /**
8
- * The <i>Inx_Api_Mailing_XsltHtmlTextContentHandler</i> is a content handler used by templates to structure (XML content) and
9
- * format (Style) mailings with HTML text content.
10
- * This content handler can only handle HTML content.
11
- * If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> instead.
12
- *
13
- * @since API 1.0.1
14
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
15
- * @package Inxmail
16
- * @subpackage Mailing
17
- */
18
- interface Inx_Api_Mailing_XsltHtmlTextContentHandler extends Inx_Api_Mailing_XsltContentHandler
19
- {
20
-
21
- /**
22
- * Returns the HTML style XML content stored by this content handler.
23
- *
24
- * @return string the HTML style XML content.
25
- */
26
- public function getHtmlTextXslt();
27
-
28
- /**
29
- * Updates the HTML style XML content stored by this content handler.
30
- *
31
- * @param string $sHtmlTextXslt the HTML style XML content.
32
- */
33
- public function updateHtmlTextXslt( $sHtmlTextXslt );
34
-
35
  }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Mailing
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_Mailing_XsltHtmlTextContentHandler</i> is a content handler used by templates to structure (XML content) and
9
+ * format (Style) mailings with HTML text content.
10
+ * This content handler can only handle HTML content.
11
+ * If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> instead.
12
+ *
13
+ * @since API 1.0.1
14
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
15
+ * @package Inxmail
16
+ * @subpackage Mailing
17
+ */
18
+ interface Inx_Api_Mailing_XsltHtmlTextContentHandler extends Inx_Api_Mailing_XsltContentHandler
19
+ {
20
+
21
+ /**
22
+ * Returns the HTML style XML content stored by this content handler.
23
+ *
24
+ * @return string the HTML style XML content.
25
+ */
26
+ public function getHtmlTextXslt();
27
+
28
+ /**
29
+ * Updates the HTML style XML content stored by this content handler.
30
+ *
31
+ * @param string $sHtmlTextXslt the HTML style XML content.
32
+ */
33
+ public function updateHtmlTextXslt( $sHtmlTextXslt );
34
+
35
  }
lib/Inx/Api/Mailing/XsltMultiPartContentHandler.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mailing
5
- */
6
- /**
7
- * The <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> is a content handler used by templates to structure (XML content) and
8
- * format (Style) mailings with both, plain and HTML text content. Both content parts can be used separately.
9
- *
10
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
- * @package Inxmail
12
- * @subpackage Mailing
13
- */
14
- interface Inx_Api_Mailing_XsltMultiPartContentHandler extends Inx_Api_Mailing_XsltContentHandler
15
- {
16
- /**
17
- * Returns the plain text style XML content stored by this content handler.
18
- *
19
- * @return string the plain text style XML content.
20
- */
21
- public function getPlainTextXslt();
22
-
23
-
24
- /**
25
- * Updates the plain text style XML content stored by this content handler.
26
- *
27
- * @param String $sPlainTextXslt the new plain text style XML content.
28
- */
29
- public function updatePlainTextXslt( $sPlainTextXslt );
30
-
31
- /**
32
- * Returns the HTML style XML content stored by this content handler.
33
- *
34
- * @return string the HTML style XML content.
35
- */
36
- public function getHtmlTextXslt();
37
-
38
- /**
39
- * Updates the HTML style XML content stored by this content handler.
40
- *
41
- * @param String $sHtmlTextXslt the new HTML style XML content.
42
- */
43
- public function updateHtmlTextXslt( $sHtmlTextXslt );
44
-
45
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mailing
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> is a content handler used by templates to structure (XML content) and
8
+ * format (Style) mailings with both, plain and HTML text content. Both content parts can be used separately.
9
+ *
10
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
+ * @package Inxmail
12
+ * @subpackage Mailing
13
+ */
14
+ interface Inx_Api_Mailing_XsltMultiPartContentHandler extends Inx_Api_Mailing_XsltContentHandler
15
+ {
16
+ /**
17
+ * Returns the plain text style XML content stored by this content handler.
18
+ *
19
+ * @return string the plain text style XML content.
20
+ */
21
+ public function getPlainTextXslt();
22
+
23
+
24
+ /**
25
+ * Updates the plain text style XML content stored by this content handler.
26
+ *
27
+ * @param String $sPlainTextXslt the new plain text style XML content.
28
+ */
29
+ public function updatePlainTextXslt( $sPlainTextXslt );
30
+
31
+ /**
32
+ * Returns the HTML style XML content stored by this content handler.
33
+ *
34
+ * @return string the HTML style XML content.
35
+ */
36
+ public function getHtmlTextXslt();
37
+
38
+ /**
39
+ * Updates the HTML style XML content stored by this content handler.
40
+ *
41
+ * @param String $sHtmlTextXslt the new HTML style XML content.
42
+ */
43
+ public function updateHtmlTextXslt( $sHtmlTextXslt );
44
+
45
+ }
lib/Inx/Api/Mailing/XsltPlainTextContentHandler.php CHANGED
@@ -1,34 +1,34 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Mailing
5
- */
6
- /**
7
- * The <i>Inx_Api_Mailing_XsltPlainTextContentHandler</i> is a content handler used by templates to structure (XML content) and
8
- * format (Style) mailings with plain text content.
9
- * This content handler can only handle plain text content.
10
- * If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> instead.
11
- *
12
- * @since API 1.0.1
13
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
14
- * @package Inxmail
15
- * @subpackage Mailing
16
- */
17
- interface Inx_Api_Mailing_XsltPlainTextContentHandler extends Inx_Api_Mailing_XsltContentHandler
18
- {
19
-
20
- /**
21
- * Returns the plain text style XML content stored by this content handler.
22
- *
23
- * @return string the plain text style XML content.
24
- */
25
- public function getPlainTextXslt();
26
-
27
- /**
28
- * Updates the plain text style XML content stored by this content handler.
29
- *
30
- * @param string $sPlainTextXslt the new plain text style XML content.
31
- */
32
- public function updatePlainTextXslt( $sPlainTextXslt );
33
-
34
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Mailing
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Mailing_XsltPlainTextContentHandler</i> is a content handler used by templates to structure (XML content) and
8
+ * format (Style) mailings with plain text content.
9
+ * This content handler can only handle plain text content.
10
+ * If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> instead.
11
+ *
12
+ * @since API 1.0.1
13
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
14
+ * @package Inxmail
15
+ * @subpackage Mailing
16
+ */
17
+ interface Inx_Api_Mailing_XsltPlainTextContentHandler extends Inx_Api_Mailing_XsltContentHandler
18
+ {
19
+
20
+ /**
21
+ * Returns the plain text style XML content stored by this content handler.
22
+ *
23
+ * @return string the plain text style XML content.
24
+ */
25
+ public function getPlainTextXslt();
26
+
27
+ /**
28
+ * Updates the plain text style XML content stored by this content handler.
29
+ *
30
+ * @param string $sPlainTextXslt the new plain text style XML content.
31
+ */
32
+ public function updatePlainTextXslt( $sPlainTextXslt );
33
+
34
  }
lib/Inx/Api/MailingTemplate/MailingTemplate.php CHANGED
@@ -1,130 +1,130 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage MailingTemplate
5
- */
6
- /**
7
- * An <i>Inx_Api_MailingTemplate_MailingTemplate</i> represents reusable mailing content that can be used as a basis
8
- * for new mailings.
9
- * These templates are far less powerful than the templates provided by design collections, but can still save time in
10
- * the creation of complex mailings with a common structure.
11
- * <p>
12
- * For an example on how to retrieve and create <i>MailingTemplate</i>s, see the
13
- * <i>Inx_Api_MailingTemplate_MailingTemplateManager</i> documentation.
14
- *
15
- * @see Inx_Api_MailingTemplate_MailingTemplateManager
16
- * @since API 1.4.0
17
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $*
18
- * @package Inxmail
19
- * @subpackage MailingTemplate
20
- */
21
- interface Inx_Api_MailingTemplate_MailingTemplate extends Inx_Api_BusinessObject
22
- {
23
- /**
24
- * MIME type constant for HTML text templates. This template has only a HTML text part.
25
- */
26
- const MIME_TYPE_HTML_TEXT = 0;
27
-
28
- /**
29
- * MIME type constant for plain text templates. This template has only a plain text part.
30
- */
31
- const MIME_TYPE_PLAIN_TEXT = 1;
32
-
33
- /**
34
- * MIME type constant for multipart templates. This template has a HTML and a plain text part.
35
- */
36
- const MIME_TYPE_MULTIPART = 2;
37
-
38
- /**
39
- * Constant for the name attribute. Used for ordering by the <i>Inx_Api_MailingTemplate_MailingTemplateManager</i>.
40
- *
41
- * @see Inx_Api_MailingTemplate_MailingTemplateManager::select($oListContext, $iOrderAttribute, $iOrderType)
42
- */
43
- const ATTRIBUTE_NAME = 0;
44
-
45
- /**
46
- * Constant for the plain text attribute.
47
- */
48
- const ATTRIBUTE_PLAIN_TEXT = 1;
49
-
50
- /**
51
- * Constant for the HTML text attribute.
52
- */
53
- const ATTRIBUTE_HTML_TEXT = 2;
54
-
55
- /**
56
- * Constant for the list context id attribute.
57
- */
58
- const ATTRIBUTE_LIST_CONTEXT_ID = 3;
59
-
60
- /**
61
- * Constant for the MIME type attribute.
62
- */
63
- const ATTRIBUTE_MIME_TYPE = 4;
64
-
65
- /**
66
- * Returns the name of the mailing template.
67
- *
68
- * @return string the name of the mailing template.
69
- */
70
- public function getName();
71
-
72
- /**
73
- * Updates the name of the mailing template.
74
- * The mailing template will not be updated on the server until <i>commitUpdate()</i> has been called.
75
- *
76
- * @param string $sName the new template name.
77
- */
78
- public function updateName( $sName );
79
-
80
- /**
81
- * Returns the id of the list which this mailing template belongs to.
82
- *
83
- * @return int the id of the list which this mailing template belongs to.
84
- */
85
- public function getListContextId();
86
-
87
- /**
88
- * Returns the MIME type of this mailing template. May be one of:
89
- * <ul>
90
- * <li><i>MIME_TYPE_HTML_TEXT</i>: Only HTML text
91
- * <li><i>MIME_TYPE_PLAIN_TEXT</i>: Only plain text
92
- * <li><i>MIME_TYPE_MULTIPART</i>: Both, HTML and plain text
93
- * </ul>
94
- *
95
- * @return int the MIME type of this mailing template.
96
- */
97
- public function getMimeType();
98
-
99
- /**
100
- * Returns the HTML text part of this mailing template, or <i>null</i> if the MIME type is
101
- * <i>MIME_TYPE_PLAIN_TEXT</i>.
102
- *
103
- * @return string the HTML text part of this mailing template, if any.
104
- */
105
- public function getHtmlTextContent();
106
-
107
- /**
108
- * Updates the HTML text part of this mailing template. The mailing template will not be updated on the server until
109
- * <i>commitUpdate()</i> has been called.
110
- *
111
- * @param string $sHtmlTextContent the new HTML text part.
112
- */
113
- public function updateHtmlTextContent( $sHtmlTextContent );
114
-
115
- /**
116
- * Returns the plain text part of this mailing template, or <code>null</code> if the MIME type is
117
- * <i>MIME_TYPE_HTML_TEXT</i>.
118
- *
119
- * @return string the plain text part of this mailing template, if any.
120
- */
121
- public function getPlainTextContent();
122
-
123
- /**
124
- * Updates the plain text part of the mailing template. The mailing template will not be updated on the server until
125
- * <i>commitUpdate()</i> has been called.
126
- *
127
- * @param string $sPlainTextContent the new plain text part.
128
- */
129
- public function updatePlainTextContent( $sPlainTextContent );
130
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage MailingTemplate
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_MailingTemplate_MailingTemplate</i> represents reusable mailing content that can be used as a basis
8
+ * for new mailings.
9
+ * These templates are far less powerful than the templates provided by design collections, but can still save time in
10
+ * the creation of complex mailings with a common structure.
11
+ * <p>
12
+ * For an example on how to retrieve and create <i>MailingTemplate</i>s, see the
13
+ * <i>Inx_Api_MailingTemplate_MailingTemplateManager</i> documentation.
14
+ *
15
+ * @see Inx_Api_MailingTemplate_MailingTemplateManager
16
+ * @since API 1.4.0
17
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $*
18
+ * @package Inxmail
19
+ * @subpackage MailingTemplate
20
+ */
21
+ interface Inx_Api_MailingTemplate_MailingTemplate extends Inx_Api_BusinessObject
22
+ {
23
+ /**
24
+ * MIME type constant for HTML text templates. This template has only a HTML text part.
25
+ */
26
+ const MIME_TYPE_HTML_TEXT = 0;
27
+
28
+ /**
29
+ * MIME type constant for plain text templates. This template has only a plain text part.
30
+ */
31
+ const MIME_TYPE_PLAIN_TEXT = 1;
32
+
33
+ /**
34
+ * MIME type constant for multipart templates. This template has a HTML and a plain text part.
35
+ */
36
+ const MIME_TYPE_MULTIPART = 2;
37
+
38
+ /**
39
+ * Constant for the name attribute. Used for ordering by the <i>Inx_Api_MailingTemplate_MailingTemplateManager</i>.
40
+ *
41
+ * @see Inx_Api_MailingTemplate_MailingTemplateManager::select($oListContext, $iOrderAttribute, $iOrderType)
42
+ */
43
+ const ATTRIBUTE_NAME = 0;
44
+
45
+ /**
46
+ * Constant for the plain text attribute.
47
+ */
48
+ const ATTRIBUTE_PLAIN_TEXT = 1;
49
+
50
+ /**
51
+ * Constant for the HTML text attribute.
52
+ */
53
+ const ATTRIBUTE_HTML_TEXT = 2;
54
+
55
+ /**
56
+ * Constant for the list context id attribute.
57
+ */
58
+ const ATTRIBUTE_LIST_CONTEXT_ID = 3;
59
+
60
+ /**
61
+ * Constant for the MIME type attribute.
62
+ */
63
+ const ATTRIBUTE_MIME_TYPE = 4;
64
+
65
+ /**
66
+ * Returns the name of the mailing template.
67
+ *
68
+ * @return string the name of the mailing template.
69
+ */
70
+ public function getName();
71
+
72
+ /**
73
+ * Updates the name of the mailing template.
74
+ * The mailing template will not be updated on the server until <i>commitUpdate()</i> has been called.
75
+ *
76
+ * @param string $sName the new template name.
77
+ */
78
+ public function updateName( $sName );
79
+
80
+ /**
81
+ * Returns the id of the list which this mailing template belongs to.
82
+ *
83
+ * @return int the id of the list which this mailing template belongs to.
84
+ */
85
+ public function getListContextId();
86
+
87
+ /**
88
+ * Returns the MIME type of this mailing template. May be one of:
89
+ * <ul>
90
+ * <li><i>MIME_TYPE_HTML_TEXT</i>: Only HTML text
91
+ * <li><i>MIME_TYPE_PLAIN_TEXT</i>: Only plain text
92
+ * <li><i>MIME_TYPE_MULTIPART</i>: Both, HTML and plain text
93
+ * </ul>
94
+ *
95
+ * @return int the MIME type of this mailing template.
96
+ */
97
+ public function getMimeType();
98
+
99
+ /**
100
+ * Returns the HTML text part of this mailing template, or <i>null</i> if the MIME type is
101
+ * <i>MIME_TYPE_PLAIN_TEXT</i>.
102
+ *
103
+ * @return string the HTML text part of this mailing template, if any.
104
+ */
105
+ public function getHtmlTextContent();
106
+
107
+ /**
108
+ * Updates the HTML text part of this mailing template. The mailing template will not be updated on the server until
109
+ * <i>commitUpdate()</i> has been called.
110
+ *
111
+ * @param string $sHtmlTextContent the new HTML text part.
112
+ */
113
+ public function updateHtmlTextContent( $sHtmlTextContent );
114
+
115
+ /**
116
+ * Returns the plain text part of this mailing template, or <code>null</code> if the MIME type is
117
+ * <i>MIME_TYPE_HTML_TEXT</i>.
118
+ *
119
+ * @return string the plain text part of this mailing template, if any.
120
+ */
121
+ public function getPlainTextContent();
122
+
123
+ /**
124
+ * Updates the plain text part of the mailing template. The mailing template will not be updated on the server until
125
+ * <i>commitUpdate()</i> has been called.
126
+ *
127
+ * @param string $sPlainTextContent the new plain text part.
128
+ */
129
+ public function updatePlainTextContent( $sPlainTextContent );
130
+ }
lib/Inx/Api/MailingTemplate/MailingTemplateManager.php CHANGED
@@ -1,96 +1,96 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage MailingTemplate
5
- */
6
- /**
7
- * The <i>Inx_Api_MailingTemplate_MailingTemplateManager</i> can be used to manage mailing templates.
8
- * This includes the retrieval and creation of <i>Inx_Api_MailingTemplate_MailingTemplate</i>s.
9
- * <p>
10
- * To retrieve or create a globally available mailing template, use the system list. The following snippet shows how to
11
- * retrieve all global mailing templates ordered by name:
12
- *
13
- * <pre>
14
- * $oMailingTemplateManager = $oSession->getMailingTemplateManager();
15
- * $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
16
- *
17
- * $oBOResultSet = $oMailingTemplateManager->select( $oSystemListContext,
18
- * Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME, Inx_Api_Order::ASC );
19
- *
20
- * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
21
- * {
22
- * $oMailingTemplate = $oBOResultSet->get( $i );
23
- * echo $oMailingTemplate->getName()."&#60;br&#62;";
24
- * }
25
- *
26
- * $oBOResultSet->close();
27
- * </pre>
28
- *
29
- * To retrieve all mailing templates, disregarding their list membership, use the inherited <i>selectAll()</i> method.
30
- * <p>
31
- * Be aware that mailing template names are not nullable and are unique in each list.
32
- * However, it is possible to have two mailing templates with the same name in different lists.
33
- * The following snippet shows how to create an <i>Inx_Api_MailingTemplate_MailingTemplate</i> and update its name:
34
- *
35
- * <pre>
36
- * $oMailingTemplateManager = $oSession->getMailingTemplateManager();
37
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Name of the desired List&quot; );
38
- * $oMailingTemplate = $oMailingTemplateManager->createTemplate( $oListContext,
39
- * Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT );
40
- *
41
- * $oMailingTemplate->updateName( &quot;Desired name&quot; );
42
- * $oMailingTemplate->commitUpdate();
43
- * </pre>
44
- * <p>
45
- * The usage of mailing templates requires the api user right: <i>Inx_Api_UserRights::TEMPLATE_FEATURE_USE</i>
46
- * <p>
47
- * For more information on mailing templates, see the <i>Inx_Api_MailingTemplate_MailingTemplate</i> documentation.
48
- *
49
- * @see Inx_Api_MailingTemplate_MailingTemplate
50
- * @since API 1.4.0
51
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
52
- * @package Inxmail
53
- * @subpackage MailingTemplate
54
- */
55
- interface Inx_Api_MailingTemplate_MailingTemplateManager extends Inx_Api_BOManager
56
- {
57
-
58
- /**
59
- * Creates a mailing template in the specified list with the specified MIME type.
60
- *
61
- * @param Inx_Api_List_ListContext $oListContext the list this template belongs to.
62
- * @param int $iMimeType the MIME type of this template. May be one of:
63
- * <ul>
64
- * <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT</i>,
65
- * <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_PLAIN_TEXT</i> or
66
- * <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_MULTIPART</i>
67
- * </ul>
68
- * @return Inx_Api_MailingTemplate_MailingTempalte a new mailing template.
69
- */
70
- public function createTemplate( Inx_Api_List_ListContext $oListContext, $iMimeType );
71
-
72
- /**
73
- * Returns an <i>Inx_Api_BOResultSet</i> containing all mailing templates assigned to the given list, ordered by the
74
- * given attribute and order type.
75
- * To retrieve the globally available mailing templates, use the system list.
76
- * <p>
77
- * The following snippet shows how to retrieve the system list context:
78
- *
79
- * <pre>
80
- * $oSystemListContext = $oSession->getListContextManager()->findByName(
81
- * Inx_Api_List_SystemListContext::NAME );
82
- * </pre>
83
- *
84
- * @param Inx_Api_List_ListContext $oListContext all mailing templates assigned to this list will be fetched.
85
- * This parameter may <strong>not</strong> be <i>null</i>.
86
- * If you wish to retrieve all mailing templates, use <i>selectAll()</i> instead.
87
- * @param int $iOrderAttribute the id of the attribute used to order the result (only
88
- * <i>Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME</i>).
89
- * Be aware that any other attribute as well as ommitting this parameter will default to the name attribute.
90
- * @param int $iOrderType the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
91
- * May be ommitted if $iOrderAttribute is ommitted as well.
92
- * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all mailing templates assigned to the given list.
93
- */
94
- public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute = -1, $iOrderType = -1 );
95
-
96
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage MailingTemplate
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_MailingTemplate_MailingTemplateManager</i> can be used to manage mailing templates.
8
+ * This includes the retrieval and creation of <i>Inx_Api_MailingTemplate_MailingTemplate</i>s.
9
+ * <p>
10
+ * To retrieve or create a globally available mailing template, use the system list. The following snippet shows how to
11
+ * retrieve all global mailing templates ordered by name:
12
+ *
13
+ * <pre>
14
+ * $oMailingTemplateManager = $oSession->getMailingTemplateManager();
15
+ * $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
16
+ *
17
+ * $oBOResultSet = $oMailingTemplateManager->select( $oSystemListContext,
18
+ * Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME, Inx_Api_Order::ASC );
19
+ *
20
+ * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
21
+ * {
22
+ * $oMailingTemplate = $oBOResultSet->get( $i );
23
+ * echo $oMailingTemplate->getName()."&#60;br&#62;";
24
+ * }
25
+ *
26
+ * $oBOResultSet->close();
27
+ * </pre>
28
+ *
29
+ * To retrieve all mailing templates, disregarding their list membership, use the inherited <i>selectAll()</i> method.
30
+ * <p>
31
+ * Be aware that mailing template names are not nullable and are unique in each list.
32
+ * However, it is possible to have two mailing templates with the same name in different lists.
33
+ * The following snippet shows how to create an <i>Inx_Api_MailingTemplate_MailingTemplate</i> and update its name:
34
+ *
35
+ * <pre>
36
+ * $oMailingTemplateManager = $oSession->getMailingTemplateManager();
37
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Name of the desired List&quot; );
38
+ * $oMailingTemplate = $oMailingTemplateManager->createTemplate( $oListContext,
39
+ * Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT );
40
+ *
41
+ * $oMailingTemplate->updateName( &quot;Desired name&quot; );
42
+ * $oMailingTemplate->commitUpdate();
43
+ * </pre>
44
+ * <p>
45
+ * The usage of mailing templates requires the api user right: <i>Inx_Api_UserRights::TEMPLATE_FEATURE_USE</i>
46
+ * <p>
47
+ * For more information on mailing templates, see the <i>Inx_Api_MailingTemplate_MailingTemplate</i> documentation.
48
+ *
49
+ * @see Inx_Api_MailingTemplate_MailingTemplate
50
+ * @since API 1.4.0
51
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
52
+ * @package Inxmail
53
+ * @subpackage MailingTemplate
54
+ */
55
+ interface Inx_Api_MailingTemplate_MailingTemplateManager extends Inx_Api_BOManager
56
+ {
57
+
58
+ /**
59
+ * Creates a mailing template in the specified list with the specified MIME type.
60
+ *
61
+ * @param Inx_Api_List_ListContext $oListContext the list this template belongs to.
62
+ * @param int $iMimeType the MIME type of this template. May be one of:
63
+ * <ul>
64
+ * <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT</i>,
65
+ * <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_PLAIN_TEXT</i> or
66
+ * <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_MULTIPART</i>
67
+ * </ul>
68
+ * @return Inx_Api_MailingTemplate_MailingTempalte a new mailing template.
69
+ */
70
+ public function createTemplate( Inx_Api_List_ListContext $oListContext, $iMimeType );
71
+
72
+ /**
73
+ * Returns an <i>Inx_Api_BOResultSet</i> containing all mailing templates assigned to the given list, ordered by the
74
+ * given attribute and order type.
75
+ * To retrieve the globally available mailing templates, use the system list.
76
+ * <p>
77
+ * The following snippet shows how to retrieve the system list context:
78
+ *
79
+ * <pre>
80
+ * $oSystemListContext = $oSession->getListContextManager()->findByName(
81
+ * Inx_Api_List_SystemListContext::NAME );
82
+ * </pre>
83
+ *
84
+ * @param Inx_Api_List_ListContext $oListContext all mailing templates assigned to this list will be fetched.
85
+ * This parameter may <strong>not</strong> be <i>null</i>.
86
+ * If you wish to retrieve all mailing templates, use <i>selectAll()</i> instead.
87
+ * @param int $iOrderAttribute the id of the attribute used to order the result (only
88
+ * <i>Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME</i>).
89
+ * Be aware that any other attribute as well as ommitting this parameter will default to the name attribute.
90
+ * @param int $iOrderType the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
91
+ * May be ommitted if $iOrderAttribute is ommitted as well.
92
+ * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all mailing templates assigned to the given list.
93
+ */
94
+ public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute = -1, $iOrderType = -1 );
95
+
96
+ }
lib/Inx/Api/NameException.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * An <i>Inx_Api_NameException</i> is thrown when a specified name (e.g. attribute name) is invalid or already used.
7
- *
8
- * @see Inx_Api_Recipient_AttributeManager#create(string, int, int)
9
- * @since API 1.0
10
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
- * @package Inxmail
12
- */
13
- class Inx_Api_NameException extends Exception
14
- {
15
- /** Type indicating that the specified name is already used. */
16
- const DUPLICATE_NAME = 100;
17
-
18
- /** Type indicating that the specified name is invalid. */
19
- const ILLEGAL_NAME = 101;
20
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * An <i>Inx_Api_NameException</i> is thrown when a specified name (e.g. attribute name) is invalid or already used.
7
+ *
8
+ * @see Inx_Api_Recipient_AttributeManager#create(string, int, int)
9
+ * @since API 1.0
10
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
+ * @package Inxmail
12
+ */
13
+ class Inx_Api_NameException extends Exception
14
+ {
15
+ /** Type indicating that the specified name is already used. */
16
+ const DUPLICATE_NAME = 100;
17
+
18
+ /** Type indicating that the specified name is invalid. */
19
+ const ILLEGAL_NAME = 101;
20
+ }
lib/Inx/Api/NullPointerException.php CHANGED
@@ -1,12 +1,12 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
-
6
- /**
7
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
8
- * @package Inxmail
9
- */
10
- class Inx_Api_NullPointerException extends Exception
11
- {
12
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+
6
+ /**
7
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
8
+ * @package Inxmail
9
+ */
10
+ class Inx_Api_NullPointerException extends Exception
11
+ {
12
+ }
lib/Inx/Api/Order.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * Defines the order types, used by selections in result sets.
7
- *
8
- * @since API 1.0.1
9
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
10
- * @package Inxmail
11
- */
12
- interface Inx_Api_Order
13
- {
14
- /** Ascending order type. */
15
- const ASC = 0;
16
-
17
- /** Descending order type. */
18
- const DESC = 1;
19
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * Defines the order types, used by selections in result sets.
7
+ *
8
+ * @since API 1.0.1
9
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
10
+ * @package Inxmail
11
+ */
12
+ interface Inx_Api_Order
13
+ {
14
+ /** Ascending order type. */
15
+ const ASC = 0;
16
+
17
+ /** Descending order type. */
18
+ const DESC = 1;
19
+ }
lib/Inx/Api/Plugin/PluginStore.php CHANGED
@@ -1,99 +1,99 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Plugin
6
- */
7
- /**
8
- * The <i>Inx_Api_Plugin_PluginStore</i> is used by plug-ins for storing small amounts of data on the Inxmail
9
- * Professional system.
10
- * Each plug-in may only use its isolated storage, identified by the plug-in secret.
11
- * The data is allocated using unique keys.
12
- * <p>
13
- * <strong>Note:</strong> It is <strong>strongly recommended</strong> to upload a maximum of 1 MB of data.
14
- * Uploading too much data may significantly reduce the performance of the server.
15
- * <p>
16
- * The following snippet shows how to upload an image to the plug-in store of a plug-in with the secret id
17
- * "plug-in secret":
18
- *
19
- * <pre>
20
- * $oPluginStore = $oSession->getPluginStore();
21
- * $handle = fopen("test.png","r");
22
- * $oPluginStore->put("plug-in secret","test-image",$handle);
23
- * </pre>
24
- * <p>
25
- * The following snippet shows how to download the previously uploaded image for saving and displaying:
26
- *
27
- * <pre>
28
- * $oPluginStore = $oSession->getPluginStore();
29
- * $oInputStream = $oPluginStore->get("plug-in secret", "test-image");
30
- *
31
- * $validate = fopen("validate.png",'w') or die("can't open file");
32
- *
33
- * while(($chunk = $oInputStream->read()) != -1)
34
- * {
35
- * fwrite($validate,$chunk);
36
- * }
37
- *
38
- * fclose($validate);
39
- *
40
- * echo '&#60;img src="validate.png"&#62;';
41
- * </pre>
42
- *
43
- * @since API 1.7.0
44
- * @version $Revision: 2934 $ $Date: 2005-07-04 17:00:09 +0200 (Mo, 04 Jul 2005) $ $Author: bgn $
45
- * @package Inxmail
46
- * @subpackage Plugin
47
- */
48
- interface Inx_Api_Plugin_PluginStore
49
- {
50
-
51
- /**
52
- * Uploads data from a plug-in which needs to be stored in Inxmail Professional.
53
- * The data should be no bigger than 1 MB.
54
- * Uploading more data is <strong>strongly discouraged</strong> as it may significantly reduce the performance of the server.
55
- *
56
- * @param string $secretId the secret id of the plug-in.
57
- * @param string $key the key for the uploaded data.
58
- * @param Inx_Api_InputStream $is the input stream to read the data from.
59
- * @return bool <i>true</i> if the upload was successful, <i>false</i> otherwise.
60
- */
61
- public function put( $secretId, $key, $is );
62
-
63
-
64
- /**
65
- * Returns an <i>Inx_Api_InputStream</i> to download the data for the given key.
66
- *
67
- * @param string $secretId the secret id of the plug-in.
68
- * @param string $key the key of the data to download.
69
- * @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> to download the data.
70
- * @throws Inx_Api_DataException if the there is no data for that key (i.e. the key does not exist).
71
- */
72
- public function get( $secretId, $key );
73
-
74
-
75
- /**
76
- * Returns all keys which are stored for the given plug-in secret id.
77
- *
78
- * @param string $secretId the secret id of the plug-in.
79
- * @return array an array of string keys.
80
- */
81
- public function getKeys( $secretId );
82
-
83
-
84
- /**
85
- * Removes the given key and its value from the plug-in store. Removing an unknown key will have no effect.
86
- *
87
- * @param string $secretId the secret id of the plug-in.
88
- * @param string $key the key of the data which should be deleted.
89
- */
90
- public function remove( $secretId, $key );
91
-
92
-
93
- /**
94
- * Removes all keys from the plug-in store for the given plug-in secret id.
95
- *
96
- * @param string $secretId the secret id of the plug-in.
97
- */
98
- public function removeAll( $secretId );
99
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Plugin
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_Plugin_PluginStore</i> is used by plug-ins for storing small amounts of data on the Inxmail
9
+ * Professional system.
10
+ * Each plug-in may only use its isolated storage, identified by the plug-in secret.
11
+ * The data is allocated using unique keys.
12
+ * <p>
13
+ * <strong>Note:</strong> It is <strong>strongly recommended</strong> to upload a maximum of 1 MB of data.
14
+ * Uploading too much data may significantly reduce the performance of the server.
15
+ * <p>
16
+ * The following snippet shows how to upload an image to the plug-in store of a plug-in with the secret id
17
+ * "plug-in secret":
18
+ *
19
+ * <pre>
20
+ * $oPluginStore = $oSession->getPluginStore();
21
+ * $handle = fopen("test.png","r");
22
+ * $oPluginStore->put("plug-in secret","test-image",$handle);
23
+ * </pre>
24
+ * <p>
25
+ * The following snippet shows how to download the previously uploaded image for saving and displaying:
26
+ *
27
+ * <pre>
28
+ * $oPluginStore = $oSession->getPluginStore();
29
+ * $oInputStream = $oPluginStore->get("plug-in secret", "test-image");
30
+ *
31
+ * $validate = fopen("validate.png",'w') or die("can't open file");
32
+ *
33
+ * while(($chunk = $oInputStream->read()) != -1)
34
+ * {
35
+ * fwrite($validate,$chunk);
36
+ * }
37
+ *
38
+ * fclose($validate);
39
+ *
40
+ * echo '&#60;img src="validate.png"&#62;';
41
+ * </pre>
42
+ *
43
+ * @since API 1.7.0
44
+ * @version $Revision: 2934 $ $Date: 2005-07-04 17:00:09 +0200 (Mo, 04 Jul 2005) $ $Author: bgn $
45
+ * @package Inxmail
46
+ * @subpackage Plugin
47
+ */
48
+ interface Inx_Api_Plugin_PluginStore
49
+ {
50
+
51
+ /**
52
+ * Uploads data from a plug-in which needs to be stored in Inxmail Professional.
53
+ * The data should be no bigger than 1 MB.
54
+ * Uploading more data is <strong>strongly discouraged</strong> as it may significantly reduce the performance of the server.
55
+ *
56
+ * @param string $secretId the secret id of the plug-in.
57
+ * @param string $key the key for the uploaded data.
58
+ * @param Inx_Api_InputStream $is the input stream to read the data from.
59
+ * @return bool <i>true</i> if the upload was successful, <i>false</i> otherwise.
60
+ */
61
+ public function put( $secretId, $key, $is );
62
+
63
+
64
+ /**
65
+ * Returns an <i>Inx_Api_InputStream</i> to download the data for the given key.
66
+ *
67
+ * @param string $secretId the secret id of the plug-in.
68
+ * @param string $key the key of the data to download.
69
+ * @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> to download the data.
70
+ * @throws Inx_Api_DataException if the there is no data for that key (i.e. the key does not exist).
71
+ */
72
+ public function get( $secretId, $key );
73
+
74
+
75
+ /**
76
+ * Returns all keys which are stored for the given plug-in secret id.
77
+ *
78
+ * @param string $secretId the secret id of the plug-in.
79
+ * @return array an array of string keys.
80
+ */
81
+ public function getKeys( $secretId );
82
+
83
+
84
+ /**
85
+ * Removes the given key and its value from the plug-in store. Removing an unknown key will have no effect.
86
+ *
87
+ * @param string $secretId the secret id of the plug-in.
88
+ * @param string $key the key of the data which should be deleted.
89
+ */
90
+ public function remove( $secretId, $key );
91
+
92
+
93
+ /**
94
+ * Removes all keys from the plug-in store for the given plug-in secret id.
95
+ *
96
+ * @param string $secretId the secret id of the plug-in.
97
+ */
98
+ public function removeAll( $secretId );
99
+ }
lib/Inx/Api/PluginStatusService.php CHANGED
@@ -1,110 +1,110 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
-
6
-
7
- abstract class Inx_Api_PluginStatusService
8
- {
9
- protected $oService;
10
-
11
- protected static $_aProperties = array();
12
- protected $_sApplicationUrl = null;
13
-
14
- public static function create( $applicationUrl )
15
- {
16
- try
17
- {
18
- return new Inx_Apiimpl_AxisPluginStatusService($applicationUrl);
19
- }
20
- catch( Exception $x )
21
- {
22
- throw new Inx_Api_APIException( "Unknown error in PluginStatusService", $x );
23
- }
24
- }
25
-
26
-
27
- public function isPluginInstalled( $sPluginSecretId )
28
- {
29
- try
30
- {
31
- return $this->oService->isPluginInstalled( $sPluginSecretId );
32
- }
33
- catch( Inx_Api_RemoteException $x )
34
- {
35
- $this->rebuildException( $x );
36
- return null;
37
- }
38
- }
39
-
40
-
41
- public function isPluginActive( $pluginSecretId, $listContextId )
42
- {
43
- try
44
- {
45
- return $this->oService->isPluginActive( $pluginSecretId, $listContextId );
46
- }
47
- catch( Inx_Api_RemoteException $x )
48
- {
49
- $this->rebuildException( $x );
50
- return null;
51
- }
52
- }
53
-
54
-
55
- public function getListContextIdsWherePluginActive( $pluginSecretId )
56
- {
57
-
58
- try
59
- {
60
- return $this->oService->getListContextIdsWherePluginActive( $pluginSecretId );
61
- }
62
- catch( Inx_Api_RemoteException $x )
63
- {
64
- $this->rebuildException( $x );
65
- return null;
66
- }
67
- }
68
-
69
-
70
- protected abstract function rebuildException( Inx_Api_RemoteException $e );
71
-
72
-
73
-
74
- /**
75
- * Sets property value
76
- *
77
- * @param string $sKey Property name. Possible values are: <i>http.proxyHost</i>, <i>http.proxyPort</i>, <i>http.proxyUser</i>, <i>http.proxyPassword</i>, <i>soap.connectionTimeout</i>
78
- * @param string|int $sValue
79
- */
80
- public static function setProperty($sKey, $mxValue)
81
- {
82
- if (empty($sKey)) {
83
- throw new Inx_Api_IllegalArgumentException("Key can't be empty.");
84
- }
85
-
86
- if (! (is_string($mxValue) || is_int($mxValue))) {
87
- throw new Inx_Api_IllegalArgumentException("Value must be string or int.");
88
- }
89
-
90
- self::$_aProperties[$sKey] = $mxValue;
91
- }
92
-
93
- /**
94
- * Returns property value
95
- *
96
- * @param string $sKey
97
- * @return string|int
98
- */
99
- public static function getProperty($sKey)
100
- {
101
- if (empty($sKey)) {
102
- throw new Inx_Api_IllegalArgumentException("Key can't be empty.");
103
- }
104
- if (isset(self::$_aProperties[$sKey])) {
105
- return self::$_aProperties[$sKey];
106
- }
107
-
108
- return null;
109
- }
110
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+
6
+
7
+ abstract class Inx_Api_PluginStatusService
8
+ {
9
+ protected $oService;
10
+
11
+ protected static $_aProperties = array();
12
+ protected $_sApplicationUrl = null;
13
+
14
+ public static function create( $applicationUrl )
15
+ {
16
+ try
17
+ {
18
+ return new Inx_Apiimpl_AxisPluginStatusService($applicationUrl);
19
+ }
20
+ catch( Exception $x )
21
+ {
22
+ throw new Inx_Api_APIException( "Unknown error in PluginStatusService", $x );
23
+ }
24
+ }
25
+
26
+
27
+ public function isPluginInstalled( $sPluginSecretId )
28
+ {
29
+ try
30
+ {
31
+ return $this->oService->isPluginInstalled( $sPluginSecretId );
32
+ }
33
+ catch( Inx_Api_RemoteException $x )
34
+ {
35
+ $this->rebuildException( $x );
36
+ return null;
37
+ }
38
+ }
39
+
40
+
41
+ public function isPluginActive( $pluginSecretId, $listContextId )
42
+ {
43
+ try
44
+ {
45
+ return $this->oService->isPluginActive( $pluginSecretId, $listContextId );
46
+ }
47
+ catch( Inx_Api_RemoteException $x )
48
+ {
49
+ $this->rebuildException( $x );
50
+ return null;
51
+ }
52
+ }
53
+
54
+
55
+ public function getListContextIdsWherePluginActive( $pluginSecretId )
56
+ {
57
+
58
+ try
59
+ {
60
+ return $this->oService->getListContextIdsWherePluginActive( $pluginSecretId );
61
+ }
62
+ catch( Inx_Api_RemoteException $x )
63
+ {
64
+ $this->rebuildException( $x );
65
+ return null;
66
+ }
67
+ }
68
+
69
+
70
+ protected abstract function rebuildException( Inx_Api_RemoteException $e );
71
+
72
+
73
+
74
+ /**
75
+ * Sets property value
76
+ *
77
+ * @param string $sKey Property name. Possible values are: <i>http.proxyHost</i>, <i>http.proxyPort</i>, <i>http.proxyUser</i>, <i>http.proxyPassword</i>, <i>soap.connectionTimeout</i>
78
+ * @param string|int $sValue
79
+ */
80
+ public static function setProperty($sKey, $mxValue)
81
+ {
82
+ if (empty($sKey)) {
83
+ throw new Inx_Api_IllegalArgumentException("Key can't be empty.");
84
+ }
85
+
86
+ if (! (is_string($mxValue) || is_int($mxValue))) {
87
+ throw new Inx_Api_IllegalArgumentException("Value must be string or int.");
88
+ }
89
+
90
+ self::$_aProperties[$sKey] = $mxValue;
91
+ }
92
+
93
+ /**
94
+ * Returns property value
95
+ *
96
+ * @param string $sKey
97
+ * @return string|int
98
+ */
99
+ public static function getProperty($sKey)
100
+ {
101
+ if (empty($sKey)) {
102
+ throw new Inx_Api_IllegalArgumentException("Key can't be empty.");
103
+ }
104
+ if (isset(self::$_aProperties[$sKey])) {
105
+ return self::$_aProperties[$sKey];
106
+ }
107
+
108
+ return null;
109
+ }
110
+ }
lib/Inx/Api/Property/ApprovalPropertyValue.php CHANGED
@@ -1,141 +1,141 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Property
5
- */
6
- /**
7
- * The <i>Inx_Api_Property_ApprovalPropertyValue</i> is a wrapper class for the approval property values.
8
- * This value determines if and how mailings shall be approved and by whom.
9
- * An <i>Inx_Api_Property_ApprovalPropertyValue</i> therefore consists of three parts which define the approval strategy:
10
- * <ul>
11
- * <li><i>The approval type</i>: Defines if and how mailings shall be approved.
12
- * <li><i>The primary approver</i>: Approver that will be involved in all approval types immediately.
13
- * <li><i>The secondary approver</i>: Approver that will only get involved in certain conditions.
14
- * </ul>
15
- * If and how the approvers will get involved is determined from the approval type.
16
- * The possible values for the approval type are:
17
- * <p>
18
- * <ul>
19
- * <li><i>APPROVAL_TYPE_OFF</i>: Approval is completely turned off.
20
- * No approver will get involved, the editor is the only one responsible for the correctness of the mailing content.
21
- * <li><i>APPROVAL_TYPE_SYSTEM</i>: The approval type is inherited from the system list.
22
- * <li><i>APPROVAL_TYPE_IDENTICAL</i>: Both approvers will get involved immediately.
23
- * Only one of them has to approve the mailing.
24
- * <li><i>APPROVAL_TYPE_ESCALATION</i>: At first, only the primary approver will be involved.
25
- * If the escalation date expires without the primary approver having approved the mailing, the secondary
26
- * approver will get involved.
27
- * </ul>
28
- * <p>
29
- * To convert an <i>Inx_Api_Property_ApprovalPropertyValue</i> into the internal representation needed for the
30
- * approval property, use the
31
- * <i>Inx_Api_Property_PropertyFormatter::createApprovalPropertyValue($oApprovalPropertyValue)</i> method.
32
- * To convert the internal representation into an <i>Inx_Api_Property_ApprovalPropertyValue</i> object, use the
33
- * <i>Inx_Api_Property_PropertyFormatter::parseApprovalPropertyValue($oProperty)</i> method.
34
- *
35
- * @see com.inxmail.xpro.api.property.PropertyFormatter
36
- * @see com.inxmail.xpro.api.property.PropertyNames#APPROVAL_ACTIVE
37
- *
38
- * @since API 1.6.0
39
- * @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
40
- * @package Inxmail
41
- * @subpackage Property
42
- */
43
- class Inx_Api_Property_ApprovalPropertyValue
44
- {
45
- private $approvalType;
46
-
47
- private $primaryApproverId;
48
-
49
- private $secondaryApproverId;
50
-
51
- /**
52
- * Approval type used for deactivating the approval process.
53
- * No approver will get involved, the editor is the only one responsible for the correctness of the mailing content.
54
- */
55
- const APPROVAL_TYPE_OFF = 0;
56
-
57
- /**
58
- * Approval type used to inherit the type from the system approval property.
59
- * If this type is used in the system list, the system approval property will be set to <i>APPROVAL_TYPE_OFF</i>.
60
- */
61
- const APPROVAL_TYPE_SYSTEM = 1;
62
-
63
- /**
64
- * Approval type used for the escalating approval process.
65
- * At first, only the primary approver will be involved.
66
- * If the escalation date expires without the primary approver having approved the mailing, the secondary approver
67
- * will get involved.
68
- */
69
- const APPROVAL_TYPE_ESCALATION = 2;
70
-
71
- /**
72
- * Approval type used for the identical approval process.
73
- * Both approvers will get involved immediately.
74
- * Only one of them has to approve the mailing.
75
- */
76
- const APPROVAL_TYPE_IDENTICAL = 3;
77
-
78
-
79
- /**
80
- * Creates an <i>Inx_Api_Property_ApprovalPropertyValue</i> instance with the given approval type, primary
81
- * approver and secondary approver.
82
- * If the approval type is <i>APPROVAL_TYPE_OFF</i> or <i>APPROVAL_TYPE_SYSTEM</i>, no approvers need to be defined.
83
- * In that case use -1 as the id of both approvers.
84
- *
85
- * @param int $approvalType the approval type. May be one of:
86
- * <ul>
87
- * <li><i>APPROVAL_TYPE_OFF</i>
88
- * <li><i>APPROVAL_TYPE_SYSTEM</i>
89
- * <li><i>APPROVAL_TYPE_IDENTICAL</i>
90
- * <li><i>APPROVAL_TYPE_ESCALATION</i>
91
- * </ul>
92
- * @param int $primaryApproverId the id of the primary approver, or -1 if none is needed.
93
- * @param int $secondaryApproverId the id of the secondary approver, or -1 if none is needed.
94
- */
95
- public function __construct( $approvalType, $primaryApproverId, $secondaryApproverId )
96
- {
97
- $this->approvalType = $approvalType;
98
- $this->primaryApproverId = $primaryApproverId;
99
- $this->secondaryApproverId = $secondaryApproverId;
100
- }
101
-
102
-
103
- /**
104
- * Returns the type of the approval process, also indicates if the process is deactivated.
105
- *
106
- * @return int the approval type. May be one of:
107
- * <ul>
108
- * <li><i>APPROVAL_TYPE_OFF</i>
109
- * <li><i>APPROVAL_TYPE_SYSTEM</i>
110
- * <li><i>APPROVAL_TYPE_IDENTICAL</i>
111
- * <li><i>APPROVAL_TYPE_ESCALATION</i>
112
- * </ul>
113
- */
114
- public function getApprovalType()
115
- {
116
- return $this->approvalType;
117
- }
118
-
119
-
120
- /**
121
- * Returns the id of the primary approver.
122
- *
123
- * @return int the id of the primary approver.
124
- */
125
- public function getPrimaryApproverId()
126
- {
127
- return $this->primaryApproverId;
128
- }
129
-
130
-
131
- /**
132
- * Returns the id of the secondary approver.
133
- *
134
- * @return int the id of the secondary approver.
135
- */
136
- public function getSecondaryApproverId()
137
- {
138
- return $this->secondaryApproverId;
139
- }
140
-
141
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Property
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Property_ApprovalPropertyValue</i> is a wrapper class for the approval property values.
8
+ * This value determines if and how mailings shall be approved and by whom.
9
+ * An <i>Inx_Api_Property_ApprovalPropertyValue</i> therefore consists of three parts which define the approval strategy:
10
+ * <ul>
11
+ * <li><i>The approval type</i>: Defines if and how mailings shall be approved.
12
+ * <li><i>The primary approver</i>: Approver that will be involved in all approval types immediately.
13
+ * <li><i>The secondary approver</i>: Approver that will only get involved in certain conditions.
14
+ * </ul>
15
+ * If and how the approvers will get involved is determined from the approval type.
16
+ * The possible values for the approval type are:
17
+ * <p>
18
+ * <ul>
19
+ * <li><i>APPROVAL_TYPE_OFF</i>: Approval is completely turned off.
20
+ * No approver will get involved, the editor is the only one responsible for the correctness of the mailing content.
21
+ * <li><i>APPROVAL_TYPE_SYSTEM</i>: The approval type is inherited from the system list.
22
+ * <li><i>APPROVAL_TYPE_IDENTICAL</i>: Both approvers will get involved immediately.
23
+ * Only one of them has to approve the mailing.
24
+ * <li><i>APPROVAL_TYPE_ESCALATION</i>: At first, only the primary approver will be involved.
25
+ * If the escalation date expires without the primary approver having approved the mailing, the secondary
26
+ * approver will get involved.
27
+ * </ul>
28
+ * <p>
29
+ * To convert an <i>Inx_Api_Property_ApprovalPropertyValue</i> into the internal representation needed for the
30
+ * approval property, use the
31
+ * <i>Inx_Api_Property_PropertyFormatter::createApprovalPropertyValue($oApprovalPropertyValue)</i> method.
32
+ * To convert the internal representation into an <i>Inx_Api_Property_ApprovalPropertyValue</i> object, use the
33
+ * <i>Inx_Api_Property_PropertyFormatter::parseApprovalPropertyValue($oProperty)</i> method.
34
+ *
35
+ * @see com.inxmail.xpro.api.property.PropertyFormatter
36
+ * @see com.inxmail.xpro.api.property.PropertyNames#APPROVAL_ACTIVE
37
+ *
38
+ * @since API 1.6.0
39
+ * @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
40
+ * @package Inxmail
41
+ * @subpackage Property
42
+ */
43
+ class Inx_Api_Property_ApprovalPropertyValue
44
+ {
45
+ private $approvalType;
46
+
47
+ private $primaryApproverId;
48
+
49
+ private $secondaryApproverId;
50
+
51
+ /**
52
+ * Approval type used for deactivating the approval process.
53
+ * No approver will get involved, the editor is the only one responsible for the correctness of the mailing content.
54
+ */
55
+ const APPROVAL_TYPE_OFF = 0;
56
+
57
+ /**
58
+ * Approval type used to inherit the type from the system approval property.
59
+ * If this type is used in the system list, the system approval property will be set to <i>APPROVAL_TYPE_OFF</i>.
60
+ */
61
+ const APPROVAL_TYPE_SYSTEM = 1;
62
+
63
+ /**
64
+ * Approval type used for the escalating approval process.
65
+ * At first, only the primary approver will be involved.
66
+ * If the escalation date expires without the primary approver having approved the mailing, the secondary approver
67
+ * will get involved.
68
+ */
69
+ const APPROVAL_TYPE_ESCALATION = 2;
70
+
71
+ /**
72
+ * Approval type used for the identical approval process.
73
+ * Both approvers will get involved immediately.
74
+ * Only one of them has to approve the mailing.
75
+ */
76
+ const APPROVAL_TYPE_IDENTICAL = 3;
77
+
78
+
79
+ /**
80
+ * Creates an <i>Inx_Api_Property_ApprovalPropertyValue</i> instance with the given approval type, primary
81
+ * approver and secondary approver.
82
+ * If the approval type is <i>APPROVAL_TYPE_OFF</i> or <i>APPROVAL_TYPE_SYSTEM</i>, no approvers need to be defined.
83
+ * In that case use -1 as the id of both approvers.
84
+ *
85
+ * @param int $approvalType the approval type. May be one of:
86
+ * <ul>
87
+ * <li><i>APPROVAL_TYPE_OFF</i>
88
+ * <li><i>APPROVAL_TYPE_SYSTEM</i>
89
+ * <li><i>APPROVAL_TYPE_IDENTICAL</i>
90
+ * <li><i>APPROVAL_TYPE_ESCALATION</i>
91
+ * </ul>
92
+ * @param int $primaryApproverId the id of the primary approver, or -1 if none is needed.
93
+ * @param int $secondaryApproverId the id of the secondary approver, or -1 if none is needed.
94
+ */
95
+ public function __construct( $approvalType, $primaryApproverId, $secondaryApproverId )
96
+ {
97
+ $this->approvalType = $approvalType;
98
+ $this->primaryApproverId = $primaryApproverId;
99
+ $this->secondaryApproverId = $secondaryApproverId;
100
+ }
101
+
102
+
103
+ /**
104
+ * Returns the type of the approval process, also indicates if the process is deactivated.
105
+ *
106
+ * @return int the approval type. May be one of:
107
+ * <ul>
108
+ * <li><i>APPROVAL_TYPE_OFF</i>
109
+ * <li><i>APPROVAL_TYPE_SYSTEM</i>
110
+ * <li><i>APPROVAL_TYPE_IDENTICAL</i>
111
+ * <li><i>APPROVAL_TYPE_ESCALATION</i>
112
+ * </ul>
113
+ */
114
+ public function getApprovalType()
115
+ {
116
+ return $this->approvalType;
117
+ }
118
+
119
+
120
+ /**
121
+ * Returns the id of the primary approver.
122
+ *
123
+ * @return int the id of the primary approver.
124
+ */
125
+ public function getPrimaryApproverId()
126
+ {
127
+ return $this->primaryApproverId;
128
+ }
129
+
130
+
131
+ /**
132
+ * Returns the id of the secondary approver.
133
+ *
134
+ * @return int the id of the secondary approver.
135
+ */
136
+ public function getSecondaryApproverId()
137
+ {
138
+ return $this->secondaryApproverId;
139
+ }
140
+
141
+ }
lib/Inx/Api/Property/FormatChoicePropertyFormatter.php CHANGED
@@ -1,467 +1,467 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Property
5
- */
6
- /**
7
- * The <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> is used for converting the mail format property
8
- * to and from the internal string representation.
9
- * For this property, there is no dedicated value holder like the <i>Inx_Api_Property_ApprovalPropertyValue</i>.
10
- * Instead, the formatter itself contains all relevant data:
11
- * <p>
12
- * <ul>
13
- * <li><i>The formatting (choice) strategy</i>: Defines how mailings shall be formatted.
14
- * <li><i>The default format</i>: Defines which format shall be used by default.
15
- * <li><i>The attribute id</i>: Defines the recipient attribute which shall be used to determine which format to use.
16
- * <li><i>The patterns</i>: Define which attribute value will trigger the use of a specific format.
17
- * </ul>
18
- * The formatting (choice) strategy may be one of the following constants:
19
- * <p>
20
- * <ul>
21
- * <li><i>MAILING_FORMAT_STRATEGY</i>: The editor may freely choose the mail format for each individual mailing.
22
- * Used by <i>formatMailingChoice()</i>.
23
- * <li><i>FIXED_STRATEGY</i>: Only one specific mail format may be used.
24
- * Used by <i>formatFixedChoice($sFormat)</i>.
25
- * <li><i>ATTRIBUTE_STRATEGY</i>: A recipient attribute is used to determine the mail format.
26
- * Used by <i>formatAttributeChoice($iAttributeId, $sDefaultFormat, $sPlainTextPattern, $sHtmlTextPattern, $sMultipartPattern)</i>.
27
- * </ul>
28
- * The default format is used by the <i>FIXED_STRATEGY</i> and the <i>ATTRIBUTE_STRATEGY</i>.
29
- * The possible formats are:
30
- * <p>
31
- * <ul>
32
- * <li><i>PLAIN_TEXT_FORMAT</i>: Mailings will contain plain text only.
33
- * <li><i>HTML_TEXT_FORMAT</i>: Mailings will contain HTML text only.
34
- * <li><i>MULTIPART_FORMAT</i>: Mailings will contain both, plain and HTML text parts.
35
- * </ul>
36
- * <p>
37
- * <strong>Note:</strong> When using the <i>ATTRIBUTE_STRATEGY</i> it is recommended to create multipart mailings only.
38
- * However, it is still possible to create plain or HTML text mailings.
39
- * Be aware that in such a case, all recipients will receive the mailing in the same format (which is plain or HTML text).
40
- * <p>
41
- * The attribute strategy requires an attribute id, a default mail format and attribute value patterns that determine
42
- * which mail format to use.
43
- * If the value of an attribute matches the pattern, the format associated to this pattern will be chosen.
44
- * If the value matches none of the specified patterns, the default format will be used.
45
- * The pattern of the default format is automatically set to <i>null</i>.
46
- * <p>
47
- * The patterns are <strong>not</strong> patterns in the ordinary sense.
48
- * No operators or wildcards are allowed and the value is case sensitive and without quotes.
49
- * Let's say we use the following patterns:
50
- * <p>
51
- * <ul>
52
- * <li><i>Plain text pattern</i>: plain%
53
- * <li><i>HTML text pattern</i>: html
54
- * <li><i>Multipart pattern (default)</i>: multipart
55
- * </ul>
56
- * If the attribute value is equal to plain, the recipient will get a multipart mailing as the % wildcard is considered
57
- * an ordinary character.
58
- * If it is equal to html, the recipient gets the HTML flavour.
59
- * However, if the attribute value is equal to HTML, the recipient will also get a multipart mailing, as the patterns
60
- * are case sensitive.
61
- * The multipart pattern may also be set to <i>null</i> as multipart is the default format and therefore the pattern
62
- * is set to <i>null</i> anyway.
63
- * <p>
64
- * The following snippet shows how to retrieve and parse the mail format property of the specified list:
65
- *
66
- * <pre>
67
- * $oListContext = $oSession->getListContextManager()->findByName(&quot;Desired list&quot;);
68
- * $oProperty = $oListContext->findProperty(Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE);
69
- *
70
- * $oFormatChoicePropertyFormatter = Inx_Api_Property_FormatChoicePropertyFormatter::parse($oProperty);
71
- * echo &quot;Format strategy: &quot;.$oFormatChoicePropertyFormatter->getChoiceStategy()."&#60;br&#62;";
72
- * echo &quot;Default format: &quot;.$oFormatChoicePropertyFormatter->getDefaultFormat()."&#60;br&#62;";
73
- * echo &quot;Attribute id: &quot;.$oFormatChoicePropertyFormatter->getAttributeId()."&#60;br&#62;";
74
- * echo &quot;HTML pattern: &quot;.$oFormatChoicePropertyFormatter->getPattern(
75
- * Inx_Api_Property_FormatChoicePropertyFormatter::HTML_TEXT_FORMAT)."&#60;br&#62;";
76
- * </pre>
77
- * <p>
78
- * To give the editor free choice to use any mail format she or he considers appropriate, use the
79
- * <i>formatMailingChoice()</i> method.
80
- * The following snippet shows how this can be achieved:
81
- *
82
- * <pre>
83
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
84
- * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
85
- *
86
- * $oProperty->updateInternalValue( Inx_Api_Property_FormatChoicePropertyFormatter::formatMailingChoice() );
87
- * $oProperty->commitUpdate();
88
- * </pre>
89
- * <p>
90
- * The opposite strategy is to restrict all mailings of a list to a certain mail format.
91
- * The following snippet shows how to restrict the mailing format of the specified list to the multipart format:
92
- *
93
- * <pre>
94
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
95
- * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
96
- *
97
- * $oProperty->updateInternalValue( Inx_Api_Property_FormatChoicePropertyFormatter::formatFixedChoice(
98
- * Inx_Api_Property_FormatChoicePropertyFormatter::MULTIPART_FORMAT ) );
99
- * $oProperty->commitUpdate();
100
- * </pre>
101
- * <p>
102
- * The final strategy is to choose the mailing format based on the value of a recipient attribute.
103
- * The following snippet shows how to send HTML mailings to recipients with the attribute value html, plain text
104
- * mailings to recipients with the attribute value plain and multipart mailings to all other recipients:
105
- *
106
- * <pre>
107
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
108
- * $oRecipientMetaData = $oSession->createRecipientContext()->getMetaData();
109
- * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
110
- *
111
- * $iAttributeId = $oRecipientMetaData->getUserAttribute( &quot;format&quot; )->getId();
112
- * $sPlainTextPattern = &quot;plain&quot;;
113
- * $sHtmlTextPattern = &quot;html&quot;;
114
- *
115
- * $sStrategy = Inx_Api_Property_FormatChoicePropertyFormatter::formatAttributeChoice( $iAttributeId,
116
- * Inx_Api_Property_FormatChoicePropertyFormatter::MULTIPART_FORMAT, $sPlainTextPattern, $sHtmlTextPattern, null );
117
- * $oProperty->updateInternalValue( $sStrategy );
118
- * $oProperty->commitUpdate();
119
- * </pre>
120
- * <p>
121
- * For more information on properties in general, see the <i>Inx_Api_Property_Property</i> documentation.
122
- *
123
- * @see Inx_Api_Property_Property
124
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
125
- * @package Inxmail
126
- * @subpackage Property
127
- */
128
- class Inx_Api_Property_FormatChoicePropertyFormatter
129
- {
130
- const PREFIX = "EmailFormat[";
131
-
132
- const SUFFIX = "]";
133
-
134
-
135
- /**
136
- * Strategy constant which lets the editor freely choose the appropriate mail format.
137
- *
138
- * @var int
139
- */
140
- const MAILING_FORMAT_STRATEGY = 0;
141
-
142
- /**
143
- * Strategy constant which restricts the mail format to exactly one specified format.
144
- *
145
- * @var int
146
- */
147
- const FIXED_STRATEGY = 1;
148
-
149
- /**
150
- * Strategy constant which is used to determine the mail format based on the value of a recipient attribute.
151
- *
152
- * @var int
153
- */
154
- const ATTRIBUTE_STRATEGY = 2;
155
-
156
-
157
- /**
158
- * Constant for the plain text pattern.
159
- *
160
- * @var string
161
- */
162
- const PLAIN_TEXT_FORMAT = "text/plain";
163
-
164
- /**
165
- * Constant for the HTML text pattern.
166
- *
167
- * @var string
168
- */
169
- const HTML_TEXT_FORMAT = "text/html";
170
-
171
- /**
172
- * Constant for the multipart pattern.
173
- *
174
- * @var string
175
- */
176
- const MULTIPART_FORMAT = "multipart";
177
-
178
-
179
- /**
180
- * The strategy used to choose the mailing format.
181
- *
182
- * @var int
183
- */
184
- protected $iChoiceStategy;
185
-
186
- /**
187
- * The attribute that controls which format to choose.
188
- *
189
- * @var int
190
- */
191
- protected $iAttributeId;
192
-
193
- /**
194
- * The plain text pattern.
195
- *
196
- * @var string
197
- */
198
- protected $sPlainTextPattern;
199
-
200
- /**
201
- * The HTML text pattern.
202
- *
203
- * @var string
204
- */
205
- protected $sHtmlTextPattern;
206
-
207
- /**
208
- * The multipart pattern.
209
- *
210
- * @var string
211
- */
212
- protected $sMultipartPattern;
213
-
214
- /**
215
- * The default mailing format.
216
- *
217
- * @var string
218
- */
219
- protected $sFormat;
220
-
221
-
222
- /**
223
- * Default constructor which may only be used by derived classes.
224
- */
225
- protected function __construct()
226
- {}
227
-
228
-
229
- /**
230
- * Parses the given property and extracts the format choice policy into a new
231
- * <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> for easy retrieval.
232
- * Only the <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i> property is allowed.
233
- * Using any other property will trigger an <i>Inx_Api_IllegalArgumentException</i>.
234
- *
235
- * @param property the property to parse.
236
- * @return Inx_Api_Property_FormatChoicePropertyFormatter an <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>
237
- * which can be used for easy retrieval of the property values.
238
- * @throws Inx_Api_IllegalArgumentException if the given property is not an
239
- * <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i> property.
240
- */
241
- public static function parse( Inx_Api_Property_Property $oProperty )
242
- {
243
- $sValue = $oProperty->getInternalValue();
244
- $oFormat = new Inx_Api_Property_FormatChoicePropertyFormatter();
245
-
246
- if( $sValue === null || strlen($sValue) == 0 )
247
- {
248
- $oFormat->iChoiceStategy = self::MAILING_FORMAT_STRATEGY;
249
- return $oFormat;
250
- }
251
-
252
- if( strpos($sValue, self::PREFIX) === 0 && true ===(strrpos($sValue, self::SUFFIX) == strlen($sValue) - strlen(self::SUFFIX)) )
253
- {
254
- $s = substr($sValue, strlen(self::PREFIX), -1);
255
-
256
-
257
- if( strcmp('0', $s) === 0 ) // EmailFormat[0]
258
- {
259
- $oFormat->iChoiceStategy = self::MAILING_FORMAT_STRATEGY;
260
- return $oFormat;
261
- }
262
- if( strcmp('1|text/plain', $s ) === 0 ) // EmailFormat[1|text/plain]
263
- {
264
- $oFormat->iChoiceStategy = self::FIXED_STRATEGY;
265
- $oFormat->sFormat = self::PLAIN_TEXT_FORMAT;
266
- return $oFormat;
267
- }
268
- if( strcmp('1|text/html', $s ) === 0) // EmailFormat[1|text/html]
269
- {
270
- $oFormat->iChoiceStategy = self::FIXED_STRATEGY;
271
- $oFormat->sFormat = self::HTML_TEXT_FORMAT;
272
- return $oFormat;
273
- }
274
- if( strcmp('1|multipart', $s ) === 0 ) // EmailFormat[1|multipart]
275
- {
276
- $oFormat->iChoiceStategy = self::FIXED_STRATEGY;
277
- $oFormat->sFormat = self::MULTIPART_FORMAT;
278
- return $oFormat;
279
- }
280
-
281
- // EmailFormat[2|<attrId>|<htmltext-pattern>|<plaintext-pattern>|<multipart-pattern>|<defaultForamt>]
282
- $aTokens = explode('|', $s);
283
- if ((count($aTokens) === 6) && strcmp('2', $aTokens[0]) === 0 && ctype_digit($aTokens[1]))
284
- {
285
- $oFormat->iChoiceStategy = self::ATTRIBUTE_STRATEGY;
286
- $oFormat->iAttributeId = (int) $aTokens[1];
287
- $oFormat->sHtmlTextPattern = $aTokens[2];
288
- $oFormat->sPlainTextPattern = $aTokens[3];
289
- $oFormat->sMultipartPattern = $aTokens[4];
290
- $df = $aTokens[5];
291
- if(strcmp($df, self::PLAIN_TEXT_FORMAT) === 0) {
292
- $oFormat->sFormat = self::PLAIN_TEXT_FORMAT;
293
- return $oFormat;
294
- }
295
-
296
- if(strcmp($df, self::HTML_TEXT_FORMAT) === 0) {
297
- $oFormat->sFormat = self::HTML_TEXT_FORMAT;
298
- return $oFormat;
299
- }
300
-
301
- if(strcmp($df, self::MULTIPART_FORMAT) === 0) {
302
- $oFormat->sFormat = self::MULTIPART_FORMAT;
303
- return $oFormat;
304
- }
305
- }
306
- }
307
- throw new Inx_Api_IllegalArgumentException( "illegal mail choise format: " . value );
308
- }
309
-
310
- /**
311
- * Returns the formatting (choice) strategy. May be one of:
312
- * <ul>
313
- * <li><i>MAILING_FORMAT_STRATEGY</i>
314
- * <li><i>FIXED_STRATEGY</i>
315
- * <li><i>ATTRIBUTE_STRATEGY</i>
316
- * </ul>
317
- *
318
- * @return int the formatting (choice) strategy.
319
- */
320
- public function getChoiceStategy()
321
- {
322
- return $this->iChoiceStategy;
323
- }
324
-
325
- /**
326
- * Returns the id of the recipient attribute used to determine the mailing format.
327
- * If the choice strategy is not <i>ATTRIBUTE_STRATEGY</i>, 0 will be returned.
328
- *
329
- * @return int the id of the recipient attribute used to determine the mailing format, or 0 if none is needed.
330
- */
331
- public function getAttributeId()
332
- {
333
- return $this->iAttributeId;
334
- }
335
-
336
- /**
337
- * Returns the pattern for the given mailing format.
338
- * Patterns are only used by the choice strategy <i>ATTRIBUTE_STRATEGY</i>.
339
- *
340
- * @param string $sFormat the mailing format for which the pattern shall be returned. May be one of:
341
- * <ul>
342
- * <li><i>PLAIN_TEXT_FORMAT</i>
343
- * <li><i>HTML_TEXT_FORMAT</i>
344
- * <li><i>MULTIPART_FORMAT</i>
345
- * </ul>
346
- * @return string the pattern for the given format, if any, <i>null</i> otherwise.
347
- */
348
- public function getPattern( $sFormat )
349
- {
350
- if( strcmp($sFormat, self::PLAIN_TEXT_FORMAT) === 0 )
351
- return $this->sPlainTextPattern;
352
- if( strcmp($sFormat, self::HTML_TEXT_FORMAT) === 0 )
353
- return $this->sHtmlTextPattern;
354
- if( strcmp($sFormat, self::MULTIPART_FORMAT) === 0 )
355
- return $this->sMultipartPattern;
356
-
357
- throw new Inx_Api_IllegalArgumentException( "unknown format: " . $sFormat );
358
- }
359
-
360
- /**
361
- * Returns the default mailing format.
362
- * The default format is only used by the choice strategies <i>FIXED_STRATEGY</i> and <i>ATTRIBUTE_STRATEGY</i>.
363
- *
364
- * @return string the default mailing format, if any, <i>null</i> otherwise.
365
- */
366
- public function getDefaultFormat()
367
- {
368
- return $this->sFormat;
369
- }
370
-
371
- /**
372
- * Creates the internal string value for the <i>MAILING_FORMAT_STRATEGY</i>.
373
- *
374
- * @return string the internal string value for the <i>MAILING_FORMAT_STRATEGY</i>.
375
- */
376
- public static function formatMailingChoice()
377
- {
378
- return self::PREFIX . "0" . self::SUFFIX;
379
- }
380
-
381
- /**
382
- * Creates the internal string value for the <i>FIXED_STRATEGY</i> using the given default mailing format.
383
- * The default format may be one of:
384
- * <ul>
385
- * <li><i>PLAIN_TEXT_FORMAT</i>
386
- * <li><i>HTML_TEXT_FORMAT</i>
387
- * <li><i>MULTIPART_FORMAT</i>
388
- * </ul>
389
- *
390
- * @param string $sFormat the default mailing format.
391
- * @return string the internal string value for the <i>FIXED_STRATEGY</i>.
392
- */
393
- public static function formatFixedChoice( $sFormat )
394
- {
395
- self::checkFormat( $sFormat );
396
- return self::PREFIX . "1|" . $sFormat . self::SUFFIX;
397
- }
398
-
399
- /**
400
- * Creates the internal string value for the <i>ATTRIBUTE_STRATEGY</i> using the given recipient attribute id,
401
- * default mailing format and patterns.
402
- * For a description of the pattern syntax, see the documentation of this class.
403
- * The default mailing attribute may be one of:
404
- * <ul>
405
- * <li><i>PLAIN_TEXT_FORMAT</i>
406
- * <li><i>HTML_TEXT_FORMAT</i>
407
- * <li><i>MULTIPART_FORMAT</i>
408
- * </ul>
409
- *
410
- * @param int $iAttributeId the id of the recipient attribute used to determine the mailing format.
411
- * @param string $sDefaultFormat the default mailing format.
412
- * @param string $sPlainTextPattern the plain text pattern. May be <i>null</i> if this is the default format.
413
- * @param string $sHtmlTextPattern the HTML text pattern. May be <i>null</i> if this is the default format.
414
- * @param string $sMultipartPattern the multipart text pattern. May be <i>null</i> if this is the default format.
415
- * @return string the internal string value for the <i>ATTRIBUTE_STRATEGY</i>.
416
- */
417
- public static function formatAttributeChoice( $iAttributeId, $sDefaultFormat,
418
- $sPlainTextPattern, $sHtmlTextPattern, $sMultipartPattern )
419
- {
420
- if( strcmp($sDefaultFormat, self::PLAIN_TEXT_FORMAT) === 0)
421
- {
422
- //fixes XAPI35 (comment): use "null" instead of null
423
- $sPlainTextPattern = "null";
424
- if( $sHtmlTextPattern === null || strlen($sHtmlTextPattern) == 0 )
425
- throw new Inx_Api_IllegalArgumentException( "htmlTextPattern - illegal value: " . $sHtmlTextPattern );
426
- if( $sMultipartPattern === null || strlen($sMultipartPattern) == 0 )
427
- throw new Inx_Api_IllegalArgumentException( "multipartPattern - illegal value: " . $sMultipartPattern );
428
- }
429
- else if( strcmp($sDefaultFormat, self::HTML_TEXT_FORMAT) === 0)
430
- {
431
- //fixes XAPI35 (comment): use "null" instead of null
432
- $sHtmlTextPattern = "null";
433
- if( $sPlainTextPattern === null || strlen($sPlainTextPattern) == 0 )
434
- throw new Inx_Api_IllegalArgumentException( "plainTextPattern - illegal value: " . $sPlainTextPattern );
435
- if( $sMultipartPattern === null || strlen($sMultipartPattern) == 0 )
436
- throw new Inx_Api_IllegalArgumentException( "multipartPattern - illegal value: " . $sMultipartPattern );
437
- }
438
- else if( strcmp($sDefaultFormat, self::MULTIPART_FORMAT) === 0 )
439
- {
440
- //fixes XAPI35 (comment): use "null" instead of null
441
- $sMultipartPattern = "null";
442
- //fixes XAPI-35: strlen() instead of length()
443
- if( $sPlainTextPattern === null || strlen($sPlainTextPattern) == 0 )
444
- throw new Inx_Api_IllegalArgumentException( "plainTextPattern - illegal value: " . $sPlainTextPattern );
445
- if( $sHtmlTextPattern === null || strlen($sHtmlTextPattern) == 0 )
446
- throw new Inx_Api_IllegalArgumentException( "htmlTextPattern - illegal value: " . $sHtmlTextPattern );
447
- }
448
- else
449
- throw new Inx_Api_IllegalArgumentException( "unknown defaultFormat: " . $sDefaultFormat );
450
-
451
- return self::PREFIX . "2|" . $iAttributeId . "|" . $sHtmlTextPattern . "|" . $sPlainTextPattern
452
- . "|" . $sMultipartPattern . "|" . $sDefaultFormat . self::SUFFIX;
453
- }
454
-
455
-
456
- private static function checkFormat( $sFormat )
457
- {
458
- if( strcmp(self::PLAIN_TEXT_FORMAT, $sFormat ) === 0)
459
- return;
460
- if( strcmp(self::HTML_TEXT_FORMAT, $sFormat ) === 0)
461
- return;
462
- if( strcmp(self::MULTIPART_FORMAT, $sFormat ) === 0)
463
- return;
464
-
465
- throw new Inx_Api_IllegalArgumentException( "unknown format: " . $sFormat );
466
- }
467
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Property
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> is used for converting the mail format property
8
+ * to and from the internal string representation.
9
+ * For this property, there is no dedicated value holder like the <i>Inx_Api_Property_ApprovalPropertyValue</i>.
10
+ * Instead, the formatter itself contains all relevant data:
11
+ * <p>
12
+ * <ul>
13
+ * <li><i>The formatting (choice) strategy</i>: Defines how mailings shall be formatted.
14
+ * <li><i>The default format</i>: Defines which format shall be used by default.
15
+ * <li><i>The attribute id</i>: Defines the recipient attribute which shall be used to determine which format to use.
16
+ * <li><i>The patterns</i>: Define which attribute value will trigger the use of a specific format.
17
+ * </ul>
18
+ * The formatting (choice) strategy may be one of the following constants:
19
+ * <p>
20
+ * <ul>
21
+ * <li><i>MAILING_FORMAT_STRATEGY</i>: The editor may freely choose the mail format for each individual mailing.
22
+ * Used by <i>formatMailingChoice()</i>.
23
+ * <li><i>FIXED_STRATEGY</i>: Only one specific mail format may be used.
24
+ * Used by <i>formatFixedChoice($sFormat)</i>.
25
+ * <li><i>ATTRIBUTE_STRATEGY</i>: A recipient attribute is used to determine the mail format.
26
+ * Used by <i>formatAttributeChoice($iAttributeId, $sDefaultFormat, $sPlainTextPattern, $sHtmlTextPattern, $sMultipartPattern)</i>.
27
+ * </ul>
28
+ * The default format is used by the <i>FIXED_STRATEGY</i> and the <i>ATTRIBUTE_STRATEGY</i>.
29
+ * The possible formats are:
30
+ * <p>
31
+ * <ul>
32
+ * <li><i>PLAIN_TEXT_FORMAT</i>: Mailings will contain plain text only.
33
+ * <li><i>HTML_TEXT_FORMAT</i>: Mailings will contain HTML text only.
34
+ * <li><i>MULTIPART_FORMAT</i>: Mailings will contain both, plain and HTML text parts.
35
+ * </ul>
36
+ * <p>
37
+ * <strong>Note:</strong> When using the <i>ATTRIBUTE_STRATEGY</i> it is recommended to create multipart mailings only.
38
+ * However, it is still possible to create plain or HTML text mailings.
39
+ * Be aware that in such a case, all recipients will receive the mailing in the same format (which is plain or HTML text).
40
+ * <p>
41
+ * The attribute strategy requires an attribute id, a default mail format and attribute value patterns that determine
42
+ * which mail format to use.
43
+ * If the value of an attribute matches the pattern, the format associated to this pattern will be chosen.
44
+ * If the value matches none of the specified patterns, the default format will be used.
45
+ * The pattern of the default format is automatically set to <i>null</i>.
46
+ * <p>
47
+ * The patterns are <strong>not</strong> patterns in the ordinary sense.
48
+ * No operators or wildcards are allowed and the value is case sensitive and without quotes.
49
+ * Let's say we use the following patterns:
50
+ * <p>
51
+ * <ul>
52
+ * <li><i>Plain text pattern</i>: plain%
53
+ * <li><i>HTML text pattern</i>: html
54
+ * <li><i>Multipart pattern (default)</i>: multipart
55
+ * </ul>
56
+ * If the attribute value is equal to plain, the recipient will get a multipart mailing as the % wildcard is considered
57
+ * an ordinary character.
58
+ * If it is equal to html, the recipient gets the HTML flavour.
59
+ * However, if the attribute value is equal to HTML, the recipient will also get a multipart mailing, as the patterns
60
+ * are case sensitive.
61
+ * The multipart pattern may also be set to <i>null</i> as multipart is the default format and therefore the pattern
62
+ * is set to <i>null</i> anyway.
63
+ * <p>
64
+ * The following snippet shows how to retrieve and parse the mail format property of the specified list:
65
+ *
66
+ * <pre>
67
+ * $oListContext = $oSession->getListContextManager()->findByName(&quot;Desired list&quot;);
68
+ * $oProperty = $oListContext->findProperty(Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE);
69
+ *
70
+ * $oFormatChoicePropertyFormatter = Inx_Api_Property_FormatChoicePropertyFormatter::parse($oProperty);
71
+ * echo &quot;Format strategy: &quot;.$oFormatChoicePropertyFormatter->getChoiceStategy()."&#60;br&#62;";
72
+ * echo &quot;Default format: &quot;.$oFormatChoicePropertyFormatter->getDefaultFormat()."&#60;br&#62;";
73
+ * echo &quot;Attribute id: &quot;.$oFormatChoicePropertyFormatter->getAttributeId()."&#60;br&#62;";
74
+ * echo &quot;HTML pattern: &quot;.$oFormatChoicePropertyFormatter->getPattern(
75
+ * Inx_Api_Property_FormatChoicePropertyFormatter::HTML_TEXT_FORMAT)."&#60;br&#62;";
76
+ * </pre>
77
+ * <p>
78
+ * To give the editor free choice to use any mail format she or he considers appropriate, use the
79
+ * <i>formatMailingChoice()</i> method.
80
+ * The following snippet shows how this can be achieved:
81
+ *
82
+ * <pre>
83
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
84
+ * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
85
+ *
86
+ * $oProperty->updateInternalValue( Inx_Api_Property_FormatChoicePropertyFormatter::formatMailingChoice() );
87
+ * $oProperty->commitUpdate();
88
+ * </pre>
89
+ * <p>
90
+ * The opposite strategy is to restrict all mailings of a list to a certain mail format.
91
+ * The following snippet shows how to restrict the mailing format of the specified list to the multipart format:
92
+ *
93
+ * <pre>
94
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
95
+ * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
96
+ *
97
+ * $oProperty->updateInternalValue( Inx_Api_Property_FormatChoicePropertyFormatter::formatFixedChoice(
98
+ * Inx_Api_Property_FormatChoicePropertyFormatter::MULTIPART_FORMAT ) );
99
+ * $oProperty->commitUpdate();
100
+ * </pre>
101
+ * <p>
102
+ * The final strategy is to choose the mailing format based on the value of a recipient attribute.
103
+ * The following snippet shows how to send HTML mailings to recipients with the attribute value html, plain text
104
+ * mailings to recipients with the attribute value plain and multipart mailings to all other recipients:
105
+ *
106
+ * <pre>
107
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
108
+ * $oRecipientMetaData = $oSession->createRecipientContext()->getMetaData();
109
+ * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
110
+ *
111
+ * $iAttributeId = $oRecipientMetaData->getUserAttribute( &quot;format&quot; )->getId();
112
+ * $sPlainTextPattern = &quot;plain&quot;;
113
+ * $sHtmlTextPattern = &quot;html&quot;;
114
+ *
115
+ * $sStrategy = Inx_Api_Property_FormatChoicePropertyFormatter::formatAttributeChoice( $iAttributeId,
116
+ * Inx_Api_Property_FormatChoicePropertyFormatter::MULTIPART_FORMAT, $sPlainTextPattern, $sHtmlTextPattern, null );
117
+ * $oProperty->updateInternalValue( $sStrategy );
118
+ * $oProperty->commitUpdate();
119
+ * </pre>
120
+ * <p>
121
+ * For more information on properties in general, see the <i>Inx_Api_Property_Property</i> documentation.
122
+ *
123
+ * @see Inx_Api_Property_Property
124
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
125
+ * @package Inxmail
126
+ * @subpackage Property
127
+ */
128
+ class Inx_Api_Property_FormatChoicePropertyFormatter
129
+ {
130
+ const PREFIX = "EmailFormat[";
131
+
132
+ const SUFFIX = "]";
133
+
134
+
135
+ /**
136
+ * Strategy constant which lets the editor freely choose the appropriate mail format.
137
+ *
138
+ * @var int
139
+ */
140
+ const MAILING_FORMAT_STRATEGY = 0;
141
+
142
+ /**
143
+ * Strategy constant which restricts the mail format to exactly one specified format.
144
+ *
145
+ * @var int
146
+ */
147
+ const FIXED_STRATEGY = 1;
148
+
149
+ /**
150
+ * Strategy constant which is used to determine the mail format based on the value of a recipient attribute.
151
+ *
152
+ * @var int
153
+ */
154
+ const ATTRIBUTE_STRATEGY = 2;
155
+
156
+
157
+ /**
158
+ * Constant for the plain text pattern.
159
+ *
160
+ * @var string
161
+ */
162
+ const PLAIN_TEXT_FORMAT = "text/plain";
163
+
164
+ /**
165
+ * Constant for the HTML text pattern.
166
+ *
167
+ * @var string
168
+ */
169
+ const HTML_TEXT_FORMAT = "text/html";
170
+
171
+ /**
172
+ * Constant for the multipart pattern.
173
+ *
174
+ * @var string
175
+ */
176
+ const MULTIPART_FORMAT = "multipart";
177
+
178
+
179
+ /**
180
+ * The strategy used to choose the mailing format.
181
+ *
182
+ * @var int
183
+ */
184
+ protected $iChoiceStategy;
185
+
186
+ /**
187
+ * The attribute that controls which format to choose.
188
+ *
189
+ * @var int
190
+ */
191
+ protected $iAttributeId;
192
+
193
+ /**
194
+ * The plain text pattern.
195
+ *
196
+ * @var string
197
+ */
198
+ protected $sPlainTextPattern;
199
+
200
+ /**
201
+ * The HTML text pattern.
202
+ *
203
+ * @var string
204
+ */
205
+ protected $sHtmlTextPattern;
206
+
207
+ /**
208
+ * The multipart pattern.
209
+ *
210
+ * @var string
211
+ */
212
+ protected $sMultipartPattern;
213
+
214
+ /**
215
+ * The default mailing format.
216
+ *
217
+ * @var string
218
+ */
219
+ protected $sFormat;
220
+
221
+
222
+ /**
223
+ * Default constructor which may only be used by derived classes.
224
+ */
225
+ protected function __construct()
226
+ {}
227
+
228
+
229
+ /**
230
+ * Parses the given property and extracts the format choice policy into a new
231
+ * <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> for easy retrieval.
232
+ * Only the <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i> property is allowed.
233
+ * Using any other property will trigger an <i>Inx_Api_IllegalArgumentException</i>.
234
+ *
235
+ * @param property the property to parse.
236
+ * @return Inx_Api_Property_FormatChoicePropertyFormatter an <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>
237
+ * which can be used for easy retrieval of the property values.
238
+ * @throws Inx_Api_IllegalArgumentException if the given property is not an
239
+ * <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i> property.
240
+ */
241
+ public static function parse( Inx_Api_Property_Property $oProperty )
242
+ {
243
+ $sValue = $oProperty->getInternalValue();
244
+ $oFormat = new Inx_Api_Property_FormatChoicePropertyFormatter();
245
+
246
+ if( $sValue === null || strlen($sValue) == 0 )
247
+ {
248
+ $oFormat->iChoiceStategy = self::MAILING_FORMAT_STRATEGY;
249
+ return $oFormat;
250
+ }
251
+
252
+ if( strpos($sValue, self::PREFIX) === 0 && true ===(strrpos($sValue, self::SUFFIX) == strlen($sValue) - strlen(self::SUFFIX)) )
253
+ {
254
+ $s = substr($sValue, strlen(self::PREFIX), -1);
255
+
256
+
257
+ if( strcmp('0', $s) === 0 ) // EmailFormat[0]
258
+ {
259
+ $oFormat->iChoiceStategy = self::MAILING_FORMAT_STRATEGY;
260
+ return $oFormat;
261
+ }
262
+ if( strcmp('1|text/plain', $s ) === 0 ) // EmailFormat[1|text/plain]
263
+ {
264
+ $oFormat->iChoiceStategy = self::FIXED_STRATEGY;
265
+ $oFormat->sFormat = self::PLAIN_TEXT_FORMAT;
266
+ return $oFormat;
267
+ }
268
+ if( strcmp('1|text/html', $s ) === 0) // EmailFormat[1|text/html]
269
+ {
270
+ $oFormat->iChoiceStategy = self::FIXED_STRATEGY;
271
+ $oFormat->sFormat = self::HTML_TEXT_FORMAT;
272
+ return $oFormat;
273
+ }
274
+ if( strcmp('1|multipart', $s ) === 0 ) // EmailFormat[1|multipart]
275
+ {
276
+ $oFormat->iChoiceStategy = self::FIXED_STRATEGY;
277
+ $oFormat->sFormat = self::MULTIPART_FORMAT;
278
+ return $oFormat;
279
+ }
280
+
281
+ // EmailFormat[2|<attrId>|<htmltext-pattern>|<plaintext-pattern>|<multipart-pattern>|<defaultForamt>]
282
+ $aTokens = explode('|', $s);
283
+ if ((count($aTokens) === 6) && strcmp('2', $aTokens[0]) === 0 && ctype_digit($aTokens[1]))
284
+ {
285
+ $oFormat->iChoiceStategy = self::ATTRIBUTE_STRATEGY;
286
+ $oFormat->iAttributeId = (int) $aTokens[1];
287
+ $oFormat->sHtmlTextPattern = $aTokens[2];
288
+ $oFormat->sPlainTextPattern = $aTokens[3];
289
+ $oFormat->sMultipartPattern = $aTokens[4];
290
+ $df = $aTokens[5];
291
+ if(strcmp($df, self::PLAIN_TEXT_FORMAT) === 0) {
292
+ $oFormat->sFormat = self::PLAIN_TEXT_FORMAT;
293
+ return $oFormat;
294
+ }
295
+
296
+ if(strcmp($df, self::HTML_TEXT_FORMAT) === 0) {
297
+ $oFormat->sFormat = self::HTML_TEXT_FORMAT;
298
+ return $oFormat;
299
+ }
300
+
301
+ if(strcmp($df, self::MULTIPART_FORMAT) === 0) {
302
+ $oFormat->sFormat = self::MULTIPART_FORMAT;
303
+ return $oFormat;
304
+ }
305
+ }
306
+ }
307
+ throw new Inx_Api_IllegalArgumentException( "illegal mail choise format: " . value );
308
+ }
309
+
310
+ /**
311
+ * Returns the formatting (choice) strategy. May be one of:
312
+ * <ul>
313
+ * <li><i>MAILING_FORMAT_STRATEGY</i>
314
+ * <li><i>FIXED_STRATEGY</i>
315
+ * <li><i>ATTRIBUTE_STRATEGY</i>
316
+ * </ul>
317
+ *
318
+ * @return int the formatting (choice) strategy.
319
+ */
320
+ public function getChoiceStategy()
321
+ {
322
+ return $this->iChoiceStategy;
323
+ }
324
+
325
+ /**
326
+ * Returns the id of the recipient attribute used to determine the mailing format.
327
+ * If the choice strategy is not <i>ATTRIBUTE_STRATEGY</i>, 0 will be returned.
328
+ *
329
+ * @return int the id of the recipient attribute used to determine the mailing format, or 0 if none is needed.
330
+ */
331
+ public function getAttributeId()
332
+ {
333
+ return $this->iAttributeId;
334
+ }
335
+
336
+ /**
337
+ * Returns the pattern for the given mailing format.
338
+ * Patterns are only used by the choice strategy <i>ATTRIBUTE_STRATEGY</i>.
339
+ *
340
+ * @param string $sFormat the mailing format for which the pattern shall be returned. May be one of:
341
+ * <ul>
342
+ * <li><i>PLAIN_TEXT_FORMAT</i>
343
+ * <li><i>HTML_TEXT_FORMAT</i>
344
+ * <li><i>MULTIPART_FORMAT</i>
345
+ * </ul>
346
+ * @return string the pattern for the given format, if any, <i>null</i> otherwise.
347
+ */
348
+ public function getPattern( $sFormat )
349
+ {
350
+ if( strcmp($sFormat, self::PLAIN_TEXT_FORMAT) === 0 )
351
+ return $this->sPlainTextPattern;
352
+ if( strcmp($sFormat, self::HTML_TEXT_FORMAT) === 0 )
353
+ return $this->sHtmlTextPattern;
354
+ if( strcmp($sFormat, self::MULTIPART_FORMAT) === 0 )
355
+ return $this->sMultipartPattern;
356
+
357
+ throw new Inx_Api_IllegalArgumentException( "unknown format: " . $sFormat );
358
+ }
359
+
360
+ /**
361
+ * Returns the default mailing format.
362
+ * The default format is only used by the choice strategies <i>FIXED_STRATEGY</i> and <i>ATTRIBUTE_STRATEGY</i>.
363
+ *
364
+ * @return string the default mailing format, if any, <i>null</i> otherwise.
365
+ */
366
+ public function getDefaultFormat()
367
+ {
368
+ return $this->sFormat;
369
+ }
370
+
371
+ /**
372
+ * Creates the internal string value for the <i>MAILING_FORMAT_STRATEGY</i>.
373
+ *
374
+ * @return string the internal string value for the <i>MAILING_FORMAT_STRATEGY</i>.
375
+ */
376
+ public static function formatMailingChoice()
377
+ {
378
+ return self::PREFIX . "0" . self::SUFFIX;
379
+ }
380
+
381
+ /**
382
+ * Creates the internal string value for the <i>FIXED_STRATEGY</i> using the given default mailing format.
383
+ * The default format may be one of:
384
+ * <ul>
385
+ * <li><i>PLAIN_TEXT_FORMAT</i>
386
+ * <li><i>HTML_TEXT_FORMAT</i>
387
+ * <li><i>MULTIPART_FORMAT</i>
388
+ * </ul>
389
+ *
390
+ * @param string $sFormat the default mailing format.
391
+ * @return string the internal string value for the <i>FIXED_STRATEGY</i>.
392
+ */
393
+ public static function formatFixedChoice( $sFormat )
394
+ {
395
+ self::checkFormat( $sFormat );
396
+ return self::PREFIX . "1|" . $sFormat . self::SUFFIX;
397
+ }
398
+
399
+ /**
400
+ * Creates the internal string value for the <i>ATTRIBUTE_STRATEGY</i> using the given recipient attribute id,
401
+ * default mailing format and patterns.
402
+ * For a description of the pattern syntax, see the documentation of this class.
403
+ * The default mailing attribute may be one of:
404
+ * <ul>
405
+ * <li><i>PLAIN_TEXT_FORMAT</i>
406
+ * <li><i>HTML_TEXT_FORMAT</i>
407
+ * <li><i>MULTIPART_FORMAT</i>
408
+ * </ul>
409
+ *
410
+ * @param int $iAttributeId the id of the recipient attribute used to determine the mailing format.
411
+ * @param string $sDefaultFormat the default mailing format.
412
+ * @param string $sPlainTextPattern the plain text pattern. May be <i>null</i> if this is the default format.
413
+ * @param string $sHtmlTextPattern the HTML text pattern. May be <i>null</i> if this is the default format.
414
+ * @param string $sMultipartPattern the multipart text pattern. May be <i>null</i> if this is the default format.
415
+ * @return string the internal string value for the <i>ATTRIBUTE_STRATEGY</i>.
416
+ */
417
+ public static function formatAttributeChoice( $iAttributeId, $sDefaultFormat,
418
+ $sPlainTextPattern, $sHtmlTextPattern, $sMultipartPattern )
419
+ {
420
+ if( strcmp($sDefaultFormat, self::PLAIN_TEXT_FORMAT) === 0)
421
+ {
422
+ //fixes XAPI35 (comment): use "null" instead of null
423
+ $sPlainTextPattern = "null";
424
+ if( $sHtmlTextPattern === null || strlen($sHtmlTextPattern) == 0 )
425
+ throw new Inx_Api_IllegalArgumentException( "htmlTextPattern - illegal value: " . $sHtmlTextPattern );
426
+ if( $sMultipartPattern === null || strlen($sMultipartPattern) == 0 )
427
+ throw new Inx_Api_IllegalArgumentException( "multipartPattern - illegal value: " . $sMultipartPattern );
428
+ }
429
+ else if( strcmp($sDefaultFormat, self::HTML_TEXT_FORMAT) === 0)
430
+ {
431
+ //fixes XAPI35 (comment): use "null" instead of null
432
+ $sHtmlTextPattern = "null";
433
+ if( $sPlainTextPattern === null || strlen($sPlainTextPattern) == 0 )
434
+ throw new Inx_Api_IllegalArgumentException( "plainTextPattern - illegal value: " . $sPlainTextPattern );
435
+ if( $sMultipartPattern === null || strlen($sMultipartPattern) == 0 )
436
+ throw new Inx_Api_IllegalArgumentException( "multipartPattern - illegal value: " . $sMultipartPattern );
437
+ }
438
+ else if( strcmp($sDefaultFormat, self::MULTIPART_FORMAT) === 0 )
439
+ {
440
+ //fixes XAPI35 (comment): use "null" instead of null
441
+ $sMultipartPattern = "null";
442
+ //fixes XAPI-35: strlen() instead of length()
443
+ if( $sPlainTextPattern === null || strlen($sPlainTextPattern) == 0 )
444
+ throw new Inx_Api_IllegalArgumentException( "plainTextPattern - illegal value: " . $sPlainTextPattern );
445
+ if( $sHtmlTextPattern === null || strlen($sHtmlTextPattern) == 0 )
446
+ throw new Inx_Api_IllegalArgumentException( "htmlTextPattern - illegal value: " . $sHtmlTextPattern );
447
+ }
448
+ else
449
+ throw new Inx_Api_IllegalArgumentException( "unknown defaultFormat: " . $sDefaultFormat );
450
+
451
+ return self::PREFIX . "2|" . $iAttributeId . "|" . $sHtmlTextPattern . "|" . $sPlainTextPattern
452
+ . "|" . $sMultipartPattern . "|" . $sDefaultFormat . self::SUFFIX;
453
+ }
454
+
455
+
456
+ private static function checkFormat( $sFormat )
457
+ {
458
+ if( strcmp(self::PLAIN_TEXT_FORMAT, $sFormat ) === 0)
459
+ return;
460
+ if( strcmp(self::HTML_TEXT_FORMAT, $sFormat ) === 0)
461
+ return;
462
+ if( strcmp(self::MULTIPART_FORMAT, $sFormat ) === 0)
463
+ return;
464
+
465
+ throw new Inx_Api_IllegalArgumentException( "unknown format: " . $sFormat );
466
+ }
467
+ }
lib/Inx/Api/Property/Property.php CHANGED
@@ -1,126 +1,126 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Property
5
- */
6
- /**
7
- * Mailing lists have properties, which control the list behaviour.
8
- * An <i>Inx_Api_Property_Property</i> may control, for example, the default mail encoding, the maximal sending
9
- * performance, or settings used by features, such as the hard bounce threshold.
10
- * The properties can be accessed through the <i>Inx_Api_List_ListContext::findProperty($sPropertyName)</i> and
11
- * <i>Inx_Api_List_ListContext::selectProperties()</i> methods.
12
- * <p>
13
- * The following snippet shows how to retrieve a specific property, namely the mail encoding property:
14
- *
15
- * <pre>
16
- * $oListContext = ...
17
- * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_ENCODING );
18
- * echo $oProperty->getInternalValue();
19
- * </pre>
20
- *
21
- * Note: Not all properties are available for all lists.
22
- * The <i>Inx_Api_Property_PropertyNames</i> interface documentation states, which properties are available for which lists.
23
- * <p>
24
- * The following snippet shows how to retrieve all properties of a list:
25
- *
26
- * <pre>
27
- * $oBOResultSet = $oListContext->selectProperties();
28
- *
29
- * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
30
- * {
31
- * $oProperty = $oBOResultSet->get( $i );
32
- * echo $oProperty->getName()."&#60;br&#62;";
33
- * }
34
- *
35
- * $oBOResultSet->close();
36
- * </pre>
37
- * <p>
38
- * The following snippet shows how to change the locale of a specific list to English:
39
- *
40
- * <pre>
41
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
42
- *
43
- * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::FORMAT_LOCALE );
44
- * $oProperty->updateInternalValue( &quot;en&quot; );
45
- * $oProperty->commitUpdate();
46
- * </pre>
47
- * <p>
48
- * Most of the properties can be set easily as the values are simple numbers or strings (see above).
49
- * However, there are two special properties which require a bit more effort to be set correctly:
50
- * <ol>
51
- * <li><i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i>: Defines the approval method and the approvers.
52
- * <li><i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i>: Defines the default mailing format.
53
- * </ol>
54
- * These two properties have a special internal value syntax.
55
- * To ease the setting of these two properties, there are two formatters used to parse and create the internal values:
56
- * <ol>
57
- * <li><i>Inx_Api_Property_PropertyFormatter</i> for the approval property.
58
- * <li><i>Inx_Api_Property_FormatChoicePropertyFormatter</i> for the mail format property.
59
- * </ol>
60
- * An <i>Inx_Api_Property_PropertyFormatter</i> instance can be obtained using the <i>getFormatter()</i> method.
61
- * The <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> offers static methods for conversion instead.
62
- * For examples on how to use the formatters, see their respective documentation.
63
- * <p>
64
- * Note: Several api user rights are required to use properties, depending on which properties shall be
65
- * retrieved/manipulated.
66
- * See the PROPERTY_* constants in the <i>Inx_Api_UserRights</i> documentation.
67
- *
68
- * @see Inx_Api_List_ListContext::findProperty($sPropertyName)
69
- * @see Inx_Api_List_ListContext::selectProperties()
70
- * @see Inx_Api_Property_PropertyNames
71
- * @see Inx_Api_Property_PropertyFormatter
72
- * @see Inx_Api_Property_FormatChoicePropertyFormatter
73
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
74
- * @package Inxmail
75
- * @subpackage Property
76
- */
77
- interface Inx_Api_Property_Property extends Inx_Api_BusinessObject
78
- {
79
- /**
80
- * Constant for the property value attribute. Used by the <i>UpdateException</i> to indicate the error source.
81
- *
82
- * @see Inx_Api_UpdateException#getErrorSource()
83
- */
84
- const ATTRIBUTE_VALUE = 1;
85
-
86
-
87
- /**
88
- * Returns the name of the property.
89
- *
90
- * @see Inx_Api_Property_PropertyNames
91
- * @return string the name of the property.
92
- */
93
- public function getName();
94
-
95
-
96
- /**
97
- * Returns the value of the property.
98
- *
99
- * @return string the value of the property.
100
- */
101
- public function getInternalValue();
102
-
103
-
104
- /**
105
- * Updates the value of the property.
106
- * <p>
107
- * For the <i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i> property use the
108
- * <i>Inx_Api_Property_PropertyFormatter</i> provided by <i>getFormatter()<i>.
109
- * For the <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE<i> property use the
110
- * <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>.
111
- *
112
- * @param string $sValue the value of the property.
113
- */
114
- public function updateInternalValue( $sValue );
115
-
116
-
117
- /**
118
- * Returns the <i>Inx_Api_Property_PropertyFormatter</i> instance used to format the
119
- * <i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i> property.
120
- *
121
- * @return Inx_Api_Property_PropertyFormatter the <i>PropertyFormatter</i> used to format the approval property.
122
- * @since API 1.6.0
123
- */
124
- public function getFormatter();
125
-
126
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Property
5
+ */
6
+ /**
7
+ * Mailing lists have properties, which control the list behaviour.
8
+ * An <i>Inx_Api_Property_Property</i> may control, for example, the default mail encoding, the maximal sending
9
+ * performance, or settings used by features, such as the hard bounce threshold.
10
+ * The properties can be accessed through the <i>Inx_Api_List_ListContext::findProperty($sPropertyName)</i> and
11
+ * <i>Inx_Api_List_ListContext::selectProperties()</i> methods.
12
+ * <p>
13
+ * The following snippet shows how to retrieve a specific property, namely the mail encoding property:
14
+ *
15
+ * <pre>
16
+ * $oListContext = ...
17
+ * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_ENCODING );
18
+ * echo $oProperty->getInternalValue();
19
+ * </pre>
20
+ *
21
+ * Note: Not all properties are available for all lists.
22
+ * The <i>Inx_Api_Property_PropertyNames</i> interface documentation states, which properties are available for which lists.
23
+ * <p>
24
+ * The following snippet shows how to retrieve all properties of a list:
25
+ *
26
+ * <pre>
27
+ * $oBOResultSet = $oListContext->selectProperties();
28
+ *
29
+ * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
30
+ * {
31
+ * $oProperty = $oBOResultSet->get( $i );
32
+ * echo $oProperty->getName()."&#60;br&#62;";
33
+ * }
34
+ *
35
+ * $oBOResultSet->close();
36
+ * </pre>
37
+ * <p>
38
+ * The following snippet shows how to change the locale of a specific list to English:
39
+ *
40
+ * <pre>
41
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
42
+ *
43
+ * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::FORMAT_LOCALE );
44
+ * $oProperty->updateInternalValue( &quot;en&quot; );
45
+ * $oProperty->commitUpdate();
46
+ * </pre>
47
+ * <p>
48
+ * Most of the properties can be set easily as the values are simple numbers or strings (see above).
49
+ * However, there are two special properties which require a bit more effort to be set correctly:
50
+ * <ol>
51
+ * <li><i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i>: Defines the approval method and the approvers.
52
+ * <li><i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i>: Defines the default mailing format.
53
+ * </ol>
54
+ * These two properties have a special internal value syntax.
55
+ * To ease the setting of these two properties, there are two formatters used to parse and create the internal values:
56
+ * <ol>
57
+ * <li><i>Inx_Api_Property_PropertyFormatter</i> for the approval property.
58
+ * <li><i>Inx_Api_Property_FormatChoicePropertyFormatter</i> for the mail format property.
59
+ * </ol>
60
+ * An <i>Inx_Api_Property_PropertyFormatter</i> instance can be obtained using the <i>getFormatter()</i> method.
61
+ * The <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> offers static methods for conversion instead.
62
+ * For examples on how to use the formatters, see their respective documentation.
63
+ * <p>
64
+ * Note: Several api user rights are required to use properties, depending on which properties shall be
65
+ * retrieved/manipulated.
66
+ * See the PROPERTY_* constants in the <i>Inx_Api_UserRights</i> documentation.
67
+ *
68
+ * @see Inx_Api_List_ListContext::findProperty($sPropertyName)
69
+ * @see Inx_Api_List_ListContext::selectProperties()
70
+ * @see Inx_Api_Property_PropertyNames
71
+ * @see Inx_Api_Property_PropertyFormatter
72
+ * @see Inx_Api_Property_FormatChoicePropertyFormatter
73
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
74
+ * @package Inxmail
75
+ * @subpackage Property
76
+ */
77
+ interface Inx_Api_Property_Property extends Inx_Api_BusinessObject
78
+ {
79
+ /**
80
+ * Constant for the property value attribute. Used by the <i>UpdateException</i> to indicate the error source.
81
+ *
82
+ * @see Inx_Api_UpdateException#getErrorSource()
83
+ */
84
+ const ATTRIBUTE_VALUE = 1;
85
+
86
+
87
+ /**
88
+ * Returns the name of the property.
89
+ *
90
+ * @see Inx_Api_Property_PropertyNames
91
+ * @return string the name of the property.
92
+ */
93
+ public function getName();
94
+
95
+
96
+ /**
97
+ * Returns the value of the property.
98
+ *
99
+ * @return string the value of the property.
100
+ */
101
+ public function getInternalValue();
102
+
103
+
104
+ /**
105
+ * Updates the value of the property.
106
+ * <p>
107
+ * For the <i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i> property use the
108
+ * <i>Inx_Api_Property_PropertyFormatter</i> provided by <i>getFormatter()<i>.
109
+ * For the <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE<i> property use the
110
+ * <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>.
111
+ *
112
+ * @param string $sValue the value of the property.
113
+ */
114
+ public function updateInternalValue( $sValue );
115
+
116
+
117
+ /**
118
+ * Returns the <i>Inx_Api_Property_PropertyFormatter</i> instance used to format the
119
+ * <i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i> property.
120
+ *
121
+ * @return Inx_Api_Property_PropertyFormatter the <i>PropertyFormatter</i> used to format the approval property.
122
+ * @since API 1.6.0
123
+ */
124
+ public function getFormatter();
125
+
126
+ }
lib/Inx/Api/Property/PropertyFormatter.php CHANGED
@@ -1,77 +1,77 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Property
5
- */
6
- /**
7
- * The <i>Inx_Api_Property_PropertyFormatter</i> is used for converting property values.
8
- * At the moment it is only used for converting the approval property to and from the internal string representation.
9
- * An <i>Inx_Api_Property_PropertyFormatter</i> can be obtained by calling <i>Inx_Api_Property_Property::getFormatter()</i>.
10
- * <p>
11
- * The following snippet shows how to retrieve and parse the approval property of the specified list:
12
- *
13
- * <pre>
14
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
15
- * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE );
16
- *
17
- * $oPropertyFormatter = $oProperty->getFormatter();
18
- * $oApprovalPropertyValue = $oPropertyFormatter->parseApprovalPropertyValue( $oProperty );
19
- * echo "Approval type: ".$oApprovalPropertyValue->getApprovalType()."&#60;br&#62;";
20
- * echo "Primary approver: ".$oApprovalPropertyValue->getPrimaryApproverId()."&#60;br&#62;";
21
- * echo "Secondary approver: ".$oApprovalPropertyValue->getSecondaryApproverId()."&#60;br&#62;";
22
- * </pre>
23
- *
24
- * It is also possible to convert an <i>Inx_Api_Property_ApprovalPropertyValue</i> into the internal string representation.
25
- * The following snippet shows how to update the approval process policy of the specified list:
26
- *
27
- * <pre>
28
- * $iPrimaryApproverId = ...
29
- * $iSecondaryApproverId = ...
30
- *
31
- * $oListContext = $oSession->getListContextManager()->findByName(&quot;Desired list&quot;);
32
- * $oProperty = $oListContext->findProperty(Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE);
33
- *
34
- * $oPropertyFormatter = $oProperty->getFormatter();
35
- * $oApprovalPropertyValue = new Inx_Api_Property_ApprovalPropertyValue(
36
- * Inx_Api_Property_ApprovalPropertyValue::APPROVAL_TYPE_ESCALATION, $iPrimaryApproverId, $iSecondaryApproverId);
37
- * $oProperty->updateInternalValue($oPropertyFormatter->createApprovalPropertyValue($oApprovalPropertyValue));
38
- * $oProperty->commitUpdate();
39
- * </pre>
40
- * <p>
41
- * For more information on the approval property and the possible approval types, see the
42
- * <i>Inx_Api_Propterty_ApprovalPropertyValue</i> documentation.
43
- * <p>
44
- * For more information on properties in general, see the <i>Inx_Api_Property_Property</i> documentation.
45
- *
46
- * @see Inx_Api_Property_ApprovalPropertyValue
47
- * @see Inx_Api_Property_Property
48
- * @since API 1.6.0
49
- * @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
50
- * @package Inxmail
51
- * @subpackage Property
52
- */
53
- interface Inx_Api_Property_PropertyFormatter
54
- {
55
- /**
56
- * Creates the internal value string for the given <i>Inx_Api_Property_ApprovalPropertyValue</i> which is
57
- * used for <i>Inx_Api_Property_Property::updateInternalValue($sValue)</i>.
58
- *
59
- * @param string $value the <i>Inx_Api_Property_ApprovalPropertyValue</i> which contains the new approval
60
- * process policy.
61
- * @return string the internal value string.
62
- */
63
- public function createApprovalPropertyValue( $value );
64
-
65
-
66
- /**
67
- * Parses a property and creates an <i>Inx_Api_Property_ApprovalPropertyValue</i> object containing the
68
- * approval process policy.
69
- * This object can be used to easily retrieve the specifics of the approval process policy.
70
- *
71
- * @param Inx_Api_Property_Property $property the property containing the approval value.
72
- * @return Inx_Api_Property_ApprovalPropertyValue an <i>Inx_Api_Property_ApprovalPropertyValue</i> containing
73
- * the approval process policy.
74
- */
75
- public function parseApprovalPropertyValue( $property );
76
-
77
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Property
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Property_PropertyFormatter</i> is used for converting property values.
8
+ * At the moment it is only used for converting the approval property to and from the internal string representation.
9
+ * An <i>Inx_Api_Property_PropertyFormatter</i> can be obtained by calling <i>Inx_Api_Property_Property::getFormatter()</i>.
10
+ * <p>
11
+ * The following snippet shows how to retrieve and parse the approval property of the specified list:
12
+ *
13
+ * <pre>
14
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
15
+ * $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE );
16
+ *
17
+ * $oPropertyFormatter = $oProperty->getFormatter();
18
+ * $oApprovalPropertyValue = $oPropertyFormatter->parseApprovalPropertyValue( $oProperty );
19
+ * echo "Approval type: ".$oApprovalPropertyValue->getApprovalType()."&#60;br&#62;";
20
+ * echo "Primary approver: ".$oApprovalPropertyValue->getPrimaryApproverId()."&#60;br&#62;";
21
+ * echo "Secondary approver: ".$oApprovalPropertyValue->getSecondaryApproverId()."&#60;br&#62;";
22
+ * </pre>
23
+ *
24
+ * It is also possible to convert an <i>Inx_Api_Property_ApprovalPropertyValue</i> into the internal string representation.
25
+ * The following snippet shows how to update the approval process policy of the specified list:
26
+ *
27
+ * <pre>
28
+ * $iPrimaryApproverId = ...
29
+ * $iSecondaryApproverId = ...
30
+ *
31
+ * $oListContext = $oSession->getListContextManager()->findByName(&quot;Desired list&quot;);
32
+ * $oProperty = $oListContext->findProperty(Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE);
33
+ *
34
+ * $oPropertyFormatter = $oProperty->getFormatter();
35
+ * $oApprovalPropertyValue = new Inx_Api_Property_ApprovalPropertyValue(
36
+ * Inx_Api_Property_ApprovalPropertyValue::APPROVAL_TYPE_ESCALATION, $iPrimaryApproverId, $iSecondaryApproverId);
37
+ * $oProperty->updateInternalValue($oPropertyFormatter->createApprovalPropertyValue($oApprovalPropertyValue));
38
+ * $oProperty->commitUpdate();
39
+ * </pre>
40
+ * <p>
41
+ * For more information on the approval property and the possible approval types, see the
42
+ * <i>Inx_Api_Propterty_ApprovalPropertyValue</i> documentation.
43
+ * <p>
44
+ * For more information on properties in general, see the <i>Inx_Api_Property_Property</i> documentation.
45
+ *
46
+ * @see Inx_Api_Property_ApprovalPropertyValue
47
+ * @see Inx_Api_Property_Property
48
+ * @since API 1.6.0
49
+ * @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
50
+ * @package Inxmail
51
+ * @subpackage Property
52
+ */
53
+ interface Inx_Api_Property_PropertyFormatter
54
+ {
55
+ /**
56
+ * Creates the internal value string for the given <i>Inx_Api_Property_ApprovalPropertyValue</i> which is
57
+ * used for <i>Inx_Api_Property_Property::updateInternalValue($sValue)</i>.
58
+ *
59
+ * @param string $value the <i>Inx_Api_Property_ApprovalPropertyValue</i> which contains the new approval
60
+ * process policy.
61
+ * @return string the internal value string.
62
+ */
63
+ public function createApprovalPropertyValue( $value );
64
+
65
+
66
+ /**
67
+ * Parses a property and creates an <i>Inx_Api_Property_ApprovalPropertyValue</i> object containing the
68
+ * approval process policy.
69
+ * This object can be used to easily retrieve the specifics of the approval process policy.
70
+ *
71
+ * @param Inx_Api_Property_Property $property the property containing the approval value.
72
+ * @return Inx_Api_Property_ApprovalPropertyValue an <i>Inx_Api_Property_ApprovalPropertyValue</i> containing
73
+ * the approval process policy.
74
+ */
75
+ public function parseApprovalPropertyValue( $property );
76
+
77
+ }
lib/Inx/Api/Property/PropertyNames.php CHANGED
@@ -1,240 +1,240 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Property
5
- */
6
- /**
7
- * The <i>Inx_Api_Property_PropertyNames</i> interface defines the properties which can be set by the API.
8
- * Not all properties are available for all list types.
9
- * See the documentation of a specific property for its list type availability.
10
- *
11
- * @see Inx_Api_Property_Property
12
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
- * @package Inxmail
14
- * @subpackage Property
15
- */
16
- interface Inx_Api_Property_PropertyNames
17
- {
18
- /**
19
- * Constant for the locale property. The locale property defines how numbers and dates are formatted.
20
- * This property is available for the following list types:
21
- * <ul>
22
- * <li>Standard list
23
- * <li>Filter list
24
- * <li>System list
25
- * </ul>
26
- */
27
- const FORMAT_LOCALE = "listFormatLocale";
28
-
29
- /**
30
- * Constant for the fraction digits property.
31
- * The fraction digits property defines how many decimal fraction digits shall be viewed of a floating point
32
- * (or floating comma) value.
33
- * This property is available for the following list types:
34
- * <ul>
35
- * <li>Standard list
36
- * <li>Filter list
37
- * <li>System list
38
- * </ul>
39
- */
40
- const FORMAT_FRACTION_DIGITS = "floatDecimalPlacesProperty";
41
-
42
- /**
43
- * Constant for the decimal separator property.
44
- * The decimal separator property defines which character is used to separate a decimal number from its fractions.
45
- * This property is available for the following list types:
46
- * <ul>
47
- * <li>Standard list
48
- * <li>Filter list
49
- * <li>System list
50
- * </ul>
51
- */
52
- const FORMAT_SEPERATOR = "floatDecimalSeperatorProperty";
53
-
54
- /**
55
- * Constant for the line break property.
56
- * The line break property defines after how many characters a text mailing line will break automatically.
57
- * This property is available for the following list types:
58
- * <ul>
59
- * <li>Standard list
60
- * <li>Filter list
61
- * </ul>
62
- */
63
- const FORMAT_LINEBREAK = "editor-max-columns";
64
-
65
- /**
66
- * Constant for the character set property.
67
- * The character set property defines how characters are encoded (e.g. UTF-8).
68
- * This property is available for the following list types:
69
- * <ul>
70
- * <li>Standard list
71
- * <li>Filter list
72
- * <li>System list
73
- * </ul>
74
- */
75
- const MAIL_ENCODING = "charset";
76
-
77
- /**
78
- * Constant for the mail format property.
79
- * The mail format property defines which formats (plain text, HTML text or multipart) may be used in a specific list.
80
- * This special property can be set using the <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>.
81
- * This property is available for the following list types:
82
- * <ul>
83
- * <li>Standard list
84
- * <li>Filter list
85
- * </ul>
86
- *
87
- * @see Inx_Api_Property_FormatChoicePropertyFormatter
88
- */
89
- const MAIL_FORMAT_CHOICE = "email-format";
90
-
91
- /**
92
- * Constant for the sender address property.
93
- * The sender address property defines which which address is used to send the mailings of a list.
94
- * This property is available for the following list types:
95
- * <ul>
96
- * <li>Standard list
97
- * <li>Filter list
98
- * </ul>
99
- */
100
- const MAIL_SENDER_ADDRESS = "sender-address";
101
-
102
- /**
103
- * Constant for the reply address property.
104
- * The reply address property defines which address the recipient may use for replies.
105
- * This property is available for the following list types:
106
- * <ul>
107
- * <li>Standard list
108
- * <li>Filter list
109
- * </ul>
110
- */
111
- const MAIL_REPLY_ADDRESS = "reply-address";
112
-
113
- /**
114
- * Constant for the system mail sender address property.
115
- * The system mail sender address property defines which address is used to send system mails.
116
- * This property is available for the following list types:
117
- * <ul>
118
- * <li>Administration list
119
- * </ul>
120
- */
121
- const SYSTEM_MAIL_SENDER_ADDRESS = "SystemSenderEmail";
122
-
123
- /**
124
- * @deprecated this property will be removed in further versions.
125
- */
126
- const SERVER_NAME = "RedirectServerHostName";
127
-
128
- /**
129
- * @deprecated this property will be removed in further versions.
130
- */
131
- const SERVER_PORT = "RedirectServerHostPort";
132
-
133
- /**
134
- * Constant for the sending performance property.
135
- * The sending performance property defines how many mails may be sent per hour at a maximum.
136
- * The value has to be set in steps of 3600, where 0 means no limit at all.
137
- * This property is available for the following list types:
138
- * <ul>
139
- * <li>Standard list
140
- * <li>Filter list
141
- * <li>System list
142
- * </ul>
143
- */
144
- const SENDING_MAILS_PER_HOUR = "sendrate";
145
-
146
- /**
147
- * @deprecated this property will be removed in further versions.
148
- */
149
- const HTML_PREVIEW = "html-preview";
150
-
151
- /**
152
- * @deprecated this property will be removed in further versions.
153
- */
154
- const MAIL_TEST_ADDRESS = "test-recipient";
155
-
156
- /**
157
- * Constant for the hard bounce threshold property.
158
- * The hard bounce threshold property defines how many hard bounces may be received before a recipient is
159
- * marked as unreachable.
160
- * A value of 0 means the recipient will never be marked as unreachable automatically.
161
- * This property is available for the following list types:
162
- * <ul>
163
- * <li>Administration list
164
- * </ul>
165
- *
166
- * @since API 1.6.0
167
- */
168
- const HARDBOUNCE_THRESHOLD = "HardbounceThreshold";
169
-
170
- /**
171
- * Constant for the hard bounce active property.
172
- * The hard bounce active property defines if recipients are automatically marked as unreachable if a
173
- * specific threshold (see <i>HARDBOUNCE_THRESHOLD</i>) is reached.
174
- * This property is available for the following list types:
175
- * <ul>
176
- * <li>Administration list
177
- * </ul>
178
- *
179
- * @since API 1.6.0
180
- */
181
- const HARDBOUNCE_ACTIVE = "HardbounceActive";
182
-
183
- /**
184
- * Constant for the approval property.
185
- * The approval property defines if the approval of of mailings is activated and how it is done.
186
- * This special property may be set using the <i>Inx_Api_Property_PropertyFormatter</i> provided by
187
- * <i>Inx_Api_Property_Property::getFormatter()</i>.
188
- * This property is available for the following list types:
189
- * <ul>
190
- * <li>Standard list
191
- * <li>Filter list
192
- * <li>System list
193
- * </ul>
194
- *
195
- * @see Inx_Api_Property_Property::getFormatter()
196
- * @since API 1.6.0
197
- */
198
- const APPROVAL_ACTIVE = "ApprovalActive";
199
-
200
- /**
201
- * Constant for the server URL property.
202
- * The server URL property defines the address of the Inxmail customer. This value is important for JSPs.
203
- * This property is available for the following list types:
204
- * <ul>
205
- * <li>Standard list
206
- * <li>Filter list
207
- * <li>Administration list
208
- * </ul>
209
- *
210
- * @since API 1.6.1
211
- */
212
- const SERVER_URL = "RedirectServerUrl";
213
-
214
- /**
215
- * Constant for the link URL property.
216
- * The link URL property defines the address of the Inxmail customer. This value is used for link tracking.
217
- * This property is available for the following list types:
218
- * <ul>
219
- * <li>Standard list
220
- * <li>Filter list
221
- * <li>Administration list
222
- * </ul>
223
- *
224
- * @since API 1.6.1
225
- */
226
- const LINK_URL = "RedirectLinkUrl";
227
-
228
- /**
229
- * Constant for the tracking proxy property.
230
- * The tracking proxy property defines if a tracking proxy shall be used and which one to use.
231
- * This property is available for the following list types:
232
- * <ul>
233
- * <li>Administration list
234
- * </ul>
235
- *
236
- * @since API 1.6.1
237
- */
238
- const TRACKING_PROXY = "TrackingProxy";
239
-
240
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Property
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Property_PropertyNames</i> interface defines the properties which can be set by the API.
8
+ * Not all properties are available for all list types.
9
+ * See the documentation of a specific property for its list type availability.
10
+ *
11
+ * @see Inx_Api_Property_Property
12
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
+ * @package Inxmail
14
+ * @subpackage Property
15
+ */
16
+ interface Inx_Api_Property_PropertyNames
17
+ {
18
+ /**
19
+ * Constant for the locale property. The locale property defines how numbers and dates are formatted.
20
+ * This property is available for the following list types:
21
+ * <ul>
22
+ * <li>Standard list
23
+ * <li>Filter list
24
+ * <li>System list
25
+ * </ul>
26
+ */
27
+ const FORMAT_LOCALE = "listFormatLocale";
28
+
29
+ /**
30
+ * Constant for the fraction digits property.
31
+ * The fraction digits property defines how many decimal fraction digits shall be viewed of a floating point
32
+ * (or floating comma) value.
33
+ * This property is available for the following list types:
34
+ * <ul>
35
+ * <li>Standard list
36
+ * <li>Filter list
37
+ * <li>System list
38
+ * </ul>
39
+ */
40
+ const FORMAT_FRACTION_DIGITS = "floatDecimalPlacesProperty";
41
+
42
+ /**
43
+ * Constant for the decimal separator property.
44
+ * The decimal separator property defines which character is used to separate a decimal number from its fractions.
45
+ * This property is available for the following list types:
46
+ * <ul>
47
+ * <li>Standard list
48
+ * <li>Filter list
49
+ * <li>System list
50
+ * </ul>
51
+ */
52
+ const FORMAT_SEPERATOR = "floatDecimalSeperatorProperty";
53
+
54
+ /**
55
+ * Constant for the line break property.
56
+ * The line break property defines after how many characters a text mailing line will break automatically.
57
+ * This property is available for the following list types:
58
+ * <ul>
59
+ * <li>Standard list
60
+ * <li>Filter list
61
+ * </ul>
62
+ */
63
+ const FORMAT_LINEBREAK = "editor-max-columns";
64
+
65
+ /**
66
+ * Constant for the character set property.
67
+ * The character set property defines how characters are encoded (e.g. UTF-8).
68
+ * This property is available for the following list types:
69
+ * <ul>
70
+ * <li>Standard list
71
+ * <li>Filter list
72
+ * <li>System list
73
+ * </ul>
74
+ */
75
+ const MAIL_ENCODING = "charset";
76
+
77
+ /**
78
+ * Constant for the mail format property.
79
+ * The mail format property defines which formats (plain text, HTML text or multipart) may be used in a specific list.
80
+ * This special property can be set using the <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>.
81
+ * This property is available for the following list types:
82
+ * <ul>
83
+ * <li>Standard list
84
+ * <li>Filter list
85
+ * </ul>
86
+ *
87
+ * @see Inx_Api_Property_FormatChoicePropertyFormatter
88
+ */
89
+ const MAIL_FORMAT_CHOICE = "email-format";
90
+
91
+ /**
92
+ * Constant for the sender address property.
93
+ * The sender address property defines which which address is used to send the mailings of a list.
94
+ * This property is available for the following list types:
95
+ * <ul>
96
+ * <li>Standard list
97
+ * <li>Filter list
98
+ * </ul>
99
+ */
100
+ const MAIL_SENDER_ADDRESS = "sender-address";
101
+
102
+ /**
103
+ * Constant for the reply address property.
104
+ * The reply address property defines which address the recipient may use for replies.
105
+ * This property is available for the following list types:
106
+ * <ul>
107
+ * <li>Standard list
108
+ * <li>Filter list
109
+ * </ul>
110
+ */
111
+ const MAIL_REPLY_ADDRESS = "reply-address";
112
+
113
+ /**
114
+ * Constant for the system mail sender address property.
115
+ * The system mail sender address property defines which address is used to send system mails.
116
+ * This property is available for the following list types:
117
+ * <ul>
118
+ * <li>Administration list
119
+ * </ul>
120
+ */
121
+ const SYSTEM_MAIL_SENDER_ADDRESS = "SystemSenderEmail";
122
+
123
+ /**
124
+ * @deprecated this property will be removed in further versions.
125
+ */
126
+ const SERVER_NAME = "RedirectServerHostName";
127
+
128
+ /**
129
+ * @deprecated this property will be removed in further versions.
130
+ */
131
+ const SERVER_PORT = "RedirectServerHostPort";
132
+
133
+ /**
134
+ * Constant for the sending performance property.
135
+ * The sending performance property defines how many mails may be sent per hour at a maximum.
136
+ * The value has to be set in steps of 3600, where 0 means no limit at all.
137
+ * This property is available for the following list types:
138
+ * <ul>
139
+ * <li>Standard list
140
+ * <li>Filter list
141
+ * <li>System list
142
+ * </ul>
143
+ */
144
+ const SENDING_MAILS_PER_HOUR = "sendrate";
145
+
146
+ /**
147
+ * @deprecated this property will be removed in further versions.
148
+ */
149
+ const HTML_PREVIEW = "html-preview";
150
+
151
+ /**
152
+ * @deprecated this property will be removed in further versions.
153
+ */
154
+ const MAIL_TEST_ADDRESS = "test-recipient";
155
+
156
+ /**
157
+ * Constant for the hard bounce threshold property.
158
+ * The hard bounce threshold property defines how many hard bounces may be received before a recipient is
159
+ * marked as unreachable.
160
+ * A value of 0 means the recipient will never be marked as unreachable automatically.
161
+ * This property is available for the following list types:
162
+ * <ul>
163
+ * <li>Administration list
164
+ * </ul>
165
+ *
166
+ * @since API 1.6.0
167
+ */
168
+ const HARDBOUNCE_THRESHOLD = "HardbounceThreshold";
169
+
170
+ /**
171
+ * Constant for the hard bounce active property.
172
+ * The hard bounce active property defines if recipients are automatically marked as unreachable if a
173
+ * specific threshold (see <i>HARDBOUNCE_THRESHOLD</i>) is reached.
174
+ * This property is available for the following list types:
175
+ * <ul>
176
+ * <li>Administration list
177
+ * </ul>
178
+ *
179
+ * @since API 1.6.0
180
+ */
181
+ const HARDBOUNCE_ACTIVE = "HardbounceActive";
182
+
183
+ /**
184
+ * Constant for the approval property.
185
+ * The approval property defines if the approval of of mailings is activated and how it is done.
186
+ * This special property may be set using the <i>Inx_Api_Property_PropertyFormatter</i> provided by
187
+ * <i>Inx_Api_Property_Property::getFormatter()</i>.
188
+ * This property is available for the following list types:
189
+ * <ul>
190
+ * <li>Standard list
191
+ * <li>Filter list
192
+ * <li>System list
193
+ * </ul>
194
+ *
195
+ * @see Inx_Api_Property_Property::getFormatter()
196
+ * @since API 1.6.0
197
+ */
198
+ const APPROVAL_ACTIVE = "ApprovalActive";
199
+
200
+ /**
201
+ * Constant for the server URL property.
202
+ * The server URL property defines the address of the Inxmail customer. This value is important for JSPs.
203
+ * This property is available for the following list types:
204
+ * <ul>
205
+ * <li>Standard list
206
+ * <li>Filter list
207
+ * <li>Administration list
208
+ * </ul>
209
+ *
210
+ * @since API 1.6.1
211
+ */
212
+ const SERVER_URL = "RedirectServerUrl";
213
+
214
+ /**
215
+ * Constant for the link URL property.
216
+ * The link URL property defines the address of the Inxmail customer. This value is used for link tracking.
217
+ * This property is available for the following list types:
218
+ * <ul>
219
+ * <li>Standard list
220
+ * <li>Filter list
221
+ * <li>Administration list
222
+ * </ul>
223
+ *
224
+ * @since API 1.6.1
225
+ */
226
+ const LINK_URL = "RedirectLinkUrl";
227
+
228
+ /**
229
+ * Constant for the tracking proxy property.
230
+ * The tracking proxy property defines if a tracking proxy shall be used and which one to use.
231
+ * This property is available for the following list types:
232
+ * <ul>
233
+ * <li>Administration list
234
+ * </ul>
235
+ *
236
+ * @since API 1.6.1
237
+ */
238
+ const TRACKING_PROXY = "TrackingProxy";
239
+
240
+ }
lib/Inx/Api/Recipient/Attribute.php CHANGED
@@ -1,266 +1,266 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Recipient
5
- */
6
- /**
7
- * An <i>Inx_Api_Recipient_Attribute</i> contains meta data of recipients.
8
- * It is the API equivalent of a column in the Inxmail recipient list view.
9
- * There are mainly two categories of attributes:
10
- * <ol>
11
- * <li>Predefined attributes are created by Inxmail and may not be removed or renamed.
12
- * The most important attributes of this type are:
13
- * <ul>
14
- * <li><i>The id attribute</i>: Contains the id of the recipient</li>
15
- * <li><i>The email attribute</i>: Contains the email address of the recipient</li>
16
- * <li><i>The key attribute</i>: In general the same as the email attribute</li>
17
- * <li><i>The subscription attribute</i>: Contains the subscription date of the recipient - Individual for every list</li>
18
- * <li><i>The last modification attribute</i>: Contains the date of the last modification of the recipient</li>
19
- * <li><i>The hard bounce attribute</i>: Contains the number of hard bounces received for the recipient</li>
20
- * </ul>
21
- * </li>
22
- * <li>User attributes are created by Inxmail users and may be freely removed or renamed.
23
- * User attributes give you the ability to treat a recipient according to certain properties.
24
- * For example you could create an user attribute called 'format' which contains the users preferred mail format.
25
- * You could then set the mailing format according to this attribute.
26
- * You could also define an user attribute to store certain interests of the recipient and generate filters
27
- * (target groups) to send a mailing only to recipients who are interested in the topic covered by the mailing.</li>
28
- * </ol>
29
- * All attributes share a common set of properties, which define them. These properties are:
30
- * <p/>
31
- * <ul>
32
- * <li><i>The id</i>: Each attribute has a unique id.</li>
33
- * <li><i>The name</i>: Each attribute has an unique name. This name is only retrievable for user attributes, though.</li>
34
- * <li><i>The type</i>: The different attribute types are:
35
- * <ul>
36
- * <li><i>EMAIL_ATTRIBUTE_TYPE</i>: The email attribute</li>
37
- * <li><i>ID_ATTRIBUTE_TYPE</i>: The id attribute</li>
38
- * <li><i>SUBSCRIPTION_ATTRIBUTE_TYPE</i>: An attribute that indicates the subscription state for a specific list</li>
39
- * <li><i>LAST_MODIFICATION_ATTRIBUTE_TYPE</i>: The last modification date attribute</li>
40
- * <li><i>HARDBOUNCE_ATTRIBUTE_TYPE</i>: Contains the number of hard bounces received for a recipient</li>
41
- * <li><i>FEATURE_ATTRIBUTE_TYPE</i>: An attribute associated with a feature (agent)</li>
42
- * <li><i>USER_ATTRIBUTE_TYPE</i>: An user defined attribute</li>
43
- * </ul>
44
- * </li>
45
- * <li><i>The data type</i>: The different data types are:
46
- * <ul>
47
- * <li><i>DATA_TYPE_STRING</i></li>
48
- * <li><i>DATA_TYPE_DATETIME</i></li>
49
- * <li><i>DATA_TYPE_DATE</i></li>
50
- * <li><i>DATA_TYPE_TIME</i></li>
51
- * <li><i>DATA_TYPE_BOOLEAN</i></li>
52
- * <li><i>DATA_TYPE_INTEGER</i></li>
53
- * <li><i>DATA_TYPE_DOUBLE</i></li>
54
- * </ul>
55
- * </li>
56
- * <li><i>The maximum String length</i>: If the data type is <i>DATA_TYPE_STRING</i>, the attribute can not be longer
57
- * than the maximum length defined in this property.</li>
58
- * <li><i>The list context id</i>: Mainly used by attributes of type <i>SUBSCRIPTION_ATTRIBUTE_TYPE</i> to indicate
59
- * the list they are responsible for.</li>
60
- * <li><i>The feature (agent) id</i>: Some attributes are used by specific features.</li>
61
- * <li><i>The accessibility</i>: Only relevant for plug-ins.</li>
62
- * </ul>
63
- * <p/>
64
- * Predefined attributes can easily be retrieved using the various get methods of the <i>Inx_Api_Recipient_RecipientMetaData</i> class.
65
- * User attributes are retrieved using the <i>Inx_Api_Recipient_RecipientMetaData::getUserAttribute($sName)</i> method
66
- * and are identified by their unique name.
67
- * See the <i>Inx_Api_Recipient_RecipientMetaData</i> documentation for more information.
68
- * <p/>
69
- * User attributes may be created, removed and renamed using the <i>Inx_Api_Recipient_AttributeManager</i>.
70
- * For more information on this topic, see the <i>AttributeManager</i> documentation.
71
- *
72
- * @see Inx_Api_Recipient_AttributeManager
73
- * @see Inx_Api_Recipient_RecipientMetaData
74
- * @since API 1.0
75
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
76
- * @package Inxmail
77
- * @subpackage Recipient
78
- */
79
- interface Inx_Api_Recipient_Attribute
80
- {
81
- /**
82
- * Constant for the data type String.
83
- *
84
- * @var int
85
- */
86
- const DATA_TYPE_STRING = 1;
87
-
88
- /**
89
- * Constant for the data type Integer.
90
- *
91
- * @var int
92
- */
93
- const DATA_TYPE_INTEGER = 2;
94
-
95
- /**
96
- * Constant for the data type Double.
97
- *
98
- * @var int
99
- */
100
- const DATA_TYPE_DOUBLE = 3;
101
-
102
- /**
103
- * Constant for the data type Boolean.
104
- *
105
- * @var int
106
- */
107
- const DATA_TYPE_BOOLEAN = 4;
108
-
109
- /**
110
- * Constant for the data type Datetime (Date + Time).
111
- *
112
- * @var int
113
- */
114
- const DATA_TYPE_DATETIME = 10;
115
-
116
- /**
117
- * Constant for the data type Date (without Time).
118
- *
119
- * @var int
120
- */
121
- const DATA_TYPE_DATE = 11;
122
-
123
- /**
124
- * Constant for the data type Time (without Date).
125
- *
126
- * @var int
127
- */
128
- const DATA_TYPE_TIME = 12;
129
-
130
-
131
- /**
132
- * Constant for attributes used by features.
133
- *
134
- * @var int
135
- */
136
- const FEATURE_ATTRIBUTE_TYPE = 1;
137
-
138
- /**
139
- * Constant for attributes containing list subscription information.
140
- *
141
- * @var int
142
- */
143
- const SUBSCRIPTION_ATTRIBUTE_TYPE = 2;
144
-
145
- /**
146
- * Constant for the email attribute.
147
- *
148
- * @var int
149
- */
150
- const EMAIL_ATTRIBUTE_TYPE = 3;
151
-
152
- /**
153
- * Constant for the id attribute.
154
- *
155
- * @var int
156
- */
157
- const ID_ATTRIBUTE_TYPE = 4;
158
-
159
- /**
160
- * Constant for user defined attributes.
161
- *
162
- * @var int
163
- */
164
- const USER_ATTRIBUTE_TYPE = 5;
165
-
166
- /**
167
- * Constant for the last modification attribute.
168
- *
169
- * @var int
170
- */
171
- const LAST_MODIFICATION_ATTRIBUTE_TYPE = 7;
172
-
173
- /**
174
- * Constant for the hard bounce attribute (counter).
175
- *
176
- * @var int
177
- * @since API 1.6.0
178
- */
179
- const HARDBOUNCE_ATTRIBUTE_TYPE = 8;
180
-
181
-
182
- /**
183
- * Returns the unique id of this attribute.
184
- *
185
- * @return int the unique id of this attribute.
186
- */
187
- public function getId();
188
-
189
-
190
- /**
191
- * Returns the unique name of this attribute.
192
- *
193
- * @return string the unique name of this attribute.
194
- */
195
- public function getName();
196
-
197
-
198
- /**
199
- * Returns the attribute type of this attribute.
200
- * May be one of:
201
- * <ul>
202
- * <li><i>ID_ATTRIBUTE_TYPE</i>
203
- * <li><i>EMAIL_ATTRIBUTE_TYPE</i>
204
- * <li><i>USER_ATTRIBUTE_TYPE</i>
205
- * <li><i>SUBSCRIPTION_ATTRIBUTE_TYPE</i>
206
- * <li><i>LAST_MODIFIED_ATTRIBUTE_TYPE</i>
207
- * <li><i>FEATURE_ATTRIBUTE_TYPE</i>
208
- * </ul>
209
- *
210
- * @return int the attribute type of this attribute.
211
- */
212
- public function getType();
213
-
214
-
215
- /**
216
- * Returns the data type of this attribute.
217
- * May be one of:
218
- * <ul>
219
- * <li><i>DATA_TYPE_STRING</i>
220
- * <li><i>DATA_TYPE_INTEGER</i>
221
- * <li><i>DATA_TYPE_DOUBLE</i>
222
- * <li><i>DATA_TYPE_BOOLEAN</i>
223
- * <li><i>DATA_TYPE_DATETIME</i>
224
- * <li><i>DATA_TYPE_DATE</i>
225
- * <li><i>DATA_TYPE_TIME</i>
226
- * </ul>
227
- *
228
- * @return int the data type of this attribute.
229
- */
230
- public function getDataType();
231
-
232
-
233
- /**
234
- * Returns the maximum length of the string value of this attribute.
235
- * Only relevant if the data type is <i>DATA_TYPE_STRING</i>.
236
- *
237
- * @return int the maximum length of the string value of this attribute.
238
- */
239
- public function getMaxStringLength();
240
-
241
-
242
- /**
243
- * Returns the list context id of this attribute.
244
- * Only relevant if the attribute type is <i>SUBSCRIPTION_ATTRIBUTE_TYPE</i> or <i>FEATURE_ATTRIBUTE_TYPE</i>.
245
- *
246
- * @return int the list context id of this attribute.
247
- */
248
- public function getListContextId();
249
-
250
-
251
- /**
252
- * Returns the feature id of this attribute.
253
- * Only relevant if the attribute type is <i>FEATURE_ATTRIBUTE_TYPE</i>.
254
- *
255
- * @return int the feature id of this attribute.
256
- */
257
- public function getFeatureId();
258
-
259
- /**
260
- * Only relevant in a plug-in api session.
261
- *
262
- * @return bool the accessibility of this attribute.
263
- */
264
- public function isAccessible();
265
-
266
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Recipient
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Recipient_Attribute</i> contains meta data of recipients.
8
+ * It is the API equivalent of a column in the Inxmail recipient list view.
9
+ * There are mainly two categories of attributes:
10
+ * <ol>
11
+ * <li>Predefined attributes are created by Inxmail and may not be removed or renamed.
12
+ * The most important attributes of this type are:
13
+ * <ul>
14
+ * <li><i>The id attribute</i>: Contains the id of the recipient</li>
15
+ * <li><i>The email attribute</i>: Contains the email address of the recipient</li>
16
+ * <li><i>The key attribute</i>: In general the same as the email attribute</li>
17
+ * <li><i>The subscription attribute</i>: Contains the subscription date of the recipient - Individual for every list</li>
18
+ * <li><i>The last modification attribute</i>: Contains the date of the last modification of the recipient</li>
19
+ * <li><i>The hard bounce attribute</i>: Contains the number of hard bounces received for the recipient</li>
20
+ * </ul>
21
+ * </li>
22
+ * <li>User attributes are created by Inxmail users and may be freely removed or renamed.
23
+ * User attributes give you the ability to treat a recipient according to certain properties.
24
+ * For example you could create an user attribute called 'format' which contains the users preferred mail format.
25
+ * You could then set the mailing format according to this attribute.
26
+ * You could also define an user attribute to store certain interests of the recipient and generate filters
27
+ * (target groups) to send a mailing only to recipients who are interested in the topic covered by the mailing.</li>
28
+ * </ol>
29
+ * All attributes share a common set of properties, which define them. These properties are:
30
+ * <p/>
31
+ * <ul>
32
+ * <li><i>The id</i>: Each attribute has a unique id.</li>
33
+ * <li><i>The name</i>: Each attribute has an unique name. This name is only retrievable for user attributes, though.</li>
34
+ * <li><i>The type</i>: The different attribute types are:
35
+ * <ul>
36
+ * <li><i>EMAIL_ATTRIBUTE_TYPE</i>: The email attribute</li>
37
+ * <li><i>ID_ATTRIBUTE_TYPE</i>: The id attribute</li>
38
+ * <li><i>SUBSCRIPTION_ATTRIBUTE_TYPE</i>: An attribute that indicates the subscription state for a specific list</li>
39
+ * <li><i>LAST_MODIFICATION_ATTRIBUTE_TYPE</i>: The last modification date attribute</li>
40
+ * <li><i>HARDBOUNCE_ATTRIBUTE_TYPE</i>: Contains the number of hard bounces received for a recipient</li>
41
+ * <li><i>FEATURE_ATTRIBUTE_TYPE</i>: An attribute associated with a feature (agent)</li>
42
+ * <li><i>USER_ATTRIBUTE_TYPE</i>: An user defined attribute</li>
43
+ * </ul>
44
+ * </li>
45
+ * <li><i>The data type</i>: The different data types are:
46
+ * <ul>
47
+ * <li><i>DATA_TYPE_STRING</i></li>
48
+ * <li><i>DATA_TYPE_DATETIME</i></li>
49
+ * <li><i>DATA_TYPE_DATE</i></li>
50
+ * <li><i>DATA_TYPE_TIME</i></li>
51
+ * <li><i>DATA_TYPE_BOOLEAN</i></li>
52
+ * <li><i>DATA_TYPE_INTEGER</i></li>
53
+ * <li><i>DATA_TYPE_DOUBLE</i></li>
54
+ * </ul>
55
+ * </li>
56
+ * <li><i>The maximum String length</i>: If the data type is <i>DATA_TYPE_STRING</i>, the attribute can not be longer
57
+ * than the maximum length defined in this property.</li>
58
+ * <li><i>The list context id</i>: Mainly used by attributes of type <i>SUBSCRIPTION_ATTRIBUTE_TYPE</i> to indicate
59
+ * the list they are responsible for.</li>
60
+ * <li><i>The feature (agent) id</i>: Some attributes are used by specific features.</li>
61
+ * <li><i>The accessibility</i>: Only relevant for plug-ins.</li>
62
+ * </ul>
63
+ * <p/>
64
+ * Predefined attributes can easily be retrieved using the various get methods of the <i>Inx_Api_Recipient_RecipientMetaData</i> class.
65
+ * User attributes are retrieved using the <i>Inx_Api_Recipient_RecipientMetaData::getUserAttribute($sName)</i> method
66
+ * and are identified by their unique name.
67
+ * See the <i>Inx_Api_Recipient_RecipientMetaData</i> documentation for more information.
68
+ * <p/>
69
+ * User attributes may be created, removed and renamed using the <i>Inx_Api_Recipient_AttributeManager</i>.
70
+ * For more information on this topic, see the <i>AttributeManager</i> documentation.
71
+ *
72
+ * @see Inx_Api_Recipient_AttributeManager
73
+ * @see Inx_Api_Recipient_RecipientMetaData
74
+ * @since API 1.0
75
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
76
+ * @package Inxmail
77
+ * @subpackage Recipient
78
+ */
79
+ interface Inx_Api_Recipient_Attribute
80
+ {
81
+ /**
82
+ * Constant for the data type String.
83
+ *
84
+ * @var int
85
+ */
86
+ const DATA_TYPE_STRING = 1;
87
+
88
+ /**
89
+ * Constant for the data type Integer.
90
+ *
91
+ * @var int
92
+ */
93
+ const DATA_TYPE_INTEGER = 2;
94
+
95
+ /**
96
+ * Constant for the data type Double.
97
+ *
98
+ * @var int
99
+ */
100
+ const DATA_TYPE_DOUBLE = 3;
101
+
102
+ /**
103
+ * Constant for the data type Boolean.
104
+ *
105
+ * @var int
106
+ */
107
+ const DATA_TYPE_BOOLEAN = 4;
108
+
109
+ /**
110
+ * Constant for the data type Datetime (Date + Time).
111
+ *
112
+ * @var int
113
+ */
114
+ const DATA_TYPE_DATETIME = 10;
115
+
116
+ /**
117
+ * Constant for the data type Date (without Time).
118
+ *
119
+ * @var int
120
+ */
121
+ const DATA_TYPE_DATE = 11;
122
+
123
+ /**
124
+ * Constant for the data type Time (without Date).
125
+ *
126
+ * @var int
127
+ */
128
+ const DATA_TYPE_TIME = 12;
129
+
130
+
131
+ /**
132
+ * Constant for attributes used by features.
133
+ *
134
+ * @var int
135
+ */
136
+ const FEATURE_ATTRIBUTE_TYPE = 1;
137
+
138
+ /**
139
+ * Constant for attributes containing list subscription information.
140
+ *
141
+ * @var int
142
+ */
143
+ const SUBSCRIPTION_ATTRIBUTE_TYPE = 2;
144
+
145
+ /**
146
+ * Constant for the email attribute.
147
+ *
148
+ * @var int
149
+ */
150
+ const EMAIL_ATTRIBUTE_TYPE = 3;
151
+
152
+ /**
153
+ * Constant for the id attribute.
154
+ *
155
+ * @var int
156
+ */
157
+ const ID_ATTRIBUTE_TYPE = 4;
158
+
159
+ /**
160
+ * Constant for user defined attributes.
161
+ *
162
+ * @var int
163
+ */
164
+ const USER_ATTRIBUTE_TYPE = 5;
165
+
166
+ /**
167
+ * Constant for the last modification attribute.
168
+ *
169
+ * @var int
170
+ */
171
+ const LAST_MODIFICATION_ATTRIBUTE_TYPE = 7;
172
+
173
+ /**
174
+ * Constant for the hard bounce attribute (counter).
175
+ *
176
+ * @var int
177
+ * @since API 1.6.0
178
+ */
179
+ const HARDBOUNCE_ATTRIBUTE_TYPE = 8;
180
+
181
+
182
+ /**
183
+ * Returns the unique id of this attribute.
184
+ *
185
+ * @return int the unique id of this attribute.
186
+ */
187
+ public function getId();
188
+
189
+
190
+ /**
191
+ * Returns the unique name of this attribute.
192
+ *
193
+ * @return string the unique name of this attribute.
194
+ */
195
+ public function getName();
196
+
197
+
198
+ /**
199
+ * Returns the attribute type of this attribute.
200
+ * May be one of:
201
+ * <ul>
202
+ * <li><i>ID_ATTRIBUTE_TYPE</i>
203
+ * <li><i>EMAIL_ATTRIBUTE_TYPE</i>
204
+ * <li><i>USER_ATTRIBUTE_TYPE</i>
205
+ * <li><i>SUBSCRIPTION_ATTRIBUTE_TYPE</i>
206
+ * <li><i>LAST_MODIFIED_ATTRIBUTE_TYPE</i>
207
+ * <li><i>FEATURE_ATTRIBUTE_TYPE</i>
208
+ * </ul>
209
+ *
210
+ * @return int the attribute type of this attribute.
211
+ */
212
+ public function getType();
213
+
214
+
215
+ /**
216
+ * Returns the data type of this attribute.
217
+ * May be one of:
218
+ * <ul>
219
+ * <li><i>DATA_TYPE_STRING</i>
220
+ * <li><i>DATA_TYPE_INTEGER</i>
221
+ * <li><i>DATA_TYPE_DOUBLE</i>
222
+ * <li><i>DATA_TYPE_BOOLEAN</i>
223
+ * <li><i>DATA_TYPE_DATETIME</i>
224
+ * <li><i>DATA_TYPE_DATE</i>
225
+ * <li><i>DATA_TYPE_TIME</i>
226
+ * </ul>
227
+ *
228
+ * @return int the data type of this attribute.
229
+ */
230
+ public function getDataType();
231
+
232
+
233
+ /**
234
+ * Returns the maximum length of the string value of this attribute.
235
+ * Only relevant if the data type is <i>DATA_TYPE_STRING</i>.
236
+ *
237
+ * @return int the maximum length of the string value of this attribute.
238
+ */
239
+ public function getMaxStringLength();
240
+
241
+
242
+ /**
243
+ * Returns the list context id of this attribute.
244
+ * Only relevant if the attribute type is <i>SUBSCRIPTION_ATTRIBUTE_TYPE</i> or <i>FEATURE_ATTRIBUTE_TYPE</i>.
245
+ *
246
+ * @return int the list context id of this attribute.
247
+ */
248
+ public function getListContextId();
249
+
250
+
251
+ /**
252
+ * Returns the feature id of this attribute.
253
+ * Only relevant if the attribute type is <i>FEATURE_ATTRIBUTE_TYPE</i>.
254
+ *
255
+ * @return int the feature id of this attribute.
256
+ */
257
+ public function getFeatureId();
258
+
259
+ /**
260
+ * Only relevant in a plug-in api session.
261
+ *
262
+ * @return bool the accessibility of this attribute.
263
+ */
264
+ public function isAccessible();
265
+
266
+ }
lib/Inx/Api/Recipient/AttributeManager.php CHANGED
@@ -1,159 +1,159 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Recipient
5
- */
6
- /**
7
- * Using the <i>Inx_Api_Recipient_AttributeManager</i>, attributes (columns) can be manipulated.
8
- * The following operations can be performed using the <i>AttributeManager</i>:
9
- * <p>
10
- * <ul>
11
- * <li>Creating attributes: <i>create(String, int, int)</i>
12
- * <li>Removing user attributes: <i>remove(Attribute)</i>
13
- * <li>Renaming user attributes: <i>rename(Attribute, String)</i>
14
- * <li>Checking list visibility: <i>isAttributeVisibleInList(Attribute, int)</i> and
15
- * <i>areAttributesVisibleInList(List, int)</i>
16
- * <li>Setting list visibility: <i>setAttributeListVisibility(Attribute, int, boolean)</i> and
17
- * <i>setAttributeListVisibilities(List, int, boolean)</i>
18
- * <li>Setting global visibility: <i>setGlobalAttributeVisibility(Attribute, boolean)</i> and
19
- * <i>setGlobalAttributeVisibilities(List, boolean)</i>
20
- * </ul>
21
- * Note: Changing the data type of an attribute is not supported by the <i>AttributeManager</i>.
22
- * This is a possibly dangerous operation that should - if at all - be performed using the client which can
23
- * provide guidance and assistance in converting attributes from on type into another.
24
- * <p>
25
- * The <i>AttributeManager</i> can not be used to change attribute values for recipients.
26
- * This is performed using the <i>Inx_Api_Recipient_RecipientContext</i>.
27
- * See the <i>RecipientContext</i> documentation for more information on this topic.
28
- * <p>
29
- * Following example illustrates how to create a new text attribute with a length of 50 characters:
30
- *
31
- * <pre>
32
- * $oSession->getAttributeManager()->create( "Firstname", Inx_Api_Recipient_Attribute::DATA_TYPE_STRING, 50 );
33
- * </pre>
34
- * <p>
35
- * For more information on <i>Attribute</i>s in general, see the <i>Inx_Api_Recipient_Attribute</i> documentation.
36
- *
37
- * @see Inx_Api_Recipient_Attribute
38
- * @see Inx_Api_Recipient_RecipientContext
39
- * @since API 1.0
40
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
41
- * @package Inxmail
42
- * @subpackage Recipient
43
- */
44
- interface Inx_Api_Recipient_AttributeManager
45
- {
46
-
47
- /**
48
- * Create a new user attribute.
49
- *
50
- * @param attributeName the unique name of the attribute
51
- * @param dataType the data type of the attribute
52
- * @param maxStringLenth the length of the string attribute (length from 1 to 255),
53
- * only for <i>Inx_Api_Recipient_Attribute::DATA_TYPE_STRING</i>
54
- * @return the attribute id of the new attribute
55
- * @throws Inx_Api_NameException if the attribute name is illegal or already exist
56
- * @see Inx_Api_Recipient_Attribute
57
- */
58
- public function create( $sAttributeName, $iDataType, $iMaxStringLenth );
59
-
60
-
61
- /**
62
- * Rename a user attribute.
63
- *
64
- * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to rename
65
- * @param string $sAttributeName the new attribute name
66
- * @return boolean true, if the attribute is renamed, otherwise false
67
- * @throws Inx_Api_NameException if the attribute name is illegal or already exist
68
- */
69
- public function rename( Inx_Api_Recipient_Attribute $oAttribute, $sAttributeName );
70
-
71
-
72
- /**
73
- * Remove a user attribute.
74
- *
75
- * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to remove
76
- * @return boolean true, if the attribute is removed, otherwise false
77
- */
78
- public function remove( Inx_Api_Recipient_Attribute $oAttribute = null );
79
-
80
-
81
- /**
82
- * Checks whether the given attribute is visible in the specified list.
83
- *
84
- * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to check.
85
- * @param int $iListId the id of the list to check.
86
- * @return bool <i>true</i> if the attribute is visible in the list, <i>false</i> otherwise.
87
- * @since API 1.10.0
88
- */
89
- public function isAttributeVisibleInList( Inx_Api_Recipient_Attribute $oAttribute, $iListId );
90
-
91
-
92
- /**
93
- * Checks whether the given attributes are visible in the specified list.
94
- * The result is an associative array where the attribute id is the key and the value is a <i>bool</i> indicating
95
- * the visibility of the attribute.
96
- *
97
- * @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to check.
98
- * @param int $iListId the id of the list to check.
99
- * @return array an associative array containing int/bool pairs.
100
- * @since API 1.10.0
101
- */
102
- public function areAttributesVisibleInList( $aAttributes, $iListId );
103
-
104
-
105
- /**
106
- * Sets the visibility of an attribute (column) in a specific list.
107
- * Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
108
- * <i>Inx_Api_APIException</i>.
109
- *
110
- * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to show or hide.
111
- * @param int $iListId the id of the list in which the attribute shall be shown or hidden.
112
- * @param bool $blVisible <i>true</i> if the attribute shall be shown, <i>false</i> if it shall be hidden.
113
- * @throws Inx_Api_APIException if the attribute can not be shown / hidden.
114
- * @since API 1.9.0
115
- */
116
- public function setAttributeListVisibility( Inx_Api_Recipient_Attribute $oAttribute, $iListId, $blVisible );
117
-
118
-
119
- /**
120
- * Sets the visibility of a list of attributes (columns) in a specific list.
121
- * Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
122
- * <i>Inx_Api_APIException</i>.
123
- * If the list contains such an attribute, none of the attributes will be modified.
124
- *
125
- * @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to show or hide.
126
- * @param int $iListId the id of the list in which the attributes shall be shown or hidden.
127
- * @param bool $blVisible <i>true</i> if the attributes shall be shown, <i>false</codei> if they shall be hidden.
128
- * @throws Inx_Api_APIException if at least one attribute can not be shown / hidden.
129
- * @since API 1.9.0
130
- */
131
- public function setAttributeListVisibilities( $aAttributes, $iListId, $blVisible );
132
-
133
-
134
- /**
135
- * Sets the visibility of an attribute (column) in all lists.
136
- * Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
137
- * <i>Inx_Api_APIException</i>.
138
- *
139
- * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to show or hide.
140
- * @param bool $blVisible <i>true</i> if the attribute shall be shown, <i>false</i> if it shall be hidden.
141
- * @throws Inx_Api_APIException if the attribute can not be shown / hidden.
142
- * @since API 1.9.0
143
- */
144
- public function setGlobalAttributeVisibility( Inx_Api_Recipient_Attribute $oAttribute, $blVisible );
145
-
146
-
147
- /**
148
- * Sets the visibility of a list of attributes (columns) in all lists.
149
- * Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
150
- * <i>Inx_Api_APIException</i>.
151
- * If the list contains such an attribute, none of the attributes will be modified.
152
- *
153
- * @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to show or hide.
154
- * @param bool $blVisible <i>true</i> if the attributes shall be shown, <i>false</i> if they shall be hidden.
155
- * @throws Inx_Api_APIException if at least one attribute can not be shown / hidden.
156
- * @since API 1.9.0
157
- */
158
- public function setGlobalAttributeVisibilities( $aAttributes, $blVisible );
159
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Recipient
5
+ */
6
+ /**
7
+ * Using the <i>Inx_Api_Recipient_AttributeManager</i>, attributes (columns) can be manipulated.
8
+ * The following operations can be performed using the <i>AttributeManager</i>:
9
+ * <p>
10
+ * <ul>
11
+ * <li>Creating attributes: <i>create(String, int, int)</i>
12
+ * <li>Removing user attributes: <i>remove(Attribute)</i>
13
+ * <li>Renaming user attributes: <i>rename(Attribute, String)</i>
14
+ * <li>Checking list visibility: <i>isAttributeVisibleInList(Attribute, int)</i> and
15
+ * <i>areAttributesVisibleInList(List, int)</i>
16
+ * <li>Setting list visibility: <i>setAttributeListVisibility(Attribute, int, boolean)</i> and
17
+ * <i>setAttributeListVisibilities(List, int, boolean)</i>
18
+ * <li>Setting global visibility: <i>setGlobalAttributeVisibility(Attribute, boolean)</i> and
19
+ * <i>setGlobalAttributeVisibilities(List, boolean)</i>
20
+ * </ul>
21
+ * Note: Changing the data type of an attribute is not supported by the <i>AttributeManager</i>.
22
+ * This is a possibly dangerous operation that should - if at all - be performed using the client which can
23
+ * provide guidance and assistance in converting attributes from on type into another.
24
+ * <p>
25
+ * The <i>AttributeManager</i> can not be used to change attribute values for recipients.
26
+ * This is performed using the <i>Inx_Api_Recipient_RecipientContext</i>.
27
+ * See the <i>RecipientContext</i> documentation for more information on this topic.
28
+ * <p>
29
+ * Following example illustrates how to create a new text attribute with a length of 50 characters:
30
+ *
31
+ * <pre>
32
+ * $oSession->getAttributeManager()->create( "Firstname", Inx_Api_Recipient_Attribute::DATA_TYPE_STRING, 50 );
33
+ * </pre>
34
+ * <p>
35
+ * For more information on <i>Attribute</i>s in general, see the <i>Inx_Api_Recipient_Attribute</i> documentation.
36
+ *
37
+ * @see Inx_Api_Recipient_Attribute
38
+ * @see Inx_Api_Recipient_RecipientContext
39
+ * @since API 1.0
40
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
41
+ * @package Inxmail
42
+ * @subpackage Recipient
43
+ */
44
+ interface Inx_Api_Recipient_AttributeManager
45
+ {
46
+
47
+ /**
48
+ * Create a new user attribute.
49
+ *
50
+ * @param attributeName the unique name of the attribute
51
+ * @param dataType the data type of the attribute
52
+ * @param maxStringLenth the length of the string attribute (length from 1 to 255),
53
+ * only for <i>Inx_Api_Recipient_Attribute::DATA_TYPE_STRING</i>
54
+ * @return the attribute id of the new attribute
55
+ * @throws Inx_Api_NameException if the attribute name is illegal or already exist
56
+ * @see Inx_Api_Recipient_Attribute
57
+ */
58
+ public function create( $sAttributeName, $iDataType, $iMaxStringLenth );
59
+
60
+
61
+ /**
62
+ * Rename a user attribute.
63
+ *
64
+ * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to rename
65
+ * @param string $sAttributeName the new attribute name
66
+ * @return boolean true, if the attribute is renamed, otherwise false
67
+ * @throws Inx_Api_NameException if the attribute name is illegal or already exist
68
+ */
69
+ public function rename( Inx_Api_Recipient_Attribute $oAttribute, $sAttributeName );
70
+
71
+
72
+ /**
73
+ * Remove a user attribute.
74
+ *
75
+ * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to remove
76
+ * @return boolean true, if the attribute is removed, otherwise false
77
+ */
78
+ public function remove( Inx_Api_Recipient_Attribute $oAttribute = null );
79
+
80
+
81
+ /**
82
+ * Checks whether the given attribute is visible in the specified list.
83
+ *
84
+ * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to check.
85
+ * @param int $iListId the id of the list to check.
86
+ * @return bool <i>true</i> if the attribute is visible in the list, <i>false</i> otherwise.
87
+ * @since API 1.10.0
88
+ */
89
+ public function isAttributeVisibleInList( Inx_Api_Recipient_Attribute $oAttribute, $iListId );
90
+
91
+
92
+ /**
93
+ * Checks whether the given attributes are visible in the specified list.
94
+ * The result is an associative array where the attribute id is the key and the value is a <i>bool</i> indicating
95
+ * the visibility of the attribute.
96
+ *
97
+ * @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to check.
98
+ * @param int $iListId the id of the list to check.
99
+ * @return array an associative array containing int/bool pairs.
100
+ * @since API 1.10.0
101
+ */
102
+ public function areAttributesVisibleInList( $aAttributes, $iListId );
103
+
104
+
105
+ /**
106
+ * Sets the visibility of an attribute (column) in a specific list.
107
+ * Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
108
+ * <i>Inx_Api_APIException</i>.
109
+ *
110
+ * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to show or hide.
111
+ * @param int $iListId the id of the list in which the attribute shall be shown or hidden.
112
+ * @param bool $blVisible <i>true</i> if the attribute shall be shown, <i>false</i> if it shall be hidden.
113
+ * @throws Inx_Api_APIException if the attribute can not be shown / hidden.
114
+ * @since API 1.9.0
115
+ */
116
+ public function setAttributeListVisibility( Inx_Api_Recipient_Attribute $oAttribute, $iListId, $blVisible );
117
+
118
+
119
+ /**
120
+ * Sets the visibility of a list of attributes (columns) in a specific list.
121
+ * Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
122
+ * <i>Inx_Api_APIException</i>.
123
+ * If the list contains such an attribute, none of the attributes will be modified.
124
+ *
125
+ * @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to show or hide.
126
+ * @param int $iListId the id of the list in which the attributes shall be shown or hidden.
127
+ * @param bool $blVisible <i>true</i> if the attributes shall be shown, <i>false</codei> if they shall be hidden.
128
+ * @throws Inx_Api_APIException if at least one attribute can not be shown / hidden.
129
+ * @since API 1.9.0
130
+ */
131
+ public function setAttributeListVisibilities( $aAttributes, $iListId, $blVisible );
132
+
133
+
134
+ /**
135
+ * Sets the visibility of an attribute (column) in all lists.
136
+ * Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
137
+ * <i>Inx_Api_APIException</i>.
138
+ *
139
+ * @param Inx_Api_Recipient_Attribute $oAttribute the attribute to show or hide.
140
+ * @param bool $blVisible <i>true</i> if the attribute shall be shown, <i>false</i> if it shall be hidden.
141
+ * @throws Inx_Api_APIException if the attribute can not be shown / hidden.
142
+ * @since API 1.9.0
143
+ */
144
+ public function setGlobalAttributeVisibility( Inx_Api_Recipient_Attribute $oAttribute, $blVisible );
145
+
146
+
147
+ /**
148
+ * Sets the visibility of a list of attributes (columns) in all lists.
149
+ * Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
150
+ * <i>Inx_Api_APIException</i>.
151
+ * If the list contains such an attribute, none of the attributes will be modified.
152
+ *
153
+ * @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to show or hide.
154
+ * @param bool $blVisible <i>true</i> if the attributes shall be shown, <i>false</i> if they shall be hidden.
155
+ * @throws Inx_Api_APIException if at least one attribute can not be shown / hidden.
156
+ * @since API 1.9.0
157
+ */
158
+ public function setGlobalAttributeVisibilities( $aAttributes, $blVisible );
159
+ }
lib/Inx/Api/Recipient/AttributeNotFoundException.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Recipient
5
- */
6
- /**
7
- * An exception thrown by the <i>Inx_Api_Recipient_RecipientMetaData</i> when an attribute does not exist.
8
- *
9
- * @since API 1.0
10
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
- * @package Inxmail
12
- * @subpackage Recipient
13
- */
14
- class Inx_Api_Recipient_AttributeNotFoundException extends Exception
15
- {
16
-
17
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Recipient
5
+ */
6
+ /**
7
+ * An exception thrown by the <i>Inx_Api_Recipient_RecipientMetaData</i> when an attribute does not exist.
8
+ *
9
+ * @since API 1.0
10
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
+ * @package Inxmail
12
+ * @subpackage Recipient
13
+ */
14
+ class Inx_Api_Recipient_AttributeNotFoundException extends Exception
15
+ {
16
+
17
+ }
lib/Inx/Api/Recipient/BlackListException.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Recipient
5
- */
6
- /**
7
- * A <i>Inx_Api_Recipient_BlackListException</i> is thrown when the email address of a recipient is blocked by the black list.
8
- *
9
- * @since API 1.0
10
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
- * @package Inxmail
12
- * @subpackage Recipient
13
- */
14
- class Inx_Api_Recipient_BlackListException extends Exception
15
- {
16
-
17
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Recipient
5
+ */
6
+ /**
7
+ * A <i>Inx_Api_Recipient_BlackListException</i> is thrown when the email address of a recipient is blocked by the black list.
8
+ *
9
+ * @since API 1.0
10
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
+ * @package Inxmail
12
+ * @subpackage Recipient
13
+ */
14
+ class Inx_Api_Recipient_BlackListException extends Exception
15
+ {
16
+
17
  }
lib/Inx/Api/Recipient/DuplicateKeyException.php CHANGED
@@ -1,18 +1,18 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Recipient
5
- */
6
- /**
7
- * An <i>Inx_Api_Recipient_DuplicateKeyException</i> is thrown when a recipient with the same key value already exists.
8
- * The key usually is the email address.
9
- *
10
- * @since API 1.0
11
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
12
- * @package Inxmail
13
- * @subpackage Recipient
14
- */
15
- class Inx_Api_Recipient_DuplicateKeyException extends Exception
16
- {
17
-
18
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Recipient
5
+ */
6
+ /**
7
+ * An <i>Inx_Api_Recipient_DuplicateKeyException</i> is thrown when a recipient with the same key value already exists.
8
+ * The key usually is the email address.
9
+ *
10
+ * @since API 1.0
11
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
12
+ * @package Inxmail
13
+ * @subpackage Recipient
14
+ */
15
+ class Inx_Api_Recipient_DuplicateKeyException extends Exception
16
+ {
17
+
18
+ }
lib/Inx/Api/Recipient/IllegalValueException.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Recipient
6
- */
7
- /**
8
- * Thrown by the <i>commitRowUpdate</i> method of an <I>Inx_Api_Recipient_RecipientRowSet</i> or
9
- * <i>Inx_Api_Recipient_UnsubscriptionRecipientRowSet</i> to indicate that the value of the specified attribute is illegal.
10
- * The source attribute id is coded as error code.
11
- *
12
- * @since API 1.0
13
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
14
- * @package Inxmail
15
- * @subpackage Recipient
16
- */
17
- class Inx_Api_Recipient_IllegalValueException extends Exception
18
- {
19
-
20
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Recipient
6
+ */
7
+ /**
8
+ * Thrown by the <i>commitRowUpdate</i> method of an <I>Inx_Api_Recipient_RecipientRowSet</i> or
9
+ * <i>Inx_Api_Recipient_UnsubscriptionRecipientRowSet</i> to indicate that the value of the specified attribute is illegal.
10
+ * The source attribute id is coded as error code.
11
+ *
12
+ * @since API 1.0
13
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
14
+ * @package Inxmail
15
+ * @subpackage Recipient
16
+ */
17
+ class Inx_Api_Recipient_IllegalValueException extends Exception
18
+ {
19
+
20
+ }
lib/Inx/Api/Recipient/SelectException.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Recipient
6
- */
7
- /**
8
- * An <i>Inx_Api_Recipient_SelectException</i> is thrown by the <i>select()</i> methods of the
9
- * <i>Inx_Api_Recipient_RecipientContext</i> when a selection failed.
10
- *
11
- * @see Inx_Api_Recipient_RecipientContext
12
- * @since API 1.0
13
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
14
- * @package Inxmail
15
- * @subpackage Recipient
16
- */
17
- class Inx_Api_Recipient_SelectException extends Exception
18
- {
19
-
20
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Recipient
6
+ */
7
+ /**
8
+ * An <i>Inx_Api_Recipient_SelectException</i> is thrown by the <i>select()</i> methods of the
9
+ * <i>Inx_Api_Recipient_RecipientContext</i> when a selection failed.
10
+ *
11
+ * @see Inx_Api_Recipient_RecipientContext
12
+ * @since API 1.0
13
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
14
+ * @package Inxmail
15
+ * @subpackage Recipient
16
+ */
17
+ class Inx_Api_Recipient_SelectException extends Exception
18
+ {
19
+
20
+ }
lib/Inx/Api/RemoteException.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * @package Inxmail
7
- */
8
- class Inx_Api_RemoteException extends Exception
9
- {
10
- protected $_oOrigExc = null;
11
-
12
- /**
13
- * Enter description here...
14
- *
15
- * @param string $sMsg
16
- * @param int $iCode
17
- * @param Exception $oOrigExc original exception object
18
- */
19
- public function __construct($sMsg, $iCode=null, $oOrigExc=null)
20
- {
21
- $this->_oOrigExc = $oOrigExc;
22
- parent::__construct($sMsg, $iCode);
23
- }
24
- /**
25
- * @return Exception object
26
- */
27
- public function getOrigException()
28
- {
29
- return $this->_oOrigExc;
30
- }
31
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * @package Inxmail
7
+ */
8
+ class Inx_Api_RemoteException extends Exception
9
+ {
10
+ protected $_oOrigExc = null;
11
+
12
+ /**
13
+ * Enter description here...
14
+ *
15
+ * @param string $sMsg
16
+ * @param int $iCode
17
+ * @param Exception $oOrigExc original exception object
18
+ */
19
+ public function __construct($sMsg, $iCode=null, $oOrigExc=null)
20
+ {
21
+ $this->_oOrigExc = $oOrigExc;
22
+ parent::__construct($sMsg, $iCode);
23
+ }
24
+ /**
25
+ * @return Exception object
26
+ */
27
+ public function getOrigException()
28
+ {
29
+ return $this->_oOrigExc;
30
+ }
31
  }
lib/Inx/Api/Reporting/ConfigDescriptor.php CHANGED
@@ -1,106 +1,106 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Reporting
6
- */
7
- /**
8
- * Every report type has a configuration descriptor.
9
- * The <i>Inx_Api_Reporting_ConfigDescriptor</i> describes the structure and elements of the report configuration area.
10
- * A <i>ConfigDescriptor</i> contains a set of <i>Inx_Api_Reporting_ControlUnit</i>s (mostly zero or one) which in turn
11
- * contain a set of <i>Inx_Api_Reporting_Control</i>s.
12
- * An <i>Inx_Api_Reporting_Control</i> describes a configuration element like the list or mailing chooser.
13
- * <p>
14
- * The following snippet shows how to print out the content of the <i>ConfigurationDescriptor</i> for the
15
- * ClickReactionTimeResponse report:
16
- *
17
- * <pre>
18
- * $oReportEngine = $oSession->getReportEngine();
19
- * $oConfigDescriptor = $oReportEngine->getDescriptor( &quot;ClickReactionTimeResponse&quot;, &quot;en_GB&quot; );
20
- *
21
- * echo &quot;&#60;pre&#62;&quot;;
22
- * echo &quot;Localized Report Title: &quot;.$oConfigDescriptor->getTitle().&quot;&#60;br&#62;&#60;br&#62;&quot;;
23
- *
24
- * for( $i = 0; $i &lt; $oConfigDescriptor->getControlUnitCount(); $i++ )
25
- * {
26
- * echo &quot;Control Unit #&quot;.$i.&quot;:&#60;br&#62;&quot;;
27
- * $oControlUnit = $oConfigDescriptor->getControlUnit( $i );
28
- *
29
- * echo &quot;Localized control title: &quot;.$oControlUnit->getTitle().&quot;&#60;br&#62;&quot;;
30
- *
31
- * for( $j = 0; $j &lt; $oControlUnit->getControlCount(); $j++ )
32
- * {
33
- * $oControl = $oControlUnit->getControl( $j );
34
- *
35
- * echo &quot; Control #&quot;.$j.&quot;:&#60;br&#62;&quot;;
36
- * echo &quot; Control type: &quot;.$oControl->getType().&quot;&#60;br&#62;&quot;;
37
- *
38
- * foreach( $oControl->getPropertyKeys() as $sKey )
39
- * {
40
- * echo &quot; Key: &quot;.$sKey.&quot; - Value: &quot;.$oControl->getProperty( $sKey ).&quot;&#60;br&#62;&quot;;
41
- * }
42
- * }
43
- * }
44
- *
45
- * echo &quot;&#60;/pre&#62;&quot;;
46
- * </pre>
47
- *
48
- * This snippet will produce the following output:
49
- *
50
- * <pre>
51
- * Localized Report Title: Clicks over time
52
- *
53
- * Control Unit #0:
54
- * Localized control title: Settings
55
- * Control #0:
56
- * Control type: mailingChooser
57
- * Key: listTitle - Value: Mailing list:
58
- * Key: mailingTitle - Value: Mailing:
59
- * Key: listBind - Value: listid
60
- * Key: mailingBind - Value: mailingid
61
- * Control #1:
62
- * Control type: simpleTimeIntervalControl
63
- * Key: title - Value: Report time period:
64
- * Key: countBind - Value: count
65
- * Key: intervalBind - Value: interval
66
- * Key: clause - Value: until today
67
- * </pre>
68
- * <p>
69
- * For more information on controls, see the <i>Inx_Api_Reporting_Control</i> documentation.
70
- *
71
- * @see Inx_Api_Reporting_ReportEngine
72
- * @see Inx_Api_Reporting_ControlUnit
73
- * @see Inx_Api_Reporting_Control
74
- * @since API 1.3
75
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
76
- * @package Inxmail
77
- * @subpackage Reporting
78
- */
79
- interface Inx_Api_Reporting_ConfigDescriptor
80
- {
81
-
82
- /**
83
- * Returns the localized title of this report.
84
- *
85
- * @return string the localized title of this report.
86
- */
87
- public function getTitle();
88
-
89
-
90
- /**
91
- * Returns the <i>Inx_Api_Reporting_ControlUnit</i> at the specified position.
92
- *
93
- * @param int $iIndex the index of the control unit to return.
94
- * @return Inx_Api_Reporting_ControlUnit the control unit at the specified position.
95
- */
96
- public function getControlUnit( $iIndex );
97
-
98
-
99
- /**
100
- * Returns the number of <i>Inx_Api_Reporting_ControlUnit</i>s.
101
- *
102
- * @return int the number of control units.
103
- */
104
- public function getControlUnitCount();
105
-
106
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Reporting
6
+ */
7
+ /**
8
+ * Every report type has a configuration descriptor.
9
+ * The <i>Inx_Api_Reporting_ConfigDescriptor</i> describes the structure and elements of the report configuration area.
10
+ * A <i>ConfigDescriptor</i> contains a set of <i>Inx_Api_Reporting_ControlUnit</i>s (mostly zero or one) which in turn
11
+ * contain a set of <i>Inx_Api_Reporting_Control</i>s.
12
+ * An <i>Inx_Api_Reporting_Control</i> describes a configuration element like the list or mailing chooser.
13
+ * <p>
14
+ * The following snippet shows how to print out the content of the <i>ConfigurationDescriptor</i> for the
15
+ * ClickReactionTimeResponse report:
16
+ *
17
+ * <pre>
18
+ * $oReportEngine = $oSession->getReportEngine();
19
+ * $oConfigDescriptor = $oReportEngine->getDescriptor( &quot;ClickReactionTimeResponse&quot;, &quot;en_GB&quot; );
20
+ *
21
+ * echo &quot;&#60;pre&#62;&quot;;
22
+ * echo &quot;Localized Report Title: &quot;.$oConfigDescriptor->getTitle().&quot;&#60;br&#62;&#60;br&#62;&quot;;
23
+ *
24
+ * for( $i = 0; $i &lt; $oConfigDescriptor->getControlUnitCount(); $i++ )
25
+ * {
26
+ * echo &quot;Control Unit #&quot;.$i.&quot;:&#60;br&#62;&quot;;
27
+ * $oControlUnit = $oConfigDescriptor->getControlUnit( $i );
28
+ *
29
+ * echo &quot;Localized control title: &quot;.$oControlUnit->getTitle().&quot;&#60;br&#62;&quot;;
30
+ *
31
+ * for( $j = 0; $j &lt; $oControlUnit->getControlCount(); $j++ )
32
+ * {
33
+ * $oControl = $oControlUnit->getControl( $j );
34
+ *
35
+ * echo &quot; Control #&quot;.$j.&quot;:&#60;br&#62;&quot;;
36
+ * echo &quot; Control type: &quot;.$oControl->getType().&quot;&#60;br&#62;&quot;;
37
+ *
38
+ * foreach( $oControl->getPropertyKeys() as $sKey )
39
+ * {
40
+ * echo &quot; Key: &quot;.$sKey.&quot; - Value: &quot;.$oControl->getProperty( $sKey ).&quot;&#60;br&#62;&quot;;
41
+ * }
42
+ * }
43
+ * }
44
+ *
45
+ * echo &quot;&#60;/pre&#62;&quot;;
46
+ * </pre>
47
+ *
48
+ * This snippet will produce the following output:
49
+ *
50
+ * <pre>
51
+ * Localized Report Title: Clicks over time
52
+ *
53
+ * Control Unit #0:
54
+ * Localized control title: Settings
55
+ * Control #0:
56
+ * Control type: mailingChooser
57
+ * Key: listTitle - Value: Mailing list:
58
+ * Key: mailingTitle - Value: Mailing:
59
+ * Key: listBind - Value: listid
60
+ * Key: mailingBind - Value: mailingid
61
+ * Control #1:
62
+ * Control type: simpleTimeIntervalControl
63
+ * Key: title - Value: Report time period:
64
+ * Key: countBind - Value: count
65
+ * Key: intervalBind - Value: interval
66
+ * Key: clause - Value: until today
67
+ * </pre>
68
+ * <p>
69
+ * For more information on controls, see the <i>Inx_Api_Reporting_Control</i> documentation.
70
+ *
71
+ * @see Inx_Api_Reporting_ReportEngine
72
+ * @see Inx_Api_Reporting_ControlUnit
73
+ * @see Inx_Api_Reporting_Control
74
+ * @since API 1.3
75
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
76
+ * @package Inxmail
77
+ * @subpackage Reporting
78
+ */
79
+ interface Inx_Api_Reporting_ConfigDescriptor
80
+ {
81
+
82
+ /**
83
+ * Returns the localized title of this report.
84
+ *
85
+ * @return string the localized title of this report.
86
+ */
87
+ public function getTitle();
88
+
89
+
90
+ /**
91
+ * Returns the <i>Inx_Api_Reporting_ControlUnit</i> at the specified position.
92
+ *
93
+ * @param int $iIndex the index of the control unit to return.
94
+ * @return Inx_Api_Reporting_ControlUnit the control unit at the specified position.
95
+ */
96
+ public function getControlUnit( $iIndex );
97
+
98
+
99
+ /**
100
+ * Returns the number of <i>Inx_Api_Reporting_ControlUnit</i>s.
101
+ *
102
+ * @return int the number of control units.
103
+ */
104
+ public function getControlUnitCount();
105
+
106
+ }
lib/Inx/Api/Reporting/Control.php CHANGED
@@ -1,129 +1,129 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Reporting
6
- */
7
- /**
8
- * An <i>Inx_Api_Reporting_Control</i> describes a configuration element like the list or mailing chooser.
9
- * You can determine which element a <i>Control</i> describes using the <i>getType()</i> method.
10
- * For a list of all available types, see below.
11
- * A <i>Control</i> also provides some localized labels and the names of the value bindings, used to set
12
- * the value of a property.
13
- * <p>
14
- * The following snippet shows how to use <i>getProperty($sKey)</i> to acquire the parameter bindings:
15
- *
16
- * <pre>
17
- * $domainParam = $domainControl->getProperty( "bind" ); // $domainControl is of type stringControl
18
- * $intervalParam = $timeIntervalChooser->getProperty( "intervalBind" );
19
- * $countParam = $timeIntervalChooser->getProperty( "countBind" );
20
- *
21
- * $oReportRequest = new Inx_Api_Reporting_ReportRequest( "IncomingMailDetailsForDomain",
22
- * Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML, "de_DE", "Europe/Berlin" );
23
- * $oReportRequest->putParameter( $domainParam, "org" );
24
- * $oReportRequest->putParameter( $intervalParam, "day" );
25
- * $oReportRequest->putParameter( $countParam, "14" );
26
- * </pre>
27
- * <p>
28
- * <b><u>Supported control types since Inxmail 3.5:</u></b>
29
- * <p>
30
- * <b>stringControl</b><br>
31
- * This control has following properties:<br>
32
- * title - the localized title of the control<br>
33
- * bind - the unique parameter key (like "domain"); the value as string (like "com")<br>
34
- * <p>
35
- * <b>timeIntervalChooser</b><br>
36
- * title - the localized title of this control<br>
37
- * beginBind - the unique parameter key; the begin date of the interval as number of milliseconds since January 1, 1970,
38
- * 00:00:00 GMT<br>
39
- * endBind - the unique parameter key; the end date of the interval as number of milliseconds since January 1, 1970,
40
- * 00:00:00 GMT<br>
41
- * intervalBind - the unique parameter key; the interval type - hour, day, week and month<br>
42
- * countBind - the unique parameter key; the count of intervals<br>
43
- * <p>
44
- * <b>simpleTimeIntervalControl</b><br>
45
- * title - the localized title of this control<br>
46
- * clause - the localized title of this control<br>
47
- * intervalBind - the unique parameter key; the interval type - hour, day, week and month<br>
48
- * countBind - the unique parameter key; the count of intervals<br>
49
- * <p>
50
- * <b>dateSpanControl</b><br>
51
- * title - the localized title of this control<br>
52
- * beginBind - the unique parameter key; the begin date of the interval as number of milliseconds since January 1, 1970,
53
- * 00:00:00 GMT<br>
54
- * endBind - the unique parameter key; the end date of the interval as number of milliseconds since January 1, 1970,
55
- * 00:00:00 GMT<br>
56
- * countBind - the unique parameter key; the count of intervals<br>
57
- * <p>
58
- * <b>limitControl</b><br>
59
- * title - the localized title of this control<br>
60
- * bind - the unique parameter key (like "limit"); the integer value as string (like "25")<br>
61
- * <p>
62
- * <b>attributeChooser</b><br>
63
- * title - the localized title of this control<br>
64
- * bind - the unique parameter key (like "attrid"); the parameter value is the attribute id<br>
65
- * <p>
66
- * <b>listChooser</b><br>
67
- * title - the localized title of this control<br>
68
- * bind - the unique parameter key (like "listid"); the parameter value is the list id<br>
69
- * <p>
70
- * <b>mailingChooser</b><br>
71
- * listTitle - the localized title of this control<br>
72
- * mailingTitle - the localized title of this control<br>
73
- * listBind - the unique parameter key (like "attrid"); the parameter value is the attribute id<br>
74
- * mailingBind - the unique parameter key (like "listid"); the parameter value is the list id<br>
75
- * <p>
76
- * <b>checkboxControl</b><br>
77
- * title - the localized title of this control<br>
78
- * bind - the unique parameter key (like "enabled1"); the valid values are "true" and "false"<br>
79
- * <p>
80
- * For more information on the report configuration in general, see the <i>Inx_Api_Reporting_ConfigDescriptor</i> documentation.
81
- *
82
- * @see Inx_Api_Reporting_ControlUnit
83
- * @see Inx_Api_Reporting_ConfigDescriptor
84
- * @since API 1.3
85
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
86
- * @package Inxmail
87
- * @subpackage Reporting
88
- */
89
- interface Inx_Api_Reporting_Control
90
- {
91
-
92
- /**
93
- * Returns the type of this control.
94
- * <p>
95
- * The supported types are:
96
- * <ul>
97
- * <li>stringControl,
98
- * <li>timeIntervalChooser,
99
- * <li>simpleTimeIntervalControl,
100
- * <li>dateSpanControl,
101
- * <li>limitControl,
102
- * <li>attributeChooser,
103
- * <li>listChooser,
104
- * <li>mailingChooser and
105
- * <li>checkboxControl
106
- * </ul>
107
- *
108
- * @return string the type of this control.
109
- */
110
- public function getType();
111
-
112
-
113
- /**
114
- * Returns the value to which this control maps the specified key.
115
- * The control contains localized titles and parameter bindings.
116
- *
117
- * @param string $sKey the key whose associated value shall be returned.
118
- * @return string the value to which this control maps the specified key.
119
- */
120
- public function getProperty( $sKey );
121
-
122
-
123
- /**
124
- * Returns an array of the keys contained in this control.
125
- *
126
- * @return array an array of the keys.
127
- */
128
- public function getPropertyKeys();
129
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Reporting
6
+ */
7
+ /**
8
+ * An <i>Inx_Api_Reporting_Control</i> describes a configuration element like the list or mailing chooser.
9
+ * You can determine which element a <i>Control</i> describes using the <i>getType()</i> method.
10
+ * For a list of all available types, see below.
11
+ * A <i>Control</i> also provides some localized labels and the names of the value bindings, used to set
12
+ * the value of a property.
13
+ * <p>
14
+ * The following snippet shows how to use <i>getProperty($sKey)</i> to acquire the parameter bindings:
15
+ *
16
+ * <pre>
17
+ * $domainParam = $domainControl->getProperty( "bind" ); // $domainControl is of type stringControl
18
+ * $intervalParam = $timeIntervalChooser->getProperty( "intervalBind" );
19
+ * $countParam = $timeIntervalChooser->getProperty( "countBind" );
20
+ *
21
+ * $oReportRequest = new Inx_Api_Reporting_ReportRequest( "IncomingMailDetailsForDomain",
22
+ * Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML, "de_DE", "Europe/Berlin" );
23
+ * $oReportRequest->putParameter( $domainParam, "org" );
24
+ * $oReportRequest->putParameter( $intervalParam, "day" );
25
+ * $oReportRequest->putParameter( $countParam, "14" );
26
+ * </pre>
27
+ * <p>
28
+ * <b><u>Supported control types since Inxmail 3.5:</u></b>
29
+ * <p>
30
+ * <b>stringControl</b><br>
31
+ * This control has following properties:<br>
32
+ * title - the localized title of the control<br>
33
+ * bind - the unique parameter key (like "domain"); the value as string (like "com")<br>
34
+ * <p>
35
+ * <b>timeIntervalChooser</b><br>
36
+ * title - the localized title of this control<br>
37
+ * beginBind - the unique parameter key; the begin date of the interval as number of milliseconds since January 1, 1970,
38
+ * 00:00:00 GMT<br>
39
+ * endBind - the unique parameter key; the end date of the interval as number of milliseconds since January 1, 1970,
40
+ * 00:00:00 GMT<br>
41
+ * intervalBind - the unique parameter key; the interval type - hour, day, week and month<br>
42
+ * countBind - the unique parameter key; the count of intervals<br>
43
+ * <p>
44
+ * <b>simpleTimeIntervalControl</b><br>
45
+ * title - the localized title of this control<br>
46
+ * clause - the localized title of this control<br>
47
+ * intervalBind - the unique parameter key; the interval type - hour, day, week and month<br>
48
+ * countBind - the unique parameter key; the count of intervals<br>
49
+ * <p>
50
+ * <b>dateSpanControl</b><br>
51
+ * title - the localized title of this control<br>
52
+ * beginBind - the unique parameter key; the begin date of the interval as number of milliseconds since January 1, 1970,
53
+ * 00:00:00 GMT<br>
54
+ * endBind - the unique parameter key; the end date of the interval as number of milliseconds since January 1, 1970,
55
+ * 00:00:00 GMT<br>
56
+ * countBind - the unique parameter key; the count of intervals<br>
57
+ * <p>
58
+ * <b>limitControl</b><br>
59
+ * title - the localized title of this control<br>
60
+ * bind - the unique parameter key (like "limit"); the integer value as string (like "25")<br>
61
+ * <p>
62
+ * <b>attributeChooser</b><br>
63
+ * title - the localized title of this control<br>
64
+ * bind - the unique parameter key (like "attrid"); the parameter value is the attribute id<br>
65
+ * <p>
66
+ * <b>listChooser</b><br>
67
+ * title - the localized title of this control<br>
68
+ * bind - the unique parameter key (like "listid"); the parameter value is the list id<br>
69
+ * <p>
70
+ * <b>mailingChooser</b><br>
71
+ * listTitle - the localized title of this control<br>
72
+ * mailingTitle - the localized title of this control<br>
73
+ * listBind - the unique parameter key (like "attrid"); the parameter value is the attribute id<br>
74
+ * mailingBind - the unique parameter key (like "listid"); the parameter value is the list id<br>
75
+ * <p>
76
+ * <b>checkboxControl</b><br>
77
+ * title - the localized title of this control<br>
78
+ * bind - the unique parameter key (like "enabled1"); the valid values are "true" and "false"<br>
79
+ * <p>
80
+ * For more information on the report configuration in general, see the <i>Inx_Api_Reporting_ConfigDescriptor</i> documentation.
81
+ *
82
+ * @see Inx_Api_Reporting_ControlUnit
83
+ * @see Inx_Api_Reporting_ConfigDescriptor
84
+ * @since API 1.3
85
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
86
+ * @package Inxmail
87
+ * @subpackage Reporting
88
+ */
89
+ interface Inx_Api_Reporting_Control
90
+ {
91
+
92
+ /**
93
+ * Returns the type of this control.
94
+ * <p>
95
+ * The supported types are:
96
+ * <ul>
97
+ * <li>stringControl,
98
+ * <li>timeIntervalChooser,
99
+ * <li>simpleTimeIntervalControl,
100
+ * <li>dateSpanControl,
101
+ * <li>limitControl,
102
+ * <li>attributeChooser,
103
+ * <li>listChooser,
104
+ * <li>mailingChooser and
105
+ * <li>checkboxControl
106
+ * </ul>
107
+ *
108
+ * @return string the type of this control.
109
+ */
110
+ public function getType();
111
+
112
+
113
+ /**
114
+ * Returns the value to which this control maps the specified key.
115
+ * The control contains localized titles and parameter bindings.
116
+ *
117
+ * @param string $sKey the key whose associated value shall be returned.
118
+ * @return string the value to which this control maps the specified key.
119
+ */
120
+ public function getProperty( $sKey );
121
+
122
+
123
+ /**
124
+ * Returns an array of the keys contained in this control.
125
+ *
126
+ * @return array an array of the keys.
127
+ */
128
+ public function getPropertyKeys();
129
+ }
lib/Inx/Api/Reporting/ControlUnit.php CHANGED
@@ -1,50 +1,50 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Reporting
6
- */
7
- /**
8
- * The <i>Inx_Api_Reporting_ControlUnit</i> describes the configuration area of a report.
9
- * It holds the localized title and a list of <i>Inx_Api_Reporting_Control</i>s.
10
- * <i>Inx_Api_Reporting_Control</i>s describe configuration elements like the list or mailing chooser.
11
- * <p>
12
- * For more information on controls, see the <i>Inx_Api_Reporting_Control</i> documentation.
13
- * <p>
14
- * For more information on the report configuration in general, see the <i>Inx_Api_Reporting_ConfigDescriptor</i> documentation.
15
- *
16
- * @see Inx_Api_Reporting_ConfigDescriptor
17
- * @see Inx_Api_Reporting_Control
18
- * @since API 1.3
19
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
20
- * @package Inxmail
21
- * @subpackage Reporting
22
- */
23
- interface Inx_Api_Reporting_ControlUnit
24
- {
25
-
26
- /**
27
- * Returns the localized title of this control unit.
28
- *
29
- * @return string the localized title of this control unit.
30
- */
31
- public function getTitle();
32
-
33
-
34
- /**
35
- * Returns the control at the specified position.
36
- *
37
- * @param int $iIndex the index of the control to return.
38
- * @return Inx_Api_Reporting_Control the control at the specified position.
39
- */
40
- public function getControl( $iIndex );
41
-
42
-
43
- /**
44
- * Returns the number of controls.
45
- *
46
- * @return int the number of controls.
47
- */
48
- public function getControlCount();
49
-
50
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Reporting
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_Reporting_ControlUnit</i> describes the configuration area of a report.
9
+ * It holds the localized title and a list of <i>Inx_Api_Reporting_Control</i>s.
10
+ * <i>Inx_Api_Reporting_Control</i>s describe configuration elements like the list or mailing chooser.
11
+ * <p>
12
+ * For more information on controls, see the <i>Inx_Api_Reporting_Control</i> documentation.
13
+ * <p>
14
+ * For more information on the report configuration in general, see the <i>Inx_Api_Reporting_ConfigDescriptor</i> documentation.
15
+ *
16
+ * @see Inx_Api_Reporting_ConfigDescriptor
17
+ * @see Inx_Api_Reporting_Control
18
+ * @since API 1.3
19
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
20
+ * @package Inxmail
21
+ * @subpackage Reporting
22
+ */
23
+ interface Inx_Api_Reporting_ControlUnit
24
+ {
25
+
26
+ /**
27
+ * Returns the localized title of this control unit.
28
+ *
29
+ * @return string the localized title of this control unit.
30
+ */
31
+ public function getTitle();
32
+
33
+
34
+ /**
35
+ * Returns the control at the specified position.
36
+ *
37
+ * @param int $iIndex the index of the control to return.
38
+ * @return Inx_Api_Reporting_Control the control at the specified position.
39
+ */
40
+ public function getControl( $iIndex );
41
+
42
+
43
+ /**
44
+ * Returns the number of controls.
45
+ *
46
+ * @return int the number of controls.
47
+ */
48
+ public function getControlCount();
49
+
50
+ }
lib/Inx/Api/Reporting/DownloadableResult.php CHANGED
@@ -1,108 +1,108 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Reporting
6
- */
7
- /**
8
- * Use the <i>Inx_Api_Reporting_DownloadableResult</i> to download a generated report.
9
- * A <i>DownloadableResult</i> can be obtained using <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i>.
10
- * The report ticket is returned by <i>Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache)</i>.
11
- * As the report generation is an asynchronous process, the <i>DownloadableResult</i> must be polled.
12
- * <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i> will return <i>null</i> as long as the report
13
- * generation has not finished.
14
- * <p/>
15
- * The following snippet shows how to download a report using the <i>DownloadableResult</i>:
16
- *
17
- * <pre>
18
- * $oResult = $oReportTicket->fetchDownloadableResult();
19
- * while( $oResult == null )
20
- * {
21
- * sleep( 3 );
22
- * $oResult = $oReportTicket->fetchDownloadableResult();
23
- * }
24
- *
25
- * $sOutputFile = &quot;SystemDomainDistribution.pdf&quot;;
26
- * download( $oResult->getInputStream(), $sOutputFile );
27
- *
28
- * if( $oReportTicket != null )
29
- * {
30
- * $oReportTicket->close();
31
- * }
32
- * </pre>
33
- * <p/>
34
- * Some output formats (e.g. <code>OUTPUT_FORMAT_HTML</code>, <code>OUTPUT_FORMAT_HTML_INXLINKS</code> or
35
- * <code>OUTPUT_FORMAT_CSV</code>) are provide as ZIP compressed archive file, as these formats usually contain several
36
- * files.
37
- * The PDF output formats on the other hand are provided as single PDF files.
38
- * The <code>download()</code> method presented in the following snippet is used to download these files, but will not
39
- * uncompress ZIP files:
40
- *
41
- * <pre>
42
- * function download($inputStream, $sFileName)
43
- * {
44
- * $handle = fopen($sFileName, 'w+b');
45
- * while (($ch = $inputStream->read()) != -1)
46
- * {
47
- * fwrite($handle, $ch);
48
- * }
49
- *
50
- * $inputStream->close();
51
- * fclose($handle);
52
- * }
53
- * </pre>
54
- * <p/>
55
- * For a more complete example on how to generate and download reports, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
56
- *
57
- * @see Inx_Api_Reporting_ReportEngine
58
- * @since API 1.3
59
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
60
- * @package Inxmail
61
- * @subpackage Reporting
62
- */
63
- interface Inx_Api_Reporting_DownloadableResult
64
- {
65
-
66
- /**
67
- * Returns an <i>Inx_Api_InputStream</i> which can be used to download the report.
68
- *
69
- * @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> to download the report.
70
- */
71
- public function getInputStream();
72
-
73
-
74
- /**
75
- * This method returns the content type of the data in the form of a string.
76
- * <p/>
77
- * It always returns one of the following types:
78
- * <ol>
79
- * <li>"zip" - if the output format is one of:
80
- * <ul>
81
- * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML</i>,</li>
82
- * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML_INXLINKS</i> or</li>
83
- * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_CSV</i></li>
84
- * </ul>
85
- * </li>
86
- * <li>"pdf" - if the output format is one of
87
- * <ul>
88
- * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4</i></li>
89
- * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_US_LETTER</i></li>
90
- * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_US_LEGAL</i></li>
91
- * </ul>
92
- * </li>
93
- * </ol>
94
- *
95
- * @return string the content type.
96
- */
97
- public function getContentType();
98
-
99
-
100
- /**
101
- * Returns the creation date of this report.
102
- * The date will be returned as ISO-8601 formatted datetime string.
103
- *
104
- * @return string the creation date of this report.
105
- */
106
- public function getCreationDate();
107
-
108
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Reporting
6
+ */
7
+ /**
8
+ * Use the <i>Inx_Api_Reporting_DownloadableResult</i> to download a generated report.
9
+ * A <i>DownloadableResult</i> can be obtained using <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i>.
10
+ * The report ticket is returned by <i>Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache)</i>.
11
+ * As the report generation is an asynchronous process, the <i>DownloadableResult</i> must be polled.
12
+ * <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i> will return <i>null</i> as long as the report
13
+ * generation has not finished.
14
+ * <p/>
15
+ * The following snippet shows how to download a report using the <i>DownloadableResult</i>:
16
+ *
17
+ * <pre>
18
+ * $oResult = $oReportTicket->fetchDownloadableResult();
19
+ * while( $oResult == null )
20
+ * {
21
+ * sleep( 3 );
22
+ * $oResult = $oReportTicket->fetchDownloadableResult();
23
+ * }
24
+ *
25
+ * $sOutputFile = &quot;SystemDomainDistribution.pdf&quot;;
26
+ * download( $oResult->getInputStream(), $sOutputFile );
27
+ *
28
+ * if( $oReportTicket != null )
29
+ * {
30
+ * $oReportTicket->close();
31
+ * }
32
+ * </pre>
33
+ * <p/>
34
+ * Some output formats (e.g. <code>OUTPUT_FORMAT_HTML</code>, <code>OUTPUT_FORMAT_HTML_INXLINKS</code> or
35
+ * <code>OUTPUT_FORMAT_CSV</code>) are provide as ZIP compressed archive file, as these formats usually contain several
36
+ * files.
37
+ * The PDF output formats on the other hand are provided as single PDF files.
38
+ * The <code>download()</code> method presented in the following snippet is used to download these files, but will not
39
+ * uncompress ZIP files:
40
+ *
41
+ * <pre>
42
+ * function download($inputStream, $sFileName)
43
+ * {
44
+ * $handle = fopen($sFileName, 'w+b');
45
+ * while (($ch = $inputStream->read()) != -1)
46
+ * {
47
+ * fwrite($handle, $ch);
48
+ * }
49
+ *
50
+ * $inputStream->close();
51
+ * fclose($handle);
52
+ * }
53
+ * </pre>
54
+ * <p/>
55
+ * For a more complete example on how to generate and download reports, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
56
+ *
57
+ * @see Inx_Api_Reporting_ReportEngine
58
+ * @since API 1.3
59
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
60
+ * @package Inxmail
61
+ * @subpackage Reporting
62
+ */
63
+ interface Inx_Api_Reporting_DownloadableResult
64
+ {
65
+
66
+ /**
67
+ * Returns an <i>Inx_Api_InputStream</i> which can be used to download the report.
68
+ *
69
+ * @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> to download the report.
70
+ */
71
+ public function getInputStream();
72
+
73
+
74
+ /**
75
+ * This method returns the content type of the data in the form of a string.
76
+ * <p/>
77
+ * It always returns one of the following types:
78
+ * <ol>
79
+ * <li>"zip" - if the output format is one of:
80
+ * <ul>
81
+ * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML</i>,</li>
82
+ * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML_INXLINKS</i> or</li>
83
+ * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_CSV</i></li>
84
+ * </ul>
85
+ * </li>
86
+ * <li>"pdf" - if the output format is one of
87
+ * <ul>
88
+ * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4</i></li>
89
+ * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_US_LETTER</i></li>
90
+ * <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_US_LEGAL</i></li>
91
+ * </ul>
92
+ * </li>
93
+ * </ol>
94
+ *
95
+ * @return string the content type.
96
+ */
97
+ public function getContentType();
98
+
99
+
100
+ /**
101
+ * Returns the creation date of this report.
102
+ * The date will be returned as ISO-8601 formatted datetime string.
103
+ *
104
+ * @return string the creation date of this report.
105
+ */
106
+ public function getCreationDate();
107
+
108
+ }
lib/Inx/Api/Reporting/ReportEngine.php CHANGED
@@ -1,129 +1,129 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Reporting
5
- */
6
- /**
7
- * The <i>Inx_Api_Reporting_ReportEngine</i> is used to generate reports.
8
- * To generate a report, you first need to create an <i>Inx_Api_Reporting_ReportRequest</i> which contains the relevant
9
- * information needed to generate the report:
10
- * <p>
11
- * <ul>
12
- * <li>The report name
13
- * <li>The output format (e.g. OUTPUT_FORMAT_HTML, OUTPUT_FORMAT_PDF_A4)
14
- * <li>The output locale (e.g. "de_DE", "en_GB")
15
- * <li>The output time zone (e.g. "Europe/Berlin", "America/New_York")
16
- * <li>Probably some report specific properties (e.g. "listid")
17
- * </ul>
18
- * The report request is sent to the server where the actual report generation takes place.
19
- * The <i>ReportEngine</i> returns an <i>Inx_Api_Reporting_ReportTicket</i> which can be used to retrieve the result as
20
- * <i>Inx_Api_Reporting_DownloadableResult</i>.
21
- * However, be aware that the report generation is processed asynchronous.
22
- * Therefore, the <i>DownloadableResult</i> must be polled until it is available.
23
- * Once it is available an <i>Inx_Api_InputStream</i> may be retrieved which can be used to download the report in the
24
- * desired output format.
25
- * <p>
26
- * The following snippet shows how to download the report 'SystemDomainDistribution' as PDF report in the
27
- * German locale and time zone with a limit of 20 entries and save it to the file 'SystemDomainDistribution.pdf':
28
- *
29
- * <pre>
30
- * $oReportRequest = new Inx_Api_Reporting_ReportRequest( &quot;SystemDomainDistribution&quot;,
31
- * Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4, &quot;de_DE&quot;, &quot;Europe/Berlin&quot; );
32
- * $oReportRequest->putParameter( &quot;limit&quot;, &quot;20&quot; );
33
- *
34
- * $oReportEngine = $oSession->getReportEngine();
35
- * $oReportTicket = $oReportEngine->generate( $oReportRequest, false );
36
- *
37
- * $oResult = $oReportTicket->fetchDownloadableResult();
38
- * while( $oResult == null )
39
- * {
40
- * sleep( 3 );
41
- * $oResult = $oReportTicket->fetchDownloadableResult();
42
- * }
43
- *
44
- * $sOutputFile = &quot;SystemDomainDistribution.pdf&quot;;
45
- * download( $oResult->getInputStream(), $sOutputFile );
46
- *
47
- * if( $oReportTicket != null )
48
- * {
49
- * $oReportTicket->close();
50
- * }
51
- * </pre>
52
- * <p>
53
- * The <i>download()</i> method - which is not part of the API - may be used to save the report to a file on disk.
54
- * The following snippet shows the definition of the <i>download()</i> method:
55
- * <p>
56
- *
57
- * <pre>
58
- * function download($inputStream, $sFileName)
59
- * {
60
- * $handle = fopen($sFileName, 'w+b');
61
- * while (($ch = $inputStream->read()) != -1)
62
- * {
63
- * fwrite($handle, $ch);
64
- * }
65
- *
66
- * $inputStream->close();
67
- * fclose($handle);
68
- * }
69
- * </pre>
70
- * <p>
71
- * For a complete list of the available reports and the properties associated with them, see Appendix A of the API
72
- * developer guide.
73
- *
74
- * @see Inx_Api_Reporting_ReportRequest
75
- * @see Inx_Api_Reporting_ReportTicket
76
- * @since API 1.3
77
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
78
- * @package Inxmail
79
- * @subpackage Reporting
80
- */
81
- interface Inx_Api_Reporting_ReportEngine
82
- {
83
-
84
- /**
85
- * This method is used to initiate the generation of the report specified by the given <i>Inx_Api_Reporting_ReportRequest</i>.
86
- * The returned <i>Inx_Api_Reporting_ReportTicket</i> may be used to poll for the <i>Inx_Api_Reporting_DownloadableResult</i>
87
- * used to download the generated report.
88
- * For an example on how to do this, see the documentation of this class.
89
- *
90
- * @param Inx_Api_Reporting_ReportRequest $oRequest the description of the report to generate.
91
- * @param boolean $blIgnoreCache <i>true</i> if the cache shall be ignored, <i>false</i> otherwise.
92
- * This will force the report to be generated instead of using a previously generated report.
93
- * @return Inx_Api_Reporting_ReportTicket a report ticket which can be used to poll for the <i>DownloadableResult</i>.
94
- */
95
- public function generate( Inx_Api_Reporting_ReportRequest $oRequest, $blIgnoreCache );
96
-
97
-
98
- /**
99
- * Returns all names of the default and custom report types.
100
- *
101
- * @return array all names of the default and custom report types.
102
- */
103
- public function getReportNames();
104
-
105
-
106
- /**
107
- * Returns the localized <i>Inx_Api_Reporting_ConfigDescriptor</i> of the specified report.
108
- * The <i>ConfigDescriptor</i> describes the structure and elements of the report configuration area.
109
- * A <i>ConfigDescriptor</i> contains a set of <i>Inx_Api_Reporting_ControlUnit</i>s which in turn contain a set
110
- * of <i>Inx_Api_Reporting_Control</i>s.
111
- * A <i>Control</i> describes a configuration element like the list or mailing chooser.
112
- *
113
- * @param string $sReportName the name of the report whose configuration descriptor shall be returned.
114
- * @param string $sLocale the locale in which the <code>ConfigDescriptor</code> shall be returned. Use the name of the
115
- * locale, with the language (defined by ISO-639) or the language and country (defined by ISO-3166)
116
- * separated by an underscore. For example: "de_DE", "de_CH", "de", "en", "en_GB", "it_IT", "fr_FR"
117
- * @return Inx_Api_Reporting_ConfigDescriptor the localized descriptor of the specified report, or null if the report
118
- * name is unknown.
119
- */
120
- public function getDescriptor( $sReportName, $sLocale );
121
-
122
-
123
- /**
124
- * Returns all supported time zones.
125
- *
126
- * @return array all supported time zones as string array.
127
- */
128
- public function getSupportedTimeZones();
129
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Reporting
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Reporting_ReportEngine</i> is used to generate reports.
8
+ * To generate a report, you first need to create an <i>Inx_Api_Reporting_ReportRequest</i> which contains the relevant
9
+ * information needed to generate the report:
10
+ * <p>
11
+ * <ul>
12
+ * <li>The report name
13
+ * <li>The output format (e.g. OUTPUT_FORMAT_HTML, OUTPUT_FORMAT_PDF_A4)
14
+ * <li>The output locale (e.g. "de_DE", "en_GB")
15
+ * <li>The output time zone (e.g. "Europe/Berlin", "America/New_York")
16
+ * <li>Probably some report specific properties (e.g. "listid")
17
+ * </ul>
18
+ * The report request is sent to the server where the actual report generation takes place.
19
+ * The <i>ReportEngine</i> returns an <i>Inx_Api_Reporting_ReportTicket</i> which can be used to retrieve the result as
20
+ * <i>Inx_Api_Reporting_DownloadableResult</i>.
21
+ * However, be aware that the report generation is processed asynchronous.
22
+ * Therefore, the <i>DownloadableResult</i> must be polled until it is available.
23
+ * Once it is available an <i>Inx_Api_InputStream</i> may be retrieved which can be used to download the report in the
24
+ * desired output format.
25
+ * <p>
26
+ * The following snippet shows how to download the report 'SystemDomainDistribution' as PDF report in the
27
+ * German locale and time zone with a limit of 20 entries and save it to the file 'SystemDomainDistribution.pdf':
28
+ *
29
+ * <pre>
30
+ * $oReportRequest = new Inx_Api_Reporting_ReportRequest( &quot;SystemDomainDistribution&quot;,
31
+ * Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4, &quot;de_DE&quot;, &quot;Europe/Berlin&quot; );
32
+ * $oReportRequest->putParameter( &quot;limit&quot;, &quot;20&quot; );
33
+ *
34
+ * $oReportEngine = $oSession->getReportEngine();
35
+ * $oReportTicket = $oReportEngine->generate( $oReportRequest, false );
36
+ *
37
+ * $oResult = $oReportTicket->fetchDownloadableResult();
38
+ * while( $oResult == null )
39
+ * {
40
+ * sleep( 3 );
41
+ * $oResult = $oReportTicket->fetchDownloadableResult();
42
+ * }
43
+ *
44
+ * $sOutputFile = &quot;SystemDomainDistribution.pdf&quot;;
45
+ * download( $oResult->getInputStream(), $sOutputFile );
46
+ *
47
+ * if( $oReportTicket != null )
48
+ * {
49
+ * $oReportTicket->close();
50
+ * }
51
+ * </pre>
52
+ * <p>
53
+ * The <i>download()</i> method - which is not part of the API - may be used to save the report to a file on disk.
54
+ * The following snippet shows the definition of the <i>download()</i> method:
55
+ * <p>
56
+ *
57
+ * <pre>
58
+ * function download($inputStream, $sFileName)
59
+ * {
60
+ * $handle = fopen($sFileName, 'w+b');
61
+ * while (($ch = $inputStream->read()) != -1)
62
+ * {
63
+ * fwrite($handle, $ch);
64
+ * }
65
+ *
66
+ * $inputStream->close();
67
+ * fclose($handle);
68
+ * }
69
+ * </pre>
70
+ * <p>
71
+ * For a complete list of the available reports and the properties associated with them, see Appendix A of the API
72
+ * developer guide.
73
+ *
74
+ * @see Inx_Api_Reporting_ReportRequest
75
+ * @see Inx_Api_Reporting_ReportTicket
76
+ * @since API 1.3
77
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
78
+ * @package Inxmail
79
+ * @subpackage Reporting
80
+ */
81
+ interface Inx_Api_Reporting_ReportEngine
82
+ {
83
+
84
+ /**
85
+ * This method is used to initiate the generation of the report specified by the given <i>Inx_Api_Reporting_ReportRequest</i>.
86
+ * The returned <i>Inx_Api_Reporting_ReportTicket</i> may be used to poll for the <i>Inx_Api_Reporting_DownloadableResult</i>
87
+ * used to download the generated report.
88
+ * For an example on how to do this, see the documentation of this class.
89
+ *
90
+ * @param Inx_Api_Reporting_ReportRequest $oRequest the description of the report to generate.
91
+ * @param boolean $blIgnoreCache <i>true</i> if the cache shall be ignored, <i>false</i> otherwise.
92
+ * This will force the report to be generated instead of using a previously generated report.
93
+ * @return Inx_Api_Reporting_ReportTicket a report ticket which can be used to poll for the <i>DownloadableResult</i>.
94
+ */
95
+ public function generate( Inx_Api_Reporting_ReportRequest $oRequest, $blIgnoreCache );
96
+
97
+
98
+ /**
99
+ * Returns all names of the default and custom report types.
100
+ *
101
+ * @return array all names of the default and custom report types.
102
+ */
103
+ public function getReportNames();
104
+
105
+
106
+ /**
107
+ * Returns the localized <i>Inx_Api_Reporting_ConfigDescriptor</i> of the specified report.
108
+ * The <i>ConfigDescriptor</i> describes the structure and elements of the report configuration area.
109
+ * A <i>ConfigDescriptor</i> contains a set of <i>Inx_Api_Reporting_ControlUnit</i>s which in turn contain a set
110
+ * of <i>Inx_Api_Reporting_Control</i>s.
111
+ * A <i>Control</i> describes a configuration element like the list or mailing chooser.
112
+ *
113
+ * @param string $sReportName the name of the report whose configuration descriptor shall be returned.
114
+ * @param string $sLocale the locale in which the <code>ConfigDescriptor</code> shall be returned. Use the name of the
115
+ * locale, with the language (defined by ISO-639) or the language and country (defined by ISO-3166)
116
+ * separated by an underscore. For example: "de_DE", "de_CH", "de", "en", "en_GB", "it_IT", "fr_FR"
117
+ * @return Inx_Api_Reporting_ConfigDescriptor the localized descriptor of the specified report, or null if the report
118
+ * name is unknown.
119
+ */
120
+ public function getDescriptor( $sReportName, $sLocale );
121
+
122
+
123
+ /**
124
+ * Returns all supported time zones.
125
+ *
126
+ * @return array all supported time zones as string array.
127
+ */
128
+ public function getSupportedTimeZones();
129
+ }
lib/Inx/Api/Reporting/ReportException.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Reporting
6
- */
7
- /**
8
- * This exception may be thrown by <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i> if an
9
- * invalid configuration of the <i>Inx_Api_Reporting_ReportRequest</i> or an internal runtime error was detected.
10
- *
11
- * @since API 1.3
12
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
- * @package Inxmail
14
- * @subpackage Reporting
15
- */
16
- class Inx_Api_Reporting_ReportException extends Exception
17
- {
18
-
19
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Reporting
6
+ */
7
+ /**
8
+ * This exception may be thrown by <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i> if an
9
+ * invalid configuration of the <i>Inx_Api_Reporting_ReportRequest</i> or an internal runtime error was detected.
10
+ *
11
+ * @since API 1.3
12
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
13
+ * @package Inxmail
14
+ * @subpackage Reporting
15
+ */
16
+ class Inx_Api_Reporting_ReportException extends Exception
17
+ {
18
+
19
+ }
lib/Inx/Api/Reporting/ReportRequest.php CHANGED
@@ -1,237 +1,237 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Reporting
6
- */
7
- /**
8
- * The <i>Inx_Api_Reporting_ReportRequest</i> describes a report to be generated.
9
- * To generate a report, you first need to create a <i>ReportRequest</i> which contains the relevant information
10
- * needed to generate the report:
11
- * <p>
12
- * <ul>
13
- * <li>The report name
14
- * <li>The output format (e.g. OUTPUT_FORMAT_HTML, OUTPUT_FORMAT_PDF_A4)
15
- * <li>The output locale (e.g. "de_DE", "en_US")
16
- * <li>The output time zone (e.g. "Europe/Berlin", "America/New_York")
17
- * <li>Probably some report specific properties (e.g. "listid", "limit")
18
- * </ul>
19
- * The report request is sent to the server where the actual report generation takes place.
20
- * <p>
21
- * To specify dates, like the begin or end date of a report, use <i>putParameter()</i> and specify the number of
22
- * milliseconds since the epoch.
23
- * To do so, use the <i>strtotime()</i> function.
24
- * The following snippet shows how to specify an end date one week ago:
25
- *
26
- * <pre>
27
- * //strtotime returns the seconds since the epoch -> * 1000
28
- * $iOneWeekAgo = strtotime("-1 week") * 1000;
29
- *
30
- * $oReportRequest = ...
31
- * $oReportRequest->putParameter("end", $iOneWeekAgo);
32
- * </pre>
33
- *
34
- * To pass a specific date, use the english date format (YYYY-MM-DD HH:MM:SS).
35
- * The following snippet shows how to specify the begin date 2000-01-01 00:00:
36
- *
37
- * <pre>
38
- * //strtotime returns the seconds since the epoch -> * 1000
39
- * $iMillennium = strtotime("2000-01-01 00:00") * 1000;
40
- *
41
- * $oReportRequest = ...
42
- * $oReportRequest->putParameter("begin", $iMillennium);
43
- * </pre>
44
- * <p>
45
- * For an example on how to retrieve a report, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
46
- *
47
- * @see Inx_Api_Reporting_ReportEngine
48
- * @since API 1.3
49
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
50
- * @package Inxmail
51
- * @subpackage Reporting
52
- */
53
- class Inx_Api_Reporting_ReportRequest
54
- {
55
-
56
- /** Output format: HTML with inxmail special hyperlinks */
57
- const OUTPUT_FORMAT_HTML_INXLINKS = 10;
58
-
59
- /** Output format: HTML */
60
- const OUTPUT_FORMAT_HTML = 11;
61
-
62
- /** Output format: Character Separated Values (CSV) */
63
- const OUTPUT_FORMAT_CSV = 20;
64
-
65
- /** Output format: PDF on A4 page size */
66
- const OUTPUT_FORMAT_PDF_A4 = 30;
67
-
68
- /** Output format: PDF on US-Letter page size */
69
- const OUTPUT_FORMAT_PDF_US_LETTER = 31;
70
-
71
- /** Output format: PDF on US-Legal page size */
72
- const OUTPUT_FORMAT_PDF_US_LEGAL = 32;
73
-
74
- /**
75
- * The technical report name.
76
- * @var string
77
- */
78
- private $sReportName;
79
-
80
- /**
81
- * The output format.
82
- * @var int
83
- */
84
- private $sOutputFormat;
85
-
86
- /**
87
- * The output locale.
88
- * @var string
89
- */
90
- private $sOutputLocale;
91
-
92
- /**
93
- * The output time zone.
94
- * @var string
95
- */
96
- private $sOutputTimeZone;
97
-
98
- /**
99
- * The set of parameters for the report.
100
- * @var associative array
101
- */
102
- private $aParameterMap = array();
103
-
104
-
105
- /**
106
- * Creates a new report request object for the report specified by the given name.
107
- * The report will be generated in the given output format, using the specified locale and time zone.
108
- *
109
- * @param string $sReportName the name of the report to generate.
110
- * For a full list of the supported reports, see Appendix A of the API Developer Guide.
111
- * @param int $sOutputFormat the output format. The supported formats are:
112
- * <ul>
113
- * <li><i>OUTPUT_FORMAT_HTML_INXLINKS</i>
114
- * <li><i>OUTPUT_FORMAT_HTML</i>
115
- * <li><i>OUTPUT_FORMAT_PDF_A4</i>
116
- * <li><i>OUTPUT_FORMAT_PDF_US_LETTER</i>
117
- * <li><i>OUTPUT_FORMAT_PDF_US_LEGAL</i>
118
- * <li><i>OUTPUT_FORMAT_CSV</i>
119
- * </ul>
120
- * @param string $sOutputLocale the output locale.
121
- * Use the name of the locale, with the language (defined by ISO-639) or the language and country
122
- * (defined by ISO-3166) separated by an underscore.
123
- * For example: "de_DE", "de_CH", "de", "en", "en_GB", "it_IT", "fr_FR"
124
- * @param string $sOutputTimeZone the output time zone.
125
- * Use <i>Inx_Api_Reporting_ReportEngine::getSupportedTimeZones()</i> to find out which time zones
126
- * are supported.
127
- * For example: "Europe/Berlin", "Europe/Rome", "America/New_York"
128
- */
129
- public function __construct( $sReportName, $sOutputFormat,
130
- $sOutputLocale, $sOutputTimeZone )
131
- {
132
- $this->sReportName = $sReportName;
133
- $this->sOutputFormat = $sOutputFormat;
134
- $this->sOutputLocale = $sOutputLocale;
135
- $this->sOutputTimeZone = $sOutputTimeZone;
136
- }
137
-
138
-
139
- /**
140
- * Returns the name of the report to generate.
141
- *
142
- * @return string the name of the report.
143
- */
144
- public function getReportName()
145
- {
146
- return $this->sReportName;
147
- }
148
-
149
-
150
- /**
151
- * Returns the output format of the report. May be one of:
152
- * <ul>
153
- * <li><i>OUTPUT_FORMAT_HTML_INXLINKS</i>
154
- * <li><i>OUTPUT_FORMAT_HTML</i>
155
- * <li><i>OUTPUT_FORMAT_PDF_A4</i>
156
- * <li><i>OUTPUT_FORMAT_PDF_US_LETTER</i>
157
- * <li><i>OUTPUT_FORMAT_PDF_US_LEGAL</i>
158
- * <li><i>OUTPUT_FORMAT_CSV</i>
159
- * </ul>
160
- *
161
- * @return int the output format.
162
- */
163
- public function getOutputFormat()
164
- {
165
- return $this->sOutputFormat;
166
- }
167
-
168
-
169
- /**
170
- * Returns the output locale of the report.
171
- * Use the name of the locale, with the language (defined by ISO-639) or the language and
172
- * country (defined by ISO-3166) separated by an underscore.
173
- * <p>
174
- * For example: "de", "de_CH", "en", "en_GB", "it", "fr"
175
- *
176
- * @return string the output locale of the report.
177
- */
178
- public function getOutputLocale()
179
- {
180
- return $this->sOutputLocale;
181
- }
182
-
183
-
184
- /**
185
- * Returns the output time zone of the report.
186
- * Use <i>Inx_Api_Reporting_ReportEngine::getSupportedTimeZones()</i> to find out which
187
- * time zones are supported.
188
- * <p>
189
- * For example: "Europe/Berlin", "Europe/Rome", "America/New_York"
190
- *
191
- * @return string the output time zone of the report.
192
- */
193
- public function getOutputTimeZone()
194
- {
195
- return $this->sOutputTimeZone;
196
- }
197
-
198
-
199
- /**
200
- * Returns the value to which this <i>Inx_Api_Reportin_ReportRequest</i> maps the specified key.
201
- * Returns <i>null</i> if this report request contains no mapping for this key.
202
- *
203
- * @param string $sKey the key whose value shall be returned.
204
- * @return string the value to which this <i>ReportRequest</i> maps the specified key, or <i>null</i> if this
205
- * report request contains no mapping for this key.
206
- */
207
- public function getParameter( $sKey )
208
- {
209
- if (isset($this->aParameterMap[$sKey]))
210
- return $this->aParameterMap[$sKey];
211
- return null;
212
- }
213
-
214
-
215
- /**
216
- * Associates the specified value with the specified key in this report request.
217
- * For an example on how to specify dates, see the documentation of this class.
218
- *
219
- * @param string $sKey the key with which the specified value is to be associated.
220
- * @param string $value the value to be associated with the specified key.
221
- */
222
- public function putParameter( $sKey, $value )
223
- {
224
- $this->aParameterMap[$sKey] = $value;
225
- }
226
-
227
-
228
- /**
229
- * Returns an array of the keys contained in this report request.
230
- *
231
- * @return array an array of the keys contained in this report request.
232
- */
233
- public function getParameterKeys()
234
- {
235
- return array_keys($this->aParameterMap);
236
- }
237
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Reporting
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_Reporting_ReportRequest</i> describes a report to be generated.
9
+ * To generate a report, you first need to create a <i>ReportRequest</i> which contains the relevant information
10
+ * needed to generate the report:
11
+ * <p>
12
+ * <ul>
13
+ * <li>The report name
14
+ * <li>The output format (e.g. OUTPUT_FORMAT_HTML, OUTPUT_FORMAT_PDF_A4)
15
+ * <li>The output locale (e.g. "de_DE", "en_US")
16
+ * <li>The output time zone (e.g. "Europe/Berlin", "America/New_York")
17
+ * <li>Probably some report specific properties (e.g. "listid", "limit")
18
+ * </ul>
19
+ * The report request is sent to the server where the actual report generation takes place.
20
+ * <p>
21
+ * To specify dates, like the begin or end date of a report, use <i>putParameter()</i> and specify the number of
22
+ * milliseconds since the epoch.
23
+ * To do so, use the <i>strtotime()</i> function.
24
+ * The following snippet shows how to specify an end date one week ago:
25
+ *
26
+ * <pre>
27
+ * //strtotime returns the seconds since the epoch -> * 1000
28
+ * $iOneWeekAgo = strtotime("-1 week") * 1000;
29
+ *
30
+ * $oReportRequest = ...
31
+ * $oReportRequest->putParameter("end", $iOneWeekAgo);
32
+ * </pre>
33
+ *
34
+ * To pass a specific date, use the english date format (YYYY-MM-DD HH:MM:SS).
35
+ * The following snippet shows how to specify the begin date 2000-01-01 00:00:
36
+ *
37
+ * <pre>
38
+ * //strtotime returns the seconds since the epoch -> * 1000
39
+ * $iMillennium = strtotime("2000-01-01 00:00") * 1000;
40
+ *
41
+ * $oReportRequest = ...
42
+ * $oReportRequest->putParameter("begin", $iMillennium);
43
+ * </pre>
44
+ * <p>
45
+ * For an example on how to retrieve a report, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
46
+ *
47
+ * @see Inx_Api_Reporting_ReportEngine
48
+ * @since API 1.3
49
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
50
+ * @package Inxmail
51
+ * @subpackage Reporting
52
+ */
53
+ class Inx_Api_Reporting_ReportRequest
54
+ {
55
+
56
+ /** Output format: HTML with inxmail special hyperlinks */
57
+ const OUTPUT_FORMAT_HTML_INXLINKS = 10;
58
+
59
+ /** Output format: HTML */
60
+ const OUTPUT_FORMAT_HTML = 11;
61
+
62
+ /** Output format: Character Separated Values (CSV) */
63
+ const OUTPUT_FORMAT_CSV = 20;
64
+
65
+ /** Output format: PDF on A4 page size */
66
+ const OUTPUT_FORMAT_PDF_A4 = 30;
67
+
68
+ /** Output format: PDF on US-Letter page size */
69
+ const OUTPUT_FORMAT_PDF_US_LETTER = 31;
70
+
71
+ /** Output format: PDF on US-Legal page size */
72
+ const OUTPUT_FORMAT_PDF_US_LEGAL = 32;
73
+
74
+ /**
75
+ * The technical report name.
76
+ * @var string
77
+ */
78
+ private $sReportName;
79
+
80
+ /**
81
+ * The output format.
82
+ * @var int
83
+ */
84
+ private $sOutputFormat;
85
+
86
+ /**
87
+ * The output locale.
88
+ * @var string
89
+ */
90
+ private $sOutputLocale;
91
+
92
+ /**
93
+ * The output time zone.
94
+ * @var string
95
+ */
96
+ private $sOutputTimeZone;
97
+
98
+ /**
99
+ * The set of parameters for the report.
100
+ * @var associative array
101
+ */
102
+ private $aParameterMap = array();
103
+
104
+
105
+ /**
106
+ * Creates a new report request object for the report specified by the given name.
107
+ * The report will be generated in the given output format, using the specified locale and time zone.
108
+ *
109
+ * @param string $sReportName the name of the report to generate.
110
+ * For a full list of the supported reports, see Appendix A of the API Developer Guide.
111
+ * @param int $sOutputFormat the output format. The supported formats are:
112
+ * <ul>
113
+ * <li><i>OUTPUT_FORMAT_HTML_INXLINKS</i>
114
+ * <li><i>OUTPUT_FORMAT_HTML</i>
115
+ * <li><i>OUTPUT_FORMAT_PDF_A4</i>
116
+ * <li><i>OUTPUT_FORMAT_PDF_US_LETTER</i>
117
+ * <li><i>OUTPUT_FORMAT_PDF_US_LEGAL</i>
118
+ * <li><i>OUTPUT_FORMAT_CSV</i>
119
+ * </ul>
120
+ * @param string $sOutputLocale the output locale.
121
+ * Use the name of the locale, with the language (defined by ISO-639) or the language and country
122
+ * (defined by ISO-3166) separated by an underscore.
123
+ * For example: "de_DE", "de_CH", "de", "en", "en_GB", "it_IT", "fr_FR"
124
+ * @param string $sOutputTimeZone the output time zone.
125
+ * Use <i>Inx_Api_Reporting_ReportEngine::getSupportedTimeZones()</i> to find out which time zones
126
+ * are supported.
127
+ * For example: "Europe/Berlin", "Europe/Rome", "America/New_York"
128
+ */
129
+ public function __construct( $sReportName, $sOutputFormat,
130
+ $sOutputLocale, $sOutputTimeZone )
131
+ {
132
+ $this->sReportName = $sReportName;
133
+ $this->sOutputFormat = $sOutputFormat;
134
+ $this->sOutputLocale = $sOutputLocale;
135
+ $this->sOutputTimeZone = $sOutputTimeZone;
136
+ }
137
+
138
+
139
+ /**
140
+ * Returns the name of the report to generate.
141
+ *
142
+ * @return string the name of the report.
143
+ */
144
+ public function getReportName()
145
+ {
146
+ return $this->sReportName;
147
+ }
148
+
149
+
150
+ /**
151
+ * Returns the output format of the report. May be one of:
152
+ * <ul>
153
+ * <li><i>OUTPUT_FORMAT_HTML_INXLINKS</i>
154
+ * <li><i>OUTPUT_FORMAT_HTML</i>
155
+ * <li><i>OUTPUT_FORMAT_PDF_A4</i>
156
+ * <li><i>OUTPUT_FORMAT_PDF_US_LETTER</i>
157
+ * <li><i>OUTPUT_FORMAT_PDF_US_LEGAL</i>
158
+ * <li><i>OUTPUT_FORMAT_CSV</i>
159
+ * </ul>
160
+ *
161
+ * @return int the output format.
162
+ */
163
+ public function getOutputFormat()
164
+ {
165
+ return $this->sOutputFormat;
166
+ }
167
+
168
+
169
+ /**
170
+ * Returns the output locale of the report.
171
+ * Use the name of the locale, with the language (defined by ISO-639) or the language and
172
+ * country (defined by ISO-3166) separated by an underscore.
173
+ * <p>
174
+ * For example: "de", "de_CH", "en", "en_GB", "it", "fr"
175
+ *
176
+ * @return string the output locale of the report.
177
+ */
178
+ public function getOutputLocale()
179
+ {
180
+ return $this->sOutputLocale;
181
+ }
182
+
183
+
184
+ /**
185
+ * Returns the output time zone of the report.
186
+ * Use <i>Inx_Api_Reporting_ReportEngine::getSupportedTimeZones()</i> to find out which
187
+ * time zones are supported.
188
+ * <p>
189
+ * For example: "Europe/Berlin", "Europe/Rome", "America/New_York"
190
+ *
191
+ * @return string the output time zone of the report.
192
+ */
193
+ public function getOutputTimeZone()
194
+ {
195
+ return $this->sOutputTimeZone;
196
+ }
197
+
198
+
199
+ /**
200
+ * Returns the value to which this <i>Inx_Api_Reportin_ReportRequest</i> maps the specified key.
201
+ * Returns <i>null</i> if this report request contains no mapping for this key.
202
+ *
203
+ * @param string $sKey the key whose value shall be returned.
204
+ * @return string the value to which this <i>ReportRequest</i> maps the specified key, or <i>null</i> if this
205
+ * report request contains no mapping for this key.
206
+ */
207
+ public function getParameter( $sKey )
208
+ {
209
+ if (isset($this->aParameterMap[$sKey]))
210
+ return $this->aParameterMap[$sKey];
211
+ return null;
212
+ }
213
+
214
+
215
+ /**
216
+ * Associates the specified value with the specified key in this report request.
217
+ * For an example on how to specify dates, see the documentation of this class.
218
+ *
219
+ * @param string $sKey the key with which the specified value is to be associated.
220
+ * @param string $value the value to be associated with the specified key.
221
+ */
222
+ public function putParameter( $sKey, $value )
223
+ {
224
+ $this->aParameterMap[$sKey] = $value;
225
+ }
226
+
227
+
228
+ /**
229
+ * Returns an array of the keys contained in this report request.
230
+ *
231
+ * @return array an array of the keys contained in this report request.
232
+ */
233
+ public function getParameterKeys()
234
+ {
235
+ return array_keys($this->aParameterMap);
236
+ }
237
+ }
lib/Inx/Api/Reporting/ReportTicket.php CHANGED
@@ -1,91 +1,91 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Reporting
5
- */
6
- /**
7
- * The <i>Inx_Api_Reporting_ReportTicket</i> is a handle to access the report.
8
- * Using the <i>Inx_Api_Reporting_ReportEngine</i> it is not possible to generate a report synchronous.
9
- * The <i>Inx_Api_Reporting_ReportRequest</i> is sent to the server instead, where the actual generation takes place.
10
- * This generation is processed asynchronous, thus the result must be polled.
11
- * This polling is accomplished using the <i>ReportTicket</i> returned by
12
- * <i>Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache)</i>.
13
- * <p>
14
- * The following snippet briefly shows how to retrieve and use a <i>ReportTicket</i>:
15
- *
16
- * <pre>
17
- * $oReportRequest = new Inx_Api_Reporting_ReportRequest( "SystemDomainDistribution",
18
- * Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4, "de_DE", "Europe/Berlin" );
19
- * $oReportRequest->putParameter( "limit", 20 );
20
- *
21
- * $oTicket = $oSession->getReportEngine()->generate( $oReportRequest, false );
22
- * try
23
- * {
24
- * $oDownloadableResult = $oTicket->fetchDownloadableResult();
25
- * while( $oDownloadableResult == null )
26
- * {
27
- * echo "Waiting for the report to finish..." ;
28
- * sleep( 3 );
29
- * $oDownloadableResult = $oTicket->fetchDownloadableResult();
30
- * }
31
- *
32
- * $oInputStream = $oDownloadableResult->getInputStream();
33
- * ...
34
- * }
35
- * catch( ReportException x )
36
- * {
37
- * echo $x->getMessage();
38
- * }
39
- *
40
- * if($oTicket != null)
41
- * {
42
- * $oTicket->close();
43
- * }
44
- * </pre>
45
- * <p>
46
- * The <i>Inx_Api_Reporting_DownloadableResult</i> fetched from the <i>ReportTicket</i> is used to download the generated report.
47
- * <i>fetchDownloadableResult()</i> will return <i>null</i> as long as the report generation is not finished.
48
- * To download the report, just poll for the <i>DownloadableResult</i> to become something different from <i>null</i>
49
- * and use the provided <i>Inx_Api_InputStream</i> to download the report.
50
- * <p>
51
- * <strong>Note:</strong> An <i>Inx_Api_Reporting_ReportTicket</i> object <strong>must</strong> be closed once it is not needed
52
- * anymore to prevent memory leaks and other potentially harmful side effects.
53
- * <p>
54
- * For a more complete example on how to generate and retrieve reports, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
55
- *
56
- * @see Inx_Api_Reporting_ReportEngine
57
- * @since API 1.3
58
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
59
- * @package Inxmail
60
- * @subpackage Reporting
61
- */
62
- interface Inx_Api_Reporting_ReportTicket
63
- {
64
-
65
- /**
66
- * The original description used to generate this report.
67
- *
68
- * @return Inx_Api_Reporting_ReportRequest the report request
69
- */
70
- public function getReportRequest();
71
-
72
-
73
- /**
74
- * Returns the <i>Inx_Api_Reporting_DownloadableResult</i> object, if the report is completely generated.
75
- * Returns <i>null</i>, if the generation of the report has not yet finished.
76
- *
77
- * @return the <i>DownloadableResult</i> or <i>null</i>.
78
- * @throws Inx_Api_Reporting_ReportException if an error in the report engine has occurred.
79
- */
80
- public function fetchDownloadableResult();
81
-
82
-
83
- /**
84
- * Closes this <i>Inx_Api_Reporting_ReportTicket</i> and releases any resources on
85
- * the server associated with this object.
86
- * An <i>Inx_Api_Reporting_ReportTicket</i> object <strong>must</strong> be closed once it is not needed
87
- * anymore to prevent memory leaks and other potentially harmful side effects.
88
- */
89
- public function close();
90
-
91
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Reporting
5
+ */
6
+ /**
7
+ * The <i>Inx_Api_Reporting_ReportTicket</i> is a handle to access the report.
8
+ * Using the <i>Inx_Api_Reporting_ReportEngine</i> it is not possible to generate a report synchronous.
9
+ * The <i>Inx_Api_Reporting_ReportRequest</i> is sent to the server instead, where the actual generation takes place.
10
+ * This generation is processed asynchronous, thus the result must be polled.
11
+ * This polling is accomplished using the <i>ReportTicket</i> returned by
12
+ * <i>Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache)</i>.
13
+ * <p>
14
+ * The following snippet briefly shows how to retrieve and use a <i>ReportTicket</i>:
15
+ *
16
+ * <pre>
17
+ * $oReportRequest = new Inx_Api_Reporting_ReportRequest( "SystemDomainDistribution",
18
+ * Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4, "de_DE", "Europe/Berlin" );
19
+ * $oReportRequest->putParameter( "limit", 20 );
20
+ *
21
+ * $oTicket = $oSession->getReportEngine()->generate( $oReportRequest, false );
22
+ * try
23
+ * {
24
+ * $oDownloadableResult = $oTicket->fetchDownloadableResult();
25
+ * while( $oDownloadableResult == null )
26
+ * {
27
+ * echo "Waiting for the report to finish..." ;
28
+ * sleep( 3 );
29
+ * $oDownloadableResult = $oTicket->fetchDownloadableResult();
30
+ * }
31
+ *
32
+ * $oInputStream = $oDownloadableResult->getInputStream();
33
+ * ...
34
+ * }
35
+ * catch( ReportException x )
36
+ * {
37
+ * echo $x->getMessage();
38
+ * }
39
+ *
40
+ * if($oTicket != null)
41
+ * {
42
+ * $oTicket->close();
43
+ * }
44
+ * </pre>
45
+ * <p>
46
+ * The <i>Inx_Api_Reporting_DownloadableResult</i> fetched from the <i>ReportTicket</i> is used to download the generated report.
47
+ * <i>fetchDownloadableResult()</i> will return <i>null</i> as long as the report generation is not finished.
48
+ * To download the report, just poll for the <i>DownloadableResult</i> to become something different from <i>null</i>
49
+ * and use the provided <i>Inx_Api_InputStream</i> to download the report.
50
+ * <p>
51
+ * <strong>Note:</strong> An <i>Inx_Api_Reporting_ReportTicket</i> object <strong>must</strong> be closed once it is not needed
52
+ * anymore to prevent memory leaks and other potentially harmful side effects.
53
+ * <p>
54
+ * For a more complete example on how to generate and retrieve reports, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
55
+ *
56
+ * @see Inx_Api_Reporting_ReportEngine
57
+ * @since API 1.3
58
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
59
+ * @package Inxmail
60
+ * @subpackage Reporting
61
+ */
62
+ interface Inx_Api_Reporting_ReportTicket
63
+ {
64
+
65
+ /**
66
+ * The original description used to generate this report.
67
+ *
68
+ * @return Inx_Api_Reporting_ReportRequest the report request
69
+ */
70
+ public function getReportRequest();
71
+
72
+
73
+ /**
74
+ * Returns the <i>Inx_Api_Reporting_DownloadableResult</i> object, if the report is completely generated.
75
+ * Returns <i>null</i>, if the generation of the report has not yet finished.
76
+ *
77
+ * @return the <i>DownloadableResult</i> or <i>null</i>.
78
+ * @throws Inx_Api_Reporting_ReportException if an error in the report engine has occurred.
79
+ */
80
+ public function fetchDownloadableResult();
81
+
82
+
83
+ /**
84
+ * Closes this <i>Inx_Api_Reporting_ReportTicket</i> and releases any resources on
85
+ * the server associated with this object.
86
+ * An <i>Inx_Api_Reporting_ReportTicket</i> object <strong>must</strong> be closed once it is not needed
87
+ * anymore to prevent memory leaks and other potentially harmful side effects.
88
+ */
89
+ public function close();
90
+
91
  }
lib/Inx/Api/Resource/Resource.php CHANGED
@@ -1,196 +1,196 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Resource
6
- */
7
- /**
8
- * An <i>Inx_Api_Resource_Resource</i> is a business object representing an attachment or an embedded image stored on the server.
9
- * <i>Resource</i>s can be used in mailings, depending on their sharing type.
10
- * The following sharing types are supported:
11
- * <p>
12
- * <ul>
13
- * <li><i>SHARING_TYPE_SYSTEM</i>: The resource can be used by all mailings in all lists
14
- * <li><i>SHARING_TYPE_MAILING</i>: The resource can only be used by one specific mailing
15
- * <li><i>SHARING_TYPE_LIST</i>: The resource can be used by all mailings of a specific list
16
- * </ul>
17
- * <p>
18
- * Besides of the sharing type a <i>Resource</i> contains meta information about the represented resource:
19
- * <p>
20
- * <ul>
21
- * <li><i>The name</i>: Each resource has a name. The name does not have to be unique.
22
- * <li><i>The content type</i>: Contains the MIME type of the resource.
23
- * <li><i>The creation datetime</i>: The datetime when the resource was uploaded.
24
- * <li><i>The size</i>: The size of the resource in bytes.
25
- * <li><i>The user id</i>: References the user who uploaded the resource.
26
- * </ul>
27
- * <p>
28
- * To download a resource, use the <i>Inx_Api_InputStream</i> provided by <i>getInputStream()</i>.
29
- * <p>
30
- * For an example on how to upload, retrieve and use resources, see the <i>Inx_Api_Resource_ResourceManager</i>
31
- * documentation.
32
- *
33
- * @see com.inxmail.xpro.api.resource.ResourceManager
34
- * @since API 1.0
35
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
36
- * @package Inxmail
37
- * @subpackage Resource
38
- */
39
- interface Inx_Api_Resource_Resource extends Inx_Api_BusinessObject
40
- {
41
-
42
- /**
43
- * Constant for the name attribute.
44
- * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
45
- *
46
- * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
47
- * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
48
- * @var int
49
- */
50
- const ATTRIBUTE_NAME = 0;
51
-
52
- /**
53
- * Constant for the size attribute.
54
- * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
55
- *
56
- * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
57
- * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
58
- * @var int
59
- */
60
- const ATTRIBUTE_SIZE = 1;
61
-
62
- /**
63
- * Constant for the creation date attribute.
64
- * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
65
- *
66
- * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
67
- * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
68
- * @var int
69
- */
70
- const ATTRIBUTE_CREATION_DATETIME = 2;
71
-
72
- /**
73
- * Constant for the sharing type attribute.
74
- * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
75
- *
76
- * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
77
- * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
78
- * @var int
79
- */
80
- const ATTRIBUTE_SHARING_TYPE = 4;
81
-
82
- /**
83
- * Constant for the user id attribute.
84
- * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
85
- *
86
- * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
87
- * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
88
- * @var int
89
- */
90
- const ATTRIBUTE_USER_ID = 5;
91
-
92
-
93
- /**
94
- * Sharing behaviour: Resource is not shared, but bound to the specified mailing - <i>getMailingId()</i>.
95
- *
96
- * @see ::getSharingType()
97
- * @var int
98
- */
99
- const SHARING_TYPE_MAILING = 0;
100
-
101
- /**
102
- * Sharing behaviour: Resource is list shared, thus bound to the the specified list - <i>getListContextId()</i>.
103
- *
104
- * @see ::getSharingType()
105
- * @var int
106
- */
107
- const SHARING_TYPE_LIST = 1;
108
-
109
- /**
110
- * Sharing behaviour: Resource is system shared, thus not bound to a single mailing or list.
111
- *
112
- * @see ::getSharingType()
113
- * @var int
114
- */
115
- const SHARING_TYPE_SYSTEM = 2;
116
-
117
-
118
- /**
119
- * Returns the filename of the resource.
120
- *
121
- * @return string the filename of the resource.
122
- */
123
- public function getName();
124
-
125
-
126
- /**
127
- * Returns the creation date of the resource.
128
- *
129
- * @return string the creation date of the resource.
130
- */
131
- public function getCreationDatetime();
132
-
133
-
134
- /**
135
- * Returns the size of the resource file in bytes.
136
- *
137
- * @return int the size of the resource file in bytes.
138
- */
139
- public function getSize();
140
-
141
-
142
- /**
143
- * Returns the id of the user who uploaded the resource.
144
- *
145
- * @return int the id of the user who uploaded the resource.
146
- */
147
- public function getUserId();
148
-
149
-
150
- /**
151
- * Returns the id of the list this resource is bound to. Only specified, if the sharing type is <i>SHARING_TYPE_LIST</i>.
152
- *
153
- * @return int the id of the list this resource is bound to.
154
- */
155
- public function getListContextId();
156
-
157
-
158
- /**
159
- * Returns the id of the mailing this resource is bound to. Only specified, if the sharing type is <i>SHARING_TYPE_MAILING</i>.
160
- *
161
- * @return int the id of the mailing this resource is bound to.
162
- */
163
- public function getMailingId();
164
-
165
-
166
- /**
167
- * Returns the sharing type. The following sharing type values are allowed:
168
- * <ul>
169
- * <li> <i>SHARING_TYPE_MAILING</i>: Resource is not shared, but bound to the specified mailing - <i>getMailingId</i>.
170
- * <li> <i>SHARING_TYPE_LIST</i>: Resource is list shared, thus bound to the the specified list - <i>getListContextId</i>.
171
- * <li> <i>SHARING_TYPE_SYSTEM</i>: Resource is system shared, thus not bound to a single mailing or list.
172
- * </ul>
173
- *
174
- * @return int the sharing type.
175
- */
176
- public function getSharingType();
177
-
178
-
179
- /**
180
- * Returns the MIME type of the content.
181
- *
182
- * @return string the MIME type of the content.
183
- */
184
- public function getContentType();
185
-
186
-
187
- /**
188
- * Returns an <i>Inx_Api_InputStream</i> which can be used to download the resource file.
189
- *
190
- * @return Inx_Api_InputStream an <i>InputStream</i> to download the resource file.
191
- * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
192
- * <i>Inx_Api_UserRights::RESOURCE_FEATURE_USE</i>
193
- */
194
- public function getInputStream();
195
-
196
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Resource
6
+ */
7
+ /**
8
+ * An <i>Inx_Api_Resource_Resource</i> is a business object representing an attachment or an embedded image stored on the server.
9
+ * <i>Resource</i>s can be used in mailings, depending on their sharing type.
10
+ * The following sharing types are supported:
11
+ * <p>
12
+ * <ul>
13
+ * <li><i>SHARING_TYPE_SYSTEM</i>: The resource can be used by all mailings in all lists
14
+ * <li><i>SHARING_TYPE_MAILING</i>: The resource can only be used by one specific mailing
15
+ * <li><i>SHARING_TYPE_LIST</i>: The resource can be used by all mailings of a specific list
16
+ * </ul>
17
+ * <p>
18
+ * Besides of the sharing type a <i>Resource</i> contains meta information about the represented resource:
19
+ * <p>
20
+ * <ul>
21
+ * <li><i>The name</i>: Each resource has a name. The name does not have to be unique.
22
+ * <li><i>The content type</i>: Contains the MIME type of the resource.
23
+ * <li><i>The creation datetime</i>: The datetime when the resource was uploaded.
24
+ * <li><i>The size</i>: The size of the resource in bytes.
25
+ * <li><i>The user id</i>: References the user who uploaded the resource.
26
+ * </ul>
27
+ * <p>
28
+ * To download a resource, use the <i>Inx_Api_InputStream</i> provided by <i>getInputStream()</i>.
29
+ * <p>
30
+ * For an example on how to upload, retrieve and use resources, see the <i>Inx_Api_Resource_ResourceManager</i>
31
+ * documentation.
32
+ *
33
+ * @see com.inxmail.xpro.api.resource.ResourceManager
34
+ * @since API 1.0
35
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
36
+ * @package Inxmail
37
+ * @subpackage Resource
38
+ */
39
+ interface Inx_Api_Resource_Resource extends Inx_Api_BusinessObject
40
+ {
41
+
42
+ /**
43
+ * Constant for the name attribute.
44
+ * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
45
+ *
46
+ * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
47
+ * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
48
+ * @var int
49
+ */
50
+ const ATTRIBUTE_NAME = 0;
51
+
52
+ /**
53
+ * Constant for the size attribute.
54
+ * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
55
+ *
56
+ * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
57
+ * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
58
+ * @var int
59
+ */
60
+ const ATTRIBUTE_SIZE = 1;
61
+
62
+ /**
63
+ * Constant for the creation date attribute.
64
+ * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
65
+ *
66
+ * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
67
+ * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
68
+ * @var int
69
+ */
70
+ const ATTRIBUTE_CREATION_DATETIME = 2;
71
+
72
+ /**
73
+ * Constant for the sharing type attribute.
74
+ * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
75
+ *
76
+ * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
77
+ * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
78
+ * @var int
79
+ */
80
+ const ATTRIBUTE_SHARING_TYPE = 4;
81
+
82
+ /**
83
+ * Constant for the user id attribute.
84
+ * Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
85
+ *
86
+ * @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
87
+ * @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
88
+ * @var int
89
+ */
90
+ const ATTRIBUTE_USER_ID = 5;
91
+
92
+
93
+ /**
94
+ * Sharing behaviour: Resource is not shared, but bound to the specified mailing - <i>getMailingId()</i>.
95
+ *
96
+ * @see ::getSharingType()
97
+ * @var int
98
+ */
99
+ const SHARING_TYPE_MAILING = 0;
100
+
101
+ /**
102
+ * Sharing behaviour: Resource is list shared, thus bound to the the specified list - <i>getListContextId()</i>.
103
+ *
104
+ * @see ::getSharingType()
105
+ * @var int
106
+ */
107
+ const SHARING_TYPE_LIST = 1;
108
+
109
+ /**
110
+ * Sharing behaviour: Resource is system shared, thus not bound to a single mailing or list.
111
+ *
112
+ * @see ::getSharingType()
113
+ * @var int
114
+ */
115
+ const SHARING_TYPE_SYSTEM = 2;
116
+
117
+
118
+ /**
119
+ * Returns the filename of the resource.
120
+ *
121
+ * @return string the filename of the resource.
122
+ */
123
+ public function getName();
124
+
125
+
126
+ /**
127
+ * Returns the creation date of the resource.
128
+ *
129
+ * @return string the creation date of the resource.
130
+ */
131
+ public function getCreationDatetime();
132
+
133
+
134
+ /**
135
+ * Returns the size of the resource file in bytes.
136
+ *
137
+ * @return int the size of the resource file in bytes.
138
+ */
139
+ public function getSize();
140
+
141
+
142
+ /**
143
+ * Returns the id of the user who uploaded the resource.
144
+ *
145
+ * @return int the id of the user who uploaded the resource.
146
+ */
147
+ public function getUserId();
148
+
149
+
150
+ /**
151
+ * Returns the id of the list this resource is bound to. Only specified, if the sharing type is <i>SHARING_TYPE_LIST</i>.
152
+ *
153
+ * @return int the id of the list this resource is bound to.
154
+ */
155
+ public function getListContextId();
156
+
157
+
158
+ /**
159
+ * Returns the id of the mailing this resource is bound to. Only specified, if the sharing type is <i>SHARING_TYPE_MAILING</i>.
160
+ *
161
+ * @return int the id of the mailing this resource is bound to.
162
+ */
163
+ public function getMailingId();
164
+
165
+
166
+ /**
167
+ * Returns the sharing type. The following sharing type values are allowed:
168
+ * <ul>
169
+ * <li> <i>SHARING_TYPE_MAILING</i>: Resource is not shared, but bound to the specified mailing - <i>getMailingId</i>.
170
+ * <li> <i>SHARING_TYPE_LIST</i>: Resource is list shared, thus bound to the the specified list - <i>getListContextId</i>.
171
+ * <li> <i>SHARING_TYPE_SYSTEM</i>: Resource is system shared, thus not bound to a single mailing or list.
172
+ * </ul>
173
+ *
174
+ * @return int the sharing type.
175
+ */
176
+ public function getSharingType();
177
+
178
+
179
+ /**
180
+ * Returns the MIME type of the content.
181
+ *
182
+ * @return string the MIME type of the content.
183
+ */
184
+ public function getContentType();
185
+
186
+
187
+ /**
188
+ * Returns an <i>Inx_Api_InputStream</i> which can be used to download the resource file.
189
+ *
190
+ * @return Inx_Api_InputStream an <i>InputStream</i> to download the resource file.
191
+ * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
192
+ * <i>Inx_Api_UserRights::RESOURCE_FEATURE_USE</i>
193
+ */
194
+ public function getInputStream();
195
+
196
+ }
lib/Inx/Api/Resource/ResourceManager.php CHANGED
@@ -1,118 +1,118 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Resource
6
- */
7
- /**
8
- * The <i>Inx_Api_Resource_ResourceManager</i> manages the file resources.
9
- * An <i>Inx_Api_Resource_Resource</i> can be used as attachment or embedded image in a mailing.
10
- * <p>
11
- * Attachments and embedded images used in mailings are "resources".
12
- * Using the <i>ResourceManager</i>, these resources can be upload to and download from the Inxmail server.
13
- * Resources can be bound to mailing lists or mailings, which means they are not visible outside these bounds,
14
- * and will be removed with their mailing list or mailing.
15
- * <p>
16
- * The following snippet shows how to upload a resource (logo.gif) which can be used by all mailings in all lists:
17
- *
18
- * <PRE>
19
- * $oResourceManager = $oSession->getResourceManager();
20
- * $in = fopen("/images/logo.gif", 'rb');
21
- * $oResource = $oResourceManager->upload( null, "logo.gif", $in );
22
- * fclose($in);
23
- * </PRE>
24
- *
25
- * Inxmail assigns an unique identifier to the uploaded resource.
26
- * To attach a resource to a mailing, add the <i>attach</i> tag to the mail body.
27
- * The following snippet shows how to attach the resource with the id 42 to a mailing:
28
- *
29
- * <PRE>
30
- * $sb = "[%attach(".$oResource->getId(). "); ".$res->getName(). "]" ;
31
- * </PRE>
32
- *
33
- * This results in a string like <i>[%attach(42); logo.gif]</i>.
34
- * To embed an image instead of adding it as attachment, replace 'attach' with 'embedded-image':
35
- * <i>[%embedded-image(42); logo.gif]</i>.
36
- * <p>
37
- * To locate existing resources, use one of the <i>select</i> methods of the <i>ResourceManager</i>.
38
- * The following snippet shows how to retrieve all <i>Inx_Api_Resource_Resource</i>s available for a specific mailing
39
- * and prints their IDs and names:
40
- *
41
- * <pre>
42
- * $oMailing = $oSession->getMailingManager()->get( 4711 );
43
- *
44
- * $oResourceManager = $oSession->getResourceManager();
45
- * $oBOResultSet = $oResourceManager->select( $oMailing, Inx_Api_Resource_Resource::ATTRIBUTE_NAME, Inx_Api_Order::ASC );
46
- *
47
- * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
48
- * {
49
- * $oResource = $oBOResultSet->get( $i );
50
- * echo $oResource->getId().&quot;: &quot;.$oResource->getName().&quot;&#60;br&#62;&quot;;
51
- * }
52
- * </pre>
53
- * <p>
54
- * For more information on resources, see the <i>Inx_Api_Resource_Resource</i> documentation.
55
- *
56
- * @see Inx_Api_Resource_Resource
57
- * @since API 1.0
58
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
59
- * @package Inxmail
60
- * @subpackage Resource
61
- */
62
- interface Inx_Api_Resource_ResourceManager extends Inx_Api_BOManager
63
- {
64
-
65
- /** @deprecated replaced by <i>Inx_Api_Order::ASC</i> */
66
- const ORDER_ASC = 0;
67
-
68
- /** @deprecated replaced by <i>Inx_Api_Order::DESC</i> */
69
- const ORDER_DESC = 1;
70
-
71
-
72
- /**
73
- * Uploads a file resource to Inxmail.
74
- * The sharing type depends on the type of the $mOwner parameter:
75
- * <ol>
76
- * <li>If you pass a <code>null</code> value, the resource will be shared with all other mailings in the system (i.e.
77
- * sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_SYSTEM</i>).
78
- * <li>If you pass an instance of <i>Inx_Api_Mailing_Mailing</i>, the resource will not be shared with other mailings
79
- * (i.e. sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_MAILING</i>).
80
- * <li>If you pass an instance of <i>Inx_Api_List_ListContext</i>, The resource will be shared with other mailings in
81
- * the specified list (i.e. sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_LIST</i>).
82
- * <li>Any other non <i>null</i> value will render no effect. The method will not perform the upload.
83
- * </ol>
84
- * If a resource with the specified name already exists it will not be overwritten.
85
- * Instead a second resource with the same name and the new content will be created.
86
- *
87
- * @param Inx_Api_List_ListContext|Inx_Api_Mailing_Mailing $mOwner the list or mailing this resource will be restricted to.
88
- * May be <i>null</i> to share the resource with all mailings in all lists.
89
- * @param string $sFilename the filename of the resource (e.g. logo.gif).
90
- * @param resource $rsInputStream the input stream of the file content.
91
- * @return Inx_Api_Resource_Resource the new resource, or <i>null</i> if the upload failed.
92
- * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
93
- * <i>Inx_Api_UserRights::RESOURCE_UPLOAD_MAILING_SHARING</i>
94
- */
95
- public function upload( $mOwner, $sFilename, $rsInputStream );
96
-
97
-
98
- /**
99
- * Returns an <i>Inx_Api_BOResultSet</i> containing all resources available for the given <i>Inx_Api_Mailing_Mailing</i>.
100
- * This includes all non shared resources available for this mailing, list shared resources and system shared resources.
101
- *
102
- * @param Inx_Api_Mailing_Mailing $oMailing the mailing for which the available resources shall be retrieved.
103
- * @param int $iOrderAttribute the order attribute. May be one of:
104
- * <ul>
105
- * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_NAME</i>
106
- * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_SHARING_TYPE</i>
107
- * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_SIZE</i>
108
- * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_CREATION_DATETIME</i>
109
- * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_USER_ID</i>
110
- * </ul>
111
- * @param int $iOrderType the order type <i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
112
- * @return Inx_Api_BOResultSet an <i>BOResultSet</i> object that contains the data produced by the given query.
113
- * @throws SecurityException if the session user doesn't have the following permission:
114
- * <i>Inx__Api_UserRights::RESOURCE_FEATURE_USE</i>
115
- */
116
- public function select( Inx_Api_Mailing_Mailing $oMailing, $iOrderAttribute, $iOrderType );
117
-
118
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Resource
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_Resource_ResourceManager</i> manages the file resources.
9
+ * An <i>Inx_Api_Resource_Resource</i> can be used as attachment or embedded image in a mailing.
10
+ * <p>
11
+ * Attachments and embedded images used in mailings are "resources".
12
+ * Using the <i>ResourceManager</i>, these resources can be upload to and download from the Inxmail server.
13
+ * Resources can be bound to mailing lists or mailings, which means they are not visible outside these bounds,
14
+ * and will be removed with their mailing list or mailing.
15
+ * <p>
16
+ * The following snippet shows how to upload a resource (logo.gif) which can be used by all mailings in all lists:
17
+ *
18
+ * <PRE>
19
+ * $oResourceManager = $oSession->getResourceManager();
20
+ * $in = fopen("/images/logo.gif", 'rb');
21
+ * $oResource = $oResourceManager->upload( null, "logo.gif", $in );
22
+ * fclose($in);
23
+ * </PRE>
24
+ *
25
+ * Inxmail assigns an unique identifier to the uploaded resource.
26
+ * To attach a resource to a mailing, add the <i>attach</i> tag to the mail body.
27
+ * The following snippet shows how to attach the resource with the id 42 to a mailing:
28
+ *
29
+ * <PRE>
30
+ * $sb = "[%attach(".$oResource->getId(). "); ".$res->getName(). "]" ;
31
+ * </PRE>
32
+ *
33
+ * This results in a string like <i>[%attach(42); logo.gif]</i>.
34
+ * To embed an image instead of adding it as attachment, replace 'attach' with 'embedded-image':
35
+ * <i>[%embedded-image(42); logo.gif]</i>.
36
+ * <p>
37
+ * To locate existing resources, use one of the <i>select</i> methods of the <i>ResourceManager</i>.
38
+ * The following snippet shows how to retrieve all <i>Inx_Api_Resource_Resource</i>s available for a specific mailing
39
+ * and prints their IDs and names:
40
+ *
41
+ * <pre>
42
+ * $oMailing = $oSession->getMailingManager()->get( 4711 );
43
+ *
44
+ * $oResourceManager = $oSession->getResourceManager();
45
+ * $oBOResultSet = $oResourceManager->select( $oMailing, Inx_Api_Resource_Resource::ATTRIBUTE_NAME, Inx_Api_Order::ASC );
46
+ *
47
+ * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
48
+ * {
49
+ * $oResource = $oBOResultSet->get( $i );
50
+ * echo $oResource->getId().&quot;: &quot;.$oResource->getName().&quot;&#60;br&#62;&quot;;
51
+ * }
52
+ * </pre>
53
+ * <p>
54
+ * For more information on resources, see the <i>Inx_Api_Resource_Resource</i> documentation.
55
+ *
56
+ * @see Inx_Api_Resource_Resource
57
+ * @since API 1.0
58
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
59
+ * @package Inxmail
60
+ * @subpackage Resource
61
+ */
62
+ interface Inx_Api_Resource_ResourceManager extends Inx_Api_BOManager
63
+ {
64
+
65
+ /** @deprecated replaced by <i>Inx_Api_Order::ASC</i> */
66
+ const ORDER_ASC = 0;
67
+
68
+ /** @deprecated replaced by <i>Inx_Api_Order::DESC</i> */
69
+ const ORDER_DESC = 1;
70
+
71
+
72
+ /**
73
+ * Uploads a file resource to Inxmail.
74
+ * The sharing type depends on the type of the $mOwner parameter:
75
+ * <ol>
76
+ * <li>If you pass a <code>null</code> value, the resource will be shared with all other mailings in the system (i.e.
77
+ * sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_SYSTEM</i>).
78
+ * <li>If you pass an instance of <i>Inx_Api_Mailing_Mailing</i>, the resource will not be shared with other mailings
79
+ * (i.e. sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_MAILING</i>).
80
+ * <li>If you pass an instance of <i>Inx_Api_List_ListContext</i>, The resource will be shared with other mailings in
81
+ * the specified list (i.e. sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_LIST</i>).
82
+ * <li>Any other non <i>null</i> value will render no effect. The method will not perform the upload.
83
+ * </ol>
84
+ * If a resource with the specified name already exists it will not be overwritten.
85
+ * Instead a second resource with the same name and the new content will be created.
86
+ *
87
+ * @param Inx_Api_List_ListContext|Inx_Api_Mailing_Mailing $mOwner the list or mailing this resource will be restricted to.
88
+ * May be <i>null</i> to share the resource with all mailings in all lists.
89
+ * @param string $sFilename the filename of the resource (e.g. logo.gif).
90
+ * @param resource $rsInputStream the input stream of the file content.
91
+ * @return Inx_Api_Resource_Resource the new resource, or <i>null</i> if the upload failed.
92
+ * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
93
+ * <i>Inx_Api_UserRights::RESOURCE_UPLOAD_MAILING_SHARING</i>
94
+ */
95
+ public function upload( $mOwner, $sFilename, $rsInputStream );
96
+
97
+
98
+ /**
99
+ * Returns an <i>Inx_Api_BOResultSet</i> containing all resources available for the given <i>Inx_Api_Mailing_Mailing</i>.
100
+ * This includes all non shared resources available for this mailing, list shared resources and system shared resources.
101
+ *
102
+ * @param Inx_Api_Mailing_Mailing $oMailing the mailing for which the available resources shall be retrieved.
103
+ * @param int $iOrderAttribute the order attribute. May be one of:
104
+ * <ul>
105
+ * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_NAME</i>
106
+ * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_SHARING_TYPE</i>
107
+ * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_SIZE</i>
108
+ * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_CREATION_DATETIME</i>
109
+ * <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_USER_ID</i>
110
+ * </ul>
111
+ * @param int $iOrderType the order type <i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
112
+ * @return Inx_Api_BOResultSet an <i>BOResultSet</i> object that contains the data produced by the given query.
113
+ * @throws SecurityException if the session user doesn't have the following permission:
114
+ * <i>Inx__Api_UserRights::RESOURCE_FEATURE_USE</i>
115
+ */
116
+ public function select( Inx_Api_Mailing_Mailing $oMailing, $iOrderAttribute, $iOrderType );
117
+
118
+ }
lib/Inx/Api/SecurityException.php CHANGED
@@ -1,11 +1,11 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * @package Inxmail
7
- */
8
- class Inx_Api_SecurityException extends Exception
9
- {
10
-
11
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * @package Inxmail
7
+ */
8
+ class Inx_Api_SecurityException extends Exception
9
+ {
10
+
11
  }
lib/Inx/Api/ServerTime.php CHANGED
@@ -1,47 +1,47 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- */
5
- /**
6
- * The <i>Inx_Api_ServerTime</code> represents the server time. With this, you are able to translate the date from your time
7
- * zone to the time zone of the server. Copyright (c) 2008 Inxmail GmbH. All Rights Reserved.
8
- *
9
- * @since API 1.4.4
10
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
- * @package Inxmail
12
- */
13
- interface Inx_Api_ServerTime
14
- {
15
-
16
- /**
17
- * Returns the server time as iso 8601 formatted datetime string.
18
- *
19
- * @return the server time as iso 8601 formatted datetime string.
20
- */
21
- public function getDatetime();
22
-
23
-
24
- /**
25
- * Returns the GMT offset of the server in milliseconds.
26
- *
27
- * @return the GMT offset in milliseconds.
28
- */
29
- public function getGMTOffset();
30
-
31
-
32
- /**
33
- * Returns the day light saving time offset of the server in milliseconds.
34
- *
35
- * @return the DST offset in milliseconds.
36
- */
37
- public function getDSTOffset();
38
-
39
-
40
- /**
41
- * Returns the time zone id, for example "Europe/Berlin".
42
- *
43
- * @return the time zone as string.
44
- */
45
- public function getTimezoneId();
46
-
47
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ */
5
+ /**
6
+ * The <i>Inx_Api_ServerTime</code> represents the server time. With this, you are able to translate the date from your time
7
+ * zone to the time zone of the server. Copyright (c) 2008 Inxmail GmbH. All Rights Reserved.
8
+ *
9
+ * @since API 1.4.4
10
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
11
+ * @package Inxmail
12
+ */
13
+ interface Inx_Api_ServerTime
14
+ {
15
+
16
+ /**
17
+ * Returns the server time as iso 8601 formatted datetime string.
18
+ *
19
+ * @return the server time as iso 8601 formatted datetime string.
20
+ */
21
+ public function getDatetime();
22
+
23
+
24
+ /**
25
+ * Returns the GMT offset of the server in milliseconds.
26
+ *
27
+ * @return the GMT offset in milliseconds.
28
+ */
29
+ public function getGMTOffset();
30
+
31
+
32
+ /**
33
+ * Returns the day light saving time offset of the server in milliseconds.
34
+ *
35
+ * @return the DST offset in milliseconds.
36
+ */
37
+ public function getDSTOffset();
38
+
39
+
40
+ /**
41
+ * Returns the time zone id, for example "Europe/Berlin".
42
+ *
43
+ * @return the time zone as string.
44
+ */
45
+ public function getTimezoneId();
46
+
47
+ }
lib/Inx/Api/Subscription/SubscriptionLogEntryRowSet.php CHANGED
@@ -1,547 +1,547 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Subscription
5
- */
6
-
7
- /**
8
- * An <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> can be used to determine whether recipients have been
9
- * unsubscribed from or subscribed to a list.
10
- * It can also contain information about the recipient, if she/he exists.
11
- * <P/>
12
- * The following information can be retrieved using the <i>SubscriptionLogEntryRowSet</i>:
13
- * <ul>
14
- * <li><i>The log entry type</i>: Describes the message of the entry. May be one of:
15
- * <ul>
16
- * <li><i>BLACKLISTED</i>: The recipient could not be subscribed because of a blacklist entry.</li>
17
- * <li><i>DUPLICATE_SUBSCRIPTION</i>: The recipient could not be subscribed because she/he is already subscribed.</li>
18
- * <li><i>INVALID_ADRESS_ERROR</i>: The recipient could not be subscribed because the email address </li>
19
- * is not conform to the RFC standard.
20
- * <li><i>LIST_UNSUBSCRIBE_HEADER_UNSUBSCRIPTION</i>: The recipient was unsubscribed using header unsubscription.</li>
21
- * <li><i>MANUAL_SUBSCRIPTION</i>: The recipient was subscribed by an Inxmail user.</li>
22
- * <li><i>MANUAL_UNSUBSCRIPTION</i>: The recipient was unsubscribed by an Inxmail user.</li>
23
- * <li><i>NOT_IN_LIST_UNSUBSCRIPTION</i>: The recipient could not be unsubscribed because she/he is not subscribed.</li>
24
- * <li><i>PENDING_SUBSCRIPTION</i>: The subscription of the recipient is in progress (Double Opt In).</li>
25
- * <li><i>PENDING_UNSUBSCRIPTION</i>: The unsubscription of the recipient is in progress (Double Opt Out).</li>
26
- * <li><i>SUBSCRIPTION_EMAIL_MISSMATCH</i>: The recipient could not be subscribed because of an
27
- * email address mismatch.</li>
28
- * <li><i>SUBSCRIPTION_ID_NOT_VALID</i>: An invalid subscription verification was received (Double Opt In).</li>
29
- * <li><i>SUBSCRIPTION_INTERNAL_ERROR</i>: The recipient could not be subscribed due to an internal error.</li>
30
- * <li><i>SUBSCRIPTION_TIMED_OUT</i>: The subscription of the recipient timed out (Double Opt In).</li>
31
- * <li><i>SUBSCRIPTION_VERIFICATION_BOUNCED</i>: A subscription verification mail bounced.</li>
32
- * <li><i>UNSUBSCRIPTION_EMAIL_MISSATCH</i>: The recipient could not be unsubscribed because of an email address</li>
33
- * <li><i>UNSUBSCRIPTION_ID_NOT_VALID</i>: An invalid unsubscription verification was received (Double Opt Out).</li>
34
- * <li><i>UNSUBSCRIPTION_INTERNAL_ERROR</i>: The recipient could not be unsubscribed due to an internal error.</li>
35
- * <li><i>UNSUBSCRIPTION_TIMED_OUT</i>: The subscription of the recipient timed out (Double Opt Out).</li>
36
- * <li><i>UNSUBSCRIPTION_VERIFICATION_BOUNCED</i>: An unsubscription verification mail bounced.</li>
37
- * <li><i>VERIFIED_SUBSCRIPTION</i>: A recipient subscription has been verified.</li>
38
- * <li><i>VERIFIED_UNSUBSCRIPTION</i>: A recipient unsubscription has been verified.</li>
39
- * <li><i>UNKNOWN_SUBSCRIPTIONTYPE</i>: The log entry type is unknown.</li>
40
- * </ul>
41
- * </li>
42
- * <li><i>The log message</i>: The message associated with the log entry.</li>
43
- * <li><i>The datetime of the entry</i>: When was the log entry created?</li>
44
- * <li><i>The email address</i>: The email address of the recipient involved in the log entry.</li>
45
- * <li><i>The recipient id</i>: The id of the recipient involved in the log entry.</li>
46
- * <li><i>The recipient state</i>: The state of the recipient involved in the log entry. May be one of:
47
- * <ul>
48
- * <li><i>RECIPIENT_STATE_EXISTENT</i>: If the recipient exists.</li>
49
- * <li><i>RECIPIENT_STATE_UNKNOWN_OR_DELETED</i>: If the recipient was deleted or the state is unknown.</li>
50
- * </ul>
51
- * </li>
52
- * <li>Possibly some attributes queried in the <i>Inx_Api_Subscription_SubscriptionManager</i> which can be retrieved
53
- * using the <i>getter</i> methods.</li>
54
- * </ul>
55
- * <P/>
56
- * A <i>SubscriptionLogEntryRowSet</i> object maintains a cursor pointing to its current row of data.
57
- * Initially the cursor is positioned before the first row.
58
- * The <i>next()</i> method moves the cursor to the next row (recipient), and because it returns <i>false</i> when
59
- * there are no more rows in the <i>SubscriptionLogEntryRowSet</i> object, it can be used in a <i>while</i> loop to
60
- * iterate through the result set.
61
- * <p/>
62
- * Be sure to call <i>next()</i> before the first retrieval statement on the row set.
63
- * As stated above, initially the cursor is before the first row, thus no data can be retrieved from the row set
64
- * before calling <i>next()</i>.
65
- * Doing so will trigger an <i>Inx_Api_DataException</i>.
66
- * <P/>
67
- * The <i>SubscriptionLogEntryRowSet</i> interface provides <i>getter</i> methods (<i>getString</i>,
68
- * <i>getInteger</i>, and so on) for retrieving attribute values from the current row.
69
- * Values can be retrieved using the attribute object if they were included in the query.
70
- * <p/>
71
- * The following snippet shows how to retrieve the email address of all (un)subscriptions in the row set, thus also
72
- * illustrating how to iterate over a <i>SubscriptionLogEntryRowSet</i>:
73
- *
74
- * <pre>
75
- * $oRecipientContext = $oSession->createRecipientContext();
76
- * $oSubscriptionManager = $oSession->getSubscriptionManager();
77
- * $oSubscriptionLogEntryRowSet = $oSubscriptionManager->getAllLogEntries( $oRecipientContext, null );
78
- *
79
- * while( $oSubscriptionLogEntryRowSet->next() )
80
- * {
81
- * echo $oSubscriptionLogEntryRowSet->getEmailAddress().&quot;&#60;br&#62;&quot;;
82
- * }
83
- *
84
- * $oSubscriptionLogEntryRowSet->close();
85
- * </pre>
86
- * <p/>
87
- * <strong>Note:</strong> An <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object <strong>must</strong> be closed
88
- * once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.
89
- * <p/>
90
- * For more information about the (un)subscription of recipients, see the <i>Inx_api_Subscritpion_SubscriptionManager</i>
91
- * and Inx_Api_Recipient_RecipientContext</i> documentation.
92
- *
93
- * @see Inx_api_Subscritpion_SubscriptionManager
94
- * @see Inx_Api_Recipient_RecipientContext
95
- * @since API 1.4.4
96
- * @version $Revision:$ $Date:$ $Author:$
97
- * @package Inxmail
98
- * @subpackage Subscription
99
- */
100
- interface Inx_Api_Subscription_SubscriptionLogEntryRowSet
101
- {
102
- /**
103
- * State for missing recipient information.
104
- * This state will be used when no attributes are specified in the query or in case of an unknown or deleted recipient.
105
- *
106
- * @var int
107
- */
108
- const RECIPIENT_STATE_UNKNOWN_OR_DELETED = 0;
109
-
110
- /**
111
- * State for existent recipient.
112
- *
113
- * @var int
114
- */
115
- const RECIPIENT_STATE_EXISTENT = 1;
116
-
117
- /**
118
- * The SubscriptionInformation State for verified subscriptions.
119
- *
120
- * @var int
121
- */
122
- const VERIFIED_SUBSCRIPTION = 1;
123
-
124
- /**
125
- * The SubscriptionInformation State for verified unsubscriptions.
126
- *
127
- * @var int
128
- */
129
- const VERIFIED_UNSUBSCRIPTION = 2;
130
-
131
- /** The SubscriptionInformation State for pending subscriptions.
132
- *
133
- * @var int
134
- */
135
- const PENDING_SUBSCRIPTION = 3;
136
-
137
- /** The SubscriptionInformation State for pending unsubscriptions.
138
- *
139
- * @var int
140
- */
141
- const PENDING_UNSUBSCRIPTION = 4;
142
-
143
- /** The SubscriptionInformation State for an unknown subscription type.
144
- *
145
- * @var int
146
- */
147
- const UNKNOWN_SUBSCRIPTIONTYPE = -1;
148
-
149
- /**
150
- * The SubscriptionInformation state for forced subscriptions.
151
- *
152
- * @var int
153
- * @since API 1.9.0
154
- */
155
- const MANUAL_SUBSCRIPTION = 5;
156
-
157
- /**
158
- * The SubscriptionInformation state for forced unsubscriptions.
159
- *
160
- * @var int
161
- * @since API 1.9.0
162
- */
163
- const MANUAL_UNSUBSCRIPTION = 6;
164
-
165
- /**
166
- * The SubscriptionInformation state for duplicate subscriptions.
167
- *
168
- * @var int
169
- * @since API 1.9.0
170
- */
171
- const DUPLICATE_SUBSCRIPTION = 7;
172
-
173
- /**
174
- * The SubscriptionInformation state for unsubscription of unknown list members.
175
- *
176
- * @var int
177
- * @since API 1.9.0
178
- */
179
- const NOT_IN_LIST_UNSUBSCRIPTION = 8;
180
-
181
- /**
182
- * The SubscriptionInformation state for a timed out subscription verification.
183
- *
184
- * @var int
185
- * @since API 1.9.0
186
- */
187
- const SUBSCRIPTION_TIMED_OUT = 9;
188
-
189
- /**
190
- * The SubscriptionInformation state for an invalid subscription verification.
191
- *
192
- * @var int
193
- * @since API 1.9.0
194
- */
195
- const SUBSCRIPTION_ID_NOT_VALID = 10;
196
-
197
- /**
198
- * The SubscriptionInformation state for subscriber email address != mail email address.
199
- *
200
- * @var int
201
- * @since API 1.9.0
202
- */
203
- const SUBSCRIPTION_EMAIL_MISSMATCH = 11;
204
-
205
- /**
206
- * The SubscriptionInformation state for a timed out unsubscription verification.
207
- *
208
- * @var int
209
- * @since API 1.9.0
210
- */
211
- const UNSUBSCRIPTION_TIMED_OUT = 12;
212
-
213
- /**
214
- * The SubscriptionInformation state for an invalid unsubscription verification.
215
- *
216
- * @var int
217
- * @since API 1.9.0
218
- */
219
- const UNSUBSCRIPTION_ID_NOT_VALID = 13;
220
-
221
- /**
222
- * The SubscriptionInformation state for member email address != mail email address.
223
- *
224
- * @var int
225
- * @since API 1.9.0
226
- */
227
- const UNSUBSCRIPTION_EMAIL_MISSMATCH = 14;
228
-
229
- /**
230
- * The SubscriptionInformation state for an error which occurred during the subscription.
231
- *
232
- * @var int
233
- * @since API 1.9.0
234
- */
235
- const SUBSCRIPTION_INTERNAL_ERROR = 15;
236
-
237
- /**
238
- * The SubscriptionInformation state for an error which occurred during the unsubscription.
239
- *
240
- * @var int
241
- * @since API 1.9.0
242
- */
243
- const UNSUBSCRIPTION_INTERNAL_ERROR = 16;
244
-
245
- /**
246
- * The SubscriptionInformation State for a subscription blocked by a blacklist agent.
247
- *
248
- * @var int
249
- * @since API 1.9.0
250
- */
251
- const BLACKLISTED = 17;
252
-
253
- /**
254
- * The SubscriptionInformation state for an invalid mail address.
255
- *
256
- * @var int
257
- * @since API 1.9.0
258
- */
259
- const INVALID_ADRESS_ERROR = 18;
260
-
261
- /**
262
- * The SubscriptionInformation state for a bounced subscription verification.
263
- *
264
- * @var int
265
- * @since API 1.9.0
266
- */
267
- const SUBSCRIPTION_VERIFICATION_BOUNCED = 19;
268
-
269
- /**
270
- * The SubscriptionInformation state for a bounced unsubscription verification.
271
- *
272
- * @var int
273
- * @since API 1.9.0
274
- */
275
- const UNSUBSCRIPTION_VERIFICATION_BOUNCED = 20;
276
-
277
- /**
278
- * The SubscriptionInformation state for an unsubscription received via an unsubscription header.
279
- *
280
- * @var int
281
- * @since API 1.9.0
282
- */
283
- const LIST_UNSUBSCRIBE_HEADER_UNSUBSCRIPTION = 21;
284
-
285
-
286
-
287
- /**
288
- * Returns the whole log message as string.
289
- *
290
- * @return string the log message as string.
291
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
292
- */
293
- function getLogMessage();
294
-
295
-
296
- /**
297
- * Returns the id of the list associated with this entry.
298
- *
299
- * @return int the id of the list associated with this entry.
300
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
301
- */
302
- function getListId() ;
303
-
304
-
305
- /**
306
- * Returns the type of the entry. May be one of:
307
- * <ul>
308
- * <li><i>BLACKLISTED</i>: The recipient could not be subscribed because of a blacklist entry.
309
- * <li><i>DUPLICATE_SUBSCRIPTION</i>: The recipient could not be subscribed because she/he is already subscribed.
310
- * <li><i>INVALID_ADRESS_ERROR</i>: The recipient could not be subscribed because the email address is not conform
311
- * to the RFC standard.
312
- * <li><i>LIST_UNSUBSCRIBE_HEADER_UNSUBSCRIPTION</i>: The recipient was unsubscribed using header unsubscription.
313
- * <li><i>MANUAL_SUBSCRIPTION</i>: The recipient was subscribed by an Inxmail user.
314
- * <li><i>MANUAL_UNSUBSCRIPTION</i>: The recipient was unsubscribed by an Inxmail user.
315
- * <li><i>NOT_IN_LIST_UNSUBSCRIPTION</i>: The recipient could not be unsubscribed because she/he is not
316
- * subscribed.
317
- * <li><i>PENDING_SUBSCRIPTION</i>: The subscription of the recipient is in progress (Double Opt In).
318
- * <li><i>PENDING_UNSUBSCRIPTION</i>: The unsubscription of the recipient is in progress (Double Opt Out).
319
- * <li><i>SUBSCRIPTION_EMAIL_MISSMATCH</i>: The recipient could not be subscribed because of an email address
320
- * mismatch.
321
- * <li><i>SUBSCRIPTION_ID_NOT_VALID</i>: An invalid subscription verification was received (Double Opt In).
322
- * <li><i>SUBSCRIPTION_INTERNAL_ERROR</i>: The recipient could not be subscribed due to an internal error.
323
- * <li><i>SUBSCRIPTION_TIMED_OUT</i>: The subscription of the recipient timed out (Double Opt In).
324
- * <li><i>SUBSCRIPTION_VERIFICATION_BOUNCED</i>: A subscription verification mail bounced.
325
- * <li><i>UNSUBSCRIPTION_EMAIL_MISSATCH</i>: The recipient could not be unsubscribed because of an email address
326
- * <li><i>UNSUBSCRIPTION_ID_NOT_VALID</i>: An invalid unsubscription verification was received (Double Opt Out).
327
- * <li><i>UNSUBSCRIPTION_INTERNAL_ERROR</i>: The recipient could not be unsubscribed due to an internal error.
328
- * <li><i>UNSUBSCRIPTION_TIMED_OUT</i>: The subscription of the recipient timed out (Double Opt Out).
329
- * <li><i>UNSUBSCRIPTION_VERIFICATION_BOUNCED</i>: An unsubscription verification mail bounced.
330
- * <li><i>VERIFIED_SUBSCRIPTION</i>: A recipient subscription has been verified.
331
- * <li><i>VERIFIED_UNSUBSCRIPTION</i>: A recipient unsubscription has been verified.
332
- * <li><i>UNKNOWN_SUBSCRIPTIONTYPE</i>: The log entry type is unknown.
333
- * </ul>
334
- *
335
- * @return int the type of this entry.
336
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
337
- */
338
- function getType();
339
-
340
-
341
- /**
342
- * Returns the datetime of the entry.
343
- *
344
- * @return string the datetime. The datetime will be returned as ISO 8601 formatted datetime string.
345
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
346
- */
347
- function getEntryDatetime();
348
-
349
-
350
- /**
351
- * Returns the email address associated with this entry.
352
- *
353
- * @return the email address associated with this entry.
354
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
355
- */
356
- function getEmailAddress();
357
-
358
-
359
- /**
360
- * Returns the id of the recipient associated with this entry, if the recipient exists.
361
- *
362
- * @return the id of the recipient associated with this entry, if the recipient exists.
363
- * @throws Inx_Api_DataException if the recipient does not exists or the recipient state is unknown.
364
- * May also occur if no row is selected (e.g. you forgot to call next()).
365
- */
366
- function getRecipientId();
367
-
368
-
369
- /**
370
- * Returns the state of the recipient associated with the current log entry. May be one of:
371
- * <ul>
372
- * <li><i>RECIPIENT_STATE_UNKNOWN_OR_DELETED</i> - if the recipient state is unknown or the recipient was deleted.
373
- * <li><i>RECIPIENT_STATE_EXISTENT</i> - if the recipient exists.
374
- * </ul>
375
- *
376
- * @return the recipient state.
377
- * @throws Inx_Api_DataException if the recipient state cannot be determined.
378
- */
379
- function getRecipientState();
380
-
381
-
382
- /**
383
- * Returns the integer value for the given recipient Attribute.
384
- *
385
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
386
- * @return int the integer value.
387
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
388
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>integer</i>.
389
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
390
- */
391
- function getInteger( Inx_Api_Recipient_Attribute $attr ) ;
392
-
393
-
394
- /**
395
- * Returns the string value for the given recipient Attribute.
396
- *
397
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
398
- * @return string the string value.
399
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
400
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
401
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
402
- */
403
- function getString(Inx_Api_Recipient_Attribute $attr );
404
-
405
-
406
- /**
407
- * Returns the datetime value for the given recipient Attribute.
408
- *
409
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
410
- * @return string the datetime value. The datetime will be returned as ISO 8601 formatted datetime string.
411
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
412
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
413
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
414
- */
415
- function getDatetime(Inx_Api_Recipient_Attribute $attr );
416
-
417
-
418
- /**
419
- * Returns the date value for the given recipient Attribute.
420
- *
421
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
422
- * @return string the date value. The date will be returned as ISO 8601 formatted date string.
423
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
424
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
425
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
426
- */
427
- function getDate(Inx_Api_Recipient_Attribute $attr );
428
-
429
-
430
- /**
431
- * Returns the time value for the given recipient Attribute.
432
- *
433
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
434
- * @return string the time value. The time will be returned as ISO 8601 formatted time string.
435
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
436
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
437
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
438
- */
439
- function getTime(Inx_Api_Recipient_Attribute $attr );
440
-
441
-
442
- /**
443
- * Returns the float value for the given recipient Attribute.
444
- *
445
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
446
- * @return float the float value.
447
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
448
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>float</i>.
449
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
450
- */
451
- function getDouble( Inx_Api_Recipient_Attribute $attr );
452
-
453
-
454
- /**
455
- * Returns the bool value for the given recipient Attribute.
456
- *
457
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
458
- * @return bool the bool value.
459
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
460
- * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
461
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
462
- */
463
- function getBoolean(Inx_Api_Recipient_Attribute $attr );
464
-
465
-
466
- /**
467
- * Returns the value for the given recipient Attribute.<br>
468
- *
469
- * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
470
- * @return mixed the value.
471
- * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
472
- * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
473
- */
474
- function getObject(Inx_Api_Recipient_Attribute $attr );
475
-
476
-
477
- /**
478
- * Moves the cursor to the front of this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object,
479
- * just before the first row.
480
- * This method has no effect if the result set contains no rows.
481
- */
482
- function beforeFirstRow();
483
-
484
-
485
- /**
486
- * Moves the cursor to the end of this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object,
487
- * just after the last row.
488
- * This method has no effect if the result set contains no rows.
489
- */
490
- function afterLastRow();
491
-
492
-
493
- /**
494
- * Moves the cursor to the given row number in this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object.
495
- * The first row is row 0, the second is row 1, and so on.
496
- *
497
- * @param int $row the number of the row to which the cursor should move.
498
- */
499
- function setRow( $row );
500
-
501
-
502
- /**
503
- * Retrieves the current row number. The first row is number 0, the second number 1, and so on.
504
- *
505
- * @return int the current row number.
506
- */
507
- function getRow();
508
-
509
-
510
- /**
511
- * Moves the cursor down one row from its current position.
512
- * A <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> cursor is initially positioned before the first row;
513
- * the first call to the method <i>next()</i> makes the first row the current row;
514
- * the second call makes the second row the current row, and so on.
515
- *
516
- * @return bool <i>true</i> if the new current row is valid, <i>false</i> if there are no more rows.
517
- */
518
- function next();
519
-
520
-
521
- /**
522
- * Moves the cursor to the previous row in this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object.
523
- *
524
- * @return bool <i>true</i> if the cursor is on a valid row; <i>false</i> if it is off the result set.
525
- */
526
- function previous();
527
-
528
-
529
- /**
530
- * Returns the number of rows in this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object.
531
- *
532
- * @return int the number of rows.
533
- */
534
- function getRowCount();
535
-
536
-
537
- /**
538
- * Releases the resources associated with this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object on
539
- * the server immediately.
540
- * <p>
541
- * An <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object <strong>must</strong> be closed
542
- * once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.
543
- */
544
- function close();
545
-
546
- }
547
-
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Subscription
5
+ */
6
+
7
+ /**
8
+ * An <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> can be used to determine whether recipients have been
9
+ * unsubscribed from or subscribed to a list.
10
+ * It can also contain information about the recipient, if she/he exists.
11
+ * <P/>
12
+ * The following information can be retrieved using the <i>SubscriptionLogEntryRowSet</i>:
13
+ * <ul>
14
+ * <li><i>The log entry type</i>: Describes the message of the entry. May be one of:
15
+ * <ul>
16
+ * <li><i>BLACKLISTED</i>: The recipient could not be subscribed because of a blacklist entry.</li>
17
+ * <li><i>DUPLICATE_SUBSCRIPTION</i>: The recipient could not be subscribed because she/he is already subscribed.</li>
18
+ * <li><i>INVALID_ADRESS_ERROR</i>: The recipient could not be subscribed because the email address </li>
19
+ * is not conform to the RFC standard.
20
+ * <li><i>LIST_UNSUBSCRIBE_HEADER_UNSUBSCRIPTION</i>: The recipient was unsubscribed using header unsubscription.</li>
21
+ * <li><i>MANUAL_SUBSCRIPTION</i>: The recipient was subscribed by an Inxmail user.</li>
22
+ * <li><i>MANUAL_UNSUBSCRIPTION</i>: The recipient was unsubscribed by an Inxmail user.</li>
23
+ * <li><i>NOT_IN_LIST_UNSUBSCRIPTION</i>: The recipient could not be unsubscribed because she/he is not subscribed.</li>
24
+ * <li><i>PENDING_SUBSCRIPTION</i>: The subscription of the recipient is in progress (Double Opt In).</li>
25
+ * <li><i>PENDING_UNSUBSCRIPTION</i>: The unsubscription of the recipient is in progress (Double Opt Out).</li>
26
+ * <li><i>SUBSCRIPTION_EMAIL_MISSMATCH</i>: The recipient could not be subscribed because of an
27
+ * email address mismatch.</li>
28
+ * <li><i>SUBSCRIPTION_ID_NOT_VALID</i>: An invalid subscription verification was received (Double Opt In).</li>
29
+ * <li><i>SUBSCRIPTION_INTERNAL_ERROR</i>: The recipient could not be subscribed due to an internal error.</li>
30
+ * <li><i>SUBSCRIPTION_TIMED_OUT</i>: The subscription of the recipient timed out (Double Opt In).</li>
31
+ * <li><i>SUBSCRIPTION_VERIFICATION_BOUNCED</i>: A subscription verification mail bounced.</li>
32
+ * <li><i>UNSUBSCRIPTION_EMAIL_MISSATCH</i>: The recipient could not be unsubscribed because of an email address</li>
33
+ * <li><i>UNSUBSCRIPTION_ID_NOT_VALID</i>: An invalid unsubscription verification was received (Double Opt Out).</li>
34
+ * <li><i>UNSUBSCRIPTION_INTERNAL_ERROR</i>: The recipient could not be unsubscribed due to an internal error.</li>
35
+ * <li><i>UNSUBSCRIPTION_TIMED_OUT</i>: The subscription of the recipient timed out (Double Opt Out).</li>
36
+ * <li><i>UNSUBSCRIPTION_VERIFICATION_BOUNCED</i>: An unsubscription verification mail bounced.</li>
37
+ * <li><i>VERIFIED_SUBSCRIPTION</i>: A recipient subscription has been verified.</li>
38
+ * <li><i>VERIFIED_UNSUBSCRIPTION</i>: A recipient unsubscription has been verified.</li>
39
+ * <li><i>UNKNOWN_SUBSCRIPTIONTYPE</i>: The log entry type is unknown.</li>
40
+ * </ul>
41
+ * </li>
42
+ * <li><i>The log message</i>: The message associated with the log entry.</li>
43
+ * <li><i>The datetime of the entry</i>: When was the log entry created?</li>
44
+ * <li><i>The email address</i>: The email address of the recipient involved in the log entry.</li>
45
+ * <li><i>The recipient id</i>: The id of the recipient involved in the log entry.</li>
46
+ * <li><i>The recipient state</i>: The state of the recipient involved in the log entry. May be one of:
47
+ * <ul>
48
+ * <li><i>RECIPIENT_STATE_EXISTENT</i>: If the recipient exists.</li>
49
+ * <li><i>RECIPIENT_STATE_UNKNOWN_OR_DELETED</i>: If the recipient was deleted or the state is unknown.</li>
50
+ * </ul>
51
+ * </li>
52
+ * <li>Possibly some attributes queried in the <i>Inx_Api_Subscription_SubscriptionManager</i> which can be retrieved
53
+ * using the <i>getter</i> methods.</li>
54
+ * </ul>
55
+ * <P/>
56
+ * A <i>SubscriptionLogEntryRowSet</i> object maintains a cursor pointing to its current row of data.
57
+ * Initially the cursor is positioned before the first row.
58
+ * The <i>next()</i> method moves the cursor to the next row (recipient), and because it returns <i>false</i> when
59
+ * there are no more rows in the <i>SubscriptionLogEntryRowSet</i> object, it can be used in a <i>while</i> loop to
60
+ * iterate through the result set.
61
+ * <p/>
62
+ * Be sure to call <i>next()</i> before the first retrieval statement on the row set.
63
+ * As stated above, initially the cursor is before the first row, thus no data can be retrieved from the row set
64
+ * before calling <i>next()</i>.
65
+ * Doing so will trigger an <i>Inx_Api_DataException</i>.
66
+ * <P/>
67
+ * The <i>SubscriptionLogEntryRowSet</i> interface provides <i>getter</i> methods (<i>getString</i>,
68
+ * <i>getInteger</i>, and so on) for retrieving attribute values from the current row.
69
+ * Values can be retrieved using the attribute object if they were included in the query.
70
+ * <p/>
71
+ * The following snippet shows how to retrieve the email address of all (un)subscriptions in the row set, thus also
72
+ * illustrating how to iterate over a <i>SubscriptionLogEntryRowSet</i>:
73
+ *
74
+ * <pre>
75
+ * $oRecipientContext = $oSession->createRecipientContext();
76
+ * $oSubscriptionManager = $oSession->getSubscriptionManager();
77
+ * $oSubscriptionLogEntryRowSet = $oSubscriptionManager->getAllLogEntries( $oRecipientContext, null );
78
+ *
79
+ * while( $oSubscriptionLogEntryRowSet->next() )
80
+ * {
81
+ * echo $oSubscriptionLogEntryRowSet->getEmailAddress().&quot;&#60;br&#62;&quot;;
82
+ * }
83
+ *
84
+ * $oSubscriptionLogEntryRowSet->close();
85
+ * </pre>
86
+ * <p/>
87
+ * <strong>Note:</strong> An <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object <strong>must</strong> be closed
88
+ * once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.
89
+ * <p/>
90
+ * For more information about the (un)subscription of recipients, see the <i>Inx_api_Subscritpion_SubscriptionManager</i>
91
+ * and Inx_Api_Recipient_RecipientContext</i> documentation.
92
+ *
93
+ * @see Inx_api_Subscritpion_SubscriptionManager
94
+ * @see Inx_Api_Recipient_RecipientContext
95
+ * @since API 1.4.4
96
+ * @version $Revision:$ $Date:$ $Author:$
97
+ * @package Inxmail
98
+ * @subpackage Subscription
99
+ */
100
+ interface Inx_Api_Subscription_SubscriptionLogEntryRowSet
101
+ {
102
+ /**
103
+ * State for missing recipient information.
104
+ * This state will be used when no attributes are specified in the query or in case of an unknown or deleted recipient.
105
+ *
106
+ * @var int
107
+ */
108
+ const RECIPIENT_STATE_UNKNOWN_OR_DELETED = 0;
109
+
110
+ /**
111
+ * State for existent recipient.
112
+ *
113
+ * @var int
114
+ */
115
+ const RECIPIENT_STATE_EXISTENT = 1;
116
+
117
+ /**
118
+ * The SubscriptionInformation State for verified subscriptions.
119
+ *
120
+ * @var int
121
+ */
122
+ const VERIFIED_SUBSCRIPTION = 1;
123
+
124
+ /**
125
+ * The SubscriptionInformation State for verified unsubscriptions.
126
+ *
127
+ * @var int
128
+ */
129
+ const VERIFIED_UNSUBSCRIPTION = 2;
130
+
131
+ /** The SubscriptionInformation State for pending subscriptions.
132
+ *
133
+ * @var int
134
+ */
135
+ const PENDING_SUBSCRIPTION = 3;
136
+
137
+ /** The SubscriptionInformation State for pending unsubscriptions.
138
+ *
139
+ * @var int
140
+ */
141
+ const PENDING_UNSUBSCRIPTION = 4;
142
+
143
+ /** The SubscriptionInformation State for an unknown subscription type.
144
+ *
145
+ * @var int
146
+ */
147
+ const UNKNOWN_SUBSCRIPTIONTYPE = -1;
148
+
149
+ /**
150
+ * The SubscriptionInformation state for forced subscriptions.
151
+ *
152
+ * @var int
153
+ * @since API 1.9.0
154
+ */
155
+ const MANUAL_SUBSCRIPTION = 5;
156
+
157
+ /**
158
+ * The SubscriptionInformation state for forced unsubscriptions.
159
+ *
160
+ * @var int
161
+ * @since API 1.9.0
162
+ */
163
+ const MANUAL_UNSUBSCRIPTION = 6;
164
+
165
+ /**
166
+ * The SubscriptionInformation state for duplicate subscriptions.
167
+ *
168
+ * @var int
169
+ * @since API 1.9.0
170
+ */
171
+ const DUPLICATE_SUBSCRIPTION = 7;
172
+
173
+ /**
174
+ * The SubscriptionInformation state for unsubscription of unknown list members.
175
+ *
176
+ * @var int
177
+ * @since API 1.9.0
178
+ */
179
+ const NOT_IN_LIST_UNSUBSCRIPTION = 8;
180
+
181
+ /**
182
+ * The SubscriptionInformation state for a timed out subscription verification.
183
+ *
184
+ * @var int
185
+ * @since API 1.9.0
186
+ */
187
+ const SUBSCRIPTION_TIMED_OUT = 9;
188
+
189
+ /**
190
+ * The SubscriptionInformation state for an invalid subscription verification.
191
+ *
192
+ * @var int
193
+ * @since API 1.9.0
194
+ */
195
+ const SUBSCRIPTION_ID_NOT_VALID = 10;
196
+
197
+ /**
198
+ * The SubscriptionInformation state for subscriber email address != mail email address.
199
+ *
200
+ * @var int
201
+ * @since API 1.9.0
202
+ */
203
+ const SUBSCRIPTION_EMAIL_MISSMATCH = 11;
204
+
205
+ /**
206
+ * The SubscriptionInformation state for a timed out unsubscription verification.
207
+ *
208
+ * @var int
209
+ * @since API 1.9.0
210
+ */
211
+ const UNSUBSCRIPTION_TIMED_OUT = 12;
212
+
213
+ /**
214
+ * The SubscriptionInformation state for an invalid unsubscription verification.
215
+ *
216
+ * @var int
217
+ * @since API 1.9.0
218
+ */
219
+ const UNSUBSCRIPTION_ID_NOT_VALID = 13;
220
+
221
+ /**
222
+ * The SubscriptionInformation state for member email address != mail email address.
223
+ *
224
+ * @var int
225
+ * @since API 1.9.0
226
+ */
227
+ const UNSUBSCRIPTION_EMAIL_MISSMATCH = 14;
228
+
229
+ /**
230
+ * The SubscriptionInformation state for an error which occurred during the subscription.
231
+ *
232
+ * @var int
233
+ * @since API 1.9.0
234
+ */
235
+ const SUBSCRIPTION_INTERNAL_ERROR = 15;
236
+
237
+ /**
238
+ * The SubscriptionInformation state for an error which occurred during the unsubscription.
239
+ *
240
+ * @var int
241
+ * @since API 1.9.0
242
+ */
243
+ const UNSUBSCRIPTION_INTERNAL_ERROR = 16;
244
+
245
+ /**
246
+ * The SubscriptionInformation State for a subscription blocked by a blacklist agent.
247
+ *
248
+ * @var int
249
+ * @since API 1.9.0
250
+ */
251
+ const BLACKLISTED = 17;
252
+
253
+ /**
254
+ * The SubscriptionInformation state for an invalid mail address.
255
+ *
256
+ * @var int
257
+ * @since API 1.9.0
258
+ */
259
+ const INVALID_ADRESS_ERROR = 18;
260
+
261
+ /**
262
+ * The SubscriptionInformation state for a bounced subscription verification.
263
+ *
264
+ * @var int
265
+ * @since API 1.9.0
266
+ */
267
+ const SUBSCRIPTION_VERIFICATION_BOUNCED = 19;
268
+
269
+ /**
270
+ * The SubscriptionInformation state for a bounced unsubscription verification.
271
+ *
272
+ * @var int
273
+ * @since API 1.9.0
274
+ */
275
+ const UNSUBSCRIPTION_VERIFICATION_BOUNCED = 20;
276
+
277
+ /**
278
+ * The SubscriptionInformation state for an unsubscription received via an unsubscription header.
279
+ *
280
+ * @var int
281
+ * @since API 1.9.0
282
+ */
283
+ const LIST_UNSUBSCRIBE_HEADER_UNSUBSCRIPTION = 21;
284
+
285
+
286
+
287
+ /**
288
+ * Returns the whole log message as string.
289
+ *
290
+ * @return string the log message as string.
291
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
292
+ */
293
+ function getLogMessage();
294
+
295
+
296
+ /**
297
+ * Returns the id of the list associated with this entry.
298
+ *
299
+ * @return int the id of the list associated with this entry.
300
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
301
+ */
302
+ function getListId() ;
303
+
304
+
305
+ /**
306
+ * Returns the type of the entry. May be one of:
307
+ * <ul>
308
+ * <li><i>BLACKLISTED</i>: The recipient could not be subscribed because of a blacklist entry.
309
+ * <li><i>DUPLICATE_SUBSCRIPTION</i>: The recipient could not be subscribed because she/he is already subscribed.
310
+ * <li><i>INVALID_ADRESS_ERROR</i>: The recipient could not be subscribed because the email address is not conform
311
+ * to the RFC standard.
312
+ * <li><i>LIST_UNSUBSCRIBE_HEADER_UNSUBSCRIPTION</i>: The recipient was unsubscribed using header unsubscription.
313
+ * <li><i>MANUAL_SUBSCRIPTION</i>: The recipient was subscribed by an Inxmail user.
314
+ * <li><i>MANUAL_UNSUBSCRIPTION</i>: The recipient was unsubscribed by an Inxmail user.
315
+ * <li><i>NOT_IN_LIST_UNSUBSCRIPTION</i>: The recipient could not be unsubscribed because she/he is not
316
+ * subscribed.
317
+ * <li><i>PENDING_SUBSCRIPTION</i>: The subscription of the recipient is in progress (Double Opt In).
318
+ * <li><i>PENDING_UNSUBSCRIPTION</i>: The unsubscription of the recipient is in progress (Double Opt Out).
319
+ * <li><i>SUBSCRIPTION_EMAIL_MISSMATCH</i>: The recipient could not be subscribed because of an email address
320
+ * mismatch.
321
+ * <li><i>SUBSCRIPTION_ID_NOT_VALID</i>: An invalid subscription verification was received (Double Opt In).
322
+ * <li><i>SUBSCRIPTION_INTERNAL_ERROR</i>: The recipient could not be subscribed due to an internal error.
323
+ * <li><i>SUBSCRIPTION_TIMED_OUT</i>: The subscription of the recipient timed out (Double Opt In).
324
+ * <li><i>SUBSCRIPTION_VERIFICATION_BOUNCED</i>: A subscription verification mail bounced.
325
+ * <li><i>UNSUBSCRIPTION_EMAIL_MISSATCH</i>: The recipient could not be unsubscribed because of an email address
326
+ * <li><i>UNSUBSCRIPTION_ID_NOT_VALID</i>: An invalid unsubscription verification was received (Double Opt Out).
327
+ * <li><i>UNSUBSCRIPTION_INTERNAL_ERROR</i>: The recipient could not be unsubscribed due to an internal error.
328
+ * <li><i>UNSUBSCRIPTION_TIMED_OUT</i>: The subscription of the recipient timed out (Double Opt Out).
329
+ * <li><i>UNSUBSCRIPTION_VERIFICATION_BOUNCED</i>: An unsubscription verification mail bounced.
330
+ * <li><i>VERIFIED_SUBSCRIPTION</i>: A recipient subscription has been verified.
331
+ * <li><i>VERIFIED_UNSUBSCRIPTION</i>: A recipient unsubscription has been verified.
332
+ * <li><i>UNKNOWN_SUBSCRIPTIONTYPE</i>: The log entry type is unknown.
333
+ * </ul>
334
+ *
335
+ * @return int the type of this entry.
336
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
337
+ */
338
+ function getType();
339
+
340
+
341
+ /**
342
+ * Returns the datetime of the entry.
343
+ *
344
+ * @return string the datetime. The datetime will be returned as ISO 8601 formatted datetime string.
345
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
346
+ */
347
+ function getEntryDatetime();
348
+
349
+
350
+ /**
351
+ * Returns the email address associated with this entry.
352
+ *
353
+ * @return the email address associated with this entry.
354
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
355
+ */
356
+ function getEmailAddress();
357
+
358
+
359
+ /**
360
+ * Returns the id of the recipient associated with this entry, if the recipient exists.
361
+ *
362
+ * @return the id of the recipient associated with this entry, if the recipient exists.
363
+ * @throws Inx_Api_DataException if the recipient does not exists or the recipient state is unknown.
364
+ * May also occur if no row is selected (e.g. you forgot to call next()).
365
+ */
366
+ function getRecipientId();
367
+
368
+
369
+ /**
370
+ * Returns the state of the recipient associated with the current log entry. May be one of:
371
+ * <ul>
372
+ * <li><i>RECIPIENT_STATE_UNKNOWN_OR_DELETED</i> - if the recipient state is unknown or the recipient was deleted.
373
+ * <li><i>RECIPIENT_STATE_EXISTENT</i> - if the recipient exists.
374
+ * </ul>
375
+ *
376
+ * @return the recipient state.
377
+ * @throws Inx_Api_DataException if the recipient state cannot be determined.
378
+ */
379
+ function getRecipientState();
380
+
381
+
382
+ /**
383
+ * Returns the integer value for the given recipient Attribute.
384
+ *
385
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
386
+ * @return int the integer value.
387
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
388
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>integer</i>.
389
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
390
+ */
391
+ function getInteger( Inx_Api_Recipient_Attribute $attr ) ;
392
+
393
+
394
+ /**
395
+ * Returns the string value for the given recipient Attribute.
396
+ *
397
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
398
+ * @return string the string value.
399
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
400
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
401
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
402
+ */
403
+ function getString(Inx_Api_Recipient_Attribute $attr );
404
+
405
+
406
+ /**
407
+ * Returns the datetime value for the given recipient Attribute.
408
+ *
409
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
410
+ * @return string the datetime value. The datetime will be returned as ISO 8601 formatted datetime string.
411
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
412
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
413
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
414
+ */
415
+ function getDatetime(Inx_Api_Recipient_Attribute $attr );
416
+
417
+
418
+ /**
419
+ * Returns the date value for the given recipient Attribute.
420
+ *
421
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
422
+ * @return string the date value. The date will be returned as ISO 8601 formatted date string.
423
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
424
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
425
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
426
+ */
427
+ function getDate(Inx_Api_Recipient_Attribute $attr );
428
+
429
+
430
+ /**
431
+ * Returns the time value for the given recipient Attribute.
432
+ *
433
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
434
+ * @return string the time value. The time will be returned as ISO 8601 formatted time string.
435
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
436
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
437
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
438
+ */
439
+ function getTime(Inx_Api_Recipient_Attribute $attr );
440
+
441
+
442
+ /**
443
+ * Returns the float value for the given recipient Attribute.
444
+ *
445
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
446
+ * @return float the float value.
447
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
448
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>float</i>.
449
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
450
+ */
451
+ function getDouble( Inx_Api_Recipient_Attribute $attr );
452
+
453
+
454
+ /**
455
+ * Returns the bool value for the given recipient Attribute.
456
+ *
457
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
458
+ * @return bool the bool value.
459
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
460
+ * @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
461
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
462
+ */
463
+ function getBoolean(Inx_Api_Recipient_Attribute $attr );
464
+
465
+
466
+ /**
467
+ * Returns the value for the given recipient Attribute.<br>
468
+ *
469
+ * @param Inx_Api_Recipient_Attribute $attr the recipient attribute to be retrieved.
470
+ * @return mixed the value.
471
+ * @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
472
+ * @throws Inx_Api_DataException if no row is selected (e.g. you forgot to call next()).
473
+ */
474
+ function getObject(Inx_Api_Recipient_Attribute $attr );
475
+
476
+
477
+ /**
478
+ * Moves the cursor to the front of this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object,
479
+ * just before the first row.
480
+ * This method has no effect if the result set contains no rows.
481
+ */
482
+ function beforeFirstRow();
483
+
484
+
485
+ /**
486
+ * Moves the cursor to the end of this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object,
487
+ * just after the last row.
488
+ * This method has no effect if the result set contains no rows.
489
+ */
490
+ function afterLastRow();
491
+
492
+
493
+ /**
494
+ * Moves the cursor to the given row number in this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object.
495
+ * The first row is row 0, the second is row 1, and so on.
496
+ *
497
+ * @param int $row the number of the row to which the cursor should move.
498
+ */
499
+ function setRow( $row );
500
+
501
+
502
+ /**
503
+ * Retrieves the current row number. The first row is number 0, the second number 1, and so on.
504
+ *
505
+ * @return int the current row number.
506
+ */
507
+ function getRow();
508
+
509
+
510
+ /**
511
+ * Moves the cursor down one row from its current position.
512
+ * A <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> cursor is initially positioned before the first row;
513
+ * the first call to the method <i>next()</i> makes the first row the current row;
514
+ * the second call makes the second row the current row, and so on.
515
+ *
516
+ * @return bool <i>true</i> if the new current row is valid, <i>false</i> if there are no more rows.
517
+ */
518
+ function next();
519
+
520
+
521
+ /**
522
+ * Moves the cursor to the previous row in this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object.
523
+ *
524
+ * @return bool <i>true</i> if the cursor is on a valid row; <i>false</i> if it is off the result set.
525
+ */
526
+ function previous();
527
+
528
+
529
+ /**
530
+ * Returns the number of rows in this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object.
531
+ *
532
+ * @return int the number of rows.
533
+ */
534
+ function getRowCount();
535
+
536
+
537
+ /**
538
+ * Releases the resources associated with this <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object on
539
+ * the server immediately.
540
+ * <p>
541
+ * An <i>Inx_Api_Subscription_SubscriptionLogEntryRowSet</i> object <strong>must</strong> be closed
542
+ * once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.
543
+ */
544
+ function close();
545
+
546
+ }
547
+
lib/Inx/Api/Testprofiles/TestRecipientContext.php CHANGED
@@ -1,146 +1,146 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Recipient
6
- */
7
-
8
- /**
9
- * The <i>Inx_Api_Testprofiles_TestRecipientContext</i> is used to access and manipulate test recipient data.
10
- * The following operations can be performed using the <i>Inx_Api_Testprofiles_TestRecipientContext</i>:
11
- * <p>
12
- * <ul>
13
- * <li>Fetch test recipient data as <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>
14
- * <li>Add and remove test recipients
15
- * <li>Retrieve and update test recipient attribute values
16
- * </ul>
17
- * There are various methods for fetching test recipient data as <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
18
- * The following snippet exemplary shows how to use one specific <code>select</code> method which retrieves all
19
- * test recipients of the specified list whose name is equal to smith, ignoring case considerations:
20
- *
21
- * <pre>
22
- * $oTestRecipientContext = $oSession->createTestRecipientContext();
23
- * $oRecipientContext = $oSession->createRecipientContext();
24
- * $oAttribute_name = $oRecipientContext->getMetaData()->getUserAttribute( &quot;name&quot; );
25
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
26
- *
27
- * $sNameFilter = 'Column(&quot;name&quot;) LIKE &quot;smith&quot;';
28
- * $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext, null, $sNameFilter );
29
- *
30
- * while( $oTestRecipientRowSet->next() )
31
- * {
32
- * echo $oTestRecipientRowSet->getString( $oAttribute_name ).&quot;&#60;br&#62;&quot;;
33
- * }
34
- *
35
- * $oTestRecipientRowSet->close();
36
- * </pre>
37
- *
38
- * <strong>Note:</strong> The % sign can not be used as wildcard in the LIKE statements of the <i>TestRecipientContext</i>.
39
- * If you use a filter which includes the % sign, the filter will only match test recipients which contain the % sign.<br>
40
- * For example the filter statement <i>&quot;Column(\&quot;name\&quot;) LIKE \&quot;s%\&quot;&quot;</i> will match test
41
- * recipients whose name is either s% or S% but not, for example, Smith.
42
- * <p>
43
- * Adding and removing recipients can be accomplished by using the <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
44
- * The name and email address are mandatory fields and must be updated.
45
- * Otherwise an <i>Inx_Api_Recipient_IllegalValueException</i> will be triggered.
46
- * The following snippet shows how to add a new test recipient using an empty <i>TestRecipientRowSet</i>:
47
- *
48
- * <pre>
49
- * $oTestRecipientContext = $oSession->createTestRecipientContext();
50
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
51
- * $oTestRecipientRowSet = $oTestRecipientContext->createRowSet( $oListContext );
52
- * $oAttribute_email = $oSession->createRecipientContext()->getMetaData()->getEmailAttribute();
53
- *
54
- * $oTestRecipientRowSet->moveToInsertRow();
55
- * $oTestRecipientRowSet->updateName( &quot;New recipient&quot; );
56
- * $oTestRecipientRowSet->updateString( $oAttribute_email, &quot;new@recipient.invalid&quot; );
57
- * $oTestRecipientRowSet->commitRowUpdate();
58
- * $oTestRecipientRowSet->close();
59
- * </pre>
60
- *
61
- * Removing a recipient using the <i>TestRecipientRowSet</i> can be accomplished by selecting only one specific test recipient.
62
- * To do so, use a filter expression on the email attribute.
63
- * The following snippet shows how to do this:
64
- *
65
- * <pre>
66
- * $oTestRecipientContext = $oSession->createTestRecipientContext();
67
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
68
- * $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext, null, 'Column(&quot;email&quot;) = &quot;abusive@recipient.invalid&quot;' );
69
- *
70
- * $oTestRecipientRowSet->next();
71
- * $oTestRecipientRowSet->deleteRow();
72
- * $oTestRecipientRowSet->close();
73
- * </pre>
74
- * <p>
75
- * Test recipient attribute values can be updated using the
76
- * <i>Inx_Api_Testprofiles_TestRecipientRowSet::setAttributeValue($oAttribute, $oValue)</i> method.
77
- * The test recipient creation example further above used this method to update the email address of the newly created test recipient.
78
- * <p>
79
- * <strong>Note:</strong> Getting this context from the session will get a snapshot of the current attributes defined.
80
- * This snapshot will be used for the lifetime of the context, changes in the underlying attribute configuration won't
81
- * be reflected to it.
82
- * This ensures that you can safely work with recipient data, even if other users possibly add or change attributes.
83
- * <p>
84
- * However, if a recipient attribute is deleted or the type is changed, this will also not be reflected to the
85
- * <i>TestRecipientContext</i>.
86
- * The attribute values may still be changed without any error, though this change will not be visible in Inxmail.
87
- * The recipient attribute will not be undeleted.
88
- * Therefore, it is not recommended to use the same test recipient context during long operations as the possibility
89
- * of changes in the recipient attributes will rise.
90
- * <p>
91
- * <strong>Note:</strong> An <i>Inx_Api_Testprofiles_TestRecipientContext</i> object <strong>must</strong> be closed once it is not
92
- * needed anymore to prevent memory leaks and other potentially harmful side effects.
93
- *
94
- * @see Inx_Api_Testprofiles_TestRecipientRowSet
95
- * @see Inx_Api_Recipient_RecipientContext
96
- * @see Inx_Api_Recipient_RecipientMetaData
97
- * @since API 1.6
98
- * @version $Revision: 9506 $ $Date: 2007-12-20 15:44:56 +0200 (Kt, 20 Grd 2007) $ $Author: vladas $
99
- * @package Inxmail
100
- * @subpackage Testprofiles
101
- */
102
- interface Inx_Api_Testprofiles_TestRecipientContext
103
- {
104
-
105
- /**
106
- * Returns an <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> containing all test recipients that are members of
107
- * the given list and match the given filter and additional filter statement.
108
- * The filter and additional filter statement attributes may be ommitted or <i>null</i>, though the list
109
- * parameter is mandatory.
110
- * <p>
111
- * For further information on the filter statement syntax, see the
112
- * <i>Inx_Api_Filter_Filter::updateStatement($sStatement)</i> documentation.
113
- * <p>
114
- * <strong>Note:</strong> The % sign can not be used as wildcard in the LIKE statements of the* <i>TestRecipientContext</i>.
115
- * If you use a filter which includes the % sign, the filter will only match test recipients which contain the % sign.<br>
116
- * For example the filter statement <i>'Column(&quot;name&quot;) LIKE &quot;s%&quot;'</i> will match test recipients
117
- * whose name is either s% or S% but not, for example, Smith.
118
- *
119
- * @param Inx_Api_List_ListContext $list all members of this list will be selected.
120
- * @param Inx_Api_Filter_Filter $oFilter the selection filter. May be ommitted or <i>null</i>.
121
- * @param string $sAdditionalFilter the additional filter statement. May be ommitted or <i>null</i>.
122
- * @return a <i>TestRecipientRowSet</i> containing all test recipients fetched by the given query.
123
- * @throws Inx_Api_Recipient_SelectException if the selection failed.
124
- */
125
- public function select( Inx_Api_List_ListContext $list=null, Inx_Api_Filter_Filter $oFilter=null, $sAdditionalFilter=null );
126
-
127
-
128
- /**
129
- * Returns an empty <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
130
- * Use this to add new test recipients to the specified list.
131
- *
132
- * @param Inx_Api_List_ListContext $list the list context for which the test recipient should be created.
133
- * @return an empty <i>TestRecipientRowSet</i>.
134
- */
135
- public function createRowSet( Inx_Api_List_ListContext $list );
136
-
137
- /**
138
- * Closes this test recipient context and releases any resources associated with it.
139
- * An <i>Inx_Api_Testprofiles_TestRecipientContext</i> object <strong>must</strong> be closed once it is not
140
- * needed anymore to prevent memory leaks and other potentially harmful side effects.
141
- */
142
- public function close();
143
-
144
- }
145
-
146
- ?>
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Recipient
6
+ */
7
+
8
+ /**
9
+ * The <i>Inx_Api_Testprofiles_TestRecipientContext</i> is used to access and manipulate test recipient data.
10
+ * The following operations can be performed using the <i>Inx_Api_Testprofiles_TestRecipientContext</i>:
11
+ * <p>
12
+ * <ul>
13
+ * <li>Fetch test recipient data as <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>
14
+ * <li>Add and remove test recipients
15
+ * <li>Retrieve and update test recipient attribute values
16
+ * </ul>
17
+ * There are various methods for fetching test recipient data as <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
18
+ * The following snippet exemplary shows how to use one specific <code>select</code> method which retrieves all
19
+ * test recipients of the specified list whose name is equal to smith, ignoring case considerations:
20
+ *
21
+ * <pre>
22
+ * $oTestRecipientContext = $oSession->createTestRecipientContext();
23
+ * $oRecipientContext = $oSession->createRecipientContext();
24
+ * $oAttribute_name = $oRecipientContext->getMetaData()->getUserAttribute( &quot;name&quot; );
25
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
26
+ *
27
+ * $sNameFilter = 'Column(&quot;name&quot;) LIKE &quot;smith&quot;';
28
+ * $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext, null, $sNameFilter );
29
+ *
30
+ * while( $oTestRecipientRowSet->next() )
31
+ * {
32
+ * echo $oTestRecipientRowSet->getString( $oAttribute_name ).&quot;&#60;br&#62;&quot;;
33
+ * }
34
+ *
35
+ * $oTestRecipientRowSet->close();
36
+ * </pre>
37
+ *
38
+ * <strong>Note:</strong> The % sign can not be used as wildcard in the LIKE statements of the <i>TestRecipientContext</i>.
39
+ * If you use a filter which includes the % sign, the filter will only match test recipients which contain the % sign.<br>
40
+ * For example the filter statement <i>&quot;Column(\&quot;name\&quot;) LIKE \&quot;s%\&quot;&quot;</i> will match test
41
+ * recipients whose name is either s% or S% but not, for example, Smith.
42
+ * <p>
43
+ * Adding and removing recipients can be accomplished by using the <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
44
+ * The name and email address are mandatory fields and must be updated.
45
+ * Otherwise an <i>Inx_Api_Recipient_IllegalValueException</i> will be triggered.
46
+ * The following snippet shows how to add a new test recipient using an empty <i>TestRecipientRowSet</i>:
47
+ *
48
+ * <pre>
49
+ * $oTestRecipientContext = $oSession->createTestRecipientContext();
50
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
51
+ * $oTestRecipientRowSet = $oTestRecipientContext->createRowSet( $oListContext );
52
+ * $oAttribute_email = $oSession->createRecipientContext()->getMetaData()->getEmailAttribute();
53
+ *
54
+ * $oTestRecipientRowSet->moveToInsertRow();
55
+ * $oTestRecipientRowSet->updateName( &quot;New recipient&quot; );
56
+ * $oTestRecipientRowSet->updateString( $oAttribute_email, &quot;new@recipient.invalid&quot; );
57
+ * $oTestRecipientRowSet->commitRowUpdate();
58
+ * $oTestRecipientRowSet->close();
59
+ * </pre>
60
+ *
61
+ * Removing a recipient using the <i>TestRecipientRowSet</i> can be accomplished by selecting only one specific test recipient.
62
+ * To do so, use a filter expression on the email attribute.
63
+ * The following snippet shows how to do this:
64
+ *
65
+ * <pre>
66
+ * $oTestRecipientContext = $oSession->createTestRecipientContext();
67
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired list&quot; );
68
+ * $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext, null, 'Column(&quot;email&quot;) = &quot;abusive@recipient.invalid&quot;' );
69
+ *
70
+ * $oTestRecipientRowSet->next();
71
+ * $oTestRecipientRowSet->deleteRow();
72
+ * $oTestRecipientRowSet->close();
73
+ * </pre>
74
+ * <p>
75
+ * Test recipient attribute values can be updated using the
76
+ * <i>Inx_Api_Testprofiles_TestRecipientRowSet::setAttributeValue($oAttribute, $oValue)</i> method.
77
+ * The test recipient creation example further above used this method to update the email address of the newly created test recipient.
78
+ * <p>
79
+ * <strong>Note:</strong> Getting this context from the session will get a snapshot of the current attributes defined.
80
+ * This snapshot will be used for the lifetime of the context, changes in the underlying attribute configuration won't
81
+ * be reflected to it.
82
+ * This ensures that you can safely work with recipient data, even if other users possibly add or change attributes.
83
+ * <p>
84
+ * However, if a recipient attribute is deleted or the type is changed, this will also not be reflected to the
85
+ * <i>TestRecipientContext</i>.
86
+ * The attribute values may still be changed without any error, though this change will not be visible in Inxmail.
87
+ * The recipient attribute will not be undeleted.
88
+ * Therefore, it is not recommended to use the same test recipient context during long operations as the possibility
89
+ * of changes in the recipient attributes will rise.
90
+ * <p>
91
+ * <strong>Note:</strong> An <i>Inx_Api_Testprofiles_TestRecipientContext</i> object <strong>must</strong> be closed once it is not
92
+ * needed anymore to prevent memory leaks and other potentially harmful side effects.
93
+ *
94
+ * @see Inx_Api_Testprofiles_TestRecipientRowSet
95
+ * @see Inx_Api_Recipient_RecipientContext
96
+ * @see Inx_Api_Recipient_RecipientMetaData
97
+ * @since API 1.6
98
+ * @version $Revision: 9506 $ $Date: 2007-12-20 15:44:56 +0200 (Kt, 20 Grd 2007) $ $Author: vladas $
99
+ * @package Inxmail
100
+ * @subpackage Testprofiles
101
+ */
102
+ interface Inx_Api_Testprofiles_TestRecipientContext
103
+ {
104
+
105
+ /**
106
+ * Returns an <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> containing all test recipients that are members of
107
+ * the given list and match the given filter and additional filter statement.
108
+ * The filter and additional filter statement attributes may be ommitted or <i>null</i>, though the list
109
+ * parameter is mandatory.
110
+ * <p>
111
+ * For further information on the filter statement syntax, see the
112
+ * <i>Inx_Api_Filter_Filter::updateStatement($sStatement)</i> documentation.
113
+ * <p>
114
+ * <strong>Note:</strong> The % sign can not be used as wildcard in the LIKE statements of the* <i>TestRecipientContext</i>.
115
+ * If you use a filter which includes the % sign, the filter will only match test recipients which contain the % sign.<br>
116
+ * For example the filter statement <i>'Column(&quot;name&quot;) LIKE &quot;s%&quot;'</i> will match test recipients
117
+ * whose name is either s% or S% but not, for example, Smith.
118
+ *
119
+ * @param Inx_Api_List_ListContext $list all members of this list will be selected.
120
+ * @param Inx_Api_Filter_Filter $oFilter the selection filter. May be ommitted or <i>null</i>.
121
+ * @param string $sAdditionalFilter the additional filter statement. May be ommitted or <i>null</i>.
122
+ * @return a <i>TestRecipientRowSet</i> containing all test recipients fetched by the given query.
123
+ * @throws Inx_Api_Recipient_SelectException if the selection failed.
124
+ */
125
+ public function select( Inx_Api_List_ListContext $list=null, Inx_Api_Filter_Filter $oFilter=null, $sAdditionalFilter=null );
126
+
127
+
128
+ /**
129
+ * Returns an empty <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
130
+ * Use this to add new test recipients to the specified list.
131
+ *
132
+ * @param Inx_Api_List_ListContext $list the list context for which the test recipient should be created.
133
+ * @return an empty <i>TestRecipientRowSet</i>.
134
+ */
135
+ public function createRowSet( Inx_Api_List_ListContext $list );
136
+
137
+ /**
138
+ * Closes this test recipient context and releases any resources associated with it.
139
+ * An <i>Inx_Api_Testprofiles_TestRecipientContext</i> object <strong>must</strong> be closed once it is not
140
+ * needed anymore to prevent memory leaks and other potentially harmful side effects.
141
+ */
142
+ public function close();
143
+
144
+ }
145
+
146
+ ?>
lib/Inx/Api/Testprofiles/TestRecipientRowSet.php CHANGED
@@ -1,524 +1,524 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Testprofiles
6
- */
7
- /**
8
- * An <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> is best explained as a table of data representing a set of test
9
- * recipients, which is usually generated by executing a selection that queries the test recipient context.
10
- * <p>
11
- * Test recipients (or test profiles) can be used to create a personalized preview of a mailing.
12
- * A test recipient object holds the following information:
13
- * <p>
14
- * <ul>
15
- * <li><i>The unique identifier (immutable)</i>: Uniquely identifies a test recipient.
16
- * <li><i>The name / profile description</i>: Describes the test recipient. While this attribute is not required to be
17
- * unique, still it is mandatory.
18
- * <li><i>The email address</i>: Mandatory attribute which can be set using <i>updateString($oAttribute, $sValue)</i>.
19
- * <li><i>Some other recipient attribute values</i>: Probably a test recipients contains other recipient attribute
20
- * values which can be used to personalize a mailing.
21
- * </ul>
22
- * <P>
23
- * A <i>TestRecipientRowSet</i> object maintains a cursor pointing to its current row of data.
24
- * Initially the cursor is positioned before the first row.
25
- * The <i>next()</i> method moves the cursor to the next row (test recipient), and because it returns <i>false</i>
26
- * when there are no more rows in the <i>TestRecipientRowSet</i> object, it can be used in a <i>while</i> loop to
27
- * iterate through the result set.
28
- * <p>
29
- * Be sure to call <i>next()</i> before the first retrieval statement on the row set.
30
- * As stated above, initially the cursor is before the first row, thus no data can be retrieved from the row set before
31
- * calling <i>next()</i>.
32
- * Doing so will trigger an <i>Inx_Api_DataException</i>.
33
- * <P>
34
- * The <i>TestRecipientRowSet</i> interface provides <i>getter</i> methods (<i>getString</i>, <i>getInteger</i>, and so on)
35
- * for retrieving attribute values from the current row.
36
- * Values can be retrieved using the attribute object.
37
- * <p>
38
- * The following snippet shows how to retrieve the email address of all test recipients in the row set, thus also
39
- * illustrating how to iterate over a <i>TestRecipientRowSet</i>:
40
- *
41
- * <pre>
42
- * $oTestRecipientContext = $oSession->createTestRecipientContext();
43
- * $oAttribute_email = $oSession->createRecipientContext()->getMetaData()->getEmailAttribute();
44
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired List&quot; );
45
- * $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext );
46
- *
47
- * while( $oTestRecipientRowSet->next() )
48
- * {
49
- * echo $oTestRecipientRowSet->getString( $oAttribute_email ).&quot;&#60;br&#62;&quot;;
50
- * }
51
- *
52
- * $oTestRecipientRowSet->close();
53
- * </pre>
54
- * <P>
55
- * The update methods may be used in two ways:
56
- * <ol>
57
- * <LI>To update a column value in the current row.
58
- * In a <i>TestRecipientRowSet</i> object, the cursor can be moved backwards and forwards, to an absolute position.
59
- * The following snippet shows how to update the <i>Lastname</i> attribute in the fifth row of the
60
- * <i>TestRecipientRowSet</i> object <i>trrs</i> and then uses the method <i>commitRowUpdate</i> to
61
- * commit the changed data from which <i>trrs</i> was derived:
62
- *
63
- * <PRE>
64
- * $oAttribute = $oRecipientMetaData->getUserAttribute( &quot;Lastname&quot; );
65
- * $oTestRecipientRowSet->setRow( 4 ); // moves the cursor to the fifth row of trrs
66
- * // updates the 'Lastname' attribute of row 4 (fifth row) to be 'Smith'
67
- * $oTestRecipientRowSet->updateString( $oAttribute, &quot;Smith&quot; );
68
- * $oTestRecipientRowSet->commitRowUpdate(); // updates the row in the data source
69
- * </PRE>
70
- * <LI>To insert attribute values into the insert row.
71
- * The <i>TestRecipientRowSet</i> object has a special row associated with it that serves as a staging area for
72
- * building a test recipient to be inserted.
73
- * The following snippet shows how to move the cursor to the insert row and insert the new test recipient
74
- * data into <i>trrs</i> and into the data source table using the method <i>commitRowUpdate</i>:
75
- *
76
- * <PRE>
77
- * $oAttribute_email = $oRecipientMetaData->getEmailAttribute();
78
- * $oAttribute_attr = $oRecipientMetaData->getUserAttribute( &quot;Lastname&quot; );
79
- * $oTestRecipientRowSet->moveToInsertRow(); // moves cursor to the insert row
80
- * // email attribute of the insert row to be smith@gmx.com - mandatory
81
- * $oTestRecipientRowSet->updateString( $oAttribute_email, &quot;smith@gmx.com&quot; );
82
- * // update profile description - mandatory
83
- * $oTestRecipientRowSet->updateName( &quot;Smith&quot; );
84
- * $oTestRecipientRowSet->updateString( $oAttribute_attr, &quot;Smith&quot; );
85
- * $oTestRecipientRowSet->commitRowUpdate(); // insert the row in the data source
86
- * </PRE>
87
- *
88
- * The code above will create a new recipient with the address smith@gmx.com, the name /
89
- * profile description Smith and the last name Smith.
90
- * Usually creating new recipients is accomplished using an empty <i>TestRecipientRowSet</i>.
91
- * Such a row set can be obtained using the <i>Inx_Api_Testprofile_TestRecipientContext::createRowSet($oListContext)</i> method.
92
- * However, the returned row set can only be used to create recipients, as there are no recipients in the row set.
93
- * </ol>
94
- * <p>
95
- * All row changes except for the <i>remove()</i> method require a call of <i>commitRowUpdate()</i> to be reflected on the server.
96
- * Any uncommitted changes will be lost once the <i>TestRecipientRowSet</i> is closed.
97
- * However, calling <i>commitRowUpdate()</i> on deleted rows will trigger an <i>Inx_Api_DataException</i>, as the recipient
98
- * in the current row no longer exists.
99
- * <p>
100
- * Note: To safely abandon all changes of the current row, use the <i>rollbackRowUpdate()</i> method.
101
- * This will prevent any changes to the current row from being committed through <i>commitRowUpdate()</i>.
102
- * Be aware that <i>rollbackRowUpdate</i> will only undo <i>uncommitted</i> changes to the current row.
103
- * So, once you called <i>commitRowUpdate()</i> there is "no way back".
104
- * <p>
105
- * <strong>Note:</strong> An <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> object <strong>must</strong> be closed once it is not
106
- * needed anymore to prevent memory leaks and other potentially harmful side effects.
107
- * <p>
108
- * For more information about the retrieval of test recipients, see the <i>Inx_Api_Testprofile_TestRecipientContext</i> documentation.
109
- *
110
- * @see Inx_Api_Testprofiles_TestRecipientContext
111
- * @since API 1.6.0
112
- * @version $Revision: 2934 $ $Date: 2005-07-04 17:00:09 +0200 (Mo, 04 Jul 2005) $ $Author: bgn $
113
- */
114
- interface Inx_Api_Testprofiles_TestRecipientRowSet
115
- {
116
-
117
- /**
118
- * Moves the cursor to the front of this <i>TestRecipientRowSet</i> object, just before the first row.
119
- * This method has no effect if the result set contains no rows.
120
- */
121
- public function beforeFirstRow();
122
-
123
-
124
- /**
125
- * Moves the cursor to the end of this <i>TestRecipientRowSet</i> object, just after the last row.
126
- * This method has no effect if the result set contains no rows.
127
- */
128
- public function afterLastRow();
129
-
130
-
131
- /**
132
- * Moves the cursor to the given row number in this <i>TestRecipientRowSet</i> object.
133
- * The first row is row 0, the second is row 1, and so on.
134
- *
135
- * @param int $row the number of the row to which the cursor should move.
136
- */
137
- public function setRow( $row );
138
-
139
-
140
- /**
141
- * Retrieves the current row number.
142
- * The first row is number 0, the second number 1, and so on.
143
- *
144
- * @return int the current row number.
145
- */
146
- public function getRow();
147
-
148
-
149
- /**
150
- * Moves the cursor down one row from its current position.
151
- * A <i>TestRecipientRowSet</i> cursor is initially positioned before the first row;
152
- * the first call to the method <i>next</i> makes the first row the current row;
153
- * the second call makes the second row the current row, and so on.
154
- *
155
- * @return bool <i>true</i> if the new current row is valid, <i>false</i> if there are no more rows.
156
- */
157
- public function next();
158
-
159
-
160
- /**
161
- * Moves the cursor to the previous row in this <i>TestRecipientRowSet</i> object.
162
- *
163
- * @return bool <i>true</i> if the cursor is on a valid row, <i>false</i> if it is off the row set.
164
- */
165
- public function previous();
166
-
167
-
168
- /**
169
- * Returns the number of rows in this <i>TestRecipientRowSet</i> object.
170
- *
171
- * @return int the number of rows.
172
- */
173
- public function getRowCount();
174
-
175
-
176
- /**
177
- * Updates the underlying recipient on the server with the new contents of the current row of this
178
- * <i>TestRecipientRowSet</i> object.
179
- *
180
- * @throws Inx_Api_Recipient_IllegalValueException if one of the attribute values is invalid or missing.
181
- * @throws Inx_Api_Recipient_DuplicateKeyException if the key value is already used.
182
- * @throws Inx_Api_DataException if the recipient was deleted or no test recipient is selected (e.g. you forgot
183
- * to call <i>next()</i>).
184
- */
185
- public function commitRowUpdate() ;
186
-
187
-
188
- /**
189
- * Reverts the updates made to the current row in this <i>TestRecipientRowSet</i> object.
190
- * This method may be called after calling one or several update methods to roll back the updates made to a row.
191
- * If no updates have been made or <i>commitRowUpdate</i> has already been called, this method has no effect.
192
- */
193
- public function rollbackRowUpdate();
194
-
195
-
196
- /**
197
- * Deletes the current row from this <i>TestRecipientRowSet</i> object.
198
- * This method cannot be called when the cursor is on the insert row.
199
- * Do <strong>not</strong> call <i>commitRowUpdate()</i> after invoking this method, as this would trigger an
200
- * <i>Inx_Api_DataException</i>.
201
- */
202
- public function deleteRow();
203
-
204
-
205
- /**
206
- * Deletes the specified rows from this <i>TestRecipientRowSet</i> object.
207
- * Do <strong>not</strong> call <i>commitRowUpdate()</i> on an affected row after invoking this method, as this
208
- * would trigger an <i>Inx_Api_DataException</i>.
209
- *
210
- * @param Inx_Api_IndexSelection $selection the rows to be deleted.
211
- */
212
- public function deleteRows( Inx_Api_IndexSelection $selection );
213
-
214
-
215
- /**
216
- * Moves the cursor to the insert row.
217
- * The current cursor position is remembered while the cursor is positioned on the insert row.
218
- * The insert row is a special row associated with a <i>TestRecipientRowSet</i>.
219
- * It is essentially a buffer where a new row may be constructed by calling the update methods prior to inserting
220
- * the row into the row set.
221
- * Only the update, getter, and <i>commitRowUpdate</i> method may be called when the cursor is on the insert row.
222
- */
223
- public function moveToInsertRow();
224
-
225
-
226
- /**
227
- * Reports whether the underlying test recipient is deleted or not.
228
- *
229
- * @return bool <i>true</i> if the underlying test recipient is deleted, <i>false</i> otherwise.
230
- */
231
- public function isRowDeleted();
232
-
233
-
234
- /**
235
- * Retrieves the test recipient id of the current row of this <i>TestRecipientRowSet</i> object.
236
- *
237
- * @return int the id of the current test recipient.
238
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
239
- * forgot to call <i>next()</i>).
240
- */
241
- public function getId();
242
-
243
-
244
- /**
245
- * Retrieves the name/profile description of the test recipient in the current row of this
246
- * <i>TestRecipientRowSet</i> object.
247
- *
248
- * @return string the name of the test recipient.
249
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
250
- * forgot to call <i>next()</i>).
251
- */
252
- public function getName();
253
-
254
-
255
- /**
256
- * Updates the name/profile description of the test recipient in the current row of this
257
- * <i>TestRecipientRowSet</i> object.
258
- *
259
- * @param string $sName the name of the test recipient profile.
260
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
261
- * forgot to call <i>next()</i>).
262
- */
263
- public function updateName( $sName );
264
-
265
-
266
- /**
267
- * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
268
- * object as a <i>string</i>.
269
- *
270
- * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
271
- * @return string the attribute value as string.
272
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
273
- * forgot to call <i>next()</i>).
274
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>string</i>.
275
- */
276
- public function getString( Inx_Api_Recipient_Attribute $oAttr );
277
-
278
-
279
- /**
280
- * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
281
- * object as a <i>bool</i>.
282
- *
283
- * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
284
- * @return bool the attribute value as bool.
285
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
286
- * forgot to call <i>next()</i>).
287
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>bool</i>.
288
- */
289
- public function getBoolean( Inx_Api_Recipient_Attribute $oAttr );
290
-
291
-
292
- /**
293
- * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
294
- * object as an <i>integer</i>.
295
- *
296
- * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
297
- * @return int the attribute value as integer.
298
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
299
- * forgot to call <i>next()</i>).
300
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>integer</i>.
301
- */
302
- public function getInteger( Inx_Api_Recipient_Attribute $oAttr );
303
-
304
-
305
- /**
306
- * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
307
- * object as a <i>float</i>.
308
- *
309
- * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
310
- * @return float the attribute value as float.
311
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
312
- * forgot to call <i>next()</i>).
313
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>float</i>.
314
- */
315
- public function getDouble( Inx_Api_Recipient_Attribute $oAttr );
316
-
317
-
318
- /**
319
- * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
320
- * object as a <i>date</i>.
321
- *
322
- * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
323
- * @return string the date value as ISO 8601 formatted date string.
324
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
325
- * forgot to call <i>next()</i>).
326
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>date</i>.
327
- */
328
- public function getDate( Inx_Api_Recipient_Attribute $oAttr );
329
-
330
-
331
- /**
332
- * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
333
- * object as a <i>time</i>.
334
- *
335
- * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
336
- * @return string the time value as ISO 8601 formatted time string.
337
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
338
- * forgot to call <i>next()</i>).
339
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>time</i>.
340
- */
341
- public function getTime( Inx_Api_Recipient_Attribute $oAttr );
342
-
343
-
344
- /**
345
- * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
346
- * object as a <i>datetime</i>.
347
- *
348
- * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
349
- * @return string the datetime value as ISO 8601 formatted datetime string.
350
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
351
- * forgot to call <i>next()</i>).
352
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>datetime</i>.
353
- */
354
- public function getDatetime( Inx_Api_Recipient_Attribute $oAttr );
355
-
356
-
357
- /**
358
- * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
359
- * object.
360
- *
361
- * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
362
- * @return mixed the attribute value.
363
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
364
- * forgot to call <i>next()</i>).
365
- */
366
- public function getObject( Inx_Api_Recipient_Attribute $attr ) ;
367
-
368
-
369
- /**
370
- * Updates the designated attribute with a <i>string</i> value.
371
- * The update methods are used to update attribute values in the current row or the insert row.
372
- * The update methods do not update the underlying recipient on the server;
373
- * instead the <i>commitRowUpdate</i> method is called to commit the changes.
374
- *
375
- * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
376
- * @param string $sValue the new attribute value.
377
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
378
- * forgot to call <i>next()</i>).
379
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>string</i>.
380
- */
381
- public function updateString( Inx_Api_Recipient_Attribute $oAttr, $sValue );
382
-
383
-
384
- /**
385
- * Updates the designated attribute with a <i>bool</i> value.
386
- * The update methods are used to update attribute values in the current row or the insert row.
387
- * The update methods do not update the underlying recipient on the server;
388
- * instead the <i>commitRowUpdate</i> method is called to commit the changes.
389
- *
390
- * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
391
- * @param bool $blValue the new attribute value.
392
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
393
- * forgot to call <i>next()</i>).
394
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>bool</i>.
395
- */
396
- public function updateBoolean( Inx_Api_Recipient_Attribute $oAttr, $blValue ) ;
397
-
398
-
399
- /**
400
- * Updates the designated attribute with an <i>integer</i> value.
401
- * The update methods are used to update attribute values in the current row or the insert row.
402
- * The update methods do not update the underlying recipient on the server;
403
- * instead the <i>commitRowUpdate</i> method is called to commit the changes.
404
- *
405
- * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
406
- * @param int $iValue the new attribute value.
407
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
408
- * forgot to call <i>next()</i>).
409
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>integer</i>.
410
- */
411
- public function updateInteger( Inx_Api_Recipient_Attribute $oAttr, $iValue );
412
-
413
-
414
- /**
415
- * Updates the designated attribute with a <i>float</i> value.
416
- * The update methods are used to update attribute values in the current row or the insert row.
417
- * The update methods do not update the underlying recipient on the server;
418
- * instead the <i>commitRowUpdate</i> method is called to commit the changes.
419
- *
420
- * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
421
- * @param float $iValue the new attribute value.
422
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
423
- * forgot to call <i>next()</i>).
424
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>float</i>.
425
- */
426
- public function updateDouble( Inx_Api_Recipient_Attribute $oAttr, $iValue );
427
-
428
-
429
- /**
430
- * Updates the designated attribute with a <i>float</i> value.
431
- * The value has to be passed either as a <i>Unix-Timestamp</i> or an ISO 8601 formatted date string.
432
- * To format the value correctly, use one of the following methods:
433
- * <ul>
434
- * <li><i>ISO-8601</i>: <pre>$sDate = date("Y-m-d");</pre>
435
- * <li><i>Unix-Timestamp</i>: <pre>$iTimestamp = time();</pre>
436
- * </ul>
437
- * The update methods are used to update attribute values in the current row or the insert row.
438
- * The update methods do not update the underlying recipient on the server;
439
- * instead the <i>commitRowUpdate</i> method is called to commit the changes.
440
- *
441
- * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
442
- * @param string $dValue the new attribute value.
443
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
444
- * forgot to call <i>next()</i>).
445
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>date</i>.
446
- */
447
- public function updateDate( Inx_Api_Recipient_Attribute $oAttr, $dValue );
448
-
449
-
450
- /**
451
- * Updates the designated attribute with a <i>time</i> value.
452
- * The value has to be passed either as a <i>Unix-Timestamp</i> or an ISO 8601 formatted time string.
453
- * To format the value correctly, use one of the following methods:
454
- * <ul>
455
- * <li><i>ISO-8601</i>: <pre>$sTime = date("H:i:sP");</pre>
456
- * <li><i>Unix-Timestamp</i>: <pre>$iTimestamp = time();</pre>
457
- * </ul>
458
- * The update methods are used to update attribute values in the current row or the insert row.
459
- * The update methods do not update the underlying recipient on the server;
460
- * instead the <i>commitRowUpdate</i> method is called to commit the changes.
461
- *
462
- * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
463
- * @param string $tValue the new attribute value.
464
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
465
- * forgot to call <i>next()</i>).
466
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>time</i>.
467
- */
468
- public function updateTime( Inx_Api_Recipient_Attribute $oAttr, $tValue );
469
-
470
-
471
- /**
472
- * Updates the designated attribute with a <i>datetime</i> value.
473
- * The value has to be passed either as a <i>Unix-Timestamp</i> or an ISO 8601 formatted datetime string.
474
- * To format the value correctly, use one of the following methods:
475
- * <ul>
476
- * <li><i>ISO-8601</i>: <pre>$sDatetime = date('c');</pre>
477
- * <li><i>Unix-Timestamp</i>: <pre>$iTimestamp = time();</pre>
478
- * </ul>
479
- * The update methods are used to update attribute values in the current row or the insert row.
480
- * The update methods do not update the underlying recipient on the server;
481
- * instead the <i>commitRowUpdate</i> method is called to commit the changes.
482
- *
483
- * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
484
- * @param string $dtValue the new attribute value.
485
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
486
- * forgot to call <i>next()</i>).
487
- * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>datetime</i>.
488
- */
489
- public function updateDatetime( Inx_Api_Recipient_Attribute $oAttr, $dtValue );
490
-
491
-
492
- /**
493
- * Updates the designated attribute with a new value.
494
- * Most string values can be converted regardless of their content.
495
- * The string "test" can, for example, be converted to a boolean and will return true.
496
- * However, this is not true for attributes of type date, time or datetime.
497
- * These values have to be passed either as a <i>Unix-Timestamp</i> or an ISO 8601 formatted date, time or datetime string.
498
- * To format the value correctly, use one of the following methods, according to the datatype of the attribute:
499
- * <ul>
500
- * <li><i>Date</i>: <pre>$sDate = date("Y-m-d");</pre>
501
- * <li><i>Time</i>: <pre>$sTime = date("H:i:sP");</pre>
502
- * <li><i>Datetime</i>: <pre>$sDatetime = date('c');</pre>
503
- * <li><i>Unix-Timestamp (works for all)</i>: <pre>$iTimestamp = time();</pre>
504
- * </ul>
505
- * The update methods are used to update attribute values in the current row or the insert row.
506
- * The update methods do not update the underlying recipient on the server;
507
- * instead the <i>commitRowUpdate</i> method is called to commit the changes.
508
- *
509
- * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
510
- * @param string|mixed $oValue the new attribute value.
511
- * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
512
- * forgot to call <i>next()</i>).
513
- */
514
- public function updateObject( Inx_Api_Recipient_Attribute $oAttr, $oValue );
515
-
516
-
517
- /**
518
- * Releases the resources associated with this <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> object on the server immediately.
519
- * <p>
520
- * An <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> object <strong>must</strong> be closed once it is not
521
- * needed anymore to prevent memory leaks and other potentially harmful side effects.
522
- */
523
- public function close();
524
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Testprofiles
6
+ */
7
+ /**
8
+ * An <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> is best explained as a table of data representing a set of test
9
+ * recipients, which is usually generated by executing a selection that queries the test recipient context.
10
+ * <p>
11
+ * Test recipients (or test profiles) can be used to create a personalized preview of a mailing.
12
+ * A test recipient object holds the following information:
13
+ * <p>
14
+ * <ul>
15
+ * <li><i>The unique identifier (immutable)</i>: Uniquely identifies a test recipient.
16
+ * <li><i>The name / profile description</i>: Describes the test recipient. While this attribute is not required to be
17
+ * unique, still it is mandatory.
18
+ * <li><i>The email address</i>: Mandatory attribute which can be set using <i>updateString($oAttribute, $sValue)</i>.
19
+ * <li><i>Some other recipient attribute values</i>: Probably a test recipients contains other recipient attribute
20
+ * values which can be used to personalize a mailing.
21
+ * </ul>
22
+ * <P>
23
+ * A <i>TestRecipientRowSet</i> object maintains a cursor pointing to its current row of data.
24
+ * Initially the cursor is positioned before the first row.
25
+ * The <i>next()</i> method moves the cursor to the next row (test recipient), and because it returns <i>false</i>
26
+ * when there are no more rows in the <i>TestRecipientRowSet</i> object, it can be used in a <i>while</i> loop to
27
+ * iterate through the result set.
28
+ * <p>
29
+ * Be sure to call <i>next()</i> before the first retrieval statement on the row set.
30
+ * As stated above, initially the cursor is before the first row, thus no data can be retrieved from the row set before
31
+ * calling <i>next()</i>.
32
+ * Doing so will trigger an <i>Inx_Api_DataException</i>.
33
+ * <P>
34
+ * The <i>TestRecipientRowSet</i> interface provides <i>getter</i> methods (<i>getString</i>, <i>getInteger</i>, and so on)
35
+ * for retrieving attribute values from the current row.
36
+ * Values can be retrieved using the attribute object.
37
+ * <p>
38
+ * The following snippet shows how to retrieve the email address of all test recipients in the row set, thus also
39
+ * illustrating how to iterate over a <i>TestRecipientRowSet</i>:
40
+ *
41
+ * <pre>
42
+ * $oTestRecipientContext = $oSession->createTestRecipientContext();
43
+ * $oAttribute_email = $oSession->createRecipientContext()->getMetaData()->getEmailAttribute();
44
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired List&quot; );
45
+ * $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext );
46
+ *
47
+ * while( $oTestRecipientRowSet->next() )
48
+ * {
49
+ * echo $oTestRecipientRowSet->getString( $oAttribute_email ).&quot;&#60;br&#62;&quot;;
50
+ * }
51
+ *
52
+ * $oTestRecipientRowSet->close();
53
+ * </pre>
54
+ * <P>
55
+ * The update methods may be used in two ways:
56
+ * <ol>
57
+ * <LI>To update a column value in the current row.
58
+ * In a <i>TestRecipientRowSet</i> object, the cursor can be moved backwards and forwards, to an absolute position.
59
+ * The following snippet shows how to update the <i>Lastname</i> attribute in the fifth row of the
60
+ * <i>TestRecipientRowSet</i> object <i>trrs</i> and then uses the method <i>commitRowUpdate</i> to
61
+ * commit the changed data from which <i>trrs</i> was derived:
62
+ *
63
+ * <PRE>
64
+ * $oAttribute = $oRecipientMetaData->getUserAttribute( &quot;Lastname&quot; );
65
+ * $oTestRecipientRowSet->setRow( 4 ); // moves the cursor to the fifth row of trrs
66
+ * // updates the 'Lastname' attribute of row 4 (fifth row) to be 'Smith'
67
+ * $oTestRecipientRowSet->updateString( $oAttribute, &quot;Smith&quot; );
68
+ * $oTestRecipientRowSet->commitRowUpdate(); // updates the row in the data source
69
+ * </PRE>
70
+ * <LI>To insert attribute values into the insert row.
71
+ * The <i>TestRecipientRowSet</i> object has a special row associated with it that serves as a staging area for
72
+ * building a test recipient to be inserted.
73
+ * The following snippet shows how to move the cursor to the insert row and insert the new test recipient
74
+ * data into <i>trrs</i> and into the data source table using the method <i>commitRowUpdate</i>:
75
+ *
76
+ * <PRE>
77
+ * $oAttribute_email = $oRecipientMetaData->getEmailAttribute();
78
+ * $oAttribute_attr = $oRecipientMetaData->getUserAttribute( &quot;Lastname&quot; );
79
+ * $oTestRecipientRowSet->moveToInsertRow(); // moves cursor to the insert row
80
+ * // email attribute of the insert row to be smith@gmx.com - mandatory
81
+ * $oTestRecipientRowSet->updateString( $oAttribute_email, &quot;smith@gmx.com&quot; );
82
+ * // update profile description - mandatory
83
+ * $oTestRecipientRowSet->updateName( &quot;Smith&quot; );
84
+ * $oTestRecipientRowSet->updateString( $oAttribute_attr, &quot;Smith&quot; );
85
+ * $oTestRecipientRowSet->commitRowUpdate(); // insert the row in the data source
86
+ * </PRE>
87
+ *
88
+ * The code above will create a new recipient with the address smith@gmx.com, the name /
89
+ * profile description Smith and the last name Smith.
90
+ * Usually creating new recipients is accomplished using an empty <i>TestRecipientRowSet</i>.
91
+ * Such a row set can be obtained using the <i>Inx_Api_Testprofile_TestRecipientContext::createRowSet($oListContext)</i> method.
92
+ * However, the returned row set can only be used to create recipients, as there are no recipients in the row set.
93
+ * </ol>
94
+ * <p>
95
+ * All row changes except for the <i>remove()</i> method require a call of <i>commitRowUpdate()</i> to be reflected on the server.
96
+ * Any uncommitted changes will be lost once the <i>TestRecipientRowSet</i> is closed.
97
+ * However, calling <i>commitRowUpdate()</i> on deleted rows will trigger an <i>Inx_Api_DataException</i>, as the recipient
98
+ * in the current row no longer exists.
99
+ * <p>
100
+ * Note: To safely abandon all changes of the current row, use the <i>rollbackRowUpdate()</i> method.
101
+ * This will prevent any changes to the current row from being committed through <i>commitRowUpdate()</i>.
102
+ * Be aware that <i>rollbackRowUpdate</i> will only undo <i>uncommitted</i> changes to the current row.
103
+ * So, once you called <i>commitRowUpdate()</i> there is "no way back".
104
+ * <p>
105
+ * <strong>Note:</strong> An <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> object <strong>must</strong> be closed once it is not
106
+ * needed anymore to prevent memory leaks and other potentially harmful side effects.
107
+ * <p>
108
+ * For more information about the retrieval of test recipients, see the <i>Inx_Api_Testprofile_TestRecipientContext</i> documentation.
109
+ *
110
+ * @see Inx_Api_Testprofiles_TestRecipientContext
111
+ * @since API 1.6.0
112
+ * @version $Revision: 2934 $ $Date: 2005-07-04 17:00:09 +0200 (Mo, 04 Jul 2005) $ $Author: bgn $
113
+ */
114
+ interface Inx_Api_Testprofiles_TestRecipientRowSet
115
+ {
116
+
117
+ /**
118
+ * Moves the cursor to the front of this <i>TestRecipientRowSet</i> object, just before the first row.
119
+ * This method has no effect if the result set contains no rows.
120
+ */
121
+ public function beforeFirstRow();
122
+
123
+
124
+ /**
125
+ * Moves the cursor to the end of this <i>TestRecipientRowSet</i> object, just after the last row.
126
+ * This method has no effect if the result set contains no rows.
127
+ */
128
+ public function afterLastRow();
129
+
130
+
131
+ /**
132
+ * Moves the cursor to the given row number in this <i>TestRecipientRowSet</i> object.
133
+ * The first row is row 0, the second is row 1, and so on.
134
+ *
135
+ * @param int $row the number of the row to which the cursor should move.
136
+ */
137
+ public function setRow( $row );
138
+
139
+
140
+ /**
141
+ * Retrieves the current row number.
142
+ * The first row is number 0, the second number 1, and so on.
143
+ *
144
+ * @return int the current row number.
145
+ */
146
+ public function getRow();
147
+
148
+
149
+ /**
150
+ * Moves the cursor down one row from its current position.
151
+ * A <i>TestRecipientRowSet</i> cursor is initially positioned before the first row;
152
+ * the first call to the method <i>next</i> makes the first row the current row;
153
+ * the second call makes the second row the current row, and so on.
154
+ *
155
+ * @return bool <i>true</i> if the new current row is valid, <i>false</i> if there are no more rows.
156
+ */
157
+ public function next();
158
+
159
+
160
+ /**
161
+ * Moves the cursor to the previous row in this <i>TestRecipientRowSet</i> object.
162
+ *
163
+ * @return bool <i>true</i> if the cursor is on a valid row, <i>false</i> if it is off the row set.
164
+ */
165
+ public function previous();
166
+
167
+
168
+ /**
169
+ * Returns the number of rows in this <i>TestRecipientRowSet</i> object.
170
+ *
171
+ * @return int the number of rows.
172
+ */
173
+ public function getRowCount();
174
+
175
+
176
+ /**
177
+ * Updates the underlying recipient on the server with the new contents of the current row of this
178
+ * <i>TestRecipientRowSet</i> object.
179
+ *
180
+ * @throws Inx_Api_Recipient_IllegalValueException if one of the attribute values is invalid or missing.
181
+ * @throws Inx_Api_Recipient_DuplicateKeyException if the key value is already used.
182
+ * @throws Inx_Api_DataException if the recipient was deleted or no test recipient is selected (e.g. you forgot
183
+ * to call <i>next()</i>).
184
+ */
185
+ public function commitRowUpdate() ;
186
+
187
+
188
+ /**
189
+ * Reverts the updates made to the current row in this <i>TestRecipientRowSet</i> object.
190
+ * This method may be called after calling one or several update methods to roll back the updates made to a row.
191
+ * If no updates have been made or <i>commitRowUpdate</i> has already been called, this method has no effect.
192
+ */
193
+ public function rollbackRowUpdate();
194
+
195
+
196
+ /**
197
+ * Deletes the current row from this <i>TestRecipientRowSet</i> object.
198
+ * This method cannot be called when the cursor is on the insert row.
199
+ * Do <strong>not</strong> call <i>commitRowUpdate()</i> after invoking this method, as this would trigger an
200
+ * <i>Inx_Api_DataException</i>.
201
+ */
202
+ public function deleteRow();
203
+
204
+
205
+ /**
206
+ * Deletes the specified rows from this <i>TestRecipientRowSet</i> object.
207
+ * Do <strong>not</strong> call <i>commitRowUpdate()</i> on an affected row after invoking this method, as this
208
+ * would trigger an <i>Inx_Api_DataException</i>.
209
+ *
210
+ * @param Inx_Api_IndexSelection $selection the rows to be deleted.
211
+ */
212
+ public function deleteRows( Inx_Api_IndexSelection $selection );
213
+
214
+
215
+ /**
216
+ * Moves the cursor to the insert row.
217
+ * The current cursor position is remembered while the cursor is positioned on the insert row.
218
+ * The insert row is a special row associated with a <i>TestRecipientRowSet</i>.
219
+ * It is essentially a buffer where a new row may be constructed by calling the update methods prior to inserting
220
+ * the row into the row set.
221
+ * Only the update, getter, and <i>commitRowUpdate</i> method may be called when the cursor is on the insert row.
222
+ */
223
+ public function moveToInsertRow();
224
+
225
+
226
+ /**
227
+ * Reports whether the underlying test recipient is deleted or not.
228
+ *
229
+ * @return bool <i>true</i> if the underlying test recipient is deleted, <i>false</i> otherwise.
230
+ */
231
+ public function isRowDeleted();
232
+
233
+
234
+ /**
235
+ * Retrieves the test recipient id of the current row of this <i>TestRecipientRowSet</i> object.
236
+ *
237
+ * @return int the id of the current test recipient.
238
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
239
+ * forgot to call <i>next()</i>).
240
+ */
241
+ public function getId();
242
+
243
+
244
+ /**
245
+ * Retrieves the name/profile description of the test recipient in the current row of this
246
+ * <i>TestRecipientRowSet</i> object.
247
+ *
248
+ * @return string the name of the test recipient.
249
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
250
+ * forgot to call <i>next()</i>).
251
+ */
252
+ public function getName();
253
+
254
+
255
+ /**
256
+ * Updates the name/profile description of the test recipient in the current row of this
257
+ * <i>TestRecipientRowSet</i> object.
258
+ *
259
+ * @param string $sName the name of the test recipient profile.
260
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
261
+ * forgot to call <i>next()</i>).
262
+ */
263
+ public function updateName( $sName );
264
+
265
+
266
+ /**
267
+ * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
268
+ * object as a <i>string</i>.
269
+ *
270
+ * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
271
+ * @return string the attribute value as string.
272
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
273
+ * forgot to call <i>next()</i>).
274
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>string</i>.
275
+ */
276
+ public function getString( Inx_Api_Recipient_Attribute $oAttr );
277
+
278
+
279
+ /**
280
+ * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
281
+ * object as a <i>bool</i>.
282
+ *
283
+ * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
284
+ * @return bool the attribute value as bool.
285
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
286
+ * forgot to call <i>next()</i>).
287
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>bool</i>.
288
+ */
289
+ public function getBoolean( Inx_Api_Recipient_Attribute $oAttr );
290
+
291
+
292
+ /**
293
+ * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
294
+ * object as an <i>integer</i>.
295
+ *
296
+ * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
297
+ * @return int the attribute value as integer.
298
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
299
+ * forgot to call <i>next()</i>).
300
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>integer</i>.
301
+ */
302
+ public function getInteger( Inx_Api_Recipient_Attribute $oAttr );
303
+
304
+
305
+ /**
306
+ * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
307
+ * object as a <i>float</i>.
308
+ *
309
+ * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
310
+ * @return float the attribute value as float.
311
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
312
+ * forgot to call <i>next()</i>).
313
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>float</i>.
314
+ */
315
+ public function getDouble( Inx_Api_Recipient_Attribute $oAttr );
316
+
317
+
318
+ /**
319
+ * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
320
+ * object as a <i>date</i>.
321
+ *
322
+ * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
323
+ * @return string the date value as ISO 8601 formatted date string.
324
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
325
+ * forgot to call <i>next()</i>).
326
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>date</i>.
327
+ */
328
+ public function getDate( Inx_Api_Recipient_Attribute $oAttr );
329
+
330
+
331
+ /**
332
+ * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
333
+ * object as a <i>time</i>.
334
+ *
335
+ * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
336
+ * @return string the time value as ISO 8601 formatted time string.
337
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
338
+ * forgot to call <i>next()</i>).
339
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>time</i>.
340
+ */
341
+ public function getTime( Inx_Api_Recipient_Attribute $oAttr );
342
+
343
+
344
+ /**
345
+ * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
346
+ * object as a <i>datetime</i>.
347
+ *
348
+ * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
349
+ * @return string the datetime value as ISO 8601 formatted datetime string.
350
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
351
+ * forgot to call <i>next()</i>).
352
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>datetime</i>.
353
+ */
354
+ public function getDatetime( Inx_Api_Recipient_Attribute $oAttr );
355
+
356
+
357
+ /**
358
+ * Retrieves the value of the designated attribute in the current row of this <i>TestRecipientRowSet</i>
359
+ * object.
360
+ *
361
+ * @param Inx_Api_Recipient_Attribute $oAttr the designated attribute.
362
+ * @return mixed the attribute value.
363
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
364
+ * forgot to call <i>next()</i>).
365
+ */
366
+ public function getObject( Inx_Api_Recipient_Attribute $attr ) ;
367
+
368
+
369
+ /**
370
+ * Updates the designated attribute with a <i>string</i> value.
371
+ * The update methods are used to update attribute values in the current row or the insert row.
372
+ * The update methods do not update the underlying recipient on the server;
373
+ * instead the <i>commitRowUpdate</i> method is called to commit the changes.
374
+ *
375
+ * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
376
+ * @param string $sValue the new attribute value.
377
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
378
+ * forgot to call <i>next()</i>).
379
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>string</i>.
380
+ */
381
+ public function updateString( Inx_Api_Recipient_Attribute $oAttr, $sValue );
382
+
383
+
384
+ /**
385
+ * Updates the designated attribute with a <i>bool</i> value.
386
+ * The update methods are used to update attribute values in the current row or the insert row.
387
+ * The update methods do not update the underlying recipient on the server;
388
+ * instead the <i>commitRowUpdate</i> method is called to commit the changes.
389
+ *
390
+ * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
391
+ * @param bool $blValue the new attribute value.
392
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
393
+ * forgot to call <i>next()</i>).
394
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>bool</i>.
395
+ */
396
+ public function updateBoolean( Inx_Api_Recipient_Attribute $oAttr, $blValue ) ;
397
+
398
+
399
+ /**
400
+ * Updates the designated attribute with an <i>integer</i> value.
401
+ * The update methods are used to update attribute values in the current row or the insert row.
402
+ * The update methods do not update the underlying recipient on the server;
403
+ * instead the <i>commitRowUpdate</i> method is called to commit the changes.
404
+ *
405
+ * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
406
+ * @param int $iValue the new attribute value.
407
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
408
+ * forgot to call <i>next()</i>).
409
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>integer</i>.
410
+ */
411
+ public function updateInteger( Inx_Api_Recipient_Attribute $oAttr, $iValue );
412
+
413
+
414
+ /**
415
+ * Updates the designated attribute with a <i>float</i> value.
416
+ * The update methods are used to update attribute values in the current row or the insert row.
417
+ * The update methods do not update the underlying recipient on the server;
418
+ * instead the <i>commitRowUpdate</i> method is called to commit the changes.
419
+ *
420
+ * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
421
+ * @param float $iValue the new attribute value.
422
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
423
+ * forgot to call <i>next()</i>).
424
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>float</i>.
425
+ */
426
+ public function updateDouble( Inx_Api_Recipient_Attribute $oAttr, $iValue );
427
+
428
+
429
+ /**
430
+ * Updates the designated attribute with a <i>float</i> value.
431
+ * The value has to be passed either as a <i>Unix-Timestamp</i> or an ISO 8601 formatted date string.
432
+ * To format the value correctly, use one of the following methods:
433
+ * <ul>
434
+ * <li><i>ISO-8601</i>: <pre>$sDate = date("Y-m-d");</pre>
435
+ * <li><i>Unix-Timestamp</i>: <pre>$iTimestamp = time();</pre>
436
+ * </ul>
437
+ * The update methods are used to update attribute values in the current row or the insert row.
438
+ * The update methods do not update the underlying recipient on the server;
439
+ * instead the <i>commitRowUpdate</i> method is called to commit the changes.
440
+ *
441
+ * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
442
+ * @param string $dValue the new attribute value.
443
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
444
+ * forgot to call <i>next()</i>).
445
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>date</i>.
446
+ */
447
+ public function updateDate( Inx_Api_Recipient_Attribute $oAttr, $dValue );
448
+
449
+
450
+ /**
451
+ * Updates the designated attribute with a <i>time</i> value.
452
+ * The value has to be passed either as a <i>Unix-Timestamp</i> or an ISO 8601 formatted time string.
453
+ * To format the value correctly, use one of the following methods:
454
+ * <ul>
455
+ * <li><i>ISO-8601</i>: <pre>$sTime = date("H:i:sP");</pre>
456
+ * <li><i>Unix-Timestamp</i>: <pre>$iTimestamp = time();</pre>
457
+ * </ul>
458
+ * The update methods are used to update attribute values in the current row or the insert row.
459
+ * The update methods do not update the underlying recipient on the server;
460
+ * instead the <i>commitRowUpdate</i> method is called to commit the changes.
461
+ *
462
+ * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
463
+ * @param string $tValue the new attribute value.
464
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
465
+ * forgot to call <i>next()</i>).
466
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>time</i>.
467
+ */
468
+ public function updateTime( Inx_Api_Recipient_Attribute $oAttr, $tValue );
469
+
470
+
471
+ /**
472
+ * Updates the designated attribute with a <i>datetime</i> value.
473
+ * The value has to be passed either as a <i>Unix-Timestamp</i> or an ISO 8601 formatted datetime string.
474
+ * To format the value correctly, use one of the following methods:
475
+ * <ul>
476
+ * <li><i>ISO-8601</i>: <pre>$sDatetime = date('c');</pre>
477
+ * <li><i>Unix-Timestamp</i>: <pre>$iTimestamp = time();</pre>
478
+ * </ul>
479
+ * The update methods are used to update attribute values in the current row or the insert row.
480
+ * The update methods do not update the underlying recipient on the server;
481
+ * instead the <i>commitRowUpdate</i> method is called to commit the changes.
482
+ *
483
+ * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
484
+ * @param string $dtValue the new attribute value.
485
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
486
+ * forgot to call <i>next()</i>).
487
+ * @throws Inx_Api_IllegalStateException if the attribute is not of type <i>datetime</i>.
488
+ */
489
+ public function updateDatetime( Inx_Api_Recipient_Attribute $oAttr, $dtValue );
490
+
491
+
492
+ /**
493
+ * Updates the designated attribute with a new value.
494
+ * Most string values can be converted regardless of their content.
495
+ * The string "test" can, for example, be converted to a boolean and will return true.
496
+ * However, this is not true for attributes of type date, time or datetime.
497
+ * These values have to be passed either as a <i>Unix-Timestamp</i> or an ISO 8601 formatted date, time or datetime string.
498
+ * To format the value correctly, use one of the following methods, according to the datatype of the attribute:
499
+ * <ul>
500
+ * <li><i>Date</i>: <pre>$sDate = date("Y-m-d");</pre>
501
+ * <li><i>Time</i>: <pre>$sTime = date("H:i:sP");</pre>
502
+ * <li><i>Datetime</i>: <pre>$sDatetime = date('c');</pre>
503
+ * <li><i>Unix-Timestamp (works for all)</i>: <pre>$iTimestamp = time();</pre>
504
+ * </ul>
505
+ * The update methods are used to update attribute values in the current row or the insert row.
506
+ * The update methods do not update the underlying recipient on the server;
507
+ * instead the <i>commitRowUpdate</i> method is called to commit the changes.
508
+ *
509
+ * @param Inx_Api_Reciptient_Attribute $oAttr the designated attribute.
510
+ * @param string|mixed $oValue the new attribute value.
511
+ * @throws Inx_Api_DataException if the test recipient was deleted or no test recipient is selected (e.g. you
512
+ * forgot to call <i>next()</i>).
513
+ */
514
+ public function updateObject( Inx_Api_Recipient_Attribute $oAttr, $oValue );
515
+
516
+
517
+ /**
518
+ * Releases the resources associated with this <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> object on the server immediately.
519
+ * <p>
520
+ * An <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> object <strong>must</strong> be closed once it is not
521
+ * needed anymore to prevent memory leaks and other potentially harmful side effects.
522
+ */
523
+ public function close();
524
+ }
lib/Inx/Api/TextModule/TextModule.php CHANGED
@@ -1,156 +1,156 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage Textmodule
5
- */
6
- /**
7
- * This class defines a text module.
8
- * Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the text
9
- * module is defined in the system list).
10
- * A common text module is a custom, personalized salutation which will be shown later.
11
- * <p>
12
- * You can update both of the content types (plain Text and html) but via the client only the one(s) defined by the
13
- * MIME type will be used.
14
- * Also, the text module name may be updated, though NOT the MIME type.
15
- * If you wish to alter the MIME type, you have to delete the text module and create a new one with the values of
16
- * the old text module and the new MIME type.
17
- * <p>
18
- * The following snippet shows how to create a global custom salutation text module using the user defined
19
- * recipient attributes 'Surname', 'First name' and 'Gender':
20
- *
21
- * <pre>
22
- * $oTextModuleManager = $oSession->getTextmoduleManager();
23
- * $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
24
- * $oTextModule = $oTextModuleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT );
25
- *
26
- * $sContent = &quot;[%if Surname IS_EMPTY]Dear Sir or Madam,\n&quot;;
27
- * $sContent .= &quot;[%elseif Column(\&quot;Gender\&quot;) = \&quot;m\&quot;]Dear Mr &quot;;
28
- * $sContent .= &quot;[First name,postfix( )][Surname], \n&quot;;
29
- * $sContent .= &quot;[%elseif Column(\&quot;Gender\&quot;) = \&quot;f\&quot;]Dear Ms &quot;;
30
- * $sContent .= &quot;[First name, postfix( )][Surname], \n &quot;;
31
- * $sContent .= &quot;[%else]Dear Sir or Madam,[%endif] \n &quot;;
32
- *
33
- * $oTextModule->updateName( &quot;salutation&quot; );
34
- * $oTextModule->updatePlainTextContent( $sContent );
35
- * $oTextModule->commitUpdate();
36
- * </pre>
37
- * <p>
38
- * For more information on the possible contents of text modules, see the corresponding section of the Inxmail client manual.
39
- * <p>
40
- * For an example on how to retrieve existing text modules, see the <i>In_Api_TextModule_TextModuleManager</i> documentation.
41
- *
42
- * @see In_Api_TextModule_TextModuleManager
43
- * @since API 1.4.0
44
- * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
45
- * @package Inxmail
46
- * @subpackage Textmodule
47
- */
48
- interface Inx_Api_TextModule_TextModule extends Inx_Api_BusinessObject
49
- {
50
-
51
- /**
52
- * MIME type constant for HTML text modules. This text module has only a HTML text part.
53
- */
54
- const MIME_TYPE_HTML_TEXT = 0;
55
-
56
- /**
57
- * MIME type constant for plain text modules. This text module has only a plain text part.
58
- */
59
- const MIME_TYPE_PLAIN_TEXT = 1;
60
-
61
- /**
62
- * MIME type constant for multipart text modules. This text module has a HTML and a plain text part.
63
- */
64
- const MIME_TYPE_MULTIPART = 2;
65
-
66
- /**
67
- * Constant for the name attribute. Used for ordering by the <i>Inx_Api_TextModule_TextModuleManager</i>.
68
- *
69
- * @see Inx_Api_TextModule_TextModuleManager::select($oListContext, $iOrderAttribute, $iOrderType)
70
- */
71
- const ATTRIBUTE_NAME = 0;
72
-
73
- /**
74
- * Constant for the plain text attribute.
75
- */
76
- const ATTRIBUTE_PLAIN_TEXT = 1;
77
-
78
- /**
79
- * Constant for the HTML text attribute.
80
- */
81
- const ATTRIBUTE_HTML_TEXT = 2;
82
-
83
- /**
84
- * Constant for the list context id attribute.
85
- */
86
- const ATTRIBUTE_LIST_CONTEXT_ID = 3;
87
-
88
- /**
89
- * Constant for the MIME type attribute.
90
- */
91
- const ATTRIBUTE_MIME_TYPE = 4;
92
-
93
- /**
94
- * Returns the name of this text module.
95
- *
96
- * @return string the name of this text module.
97
- */
98
- public function getName();
99
-
100
- /**
101
- * Updates the name of the text module.
102
- * The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
103
- *
104
- * @param string $sName the new text module name.
105
- */
106
- public function updateName( $sName );
107
-
108
- /**
109
- * Returns the id of the list which this text module belongs to.
110
- *
111
- * @return int the id of the list which this text module belongs to.
112
- */
113
- public function getListContextId();
114
-
115
- /**
116
- * Returns the MIME type of this text module. May be one of:
117
- * <ul>
118
- * <li><i>MIME_TYPE_HTML_TEXT</i>: Only HTML text
119
- * <li><i>MIME_TYPE_PLAIN_TEXT</i>: Only plain text
120
- * <li><i>MIME_TYPE_MULTIPART</i>: Both, HTML and plain text
121
- * </ul>
122
- *
123
- * @return int the MIME type of this text module.
124
- */
125
- public function getMimeType();
126
-
127
- /**
128
- * Returns the HTML text part of this text module, or <i>null</i> if the MIME type is <i>MIME_TYPE_PLAIN_TEXT</i>.
129
- *
130
- * @return string the HTML text part of this text module, if any.
131
- */
132
- public function getHtmlTextContent();
133
-
134
- /**
135
- * Updates the HTML text part of this text module.
136
- * The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
137
- *
138
- * @param string $sHtmlTextContent the new HTML text part.
139
- */
140
- public function updateHtmlTextContent( $sHtmlTextContent );
141
-
142
- /**
143
- * Returns the plain text part of this text module, or <i>null</i> if the MIME type is <i>MIME_TYPE_HTML_TEXT</i>.
144
- *
145
- * @return string the plain text part of this text module, if any.
146
- */
147
- public function getPlainTextContent();
148
-
149
- /**
150
- * Updates the plain text part of the text module.
151
- * The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
152
- *
153
- * @param string $sPlainTextContent the new plain text part.
154
- */
155
- public function updatePlainTextContent( $sPlainTextContent );
156
- }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage Textmodule
5
+ */
6
+ /**
7
+ * This class defines a text module.
8
+ * Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the text
9
+ * module is defined in the system list).
10
+ * A common text module is a custom, personalized salutation which will be shown later.
11
+ * <p>
12
+ * You can update both of the content types (plain Text and html) but via the client only the one(s) defined by the
13
+ * MIME type will be used.
14
+ * Also, the text module name may be updated, though NOT the MIME type.
15
+ * If you wish to alter the MIME type, you have to delete the text module and create a new one with the values of
16
+ * the old text module and the new MIME type.
17
+ * <p>
18
+ * The following snippet shows how to create a global custom salutation text module using the user defined
19
+ * recipient attributes 'Surname', 'First name' and 'Gender':
20
+ *
21
+ * <pre>
22
+ * $oTextModuleManager = $oSession->getTextmoduleManager();
23
+ * $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
24
+ * $oTextModule = $oTextModuleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT );
25
+ *
26
+ * $sContent = &quot;[%if Surname IS_EMPTY]Dear Sir or Madam,\n&quot;;
27
+ * $sContent .= &quot;[%elseif Column(\&quot;Gender\&quot;) = \&quot;m\&quot;]Dear Mr &quot;;
28
+ * $sContent .= &quot;[First name,postfix( )][Surname], \n&quot;;
29
+ * $sContent .= &quot;[%elseif Column(\&quot;Gender\&quot;) = \&quot;f\&quot;]Dear Ms &quot;;
30
+ * $sContent .= &quot;[First name, postfix( )][Surname], \n &quot;;
31
+ * $sContent .= &quot;[%else]Dear Sir or Madam,[%endif] \n &quot;;
32
+ *
33
+ * $oTextModule->updateName( &quot;salutation&quot; );
34
+ * $oTextModule->updatePlainTextContent( $sContent );
35
+ * $oTextModule->commitUpdate();
36
+ * </pre>
37
+ * <p>
38
+ * For more information on the possible contents of text modules, see the corresponding section of the Inxmail client manual.
39
+ * <p>
40
+ * For an example on how to retrieve existing text modules, see the <i>In_Api_TextModule_TextModuleManager</i> documentation.
41
+ *
42
+ * @see In_Api_TextModule_TextModuleManager
43
+ * @since API 1.4.0
44
+ * @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
45
+ * @package Inxmail
46
+ * @subpackage Textmodule
47
+ */
48
+ interface Inx_Api_TextModule_TextModule extends Inx_Api_BusinessObject
49
+ {
50
+
51
+ /**
52
+ * MIME type constant for HTML text modules. This text module has only a HTML text part.
53
+ */
54
+ const MIME_TYPE_HTML_TEXT = 0;
55
+
56
+ /**
57
+ * MIME type constant for plain text modules. This text module has only a plain text part.
58
+ */
59
+ const MIME_TYPE_PLAIN_TEXT = 1;
60
+
61
+ /**
62
+ * MIME type constant for multipart text modules. This text module has a HTML and a plain text part.
63
+ */
64
+ const MIME_TYPE_MULTIPART = 2;
65
+
66
+ /**
67
+ * Constant for the name attribute. Used for ordering by the <i>Inx_Api_TextModule_TextModuleManager</i>.
68
+ *
69
+ * @see Inx_Api_TextModule_TextModuleManager::select($oListContext, $iOrderAttribute, $iOrderType)
70
+ */
71
+ const ATTRIBUTE_NAME = 0;
72
+
73
+ /**
74
+ * Constant for the plain text attribute.
75
+ */
76
+ const ATTRIBUTE_PLAIN_TEXT = 1;
77
+
78
+ /**
79
+ * Constant for the HTML text attribute.
80
+ */
81
+ const ATTRIBUTE_HTML_TEXT = 2;
82
+
83
+ /**
84
+ * Constant for the list context id attribute.
85
+ */
86
+ const ATTRIBUTE_LIST_CONTEXT_ID = 3;
87
+
88
+ /**
89
+ * Constant for the MIME type attribute.
90
+ */
91
+ const ATTRIBUTE_MIME_TYPE = 4;
92
+
93
+ /**
94
+ * Returns the name of this text module.
95
+ *
96
+ * @return string the name of this text module.
97
+ */
98
+ public function getName();
99
+
100
+ /**
101
+ * Updates the name of the text module.
102
+ * The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
103
+ *
104
+ * @param string $sName the new text module name.
105
+ */
106
+ public function updateName( $sName );
107
+
108
+ /**
109
+ * Returns the id of the list which this text module belongs to.
110
+ *
111
+ * @return int the id of the list which this text module belongs to.
112
+ */
113
+ public function getListContextId();
114
+
115
+ /**
116
+ * Returns the MIME type of this text module. May be one of:
117
+ * <ul>
118
+ * <li><i>MIME_TYPE_HTML_TEXT</i>: Only HTML text
119
+ * <li><i>MIME_TYPE_PLAIN_TEXT</i>: Only plain text
120
+ * <li><i>MIME_TYPE_MULTIPART</i>: Both, HTML and plain text
121
+ * </ul>
122
+ *
123
+ * @return int the MIME type of this text module.
124
+ */
125
+ public function getMimeType();
126
+
127
+ /**
128
+ * Returns the HTML text part of this text module, or <i>null</i> if the MIME type is <i>MIME_TYPE_PLAIN_TEXT</i>.
129
+ *
130
+ * @return string the HTML text part of this text module, if any.
131
+ */
132
+ public function getHtmlTextContent();
133
+
134
+ /**
135
+ * Updates the HTML text part of this text module.
136
+ * The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
137
+ *
138
+ * @param string $sHtmlTextContent the new HTML text part.
139
+ */
140
+ public function updateHtmlTextContent( $sHtmlTextContent );
141
+
142
+ /**
143
+ * Returns the plain text part of this text module, or <i>null</i> if the MIME type is <i>MIME_TYPE_HTML_TEXT</i>.
144
+ *
145
+ * @return string the plain text part of this text module, if any.
146
+ */
147
+ public function getPlainTextContent();
148
+
149
+ /**
150
+ * Updates the plain text part of the text module.
151
+ * The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
152
+ *
153
+ * @param string $sPlainTextContent the new plain text part.
154
+ */
155
+ public function updatePlainTextContent( $sPlainTextContent );
156
+ }
lib/Inx/Api/TextModule/TextModuleManager.php CHANGED
@@ -1,89 +1,89 @@
1
- <?php
2
-
3
- /**
4
- * @package Inxmail
5
- * @subpackage Textmodule
6
- */
7
- /**
8
- * The <i>Inx_Api_TextModule_TextModuleManager</i> can be used to retrieve and create text modules.
9
- * Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the
10
- * text module is defined in the system list).
11
- * A common text module is a custom, personalized salutation.
12
- * <p>
13
- * The following snippet shows how to create a new text module and update its name:
14
- *
15
- * <pre>
16
- * $oTextmoduleManager = $oSession->getTextmoduleManager();
17
- * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired List&quot; );
18
- * $oTextModule = $oTextmoduleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT );
19
- *
20
- * $oTextModule->updateName( &quot;Desired name&quot; );
21
- * $oTextModule->commitUpdate();
22
- * </pre>
23
- *
24
- * </p>
25
- * To retrieve existing text modules, use one of the two <i>select</i> methods provided by this manager.
26
- * The following snippet shows how to retrieve all global text modules, ordered by their name, and prints out some
27
- * information regarding these text modules:
28
- *
29
- * <pre>
30
- * $oTextmoduleManager = $oSession->getTextmoduleManager();
31
- * $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
32
- * $oBOResultSet = $oTextmoduleManager->select( $oListContext, Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME, Inx_Api_Order::DESC );
33
- *
34
- * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
35
- * {
36
- * $oTextModule = $oBOResultSet->get( $i );
37
- * echo &quot;Textmodule &quot;.$oTextModule->getName().&quot; has the content type &quot;.$oTextModule->getMimeType().&quot;&#60;br&#62;&quot;;
38
- * }
39
- *
40
- * $oBOResultSet->close();
41
- * </pre>
42
- * <p>
43
- * For more information on text modules, see the <i>Inx_Api_TextModule_TextModule</i> documentation.
44
- *
45
- * @see Inx_Api_TextModule_TextModule
46
- * @since API 1.4.0
47
- * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
48
- * @package Inxmail
49
- * @subpackage Textmodule
50
- */
51
- interface Inx_Api_TextModule_TextModuleManager extends Inx_Api_BOManager
52
- {
53
-
54
- /**
55
- * Creates a new text module in the specified list.
56
- * To create a globally available text module, use the <i>SystemListContext</i>.
57
- * The <i>SystemListContext</i> can be retrieved using the following snippet:
58
- *
59
- * <pre>
60
- * $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
61
- * </pre>
62
- *
63
- * @param Inx_Api_List_ListContext $oListContext the list the text module shall be created for.
64
- * @param int $iMimeType the MIME type of this text module. May be one of:
65
- * <ul>
66
- * <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT</i>,
67
- * <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT</i> or
68
- * <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_MULTIPART</i>
69
- * </ul>
70
- * @return a new text module.
71
- */
72
- public function createTextmodule( Inx_Api_List_ListContext $oListContext, $iMimeType );
73
-
74
- /**
75
- * Returns an <i>Inx_Api_BOResultSet</i> containing all text modules in the specified list, ordered by the given
76
- * attribute.
77
- *
78
- * @param Inx_Api_List_ListContext $oListContext all text modules of this list will be selected.
79
- * @param int $iOrderAttribute the order attribute (only <i>Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME</i>).
80
- * May be ommitted.
81
- * @param int $iOrderType the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DES</i>).
82
- * May be ommitted.
83
- * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all text modules in the specified list.
84
- * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
85
- * <i>Inx_Api_UserRights::TEXTMODULE_FEATURE_USE</i>
86
- */
87
- public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute=null, $iOrderType=null );
88
-
89
- }
1
+ <?php
2
+
3
+ /**
4
+ * @package Inxmail
5
+ * @subpackage Textmodule
6
+ */
7
+ /**
8
+ * The <i>Inx_Api_TextModule_TextModuleManager</i> can be used to retrieve and create text modules.
9
+ * Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the
10
+ * text module is defined in the system list).
11
+ * A common text module is a custom, personalized salutation.
12
+ * <p>
13
+ * The following snippet shows how to create a new text module and update its name:
14
+ *
15
+ * <pre>
16
+ * $oTextmoduleManager = $oSession->getTextmoduleManager();
17
+ * $oListContext = $oSession->getListContextManager()->findByName( &quot;Desired List&quot; );
18
+ * $oTextModule = $oTextmoduleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT );
19
+ *
20
+ * $oTextModule->updateName( &quot;Desired name&quot; );
21
+ * $oTextModule->commitUpdate();
22
+ * </pre>
23
+ *
24
+ * </p>
25
+ * To retrieve existing text modules, use one of the two <i>select</i> methods provided by this manager.
26
+ * The following snippet shows how to retrieve all global text modules, ordered by their name, and prints out some
27
+ * information regarding these text modules:
28
+ *
29
+ * <pre>
30
+ * $oTextmoduleManager = $oSession->getTextmoduleManager();
31
+ * $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
32
+ * $oBOResultSet = $oTextmoduleManager->select( $oListContext, Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME, Inx_Api_Order::DESC );
33
+ *
34
+ * for( $i = 0; $i &lt; $oBOResultSet->size(); $i++ )
35
+ * {
36
+ * $oTextModule = $oBOResultSet->get( $i );
37
+ * echo &quot;Textmodule &quot;.$oTextModule->getName().&quot; has the content type &quot;.$oTextModule->getMimeType().&quot;&#60;br&#62;&quot;;
38
+ * }
39
+ *
40
+ * $oBOResultSet->close();
41
+ * </pre>
42
+ * <p>
43
+ * For more information on text modules, see the <i>Inx_Api_TextModule_TextModule</i> documentation.
44
+ *
45
+ * @see Inx_Api_TextModule_TextModule
46
+ * @since API 1.4.0
47
+ * @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
48
+ * @package Inxmail
49
+ * @subpackage Textmodule
50
+ */
51
+ interface Inx_Api_TextModule_TextModuleManager extends Inx_Api_BOManager
52
+ {
53
+
54
+ /**
55
+ * Creates a new text module in the specified list.
56
+ * To create a globally available text module, use the <i>SystemListContext</i>.
57
+ * The <i>SystemListContext</i> can be retrieved using the following snippet:
58
+ *
59
+ * <pre>
60
+ * $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
61
+ * </pre>
62
+ *
63
+ * @param Inx_Api_List_ListContext $oListContext the list the text module shall be created for.
64
+ * @param int $iMimeType the MIME type of this text module. May be one of:
65
+ * <ul>
66
+ * <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT</i>,
67
+ * <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT</i> or
68
+ * <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_MULTIPART</i>
69
+ * </ul>
70
+ * @return a new text module.
71
+ */
72
+ public function createTextmodule( Inx_Api_List_ListContext $oListContext, $iMimeType );
73
+
74
+ /**
75
+ * Returns an <i>Inx_Api_BOResultSet</i> containing all text modules in the specified list, ordered by the given
76
+ * attribute.
77
+ *
78
+ * @param Inx_Api_List_ListContext $oListContext all text modules of this list will be selected.
79
+ * @param int $iOrderAttribute the order attribute (only <i>Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME</i>).
80
+ * May be ommitted.
81
+ * @param int $iOrderType the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DES</i>).
82
+ * May be ommitted.
83
+ * @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all text modules in the specified list.
84
+ * @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
85
+ * <i>Inx_Api_UserRights::TEXTMODULE_FEATURE_USE</i>
86
+ */
87
+ public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute=null, $iOrderType=null );
88
+
89
+ }
lib/Inx/Api/TriggerMail/Attachment.php CHANGED
@@ -1,55 +1,55 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * The <code>Attachment</code> object represents a regular attachment or an embedded image of a trigger mailing and is
9
- * part of the <code>TriggerMailContent</code> object.
10
- *
11
- * @see com.inxmail.xpro.api.triggermail.TriggerMailContent#getAttachments()
12
- * @see com.inxmail.xpro.api.triggermail.TriggerMailContent#getEmbeddedImages()
13
- * @since API 1.10.0
14
- * @author chge, 09.07.2012
15
- */
16
- interface Inx_Api_TriggerMail_Attachment
17
- {
18
-
19
- /**
20
- * Returns the file name of a regular attachment or the image identifier of an embedded image. An embedded image is
21
- * referenced in a message body using an &lt;img&gt; tag, as follows:
22
- *
23
- * <pre>
24
- * &lt;img src="cid:Image-Identifier"&gt;
25
- * </pre>
26
- *
27
- * @return the file name of a regular attachment or the image identifier of an embedded image.
28
- */
29
- public function getName();
30
-
31
-
32
- /**
33
- * Returns the MIME type of this attachment, e.g. <code>application/pdf</code> or <code>image/gif</code>.
34
- *
35
- * @return the MIME type of this attachment.
36
- */
37
- public function getContentType();
38
-
39
-
40
- /**
41
- * Return the size of the content of this attachment in bytes.
42
- *
43
- * @return the size of the content of this attachment in bytes.
44
- */
45
- public function getSize();
46
-
47
-
48
- /**
49
- * Returns an input stream of the content of this attachment. This method is used to download the content of this
50
- * attachment.
51
- *
52
- * @return an input stream of the content of this attachment.
53
- */
54
- public function getContent();
55
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * The <code>Attachment</code> object represents a regular attachment or an embedded image of a trigger mailing and is
9
+ * part of the <code>TriggerMailContent</code> object.
10
+ *
11
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailContent#getAttachments()
12
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailContent#getEmbeddedImages()
13
+ * @since API 1.10.0
14
+ * @author chge, 09.07.2012
15
+ */
16
+ interface Inx_Api_TriggerMail_Attachment
17
+ {
18
+
19
+ /**
20
+ * Returns the file name of a regular attachment or the image identifier of an embedded image. An embedded image is
21
+ * referenced in a message body using an &lt;img&gt; tag, as follows:
22
+ *
23
+ * <pre>
24
+ * &lt;img src="cid:Image-Identifier"&gt;
25
+ * </pre>
26
+ *
27
+ * @return the file name of a regular attachment or the image identifier of an embedded image.
28
+ */
29
+ public function getName();
30
+
31
+
32
+ /**
33
+ * Returns the MIME type of this attachment, e.g. <code>application/pdf</code> or <code>image/gif</code>.
34
+ *
35
+ * @return the MIME type of this attachment.
36
+ */
37
+ public function getContentType();
38
+
39
+
40
+ /**
41
+ * Return the size of the content of this attachment in bytes.
42
+ *
43
+ * @return the size of the content of this attachment in bytes.
44
+ */
45
+ public function getSize();
46
+
47
+
48
+ /**
49
+ * Returns an input stream of the content of this attachment. This method is used to download the content of this
50
+ * attachment.
51
+ *
52
+ * @return an input stream of the content of this attachment.
53
+ */
54
+ public function getContent();
55
  }
lib/Inx/Api/TriggerMail/BuildException.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * A <code>BuildException</code> is thrown when the building of a trigger mailing fails. This may be due to an illegal
9
- * recipient address or a general building failure. For a deeper insight on the error, consult the {@link RenderError}
10
- * associated with the exception.
11
- *
12
- * @see com.inxmail.xpro.api.triggermail.RenderError
13
- * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#build(int)
14
- * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#build(int, int)
15
- * @since API 1.10.0
16
- * @author chge, 09.07.2012
17
- */
18
- class Inx_Api_TriggerMail_BuildException extends Exception
19
- {
20
- /** The email address of the recipient for which the trigger mailing was built. */
21
- protected $emailAddress;
22
-
23
- /** Contains detail information about the error. */
24
- protected $error;
25
-
26
-
27
- /**
28
- * Creates a <code>BuildException</code> with the given recipient address and render error.
29
- *
30
- * @param emailAddress the email address of the recipient for which the trigger mailing was built.
31
- * @param error contains detail information about the error.
32
- */
33
- public function __construct( $sEmailAddress, Inx_Api_TriggerMail_RenderError $error )
34
- {
35
- $this->emailAddress = $sEmailAddress;
36
- $this->error = $error;
37
- }
38
-
39
-
40
- /**
41
- * Returns detail information about the error.
42
- *
43
- * @return detail information about the error.
44
- */
45
- public function getError()
46
- {
47
- return $this->error;
48
- }
49
-
50
-
51
- /**
52
- * Returns the email address of the recipient for which the trigger mailing was built.
53
- *
54
- * @return the recipients email address.
55
- */
56
- public function getEmailAddress()
57
- {
58
- return $this->emailAddress;
59
- }
60
-
61
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * A <code>BuildException</code> is thrown when the building of a trigger mailing fails. This may be due to an illegal
9
+ * recipient address or a general building failure. For a deeper insight on the error, consult the {@link RenderError}
10
+ * associated with the exception.
11
+ *
12
+ * @see com.inxmail.xpro.api.triggermail.RenderError
13
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#build(int)
14
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#build(int, int)
15
+ * @since API 1.10.0
16
+ * @author chge, 09.07.2012
17
+ */
18
+ class Inx_Api_TriggerMail_BuildException extends Exception
19
+ {
20
+ /** The email address of the recipient for which the trigger mailing was built. */
21
+ protected $emailAddress;
22
+
23
+ /** Contains detail information about the error. */
24
+ protected $error;
25
+
26
+
27
+ /**
28
+ * Creates a <code>BuildException</code> with the given recipient address and render error.
29
+ *
30
+ * @param emailAddress the email address of the recipient for which the trigger mailing was built.
31
+ * @param error contains detail information about the error.
32
+ */
33
+ public function __construct( $sEmailAddress, Inx_Api_TriggerMail_RenderError $error )
34
+ {
35
+ $this->emailAddress = $sEmailAddress;
36
+ $this->error = $error;
37
+ }
38
+
39
+
40
+ /**
41
+ * Returns detail information about the error.
42
+ *
43
+ * @return detail information about the error.
44
+ */
45
+ public function getError()
46
+ {
47
+ return $this->error;
48
+ }
49
+
50
+
51
+ /**
52
+ * Returns the email address of the recipient for which the trigger mailing was built.
53
+ *
54
+ * @return the recipients email address.
55
+ */
56
+ public function getEmailAddress()
57
+ {
58
+ return $this->emailAddress;
59
+ }
60
+
61
  }
lib/Inx/Api/TriggerMail/BuildMode.php CHANGED
@@ -1,136 +1,136 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * The <code>BuildMode</code> determines how a mailing is built by the {@link TriggerMailingRenderer}.
9
- *
10
- * @author chge, 02.08.2012
11
- */
12
- final class Inx_Api_TriggerMail_BuildMode
13
- {
14
- private static $NORMAL = null;
15
-
16
- private static $ALTERNATIVEVIEW_ACTIVE = null;
17
-
18
- /** The mode to generate a normal trigger mail), ready to be sent. */
19
- public static final function NORMAL()
20
- {
21
- return new Inx_Api_TriggerMail_BuildMode( 100 );
22
- }
23
-
24
- /**
25
- * The mode for mail view: All links are fully functional. Embedded images are replaced with http references to
26
- * image resources on the Inxmail server.
27
- */
28
- public static final function ALTERNATIVEVIEW_ACTIVE()
29
- {
30
- return new Inx_Api_TriggerMail_BuildMode( 101 );
31
- }
32
-
33
- /**
34
- * The mode for mail view: All links are not functional. Embedded images are replaced with http references to image
35
- * resources on the Inxmail server.
36
- */
37
- public static final function ALTERNATIVEVIEW_INACTIVE()
38
- {
39
- return new Inx_Api_TriggerMail_BuildMode( 104 );
40
- }
41
-
42
- /**
43
- * The mode for mail preview: Trackable links will not trigger any events), unsubscription links will redirect but
44
- * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail
45
- * server.
46
- */
47
- public static final function PREVIEW()
48
- {
49
- return new Inx_Api_TriggerMail_BuildMode( 102 );
50
- }
51
-
52
- /**
53
- * The mode for mail archive view: Trackable links will not trigger any events), unsubscription links will redirect
54
- * but not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail
55
- * server.
56
- */
57
- public static final function ARCHIVE()
58
- {
59
- return new Inx_Api_TriggerMail_BuildMode( 103 );
60
- }
61
-
62
- /**
63
- * The mode for mail view: All links are fully functional but converted to simple links. Embedded images are
64
- * replaced with http references to image resources on the Inxmail server.
65
- */
66
- public static final function ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS()
67
- {
68
- return new Inx_Api_TriggerMail_BuildMode( 105 );
69
- }
70
-
71
- /**
72
- * The mode for mail view: All links are fully functional but converted to simple links. Embedded images are
73
- * replaced with http references to image resources on the Inxmail server. The function InInboxView returns true for
74
- * this call.
75
- */
76
- public static final function NEWSLETTER_SIMPLE_LINKS()
77
- {
78
- return new Inx_Api_TriggerMail_BuildMode( 106 );
79
- }
80
-
81
- /**
82
- * Constant for an unknown build mode. This mode indicates a version mismatch between API and server.
83
- */
84
- public static final function UNKNOWN()
85
- {
86
- return new Inx_Api_TriggerMail_BuildMode( -1 );
87
- }
88
-
89
- private $id;
90
-
91
-
92
- private function __construct( $iId )
93
- {
94
- $this->id = $iId;
95
- }
96
-
97
-
98
- /**
99
- * Returns the ID of the <code>BuildMode</code>. The ID is used for transmission purposes and should not be used
100
- * inside client code.
101
- *
102
- * @return the ID of the <code>BuildMode</code>.
103
- */
104
- public function getId()
105
- {
106
- return $this->id;
107
- }
108
-
109
-
110
- /**
111
- * Returns the <code>BuildMode</code> corresponding to the given ID. If the ID is unknown, the <code>UKNOWN</code>
112
- * build mode will be returned. The ID is used for transmission purposes and should not be used inside client code.
113
- *
114
- * @param id the ID of the <code>BuildMode</code> to retrieve.
115
- * @return the <code>BuildMode</code> corresponding to the given ID.
116
- */
117
- public static function byId( $iMode )
118
- {
119
- foreach( self::values() as $m )
120
- {
121
- if( $m->getId() == $iMode )
122
- {
123
- return $m;
124
- }
125
- }
126
-
127
- return self::UNKNOWN();
128
- }
129
-
130
- public static function values()
131
- {
132
- return array(self::NORMAL(), self::ALTERNATIVEVIEW_ACTIVE(), self::ALTERNATIVEVIEW_INACTIVE(), self::PREVIEW(),
133
- self::ARCHIVE(), self::ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS(), self::NEWSLETTER_SIMPLE_LINKS(),
134
- self::UNKNOWN());
135
- }
136
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * The <code>BuildMode</code> determines how a mailing is built by the {@link TriggerMailingRenderer}.
9
+ *
10
+ * @author chge, 02.08.2012
11
+ */
12
+ final class Inx_Api_TriggerMail_BuildMode
13
+ {
14
+ private static $NORMAL = null;
15
+
16
+ private static $ALTERNATIVEVIEW_ACTIVE = null;
17
+
18
+ /** The mode to generate a normal trigger mail), ready to be sent. */
19
+ public static final function NORMAL()
20
+ {
21
+ return new Inx_Api_TriggerMail_BuildMode( 100 );
22
+ }
23
+
24
+ /**
25
+ * The mode for mail view: All links are fully functional. Embedded images are replaced with http references to
26
+ * image resources on the Inxmail server.
27
+ */
28
+ public static final function ALTERNATIVEVIEW_ACTIVE()
29
+ {
30
+ return new Inx_Api_TriggerMail_BuildMode( 101 );
31
+ }
32
+
33
+ /**
34
+ * The mode for mail view: All links are not functional. Embedded images are replaced with http references to image
35
+ * resources on the Inxmail server.
36
+ */
37
+ public static final function ALTERNATIVEVIEW_INACTIVE()
38
+ {
39
+ return new Inx_Api_TriggerMail_BuildMode( 104 );
40
+ }
41
+
42
+ /**
43
+ * The mode for mail preview: Trackable links will not trigger any events), unsubscription links will redirect but
44
+ * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail
45
+ * server.
46
+ */
47
+ public static final function PREVIEW()
48
+ {
49
+ return new Inx_Api_TriggerMail_BuildMode( 102 );
50
+ }
51
+
52
+ /**
53
+ * The mode for mail archive view: Trackable links will not trigger any events), unsubscription links will redirect
54
+ * but not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail
55
+ * server.
56
+ */
57
+ public static final function ARCHIVE()
58
+ {
59
+ return new Inx_Api_TriggerMail_BuildMode( 103 );
60
+ }
61
+
62
+ /**
63
+ * The mode for mail view: All links are fully functional but converted to simple links. Embedded images are
64
+ * replaced with http references to image resources on the Inxmail server.
65
+ */
66
+ public static final function ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS()
67
+ {
68
+ return new Inx_Api_TriggerMail_BuildMode( 105 );
69
+ }
70
+
71
+ /**
72
+ * The mode for mail view: All links are fully functional but converted to simple links. Embedded images are
73
+ * replaced with http references to image resources on the Inxmail server. The function InInboxView returns true for
74
+ * this call.
75
+ */
76
+ public static final function NEWSLETTER_SIMPLE_LINKS()
77
+ {
78
+ return new Inx_Api_TriggerMail_BuildMode( 106 );
79
+ }
80
+
81
+ /**
82
+ * Constant for an unknown build mode. This mode indicates a version mismatch between API and server.
83
+ */
84
+ public static final function UNKNOWN()
85
+ {
86
+ return new Inx_Api_TriggerMail_BuildMode( -1 );
87
+ }
88
+
89
+ private $id;
90
+
91
+
92
+ private function __construct( $iId )
93
+ {
94
+ $this->id = $iId;
95
+ }
96
+
97
+
98
+ /**
99
+ * Returns the ID of the <code>BuildMode</code>. The ID is used for transmission purposes and should not be used
100
+ * inside client code.
101
+ *
102
+ * @return the ID of the <code>BuildMode</code>.
103
+ */
104
+ public function getId()
105
+ {
106
+ return $this->id;
107
+ }
108
+
109
+
110
+ /**
111
+ * Returns the <code>BuildMode</code> corresponding to the given ID. If the ID is unknown, the <code>UKNOWN</code>
112
+ * build mode will be returned. The ID is used for transmission purposes and should not be used inside client code.
113
+ *
114
+ * @param id the ID of the <code>BuildMode</code> to retrieve.
115
+ * @return the <code>BuildMode</code> corresponding to the given ID.
116
+ */
117
+ public static function byId( $iMode )
118
+ {
119
+ foreach( self::values() as $m )
120
+ {
121
+ if( $m->getId() == $iMode )
122
+ {
123
+ return $m;
124
+ }
125
+ }
126
+
127
+ return self::UNKNOWN();
128
+ }
129
+
130
+ public static function values()
131
+ {
132
+ return array(self::NORMAL(), self::ALTERNATIVEVIEW_ACTIVE(), self::ALTERNATIVEVIEW_INACTIVE(), self::PREVIEW(),
133
+ self::ARCHIVE(), self::ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS(), self::NEWSLETTER_SIMPLE_LINKS(),
134
+ self::UNKNOWN());
135
+ }
136
  }
lib/Inx/Api/TriggerMail/ParseException.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * A <code>ParseException</code> is thrown when the parsing of a trigger mailing fails. The reason for such a failure
9
- * usually is a syntax error. For a deeper insight on the error, consult the {@link RenderError}s associated with the
10
- * exception.
11
- *
12
- * @see com.inxmail.xpro.api.triggermail.RenderError
13
- * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#parse(int, int)
14
- * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#parse(int, long, int)
15
- * @since API 1.10.0
16
- * @author chge, 09.07.2012
17
- */
18
- class Inx_Api_TriggerMail_ParseException extends Exception
19
- {
20
- /** Contains detail information about the error. */
21
- protected $errors;
22
-
23
-
24
- /**
25
- * Creates a <code>ParseException</code> with the given render errors.
26
- *
27
- * @param errors the render errors which occurred during the parsing.
28
- */
29
- public function __construct( array $errors )
30
- {
31
- $this->errors = $errors;
32
- }
33
-
34
-
35
- /**
36
- * Returns detail information about the error by returning the render error with the given index.
37
- *
38
- * @param index the index of the render error to be returned.
39
- * @return the render error with the given index.
40
- */
41
- public function getError( $iIndex )
42
- {
43
- return $this->errors[$iIndex];
44
- }
45
-
46
-
47
- /**
48
- * Returns the number of render errors associated with this <code>ParseException</code>.
49
- *
50
- * @return the number of render errors.
51
- */
52
- public function getErrorCount()
53
- {
54
- return sizeof($this->errors);
55
- }
56
-
57
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * A <code>ParseException</code> is thrown when the parsing of a trigger mailing fails. The reason for such a failure
9
+ * usually is a syntax error. For a deeper insight on the error, consult the {@link RenderError}s associated with the
10
+ * exception.
11
+ *
12
+ * @see com.inxmail.xpro.api.triggermail.RenderError
13
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#parse(int, int)
14
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#parse(int, long, int)
15
+ * @since API 1.10.0
16
+ * @author chge, 09.07.2012
17
+ */
18
+ class Inx_Api_TriggerMail_ParseException extends Exception
19
+ {
20
+ /** Contains detail information about the error. */
21
+ protected $errors;
22
+
23
+
24
+ /**
25
+ * Creates a <code>ParseException</code> with the given render errors.
26
+ *
27
+ * @param errors the render errors which occurred during the parsing.
28
+ */
29
+ public function __construct( array $errors )
30
+ {
31
+ $this->errors = $errors;
32
+ }
33
+
34
+
35
+ /**
36
+ * Returns detail information about the error by returning the render error with the given index.
37
+ *
38
+ * @param index the index of the render error to be returned.
39
+ * @return the render error with the given index.
40
+ */
41
+ public function getError( $iIndex )
42
+ {
43
+ return $this->errors[$iIndex];
44
+ }
45
+
46
+
47
+ /**
48
+ * Returns the number of render errors associated with this <code>ParseException</code>.
49
+ *
50
+ * @return the number of render errors.
51
+ */
52
+ public function getErrorCount()
53
+ {
54
+ return sizeof($this->errors);
55
+ }
56
+
57
  }
lib/Inx/Api/TriggerMail/RenderError.php CHANGED
@@ -1,144 +1,144 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * A <code>RenderError</code> object describes the details of an error which occurred during the parsing or building of
9
- * a trigger mailing. <code>RenderError</code> offers the following information:
10
- * <ul>
11
- * <li><i>Error type</i>: an internal error code
12
- * <li><i>Mail part</i>: the internal mail part code
13
- * <li><i>Begin line / column</i>: the line and column where the malicious token begins
14
- * <li><i>End line / column</i>: the line and column where the malicious token ends.
15
- * <li><i>Error messages</i>: the error messages
16
- * </ul>
17
- * <p>
18
- * <code>RenderError</code> is mainly used internally but may provide some insight on the error source to API
19
- * developers. For example, the token position will assist you in identifying syntax errors. The error messages may also
20
- * be analyzed to identify the error source.
21
- *
22
- * @see BuildException#getError()
23
- * @see ParseException#getError(int)
24
- * @since API 1.10.0
25
- * @author chge, 09.07.2012
26
- */
27
- class Inx_Api_TriggerMail_RenderError
28
- {
29
- private $errorType;
30
-
31
- private $mailPart;
32
-
33
- private $beginLine;
34
-
35
- private $endLine;
36
-
37
- private $beginColumn;
38
-
39
- private $endColumn;
40
-
41
- private $msgArgs;
42
-
43
-
44
- /**
45
- * Creates a <code>RenderError</code> with the given details.
46
- *
47
- * @param errorType the internal error code.
48
- * @param mailPart the internal mail part code.
49
- * @param beginLine the line where the malicious token begins.
50
- * @param endLine the line where the malicious token ends.
51
- * @param beginColumn the column where the malicious token begins.
52
- * @param endColumn the column where the malicious token ends.
53
- * @param msgArgs the error messages.
54
- */
55
- public function __construct( $iErrorType, $iMailPart, $iBeginLine, $iEndLine, $iBeginColumn,
56
- $iEndColumn, $aMsgArgs )
57
- {
58
- $this->errorType = $iErrorType;
59
- $this->mailPart = $iMailPart;
60
- $this->beginLine = $iBeginLine;
61
- $this->endLine = $iEndLine;
62
- $this->beginColumn = $iBeginColumn;
63
- $this->endColumn = $iEndColumn;
64
- $this->msgArgs = $aMsgArgs;
65
- }
66
-
67
-
68
- /**
69
- * Returns the internal error code.
70
- *
71
- * @return the internal error code.
72
- */
73
- public function getErrorType()
74
- {
75
- return $this->errorType;
76
- }
77
-
78
-
79
- /**
80
- * Returns the internal mail part code.
81
- *
82
- * @return the internal mail part code.
83
- */
84
- public function getMailPart()
85
- {
86
- return $this->mailPart;
87
- }
88
-
89
-
90
- /**
91
- * Returns the line where the malicious token begins.
92
- *
93
- * @return the line where the malicious token begins.
94
- */
95
- public function getBeginLine()
96
- {
97
- return $this->beginLine;
98
- }
99
-
100
-
101
- /**
102
- * Returns the line where the malicious token ends.
103
- *
104
- * @return the line where the malicious token ends.
105
- */
106
- public function getEndLine()
107
- {
108
- return $this->endLine;
109
- }
110
-
111
-
112
- /**
113
- * Returns the column where the malicious token begins.
114
- *
115
- * @return the column where the malicious token begins.
116
- */
117
- public function getBeginColumn()
118
- {
119
- return $this->beginColumn;
120
- }
121
-
122
-
123
- /**
124
- * Returns the column where the malicious token ends.
125
- *
126
- * @return the column where the malicious token ends.
127
- */
128
- public function getEndColumn()
129
- {
130
- return $this->endColumn;
131
- }
132
-
133
-
134
- /**
135
- * Returns the error messages.
136
- *
137
- * @return the error messages.
138
- */
139
- public function getMsgArgs()
140
- {
141
- return $this->msgArgs;
142
- }
143
-
144
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * A <code>RenderError</code> object describes the details of an error which occurred during the parsing or building of
9
+ * a trigger mailing. <code>RenderError</code> offers the following information:
10
+ * <ul>
11
+ * <li><i>Error type</i>: an internal error code
12
+ * <li><i>Mail part</i>: the internal mail part code
13
+ * <li><i>Begin line / column</i>: the line and column where the malicious token begins
14
+ * <li><i>End line / column</i>: the line and column where the malicious token ends.
15
+ * <li><i>Error messages</i>: the error messages
16
+ * </ul>
17
+ * <p>
18
+ * <code>RenderError</code> is mainly used internally but may provide some insight on the error source to API
19
+ * developers. For example, the token position will assist you in identifying syntax errors. The error messages may also
20
+ * be analyzed to identify the error source.
21
+ *
22
+ * @see BuildException#getError()
23
+ * @see ParseException#getError(int)
24
+ * @since API 1.10.0
25
+ * @author chge, 09.07.2012
26
+ */
27
+ class Inx_Api_TriggerMail_RenderError
28
+ {
29
+ private $errorType;
30
+
31
+ private $mailPart;
32
+
33
+ private $beginLine;
34
+
35
+ private $endLine;
36
+
37
+ private $beginColumn;
38
+
39
+ private $endColumn;
40
+
41
+ private $msgArgs;
42
+
43
+
44
+ /**
45
+ * Creates a <code>RenderError</code> with the given details.
46
+ *
47
+ * @param errorType the internal error code.
48
+ * @param mailPart the internal mail part code.
49
+ * @param beginLine the line where the malicious token begins.
50
+ * @param endLine the line where the malicious token ends.
51
+ * @param beginColumn the column where the malicious token begins.
52
+ * @param endColumn the column where the malicious token ends.
53
+ * @param msgArgs the error messages.
54
+ */
55
+ public function __construct( $iErrorType, $iMailPart, $iBeginLine, $iEndLine, $iBeginColumn,
56
+ $iEndColumn, $aMsgArgs )
57
+ {
58
+ $this->errorType = $iErrorType;
59
+ $this->mailPart = $iMailPart;
60
+ $this->beginLine = $iBeginLine;
61
+ $this->endLine = $iEndLine;
62
+ $this->beginColumn = $iBeginColumn;
63
+ $this->endColumn = $iEndColumn;
64
+ $this->msgArgs = $aMsgArgs;
65
+ }
66
+
67
+
68
+ /**
69
+ * Returns the internal error code.
70
+ *
71
+ * @return the internal error code.
72
+ */
73
+ public function getErrorType()
74
+ {
75
+ return $this->errorType;
76
+ }
77
+
78
+
79
+ /**
80
+ * Returns the internal mail part code.
81
+ *
82
+ * @return the internal mail part code.
83
+ */
84
+ public function getMailPart()
85
+ {
86
+ return $this->mailPart;
87
+ }
88
+
89
+
90
+ /**
91
+ * Returns the line where the malicious token begins.
92
+ *
93
+ * @return the line where the malicious token begins.
94
+ */
95
+ public function getBeginLine()
96
+ {
97
+ return $this->beginLine;
98
+ }
99
+
100
+
101
+ /**
102
+ * Returns the line where the malicious token ends.
103
+ *
104
+ * @return the line where the malicious token ends.
105
+ */
106
+ public function getEndLine()
107
+ {
108
+ return $this->endLine;
109
+ }
110
+
111
+
112
+ /**
113
+ * Returns the column where the malicious token begins.
114
+ *
115
+ * @return the column where the malicious token begins.
116
+ */
117
+ public function getBeginColumn()
118
+ {
119
+ return $this->beginColumn;
120
+ }
121
+
122
+
123
+ /**
124
+ * Returns the column where the malicious token ends.
125
+ *
126
+ * @return the column where the malicious token ends.
127
+ */
128
+ public function getEndColumn()
129
+ {
130
+ return $this->endColumn;
131
+ }
132
+
133
+
134
+ /**
135
+ * Returns the error messages.
136
+ *
137
+ * @return the error messages.
138
+ */
139
+ public function getMsgArgs()
140
+ {
141
+ return $this->msgArgs;
142
+ }
143
+
144
  }
lib/Inx/Api/TriggerMail/TriggerMailContent.php CHANGED
@@ -1,138 +1,138 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * The <code>TriggerMailContent</code> contains the personalized content of a trigger mailing for a specific recipient.
9
- * The information that can be retrieved from the <code>TriggerMailContent</code> includes:
10
- * <ul>
11
- * <li><i>The content type</i>: {@link #getContentType()}
12
- * <li><i>Plain/HTML text</i>: {@link #getPlainText()} and {@link #getHtmlText()}
13
- * <li><i>The subject</i>: {@link #getSubject()}
14
- * <li><i>The recipient address</i>: {@link #getRecipientAddress()}
15
- * <li><i>Attachments</i>: {@link #getAttachments()}
16
- * <li><i>Embedded images</i>: {@link #getEmbeddedImages()}
17
- * <li><i>The sender address</i>: {@link #getSenderAddress()}
18
- * <li><i>The bounce and reply addresses</i>: {@link #getBounceAddress()} and {@link #getReplyToAddress()}
19
- * <li><i>The mail headers</i>: {@link #getHeader()} or {@link #getMultipleHeaders()}
20
- * </ul>
21
- * A <code>TriggerMailContent</code> object is created by a {@link TriggerMailingRenderer} using its <code>build</code>
22
- * methods.
23
- *
24
- * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#build(int)
25
- * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#build(int, int)
26
- * @since API 1.10.0
27
- * @author chge, 09.07.2012
28
- */
29
- interface Inx_Api_TriggerMail_TriggerMailContent
30
- {
31
- /**
32
- * Returns the content type of this trigger mail.
33
- *
34
- * @return the content type of this trigger mail.
35
- */
36
- public function getContentType();
37
-
38
-
39
- /**
40
- * Returns the HTML text part of the mail, or <code>null</code> if the mail type is
41
- * {@link TriggerMailingContentType#PLAIN_TEXT}.
42
- *
43
- * @return the HTML text part of the mail, if any.
44
- */
45
- public function getHtmlText();
46
-
47
-
48
- /**
49
- * Returns the plain text part of the mail, or <code>null</code> if the mail type is
50
- * {@link TriggerMailingContentType#HTML_TEXT}.
51
- *
52
- * @return the plain text part of the email, if any.
53
- */
54
- public function getPlainText();
55
-
56
-
57
- /**
58
- * Returns the subject of the trigger mail.
59
- *
60
- * @return the subject of the trigger mail.
61
- */
62
- public function getSubject();
63
-
64
-
65
- /**
66
- * Returns the recipient address of the trigger mail.
67
- *
68
- * @return the recipient address of the trigger mail.
69
- */
70
- public function getRecipientAddress();
71
-
72
-
73
- /**
74
- * Returns the sender address of the trigger mail.
75
- *
76
- * @return the sender address of the trigger mail.
77
- */
78
- public function getSenderAddress();
79
-
80
-
81
- /**
82
- * Returns the reply address of the trigger mail. This address will be used for replies.
83
- *
84
- * @return the reply address of the trigger mail.
85
- */
86
- public function getReplyToAddress();
87
-
88
-
89
- /**
90
- * Returns the bounce address of the trigger mail. This address will be used for bounce messages.
91
- *
92
- * @return the bounce address of the trigger mail.
93
- */
94
- public function getBounceAddress();
95
-
96
-
97
- /**
98
- * Returns all regular attachments (files) of the trigger mail.
99
- *
100
- * @return all regular attachments of the trigger mail.
101
- */
102
- public function getAttachments();
103
-
104
-
105
- /**
106
- * Returns all embedded images of the trigger mail.
107
- *
108
- * @return all embedded images of the trigger mail.
109
- */
110
- public function getEmbeddedImages();
111
-
112
-
113
- /**
114
- * Returns the header informations of the trigger mail. The map contains the key/value-pair of the headers.
115
- * <p>
116
- * Note: This method allows header fields only to be defined once. If a header field is defined multiple times, the
117
- * last value will be used. If you wish to define header fields multiple times, use the
118
- * {@link #getMultipleHeaders()} method instead. Nonetheless, you should be aware that defining the same header
119
- * field multiple times is discouraged by RFC 5322 as this is an obsolete behavior only permitted by legacy
120
- * implementations.
121
- *
122
- * @return the header information of the trigger mail.
123
- */
124
- public function getHeader();
125
-
126
-
127
- /**
128
- * Returns the header information of the trigger mail. The list contains <code>HeaderField</code> objects
129
- * encapsulating the key/value-pairs of the headers. This method allows for multiple defined header fields.
130
- * <p>
131
- * Note: You should be aware that defining the same header field multiple times is discouraged by RFC 5322 as this
132
- * is an obsolete behavior only permitted by legacy implementations.
133
- *
134
- * @return the header information of the trigger mail.
135
- * @since API 1.9.0
136
- */
137
- public function getMultipleHeaders();
138
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * The <code>TriggerMailContent</code> contains the personalized content of a trigger mailing for a specific recipient.
9
+ * The information that can be retrieved from the <code>TriggerMailContent</code> includes:
10
+ * <ul>
11
+ * <li><i>The content type</i>: {@link #getContentType()}
12
+ * <li><i>Plain/HTML text</i>: {@link #getPlainText()} and {@link #getHtmlText()}
13
+ * <li><i>The subject</i>: {@link #getSubject()}
14
+ * <li><i>The recipient address</i>: {@link #getRecipientAddress()}
15
+ * <li><i>Attachments</i>: {@link #getAttachments()}
16
+ * <li><i>Embedded images</i>: {@link #getEmbeddedImages()}
17
+ * <li><i>The sender address</i>: {@link #getSenderAddress()}
18
+ * <li><i>The bounce and reply addresses</i>: {@link #getBounceAddress()} and {@link #getReplyToAddress()}
19
+ * <li><i>The mail headers</i>: {@link #getHeader()} or {@link #getMultipleHeaders()}
20
+ * </ul>
21
+ * A <code>TriggerMailContent</code> object is created by a {@link TriggerMailingRenderer} using its <code>build</code>
22
+ * methods.
23
+ *
24
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#build(int)
25
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailingRenderer#build(int, int)
26
+ * @since API 1.10.0
27
+ * @author chge, 09.07.2012
28
+ */
29
+ interface Inx_Api_TriggerMail_TriggerMailContent
30
+ {
31
+ /**
32
+ * Returns the content type of this trigger mail.
33
+ *
34
+ * @return the content type of this trigger mail.
35
+ */
36
+ public function getContentType();
37
+
38
+
39
+ /**
40
+ * Returns the HTML text part of the mail, or <code>null</code> if the mail type is
41
+ * {@link TriggerMailingContentType#PLAIN_TEXT}.
42
+ *
43
+ * @return the HTML text part of the mail, if any.
44
+ */
45
+ public function getHtmlText();
46
+
47
+
48
+ /**
49
+ * Returns the plain text part of the mail, or <code>null</code> if the mail type is
50
+ * {@link TriggerMailingContentType#HTML_TEXT}.
51
+ *
52
+ * @return the plain text part of the email, if any.
53
+ */
54
+ public function getPlainText();
55
+
56
+
57
+ /**
58
+ * Returns the subject of the trigger mail.
59
+ *
60
+ * @return the subject of the trigger mail.
61
+ */
62
+ public function getSubject();
63
+
64
+
65
+ /**
66
+ * Returns the recipient address of the trigger mail.
67
+ *
68
+ * @return the recipient address of the trigger mail.
69
+ */
70
+ public function getRecipientAddress();
71
+
72
+
73
+ /**
74
+ * Returns the sender address of the trigger mail.
75
+ *
76
+ * @return the sender address of the trigger mail.
77
+ */
78
+ public function getSenderAddress();
79
+
80
+
81
+ /**
82
+ * Returns the reply address of the trigger mail. This address will be used for replies.
83
+ *
84
+ * @return the reply address of the trigger mail.
85
+ */
86
+ public function getReplyToAddress();
87
+
88
+
89
+ /**
90
+ * Returns the bounce address of the trigger mail. This address will be used for bounce messages.
91
+ *
92
+ * @return the bounce address of the trigger mail.
93
+ */
94
+ public function getBounceAddress();
95
+
96
+
97
+ /**
98
+ * Returns all regular attachments (files) of the trigger mail.
99
+ *
100
+ * @return all regular attachments of the trigger mail.
101
+ */
102
+ public function getAttachments();
103
+
104
+
105
+ /**
106
+ * Returns all embedded images of the trigger mail.
107
+ *
108
+ * @return all embedded images of the trigger mail.
109
+ */
110
+ public function getEmbeddedImages();
111
+
112
+
113
+ /**
114
+ * Returns the header informations of the trigger mail. The map contains the key/value-pair of the headers.
115
+ * <p>
116
+ * Note: This method allows header fields only to be defined once. If a header field is defined multiple times, the
117
+ * last value will be used. If you wish to define header fields multiple times, use the
118
+ * {@link #getMultipleHeaders()} method instead. Nonetheless, you should be aware that defining the same header
119
+ * field multiple times is discouraged by RFC 5322 as this is an obsolete behavior only permitted by legacy
120
+ * implementations.
121
+ *
122
+ * @return the header information of the trigger mail.
123
+ */
124
+ public function getHeader();
125
+
126
+
127
+ /**
128
+ * Returns the header information of the trigger mail. The list contains <code>HeaderField</code> objects
129
+ * encapsulating the key/value-pairs of the headers. This method allows for multiple defined header fields.
130
+ * <p>
131
+ * Note: You should be aware that defining the same header field multiple times is discouraged by RFC 5322 as this
132
+ * is an obsolete behavior only permitted by legacy implementations.
133
+ *
134
+ * @return the header information of the trigger mail.
135
+ * @since API 1.9.0
136
+ */
137
+ public function getMultipleHeaders();
138
  }
lib/Inx/Api/TriggerMail/TriggerMailingConstants.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * The <code>TriggerMailingConstants</code> define some parameters for trigger mailings. The constants are used
9
- * internally only.
10
- *
11
- * @author chge, 02.08.2012
12
- */
13
- interface Inx_Api_TriggerMail_TriggerMailingConstants
14
- {
15
- /**
16
- * the array index of list type of trigger mailing business object
17
- */
18
- const INTERNAL_TRIGGER_MAILING_LIST_ID = 0;
19
-
20
- const INTERNAL_TRIGGER_MAILING_CONTENT_TYPE = 1;
21
-
22
- const INTERNAL_TRIGGER_MAILING_FEATURE_ID = 2;
23
-
24
- const TRIGGER_MAILING_MAX_CHANGEDATTR_SIZE = 20;
25
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * The <code>TriggerMailingConstants</code> define some parameters for trigger mailings. The constants are used
9
+ * internally only.
10
+ *
11
+ * @author chge, 02.08.2012
12
+ */
13
+ interface Inx_Api_TriggerMail_TriggerMailingConstants
14
+ {
15
+ /**
16
+ * the array index of list type of trigger mailing business object
17
+ */
18
+ const INTERNAL_TRIGGER_MAILING_LIST_ID = 0;
19
+
20
+ const INTERNAL_TRIGGER_MAILING_CONTENT_TYPE = 1;
21
+
22
+ const INTERNAL_TRIGGER_MAILING_FEATURE_ID = 2;
23
+
24
+ const TRIGGER_MAILING_MAX_CHANGEDATTR_SIZE = 20;
25
  }
lib/Inx/Api/TriggerMail/TriggerMailingContentType.php CHANGED
@@ -1,168 +1,168 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * The <code>TriggerMailingContentType</code> defines the content type of a trigger mailing.
9
- *
10
- * @author chge, 02.08.2012
11
- */
12
- final class Inx_Api_TriggerMail_TriggerMailingContentType
13
- {
14
- private static $HTML_TEXT = null;
15
-
16
- private static $PLAIN_TEXT = null;
17
-
18
- private static $MULTIPART = null;
19
-
20
- private static $XML_XSLT_HTML_TEXT = null;
21
-
22
- private static $XML_XSLT_PLAIN_TEXT = null;
23
-
24
- private static $XML_XSLT_MULTIPART = null;
25
-
26
- private static $SYSTEM = null;
27
-
28
- private static $UNKNOWN = null;
29
-
30
- /**
31
- * Mail type indicating a HTML text mail. This trigger mail has only a HTML text part.
32
- */
33
- public static final function HTML_TEXT()
34
- {
35
- if(self::$HTML_TEXT === null)
36
- self::$HTML_TEXT = new Inx_Api_TriggerMail_TriggerMailingContentType( 0 );
37
-
38
- return self::$HTML_TEXT;
39
- }
40
-
41
- /**
42
- * Mail type indicating a plain text mail. This trigger mail has only a plain text part.
43
- */
44
- public static final function PLAIN_TEXT()
45
- {
46
- if(self::$PLAIN_TEXT === null)
47
- self::$PLAIN_TEXT = new Inx_Api_TriggerMail_TriggerMailingContentType( 1 );
48
-
49
- return self::$PLAIN_TEXT;
50
- }
51
-
52
- /**
53
- * Mail type indicating a multipart mail. This trigger mail has a HTML and a plain text part.
54
- */
55
- public static final function MULTIPART()
56
- {
57
- if(self::$MULTIPART === null)
58
- self::$MULTIPART = new Inx_Api_TriggerMail_TriggerMailingContentType( 2 );
59
-
60
- return self::$MULTIPART;
61
- }
62
-
63
- /**
64
- * Mail type indicating a HTML text mail which uses a template defined in XML/XSLT. This trigger mail has only a
65
- * HTML text part.
66
- */
67
- public static final function XML_XSLT_HTML_TEXT()
68
- {
69
- if(self::$XML_XSLT_HTML_TEXT === null)
70
- self::$XML_XSLT_HTML_TEXT = new Inx_Api_TriggerMail_TriggerMailingContentType( 3 );
71
-
72
- return self::$XML_XSLT_HTML_TEXT;
73
- }
74
-
75
- /**
76
- * Mail type indicating a plain text mail which uses a template defined in XML/XSLT. This trigger mail has only a
77
- * plain text part.
78
- */
79
- public static final function XML_XSLT_PLAIN_TEXT()
80
- {
81
- if(self::$XML_XSLT_PLAIN_TEXT === null)
82
- self::$XML_XSLT_PLAIN_TEXT = new Inx_Api_TriggerMail_TriggerMailingContentType( 4 );
83
-
84
- return self::$XML_XSLT_PLAIN_TEXT;
85
- }
86
-
87
- /**
88
- * Mail type indicating a multipart mail which uses a template defined in XML/XSLT. This trigger mail has a HTML and
89
- * a plain text part.
90
- */
91
- public static final function XML_XSLT_MULTIPART()
92
- {
93
- if(self::$XML_XSLT_MULTIPART === null)
94
- self::$XML_XSLT_MULTIPART = new Inx_Api_TriggerMail_TriggerMailingContentType( 5 );
95
-
96
- return self::$XML_XSLT_MULTIPART;
97
- }
98
-
99
- /**
100
- * The default mail type used by the system.
101
- */
102
- public static final function SYSTEM()
103
- {
104
- if(self::$SYSTEM === null)
105
- self::$SYSTEM = new Inx_Api_TriggerMail_TriggerMailingContentType( -1 );
106
-
107
- return self::$SYSTEM;
108
- }
109
-
110
- /**
111
- * Constant for an unknown content type. This type indicates a version mismatch between API and server.
112
- */
113
- public static final function UNKNOWN()
114
- {
115
- if(self::$UNKNOWN === null)
116
- self::$UNKNOWN = new Inx_Api_TriggerMail_TriggerMailingContentType( -2 );
117
-
118
- return self::$UNKNOWN;
119
- }
120
-
121
- private $id;
122
-
123
-
124
- private function __construct( $iId )
125
- {
126
- $this->id = $iId;
127
- }
128
-
129
-
130
- /**
131
- * Returns the ID of the <code>TriggerMailingContentType</code>. The ID is used for transmission purposes and should
132
- * not be used inside client code.
133
- *
134
- * @return the ID of the <code>TriggerMailingContentType</code>.
135
- */
136
- public function getId()
137
- {
138
- return $this->id;
139
- }
140
-
141
-
142
- /**
143
- * Returns the <code>TriggerMailingContentType</code> corresponding to the given ID. If the ID is unknown, the
144
- * <code>UNKNOWN</code> content type will be returned. The ID is used for transmission purposes and should not be
145
- * used inside client code.
146
- *
147
- * @param id the ID of the <code>TriggerMailingContentType</code> to retrieve.
148
- * @return the <code>TriggerMailingContentType</code> corresponding to the given ID.
149
- */
150
- public static function byId( $iId )
151
- {
152
- foreach( self::values() as $type )
153
- {
154
- if( $type->getId() == $iId )
155
- {
156
- return $type;
157
- }
158
- }
159
-
160
- return self::UNKNOWN();
161
- }
162
-
163
- public static function values()
164
- {
165
- return array(self::HTML_TEXT(), self::PLAIN_TEXT(), self::MULTIPART(), self::XML_XSLT_HTML_TEXT(),
166
- self::XML_XSLT_PLAIN_TEXT(), self::XML_XSLT_MULTIPART(), self::SYSTEM(), self::UNKNOWN());
167
- }
168
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * The <code>TriggerMailingContentType</code> defines the content type of a trigger mailing.
9
+ *
10
+ * @author chge, 02.08.2012
11
+ */
12
+ final class Inx_Api_TriggerMail_TriggerMailingContentType
13
+ {
14
+ private static $HTML_TEXT = null;
15
+
16
+ private static $PLAIN_TEXT = null;
17
+
18
+ private static $MULTIPART = null;
19
+
20
+ private static $XML_XSLT_HTML_TEXT = null;
21
+
22
+ private static $XML_XSLT_PLAIN_TEXT = null;
23
+
24
+ private static $XML_XSLT_MULTIPART = null;
25
+
26
+ private static $SYSTEM = null;
27
+
28
+ private static $UNKNOWN = null;
29
+
30
+ /**
31
+ * Mail type indicating a HTML text mail. This trigger mail has only a HTML text part.
32
+ */
33
+ public static final function HTML_TEXT()
34
+ {
35
+ if(self::$HTML_TEXT === null)
36
+ self::$HTML_TEXT = new Inx_Api_TriggerMail_TriggerMailingContentType( 0 );
37
+
38
+ return self::$HTML_TEXT;
39
+ }
40
+
41
+ /**
42
+ * Mail type indicating a plain text mail. This trigger mail has only a plain text part.
43
+ */
44
+ public static final function PLAIN_TEXT()
45
+ {
46
+ if(self::$PLAIN_TEXT === null)
47
+ self::$PLAIN_TEXT = new Inx_Api_TriggerMail_TriggerMailingContentType( 1 );
48
+
49
+ return self::$PLAIN_TEXT;
50
+ }
51
+
52
+ /**
53
+ * Mail type indicating a multipart mail. This trigger mail has a HTML and a plain text part.
54
+ */
55
+ public static final function MULTIPART()
56
+ {
57
+ if(self::$MULTIPART === null)
58
+ self::$MULTIPART = new Inx_Api_TriggerMail_TriggerMailingContentType( 2 );
59
+
60
+ return self::$MULTIPART;
61
+ }
62
+
63
+ /**
64
+ * Mail type indicating a HTML text mail which uses a template defined in XML/XSLT. This trigger mail has only a
65
+ * HTML text part.
66
+ */
67
+ public static final function XML_XSLT_HTML_TEXT()
68
+ {
69
+ if(self::$XML_XSLT_HTML_TEXT === null)
70
+ self::$XML_XSLT_HTML_TEXT = new Inx_Api_TriggerMail_TriggerMailingContentType( 3 );
71
+
72
+ return self::$XML_XSLT_HTML_TEXT;
73
+ }
74
+
75
+ /**
76
+ * Mail type indicating a plain text mail which uses a template defined in XML/XSLT. This trigger mail has only a
77
+ * plain text part.
78
+ */
79
+ public static final function XML_XSLT_PLAIN_TEXT()
80
+ {
81
+ if(self::$XML_XSLT_PLAIN_TEXT === null)
82
+ self::$XML_XSLT_PLAIN_TEXT = new Inx_Api_TriggerMail_TriggerMailingContentType( 4 );
83
+
84
+ return self::$XML_XSLT_PLAIN_TEXT;
85
+ }
86
+
87
+ /**
88
+ * Mail type indicating a multipart mail which uses a template defined in XML/XSLT. This trigger mail has a HTML and
89
+ * a plain text part.
90
+ */
91
+ public static final function XML_XSLT_MULTIPART()
92
+ {
93
+ if(self::$XML_XSLT_MULTIPART === null)
94
+ self::$XML_XSLT_MULTIPART = new Inx_Api_TriggerMail_TriggerMailingContentType( 5 );
95
+
96
+ return self::$XML_XSLT_MULTIPART;
97
+ }
98
+
99
+ /**
100
+ * The default mail type used by the system.
101
+ */
102
+ public static final function SYSTEM()
103
+ {
104
+ if(self::$SYSTEM === null)
105
+ self::$SYSTEM = new Inx_Api_TriggerMail_TriggerMailingContentType( -1 );
106
+
107
+ return self::$SYSTEM;
108
+ }
109
+
110
+ /**
111
+ * Constant for an unknown content type. This type indicates a version mismatch between API and server.
112
+ */
113
+ public static final function UNKNOWN()
114
+ {
115
+ if(self::$UNKNOWN === null)
116
+ self::$UNKNOWN = new Inx_Api_TriggerMail_TriggerMailingContentType( -2 );
117
+
118
+ return self::$UNKNOWN;
119
+ }
120
+
121
+ private $id;
122
+
123
+
124
+ private function __construct( $iId )
125
+ {
126
+ $this->id = $iId;
127
+ }
128
+
129
+
130
+ /**
131
+ * Returns the ID of the <code>TriggerMailingContentType</code>. The ID is used for transmission purposes and should
132
+ * not be used inside client code.
133
+ *
134
+ * @return the ID of the <code>TriggerMailingContentType</code>.
135
+ */
136
+ public function getId()
137
+ {
138
+ return $this->id;
139
+ }
140
+
141
+
142
+ /**
143
+ * Returns the <code>TriggerMailingContentType</code> corresponding to the given ID. If the ID is unknown, the
144
+ * <code>UNKNOWN</code> content type will be returned. The ID is used for transmission purposes and should not be
145
+ * used inside client code.
146
+ *
147
+ * @param id the ID of the <code>TriggerMailingContentType</code> to retrieve.
148
+ * @return the <code>TriggerMailingContentType</code> corresponding to the given ID.
149
+ */
150
+ public static function byId( $iId )
151
+ {
152
+ foreach( self::values() as $type )
153
+ {
154
+ if( $type->getId() == $iId )
155
+ {
156
+ return $type;
157
+ }
158
+ }
159
+
160
+ return self::UNKNOWN();
161
+ }
162
+
163
+ public static function values()
164
+ {
165
+ return array(self::HTML_TEXT(), self::PLAIN_TEXT(), self::MULTIPART(), self::XML_XSLT_HTML_TEXT(),
166
+ self::XML_XSLT_PLAIN_TEXT(), self::XML_XSLT_MULTIPART(), self::SYSTEM(), self::UNKNOWN());
167
+ }
168
  }
lib/Inx/Api/TriggerMail/TriggerMailingExceptionType.php CHANGED
@@ -1,140 +1,140 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * The <code>TriggerMailingExceptionType</code> defines the type or category of an exception that occurred while
9
- * processing a request.
10
- *
11
- * @author chge, 02.08.2012
12
- */
13
- final class Inx_Api_TriggerMail_TriggerMailingExceptionType
14
- {
15
- private static $STATE = null;
16
-
17
- private static $RECIPIENT_NOT_FOUND = null;
18
-
19
- private static $MAILBUILD = null;
20
-
21
- private static $MAILING_FEATURE_DISABLED = null;
22
-
23
- private static $APPROVAL = null;
24
-
25
- private static $UNKNOWN = null;
26
-
27
-
28
- /**
29
- * Type for {@link MailingStateException}.
30
- */
31
- public static final function STATE()
32
- {
33
- if(null === self::$STATE)
34
- self::$STATE = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1000 );
35
-
36
- return self::$STATE;
37
- }
38
-
39
- /**
40
- * Type for {@link UnknownRecipientException} or an otherwise unknown recipient.
41
- */
42
- public static final function RECIPIENT_NOT_FOUND()
43
- {
44
- if(null === self::$RECIPIENT_NOT_FOUND)
45
- self::$RECIPIENT_NOT_FOUND = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1001 );
46
-
47
- return self::$RECIPIENT_NOT_FOUND;
48
- }
49
-
50
- /**
51
- * Type for an error which occurred during the building process of a mailing.
52
- */
53
- public static final function MAILBUILD()
54
- {
55
- if(null === self::$MAILBUILD)
56
- self::$MAILBUILD = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1002 );
57
-
58
- return self::$MAILBUILD;
59
- }
60
-
61
- /**
62
- * Type for missing mailing feature error.
63
- */
64
- public static final function MAILING_FEATURE_DISABLED()
65
- {
66
- if(null === self::$MAILING_FEATURE_DISABLED)
67
- self::$MAILING_FEATURE_DISABLED = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1003 );
68
-
69
- return self::$MAILING_FEATURE_DISABLED;
70
- }
71
-
72
- /**
73
- * Type for an error which occurred during the approval process of a mailing.
74
- */
75
- public static final function APPROVAL()
76
- {
77
- if(null === self::$APPROVAL)
78
- self::$APPROVAL = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1004 );
79
-
80
- return self::$APPROVAL;
81
- }
82
-
83
- /**
84
- * Type for an unknown error.
85
- */
86
- public static final function UNKNOWN()
87
- {
88
- if(null === self::$UNKNOWN)
89
- self::$UNKNOWN = new Inx_Api_TriggerMail_TriggerMailingExceptionType( -1 );
90
-
91
- return self::$UNKNOWN;
92
- }
93
-
94
- private $id;
95
-
96
-
97
- private function __construct( $iId )
98
- {
99
- $this->id = $iId;
100
- }
101
-
102
-
103
- /**
104
- * Returns the ID of the <code>TriggerMailingExceptionType</code>. The ID is used for transmission purposes and
105
- * should not be used inside client code.
106
- *
107
- * @return the ID of the <code>TriggerMailingExceptionType</code>.
108
- */
109
- public function getId()
110
- {
111
- return $this->id;
112
- }
113
-
114
-
115
- /**
116
- * Returns the <code>TriggerMailingExceptionType</code> corresponding to the given ID. If the ID is unknown, the
117
- * UNKNOWN type will be used. The ID is used for transmission purposes and should not be used inside client code.
118
- *
119
- * @param id the ID of the <code>TriggerMailingExceptionType</code> to retrieve.
120
- * @return the <code>TriggerState</code> TriggerMailingExceptionType to the given ID.
121
- */
122
- public static function byId( $iId )
123
- {
124
- foreach( self::values() as $type )
125
- {
126
- if( $type->getId() == $iId )
127
- {
128
- return $type;
129
- }
130
- }
131
-
132
- return self::UNKNOWN();
133
- }
134
-
135
- public static function values()
136
- {
137
- return array(self::STATE(), self::RECIPIENT_NOT_FOUND(), self::MAILBUILD(), self::MAILING_FEATURE_DISABLED(),
138
- self::APPROVAL(), self::UNKNOWN());
139
- }
140
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * The <code>TriggerMailingExceptionType</code> defines the type or category of an exception that occurred while
9
+ * processing a request.
10
+ *
11
+ * @author chge, 02.08.2012
12
+ */
13
+ final class Inx_Api_TriggerMail_TriggerMailingExceptionType
14
+ {
15
+ private static $STATE = null;
16
+
17
+ private static $RECIPIENT_NOT_FOUND = null;
18
+
19
+ private static $MAILBUILD = null;
20
+
21
+ private static $MAILING_FEATURE_DISABLED = null;
22
+
23
+ private static $APPROVAL = null;
24
+
25
+ private static $UNKNOWN = null;
26
+
27
+
28
+ /**
29
+ * Type for {@link MailingStateException}.
30
+ */
31
+ public static final function STATE()
32
+ {
33
+ if(null === self::$STATE)
34
+ self::$STATE = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1000 );
35
+
36
+ return self::$STATE;
37
+ }
38
+
39
+ /**
40
+ * Type for {@link UnknownRecipientException} or an otherwise unknown recipient.
41
+ */
42
+ public static final function RECIPIENT_NOT_FOUND()
43
+ {
44
+ if(null === self::$RECIPIENT_NOT_FOUND)
45
+ self::$RECIPIENT_NOT_FOUND = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1001 );
46
+
47
+ return self::$RECIPIENT_NOT_FOUND;
48
+ }
49
+
50
+ /**
51
+ * Type for an error which occurred during the building process of a mailing.
52
+ */
53
+ public static final function MAILBUILD()
54
+ {
55
+ if(null === self::$MAILBUILD)
56
+ self::$MAILBUILD = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1002 );
57
+
58
+ return self::$MAILBUILD;
59
+ }
60
+
61
+ /**
62
+ * Type for missing mailing feature error.
63
+ */
64
+ public static final function MAILING_FEATURE_DISABLED()
65
+ {
66
+ if(null === self::$MAILING_FEATURE_DISABLED)
67
+ self::$MAILING_FEATURE_DISABLED = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1003 );
68
+
69
+ return self::$MAILING_FEATURE_DISABLED;
70
+ }
71
+
72
+ /**
73
+ * Type for an error which occurred during the approval process of a mailing.
74
+ */
75
+ public static final function APPROVAL()
76
+ {
77
+ if(null === self::$APPROVAL)
78
+ self::$APPROVAL = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1004 );
79
+
80
+ return self::$APPROVAL;
81
+ }
82
+
83
+ /**
84
+ * Type for an unknown error.
85
+ */
86
+ public static final function UNKNOWN()
87
+ {
88
+ if(null === self::$UNKNOWN)
89
+ self::$UNKNOWN = new Inx_Api_TriggerMail_TriggerMailingExceptionType( -1 );
90
+
91
+ return self::$UNKNOWN;
92
+ }
93
+
94
+ private $id;
95
+
96
+
97
+ private function __construct( $iId )
98
+ {
99
+ $this->id = $iId;
100
+ }
101
+
102
+
103
+ /**
104
+ * Returns the ID of the <code>TriggerMailingExceptionType</code>. The ID is used for transmission purposes and
105
+ * should not be used inside client code.
106
+ *
107
+ * @return the ID of the <code>TriggerMailingExceptionType</code>.
108
+ */
109
+ public function getId()
110
+ {
111
+ return $this->id;
112
+ }
113
+
114
+
115
+ /**
116
+ * Returns the <code>TriggerMailingExceptionType</code> corresponding to the given ID. If the ID is unknown, the
117
+ * UNKNOWN type will be used. The ID is used for transmission purposes and should not be used inside client code.
118
+ *
119
+ * @param id the ID of the <code>TriggerMailingExceptionType</code> to retrieve.
120
+ * @return the <code>TriggerState</code> TriggerMailingExceptionType to the given ID.
121
+ */
122
+ public static function byId( $iId )
123
+ {
124
+ foreach( self::values() as $type )
125
+ {
126
+ if( $type->getId() == $iId )
127
+ {
128
+ return $type;
129
+ }
130
+ }
131
+
132
+ return self::UNKNOWN();
133
+ }
134
+
135
+ public static function values()
136
+ {
137
+ return array(self::STATE(), self::RECIPIENT_NOT_FOUND(), self::MAILBUILD(), self::MAILING_FEATURE_DISABLED(),
138
+ self::APPROVAL(), self::UNKNOWN());
139
+ }
140
  }
lib/Inx/Api/TriggerMail/TriggerMailingRenderer.php CHANGED
@@ -1,285 +1,285 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMail
5
- */
6
-
7
- /**
8
- * The <code>TriggerMailingRenderer</code> is used to generate mail content using the API. The main use of the class
9
- * will be to generate personalized previews of trigger mailings. The class can also be used to generate and send single
10
- * trigger mails using a different mail sender. Be aware that in this case the mail sending rate would decrease
11
- * enormously.
12
- * <p>
13
- * To preview a trigger mailing, take a <code>TriggerMailingRenderer</code> from the
14
- * {@link com.inxmail.xpro.api.triggermailing.TriggerMailingManager TriggerMailingManager}. Each mailing needs to be
15
- * parsed before building it. The following snippet shows how to build a trigger mail for a given recipient:
16
- *
17
- * <pre>
18
- * TriggerMailingRenderer renderer = session.getTriggerMailingManager().createRenderer();
19
- *
20
- * renderer.parse( mailing.getId(), BuildMode.ALTERNATIVEVIEW_ACTIVE );
21
- *
22
- * TriggerMailContent content = renderer.build( recipientId );
23
- * </pre>
24
- * <p>
25
- * <code>TriggerMailingRenderer</code> can handle the following different build modes:
26
- * <ol>
27
- * <li>{@link BuildMode#PREVIEW} - Trackable links will not trigger any events, unsubscription links will redirect but
28
- * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
29
- * <li>{@link BuildMode#ALTERNATIVEVIEW_ACTIVE} - All links are fully functional. Embedded images are replaced with http
30
- * references to image resources on the Inxmail server.
31
- * <li>{@link BuildMode#ALTERNATIVEVIEW_INACTIVE} - All links are not functional. Embedded images are replaced with http
32
- * references to image resources on the Inxmail server.
33
- * <li>{@link BuildMode#NORMAL} - The mail is rendered, ready to be sent.
34
- * <li>{@link BuildMode#ARCHIVE} - Trackable links will not trigger any events, unsubscription links will redirect but
35
- * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
36
- * <li>{@link BuildMode#ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS} - All links are fully functional but converted to simple
37
- * links. Embedded images are replaced with http references to image resources on the Inxmail server.
38
- * <li>{@link BuildMode#NEWSLETTER_SIMPLE_LINKS} - The same as above, but the function InInboxView returns true.
39
- * </ol>
40
- * <p>
41
- * <strong>Note:</strong> A <code>TriggerMailingRenderer</code> object <strong>must</strong> be closed once it is not
42
- * needed anymore to prevent memory leaks and other potentially harmful side effects.
43
- *
44
- * @see com.inxmail.xpro.api.triggermail.TriggerMailContent
45
- * @since API 1.10.0
46
- * @author chge, 09.07.2012
47
- */
48
- interface Inx_Api_TriggerMail_TriggerMailingRenderer
49
- {
50
- /**
51
- * Prepares the trigger mailing for a preview. It checks the mail quality (syntax errors, references to orphaned
52
- * elements, ... ).<br>
53
- * Errors will be listed in the <code>ParseException</code><br>
54
- * The mailingId is supposed to be valid (existing trigger mailing).<br>
55
- *
56
- * @param mailingId the id of the trigger mailing to be parsed.
57
- * @param sendingId the id of the sending of the trigger mailing.
58
- * @param buildMode the mode of the build. The mode <code>UNKNOWN</code> is illegal.
59
- * @throws ParseException if any syntax error is present in the trigger mail.
60
- * @throws APIException if the trigger mailing id is no longer valid.
61
- * @throws IllegalArgumentException if the build mode is <code>UNKNOWN</code>.
62
- */
63
- public function parse($iMailingId, Inx_Api_TriggerMail_BuildMode $buildMode, $iSendingId = null);
64
-
65
-
66
- /**
67
- * Generates the personalized trigger mail content (recipient address, subject, HTML and/or plain text, ...) for the
68
- * specified recipient with a specified mail type restriction.
69
- *
70
- * @param recipientId the id of the recipient for which the trigger mail shall be personalized.
71
- * @param preferredMailType the mail type. <code>UNKNOWN</code> is not allowed.
72
- * @return the personalized content of the trigger mail.
73
- * @throws BuildException if the recipient could not be found, or the building failed.
74
- * @throws IllegalArgumentException if the preferred mail type is <code>UNKNOWN</code>.
75
- */
76
- public function build( $iRecipientId, Inx_Api_TriggerMail_TriggerMailingContentType $preferredMailType = null );
77
-
78
-
79
- /**
80
- * Closes this <code>TriggerMailingRenderer</code> and releases any server resources associated with this object. A
81
- * <code>TriggerMailingRenderer</code> object <strong>must</strong> be closed once it is not needed anymore to
82
- * prevent memory leaks and other potentially harmful side effects.
83
- */
84
- public function close();
85
- }
86
-
87
- /**
88
- * The <code>ParseResultCode</code> defines the result of the server side parsing process.
89
- *
90
- * @author chge, 02.08.2012
91
- */
92
- final class Inx_Api_TriggerMail_ParseResultCode
93
- {
94
- private static $PARSE_SUCCESSFUL = null;
95
-
96
- private static $PARSE_EXCEPTION = null;
97
-
98
- private static $MAILING_NOT_FOUND = null;
99
-
100
- private static $UNKNOWN = null;
101
-
102
- /**
103
- * The mailing was successfully parsed.
104
- */
105
- public static final function PARSE_SUCCESSFUL()
106
- {
107
- if(null === self::$PARSE_SUCCESSFUL)
108
- self::$PARSE_SUCCESSFUL = new Inx_Api_TriggerMail_ParseResultCode( 1 );
109
-
110
- return self::$PARSE_SUCCESSFUL;
111
- }
112
-
113
- /**
114
- * An exception occurred during the parsing process.
115
- */
116
- public static final function PARSE_EXCEPTION()
117
- {
118
- if(null === self::$PARSE_EXCEPTION)
119
- self::$PARSE_EXCEPTION = new Inx_Api_TriggerMail_ParseResultCode( 2 );
120
-
121
- return self::$PARSE_EXCEPTION;
122
- }
123
-
124
- /**
125
- * The mailing could not be found (i.e. was deleted).
126
- */
127
- public static final function MAILING_NOT_FOUND()
128
- {
129
- if(null === self::$MAILING_NOT_FOUND)
130
- self::$MAILING_NOT_FOUND = new Inx_Api_TriggerMail_ParseResultCode( 3 );
131
-
132
- return self::$MAILING_NOT_FOUND;
133
- }
134
-
135
- /**
136
- * The result is unknown. This indicates an unknown error.
137
- */
138
- public static final function UNKNOWN()
139
- {
140
- if(null == self::$UNKNOWN)
141
- self::$UNKNOWN = new Inx_Api_TriggerMail_ParseResultCode( -1 );
142
-
143
- return self::$UNKNOWN;
144
- }
145
-
146
- private $id;
147
-
148
-
149
- private function __construct( $iId )
150
- {
151
- $this->id = $iId;
152
- }
153
-
154
-
155
- /**
156
- * Returns the ID of the <code>ParseResultCode</code>. The ID is used for transmission purposes and should not
157
- * be used inside client code.
158
- *
159
- * @return the ID of the <code>ParseResultCode</code>.
160
- */
161
- public function getId()
162
- {
163
- return $this->id;
164
- }
165
-
166
-
167
- /**
168
- * Returns the <code>ParseResultCode</code> corresponding to the given ID. If the ID is unknown, the UNKNOWN
169
- * code will be used. The ID is used for transmission purposes and should not be used inside client code.
170
- *
171
- * @param id the ID of the <code>ParseResultCode</code> to retrieve.
172
- * @return the <code>ParseResultCode</code> corresponding to the given ID.
173
- */
174
- public static function byId( $iId )
175
- {
176
- foreach( self::values() as $result )
177
- {
178
- if( $result->getId() == $iId )
179
- {
180
- return $result;
181
- }
182
- }
183
-
184
- return self::UNKNOWN();
185
- }
186
-
187
- public static function values()
188
- {
189
- return array(self::PARSE_SUCCESSFUL(), self::PARSE_EXCEPTION(), self::MAILING_NOT_FOUND(), self::UNKNOWN());
190
- }
191
- }
192
-
193
-
194
- /**
195
- * The <code>BuildResultCode</code> defines the result of the server side building process.
196
- *
197
- * @author chge, 02.08.2012
198
- */
199
- final class Inx_Api_TriggerMail_BuildResultCode
200
- {
201
- private static $BUILD_SUCCESSFUL = null;
202
-
203
- private static $BUILD_EXCEPTION = null;
204
-
205
- private static $UNKNOWN = null;
206
-
207
- /**
208
- * The mailing was successfully built.
209
- */
210
- public static final function BUILD_SUCCESSFUL()
211
- {
212
- if(null === self::$BUILD_SUCCESSFUL)
213
- self::$BUILD_SUCCESSFUL = new Inx_Api_TriggerMail_BuildResultCode( 1 );
214
-
215
- return self::$BUILD_SUCCESSFUL;
216
- }
217
-
218
- /**
219
- * An exception occurred during the build of the mailing.
220
- */
221
- public static final function BUILD_EXCEPTION()
222
- {
223
- if(null === self::$BUILD_EXCEPTION)
224
- self::$BUILD_EXCEPTION = new Inx_Api_TriggerMail_BuildResultCode( 2 );
225
-
226
- return self::$BUILD_EXCEPTION;
227
- }
228
-
229
- /**
230
- * The result is unknown. This indicates an unknown error.
231
- */
232
- public static final function UNKNOWN()
233
- {
234
- if(null === self::$UNKNOWN)
235
- self::$UNKNOWN = new Inx_Api_TriggerMail_BuildResultCode( -1 );
236
-
237
- return self::$UNKNOWN;
238
- }
239
-
240
- private $id;
241
-
242
-
243
- private function __construct( $iId )
244
- {
245
- $this->id = $iId;
246
- }
247
-
248
-
249
- /**
250
- * Returns the ID of the <code>BuildResultCode</code>. The ID is used for transmission purposes and should not
251
- * be used inside client code.
252
- *
253
- * @return the ID of the <code>BuildResultCode</code>.
254
- */
255
- public function getId()
256
- {
257
- return $this->id;
258
- }
259
-
260
-
261
- /**
262
- * Returns the <code>BuildResultCode</code> corresponding to the given ID. If the ID is unknown, the UNKNOWN
263
- * code will be used. The ID is used for transmission purposes and should not be used inside client code.
264
- *
265
- * @param id the ID of the <code>BuildResultCode</code> to retrieve.
266
- * @return the <code>BuildResultCode</code> corresponding to the given ID.
267
- */
268
- public static function byId( $iId )
269
- {
270
- foreach( self::values() as $result )
271
- {
272
- if( $result->getId() == $iId )
273
- {
274
- return $result;
275
- }
276
- }
277
-
278
- return self::UNKNOWN();
279
- }
280
-
281
- public static function values()
282
- {
283
- return array(self::BUILD_SUCCESSFUL(), self::BUILD_EXCEPTION(), self::UNKNOWN());
284
- }
285
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMail
5
+ */
6
+
7
+ /**
8
+ * The <code>TriggerMailingRenderer</code> is used to generate mail content using the API. The main use of the class
9
+ * will be to generate personalized previews of trigger mailings. The class can also be used to generate and send single
10
+ * trigger mails using a different mail sender. Be aware that in this case the mail sending rate would decrease
11
+ * enormously.
12
+ * <p>
13
+ * To preview a trigger mailing, take a <code>TriggerMailingRenderer</code> from the
14
+ * {@link com.inxmail.xpro.api.triggermailing.TriggerMailingManager TriggerMailingManager}. Each mailing needs to be
15
+ * parsed before building it. The following snippet shows how to build a trigger mail for a given recipient:
16
+ *
17
+ * <pre>
18
+ * TriggerMailingRenderer renderer = session.getTriggerMailingManager().createRenderer();
19
+ *
20
+ * renderer.parse( mailing.getId(), BuildMode.ALTERNATIVEVIEW_ACTIVE );
21
+ *
22
+ * TriggerMailContent content = renderer.build( recipientId );
23
+ * </pre>
24
+ * <p>
25
+ * <code>TriggerMailingRenderer</code> can handle the following different build modes:
26
+ * <ol>
27
+ * <li>{@link BuildMode#PREVIEW} - Trackable links will not trigger any events, unsubscription links will redirect but
28
+ * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
29
+ * <li>{@link BuildMode#ALTERNATIVEVIEW_ACTIVE} - All links are fully functional. Embedded images are replaced with http
30
+ * references to image resources on the Inxmail server.
31
+ * <li>{@link BuildMode#ALTERNATIVEVIEW_INACTIVE} - All links are not functional. Embedded images are replaced with http
32
+ * references to image resources on the Inxmail server.
33
+ * <li>{@link BuildMode#NORMAL} - The mail is rendered, ready to be sent.
34
+ * <li>{@link BuildMode#ARCHIVE} - Trackable links will not trigger any events, unsubscription links will redirect but
35
+ * not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
36
+ * <li>{@link BuildMode#ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS} - All links are fully functional but converted to simple
37
+ * links. Embedded images are replaced with http references to image resources on the Inxmail server.
38
+ * <li>{@link BuildMode#NEWSLETTER_SIMPLE_LINKS} - The same as above, but the function InInboxView returns true.
39
+ * </ol>
40
+ * <p>
41
+ * <strong>Note:</strong> A <code>TriggerMailingRenderer</code> object <strong>must</strong> be closed once it is not
42
+ * needed anymore to prevent memory leaks and other potentially harmful side effects.
43
+ *
44
+ * @see com.inxmail.xpro.api.triggermail.TriggerMailContent
45
+ * @since API 1.10.0
46
+ * @author chge, 09.07.2012
47
+ */
48
+ interface Inx_Api_TriggerMail_TriggerMailingRenderer
49
+ {
50
+ /**
51
+ * Prepares the trigger mailing for a preview. It checks the mail quality (syntax errors, references to orphaned
52
+ * elements, ... ).<br>
53
+ * Errors will be listed in the <code>ParseException</code><br>
54
+ * The mailingId is supposed to be valid (existing trigger mailing).<br>
55
+ *
56
+ * @param mailingId the id of the trigger mailing to be parsed.
57
+ * @param sendingId the id of the sending of the trigger mailing.
58
+ * @param buildMode the mode of the build. The mode <code>UNKNOWN</code> is illegal.
59
+ * @throws ParseException if any syntax error is present in the trigger mail.
60
+ * @throws APIException if the trigger mailing id is no longer valid.
61
+ * @throws IllegalArgumentException if the build mode is <code>UNKNOWN</code>.
62
+ */
63
+ public function parse($iMailingId, Inx_Api_TriggerMail_BuildMode $buildMode, $iSendingId = null);
64
+
65
+
66
+ /**
67
+ * Generates the personalized trigger mail content (recipient address, subject, HTML and/or plain text, ...) for the
68
+ * specified recipient with a specified mail type restriction.
69
+ *
70
+ * @param recipientId the id of the recipient for which the trigger mail shall be personalized.
71
+ * @param preferredMailType the mail type. <code>UNKNOWN</code> is not allowed.
72
+ * @return the personalized content of the trigger mail.
73
+ * @throws BuildException if the recipient could not be found, or the building failed.
74
+ * @throws IllegalArgumentException if the preferred mail type is <code>UNKNOWN</code>.
75
+ */
76
+ public function build( $iRecipientId, Inx_Api_TriggerMail_TriggerMailingContentType $preferredMailType = null );
77
+
78
+
79
+ /**
80
+ * Closes this <code>TriggerMailingRenderer</code> and releases any server resources associated with this object. A
81
+ * <code>TriggerMailingRenderer</code> object <strong>must</strong> be closed once it is not needed anymore to
82
+ * prevent memory leaks and other potentially harmful side effects.
83
+ */
84
+ public function close();
85
+ }
86
+
87
+ /**
88
+ * The <code>ParseResultCode</code> defines the result of the server side parsing process.
89
+ *
90
+ * @author chge, 02.08.2012
91
+ */
92
+ final class Inx_Api_TriggerMail_ParseResultCode
93
+ {
94
+ private static $PARSE_SUCCESSFUL = null;
95
+
96
+ private static $PARSE_EXCEPTION = null;
97
+
98
+ private static $MAILING_NOT_FOUND = null;
99
+
100
+ private static $UNKNOWN = null;
101
+
102
+ /**
103
+ * The mailing was successfully parsed.
104
+ */
105
+ public static final function PARSE_SUCCESSFUL()
106
+ {
107
+ if(null === self::$PARSE_SUCCESSFUL)
108
+ self::$PARSE_SUCCESSFUL = new Inx_Api_TriggerMail_ParseResultCode( 1 );
109
+
110
+ return self::$PARSE_SUCCESSFUL;
111
+ }
112
+
113
+ /**
114
+ * An exception occurred during the parsing process.
115
+ */
116
+ public static final function PARSE_EXCEPTION()
117
+ {
118
+ if(null === self::$PARSE_EXCEPTION)
119
+ self::$PARSE_EXCEPTION = new Inx_Api_TriggerMail_ParseResultCode( 2 );
120
+
121
+ return self::$PARSE_EXCEPTION;
122
+ }
123
+
124
+ /**
125
+ * The mailing could not be found (i.e. was deleted).
126
+ */
127
+ public static final function MAILING_NOT_FOUND()
128
+ {
129
+ if(null === self::$MAILING_NOT_FOUND)
130
+ self::$MAILING_NOT_FOUND = new Inx_Api_TriggerMail_ParseResultCode( 3 );
131
+
132
+ return self::$MAILING_NOT_FOUND;
133
+ }
134
+
135
+ /**
136
+ * The result is unknown. This indicates an unknown error.
137
+ */
138
+ public static final function UNKNOWN()
139
+ {
140
+ if(null == self::$UNKNOWN)
141
+ self::$UNKNOWN = new Inx_Api_TriggerMail_ParseResultCode( -1 );
142
+
143
+ return self::$UNKNOWN;
144
+ }
145
+
146
+ private $id;
147
+
148
+
149
+ private function __construct( $iId )
150
+ {
151
+ $this->id = $iId;
152
+ }
153
+
154
+
155
+ /**
156
+ * Returns the ID of the <code>ParseResultCode</code>. The ID is used for transmission purposes and should not
157
+ * be used inside client code.
158
+ *
159
+ * @return the ID of the <code>ParseResultCode</code>.
160
+ */
161
+ public function getId()
162
+ {
163
+ return $this->id;
164
+ }
165
+
166
+
167
+ /**
168
+ * Returns the <code>ParseResultCode</code> corresponding to the given ID. If the ID is unknown, the UNKNOWN
169
+ * code will be used. The ID is used for transmission purposes and should not be used inside client code.
170
+ *
171
+ * @param id the ID of the <code>ParseResultCode</code> to retrieve.
172
+ * @return the <code>ParseResultCode</code> corresponding to the given ID.
173
+ */
174
+ public static function byId( $iId )
175
+ {
176
+ foreach( self::values() as $result )
177
+ {
178
+ if( $result->getId() == $iId )
179
+ {
180
+ return $result;
181
+ }
182
+ }
183
+
184
+ return self::UNKNOWN();
185
+ }
186
+
187
+ public static function values()
188
+ {
189
+ return array(self::PARSE_SUCCESSFUL(), self::PARSE_EXCEPTION(), self::MAILING_NOT_FOUND(), self::UNKNOWN());
190
+ }
191
+ }
192
+
193
+
194
+ /**
195
+ * The <code>BuildResultCode</code> defines the result of the server side building process.
196
+ *
197
+ * @author chge, 02.08.2012
198
+ */
199
+ final class Inx_Api_TriggerMail_BuildResultCode
200
+ {
201
+ private static $BUILD_SUCCESSFUL = null;
202
+
203
+ private static $BUILD_EXCEPTION = null;
204
+
205
+ private static $UNKNOWN = null;
206
+
207
+ /**
208
+ * The mailing was successfully built.
209
+ */
210
+ public static final function BUILD_SUCCESSFUL()
211
+ {
212
+ if(null === self::$BUILD_SUCCESSFUL)
213
+ self::$BUILD_SUCCESSFUL = new Inx_Api_TriggerMail_BuildResultCode( 1 );
214
+
215
+ return self::$BUILD_SUCCESSFUL;
216
+ }
217
+
218
+ /**
219
+ * An exception occurred during the build of the mailing.
220
+ */
221
+ public static final function BUILD_EXCEPTION()
222
+ {
223
+ if(null === self::$BUILD_EXCEPTION)
224
+ self::$BUILD_EXCEPTION = new Inx_Api_TriggerMail_BuildResultCode( 2 );
225
+
226
+ return self::$BUILD_EXCEPTION;
227
+ }
228
+
229
+ /**
230
+ * The result is unknown. This indicates an unknown error.
231
+ */
232
+ public static final function UNKNOWN()
233
+ {
234
+ if(null === self::$UNKNOWN)
235
+ self::$UNKNOWN = new Inx_Api_TriggerMail_BuildResultCode( -1 );
236
+
237
+ return self::$UNKNOWN;
238
+ }
239
+
240
+ private $id;
241
+
242
+
243
+ private function __construct( $iId )
244
+ {
245
+ $this->id = $iId;
246
+ }
247
+
248
+
249
+ /**
250
+ * Returns the ID of the <code>BuildResultCode</code>. The ID is used for transmission purposes and should not
251
+ * be used inside client code.
252
+ *
253
+ * @return the ID of the <code>BuildResultCode</code>.
254
+ */
255
+ public function getId()
256
+ {
257
+ return $this->id;
258
+ }
259
+
260
+
261
+ /**
262
+ * Returns the <code>BuildResultCode</code> corresponding to the given ID. If the ID is unknown, the UNKNOWN
263
+ * code will be used. The ID is used for transmission purposes and should not be used inside client code.
264
+ *
265
+ * @param id the ID of the <code>BuildResultCode</code> to retrieve.
266
+ * @return the <code>BuildResultCode</code> corresponding to the given ID.
267
+ */
268
+ public static function byId( $iId )
269
+ {
270
+ foreach( self::values() as $result )
271
+ {
272
+ if( $result->getId() == $iId )
273
+ {
274
+ return $result;
275
+ }
276
+ }
277
+
278
+ return self::UNKNOWN();
279
+ }
280
+
281
+ public static function values()
282
+ {
283
+ return array(self::BUILD_SUCCESSFUL(), self::BUILD_EXCEPTION(), self::UNKNOWN());
284
+ }
285
  }
lib/Inx/Api/TriggerMailing/Descriptor/ActionTriggerDescriptorBuilder.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMailing_Descriptor
5
- */
6
-
7
- /**
8
- * The <i>Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder</i> is used to easily create action triggers.
9
- * The following example shows how to create an action trigger descriptor:
10
- *
11
- * <pre>
12
- * $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
13
- * $descriptor = $factory->createActionTriggerDescriptorBuilder()->build();
14
- * </pre>
15
- *
16
- * @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createActionTriggerDescriptorBuilder()
17
- * @since API 1.10.0
18
- * @author chge, 16.07.2012
19
- */
20
- interface Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder extends Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
21
- {
22
-
23
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMailing_Descriptor
5
+ */
6
+
7
+ /**
8
+ * The <i>Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder</i> is used to easily create action triggers.
9
+ * The following example shows how to create an action trigger descriptor:
10
+ *
11
+ * <pre>
12
+ * $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
13
+ * $descriptor = $factory->createActionTriggerDescriptorBuilder()->build();
14
+ * </pre>
15
+ *
16
+ * @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createActionTriggerDescriptorBuilder()
17
+ * @since API 1.10.0
18
+ * @author chge, 16.07.2012
19
+ */
20
+ interface Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder extends Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
21
+ {
22
+
23
  }
lib/Inx/Api/TriggerMailing/Descriptor/AnniversaryTriggerDescriptorBuilder.php CHANGED
@@ -1,100 +1,100 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMailing_Descriptor
5
- */
6
-
7
- /**
8
- * The <i>Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder</i> is used to easily create anniversary
9
- * triggers. The following settings are mandatory:
10
- * <p>
11
- * <ul>
12
- * <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
13
- * <li><b>The sending time</b>: Defines the time at which the trigger will be fired during each dispatch cycle.
14
- * <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients.
15
- * <li><b>The column modificator</b>: Defines how long after or before a specific date the trigger shall be fired.
16
- * </ul>
17
- * <p>
18
- * Using only these settings the easiest possible anniversary trigger descriptor can be built using the following
19
- * statements:
20
- *
21
- * <pre>
22
- * $rmd = $session->createRecipientContext()->getMetaData();
23
- * $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
24
- * $sendingTime = date('c', mktime(12, 30));
25
- *
26
- * $modificator = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
27
- * Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
28
- * Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 50);
29
- *
30
- * $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
31
- * $builder = $factory->createAnniversaryTriggerDescriptorBuilder();
32
- * $builder->startDate( date('c') );
33
- * $builder->sendingTime( $sendingTime );
34
- * $builder->attribute( $birthdayId );
35
- * $builder->columnModificator( $modificator );
36
- * $descriptor = $builder->build();
37
- * </pre>
38
- * <p>
39
- * There are also some optional settings which can be set:
40
- * <p>
41
- * <ul>
42
- * <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
43
- * <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
44
- * trigger mailing shall be dispatched to a recipient.
45
- * <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
46
- * trigger mailing.
47
- * </ul>
48
- * <p>
49
- * Using all of these settings, the trigger descriptor could be built with the following statements:
50
- *
51
- * <pre>
52
- * $rmd = $session->createRecipientContext()->getMetaData();
53
- * $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
54
- * $counterId = $rmd->getUserAttribute( "Counter" )->getId();
55
- * $endDate = date('c', strtotime('+1 year'));
56
- * $sendingTime = date('c', mktime(12, 30));
57
- *
58
- * $modificator = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
59
- * Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
60
- * Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 50);
61
- *
62
- * $offset = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
63
- * Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
64
- * Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1);
65
- *
66
- * $cmdFactory = $session->getActionManager()->getCommandFactory();
67
- * $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
68
- * $commands = array( $cmd );
69
- *
70
- * $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
71
- * $descriptor = $factory->createAnniversaryTriggerDescriptorBuilder()->startDate( date('c') )
72
- * ->sendingTime( $sendingTime )->endDate( $endDate )->attribute( $birthdayId )
73
- * ->columnModificator( $modificator )->offset( $offset )->attributeValueSetters( $commands )
74
- * ->build();
75
- * </pre>
76
- *
77
- * The created trigger will fire one day before a recipients 50th birthday at 12:30 and will increase the Counter
78
- * attribute. The trigger will be active from now on till the next year.
79
- *
80
- * @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createAnniversaryTriggerDescriptorBuilder()
81
- * @since API 1.10.0
82
- * @author chge, 16.07.2012
83
- */
84
- interface Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder
85
- extends Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder
86
- {
87
- /**
88
- * Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to define the time span between the
89
- * dispatch date and the date specified by the attribute. Be aware that the only legal offset type is WAS_AGO.
90
- * For example: An anniversary trigger mailing can be sent out ten years after the date specified by the attribute.
91
- * This setting is mandatory.
92
- *
93
- * @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $columnModificator the <i>TimeTriggerOffset</i> used
94
- * to define the time span between the dispatch date and the date specified by the attribute.
95
- * @return Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder the builder.
96
- * @throws Inx_Api_NullPointerException if the given offset is <i>null</i>.
97
- * @throws Inx_Api_IllegalArgumentException if the offset type is not WAS_AGO.
98
- */
99
- public function columnModificator( Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $columnModificator );
100
  }
1
+ <?php
2
+ /**
3
+ * @package Inxmail
4
+ * @subpackage TriggerMailing_Descriptor
5
+ */
6
+
7
+ /**
8
+ * The <i>Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder</i> is used to easily create anniversary
9
+ * triggers. The following settings are mandatory:
10
+ * <p>
11
+ * <ul>
12
+ * <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
13
+ * <li><b>The sending time</b>: Defines the time at which the trigger will be fired during each dispatch cycle.
14
+ * <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients.
15
+ * <li><b>The column modificator</b>: Defines how long after or before a specific date the trigger shall be fired.
16
+ * </ul>
17
+ * <p>
18
+ * Using only these settings the easiest possible anniversary trigger descriptor can be built using the following
19
+ * statements:
20
+ *
21
+ * <pre>
22
+ * $rmd = $session->createRecipientContext()->getMetaData();
23
+ * $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
24
+ * $sendingTime = date('c', mktime(12, 30));
25
+ *
26
+ * $modificator = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
27
+ * Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
28
+ * Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 50);
29
+ *
30
+ * $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
31
+ * $builder = $factory->createAnniversaryTriggerDescriptorBuilder();
32
+ * $builder->startDate( date('c') );
33
+ * $builder->sendingTime( $sendingTime );
34
+ * $builder->attribute( $birthdayId );
35
+ * $builder->columnModificator( $modificator );
36
+ * $descriptor = $builder->build();
37
+ * </pre>
38
+ * <p>
39
+ * There are also some optional settings which can be set:
40
+ * <p>
41
+ * <ul>
42
+ * <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
43
+ * <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
44
+ * trigger mailing shall be dispatched to a recipient.
45
+ * <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
46
+ * trigger mailing.
47
+ * </ul>
48
+ * <p>
49
+ * Using all of these settings, the trigger descriptor could be built with the following statements:
50
+ *
51
+ * <pre>
52
+ * $rmd = $session->createRecipientContext()->getMetaData();
53
+ * $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
54
+ * $counterId = $rmd->getUserAttribute( "Counter" )->getId();
55
+ * $endDate = date('c', strtotime('+1 year'));
56
+ * $sendingTime = date('c', mktime(12, 30));
57
+ *
58
+ * $modificator = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
59
+ * Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
60
+ * Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 50);
61
+ *
62
+ * $offset = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
63
+ * Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
64
+ * Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1);
65
+ *
66
+ * $cmdFactory = $session->getActionManager()->getCommandFactory();
67
+ * $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
68
+ * $commands = array( $cmd );
69
+ *
70
+ * $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
71
+ * $descriptor = $factory->createAnniversaryTriggerDescriptorBuilder()->startDate( date('c') )
72
+ * ->sendingTime( $sendingTime )->endDate( $endDate )->attribute( $birthdayId )
73
+ * ->columnModificator( $modificator )->offset( $offset )->attributeValueSetters( $commands )
74
+ * ->build();
75
+ * </pre>
76
+ *
77
+ * The created trigger will fire one day before a recipients 50th birthday at 12:30 and will increase the Counter
78
+ * attribute. The trigger will be active from now on till the next year.
79
+ *
80
+ * @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createAnniversaryTriggerDescriptorBuilder()
81
+ * @since API 1.10.0
82
+ * @author chge, 16.07.2012
83
+ */
84
+ interface Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder
85
+ extends Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder
86
+ {
87
+ /**
88
+ * Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to define the time span between the
89
+ * dispatch date and the date specified by the attribute. Be aware that the only legal offset type is WAS_AGO.
90
+ * For example: An anniversary trigger mailing can be sent out ten years after the date specified by the attribute.
91
+ * This setting is mandatory.
92
+ *
93
+ * @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $columnModificator the <i>TimeTriggerOffset</i> used
94
+ * to define the time span between the dispatch date and the date specified by the attribute.
95
+ * @return Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder the builder.
96
+ * @throws Inx_Api_NullPointerException if the given offset is <i>null</i>.
97
+ * @throws Inx_Api_IllegalArgumentException if the offset type is not WAS_AGO.
98
+ */
99
+ public function columnModificator( Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $columnModificator );
100
  }
lib/Inx/Api/TriggerMailing/Descriptor/AttributeTriggerDescriptorBuilder.php CHANGED
@@ -1,109 +1,109 @@
1
- <?php
2
- /**
3
- * @package Inxmail
4
- * @subpackage TriggerMailing_Descriptor
5
- */
6
-
7
- /**
8
- * The <i>Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder</i> is used to easily create attribute
9
- * driven time triggers. The following settings are mandatory:
10
- * <p>
11
- * <ul>
12
- * <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
13
- * <li><b>The sending time</b>: Defines the time at shich the trigger will be fired during each dispatch cycle.
14
- * <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients.
15
- * </ul>
16
- * <p>
17
- * Using only these settings the easiest possible attribute trigger descriptor can be built using the following
18
- * statements:
19
- *
20
- * <pre>
21
- * $rmd = $session->createRecipientContext()->getMetaData();
22
- * $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
23
- * $sendingTime = date('c', mktime(12, 30));
24
- *
25
- * $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
26
- * $builder = $factory->createBirthdayTriggerDescriptorBuilder();
27
- * $builder->startDate( date('c') );
28
- * $builder->sendingTime( $sendingTime );
29
- * $builder->attribute( $birthdayId );
30
- * $descriptor = $builder->build();
31
- * </pre>
32
- * <p>
33
- * There are also some optional settings which can be set:
34
- * <p>
35
- * <ul>
36
- * <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
37
- * <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
38
- * trigger mailing shall be dispatched to a recipient.
39
- * <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
40
- * trigger mailing.
41
- * </ul>
42
- * <p>
43
- * Using all of these settings, the trigger descriptor could be built with the following statements:
44
- *
45
- * <pre>
46
- * $rmd = $session->createRecipientContext()->getMetaData();
47
- * $birthdayId = $rmd->getUserAttribute( "Geburtstag" )->getId();
48
- * $counterId = $rmd->getUserAttribute( "Counter" )->getId();
49
- *
50
- * $endDate = date('c', strtotime('+1 year'));
51
- * $sendingTime = date('c', mktime(12, 30));
52
- *
53
- * $offset = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
54
- * Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
55
- * Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1 );
56
- *
57
- * $cmdFactory = $session->getActionManager()->getCommandFactory();
58
- * $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
59
- * $commands = array( $cmd );
60
- *
61
- * $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
62
- * $descriptor = $factory->createBirthdayTriggerDescriptorBuilder()->startDate( date('c') )
63
- * ->sendingTime( $sendingTime )->endDate( $endDate )->attribute( $birthdayId )->offset( $offset )
64
- * ->attributeValueSetters( $commands )->build();
65
- * </pre>
66
- *
67
- * The created trigger will fire one day before a recipients birthday at 12:30 and will increase the Counter attribute.
68
- * The trigger will be active from now on till the next year.
69
- *
70
- * @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createBirthdayTriggerDescriptorBuilder()
71
- * @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createFollowUpTriggerDescriptorBuilder()
72
- * @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createReminderTriggerDescriptorBuilder()
73
- * @since API 1.10.0
74
- * @author chge, 16.07.2012
75
- */
76
- interface Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder
77
- extends Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder
78
- {
79
- /**
80
- * Sets the ID of the recipient attribute used as basis of the trigger. This setting is mandatory.
81
- *
82
- * @param int $iAttributeId the ID of the recipient attribute used as basis of the trigger.
83
- * @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder the builder.
84
- */
85
- public function attribute( $iAttributeId );
86
-
87
-
88
- /**
89
- * Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to alter the dispatch date specified
90
- * by the attribute. For example: Normally, birthday trigger mailings are sent on the birthday of the recipient.
91
- * Using a <i>TimeTriggerOffset</i> you can send your congratulations before or after that date. This setting is
92
- * optional.
93
- * <p>
94
- * There are some restrictions regarding the permitted offset types and units:
95
- * <ul>
96
- * <li><b>Birthday trigger mailing</b>: Only the DAY unit is permitted.
97
- * <li><b>Reminder trigg