NewHavenSoftware_CMSAPI - Version 9.0.1.8

Version Notes

9.0.1.8
Added cmsapiGiftMessageInfo to the V2 api that will return an object with to,from, and message values. See the NewHaven Software Magento Setup Guide for more information about the message template plug-in option.

9.0.1.7
The first Amasty Order Attributes implementation was not working properly. In this release added more flexible support for custom fields. You can now define a custom field with this syntax: CLASS_API/path/fieldName. For Amasty this would be: Amasty_Orderattr_Model_Sales_Order_Api/custom/fieldName the limitation here is the class must have an info method that accepts the order increment ID as the parameter. Also the field names all need to be unique.

9.0.1.6
Removed error data introduced in 9.0.1.5

9.0.1.5
Added support for Amasty Order Attributes for use with custom fields

9.0.1.4
Removed unneeded module dependency. Added the ability to set global custom_field values.

In addition to a comma delimited list of order fields. You can now add name=value in the Custom Fields list. These will be sent with every order.

In CMS add a matching custom field plug-in option:
Name: CMS XML element name to store the data
Value: the custom field name specified in Magento
Type: Custom Field

If no mapping plug-in option is found, the values will appear in the order notes.

9.0.1.3
Changed module dependency to Mage_Api

9.0.1.2
Added app/etc/modules/NewHavenSoftware_CMSAPI.xml file to enable the extension.

9.0.1.1
Added cmsapiCustomFields to the v2 API. This API call is used to get order level data based on the fields entered in System Configuration

Added configuration option "NewHaven Software Settings" to the Services tab of System>Configuration. This provides the custom fields setting. Enter a comma delimited list of order level attributes that may be custom and not available in the v2 API.

Download this release

Release Info

Developer Jason Morrison
Extension NewHavenSoftware_CMSAPI
Version 9.0.1.8
Comparing to
See all releases


Code changes from version 9.0.1.7 to 9.0.1.8

app/code/community/NewHavenSoftware/CMSAPI/Model/Gift/Api/V2.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class NewHavenSoftware_CMSAPI_Model_GiftMessage_Api_V2 extends Mage_Api_Model_Resource_Abstract {
3
+ public function GetGiftMessage($giftMessageId) {
4
+ $message = Mage::getModel('giftmessage/message');
5
+ if(!is_null($giftMessageId)) {
6
+ $message->load((int)$giftMessageId);
7
+ }
8
+ return $message;
9
+ }
10
+ }
11
+ ?>
app/code/community/NewHavenSoftware/CMSAPI/Model/Gift/Message/Api/V2.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class NewHavenSoftware_CMSAPI_Model_Gift_Message_Api_V2 extends Mage_Api_Model_Resource_Abstract {
3
+ public function GetGiftMessage($giftMessageId) {
4
+ $message = Mage::getModel('giftmessage/message');
5
+ if(!is_null($giftMessageId)) {
6
+ $message->load((int)$giftMessageId);
7
+ }
8
+ return $message;
9
+ }
10
+ }
11
+ ?>
app/code/community/NewHavenSoftware/CMSAPI/etc/api.xml CHANGED
@@ -1,85 +1,97 @@
1
  <?xml version="1.0"?>
2
  <config>
3
- <api>
4
- <resources>
5
- <cmsapi_check>
6
- <model>cmsapi/check_api</model>
7
- <title>NewHaven Software Check API</title>
8
- <acl>cmsapi_data</acl>
9
- <methods>
10
- <nhsInstalled translate="title" module="newhavensoftware_cmsapi">
11
- <title>Is the NHS extension installed?</title>
12
- <method>isNHS</method>
13
- </nhsInstalled>
14
- </methods>
15
- </cmsapi_check>
16
- <cmsapi_custom>
17
- <model>cmsapi/custom_api</model>
18
- <title>NewHaven Software Custom API</title>
19
- <acl>cmsapi_data</acl>
20
- <methods>
21
- <fields translate="title" module="newhavensoftware_cmsapi">
22
- <title>This will return the custom fields and values in comma delimited form</title>
23
- <method>CustomFields</method>
24
- </fields>
25
- </methods>
26
- </cmsapi_custom>
27
- <cmsapi_catalog_product>
28
- <model>cmsapi/catalog_product_api</model>
29
- <acl>catalog/product</acl>
30
- <title>Product API</title>
31
- <methods>
32
- <create translate="title" module="catalog">
33
- <title>Create new product</title>
34
- <acl>catalog/product/create</acl>
35
- </create>
36
- </methods>
37
- <faults module="catalog">
38
- <store_not_exists>
39
- <code>100</code>
40
- <message>Requested store view not found.</message>
41
- </store_not_exists>
42
- <product_not_exists>
43
- <code>101</code>
44
- <message>Product not exists.</message>
45
- </product_not_exists>
46
- <data_invalid>
47
- <code>102</code>
48
- <message>Invalid data given. Details in error message.</message>
49
- </data_invalid>
50
- <not_deleted>
51
- <code>103</code>
52
- <message>Product not deleted. Details in error message.</message>
53
- </not_deleted>
54
- <product_type_not_exists>
55
- <code>104</code>
56
- <message>Product type is not in allowed types.</message>
57
- </product_type_not_exists>
58
- <product_attribute_set_not_exists>
59
- <code>105</code>
60
- <message>Product attribute set is not existed</message>
61
- </product_attribute_set_not_exists>
62
- <product_attribute_set_not_valid>
63
- <code>106</code>
64
- <message>Product attribute set is not belong catalog product entity type</message>
65
- </product_attribute_set_not_valid>
66
- </faults>
67
- </cmsapi_catalog_product>
 
 
 
 
 
 
 
 
 
 
 
68
  </resources>
69
  <v2>
70
  <resources_function_prefix>
71
  <cmsapi_check>cmsapiCheck</cmsapi_check>
72
  <cmsapi_custom>cmsapiCustom</cmsapi_custom>
73
  <cmsapi_catalog_product>cmsapiCatalogProduct</cmsapi_catalog_product>
 
74
  </resources_function_prefix>
75
  </v2>
76
  <acl>
77
- <resources>
78
- <cmsapi_data translate="title" module="newhavensoftware_cmsapi">
79
- <title>CMSAPI data</title>
80
- <sort_order>3</sort_order>
81
- </cmsapi_data>
82
- </resources>
83
  </acl>
84
  </api>
85
  </config>
1
  <?xml version="1.0"?>
2
  <config>
3
+ <api>
4
+ <resources>
5
+ <cmsapi_check>
6
+ <model>cmsapi/check_api</model>
7
+ <title>NewHaven Software Check API</title>
8
+ <acl>cmsapi_data</acl>
9
+ <methods>
10
+ <nhsInstalled translate="title" module="newhavensoftware_cmsapi">
11
+ <title>Is the NHS extension installed?</title>
12
+ <method>isNHS</method>
13
+ </nhsInstalled>
14
+ </methods>
15
+ </cmsapi_check>
16
+ <cmsapi_custom>
17
+ <model>cmsapi/custom_api</model>
18
+ <title>NewHaven Software Custom API</title>
19
+ <acl>cmsapi_data</acl>
20
+ <methods>
21
+ <fields translate="title" module="newhavensoftware_cmsapi">
22
+ <title>This will return the custom fields and values in comma delimited form</title>
23
+ <method>CustomFields</method>
24
+ </fields>
25
+ </methods>
26
+ </cmsapi_custom>
27
+ <cmsapi_gift_message>
28
+ <model>cmsapi/gift_message_api</model>
29
+ <title>NewHaven Software GiftMessage API</title>
30
+ <acl>cmsapi_data</acl>
31
+ <methods>
32
+ <info translate="title" module="newhavensoftware_cmsapi">
33
+ <title>This will return the Gift Message entity given the ID</title>
34
+ <method>GetGiftMessage</method>
35
+ </info>
36
+ </methods>
37
+ </cmsapi_gift_message>
38
+ <cmsapi_catalog_product>
39
+ <model>cmsapi/catalog_product_api</model>
40
+ <acl>catalog/product</acl>
41
+ <title>Product API</title>
42
+ <methods>
43
+ <create translate="title" module="catalog">
44
+ <title>Create new product</title>
45
+ <acl>catalog/product/create</acl>
46
+ </create>
47
+ </methods>
48
+ <faults module="catalog">
49
+ <store_not_exists>
50
+ <code>100</code>
51
+ <message>Requested store view not found.</message>
52
+ </store_not_exists>
53
+ <product_not_exists>
54
+ <code>101</code>
55
+ <message>Product not exists.</message>
56
+ </product_not_exists>
57
+ <data_invalid>
58
+ <code>102</code>
59
+ <message>Invalid data given. Details in error message.</message>
60
+ </data_invalid>
61
+ <not_deleted>
62
+ <code>103</code>
63
+ <message>Product not deleted. Details in error message.</message>
64
+ </not_deleted>
65
+ <product_type_not_exists>
66
+ <code>104</code>
67
+ <message>Product type is not in allowed types.</message>
68
+ </product_type_not_exists>
69
+ <product_attribute_set_not_exists>
70
+ <code>105</code>
71
+ <message>Product attribute set is not existed</message>
72
+ </product_attribute_set_not_exists>
73
+ <product_attribute_set_not_valid>
74
+ <code>106</code>
75
+ <message>Product attribute set is not belong catalog product entity type</message>
76
+ </product_attribute_set_not_valid>
77
+ </faults>
78
+ </cmsapi_catalog_product>
79
  </resources>
80
  <v2>
81
  <resources_function_prefix>
82
  <cmsapi_check>cmsapiCheck</cmsapi_check>
83
  <cmsapi_custom>cmsapiCustom</cmsapi_custom>
84
  <cmsapi_catalog_product>cmsapiCatalogProduct</cmsapi_catalog_product>
85
+ <cmsapi_gift_message>cmsapiGiftMessage</cmsapi_gift_message>
86
  </resources_function_prefix>
87
  </v2>
88
  <acl>
89
+ <resources>
90
+ <cmsapi_data translate="title" module="newhavensoftware_cmsapi">
91
+ <title>CMSAPI data</title>
92
+ <sort_order>3</sort_order>
93
+ </cmsapi_data>
94
+ </resources>
95
  </acl>
96
  </api>
97
  </config>
app/code/community/NewHavenSoftware/CMSAPI/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <config>
4
  <modules>
5
  <NewHavenSoftware_CMSAPI>
6
- <version>9.0.1.4</version>
7
  </NewHavenSoftware_CMSAPI>
8
  </modules>
9
  <global>
3
  <config>
4
  <modules>
5
  <NewHavenSoftware_CMSAPI>
6
+ <version>9.0.1.8</version>
7
  </NewHavenSoftware_CMSAPI>
8
  </modules>
9
  <global>
app/code/community/NewHavenSoftware/CMSAPI/etc/wsdl.xml CHANGED
@@ -59,6 +59,13 @@ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}" xmlns:ns0="urn:
59
  </restriction>
60
  </complexContent>
61
  </complexType>
 
 
 
 
 
 
 
62
  </schema>
63
  </types>
64
  <message name="cmsapiCustomFieldsRequest">
@@ -68,6 +75,13 @@ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}" xmlns:ns0="urn:
68
  <message name="cmsapiCustomFieldsResponse">
69
  <part name="result" type="xsd:string"/>
70
  </message>
 
 
 
 
 
 
 
71
  <message name="cmsapiChecknhsInstalledRequest">
72
  <part name="sessionId" type="xsd:string"/>
73
  </message>
@@ -85,6 +99,11 @@ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}" xmlns:ns0="urn:
85
  <input name="cmsapiCustomFieldsRequest" message="typens:cmsapiCustomFieldsRequest"/>
86
  <output name="cmsapiCustomFieldsResponse" message="typens:cmsapiCustomFieldsResponse"/>
87
  </operation>
 
 
 
 
 
88
  </portType>
89
  <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
90
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
@@ -106,5 +125,14 @@ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}" xmlns:ns0="urn:
106
  <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
107
  </output>
108
  </operation>
 
 
 
 
 
 
 
 
 
109
  </binding>
110
  </definitions>
59
  </restriction>
60
  </complexContent>
61
  </complexType>
62
+ <complexType name="cmsapiGiftMessageEntity">
63
+ <all>
64
+ <element name="sender" type="xsd:string" />
65
+ <element name="recipient" type="xsd:string" />
66
+ <element name="message" type="xsd:string" />
67
+ </all>
68
+ </complexType>
69
  </schema>
70
  </types>
71
  <message name="cmsapiCustomFieldsRequest">
75
  <message name="cmsapiCustomFieldsResponse">
76
  <part name="result" type="xsd:string"/>
77
  </message>
78
+ <message name="cmsapiGiftMessageInfoRequest">
79
+ <part name="sessionId" type="xsd:string"/>
80
+ <part name="giftMessageId" type="xsd:string"/>
81
+ </message>
82
+ <message name="cmsapiGiftMessageInfoResponse">
83
+ <part name="result" type="typens:cmsapiGiftMessageEntity"/>
84
+ </message>
85
  <message name="cmsapiChecknhsInstalledRequest">
86
  <part name="sessionId" type="xsd:string"/>
87
  </message>
99
  <input name="cmsapiCustomFieldsRequest" message="typens:cmsapiCustomFieldsRequest"/>
100
  <output name="cmsapiCustomFieldsResponse" message="typens:cmsapiCustomFieldsResponse"/>
101
  </operation>
102
+ <operation name="cmsapiGiftMessageInfo">
103
+ <documentation>This will return the Gift Message entity given the ID</documentation>
104
+ <input name="cmsapiGiftMessageInfoRequest" message="typens:cmsapiGiftMessageInfoRequest"/>
105
+ <output name="cmsapiGiftMessageInfoResponse" message="typens:cmsapiGiftMessageInfoResponse"/>
106
+ </operation>
107
  </portType>
108
  <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
109
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
125
  <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
126
  </output>
127
  </operation>
128
+ <operation name="cmsapiGiftMessageInfo">
129
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
130
+ <input>
131
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
132
+ </input>
133
+ <output>
134
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
135
+ </output>
136
+ </operation>
137
  </binding>
138
  </definitions>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NewHavenSoftware_CMSAPI</name>
4
- <version>9.0.1.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -14,7 +14,10 @@ Adds the following to the v2 API:&#xD;
14
  &lt;/ol&gt;&#xD;
15
  &#xD;
16
  This extension is required for integration with the CMS eCMS module.</description>
17
- <notes>9.0.1.7&#xD;
 
 
 
18
  The first Amasty Order Attributes implementation was not working properly. In this release added more flexible support for custom fields. You can now define a custom field with this syntax: CLASS_API/path/fieldName. For Amasty this would be: Amasty_Orderattr_Model_Sales_Order_Api/custom/fieldName the limitation here is the class must have an info method that accepts the order increment ID as the parameter. Also the field names all need to be unique. &#xD;
19
  &#xD;
20
  9.0.1.6&#xD;
@@ -46,9 +49,9 @@ Added cmsapiCustomFields to the v2 API. This API call is used to get order level
46
  &#xD;
47
  Added configuration option "NewHaven Software Settings" to the Services tab of System&gt;Configuration. This provides the custom fields setting. Enter a comma delimited list of order level attributes that may be custom and not available in the v2 API.</notes>
48
  <authors><author><name>Jason Morrison</name><user>jmorrison</user><email>jmorrison@newhavensoftware.com</email></author></authors>
49
- <date>2013-08-28</date>
50
- <time>01:33:18</time>
51
- <contents><target name="magecommunity"><dir name="NewHavenSoftware"><dir name="CMSAPI"><dir name="Helper"><file name="Data.php" hash="ab4082fe27f7c6732a7f857fc326ec99"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="aad926da6a10b2c2de3c28abac0eaf52"/></dir></dir></dir><dir name="Check"><dir name="Api"><file name="V2.php" hash="c27fcf391dcf5ad7e0c86de44fd14e7c"/></dir></dir><dir name="Custom"><dir name="Api"><file name="V2.php" hash="6e720e7e3704257a045905a1f639eaa5"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ba4c36dbd3d346c3561fb5822d5fd3b4"/><file name="api.xml" hash="d78c5d767a78b9b03be362c8ef895c98"/><file name="config.xml" hash="780d234cb167e08c7d26f10ceda84f3d"/><file name="system.xml" hash="ab6f7ba6be148634383f9e3a8f63e2cd"/><file name="wsdl.xml" hash="a0c5b11146e29e8bdfcea57ff53f8c4c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NewHavenSoftware_CMSAPI.xml" hash="f858d97574f528dc237ad32e0e96ae73"/></dir></target></contents>
52
  <compatible/>
53
- <dependencies><required><php><min>5.2.0</min><max>5.5.2</max></php></required></dependencies>
54
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NewHavenSoftware_CMSAPI</name>
4
+ <version>9.0.1.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
14
  &lt;/ol&gt;&#xD;
15
  &#xD;
16
  This extension is required for integration with the CMS eCMS module.</description>
17
+ <notes>9.0.1.8&#xD;
18
+ Added cmsapiGiftMessageInfo to the V2 api that will return an object with to,from, and message values. See the NewHaven Software Magento Setup Guide for more information about the message template plug-in option.&#xD;
19
+ &#xD;
20
+ 9.0.1.7&#xD;
21
  The first Amasty Order Attributes implementation was not working properly. In this release added more flexible support for custom fields. You can now define a custom field with this syntax: CLASS_API/path/fieldName. For Amasty this would be: Amasty_Orderattr_Model_Sales_Order_Api/custom/fieldName the limitation here is the class must have an info method that accepts the order increment ID as the parameter. Also the field names all need to be unique. &#xD;
22
  &#xD;
23
  9.0.1.6&#xD;
49
  &#xD;
50
  Added configuration option "NewHaven Software Settings" to the Services tab of System&gt;Configuration. This provides the custom fields setting. Enter a comma delimited list of order level attributes that may be custom and not available in the v2 API.</notes>
51
  <authors><author><name>Jason Morrison</name><user>jmorrison</user><email>jmorrison@newhavensoftware.com</email></author></authors>
52
+ <date>2013-09-18</date>
53
+ <time>20:37:54</time>
54
+ <contents><target name="magecommunity"><dir name="NewHavenSoftware"><dir name="CMSAPI"><dir name="Helper"><file name="Data.php" hash="ab4082fe27f7c6732a7f857fc326ec99"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="aad926da6a10b2c2de3c28abac0eaf52"/></dir></dir></dir><dir name="Check"><dir name="Api"><file name="V2.php" hash="c27fcf391dcf5ad7e0c86de44fd14e7c"/></dir></dir><dir name="Custom"><dir name="Api"><file name="V2.php" hash="6e720e7e3704257a045905a1f639eaa5"/></dir></dir><dir name="Gift"><dir name="Api"><file name="V2.php" hash="bf989c37e7277dd55b50e378e15cd19a"/></dir><dir name="Message"><dir name="Api"><file name="V2.php" hash="0a5ffdd3fc3760b311970169858d5475"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ba4c36dbd3d346c3561fb5822d5fd3b4"/><file name="api.xml" hash="aa7bd3dce22dfa8ed65403c48fe6de9a"/><file name="config.xml" hash="94b6801f25d75ceb6519c36a07432aaf"/><file name="system.xml" hash="ab6f7ba6be148634383f9e3a8f63e2cd"/><file name="wsdl.xml" hash="93ea17ae19287afccf46543c1ac01a30"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NewHavenSoftware_CMSAPI.xml" hash="f858d97574f528dc237ad32e0e96ae73"/></dir></target></contents>
55
  <compatible/>
56
+ <dependencies><required><php><min>5.2.0</min><max>5.5.3</max></php></required></dependencies>
57
  </package>