Skip to content

Commit 1ce148f

Browse files
add TemplateMerge API
1 parent 29b81f5 commit 1ce148f

File tree

14 files changed

+713
-226
lines changed

14 files changed

+713
-226
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ var StorageApi = require('asposestoragecloud');
138138
var storageApi = new StorageApi({
139139
'baseURI':conf['basePath'],
140140
'appSid': conf['appSID'],
141-
'apiKey': conf['apiKey'] ,
142-
'debug': conf['debug']});
141+
'apiKey': conf['apiKey']});
143142

144143

145144
// Setup local folder for source and result
@@ -219,7 +218,6 @@ Class | Method | HTTP request | Description
219218
*Asposehtmlcloud.ConversionApi* | [**PutConvertDocumentToImage**](docs/ConversionApi.md#PutConvertDocumentToImage) | **PUT** /html/{name}/convert/image/{outFormat} | Converts the HTML document (located on storage) to the specified image format and uploads resulting file to storage.
220219
*Asposehtmlcloud.ConversionApi* | [**PutConvertDocumentToPdf**](docs/ConversionApi.md#PutConvertDocumentToPdf) | **PUT** /html/{name}/convert/pdf | Converts the HTML document (located on storage) to PDF and uploads resulting file to storage.
221220
*Asposehtmlcloud.ConversionApi* | [**PutConvertDocumentToXps**](docs/ConversionApi.md#PutConvertDocumentToXps) | **PUT** /html/{name}/convert/xps | Converts the HTML document (located on storage) to XPS and uploads resulting file to storage.
222-
*Asposehtmlcloud.DocumentApi* | [**GetDocument**](docs/DocumentApi.md#GetDocument) | **GET** /html/{name} | Return the HTML document by the name from default or specified storage.
223221
*Asposehtmlcloud.DocumentApi* | [**GetDocumentFragmentByXPath**](docs/DocumentApi.md#GetDocumentFragmentByXPath) | **GET** /html/{name}/fragments/{outFormat} | Return list of HTML fragments matching the specified XPath query.
224222
*Asposehtmlcloud.DocumentApi* | [**GetDocumentFragmentByXPathByUrl**](docs/DocumentApi.md#GetDocumentFragmentByXPathByUrl) | **GET** /html/fragments/{outFormat} | Return list of HTML fragments matching the specified XPath query by the source page URL.
225223
*Asposehtmlcloud.DocumentApi* | [**GetDocumentFragmentsByCSSSelector**](docs/DocumentApi.md#GetDocumentFragmentsByCSSSelector) | **GET** /html/{name}/fragments/css/{outFormat} | Return list of HTML fragments matching the specified CSS selector.
@@ -232,6 +230,8 @@ Class | Method | HTTP request | Description
232230
*Asposehtmlcloud.TranslationApi* | [**GetTranslateDocumentByUrl**](docs/TranslationApi.md#GetTranslateDocumentByUrl) | **GET** /html/translate/{srcLang}/{resLang} | Translate the HTML document from Web specified by its URL.
233231
*Asposehtmlcloud.SummarizationApi* | [**GetDetectHtmlKeywords**](docs/SummarizationApi.md#GetDetectHtmlKeywords) | **GET** /html/{name}/summ/keywords | Get the HTML document keywords using the keyword detection service.
234232
*Asposehtmlcloud.SummarizationApi* | [**GetDetectHtmlKeywordsByUrl**](docs/SummarizationApi.md#GetDetectHtmlKeywordsByUrl) | **GET** /html/summ/keywords | Get the keywords from HTML document from Web specified by its URL using the keyword detection service
233+
*Asposehtmlcloud.TemplateMergeApi* | [**GetMergeHtmlTemplate**](docs/TemplateMergeApi.md#GetMergeHtmlTemplate) | **GET** /html/{templateName}/merge | Populate HTML document template with data located as a file in the storage.
234+
*Asposehtmlcloud.TemplateMergeApi* | [**PutMergeHtmlTemplate**](docs/TemplateMergeApi.md#PutMergeHtmlTemplate) | **PUT** /html/{templateName}/merge | Populate HTML document template with data from the request body. Result document will be saved to storage.
235235

236236
### STORAGE SDK
237237

docs/DocumentApi.md

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,13 @@ All URIs are relative to *https://api.aspose.cloud/v1.1*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**GetDocument**](DocumentApi.md#GetDocument) | **GET** /html/{name} | Return the HTML document by the name from default or specified storage.
87
[**GetDocumentFragmentByXPath**](DocumentApi.md#GetDocumentFragmentByXPath) | **GET** /html/{name}/fragments/{outFormat} | Return list of HTML fragments matching the specified XPath query.
98
[**GetDocumentFragmentByXPathByUrl**](DocumentApi.md#GetDocumentFragmentByXPathByUrl) | **GET** /html/fragments/{outFormat} | Return list of HTML fragments matching the specified XPath query by the source page URL.
109
[**GetDocumentFragmentsByCSSSelector**](DocumentApi.md#GetDocumentFragmentsByCSSSelector) | **GET** /html/{name}/fragments/css/{outFormat} | Return list of HTML fragments matching the specified CSS selector.
1110
[**GetDocumentFragmentsByCSSSelectorByUrl**](DocumentApi.md#GetDocumentFragmentsByCSSSelectorByUrl) | **GET** /html/fragments/css/{outFormat} | Return list of HTML fragments matching the specified CSS selector by the source page URL.
1211
[**GetDocumentImages**](DocumentApi.md#GetDocumentImages) | **GET** /html/{name}/images/all | Return all HTML document images packaged as a ZIP archive.
1312
[**GetDocumentImagesByUrl**](DocumentApi.md#GetDocumentImagesByUrl) | **GET** /html/images/all | Return all HTML page images packaged as a ZIP archive by the source page URL.
1413

15-
16-
<a name="GetDocument"></a>
17-
# **GetDocument**
18-
> File GetDocument(name, opts)
19-
20-
Return the HTML document by the name from default or specified storage.
21-
22-
### Example
23-
```javascript
24-
var Asposehtmlcloud = require('asposehtmlcloud');
25-
26-
var apiInstance = new Asposehtmlcloud.DocumentApi();
27-
28-
var name = "name_example"; // String | The document name.
29-
30-
var opts = {
31-
'storage': "storage_example", // String | The document folder
32-
'folder': "folder_example" // String | The document folder.
33-
};
34-
35-
var callback = function(error, data, response) {
36-
if (error) {
37-
console.error(error);
38-
} else {
39-
console.log('API called successfully. Returned data: ' + data);
40-
}
41-
};
42-
apiInstance.GetDocument(name, opts, callback);
43-
```
44-
45-
### Parameters
46-
47-
Name | Type | Description | Notes
48-
------------- | ------------- | ------------- | -------------
49-
**name** | **String**| The document name. |
50-
**storage** | **String**| The document folder | [optional]
51-
**folder** | **String**| The document folder. | [optional]
52-
53-
### Return type
54-
55-
**File**
56-
57-
### HTTP request headers
58-
59-
- **Content-Type**: application/json
60-
- **Accept**: multipart/form-data, application/zip
61-
6214
<a name="GetDocumentFragmentByXPath"></a>
6315
# **GetDocumentFragmentByXPath**
6416
> File GetDocumentFragmentByXPath(name, xPath, outFormat, opts)
@@ -96,7 +48,7 @@ apiInstance.GetDocumentFragmentByXPath(name, xPath, outFormat, opts, callback);
9648

9749
Name | Type | Description | Notes
9850
------------- | ------------- | ------------- | -------------
99-
**name** | **String**| The document name. |
51+
**name** | **String**| The document name. | Presented as zip archive with one html file in the root or html file.
10052
**xPath** | **String**| XPath query string. |
10153
**outFormat** | **String**| Output format. Possible values: &#39;plain&#39; and &#39;json&#39;. |
10254
**storage** | **String**| The document storage. | [optional]
@@ -195,7 +147,7 @@ apiInstance.GetDocumentFragmentsByCSSSelector(name, selector, outFormat, opts, c
195147

196148
Name | Type | Description | Notes
197149
------------- | ------------- | ------------- | -------------
198-
**name** | **String**| The document name. |
150+
**name** | **String**| The document name. | Presented as zip archive with one html file in the root or html file.
199151
**selector** | **String**| CSS selector string. |
200152
**outFormat** | **String**| Output format. Possible values: &#39;plain&#39; and &#39;json&#39;. |
201153
**folder** | **String**| The document folder. | [optional]
@@ -291,7 +243,7 @@ apiInstance.GetDocumentImages(name, opts, callback);
291243

292244
Name | Type | Description | Notes
293245
------------- | ------------- | ------------- | -------------
294-
**name** | **String**| The document name. |
246+
**name** | **String**| The document name. | Presented as zip archive with one html file in the root.
295247
**folder** | **String**| The document folder. | [optional]
296248
**storage** | **String**| The document storage. | [optional]
297249

docs/OcrApi.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Method | HTTP request | Description
1212
# **GetRecognizeAndImportToHtml**
1313
> File GetRecognizeAndImportToHtml(name, opts)
1414
15-
Recognize text from the image file in the storage and import it to HTML format.
15+
Recognize text from the image file in the storage and import it to HTML format.
16+
Acceptable image formats is jpg, gif, png, bmp, tiff.
1617

1718
### Example
1819
```javascript
@@ -48,7 +49,7 @@ Name | Type | Description | Notes
4849
**storage** | **String**| The source image storage. | [optional]
4950

5051
### Return type
51-
52+
5253
**File**
5354

5455
### HTTP request headers
@@ -60,7 +61,8 @@ Name | Type | Description | Notes
6061
# **GetRecognizeAndTranslateToHtml**
6162
> File GetRecognizeAndTranslateToHtml(name, srcLang, resLang, opts)
6263
63-
Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
64+
Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
65+
Acceptable image formats is jpg, gif, png, bmp, tiff.
6466

6567
### Example
6668
```javascript

docs/SummarizationApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ apiInstance.GetDetectHtmlKeywords(name, opts, callback);
4141

4242
Name | Type | Description | Notes
4343
------------- | ------------- | ------------- | -------------
44-
**name** | **String**| Document name. |
44+
**name** | **String**| Document name. | Html file in the storage.
4545
**folder** | **String**| Document folder. | [optional]
4646
**storage** | **String**| Document storage. | [optional]
4747

docs/TemplateMergeApi.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Asposehtmlcloud.TemplateMergeApi
2+
3+
All URIs are relative to *https://api.aspose.cloud/v1.1*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**GetMergeHtmlTemplate**](TemplateMergeApi.md#GetMergeHtmlTemplate) | **GET** /html/{templateName}/merge | Populate HTML document template with data located as a file in the storage.
8+
[**PutMergeHtmlTemplate**](TemplateMergeApi.md#PutMergeHtmlTemplate) | **PUT** /html/{templateName}/merge | Populate HTML document template with data from the request body. Result document will be saved to storage.
9+
10+
11+
<a name="GetMergeHtmlTemplate"></a>
12+
# **GetMergeHtmlTemplate**
13+
> File GetMergeHtmlTemplate(templateName, dataPath, opts)
14+
15+
Populate HTML document template with data located as a file in the storage.
16+
17+
### Example
18+
19+
#### Template file HtmlTemplate.html
20+
21+
```html
22+
<html>
23+
<head>
24+
<title>{{Title}}</title>
25+
<meta charset="utf-8" />
26+
</head>
27+
<body>
28+
<div>
29+
<p>Name: {{Name}} {{Surname}}</p>
30+
<p>Address: {{Address.Number}}, {{Address.Street}}, {{Address.City}}</p>
31+
</div>
32+
</body>
33+
</html>
34+
```
35+
36+
#### Data file XmlSourceData.xml
37+
```xml
38+
<?xml version="1.0" encoding="utf-8" ?>
39+
<Data>
40+
<Title>Test</Title>
41+
<Person>
42+
<Name>John</Name>
43+
<Surname>Smith</Surname>
44+
<Address>
45+
<Number>200</Number>
46+
<Street>Austin rd.</Street>
47+
<City>Dallas</City>
48+
</Address>
49+
</Person>
50+
<Person>
51+
<Name>Jack</Name>
52+
<Surname>Fox</Surname>
53+
<Address>
54+
<Number>25</Number>
55+
<Street>Broadway</Street>
56+
<City>New York</City>
57+
</Address>
58+
</Person>
59+
<Person>
60+
<Name>Sherlock</Name>
61+
<Surname>Holmes</Surname>
62+
<Address>
63+
<Number>65</Number>
64+
<Street>Baker str.</Street>
65+
<City>London</City>
66+
</Address>
67+
</Person>
68+
</Data>
69+
```
70+
71+
```javascript
72+
var Asposehtmlcloud = require('asposehtmlcloud');
73+
74+
var apiInstance = new Asposehtmlcloud.TemplateMergeApi();
75+
76+
var templateName = "templateName_example"; // String | Template document name. Template document is HTML or zipped HTML.
77+
78+
var dataPath = "dataPath_example"; // String | Data source file path in the storage. Supported data format: XML
79+
80+
var opts = {
81+
'options': "options_example", // String | Template merge options: reserved for further implementation.
82+
'folder': "folder_example", // String | The template document folder.
83+
'storage': "storage_example" // String | The template document and data source storage.
84+
};
85+
86+
var callback = function(error, data, response) {
87+
if (error) {
88+
console.error(error);
89+
} else {
90+
console.log('API called successfully. Returned data: ' + data);
91+
}
92+
};
93+
apiInstance.GetMergeHtmlTemplate(templateName, dataPath, opts, callback);
94+
```
95+
96+
### Parameters
97+
98+
Name | Type | Description | Notes
99+
------------- | ------------- | ------------- | -------------
100+
**templateName** | **String**| Template document name. Template document is HTML or zipped HTML. |
101+
**dataPath** | **String**| Data source file path in the storage. Supported data format: XML |
102+
**options** | **String**| Template merge options: reserved for further implementation. | [optional]
103+
**folder** | **String**| The template document folder. | [optional]
104+
**storage** | **String**| The template document and data source storage. | [optional]
105+
106+
### Return type
107+
108+
**File**
109+
110+
### HTTP request headers
111+
112+
- **Content-Type**: application/octet-stream
113+
- **Accept**: application/json
114+
115+
<a name="PutMergeHtmlTemplate"></a>
116+
# **PutMergeHtmlTemplate**
117+
> File PutMergeHtmlTemplate(templateName, outPath, file, opts)
118+
119+
Populate HTML document template with data from the request body. Result document will be saved to storage.
120+
121+
### Example
122+
```javascript
123+
var Asposehtmlcloud = require('asposehtmlcloud');
124+
125+
var apiInstance = new Asposehtmlcloud.TemplateMergeApi();
126+
127+
var templateName = "templateName_example"; // String | Template document name. Template document is HTML or zipped HTML.
128+
129+
var outPath = "outPath_example"; // String | Result document path.
130+
131+
var file = "/path/to/file.xml"; // File | A data file to populate template.
132+
133+
var opts = {
134+
'options': "options_example", // String | Template merge options: reserved for further implementation.
135+
'folder': "folder_example", // String | The template document folder.
136+
'storage': "storage_example" // String | The template document and data source storage.
137+
};
138+
139+
var callback = function(error, data, response) {
140+
if (error) {
141+
console.error(error);
142+
} else {
143+
console.log('API called successfully. Returned data: ' + data);
144+
}
145+
};
146+
apiInstance.PutMergeHtmlTemplate(templateName, outPath, file, opts, callback);
147+
```
148+
149+
### Parameters
150+
151+
Name | Type | Description | Notes
152+
------------- | ------------- | ------------- | -------------
153+
**templateName** | **String**| Template document name. Template document is HTML or zipped HTML. |
154+
**outPath** | **String**| Result document path. |
155+
**file** | **File**| A data file to populate template. |
156+
**options** | **String**| Template merge options: reserved for further implementation. | [optional]
157+
**folder** | **String**| The template document folder. | [optional]
158+
**storage** | **String**| The template document and data source storage. | [optional]
159+
160+
### Return type
161+
162+
**File**
163+
164+
### HTTP request headers
165+
166+
- **Content-Type**: application/octet-stream
167+
- **Accept**: application/json
168+

docs/TranslationApi.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Method | HTTP request | Description
1212
# **GetTranslateDocument**
1313
> File GetTranslateDocument(name, srcLang, resLang, opts)
1414
15-
Translate the HTML document specified by the name from default or specified storage.
15+
Translate the HTML document specified by the name from default or specified storage.
16+
Allowed values for language pairs is en-de, en-fr, en-ru, de-en, ru-en, en-zh, zh-en.
1617

1718
### Example
1819
```javascript
@@ -45,7 +46,7 @@ apiInstance.GetTranslateDocument(name, srcLang, resLang, opts, callback);
4546

4647
Name | Type | Description | Notes
4748
------------- | ------------- | ------------- | -------------
48-
**name** | **String**| Document name. |
49+
**name** | **String**| Document name. | Html file in the storage.
4950
**srcLang** | **String**| Source language. | Allowed values is "en" (alias "eng", "english"), "de" (alias "deu", "deutsch", "german"), "fr" (alias "fra", "french"), "ru" (alias "rus", "russian"), "zh", alias ("chinese").
5051
**resLang** | **String**| Result language. | Allowed values is "en" (alias "eng", "english"), "de" (alias "deu", "deutsch", "german"), "fr" (alias "fra", "french"), "ru" (alias "rus", "russian"), "zh", alias ("chinese").
5152
**storage** | **String**| The source document storage. | [optional]
@@ -64,7 +65,8 @@ Name | Type | Description | Notes
6465
# **GetTranslateDocumentByUrl**
6566
> File GetTranslateDocumentByUrl(sourceUrl, srcLang, resLang)
6667
67-
Translate the HTML document from Web specified by its URL.
68+
Translate the HTML document from Web specified by its URL.
69+
Allowed values for language pairs is en-de, en-fr, en-ru, de-en, ru-en, en-zh, zh-en.
6870

6971
### Example
7072
```javascript

setting/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"authPath":"https://api.aspose.cloud/oauth2/token",
44
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
55
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
6-
"testResult":"testresult",
6+
"testResult":"testresult"
77
"testData":"testdata",
8-
"remoteFolder":"HtmlTestDoc",
8+
"remoteFolder":"",
99
"defaultUserAgent":"Webkit"
1010
}

0 commit comments

Comments
 (0)