Wiki source code of Tracking Type
Last modified by Achraf El Kari on 2022/06/13 13:17
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} |
2 | {{toc/}} | ||
3 | {{/box}} | ||
4 | |||
![]() |
1.2 | 5 | = Introduction = |
![]() |
1.1 | 6 | |
![]() |
7.1 | 7 | We will go through all endpoints needed to manage the Tracking type entity. |
![]() |
1.1 | 8 | |
![]() |
1.4 | 9 | = Endpoints = |
10 | |||
![]() |
9.2 | 11 | **PS:** __//For all those endpoints, the env params are mandatory on the header, otherwise you got an error 400 (BAD PARAMS).//__ |
![]() |
7.3 | 12 | |
13 | |||
![]() |
9.2 | 14 | |(% style="width:202px" %)**URL [method]**|(% style="width:126px" %)**Description**|(% style="width:250px" %)**Input example**|(% style="width:449px" %)**Output example** |
15 | |(% style="width:202px" %)((( | ||
![]() |
7.2 | 16 | /rest/trackingType [GET] |
17 | |||
18 | |||
19 | hedear : Authorization + env => Mandatory | ||
![]() |
7.4 | 20 | |
![]() |
9.2 | 21 | )))|(% style="width:126px" %)((( |
22 | get **all **tracking Types of the giving environment ==> | ||
![]() |
7.4 | 23 | |
24 | order, orderLine... | ||
![]() |
9.2 | 25 | )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)[[attach:TrackingTypes.json||target="_blank"]] |
![]() |
9.3 | 26 | |(% style="width:202px" %)/rest/trackingType [POST]|(% style="width:126px" %)((( |
27 | Insert or update new TrackingType | ||
28 | |||
29 | |||
![]() |
10.1 | 30 | If the trackingType already exists, then it will be updated. |
31 | |||
32 | |||
33 | **PS1 :** iXPath will take in consideration the environment given at the header while inserting and updating. | ||
34 | |||
35 | |||
36 | **PS2 :** iXPath v3 is case sensitive. | ||
![]() |
9.3 | 37 | )))|(% style="width:250px" %){{code language="json"}}{ |
![]() |
10.1 | 38 | "alias":"order", |
![]() |
9.3 | 39 | "label":{ |
![]() |
9.4 | 40 | "fr":"Commande", |
![]() |
9.3 | 41 | "en":"Order" |
42 | }, | ||
43 | "dataTypes":[ | ||
44 | { | ||
45 | "alias":"orderNumber", | ||
46 | "label":{ | ||
47 | "fr":"Numéro de commande", | ||
48 | "en":"Order Number" | ||
49 | }, | ||
50 | "type":"NUMBER", | ||
51 | "size":10, | ||
52 | "mandatory":true, | ||
53 | "isList":false | ||
54 | }, | ||
55 | { | ||
56 | "alias":"orderLine", | ||
57 | "label":{ | ||
58 | "fr":"Ligne de commande", | ||
59 | "en":"Order Lines" | ||
60 | }, | ||
61 | "type":"TRACKING", | ||
62 | "trackingType":"orderLine", | ||
63 | "mandatory":true, | ||
64 | "isList":false | ||
65 | } | ||
66 | ] | ||
![]() |
9.2 | 67 | }{{/code}}|(% style="width:449px" %){{code language="JSON"}}{ |
![]() |
1.8 | 68 | "timestamp": 1620217014704, |
69 | "status": "200", | ||
70 | "data": [ | ||
71 | { | ||
72 | "date": "Tue May 04 16:37:49 GMT+01:00 2021", | ||
73 | "current": "true", | ||
74 | "author": "person1232", | ||
75 | "id": "11e8707eb50e25c00a62e4efedb5f6071ec7e27e", | ||
76 | "message": "version 2" | ||
77 | }, | ||
78 | { | ||
79 | "date": "Tue May 04 13:28:12 GMT+01:00 2021", | ||
80 | "current": "false", | ||
81 | "author": "person1", | ||
82 | "id": "4b64d02451f47d9cb91d08faa986c941deef0f5c", | ||
83 | "message": "version 1" | ||
84 | } | ||
85 | ] | ||
86 | }{{/code}} | ||
![]() |
9.2 | 87 | |(% style="width:202px" %)/rest/git/commit [POST]|(% style="width:126px" %)commit changes in files with a message|(% style="width:250px" %){{code language="JSON"}}{ |
![]() |
1.10 | 88 | "files": |
89 | [ | ||
90 | {"fileName" : "newFile.xml"}, | ||
91 | {"fileName" : "/dir/modifiedFile.pdf"} | ||
92 | ], | ||
93 | "message": "this is a commit message" | ||
![]() |
1.13 | 94 | }{{/code}}|(% style="width:449px" %)((( |
![]() |
1.10 | 95 | it returns a String with the commit message meaning that the commit has passed successfully. |
![]() |
1.4 | 96 | |
![]() |
1.10 | 97 | eg : |
98 | |||
![]() |
1.11 | 99 | {{code language="JSON"}}{ |
100 | "timestamp": 1620217700570, | ||
101 | "status": "200", | ||
102 | "data": "this is a commit message" | ||
103 | }{{/code}} | ||
![]() |
1.10 | 104 | ))) |
![]() |
9.2 | 105 | |(% style="width:202px" %)((( |
![]() |
1.13 | 106 | /rest/git/switchComit/{id} |
![]() |
1.10 | 107 | |
![]() |
1.13 | 108 | [GET] |
![]() |
9.2 | 109 | )))|(% style="width:126px" %)((( |
![]() |
1.15 | 110 | switch to a certain version and return the history of all commits. |
111 | |||
![]() |
1.26 | 112 | **__NB __**: if there are some modified files in the current version, these files will be moved to a new directory called : |
![]() |
1.16 | 113 | |
114 | .../archive/git-{timestamp} | ||
![]() |
9.2 | 115 | )))|(% style="width:250px" %)((( |
116 | |||
![]() |
1.13 | 117 | |
![]() |
1.17 | 118 | |
![]() |
1.30 | 119 | )))|(% style="width:449px" %)((( |
120 | {{code language="JSON"}} | ||
121 | { | ||
![]() |
1.15 | 122 | "timestamp": 1620217014704, |
123 | "status": "200", | ||
124 | "data": [ | ||
125 | { | ||
126 | "date": "Tue May 04 16:37:49 GMT+01:00 2021", | ||
127 | "current": "false", | ||
128 | "author": "person1232", | ||
129 | "id": "11e8707eb50e25c00a62e4efedb5f6071ec7e27e", | ||
130 | "message": "version 2" | ||
131 | }, | ||
132 | { | ||
133 | "date": "Tue May 04 13:28:12 GMT+01:00 2021", | ||
134 | "current": "true", | ||
135 | "author": "person1", | ||
136 | "id": "4b64d02451f47d9cb91d08faa986c941deef0f5c", | ||
137 | "message": "version 1" | ||
138 | } | ||
139 | ] | ||
![]() |
1.30 | 140 | } |
141 | {{/code}} | ||
142 | ))) | ||
![]() |
9.2 | 143 | |(% style="width:202px" %)/rest/git/update [GET]|(% style="width:126px" %)((( |
![]() |
1.25 | 144 | Integrates and pulls changes from a remote repository into the current branch. |
![]() |
9.2 | 145 | )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)((( |
![]() |
1.26 | 146 | it returns a success message. |
![]() |
1.14 | 147 | |
![]() |
1.26 | 148 | eg : |
149 | |||
150 | {{code language="JSON"}} | ||
151 | { | ||
152 | "timestamp": 1620219625637, | ||
153 | "status": "200", | ||
154 | "data": "branch is now updated" | ||
155 | } | ||
156 | {{/code}} | ||
157 | ))) | ||
![]() |
9.2 | 158 | |(% style="width:202px" %)/rest/environment/init [POST]|(% style="width:126px" %)((( |
![]() |
1.28 | 159 | Clone a git repository into the directory of the current environment, |
![]() |
1.26 | 160 | |
![]() |
1.29 | 161 | if it doesn't exist it creates a new directory and initialize the repo, |
![]() |
1.28 | 162 | |
![]() |
5.4 | 163 | if the directory exists, the endpoint renames the directory and creates a new one and clones the repository. |
![]() |
9.2 | 164 | )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)((( |
![]() |
1.29 | 165 | it returns a "success" message : |
166 | |||
167 | eg : | ||
168 | |||
![]() |
1.30 | 169 | {{code language="JSON"}} |
170 | { | ||
171 | "timestamp": 1620229625932, | ||
172 | "status": "200", | ||
![]() |
5.2 | 173 | "data": "Repository initialized successfully !" |
![]() |
1.30 | 174 | } |
175 | {{/code}} | ||
![]() |
1.29 | 176 | ))) |
![]() |
9.2 | 177 | |(% style="width:202px" %)/rest/git/checkout/{branch} [POST]|(% style="width:126px" %)switch to a certain branch|(% style="width:250px" %)((( |
![]() |
4.1 | 178 | the {branch} must be replaced by the name of the branch destination. |
![]() |
1.29 | 179 | |
![]() |
4.1 | 180 | eg : /rest/git/checkout/master |
181 | |||
182 | /rest/git/checkout/develop | ||
183 | )))|(% style="width:449px" %)((( | ||
184 | it returns a "success" message of checkout branch. | ||
185 | |||
186 | eg : | ||
187 | |||
188 | {{code language="JSON"}} | ||
189 | { | ||
190 | "timestamp": 1620229625932, | ||
191 | "status": "200", | ||
192 | "data": "switched to branch : master" | ||
193 | } | ||
194 | {{/code}} | ||
195 | ))) | ||
![]() |
9.2 | 196 | |(% style="width:202px" %)((( |
![]() |
4.1 | 197 | /rest/git/newbranch/{branch} |
198 | |||
199 | [POST] | ||
![]() |
9.2 | 200 | )))|(% style="width:126px" %)create and switch to a new branch |(% style="width:250px" %)((( |
![]() |
4.1 | 201 | the {branch} must be replaced by the name of the branch destination. |
202 | |||
203 | eg : | ||
204 | |||
205 | /rest/git/checkout/newBranch | ||
206 | )))|(% style="width:449px" %)((( | ||
207 | it returns a "success" message of the branch creation. | ||
208 | |||
209 | eg : | ||
210 | |||
211 | {{code language="JSON"}} | ||
212 | { | ||
213 | "timestamp": 1620229625932, | ||
214 | "status": "200", | ||
215 | "data": "new branch has been created : newBranch" | ||
216 | } | ||
217 | {{/code}} | ||
218 | ))) | ||
![]() |
9.2 | 219 | |(% style="width:202px" %)/rest/git/revert [POST]|(% style="width:126px" %)switch the modified file to the initial head version. |(% style="width:250px" %) |(% style="width:449px" %)((( |
![]() |
5.2 | 220 | it returns a "success" message. |
![]() |
4.1 | 221 | |
![]() |
5.2 | 222 | eg : |
223 | |||
224 | {{code language="JSON"}} | ||
225 | { | ||
226 | "timestamp": 1620229625932, | ||
227 | "status": "200", | ||
228 | "data": "the selected files has been synchronized to HEAD successfully !" | ||
229 | } | ||
230 | {{/code}} | ||
231 | ))) | ||
232 | |||
![]() |
5.1 | 233 | = Errors = |
234 | |||
235 | below, you can find an example of technical and functional errors : | ||
236 | |||
237 | {{code language="JSON"}} | ||
238 | { | ||
239 | "timestamp": 1620221672951, | ||
240 | "status": "500", | ||
241 | "error": "JSON file is not valid", | ||
242 | "thechnicalError": "JSONObject[\"fileName\"] not found." | ||
243 | } | ||
244 | {{/code}} | ||
245 | |||
246 | the functional error is shown with the JSON key "error", while technical error is stored in the "thechnicalError" key. | ||
247 | |||
248 | |||
![]() |
3.1 | 249 | == == |