Skip to content

Commit bdf3249

Browse files
Update documentation to markdown (Build number: 10)
0 parents  commit bdf3249

File tree

1,603 files changed

+155427
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,603 files changed

+155427
-0
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/* Compatability shim for jQuery and underscores.js.
2+
*
3+
* Copyright Sphinx contributors
4+
* Released under the two clause BSD licence
5+
*/
6+
7+
/**
8+
* small helper function to urldecode strings
9+
*
10+
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
11+
*/
12+
jQuery.urldecode = function(x) {
13+
if (!x) {
14+
return x
15+
}
16+
return decodeURIComponent(x.replace(/\+/g, ' '));
17+
};
18+
19+
/**
20+
* small helper function to urlencode strings
21+
*/
22+
jQuery.urlencode = encodeURIComponent;
23+
24+
/**
25+
* This function returns the parsed url parameters of the
26+
* current request. Multiple values per key are supported,
27+
* it will always return arrays of strings for the value parts.
28+
*/
29+
jQuery.getQueryParameters = function(s) {
30+
if (typeof s === 'undefined')
31+
s = document.location.search;
32+
var parts = s.substr(s.indexOf('?') + 1).split('&');
33+
var result = {};
34+
for (var i = 0; i < parts.length; i++) {
35+
var tmp = parts[i].split('=', 2);
36+
var key = jQuery.urldecode(tmp[0]);
37+
var value = jQuery.urldecode(tmp[1]);
38+
if (key in result)
39+
result[key].push(value);
40+
else
41+
result[key] = [value];
42+
}
43+
return result;
44+
};
45+
46+
/**
47+
* highlight a given string on a jquery object by wrapping it in
48+
* span elements with the given class name.
49+
*/
50+
jQuery.fn.highlightText = function(text, className) {
51+
function highlight(node, addItems) {
52+
if (node.nodeType === 3) {
53+
var val = node.nodeValue;
54+
var pos = val.toLowerCase().indexOf(text);
55+
if (pos >= 0 &&
56+
!jQuery(node.parentNode).hasClass(className) &&
57+
!jQuery(node.parentNode).hasClass("nohighlight")) {
58+
var span;
59+
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
60+
if (isInSVG) {
61+
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
62+
} else {
63+
span = document.createElement("span");
64+
span.className = className;
65+
}
66+
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
67+
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
68+
document.createTextNode(val.substr(pos + text.length)),
69+
node.nextSibling));
70+
node.nodeValue = val.substr(0, pos);
71+
if (isInSVG) {
72+
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
73+
var bbox = node.parentElement.getBBox();
74+
rect.x.baseVal.value = bbox.x;
75+
rect.y.baseVal.value = bbox.y;
76+
rect.width.baseVal.value = bbox.width;
77+
rect.height.baseVal.value = bbox.height;
78+
rect.setAttribute('class', className);
79+
addItems.push({
80+
"parent": node.parentNode,
81+
"target": rect});
82+
}
83+
}
84+
}
85+
else if (!jQuery(node).is("button, select, textarea")) {
86+
jQuery.each(node.childNodes, function() {
87+
highlight(this, addItems);
88+
});
89+
}
90+
}
91+
var addItems = [];
92+
var result = this.each(function() {
93+
highlight(this, addItems);
94+
});
95+
for (var i = 0; i < addItems.length; ++i) {
96+
jQuery(addItems[i].parent).before(addItems[i].target);
97+
}
98+
return result;
99+
};
100+
101+
/*
102+
* backward compatibility for jQuery.browser
103+
* This will be supported until firefox bug is fixed.
104+
*/
105+
if (!jQuery.browser) {
106+
jQuery.uaMatch = function(ua) {
107+
ua = ua.toLowerCase();
108+
109+
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
110+
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
111+
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
112+
/(msie) ([\w.]+)/.exec(ua) ||
113+
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
114+
[];
115+
116+
return {
117+
browser: match[ 1 ] || "",
118+
version: match[ 2 ] || "0"
119+
};
120+
};
121+
jQuery.browser = {};
122+
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
123+
}

_static/jquery.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/advanced-search.md

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
<a id="advanced-search-api"></a>
2+
3+
# Advanced Search API
4+
5+
REST API allows to create advanced search queries.
6+
7+
Parameters for APIs requests:
8+
9+
- **query** - search string
10+
11+
REST API url: `http://domail.com/api/rest/latest/search/advanced`
12+
13+
REST API works with the get request only.
14+
15+
## Result
16+
17+
Request returns an array with data:
18+
19+
- **records_count** - the total number of results (without `offset`
20+
and `max_results`) parameters
21+
- **count** - count of records in the current request
22+
- **data** - array with data. Data consists of the following values:
23+
- **entity_name** - class name of entity
24+
- **record_id** - id of record from this entity
25+
- **record_string** - the title of this record
26+
- **record_url** - the given URL for this record
27+
- **selected_data** - data from fields that have been explicitly
28+
selected in the select clause (optional)
29+
30+
## Query Language
31+
32+
### Keywords
33+
34+
#### select
35+
36+
Includes field values, taken from the search index, as an additional
37+
“selected_data” section in the search result items. You can select one
38+
or more fields to be attached to search results. The name of the field
39+
should consist the type prefix, otherwise the default `text` type will
40+
be used.
41+
42+
```none
43+
select text.field_name
44+
select (text.first_field_name, text.second_field_name)
45+
```
46+
47+
You can use fieldname aliasing, as known in SQL, for example:
48+
49+
```none
50+
select text.field_1 as name, text.field_2 as author
51+
```
52+
53+
You can use fieldname aliasing, as known in SQL, for example:
54+
55+
```none
56+
select (text.field_1 as name, text.field_2 as author)
57+
```
58+
59+
Note that parentheses are mandatory.
60+
61+
#### from
62+
63+
A list of entity aliases to search from. It can be one alias or group.
64+
Examples:
65+
66+
```none
67+
from one_alias
68+
from (first_alias, second_alias)
69+
```
70+
71+
#### where
72+
73+
The `where` clause defines the search parameters.
74+
75+
#### and, or
76+
77+
`And` and `or` operators are used to combine multiple clauses, allowing you to refine your search.
78+
79+
Syntax:
80+
81+
```none
82+
and field_type field_name operator value
83+
or field_type field_name operator value
84+
```
85+
86+
If the field type is not set, then text field type will be used.
87+
88+
#### offset
89+
90+
The offset clause allows to set the offset of the first result.
91+
92+
#### max_results
93+
94+
The set results count for the query.
95+
96+
#### order_by
97+
98+
The `order_by` clause allows to sort results in ascending or descending order.
99+
100+
Syntax:
101+
102+
```none
103+
order_by field_type field_name direction
104+
```
105+
106+
If the field type is set, the text field will be assigned. Direction -
107+
`ASC`, `DESC`. If the direction is not assigned, the
108+
`ASC` direction will be used.
109+
110+
## Field Types
111+
112+
User should specify field type in query string. By default, if type is
113+
not set, it will be used text type. Supported field types: \* **text**
114+
\* **integer** \* **decimal** \* **datetime**
115+
116+
## Operators
117+
118+
Different field types support different operators in the `where` block.
119+
120+
### For String Fields
121+
122+
- **~ (CONTAINS)** - operator `~` is used for set text field value.
123+
If search value is string, it must be quoted. Examples:
124+
```none
125+
name ~ value
126+
name ~ "string value"
127+
```
128+
- **!~ (NOT CONTAINS)** - operator `!~` is used for search strings
129+
without value. If the search value is a string, it must be quoted.
130+
Examples:
131+
```none
132+
name !~ value
133+
name !~ "string value"
134+
```
135+
- **like** - operator `like` is used to finding records with a
136+
specified substring in any position (`LIKE %value%` statement
137+
behaviour). If the search value is a multi-word string that contains
138+
whitespaces, it should be enclosed in quotes. Examples:
139+
```none
140+
name like value
141+
name like "string value"
142+
```
143+
- **notlike** - operator `notlike` is used to find records
144+
without a specified substring in any position (`NOT LIKE %value%`
145+
statement behaviour). If the search value is a multi-word string that
146+
contains whitespaces, it should be enclosed in quotes. Examples:
147+
```none
148+
name notlike value
149+
name notlike "string value"
150+
```
151+
152+
### For Numeric Fields
153+
154+
- **= (EQUALS)** - operator `=` is used to search for records where the
155+
field value matches the specified value. Examples:
156+
```none
157+
integer count = 100
158+
decimal price = 12.5
159+
datetime create_date = "2013-01-01 00:00:00"
160+
```
161+
- **!= (NOT EQUALS)** - operator `!=` is used to search for records
162+
where the field value does not match the specified value. Examples:
163+
```none
164+
integer count != 5
165+
decimal price != 45
166+
datetime create_date != "2012-01-01 00:00:00"
167+
```
168+
- **>, <, <=, >=** - Operators are used to search for the records where the field value is `greater`, `less`,
169+
`less than or equals` or `greater than or equals` of the
170+
specified value. Examples:
171+
```none
172+
integer count >= 5
173+
decimal price < 45
174+
datetime create_date > "2012-01-01 00:00:00"
175+
```
176+
- **in** - operator `in` is used to search for the records where the value is in
177+
the specified set of data. Examples:
178+
```none
179+
integer count in (5, 10, 15, 20)
180+
decimal price in (12.2, 55.25)
181+
```
182+
- **!in** - operator `!in` is used to search for records where the field value is not
183+
in the specified set of data. Examples:
184+
```none
185+
integer count !in (1, 3, 5)
186+
decimal price !in (2.1, 55, 45.4)
187+
```
188+
189+
### Query Brackets
190+
191+
User can combined operators in the search query with brackets.
192+
193+
Examples:
194+
195+
```none
196+
from oro_test where (owner ~ john and (integer count > 10 or float price = 10)) or (owner ~ mary and (integer count > 5 or float price = 150))
197+
```
198+
199+
## Query Examples
200+
201+
- Search by demo products where the name contains the `opportunity` string
202+
and where the price is greater than `100`.
203+
```none
204+
from demo_product where name ~ opportunity and double price > 100
205+
```
206+
- Search and return entity data plus the name and the description of demo
207+
products.
208+
```none
209+
select (name, description) from demo_product
210+
```
211+
- Search by all entities where the integer field count is not equal `10`.
212+
```none
213+
integer count != 10
214+
```
215+
- Search by all entities where text field `all_text` does not contain the
216+
`opportunity` string.
217+
```none
218+
all_text !~ "opportunity"
219+
```
220+
- Select `10` results from the `demo_products` and `demo_categories`
221+
entities where the text field description contains `test`, order
222+
`ASC` by text field name and offset first result to `5`.
223+
```none
224+
from (demo_products, demo_categories) where description ~ test order_by name offset 5 max_results 10
225+
```

api/authentication/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<a id="web-services-api-authentication"></a>
2+
3+
# Authentication
4+
5+
A RESTful API should be stateless. This means that request authentication should not depend on cookies or sessions.
6+
Instead, each request should come with some authentication credentials.
7+
8+
Out-of-the-box, OroPlatform provides the following authentication mechanism:
9+
10+
* [OAuth Authentication](oauth.md)
11+
12+
#### BUSINESS TIP
13+
# Business Tip
14+
15+
Looking to make a digital commerce investment? Evaluate the <a href="https://oroinc.com/b2b-ecommerce/b2b-ecommerce-comparison" target="_blank">best B2B eCommerce platforms</a> on our comparison page.

0 commit comments

Comments
 (0)